mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-20 16:55:45 +00:00
fix(shell): clean up rcfiles and remove redundancies
- Remove deprecated GREP_OPTIONS (handled via alias) - Quote $ZSH_COMPDUMP to prevent word splitting - Remove duplicate vim alias (nvim alias takes precedence) - Consolidate completion path to ZSH_CUSTOM_COMPLETION_PATH - Simplify PATH setup in rcfiles, centralize in exports - Move LM Studio PATH from rcfiles to exports - Add clarifying comments for macOS-specific ssh-add
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
|
# Minimal PATH for x-have and utilities; full PATH set in shared.sh/exports
|
||||||
export PATH="$HOME/.local/bin:$DOTFILES/local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$DOTFILES/local/bin:$PATH"
|
||||||
export SHARED_SCRIPTS_SOURCED=0
|
export SHARED_SCRIPTS_SOURCED=0
|
||||||
|
|
||||||
@@ -11,7 +12,7 @@ source "$DOTFILES/config/shared.sh"
|
|||||||
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] &&
|
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] &&
|
||||||
source "${DOTFILES}/config/fzf/fzf.bash"
|
source "${DOTFILES}/config/fzf/fzf.bash"
|
||||||
|
|
||||||
# Import ssh keys in keychain
|
# Import ssh keys in keychain (macOS-specific -A flag, silently fails on Linux)
|
||||||
ssh-add -A 2>/dev/null
|
ssh-add -A 2>/dev/null
|
||||||
|
|
||||||
x-have antidot && {
|
x-have antidot && {
|
||||||
@@ -22,5 +23,3 @@ PROMPT_DIRTRIM=3
|
|||||||
PROMPT_COMMAND='PS1_CMD1=$(git branch --show-current 2>/dev/null)'
|
PROMPT_COMMAND='PS1_CMD1=$(git branch --show-current 2>/dev/null)'
|
||||||
PS1='\[\e[95m\]\u\[\e[0m\]@\[\e[38;5;22;2m\]\h\[\e[0m\] \[\e[38;5;33m\]\w\[\e[0m\] \[\e[92;2m\]${PS1_CMD1}\n\[\e[39m\]➜\[\e[0m\] '
|
PS1='\[\e[95m\]\u\[\e[0m\]@\[\e[38;5;22;2m\]\h\[\e[0m\] \[\e[38;5;33m\]\w\[\e[0m\] \[\e[92;2m\]${PS1_CMD1}\n\[\e[39m\]➜\[\e[0m\] '
|
||||||
|
|
||||||
# Added by LM Studio CLI (lms)
|
|
||||||
export PATH="$PATH:$HOME/.lmstudio/bin"
|
|
||||||
|
|||||||
15
base/zshrc
15
base/zshrc
@@ -7,18 +7,13 @@
|
|||||||
autoload -U promptinit; promptinit
|
autoload -U promptinit; promptinit
|
||||||
|
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
LOCAL_SHARE="$HOME/.local/share"
|
# Minimal PATH for x-have and utilities; full PATH set in shared.sh/exports
|
||||||
export PATH="$HOME/.local/bin:$DOTFILES/local/bin:$LOCAL_SHARE/nvim/mason/bin:$LOCAL_SHARE/bob/nvim-bin:$LOCAL_SHARE/cargo/bin:/opt/homebrew/bin:/usr/local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$DOTFILES/local/bin:$PATH"
|
||||||
export SHARED_SCRIPTS_SOURCED=0
|
export SHARED_SCRIPTS_SOURCED=0
|
||||||
|
|
||||||
source "$DOTFILES/config/shared.sh"
|
source "$DOTFILES/config/shared.sh"
|
||||||
|
|
||||||
# zsh completions directory
|
# zsh completions directory (ZSH_CUSTOM_COMPLETION_PATH set in shared.sh)
|
||||||
[ -z "$ZSH_COMPLETIONS" ] && export ZSH_COMPLETIONS="$XDG_CONFIG_HOME/zsh/completion"
|
|
||||||
|
|
||||||
# Add zsh completions to FPATH, compinit will be called later
|
|
||||||
FPATH="$ZSH_COMPLETIONS:$FPATH"
|
|
||||||
|
|
||||||
ZSH_COMPDUMP="$XDG_CACHE_HOME/zsh/zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
|
ZSH_COMPDUMP="$XDG_CACHE_HOME/zsh/zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
|
||||||
|
|
||||||
source "$DOTFILES/config/zsh/antidote.zsh"
|
source "$DOTFILES/config/zsh/antidote.zsh"
|
||||||
@@ -37,12 +32,10 @@ source_fzf_config
|
|||||||
x-have antidot && eval "$(antidot init)"
|
x-have antidot && eval "$(antidot init)"
|
||||||
|
|
||||||
autoload -Uz compinit bashcompinit
|
autoload -Uz compinit bashcompinit
|
||||||
compinit -d $ZSH_COMPDUMP
|
compinit -d "$ZSH_COMPDUMP"
|
||||||
bashcompinit
|
bashcompinit
|
||||||
|
|
||||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||||
export P10K_CONFIG="$DOTFILES/config/zsh/p10k.zsh"
|
export P10K_CONFIG="$DOTFILES/config/zsh/p10k.zsh"
|
||||||
[[ ! -f "$P10K_CONFIG" ]] || source "$P10K_CONFIG"
|
[[ ! -f "$P10K_CONFIG" ]] || source "$P10K_CONFIG"
|
||||||
|
|
||||||
# Added by LM Studio CLI (lms)
|
|
||||||
export PATH="$PATH:$HOME/.lmstudio/bin"
|
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ x-have eza && {
|
|||||||
alias ls="eza -h -s=type --git --icons --group-directories-first"
|
alias ls="eza -h -s=type --git --icons --group-directories-first"
|
||||||
}
|
}
|
||||||
|
|
||||||
alias vim='vim -u "$XDG_CONFIG_HOME/vim/vimrc"'
|
|
||||||
|
|
||||||
# Easier navigation: .., ..., ....
|
# Easier navigation: .., ..., ....
|
||||||
alias ..="cd .."
|
alias ..="cd .."
|
||||||
alias ...="cd ../.."
|
alias ...="cd ../.."
|
||||||
|
|||||||
@@ -282,7 +282,8 @@ export LESSHISTFILE="$XDG_STATE_HOME"/less/history
|
|||||||
export MANPAGER="less -X"
|
export MANPAGER="less -X"
|
||||||
|
|
||||||
# Always enable colored `grep` output
|
# Always enable colored `grep` output
|
||||||
export GREP_OPTIONS="--color=auto"
|
# Note: GREP_OPTIONS is deprecated since GNU grep 2.21
|
||||||
|
# Color is handled via alias in config/alias
|
||||||
|
|
||||||
# check the window size after each command and, if necessary,
|
# check the window size after each command and, if necessary,
|
||||||
# update the values of LINES and COLUMNS.
|
# update the values of LINES and COLUMNS.
|
||||||
@@ -436,6 +437,10 @@ msg "Setting up Wakatime configuration"
|
|||||||
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
|
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
|
||||||
x-dc "$WAKATIME_HOME"
|
x-dc "$WAKATIME_HOME"
|
||||||
|
|
||||||
|
# LM Studio CLI
|
||||||
|
msg "Setting up LM Studio configuration"
|
||||||
|
export PATH="$PATH:$HOME/.lmstudio/bin"
|
||||||
|
|
||||||
# Misc
|
# Misc
|
||||||
msg "Setting up miscellaneous configuration"
|
msg "Setting up miscellaneous configuration"
|
||||||
export ZSHZ_DATA="$XDG_STATE_HOME/z"
|
export ZSHZ_DATA="$XDG_STATE_HOME/z"
|
||||||
|
|||||||
Reference in New Issue
Block a user