News for hackers. Stuff that matters.

Ask HN: Vim Pro Tips?

Lots of HN users use Vim, does anybody have an pro-tips for the average Vim user they can share, to help boost everybody's productivity
( 3 comments | 11 points | on HN )
Re:Ask HN: Vim Pro Tips? by ehamberg on Monday January 30, 2012 @11:39AM (#3529407)
Learn to use text objects¹ – they are what makes Vim much more powerful than Vi. You can even add custom text objects² such as function argument³ or camel case word⁴.

Text objects let you operate on logical units of text. E.g. “change inner word” (ciw), “delete a sentence” (das), change inner double quotes (ci"), ...

[1] http://blog.carbonfive.com/2011/10/17/vim-text-objects-the-d...

[2] http://vim.wikia.com/wiki/Creating_new_text_objects

[3] http://www.vim.org/scripts/script.php?script_id=2699

[4] http://www.vim.org/scripts/script.php?script_id=1905

Re:Ask HN: Vim Pro Tips? by DavidChouinard on Monday January 30, 2012 @09:21AM (#3528876)
I highly recommend installing Janus, it comes with a bunch of useful customization and plugins: https://github.com/carlhuda/janus
Re:Ask HN: Vim Pro Tips? by swatermasysk on Tuesday January 31, 2012 @10:35AM (#3533644)
I recommend avoiding packages like Janus when you are just getting started.

The key to vim success is really understanding the basics. Packages like Janus obscure some of this and hurt truly learning the fundamentals.

Similarly, I would limit plugins entirely. Maybe limit yourself to 1 or 2 new plugins per week until you really get understand whats going on.