在平時使用
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
吧~