2013-05-07 76 views
2

我使用終端VIM在OSX,我已經通過自制軟件安裝的ctags生成C標籤標記內內OSX VIM不工作

然後我加入了/usr/local/bin/目錄,是我路上

,也別名CTAGS使用自制安裝版本

所有這些在我的.zshrc中,並且它工作正常。

的問題是,當我嘗試VIM中運行:!ctags -R .,因爲它好好嘗試公認的選項

它失敗「-R」

我已經拼命地跑:!which ctags並返回

/usr/bin/ctags 

而不是/usr/local/bin/ctags

有什麼辦法解決這個問題?

UPDATE

添加我zshrc文件

# number of lines kept in history 
export HISTSIZE=1000 
# number of lines saved in the history after logout 
export SAVEHIST=1000 
# location of history 
export HISTFILE=~/.zhistory 
# append command to history file once executed 
setopt inc_append_history 

autoload -U compinit 
compinit 

# Colors 
autoload -U colors 
colors 
setopt prompt_subst 

# Save a smiley to a local variable if the last command exited with success. 
local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})" 

# Show the relative path on one line, then the smiley. 
PROMPT='%{$fg[cyan]%}%~ ${smiley} %{$reset_color%}' 

RPROMPT='%{$fg[cyan]%} $(~/Dotfiles/rbenv-version.sh)$(~/Dotfiles/git-cwd-info.sh)%{$reset_color%}' 

# Example aliases 
source ~/Dotfiles/zsh/aliases 
source ~/Dotfiles/zsh/plugins/bundler.zsh 

export SHELL=/bin/zsh 

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin 
export PATH="$HOME/.rbenv/bin:$PATH" 
export PATH=/usr/local/bin:$PATH 

eval "$(rbenv init -)" 

export LC_ALL=en_US.utf-8 
export LANG="$LC_ALL" 

export EDITOR=vim 
### Added by the Heroku Toolbelt 
export PATH="/usr/local/heroku/bin:$PATH" 
+0

你在哪裏添加/ usr/local/bin到你的PATH?在.bashrc中? – echristopherson 2013-05-07 00:14:33

+1

確保何時將路徑添加到/ usr/local/bin路徑的前面。而不是結束。 – FDinoff 2013-05-07 00:14:40

+0

@echristopherson它表示'.zshrc'中的帖子 – FDinoff 2013-05-07 00:15:12

回答

2

我發現了什麼問題,相應地this answer in superuser

Vim的 '忽略' 的別名,因爲你的shell是不是以'心情'來解析你的.bash_profile/.bashrc(你沒有指定,你的地址是 al iases被定義),因爲它不是作爲登錄/交互式 shell啓動的(請閱讀此處以瞭解更多關於何時讀取什麼內容以及何時讀取 的原因)。

和我的解決方案是建立一個全球性的路徑一樣described here

是編輯我/etc/paths

,並添加/usr/local/bin開頭的文件的(在它不」等情況t工作)

/usr/local/bin 
/usr/bin 
/bin 
/usr/sbin 
/sbin