27
31

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MacVimをダウンロードしたら~/.zshrcとかに書いておく設定

Last updated at Posted at 2012-12-26

設定

~/.zshrc
alias vim=/Applications/MacVim.app/Contents/MacOS/Vim
alias vi=vim

上記のように, vim自体に対するaliasの設定についてはよく見かけるが,
vimdiffviewも使うなら, 下記のいずれかの方法による設定が必要.

①aliasによる設定

~/.zshrc
alias vimdiff=/Applications/MacVim.app/Contents/bin/vimdiff
alias view=/Applications/MacVim.app/Contents/bin/view

②PATHによる設定

~/.zprofile
export PATH="/Applications/MacVim.app/Contents/bin:${PATH}"
MacVimに同梱されているコマンド
$ ls -lhFG /Applications/MacVim.app/Contents/bin
total 328
lrwxr-xr-x  1 skkzsh  admin     4B  1  4  2024 gview@ -> mvim
lrwxr-xr-x  1 skkzsh  admin     4B  1  4  2024 gvim@ -> mvim
lrwxr-xr-x  1 skkzsh  admin     4B  1  4  2024 gvimdiff@ -> mvim
-rwxr-xr-x@ 1 skkzsh  admin   144B  1  4  2024 gvimtutor*
lrwxr-xr-x  1 skkzsh  admin     4B  1  4  2024 mview@ -> mvim
-rwxr-xr-x@ 1 skkzsh  admin   1.9K  1  4  2024 mvim*
lrwxr-xr-x  1 skkzsh  admin     4B  1  4  2024 mvimdiff@ -> mvim
lrwxr-xr-x  1 skkzsh  admin     9B  1  4  2024 mvimtutor@ -> gvimtutor
lrwxr-xr-x  1 skkzsh  admin     4B  1  4  2024 view@ -> mvim
lrwxr-xr-x  1 skkzsh  admin     4B  1  4  2024 vim@ -> mvim
lrwxr-xr-x  1 skkzsh  admin     4B  1  4  2024 vimdiff@ -> mvim
-rwxr-xr-x@ 1 skkzsh  admin   2.1K  1  4  2024 vimtutor*
-rwxr-xr-x@ 1 skkzsh  admin   149K  1  4  2024 xxd*

参考

自分はおおよそ以下のように書いている.

~/.zprofile
case "$(uname)" in

    Darwin) # OSがMacならば
        if [[ -d /Applications/MacVim.app ]]; then # MacVimが存在するならば
            export PATH="/Applications/MacVim.app/Contents/bin:${PATH}"
        fi
        ;;

    *) ;; # OSがMac以外ならば何もしない
esac

参照

27
31
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
27
31

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?