forked from tonybanters/vim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlsp.vim
More file actions
33 lines (29 loc) · 952 Bytes
/
lsp.vim
File metadata and controls
33 lines (29 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
" Enable diagnostics highlighting
let lspOpts = #{autoHighlightDiags: v:true}
autocmd User LspSetup call LspOptionsSet(lspOpts)
let lspServers = [
\ #{
\ name: 'rust-analyzer',
\ filetype: ['rust'],
\ path: 'rust-analyzer',
\ args: []
\ }
\ ]
autocmd User LspSetup call LspAddServer(lspServers)
" Key mappings
nnoremap gd :LspGotoDefinition<CR>
nnoremap gr :LspShowReferences<CR>
nnoremap K :LspHover<CR>
nnoremap gl :LspDiag current<CR>
nnoremap <leader>nd :LspDiag next \| LspDiag current<CR>
nnoremap <leader>pd :LspDiag prev \| LspDiag current<CR>
inoremap <silent> <C-Space> <C-x><C-o>
" Set omnifunc for completion
autocmd FileType php setlocal omnifunc=lsp#complete
" Custom diagnostic sign characters
autocmd User LspSetup call LspOptionsSet(#{
\ diagSignErrorText: '✘',
\ diagSignWarningText: '▲',
\ diagSignInfoText: '»',
\ diagSignHintText: '⚑',
\ })