mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-03-05 10:01:37 +01:00
vim: Update coc.nvim config
As far as I remember, these were changes from the README or other similar documentation.
This commit is contained in:
parent
edbeec006f
commit
129b0275ab
15
vim/.vimrc
15
vim/.vimrc
@ -341,13 +341,14 @@ endfunction
|
|||||||
" Use tab for trigger completion with characters ahead and navigate.
|
" Use tab for trigger completion with characters ahead and navigate.
|
||||||
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
|
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
|
||||||
" other plugin before putting this into your config.
|
" other plugin before putting this into your config.
|
||||||
inoremap <silent><expr> <TAB>
|
|
||||||
\ pumvisible() ? "\<C-n>" :
|
|
||||||
\ <SID>check_back_space() ? "\<TAB>" :
|
|
||||||
\ coc#refresh()
|
|
||||||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
|
||||||
|
|
||||||
function! s:check_back_space() abort
|
function! s:check_back_space() abort
|
||||||
let col = col('.') - 1
|
let col = col('.') - 1
|
||||||
return !col || getline('.')[col - 1] =~# '\s'
|
return !col || getline('.')[col - 1] =~ '\s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Insert <tab> when previous text is space, refresh completion if not.
|
||||||
|
inoremap <silent><expr> <TAB>
|
||||||
|
\ coc#pum#visible() ? coc#pum#next(1):
|
||||||
|
\ <SID>check_back_space() ? "\<Tab>" :
|
||||||
|
\ coc#refresh()
|
||||||
|
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
|
||||||
|
Loading…
Reference in New Issue
Block a user