LoginSignup
1
1

More than 5 years have passed since last update.

UbuntuとmacOSで zsh / tmux の設定ファイルを分ける

Posted at

zshやtmuxの設定ファイルをdotfilesリポジトリで管理しているのですが、OSによって設定内容を変更しないと期待する動作を得らなかったため、UbuntuとmacOSによって設定ファイルを分けてみました。

基本的には 参考 に記載したサイトを参考にさせていただいて、OSによって読み込む設定ファイルを分けています。
OSによって と記載しましたが、厳密には macOSLinux もしくは それ以外 としています。
私の場合は今のところ macOS or Ubuntu でこの設定で動いているのでOS判定は厳密に行なっていません。

zshrc / z_profile


+case ${OSTYPE} in
+  # macOS
+  darwin*)
+    source ~/.zprofile.macos
+    ;;
+  linux*)
+    source ~/.zprofile.linux
+    ;;
+esac

tmux

+if-shell 'test "$(uname -s)" = Darwin' "source-file ~/.tmux.conf.macos" "source-file ~/.tmux.conf.linux"

ll 等でファイル一覧が見やすいかなと思い、ファイル名を .file_name.os_name としたのですが、私の vimrc ではシンタックスハイライトがつかなかったので、 .os_name.file_name でも良かったかなと思っています。

参考

http://shkh.hatenablog.com/entry/2012/06/17/222936
http://kiririmode.hatenablog.jp/entry/20150207/1423296151

blogだけではなくqiitaにも投稿してみました。

1
1
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
1
1