Merge pull request #21 from dianlujitao/master

Allow customizing the jump key
This commit is contained in:
Sebastian Schasse 2020-04-17 11:36:48 +02:00 committed by GitHub
commit cbd32a6fcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View file

@ -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/)

View file

@ -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"