Skip to content

Instantly share code, notes, and snippets.

@Osse
Created October 4, 2012 16:26
Show Gist options
  • Save Osse/3834757 to your computer and use it in GitHub Desktop.
Save Osse/3834757 to your computer and use it in GitHub Desktop.
Indent plix
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