Skip to content

Instantly share code, notes, and snippets.

@joshp123
Last active October 4, 2018 13:28
Show Gist options
  • Save joshp123/c09ee6ed4b3f56a37adee29603c556e8 to your computer and use it in GitHub Desktop.
Save joshp123/c09ee6ed4b3f56a37adee29603c556e8 to your computer and use it in GitHub Desktop.
vim dictionary-ise variables
:%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