From 4ae36ba00e2116fd771916d265035f4eb1c6f6c5 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Thu, 13 Apr 2023 11:43:27 +0800 Subject: Update --- bin/task/shellrc | 1 - zsh/zshrc | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/task/shellrc b/bin/task/shellrc index 0416dfa..7098ac0 100644 --- a/bin/task/shellrc +++ b/bin/task/shellrc @@ -4,7 +4,6 @@ tk() { task rc.context=`cat ~/.task/context` $@; } tkc(){ echo $1 >~/.task/context; } alias tkcc='task context' tkcn() { echo none >~/.task/context; } -tkch() { echo home >~/.task/context; } tkcp() { echo plan >~/.task/context; } [ "$shell" = zsh ] && compdef tk=task alias tka='tk annotate' diff --git a/zsh/zshrc b/zsh/zshrc index a43dc2e..6a5a587 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -36,8 +36,8 @@ _comp_options+=(globdots) # With hidden files zstyle ':completion:*' menu select zstyle ':completion::complete:*' gain-privileges 1 - -_get_context() { +# Set variable CONTEXT +function _get_context() { CONTEXT_FILE=${CONTEXT_FILE:-~/.task/context} LAST_MODIFY_TIME=$(stat -c %y "$CONTEXT_FILE") @@ -46,6 +46,7 @@ _get_context() { MODIFY_TIME="$LAST_MODIFY_TIME" fi } + autoload -Uz add-zsh-hook add-zsh-hook precmd precmd function precmd() { -- cgit v1.2.3-70-g09d2