Fix vim keybindings
This commit is contained in:
parent
d2968d8007
commit
b378035b08
|
@ -61,6 +61,8 @@ in
|
||||||
|
|
||||||
vim-css-color
|
vim-css-color
|
||||||
|
|
||||||
|
vista-vim
|
||||||
|
|
||||||
# ===
|
# ===
|
||||||
# Languages
|
# Languages
|
||||||
# haskell syntax highlighting
|
# haskell syntax highlighting
|
||||||
|
|
|
@ -14,6 +14,7 @@ function! MyExplorer()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
nnoremap <space>e :call MyExplorer()<CR>
|
nnoremap <space>e :call MyExplorer()<CR>
|
||||||
|
nnoremap <space>v :Vista coc<CR>
|
||||||
|
|
||||||
set nofoldenable
|
set nofoldenable
|
||||||
set background=light
|
set background=light
|
||||||
|
@ -135,13 +136,13 @@ inoremap <silent><expr> <c-space> coc#refresh()
|
||||||
" Coc only does snippet and additional edit on confirm.
|
" Coc only does snippet and additional edit on confirm.
|
||||||
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||||
|
|
||||||
nnoremap <silent> gp <Plug>(coc-diagnostic-prev)
|
nnoremap <silent> gp :call CocAction('diagnosticPrevious')<cr>
|
||||||
nnoremap <silent> gn <Plug>(coc-diagnostic-next)
|
nnoremap <silent> gn :call CocAction('diagnosticNext')<cr>
|
||||||
|
|
||||||
" Remap keys for gotos
|
" Remap keys for gotos
|
||||||
nnoremap <silent> gd <Plug>(coc-definition)
|
nnoremap <silent> gd :call CocAction('jumpDefinition')<cr>
|
||||||
nnoremap <silent> gy <Plug>(coc-type-definition)
|
nnoremap <silent> gt :call CocAction('jumpTypeDefinition')<cr>
|
||||||
nnoremap <silent> gr <Plug>(coc-references)
|
nnoremap <silent> gr :call CocAction('jumpReferences')<cr>
|
||||||
|
|
||||||
nnoremap <silent> gs :Git status<CR>
|
nnoremap <silent> gs :Git status<CR>
|
||||||
nnoremap <silent> gu :CocCommand git.chunkUndo<CR>
|
nnoremap <silent> gu :CocCommand git.chunkUndo<CR>
|
||||||
|
@ -153,7 +154,7 @@ nnoremap <silent> gc :Git commit<CR>
|
||||||
function! s:show_documentation()
|
function! s:show_documentation()
|
||||||
if (index(['vim','help'], &filetype) >= 0)
|
if (index(['vim','help'], &filetype) >= 0)
|
||||||
elseif (coc#rpc#ready())
|
elseif (coc#rpc#ready())
|
||||||
call CocActionAsync('doHover')
|
call CocActionAsync('definitionHover')
|
||||||
else
|
else
|
||||||
execute '!' . &keywordprg . " " . expand('<cword>')
|
execute '!' . &keywordprg . " " . expand('<cword>')
|
||||||
endif
|
endif
|
||||||
|
@ -182,13 +183,6 @@ nnoremap <leader>a <Plug>(coc-codeaction-selected)
|
||||||
nnoremap <silent> <space>f :Format<CR>
|
nnoremap <silent> <space>f :Format<CR>
|
||||||
nnoremap <space>l <Plug>(coc-codelens-action)
|
nnoremap <space>l <Plug>(coc-codelens-action)
|
||||||
|
|
||||||
" Create mappings for function text object, requires document symbols feature of languageserver.
|
|
||||||
|
|
||||||
xmap if <Plug>(coc-funcobj-i)
|
|
||||||
xmap af <Plug>(coc-funcobj-a)
|
|
||||||
omap if <Plug>(coc-funcobj-i)
|
|
||||||
omap af <Plug>(coc-funcobj-a)
|
|
||||||
|
|
||||||
" FZF ctrl-p style search
|
" FZF ctrl-p style search
|
||||||
nnoremap <space>p :Files<CR>
|
nnoremap <space>p :Files<CR>
|
||||||
nnoremap <space>g :Rg<CR>
|
nnoremap <space>g :Rg<CR>
|
||||||
|
@ -243,11 +237,9 @@ nnoremap <silent> <space>d :<C-u>CocFzfList diagnostics<cr>
|
||||||
" Show commands
|
" Show commands
|
||||||
nnoremap <silent> <space>c :<C-u>CocFzfList commands<cr>
|
nnoremap <silent> <space>c :<C-u>CocFzfList commands<cr>
|
||||||
" Find symbol of current document
|
" Find symbol of current document
|
||||||
nnoremap <silent> <space>o :<C-u>CocFzfList outline<cr>
|
nnoremap <silent> <space>o :Vista finder coc<cr>
|
||||||
" Find symbol of current document
|
" Find symbol of current document
|
||||||
nnoremap <silent> <space>a :<C-u>CocFzfList actions<cr>
|
nnoremap <silent> <space>a :<C-u>CocAction<cr>
|
||||||
" Do default action for next item.
|
|
||||||
nnoremap <silent> <space>j :<C-u>CocNext<CR>
|
|
||||||
|
|
||||||
imap <Enter> <CR>
|
imap <Enter> <CR>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue