From: Sergey Matveev Date: Mon, 23 May 2022 08:36:08 +0000 (+0300) Subject: Move some tmux bindings to separate files X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=commitdiff_plain;h=acc0c4539f489bde52ad92906a6b4eba13346107 Move some tmux bindings to separate files --- diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 64ba0b5..512bf7d 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -36,40 +36,8 @@ set-window-option -g window-status-last-style "bg=cyan" bind-key b set-option status unbind-key L -bind-key u { - capture-pane -J - save-buffer /tmp/tmux-buffer - delete-buffer - display-popup -E -w 100% "urlview /tmp/tmux-buffer" -} - -bind-key y { - capture-pane -J - save-buffer /tmp/tmux-buffer - delete-buffer - split-window 'vim -c "set listchars=" -c "match ExtraWhitespace //" /tmp/tmux-buffer' -} - -bind-key Y { - capture-pane -J -S - -E - - save-buffer /tmp/tmux-buffer - delete-buffer - split-window 'vim -c "set listchars=" -c "match ExtraWhitespace //" /tmp/tmux-buffer' -} - -bind-key t display-menu \ - music t "display-popup -E -w 100% '~/.tmux/bin/menu-music.sh'" \ - pass p "display-popup -E '~/.tmux/bin/menu-pass-session.sh'" \ - dict d "display-popup -E -h 100% '~/.tmux/bin/menu-dict.sh'" \ - calc c "display-popup -E '~/.tmux/bin/menu-calc.sh'" \ - cal l "display-popup 'cal -3N'" \ - top o "display-popup -E -h 100% 'top -s 1'" - -bind-key o display-menu \ - find o "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh find '#{pane_current_path}'\"" \ - procs p "display-popup -E -w 100% -h 100% \"~/.tmux/bin/fzf.zsh procs '#{pane_current_path}'\"" \ - git-files g "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh git-files '#{pane_current_path}'\"" \ - git-branches b "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh git-branches '#{pane_current_path}'\"" \ - git-commits c "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh git-commits '#{pane_current_path}'\"" - +source-file ~/.tmux/rc/urlview +source-file ~/.tmux/rc/capture +source-file ~/.tmux/rc/menu-various +source-file ~/.tmux/rc/menu-fzf source-file ~/.tmux/rc/select-command-output diff --git a/tmux/.tmux/rc/capture b/tmux/.tmux/rc/capture new file mode 100644 index 0000000..74e24a8 --- /dev/null +++ b/tmux/.tmux/rc/capture @@ -0,0 +1,13 @@ +bind-key y { + capture-pane -J + save-buffer /tmp/tmux-buffer + delete-buffer + split-window 'vim -c "set listchars=" -c "match ExtraWhitespace //" /tmp/tmux-buffer' +} + +bind-key Y { + capture-pane -J -S - -E - + save-buffer /tmp/tmux-buffer + delete-buffer + split-window 'vim -c "set listchars=" -c "match ExtraWhitespace //" /tmp/tmux-buffer' +} diff --git a/tmux/.tmux/rc/menu-fzf b/tmux/.tmux/rc/menu-fzf new file mode 100644 index 0000000..4355fb8 --- /dev/null +++ b/tmux/.tmux/rc/menu-fzf @@ -0,0 +1,6 @@ +bind-key o display-menu \ + find o "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh find '#{pane_current_path}'\"" \ + procs p "display-popup -E -w 100% -h 100% \"~/.tmux/bin/fzf.zsh procs '#{pane_current_path}'\"" \ + git-files g "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh git-files '#{pane_current_path}'\"" \ + git-branches b "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh git-branches '#{pane_current_path}'\"" \ + git-commits c "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh git-commits '#{pane_current_path}'\"" diff --git a/tmux/.tmux/rc/menu-various b/tmux/.tmux/rc/menu-various new file mode 100644 index 0000000..5bfb223 --- /dev/null +++ b/tmux/.tmux/rc/menu-various @@ -0,0 +1,7 @@ +bind-key t display-menu \ + music t "display-popup -E -w 100% '~/.tmux/bin/menu-music.sh'" \ + pass p "display-popup -E '~/.tmux/bin/menu-pass-session.sh'" \ + dict d "display-popup -E -h 100% '~/.tmux/bin/menu-dict.sh'" \ + calc c "display-popup -E '~/.tmux/bin/menu-calc.sh'" \ + cal l "display-popup 'cal -3N'" \ + top o "display-popup -E -h 100% 'top -s 1'" diff --git a/tmux/.tmux/rc/urlview b/tmux/.tmux/rc/urlview new file mode 100644 index 0000000..7568cc1 --- /dev/null +++ b/tmux/.tmux/rc/urlview @@ -0,0 +1,6 @@ +bind-key u { + capture-pane -J + save-buffer /tmp/tmux-buffer + delete-buffer + display-popup -E -w 100% "urlview /tmp/tmux-buffer" +}