eshell: fix hyperbole and remove unused sudo toggle

This commit is contained in:
MitchMarq42 2022-12-04 13:22:22 -09:00
parent eb7f03b1c9
commit 640211d570
2 changed files with 9 additions and 19 deletions

View File

@ -40,11 +40,6 @@
"b" (general-key "C-c C-e") "b" (general-key "C-c C-e")
"r" (general-key "C-c C-v r") "r" (general-key "C-c C-v r")
"s" 'eshell) "s" 'eshell)
;; eshell fixes
(general-define-key
:states 'normal
:maps 'eshell-mode-map
"I" 'eshell-evil-insert-line)
(provide 'mitch-keybinds) (provide 'mitch-keybinds)
;;; mitch-keybinds.el ends here ;;; mitch-keybinds.el ends here

View File

@ -156,20 +156,15 @@ This is taken from a website that I can't remember at the moment."
(if (null args) (bury-buffer) (if (null args) (bury-buffer)
(mapc #'find-file-other-window (mapc #'find-file-other-window
(mapcar #'expand-file-name (flatten-tree (reverse args)))))) (mapcar #'expand-file-name (flatten-tree (reverse args))))))
(defun aweshell-sudo-toggle () (defun mitch/eshell-setup-keys ()
"Toggle sudo with current command." (evil-collection-define-key
(interactive) 'normal
(save-excursion 'eshell-mode-map
(let ((commands (buffer-substring-no-properties (kbd "I") 'eshell-evil-insert-line
(progn (eshell-bol) (point)) (point-max)))) (kbd "RET") 'hkey-either))
(if (string-match-p "^sudo " commands) (advice-add 'evil-collection-eshell-setup-keys
(progn :after 'mitch/eshell-setup-keys))
(eshell-bol)
(while (re-search-forward "sudo " nil t)
(replace-match "" t nil)))
(progn
(eshell-bol)
(insert "sudo ")))))))
(use-package eat (use-package eat
:straight (:repo "https://codeberg.org/akib/emacs-eat" :straight (:repo "https://codeberg.org/akib/emacs-eat"
:files ("*.el" "dir" "*.info" "*.texi" "*.ti" ("e" "e/*"))) :files ("*.el" "dir" "*.info" "*.texi" "*.ti" ("e" "e/*")))