-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
67 lines (54 loc) · 1.92 KB
/
init.lua
File metadata and controls
67 lines (54 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
--Imports
require("config.lazy")
require("config.colorscheme")
require("config.lualine")
-- Basic Neovim configuration
-- Enable line numbers
vim.opt.number = true
vim.opt.relativenumber = true
-- Set tab width to 2 spaces
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
-- Set clipboard to use system clipboard
vim.opt.clipboard = "unnamedplus"
vim.keymap.set("n", "<A-j>", ":m .+1<CR>==")
vim.keymap.set("n", "<A-k>", ":m .-2<CR>==")
vim.keymap.set("v", "<A-j>", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "<A-k>", ":m '<-2<CR>gv=gv")
-- Enable syntax highlighting
vim.opt.syntax = "on"
-- Show a notification message that confirms the config is loaded
vim.api.nvim_exec([[
augroup ConfigMessage
autocmd!
autocmd VimEnter * echom "Neovim configuration loaded successfully!"
augroup END
]], false)
-- Add a keyboard shortcut (F5) to confirm the config is working
vim.api.nvim_set_keymap('n', '<F5>', ':echo "Config test: Keyboard shortcut is working!"<CR>', {noremap = true})
--print("init.lua loaded! Press F5 to test keyboard shortcut.")
if vim.g.vscode then
vim.api.nvim_exec([[
" THEME CHANGER
function! SetCursorLineNrColorInsert(mode)
" Insert mode: blue
if a:mode == "i"
call VSCodeNotify('nvim-theme.insert')
" Replace mode: red
elseif a:mode == "r"
call VSCodeNotify('nvim-theme.replace')
endif
endfunction
augroup CursorLineNrColorSwap
autocmd!
autocmd ModeChanged *:[vV\x16]* call VSCodeNotify('nvim-theme.visual')
autocmd ModeChanged *:[R]* call VSCodeNotify('nvim-theme.replace')
autocmd InsertEnter * call SetCursorLineNrColorInsert(v:insertmode)
autocmd InsertLeave * call VSCodeNotify('nvim-theme.normal')
autocmd CursorHold * call VSCodeNotify('nvim-theme.normal')
autocmd ModeChanged [vV\x16]*:* call VSCodeNotify('nvim-theme.normal')
augroup END
]], false)
else
end