diff options
-rw-r--r-- | .config/coc/extensions/package.json | 2 | ||||
-rw-r--r-- | .config/nvim/coc-settings.json | 1 | ||||
-rw-r--r-- | .config/nvim/init.vim | 38 |
3 files changed, 11 insertions, 30 deletions
diff --git a/.config/coc/extensions/package.json b/.config/coc/extensions/package.json index adda904..aed1c07 100644 --- a/.config/coc/extensions/package.json +++ b/.config/coc/extensions/package.json @@ -14,5 +14,5 @@ }, "disabled": [], "locked": [], - "lastUpdate": 1663853601152 + "lastUpdate": 1663853823511 }
\ No newline at end of file diff --git a/.config/nvim/coc-settings.json b/.config/nvim/coc-settings.json index 49d45e0..19f9d8b 100644 --- a/.config/nvim/coc-settings.json +++ b/.config/nvim/coc-settings.json @@ -1,4 +1,5 @@ { + "suggest.noselect": true, "languageserver": { "clangd": { "command": "clangd", diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 6f7c503..87e2862 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -50,6 +50,7 @@ Plug 'AndrewRadev/tagalong.vim' Plug 'terrortylor/nvim-comment' Plug 'liuchengxu/vim-which-key' Plug 'justinmk/vim-sneak' + " Plug 'jbgutierrez/vim-better-comments' Plug 'junegunn/goyo.vim' Plug 'othree/eregex.vim' @@ -318,37 +319,16 @@ augroup END autocmd FileType tex let b:surround_{char2nr("q")} = "`\r'" autocmd FileType tex let b:surround_{char2nr('Q')} = "``\r''" -" tab out of brackets -function TabOutOfDelim() - let char = strcharpart(getline('.'), col('.') + 1, 1) - let valid = ")}]> " - if stridx(valid, char) != -1 - norm l - endif -endfunction - -function CocTabButton() - if pumvisible() - return "\<C-n>" - elseif <SID>check_back_space() - return "\<Tab>" - else - call coc#refresh() - endif -endfunction - -" imap <silent><cmd> <Tab> call TabOutOfDelim() <bar> call CocTabButton() -" imap <silent><cmd> <Tab> call CocTabButton() <bar> call TabOutOfDelim() -imap <silent><cmd> <Tab> call CocTabButton() -" imap <silent> <Tab> <Esc>:call TabOutOfDelim()<CR>a - - " coc.vim <tab> completion and <cr> stuffs +function! CheckBackspace() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction inoremap <silent><expr> <TAB> - \ pumvisible() ? "\<C-n>" : - \ <SID>check_back_space() ? "\<TAB>" : - \ coc#refresh() -inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>" + \ coc#pum#visible() ? coc#pum#next(1) : + \ CheckBackspace() ? "\<Tab>" : + \ coc#refresh() +inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>" function! s:check_back_space() abort let col = col('.') - 1 |