Skip to content

Instantly share code, notes, and snippets.

@gausby
Last active April 5, 2020 15:23
Show Gist options
  • Save gausby/6f9922f2a5ebd4a2445fb8bf9512b5c7 to your computer and use it in GitHub Desktop.
Save gausby/6f9922f2a5ebd4a2445fb8bf9512b5c7 to your computer and use it in GitHub Desktop.
(use-package eshell
:after projectile
:preface
(defun universal-argument-eshell ()
"wrap the `eshell'-command, with a check for whether or not
the universal argument has been applied, and how many times.
Zero times: normal behavior (eshell); Once: open a shell in the
current project root"
(interactive)
(cond ((equal current-prefix-arg nil)
(call-interactively 'eshell))
((equal current-prefix-arg (list 4))
(projectile-run-eshell))
))
;; mode hook
(defun mg/my-eshell-mode-hook ()
(set (make-local-variable 'global-hl-line-mode) nil))
;; :hook (eshell-mode . mg/my-eshell-mode-hook)
;; :bind
:config
(bind-keys
("C-x C-t" . universal-argument-eshell)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment