diff options
Diffstat (limited to 'zsh/zshrc')
-rw-r--r-- | zsh/zshrc | 25 |
1 files changed, 5 insertions, 20 deletions
@@ -36,18 +36,6 @@ _comp_options+=(globdots) # With hidden files | |||
36 | zstyle ':completion:*' menu select | 36 | zstyle ':completion:*' menu select |
37 | zstyle ':completion::complete:*' gain-privileges 1 | 37 | zstyle ':completion::complete:*' gain-privileges 1 |
38 | 38 | ||
39 | function _already_sync_after_wakeup() { | ||
40 | WAKEUP="$HOME/.wakeup" | ||
41 | [ ! -e "$WAKEUP" ] && return 0 | ||
42 | |||
43 | latest=$(date -d @`stat -c %X "$WAKEUP"` +%s) | ||
44 | # If sync time is older than wakeup time (timestamp in file), then return false | ||
45 | if [ $latest -gt "$(cat $WAKEUP)" ]; then | ||
46 | return 0 | ||
47 | else | ||
48 | return 1 | ||
49 | fi | ||
50 | } | ||
51 | 39 | ||
52 | autoload -Uz add-zsh-hook | 40 | autoload -Uz add-zsh-hook |
53 | autoload -Uz parameter | 41 | autoload -Uz parameter |
@@ -64,13 +52,6 @@ function precmd() { | |||
64 | fi | 52 | fi |
65 | PROMPT="%B%(?:%F{green}%m%f:%K{red}%F{black}%m%f%k)%f%F{cyan} %c%f%b${jobstring} " | 53 | PROMPT="%B%(?:%F{green}%m%f:%K{red}%F{black}%m%f%k)%f%F{cyan} %c%f%b${jobstring} " |
66 | 54 | ||
67 | # RIGHT PROMPT | ||
68 | # Show context and git status of tracking repos at right | ||
69 | UNSYNC_REPOS=$(NUM=$($SETTING_DIR/bin/git/check-repos.sh -n); (( $NUM != 0 )) && echo $NUM) | ||
70 | NEED_SYNC=$(_already_sync_after_wakeup || echo S) | ||
71 | RPROMPT="%B%K{blue}%F{yellow}${CONTEXT:+ $CONTEXT }%f%k%K{red}%F{black}${UNSYNC_REPOS}${NEED_SYNC}%f%k%b" | ||
72 | |||
73 | |||
74 | [ -n "$PRE_POPULATE" ] && print -z "$PRE_POPULATE" | 55 | [ -n "$PRE_POPULATE" ] && print -z "$PRE_POPULATE" |
75 | } | 56 | } |
76 | 57 | ||
@@ -147,4 +128,8 @@ case ":$PATH:" in | |||
147 | esac | 128 | esac |
148 | # pnpm end | 129 | # pnpm end |
149 | 130 | ||
150 | source ~/.profile | 131 | source ~/.profile 2>/dev/null |
132 | |||
133 | # Makefile | ||
134 | zstyle ':completion:*:make:*:targets' call-command true | ||
135 | zstyle ':completion:*:*:make:*' tag-order 'targets' 2>/dev/null | ||