handlename's blog

コード片など

tmuxのコピーモードの選択範囲を外部のコマンドにわたす

  • tmux 1.8

tmuxのコピーモードで、選択中のテキストを外部のコマンドに渡せたら捗るのになー と思ってman引いたらそのまんまな例が載ってた。

One command accepts an argument, copy-pipe, which copies the selection and pipes it to a command. For example the following will bind `C-q' to copy the selection into /tmp as well as the paste buffer:

  bind-key -temacs-copy C-q copy-pipe "cat >/tmp/out"

cat >/tmp/out の部分を置き換えれば好きなコマンドに選択範囲を渡せる。 つまり、範囲を選択してNoPasteに投げる、みたいなことがコマンド一発でできる。

べんり〜