mirror of
https://github.com/tmux-plugins/tmux-sensible.git
synced 2024-11-21 23:28:50 +00:00
parent
fa3e8b91ea
commit
4967aa0ce7
@ -6,6 +6,8 @@
|
|||||||
- do not make any decision about the prefix, just enhance it
|
- do not make any decision about the prefix, just enhance it
|
||||||
- update `README.md`. List options set in the plugin.
|
- update `README.md`. List options set in the plugin.
|
||||||
- do *not* set `mode-mouse on` by default because some users don't like it
|
- do *not* set `mode-mouse on` by default because some users don't like it
|
||||||
|
- if a user changes default prefix but binds `C-b` to something else, do not
|
||||||
|
unbind `C-b`
|
||||||
|
|
||||||
### v1.0.0, 2014-07-30
|
### v1.0.0, 2014-07-30
|
||||||
- initial work on the plugin
|
- initial work on the plugin
|
||||||
|
@ -41,6 +41,17 @@ key_binding_not_set() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
key_binding_not_changed() {
|
||||||
|
local key="$1"
|
||||||
|
local default_value="$2"
|
||||||
|
if $(tmux list-keys | grep -q "bind-key[[:space:]]\+${key}[[:space:]]\+${default_value}"); then
|
||||||
|
# key still has the default binding
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
# OPTIONS
|
# OPTIONS
|
||||||
|
|
||||||
@ -97,7 +108,9 @@ main() {
|
|||||||
# if C-b is not prefix
|
# if C-b is not prefix
|
||||||
if [ $prefix != "C-b" ]; then
|
if [ $prefix != "C-b" ]; then
|
||||||
# unbind obsolte default binding
|
# unbind obsolte default binding
|
||||||
tmux unbind-key C-b
|
if key_binding_not_changed "C-b" "send-prefix"; then
|
||||||
|
tmux unbind-key C-b
|
||||||
|
fi
|
||||||
|
|
||||||
# pressing `prefix + prefix` sends <prefix> to the shell
|
# pressing `prefix + prefix` sends <prefix> to the shell
|
||||||
tmux bind-key "$prefix" send-prefix
|
tmux bind-key "$prefix" send-prefix
|
||||||
|
Loading…
Reference in New Issue
Block a user