nvim: Set up LC bindings only if it is started
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
parent
46364f42e3
commit
d259c571bb
1 changed files with 4 additions and 3 deletions
|
@ -394,6 +394,7 @@ augroup haskell_maps
|
||||||
" https://github.com/maxigit/vimrc/tree/2020/compiler
|
" https://github.com/maxigit/vimrc/tree/2020/compiler
|
||||||
au FileType haskell compiler stack
|
au FileType haskell compiler stack
|
||||||
au FileType haskell setlocal makeprg=stack\ build
|
au FileType haskell setlocal makeprg=stack\ build
|
||||||
|
au FileType haskell setlocal keywordprg=:Hoogle
|
||||||
au FileType haskell nmap <LocalLeader>b :Neomake!<CR>
|
au FileType haskell nmap <LocalLeader>b :Neomake!<CR>
|
||||||
au FileType haskell nmap <LocalLeader>t :NeomakeSh stack exec -- hasktags -x -c .<CR>
|
au FileType haskell nmap <LocalLeader>t :NeomakeSh stack exec -- hasktags -x -c .<CR>
|
||||||
au FileType haskell nmap <LocalLeader>g :Ghcid<CR>
|
au FileType haskell nmap <LocalLeader>g :Ghcid<CR>
|
||||||
|
@ -498,7 +499,9 @@ augroup END
|
||||||
|
|
||||||
augroup LSP
|
augroup LSP
|
||||||
au!
|
au!
|
||||||
autocmd FileType haskell,rust,python :call SetLspKeybindings()
|
nnoremap <LocalLeader>cs :LanguageClientStart<CR>
|
||||||
|
nnoremap <LocalLeader>ch :LanguageClientStop<CR>
|
||||||
|
autocmd User LanguageClientStarted :call SetLspKeybindings()
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" --------------------------- Plugin settings --------------------------------
|
" --------------------------- Plugin settings --------------------------------
|
||||||
|
@ -737,8 +740,6 @@ function! SetLspKeybindings()
|
||||||
nnoremap K :call LanguageClient#textDocument_hover()<CR>
|
nnoremap K :call LanguageClient#textDocument_hover()<CR>
|
||||||
nnoremap ge :call LanguageClient#explainErrorAtPoint()<CR>
|
nnoremap ge :call LanguageClient#explainErrorAtPoint()<CR>
|
||||||
|
|
||||||
nnoremap <LocalLeader>cs :LanguageClientStart<CR>
|
|
||||||
nnoremap <LocalLeader>ch :LanguageClientStop<CR>
|
|
||||||
nnoremap <LocalLeader>cm :call LanguageClient_contextMenu()<CR>
|
nnoremap <LocalLeader>cm :call LanguageClient_contextMenu()<CR>
|
||||||
nnoremap <LocalLeader>td :call LanguageClient#textDocument_typeDefinition()<CR>
|
nnoremap <LocalLeader>td :call LanguageClient#textDocument_typeDefinition()<CR>
|
||||||
nnoremap <LocalLeader>di :call LanguageClient#textDocument_implementation()<CR>
|
nnoremap <LocalLeader>di :call LanguageClient#textDocument_implementation()<CR>
|
||||||
|
|
Loading…
Reference in a new issue