From d259c571bbacd737fcb417d25df68f1fc5a61d93 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Sun, 9 Feb 2020 19:13:00 +0530 Subject: [PATCH] nvim: Set up LC bindings only if it is started Signed-off-by: Sanchayan Maity --- nvim/.config/nvim/init.vim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index ab0d2fe..7f0c4d4 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -394,6 +394,7 @@ augroup haskell_maps " https://github.com/maxigit/vimrc/tree/2020/compiler au FileType haskell compiler stack au FileType haskell setlocal makeprg=stack\ build + au FileType haskell setlocal keywordprg=:Hoogle au FileType haskell nmap b :Neomake! au FileType haskell nmap t :NeomakeSh stack exec -- hasktags -x -c . au FileType haskell nmap g :Ghcid @@ -498,7 +499,9 @@ augroup END augroup LSP au! - autocmd FileType haskell,rust,python :call SetLspKeybindings() + nnoremap cs :LanguageClientStart + nnoremap ch :LanguageClientStop + autocmd User LanguageClientStarted :call SetLspKeybindings() augroup END " --------------------------- Plugin settings -------------------------------- @@ -737,8 +740,6 @@ function! SetLspKeybindings() nnoremap K :call LanguageClient#textDocument_hover() nnoremap ge :call LanguageClient#explainErrorAtPoint() - nnoremap cs :LanguageClientStart - nnoremap ch :LanguageClientStop nnoremap cm :call LanguageClient_contextMenu() nnoremap td :call LanguageClient#textDocument_typeDefinition() nnoremap di :call LanguageClient#textDocument_implementation()