-
-
Save markwu/f7fda69de5c7caf1e34515804740be76 to your computer and use it in GitHub Desktop.
tabcomplete
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 characters
| inoremap <expr> <tab> pumvisible() ? '<c-n>' : '<tab>' | |
| inoremap <expr> <s-tab> pumvisible() ? '<c-p>' : '<tab>' | |
| augroup autocomplete | |
| autocmd! | |
| autocmd TextChangedI * call TypeComplete() | |
| augroup end | |
| fun! TypeComplete() | |
| if getline('.')[col('.') - 2] =~ '\K' && getline('.')[col('.') - 1] !~ '\K' | |
| call feedkeys("\<c-n>") | |
| end | |
| endfun |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment