From 60e42fcc21392c9c70b3066d3433dea6b9cc2e81 Mon Sep 17 00:00:00 2001 From: TiynGER Date: Mon, 6 Apr 2020 12:35:14 +0200 Subject: [PATCH] better usability for snippets in coc --- .config/nvim/init.vim | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 6dde205..c89be33 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -63,7 +63,7 @@ autocmd BufWritePre * %s/\s\+$//e " Plugin section call plug#begin('~/.config/nvim/plugged') Plug 'neoclide/coc.nvim', {'branch': 'release'} " Autocomplete -Plug 'lervag/vimtex', {'for': 'tex'} " library for coc autocomplete +Plug 'lervag/vimtex' , { 'for' : 'tex'} " tex library for coc autocompletion Plug 'donRaphaco/neotex', { 'for': 'tex'} " Asynchronous pdf rendering Plug 'preservim/nerdtree' " Filetree Plug 'majutsushi/tagbar' " Show tags @@ -74,18 +74,21 @@ call plug#end() " Coc extensions let g:coc_global_extensions = ['coc-snippets', 'coc-vimtex'] - -" Coc remaps +" tab through suggestions +let g:coc_snippet_next = '' inoremap \ pumvisible() ? "\" : \ check_back_space() ? "\" : \ coc#refresh() +" jump to next placeholder inoremap pumvisible() ? "\" : "\" - +" ending suggestions function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction +" expand snippets on enter +inoremap pumvisible() ? "\" : "\" "tagbar map :TagbarToggle