mirror of
https://git.sr.ht/~roxwize/.dotfiles
synced 2025-05-03 04:03:08 +00:00
~
Signed-off-by: roxwize <rae@roxwize.xyz>
This commit is contained in:
parent
062c447374
commit
c38f040574
21 changed files with 5 additions and 4 deletions
63
nixos/home/neovim.nix
Normal file
63
nixos/home/neovim.nix
Normal file
|
@ -0,0 +1,63 @@
|
|||
{ pkgs, ... }: {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
vimAlias = true;
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
cmp_luasnip
|
||||
cmp-nvim-lsp
|
||||
luasnip
|
||||
nvim-cmp
|
||||
nvim-lspconfig
|
||||
rustaceanvim
|
||||
vim-just
|
||||
vim-sleuth
|
||||
vim-wakatime
|
||||
];
|
||||
extraLuaConfig = ''
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
|
||||
vim.opt.number = true
|
||||
|
||||
-- cmp
|
||||
local cmp = require("cmp")
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
mapping = {
|
||||
['<C-up>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-down>'] = 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.nil_ls.setup {
|
||||
autostart = true,
|
||||
capabilities = caps,
|
||||
cmd = { "nil" }
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue