使用 sheldon 管理 Zsh 配置
source link: https://gythialy.github.io/zsh-sheldon-config/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
使用 sheldon 管理 Zsh 配置
之前一直使用使用 antigen 管理 Zsh 配置,由于 antigen 已经很就不更新了,最后一次代码提交为 2019,就切换到了 sheldon。
sheldon 是 Rust 编写的 Zsh 包管理器,特性如下:
- Plugins from Git repositories.
- Branch / tag / commit support.
- Submodule support.
- First class support for GitHub repositories.
- First class support for Gists.
- Arbitrary remote scripts or binary plugins.
- Local plugins.
- Inline plugins.
- Highly configurable install methods using templates.
- Shell agnostic, with sensible defaults for Zsh.
- Super-fast plugin loading and parallel installation. See benchmarks.
- Config file using TOML syntax.
- Clean ~/.zshrc or ~/.bashrc (just add 1 line).
通过 brew install sheldon
一键安装,也有其他安装方式可选。
执行 sheldon init
会生成默认配置 plugins.toml
,文件存放在 $XDG_CONFIG_HOME/sheldon
,一般这个路径就是 ~/.config/sheldon/plugins.toml
。可以直接编辑这个配置,也可以通过 sheldon CLI 来操作。
sheldon 有三种不同类型的命令:
init
初始化一个新的配置文件。lock
和source
处理插件下载、安装和 shell 源代码的生成。add
,edit
,remove
会自动更新配置文件
详细使用,可以参考官方说明,常用的就是 sheldon lock --update
更新所有插件。
# ~/.config/sheldon/plugins.toml
# ┌─ Unique name for the plugin
# ┌──┴─┐
[plugins.base16]
github = "chriskempson/base16-shell"
# └─────┬────┘ └─────┬────┘
# │ └─ GitHub repository name
# └─ GitHub user or organization
配置中启用了 Oh My Zsh 的部分功能,还有启用了自动高亮,完成建议等。
shell = "zsh"
[templates]
defer = "{% for file in files %}zsh-defer source \"{{ file }}\"\n{% endfor %}"
# PATH = 'export PATH="{{ dir }}:$PATH"'
# fpath = 'fpath=( "{{ dir }}" $fpath )'
# path = 'path=( "{{ dir }}" $path )'
# source = {value = 'source "{{ file }}"', each = true}
[plugins]
[plugins.zsh-defer]
github = "romkatv/zsh-defer"
[plugins.ohmyzsh-lib]
github = "ohmyzsh/ohmyzsh"
dir = "lib"
use = ["{clipboard,completion,git,termsupport,theme-and-appearance}.zsh"]
apply = ["defer"]
[plugins.ohmyzsh-plugin]
github = "ohmyzsh/ohmyzsh"
dir = "plugins"
use = ["{command-not-found,common-aliases,docker-compose,gem,git,npm,yarn,kubectl}/*.plugin.zsh"]
apply = ["defer"]
[plugins.zsh-syntax-highlighting]
github = "zsh-users/zsh-syntax-highlighting"
apply = ["defer"]
[plugins.zsh-autosuggestions]
github = "zsh-users/zsh-autosuggestions"
use = ["{{ name }}.zsh"]
apply = ["defer"]
[plugins.zsh-completions]
github = "zsh-users/zsh-completions"
apply = ["defer"]
# [plugins.powerlevel10k]
# github = "romkatv/powerlevel10k"
# [plugins.zsh-z]
# github = "agkozak/zsh-z"
# apply = ["defer"]
[plugins.z-lua]
github = "skywind3000/z.lua"
apply = ["defer"]
# [plugins.compinit]
# gist = "c514eaedbd4539ee2affffab9ca74913"
# inline = 'autoload -Uz compinit && compinit'
# For example:
#
# [plugins.base16]
# github = "chriskempson/base16-shell"
更新 .zshrc
在文件中添加 eval "$(starship init zsh)"
即可
---EOF---
Recommend
-
45
2018年3月14日,史蒂芬•霍金与世长辞,享年76岁。作为理论物理学家,他的成就是什么呢?
-
5
CEO SpotlightCEO Spotlight: Sheldon Inwentash: Discovering Disruptive Companies Before Everyone ElseWhen it comes to defining his method,
-
2
Sheldon: The Erlang spell checkerSheldon is a very simple Erlang spell checker tha...
-
4
Spell check your Erlang code with Sheldon“Scissors cuts paper. Paper covers rock. Rock crushes lizard.”In the article
-
3
安装zsh和oh-my-zsh安装zshsudo apt install zsh# 输出正在读取软件包列表... 完成正在分析软件包的依赖关系树... 完成正在读取状...
-
13
Top Liked Posts Just a reminder to make clear that development for this device is not dead. As soon as I can, I w...
-
6
使用 Antidote 管理 Zsh 配置 2023-02-18 2023-02-17 Notes 之前介绍了使用
-
5
实际项目中会运到的 Typescript 回调函数、事件侦听的类型定义,如果刚碰到会一脸蒙真的,我就是 这是第一次我自己对 Typescript 记录学习,所以得先说一下我与 Typescrip...
-
4
响应式的 switchboard:让又大又慢的Vue/AIpine 页面爆快 ...
-
7
Voice with AI- Tutorial in Sheldon Cooper & Super Mario’s voice!
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK