HPC Documentation

Guides, references, and tutorials for the WCM cluster

VIM

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

CommandAction
iInsert before the cursor
aAppend after the cursor
oOpen a new line below the current line

Saving and Quitting

Run these from Normal Mode by typing : first:

CommandAction
:wWrite (Save) the changes
:qQuit (fails if there are unsaved changes)
:wqSave and Quit

Efficient Navigation

In Normal Mode, use these shortcuts to move quickly through files:

CommandAction
gg / GJump to the beginning / end of the file
:nGo 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

Undo and Text Manipulation

CommandAction
u / Ctrl+rUndo / Redo last action
dd / yyDelete (Cut) / Yank (Copy) current line
pPaste text after the cursor

SCU High-Performance Computing Technical Documentation — 2026.