Last active
October 6, 2024 18:28
-
-
Save ericdouglas/72621cb47b368297feaa to your computer and use it in GitHub Desktop.
Change 4 spaces to 2 spaces indentation and change tab to spaces - Vim tip
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
// 4 spaces to 2 spaces | |
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g | |
// Tab to 2 spaces | |
:%s/\t/ /g |
hey there, I made an improvement to allow this method to be used in a selected code only by making a function for it. source - gist
Thanks!
Thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I couldn't get various incarnations of
:retab
or=
to work properly, but this one did it!