Introduction

The number of Linux text editors has been steadily rising over the past two decades. Long gone are the days when Vi and Vim were your only choice. Naturally, the introduction of new text editors has also sparked a debate among Linux users. Which is the best text editor for Linux?

This article provides a review of the most popular, feature-rich, and useful source-code text editors. You might already have your favorite, but we strongly recommend you consider the options below.

list of the best linux text editors for programmers

What is a Text Editor in Linux?

A text editor, also known as a code editor, is an application designed for coding and editing in HTML, CSS, JavaScript, PHP and many other programming languages. Most editors come with features such as syntax highlighting, easy navigation, customizable interfaces, search and replace options, and so on.

In Linux, there are two types of text editors:

  • Command-line text editors. A good example is Vim, which gives you the option of jumping into the editor from the command line. System admins will find this very useful when editing configuration files.
  • Graphical user interface (GUI) text editors. This type of text editor features a GUI but cannot be used from the command line.

Best Text Editor Options For Programmers

Vim

Almost all Linux distributions come with the Vim editor installed. Its predecessor, the infamous Vi editor, was available on Linux from the very start.

Pros: Vim supports automatic commands, digraph inputs (useful in programming), split and session screens, tabs, colored syntax (color-coded by function), and tagging. It can be configured with plugins and comes with a tutorial (use the vimtutor command). When you master the commands, Vim is very efficient.

Cons: It does not have a GUI. The only way you can initiate Vim is from the command line. That is its biggest strength and weakness. The user interface is user-unfriendly while some commands are unintuitive. Coding a file from scratch would be too complicated. The learning curve can be steep, but Vim is very popular in the Linux community.

screenshot of the vim text editor

Nano Editor

Nano is a revision of an older editor called pico and comes pre-loaded on most Linux installations. Nano is an ideal lightweight editor for beginners.

Pros: It supports GNU Autoconf, interactive search-and-replace, auto-indent, and spellcheck. Nano is intuitive and easy to use. It lists the keystroke commands at the bottom of the editor, so you don’t have to memorize or look them up.

Cons: The list of commands is short and some are unintuitive.

nano text editor

Atom

Atom is a popular open-source code/text editor that works across several platforms such as Windows, Mac, or Linux.

Pros: Atom has color-coded syntax, a smart autocomplete feature, multiple panes, and a search-and-replace feature. It also has its own package manager for plugins, so you can easily expand its functionality. You can also customize the appearance manually by using themes. A new plugin – called teletype – allows you to share workspaces with other Atom users.

Cons: Most users will have to tweak the default configuration. Low-spec computers will struggle to run Atom, especially if you load multiple projects.

How to Install

Atom is not typically included in a default Linux installation. Install it with the following commands:

sudo add-apt-repository ppa:webupd8team/atom
sudo apt-get update
sudo apt-get install atom

For RedHat or CentOS systems, use the yum install command instead of apt-get install.

atom text editor

Sublime Text

What makes Sublime Text stand out is its ability to make use of each OS’ native functionalities. That makes Sublime Text one of the more resource-efficient options.

Pros: Sublime Text is highly customizable, both in appearance and in functionality (using plugins). In addition to having many of the basic editor features (like colored syntax and searchability), Sublime adds a Goto Anything feature. You can search inside or outside the application or open and manipulate files with a quick keystroke. It also allows multiple selections, so you can highlight multiple lines and edit them all at once.

Cons: Sublime Text has a steep learning curve even though it’s designed to simplify workflows. You can use it free of charge, but it has a very intrusive popup system asking users to buy a license.

How to Install

Sublime Text is not a default application on most Linux installations. Install it with the following command:

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt update
sudo apt install sublime-text

installing Sublime Text

Gedit

Gedit is a text editor that comes with the GNOME desktop environment. The design emphasizes simplicity so gedit is a great editor for beginners. Even though simple in design, gedit is a powerful tool.

Pros: The uncomplicated interface includes clipboard support, multilanguage spellchecking, undo/redo, syntax highlighting for various languages (C, C++, Java, Python, etc,), color-coded syntax, and has a flexible plugin system.

Cons: This editor works well if you do not need too many features, or if you simply prefer a clean interface. Gedit works great with GNOME, but there are better options for other desktop environments.

How to Install

On older versions of Linux, or versions without GNOME, it may not come pre-installed. Install Gedit with the following command:

sudo apt-get install gedit

gedit text editor being installed on linux

Visual Studio Code

If you’ve installed Anaconda on Linux, you may be familiar with the option to install Microsoft Visual Studio Code. Even though it’s from Microsoft, VSCode is cross-platform, meaning it works on Windows, Linux, and Mac.

Pros: Visual Studio Code is lightweight but powerful, and it offers an extensive library of add-ons. These include additional programming language support, debuggers, and commands. This text editor is an excellent choice for developing JavaScript applications and working in cross-platform environments.

Cons: Compared to other text editors on this list, VSCode might not always run properly on Linux, especially Ubuntu. It is also known to use a lot of memory and CPU resources. Furthermore, it may run slower compared to other text editors.

How to Install

Install VSCode with the following command:

sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
sudo apt-get update
sudo apt-get install ubuntu-make

visual studio code welcome menu with help

GNU Emacs

GNU Emacs is a text/code editor for Linux professionals created by Richard Stallman, the founder of the GNU project. Emacs allows you to write code, display a manual, or draft an email from the same interface.

Pros: It has content-aware editing modes, extensive documentation and a tutorial, incredible language support, and a package manager for extensions. It also offers cross-compatibility with other GNU apps, including an organizer, mail app, calendar, and debugger.

Cons: It’s not for everyone. You might choose Emacs if you have multiple different tasks and want a standard interface. It’s designed for the Linux power user, so if that’s you, it’s worth a try.

How to Install

Install GNU Emacs with the following command:

sudo add-apt-repository ppa:kelleyk/emacs
sudo apt update
sudo apt install emacs26

gnu emacs welcome page

Notepadqq

Notepadqq is a Linux editor inspired by the Notepad++ application for Windows. Even though different developers manage the projects, Notepadqq is a fair replica of Notepad++.

Pros: Notepadqq supports tabbed projects, color-coded syntax, syntax highlighting, auto-tabbing, and a good search-and-replace feature. It has a smart-indent feature that remembers the indentation settings of the last line typed. Another strongpoint is how efficiently it converts files between various types of character encoding.

Cons: Notepadqq supports over 100 languages but if you compare it to other text editors, Notepadqq’s set of features might seems lacking. It opens any text file though it doesn’t do tag matching or auto-completion.

How to Install

Install Notepadqq with the following command:

sudo snap install --classic notepadqq

notepadqq main screen sample


Note: Most modern Linux distributions support Snap. If you’re running CentOS (or another Linux distribution without Snap), you’ll need to install the Snap app first.


Brackets

Brackets is a Linux editor designed around HTML and web design. It’s a cross-platform editor so that you can run it on Windows, Mac, or Linux for a seamless editing experience.

Pros: Brackets is a great choice for web developers. It includes live-preview for testing the appearance of your HTML code, plus inline editors. Like many other editors, it supports many extensions to add functionalities.

Cons: Brackets may stutter on older computer systems. Natively, it only supports HTML, CSS, and JavaScript. You can add more with extensions, though.

How to Install

Install Brackets with the following command:

sudo add-apt-repository ppa:webupd8team/brackets
sudo apt-get update
sudo apt-get install brackets

brackets editor getting started page

Bluefish Text Editor

The bluefish text editor is aimed at making coding more accessible. It works on most platforms so that you can use it on Linux, Mac, or Windows.

Pros: Bluefish can be enhanced with plugins and supports standard features like color-coded syntax, auto-indent, and auto-complete for tags and classes. It also features an auto-recover option, in case of a power outage or system crash. It organizes data and code in a way that’s intuitive and easy to read.

Cons: Bluefish is not updated regularly and is already getting a bit outdated. It is useful if you are new to writing code or editing configuration files. However, some advanced features are tough to find, and the UI is not optimized for advanced users.

How to Install

Install Bluefish by executing the following command:

sudo add-apt-repository ppa:klaus-vormweg/bluefish
sudo apt-get update
sudo apt-get install bluefish

bluefish text editor interface after installing

Geany

Geany works as a text editor, but its primary function is as an Integrated Desktop Environment (IDE). It is a lightweight GUI text editor with basic IDE features. Its primary purpose is to be tight and compact with short load times and limited dependencies on separate packages or external libraries on Linux.

Pros: It is a compact cross-platform, flexible and powerful editor that supports most programming languages. It is customizable with plugins, and features a split window, colored syntax, line numbering, and autocomplete.

Cons: Not everyone will need IDE features, meaning that Geany is focused on coding from scratch and debugging issues. Use Geany if you need full programming functionality, including the editor, build automation, and debugging all accessible from a single interface.

How to Install

Install Geany with the following command:

sudo apt-get update
sudo apt-get install geany

geany text editing menu

Conclusion

This guide should give you a solid idea of which code editor is going to be best for your needs. Each code editor reviewed has its strengths and weaknesses.

Even if none of the text editors in our list pique your interest, there are many alternatives.