最近在 csh shell 環境下工作 在使用 vim 時 發現 airblade/vim-gitgutter 這個套件無法正常使用
在閱讀 airblade/vim-gitgutter 內相關的說明後 看到
Why aren't any signs showing at all? Here are some things you can check: - Your git config is compatible with the version of git which your Vim is calling (:echo system('git --version')). - Your Vim supports signs (:echo has('signs') should give 1). - Your file is being tracked by git and has unstaged, saved changes. - If you use a non-POSIX shell, add set shell=/bin/bash to your ~/.vimrc. - If your grep does not support the color flag, add let g:gitgutter_grep_command = 'grep -e' to your ~/.vimrc.
在我遇到的情況 恰好是由於 csh shell 不是 POSIX shell 因此 必須要在 .vimrc 寫入
$ set shell=/bin/bash
Reference
Top Ten Reasons not to use the C shell