Created
December 9, 2014 14:33
-
-
Save erikcorry/d5c1474f5954130a2b4b to your computer and use it in GitHub Desktop.
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
" Tab completion in vim using the tab key. | |
" Turns into two spaces if there is no alphanumerics on the left of the cursor. | |
function! CleverTab() | |
if strpart( getline('.'), col('.')-2, 1) =~ '^\s*$' | |
return " " | |
else | |
return "\<C-P>" | |
endfunction | |
inoremap <Tab> <C-R>=CleverTab()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment