~kaction/config

b2ccfe88c38ce7ed603694bcd7df44db84f42bd3 — Dmitry Bogatov 5 months ago 62166a2 lsp
vim: configure LSP

Configure Language-Server-Protocol support for Vim and install servers
for languages I write in:

	'c': ['ccls'],
	'python': ['pyls'],
	'dhall': ['dhall-lsp-server'],
	'tex': ['texlab'],
	'go': ['gopls'],
	'nix': ['rnix-lsp'],
	'haskell': ['haskell-language-server-wrapper', '--lsp'],

Usefulness and support level, well, vary. Unfortunately, this change
requires giving up on purging of coreutils, since they are embedded deep
somewhere in clang and captured from stdenv.Purging them would require
rebuiling clang at best and stdenv at worst.
M nixpkgs/overlays.d/config.d/vim/default.nix => nixpkgs/overlays.d/config.d/vim/default.nix +1 -0
@@ 38,6 38,7 @@ in buildEnv {
      dhall-vim
      agda-vim
      vim-nginx
      LanguageClient-neovim
      vim-gemini
      purescript-vim
      vim-snipmate

M nixpkgs/overlays.d/config.d/vim/vim/share/vim/vim82/vimrc => nixpkgs/overlays.d/config.d/vim/vim/share/vim/vim82/vimrc +20 -0
@@ 92,3 92,23 @@ smap <S-Tab> <Plug>snipMateBack

imap <C-s> <Plug>snipMateShow
let g:snipMate = { 'snippet_version': 1 }
let g:LanguageClient_serverCommands = {
  \ 'c': ['ccls'],
  \ 'python': ['pyls'],
  \ 'dhall': ['dhall-lsp-server'],
  \ 'tex': ['texlab'],
  \ 'go': ['gopls'],
  \ 'nix': ['rnix-lsp'],
  \ 'haskell': ['haskell-language-server-wrapper', '--lsp']
  \ }
nmap <silent> K  <Plug>(lcn-hover)
nmap <silent> gd <Plug>(lcn-definition)
nmap <silent> gr <Plug>(lcn-rename)
nmap <silent> g? <Plug>(lcn-references)
nmap <silent> gl <Plug>(lcn-symbols)
nmap <silent> g= <Plug>(lcn-format)
nmap <silent> g. <Plug>(lcn-explain-error)
nmap <silent> g' <Plug>(lcn-code-action)
nmap <silent> g; <Plug>(lcn-code-lens-action)
set completefunc=LanguageClient#complete
set formatexpr=LanguageClient#textDocument_rangeFormatting_sync()

M universe/default.nix => universe/default.nix +11 -3
@@ 12,10 12,10 @@ let
    pam
    kerberos
    dbus
    coreutils
    ## coreutils
    man
    acl
    attr
    ## acl
    ## attr
    libusb1
    xorg.libX11
  ]);


@@ 80,6 80,14 @@ let
      urlview # open links in email
      vim
      w3m # Web-browser that supports tables
      haskell.compiler.ghc884
      haskell.packages.ghc884.haskell-language-server
      haskell.packages.ghc884.retrie
      texlab
      python3.pkgs.python-language-server
      ccls
      rnix-lsp
      gopls
    ] ++ optionals use-hardware-token [
      python3.pkgs.trezor
      python3.pkgs.trezor_agent