diff --git a/emacs/init.org b/emacs/init.org index f708558..625ce02 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -2133,7 +2133,14 @@ A handy utility that reverse the current frame window split (vertical to horizon * EShell Easy keybinding to open EShell: #+BEGIN_SRC emacs-lisp - (leader-def-key "'" 'eshell) + (defun open-eshell (&optional arg) + (interactive "P") + (if (and (fboundp 'projectile-project-root) + (projectile-project-root)) + (projectile-run-eshell arg) + (eshell arg))) + + (leader-def-key "'" 'open-eshell) #+END_SRC Make EShell's tab completion work like Bash's: @@ -2322,7 +2329,6 @@ Manage node version via NVM within Emacs: (nvm-use version))) #+END_SRC - * Typescript #+BEGIN_SRC emacs-lisp (use-package typescript-mode @@ -4933,13 +4939,20 @@ A better terminal emulator for Emacs. Replaces ansi-term, not EShell. (apply #'eshell-exec-in-vterm args))) :commands (vterm vterm-other-window vterm-mode)) - (defun open-vterm (&optional new-buffer) + (defun run-vterm (&optional new-buffer) (interactive "P") (let ((buffer-name (when (not new-buffer) "vterm"))) (if (and buffer-name (get-buffer buffer-name)) (switch-to-buffer buffer-name) (vterm buffer-name)))) + (defun open-vterm (&optional arg) + (interactive "P") + (if (and (fboundp 'projectile-project-root) + (projectile-project-root)) + (projectile-run-vterm arg) + (run-vterm arg))) + (leader-def-key "sv" 'open-vterm) #+END_SRC