config: some more directory cleanups

This commit is contained in:
xeruf 2021-11-07 05:39:08 +01:00
parent 321833d9ab
commit 46759e9254
3 changed files with 6 additions and 4 deletions

View File

@ -290,7 +290,7 @@ smv() {
test -w "$1" && test -w "$(dirname $2)" && mv "$@" || sudo mv "$@" test -w "$1" && test -w "$(dirname $2)" && mv "$@" || sudo mv "$@"
} }
# Rename the file, keep it in its directory # Rename the file inside its directory
mvf() { mvf() {
smv "$1" "$(dirname $1)/$2" smv "$1" "$(dirname $1)/$2"
} }
@ -300,7 +300,7 @@ mvln() {
file=$(test -f "$1" && echo 1 || echo 0) file=$(test -f "$1" && echo 1 || echo 0)
if test -d $1; then if test -d $1; then
mkdir -p "$2" mkdir -p "$2"
mv -T $1 $2 mv -vT $1 $2
else else
mv -v $1 $2 mv -v $1 $2
fi fi
@ -311,6 +311,7 @@ mvln() {
# Move into XDG_DATA_HOME or so # Move into XDG_DATA_HOME or so
mvx() { mvx() {
mvln "$1" "${2:-$XDG_DATA_HOME}/${1#.}" mvln "$1" "${2:-$XDG_DATA_HOME}/${1#.}"
yadm add "$1" ".config/$1"
} }

View File

@ -4,7 +4,7 @@
typeset -A _clean_map typeset -A _clean_map
_clean_map=([h]=$XDG_CACHE_HOME [t]=/var/tmp [l]=/var/log [c]=/var/cache) _clean_map=([h]=$XDG_CACHE_HOME [t]=/var/tmp [l]=/var/log [c]=/var/cache)
# Directories to always clean # Directories to always clean
_clean_folders=(~/.ant ~/.autopsy ~/.cargo ~/.electron-gyp ~/.gradle ~/.konan ~/.nix-defexpr ~/.node-gyp ~/.npm ~/.nv ~/.parallel ~/.stack ~/.yarn _clean_folders=(~/.ant ~/.autopsy ~/.bundle ~/.cache ~/.cargo ~/.docker ~/.electron ~/.electron-gyp ~/.gradle ~/.gradle-kotlin-dsl ~/.hex ~/.java ~/.kscript ~/.konan ~/.m2 ~/.nix-defexpr ~/.node-gyp ~/.npm ~/.nv ~/.openjfx ~/.parallel ~/.stack ~/.surf ~/.texlive ~/.yarn luametatex-cache
~/.lesshst ~/.yarnrc) ~/.lesshst ~/.yarnrc)

View File

@ -33,6 +33,7 @@ export BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME"/bundle
export BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle export BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle
export BUNDLE_USER_PLUGIN="$XDG_STATE_HOME"/bundle export BUNDLE_USER_PLUGIN="$XDG_STATE_HOME"/bundle
export LESSHISTFILE="$XDG_STATE_HOME"/lesshst
export KSCRIPT_CACHE_DIR="$XDG_CACHE_HOME"/kscript export KSCRIPT_CACHE_DIR="$XDG_CACHE_HOME"/kscript
# Java & Android # Java & Android
@ -56,7 +57,7 @@ export CONFIG_SHELLS="$XDG_CONFIG_HOME/shell"
# environment # environment
which nvim >/dev/null && export EDITOR='nvim' || export EDITOR='vim' which nvim >/dev/null && export EDITOR='nvim' || export EDITOR='vim'
export LESS="--RAW-CONTROL-CHARS --ignore-case --LONG-PROMPT --jump-target=5 $(test $(less --version | head -1 | cut -f2 -d' ') -ge 590 && echo --incsearch)" export LESS="--RAW-CONTROL-CHARS --ignore-case --LONG-PROMPT --jump-target=5 $(test $(less --version | head -1 | cut -f2 -d' ') -ge 590 && echo --incsearch)"
export IGNOREDIRS_PURE="-x .sync -x .stfolder -x .gradle -x dist_newstyle -x node_modules -x generated -x .cache -x *Cache -x .local/cache -x .cpan" export IGNOREDIRS_PURE="-x .sync -x .stfolder -x .gradle -x dist_newstyle -x node_modules -x generated -x .cache -x *Cache -x .local/cache -x .local/state -x share/JetBrains -x share/Zeal -x share/syncthing -x .cpan"
export IGNOREDIRS="-x dev -x *build -x .git -x .idea -x out -x cache -x Partitions $IGNOREDIRS_PURE" export IGNOREDIRS="-x dev -x *build -x .git -x .idea -x out -x cache -x Partitions $IGNOREDIRS_PURE"
# red stderr # red stderr
test -f "/usr/lib/libstderred.so" && export LD_PRELOAD="/usr/lib/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}" test -f "/usr/lib/libstderred.so" && export LD_PRELOAD="/usr/lib/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}"