Add a clear pane history key binding

This commit is contained in:
Bruno Sutic 2014-08-26 13:45:31 +02:00
parent 40ae827c72
commit d7d642100c
No known key found for this signature in database
GPG key ID: 66D96E4F2F7EF26C
4 changed files with 26 additions and 0 deletions

View file

@ -3,6 +3,7 @@
### master
- add other plugins list to the README
- update readme to reflect github organization change
- add a 'clear pane history' key binding
### v0.0.1, 2014-06-02

View file

@ -11,6 +11,7 @@ Features:
3. Enables saving a complete history of the current pane<br/>
Everything that has been typed and all the output since the creation of the
current pane can be saved to a file.
4. Clear pane history with `prefix + M-c`
### 1. Logging
@ -73,6 +74,12 @@ With modern computers it is ok to set this option to a high number:
# in .tmux.conf
set -g history-limit 50000
### 4. Clear pane history
Key binding: `prefix + alt + c`
This is just a convenience key binding.
### Installation with [Tmux Plugin Manager](https://github.com/tmux-plugins/tpm) (recommended)
Add plugin to the list of TPM plugins in `.tmux.conf`:

View file

@ -7,6 +7,7 @@ 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
setup_pipe_pane_key_binding() {
local key=$(get_tmux_option "@pipe_pane_key" "$default_pipe_pane_key")
@ -23,9 +24,15 @@ setup_scrollback_dump_key_binding() {
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")
tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/tmux_scrollback_clear.sh"
}
main() {
setup_pipe_pane_key_binding
setup_pane_screenshot_key_binding
setup_scrollback_dump_key_binding
setup_clear_scrollback_key_binding
}
main

View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $CURRENT_DIR/shared.sh
main() {
tmux clear-history
display_message "Pane history cleared!"
}
main