Skip to content

Commit 0b4971c

Browse files
committed
up zshrc
1 parent df9e185 commit 0b4971c

File tree

1 file changed

+13
-24
lines changed

1 file changed

+13
-24
lines changed

_posts/2025-01-28-zsh.md

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ cat >> ~/.zshrc << 'EOL'
2121
2222
HISTFILE=~/.zsh_history
2323
24-
HISTSIZE=10000 # 內存中保存的歷史記錄數量
25-
SAVEHIST=10000 # 歷史檔案中保存的記錄數量
24+
HISTSIZE=1000 # 內存中保存的歷史記錄數量
25+
SAVEHIST=1000 # 歷史檔案中保存的記錄數量
2626
2727
# 以附加模式寫入歷史,而不是覆蓋
2828
setopt APPEND_HISTORY
@@ -39,34 +39,20 @@ setopt HIST_REDUCE_BLANKS # 移除多餘的空格
3939
4040
HISTORY_IGNORE="(cd|cd *)" # 不保存 cd 指令
4141
42-
zinit ice wait lucid
43-
zinit light rupa/z
44-
45-
zinit ice wait lucid
46-
zinit light junegunn/fzf
47-
48-
zinit ice wait"2" lucid
49-
zinit snippet OMZP::git
50-
51-
zinit ice wait"2" lucid
52-
zinit snippet OMZP::sudo
53-
54-
zinit ice wait lucid
55-
zinit light zsh-users/zsh-autosuggestions
56-
57-
zinit ice wait lucid
58-
zinit light zsh-users/zsh-syntax-highlighting
59-
60-
zinit ice lucid wait
61-
zinit light MichaelAquilina/zsh-autoswitch-virtualenv
42+
zinit wait lucid for \
43+
rupa/z \
44+
junegunn/fzf \
45+
OMZP::git \
46+
OMZP::sudo \
47+
zsh-users/zsh-autosuggestions \
48+
zsh-users/zsh-syntax-highlighting \
49+
MichaelAquilina/zsh-autoswitch-virtualenv \
6250
6351
zinit ice depth=1
6452
zinit light romkatv/powerlevel10k
65-
6653
zinit cdclear -q
6754
6855
setopt promptsubst
69-
EOL
7056
```
7157
7258
* [z](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/z),快速跳轉路徑。
@@ -81,12 +67,15 @@ EOL
8167
* 更改EDITOR為nano。
8268
* 自動補全邏輯改為從歷史記錄中查找建議,沒有歷史建議則提示參數或子路徑。
8369
* 更改自動補全提示的顏色來避免在One Dark下看不到提示。
70+
* 增加快速更新系統用的指令
8471
8572
```zsh
8673
cat >> ~/.zshrc << 'EOL'
8774
export EDITOR=nano
8875
export ZSH_AUTOSUGGEST_STRATEGY=(history completion)
8976
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=fg=#626262
77+
78+
alias upsys='sudo pacman -Syu --noconfirm && yay -Syu --noconfirm && flatpak update -y'
9079
EOL
9180
```
9281

0 commit comments

Comments
 (0)