Hi Everyone.

I’m using emacs and ripgrep to find what I’m looking for in a folder. Ripgrep shows the result of what I’m looking beautifully. Thats great. Every time I open a result, ripgrep buffer disappears.

Does anyone know how to open a temp buffer to view result then I can close it and go back to rg result again, so I don’t have to type my search query.

Thanks.

You are viewing a single thread.
View all comments
1 point

my solution: switch to any non-ripgrep buffer and navigate with next-error

   (defun bss/next-error-in-same-window ()
     (interactive)
     (let ((display-buffer-overriding-action '(display-buffer-same-window (inhibit-same-window . nil)))) (next-error)))
   (defun bss/previous-error-in-same-window ()
     (interactive)
     (let ((display-buffer-overriding-action '(display-buffer-same-window (inhibit-same-window . nil)))) (previous-error)))
   (global-set-key (kbd "s-[") 'bss/previous-error-in-same-window)
   (global-set-key (kbd "s-]") 'bss/next-error-in-same-window)
permalink
report
reply

Emacs

!emacs@communick.news

Create post

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

  • Windows
  • Mac OS X
  • GNU/Linux and BSD (Just get it from your distribution’s package manager)

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for “emacs” and “vi” link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

Community stats

  • 18

    Monthly active users

  • 562

    Posts

  • 2.4K

    Comments