summaryrefslogtreecommitdiff
path: root/eshell-conf.el
diff options
context:
space:
mode:
Diffstat (limited to 'eshell-conf.el')
-rw-r--r--eshell-conf.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/eshell-conf.el b/eshell-conf.el
index 3e95e8d..7b226e1 100644
--- a/eshell-conf.el
+++ b/eshell-conf.el
@@ -1195,5 +1195,22 @@ command."
(add-hook 'eshell-mode-hook #'ghostel-eshell-visual-command-mode)
+;;;; Copy-mode also enters view-mode
+
+(defun copy-and-view-mode (&optional arg)
+ "Also enter `view-mode' in copy-mode.
+If ARG is non-nil, behave just like `ghostel-copy-mode'."
+ (interactive "P")
+ (cond
+ ((eq ghostel--input-mode 'copy)
+ (cond ((null arg) (view-mode -1)))
+ (ghostel-readonly-exit))
+ (t
+ (ghostel-copy-mode)
+ (cond ((null arg) (view-mode 1))))))
+
+;; C-c C-t
+(define-key ghostel-mode-map (vector 3 20) #'copy-and-view-mode)
+
(provide 'eshell-conf)
;;; eshell-conf.el ends here