Move eshell, term & vterm modules to :term

This commit is contained in:
Henrik Lissner
2019-05-18 23:41:18 -04:00
parent 42ba2a22b8
commit 8c65a63b1c
18 changed files with 41 additions and 30 deletions

View File

@@ -0,0 +1,33 @@
;;; term/term/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +term/open (arg)
"Open a terminal buffer in the current window. If ARG (universal argument) is
non-nil, cd into the current project's root."
(interactive "P")
(let ((default-directory
(if arg
(or (doom-project-root) default-directory)
default-directory)))
;; Doom's switch-buffer hooks prevent themselves from triggering when
;; switching from buffer A back to A. Because `multi-term' uses `set-buffer'
;; before `switch-to-buffer', the hooks don't trigger, so we use this
;; roundabout way to trigger them properly.
(switch-to-buffer (save-window-excursion (multi-term)))))
;;;###autoload
(defun +term/open-popup (arg)
"Open a terminal popup window. If ARG (universal argument) is
non-nil, cd into the current project's root."
(interactive "P")
(let ((default-directory
(if arg
(or (doom-project-root) default-directory)
default-directory)))
(pop-to-buffer (save-window-excursion (multi-term)))))
;;;###autoload
(defun +term/open-popup-in-project ()
"Open a terminal popup window in the root of the current project."
(interactive)
(+term/open-popup t))

View File

@@ -0,0 +1,8 @@
;;; term/term/config.el -*- lexical-binding: t; -*-
;;;###package multi-term
(setq multi-term-dedicated-window-height 20
multi-term-switch-after-close 'PREVIOUS)
;;;###package term
(add-hook 'term-mode-hook #'doom|mark-buffer-as-real)

View File

@@ -0,0 +1,5 @@
;; -*- no-byte-compile: t; -*-
;;; term/term/packages.el
(package! term :built-in t)
(package! multi-term)