The New Snacks Picker
Wow! This newsletter recently earned its 100th subscriber, which means I had to bump up to buttondown.email’s paid plan. I have received enough donations, ebook, and print book purchases that this was an easy decision (Thank you so much for the support!). Plus, I’ve been really happy with buttondown.email so I am happy to support them. I find it much more pleasant to use than the competing newsletter platforms I’ve tried, and recommend them if you ever want to spin up a newsletter of your own.
I originally set this newsletter up to announce new chapters as I was writing the book and never really intended it to survive past that. However, Folke keeps improving LazyVim, so I don’t think I’ll run out of content!
This week, he released a new picker as part of his Snacks.nvim package. It has all the best features of Telescope and the speed and performance of fzf.lua. It is not the default picker at this time, but it is a recommended extra.
This puts me in the situation I was in when fzf.lua came out where I have to either describe both pickers or be selective in what I recommend. I don’t have time to fully update the book right now (my new full-time job is more than full-time and I’m still working to help get writers interested in Fablehenge), so I’m planning to instruct new readers not to enable the snacks-picker recommended extra for now.
However, I am personally using the Snacks picker and I love and recommend it. For those of you comfortable with exploring LazyVim outside of the book’s recommendations, I encourage you to try it out!
The chief improvement from fzf-lua is that the Snacks picker has a true Normal mode. This means you can do the kinds of LazyVim things you know and love like web-based navigation and editing or putting yanked text in the picker’s input area. For those of you who read the earliest versions of the book, you may recall I preferred Telescope to fzf-lua because of its Normal mode, and when fzf-lua became the new default I was disappointed to lose it. Now I get to have my performance cake and eat my normal mode input area, too. What a great snack!
Some keybindings are different between the two. I don’t have space to go into the details, but reading through the win section of the Snacks picker default config should give you a good idea. There are a couple points I want to mention:
You can select multiple files using
. This was true of fzf-lua as well, but I only recently became aware of it due to an Errata submission (thank you!). If you select multiple files and hit enter, they will be opened in separate buffers accessible with the usual
. Similarly,control-q
andcontrol-t
will open only the selected files in quickfix or trouble.I close buffers from the Open buffer picker with
anddd
, but you can also usecontrol-x
.Snacks doesn’t seem to have a built-in way to jump to a specific line in the results, but you can easily use
ands
to go into the usual “Seek Text” flow.
Hopefully that’s enough to get everybody started. Remember, you can switch back to the default fzf-lua picker by simply disabling the snacks_picker extra.