rice/programs/nvim.nix

122 lines
3.1 KiB
Nix
Raw Normal View History

2022-08-14 00:01:29 +00:00
{
lib,
pkgs,
...
2022-08-16 19:14:35 +00:00
} @ inputs: {
2022-07-22 20:42:05 +00:00
home-manager.users.buffet = {
home.sessionVariables = {
EDITOR = "nvim";
};
# TODO: keybinds
# TODO: looks
# TODO: options
programs.neovim = {
enable = true;
2022-08-16 19:14:35 +00:00
plugins = let
buildPlugin = name:
pkgs.vimUtils.buildNeovimPluginFrom2Nix {
inherit name;
src = inputs."${name}";
};
buildPlugins = names: lib.attrsets.genAttrs names buildPlugin;
plugins = buildPlugins ["lsp-trouble"];
in
with pkgs.vimPlugins;
with plugins; [
{plugin = editorconfig-nvim;}
{plugin = fugitive;}
{plugin = lsp-trouble;}
{plugin = nvim-autopairs;}
{plugin = rust-vim;}
{plugin = tabular;}
{plugin = vim-nix;}
{plugin = vim-repeat;}
2022-07-22 20:42:05 +00:00
2022-08-16 19:14:35 +00:00
{
plugin = gitsigns-nvim;
config = "lua require 'gitsigns'.setup()";
}
2022-07-22 20:42:05 +00:00
2022-08-16 19:14:35 +00:00
# TODO: replace with own bar
{
plugin = lightline-vim;
config = "let g:lightline = { 'colorscheme': 'solarized' }";
}
2022-07-22 20:42:05 +00:00
2022-08-16 19:14:35 +00:00
{
plugin = lspsaga-nvim;
2022-08-16 21:06:39 +00:00
config = "lua require 'lspsaga'.init_lsp_saga()";
2022-08-16 19:14:35 +00:00
}
2022-07-22 20:42:05 +00:00
2022-08-16 19:14:35 +00:00
{
plugin = NeoSolarized;
config = ''
set background=light
colorscheme NeoSolarized
'';
}
2022-07-22 20:42:05 +00:00
2022-08-16 19:14:35 +00:00
{
plugin = nvim-lspconfig;
2022-08-16 21:06:39 +00:00
config = let
configure = srv: "lua require 'lspconfig'.${srv}.setup {}";
servers = [
"clangd"
"rust_analyzer"
];
in
lib.strings.concatStringsSep "\n" (builtins.map configure servers);
2022-08-16 19:14:35 +00:00
}
2022-07-22 20:42:05 +00:00
2022-08-16 19:14:35 +00:00
{
plugin = telescope-nvim;
# TODO: telescope-nvim config
}
2022-07-22 20:42:05 +00:00
2022-08-16 19:14:35 +00:00
{
plugin = nvim-treesitter.withPlugins (plugins:
with plugins; [
tree-sitter-bash
tree-sitter-bibtex
tree-sitter-c
tree-sitter-cmake
tree-sitter-comment
tree-sitter-cpp
tree-sitter-css
tree-sitter-devicetree
tree-sitter-dockerfile
tree-sitter-fennel
tree-sitter-go
tree-sitter-javascript
tree-sitter-json
tree-sitter-latex
tree-sitter-lua
tree-sitter-make
tree-sitter-markdown
tree-sitter-nix
tree-sitter-perl
tree-sitter-python
tree-sitter-regex
tree-sitter-rust
tree-sitter-toml
]);
2022-08-16 20:10:01 +00:00
config = builtins.replaceStrings ["\n"] [""] ''
2022-08-16 19:14:35 +00:00
lua require 'nvim-treesitter.configs'.setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
}
2022-08-16 20:10:01 +00:00
'';
2022-08-16 19:14:35 +00:00
}
2022-08-16 20:11:38 +00:00
{
plugin = vimwiki;
# TODO: vimwiki config
}
2022-08-16 19:14:35 +00:00
];
2022-07-22 20:42:05 +00:00
};
};
}