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

93 lines
2.3 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 {
version = "2021-03-12";
src = pkgs.fetchFromGitHub {
owner = "neovim";
repo = "neovim";
rev = "dc8273f2f1e615cac5cee86709ca4ae6dbd70edf";
sha256 = "0xqvgdp7qvzd8jfy7s6kkr6n6bs7khg8n65vh7r1pp7xqawx4aiz";
};
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;
# TODO doesn't seem to work in tsx atm
nvim-ts-autotag = buildVimPluginFrom2Nix {
pname = "nvim-ts-autotag";
version = "2021-03-11";
src = pkgs.fetchFromGitHub {
owner = "windwp";
repo = "nvim-ts-autotag";
rev = "50410bf1d3f7519ac433b4027486a9fe3273049b";
sha256 = "0i7q31fn8llrxcbb5y79wanb03cj7fv02d0n8f7fa4y3cydxiiyl";
};
};
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
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-03-04 19:03:00 +01:00
vim-peekaboo
2019-12-17 18:22:42 +01:00
vim-gitgutter
2020-01-23 13:18:11 +01:00
vim-fugitive
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
2019-12-12 15:42:12 +01:00
2021-03-04 20:03:38 +01:00
# use :TSInstall & :TSUpdate to manage parsers
nvim-treesitter
nvim-treesitter-context
nvim-treesitter-refactor
nvim-treesitter-textobjects
nvim-ts-autotag
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
2020-12-25 12:01:10 +01:00
completion-nvim
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
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);
2020-02-13 18:52:52 +01:00
withNodeJs = true;
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
}