Cleanup nvim config, add instant.nvim

This commit is contained in:
Benjamin Bädorf 2021-12-02 12:19:37 +01:00
parent 0b61f2808e
commit 7069fb2a62
No known key found for this signature in database
GPG key ID: 4406E80E13CD656C
2 changed files with 35 additions and 22 deletions

View file

@ -5,6 +5,16 @@ let
preview-file = pkgs.writeShellScriptBin "preview-file" (import ./preview-file.nix pkgs); preview-file = pkgs.writeShellScriptBin "preview-file" (import ./preview-file.nix pkgs);
instant-nvim = pkgs.vimUtils.buildVimPlugin {
name = "instant";
src = pkgs.fetchFromGitHub {
owner = "jbyuki";
repo = "instant.nvim";
rev = "c02d72267b12130609b7ad39b76cf7f4a3bc9554";
sha256 = "sha256-7Pr2Au/oGKp5kMXuLsQY4BK5Wny9L1EBdXtyS5EaZPI=";
};
};
sonokai = pkgs.vimUtils.buildVimPlugin { sonokai = pkgs.vimUtils.buildVimPlugin {
name = "sonokai"; name = "sonokai";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
@ -62,28 +72,6 @@ in
withRuby = true; withRuby = true;
withPython3 = true; withPython3 = true;
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)
''
];
extraPackages = with pkgs; [ extraPackages = with pkgs; [
ccls ccls
gopls gopls
@ -113,6 +101,8 @@ in
lsp_extensions-nvim lsp_extensions-nvim
nvim-lspconfig nvim-lspconfig
instant-nvim
ack-vim ack-vim
airline airline
editorconfig-vim editorconfig-vim
@ -154,4 +144,26 @@ in
yats-vim yats-vim
vim-mdx-js vim-mdx-js
]; ];
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)
''
];
} }

View file

@ -73,3 +73,4 @@ let g:user_emmet_leader_key='<c-n>'
if executable('ag') if executable('ag')
let g:ackprg = 'ag --vimgrep' let g:ackprg = 'ag --vimgrep'
endif endif