Shell-based plain text editors give you a quick way to edit texts

## Why you should learn how to use shell-based text editors

As a data scientist, you'll possibly end up working on a remote machine. This necessitates using a remote ssh session, usually in a terminal shell. At other times, in a pinch, you might need to quickly edit a file on your local filesystem and need access to a shell. Thus, knowing how to use/wrangle at least one of the built-in ones that are widely available in most systems will allow you to make quick edits on the fly.

## Most important shell text editor usage steps

The most important things to learn are to:

1. Open a file
2. Edit and navigate through it
3. Save and close it

As long as you can master those three actions in any text editor, you're gold. Don't worry about other extensions and add-ons until you've mastered these steps and can execute them from memory.

## Which shell text editors exist?

Three of them are the most famous:

• nano
• vi/vim
• emacs

The venerable nano is usually available in most systems, and has a relatively low learning curve. You can also customize it to do syntax highlighting! (see: Enhance nano with syntax highlighting)

vi/vim is the butt of many jokes on "how to exit text editors", but really it's easy:

1. Hit escape
2. Quickly hit :wq (the colon enters command-line mode, the w stands for write, and the q means quit)
3. Hit enter

In normal mode, there is also: Shift + zz for save and quit, or Shift + zq for quit without save. (h/t Arkadij Kummer for surfacing this one to me.)

If you need to save the file, you'll be prompted.