Last active
January 23, 2018 21:12
-
-
Save lwakefield/4ae2d94e2c54f6ae9139fd2b4037163c 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