Last active
October 4, 2018 13:28
-
-
Save joshp123/c09ee6ed4b3f56a37adee29603c556e8 to your computer and use it in GitHub Desktop.
vim dictionary-ise variables
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
:%s/\(\zs\S\+\ze\s\{1}[=]\)/config["\1"]/g | |
(then do this because it's buggy) | |
%s/ ="/"/g | |
given a file like so: | |
foo = {SomeObject( | |
a=1, | |
b=2, | |
c=3 | |
} | |
replaces all assignments with config["foo"] = |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment