From 18d0354522e5dd3bc30034bac9390facdec1ec62 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Thu, 12 May 2022 11:32:00 +0200 Subject: [PATCH] config/shell: improve ignoredirs handling --- .config/shell/functions | 6 ++++-- .zshenv | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.config/shell/functions b/.config/shell/functions index 309809d..6b259df 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -261,15 +261,17 @@ alias mdo="pandoc -f gfm-ascii_identifiers-gfm_auto_identifiers -t org-auto_iden alias mdox="xclip -o -selection clipboard | mdo | xclip -filter" alias f="fossil" +alias fs="fossil status" +alias fc="fossil commit -v" alias gdiff='git diff --word-diff=color --word-diff-regex=. --no-index' -# Default grep with some niceties +# Default grep with some convenience flags alias grpc='grep --color=auto --line-number --binary-files=without-match --directories=skip' # Default grep with some niceties and ignoring case alias grp='grpc --ignore-case' # Grep recursively and paginate -grpr() { grp --color=always --recursive $(echo $DIRS_IGNORE | sed 's/-x/--exclude-dir/g') "$@" | less -FX; } +grpr() { grp --color=always --recursive $(echo $DIRS_IGNORE | sed 's|-x \([^ ]*/\)\?|--exclude-dir |g') "$@" | less -FX; } # Grep in shell config files grsh() { grpr --no-ignore-case "$@" $HOME/.{ba,z}sh* $HOME/.local/bin $CONFIG_SHELLS $CONFIG_ZSH; } diff --git a/.zshenv b/.zshenv index 2022d83..98725b4 100644 --- a/.zshenv +++ b/.zshenv @@ -68,7 +68,7 @@ export LESS="--RAW-CONTROL-CHARS --ignore-case --LONG-PROMPT --jump-target=5 $(t # TODO put into config file and use --exclude-from export DIRS_GENERATED="-x generated -x .gradle -x cmake_build -x dist-newstyle -x node_modules -x __pycache__" export DIRS_IGNORE_SAFE="-x .cache -x .cpan -x *Cache -x .pyenv -x .local/cache -x share/baloo -x share/cabal -x share/cargo -x share/digikam -x share/gem -x share/JetBrains -x share/tldr -x share/syncthing -x share/Steam/ubuntu* -x share/Steam/package -x share/virtualenv -x share/Zeal -x state/gradle -x state/android -x Ferdi/Partitions -x oh-my-zsh -x wine/drive_c/windows -x vendor/cache $DIRS_GENERATED" -export DIRS_IGNORE="-x .sync -x .stfolder -x *build -x .git -x .idea -x env -x out -x cache -x Partitions $DIRS_IGNORE_SAFE" +export DIRS_IGNORE="-x .sync -x .stfolder -x *build -x .git -x .idea -x env -x out -x cache -x Partitions -x vendor/bundle -x log $DIRS_IGNORE_SAFE" # red stderr test -f "/usr/lib/libstderred.so" && export LD_PRELOAD="/usr/lib/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}" # software config