vimrc: Add Golang LSP
This commit is contained in:
parent
82ed66a7d7
commit
5e7806066c
1 changed files with 13 additions and 0 deletions
13
.vimrc
13
.vimrc
|
|
@ -62,6 +62,19 @@ inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>"
|
|||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" LSP Stuff "
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Golang
|
||||
if executable('gopls')
|
||||
au User lsp_setup call lsp#register_server({
|
||||
\ 'name': 'gopls',
|
||||
\ 'cmd': {server_info->['gopls', '-remote=auto']},
|
||||
\ 'allowlist': ['go', 'gomod', 'gohtmltmpl', 'gotexttmpl'],
|
||||
\ })
|
||||
|
||||
autocmd BufWritePre *.go
|
||||
\ call execute('LspDocumentFormatSync') |
|
||||
\ call execute('LspCodeActionSync source.organizeImports')
|
||||
endif
|
||||
|
||||
" Haskell
|
||||
if executable('haskell-language-server-wrapper')
|
||||
au User lsp_setup call lsp#register_server({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue