Jump and move in a vim jump list

Tags: vim

In Vim, you can move very fast with jump command

Jumping with H M L

  • H jump to the top of the screen
  • M jump to the middle of the screen
  • L jump to the bottom of the screen

Example commands

H
M
L

Result

enter image description here

Jump to match parentheses

You can jump between ( ), { }, [ ].

Move cursor to it and press % to jump between pair.

Example command

f(
%
%
f{
%
%
/[<cr>
%

Result

match parentheses

Jump between HTML/XML tag with matchit plugin

just enable it in your VIMRC file with the following commands

filetype plugin on
runtime! macros/matchit.vim

After enable plugin, if you open existing XML or HTML files, vim automatic detect file type and matchit work.

However, if you 've just typed XML or HTML element and want matchit to work you need to run to command :set ft=html (or other file types) ft is short form of filetype. Therefore you can use :set filetype=html as well.

Example of commands to jump between tag with %. Assume that you have some HTML elements and already run :set ft=html

gg
/div<cr>
%
%
%

Result

match it result