What are some advanced editing techniques that save you a lot of time?
I was looking at the demo gif on Sublime Website. I didn't even know multiple cursors feature exists. That lead me to its multiple-cursors.el.
I'm sure some of you guys here are using modules/shortcuts/macros you take for granted, but some of us haven't even heard of them. Would be great if you can share them.
Posted Mar 25, 2017, 2:14 AM UTC
multiple cursors is pretty dope, but every time i use it i get this feeling like i'm never quite sure if it's saving me more time than defining and repeating a quick keyboard macro would have.
nearly everybody knows about search forward / backward but i didn't really appreciate using them as cursor movement commands to jump around in the file until i started seeing other folks using search commands as cursor movement.
the thing that saves me a ton of time that i rarely see other people use is text registers. for a long time i was in the bad habit of just using the regular kill ring for these things, but registers is way faster when you're juggling several snippets and you don't want to have to sit there and M-y a bunch of times to get to the thing you wanted to yank back.
Someday, text registers. Someday.
Text registers... So useful when grading programming assignments... One register for "Please make sure the program names and interfaces match the question", one for "This does not compile", one for "This does not pass the tests", one for "Someone please kill me now"...
And to navigate to the previous/next instance of the identifier at point even more quickly, the package
highlight-symbolprovideshighlight-symbol-next/prev.Isn't that just *?
For me it's just
M-n(andM-pfor the previous symbol).cool tip, thanks for this!
Text registers and C-x e macros are what always make me give up on IDEs after a few days, no matter what other features they have.
I use text registers a lot, but haven't been a macro user because I never really learned it. I just read this, and now I'm definitely going to start using macros.
You might try elmacro-mode which makes macros more comfortable. I wrote a couple of wrappers which I use everyday. With this you can: press F6 start start recording, press it again when done. Now you're asked if you want to repeat the macro (once per <return> or repeatetly. Also the generated code will be written to a config file including a repeater-wrapper, so that you can M-x macro-repeat anytime later. Or press C-F6 anytime to execute a macro (with completion).
I tried ordinary macros earlier today. Worked like a charm. I don't think I need anything more, tbh. But thank you anyway.
The best thing is if you repeat things multiple times do C-x e the first time then just e the rest.
If text registers are too much for you, you might prefer something like
helm-show-kill-ringas part ofhelmthis let's you search through recent kills (with fuzzy searching) and paste them.Obviously this is less precise and requires more keypresses that text registers - but potentially uses less mental state.
Definitely. (
counsel-yank-popfor me). My fingers just type a fragment of the one I want without me having to engage much brain power, and you don't have to plan ahead.Of course some tasks would be better with registers, especially when working with macros, but in general I like solutions where I don't have to think much, and being a touch typist, there's minimal friction to typing fragments of text.
It's bound to
helm-show-kill-ringand so it's very easy (and fast) for me to narrow to previous kill ring entries.For the registers, I always thought that their calling key stroke sequence is like in an old adventure: "You're follow a long, dark and winding path ..." :-)