Skip to content

chore: nvim upgrades - #866

Merged
shunkakinoki merged 1 commit into
mainfrom
refactor/neovim-lua-config-subdirectory
Feb 19, 2026
Merged

chore: nvim upgrades#866
shunkakinoki merged 1 commit into
mainfrom
refactor/neovim-lua-config-subdirectory

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Feb 19, 2026

Copy link
Copy Markdown
Owner

Summary by cubic

Refactored Neovim config to use a config/ Lua namespace and updated all requires accordingly. Home Manager now syncs the lua/ directory to ~/.config/nvim for consistent module loading.

  • Refactors
    • Moved modules into lua/config/ and prefixed imports with config.*
    • Updated init.lua and internal modules to use config.utils
    • Updated tests to load config.* modules
    • Added Home Manager mapping to install lua/ into ~/.config/nvim/lua recursively

Written for commit de79918. Summary will update on new commits.

Copilot AI review requested due to automatic review settings February 19, 2026 12:38
@mesa-dot-dev

mesa-dot-dev Bot commented Feb 19, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @shunkakinoki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the maintainability and structure of the Neovim configuration by reorganizing its Lua modules into a dedicated config subdirectory. This change centralizes configuration files, updates all necessary import paths, and ensures the NixOS setup correctly integrates the new file layout, leading to a cleaner and more organized codebase.

Highlights

  • Configuration File Restructuring: All Neovim Lua configuration modules have been moved into a new lua/config subdirectory to improve organization and modularity.
  • NixOS Integration Update: The home-manager/programs/neovim/default.nix file was updated to recursively include the newly structured lua directory, ensuring all configuration files are properly sourced.
  • Module Import Path Adjustments: All require statements across the Neovim configuration, including init.lua and other Lua modules, have been updated to reflect the new config subdirectory in their paths.
  • Test Suite Alignment: Existing test files were modified to correctly reference the new module import paths, ensuring the test suite remains functional after the refactoring.
Changelog
  • home-manager/programs/neovim/default.nix
    • Added a recursive home.file entry to include the new lua directory.
  • home-manager/programs/neovim/init.lua
    • Updated all require statements to include the config prefix for Lua modules.
  • home-manager/programs/neovim/lua/ai.lua
    • Renamed to home-manager/programs/neovim/lua/config/ai.lua.
  • home-manager/programs/neovim/lua/autocmds.lua
    • Renamed to home-manager/programs/neovim/lua/config/autocmds.lua and updated utils import path.
  • home-manager/programs/neovim/lua/completion.lua
    • Renamed to home-manager/programs/neovim/lua/config/completion.lua.
  • home-manager/programs/neovim/lua/keymaps.lua
    • Renamed to home-manager/programs/neovim/lua/config/keymaps.lua and updated utils import path.
  • home-manager/programs/neovim/lua/lsp.lua
    • Renamed to home-manager/programs/neovim/lua/config/lsp.lua.
  • home-manager/programs/neovim/lua/plugins.lua
    • Renamed to home-manager/programs/neovim/lua/config/plugins.lua.
  • home-manager/programs/neovim/lua/settings.lua
    • Renamed to home-manager/programs/neovim/lua/config/settings.lua.
  • home-manager/programs/neovim/lua/telescope.lua
    • Renamed to home-manager/programs/neovim/lua/config/telescope.lua.
  • home-manager/programs/neovim/lua/terminal.lua
    • Renamed to home-manager/programs/neovim/lua/config/terminal.lua.
  • home-manager/programs/neovim/lua/treesitter.lua
    • Renamed to home-manager/programs/neovim/lua/config/treesitter.lua.
  • home-manager/programs/neovim/lua/ui.lua
    • Renamed to home-manager/programs/neovim/lua/config/ui.lua.
  • home-manager/programs/neovim/lua/utils.lua
    • Renamed to home-manager/programs/neovim/lua/config/utils.lua.
  • home-manager/programs/neovim/lua/workspace.lua
    • Renamed to home-manager/programs/neovim/lua/config/workspace.lua.
  • home-manager/programs/neovim/tests/api/init_spec.lua
    • Updated package.loaded and require calls for the settings module to use the new config path.
  • home-manager/programs/neovim/tests/autocmds_spec.lua
    • Updated package.loaded and require calls for the autocmds module to use the new config path.
  • home-manager/programs/neovim/tests/settings_spec.lua
    • Updated package.loaded and require calls for the settings module to use the new config path.
  • home-manager/programs/neovim/tests/utils_spec.lua
    • Updated package.loaded and require calls for the utils module to use the new config path.
  • home-manager/programs/neovim/tests/workspace_spec.lua
    • Updated package.loaded and require calls for the workspace module to use the new config path.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mesa-dot-dev

mesa-dot-dev Bot commented Feb 19, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Upgraded Neovim and refactored its Lua configuration into a dedicated subdirectory.

What changed?

Neovim's Lua configuration has been reorganized and moved into a subdirectory, alongside general upgrades to Neovim and its associated configurations.

Description generated by Mesa. Update settings

@coderabbitai

coderabbitai Bot commented Feb 19, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Reorganized Neovim Lua configuration with improved module namespacing for enhanced code structure and maintainability.
    • Migrated all configuration modules to a dedicated, properly namespaced directory structure for better organization.
    • Updated configuration imports to use the new namespace convention throughout the codebase.
    • Updated test suite to align with the new configuration module structure.

Walkthrough

This PR reorganizes Neovim Lua module imports from flat names to a namespaced config.* structure. A new home.file entry enables recursive copying of the lua directory, and all require() calls are updated to reflect the new module paths in init.lua, configuration modules, and tests.

Changes

Cohort / File(s) Summary
Nix Configuration
home-manager/programs/neovim/default.nix
Added home.file entry at ".config/nvim/lua" with recursive=true and force=true to enable copying the lua directory.
Core Module Initialization
home-manager/programs/neovim/init.lua
Updated all 13 require() calls from flat module names (settings, plugins, autocmds, etc.) to namespaced equivalents (config.settings, config.plugins, etc.).
Configuration Module Imports
home-manager/programs/neovim/lua/config/autocmds.lua, lua/config/keymaps.lua
Updated require("utils") to require("config.utils") to reflect new module namespace.
Test Suite Updates
home-manager/programs/neovim/tests/init_spec.lua, tests/autocmds_spec.lua, tests/settings_spec.lua, tests/utils_spec.lua, tests/workspace_spec.lua
Updated all test module loading paths from flat names to config.* namespace in both package.loaded resets and require() calls.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 Hopping through paths both flat and deep,
Config modules now in namespaces keep,
Lua files bundled in their home so neat,
require("config.*") makes the journey complete!

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/neovim-lua-config-subdirectory

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@shunkakinoki
shunkakinoki merged commit dcc7f55 into main Feb 19, 2026
31 of 32 checks passed
@shunkakinoki
shunkakinoki deleted the refactor/neovim-lua-config-subdirectory branch February 19, 2026 12:39

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 20 files

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request is a nice structural refactoring of your Neovim configuration, moving Lua modules into a config subdirectory. The changes are consistent across all modified files, including the tests. I have one suggestion to further simplify the configuration by removing some now-redundant code in init.lua as a result of these changes.

Comment on lines +25 to +29
home.file.".config/nvim/lua" = {
source = ./lua;
recursive = true;
force = true;
};

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.

medium

By adding this home.file block, you're now explicitly managing the lua directory with home-manager, which is a good simplification.

This change makes some of the path manipulation logic in init.lua redundant. The code block from lines 20-27 in init.lua dynamically determines the path to the lua directory. Since ~/.config/nvim/lua is now a known location thanks to this change, that dynamic logic is no longer needed. The paths added on lines 16-18 are sufficient.

For a cleaner configuration, you could consider removing lines 20-27 from init.lua.

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

This PR upgrades the Neovim Home Manager setup by moving configuration into lua/config/* modules, updating init.lua/tests to use the config.* namespace, and ensuring the Lua module tree is deployed to ~/.config/nvim.

Changes:

  • Update init.lua and test specs to require("config.*") modules.
  • Add new lua/config/* modules for settings/plugins/LSP/UI/treesitter/telescope/terminal/etc.
  • Update Home Manager config to install the full lua/ directory under ~/.config/nvim/lua.

Reviewed changes

Copilot reviewed 9 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
home-manager/programs/neovim/tests/workspace_spec.lua Update module path to config.workspace in tests.
home-manager/programs/neovim/tests/utils_spec.lua Update module path to config.utils in tests.
home-manager/programs/neovim/tests/settings_spec.lua Update module path to config.settings in tests.
home-manager/programs/neovim/tests/autocmds_spec.lua Update module path to config.autocmds in tests.
home-manager/programs/neovim/tests/api/init_spec.lua Update module path to config.settings in API init test.
home-manager/programs/neovim/lua/config/workspace.lua Add workspace-specific autocmd + user command (needs idempotency/ft-scope fixes).
home-manager/programs/neovim/lua/config/utils.lua Add utility helpers (buffer cycling, qf helpers, etc.).
home-manager/programs/neovim/lua/config/ui.lua Add UI plugin setup (notify/lualine/nvim-tree/etc.).
home-manager/programs/neovim/lua/config/treesitter.lua Add treesitter + related plugin setup.
home-manager/programs/neovim/lua/config/terminal.lua Add toggleterm-based terminal management.
home-manager/programs/neovim/lua/config/telescope.lua Add Telescope config + keymaps.
home-manager/programs/neovim/lua/config/settings.lua Add core editor options and diagnostic configuration.
home-manager/programs/neovim/lua/config/plugins.lua Add plugin install/setup via vim.pack.add.
home-manager/programs/neovim/lua/config/lsp.lua Add LSP setup and LSP keymaps.
home-manager/programs/neovim/lua/config/keymaps.lua Update utils import path to config.utils.
home-manager/programs/neovim/lua/config/completion.lua Add nvim-cmp + Copilot completion configuration.
home-manager/programs/neovim/lua/config/autocmds.lua Update utils import path to config.utils.
home-manager/programs/neovim/lua/config/ai.lua Add sidekick/snacks/opencode configuration + keymaps.
home-manager/programs/neovim/init.lua Switch module requires to config.*.
home-manager/programs/neovim/default.nix Ensure ./lua is installed to ~/.config/nvim/lua.

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

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.

2 participants