When it comes to text editors, I’ve bounced around a lot – everything from Notepad to Textmate to CSSEdit. Well, I’ve come across a new feature provided by my most recent editor of choice and it might just be the last one I ever use. Here’s why:

Multiple Cursors in Sublime Text 2

First off, let me just clarify that you don’t need more than ten fingers to maneuver this function. I know many of you were concerned, but you’re safe. Let’s jump in…

Think of multiple cursors as a quicker way to do a find / replace. You can highlight a pattern and hit CMD + D (mac) multiple times and you’ll notice that each time you do, that initial highlighted pattern is highlighted again wherever is applies. Once you finish highlighting all desired instances of said pattern, simply type the new text. Oh no, you typed the wrong letter?! No problem… just backspace and edit again – this feature will only disable when you hit ‘escape’. Compared to find / replace, this is awesome because you don’t have to find your newly typed phrase just to fix a typo.

This recently came in real handy when we needed to created rewrite rules in an htaccess file from one domain to another. In an excel spreadsheet, we grabbed all the current URLs from one website in column A and all the new ones in column B. Next we copied those columns into a text file and from there, using multiple cursors, Magic! I was able to highlight all those weird patterns that rewrite rules require and change them as needed.