literate-config

Literate config. See <a href="../readme.org">readme.org</a> for a better-formatted version
Log | Files | Refs

commit c213db617a27e57900ad9bdc021d0a4cada6741c
parent 92eaa857aa48ccbcf7f7200a52d159d3b21bbf58
Author: Crazazy <crazazy@tilde.cafe>
Date:   Tue, 20 Sep 2022 09:54:24 +0200

add multiple terminals

Diffstat:
Memacs.org | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/emacs.org b/emacs.org @@ -36,6 +36,24 @@ Also, if you just stumbled accross this at random, there is an easy tangle butto #+begin_src emacs-lisp :mkdirp yes :tangle emacsconfig/base.el (use-package better-defaults) #+end_src +*** Multiple terminals + By default, =term= only supports 1 terminal. This version supports multiple terminals + #+begin_src emacs-lisp :tangle emacsconfig/base.el + (defun new-term (program) + "start a new terminal emulator in a new buffer" + (interactive (list (read-from-minibuffer "Run program: " + (or explicit-shell-file-name + (getenv "ESHELL") + shell-file-name)))) + (let* ((term-list (seq-filter + (lambda (s) (string-match-p "terminal" (buffer-name s))) + (buffer-list))) + (term-num (number-to-string (length term-list)))) + (set-buffer (make-term (concat "terminal-" term-num) program)) + (term-mode) + (term-char-mode) + (switch-to-buffer (concat "*terminal-" term-num "*")))) + #+end_src ** Generally nice emacs tools *** Magit Simple. Nice. default config. (almost)