News for hackers. Stuff that matters.
Re:Efficient Editing With vim by lanstein on Friday September 25, 2009 @02:03PM (#843959)
Amazingly, this is the first I've heard of fx/tx/Fx. How ridiculously awesome.
Re:Efficient Editing With vim by latortuga on Friday September 25, 2009 @02:54PM (#844062)
This is especially powerful when trying to move small chunks of code around. Say you have something like

document.getElementById('asweetid')

and you want to grab just the id for use elsewhere. In command mode pressing f' will move your cursor to the quote, yf' will put 'asweetid' into your yank register and a p anywhere else will paste it. I also make heavy use of ctx where x is a character on a line that I want to replace up to. The best part about vim, I think, is how I think about the commands in my head and they just kind of flow out of my fingers.

"Hmm I want to change (press c) to (press t) that closing paren (press shift 0)."

Even just typing that my left hand instinctively moved toward the caps lock to go to command mode.

Re:Efficient Editing With vim by nostrademons on Friday September 25, 2009 @03:42PM (#844169)
Yeah, I use 'dt,' or 'dt)' all the time to move single arguments of functions around, and 'd%' to move the function calls themselves.
Re:Efficient Editing With vim by puffythefish on Friday September 25, 2009 @09:10PM (#844820)
yi' will also work in this example.
Re:Efficient Editing With vim by joshuaxls on Friday September 25, 2009 @02:58PM (#844067)
I have this printed out and taped up right next to my monitor: http://wint1.kaist.ac.kr/files/attach/images/59/450/vi-vim-c...

It's helped me polish off those last few vim commands that I never got used to. I recommend looking at it daily.

Re:Efficient Editing With vim by chewbranca on Friday September 25, 2009 @06:25PM (#844568)
I've got that cheat sheet saved on my computer and I've looked at it several times before, but today was the first time I realized that you can hit '&' to repeat the last :s command on the current line. Very slick!!
Re:Efficient Editing With vim by joshuaxls on Friday September 25, 2009 @07:05PM (#844643)
Yep, and 'g&' is really helpful. It runs the last substitute across the entire file, preserving flags.
Re:Efficient Editing With vim by sofal on Friday September 25, 2009 @06:52PM (#844613)
I thought I was a Vim master and I just looked at that and discovered once again how stupid and inefficient I've been this whole time. This sort of thing keeps happening to me with Vim.
Re:Efficient Editing With vim by mhansen on Saturday September 26, 2009 @08:20AM (#845374)
Source: http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial...

That's the tutorial that fed me that chart in easy-to-manage pieces, easing me into vim nicely.

Also highly recommended, the rant by the same guy: http://www.viemu.com/a-why-vi-vim.html