{ pkgs ? import { }, }: pkgs.vim_configurable.customize { name = "vim-lsp"; vimrcConfig = { packages.myVimPackage.start = with pkgs.vimPlugins; [ vim-nix # File type and syntax highlighting. vim-lsp ]; # vim customRC = '' source ${./vimrc.vim} au BufRead,BufNewFile *.nix setf nix autocmd User lsp_setup call lsp#register_server({ \ 'name': 'nil', \ 'cmd': {server_info->[$NIL_PATH]}, \ 'whitelist': ['nix'], \ }) autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() function! s:on_lsp_buffer_enabled() setlocal omnifunc=lsp#complete setlocal tagfunc=lsp#tagfunc nmap gd (lsp-definition) nmap gr (lsp-references) nmap gs (lsp-document-symbol-search) nmap gS (lsp-workspace-symbol-search) nmap gy (lsp-type-definition) nmap r (lsp-rename) nmap [g (lsp-previous-diagnostic) nmap ]g (lsp-next-diagnostic) nmap (lsp-hover) nnoremap lsp#scroll(+4) nnoremap lsp#scroll(-4) let g:lsp_format_sync_timeout = 1000 autocmd BufWritePre *.nix call execute('LspDocumentFormatSync') endfunction ''; }; }