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

feat(core-config): opt-in to lua patterns for dev.patterns #1676

Closed
wants to merge 1 commit into from

Conversation

fredrikaverpil
Copy link

@fredrikaverpil fredrikaverpil commented Jul 24, 2024

Description

This adds the ability to opt-in to use lua patterns for dev.patterns. I'm currently helping a friend who uses NixOS and where there apparently is very poor and fragmented approaches on how to set up Neovim with plugins downloaded using Nix but configured with Lazy.

Here's a blog post by @KFearsoff outlining the overall setup, and also highlights the reason for this PR:

If you've been paying close attention to what changed between the steps, you have probably noticed that in the last step, we added dev.patterns = {"folke"}. Why not wildcard?

The sad answer is that there's no wildcard. The pattern matcher used in lazy.nvim doesn't support them. Which means that we unfortunately have to add new entries to it when we add a new plugin: if we installed a plugin "hrsh7th/nvim-cmp", we need to add "hrsh7th" to dev.patterns. I'm about to submit an issue to fix that, pinky swear. But for now it is what it is

Apparently, I might beat @KFearsoff to the punch here, if you think this addition is ok. 😆
Or maybe you have a better idea?

Anyway, the goal with this PR is to be able to do something like this: patterns = { ".*" }.

@fredrikaverpil fredrikaverpil changed the title feat: add option to use lua patterns for dev patterns feat(core-config): add lua patterns for dev.patterns Jul 24, 2024
@fredrikaverpil fredrikaverpil marked this pull request as ready for review July 24, 2024 20:21
@fredrikaverpil
Copy link
Author

@KFearsoff 👋 perhaps you would like to add anything? 😄

@fredrikaverpil fredrikaverpil changed the title feat(core-config): add lua patterns for dev.patterns feat(core-config): opt-in to lua patterns for dev.patterns Jul 24, 2024
@folke
Copy link
Owner

folke commented Jul 24, 2024

dev.patterns = {""} works

@folke folke closed this Jul 24, 2024
@KFearsoff
Copy link

dev.patterns = {""} works

Damn. Seems obvious enough, but also something I didn't anticipate at all.

Any chance this could be documented? This is such a small thing, but it would help immensely for this weird edge case that we have.

@fredrikaverpil
Copy link
Author

@KFearsoff did you try it? Maybe update your blog post with this info so that others reading your post is aware of this?

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.

3 participants