Created
April 16, 2013 10:07
-
-
Save mageekguy/5394811 to your computer and use it in GitHub Desktop.
Command to replace spaces by tabs in a file.
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
command! -buffer -range=% -nargs=? SpaceToTab execute '<line1>,<line2>s#^\( \{'.(<q-args> ? <q-args> : &ts).'\}\)\+#\=repeat("\t", len(submatch(0))/' . &ts . ')#e' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment