logo
Jiff Slater
🤔 About
✍️ Contact
📚Knowledge
30 Jul 2021
These articles have been archived. You may find them useful but I am no longer offering support for them. Check out my latest articles on plkt.io.
Time Saving Vim Movement Tips
28 July 2008

I must admit, even though I’ve been learning how to use Emacs, I’m still learning new tricks for Vim.

When I browse through the Vim help documents, I _always_ learn something new.

Today I will show you some time saving tips for moving around in Vim.

Basic

w - move forward by a word
Jack!  R_e_member that you have an appointment tomorrow.
w
Jack!  Remembe_r_ that you have an appointment tomorrow.

b - move backward by a word
Jack!  Remembe_r_ that you have an appointment tomorrow.
b
Jack!  _R_emember that you have an appointment tomorrow.

fx - search forward for the character x
Jack!  Reme_m_ber that you have an appointment tomorrow.
fo
Jack!  Remember that y_o_u have an appointment tomorrow.

tx - search to the character x
Jack!  Reme_m_ber that you have an appointment tomorrow.
to
Jack!  Remember that _y_ou have an appointment tomorrow.

Fx - search backward to the charater x
Jack!  Remember that _y_ou have an appointment tomorrow.
FR
Jack!  _R_emember that you have an appointment tomorrow.

Tx - search backward to the character x
Jack!  Remember that you have an _a_ppointment tomorrow.
Tc
Jac_k_!  Remember that you have an appointment tomorrow.

; - repeat command
, - repeat command in the opposite direction

% - move to matching paren, e.g. [{()}]
[_[_ -e ~/.xinitrc ]]
%
[[ -e ~/.xinitrc _]_]

Ctrl-U - move the window up a screenful
Ctrl-D - move the window down a screenful
Ctrl-E - move the window up a line (keep the cursor in the same place)
Ctrl-Y - move the window down a line (keep the cursor in the same place)
zt - move the window so the cursor is at the top of the screen
zb - move the window so the cursor is at the bottom of the screen