Created
January 4, 2011 16:07
-
-
Save agile/764968 to your computer and use it in GitHub Desktop.
drop this in ~/.vim/plugins and you can complete in insert mode using the tab key
This file contains 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
function InsertTabWrapper() | |
let col = col('.') - 1 | |
if !col || getline('.')[col - 1] !~ '\k' | |
return "\<tab>" | |
else | |
return "\<c-p>" | |
endif | |
endfunction | |
inoremap <tab> <c-r>=InsertTabWrapper()<cr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment