bin: adjust paths & exit codes

This commit is contained in:
xerus2000 2021-04-11 22:47:51 +02:00
parent 4eab2b7363
commit 414a769c45
10 changed files with 29 additions and 11 deletions

View File

@ -38,6 +38,8 @@
branch = false branch = false
[grep] [grep]
lineNumber = true lineNumber = true
[log]
date=local
[color "status"] [color "status"]
added = green added = green
@ -90,9 +92,10 @@
lg = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --graph lg = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --graph
lo = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --no-merges lo = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --no-merges
lp = log -p --date=local
ln = !git --no-pager lo -5 ln = !git --no-pager lo -5
my = lo --author [Jj]anek my = lo --author [Jj]anek
standup = lo --since yesterday --author [Jj]anek --all standup = my --since yesterday --all
co-authors = !git log | grep -i Co-Authored | awk '!a[$0]++' co-authors = !git log | grep -i Co-Authored | awk '!a[$0]++'
when = git for-each-ref --sort=committerdate --format='%(refname:short) * %(authorname) * %(committerdate:relative)' refs/remotes/ # List all branches with their last updates when = git for-each-ref --sort=committerdate --format='%(refname:short) * %(authorname) * %(committerdate:relative)' refs/remotes/ # List all branches with their last updates

View File

@ -92,6 +92,8 @@ formatsong() {
echo "$1" | sed -e 's/\([ ([]\)\(ft\|Ft\|Feat\|featuring\)\([ .]\)/\1feat\3/; echo "$1" | sed -e 's/\([ ([]\)\(ft\|Ft\|Feat\|featuring\)\([ .]\)/\1feat\3/;
s/\([ ([]\)feat /\1feat. /; s/\([ ([]\)feat /\1feat. /;
s/ \((Original Mix)\|(Original)\|(Full Stream)\|.NCS Release.\)//i; s/ \((Original Mix)\|(Original)\|(Full Stream)\|.NCS Release.\)//i;
s/ (\(Acoustic\|Live\))/ [\1]/i;
s/ \[\(feat.*\)\]/ (\1)/i;
s/ \(\..\{2,4\}\)$/\1/; s/ \(\..\{2,4\}\)$/\1/;
s/---/ - /; s/---/ - /;
s/^[0-9]\{6\}_//; s/^[0-9]\{6\}_//;

View File

@ -368,7 +368,7 @@ filextype */
" Displaying pictures in terminal " Displaying pictures in terminal
" "
" fileviewer *.jpg,*.png shellpic %c fileviewer *.jpg,*.png shellpic %c
" Open all other files with default system programs (you can also remove all " Open all other files with default system programs (you can also remove all
" :file[x]type commands above to ensure they don't interfere with system-wide " :file[x]type commands above to ensure they don't interfere with system-wide
@ -376,7 +376,7 @@ filextype */
" uncommenting one of lines below will result in ignoring 'vi[x]cmd' option " uncommenting one of lines below will result in ignoring 'vi[x]cmd' option
" for unknown file types. " for unknown file types.
" For *nix: " For *nix:
" filetype * xdg-open filetype * xdg-open
" For OS X: " For OS X:
" filetype * open " filetype * open
" For Windows: " For Windows:

View File

@ -2,4 +2,5 @@
cgit = !yadm cme "config/git:" -- $XDG_CONFIG_HOME/git $CONFIG_SHELLS/git $HOME/.local/bin/scripts/git-* cgit = !yadm cme "config/git:" -- $XDG_CONFIG_HOME/git $CONFIG_SHELLS/git $HOME/.local/bin/scripts/git-*
cvim = !yadm cme "config/nvim:" -- $XDG_CONFIG_HOME/nvim/init* cvim = !yadm cme "config/nvim:" -- $XDG_CONFIG_HOME/nvim/init*
cshell = !yadm cme "config/shell:" -- $CONFIG_SHELLS cshell = !yadm cme "config/shell:" -- $CONFIG_SHELLS
cf = !yadm cme "bin:" -- $CONFIG_SHELLS/functions $HOME/.local/bin/scripts
cbin = !yadm cme "bin:" -- $HOME/.local/bin/scripts cbin = !yadm cme "bin:" -- $HOME/.local/bin/scripts

View File

@ -13,7 +13,7 @@ fi 2>/dev/null || return 0
# source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" # source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
#fi #fi
export PATH=$HOME/.local/bin/scripts:$HOME/.local/bin:$PATH:/opt/android/sdk/platform-tools:$XDG_CONFIG_HOME/emacs/bin export PATH=$HOME/.local/bin/scripts:$HOME/.local/bin:$PATH:/opt/android-sdk/platform-tools:$XDG_CONFIG_HOME/emacs/bin:$XDG_DATA_HOME/gem/ruby/2.7.0/bin
export CONFIG_ZSH="$XDG_CONFIG_HOME/zsh" export CONFIG_ZSH="$XDG_CONFIG_HOME/zsh"
export CONFIG_SHELLS="$XDG_CONFIG_HOME/shell" export CONFIG_SHELLS="$XDG_CONFIG_HOME/shell"

View File

@ -1,4 +1,6 @@
#!/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 "$@" | 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 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 --quit-if-one-screen

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# create a diff of diffs - https://stackoverflow.com/a/23527631 # create a diff of diffs - https://stackoverflow.com/a/23527631
dif "${@:3}" <(git show $1) <(git show $2) #dif "${@:3}" <(git show $1) <(git show $2)
#git range-diff $1~..$1 $2~..$2 "${@:3}" git range-diff $1~..$1 $2~..$2 "${@:3}"

View File

@ -1,7 +1,6 @@
#!/bin/sh #!/bin/sh
set -e
dif "$(st-unarchive "$1")" "$@" dif "$(st-unarchive "$1")" "$@"
test "$?" -eq "2" && exit 1
echo "y to restore" echo "y to restore"
read answer read answer
test "$answer" = "y" && st-restore "$1" || exit 0 test "$answer" = "y" && st-restore "$1" || exit 0

View File

@ -1,2 +1,13 @@
#!/bin/sh #!/bin/sh
echo "$1" | cut -d'/' -f3- | sed 's/[[:digit:]]\+\.//' echo "$1" |
sed 's|\.sync/Archive/\(.\+\)\.[[:digit:]]\+|\1|;
s|\.sync/Archive/||;
s|\.stversions/\(.*\)~[[:digit:]]\+-[[:digit:]]\+|\1|;
s|\.sync-conflict-[[:digit:]]\+-[[:digit:]]\+-[[:alnum:]]\+||'
# TESTING
# echo "1-projects/.sync/Archive/meetings.1.txt
# 1-projects/.sync/Archive/meetings.txt
# data/.stversions/meeting~2020-01
# meeting.sync-conflict-2021-1925-P5K
# meeting.sync-conflict-2021-1925-PRK.txt" |

View File

@ -39,7 +39,7 @@ test -f "/usr/lib/libstderred.so" && export LD_PRELOAD="/usr/lib/libstderred.so$
# enable pass extensions # enable pass extensions
export PASSWORD_STORE_ENABLE_EXTENSIONS="true" export PASSWORD_STORE_ENABLE_EXTENSIONS="true"
# fzf defaults # fzf defaults
export FZF_DEFAULT_OPTS='--select-1 --exit-0 --tiebreak=end,length --history=/var/tmp/fzf-history --ansi --bind="alt-enter:execute(test -O {} && $EDITOR {} || sudoedit {}),del:execute(gio trash {}),change:top,left-click:execute(xdg-open {})"' export FZF_DEFAULT_OPTS='--select-1 --exit-0 --tiebreak=end,length --history=/var/tmp/fzf-history --ansi --bind="alt-enter:execute(test -O {} && $EDITOR {} || sudoedit {}),alt-bspace:execute(gio trash {}),change:top,double-click:execute(xdg-open {})"'
FD_BASE="fd --hidden --color=always --no-ignore-vcs" FD_BASE="fd --hidden --color=always --no-ignore-vcs"
export FZF_DEFAULT_COMMAND="$FD_BASE --type file" export FZF_DEFAULT_COMMAND="$FD_BASE --type file"
export FZF_CTRL_T_COMMAND="$FD_BASE -d 7" export FZF_CTRL_T_COMMAND="$FD_BASE -d 7"