LoginSignup
42
45

More than 5 years have passed since last update.

tmuxのバージョンを1.8にアップデートして、クリップボードの設定

Posted at

現在のバージョン確認

tmux -V
tmux 1.7

アップグレード

brew upgrade tmux

tmux -V
tmux 1.8

アップグレードされてますね。

で、ここからが今回アップグレードしてみようと思った理由。
tmuxの1.8からcopy-pipeが導入されているらしい。
参考 http://robots.thoughtbot.com/post/55885045171/tmux-copy-paste-on-os-x-a-better-future

このおかげで、OSのクリップボードに取り込む処理が不要になっている。

tmux.confに以下を追加
(キーバインドを変更したい場合は変更してください。)

# Use vim keybindings in copy mode
setw -g mode-keys vi

# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"

# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"

これで、vで選択してyでクリップボードにコピーされます。

42
45
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
42
45