Contents
Vim Text Editor
Vim is the standard command-line text editor for High-Performance Computing (HPC). Since clusters are accessed via terminal-based SSH, Vim allows you to edit scripts and code directly on the remote server without needing a graphical interface.
Getting Started
To open an existing file or initialize a new blank file, use the following command:
vim filename.txt
Note: If the file does not exist, Vim will create it once you save and exit.
The Three Pillars: Vim Modes
Vim is "modal," meaning keys perform different actions depending on your current mode.
- Normal Mode: The default state for navigation, copying/pasting, and deleting text.
- Insert Mode: The mode used for typing and editing text.
- Command Mode: Used for file operations like saving, quitting, and settings.
Pro Tip: Press Esc at any time to return to Normal Mode. If you feel lost, hit Esc twice.
Essential Commands
Entering Insert Mode
| Command | Action |
|---|---|
i | Insert before the cursor |
a | Append after the cursor |
o | Open a new line below the current line |
Saving and Quitting
Run these from Normal Mode by typing : first:
| Command | Action |
|---|---|
:w | Write (Save) the changes |
:q | Quit (fails if there are unsaved changes) |
:wq | Save and Quit |
Efficient Navigation
In Normal Mode, use these shortcuts to move quickly through files:
| Command | Action |
|---|---|
gg / G | Jump to the beginning / end of the file |
:n | Go to line number n (e.g., :42) |
0 / $ | Jump to the start / end of the current line |
Search and Replace
Run these search patterns from Normal Mode:
/pattern # Search forward for 'pattern'
n / N # Find next / previous occurrence
:%s/old/new/g # Replace all 'old' with 'new' in file
n / N # Find next / previous occurrence
:%s/old/new/g # Replace all 'old' with 'new' in file
Undo and Text Manipulation
| Command | Action |
|---|---|
u / Ctrl+r | Undo / Redo last action |
dd / yy | Delete (Cut) / Yank (Copy) current line |
p | Paste text after the cursor |
SCU High-Performance Computing Technical Documentation — 2026.