Last active
February 20, 2018 04:24
-
-
Save compufox/ce9ab6abac372f5e9a79e25b7e250042 to your computer and use it in GitHub Desktop.
(should) move the cursor to the bottom of an eshell buffer on entering
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defvar *eshell-cursor-moved* nil) | |
| (defun move-eshell-cursor () | |
| (catch 'set-var | |
| (when (and (string-match "eshell" (buffer-name)) (not *eshell-cursor-moved*)) | |
| (progn | |
| (setq *eshell-cursor-moved* t) | |
| (goto-char (point-max)) | |
| (throw 'set-var nil))) | |
| (when (and (not (string-match "eshell" (buffer-name))) *eshell-cursor-moved*) | |
| (setq *eshell-cursor-moved* nil)))) | |
| (add-hook 'post-command-hook #'move-eshell-cursor) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment