Vim

fast deplacement are:

  • w: begin of the next word
  • b: begin of the back word
  • e: end of the next word

Searching

line

use f(charater) search next character use t(character) search before the next character

f and t can be use for delete everything until the character. ; can be use to repet and , unrepet

file

/(character) search the character in the file

n to next N to previous

moving quickly

horizontally

0: Moves to the first character of a line ^: Moves to the first non-blank character of a line $: Moves to the end of a line

vertically

Starting from k and j, we move on to a faster way of maneuvering vertically with:

} jumps entire paragraphs downwards { similarly but upwards CTRL-D lets you move down half a page by scrolling the page CTRL-U lets you move up half a page also by scrolling

Combinaison

Vim is a lot more powerfull when you combine the command and is done

2w will move you two words forward

the logic work with all the above command

gd to jump to definition of whatever is under your cursor gf to jump to a file in an import G to go to the end of the file % jump to matching ({[]})

Configuration

for me a first thing to do is enable the number line

# enambe number line
:set number

# realy maindy to use jump like 2j
:set relativenumber

# disable number line
:set nonumber

all the command in the /can be put in the .vimrc file to be enable globaly of vim

for more info see vim shortcut.