literate-config

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

commit f6afa5aa16056d6edec34a03363b1703c4df480c
parent 28f02d46a2aba67660ec160b3a020a9893d70243
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)