diff options
author | jao <jao@gnu.org> | 2022-01-12 02:18:18 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-01-12 02:18:18 +0000 |
commit | ac58616752652cf6203f9562a9137ab45e2d57d5 (patch) | |
tree | 74837fce10e5db12f58874867c09d3f16c988db8 /init.org | |
parent | dc1ebade6e706f652b43a459cff1ed571a096b29 (diff) | |
download | elibs-ac58616752652cf6203f9562a9137ab45e2d57d5.tar.gz elibs-ac58616752652cf6203f9562a9137ab45e2d57d5.tar.bz2 |
vterm redux
Diffstat (limited to 'init.org')
-rw-r--r-- | init.org | 33 |
1 files changed, 28 insertions, 5 deletions
@@ -1793,10 +1793,35 @@ (autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t) (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) #+end_src +*** vterm + #+begin_src emacs-lisp :tangle no + (defvar jao-use-vterm nil) + + (use-package vterm + :ensure t + :init (setq vterm-kill-buffer-on-exit t + vterm-copy-exclude-prompt t + jao-use-vterm t) + :config (jao-define-attached-buffer "\\*vterm\\*" 0.5) + :bind (("<f3>" . vterm))) + + (use-package eshell-vterm + :ensure t + :config (eshell-vterm-mode)) + + (defun jao-exec-in-vterm (cmd bname) + (if (string-blank-p (or cmd "")) + (vterm) + (let ((vterm-shell cmd) + (vterm-kill-buffer-on-exit t) + (buff (generate-new-buffer bname))) + (switch-to-buffer buff) + (vterm-mode)))) + + #+end_src *** term #+begin_src emacs-lisp (defvar-local jao-term--cmd nil) - (defvar jao-use-vterm nil) (defun jao-term--find (cmd) (seq-find (lambda (b) @@ -1935,10 +1960,8 @@ ***** Completion #+begin_src emacs-lisp (defun jao-eshell-completion-capf () - (let ((c (bash-completion-dynamic-complete-nocomint - (save-excursion (eshell-bol) (point)) - (point) - t))) + (let* ((b (save-excursion (eshell-bol) (point))) + (c (bash-completion-dynamic-complete-nocomint b (point) t))) (when (and c (listp c)) (append c '(:exclusive no))))) |