summary refs log tree commit diff stats
path: root/emacs/.emacs.d/main.el
diff options
context:
space:
mode:
authorAlan Pearce2019-08-01 17:36:43 +0200
committerAlan Pearce2019-08-01 17:36:43 +0200
commit8a652a8ec8620e043d9b0c1c5d4d58c402a3db66 (patch)
treedb47bdf9add352319411483d38a057bc9a5bb890 /emacs/.emacs.d/main.el
parentb7c34e2d75a4709bf6bf9d0c0f2d4fc8b908a437 (diff)
downloaddotfiles-8a652a8ec8620e043d9b0c1c5d4d58c402a3db66.tar.lz
dotfiles-8a652a8ec8620e043d9b0c1c5d4d58c402a3db66.tar.zst
dotfiles-8a652a8ec8620e043d9b0c1c5d4d58c402a3db66.zip
Emacs: improve eshell setup
Diffstat (limited to 'emacs/.emacs.d/main.el')
-rw-r--r--emacs/.emacs.d/main.el39
1 files changed, 38 insertions, 1 deletions
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))