From 54c53c011c0ba9c8629777a506c94f56ce697aa8 Mon Sep 17 00:00:00 2001 From: Gal Szkolnik Date: Mon, 15 Aug 2022 16:57:29 -0400 Subject: [PATCH] =Byobu improvements --- _home/dot_byobu/dot_tmux.conf | 8 ++++++++ _home/dot_sz.shrc.d/34_tmux.tools | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 _home/dot_byobu/dot_tmux.conf diff --git a/_home/dot_byobu/dot_tmux.conf b/_home/dot_byobu/dot_tmux.conf new file mode 100644 index 0000000..0faebe3 --- /dev/null +++ b/_home/dot_byobu/dot_tmux.conf @@ -0,0 +1,8 @@ +# Taken from: http://grota.github.io/blog/2012/05/08/tmux-clipboard-integration/ +# Everytime you press the prefix key followed by C-c you will be asked to choose from the list of tmux paste-buffers. The buffer selected will be put into the system clipboard. +bind C-c choose-buffer "run \"tmux save-buffer -b %% - | xclip -i -sel clipboard\" \; run \" tmux display \\\"Clipboard \(+\) filled with: $(tmux save-buffer -b %1 - | dd ibs=1 obs=1 status=noxfer count=80 2> /dev/null)... \\\" \" " +#no buffer %1 +set -g mouse on +source-file $BYOBU_PREFIX/share/byobu/keybindings/f-keys.tmux; +source-file $HOME/.byobu/keybindings.tmux +bind-key -n M-F12 source $BYOBU_PREFIX/share/byobu/keybindings/mouse.tmux.enable \; display-message "Mouse: OFF" diff --git a/_home/dot_sz.shrc.d/34_tmux.tools b/_home/dot_sz.shrc.d/34_tmux.tools index fd899de..afa33aa 100644 --- a/_home/dot_sz.shrc.d/34_tmux.tools +++ b/_home/dot_sz.shrc.d/34_tmux.tools @@ -6,4 +6,20 @@ if [[ -n "$(which-command tmux)" ]]; then __C="$HOME/.local/share/bash-completion/tmux/completions/tmux" [[ -r $__C ]] && . <( cat $__C ) unset __C + + function tmux-down() { + tmux split-window "${@}" + } + + function tmux-up() { + tmux-down "${@}"; tmux swap-pane -dt -1 + } + + function tmux-right() { + tmux split-window -h "${@}" + } + + function tmux-left() { + tmux-right "${@}"; tmux swap-pane -dt -1 + } fi