1
0
Fork 0
mirror of https://git.sr.ht/~roxwize/.dotfiles synced 2025-01-31 07:03:36 +00:00
.dotfiles/nixos/home/neovim.nix

64 lines
1.9 KiB
Nix
Raw Normal View History

2024-12-20 03:52:48 +00:00
{ pkgs, ... }: {
programs.neovim = {
enable = true;
defaultEditor = true;
vimAlias = true;
plugins = with pkgs.vimPlugins; [
2024-12-20 19:37:27 +00:00
cmp_luasnip
2024-12-20 19:52:09 +00:00
cmp-nvim-lsp
2024-12-20 19:37:27 +00:00
luasnip
nvim-cmp
nvim-lspconfig
2024-12-20 20:16:38 +00:00
rustaceanvim
2024-12-20 03:52:48 +00:00
vim-just
vim-sleuth
vim-wakatime
];
extraLuaConfig = ''
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
2024-12-20 20:01:00 +00:00
vim.opt.number = true
2024-12-20 19:49:21 +00:00
-- cmp
local cmp = require("cmp")
cmp.setup {
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end
},
mapping = {
2024-12-20 20:01:00 +00:00
['<C-up>'] = cmp.mapping.select_prev_item(),
['<C-down>'] = cmp.mapping.select_next_item(),
2024-12-20 19:49:21 +00:00
['<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")
2024-12-20 19:53:08 +00:00
lc.nil_ls.setup {
2024-12-20 19:49:21 +00:00
autostart = true,
capabilities = caps,
cmd = { "nil" }
}
2024-12-20 03:52:48 +00:00
'';
};
}