Skip to content

fix(nvim): resolve config path via stdpath so <leader>rc opens init.l…#209

Merged
Gerrrt merged 2 commits into
mainfrom
claude/windows-dotfiles-optimization-4yjowv
Jul 13, 2026
Merged

fix(nvim): resolve config path via stdpath so <leader>rc opens init.l…#209
Gerrrt merged 2 commits into
mainfrom
claude/windows-dotfiles-optimization-4yjowv

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

…ua on Windows

<leader>rc and the alpha dashboard "Config" button both hardcoded ~/.config/nvim/init.lua. On the Windows host Neovim reads %LOCALAPPDATA%\nvim, so that path doesn't exist and the binding opened a phantom file (the wart nvim-sync.ps1 already flags for dotfiles-Windows). Both now resolve the config dir at runtime with vim.fn.stdpath("config") + vim.fs.joinpath, so the same binding lands on the real init.lua on every platform. luacheck clean.

Claude-Session: https://claude.ai/code/session_016xkWqWoYXgpgUJ3YVu3JGH

What & why

Is it actually Core?

  • Identical on every machine — not OS-specific (pkg manager, paths, clipboard → the OS repo)
  • Not offensive/engagement tooling (→ dotfiles-Kali)

Contract & checks

  • If a Core file was added/removed, core.manifest was updated in the same change
  • make audit is green locally (manifest ↔ fs, exec-bits, syntax, lint, behavioral)
  • Exec-bits correct: scripts +x, zsh/*.zsh modules not executable
  • If a new file needs a symlink, each OS repo's bootstrap.sh was noted/updated

Notes

…ua on Windows

`<leader>rc` and the alpha dashboard "Config" button both hardcoded
`~/.config/nvim/init.lua`. On the Windows host Neovim reads `%LOCALAPPDATA%\nvim`,
so that path doesn't exist and the binding opened a phantom file (the wart
nvim-sync.ps1 already flags for dotfiles-Windows). Both now resolve the config
dir at runtime with `vim.fn.stdpath("config")` + `vim.fs.joinpath`, so the same
binding lands on the real init.lua on every platform. luacheck clean.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_016xkWqWoYXgpgUJ3YVu3JGH
Copilot AI review requested due to automatic review settings July 13, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Makes Neovim config-opening actions portable across operating systems.

Changes:

  • Resolves init.lua via stdpath("config").
  • Updates both keymap and dashboard actions.
  • Documents the fix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
nvim/lua/gerrrt/config/keymaps.lua Updates <leader>rc.
nvim/lua/gerrrt/plugins/alpha-nvim.lua Updates the Config button.
CHANGELOG.md Records the fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nvim/lua/gerrrt/config/keymaps.lua Outdated
Comment thread nvim/lua/gerrrt/plugins/alpha-nvim.lua Outdated
Copilot review: vim.cmd.edit() applies Ex filename magic, so a config path
containing `%` (current file) or `#` (alternate file) — reachable via an unusual
XDG_CONFIG_HOME / Windows profile — would be expanded instead of opened. Wrap the
resolved path in vim.fn.fnameescape() in both the <leader>rc keymap and the alpha
dashboard "Config" button so it's always treated literally.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_016xkWqWoYXgpgUJ3YVu3JGH
@Gerrrt Gerrrt merged commit f83a5f1 into main Jul 13, 2026
14 checks passed
@Gerrrt Gerrrt deleted the claude/windows-dotfiles-optimization-4yjowv branch July 13, 2026 14:37
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.

3 participants