laggardkernel / easyjump.tmux

EasyMotion for Tmux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

easyjump.tmux

EasyMotion for Tmux

Demonstration

📹: https://asciinema.org/a/372086

This project is heavily inspired by tmux-jump.

There some differences between tmux-jump and easyjump.tmux:

  • easyjump.tmux can be integrated into Vim/Neovim! 🔥 See Integration with Vim for more details.
  • easyjump.tmux supports the smart case-insensitive search (turned on by default).
  • tmux-jump searches by 1 char and easyjump.tmux does by 2 chars.
  • tmux-jump only matches the prefixes of words, easyjump.tmux matches all substrings.
  • tmux-jump is implemented in Ruby and easyjump.tmux is done in Python 3 with type hints.

Requirements

  • Tmux >= 3.1
  • Python >= 3.8

Windows is not supported now.

Installation

  • TPM

    1. Add to ~/.tmux.conf:

      set-option -g @plugin "roy2220/easyjump.tmux"
    2. Press prefix + I to install the plugin.

  • Manual

    1. Fetch the source:

      git clone https://github.com/roy2220/easyjump.tmux.git /PATH/TO/DIR
    2. Add to ~/.tmux.conf:

      run-shell "/PATH/TO/DIR/easyjump.tmux"
    3. Reload Tmux configuration:

      tmux source ~/.tmux.conf

Usage

  • Press prefix + j to invoke EasyJump.
  • Press Ctrl + j to invoke EasyJump in copy mode.
  • Press Enter to cancel EasyJump.

Configuration

defaults:

set-option -g @easyjump-key-binding "j"
set-option -g @easyjump-smart-case "on"
set-option -g @easyjump-label-chars "fjdkslaghrueiwoqptyvncmxzb1234567890"
set-option -g @easyjump-label-attrs "\e[1m\e[38;5;172m"
set-option -g @easyjump-text-attrs "\e[0m\e[38;5;237m"
set-option -g @easyjump-auto-begin-selection "on"

Note: @easyjump-label-attrs/@easyjump-text-attrs is escape sequence for text coloring and formatting, see https://misc.flogisoft.com/bash/tip_colors_and_formatting for more information.

Integration with Vim

Vim 8 or Neovim is required.

Demonstration in Vim

📹: https://asciinema.org/a/372879

Installation in Vim

  • vim-plug

    1. Add to ~/.vimrc:
    Plug 'roy2220/easyjump.tmux'
    1. Just :PlugInstall
  • Manual

    1. Fetch the source:

      git clone https://github.com/roy2220/easyjump.tmux.git /PATH/TO/DIR
    2. Add to ~/.vimrc:

      source /PATH/TO/DIR/plugin/easyjump.vim
    3. Reload Vim configuration:

      :source ~/.vimrc

Usage in Vim

  • Press Ctrl + j to invoke EasyJump in normal mode, insert mode, visual mode or operator-pending mode.
  • Press Enter to cancel EasyJump.

Configuration in Vim

defaults:

let g:easyjump_smart_case = v:true
let g:easyjump_label_chars = 'fjdkslaghrueiwoqptyvncmxzb1234567890'
let g:easyjump_label_attrs = "\e[1m\e[38;5;172m"
let g:easyjump_text_attrs = "\e[0m\e[38;5;237m"

nmap <C-J> <Plug>EasyJump
imap <C-J> <Plug>EasyJump
vmap <C-J> <Plug>EasyJump
omap <C-J> <Plug>EasyJump

Note: g:easyjump_label_attrs/g:easyjump_text_attrs is escape sequence for text coloring and formatting, see https://misc.flogisoft.com/bash/tip_colors_and_formatting for more information.

About

EasyMotion for Tmux


Languages

Language:Python 85.5%Language:Vim Script 14.5%