top | item 22131879

(no title)

quickpost | 6 years ago

Doesn't sound crazy at all to me! I do this all the time using multiline editing in Sublime Text. It's the one part of a more modern IDE I have a hard time giving up (transitioning to Spacemacs currently). Will have to try out this script and see if it helps bridge the gap!

discuss

order

brlewis|6 years ago

If emacs keyboard macros haven't bridged the gap for you, try https://github.com/magnars/multiple-cursors.el

Keyboard macros: https://www.emacswiki.org/emacs/KeyboardMacros

MultusSalus|6 years ago

I’ve been using this for a few things, and while it’s a little more unwieldy than Sublime’s it works fine for most of my uses so I’d definitely recommend giving it a go.

numlocked|6 years ago

multiple-cursors is AMAZING and i use it all the time, but it does NOT work well for more than a few hundred lines of text. It gets incredibly slow.

quickpost|6 years ago

Perfect - I'll try this out. Thanks for helping me out despite my newby-ness!

eterm|6 years ago

I tend to do it in sublime with a regex:

Find/replace all:

  ^(.*)$\n
with

  "$1",

useragent86|6 years ago

That also works well in Emacs:

    C-M-% runs the command query-replace-regexp (found in global-map),
    which is an interactive compiled Lisp function in ‘replace.el’.

    It is bound to C-M-%, <menu-bar> <edit> <replace>
    <query-replace-regexp>.

    (query-replace-regexp REGEXP TO-STRING &optional DELIMITED START END
    BACKWARD REGION-NONCONTIGUOUS-P)

    Replace some things after point matching REGEXP with TO-STRING.
    As each match is found, the user must type a character saying
    what to do with it.  For directions, type <help> at that time.