deadgrep icon indicating copy to clipboard operation
deadgrep copied to clipboard

Please add some keyboard shortcuts to the search UI

Open Schnouki opened this issue 6 years ago • 3 comments

In search results, it would be super useful (for me) to have several shortcuts to change search parameters. For instance:

  • t: change search term
  • y s, y w, y r: change search type to strings, words, regexp
  • C s, C e, C i: set case to smart, sensitive, ignore
  • c n, c b, c a: change context to none, before, after
  • d: change directory
  • f a, f t, f g: change files to all, type, glob

In other words, please let me change all search parameters without having to move the point to a button and then hitting RET! :)

Schnouki avatar Aug 14 '19 10:08 Schnouki

Additional idea: Have a key to toggle trough the different options in the current line.

Gei0r avatar Feb 13 '20 07:02 Gei0r

And also will be great to add some keys for adding -u and -uu arguments.

s-kostyaev avatar Feb 13 '20 08:02 s-kostyaev

Just to help here (FYI). Following prompts the user for a new file type, then restarts the search.

(defun deadgrep-file-type ()
  "Prompt the user for a new file type, then restart the search."
  (interactive)
  (let ((new-file-type
         (deadgrep--read-file-type deadgrep--initial-filename)))
    (setq deadgrep--file-type (cons 'type new-file-type)))
  (rename-buffer
   (deadgrep--buffer-name deadgrep--search-term default-directory) t)
  (deadgrep-restart))

A use-package key binding:

:bind (:map deadgrep-mode-map
            ("T" . deadgrep-file-type))

bobslee avatar Sep 29 '22 09:09 bobslee