Guest User

nix vim

a guest
Jun 5th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. { pkgs ? import <nixpkgs> {}, lib ? pkgs.lib, ... }:
  2.  
  3. with pkgs;
  4.  
  5. let
  6. pythonBundle = python3Full.withPackages(ps: with ps; [
  7. python-language-server
  8. pyls-mypy pyls-isort pyls-black
  9. # add your python libraries here
  10. ]);
  11. myvim = (vim_configurable.customize {
  12. # This is taken from the NixOS Wiki
  13. # Add and modify your config here
  14. # you can also use lib.fileContents to load from an existing file
  15. name = "vim-with-plugins";
  16. vimrcConfig = {
  17. customRC = ''
  18. let g:LanguageClient_serverCommands = {
  19. \ 'python': ['pyls']
  20. \ }
  21. nnoremap <F5> :call LanguageClient_contextMenu()<CR>
  22. nnoremap <silent> gh :call LanguageClient_textDocument_hover()<CR>
  23. nnoremap <silent> gd :call LanguageClient_textDocument_definition()<CR>
  24. nnoremap <silent> gr :call LanguageClient_textDocument_references()<CR>
  25. nnoremap <silent> gs :call LanguageClient_textDocument_documentSymbol()<CR>
  26. nnoremap <silent> <F2> :call LanguageClient_textDocument_rename()<CR>
  27. nnoremap <silent> gf :call LanguageClient_textDocument_formatting()<CR>
  28. '';
  29. packages.myVimPackage = with pkgs.vimPlugins; {
  30. start = [ LanguageClient-neovim ];
  31. };
  32. };
  33. }); in myvim.overrideAttrs (oldAttrs: rec { python = pythonBundle; })
Advertisement
Add Comment
Please, Sign In to add comment