term/eshell: remove redundant keys (with evil-collection)
And expand comments + use windmove-* instead of evil-window-* so as to not exclude non-evil users from these keybinds.
This commit is contained in:
parent
448ec65997
commit
1b79aa1b4d
1 changed files with 30 additions and 33 deletions
|
@ -119,9 +119,11 @@ You should use `set-eshell-alias!' to change this.")
|
|||
(when (featurep! :editor evil +everywhere)
|
||||
(advice-add #'evil-collection-eshell-next-prompt-on-insert :override #'+eshell*goto-prompt-on-insert))
|
||||
|
||||
(defun +eshell|init-keymap ()
|
||||
"Setup eshell keybindings. This must be done in a hook because eshell-mode
|
||||
redefines its keys every time `eshell-mode' is enabled."
|
||||
(add-hook 'eshell-first-time-mode-hook
|
||||
(defun +eshell-init-keymap-h ()
|
||||
;; Keys must be bound in a hook because eshell resets its keymap every
|
||||
;; time `eshell-mode' is enabled. Why? It is not for us mere mortals to
|
||||
;; grasp such wisdom.
|
||||
(map! :map eshell-mode-map
|
||||
:n "RET" #'+eshell/goto-end-of-prompt
|
||||
:n [return] #'+eshell/goto-end-of-prompt
|
||||
|
@ -132,26 +134,21 @@ redefines its keys every time `eshell-mode' is enabled."
|
|||
:i "TAB" #'+eshell/pcomplete
|
||||
:i [tab] #'+eshell/pcomplete
|
||||
:i "C-d" #'+eshell/quit-or-delete-char
|
||||
:i "C-p" #'eshell-previous-matching-input-from-input
|
||||
:i "C-k" #'eshell-previous-matching-input-from-input
|
||||
:i "C-j" #'eshell-next-matching-input-from-input
|
||||
:i "C-n" #'eshell-next-matching-input-from-input
|
||||
"C-s" #'+eshell/search-history
|
||||
;; Tmux-esque prefix keybinds
|
||||
"C-c s" #'+eshell/split-below
|
||||
"C-c v" #'+eshell/split-right
|
||||
"C-c x" #'+eshell/kill-and-close
|
||||
"C-c h" #'evil-window-left
|
||||
"C-c j" #'evil-window-down
|
||||
"C-c k" #'evil-window-up
|
||||
"C-c l" #'evil-window-right
|
||||
"C-c h" #'windmove-left
|
||||
"C-c j" #'windmove-down
|
||||
"C-c k" #'windmove-up
|
||||
"C-c l" #'windmove-right
|
||||
[remap split-window-below] #'+eshell/split-below
|
||||
[remap split-window-right] #'+eshell/split-right
|
||||
[remap doom/backward-to-bol-or-indent] #'eshell-bol
|
||||
[remap doom/backward-kill-to-bol-and-indent] #'eshell-kill-input
|
||||
[remap evil-window-split] #'+eshell/split-below
|
||||
[remap evil-window-vsplit] #'+eshell/split-right))
|
||||
(add-hook 'eshell-first-time-mode-hook #'+eshell|init-keymap))
|
||||
[remap evil-window-vsplit] #'+eshell/split-right))))
|
||||
|
||||
|
||||
(def-package! eshell-up
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue