Are You Too Wedded To Your Text Editor?

Software Development September 10th, 2018

I've been a proud VIM user for years — dating back as far as 1999 — but especially so, since I pushed myself to learn it properly a few short years ago. However, I wonder if I've become too wedded to it. And I'm keen to find out if you are too.

This is especially important if another text editor does all that I need, but also:

  • Provides a better UX
  • Is easier to use
  • Is easier to install and configure
  • Requires less effort
  • Has a larger, more active community (so it's easier to get help and support)

This might seem an odd thing to consider — especially coming from someone using VIM (or Emacs, Pico, Nano, etc). After all, the typical reputation that I've noticed over the years of people who use command-line editors is that they stick to it for life.

But I'm not quite that kind of person. As I've written about here on the blog on more than one occasion, I'm very passionate about using VIM for almost everything. I've even created and published a .vimrc file to share that experience with others.

But despite that, intermittently, I've wondered from time to time if another editor can do all that VIM can do, but is easier to use.

Me being me, I even started wondering if I've become so single-minded in my pursuit of VIM excellence, that I've refused to consider worthwhile alternatives, for fear of wasting all the effort invested?

Here's what's brought these thoughts to a head.

Over the last few months, I've spent an increasing amount of time growing my regular expression skills, so that I can search and update the ownCloud documentation (I'm the documentation lead) more efficiently and effectively.

When building a regular expression, I'll typically use Regex101.com to build the regular expression, so that I know that it matches what I'm after and that it's as efficient as I can make it. You can see an example in the screenshot below.

Building a regular expression using Regex101.com

It usually doesn't take too long to create the desired expression. If you're not familiar with Regex101, you start by pasting some sample text in the "Test String" field at the bottom, and then you start creating the regular expression in the "Regular Expression" field at the top.

Based on the test text and the current state of your regular expression, it will (or won't) start to highlight one or more sections of the test string. There's far more to Regex101 than I can cover here, but that's the essentials that you need to know.

Let's assume that the regular expression that I've created works as expected, that's when the trouble starts. That sounds like rather an odd thing to say, but here's why.

I then have to update that regular expression to work in VIM, as it doesn't support the same type of regular expressions that most other tools do. It's a process which I've found to be painful. And secondly, VIM seems to only search and update one file at a time.

However, if I were to use SublimeText or Atom, I don't have to change the regular expression at all. I can just copy and paste it into the find field. What's more, they can perform a find/replace across the entire project or codebase — not just one file!

Doing a project-wide find and replace, using a regular expression, with SublimeText 3

In the pic above, I did a project-wide search and replace, using a regex. It showed me a list of matches, so I knew that the regex worked. I could then replace all the matches and save all the changed files. Easy! The same can't be said for VIM.

So on this point, at least for now, they're the logical choice, as they present a much lower barrier to entry. What's more, while they're not VIM, they do support VIM-like functionality, whether through plugins or sometimes natively.

So while I love VIM and have grown so much in what I can do with it, I'm no sucker for punishment. If another editor is as fast, supports pretty much the same level of functionality, perhaps looks just that much more modern and polished, and lets me do what I need to do with less effort, I'm inclined to consider switching.

And there's my conundrum. I'm feeling pulled in two directions. I honestly love using VIM and love that I can do so much with it. But, at least with respect to project-wide regex find and replace, SublimeText and Atom are far and away easier to use!

So What Do I Do?

I feel that there are only three possible choices.

  1. Do I push on growing my VIM skills and overcome this hurdle?
  2. Do I switch to SublimeText and leave VIM behind?
  3. Or do I use SublimeText just for project-wide regex find and replace tasks?

Decisions, decisions, decisions!

As I'm prone to do, I put the question out on social media, specifically on my Facebook page. And, sure enough, a very learned and thoughtful friend gave me a good answer. Here's how it went.

Why don't we use both VIM AND SublimeText (or another editor)

More specifically he said:

For what it's worth, I use VIM as my primary editor and VS Code mainly as a sort of clipboard on steroids.

Use both you say? I thought and thought and thought about it. Use both. Hmmm. What is it, at times, about when other people affirm what you’ve been thinking?

Why is it that all you needed was to know that at least one other person already does what you’re considering oing? Is it strength in numbers, unwillingness to go something alone, or that you just want to know you’re in good company?

Whichever, hearing someone I trust suggest this was enough to move me forward. As I sat and thought about it just that bit longer, I realised that I was being pedantic, and that using at least one more text editor had a host of benefits. Here’s the short list:

  • By using two editors on a regular basis, I can steadily grow my skills in both, and be able to use the one that best suits the job at hand.
  • I'll have a broader skill set and outlook on problem solving by using both editors.
  • I could be part of multiple communities and be able to learn from both of them.
  • I'd only be learning two editors, not three or more, so my focus and attention wouldn't be stretched too far.
  • Using a second editor would provide a nice alternative, and it's good to use different tools from time to time.
  • I'm sure there are things that both editors excel at, that would be somewhat forced in the other.

Do you agree? Are there other benefits that you can think of?

If even half of these are correct then learning one more professional text editor is the right choice, and I've been worrying over nothing. So, after some further deliberation, I decided to give it a go. It’s good to make decisions and move forward. So keep an eye out for future posts on SublimeText.

Are you in the same position? Are you not sure which way to go? I hope this short, cathartic story helps you make a decision and move forward.

Tagged with: Regular Expressions / Regex101.com / Text Editor / VIM / SublimeText / Atom

Join the Email List

If you enjoyed this post, why not join the email list and get all future posts straight to your inbox? In addition, you'll get background information, extra research, and other content that's only available on the list. I promise I'll NEVER spam you. And you can unsubscribe at any time.