Browse Source

Cleanup nvim config, add instant.nvim

feat/hibernate-always
Benjamin Bädorf 2 months ago
parent
commit
40dab652fb
Signed by: b12f GPG Key ID: 4406E80E13CD656C
  1. 56
      modules/terminal-life/nvim/default.nix
  2. 1
      modules/terminal-life/nvim/plugins.vim

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

@ -5,6 +5,16 @@ let
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 {
name = "sonokai";
src = pkgs.fetchFromGitHub {
@ -53,28 +63,6 @@ in
withRuby = 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; [
ccls
gopls
@ -104,6 +92,8 @@ in
lsp_extensions-nvim
nvim-lspconfig
instant-nvim
ack-vim
airline
editorconfig-vim
@ -144,4 +134,26 @@ in
vim-vue
yats-vim
];
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)
''
];
}

1
modules/terminal-life/nvim/plugins.vim

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

Loading…
Cancel
Save