3 Text Editors for the Linux Command Line

17 September, 2024

I don’t know exactly, or even roughly, how many editors there are for the Linux command line. But I have tried more than a few of them over the years, and found that most weren’t for me. A variety reasons for that, which probably had as much to do with me as with the editors.

But, regardless of what you might think, editing text at the command line doesn’t need to be the domain of the techie. With the right editor, anyone can easily and fluidly work with plain text files in a terminal window.

Let’s take a quick look at three command line text editors that enable anyone to do just that.

nano

nano has been around for quite a while and is included with many a Linux distribution. And while it’s not the prettiest text editor out there, nano does its job very well.

nano has all of the main features that you expect in a text editor: syntax highlighting, easy-to-remember keyboard shortcuts, line wrapping, search and replace, undo and redo, and mouse support. And more. It’s a complete package, but a small one.

Here’s a look at nano doing its thing:

nano, editing a Python script

ne

Before I started writing this post, I’d heard of ne but I’d never tried it. As far as command line editors go, ne is good. Very good.

ne was created as an alternative to the venerable vi editor, with ease of use in mind. That ease of use comes, in part, from the editor adopting standard desktop keyboard shortcuts and having a menu bar at the top of its screen.

ne also does syntax highlighting and lets you record, save, and play macros to automate tasks without any knowledge of programming. If you’re a productivity hacker, doing that can help you save a bit of time. The only problem I had with ne was that it didn’t apply line wrapping to files that I’d created in other editors. I’m sure there’s a way around that, but I couldn’t find it.

This is what ne looks like in action:

Using ne to update an HTML file

micro

As I pointed out at the top of this post, I’ve worked with a number of command line editors over the decades. The only one I’ve ever felt completely comfortable using from the start has been micro.

From the first time I fired it up, micro just felt right (in a small way, like the feeling I got when I first took an MG4 electric hatchback on the road). That’s probably because micro behaves a lot like a desktop application — it uses the same keyboard shortcuts that I’m used to, and it supports a mouse.

You can also customize micro by changing its colour scheme and by installing plugins. Most of those plugins are too specialized for my needs but the spelling checker and word counter plugins are ones that I use all of the time.

Here’s micro editing this post:

Using micro write this post

If you’re looking for a deeper dive into micro, check out this article.

Final Thoughts

Editing at the Linux command line doesn’t need to involve an obscure set of keyboard shortcuts or a string of confusing parameters. The three editors I look at in this post make editing text — whether a small configuration file or a piece of longer-form writing — easy and painless. No matter what your level of comfort at the command line is.

Scott Nesbitt