Skip to content

fix: manage ~/.vimrc as a bounded block in user-owned config - #178

Merged
jiminu merged 2 commits into
mainfrom
fix/user-vimrc-bounded-block
Aug 25, 2026
Merged

fix: manage ~/.vimrc as a bounded block in user-owned config#178
jiminu merged 2 commits into
mainfrom
fix/user-vimrc-bounded-block

Conversation

@jiminu

@jiminu jiminu commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

Changes user-vimrc from a managed symlink at ${XDG_CONFIG_HOME:-$HOME/.config}/vim/vimrc to a bounded block inside $HOME/.vimrc.

Context & Motivation

  • Vim support for $XDG_CONFIG_HOME/vim/vimrc was introduced in patch 9.1.0327.
  • Ubuntu 24.04 LTS (Selfishell's primary Linux target) packages Vim 9.1.0016, which does not search the XDG path. As a result, minimal profile installations on Ubuntu 24.04 (and macOS environments with standard system Vim) did not read the managed vimrc.
  • Furthermore, treating ~/.vimrc as a user-owned configuration file containing a bounded Selfishell block aligns with Selfishell's design contract for .zshrc, .zprofile, and config.ghostty: preserving existing user configuration and allowing custom keymaps/plugins outside the block.

Changes

  1. Resource declaration: Changed user-vimrc from link at ~/.config/vim/vimrc to block at $HOME/.vimrc in lib/resources.sh.
  2. Block definition & Vim syntax: Defined user-vimrc block with " comments in lib/managed.sh and extended block marker generation/inspection to support custom comment characters.
  3. Preflight: Added user-vimrc preflights to lib/commands/install.sh and lib/commands/update.sh.
  4. Documentation: Updated AGENTS.md user-owned configuration section.
  5. Tests & E2E:
    • Updated tests/managed_install_test.bash and scripts/macos-configuration-e2e.sh to verify ~/.vimrc block lifecycle, idempotency, update, restoration, and symlink rejection.
    • Added standard startup Vim regression test to scripts/ubuntu-container-e2e.sh to verify that default Vim startup on Ubuntu 24.04 resolves ~/.vimrc and applies number / relativenumber.

Verification

  • bash scripts/check.sh (all 21 test suites, ShellCheck, shfmt, syntax checks) passed.
  • bash scripts/macos-configuration-e2e.sh passed.
  • Ubuntu 24.04 container E2E (scripts/ubuntu-container-e2e.sh with Vim startup regression check) passed in CI.

@jiminu
jiminu merged commit 4ec817f into main Aug 25, 2026
7 checks passed
@jiminu
jiminu deleted the fix/user-vimrc-bounded-block branch August 25, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant