From fca2c6d3e5072b50bed479467d6b090cf54a6897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Sun, 24 Oct 2021 15:47:37 +0200 Subject: [PATCH] Added tab like in vscode --- .config/nvim/init.vim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 14d6fd6..93a0896 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -87,6 +87,24 @@ call plug#end() " Instalation coc extentions let g:coc_global_extensions = ['coc-solargraph', 'coc-go', 'coc-yaml', 'coc-pyright', 'coc-json' , 'coc-markdownlint' , 'coc-sh', 'coc-prettier', 'coc-diagnostic', 'coc-perl'] +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction +" Make auto-select the first completion item and notify coc.nvim to +" format on enter, could be remapped by other vim plugin +inoremap pumvisible() ? coc#_select_confirm() + \: "\u\\=coc#on_enter()\" + +" 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() ? "\" : "\" + " Status-line set statusline= set statusline+=%#IncSearch#