Table of Contents

Debian Text Editors

Debian provides several text editors with different learning curves and capabilities.

nano

Beginner-friendly, simple modal editor. Starts in edit mode:

nano file.txt

Common commands (Ctrl prefix):

Quick, non-destructive, forgiving. Good for quick edits and scripts.

vi/vim

Powerful but steep learning curve. Three modes:

Basic workflow:

vim file.txt
i              # enter insert mode
[edit text]
Esc            # back to normal
:wq            # save and quit
:q!            # quit without saving

Useful normal mode commands:

Vim has syntax highlighting, text objects, macros, and extensive customization.

emacs

Extensible, powerful, but also steep. Heavy Ctrl usage. Start:

emacs file.txt

Commands:

Less common on systems without X11; vim is usually available everywhere.

ed

Minimal line editor, rarely needed:

ed file.txt

Useful only when nothing else available (embedded systems, minimal recovery).

Choosing an Editor

Set default editor:

export EDITOR=vim
export EDITOR=nano

Used by crontab -e, visudo, and many tools. Pick one and learn it:

For shell scripts: vim with syntax highlighting makes debugging easier. For one-liners: nano is faster.