From 8cc874b8304f054671df68110f0aebcc5bc376dc Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Wed, 23 Mar 2022 19:51:35 +0530 Subject: [PATCH] tmux: Add plugin to capture last command output --- .gitmodules | 3 +++ tmux/.tmux.conf | 6 ++++++ tmux/.tmux/plugins/tmux-cmd-capture | 1 + 3 files changed, 10 insertions(+) create mode 160000 tmux/.tmux/plugins/tmux-cmd-capture diff --git a/.gitmodules b/.gitmodules index 589f5fa..59b2e18 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "tmux/.tmux/plugins/tmux-fuzzback"] path = tmux/.tmux/plugins/tmux-fuzzback url = https://github.com/roosta/tmux-fuzzback.git +[submodule "tmux/.tmux/plugins/tmux-cmd-capture"] + path = tmux/.tmux/plugins/tmux-cmd-capture + url = https://github.com/artemave/tmux_capture_last_command_output.git diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 39bf8c3..f29a044 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -89,6 +89,11 @@ bind S command-prompt -p 'Save history to filename:' -I '/tmp/tmux.history' 'cap # Session selector bind T display-popup -E "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t" +# Last command output +set -g @command-capture-key t +set -g @command-capture-prompt-pattern '] % ' +set -g @command-capture-editor-cmd 'nvim -R' + # This effects color rendering and typing on terminal. set-option -g default-terminal "tmux-256color" set-option -ga terminal-overrides ",foot:Tc" @@ -136,3 +141,4 @@ run-shell '~/.tmux/plugins/tmux-copycat/copycat.tmux' run-shell '~/.tmux/plugins/tmux-open/open.tmux' run-shell '~/.tmux/plugins/tmux-butler/tmux-butler.tmux' run-shell '~/.tmux/plugins/tmux-fuzzback/fuzzback.tmux' +run-shell '~/.tmux/plugins/tmux-cmd-capture/tmux_capture_last_command_output.tmux' diff --git a/tmux/.tmux/plugins/tmux-cmd-capture b/tmux/.tmux/plugins/tmux-cmd-capture new file mode 160000 index 0000000..bfd0f89 --- /dev/null +++ b/tmux/.tmux/plugins/tmux-cmd-capture @@ -0,0 +1 @@ +Subproject commit bfd0f897b32aea2eaa739520a6bd0a1b22d1d864