~e-v/eshell-follow.el

Make eshell follow your buffers in Doom Emacs
README: Export to md
README: add missing src block end
README: Change screencast link to srht site

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~e-v/eshell-follow.el
read/write
git@git.sr.ht:~e-v/eshell-follow.el

You can also use your local clone with git send-email.

eshell-follow.el is a global minor mode for Doom Emacs which changes eshell’s working directory to the one in which the file visited by the current buffer is stored (or, in the case of a Dired buffer, the directory it is visiting). I find it handy when working with different windows, as it saves me from cd’ing into a new directory every time I change switch windows.

By default, it applies to eshell’s pop-up window, as displayed after running +eshell/toggle.

Screencast of eshell-follow in action.

#Installation

Add this to your packages.el file:

(package! eshell-follow
  :recipe (:type git :repo "https://git.sr.ht/~e-v/eshell-follow.el"))

And something like this to config.el:

(use-package! eshell-follow
  :after-call eshell-follow-global-mode)

Then run doom sync.

#Usage

Run eshell-follow-global-mode to enable it. Run it again to disable it.

#Customisation

Change the value of the eshell-follow-buffer-name variable according to which eshell buffer should follow your buffers. For example:

;; Default name of the eshell buffer created by the `eshell' command
(setq eshell-follow-buffer-name "*doom:eshell*")

You can add a keybinding to toggle eshell-follow-global-mode by adding this to config.el:

(map! :map eshell-mode-map :localleader :desc "Toggle eshell-follow" "f" #'eshell-follow-global-mode)

This allows you to enable eshell-follow with SPC m f when the eshell popup is active.

#Bugs and suggestions

Please use the bug tracker or send me an email.

#TODO

  • Don’t restrict package to Doom Emacs.
  • Allow regexp in eshell-follow-buffer-name.