os/modules/terminal-life/nvim/default.nix

192 lines
4.4 KiB
Nix
Raw Normal View History

2021-05-30 19:10:28 +00:00
{ config, pkgs, ... }:
let
psCfg = config.pub-solar;
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
preview-file = pkgs.writeShellScriptBin "preview-file" (import ./preview-file.nix pkgs);
vimagit-master = pkgs.vimUtils.buildVimPlugin {
name = "vimagit-master";
src = pkgs.fetchFromGitHub {
owner = "jreybert";
repo = "vimagit";
rev = "308650ddc1e9a94e49fae0ea04bbc1c45f23d4c4";
sha256 = "sha256-fhazQQqyFaO0fdoeNI9nBshwTDhKNHH262H/QThtuO0=";
};
};
2021-12-02 11:19:37 +00:00
instant-nvim = pkgs.vimUtils.buildVimPlugin {
name = "instant";
src = pkgs.fetchFromGitHub {
owner = "jbyuki";
repo = "instant.nvim";
rev = "c02d72267b12130609b7ad39b76cf7f4a3bc9554";
sha256 = "sha256-7Pr2Au/oGKp5kMXuLsQY4BK5Wny9L1EBdXtyS5EaZPI=";
};
};
vim-caddyfile = pkgs.vimUtils.buildVimPlugin {
name = "vim-caddyfile";
src = pkgs.fetchFromGitHub {
owner = "isobit";
repo = "vim-caddyfile";
rev = "24fe0720551883e407cb70ae1d7c03f162d1d5a0";
sha256 = "sha256-rRYv3vnt31g7hNTxttTD6BWdv5JJ+ko3rPNyDUEOZ9o=";
};
};
2021-05-30 19:10:28 +00:00
workspace = pkgs.vimUtils.buildVimPlugin {
name = "vim-workspace";
src = pkgs.fetchFromGitHub {
owner = "thaerkh";
repo = "vim-workspace";
rev = "c26b473f9b073f24bacecd38477f44c5cd1f5a62";
sha256 = "sha256-XV7opLyfkHIDO0+JJaO/x0za0gsHuklrzapTGdLHJmI=";
2021-05-30 19:10:28 +00:00
};
};
2021-05-30 19:10:28 +00:00
beautify = pkgs.vimUtils.buildVimPlugin {
name = "vim-beautify";
src = pkgs.fetchFromGitHub {
owner = "zeekay";
repo = "vim-beautify";
rev = "e0691483927dc5a0c051433602397419f9628623";
sha256 = "QPTCl6KaGcAjTS5yVDov9yxmv0fDaFoPLMsrtVIG6GQ=";
};
};
2021-06-28 15:52:55 +00:00
vim-mdx-js = pkgs.vimUtils.buildVimPlugin {
name = "vim-mdx-js";
src = pkgs.fetchFromGitHub {
owner = "jxnblk";
repo = "vim-mdx-js";
rev = "17179d7f2a73172af5f9a8d65b01a3acf12ddd50";
sha256 = "wfYCvw9JVGG8p8PQhRPT6CeGGf2OVz9SR2KQM0LjQhY=";
};
};
2022-04-10 12:02:28 +00:00
apprentice = pkgs.vimUtils.buildVimPlugin {
name = "vim-apprentice";
src = pkgs.fetchFromGitHub {
owner = "romainl";
repo = "Apprentice";
rev = "ecd41698037f15a58125b349be76dbd2595bfb6d";
sha256 = "sha256-9s7Yzn3IEJBjcyUq9NBIQ9wb45Xr7jOkEIoWf0lAYYg=";
};
};
2021-05-30 19:10:28 +00:00
in
{
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
withRuby = true;
withPython3 = true;
extraPackages = with pkgs; [
ccls
gopls
nodejs
2021-05-30 19:10:28 +00:00
nodePackages.bash-language-server
nodePackages.dockerfile-language-server-nodejs
nodePackages.svelte-language-server
nodePackages.typescript
nodePackages.typescript-language-server
2021-05-30 19:10:28 +00:00
nodePackages.vim-language-server
nodePackages.vue-language-server
2022-04-18 11:12:02 +00:00
nodePackages.vscode-langservers-extracted
nodePackages.yaml-language-server
2022-04-18 11:12:02 +00:00
vscode-extensions.angular.ng-template
2022-01-05 21:56:03 +00:00
python39Packages.python-lsp-server
python3Full
2021-05-30 19:10:28 +00:00
solargraph
rnix-lsp
rust-analyzer
2021-05-30 19:10:28 +00:00
terraform-ls
];
plugins = with pkgs.vimPlugins; [
2022-01-05 21:56:03 +00:00
nvim-cmp
cmp-nvim-lsp
cmp_luasnip
luasnip
lsp_extensions-nvim
nvim-lspconfig
2021-05-30 19:10:28 +00:00
2021-12-02 11:19:37 +00:00
instant-nvim
2021-05-30 19:10:28 +00:00
ack-vim
2022-04-03 16:34:46 +00:00
vim-airline
2021-05-30 19:10:28 +00:00
editorconfig-vim
nnn-vim
2022-03-15 16:20:25 +00:00
quick-scope
suda-vim
syntastic
vim-vinegar
workspace
2021-05-30 19:10:28 +00:00
sonokai
vim-hybrid-material
vim-airline-themes
apprentice
2021-05-30 19:10:28 +00:00
fugitive
vim-gitgutter
vim-rhubarb
vimagit-master
2021-05-30 19:10:28 +00:00
fzf-vim
fzfWrapper
vim-highlightedyank
2021-05-30 19:10:28 +00:00
beautify
vim-surround
vim-bufkill
vim-sensible
2021-05-30 19:10:28 +00:00
ansible-vim
emmet-vim
rust-vim
vim-caddyfile
2021-05-30 19:10:28 +00:00
vim-go
vim-javascript
vim-json
2022-04-18 11:12:02 +00:00
SchemaStore-nvim
2021-05-30 19:10:28 +00:00
vim-markdown
vim-nix
2022-08-02 13:31:27 +00:00
vim-nixhash
2021-05-30 19:10:28 +00:00
vim-ruby
vim-toml
vim-vue
yats-vim
2021-06-28 15:52:55 +00:00
vim-mdx-js
2021-05-30 19:10:28 +00:00
];
2021-12-02 11:19:37 +00:00
extraConfig = builtins.concatStringsSep "\n" [
''
" Persistent undo
set undofile
set undodir=${xdg.cacheHome}/nvim/undo
set backupdir=${xdg.dataHome}/nvim/backup
set directory=${xdg.dataHome}/nvim/swap/
''
(builtins.readFile ./init.vim)
(builtins.readFile ./plugins.vim)
(builtins.readFile ./clipboard.vim)
(builtins.readFile ./ui.vim)
(builtins.readFile ./quickfixopenall.vim)
(builtins.readFile ./lsp.vim)
''
" fzf with file preview
command! -bang -nargs=? -complete=dir Files
\ call fzf#vim#files(<q-args>, { 'options': ['--keep-right', '--cycle', '--layout', 'reverse', '--preview', '${preview-file}/bin/preview-file {}'] }, <bang>0)
''
];
2021-05-30 19:10:28 +00:00
}