bin: remove obsolete note functions & improve diffing
This commit is contained in:
parent
9188a80fe7
commit
d848d61fce
|
@ -159,15 +159,6 @@ alias jcj='jcl -o json-pretty -u'
|
||||||
|
|
||||||
alias grp='grep --line-number --ignore-case --binary-files=without-match --directories=skip'
|
alias grp='grep --line-number --ignore-case --binary-files=without-match --directories=skip'
|
||||||
alias grpr='grp --recursive'
|
alias grpr='grp --recursive'
|
||||||
# Use grep and sed to replace $1 with $2 recursively
|
|
||||||
rpl() {
|
|
||||||
grep --null --recursive --files-with-matches "$1" |
|
|
||||||
xargs -0 sed -i "/${1}/{
|
|
||||||
s//${2}/g
|
|
||||||
w /dev/stdout
|
|
||||||
}"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Recover stray swap files from neovim
|
# Recover stray swap files from neovim
|
||||||
alias vrec="ls $XDG_DATA_HOME/nvim/swap | sed 's/\%/\//g' | sed 's|\(.*\)\..*|\1|' | head -1 | xargs -r nvim"
|
alias vrec="ls $XDG_DATA_HOME/nvim/swap | sed 's/\%/\//g' | sed 's|\(.*\)\..*|\1|' | head -1 | xargs -r nvim"
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
note "box/$(date +%F)-$1"
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
# interactive diff with pagination
|
# interactive diff with pagination
|
||||||
diff --color=always --report-identical-files -U 2 "$@" | less --quit-if-one-screen
|
diff --color=always --report-identical-files -U 2 "$@" | diffr --colors refine-added:none:background:0x33,0x66,0x33:bold --colors added:none:background:0x33,0x44,0x33 --colors refine-removed:none:background:0x66,0x33,0x33:bold --colors removed:none:background:0x44,0x33,0x33 | less --RAW-CONTROL-CHARS --quit-on-intr
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# create a diff of diffs - https://stackoverflow.com/a/23527631
|
||||||
|
dif "${@:3}" <(git show $1) <(git show $2)
|
||||||
|
|
||||||
|
#git range-diff $1~..$1 $2~..$2 "${@:3}"
|
|
@ -1,16 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
p=$PWD
|
|
||||||
cd $HOME/daten/Dropbox/dokumente/notes
|
|
||||||
loc=$1
|
|
||||||
case $1 in
|
|
||||||
log|jrnl) shift; file=journal/${1:-jrnl}.txt;; #date +%F >>$file;;
|
|
||||||
idea) shift; file=ideas/${1:-README}.md;;
|
|
||||||
box) shift; file=box/$1.md;;
|
|
||||||
write) shift; file=writings/$1.md;;
|
|
||||||
msg) shift; file=archive/messages/$1.md;;
|
|
||||||
*) file=${1:-README}.md;;
|
|
||||||
esac
|
|
||||||
comment=$(test -f $file && echo Update || echo Create)
|
|
||||||
test "$2" && echo "$2" >>$file || $EDITOR + $file
|
|
||||||
git add $file && git commit -m "$(test "$(dirname $file)" != "." && echo "${loc%%/*}: ")$comment $(basename $file)" && git push
|
|
||||||
cd $p
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Use grep and sed to replace $1 with $2 recursively and print what is done
|
||||||
|
grep --null --recursive --files-with-matches "$1" |
|
||||||
|
xargs -0 sed -i "/${1}/{
|
||||||
|
s//${2}/g
|
||||||
|
w /dev/stdout
|
||||||
|
}"
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
note write "$@"
|
|
Loading…
Reference in New Issue