Testing Neovim config

Author Mitja Felicijan <mitja.felicijan@gmail.com> 2026-05-21 06:29:59 +0200
Committer Mitja Felicijan <mitja.felicijan@gmail.com> 2026-05-21 07:10:49 +0200
Commit f5e5d186a5e4a1ed397f4ad21bef4bdd81bac06b (patch)
-rw-r--r-- .config/nvim/init.lua 65
-rw-r--r-- .gitignore 1
2 files changed, 66 insertions, 0 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
  
1
vim.opt.winborder = "double"
  
2
vim.opt.tabstop = 4
  
3
vim.opt.shiftwidth = 4
  
4
vim.opt.signcolumn = "yes"
  
5
vim.opt.wrap = false
  
6
vim.opt.ignorecase = true
  
7
vim.opt.smartindent = true
  
8
vim.opt.termguicolors = true
  
9
vim.opt.undofile = true
  
10
vim.opt.number = true
  
11
vim.opt.cursorline = true
  
12
vim.opt.mouse = ""
  
13
vim.opt.guicursor = ""
  
14
vim.opt.clipboard = "unnamedplus"
  
15
vim.opt.completeopt = { "menu", "menuone", "popup", "noselect", "noinsert" }
  
16
  
  
17
vim.keymap.set("n", "<C-Left>",  ":bprevious<CR>")
  
18
vim.keymap.set("n", "<C-Right>", ":bnext<CR>")
  
19
vim.keymap.set("n", "<Leader>d", ":bd!<CR>")
  
20
vim.keymap.set("n", "<Leader>x", ":Ex .<CR>")
  
21
vim.keymap.set("n", "<Leader>f", ":find ")
  
22
vim.keymap.set("n", "<Leader>b", ":b ")
  
23
vim.keymap.set("n", "<Leader>q", ":nohlsearch<CR>")
  
24
vim.keymap.set("n", "<leader>w", ":silent! grep! <cword> | cwindow | redraw!<CR>")
  
25
  
  
26
vim.api.nvim_set_hl(0, "Normal", { bg = "#000000" })
  
27
vim.api.nvim_set_hl(0, "CursorLine", { bg = "#222222" })
  
28
vim.api.nvim_set_hl(0, "Keyword", { fg = "#ffcc66" })
  
29
vim.api.nvim_set_hl(0, "Statement", { fg = "#ffcc66" })
  
30
vim.api.nvim_set_hl(0, "Type", { fg = "#66ccff" })
  
31
vim.api.nvim_set_hl(0, "Number", { fg = "#ff9966" })
  
32
vim.api.nvim_set_hl(0, "Float", { fg = "#ff9966" })
  
33
vim.api.nvim_set_hl(0, "Boolean", { fg = "#ff9966" })
  
34
  
  
35
vim.api.nvim_create_autocmd("FileType", {
  
36
	callback = function()
  
37
		vim.opt_local.path = ".,**"
  
38
	end,
  
39
})
  
40
  
  
41
vim.lsp.config("clang", {
  
42
	cmd = { "clangd" },
  
43
	filetype = { ".c", ".h" },
  
44
	root_markers = { ".clangd", ".git", },
  
45
})
  
46
  
  
47
vim.lsp.config("gopls", {
  
48
	cmd = { "gopls" },
  
49
	filetypes = { "go", "gomod", "gowork", "gotmpl" },
  
50
})
  
51
  
  
52
vim.lsp.enable({ "clangd", "gopls" })
  
53
  
  
54
vim.api.nvim_create_autocmd("LspAttach", {
  
55
	callback = function(event)
  
56
		local opts = { buffer = event.buf }
  
57
		vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
  
58
		vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
  
59
		vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
  
60
		vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
  
61
		vim.keymap.set("n", "<C-q>", vim.diagnostic.setloclist, opts)
  
62
		vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
  
63
		vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
  
64
	end,
  
65
})
diff --git a/.gitignore b/.gitignore
  
1
*.json