dotfiles/sheldon.toml
Jonny Barnes 43e5d5ed85
Only load fnm sheldon plugin on macOS
On the server, fnm isn't installed since system nodejs is used instead.
The zsh-fnm plugin's own fallback silently curl-installs fnm when missing,
and its --use-on-cd hook then prompts on every cd since no default version
is fnm-managed there. Gate the plugin to Darwin only.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3jcSVn51hiw58f7jPWrpN
2026-08-04 22:30:41 +01:00

112 lines
2.5 KiB
TOML

# Sheldon configuration file
#
# See https://sheldon.cli.rs
#
# Also heavily inspired by https://github.com/rossmacarthur/dotfiles/tree/trunk
shell = "zsh"
[templates]
defer = '''
{{- hooks?.pre | nl }}
{%- for file in files %}zsh-defer source "{{ file }}"{{ "\n" }}
{%- endfor %}
{{- hooks?.post | nl }}'''
defer-more = '''
{{- hooks?.pre | nl }}
{%- for file in files %}zsh-defer -t 0.5 source "{{ file }}"{{ "\n" }}
{%- endfor %}
{{- hooks?.post | nl }}'''
# Loading indicator
# -----------------
[plugins.show]
local = "~/.zsh/plugins/loading"
# Completions
# -----------
[plugins.zsh-completions]
github = "zsh-users/zsh-completions"
# Sourced
# -------
[plugins.functions]
local = "~/.zsh/plugins"
[plugins.zsh-defer]
github = "romkatv/zsh-defer"
# Deferred plugins
# ----------------
[plugins.aliases]
local = "~/.zsh/plugins"
apply = ["defer"]
[plugins.fzf]
github = "junegunn/fzf"
use = ["shell/completion.zsh", "shell/key-bindings.zsh"]
apply = ["defer"]
# compinit must run before fzf-tab and before any plugin that calls `compdef`
# (fnm, zoxide). ZLE-wrapping plugins (autosuggestions, syntax-highlighting)
# must be sourced after fzf-tab.
[plugins.compinit]
local = "~/.zsh/plugins"
apply = ["defer"]
[plugins.fzf-tab]
github = "Aloxaf/fzf-tab"
apply = ["defer"]
[plugins.zsh-autosuggestions]
github = "zsh-users/zsh-autosuggestions"
apply = ["defer"]
use = ["{{ name }}.zsh"]
[plugins.zsh-you-should-use]
github = "MichaelAquilina/zsh-you-should-use"
apply = ["defer"]
hooks.pre = "export YSU_MODE=ALL"
[plugins.forgit]
github = "wfxr/forgit"
apply = ["defer"]
[plugins.fnm]
github = "dominik-schwabe/zsh-fnm"
apply = ["defer"]
# Linux boxes (e.g. the server) intentionally use the distro nodejs package
# instead of fnm, so only load this plugin on macOS. Otherwise the plugin's
# own fallback silently curl-installs fnm and its --use-on-cd hook then
# prompts on every cd since no version is fnm-managed there.
hooks.pre = '''
if [[ "$OSTYPE" == darwin* ]]; then
export ZSH_FNM_ENV_EXTRA_ARGS="--use-on-cd --version-file-strategy recursive --resolve-engines false"'''
hooks.post = "fi"
[plugins.zoxide]
github = "ajeetdsouza/zoxide"
apply = ["defer"]
[plugins.mcfly]
github = "cantino/mcfly"
apply = ["defer"]
[plugins.zsh-ssh]
github = 'sunlei/zsh-ssh'
apply = ["defer"]
[plugins.zsh-syntax-highlighting]
github = "zsh-users/zsh-syntax-highlighting"
apply = ["defer"]
# Loading indicator
# -----------------
[plugins.hide]
local = "~/.zsh/plugins/loading"
apply = ["defer-more"]