Smart man page lookup for zsh vi mode
Press Shift-K on any command or option to instantly open its man page
|
Automatically finds the right man page for subcommands |
Opens man page directly at the option definition |
|
Works with combined short options |
Handles options with values |
|
Detects correct command in pipelines |
Supports various man page styles |
zinit
zinit light TunaCuma/zsh-vi-manantidote
Add to your .zsh_plugins.txt:
TunaCuma/zsh-vi-man
oh-my-zsh
git clone https://github.com/TunaCuma/zsh-vi-man \
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-vi-manThen add to your .zshrc:
plugins=(... zsh-vi-man)Manual
git clone https://github.com/TunaCuma/zsh-vi-man ~/.zsh-vi-man
echo 'source ~/.zsh-vi-man/zsh-vi-man.plugin.zsh' >> ~/.zshrc- Type a command (e.g.,
ls -laorgit commit --amend) - Press
Escapeto enter vi normal mode - Move cursor to any word
- Press
Kto open the man page
| Command | Cursor On | Result |
|---|---|---|
ls -la |
ls |
Opens man ls |
ls -la |
-la |
Opens man ls, jumps to -l |
git commit --amend |
commit |
Opens man git-commit |
grep --color=auto |
--color=auto |
Opens man grep, jumps to --color |
cat file | sort -r |
-r |
Opens man sort, jumps to -r |
find . -name "*.txt" |
-name |
Opens man find, jumps to -name |
Set these variables before sourcing the plugin:
# Change the trigger key (default: K)
ZVM_MAN_KEY='?'
# Use a different pager (default: less)
ZVM_MAN_PAGER='bat'This plugin works seamlessly with zsh-vi-mode. It automatically detects zsh-vi-mode and hooks into its lazy keybindings system.
For best results, source this plugin after zsh-vi-mode:
source /path/to/zsh-vi-mode.zsh
source /path/to/zsh-vi-man.zshMIT License - see LICENSE for details.
Made with β€οΈ by Tuna Cuma