简体   繁体   中英

emacs paredit - how to delete quotes

I'm using the emacs starter kit, https://github.com/technomancy/emacs-starter-kit , which comes with paredit mode. I'm writing some javascript, and would like to remove something from quotes. Eg. "somestring" should become somestring

What the best way to do that? Going in the other direction is easy, I just select somestring and type a quote.

Thanks.

Use Ms 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 Ms.

If you're on the first quote, you can Mx delete-pair . If you do it all the time, bind that to some convenient key.

将点放在字符串的任何位置并键入MsMx paredit-splice-sexp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM