nvim: init.vim: Add support for Clojure, Erlang & go

LSP support for go seems to work. Clojure has not been
tested. Erlang should be fine though untested.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2019-08-28 23:53:21 +05:30
parent 6eda783c78
commit 4cbf6441c0

View file

@ -59,6 +59,11 @@ Plug 'zchee/deoplete-jedi'
" Autocomplete for Rust
Plug 'sebastianmarkow/deoplete-rust'
Plug 'rust-lang/rust.vim'
" Erlang Support
Plug 'vim-erlang/vim-erlang-tags'
Plug 'vim-erlang/vim-erlang-runtime'
Plug 'vim-erlang/vim-erlang-omnicomplete'
Plug 'vim-erlang/vim-erlang-compiler'
" Miscellaneous
Plug 'tpope/vim-surround'
Plug 'editorconfig/editorconfig-vim'
@ -184,7 +189,10 @@ noremap <Right> <NOP>
let g:LanguageClient_autoStart = 0
let g:LanguageClient_loggingFile = expand('$HOME/LC.log')
let g:LanguageClient_rootMarkers = ['stack.yaml']
let g:LanguageClient_serverCommands = { 'haskell': ['$HOME/.local/bin/hie-wrapper'] }
let g:LanguageClient_serverCommands = {
\ 'haskell': ['$HOME/.local/bin/hie-wrapper'],
\ 'go' : ['$HOME/go/bin/gopls'],
\ }
nnoremap <leader>ld :call LanguageClient#textDocument_definition()<CR>
nnoremap <leader>lr :call LanguageClient#textDocument_rename()<CR>
@ -295,3 +303,22 @@ let g:loaded_gentags#ctags = 1
" Let vim-gitgutter do its thing on large files
let g:gitgutter_max_signs=10000
" Run gofmt on save
autocmd BufWritePre *.go :call LanguageClient#textDocument_formatting_sync()
" For Clojure
function! Expand(exp) abort
let l:result = expand(a:exp)
return l:result ==# '' ? '' : "file://" . l:result
endfunction
nnoremap <silent> crcc :call LanguageClient#workspace_executeCommand('cycle-coll', [Expand('%:p'), line('.') - 1, col('.') - 1])<CR>
nnoremap <silent> crth :call LanguageClient#workspace_executeCommand('thread-first', [Expand('%:p'), line('.') - 1, col('.') - 1])<CR>
nnoremap <silent> crtt :call LanguageClient#workspace_executeCommand('thread-last', [Expand('%:p'), line('.') - 1, col('.') - 1])<CR>
nnoremap <silent> crtf :call LanguageClient#workspace_executeCommand('thread-first-all', [Expand('%:p'), line('.') - 1, col('.') - 1])<CR>
nnoremap <silent> crtl :call LanguageClient#workspace_executeCommand('thread-last-all', [Expand('%:p'), line('.') - 1, col('.') - 1])<CR>
nnoremap <silent> crml :call LanguageClient#workspace_executeCommand('move-to-let', [Expand('%:p'), line('.') - 1, col('.') - 1, input('Binding name: ')])<CR>
nnoremap <silent> cril :call LanguageClient#workspace_executeCommand('introduce-let', [Expand('%:p'), line('.') - 1, col('.') - 1, input('Binding name: ')])<CR>
nnoremap <silent> crel :call LanguageClient#workspace_executeCommand('expand-let', [Expand('%:p'), line('.') - 1, col('.') - 1])<CR>
nnoremap <silent> cram :call LanguageClient#workspace_executeCommand('add-missing-libspec', [Expand('%:p'), line('.') - 1, col('.') - 1])<CR>