From 165d9b79a15924ec3be02322b256293edb74d155 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Wed, 9 Nov 2011 14:09:38 -0600 Subject: [PATCH] * usr/share/byobu/keybindings/f-keys.tmux, usr/share/byobu/keybindings/f-keys.tmux.disable, usr/share/byobu/keybindings/Makefile.am, usr/share/byobu/profiles/tmux, usr/share/doc/byobu/help.tmux.txt: - Add Shift-F12 to toggle keybindings on/off - Split tmux keybindings to separate file to source --- debian/changelog | 6 ++ usr/share/byobu/keybindings/Makefile.am | 2 +- usr/share/byobu/keybindings/f-keys.tmux | 64 +++++++++++++++++++ .../byobu/keybindings/f-keys.tmux.disable | 60 +++++++++++++++++ usr/share/byobu/profiles/tmux | 40 +----------- usr/share/doc/byobu/help.tmux.txt | 1 + 6 files changed, 133 insertions(+), 40 deletions(-) create mode 100644 usr/share/byobu/keybindings/f-keys.tmux create mode 100644 usr/share/byobu/keybindings/f-keys.tmux.disable diff --git a/debian/changelog b/debian/changelog index 05a270d8..745c776f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,6 +23,12 @@ byobu (4.47) unreleased; urgency=low - Ctrl-F11 puts window into a vertical split in previous window * usr/share/doc/byobu/help.tmux.txt: - fix typo + * usr/share/byobu/keybindings/f-keys.tmux, + usr/share/byobu/keybindings/f-keys.tmux.disable, + usr/share/byobu/keybindings/Makefile.am, + usr/share/byobu/profiles/tmux, usr/share/doc/byobu/help.tmux.txt: + - Add Shift-F12 to toggle keybindings on/off + - Split tmux keybindings to separate file to source -- Dustin Kirkland Tue, 08 Nov 2011 19:16:15 -0600 diff --git a/usr/share/byobu/keybindings/Makefile.am b/usr/share/byobu/keybindings/Makefile.am index 26f9c992..6b6dd027 100644 --- a/usr/share/byobu/keybindings/Makefile.am +++ b/usr/share/byobu/keybindings/Makefile.am @@ -1,2 +1,2 @@ keybindingsdir = $(datadir)/@PACKAGE@/keybindings -keybindings_DATA = common f-keys none screen-escape-keys +keybindings_DATA = common f-keys f-keys.tmux f-keys.tmux.disable none screen-escape-keys diff --git a/usr/share/byobu/keybindings/f-keys.tmux b/usr/share/byobu/keybindings/f-keys.tmux new file mode 100644 index 00000000..14a7de59 --- /dev/null +++ b/usr/share/byobu/keybindings/f-keys.tmux @@ -0,0 +1,64 @@ +############################################################################### +# byobu's tmux f-key keybindings +# +# Copyright (C) 2011 Dustin Kirkland +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +############################################################################### + +# Add F12 to the prefix list +set -g prefix ^A,F12 + +# Byobu's Keybindings +# Documented in: /usr/share/doc/byobu/help.tmux.txt +bind-key -n F1 new-window -k -n config byobu-config +bind-key -n S-F1 new-window -k -n help 'sensible-pager /usr/share/doc/byobu/help.tmux.txt' +bind-key -n F2 new-window +bind-key -n C-F2 display-panes \; split-window -h +bind-key -n S-F2 display-panes \; split-window -v +bind-key -n C-S-F2 new-session +bind-key -n F3 previous-window +bind-key -n F4 next-window +bind-key -n M-Left previous-window +bind-key -n M-Right next-window +bind-key -n M-Up choose-session \; send-keys Up \; send-keys Enter +bind-key -n M-Down choose-session \; send-keys Down \; send-keys Enter +bind-key -n S-F3 display-panes \; select-pane -t :.- +bind-key -n S-F4 display-panes \; select-pane -t :.+ +bind-key -n S-Up display-panes \; select-pane -U +bind-key -n S-Down display-panes \; select-pane -D +bind-key -n S-Left display-panes \; select-pane -L +bind-key -n S-Right display-panes \; select-pane -R +bind-key -n C-F3 display-panes \; swap-pane -s :. -t :.- \; select-pane -t :.- +bind-key -n C-F4 display-panes \; swap-pane -s :. -t :.+ \; select-pane -t :.+ +bind-key -n C-Up resize-pane -U +bind-key -n C-Down resize-pane -D +bind-key -n C-Left resize-pane -L +bind-key -n C-Right resize-pane -R +bind-key -n F5 source /usr/share/byobu/profiles/tmuxrc +bind-key -n S-F5 next-layout +bind-key -n C-F5 send-keys ". $BYOBU_PREFIX/bin/byobu-reconnect-sockets" \; send-keys Enter +bind-key -n F6 detach +bind-key -n S-F6 run-shell 'exec touch $BYOBU_RUN_DIR/no-logout' \; detach +bind-key -n C-F6 kill-pane +bind-key -n F7 copy-mode +bind-key -n M-NPage copy-mode \; send-keys NPage +bind-key -n M-PPage copy-mode \; send-keys PPage +bind-key -n F8 command-prompt -p "(rename-window)" "rename-window %%" +bind-key -n F9 new-window -k -n config byobu-config +bind-key -n M-F11 break-pane +bind-key -n C-F11 join-pane -h -s :. -t :-1 +bind-key -n S-F11 join-pane -v -s :. -t :-1 +bind-key -n S-F12 source $BYOBU_PREFIX/share/byobu/keybindings/f-keys.tmux.disable diff --git a/usr/share/byobu/keybindings/f-keys.tmux.disable b/usr/share/byobu/keybindings/f-keys.tmux.disable new file mode 100644 index 00000000..904c7071 --- /dev/null +++ b/usr/share/byobu/keybindings/f-keys.tmux.disable @@ -0,0 +1,60 @@ +############################################################################### +# disable byobu's tmux f-key keybindings +# +# Copyright (C) 2011 Dustin Kirkland +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +############################################################################### + +# Undo Byobu's Keybindings +unbind-key -n F1 +unbind-key -n S-F1 +unbind-key -n F2 +unbind-key -n C-F2 +unbind-key -n S-F2 +unbind-key -n C-S-F2 +unbind-key -n F3 +unbind-key -n F4 +unbind-key -n M-Left +unbind-key -n M-Right +unbind-key -n M-Up +unbind-key -n M-Down +unbind-key -n S-F3 +unbind-key -n S-F4 +unbind-key -n S-Up +unbind-key -n S-Down +unbind-key -n S-Left +unbind-key -n S-Right +unbind-key -n C-F3 +unbind-key -n C-F4 +unbind-key -n C-Up +unbind-key -n C-Down +unbind-key -n C-Left +unbind-key -n C-Right +unbind-key -n F5 +unbind-key -n S-F5 +unbind-key -n C-F5 +unbind-key -n F6 +unbind-key -n S-F6 +unbind-key -n C-F6 +unbind-key -n F7 +unbind-key -n M-NPage +unbind-key -n M-PPage +unbind-key -n F8 +unbind-key -n F9 +unbind-key -n M-F11 +unbind-key -n C-F11 +unbind-key -n S-F11 +bind-key -n S-F12 source $BYOBU_PREFIX/share/byobu/keybindings/f-keys.tmux diff --git a/usr/share/byobu/profiles/tmux b/usr/share/byobu/profiles/tmux index 6e549b0e..6bc50ca7 100644 --- a/usr/share/byobu/profiles/tmux +++ b/usr/share/byobu/profiles/tmux @@ -34,45 +34,7 @@ source /usr/share/tmux/screen-keys.conf set -g prefix ^A,F12 # Byobu's Keybindings -# Documented in: /usr/share/doc/byobu/help.tmux.txt -bind-key -n F1 new-window -k -n config byobu-config -bind-key -n S-F1 new-window -k -n help 'sensible-pager /usr/share/doc/byobu/help.tmux.txt' -bind-key -n F2 new-window -bind-key -n C-F2 display-panes \; split-window -h -bind-key -n S-F2 display-panes \; split-window -v -bind-key -n C-S-F2 new-session -bind-key -n F3 previous-window -bind-key -n F4 next-window -bind-key -n M-Left previous-window -bind-key -n M-Right next-window -bind-key -n M-Up choose-session \; send-keys Up \; send-keys Enter -bind-key -n M-Down choose-session \; send-keys Down \; send-keys Enter -bind-key -n S-F3 display-panes \; select-pane -t :.- -bind-key -n S-F4 display-panes \; select-pane -t :.+ -bind-key -n S-Up display-panes \; select-pane -U -bind-key -n S-Down display-panes \; select-pane -D -bind-key -n S-Left display-panes \; select-pane -L -bind-key -n S-Right display-panes \; select-pane -R -bind-key -n C-F3 display-panes \; swap-pane -s :. -t :.- \; select-pane -t :.- -bind-key -n C-F4 display-panes \; swap-pane -s :. -t :.+ \; select-pane -t :.+ -bind-key -n C-Up resize-pane -U -bind-key -n C-Down resize-pane -D -bind-key -n C-Left resize-pane -L -bind-key -n C-Right resize-pane -R -bind-key -n F5 source /usr/share/byobu/profiles/tmuxrc -bind-key -n S-F5 next-layout -bind-key -n C-F5 send-keys ". $BYOBU_PREFIX/bin/byobu-reconnect-sockets" \; send-keys Enter -bind-key -n F6 detach -bind-key -n S-F6 run-shell 'exec touch $BYOBU_RUN_DIR/no-logout' \; detach -bind-key -n C-F6 kill-pane -bind-key -n F7 copy-mode -bind-key -n M-NPage copy-mode \; send-keys NPage -bind-key -n M-PPage copy-mode \; send-keys PPage -bind-key -n F8 command-prompt -p "(rename-window)" "rename-window %%" -bind-key -n F9 new-window -k -n config byobu-config -bind-key -n M-F11 break-pane -bind-key -n C-F11 join-pane -h -s :. -t :-1 -bind-key -n S-F11 join-pane -v -s :. -t :-1 +source $BYOBU_PREFIX/share/byobu/keybindings/f-keys.tmux set-option -g set-titles on set-option -g set-titles-string '#(whoami)@#H - byobu (#S)' diff --git a/usr/share/doc/byobu/help.tmux.txt b/usr/share/doc/byobu/help.tmux.txt index 7d0ea55b..cbc961d1 100644 --- a/usr/share/doc/byobu/help.tmux.txt +++ b/usr/share/doc/byobu/help.tmux.txt @@ -31,3 +31,4 @@ and some convenient keybindings: Ctrl-F11 Join window into a vertical split Shift-F11 Join window into a horizontal split F12 Escape sequence + Shift-F12 Toggle on/off Byobu's keybindings