From 8519a2af5847ecb69ff841db8ef76ed42465fb80 Mon Sep 17 00:00:00 2001 From: condy Date: Thu, 11 Apr 2024 03:30:31 +0800 Subject: [PATCH] rg eshell integration Fix #111 --- lisp/init-shell.el | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lisp/init-shell.el b/lisp/init-shell.el index 888658c..48ba128 100644 --- a/lisp/init-shell.el +++ b/lisp/init-shell.el @@ -79,15 +79,9 @@ current directory." (let ((dir (completing-read "Directory: " (delete-dups (ring-elements eshell-last-dir-ring)) nil t))) (eshell/cd dir))) - (defun eshell/bd () - "cd to parent directory with completions." - (let ((dir default-directory) - dirs) - (while (not (string-empty-p dir)) - (push (file-name-directory dir) dirs) - (setq dir (substring dir 0 -1))) - (let ((dir (completing-read "Directory: " dirs nil t))) - (eshell/cd dir)))) + (defun eshell/rg (&rest args) + "ripgrep with eshell integration." + (eshell-grep "rg" (append '("--no-heading") args) t)) :custom ;; The following cmds will run on term. (eshell-visual-commands '("top" "htop" "less" "more" "telnet"))