Hacker News new | past | comments | ask | show | jobs | submit login
Best of Vim Tips (rayninfo.co.uk)
117 points by res0nat0r on Jan 7, 2010 | hide | past | favorite | 20 comments



Man, that's intimidating. I found 2 new tricks on the top screen and I still don't want to scroll through the rest.


My exact thoughts. I think I am going to print it out and study it for a while. I am sure there are tons of productivity things I can learn..and things I should probably already know.


For intimidation, try browsing all the help pages of vim! :-)

I've concluded that vim has every feature I can imagine - and then some. But I can't appreciate it until I've imagined it. The problem is that it is impossible to find that feature in the help, since I don't know its name. Google helps here, by searching for a description of it in my own words.

Every tutorial I've ever seen on vim is mind-bogglingly boring. I've learnt the most by just hearing one tip at a time - and searching for one when I need it.

Some people can absorb massive quantities of raw information, but I need to integrate new information into my other knowledge in order to be able to use it. Then there's practicing the habit of using it, and learning in what situations it is appropriate. For a tool, it's not knowledge per se, but the application of knowledge that is useful.


Oh man, the very first one was something I'd been wishing for!

I need it for appending to text I've searched for, especially if I need to do it a few times. e.g. for adding an argument to a few method calls. I usually go `n` (repeat the search), then `e` (go to the end).

That's enough. One tip at a time maxes out my absorption rate.


This is the best list of vim tips online I believe, and the author is always updating it. Last update: 22-DEC-09

One of my favorites that has saved me a ton of time more than once:

" rename a string with an incrementing number

:let i=10 | 'a,'bg/Abc/s/yy/\=i/ |let i=i+1 # convert yy to 10,11,12 etc


"This is the best list of vim tips online "

When does a collection of items go from a list of tips to a lengthy compendium of details?

Like others, I started looking over the page and got discouraged; there's too damn much.


For my understanding (ignoring the loop):

    between mark a and mark b: 'a,'b
    goto lines containing Abc: g/Abc
    recognizable substitute:   s/yy/\=i/
      = prefixes a variable (escaped with \)
A problem is that it will only replace the first `yy` on the line (if you add g, to make it s/yy/\=i/g, it replaces all of them, but with the same value of i.

How to make it increment multiple yy's on the one line?


So after griping that the page is a case of data overload, I though there should be another way to get this much information parceled out in more digestible portions.

In order to help myself (and others so interested) to improve my German vocabulary I set up a Twitter account that shoots off random German - English word definitions: @TeachMeGerman. Every hour you can learn a new word (modulo the data set size, though the repetition is actually handy).

I bet such a thing, if it does not already exist, would be good way to pick up new vim tips.

Thoughts?

Volunteers? :)


I tried registering @vimtips, but turns out it's already been done: http://twitter.com/vimtips Hasn't tweeted in while though.


Oops, that's me. I'll get that app tweeting again. Sorry.


Sweet. I don't knok if this is a practical approach for you, but for @TeachMeGerman I set up a large text file (one I had created for a "flash card" app) and a small Ruby script to grab a random entry and post it to Twitter, driven via cron.

This way I didn't have to remember to do anything. :)


This article suffers from a bad case of TL;DR. There's great information buried in there, but it's presentation is poor. Typography should be taught in primary school to stave this off.


I think it's better to just know how/why all these tricks and tips work instead of having a huge list that's hard to read. It's much easier to apply that way.


A lot of these (at least in the beginning) appear to be regexp tricks rather than vim ones


Ok, now I'm totally sure I will never in my life try Vim - I'm not Rainman.


This is pure gold. Thanks.


hey guys this page is fantastic and the author responds in a very friendly way. You don't have to read it in one shot. Its more like a cheat sheet, than an extensive manual.

I love it as it is.


Yes, I'd like to second that- it's a great reference list that gave me exactly what I needed already quite a few times.


What does this do?

'a,'bg/fred/s/dick/joe/igc : VERY USEFUL


between (book)mark a and b find fred then search the line and replace any occurrence of dick with joe with a confirmation. there a couple of modifiers on there I don't know but I think that's pretty much it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: