Coder Social home page Coder Social logo

emacs-tmux-pane's Introduction

README

https://melpa.org/packages/tmux-pane-badge.svg

About

This package is a port of vim-tmux-navigator. It provide integration between emacs windows and tmux panes. Note those tmux panes need not to be created by this package. Tmux panes created in any approach are supported.

./screenshots/tmux-pane.png

Install

Just install tmux-pane from melpa.

Tmux configuration

If you are using TPM, add the following codes to your ~/.tmux.conf

set -g @plugin 'laishulu/emacs-tmux-pane'

Without TPM, you can manually copy the content of file tmux-pane.tmux to your file ~/.tmux.conf.

Usage

A global minor mode tmux-pane-mode (disabled by default) is provided.

Default key map:

  • C-k: Up
  • C-j: Down
  • C-h: Left
  • C-l: Right
  • C-\: Last

Commands

  • tmux-pane-open-vertical : Open a vertical tmux side pane at right
  • tmux-pane-open-horizontal: Open a vertical tmux side pane at below
  • tmux-pane-close: Close the latest tmux side pane if possible
  • tmux-pane-rerun: Rerun the latest command in the latest tmux pane
  • tmux-pane-toggle-vertical: Open a vertical tmux side pane, or close the latest tmux pane (not necessarily to be the vertical pane).
  • tmux-pane-toggle-horizontal: Open a horizontal tmux side pane, or close the latest tmux pane (not necessarily to be the horizontal pane).
  • tmux-pane-omni-window-up : Navigate to the up window of Emacs or tmux.
  • tmux-pane-omni-window-down : Navigate to the down window of Emacs or tmux.
  • tmux-pane-omni-window-left : Navigate to the left window of Emacs or tmux.
  • tmux-pane-omni-window-right : Navigate to the right window of Emacs or tmux.
  • tmux-pane-omni-window-last : Navigate to the last window of Emacs or tmux.

Variables

The following two variable can be customized

  • tmux-pane-vertical-percent (Default: 25): Width percentage of the vertical side pane to the whole tmux window
  • tmux-pane-vertical-percent (Default: 25): Height percentage of the horizontal side pane to the whole tmux window

Hooks

  • tmux-pane-before-leave-hook (Default: 25): Hook to run before leaving emacs to tmux.
  • tmux-pane-after-leave-hook (Default: 25): Hook to run after leaving emacs to tmux.

Example configuration for Doom Emacs

(use-package! tmux-pane
  :config
  (tmux-pane-mode)
  (map! :leader
        (:prefix ("v" . "tmux pane")
          :desc "Open vpane" :nv "o" #'tmux-pane-open-vertical
          :desc "Open hpane" :nv "h" #'tmux-pane-open-horizontal
          :desc "Open hpane" :nv "s" #'tmux-pane-open-horizontal
          :desc "Open vpane" :nv "v" #'tmux-pane-open-vertical
          :desc "Close pane" :nv "c" #'tmux-pane-close
          :desc "Rerun last command" :nv "r" #'tmux-pane-rerun))
  (map! :leader
        (:prefix "t"
          :desc "vpane" :nv "v" #'tmux-pane-toggle-vertical
          :desc "hpane" :nv "h" #'tmux-pane-toggle-horizontal)))

emacs-tmux-pane's People

Contributors

laishulu avatar jaidetree avatar joaofnds avatar syohex 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.