4 ms·
> Not good for editing I knew Emacs wasn't the editor for me when I found out that there isn't, by default, a way to quickly duplicate a line. Of course, the
by commandlinefan 6y ago
> Not good for editing
I knew Emacs wasn't the editor for me when I found out that there isn't, by default, a way to quickly duplicate a line. Of course, the emacs community says that adding this feature is a simple matter of defining a macro in your emacs config file. Very different mindset.
- jgilias 6y agoA huge part of why I've come to like it is because I use the Doom configuration that comes with sane and very usable defaults out of the box. A Vim user can hit the ground running with it. I don't think I could've persisted long enough had I tried using a vanilla GNU Emacs.
- rtkaratekid 6y agoI hit a wall, then hit the ground, then got up but now I seem to be hobbling along fine enough with my attempt to use Doom. It’s just that there’s no simple intro to the emacs paradigm so I find myself almost constantly confused when something doesn’t go as expected. It’s been... a month or two now? I do like the spacebar leader key though.
- jlokier 6y agoOf course there is a way to duplicate a line in Emacs by default. Like in vi, you compose simple commands. Let's see: ; Duplicates the current line S-C-backspace C-[y y] ; Duplicates the current line C-[a k k y y] ; Duplicates the current line C-[a SPC n w y y] ; Duplicates the current line C-[a SPC n] ESC w C-y Repeat duplicating until it looks like enough: ; Duplicate again until happy C-[y y y...] ; Duplicate again until happy C-x z z z... Duplicate 3 lines instead of 1: ; Duplicate this line and the next two C-[a u] 3 C-[k y y] Duplicate 10 times: ; Duplicate the current line 10 times C-[a k k] C-x ( C-y C-x ) C-u 10 C-x e ; Duplicate the current line 10 times C-[a SPC n w] C-x ( C-y C-x ) C-u 10 C-x e ; Duplicate the current line 10 times S-C-backspace C-x ( C-y C-x ) C-u 10 C-x e Remove duplicate lines instead: ; Select region, then M-x delete-duplicate-lines
- dotancohen 6y agoThank you very much!