Vim-Style Code Editor
A browser-based code editor with Vim key bindings for efficient text editing. Perfect for quick code edits and note-taking.
NORMAL
Plain Text
Line: 1, Column: 0
Vim Key Bindings Reference
Vim is a modal editor with different modes for different tasks. Press Esc to return to normal mode from any other mode.
Modes
i- Enter insert mode (typing text)Esc- Return to normal modev- Enter visual mode (selection)V- Enter visual line modeCtrl+v- Enter visual block mode:- Enter command modeR- Enter replace mode
Basic Navigation
h- Move leftj- Move downk- Move upl- Move rightw- Move to next wordb- Move to previous word0- Move to start of line$- Move to end of linegg- Move to start of documentG- Move to end of document
Basic Editing
x- Delete character at cursordd- Delete current lineyy- Yank (copy) current linep- Paste after cursorP- Paste before cursoru- Undo last changeCtrl+r- Redoo- Insert new line below & enter insert modeO- Insert new line above & enter insert mode
Basic Search
/pattern- Search forward for pattern?pattern- Search backward for patternn- Go to next search matchN- Go to previous search match*- Search forward for word under cursor#- Search backward for word under cursor
Advanced Navigation
f{char}- Move to next occurrence of characterF{char}- Move to previous occurrence of charactert{char}- Move to before next occurrence of characterT{char}- Move to after previous occurrence of character;- Repeat last f, F, t, or T movement,- Repeat last f, F, t, or T movement, but in opposite direction%- Move to matching parenthesis, bracket, or brace{- Move to previous paragraph}- Move to next paragraphCtrl+u- Move up half a screenCtrl+d- Move down half a screenCtrl+b- Move up one full screenCtrl+f- Move down one full screenH- Move to top of screenM- Move to middle of screenL- Move to bottom of screen
Advanced Editing
c{motion}- Change text of motioncc- Change entire lineC- Change from cursor to end of lined{motion}- Delete text of motionD- Delete from cursor to end of liney{motion}- Yank (copy) text of motionY- Yank (copy) entire line (same as yy)r{char}- Replace character under cursor with charJ- Join current line with next line~- Switch case of character under cursorgu{motion}- Make motion text lowercasegU{motion}- Make motion text uppercaseg~{motion}- Toggle case of motion text>>- Indent current line<<- Outdent current line={motion}- Auto-indent text of motion
Text Objects
iw- Inner wordaw- A word (includes surrounding space)is- Inner sentenceas- A sentenceip- Inner paragraphap- A paragraphi(ori)- Inside parenthesesa(ora)- Around parenthesesi[ori]- Inside square bracketsa[ora]- Around square bracketsi{ori}- Inside curly bracesa{ora}- Around curly bracesi"- Inside double quotesa"- Around double quotesi'- Inside single quotesa'- Around single quotesit- Inside HTML/XML tagat- Around HTML/XML tag
Advanced Search & Replace
:%s/old/new/g- Replace all occurrences of 'old' with 'new':%s/old/new/gc- Replace all occurrences with confirmation:s/old/new/g- Replace all occurrences in current line:#,#s/old/new/g- Replace all occurrences between line # and #:g/pattern/d- Delete all lines containing pattern:v/pattern/d- Delete all lines not containing pattern
Common Command Combinations
| Command | Description |
|---|---|
ciw |
Change inner word (delete word and enter insert mode) |
ci" |
Change text inside double quotes |
ci( |
Change text inside parentheses |
ci{ |
Change text inside curly braces |
cit |
Change text inside HTML/XML tag |
diw |
Delete inner word |
di" |
Delete text inside double quotes |
yi) |
Yank (copy) text inside parentheses |
va{ |
Visually select text including curly braces |
ggVG |
Select entire document |
gg=G |
Auto-indent entire document |
gUiw |
Convert word to uppercase |
guap |
Convert paragraph to lowercase |
!}sort |
Sort lines until end of paragraph |
:%!jq . |
Format JSON (requires jq) |
Marks and Jumps
| Command | Description |
|---|---|
m{a-zA-Z} |
Set mark at current position |
`{a-zA-Z} |
Jump to mark |
'{a-zA-Z} |
Jump to line of mark |
`` |
Jump to position before last jump |
Ctrl+o |
Go to older position in jump list |
Ctrl+i |
Go to newer position in jump list |
Getting Started with Vim
- Start by mastering the basic navigation keys (h, j, k, l) before using arrow keys.
- Practice switching between normal mode and insert mode (Esc and i).
- Learn to use text objects (iw, i", i() for efficient editing.
- Use dot (.) to repeat the last change.
- Combine operators (c, d, y) with motions (w, $, %) for powerful editing.
Editor-Specific Features
- Ctrl+G: Shows file status information (line count, position)
- Drag and drop: You can drag text files directly into the editor
- Large file handling: The editor automatically optimizes for large files
- Keyboard shortcuts: Many browser shortcuts are intercepted to allow Vim commands
Common Vim Patterns
- Repeat with numbers: Prefix commands with numbers to repeat them (e.g., 5dd to delete 5 lines)
- Compound commands: Commands like
gUiw(uppercase inner word) combine multiple concepts - Dot command: Use
.to repeat the last change - Macro recording: Use
q{register}to record,@{register}to play back
Troubleshooting
- Stuck in a mode? Press Esc multiple times to ensure you're back in normal mode
- Command not working? Check if you're in the correct mode (normal, insert, visual)
- Browser conflicts? Some Vim commands may conflict with browser shortcuts
- Performance issues? For large files, some features are automatically disabled