114 noremap <leader>te :Tabularize first_eq<CR> |
114 noremap <leader>te :Tabularize first_eq<CR> |
115 noremap <leader>tc :Tabularize first_colon<CR> |
115 noremap <leader>tc :Tabularize first_colon<CR> |
116 noremap <leader>tm :Tabularize methods<CR> |
116 noremap <leader>tm :Tabularize methods<CR> |
117 |
117 |
118 noremap <silent> <leader>a :call vimrc#AutoFmtToggle()<CR> |
118 noremap <silent> <leader>a :call vimrc#AutoFmtToggle()<CR> |
|
119 |
|
120 " Maps that only apply when an LSP is available |
|
121 func! s:on_lsp_buffer_enabled() abort |
|
122 setl omnifunc=lsp#complete |
|
123 nmap <buffer> <F9> <plug>(lsp-hover) |
|
124 nmap <buffer> gd <plug>(lsp-definition) |
|
125 nmap <buffer> ]d <plug>(lsp-next-diagnostic) |
|
126 nmap <buffer> [d <plug>(lsp-previous-diagnostic) |
|
127 endfunc |
119 |
128 |
120 " Commands & Aliases {{{ |
129 " Commands & Aliases {{{ |
121 command! -nargs=+ CAlias call vimrc#CommandAlias(<f-args>) |
130 command! -nargs=+ CAlias call vimrc#CommandAlias(<f-args>) |
122 |
131 |
123 command! Gcd call vimrc#Gcd() |
132 command! Gcd call vimrc#Gcd() |
337 let g:lsp_document_code_action_signs_enabled = 0 |
346 let g:lsp_document_code_action_signs_enabled = 0 |
338 let g:lsp_preview_doubletap = [function('lsp#ui#vim#output#closepreview')] |
347 let g:lsp_preview_doubletap = [function('lsp#ui#vim#output#closepreview')] |
339 |
348 |
340 augroup vim-lsp |
349 augroup vim-lsp |
341 autocmd! |
350 autocmd! |
342 autocmd User lsp_buffer_enabled call vimrc#on_lsp_buffer_enabled() |
351 autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() |
343 |
352 |
344 if executable('rls') |
353 if executable('rls') |
345 autocmd User lsp_setup call lsp#register_server({ |
354 autocmd User lsp_setup call lsp#register_server({ |
346 \ 'name': 'rls', |
355 \ 'name': 'rls', |
347 \ 'cmd': {server_info->['rustup', 'run', 'stable', 'rls']}, |
356 \ 'cmd': {server_info->['rustup', 'run', 'stable', 'rls']}, |