feat(config-settings): add Dots link toggle for user-dots symlink
Extract the user-dots symlink logic into the __fish_user_dots_link helper and add a dedicated __fish_user_dots_symlink toggle, surfaced as a 'Dots link' bool row on the config-settings Paths page. Unlike the opinionated categories it has no universal/session split — it acts on a literal path. Setting it falsy (or toggling off) stops symlink generation and removes any existing link immediately, honoured regardless of the C2 master switch. Creation remains a C2 startup side-effect. config.fish now calls the helper. Docs: README, fish-config.md (C2 table, Paths page, machine-local section), and fish-config.index updated.
This commit is contained in:
+5
-14
@@ -227,20 +227,11 @@ if status is-interactive
|
||||
set -q __fish_user_dots_path
|
||||
or set -l __fish_user_dots_path "$XDG_CONFIG_HOME/.user-dots/fish"
|
||||
# ────────────────────── user-dots convenience symlink ───────────────────
|
||||
# Keep $__fish_config_dir/user-dots pointing at the resolved path so it can
|
||||
# be browsed from the fish config dir. Git-ignored; a C2 startup side-effect.
|
||||
# Only ever manages a symlink — never clobbers a real file/dir placed there.
|
||||
if __fish_config_op_enabled __fish_config_op_autoexec
|
||||
set -l __udots_link "$__fish_config_dir/user-dots"
|
||||
if test -d "$__fish_user_dots_path"
|
||||
if test -L "$__udots_link"
|
||||
test (readlink "$__udots_link") != "$__fish_user_dots_path"
|
||||
and ln -sfn "$__fish_user_dots_path" "$__udots_link"
|
||||
else if not test -e "$__udots_link"
|
||||
ln -s "$__fish_user_dots_path" "$__udots_link"
|
||||
end
|
||||
end
|
||||
end
|
||||
# Keep $__fish_config_dir/user-dots tracking the resolved path so it can be
|
||||
# browsed from the fish config dir. Git-ignored. Controlled by the
|
||||
# __fish_user_dots_symlink toggle (config-settings → Paths); creation is a
|
||||
# C2 side-effect, removal-on-opt-out is honoured regardless. See the helper.
|
||||
__fish_user_dots_link
|
||||
|
||||
# ─────────────────────── Source machine-local config ────────────────────
|
||||
# Sources local.fish if it exists. That file handles sourcing its own
|
||||
|
||||
Reference in New Issue
Block a user