I'm using the emacs starter kit, https://github.com/technomancy/emacs-starter-kit, which comes with paredit mode.
"somestring" should become
What the best way to do that?
Going in the other direction is easy, I just select
somestring and type a quote.
Use M-s to splice the current form into the outer form. This works with quotes, parentheses, and similar stuff, depending on the exact mode you're in:
(bla (|foo)) -> (bla |foo) (bla "|foo") -> (bla |foo)
Where | is the position of the cursor when you press M-s.
If you're on the first quote, you can M-x delete-pair. If you do it all the time, bind that to some convenient key.
Put point anywhere on the string and type M-s or M-x paredit-splice-sexp.
©2020 All rights reserved.