From 1de12e582b9c6aa6cbbbbd5e2bd49c84c6b71f7d Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Wed, 24 Apr 2024 04:04:14 +0530 Subject: (Emacs/config)+method of searching +literate/el-files Uses grep by default. Also made a method of searching a discrete list of files using grep. --- Emacs/.config/emacs/config.org | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Emacs/.config/emacs') diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index 2154153..279e617 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -712,6 +712,26 @@ thing faster and within Emacs lisp. ~rgrep~ is useful though. rg-default-alias-fallback "all" rg-buffer-name "*ripgrep*")) #+end_src +*** Searching Lisp config +Using grep search all the elisp files. With ~wgrep~ this provides +another method of refactoring. +#+begin_src emacs-lisp +(use-package grep + :general + (search-leader + "c" #'+grep/search-config) + :config + (defun +grep/grep-cmd-str (str files) + (cl-reduce + #'concat + (append (list grep-command "\"" str "\" ") + (mapcar (lambda (x) (concat x " ")) files)))) + + (defun +grep/search-config () + (interactive) + (grep (+grep/grep-cmd-str (read-string "Search?: ") + +literate/el-files)))) +#+end_src ** Olivetti Olivetti provides a focus mode for Emacs, which makes it look a bit nicer with fringes. I also define ~+olivetti-mode~ which will -- cgit v1.2.3-13-gbd6f