This list covers movement shortcuts for navigating in Vim (Normal & Visual modes).
Mastering these is key to efficient editing.
Temp / most recent:
vim:
I frequently use, e.g., dt: or ct: to delete/change everything up until a colon (or some other character).
t and f work without a command as well, so to move to colon use f: and to move to right before colon use t:
ctrl + w delete everything before the cursorctrl + k delete everything after the cursor
Basic Movement
Shortcut
Action
h
Move left one character
l
Move right one character
0
Move to beginning of line
^
Move to first non-whitespace character
$
Move to end of line
w
Move to beginning of next word
e
Move to end of current/next word
ge
Move to end of previous word
b
Move to beginning of current/previous word
Screen Movement
Shortcut
Action
H
Move to top of screen
M
Move to middle of screen
L
Move to bottom of screen
Ctrl + u
Move up half a screen
Ctrl + d
Move down half a screen
Ctrl + b
Move up one screen
Ctrl + f
Move down one screen
zz
Center cursor on screen
zt
Move cursor line to top of screen
zb
Move cursor line to bottom of screen
Search Movement
Shortcut
Action
/pattern
Search forward for pattern
?pattern
Search backward for pattern
n
Repeat search in same direction
N
Repeat search in opposite direction
*
Search forward for word under cursor
#
Search backward for word under cursor
Paragraph & Sentence Movement
Shortcut
Action
{
Move backward one paragraph
}
Move forward one paragraph
(
Move backward one sentence
)
Move forward one sentence
Mark & Jump Movement
Shortcut
Action
ma
Set mark a at current position
`a`
Jump to exact position of mark a
'a
Jump to beginning of line with mark a
“
Jump back to last position before latest jump
''
Jump back to beginning of line before latest jump
Ctrl + o
Jump to older cursor position
Ctrl + i
Jump to newer cursor position
Search Matching Brackets
Shortcut
Action
%
Jump to matching bracket, brace, or parenthesis
Line & Character Navigation
Shortcut
Action
fx
Find next occurrence of x in current line
Fx
Find previous occurrence of x in current line
tx
Move before next occurrence of x in current line
Tx
Move before previous occurrence of x in current line
;
Repeat last f, t, F, or T
,
Repeat last f, t, F, or T in opposite direction
Scrolling Without Moving Cursor
Shortcut
Action
Ctrl + y
Scroll up one line
Ctrl + e
Scroll down one line
Tip: Use counts before motions (e.g., 5w moves forward 5 words).
See :help motion.txt in Vim for more details.
Vim Editing Shortcuts
This list covers editing shortcuts for Vim, including copying, deleting, yanking, pasting, and replacing.
Copying (Yanking)
Shortcut
Action
yy
Yank (copy) the current line
3yy
Yank 3 lines
yw
Yank to beginning of next word
y$
Yank from cursor to end of line
y^
Yank from cursor to first non-whitespace character
y}
Yank to end of paragraph
yiw
Yank inner word (without spaces)
yaw
Yank a word (with spaces)
"+y
Yank to system clipboard
"+yy
Yank line to system clipboard
Deleting
Shortcut
Action
x
Delete character under cursor
X
Delete character before cursor
dd
Delete current line
3dd
Delete 3 lines
dw
Delete to beginning of next word
d$
Delete from cursor to end of line
d^
Delete from cursor to first non-whitespace character
d}
Delete to end of paragraph
diw
Delete inner word
daw
Delete a word (with spaces)
"+d
Delete to system clipboard
"+dd
Delete line to system clipboard
Pasting
Shortcut
Action
p
Paste after cursor or below current line
P
Paste before cursor or above current line
"+p
Paste from system clipboard after cursor
"+P
Paste from system clipboard before cursor
Changing (Replace + Insert)
Shortcut
Action
rX
Replace character under cursor with X
R
Enter replace mode (type over existing text)
cw
Change to beginning of next word (delete + insert mode)
c$
Change to end of line
ciw
Change inner word
caw
Change a word (with spaces)
C
Change from cursor to end of line
Undo & Redo
Shortcut
Action
u
Undo last change
U
Undo all changes to current line
Ctrl + r
Redo undone change
Indentation
Shortcut
Action
>>
Indent current line
<<
Un-indent current line
3>>
Indent 3 lines
3<<
Un-indent 3 lines
=
Auto-indent selection or motion
=%
Auto-indent between matching braces
Tip: Motions can be combined with commands.
For example: y$ (yank to end of line), d} (delete to end of paragraph), caw (change a word).
Terminal Movement Shortcuts
This list covers common movement shortcuts for navigating in the terminal (Bash, Zsh, etc.).
Most of these work in Readline-based shells (default on Kali).
OSCP essentials (use constantly)
Shortcut
Action
Ctrl+A
Beginning of line
Ctrl+E
End of line
Ctrl+U
Delete to beginning of line
Ctrl+K
Delete to end of line
Ctrl+W
Delete previous word
Alt+Backspace
Delete previous word
Alt+D
Delete next word
Ctrl+Y
Paste (yank) last deleted text
Ctrl+L
Clear screen
Ctrl+R
Search command history
Ctrl+_
Undo last edit (Readline)
Ctrl+A # Start of lineCtrl+E # End of lineCtrl+W # Delete previous wordAlt+D # Delete next wordCtrl+U # Delete to beginningCtrl+K # Delete to endCtrl+R # Search historyCtrl+Y # Paste deleted textCtrl+L # Clear screen