News for hackers. Stuff that matters.
Re:Vim anti-patterns by scott_s on Tuesday February 07, 2012 @05:48PM (#3564021)
'gg' and 'G' in command mode will send you to the beginning and the ending of the file.

I've always used ':1' for the beginning and ':$' for the end. To me, the benefit of this is that I always use the same mechanism to go to a particular line of a file. (I often do, say, ':45' if an error is reported at line 45.)

For moving up and down large distances, I also prefer ctrl+u for up and ctrl+d for down. There is a minor difference: ctrl+f will put the last line at the top of the screen, filling the rest with the tilde-abyss. That always bothers me.

Re:Vim anti-patterns by jdludlow on Tuesday February 07, 2012 @05:59PM (#3564076)
45G does the same thing as :45, so the people using gg and G can also remain consistent with their muscle memory.
Re:Vim anti-patterns by dasil003 on Wednesday February 08, 2012 @04:44AM (#3565912)
The beautiful thing about muscle memory is you can have two similar concepts map to completely different keys and your muscles will handle it just fine. I happily use gg/G/:# without mental overhead.
Re:Vim anti-patterns by emillon on Wednesday February 08, 2012 @02:19AM (#3565578)
And for completeness, so does 45gg.
Re:Vim anti-patterns by edanm on Wednesday February 08, 2012 @04:47AM (#3565921)
I like the idea of :1 and :$, but how do you get it to work in conjuction with selections (visual mode)?

If I want to select the entire contents of the file, hitting "v" then ":1" seems not to work.

Re:Vim anti-patterns by graywh on Tuesday February 07, 2012 @09:32PM (#3564765)
The reason for that difference between ctrl-d and ctrl-f is that one moves the cursor half a page (or 'scroll') and the other scrolls the screen one page.