Skip to content

Easily switch between & create new shell buffers.

Notifications You must be signed in to change notification settings

marlonschlosshauer/conch.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

conch.el

Easily switch between & create new shell buffers.

Conch provides a unified interface for managing shell buffers in Emacs. It supports multiple shell backends including eshell, shell, term, and vterm.

Disclaimer: This is hella vibe coded.

Behavior

  • Not in a shell buffer, no shells exist: Create a new shell
  • Not in a shell buffer, shells exist: Switch to a shell
  • In a shell buffer, another shell exists: Switch to it
  • In a shell buffer, no other shells: Do nothing
  • With prefix argument (C-u): Always create a new shell

Installation

The simplest way to install conch.el is by using use-package with the :vc keyword:

(use-package conch
	:vc (:url "https://github.com/marlonschlosshauer/conch.el" :rev :newest))

Usage

Conch provides dedicated commands for each shell type:

Command Description
conch-eshell Switch/create eshell buffers
conch-shell Switch/create shell-mode buffers
conch-term Switch/create term buffers
conch-vterm Switch/create vterm buffers
conch Use the default backend

Example configuration

;; Bind each shell type to a key
(global-set-key (kbd "C-c e") #'conch-eshell)
(global-set-key (kbd "C-c s") #'conch-shell)
(global-set-key (kbd "C-c v") #'conch-vterm)

;; Or use the generic command with a configured default
(setq conch-default-backend 'vterm)
(global-set-key (kbd "C-c t") #'conch)

With use-package

(use-package conch
  :bind (("C-c e" . conch-eshell)
         ("C-c s" . conch-shell)
         ("C-c v" . conch-vterm))
  :custom
  (conch-default-backend 'eshell)) ;; optional

Customization

  • conch-default-backend - The shell backend used by the conch command. Options: eshell, shell, term, vterm. Default: eshell.

Adding custom backends

You can add support for other shell types by extending conch-backends:

(add-to-list 'conch-backends
             '(my-shell . (:mode my-shell-mode
                           :create my-shell
                           :create-new (lambda () (my-shell t)))))

Each backend requires three properties:

  • :mode - The major mode symbol
  • :create - Function to create or switch to a buffer
  • :create-new - Function to always create a new buffer

About

Easily switch between & create new shell buffers.

Resources

Stars

Watchers

Forks