Created
August 21, 2012 19:31
-
-
Save joequery/3418565 to your computer and use it in GitHub Desktop.
Tab or complete
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
| "Use TAB to complete when typing words, else inserts TABs as usual. | |
| function! Tab_Or_Complete() | |
| if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w' | |
| return "\<C-N>" | |
| else | |
| return "\<Tab>" | |
| endif | |
| endfunction | |
| inoremap <Tab> <C-R>=Tab_Or_Complete()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment