Hacker News new | ask | show | jobs
by spiffworks 5395 days ago
You should look in to one of the functions listed here:

http://www.emacswiki.org/emacs/CopyingWholeLines

Not having to use 3 keystrokes in the place of one is the whole point of using Emacs.

2 comments

C-S-backspace is already bound to kill-whole-line.

But barring that, I don't think the point of using Emacs is to write shortcuts for nearly everything. That will effectively kill many benefits of Emacs.

Emacs has various verbs for moving around and learning those and combining them with other verbs will allow you to reuse the same patterns on various types of files and use-cases.

For example, without shortcuts, copying one line is C-a C-SPC C-n M-w but actually you just keep your finger on control all the time and it becomes C-(a SPC n) to select: I can do that pretty much instantaneously. Then I can choose whether to kill or copy: in the latter, I just add M-w and the former goes even faster: C-(a SPC n w).

But the benefit of doing the more complex way is that if you want to copy/kill the line above your current line, you just do C-(a SPC p w). Or if you want to kill a few words from the beginning of the line: C-a [M-d ...] or copy them: C-a [M-f ...] M-w. Or mark a few paragraphs, starting from the current one: M-{ [M-h ...] and you get the point.

If you had shortcut functions for various complete combinations then you'd actually have to step out of the flow whenever you don't have a readily available shortcut for something. And it's much faster to type a couple of "extra" characters because you can leverage the same operations into more complex combinations without consciously thinking about it.

I agree with you on many points, but there are a few things for which I prefer to have a dedicated shortcut. Specifically, basic functionality such as copying a line. More importantly, by your logic, we shouldn't have the C-k shortcut either. Wouldn't we be poorer for such a lack of divergence from bedrock abstraction?
I've started trying to switch over from vim to emacs, due to the fact that emacs seems better designed in general, with more - better extensions. I'd been wondering if there was some standard way of doing line deletion than the one I'd come up with. Apparently not.

Well, time to go back to viper-mode, with my old friends 'yy', 'dd', and 'kyy'.

Vim is better designed than Emacs for editing. Emacs is just better designed for everything else. To this day, there is no better way of scrolling text than j/k. That doesn't change the reality of Emacs' incredible flexibility.
Yes, and Emacs can also emulate ... Vim.

=> VIPER mode.

> Vim is better designed than Emacs for editing.

For you. Not for everyone.

excellent, thanks - another one to add to my (ever growing) .emacs.d