feat(zsh): use XDG spec

This commit is contained in:
Price Hiller 2022-08-02 16:44:29 -05:00
parent 1dc492dbab
commit 22f690b4bf
2 changed files with 10 additions and 4 deletions

View File

@ -1,18 +1,23 @@
#!/usr/bin/env zsh
configure() {
autoload -U +X bashcompinit && bashcompinit
export XDG_CONFIG_HOME="${HOME}/.config"
export XDG_CACHE_HOME="${HOME}/.cache"
export XDG_DATA_HOME="${HOME}/.local/share"
export XDG_STATE_HOME="${HOME}/.local/state"
export XDG_DATA_DIRS="/usr/local/share:/usr/share"
export XDG_CONFIG_DIRS="/etc/xdg"
}
init() {
configure
local wkdir="${BASE_ZSH_CONFIG_DIR}/config"
source "${wkdir}/themes/init.zsh"
source "${wkdir}/profile/init.zsh"
source "${wkdir}/style/init.zsh"
source "${wkdir}/omz/init.zsh"
source "${wkdir}/plugins/init.zsh"
source "${wkdir}/profile/init.zsh"
source "${wkdir}/completions/init.zsh"
configure
}
init

View File

@ -11,8 +11,9 @@ export ZSH_AUTOSUGGEST_STRATEGY=(history completion)
### FZF ###
function zvm_after_init() {
[[ -r "${XDG_DATA_CONFIG}/fzf/fzf.zsh" ]] && source "${XDG_DATA_CONFIG}fzf/fzf.zsh"
[[ -r "${XDG_CONFIG_HOME}/fzf/fzf.zsh" ]] && source "${XDG_CONFIG_HOME}fzf/fzf.zsh"
}
[[ -r "${XDG_CONFIG_HOME}/fzf/fzf.zsh" ]] && source "${XDG_CONFIG_HOME}fzf/fzf.zsh"
export FZF_DEFAULT_COMMAND='fd --hidden --exclude .git --color=always'
export FZF_DEFAULT_OPTS="--height=80% --layout=reverse --info=inline --border --margin=1 --ansi"
export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"