LoginSignup
6
7

More than 5 years have passed since last update.

macOS+iTerm2+tmuxな環境でクリップボードを扱う(2017)

Posted at

環境

  • macOS 10.12.6 (Sierra)
  • iTerm2 3.1.2
  • tmux 2.5
  • vim 8.0 (Homebrewでインストール vim --version+clipboard となっているのを確認)

iTerm2 の設定

Preferences を開き、 [General] タブの "Applications in terminal may access clipboard" のチェックをつける

スクリーンショット 2017-10-05 11.31.02.png

reattach-to-user-namespace のインストール

tmux の中からクリップボードにアクセスするため、

$ brew install reattach-to-user-namespace

tmux の設定

~/.tmux.conf に以下の行を追加

~/.tmux.conf
set-option -g default-command "reattach-to-user-namespace -l bash"

vim の設定

~/.vimrcに以下の行を追加

~/.vimrc
set clipboard=unnamed
6
7
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
6
7