Created
October 4, 2012 16:26
-
-
Save Osse/3834757 to your computer and use it in GitHub Desktop.
Indent plix
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
function! IndentPlix() | |
let line = getline('.') | |
if line =~ '^\t*$' | |
return "\<tab>" | |
else | |
let length = strdisplaywidth(line) | |
let spaces = &ts - (length % &ts) | |
return repeat(' ', spaces) | |
endif | |
endfunction | |
inoremap <expr> <Tab> IndentPlix() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment