mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
💥 Move dired, electric-indent, eshell, imenu, term modules to :emacs
This commit is contained in:
29
modules/emacs/term/autoload.el
Normal file
29
modules/emacs/term/autoload.el
Normal file
@ -0,0 +1,29 @@
|
||||
;;; emacs/term/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defun +term/open (&optional project-root)
|
||||
"Open a terminal buffer in the current window. If PROJECT-ROOT (C-u) is
|
||||
non-nil, cd into the current project's root."
|
||||
(interactive "P")
|
||||
(let ((default-directory (if project-root (doom-project-root 'nocache) default-directory)))
|
||||
(call-interactively #'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")
|
||||
(require 'multi-term)
|
||||
(let ((default-directory (if arg (doom-project-root 'nocache) default-directory))
|
||||
(buffer (multi-term-get-buffer current-prefix-arg)))
|
||||
(pop-to-buffer buffer)
|
||||
(setq multi-term-buffer-list (nconc multi-term-buffer-list (list buffer)))
|
||||
(multi-term-internal)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +term/open-popup-in-project (arg)
|
||||
"Open a terminal popup window in the root of the current project.
|
||||
|
||||
If ARG (universal argument) is non-nil, open it in `default-directory' instead."
|
||||
(interactive "P")
|
||||
(+term/open-popup (not arg)))
|
14
modules/emacs/term/config.el
Normal file
14
modules/emacs/term/config.el
Normal file
@ -0,0 +1,14 @@
|
||||
;;; emacs/term/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; `multi-term'
|
||||
(setq multi-term-dedicated-window-height 20
|
||||
multi-term-switch-after-close 'PREVIOUS)
|
||||
|
||||
;; `term' (built-in)
|
||||
(after! term
|
||||
(set! :env "SHELL")
|
||||
|
||||
;; Consider term buffers real
|
||||
(defun +term-p (buf)
|
||||
(eq (buffer-local-value 'major-mode buf) 'term-mode))
|
||||
(add-to-list 'doom-real-buffer-functions #'+term-p #'eq))
|
4
modules/emacs/term/packages.el
Normal file
4
modules/emacs/term/packages.el
Normal file
@ -0,0 +1,4 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; emacs/term/packages.el
|
||||
|
||||
(package! multi-term)
|
Reference in New Issue
Block a user