A simple TMux plugin that provides quick access to cheat.sh directly from your terminal.
- gum
- curl
- tmux
- jq
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.
- Clone the repository:
git clone https://github.com/danitrap/tmux-cheatsh.git ~/.tmux/plugins/tmux-cheatsh
- Add this line to your
.tmux.conf
:
run-shell ~/.tmux/plugins/tmux-cheatsh/tmux-cheatsh.tmux
- Reload TMux configuration:
tmux source-file ~/.tmux.conf
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'
- Press
<prefix> + C
to activate the plugin - Either:
- Type a search term directly, or
- Browse and filter through available topics
- 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.
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
- Interactive topic filtering
- TMux-aware (splits window when in TMux session)
- Paged output for better readability
- Works standalone or within TMux
-
Fork the repository
-
Create your feature branch:
git checkout -b feature/amazing-feature
-
Commit your changes:
git commit -m 'Add some amazing feature'
-
Push to the branch:
git push origin feature/amazing-feature
-
Open a Pull Request