Terminal text editors: nano, vim and Emacs
In short: Servers often have no graphical interface. There you edit files with terminal editors. nano is the simplest, vim and Emacs are powerful but need learning.
nano
Like a normal text program: just type. The shortcuts are shown at the bottom (^ means Ctrl).
Ctrl+Osave,Ctrl+Xquit,Ctrl+Wsearch,Ctrl+Kcut line.
Start: nano file.txt. Ideal for beginners and quick changes.
vim
The trick: vim has modes.
- Normal mode (start): keys are commands.
h j k lmove,dddelete line,yycopy,ppaste,uundo. - Insert mode: enter with
i, types normal text,Escback. - Command mode:
:wsave,:qquit,:wqboth,:q!without saving,/wordsearch.
If you are stuck: Esc, then :q!. vimtutor is a built-in exercise of about 30 minutes. Vim (or the similar vi) is available almost everywhere.
Emacs
An extensible “operating system inside an editor” programmed in Lisp (email, notes, Git). Shortcuts with Ctrl and Meta (Alt), for example Ctrl+X Ctrl+S save, Ctrl+X Ctrl+C quit.
Which one?
For daily use on servers nano is enough. Whoever programs a lot in the terminal learns vim basics because they run everywhere. See also IDE for the graphical variant.