1
0
Fork 0

zsh: add linecount function

This commit is contained in:
Luca Bilke 2025-01-12 19:02:23 +01:00
parent 6299054903
commit 8b1df582b3
Signed by: luca
GPG key ID: C9E851809C1A5BDE

View file

@ -13,6 +13,16 @@ function xsi() {
--preview-window=right:66%:wrap | xargs -ro xi
}
function linecount() {
filematch=$1
find . -type f -name "$1" -exec wc -l {} \; |
awk -v color="$(tput setab 4; tput setaf 0)" '{ count+=$1; print $2 ": " $1 } END { print color "TOTAL: " count }' |
column -t
tput sgr0
}
function geo() {
pos=$(curl -s "https://reallyfreegeoip.org/json/${1}")
lat=$(echo "$pos" | jq -r '.latitude')