Skip to content

Commit 1e5e8d0

Browse files
author
Bruno Sutic
committed
Extract default keys and options to a separate file
1 parent d1dbf8d commit 1e5e8d0

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### master
44
- update readme
5+
- extract default keys and key options to `variables.sh` file
56

67
### v1.0.0, 2014-11-09
78
- improve `capture-pane`. It is now piped directly to the target file.

logging.tmux

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,26 @@
22

33
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
44

5-
source $CURRENT_DIR/scripts/shared.sh
6-
7-
default_pipe_pane_key="P" # Shift-p
8-
default_pane_screenshot_key="M-p" # Alt-p
9-
default_scrollback_dump_key="M-P" # Alt-Shift-p
10-
default_clear_scrollback_key="M-c" # Alt-c
5+
source "$CURRENT_DIR/scripts/shared.sh"
6+
source "$CURRENT_DIR/scripts/variables.sh"
117

128
setup_pipe_pane_key_binding() {
13-
local key=$(get_tmux_option "@pipe_pane_key" "$default_pipe_pane_key")
9+
local key=$(get_tmux_option "$pipe_pane_key_option" "$default_pipe_pane_key")
1410
tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/tmux_proper_pipe_pane.sh"
1511
}
1612

1713
setup_pane_screenshot_key_binding() {
18-
local key=$(get_tmux_option "@pane_screenshot_key" "$default_pane_screenshot_key")
14+
local key=$(get_tmux_option "$pane_screenshot_key_option" "$default_pane_screenshot_key")
1915
tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/tmux_pane_screenshot.sh"
2016
}
2117

2218
setup_scrollback_dump_key_binding() {
23-
local key=$(get_tmux_option "@scrollback_dump_key" "$default_scrollback_dump_key")
19+
local key=$(get_tmux_option "$scrollback_dump_key_option" "$default_scrollback_dump_key")
2420
tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/tmux_scrollback_dump.sh"
2521
}
2622

2723
setup_clear_scrollback_key_binding() {
28-
local key=$(get_tmux_option "@scrollback_clear_key" "$default_clear_scrollback_key")
24+
local key=$(get_tmux_option "$clear_scrollback_key_option" "$default_clear_scrollback_key")
2925
tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/tmux_scrollback_clear.sh"
3026
}
3127

scripts/variables.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
pipe_pane_key_option="@pipe-pane-key"
2+
default_pipe_pane_key="P" # Shift-p
3+
4+
pane_screenshot_key_option="@pane-screenshot-key"
5+
default_pane_screenshot_key="M-p" # Alt-p
6+
7+
scrollback_dump_key_option="@scrollback-dump-key"
8+
default_scrollback_dump_key="M-P" # Alt-Shift-p
9+
10+
clear_scrollback_key_option="@scrollback-clear-key"
11+
default_clear_scrollback_key="M-c" # Alt-c

0 commit comments

Comments
 (0)