Skip to content

Editor hints (vim modelines + VSCode associations) for extension-less configs#3

Merged
davidham merged 2 commits into
mainfrom
feature/editor-hints
May 20, 2026
Merged

Editor hints (vim modelines + VSCode associations) for extension-less configs#3
davidham merged 2 commits into
mainfrom
feature/editor-hints

Conversation

@davidham

Copy link
Copy Markdown
Owner

Summary

The XDG-relocated config files (xdg/git/{config,attributes,ignore}, xdg/npm/npmrc, xdg/nix/nix.conf) have no extensions, so editors fall back to plain text. Two complementary hints:

  1. Vim modelines at the top of each file using its native comment syntax (`#` or `;`). Verified `git config` still parses xdg/git/config (the modeline is a valid comment line).
  2. .vscode/settings.json with files.associations using `**/`-prefixed globs (bare paths weren't matching reliably).

🤖 Generated with Claude Code

davidham added 2 commits May 20, 2026 10:24
After moving gitconfig/gitignore/gitattributes/npmrc/nix.conf to their
XDG locations, none have file extensions anymore, so editors fall back
to plain text. Add hints two ways:

1. Vim modelines (top of each file) using the file's native comment
   syntax: '#' for gitconfig/gitattributes/gitignore/nix.conf,
   ';' for npmrc. Works in vim/nvim/emacs.
2. .vscode/settings.json with files.associations -- workspace-scoped,
   activates whenever the repo is opened as a VSCode workspace.

Verified git still parses xdg/git/config with the modeline (it's a
valid '#' comment line).
Bare paths like 'xdg/git/config' weren't matching reliably in VS Code's
files.associations. The **/-prefixed form matches the same path from
any depth (still matches from workspace root) and works consistently
across VS Code versions.
@davidham davidham merged commit ebc8e71 into main May 20, 2026
2 checks passed
@davidham davidham deleted the feature/editor-hints branch May 20, 2026 15:30
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