成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

Mac 配置代碼高亮 Git狀態(tài)顯示

Prasanta / 2525人閱讀

摘要:首先進(jìn)入到到目錄一般默認(rèn)打開的都是,如果不是輸入回車即可,編輯目錄下的編輯配置代碼如下復(fù)制粘貼退出保存,然后執(zhí)行一下回車即可。然后我們?cè)趤黹_啟代碼高亮開關(guān),編輯開啟配置項(xiàng)代碼高亮開啟文件內(nèi)容行號(hào)保存退出就可以了。

Mac 一個(gè)為開發(fā)者量身定做的筆記本,相信你已經(jīng)裝好了iTerm2了,打開你的iTerm2開始我們的配置。文章來源于個(gè)人博客 YANGXIANGMING。分享給大家希望能幫助大家配置一個(gè)好的開發(fā)環(huán)境,好的開發(fā)環(huán)境才有好的心情Code。

首先進(jìn)入到Home到目錄一般默認(rèn)打開的都是Home,如果不是輸入 cd ~ 回車即可,編輯Home目錄下的 .bash_profile 編輯 vim .bash_profile 配置代碼如下:

#Git branch status
function git_status {
  local unknown untracked stash clean ahead behind staged dirty diverged
  unknown="0;34" # blue
  untracked="0;32" # green
  stash="0;32" # green
  clean="0;32" # green
  ahead="0;33" # yellow
  behind="0;33" # yellow
  staged="0;96" # cyan
  dirty="0;31" # red
  diverged="0;31" # red

  if [[ $TERM = *256color ]]; then
    unknown="38;5;20" # dark blue
    untracked="38;5;76" # mid lime-green
    stash="38;5;76" # mid lime-green
    clean="38;5;82" # brighter green
    ahead="38;5;226" # bright yellow
    behind="38;5;142" # darker yellow-orange
    staged="38;5;214" # orangey yellow
    dirty="38;5;202" # orange
    diverged="38;5;196" # red
  fi

  branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
  if [[ -n "$branch" ]]; then
    if [[ "$branch" == "HEAD" ]]; then
      branch=$(git rev-parse --short HEAD 2>/dev/null)
    fi
    git_status=$(git status 2> /dev/null)
    # If nothing changes the color, we can spot unhandled cases.
    color=$unknown
    if [[ $git_status =~ "Untracked files" ]]; then
      color=$untracked
      branch="${branch}+"
    fi
    if git stash show &>/dev/null; then
      color=$stash
      branch="${branch}*"
    fi
    if [[ $git_status =~ "working directory clean" ]]; then
      color=$clean
    fi
    if [[ $git_status =~ "Your branch is ahead" ]]; then
      color=$ahead
      branch="${branch}"
    fi
    if [[ $git_status =~ "Your branch is behind" ]]; then
      color=$behind
      branch="${branch}"
    fi
    if [[ $git_status =~ "Changes to be committed" ]]; then
      color=$staged
    fi
    if [[ $git_status =~ "Changed but not updated" ||
          $git_status =~ "Changes not staged"      ||
          $git_status =~ "Unmerged paths" ]]; then
      color=$dirty
    fi
    if [[ $git_status =~ "Your branch".+diverged ]]; then
      color=$diverged
      branch="${branch}!"
    fi
    printf "