Skip to content

Commit

Permalink
rg eshell integration
Browse files Browse the repository at this point in the history
Fix #111
  • Loading branch information
condy0919 committed Apr 10, 2024
1 parent a02a6b5 commit 8519a2a
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lisp/init-shell.el
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 8519a2a

Please sign in to comment.