Skip to content

A simple TMux plugin that provides quick access to cheat.sh directly from your terminal.

License

Notifications You must be signed in to change notification settings

danitrap/tmux-cheatsh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cheat.sh TMux Plugin

A simple TMux plugin that provides quick access to cheat.sh directly from your terminal.

Prerequisites

  • gum
  • curl
  • tmux
  • jq

Installation

Installation via tpm

Add this to your .tmux.conf:

set -g @plugin 'danitrap/tmux-cheatsh'

Reload TMux configuration:

tmux source-file ~/.tmux.conf

And press <prefix> + I to fetch the plugin.

Installation via git

  1. Clone the repository:
git clone https://github.com/danitrap/tmux-cheatsh.git ~/.tmux/plugins/tmux-cheatsh
  1. Add this line to your .tmux.conf:
run-shell ~/.tmux/plugins/tmux-cheatsh/tmux-cheatsh.tmux
  1. Reload TMux configuration:
tmux source-file ~/.tmux.conf

Configuration

Customize the plugin behavior in your .tmux.conf:

# Change default keybinding (default: prefix + C)
set -g @cheatsh-key 'C'

# Set split direction (default: 'h' for horizontal)
set -g @cheatsh-split 'v'  # 'v' for vertical, 'h' for horizontal

# Set split size percentage (default: 50)
set -g @cheatsh-split-size '40'

Usage

  1. Press <prefix> + C to activate the plugin
  2. Either:
    • Type a search term directly, or
    • Browse and filter through available topics
  3. Results will appear in a split pane if you're in TMux, or directly in your terminal otherwise

The script will fetch and display programming language references, command examples, and code snippets from cheat.sh.

Examples

Common search patterns:

# Python specific queries
python/list comprehension  # List comprehension examples
python/dict                # Dictionary operations
python/:learn              # Python learning guide

# Git operations
git/stash                  # Git stash commands
git/rebase                 # Git rebase guide

# Linux commands
find                       # Find command examples
awk                        # Awk usage guide

Features

  • Interactive topic filtering
  • TMux-aware (splits window when in TMux session)
  • Paged output for better readability
  • Works standalone or within TMux

Contributing

  1. Fork the repository

  2. Create your feature branch:

    git checkout -b feature/amazing-feature
  3. Commit your changes:

    git commit -m 'Add some amazing feature'
  4. Push to the branch:

    git push origin feature/amazing-feature
  5. Open a Pull Request

About

A simple TMux plugin that provides quick access to cheat.sh directly from your terminal.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages