diff --git a/.zshrc b/.zshrc index cb0e539..9208d97 100644 --- a/.zshrc +++ b/.zshrc @@ -79,6 +79,9 @@ if __name__ == \"__main__\": evaluate_and_print(expr) " } +function countlines() { + find . -type f -name "$1" -exec wc -l {} \; | awk '{print $0} {total += $1} END {print "Total lines:", total}' +} ### ---- zsh options ------------------------------------- setopt autocd @@ -197,6 +200,7 @@ fpath=($ZSH/plugins/zsh-completions/src $fpath) ZAQ_PREFIXES+=('git commit( [^ ]##)# -[^ -]#m') ZAQ_PREFIXES_GREEDY+=('py #') +ZAQ_PREFIXES_GREEDY+=('countlines #') ### --- fzf Config ------------------------------------ export FZF_CTRL_T_OPTS="--preview '(highlight -O ansi -l {} 2> /dev/null || cat {} || tree -C {}) 2> /dev/null | head -200'"