mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
feat(zsh): Finished reorganise zsh with a same entry point for all platforms
This commit is contained in:
parent
bd5ca49c3e
commit
2b21b63a13
22 changed files with 503 additions and 369 deletions
41
tools/zsh/mod/config.zsh
Normal file
41
tools/zsh/mod/config.zsh
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# $DOTFILES/tools/zsh/mod/config.zsh
|
||||
# Sourced by user's zshrc 在用户的 zshrc 中被引用
|
||||
|
||||
# ZSH Config, no need to `export` these variables
|
||||
HISTFILE="$XDG_STATE_HOME"/zsh/history
|
||||
HIST_STAMPS="yyyy-mm-dd"
|
||||
HISTSIZE=10000
|
||||
SAVEHIST=10000
|
||||
|
||||
|
||||
# Manually manage plugins 手动管理插件
|
||||
# Load zsh-syntax-highlighting before zsh-history-substring-search
|
||||
# Reference: https://github.com/zsh-users/zsh-history-substring-search?tab=readme-ov-file#usage
|
||||
plugins=(
|
||||
"zsh-autosuggestions"
|
||||
"zsh-syntax-highlighting"
|
||||
"zsh-history-substring-search"
|
||||
)
|
||||
|
||||
plugin_dir="$ZDOTDIR/plugins"
|
||||
|
||||
for plugin in "${plugins[@]}"; do
|
||||
plugin_path="$plugin_dir/$plugin/$plugin.zsh"
|
||||
if [[ -f $plugin_path ]]; then
|
||||
source "$plugin_path"
|
||||
else
|
||||
echo "Warning: Plugin not found: $plugin_path"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# https://unix.stackexchange.com/questions/33994/
|
||||
# Use `set -k` to mark leading `#` as a comment character
|
||||
set -k
|
||||
|
||||
# TODO: Below should be reorganized
|
||||
export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
|
||||
export PATH=$HOME/.local/share/gem/ruby/3.3.0/bin:$PATH # Ruby Executables
|
||||
|
||||
export NVM_DIR="$HOME/.config/nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
Loading…
Add table
Add a link
Reference in a new issue