Coder Social home page Coder Social logo

toggle-term.el's Introduction

Table Of Contents

Toggle Term

https://melpa.org/packages/toggle-term-badge.svg

toggle-term.el is an Emacs package inspired by toggleterm.nvim, allowing you to spawn a persistent term, vterm, eat, shell, eshell, or ielm at the bottom of the frame and switch between them when needed.

./assets/toggle-term.gif

Installation

Melpa

As of 05/26/24 toggle-term.el is part of the MELPA

Just add the following to your init.el if you already have the MELPA added:

(use-package toggle-term
  :bind (("M-o f" . toggle-term-find)
         ("M-o t" . toggle-term-term)
         ("M-o v" . toggle-term-vterm)
         ("M-o a" . toggle-term-eat)
         ("M-o s" . toggle-term-shell)
         ("M-o e" . toggle-term-eshell)
         ("M-o i" . toggle-term-ielm)
         ("M-o o" . toggle-term-toggle))
  :config
    (setq toggle-term-size 25)
    (setq toggle-term-switch-upon-toggle t))

Quelpa

(quelpa
 '(toggle-term :fetcher github
               :repo "justinlime/toggle-term.el"))
(setq toggle-term-size 25)
(setq toggle-term-switch-upon-toggle t)
(require 'toggle-term)

Quelpa Use Package

(use-package toggle-term
  :quelpa (toggle-term :fetcher github :repo "justinlime/toggle-term.el")
  :bind (("M-o f" . toggle-term-find)
         ("M-o t" . toggle-term-term)
         ("M-o v" . toggle-term-vterm)
         ("M-o a" . toggle-term-eat)
         ("M-o s" . toggle-term-shell)
         ("M-o e" . toggle-term-eshell)
         ("M-o i" . toggle-term-ielm)
         ("M-o o" . toggle-term-toggle))
  :config
    (setq toggle-term-size 25)
    (setq toggle-term-switch-upon-toggle t))

Usage

Functions

Toggle-term provides the following main functions:

toggle-term-find
Switch to an active toggle, or create a new one.
toggle-term-toggle
Toggle the last used toggle.

Helper Functions

The follwing helper functions are included for use with keybinds:

toggle-term-term
Toggle a term, named toggle-term-term
toggle-term-vterm
Toggle a term, named toggle-term-vterm
toggle-term-eat
Toggle a eat-term, named toggle-term-eat
toggle-term-shell
Toggle a shell, named toggle-term-shell
toggle-term-eshell
Toggle an eshell, named toggle-term-eshell
toggle-term-ielm
Toggle an ielm, named toggle-term-ielm

Variables

toggle-term-size

This can be used to set the size, which is a percentage of the window the toggle will occupy.

This would set the toggle to occupy 25% of the available window:

(setq toggle-term-size 25)

NOTE: values too high, or too low, may cause unexpected behavior

toggle-term-switch-upon-toggle

Determines if the window created by toggle term should be switched to upon spawning:

(setq toggle-term-switch-upon-toggle t)
toggle-term-use-persp

Optionally use perspective integration, automatically enabled when persp-mode is enabled.

(setq toggle-term-use-persp t)
toggle-term-init-toggle

Optionally define an initial toggle that will be the first used when invoking toggle-term-toggle.

;; '("name-of-toggle" . type-of-toggle)
(setq toggle-term-init-toggle '("my-terminal" . "term"))
;; or
(setq toggle-term-init-toggle '("my-shell" . "shell"))
;; etc

toggle-term.el's People

Contributors

justinlime avatar jtbx avatar gagero avatar makesesama avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.