diff options
author | Alan Pearce | 2019-08-01 17:36:43 +0200 |
---|---|---|
committer | Alan Pearce | 2019-08-01 17:36:43 +0200 |
commit | 8a652a8ec8620e043d9b0c1c5d4d58c402a3db66 (patch) | |
tree | db47bdf9add352319411483d38a057bc9a5bb890 /emacs | |
parent | b7c34e2d75a4709bf6bf9d0c0f2d4fc8b908a437 (diff) | |
download | nixfiles-8a652a8ec8620e043d9b0c1c5d4d58c402a3db66.tar.lz nixfiles-8a652a8ec8620e043d9b0c1c5d4d58c402a3db66.tar.zst nixfiles-8a652a8ec8620e043d9b0c1c5d4d58c402a3db66.zip |
Emacs: improve eshell setup
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/.emacs.d/eshell/alias | 2 | ||||
-rw-r--r-- | emacs/.emacs.d/main.el | 39 |
2 files changed, 40 insertions, 1 deletions
diff --git a/emacs/.emacs.d/eshell/alias b/emacs/.emacs.d/eshell/alias new file mode 100644 index 00000000..16feb8c8 --- /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 1135b4a2..8add90c8 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)) |