Hot tips collection about using VIM


Today i try to learn VIM and found several trivial things that probably gain my effectivity about using VIM. Note that i use VIM for editing PHP, Python, Javascript, CSS and HTML. Also i create my own VIM like Netbeans ( Which it’s still my primary IDE for web development ) in http://github.com/yodiaditya/vim-netbeans. Here are hot tips :

How to indent visual blocks in VIM ?
After blocking using v, now press > for right indentation or < for indentation. Press . for repeat it's command if you think need to indent more. Fix indent width by put shiftwidth=2 or more in .vimrc. For auto-indent, press == How to block one line in VIM ?
Using shift+v

How to paste with indentation included ?
After blocking code with v and y (for yanking / copy ), select your cursor to where the start aligning position. Then you can use ]p for paste text aligning indentation with surroundings

I will update this post as i found another tips.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.