doom-neovim / doom-nvim

A Neovim configuration for the advanced martian hacker
GNU General Public License v2.0
1.01k stars 107 forks source link

[FEATURE REQUEST] Refactor module resolution to simplify adding user overrides. #331

Closed connorgmeehan closed 2 years ago

connorgmeehan commented 2 years ago

What is the feature, what would you like to be able to do?

Currently the method that user's override an existing module is fragmented and not as straight forward as we'd like. Currently a user must:

  1. Copy the module from lua/doom/modules/SECTION_NAME/MODULE_NAME/ -> lua/user/modules/MODULE_NAME
  2. Do this in their modules.lua
    -- modules.lua
    return {
    langs = {
    'lua', -- delete this
    },
    user = {
    'lua', -- add this
    }
    }

A better solution is to change the way modules are resolved, first doom tries to load from lua/user/modules/SECTION_NAME/MODULE_NAME/, if there is no module there, doom will fallback to the builtin lua/doom/modules/SECTION_NAME/MODULE_NAME/.

This way all the user needs to do is copy the module into the user folder and maintain the same folder structure.

What is the use case, why do you want this feature?

The current way of overriding / adding modules is unclear and could be hugely simplified.

Possible Implementation (if applicable)

Modules are resolved inside of lua/doom/core/config, line 86.

connorgmeehan commented 2 years ago

This has been resolved in https://github.com/NTBBloodbath/doom-nvim/commit/f0fa800b57b5c1ccda1d57ffcf737003530e4799