本文介绍了从 VSC 内部向 Bash 终端添加别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
[visual-studio-code] 在 VSC 中使用 bash 终端时,有没有办法给它添加别名?
[visual-studio-code] Is there a way to add aliases to the bash terminal when using it from within VSC?
推荐答案
我在这里找到了答案https://gist.github.com/wzup/36b5159d8c580b827384
作为灵感
# create a file C:\Users\[user]\.bashrc
# add this content
# add your onw aliases or changes these ones as you like
# to make a dot (.bashrs) file in windows, create a file ".bashrs." (without extention) and save. windows will save it as ".bashrc"
alias ls='ls -alh'
alias cdnginx='cd /c/nginx && ls'
alias cdmcga='cd /c/Users/[user]/sbox/node/mcga && ls'
alias cdfood9='cd /c/Users/[user]/sbox/node/food9 && ls'
alias cdmysql='cd /c/nginx/mysql/bin && ls'
alias cdsbox='cd /c/Users/[user]/sbox && ls'
alias cdangular='cd /c/Users/[user]/sbox/angularjs && ls'
alias cdmongobin='cd "/c/Program Files/MongoDB/Server/3.0/bin" && ls'
alias cdmongodata='cd /c/mongodb/data/db && ls'
alias sbrc='cd ~ && source .bashrc'
alias mydocs='cd ~/Documents'
这篇关于从 VSC 内部向 Bash 终端添加别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!