Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/suonlight/multi-vterm
Managing multiple vterm buffers in Emacs
https://github.com/suonlight/multi-vterm
Last synced: 5 days ago
JSON representation
Managing multiple vterm buffers in Emacs
- Host: GitHub
- URL: https://github.com/suonlight/multi-vterm
- Owner: suonlight
- License: gpl-3.0
- Created: 2019-03-10T11:30:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-09T14:24:46.000Z (over 1 year ago)
- Last Synced: 2024-02-17T07:36:06.405Z (9 months ago)
- Language: Emacs Lisp
- Homepage:
- Size: 37.1 KB
- Stars: 187
- Watchers: 5
- Forks: 21
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# multi-vterm.el
Managing multiple [vterm](https://github.com/akermu/emacs-libvterm) buffers in Emacs
This package is inspired by [multi-term.el](https://github.com/milkypostman/multi-term)# Installation
`multi-vterm` is available on MELPA, and it can be installed as normal package
```
(use-package multi-vterm :ensure t)
```# Configuration
## Dedicated terminal height
Configure the height in rows:
```elisp
;; dedicated terminal height of 50 rows
(setq multi-vterm-dedicated-window-height 50)
```
Configure the height in percent:
```elisp
;; dedicated terminal height of 30%
(setq multi-vterm-dedicated-window-height-percent 30)
```
If `multi-vterm-dedicated-window-height-percent` is set `multi-vterm-dedicated-window-height` is ignored.
**Note**: The lower limit is 10% and the upper limit is 90%.# Usage
| Command | Description |
|---------------------------------|-------------------------------------------------|
| multi-vterm | Create new terminal |
| multi-vterm-next | Switch to next terminal |
| multi-vterm-prev | Switch to previous terminal |
| multi-vterm-dedicated-toggle | Toggle dedicated terminal |
| multi-vterm-project | Create/toggle terminal based on current project |# For Evil users
I'm using Evil. This is my personal config to use `multi-vterm` with `evil`
```elisp
(use-package multi-vterm
:config
(add-hook 'vterm-mode-hook
(lambda ()
(setq-local evil-insert-state-cursor 'box)
(evil-insert-state)))
(define-key vterm-mode-map [return] #'vterm-send-return)(setq vterm-keymap-exceptions nil)
(evil-define-key 'insert vterm-mode-map (kbd "C-e") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-f") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-a") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-v") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-b") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-w") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-u") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-d") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-n") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-m") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-p") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-j") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-k") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-r") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-t") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-g") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-c") #'vterm--self-insert)
(evil-define-key 'insert vterm-mode-map (kbd "C-SPC") #'vterm--self-insert)
(evil-define-key 'normal vterm-mode-map (kbd "C-d") #'vterm--self-insert)
(evil-define-key 'normal vterm-mode-map (kbd ",c") #'multi-vterm)
(evil-define-key 'normal vterm-mode-map (kbd ",n") #'multi-vterm-next)
(evil-define-key 'normal vterm-mode-map (kbd ",p") #'multi-vterm-prev)
(evil-define-key 'normal vterm-mode-map (kbd "i") #'evil-insert-resume)
(evil-define-key 'normal vterm-mode-map (kbd "o") #'evil-insert-resume)
(evil-define-key 'normal vterm-mode-map (kbd "") #'evil-insert-resume))
```