1
0
Fork 0
mirror of https://git.sr.ht/~roxwize/.dotfiles synced 2025-02-07 09:52:50 +00:00
This commit is contained in:
Rae 5e 2024-12-20 14:49:21 -05:00
parent 447ca1d457
commit 0872cf4d03

View file

@ -13,12 +13,47 @@
vim-wakatime vim-wakatime
]; ];
extraLuaConfig = '' extraLuaConfig = ''
require("./lsp.lua")
vim.opt.tabstop = 4 vim.opt.tabstop = 4
vim.opt.softtabstop = 4 vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4 vim.opt.shiftwidth = 4
vim.opt.expandtab = true vim.opt.expandtab = true
-- cmp
local cmp = require("cmp")
cmp.setup {
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end
},
mapping = {
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<tab>'] = cmp.mapping.confirm { select = true }
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" }
})
}
local caps = vim.tbl_deep_extend(
"force",
vim.lsp.protocol.make_client_capabilities(),
require("cmp_nvim_lsp").default_capabilities(),
{ workspace = { didChangeWatchedFiles = { dynamicRegistration = true } } }
)
-- lspconfig
local lc = require("lspconfig")
lc.nix_nil.setup {
autostart = true,
capabilities = caps,
cmd = { "nil" }
}
''; '';
}; };
} }