2 ms·
Abolish.vim – super-powerful word substitution, case coercion, and abbreviation
- camtarn 8y agoThis is an old plugin, but it's still one of my all-time favourites. For instance, my task today was to update some terminology in a large app. I had to replace all references to 'Ab1' with 'AbFoo', 'Ab2' with 'AbBar', and 'Ab3' with 'AbBaz'. I also had to replace 'Near' with 'Node' and 'Far' with 'Antinode'. To complicate matters, both of these were usually found in the same line, and both had different capitalization variants - e.g. gAb1NearSensor -> gAbFooNodeSensor, ab1Group -> abFooGroup, nearSensor -> nodeSensor. With Abolish.vim, this is simply a case of opening each affected file, then doing: :%S/ab{1,2,3}/ab{Foo,Bar,Baz}/ :%S/{near,far}/{node,antinode}/ This handles all the possible case combinations automatically. Instead of spending hours tracking down all possible combinations, and inevitably missing some, it's done within half an hour. Just because that's not cool enough, the plugin also offers variable name case coercion (between MixedCase, camelCase, snake_case, UPPER_CASE, dash-case, dot.case, space case , and Title Case) and abbreviation/replacement of commonly used or misspelled words.
- deleted 8y ago[deleted]