diff --git a/CHANGELOG.md b/CHANGELOG.md index 4007594..b86a117 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### master - update readme +- extract default keys and key options to `variables.sh` file ### v1.0.0, 2014-11-09 - improve `capture-pane`. It is now piped directly to the target file. diff --git a/logging.tmux b/logging.tmux index 30a20ec..a0bbfef 100755 --- a/logging.tmux +++ b/logging.tmux @@ -2,30 +2,26 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -source $CURRENT_DIR/scripts/shared.sh - -default_pipe_pane_key="P" # Shift-p -default_pane_screenshot_key="M-p" # Alt-p -default_scrollback_dump_key="M-P" # Alt-Shift-p -default_clear_scrollback_key="M-c" # Alt-c +source "$CURRENT_DIR/scripts/shared.sh" +source "$CURRENT_DIR/scripts/variables.sh" setup_pipe_pane_key_binding() { - local key=$(get_tmux_option "@pipe_pane_key" "$default_pipe_pane_key") + local key=$(get_tmux_option "$pipe_pane_key_option" "$default_pipe_pane_key") tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/tmux_proper_pipe_pane.sh" } setup_pane_screenshot_key_binding() { - local key=$(get_tmux_option "@pane_screenshot_key" "$default_pane_screenshot_key") + local key=$(get_tmux_option "$pane_screenshot_key_option" "$default_pane_screenshot_key") tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/tmux_pane_screenshot.sh" } setup_scrollback_dump_key_binding() { - local key=$(get_tmux_option "@scrollback_dump_key" "$default_scrollback_dump_key") + local key=$(get_tmux_option "$scrollback_dump_key_option" "$default_scrollback_dump_key") tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/tmux_scrollback_dump.sh" } setup_clear_scrollback_key_binding() { - local key=$(get_tmux_option "@scrollback_clear_key" "$default_clear_scrollback_key") + local key=$(get_tmux_option "$clear_scrollback_key_option" "$default_clear_scrollback_key") tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/tmux_scrollback_clear.sh" } diff --git a/scripts/variables.sh b/scripts/variables.sh new file mode 100644 index 0000000..0f1c259 --- /dev/null +++ b/scripts/variables.sh @@ -0,0 +1,11 @@ +pipe_pane_key_option="@pipe-pane-key" +default_pipe_pane_key="P" # Shift-p + +pane_screenshot_key_option="@pane-screenshot-key" +default_pane_screenshot_key="M-p" # Alt-p + +scrollback_dump_key_option="@scrollback-dump-key" +default_scrollback_dump_key="M-P" # Alt-Shift-p + +clear_scrollback_key_option="@scrollback-clear-key" +default_clear_scrollback_key="M-c" # Alt-c