Created
September 12, 2018 19:04
-
-
Save jsatk/a8994388ea9ecd9d1c273137072fa77a to your computer and use it in GitHub Desktop.
Revisions
-
jsatk created this gist
Sep 12, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ " Auto-Completion --------------------------------------------------------- {{{ " Use TAB to complete when typing words, else inserts TABs as usual. function! Tab_Or_Complete(move_to_next_word) abort " If auto-complete menu is not open and we are in the middle of typing a " word OR if auto-complete menu is already open the `tab` cycles through " suggested completions. if pumvisible() || (col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w') return a:move_to_next_word else " If we aren't typing a word and we press `tab` simply do the normal `tab` " action. return "\<Tab>" endif endfunction inoremap <expr> <Tab> Tab_Or_Complete("\<C-N>") inoremap <expr> <S-Tab> Tab_Or_Complete("\<C-P>") " }}}