-
Notifications
You must be signed in to change notification settings - Fork 34.1k
Feature/snacks picker #1481
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
base: master
Are you sure you want to change the base?
Feature/snacks picker #1481
Conversation
47c264e
to
9daf9fb
Compare
Also, I can move the stylua changes to a different PR / remove them entirely |
9daf9fb
to
aa93f4d
Compare
Damn I was thinking of switching to snacks picker just yesterday, and this PR saves me a lot of time. Also I would suggest to move the stylua changes to a different pr or remove them (just as you suggested), it kind of pollutes this already change-heavy PR. Cheers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update the libary
key of lazydev.nvim
in init.lua to the following:
...
library = {
-- Load luvit types when the `vim.uv` word is found
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
-- Load snacks.nvim when `Snacks` word is found
{ path = 'snacks.nvim', words = { 'Snacks' } },
},
Otherwise the lua lsp is gonna show a lot of undefined global warnings in your snacks picker configuration. All other changes looks fine.
aa93f4d
to
1ec4080
Compare
Oops, I forgot to copy it from my config 🤦 I also split the style lua changes to a different PR :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to merge
Hey 👋 I have a couple of questions. Is there any difference between Thank you for your time, cheers ✌️ |
Well, I would also like to know why is this necessary, what are the benefits of swapping telescope with snacks picker? One downside is that existing kickstart users who are already accustomed to using telescope and might have already done some minor telescope customisations will need to adapt if this is merged. So I would think there would need to be some substantial improvement or benefit for switching. On the other hand it is useful to have a branch like this so it is easily to try out some new stuff for those that are interested. |
They both offer similar functionality and pickers.
To be honest, I'm not sure it is preferable. The main advantages I can think of about snacks are:
This was my motivation behind this PR 😄 |
One of the main reason i prefer snacks picker over telescope is that it supports frecency sorting out of the box. It can be added to telescope as well by adding nvim-telescope/telescope-frecency.nvim. |
Call me biased but snacks-picker is created and maintained by folke (probably the biggest neovim plugins author), and integrates much nicely with a lot of his other plugins. (Which there are a lot of) Kickstart aims to ease people into the neovim ecosystem and imo using something like snacks.picker just helps in that direction. |
I thought the point of kickstart is that users should copy it to their config and then maintain that config themselves, right? So why would a change in upstream kickstart.nvim affect users config? As I understand, Kickstart is not a plugin, not a distro either, so users don't need to update Kickstart like they update a plugin or distro |
There are reasonable changes over time that I want to stay in sync with, so I regularly pull this repo to catch up. IDK if that the best approach, but it works fine until we start replacing plugins. For me, there should be a good reason(other than popularity) to replace a plugin. Note, I'm not saying there is no good reason for the change. I just prefer to have such reasons to be listed explicitly. |
100% agree with this. Just my two cents, but I think kickstart should represent "how to configure neovim if you started today". Things are constantly changing in the neovim ecosystem as new neovim versions are released, popular plugins stop being maintained, new plugins are created, etc. I've used neovim for years and I would always have a couple of people with neovim config repos that I would follow to try and get a sense of what a good setup was. Now I mostly use kickstart for that, a reference point to update my configuration.
I'm not sure there needs to be a objective reason to replace a plugin. Neovim configuration is all a little subjective and I think it should just be based on what the kickstart maintainers view as the "best" (subjective) starting point. I personally use both snacks and telescope because snacks solved performance issues I was having with telescope, but there are some telescope integrations that don't exist in snacks yet. |
Thank you all for the kind responses, i really appreciated all the different perspectives ❤️ As newbie, I have to say that i personally find Simple example that made my day: Search File -> insert Cheers ✌️ |
It's unclear to me whether most people would be in favor of this change. Thanks for the PR though! If I see a groundswell of support I'll merge. |
Just my 2 cents, I tried snacks picker and am going to stick with it. The git log search picker alone has sold me on it. |
@yetyetanotherusername The question is not - "is this shiny and tasty and a thing I want". The question is "Is this something EVERY SINGLE NEW Neovim user MUST start with in order to have a good experience?" |
* The following content was translated from Chinese to English by AI. If there is any ambiguity or misinterpretation, please let me know. Could you record a short video and post it here to demonstrate how Based on the textual description and the repository README, I personally disagree with replacing
|
@SetsuikiHyoryu I've been a bit frustrated by the lack of screenshots/video or even any real exhaustive description on the Snack website as well. |
You can find some screenshots in the dedicated README for snacks.picker. Though I do agree it's still missing more screenshot and videos. |
I do agree that it would have been nicer if it was split into multiple plugins, I don't think it's a blocker for kickstart. If it was,
You don't have to configure anything to disable the other modules. They are all disabled by default, and need to be explicitly enabled in order to run.
In my opinion, the storage space difference is negligible. |
As discussed in by other people in this thread, there are more benefits to snacks.nvim then visual flare.
|
@oriori1703 Good to know, thanks! If more people chime in here and want it merged, I'll merge it! |
I agree with this. When last I looked, Telescope was rather moribund. I just need a few more people to chime in saying they want this and I'll merge. I realize screaming avoidance isn't a great way to run a project, but there we have it :) |
Taking another break from rying to maintain this repo :) There's NO ill will here on anyone's part, but this PR is an excellent example of why trying to run this project is SUPER hard. <existing users, rightly, ask WHY DO WE NEED BRIGHT SHINY?> <PR author says - SHINY!> Chaos ensues :) |
I'm opposed to be using snacks personally. I'm personally using fzf-lua but I've used snacks. But I don't really see much benefit over Telescope. The idea that the "big neovim distribution uses it" Is not really true to my knowledge. Lazyvim recently swapped to fzf-lua, though it has options for both Telescope and Snacks pickers. NvChad uses Telescope and astro uses snacks. It might "technically" be an marginal improvement. Telescope is far more integrated in plugins. I just don't see substantial benefit. Telescope is better documented as of now. And the way telescope is configured right now just showcases more aspects of configuration. On another note. If you do add it doing it like this: config = function()
vim.keymap.set('n', '<leader>sf', snacks.find, { desc = "[S]earch [F]iles" }) It is just more compact. Since rn you are adding more code than removing in the commit. |
If I understand correctly, according to this reddit post, Lazyvim switched again, and uses snack.picker by default for new installtions (for new installs it stills uses fzf-lua until the user opts in). |
I followed the examples in the from the README for the keybinds. Also this could also be more compact if #1484 is merged (which I originally used when I opend this PR) |
My opinion exactly. I would also be in favor of swapping to
Since all 'Snacks' or sub-plugins are opt-in rather than opt-out I think this wouldn't cause an issue |
I'm another a longtime kickstart user who moved from Telescope to snacks.picker. Telescope has a lot of issues (only one of which is performance) that snacks.picker does not. I strongly recommend removing Telescope from kickstart—it's caused me a lot of frustration. |
If there is going to be a change of the picker I would strongly suggest considering fzf-lua first. This plugin is very well maintained, it has nice defaults (important as it aligns with kickstart philosophy for minimal setup for new users) but it is also incredibly customizable and has superb performance as it uses fzf. Not only that, but also fzf is a tool that many users already use in their terminal even if they are new to neovim, so starting with fzf-lua is a seamless transition. LazyVim migrated to fzf-lua, then went for snacks, obviously because for folke it would be easier to maintain LazyVim if he is maintaining his own picker and can make everything work better together as a distro if he has control over the plugins as well, but that doesn't mean fzf-lua is worst than snacks in any way. Personally, I migrated to fzf-lua long time ago when I had problems with my Telescope crashing on repositories with big files and I've been using it ever since. I also tried the snacks picker out of curiosity but I just find fzf-lua more robust. One more thing, fzf-lua has some pre-defined profiles you can use and one of them is the telescope profile where, as it's documented, they try their best to get the closest match to telescope defaults in look and feel and keybinds. This is also important if kickstart offers a smooth migration from Telescope to fzf-lua optionally. |
snacks.picker has that too under layout.preset, i.e. picker = {
layout = { preset = "telescope" },
} and since I'm commenting here already, I might as well chime in too.
If we're strictly speaking about functionality, I don't think there's much if any difference regarding telescope vs snacks.picker. Sure snacks has more features OOTB, but telescope can be extended to match those features by adding more plugins. I believe what's valuable here is that, in addition to picker, snacks comes with a lot more modules that could potentially replace existing plugins in kickstart. One example is replacing |
I think so too, I merged this MR to my config, and with this I could replace neo-tree, telescope, and toggleterm. So this makes my config much leaner. With mini and snacks, even though they have some overlap, one can make a very lean but functional ide config. So I'm all for this change. |
I have a feeling that "Swiss army knife" distributions like mini and snacks might not be the best fit for a project like Kickstart. In my view, Kickstart aims to be as minimal as possible to avoid unnecessary noise. On the other hand, distributions like mini and snacks provide a lot out of the box, and it’s not always clear where to draw the line when it comes to enabling new features. For example:
Neo-tree is disabled by default, and toggleterm isn’t even part of the current Kickstart setup. I’m pretty sure there are plenty of other cool features included, but they feel out of scope for a minimal base like Kickstart. Another reason I’m personally not a fan of "Swiss army knife" packages is that they tend to clutter package manager updates with unrelated logs. In my opinion, if we had something like the snacks picker as a standalone package, that might be a better approach. |
Switch from
telescope
tosnacks.nvim
.Benefits of snacks compiled from the comments:
I just switched my config to use snacks instead of telescope, so I'm opening a PR in case it interests anyone else.
I know that this might be controversial because both Kickstart and telescope were create by teej (which did an awesome job on both BTW), so feel free to close this if you feel it doesn't suite the project.
Also, if you want, we can also easily use
snacks.explorer
andsnacks.indent
to replaceneo-tree
andindent-blanklines