美文网首页
mac终端配色

mac终端配色

作者: 简单的破小孩儿 | 来源:发表于2018-07-31 10:39 被阅读0次

现实git分支

Parses out the branch name from .git/HEAD:

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=''
}

PROMPT_COMMAND="find_git_branch; $PROMPT_COMMAND"
# Heree
black=$'\[\e[1;30m\]'
red=$'\[\e[1;31m\]'
green=$'\[\e[1;32m\]'
yellow=$'\[\e[1;33m\]'
blue=$'\[\e[1;34m\]'
magenta=$'\[\e[1;35m\]'
cyan=$'\[\e[1;36m\]'
white=$'\[\e[1;37m\]'
normal=$'\[\e[m\]'
 
PS1="$white[$magenta\u$white@$green\h$white:$cyan\w$yellow\$git_branch$white]\$ $normal"

显示文件和文件夹不同颜色

alias cls='tput reset'
alias egrep='egrep -G'
alias fgrep='fgrep -G'
alias grep='grep -G'
alias l.='ls -d .* -G'
alias ll='ls -l -G'
alias ls='ls -G'
alias vi='vim'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'

相关文章

  • mac终端配色

    现实git分支 Parses out the branch name from .git/HEAD: 显示文件和文...

  • iTerm2+Vim+Ls配色

    01 Mac下终端配置(item2 + oh-my-zsh + solarized配色方案) Mac下终端配置(i...

  • Mac终端优化

    之前有一篇文章写到如何美化Mac终端和这篇文章继续总结梳理一下。 1. 终端配色 Mac默认的终端白底黑字非常难看...

  • Mac 终端的Solarlized配色

    下载Solarlized配色 然后点开终端(可以Command+Space, 输入term并回车),打开偏好设置(...

  • iterm+oh-my-zsh

    转载Mac 下终端配置(item2 + oh-my-zsh +3024Night 配色方案) - Laravel爱...

  • Mac 下 iTem2 配色

    mac下经常会使用到终端,item2的终端相比xcode的终端更好用,但是配色并不是很好看,所以一下就是item2...

  • Mac终端配色方案 Color schemes

    要想配置出这种好看的方案,标配就是:zsh + Meslo字体 + Soloarized Dark显示方案 + A...

  • ubuntu 下的SecureCRT配置

    摘要: 关键词:SecureCRT配色, SecureCRT设置颜色, Linux终端配色,Linux终端颜色设置...

  • 终端配色

    sudo apt-get install gitgit clone https://github.com/Mayc...

  • 终端配色

    Linux下的命令dircolors可用于设置ls命令输出结果的颜色。其本质是通过设置环境变量LS_COLORS来...

网友评论

      本文标题:mac终端配色

      本文链接:https://www.haomeiwen.com/subject/cepcvftx.html