config/shell: script adjustments

This commit is contained in:
xeruf 2021-07-10 21:47:54 +02:00
parent 738458c5f2
commit 978a1fbd85
4 changed files with 6 additions and 6 deletions

View File

@ -19,7 +19,7 @@ Plug 'bkad/CamelCaseMotion' " move through camel case words
" commands " commands
Plug 'inkarkat/vim-ReplaceWithRegister' " gr to replace with register Plug 'inkarkat/vim-ReplaceWithRegister' " gr to replace with register
Plug 'tpope/vim-commentary' " gc to comment out (gcap for paragraph) Plug 'tpope/vim-commentary' " gc to comment out (gcap for paragraph)
Plug 'junegunn/vim-easy-align' " ga to align stuff Plug 'junegunn/vim-easy-align' " gaip*= - align in paragraph all equal signs
xmap ga <Plug>(EasyAlign) xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign) nmap ga <Plug>(EasyAlign)
" libs " libs

View File

@ -10,6 +10,7 @@ alias -g L="--color=always | ${PAGER:-less}"
fi fi
alias h='help' alias h='help'
compdef help=which
alias info='info --vi-keys' alias info='info --vi-keys'
d() { cd $(zf "$@") } d() { cd $(zf "$@") }
@ -30,7 +31,6 @@ ulimit -c unlimited # Enable core dumps
which lsb_release >/dev/null && export DIST=$(lsb_release --id | cut -d' ' -f2) || true which lsb_release >/dev/null && export DIST=$(lsb_release --id | cut -d' ' -f2) || true
compdef help=info
unalias rd 2>/dev/null unalias rd 2>/dev/null
rd() { rd() {
for f in "$@" for f in "$@"
@ -58,14 +58,14 @@ wh() {
compdef wh=which compdef wh=which
alias calc='rlwrap -a bc -l' alias calc='rlwrap -a bc -l'
alias logoff="loginctl terminate-user $USER"
blues() { bluedevil-sendfile $(echo "$@" | xargs -n 1 realpath | xargs -n 1 echo -n " --files") }
alias j='jrnl' alias j='jrnl'
jn() { jrnl -to today "$@" | bat --style=plain --pager="less +G" } jn() { jrnl -to today "$@" | bat --style=plain --pager="less +G" }
compdef jn=jrnl compdef jn=jrnl
alias jnc='jn -contains' alias jnc='jn -contains'
alias logoff="loginctl terminate-user $USER"
# Some aliases # Some aliases
alias edgrub='sudoedit /etc/default/grub && sudo update-grub' alias edgrub='sudoedit /etc/default/grub && sudo update-grub'
alias edenv='sudoedit /etc/environment' alias edenv='sudoedit /etc/environment'

View File

@ -22,5 +22,5 @@ if test "$#" -gt 0
fi fi
else else
find "$DATA/2-standards/notes/journal" -name "intentions*sync-conflict*" -exec sh -c 'basename {} | cut -d. -f1 | xargs -i% jrnl % --import --file {}' \; -delete find "$DATA/2-standards/notes/journal" -name "intentions*sync-conflict*" -exec sh -c 'basename {} | cut -d. -f1 | xargs -i% jrnl % --import --file {}' \; -delete
find -name '*sync-conflict*' -exec st-diff $quick '{}' \; find -name '.stfolder' -prune -o -name '*sync-conflict*' -exec st-diff $quick '{}' \;
fi fi

View File

@ -7,7 +7,7 @@ set -o noglob
query=$(zoxide query -sl "$@") query=$(zoxide query -sl "$@")
# First find out whether there is an obvious match (score at least ten times that of runner-up) # First find out whether there is an obvious match (score at least ten times that of runner-up)
# If not select with fzf, using locate to find extra options # If not select with fzf, using locate to find extra options
( expr $(echo "$query" | sed 'N;s|/.*\n|> 10 *|;q' | sed 's| */.*||') >/dev/null && ( expr $(echo "$query" | sed 'N;s|/.*\n|> 10 *|;q' | sed 's| */.*||') >/dev/null 2>&1 &&
echo "$query" | head -1 || echo "$query" | head -1 ||
( echo "$query"; locate --basename --existing "$@" | while read -r file; do test -d "$file" && echo "$file"; done | sed 's/^/ 0 /' ) | ( echo "$query"; locate --basename --existing "$@" | while read -r file; do test -d "$file" && echo "$file"; done | sed 's/^/ 0 /' ) |
fzf -0 -1 -n2.. --tiebreak=index --preview="ls -a --color --human-readable --group-directories-first --file-type {2..}" --preview-window=20% ) | tr -s ' ' | cut -d' ' -f3- fzf -0 -1 -n2.. --tiebreak=index --preview="ls -a --color --human-readable --group-directories-first --file-type {2..}" --preview-window=20% ) | tr -s ' ' | cut -d' ' -f3-