aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--alias2
-rw-r--r--zsh/zshrc22
2 files changed, 16 insertions, 8 deletions
diff --git a/alias b/alias
index d53621d..879adb3 100644
--- a/alias
+++ b/alias
@@ -18,6 +18,8 @@ alias cdconfig="cd ~/config"
18alias tmuxconfig="$EDITOR ~/.tmux.conf" 18alias tmuxconfig="$EDITOR ~/.tmux.conf"
19cde() { cd /etc/$@; } 19cde() { cd /etc/$@; }
20alias cdetc='cde' 20alias cdetc='cde'
21alias ls='ls --color'
22alias grep='grep --color'
21 23
22# network 24# network
23alias digg='dig +noall +answer +multiline' 25alias digg='dig +noall +answer +multiline'
diff --git a/zsh/zshrc b/zsh/zshrc
index 79bc591..9d9069e 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -38,12 +38,22 @@ zstyle ':completion::complete:*' gain-privileges 1
38 38
39 39
40# PS1 with git status at right 40# PS1 with git status at right
41_get_context() {
42 CONTEXT_FILE=${CONTEXT_FILE:-~/.task/context}
43
44 LAST_MODIFY_TIME=$(stat -c %y "$CONTEXT_FILE")
45 if [ ! "$MODIFY_TIME" = "$LAST_MODIFY_TIME" ]; then
46 CONTEXT=$(cat "$CONTEXT_FILE")
47 MODIFY_TIME="$LAST_MODIFY_TIME"
48 fi
49 echo $CONTEXT
50}
41autoload -Uz add-zsh-hook 51autoload -Uz add-zsh-hook
42add-zsh-hook precmd precmd 52add-zsh-hook precmd precmd
43function precmd() { 53function precmd() {
44 RIGHT=$(NUM=$($SETTING_DIR/bin/git/check-repos.sh -n); (( $NUM != 0 )) && echo $NUM) 54 RIGHT=$(NUM=$($SETTING_DIR/bin/git/check-repos.sh -n); (( $NUM != 0 )) && echo $NUM)
45 PROMPT='%B%(?:%F{green}%m%f:%K{red}%F{black}%m%f%k)%f%F{cyan} %c%f%b ' 55 PROMPT='%B%(?:%F{green}%m%f:%K{red}%F{black}%m%f%k)%f%F{cyan} %c%f%b '
46 RPROMPT="%B%K{red}%F{black}${RIGHT}%f%k%b" 56 RPROMPT="%K{blue}%F{yellow}$(_get_context)%f%k %B%K{red}%F{black}${RIGHT}%f%k%b"
47 [ -n "$PRE_POPULATE" ] && print -z "$PRE_POPULATE" 57 [ -n "$PRE_POPULATE" ] && print -z "$PRE_POPULATE"
48} 58}
49 59
@@ -74,7 +84,7 @@ key[PageDown]="${terminfo[knp]}"
74key[Shift-Tab]="${terminfo[kcbt]}" 84key[Shift-Tab]="${terminfo[kcbt]}"
75 85
76# setup key accordingly 86# setup key accordingly
77bindkey -- '^[[Z' reverse-menu-complete 87bindkey -- ${key[Shift-Tab]} reverse-menu-complete
78#bindkey -- "\C-A" beginning-of-line 88#bindkey -- "\C-A" beginning-of-line
79#bindkey -- "\C-E" end-of-line 89#bindkey -- "\C-E" end-of-line
80#bindkey -- "\C-d" delete-char 90#bindkey -- "\C-d" delete-char
@@ -96,13 +106,9 @@ bindkey -- '^[[Z' reverse-menu-complete
96#bindkey -- "${key[Insert]}" overwrite-mode 106#bindkey -- "${key[Insert]}" overwrite-mode
97 107
98 108
99# Common shell options
100alias ls='ls --color'
101alias grep='grep --color'
102
103
104# Quick jump to parent folders 109# Quick jump to parent folders
105source ~/helper/zsh/bd.zsh 110source $SETTING_DIR/zsh/bd.zsh
111
106 112
107# Load my general settings 113# Load my general settings
108source $SETTING_DIR/bin/init/load-settings.sh 114source $SETTING_DIR/bin/init/load-settings.sh