4 ms·
ctrl-k ctrl-y ?
by rrmm 11y ago
ctrl-k ctrl-y ?
- lottin 11y agoNot quite the same. For instance, to duplicate a line in Emacs you have to go to the beginning of the line, kill it and then yank twice, and it doesn't even work always, particularly at the end of a buffer. In vi, it's just yyp. No corner cases.
- justinhj 11y agoI've been using emacs for a long time. When I duplicate a line I don't even know that I'm following the steps you mention, I just do it on autopilot. What I like most about emacs though is that I rarely have to do repetitive tasks because I can write a bit of lisp code to do them instead.
- fsck--off 11y agoOr you can go to the beginning of the line, press Control-space (set mark), press Control-e (end of line), then Meta-W (copy), and Control-y (paste).
- vithlani 11y agoOr you could use this: https://github.com/sawan/emacs-config/blob/e7e7635ca93589eda217abd6e99ea1b818b458c0/emacs24.el#L290 https://github.com/sawan/emacs-config/blob/e7e7635ca93589eda... and bind it to a nice key binding.
- zarkone 11y agoJust to share experience, i've recorded Macro named dup-line and bind to `C-M-y`. And find it very handy :)