News for hackers. Stuff that matters.
Re:Vim Anti-Patterns by tgb on Wednesday October 05, 2016 @11:21AM (#12644588)
I love vim but admittedly ctrl-backspace-backspace is just as fast as d2b and works in nearly any editor. The stuff i really like is stuff as dt. which will delete until the end of the sentence, ie until the period. Or di( which deletes everything inside the parenthesis.
Re:Vim Anti-Patterns by clifanatic on Wednesday October 05, 2016 @01:26PM (#12645852)
I decided one year that I would force myself (a vi die-hard) to use emacs for everything for an entire year, to see if I ever got used to it. One thing that never stopped driving me crazy was that there's no efficient way to duplicate a line like yyp in vim. The closest I could ever get in emacs was ctrl+k k ctrl+y ctrl+y (that is, delete the line and then paste it back twice). Looking online for a solution leads me to believe that the only way to really effectively use emacs is to learn lisp and reprogram it yourself.
Re:Vim Anti-Patterns by qwertyuiop924 on Wednesday October 05, 2016 @02:40PM (#12646559)
...Which is actually quite simple. Here's my function for doing that that I wrote just now:

  (defun duplicate-line 
    (interactive)
    (kill-whole-line)
    (yank)
    (yank))
Five lines, and it took me all of ten minutes to write, including looking up the names of all the functions. Of course, there's probably a better way to do this, but I don't know what it is. Now all you have to do is bind it to a key.

Or, of course, you could just record a keyboard macro to do it instead.

Re:Vim Anti-Patterns by _asummers on Wednesday October 05, 2016 @11:21PM (#12649994)
I have mine set up like this:

https://gist.github.com/asummers/7784d40b1bc53ee309777274e9d...

That way I can hit M-w when I don't have a region and get the copy behavior for the whole line.

Re:Vim Anti-Patterns by qwertyuiop924 on Thursday October 06, 2016 @03:20AM (#12650761)
That's cool. I have no idea how that works, but it's cool.
Re:Vim Anti-Patterns by omaranto on Wednesday October 05, 2016 @11:25PM (#12650020)
You could use C-S-<backspace> C-y C-y, which uses kill-whole-line (C-S-<backspace>) instead of kill-line twice (C-k C-k).

I think that's reasonably short (same number of non-modifier keys as vi!). Of course, if you find yourself doing it a lot, you can configure Emacs however you want.

Re:Vim Anti-Patterns by arecarn on Wednesday October 05, 2016 @11:37AM (#12644749)
Try Ctrl-w in insert mode it is similar to Ctrl-backspace. Also in normal mode try db. where '.' just repeats the last command 'db'. I find I'm never really using counts in vim but instead using the repeat command '.' since it provides better visual feedback.
Re:Vim Anti-Patterns by lunchboxsushi on Wednesday October 05, 2016 @11:25AM (#12644624)
also for html cit and the rest for general purposes ci), ci', ci", interchangeably with d, or y. that was probably the first time I just has to sit back and take a second.