Last active
August 23, 2018 20:47
-
-
Save adam000/0d4f48b3f24415b657073cb734338b75 to your computer and use it in GitHub Desktop.
MARS - Macroized Applied Rapid Substitution
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
// :execute "normal" "mAj^W\"nyEW\"ayEW\"byEk" | execute "normal" @n . "k" | execute ".,.+" . @n . "s/" . @a . "/" . @b | execute "normal" "'A" | |
// 25 FooApi BarApi | |
// Explanation: | |
// mark line as A mA | |
// down one line j | |
// beginning of content ^ | |
// next Word W | |
// Copy Word to n, continue \"nyEW | |
// Copy Word to a, continue \"ayEW | |
// Copy Word to b \"byE | |
// Up one line k | |
// Up register n lines @n . "k" | |
// In the next n lines, sub a for b ".,.+" . @n . "s/" . @a . "/" . @b | |
// Go back to the line at the start 'A |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment