dotfiles/nvim/default.nix

125 lines
2.5 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; [
lua-language-server
rnix-lsp
ripgrep
wl-clipboard
];
plugins = with pkgs.vimPlugins; [
{
plugin = which-key-nvim;
config = toLua "require('which-key').setup()";
}
neodev-nvim
plenary-nvim
telescope-nvim
telescope-ui-select-nvim
FTerm-nvim
neogit
harpoon
{
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
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.withPlugins (p: [
p.tree-sitter-nix
p.tree-sitter-vim
p.tree-sitter-bash
p.tree-sitter-lua
p.tree-sitter-python
p.tree-sitter-json
p.tree-sitter-yaml
p.tree-sitter-rust
p.tree-sitter-javascript
p.tree-sitter-typescript
p.tree-sitter-c
p.tree-sitter-cpp
]));
config = toLuaFile ./plugin/treesitter.lua;
}
];
extraLuaConfig = ''
${builtins.readFile ./options.lua}
${builtins.readFile ./keymaps.lua}
'';
};
}