From 129b0275ab1704b5b9e2bd695e8e1854cd3d3b9b Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Sat, 7 Jan 2023 03:40:42 -0500 Subject: [PATCH] vim: Update coc.nvim config As far as I remember, these were changes from the README or other similar documentation. --- vim/.vimrc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index 142bc49e..d243e1f8 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -341,13 +341,14 @@ endfunction " Use tab for trigger completion with characters ahead and navigate. " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " other plugin before putting this into your config. -inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() -inoremap pumvisible() ? "\" : "\" - function! s:check_back_space() abort let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' + return !col || getline('.')[col - 1] =~ '\s' endfunction + +" Insert when previous text is space, refresh completion if not. +inoremap +\ coc#pum#visible() ? coc#pum#next(1): +\ check_back_space() ? "\" : +\ coc#refresh() +inoremap coc#pum#visible() ? coc#pum#prev(1) : "\"