cvigilv / esqueleto.nvim

Reduce your boilerplate code the lazy-bones way
MIT License
98 stars 7 forks source link

Remove need to specify 'patterns'? #41

Closed andrewferrier closed 7 months ago

andrewferrier commented 9 months ago

Hello! Thanks for writing esqueleto. Great plugin! I've been using it to replace some homegrown logic from my dotfiles. Thanks! I'll be sending a few bits of feedback as issues your way, hope that's helpful :)

My first would be - I'm not sure why it's necessary to specify the pattern list. In my config, I've ended up with something like:

return {
    "cvigilv/esqueleto.nvim",
    config = function()
        require("esqueleto").setup({
            directories = vim.fn.stdpath("config") .. "/skeleton",
            patterns = vim.fn.readdir(vim.fn.stdpath("config") .. "/skeleton"),
        })
    end,
}

Why would I ever not want every subdir from the directories I've specified in the patterns list? Is there a reason I wouldn't include one? I think, unless I've missed something, this is something esqueleto could calculate out-of-the-box, isn't it? Certainly from reading the README I can't see any situation where those two lists wouldn't match. Maybe if that's true, you could auto-calculate this and remove the user burden to specify it?

cvigilv commented 9 months ago

Maybe the default behavior should do what you do. I'm currently out on vacations, once I arrive I can add this feature. Thanks!

cvigilv commented 8 months ago

@andrewferrier This issue will be tackled this week, I'll add it as a default. If you are interested in doing the PR with this change, I will merge it promptly since I already changes my config to use this method.

cvigilv commented 8 months ago

Why would I ever not want every subdir from the directories I've specified in the patterns list? Is there a reason I wouldn't include one? I think, unless I've missed something, this is something esqueleto could calculate out-of-the-box, isn't it? Certainly from reading the README I can't see any situation where those two lists wouldn't match. Maybe if that's true, you could auto-calculate this and remove the user burden to specify it?

Regarding this points you make, if you have multiple directories you need to generate the list of all patterns found in the directories, so its not so straightforward. I'll have to think how to make this, but for now I'll use your config as the new defaults.