aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config/emacs
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-04-24 04:04:14 +0530
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-04-24 04:04:14 +0530
commit1de12e582b9c6aa6cbbbbd5e2bd49c84c6b71f7d (patch)
treee818b30bab26bfe572c048ad2c66448ec8e8843d /Emacs/.config/emacs
parentc135997363495a523ff28ab30086d766a26d7c95 (diff)
downloaddotfiles-1de12e582b9c6aa6cbbbbd5e2bd49c84c6b71f7d.tar.gz
dotfiles-1de12e582b9c6aa6cbbbbd5e2bd49c84c6b71f7d.tar.bz2
dotfiles-1de12e582b9c6aa6cbbbbd5e2bd49c84c6b71f7d.zip
(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.
Diffstat (limited to 'Emacs/.config/emacs')
-rw-r--r--Emacs/.config/emacs/config.org20
1 files changed, 20 insertions, 0 deletions
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