Skip to content

neovim: Support Lua for plugin configuration#2723

Closed
cdunster wants to merge 2 commits intonix-community:masterfrom
cdunster:neovim-lua-config
Closed

neovim: Support Lua for plugin configuration#2723
cdunster wants to merge 2 commits intonix-community:masterfrom
cdunster:neovim-lua-config

Conversation

@cdunster
Copy link
Copy Markdown

Description

This is to support the use of Lua as a language for plugin configuration in neovim.
Lua plugins are becoming the norm in neovim so it is useful to be able to configure them with Lua.

This should be expanded on later to add better support for Lua but this is a good first step.

P.S. I am very new to Nix and home-manager so any feedback is welcome, but please be kind 😁

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all.
    (bash module tests not passing, I think this is an error on master though)

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module
    (not new but no current maintainer)

    • Added myself as module maintainer. See example.

    • Added myself and the module files to .github/CODEOWNERS.

Add support for using lua for plugin configuration by adding a lua block
around the config in the generated init.vim file.
@teto
Copy link
Copy Markdown
Collaborator

teto commented Feb 16, 2022

first of all thanks for contributing, adding a test etc .
There is a similar PR to improve lua support that was opened recently too #2716
I prefer the other PR approach that just requires the generated lua config rather than the ugly heredoc sections:

          config = ''
            lua << EOF
          '' + p.config + ''
            EOF'';

I intend to merge #2716 as soon as my comment is adressed then we could look at generating an init.lua by default and converting these

set packpath^=/nix/store/00000000000000000000000000000000-vim-pack-dir
set runtimepath^=/nix/store/00000000000000000000000000000000-vim-pack-dir

to lua.

NB: even though lua plugins are nice, I suspect many less vocal) neovim users still use an init.vim (I do, well I have an hybrid setup), some operations are still easier in viml IMO.

@cdunster
Copy link
Copy Markdown
Author

I prefer the other PR approach that just requires the generated lua config rather than the ugly heredoc sections:

No worries, I was actually planning on doing something similar as a next step but where each plugin configured with Lua had a separate file in the .config/nvim/lua subdirectory and then sourced in init.vim or init.lua as this is my preferred approach for my current dotfiles.

I intend to merge #2716 as soon as my comment is adressed then we could look at generating an init.lua by default and converting these

Nice, just happy to have Lua supported so I can use my existing config.

NB: even though lua plugins are nice, I suspect many less vocal) neovim users still use an init.vim (I do, well I have an hybrid setup), some operations are still easier in viml IMO.

You're right but I think more and more people are moving to Lua and it's great for new people so adding support now makes sense.

@cdunster cdunster closed this May 2, 2022
@cdunster cdunster deleted the neovim-lua-config branch May 2, 2022 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants