When working on the command line, text editing is one of the most frequent actions you will take. That’s why it’s so important to have a good terminal text editor. But what is an editor?
Well, I believe that the best terminal text editor should be easy to use, fast, editable by hand or programmatically, support customisability or scripting (which can also be customisable) and lastly follow standard keyboard shortcuts.
Geany Editor
Geany is a tiny and lightweight integrated development environment that offers basic IDE-like features with a focus on software development using the GTK+ toolkit.
It has some basic features as listed below:
- Syntax highlighting
- Pluggable interface
- Supports many file types
- Enables code folding and code navigation
- Symbol name and construct auto-completion
- Supports auto-closing of HTML and XML tags
- Elementary project management functionality plus many more
You can install Geany editor in Linux systems using your default package manager as shown.
$ sudo apt install geany [On Debian, Ubuntu, and Mint] $ sudo dnf install geany [On RHEL, CentOS, and Fedora] $ sudo pacman -S geany [On Arch Linux and Manjaro] $ sudo zypper install geany [On OpenSuse]
Vim
Vim is one of the most popular command-line text editors ever. If you have been using Linux for some time, you probably have come across jokes regarding how difficult it is to use Vim. It is certainly true that VIM has a steep learning curve due to its minimal mouse support and multiple modes but once you learn to use the extensive keyboard mappings and commands Vim offers, you can be more productive than you ever were. No scrolling down to the end of the document now, you can just press G
!
These key mappings can be customized and extended too and the “recording macros” feature can also help you automate the sequence of keystrokes. Vim also has a lot of community plugins that add to the functionality or even beautify your working environment.
It also offers a fun interactive tutorial application called “vimtutor” which will take you through all its basic commands and features so that you can get started with your command line editing journey.
Gedit
Gedit is a general-purpose GUI based text editor and is installed by default text editor on Gnome desktop environment. It is simple to use, highly pluggable and a powerful editor with the following features:
- Support for UTF-8
- Use of configurable font size and colors
- Highly customizable syntax highlighting
- Undo and redo functionalities
- Reverting of files
- Remote editing of files
- Search and replace text
- Clipboard support functionalities and many more
You can install Gedit editor in Linux systems using your default package manager as shown.
$ sudo apt install gedit [On Debian, Ubuntu, and Mint] $ sudo dnf install gedit [On RHEL, CentOS and Fedora] $ sudo pacman -S gedit [On Arch Linux and Manjaro] $ sudo zypper install gedit [On OpenSuse]
Nano Editor
Nano is an easy to use text editor, especially for both new and advanced Linux users. It enhances usability by providing customizable key binding.
Nano has the following features:
- Highly customizable key bindings
- Syntax highlighting
- Undo and redo options
- Full line display on the standard output
- Pager support to read from standard input
You can install Nano editor in Linux systems using your default package manager as shown.
$ sudo apt install nano [On Debian, Ubuntu, and Mint] $ sudo dnf install nano [On RHEL, CentOS and Fedora] $ sudo pacman -S nano [On Arch Linux and Manjaro] $ sudo zypper install nano [On OpenSuse]
You can check our complete guide for editing files with Nano editor at:
GNU Emacs
Emacs is a highly extensible and customizable text editor that also offers an interpretation of the Lisp programming language at its core. Different extensions can be added to support text editing functionalities.
Emacs has the following features:
- User documentation and tutorials
- Syntax highlighting using colors even for plain text.
- Unicode supports many natural languages.
- Various extension including mail and news, debugger interface, calendar, and many more
You can install Emacs editor in Linux systems using your default package manager as shown.
$ sudo apt install emacs [On Debian, Ubuntu, and Mint] $ sudo dnf install emacs [On RHEL, CentOS and Fedora] $ sudo pacman -S emacs [On Arch Linux and Manjaro] $ sudo zypper install emacs [On OpenSuse]
Kate/Kwrite
Kate is a feature-rich and highly pluggable text editor that comes with KDesktop Environment (KDE). The Kate project aims at the development of two main products that are: KatePart and Kate.
KatePart is an advanced text editor component included in many KDE applications that may require users to edit text whereas Kate is a multiple document interface (MDI) text, editor.
The following are some of its general features:
- Extensible through scripting
- Encoding support such as Unicode mode
- Text rendering in bi-directional mode
- Line ending support with auto-detection functionalities
Also remote file editing and many other features including advanced editor features, applications features, programming features, text highlighting features, backup features, and search and replace features.
You can install Kate editor in Linux systems using your default package manager as shown.
$ sudo apt install kate [On Debian, Ubuntu, and Mint] $ sudo dnf install kate [On RHEL, CentOS, and Fedora] $ sudo pacman -S kate [On Arch Linux and Manjaro] $ sudo zypper install kate [On OpenSuse]
Emacs
Emacs vs Vim has been one of the most heated discussions in the Linux community for years. But one thing that Emacs easily beats Vim is age. With its initial release in 1976, Emacs is one of the oldest pieces of software that is still being maintained. Emacs just like vim can be difficult at first but it will provide you with the fastest and most productive working environment ever.
Also read: Nano vs VIM editor – What’s the difference between nano and vim editors?
Apart from being able to do everything Vim can, Emacs is insanely extensible. It even comes with its own fully-fledged package manager to download those extensions. With Emacs, you can browse the internet, check your mail, read pdf, listen to music, share files, watch movies, check IRC, play games, and much more INSIDE THE TEXT EDITOR ITSELF.
Emacs is without a doubt one of the most powerful text editors ever written. So powerful in fact, that it is often jokingly called an operating system instead of a text editor and it’s not hard to see why.
To get started with Emacs, check out: Basic Emacs guide
Leaf Pad
Leaf Pad is a GTK+ based, lightweight GUI based text editor which is also popular among Linux users today. It is easy to use by new Linux users.
It has the following features:
- Codeset option
- Allows auto-detection of codeset
- Options of undo and redo
- Display file line numbers
- Supports Drag and Drop options
- Printing support
You can install Leaf Pad editor in Linux systems using snap package manager as shown.
$ sudo snap install leafpad
Nano
Another classic. Nano unlike Emacs and Vim is as a beginner as it can get. Nano comes pre-installed on most distros and is usually the first cli-text editor most people use. It is simple, minimal, intuitive, and perfect for casual config editing.
Also read: nano editor in Linux – A Complete Beginner’s Reference to the nano editor
To get started with Vim, check out: Nano tutorial
ne
If you want something with high-end features like the ones Vim has but at the same time want a more gradual learning curve, ne is just the thing for you. By default ne comes with syntax-highlighting, a macro scripting system for automating keystrokes, regex support and bracket matching which are all the things lacking in nano. However, it follows nano’s approach in its intuitive and simple key bindings.
micro – A simple and easy to use text editor
Micro is a terminal-based text editor that aims to be easy to use and intuitive while also taking advantage of modern terminals’ full capabilities. From the project page:
micro aims to be somewhat of a successor to the nano editor by being easy to install and use in a pinch, but micro also aims to be enjoyable to use full time, whether you work in the terminal because you prefer it (like me), or because you need to (over ssh).
Features are as follows:
- Standard keybindings (Ctrl-s to save, Ctrl-z to undo, Ctrl-q to quit, etc.)
- Syntax highlighting for over 140 programming languages supported
- Full support for the mouse. It means you can click and drag to select the text, double click select by word, and triple-click to select by line
- Multiple cursors
- Configurable keybindings and settings (tab width, tabs vs. spaces, diff gutter, etc.)
- Built-in terminal emulator
- Splits and tabs
- Automatic linting and commenting via Lua plugins
- Plugin manager to download additional Lua plugins other users have made
- Terminal emulator
- And much more
neovim – Vim fork focused on extensibility, usability, and backward comparability
Neovim is a fork of vim with additional features. The authors of Neovim wanted text editor features to improve Vim’s extensibility and maintainability. It is fully compatible with Vim’s editing model and the Vimscript language. With 30% less source-code than Vim, the vision of Neovim is to enable new applications without compromising Vim’s traditional roles. Since Neovim is a drop-in replacement for vim, the learning curve is easier for existing vim users. Feature includes:
- Strong defaults
- Modern terminal features such as cursor styling, focus events, bracketed paste
- Built-in terminal emulator
- The plugin API
- LUA based scripting apart from Vimscript
Atom
Atom is a free and open-source text editor that’s developed by GitHub. Based on Electron (CoffeeScript, JS, Less, HTML), it’s a desktop application built using web technologies. Often being called the text editor of the 21st century, it’s a modern text editor that’s hackable to the core.
The major features of Atom are cross-platform editing, built-in package manager, file system browser, multiple pane support, find and replace function, and smart autocompletion. You can select from 1000s of open source packages and add new features to Atom. It’s also customizable to suit your needs and style.
Since Microsoft acquired GitHub, the pace of Atom’s development has slowed down (Probably because Microsoft owns Visual Studio Code). However, it’s still one of the best text editors for Linux out there.
Installing Atom
sudo apt install atom
You can also download the .deb and .rpm files from the official Atom website
Visual Studio Code
Like the best Linux distributions for programmers, there are various options for Linux editors that one can use to get their daily jobs done. Despite being created by Microsoft, Visual Studio Code is completely open-source, and its source code can be accessed on GitHub. As of today, over 2.6 million users use it.
Featuring a modern look, VS Code delivers a powerful performance despite being lightweight. There’s a vast library of extensions that enable support for more languages, commands, debuggers, etc. This cross-platform tool (Linux, macOS, and Windows.) comes with out-of-the-box support for TypeScript, JavaScript, and Node.js.
VS Code installation command:
sudo apt install code
If you’re running CentOS, Fedora, or OpenSUSE, you can download the .rpm file from the official website.
Conclusion
As a developer or someone who is into software development, you are aware that the efficiency of your code writing will play a big role in deciding how quickly you can get your job done. If you are not using the best terminal editor, then you may be slowing down your progress.