Refactoring in Spacemacs

Jack of Some is back with another video. This one is about using Spacemacs to refactor code. For someone who’s content with vanilla Emacs and has no plans to move to one of the other configurations, I’ve been writing a lot about Spacemacs lately. This is justified with today’s video because it taught me several things I didn’t know about iedit that apply no matter what flavor of Emacs you prefer.

Ever since abo-abo turned me on to it, I’ve been a heavy user of iedit. I almost always prefer it to query-replace or query-replace-regexp. It turns out, though, that it’s much more flexible than I imagined and Jack demonstrates that flexibility in his video. If you’re not a Spacemacs user, the keysequences are different, of course, but bringing up the doc-string will show you their vanilla Emacs counterparts.

As an example, when I was writing the post on Org gems, I decided to change ‘6’ to “six” in the text so I fired up iedit. Unfortunately, the ‘6’ in the list got changed too. It was easy to fix it up, of course, but I thought it was too bad there wasn’t a way of turning iedit off for some occurrences of the target symbol. After watching Jack’s video, I realized that there was a way of doing it and that it was all documented in the docstring.

If you’re an iedit user and are not aware of all of it’s functionality, be sure to watch the video and visit the documentation.

This entry was posted in General and tagged . Bookmark the permalink.