mirror of
https://github.com/schasse/tmux-jump.git
synced 2026-09-10 07:06:15 -04:00
Merge pull request #21 from dianlujitao/master
Allow customizing the jump key
This commit is contained in:
commit
cbd32a6fcb
|
|
@ -55,6 +55,12 @@ tmux source-file ~/.tmux.conf
|
|||
|
||||
tmux-jump can also be used in in any program and during copy mode.
|
||||
|
||||
You can customize the key binding in your `.tmux.conf`:
|
||||
|
||||
```
|
||||
set -g @jump-key 's'
|
||||
```
|
||||
|
||||
## Similar Projects
|
||||
|
||||
* [vimium](https://vimium.github.io/)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
get_tmux_option() {
|
||||
local option=$1
|
||||
local default_value=$2
|
||||
local option_value=$(tmux show-option -gqv "$option")
|
||||
if [ -z $option_value ]; then
|
||||
echo $default_value
|
||||
else
|
||||
echo $option_value
|
||||
fi
|
||||
}
|
||||
|
||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
tmux bind-key j run-shell -b "$CURRENT_DIR/scripts/tmux-jump.sh"
|
||||
tmux bind-key $(get_tmux_option "@jump-key" "j") run-shell -b "$CURRENT_DIR/scripts/tmux-jump.sh"
|
||||
|
|
|
|||
Loading…
Reference in a new issue