nixos-config/home/editors/neovim/default.nix

108 lines
2.9 KiB
Nix
Raw Normal View History

2019-10-19 12:55:35 +02:00
{ config, pkgs, ... }:
2019-12-12 15:42:12 +01:00
let
neovim-unwrapped = pkgs.neovim-unwrapped.overrideAttrs (oldAttrs: rec {
2021-04-13 15:15:09 +02:00
version = "2021-04-13";
src = pkgs.fetchFromGitHub {
owner = "neovim";
repo = "neovim";
2021-04-13 15:15:09 +02:00
rev = "c9817603cff5a5ca7ef4e4c12c8bf0e16d859e9a";
sha256 = "10ynpvrdm7sdkvmv96rgk0a6xa7489v65pxshml99vd4h7x8cfzl";
};
2020-11-22 10:58:19 +01:00
nativeBuildInputs = oldAttrs.nativeBuildInputs
++ [ pkgs.utf8proc pkgs.tree-sitter ];
});
2019-12-12 15:42:12 +01:00
buildVimPluginFrom2Nix = pkgs.vimUtils.buildVimPluginFrom2Nix;
nvim-ts-autotag = buildVimPluginFrom2Nix {
pname = "nvim-ts-autotag";
2021-04-13 15:15:09 +02:00
version = "2021-03-26";
src = pkgs.fetchFromGitHub {
owner = "windwp";
repo = "nvim-ts-autotag";
2021-04-13 15:15:09 +02:00
rev = "00b79b593af52585809e341c8dd1b7d839b3c466";
sha256 = "0a17jp6xn9vb8f205ivsw1fx1bapg6l5ywl1miacc06py459c7ch";
};
};
nvim-ts-context-commentstring = buildVimPluginFrom2Nix {
pname = "nvim-ts-context-commentstring";
version = "2021-04-06";
src = pkgs.fetchFromGitHub {
owner = "JoosepAlviste";
repo = "nvim-ts-context-commentstring";
rev = "5024c83e92c3988f6e7119bfa1b2347ae3a42c3e";
sha256 = "13k7gwbrkbxjb3bf98zv6b64qqlas8z8xr9hxlr5l5hwmz5gw83i";
};
};
2020-09-26 23:54:07 +02:00
vimLua = lua: ''
lua << EOF
${lua}
EOF
'';
in {
2021-03-04 20:03:38 +01:00
home.packages = with pkgs; [
gcc # required for nvim-treesitter
2021-04-13 15:15:09 +02:00
tree-sitter
2021-03-04 20:03:38 +01:00
graphviz
];
2020-09-26 23:54:07 +02:00
2019-10-19 12:55:35 +02:00
programs.neovim = {
enable = true;
package = neovim-unwrapped;
2019-10-19 12:55:35 +02:00
viAlias = true;
vimAlias = true;
plugins = with pkgs.vimPlugins; [
2021-03-26 03:32:40 +01:00
nvcode-color-schemes-vim
2019-12-12 15:42:12 +01:00
editorconfig-vim
2020-03-18 11:26:16 +01:00
direnv-vim
2019-12-12 15:42:12 +01:00
fzf-vim
lightline-vim
nerdtree
2020-01-23 13:18:11 +01:00
vim-startify
2020-10-03 16:52:45 +02:00
vim-visual-multi
2019-12-12 15:42:12 +01:00
vim-surround
vim-commentary
vim-easymotion
2020-06-18 16:22:24 +02:00
vim-which-key
2020-01-23 13:18:11 +01:00
vim-fugitive
2021-04-13 15:15:09 +02:00
registers-nvim
plenary-nvim
gitsigns-nvim
2020-03-04 19:03:00 +01:00
vim-test
2020-11-28 16:21:07 +01:00
auto-pairs
2019-12-12 15:42:12 +01:00
camelcasemotion
2020-09-23 09:36:25 +02:00
wmgraphviz-vim
2021-04-13 15:15:09 +02:00
nvim-compe
2019-12-12 15:42:12 +01:00
2021-03-04 20:03:38 +01:00
# use :TSInstall & :TSUpdate to manage parsers
nvim-treesitter
2021-04-13 15:15:09 +02:00
# TODO https://github.com/NixOS/nixpkgs/pull/115445
# nvim-treesitter.withPlugins (builtins.attrValues pkgs.tree-sitter.builtGrammars)
2021-03-04 20:03:38 +01:00
nvim-treesitter-context
nvim-treesitter-refactor
nvim-treesitter-textobjects
nvim-ts-autotag
2021-04-13 15:15:09 +02:00
nvim-ts-context-commentstring
2021-03-04 20:03:38 +01:00
2020-10-03 16:52:45 +02:00
nvim-lspconfig
2021-03-04 14:48:23 +01:00
# nvim-dap
2020-08-27 13:33:29 +02:00
2019-12-12 15:42:12 +01:00
vim-orgmode
2019-10-19 12:55:35 +02:00
];
2020-06-18 16:22:24 +02:00
extraConfig = with builtins;
2021-03-04 14:48:23 +01:00
readFile ./init.vim # + readFile ./vim-surround-fix.vim
+ readFile ./which-key.vim + readFile ./test.vim
+ vimLua (readFile ./gitsigns.lua)
2020-11-22 10:58:19 +01:00
+ vimLua (readFile ./lsp/extensions.lua) + readFile ./lsp/lsp.vim
2021-03-04 20:03:38 +01:00
+ vimLua (readFile ./lsp/lsp.lua) + vimLua (readFile ./treesitter.lua);
2021-04-13 15:15:09 +02:00
withNodeJs = false;
2020-08-27 13:33:29 +02:00
withPython = false;
2019-10-19 12:55:35 +02:00
};
2020-10-20 15:47:53 +02:00
2021-03-04 20:03:38 +01:00
xdg.configFile."nvim/filetype.vim".source = ./filetype.vim;
2020-10-20 15:47:53 +02:00
xdg.configFile."nvim/scripts.vim".source = ./scripts.vim;
2019-10-19 12:55:35 +02:00
}