summaryrefslogtreecommitdiff
path: root/nvim/init.lua
blob: 9547184bad850c7c00de35c51a9096ffdd38fcad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require("config.lazy")
vim.o.background = "dark"
vim.o.tabstop = 4
vim.o.shiftwidth = 4
vim.o.ignorecase = true
vim.o.number = true
vim.cmd([[colorscheme gruvbox]])

vim.keymap.set('n', 'gl', vim.diagnostic.open_float, { noremap = true, silent = true })
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { noremap = true, silent = true })
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, { noremap = true, silent = true })
vim.diagnostic.config({
  virtual_text = true,
})

-- TODO move this to a separate LSP config
vim.lsp.enable('clangd')
vim.api.nvim_create_autocmd("BufWritePre", {
  pattern = { "*.c", "*.cpp", "*.h", "*.hpp" },
  callback = function()
    vim.lsp.buf.format({ async = false })
  end,
})