Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to putting config in a directory #43

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

purefn
Copy link

@purefn purefn commented Jul 11, 2023

Instead of using wrapRc to reference to add the -u argument to neovim, we add the directory to the XDG_CONFIG_DIRS, which neovim will read on startup.

This allows us to do a few nice things:

  • Write commonly used code in modules. This is used to to create an internal module, flake/lsp, which contains the functions used for on_attach and the capabilities. Users can also add their own modules via vim.lua.modules.mymodule = "<code>";.
  • Put language specific code in ftplugin/<lang>.lua. The nix config was migrated to use this approach as an example.

Instead of using `wrapRc` to reference to add the `-u` argument to
neovim, we add the directory to the `XDG_CONFIG_DIRS`, which neovim will
read on startup.

This allows us to do a few nice things:
  * Write commonly used code in modules. This is used to to
    create an internal module, `flake/lsp`, which contains the
    functions used for `on_attach` and the `capabilities`. Users can also
    add their own modules via `vim.lua.modules.mymodule = "<code>";`.
  * Put language specific code in `ftplugin/<lang>.lua`. The `nix`
    config was migrated to use this approach as an example.
@jordanisaacs
Copy link
Owner

jordanisaacs commented Sep 4, 2023

Sorry for the delayed response. This is an interesting feature which I am open to merging as an option that is by default disabled. This is because I see the primary use case of this flake being completely reproducible configurations that do not leak into your environment, hence the use of wrapRc.

But I see why someone may want to use XDG_CONFIG_DIRS, which is why I would be open to merging it as a configurable option.

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