oh-my-zsh配置 alias 指定指令別名

在平時使用shell中經常要輸入很長的命令是不是很頭疼!那咱們就來設置一下快捷指令吧!

首先確保你已經安裝過oh-my-zsh~

然後執行

vim ~/.zshrc

這時候可以看到文件底部內容爲

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

那麼就直接在文件底部 按照他的形式去添加就好了~

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias go-work="cd ~/Document/work"

不要忘了讓剛纔的命令生效,不然使用tab鍵無法自動補全

source ~/.zshrc

ok,接下來在你的shell中試試go-work吧~

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章