Prechádzať zdrojové kódy

working on my theme

Kevin Heinicke 10 rokov pred
rodič
commit
0abf3d1db9
2 zmenil súbory, kde vykonal 13 pridanie a 34 odobranie
  1. 7 29
      .zsh_custom/themes/bixel.zsh-theme
  2. 6 5
      .zshrc

+ 7 - 29
.zsh_custom/themes/bixel.zsh-theme

@@ -3,40 +3,18 @@
 
 # Git: branch/detached head, dirty status
 prompt_git() {
-  local ref dirty mode repo_path
-  repo_path=$(git rev-parse --git-dir 2>/dev/null)
-
+  local color dirty branch
   if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
     dirty=$(parse_git_dirty)
-    ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)"
     if [[ -n $dirty ]]; then
-      prompt_segment yellow black
+      color='yellow'
     else
-      prompt_segment green black
-    fi
-
-    if [[ -e "${repo_path}/BISECT_LOG" ]]; then
-      mode=" <B>"
-    elif [[ -e "${repo_path}/MERGE_HEAD" ]]; then
-      mode=" >M<"
-    elif [[ -e "${repo_path}/rebase" || -e "${repo_path}/rebase-apply" || -e "${repo_path}/rebase-merge" || -e "${repo_path}/../.dotest" ]]; then
-      mode=" >R>"
+      color='green'
     fi
-
-    setopt promptsubst
-    autoload -Uz vcs_info
-
-    zstyle ':vcs_info:*' enable git
-    zstyle ':vcs_info:*' get-revision true
-    zstyle ':vcs_info:*' check-for-changes true
-    zstyle ':vcs_info:*' stagedstr '✚'
-    zstyle ':vcs_info:git:*' unstagedstr '●'
-    zstyle ':vcs_info:*' formats ' %u%c'
-    zstyle ':vcs_info:*' actionformats ' %u%c'
-    vcs_info
-    echo -n "${ref/refs\/heads\// }${vcs_info_msg_0_%% }${mode}"
+    branch=$(git rev-parse --abbrev-ref HEAD)
+    echo -n "%F{$color}➤ $branch%f"
   fi
 }
 
-PROMPT='[%~] '
-RPROMPT='[$(prompt_git)]'
+PROMPT='%F{blue}%~%f '
+RPROMPT='$(prompt_git)'

+ 6 - 5
.zshrc

@@ -9,7 +9,7 @@ export ZSH_CUSTOM=~/.zsh_custom
 # Look in ~/.oh-my-zsh/themes/
 # Optionally, if you set this to "random", it'll load a random theme each
 # time that oh-my-zsh is loaded.
-ZSH_THEME="agnoster"
+ZSH_THEME="bixel"
 
 # Device-specifig setup (ignored by git)
 # source local config first to overwrite default theme if wanted
@@ -28,7 +28,8 @@ alias ll='ls -Fhla | less -R'
 alias l='ls -lhatr'
 
 # vi-mode ❤️ :O
-bindkey -v
-bindkey '^?' backward-delete-char
-bindkey '^w' backward-kill-word
-bindkey '^r' history-incremental-search-backward
+# not so useful in daily life...
+# bindkey -v
+# bindkey '^?' backward-delete-char
+# bindkey '^w' backward-kill-word
+# bindkey '^r' history-incremental-search-backward