一款极其好用的终端工具,简单易上手。
环境:CentOS 7
安装
1 | # 使用 zsh |
有什么好处呢?用了就知道了!
主题
第一个好处就是漂亮!
有多少种主题?
1 | ls ~/.oh-my-zsh/themes |
太多了,我选 ys
。
1 | vim ~/.zshrc |
pure 其实也不错,但是它没有被集成到 Oh My Zsh
中,需要额外安装。
1 | # 下载 |
插件
必装插件:highlighting
&& autosuggestions
。直接 CV
就完事!
1 | git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting |
选装插件:
- extract:再也不用
tar -zxvf
了,直接x
搞定所有! - autojump:
cd /var/www/hexo
(x)j hexo
(√)
- themes:快速切换主题
如何装?Just:
1 | vim ~/.zshrc |
如果要安装 autojump
则还需要:
1 | yum install autojump-zsh |
然后重载配置:
1 | source ~/.zshrc |
Enjoy it !
2020/3/14 更新
解决安装 autosuggestions 后往终端里粘贴文字变慢的问题:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 vim ~.zshrc
# 添加以下内容
# This speeds up pasting w/ autosuggest
# https://github.com/zsh-users/zsh-autosuggestions/issues/238
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish
# 使其生效
source .zshrc