Refactor zsh configs

This commit is contained in:
david pickle 2025-01-26 17:07:58 -06:00
parent 36ba8bd5a9
commit 1355bd4ee9
6 changed files with 24 additions and 19 deletions

@ -2,11 +2,16 @@
### prerequisites
- zsh is installed (scripts are written for zsh)
- git is installed
- ensure ZDOTDIR is set, current idea is put the line below into /etc/zshenv
- `export ZDOTDIR="$HOME/.config/zsh"`
- export the env var `BOX_SETUP_OS` to indicate the operating system
- options defined in `set_env_vars` file
- if on macOS, install [homebrew](https://brew.sh/)
##### conditional prerequisites
- git is installed (if any builds/installs use git)
- ensure sudo access is configured for the current user
### script run
- git clone this repo
- from the repo's root directory, run `./setup_this_box`

@ -40,4 +40,5 @@ copy_file() {
copy_dir src_files/.config $HOME/.config
copy_dir src_files/.local $HOME/.local
copy_file src_files/.zshrc $HOME
# copy_file src_files/.example_file $HOME

@ -1,3 +1,4 @@
# TODO: refactor this file; separate general dev from rs specific
# set env vars, path updates, etc
[[ -a $HOME/.rs-vars ]] \
&& source $HOME/.rs-vars \

@ -0,0 +1,10 @@
# env vars
export EDITOR='vim' # TODO: update to nvim once configured
export HOME_BOX="$HOME/dbox"
export DIR_DEV="$HOME/dev"
export DIR_CONFIG="$HOME/.config"
export XDG_CONFIG_HOME=$DIR_CONFIG
export ZDOTDIR="$DIR_CONFIG/zsh"
export DIR_LOCAL="$HOME/.local"
export DIR_BUILD="$DIR_LOCAL/build"

@ -1,15 +1,6 @@
# use vim-like control in shell
set -o vi
# env vars
export EDITOR='vim' # TODO: update to nvim once configured
export HOME_BOX="$HOME/dbox"
export DIR_DEV="$HOME/dev"
export DIR_CONFIG="$HOME/.config"
export XDG_CONFIG_HOME=$DIR_CONFIG
export DIR_LOCAL="$HOME/.local"
export DIR_BUILD="$DIR_LOCAL/build"
# path updates
export PATH=$DIR_LOCAL/bin:$DIR_LOCAL/scripts:$PATH
export PATH=$PATH:/opt/homebrew/opt/ccache/libexec
@ -36,15 +27,12 @@ alias pdt='ping -c 4 drinkingtea.net'
alias weather='curl wttr.in'
alias shrug='echo "¯\\_(ツ)_/¯"'
[[ -e "$HOME/.profile" ]] && source "$HOME/.profile"
# source extensions and system-specific files
[[ -e "$HOME/.profile" ]] && source "$HOME/.profile" # TODO: do i want to source .profile?
[[ -a "$ZDOTDIR/.zsh-life-system" ]] && source "$ZDOTDIR/.zsh-life-system"
[[ -a "$ZDOTDIR/.zsh-job-rs" ]] && source "$ZDOTDIR/.zsh-job-rs"
# add machine-specific configs as appropriate
[[ -a "$DIR_CONFIG/zsh/.zshrc-life-system" ]] &&
source "$DIR_CONFIG/zsh/.zshrc-life-system"
# TODO: refactor the below so that general dev is separate from rs specific stuff
[[ -a $DIR_CONFIG/zsh/.zshrc-job-rs ]] &&
source $DIR_CONFIG/zsh/.zshrc-job-rs
# TODO: refactor the below; simplify or at least move elsewhere
alias lintjs='npx prettier --write'
export DEVKITARM=/opt/devkitpro/devkitARM
. /opt/homebrew/opt/asdf/libexec/asdf.sh # TODO: ensure not duplicated asdf logic