fix: move lua/ and plugin/ to repo root for plugin-manager installs #1

Merged
huantrinh1802 merged 1 commit from fix/rtp-plugin-layout into main 2026-09-22 22:10:19 +10:00

Why:

  • Every plugin manager (lazy.nvim, packer.nvim, vim-plug, ...) adds
    the git clone root itself to 'runtimepath' and looks for lua/ and
    plugin/ directly there — there's no way to point them at a
    subdirectory. This repo nested both under nvim/ (to sit next to
    rust/), so require("localhistory") failed for every git-based
    install with "module 'localhistory' not found", even with the
    rust.bin auto-detection and build-hook docs from the previous
    commit in place.

What:

  • git mv nvim/lua -> lua, nvim/plugin -> plugin, nvim/tests -> tests;
    drop the now-empty nvim/ directory. rust/ is untouched.
  • config.lua's plugin_root() (used by rust.bin auto-detection) now
    walks up 3 directories instead of 4, matching the new depth of
    lua/localhistory/config.lua relative to the repo root.
  • tests/run.lua's rtp-setup helper (renamed repo_nvim_root ->
    repo_root) needed no numeric change: the file and its target both
    moved up one level, so the same two ":h" calls still land on the
    repo root.
  • Updated README.md and CLAUDE.md path references, and added a note
    to CLAUDE.md's architecture section spelling out why lua/ and
    plugin/ must stay at the repo root.

Impact:

  • Fixes a hard failure for anyone installing this plugin via a
    plugin manager pointed at the git repo (reproduced and verified
    fixed by adding only the repo root to 'runtimepath', matching what
    a real install does). rust/ and its build/tests are unaffected;
    the Lua test suite path is now tests/run.lua instead of
    nvim/tests/run.lua.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

Why: - Every plugin manager (lazy.nvim, packer.nvim, vim-plug, ...) adds the git clone root itself to 'runtimepath' and looks for lua/ and plugin/ directly there — there's no way to point them at a subdirectory. This repo nested both under nvim/ (to sit next to rust/), so require("localhistory") failed for every git-based install with "module 'localhistory' not found", even with the rust.bin auto-detection and build-hook docs from the previous commit in place. What: - git mv nvim/lua -> lua, nvim/plugin -> plugin, nvim/tests -> tests; drop the now-empty nvim/ directory. rust/ is untouched. - config.lua's plugin_root() (used by rust.bin auto-detection) now walks up 3 directories instead of 4, matching the new depth of lua/localhistory/config.lua relative to the repo root. - tests/run.lua's rtp-setup helper (renamed repo_nvim_root -> repo_root) needed no numeric change: the file and its target both moved up one level, so the same two ":h" calls still land on the repo root. - Updated README.md and CLAUDE.md path references, and added a note to CLAUDE.md's architecture section spelling out why lua/ and plugin/ must stay at the repo root. Impact: - Fixes a hard failure for anyone installing this plugin via a plugin manager pointed at the git repo (reproduced and verified fixed by adding only the repo root to 'runtimepath', matching what a real install does). rust/ and its build/tests are unaffected; the Lua test suite path is now `tests/run.lua` instead of `nvim/tests/run.lua`. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Why:
- Every plugin manager (lazy.nvim, packer.nvim, vim-plug, ...) adds
  the git clone root itself to 'runtimepath' and looks for lua/ and
  plugin/ directly there — there's no way to point them at a
  subdirectory. This repo nested both under nvim/ (to sit next to
  rust/), so require("localhistory") failed for every git-based
  install with "module 'localhistory' not found", even with the
  rust.bin auto-detection and build-hook docs from the previous
  commit in place.

What:
- git mv nvim/lua -> lua, nvim/plugin -> plugin, nvim/tests -> tests;
  drop the now-empty nvim/ directory. rust/ is untouched.
- config.lua's plugin_root() (used by rust.bin auto-detection) now
  walks up 3 directories instead of 4, matching the new depth of
  lua/localhistory/config.lua relative to the repo root.
- tests/run.lua's rtp-setup helper (renamed repo_nvim_root ->
  repo_root) needed no numeric change: the file and its target both
  moved up one level, so the same two ":h" calls still land on the
  repo root.
- Updated README.md and CLAUDE.md path references, and added a note
  to CLAUDE.md's architecture section spelling out why lua/ and
  plugin/ must stay at the repo root.

Impact:
- Fixes a hard failure for anyone installing this plugin via a
  plugin manager pointed at the git repo (reproduced and verified
  fixed by adding only the repo root to 'runtimepath', matching what
  a real install does). rust/ and its build/tests are unaffected;
  the Lua test suite path is now `tests/run.lua` instead of
  `nvim/tests/run.lua`.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
huantrinh1802 deleted branch fix/rtp-plugin-layout 2026-09-22 22:10:19 +10:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
huantrinh1802/localhistory.nvim!1
No description provided.