From f0dc8945938f366b62c568cb95fcb4bfd82eec4e Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Sat, 30 May 2020 12:32:51 +0530 Subject: [PATCH] nvim: Drop supertab Signed-off-by: Sanchayan Maity --- nvim/.config/nvim/config.vim | 4 ++-- nvim/.config/nvim/init.vim | 2 -- nvim/.config/nvim/keymappings.vim | 11 +++++++++++ nvim/.config/nvim/plugin_settings.vim | 2 -- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/nvim/.config/nvim/config.vim b/nvim/.config/nvim/config.vim index 46806d9..8127725 100644 --- a/nvim/.config/nvim/config.vim +++ b/nvim/.config/nvim/config.vim @@ -40,11 +40,11 @@ set magic " Use 'magic' patterns (extended regular expressions set autoread " Autoload file if it changes on disk set termguicolors " Enable colors for terminal set completeopt-=menu -set completeopt+=menuone " Show the completions UI even with only 1 item set completeopt-=longest " Don't insert the longest common text set completeopt-=preview " Hide the documentation preview window +set completeopt+=menuone " Show the completions UI even with only 1 item set completeopt+=noinsert " Don't insert text automatically -set completeopt-=noselect " Highlight the first completion automatically +set completeopt+=noselect " Do not select a match in the menu " Required for vim-workspace " See https://github.com/thaerkh/vim-workspace/issues/11 set sessionoptions-=blank diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index c18d470..d90bd24 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -1,7 +1,5 @@ call plug#begin('~/.config/nvim/plugged') -" Tab completion -Plug 'ervandew/supertab' " Motions Plug 'haya14busa/incsearch.vim' Plug 'justinmk/vim-sneak' diff --git a/nvim/.config/nvim/keymappings.vim b/nvim/.config/nvim/keymappings.vim index 28b2562..8552cec 100644 --- a/nvim/.config/nvim/keymappings.vim +++ b/nvim/.config/nvim/keymappings.vim @@ -145,6 +145,17 @@ nnoremap imap lua require'source'.prevCompletion() imap lua require'source'.nextCompletion() +" Tab completion. Taken from nvim-completion README. +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~ '\s' +endfunction + +inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ completion#trigger_completion() + " Asynchronous make command! -bang -nargs=* -complete=file Make call asyncdo#run(0, &makeprg, ) command! -bang -nargs=* -complete=file LMake call asyncdo#lrun(0, &makeprg, ) diff --git a/nvim/.config/nvim/plugin_settings.vim b/nvim/.config/nvim/plugin_settings.vim index 3cef649..0016354 100644 --- a/nvim/.config/nvim/plugin_settings.vim +++ b/nvim/.config/nvim/plugin_settings.vim @@ -12,8 +12,6 @@ let g:gitgutter_sign_modified_removed = 'mr' " Automatically detect style file and apply style to formatting let g:clang_format#detect_style_file = 1 -" Fix tab behaviour while switching through completion options -let g:SuperTabDefaultCompletionType = "" " For workspace let g:workspace_session_directory = $HOME . '/.vim/session/' let g:workspace_undodir = $HOME . '/.vim/undodir'