Compare commits

..

2 commits

3 changed files with 43 additions and 31 deletions

View file

@ -10,13 +10,23 @@ fi
# Make utilities available # Make utilities available
PATH="$DOTFILES_DIR/bin:$PATH" PATH="$DOTFILES_DIR/bin:$PATH"
. $DOTFILES_DIR/lib/function.zsh
for DOTFILE in "$DOTFILES_DIR"/lib/{path,env,prompt,alias,conda,plugins,custom}.zsh; do src=(
[ -f "$DOTFILE" ] && . "$DOTFILE" 'base'
'function'
'path'
'env'
'prompt'
'alias'
'conda'
'plugins'
)
for dotfile in $src; do
. $DOTFILES_DIR/lib/$dotfile.zsh
done done
unset DOTFILE unset dotfile
DOTFILES_EXTRA_DIR="$HOME/.extra" DOTFILES_EXTRA_DIR="$HOME/.extra"

27
lib/base.zsh Normal file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env zsh
autoload -Uz compinit
compinit
# XDG
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.local/cache}"
export HISTFILE=~/.zsh_history
export HISTSIZE=32768
export HISTFILESIZE="${HISTSIZE}"
export SAVEHIST=4096
export HISTCONTROL=ignoredups:erasedups
export LESS='-R'
export LS_COLORS="ow=1;34:tw=1;34:st=00;"
# add completions to fpath
fpath=($DOTFILES_DIR/lib/completions $fpath)
# Append to the history file, rather than overwriting it
setopt APPEND_HISTORY
# Disable autocd
unsetopt autocd

View file

@ -1,29 +1,5 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
# XDG
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.local/cache}"
export HISTFILE=~/.zsh_history
export HISTSIZE=32768
export HISTFILESIZE="${HISTSIZE}"
export SAVEHIST=4096
export HISTCONTROL=ignoredups:erasedups
export LESS='-R'
export LS_COLORS="ow=1;34:tw=1;34:st=00;"
# add completions to fpath
fpath=($DOTFILES_DIR/lib/completions $fpath)
autoload -Uz compinit && compinit
# Append to the history file, rather than overwriting it
setopt APPEND_HISTORY
# Disable autocd
unsetopt autocd
is-executable nvim && export EDITOR=nvim || export EDITOR=vim is-executable nvim && export EDITOR=nvim || export EDITOR=vim
is-executable lf && source "$XDG_CONFIG_HOME/lf/lfcd.sh" is-executable lf && source "$XDG_CONFIG_HOME/lf/lfcd.sh"
@ -71,8 +47,8 @@ is-executable pnpm && \
export PNPM_HOME="$HOME/.local/share/pnpm"; \ export PNPM_HOME="$HOME/.local/share/pnpm"; \
add-to-path prepend "$PNPM_HOME" add-to-path prepend "$PNPM_HOME"
[ -d "$HOME/.pkgs/google-cloud-sdk" ] && \ [[ -d "$HOME/.pkgs/google-cloud-sdk" ]] && \
source "$HOME/.pkgs/google-cloud-sdk/completion.zsh.inc"; \ . "$HOME/.pkgs/google-cloud-sdk/completion.zsh.inc"; \
add-to-path prepend "$HOME/.pkgs/google-cloud-sdk/bin" add-to-path prepend "$HOME/.pkgs/google-cloud-sdk/bin"
[ -d "$HOME/.deno" ] && \ [ -d "$HOME/.deno" ] && \
@ -82,7 +58,6 @@ is-executable pnpm && \
if [ -d "$HOME/.bun" ]; then if [ -d "$HOME/.bun" ]; then
# bun completions # bun completions
[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun" [ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun"
# bun # bun
export BUN_INSTALL="$HOME/.bun" export BUN_INSTALL="$HOME/.bun"
add-to-path prepend "$BUN_INSTALL/bin" add-to-path prepend "$BUN_INSTALL/bin"