From 8a652a8ec8620e043d9b0c1c5d4d58c402a3db66 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 1 Aug 2019 17:36:43 +0200 Subject: Emacs: improve eshell setup --- emacs/.emacs.d/eshell/alias | 2 ++ emacs/.emacs.d/main.el | 39 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 emacs/.emacs.d/eshell/alias diff --git a/emacs/.emacs.d/eshell/alias b/emacs/.emacs.d/eshell/alias new file mode 100644 index 0000000..16feb8c --- /dev/null +++ b/emacs/.emacs.d/eshell/alias @@ -0,0 +1,2 @@ +alias up eshell-up $1 +alias pk eshell-up-pk $1 \ No newline at end of file diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el index 1135b4a..8add90c 100644 --- a/emacs/.emacs.d/main.el +++ b/emacs/.emacs.d/main.el @@ -280,7 +280,8 @@ With two prefix arguments, write out the day and month name." (add-to-list 'projectile-globally-ignored-files "package-lock.json") (add-to-list 'projectile-globally-ignored-files "pnpm-lock.yaml") (with-eval-after-load 'evil-ex - (evil-ex-define-cmd "prg" #'projectile-ripgrep)))) + (evil-ex-define-cmd "prg" #'projectile-ripgrep) + (evil-ex-define-cmd "pesh[ell]" #'projectile-run-eshell)))) (use-package counsel-projectile :commands (counsel-projectile-switch-project @@ -439,11 +440,47 @@ With two prefix arguments, write out the day and month name." (use-package eshell :defer 5 + :commands (eshell) :functions (eshell/pwd) + :init (progn + (with-eval-after-load 'evil-ex + (evil-ex-define-cmd "esh[ell]" #'eshell))) :custom ((eshell-prompt-function (lambda () (concat (eshell/pwd) "\n$ "))) (eshell-prompt-regexp "^[$][[:blank:]]"))) +(use-package esh-autosuggest + :ghook ('eshell-mode-hook)) + +(defun my-bind-esh-push () + (general-define-key + :states '(normal insert) + :keymaps 'local + "M-q" #'eshell-push-command)) + +(use-package esh-buf-stack + :ghook ('eshell-mode-hook #'my-bind-esh-push) + :config (setup-eshell-buf-stack)) + +(use-package bash-completion + :after (eshell)) + +(use-package fish-completion + :when (executable-find "fish") + :after (bash-completion) + :custom ((fish-completion-fallback-on-bash-p t)) + :config (global-fish-completion-mode)) + +(use-package esh-help + :after (eshell) + :config (setup-esh-help-eldoc)) + +(use-package eshell-fringe-status + :ghook '(eshell-mode-hook)) + +(use-package eshell-up + :after (eshell)) + (use-package shell :general (:keymaps 'shell-mode-map "C-d" #'comint-delchar-or-maybe-eof)) -- cgit 1.4.1