config/shell: update aliases

This commit is contained in:
xerus2000 2020-12-10 17:34:56 +01:00
parent 1dd3f3d4e7
commit 5638127ff7
3 changed files with 15 additions and 4 deletions

View File

@ -104,9 +104,10 @@
rh = reset HEAD~
rs = reset --keep
ru = reset --keep @{upstream}
rg = rmgonebranches
unstage = reset HEAD --
gcr = !git gc && git repack -a -d
ready = rebase -i @{push}
format-head = !git stash && git-clang-format HEAD~ && git commit -a --amend --no-edit && git stash pop

View File

@ -106,7 +106,12 @@ alias lst='( last; last -f /var/log/wtmp.1 ) | grep -v "pts/" | tac | less +G'
alias lar='last | tac'
tr() { tree -a -L 2 --du -h -C "$@" | ${PAGER:-less} }
alias xo='xdg-open'
xo() {
while test $# -gt 0; do
xdg-open "$1"
shift
done
}
alias sqli='rlwrap sqlite3 -column -header -cmd .tables'
alias loc='noglob locate --basename'
alias uloc='noglob sudo updatedb && locate --basename'

View File

@ -1,11 +1,16 @@
#!/bin/sh
# Show type & contents of given files or PWD
# gets the last arg or current dir
for last; do true; done
last=${last:-.}
file "$last" | grep -v --color=never directory
stat -c 'Permissions: %A, Created: %.10w, Modified %.10y, Size: %s' "$last"
file "$last" | grep -v --color=never 'directory$'
test -e "$last" || exit 1
case "$(file --dereference --mime "$last")" in
*inode/directory*) ls -l --color=always --human-readable --group-directories-first --file-type --dereference-command-line --almost-all "$@";;
*binary) ;;
*) $(test -f "$last" -a ! -r "$last") bat --style header "$@";;
esac
stat -c 'Permissions: %A, Created: %.10w, Modified %.10y, Size: %s' "$last"