Text editor

Text editor #

A text editor allows you to edit plain (i.e. non-formatted) text. A text editor can open any file produced with a text editor (and more), regardless of the file’s extension.

In this sense, Microsoft Word is not a text editor (neither are Apple Pages or LibreOffice Writer).

Most operating systems comes with one or several text editor(s) pre-installed, such as Notepad++ (Windows), TextEdit (macOS), gedit (default Ubuntu), etc.

Usage #

Your IDE is an (enhanced) text editor, so you can use it as such.

But it some scenarios, it can be useful to use a lighter program, for instance for:

  • editing the configuration file of a program,
  • modifying a small script (or even a single command-line instruction) copy-pasted from the web,
  • etc.

Among other reasons:

  • opening an IDE can take time,
  • if your IDE has autosave enabled, you may accidentally add unrelated files to your current project,
  • etc.

Advanced text editors #

For most purposes, a basic text editor should be sufficient.

But depending on your workflow, you may want to try a more advanced one.

VSCode #

We already introduced VSCode in the section dedicated to IDEs.

vi and emacs #

These are two keyboard-centric editors. Both were developed in the 70’s (before the mouse became a widespread peripheral) but are still commonly used today (in some form) by developers.

We do not recommend learning vi or Emacs at this (early) stage of your studies, because it often requires time, and you arguably have more fundamental thing to learn. But you may give them a try at some point of your career, because they may significantly improve your productivity.

vi/vim/neovim #

vi was initially released 1978, as part of the first BSD distribution. The original program is rarely used today, but vim (for “vi improved”), released in 1991, and neovim, released in 2015 are still popular among developers. For instance, 22% (resp. 12%, non-exclusive) of respondents to the 2023 Stack Overflow developer survey use vim (resp. neovim) as a code editor.

vi/vim/neovim is a so-called modal editor, meaning that users can switch between different modes. In one mode, pressing a standard key inserts the corresponding character on screen, whereas in another mode, pressing the same key has a different functionality (navigation, copy, paste, etc.). These functionalities are referred to as vi keybindings or vi motions, and allow performing a variety of text editing operations in an efficient way.

vi keybindings are commonly used in applications other than vi/vim/neovim, with dedicated plugins. For instance, most code editors/IDEs (VSCode, IntelliJ IDEA, Emacs, etc.), terminal emulators or even web browsers have plugins for vi keybindings.

Note. vim and neovim are very customizable, with comprehensive collections of (community-developed) plugins, which allows using them as IDEs. We do not recommend trying this at this stage of your studies, because configuration may require a significant time investment (more than VSCode for instance).

Warning. The original vi still comes pre-installed on many operating systems (Windows, macOS, Linux, …), and may be the default text editor opened by terminal-based applications (e.g. git) on your system. If this is the case (and if you do not know the vi keybindings), we recommend changing this setting.

Emacs #

Emacs was initially written in 1976. The most popular version is GNU Emacs, released in 91, was notably co-developed by Richard Stallman.

Emacs is partly responsible for popularizing (sequences of) combinations of keys (e.g. Ctrl+<letter>), as opposed to modal editors like vi. GNU Emacs has more than 10 000 built-in commands, and also provides a (limited) mouse interface.

5% of respondents to the 2023 Stack Overflow developer survey use Emacs as a code editor.

Emacs is also very customizable, with a comprehensive collections of (community-developed) plugins (probably more comprehensive than vim), and dedicated software repositories. Notably, Emacs tends to serve as a unique user interface for a variety of tasks (code editing, terminal emulation, email management, web browsing, playing music/videos, etc.).

Note. Emacs can be used as an IDE, but for the same reason as for vim or neovim, we do not recommend trying this at this stage of your studies.