summaryrefslogtreecommitdiff
path: root/.bashrc
diff options
context:
space:
mode:
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc34
1 files changed, 27 insertions, 7 deletions
diff --git a/.bashrc b/.bashrc
index 5958bd3..165f24c 100644
--- a/.bashrc
+++ b/.bashrc
@@ -7,7 +7,7 @@ export EDITOR="vim"
export STARDICT_DATA_DIR="$HOME/bin/dict/"
export NOTES_DIR="$HOME/notes"
export TERM="screen-256color"
-export GREP_COLOR='00;38;5;166'
+export GREP_COLOR='mt=00;38;5;166'
export CM_HISTLENGTH=50
# my scripts on PATH
export PATH=/usr/local/bin:$PATH
@@ -367,7 +367,7 @@ function ean() {
function da(){
# da = delete action
# if it's done get rid of it, but with a confirm dialog
- SEL=$(rg -l ".*" $GTD_DIR -g '!proj*'| cut -c 21- | fzf -e -i --bind 'tab:up')
+ SEL=$(rg -l --max-depth=1 ".*" $GTD_DIR -g '!proj*'| cut -c 21- | fzf -e -i --bind 'tab:up')
#trickery to add to beginning of the file
content="$GTD_DIR$SEL"
echo "$content"
@@ -404,6 +404,7 @@ function pc(){
echo "$3" >>"$proj"
fi
}
+
function pl(){
# pl = project list
clear
@@ -414,11 +415,30 @@ function pl(){
echo ' '
echo '-----------------------------------'
else
- echo "--------- all $1 projects ----------"
- echo ' '
- rg $1 $GTD_DIR | rg -w proj* --line-number --sort path | cut -c 26- | rev | cut -c 12- | rev | nl
- echo ' '
- echo '---------------------------------------'
+ #test for negation (not prefix)
+ if [[ "$1" =~ ^not* ]]; then
+ myString="${1:3}"
+ #test for second input
+ if [ $# -eq 2 ]; then
+ echo "----------- all $1 tasks that are $2 ----------"
+ echo ' '
+ rg --max-depth=1 --files-without-match "$myString" $GTD_DIR -w proj* --line-number --sort path | while read line; do rg --with-filename "$2" "$line"| cut -c 21- ; done
+ else
+ # just one negative search
+ echo "----------------- all $1 projects ----------------"
+ echo ' '
+ rg --max-depth=1 --files-without-match "$myString" $GTD_DIR | rg -w proj* --sort path | cut -c 26- | rev | cut -c 5- | rev | nl
+ echo ' '
+ echo '--------------------------------------------------------'
+
+ fi
+ else
+ echo "--------- all $1 projects ----------"
+ echo ' '
+ rg $1 $GTD_DIR | rg -w proj* --sort path | cut -c 26- | rev | cut -c 12- | rev | nl
+ echo ' '
+ echo '---------------------------------------'
+ fi
fi
}
function pe() {