{ pkgs, ... }: let leader = ''","''; my-fzf-vim = with pkgs.vimPlugins; { plugin = fzf-vim; config = '' let mapleader = ${leader} nnoremap ff :Files nnoremap fb :Buffers nnoremap fw :Windows nnoremap fl :Lines nnoremap fm :Marks nnoremap fc :Commands nnoremap fr :Rg nnoremap fk :Maps ''; }; my-neovim-sensible = with pkgs.vimPlugins; { plugin = neovim-sensible; config = '' let mapleader = ${leader} nnoremap bd :bdelete ''; }; my-gruvbox = with pkgs.vimPlugins; { plugin = gruvbox; config = '' colorscheme gruvbox ''; }; emptyString = "''"; myLightline = with pkgs.vimPlugins; { plugin = lightline-vim; config = '' function! StatusDiagnostic() abort let info = get(b:, 'coc_diagnostic_info', {}) if empty(info) | return ${emptyString} | endif let msgs = [] if get(info, 'error', 0) call add(msgs, ' ' . info['error']) endif if get(info, 'warning', 0) call add(msgs, ' ' . info['warning']) endif return join(msgs, ' ') . ' ' . get(g:, 'coc_status', ${emptyString}) endfunction " Hide modes in status line, since lightline shows them set noshowmode let g:lightline = { \ 'colorscheme': 'gruvbox', \ 'active': { \ 'left': [ [ 'mode', 'paste' ], \ [ 'cocstatus', 'readonly', 'filename', 'modified' ] ] \ }, \ 'component_function': { \ 'cocstatus': 'StatusDiagnostic' \ }, \ } ''; }; myConfiguration = builtins.concatStringsSep "\n" (map (pair: pair.config) [ my-fzf-vim my-gruvbox my-neovim-sensible myLightline ]); additionalPackages = map (pair: pair.plugin) [ my-fzf-vim my-gruvbox my-neovim-sensible myLightline ]; in { programs.neovim = { enable = true; defaultEditor = true; configure = { customRC = myConfiguration; packages.myVimPackage = with pkgs.vimPlugins; { start = [ vim-lastplace vim-nix vim-unimpaired ] ++ additionalPackages; }; }; viAlias = true; vimAlias = true; }; environment.systemPackages = with pkgs; [ ripgrep ]; }