3 ms·
I wish tmux had the ability to pipe the buffer to some external program, e.g. vim. Their vi-mode is okay, but it's never going to be the same as native vim with
by rrradical 6y ago
I wish tmux had the ability to pipe the buffer to some external program, e.g. vim. Their vi-mode is okay, but it's never going to be the same as native vim with my configs, plugins, etc.
That aside, I do really enjoy tmux and appreciate the hard work of the devs!
- ianthehenry 6y agoYou can do that! tmux capture-pane -p -S - | vim - Or bind that to a key. -p is "print to stdout", -S specifies where to start and - means "the beginning of history" (by default capture-pane just gives you the visible contents). I'm not sure how to do the same thing with the current selection -- copy-pipe doesn't seem to work with vim, for some reason.
- vbsteven 6y agoIn the same vein, I use this in my .tmux.conf: bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer"' And with that I can just hit `<prefix> u` to pipe the current pane into urlview. Typical use is for example when pushing to a branch and bitbucket prints the URL to create a PR to stdout. I hit `<prefix> u`, `<enter>` and the link is open in Firefox.
- rrradical 6y agoThanks, that seems close to what I'm looking for, but I'm not sure how to get a keybind that has behavior similar to scrollback mode. I think tmux is missing the ability to give control over to an arbitrary shell command. For example, if I bind that to a key, I can only run it in the background right?