Current working changes to configuration
This commit is contained in:
commit
0a24ffcef1
66 changed files with 5312 additions and 0 deletions
225
home/shell/.zshrc
Normal file
225
home/shell/.zshrc
Normal file
|
|
@ -0,0 +1,225 @@
|
|||
#==============================================================================
|
||||
# Zsh Configuration
|
||||
#==============================================================================
|
||||
# History settings
|
||||
HISTFILE=~/.histfile
|
||||
HISTSIZE=100000
|
||||
SAVEHIST=100000
|
||||
setopt extendedglob notify
|
||||
unsetopt autocd beep
|
||||
setopt INC_APPEND_HISTORY # Write to history file immediately, not when shell exits
|
||||
setopt APPEND_HISTORY # Append instead of overwriting the file
|
||||
setopt HIST_IGNORE_DUPS # Don't save duplicate commands
|
||||
setopt HIST_IGNORE_SPACE # Don't save commands starting with space
|
||||
|
||||
#==============================================================================
|
||||
# Environment Variables
|
||||
#==============================================================================
|
||||
|
||||
export OMPI_MCA_rmaps_base_oversubscribe=1
|
||||
export CLICOLOR=1
|
||||
export LSCOLORS=ExGxBxDxCxEgEdxbxgxcxd
|
||||
export LS_COLORS='di=1;37:ln=35:so=32:pi=33:ex=1;32:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43'
|
||||
export XKB_DEFAULT_OPTIONS="caps:escape"
|
||||
export PASSWORD_STORE_CHARACTER_SET='a-zA-Z0-9+\-$!*_='
|
||||
export XDEB_PKGROOT=${HOME}/.config/xdeb
|
||||
export EDITOR=nvim
|
||||
export TERMINAL=ghostty
|
||||
export GOOGLE_CLOUD_PROJECT=slurm-slinky-k8s
|
||||
export SU2_RUN="~/.local/bin/"
|
||||
export SU2_HOME="~/builds/SU2/"
|
||||
export PYTHONPATH=$SU2_RUN:$PYTHONPATH
|
||||
|
||||
if [[ -f /etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh ]]; then
|
||||
source /etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh
|
||||
fi
|
||||
|
||||
# Custom path additions
|
||||
if [ -f "$HOME/.profile" ]; then
|
||||
source ~/.profile
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.local/share/os/habits.sh" ]; then
|
||||
source "$HOME/.local/share/os/habits.sh"
|
||||
fi
|
||||
|
||||
#==============================================================================
|
||||
# Aliases
|
||||
#==============================================================================
|
||||
|
||||
alias clip2png="xclip -selection clipboard -target image/png -out"
|
||||
if which kubectl > /dev/null; then
|
||||
alias k="kubectl"
|
||||
source <(k completion zsh)
|
||||
fi
|
||||
cc() {
|
||||
CLAUDE_SESSION="${1:-unnamed}" claude "${@:2}"
|
||||
}
|
||||
|
||||
ssh_no_tmux() {
|
||||
NO_TMUX=1 nohup ghostty --command="ssh $*" >/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
alias jjn="jj new -B @ --no-edit"
|
||||
alias jjs="jj squash --interactive --from @ --into @-"
|
||||
alias jjp="jj bookmark move master --to @-; jj git push"
|
||||
alias pkg_search="nix search nixpkgs --extra-experimental-features 'nix-command flakes'"
|
||||
|
||||
sandbox() {
|
||||
local host_repos="$HOME/repos"
|
||||
local sandbox_cwd="/workspace"
|
||||
|
||||
if [[ "$PWD" == "$host_repos" ]]; then
|
||||
sandbox_cwd="/workspace"
|
||||
elif [[ "$PWD" == "$host_repos"/* ]]; then
|
||||
sandbox_cwd="/workspace/${PWD#$host_repos/}"
|
||||
fi
|
||||
|
||||
if ! docker ps -a --format '{{.Names}}' | grep -q '^dev-sandbox$'; then
|
||||
docker run -dit --name dev-sandbox \
|
||||
--env-file "$host_repos/dev_sandbox/.env" \
|
||||
-v "$host_repos:/workspace" \
|
||||
-v pi-state:/root/.pi \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
dev-sandbox:latest
|
||||
else
|
||||
docker start dev-sandbox 2>/dev/null
|
||||
fi
|
||||
|
||||
if (( $# > 0 )); then
|
||||
docker exec -it -w "$sandbox_cwd" dev-sandbox /bin/zsh -l -c 'exec "$@"' sandbox "$@"
|
||||
else
|
||||
docker exec -it -w "$sandbox_cwd" dev-sandbox /bin/zsh -l
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#==============================================================================
|
||||
# Functions
|
||||
#==============================================================================
|
||||
|
||||
load_env() {
|
||||
set -a
|
||||
. "./$1"
|
||||
set +a
|
||||
}
|
||||
|
||||
#==============================================================================
|
||||
# os functions
|
||||
#==============================================================================
|
||||
alias t="nvim ~/.local/share/os/tasks.md"
|
||||
alias h="habits open"
|
||||
alias books="nvim ~/.local/share/os/books.md"
|
||||
alias mindset="nvim ~/.local/share/os/mindset.md"
|
||||
|
||||
#==============================================================================
|
||||
# Completions
|
||||
#==============================================================================
|
||||
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
zstyle ':compinstall' filename '/home/aselimov/.zshrc'
|
||||
zstyle -e ':completion:*:hosts' hosts 'reply=(
|
||||
${=${${(f)"$(cat {/etc/ssh_,~/ar.ssh/known_}hosts(|2)(N) 2>/dev/null)"}%%[#| ]*}//,/ }
|
||||
${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}}
|
||||
)'
|
||||
|
||||
#==============================================================================
|
||||
# Plugins & Tools
|
||||
#==============================================================================
|
||||
|
||||
# nvm
|
||||
# Lazy-load nvm - only initialize when first used
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
|
||||
# Function to load nvm (called only once)
|
||||
load_nvm() {
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
||||
}
|
||||
|
||||
# Create placeholder functions that load nvm once, then call the real command
|
||||
nvm() {
|
||||
unset -f nvm node npm
|
||||
load_nvm
|
||||
nvm "$@"
|
||||
}
|
||||
|
||||
node() {
|
||||
unset -f nvm node npm
|
||||
load_nvm
|
||||
node "$@"
|
||||
}
|
||||
|
||||
npm() {
|
||||
unset -f nvm node npm
|
||||
load_nvm
|
||||
npm "$@"
|
||||
}
|
||||
|
||||
# ghcup
|
||||
[ -f "/home/aselimov/.ghcup/env" ] && . "/home/aselimov/.ghcup/env" # ghcup-env
|
||||
|
||||
# pyenv
|
||||
if command -v pyenv >/dev/null 2>&1; then
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
eval "$(pyenv init - zsh)"
|
||||
fi
|
||||
|
||||
# jenv
|
||||
if command -v jenv >/dev/null 2>&1; then
|
||||
export PATH="$HOME/.jenv/bin:$PATH"
|
||||
eval "$(jenv init -)"
|
||||
fi
|
||||
|
||||
# Simple notify function
|
||||
notify() {
|
||||
local cmd="$*"
|
||||
eval "$cmd"
|
||||
local rc=$?
|
||||
osascript -e "display notification \"Done (exit=$rc)\" with title \"${cmd//\"/\\\"}\""
|
||||
return $rc
|
||||
}
|
||||
|
||||
|
||||
# zsh-autosuggestions
|
||||
source "$HOME/.config/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
||||
|
||||
# zsh-syntax-highlighting
|
||||
source "$HOME/.config/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||
|
||||
# zsh-history-substring-search
|
||||
source "$HOME/.config/zsh/zsh-history-substring-search/zsh-history-substring-search.zsh"
|
||||
|
||||
#==============================================================================
|
||||
# Keybindings
|
||||
#==============================================================================
|
||||
|
||||
bindkey -v
|
||||
bindkey '^[[A' history-substring-search-up
|
||||
bindkey '^[[B' history-substring-search-down
|
||||
|
||||
#==============================================================================
|
||||
# OS-Specific Configuration
|
||||
#==============================================================================
|
||||
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
alias ls="gls --classify --group-directories-first --color"
|
||||
export NVIM_JDTLS_JAVA_HOME="/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/"
|
||||
else
|
||||
alias ls="ls --classify --group-directories-first --color"
|
||||
fi
|
||||
|
||||
# starship
|
||||
eval "$(starship init zsh)"
|
||||
|
||||
if [[ -z "$TMUX" ]] && [[ -n "$PS1" ]] && [[ -z "$NO_TMUX" ]]; then
|
||||
tmux attach -t dev || tmux new -s dev
|
||||
fi
|
||||
|
||||
# Get remaining habits
|
||||
if [ -n "$HABITS" ]; then
|
||||
echo "Habits remaining are:"
|
||||
habits left
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue