一些好用插件
# 自带插件
# copypath
copypath
复制当前目录的路径到剪贴板
# copyfile
copyfile + 文件名
便会将文件内容复制到剪贴板
# copybuffer
copybuffer
复制当前终端的内容到剪贴板
# dirhistory
使用 ALT + 方向键
可以快速切换目录,←向前,→向后,↓向上级目录,↑向第一个子目录,不过一些 terminal 程序可能会因为 ALT 被占用而用不了
# sudo
需要 sudo
的命令没 sudo
时,按两下 ESC
会直接在命令前加上 sudo
# history
列出历史执行的命令
h # 列出历史命令
hs # 搜索指令
hsi # 同上,但是区分大小写
1
2
3
2
3
# jsontools
# 格式化的显示json,可以设个别名
cat json.json | pp_json
# 校验
is_json < json.json
1
2
3
4
2
3
4
# z
z + 目录名
,会自动跳转到最近访问过的目录,比如 z Downloads
,会跳转到 ~/Downloads
目录
跳转逻辑是根据目录的访问频率来的,访问频率越高,跳转到的概率越大
# 需自行安装
# zsh-autosuggestions
会自动提示命令输入,使用→补全,基于输入历史
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
1
# zsh-syntax-highlighting
会自动高亮命令,正确的命令(即能执行的)绿色,错误的命令红色,可以省一些麻烦
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
1
# 其他
# powerlevel10k 主题
一个挺好用的主题 (opens new window)
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# 或是使用gitee镜像
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
1
2
3
2
3
上次更新: 9/20/2024, 4:07:01 PM