1
0
Fork 0
mirror of https://github.com/ryanccn/flake.git synced 2025-12-06 08:10:43 +01:00

feat: adopt XDG base directories

This commit is contained in:
Ryan Cao 2024-02-16 00:01:34 +08:00
parent b1984a512c
commit c6c59dd552
Signed by: ryanccn
SSH key fingerprint: SHA256:NtP/BlVhoQq4xU6BEcZeT8nIPvHntkJ3lIc2yB+F09E
7 changed files with 40 additions and 24 deletions

View file

@ -7,17 +7,17 @@ eval "$(/opt/homebrew/bin/brew shellenv)"
# fnm shell env
eval "$(fnm env --use-on-cd)"
# cargo
export PATH="$CARGO_HOME/bin:$PATH"
# go
export PATH="$GOPATH/bin:$PATH"
# deno
export PATH="$HOME/.deno/bin:$PATH"
# pnpm
export PNPM_HOME="${HOME}/Library/pnpm"
# direnv
export DIRENV_LOG_FORMAT=""
# docker
export PATH="$HOME/.docker/bin:$PATH"
export PATH="$PNPM_HOME:$PATH"
# local bin
export PATH="$HOME/.local/bin:$PATH"

View file

@ -6,10 +6,12 @@ setopt auto_menu
setopt complete_in_word
setopt always_to_end
export HISTFILE="$XDG_STATE_HOME"/zsh/history
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
# configure completion styles
zstyle ':completion:*' menu select
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' group-name \'\'
function take() {
@ -17,17 +19,6 @@ function take() {
cd "$1" || return 1
}
function clean_vscode_workspace_storage() {
for i in "$HOME/Library/Application Support/Code/User/workspaceStorage/"*; do
if [ -f $i/workspace.json ]; then
older="$(python3 -c "import sys, json; print(json.load(open(sys.argv[1], 'r'))['folder'])" $i/workspace.json 2>/dev/null | sed 's#^file://##;s/+/ /g;s/%\(..\)/\\x\1/g;')";
if [ -n "$folder" ] && [ ! -d "$folder" ]; then
echo "Removing workspace $(basename $i) for deleted folder $folder of size $(du -sh $i|cut -f1)"; rm -rfv "$i";
fi
fi
done
}
# nix-your-shell
eval "$(nix-your-shell zsh)"