User Tools

Site Tools


vim:vim

General Vim Tips

Vim is the best Text Editor on this planet. Visit http://www.vim.org for more Information.

Plugins

There are thousands of plugins available for VIM. Here you can find some instructions to those i use: VIM Plugins
There is also an article about an awesome BASH-IDE like plugin!

Command Mode

Movement:

movement keys direction
h left
j down
k up
l right

Moving wordwise

Key Action
b go to the beginning of the current word
B go to the beginning of the current WORD
e go to the end of the current word
E go to the end of the current WORD

Deleting with d

key action
dd delete the whole line
d1 delete one line
de delete the current word from the beginning
db delete the current word from the end

Line selection

:1   /this moves to line 1

Going to the end of the document:

G

Searching

/searchterm

to search again just type:

/

Search / Replace

so search/replace every Word in the whole document:

:%s/searchword/replaceword

Recording and using Macros

Commenting out multiple Lines

To comment out multiple Lines at once:

  • V → Enter Visual mode
  • mark your lines
  • : → you get :'<,'>
  • s/^/# /

Cheat sheet

Vim related links

vim/vim.txt · Last modified: 2013/01/24 23:33 by skull@darktemple.ch