dotfiles/nvim/default.nix

134 lines
2.7 KiB
Nix

{ inputs
, lib
, config
, pkgs
, ...
}:
{
programs.neovim =
let
toLua = str: "lua << EOF\n${str}\nEOF\n";
toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n";
in
{
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
extraPackages = with pkgs; [
nodejs_22 # Required for copilot-vim
ripgrep # Required for telescope
wl-clipboard # Required for clipboard sync
# Language servers
clang-tools
lua-language-server
nodePackages.typescript-language-server
typescript
tailwindcss-language-server
gopls
vhdl-ls
nixd
];
plugins = with pkgs.vimPlugins; [
yuck-vim
{
plugin = which-key-nvim;
config = toLua "require('which-key').setup()";
}
neodev-nvim
plenary-nvim
{
plugin = telescope-nvim;
config = toLuaFile ./plugin/telescope.lua;
}
telescope-ui-select-nvim
FTerm-nvim
vim-fugitive
harpoon1
{
plugin = undotree-nvim;
config = toLua "require('undotree').setup()";
}
{
plugin = comment-nvim;
config = toLua "require('Comment').setup()";
}
{
plugin = todo-comments-nvim;
config = toLua "require('todo-comments').setup()";
}
{
plugin = neoconf-nvim;
config = toLua "require('neoconf').setup()";
}
{
plugin = catppuccin-nvim;
config = "colorscheme catppuccin-mocha";
}
cmp-nvim-lsp
cmp-nvim-lsp-signature-help
cmp-buffer
cmp-path
cmp-cmdline
cmp-git
cmp-calc
cmp_luasnip
copilot-cmp
luasnip
friendly-snippets
{
plugin = nvim-cmp;
config = toLuaFile ./plugin/cmp.lua;
}
{
plugin = nvim-lspconfig;
config = toLuaFile ./plugin/lsp.lua;
}
rust-tools-nvim
{
plugin = fidget-nvim;
config = toLua "require('fidget').setup({})";
}
rainbow-delimiters-nvim
{
plugin = (nvim-treesitter.withAllGrammars);
config = toLuaFile ./plugin/treesitter.lua;
}
{
plugin = copilot-lua;
config = toLua ''
require("copilot").setup({
suggestion = { enabled = false },
panel = { enabled = false },
})
'';
}
];
extraLuaConfig = ''
${builtins.readFile ./options.lua}
${builtins.readFile ./keymaps.lua}
'';
};
}