3 ms·
Yes, indeed. You can also do that, and other small variations on it depending on the context, with a macro. You go to the end of "josh", press F3, add a comma
by molteanu 7y ago
Yes, indeed. You can also do that, and other small variations on it depending on the context, with a macro.
You go to the end of "josh", press F3, add a comma and a space and you delete the rest of the line, until "sam" is now the next symbol after your cursor. Then you go to the end of the line (C-e) and press F4. Your macro is now recorded. To call it, press F4 repeatedly until everything is on one line.
As a bonus, you can actually name your macro, assign a keybinding to it, and can also save it as Lisp code.
- numlocked 7y agoWorks well for a few dozen entries...less so for a few hundred or a few thousand :)
- xenophonf 7y agoEmacs keyboard macros can easily operate on thousands of things. Just give it a prefix argument like C-u 1000 <macro-key-combo>.
- tspiteri 7y agoOr use the C-u 0 prefix to repeat till there is an error, possibly at the end of buffer. And if you don't want to go on to the end of the buffer, narrow to the required region (C-x n n) and widen afterwards (C-x n w).
- OrderlyTiamat 7y agohell yeah, this is what I'm on about, I'm still learning stuff about emacs tricks here. I love this, thanks for bringing this up!