vimrc(lsp): add codeactions bindings
This commit is contained in:
parent
301bc3ea49
commit
cc322fcff8
13
.vim/vimrc
13
.vim/vimrc
@ -1225,6 +1225,19 @@ function! s:on_lsp_buffer_enabled() abort
|
||||
inoremap <buffer> <expr><c-f> lsp#scroll(+4)
|
||||
inoremap <buffer> <expr><c-d> lsp#scroll(-4)
|
||||
|
||||
" simple code action for normal mode and visual mode
|
||||
nmap <buffer> <Leader><Leader> <plug>(lsp-code-action)
|
||||
vmap <buffer> <Leader><Leader> :LspCodeAction<CR>
|
||||
|
||||
" alternative that uses floating window
|
||||
nmap <buffer> <Leader>f <plug>(lsp-code-action-float)
|
||||
|
||||
" mapping for filtered code actions
|
||||
nmap <buffer> <Leader>ri :LspCodeAction refactor.inline<CR>
|
||||
nmap <buffer> <Leader>ro :LspCodeAction source.organizeImports<CR>
|
||||
vmap <buffer> <Leader>rm :LspCodeAction refactor.extract<CR>
|
||||
nmap <buffer> <Leader>rm :LspCodeAction refactor.extract<CR>
|
||||
|
||||
" let g:lsp_format_sync_timeout = 1000
|
||||
let g:lsp_format_sync_timeout = 700
|
||||
augroup lsp_format_sync
|
||||
|
Loading…
Reference in New Issue
Block a user