Fix usage in user folder instead of global
This commit is contained in:
parent
b3e40ed202
commit
24bede8c5c
|
@ -53,8 +53,8 @@ E() {
|
||||||
|
|
||||||
# edit and refresh aliases
|
# edit and refresh aliases
|
||||||
aliases() {
|
aliases() {
|
||||||
sudoedit /etc/zsh/aliases/${1:-functions}
|
$EDITOR $(zdotfile aliases/${1:-functions})
|
||||||
. /etc/zsh/aliases/*
|
. $(zdotfile aliases)/*
|
||||||
}
|
}
|
||||||
|
|
||||||
# per directory configuration
|
# per directory configuration
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#compdef aliases
|
#compdef aliases
|
||||||
|
|
||||||
_files -W /etc/zsh/aliases/
|
_files -W $ZDOTDIR/aliases/
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
# autoload completions
|
# autoload completions
|
||||||
fpath=( "${ZDOTDIR:+ZDOTDIR}/compdef" "/etc/zsh/compdef" $fpath )
|
fpath=( "${ZDOTDIR:+$ZDOTDIR/compdef}" "/etc/zsh/compdef" $fpath )
|
||||||
autoload -U /etc/zsh/compdef/*(:t)
|
|
||||||
|
|
||||||
if [[ -d $ZDOTDIR/compdef ]]; then
|
[[ -n $(echo /etc/zsh/compdef/*(N:t)) ]] && autoload -U /etc/zsh/compdef/*(N:t)
|
||||||
autoload -U /etc/zsh/compdef/*(N:t)
|
[[ -n $(echo $ZDOTDIR/compdef/*(N:t)) ]] && autoload -U $ZDOTDIR/compdef/*(N:t)
|
||||||
fi
|
|
||||||
|
|
||||||
autoload -Uz compinit && compinit
|
autoload -Uz compinit && compinit -u
|
||||||
|
|
||||||
zstyle ':completion:*' verbose yes
|
zstyle ':completion:*' verbose yes
|
||||||
zstyle ':completion:*:descriptions' format ‘%B%d%b’
|
zstyle ':completion:*:descriptions' format ‘%B%d%b’
|
||||||
|
|
27
zshenv
Normal file → Executable file
27
zshenv
Normal file → Executable file
|
@ -1,2 +1,25 @@
|
||||||
# prevent ZDOTDIR leaking when su'ing to another user
|
export ZDOTDIR=$HOME/.config/zsh
|
||||||
unset ZDOTDIR
|
|
||||||
|
ZMODLOAD_BLACKLIST=( ssh-agent )
|
||||||
|
export ZMODLOAD_BLACKLIST
|
||||||
|
if [ -n "$TMUX" ]; then export SHELL=/usr/bin/tmux; fi
|
||||||
|
|
||||||
|
export MAILDIR=$HOME/.maildir export NOTMUCH_CONFIG=$HOME/.config/notmuch-config
|
||||||
|
export GNUPGHOME="$XDG_CONFIG_HOME"/gnupg
|
||||||
|
export FZF_DEFAULT_COMMAND="fd"
|
||||||
|
export NPM_PACKAGES="${XDG_DATA_HOME}/npm-packages"
|
||||||
|
export NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
|
||||||
|
|
||||||
|
PATH="$PATH:$HOME/.gem/ruby/2.5.0/bin"
|
||||||
|
PATH="$PATH:$NPM_PACKAGES/bin"
|
||||||
|
PATH="$PATH:$HOME/.local/bin"
|
||||||
|
PATH="$PATH:$XDG_DATA_HOME/android/sdk/tools"
|
||||||
|
export PATH
|
||||||
|
|
||||||
|
if command -v rustup &>/dev/null; then
|
||||||
|
export RUST_SRC_PATH=$(rustup run stable rustc --print sysroot)/lib/rustlib/src/rust/src
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -e $ZDOTDIR/dirs ]]; then
|
||||||
|
source $ZDOTDIR/dirs
|
||||||
|
fi
|
||||||
|
|
4
zshrc
4
zshrc
|
@ -14,6 +14,8 @@ setopt chase_links
|
||||||
setopt short_loops
|
setopt short_loops
|
||||||
setopt cdable_vars
|
setopt cdable_vars
|
||||||
|
|
||||||
|
export ZDOTDIR=${ZDOTDIR:-$HOME/.zsh}
|
||||||
|
|
||||||
# get a file from ZDOTDIR, return file in /etc/zsh if it does not exist
|
# get a file from ZDOTDIR, return file in /etc/zsh if it does not exist
|
||||||
zdotfile() {
|
zdotfile() {
|
||||||
if [[ -e $ZDOTDIR/$1 ]]; then
|
if [[ -e $ZDOTDIR/$1 ]]; then
|
||||||
|
@ -33,7 +35,7 @@ stty -ixon
|
||||||
|
|
||||||
. $(zdotfile modules/loader.zsh) && mod_init
|
. $(zdotfile modules/loader.zsh) && mod_init
|
||||||
|
|
||||||
for i in ${ZDOTDIR:+ZDOTDIR/aliases/*~*.zwc(N)} /etc/zsh/aliases/*~*.zwc(N); do
|
for i in ${ZDOTDIR:+$ZDOTDIR/aliases/*~*.zwc(N)} /etc/zsh/aliases/*~*.zwc(N); do
|
||||||
. $i
|
. $i
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue