How to refactor in the current buffer with isearch-occur and occur- edit-mode reddit / emacs ---------------------------------------------------------------------- tonyaldon · 2022-12-08 17:00 ---------------------------------------------------------------------- hexmode · 2022-12-08 20:25 TIL `C-s M-s o` to get into an occur buffer + `e` to get into `occur- edit-mode` (bundled in emacs) Nice. ---------------------------------------------------------------------- Pinsl · 2022-12-09 07:33 How would you do this without multiple-cursors? ---------------------------------------------------------------------- _viz_ · 2022-12-09 08:34 The usual way is to either use a keyboard macro or roll with C-M-%. The latter is more powerful than you might think since the replacement can contain arbitrary lisp expressions and has plenty of useful expansions like the number of current replacement, etc. I would recommend to read the docstring of query-replace-regexp to know more about it. ---------------------------------------------------------------------- Pinsl · 2022-12-09 08:37 Yeah right. I just found this: https://www.masteringemacs.org/article/evaluating-lisp-forms-regular- expressions This is amazing, I was not aware that you can use lisp expressions in query replace. It also works in evil substitute! ---------------------------------------------------------------------- kkvi115 · 2022-12-09 10:50 So I can use this to replace helm swoop ---------------------------------------------------------------------- tonyaldon · 2022-12-09 20:57 You can give a try to this video: https://youtu.be/efBlQF6lb2I ---------------------------------------------------------------------- tonyaldon · 2022-12-09 20:58 I'm glad you like it 😁 ---------------------------------------------------------------------- tonyaldon · 2022-12-09 21:01 I don't know helm swoop. ---------------------------------------------------------------------- tonyaldon · 2022-12-13 07:53 Hey u/Pinsl, at the end of the yesterday's video, we answered to your question (in the context of dired buffers): https://youtu.be/x4s0KKSVuN0?t=908 ---------------------------------------------------------------------- Pinsl · 2022-12-14 07:31 nice, thank you!