fix(nvim): resolve config path via stdpath so <leader>rc opens init.l…#209
Merged
Conversation
…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
Contributor
There was a problem hiding this comment.
Pull request overview
Makes Neovim config-opening actions portable across operating systems.
Changes:
- Resolves
init.luaviastdpath("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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ua on Windows
<leader>rcand 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 withvim.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?
dotfiles-Kali)Contract & checks
core.manifestwas updated in the same changemake auditis green locally (manifest ↔ fs, exec-bits, syntax, lint, behavioral)+x,zsh/*.zshmodules not executablebootstrap.shwas noted/updatedNotes