Text Editors

Commands for creating and editing files on the cluster.

Command

Description

nano <file>

Simple, user-friendly text editor

vim <file>

Advanced text editor (steep learning curve)

nano

A beginner-friendly editor with on-screen shortcuts.

nano myfile.txt

Basic nano Commands

Key

Action

Ctrl + O

Save (Write Out)

Ctrl + X

Exit

Ctrl + K

Cut line

Ctrl + U

Paste

vim

A powerful modal editor for advanced users.

vim myfile.txt

vim Quick Reference

Vim is a “Modal” editor, which means what keys do changes depending on what mode you’re in.

Key

Action

i

Enter insert mode

Esc

Exit insert mode

:

Enter Command mode

: -> w -> q

Save and quit

: -> q -> !

Quit without saving

Also, many commands can or must be prefaced with a quantifier

Key

Action

d-> d

Delete, then current line

d-> 5

Delete, then 5 lines

c-> w

Cut (delete then insert), then 1 word

u

Undo

G

Go to end of file

g -> g

Go to beginning of file

vim Modes

  1. Normal mode (default) - Navigate and issue commands

  2. Insert mode - Type text (press i to enter)

  3. Command mode - Type : commands (press : to enter)

Tips

  • New to Linux? Start with nano - it’s easier to learn

  • vim is powerful but has a steep learning curve

  • Consider taking a vim tutorial if you plan to edit files regularly

  • Both editors work with remote files via SSH