https://github.com/artemave/tmux_capture_last_command_output
Capture the output of the last terminal command and open it an editor in a separate tmux window.
https://github.com/artemave/tmux_capture_last_command_output
tmux tmux-plugins
Last synced: 11 months ago
JSON representation
Capture the output of the last terminal command and open it an editor in a separate tmux window.
- Host: GitHub
- URL: https://github.com/artemave/tmux_capture_last_command_output
- Owner: artemave
- License: mit
- Created: 2022-01-30T13:24:27.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-29T10:07:15.000Z (over 3 years ago)
- Last Synced: 2025-03-23T16:51:22.284Z (about 1 year ago)
- Topics: tmux, tmux-plugins
- Language: Shell
- Homepage:
- Size: 3.91 KB
- Stars: 24
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tmux Capture Last Command Output
Capture the output of the last terminal command and open it an editor in a separate tmux window.
## Installation
### Using [TPM](https://github.com/tmux-plugins/tpm):
set -g @plugin 'artemave/tmux_capture_last_command_output'
Hit prefix + I to fetch and source the plugin.
### Manual
Clone the repo:
git clone https://github.com/artemave/tmux_capture_last_command_output.git ~/.tmux/plugins/tmux_capture_last_command_output
Source it in your `.tmux.conf`:
run-shell ~/.tmux/plugins/tmux_capture_last_command_output/tmux_capture_last_command_output.tmux
Reload TMUX conf by running:
tmux source-file ~/.tmux.conf
## Configuration
#### @command-capture-key
Required. Set Prefix + key to trigger the plugin. For example, `prefix+t`:
```
set -g @command-capture-key t
```
#### @command-capture-prompt-pattern
Required. A regexp to identify command separator. Usually a prompt. E.g., if set to '] % ', the plugin will capture the latest output up until the first line that contains '] % ':
```
set -g @command-capture-prompt-pattern '] % '
```
#### @command-capture-editor-cmd
Optional. An editor to use for the captured output. Defaults to `$EDITOR -`, which works with vim/nvim. Example:
```
set -g @command-capture-editor-cmd 'nvim -'
```