Luuman's Blog

因为有了危机感,所以会义无反顾。


  • Home

  • About

  • Archives

  • Search

Terminal配置

Posted on 2017-08-02 Edited on 2017-07-31 In Tool

vim ~/.bash_profile

a :编辑模式
esc :命令模式
:wq :保存并退出

1
2
3
4
5
6
# for color
export CLICOLOR=1
# \h:\W \u\$
export PS1='\[\033[01;33m\]\u@\h\[\033[01;31m\] \W\$\[\033[00m\] '
# grep
alias grep='grep --color=always'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
find_git_branch () {
local dir=. head
until [ "$dir" -ef / ]; do
if [ -f "$dir/.git/HEAD" ]; then
head=$(< "$dir/.git/HEAD")
if [[ $head = ref:\ refs/heads/* ]]; then
git_branch="<${head#*/*/}>"
elif [[ $head != '' ]]; then
git_branch="<(detached)>"
else
git_branch="<(unknow)>"
fi
return
fi
dir="../$dir"
done
git_branch=''
}
# for color
export CLICOLOR=1
# \h:\W \u\$
PROMPT_COMMAND="find_git_branch; $PROMPT_COMMAND"
export PS1='\[\033[01;33m\]\u@\[\033[01;31m\]\W\[\033[00;31m\] $git_branch\[\033[01;31m\]\$\[\033[00m\] '
# Terminal
WeChat SDK
Vue组件探秘

Luuman

爱折腾,爱运动,更爱游离于错综复杂的编码与逻辑中,无法自拔。相信编程是一门艺术,自诩为游弋在代码里的人生。
92 posts
19 categories
36 tags
友情链接
  • 编程の趣
  • 翁天信
  • MOxFIVE
  • Meicai
广告位 广告位 广告位
© 2019 Luuman
Powered by Hexo v3.9.0
|
Theme – Nice.Gemini v7.3.0