Commit graph

91 commits

Author SHA1 Message Date
Folke Lemaitre
a13ff6fe0f
fix(picker): show_empty for files / grep. Closes #808 2025-01-31 06:23:08 +01:00
Folke Lemaitre
08b9083f47
feat(picker.explorer): added explorer_move action mapped to m 2025-01-30 22:02:51 +01:00
Folke Lemaitre
a9591ed43f
feat(picker.jump): added opts.jump.close, which default to true, but is false for explorer 2025-01-30 21:12:05 +01:00
Folke Lemaitre
db52796e79
feat(picker.explorer): live search 2025-01-30 19:11:37 +01:00
Folke Lemaitre
00613bd416 feat(picker): new file explorer Snacks.picker.explorer() 2025-01-30 17:56:14 +01:00
Folke Lemaitre
e16a6a4413 feat(picker): reworked toggles (flags). they're now configurable. Closes #770 2025-01-30 17:56:14 +01:00
Folke Lemaitre
7ad414e8a9 refactor(picker): indent/hierarchy => tree 2025-01-30 17:56:14 +01:00
Folke Lemaitre
d70af2d253
fix(picker.select): allow configuring vim.ui.select with the select source. Closes #776 2025-01-29 12:49:20 +01:00
Folke Lemaitre
04e2995bbf
fix(picker.preview): don't enable numbers when minimal=true 2025-01-28 19:32:07 +01:00
Folke Lemaitre
32cffd2e60
feat(picker): added notifications picker. Closes #738 2025-01-28 17:16:32 +01:00
Folke Lemaitre
bb3db117a4
feat(picker): added git_stash picker. Closes #762 2025-01-28 16:05:30 +01:00
Folke Lemaitre
08d4f14cd8
fix(picker): starting a picker from the picker sometimes didnt start in insert mode. Fixes #718 2025-01-23 19:36:50 +01:00
Folke Lemaitre
e6fb5381a9
feat(picker.git): git_log, git_log_file, git_log_line now do git_checkout as confirm. Closes #722 2025-01-23 19:18:20 +01:00
Folke Lemaitre
9e7bfc05d5
fix(picker.icons): opts.icons -> opts.icon_sources. Fixes #715 2025-01-23 13:12:56 +01:00
Folke Lemaitre
d03bd00ced
feat(picker): added lazy source to search for a plugin spec. Closes #680 2025-01-23 13:04:00 +01:00
Folke Lemaitre
9d5d3bdb17
feat(picker): added opts.rtp (bool) to find/grep over files in the rtp. See #680 2025-01-23 13:03:27 +01:00
Jorge Villalobos
b7c08df2b8
feat(picker.keymaps): add global + buffer toggles (#705)
## Description

This PR adds 2 actions to the `keymaps` picker, to toggle the `global`
and `local` options.

## Related Issue(s)

None.

## Screenshots


https://github.com/user-attachments/assets/3f4ca80a-b554-47a2-970b-15dc84f357d8
2025-01-23 10:57:16 +01:00
Folke Lemaitre
97898e910d
feat(picker): added new icons picker for nerd fonts and emoji. Closes #703 2025-01-23 10:51:17 +01:00
Folke Lemaitre
2762c37eb0
feat(picker.keymaps): improvements to keymaps picker 2025-01-23 09:14:29 +01:00
Folke Lemaitre
8b2c78a3bf
feat(picker.multi): multi now also merges keymaps 2025-01-23 00:29:28 +01:00
Folke Lemaitre
450d1d4d4c
feat(picker.smart): re-implemented smart as multi-source picker 2025-01-22 23:49:57 +01:00
Folke Lemaitre
efb6d1f8b8
feat(picker): syntax highlighting for command and search history 2025-01-22 23:49:55 +01:00
Jorge Villalobos
67fbab1bf7
feat(picker.smart): add bufdelete actions from buffers picker (#679)
## Description

This enables the ability to delete buffers directly from the `smart`
picker (or other combined pickers) by adding a check + warning to the
`bufdelete` action (ensuring it only operates on buffer items), and
adding the same `dd` and `<c-x>` mappings as the `buffers` picker.

## Related Issue(s)

TBD... searching.

## Screenshots


https://github.com/user-attachments/assets/6c5c4b5e-74ed-4778-9f31-a714f7da1853
2025-01-21 08:43:37 +01:00
Folke Lemaitre
40cea79697
fix(picker.undo): disable number and signcolumn in preview 2025-01-19 23:40:36 +01:00
Folke Lemaitre
781b6f6ab0
feat(picker): added args option for files and grep. Closes #621 2025-01-19 22:01:23 +01:00
Folke Lemaitre
5c45f1c193
feat(picker): added undo picker to navigate the undo tree. Closes #638 2025-01-19 21:54:18 +01:00
Folke Lemaitre
348307a82e
feat(picker.lsp): added lsp_workspace_symbols. Supports live search. Closes #473 2025-01-19 17:29:37 +01:00
Folke Lemaitre
c6c76a6aa3
fix(picker.diagnostics): sort on empty pattern. Fixes #641 2025-01-19 16:27:19 +01:00
Folke Lemaitre
8563dfce68
feat(picker): added git_branches picker. Closes #614 2025-01-19 16:24:35 +01:00
Folke Lemaitre
b170ced527
feat(picker): added spelling picker. Closes #625 2025-01-19 14:02:18 +01:00
Folke Lemaitre
ee988fa4b0
feat(picker.commands): added builtin commands. Fixes #634 2025-01-19 13:01:26 +01:00
Folke Lemaitre
84c3738fb0
feat(picker): added jump options jumplist(true for all), reuse_win & tagstack (true for lsp). Closes #589. Closes #568 2025-01-17 21:28:14 +01:00
Folke Lemaitre
192fb31c4b
feat(picker): added exclude option for files and grep. Closes #581 2025-01-17 14:35:29 +01:00
Folke Lemaitre
be421822d5
feat(picker.sources): lines just sorts by score/idx. Smart sorts on empty 2025-01-17 09:42:57 +01:00
Folke Lemaitre
772f3e9b89
feat(picker): added smart picker 2025-01-16 13:01:05 +01:00
Anton Kastritskii
cc69043689
feat(picker.git): added git_diff picker for diff hunks (#519)
Hi and thank you for the useful plugin!

## Description

I have been exploring the new picker api and got this git diff picker
working which I think can be a nice addition to the existing set of
picker. The key difference from the existing git_status picker is that
it separates each hunk into its own item similar to `git add --patch`
and when you select an item it takes you to the first hunk's line
instead of top of the buffer. Before I put more effort into it I would
like to see if this is a welcome change first.

This implementation can be further extended by allowing to support
additional arguments such as `--staged`, `--ignore-all-space` or both.

A few points on current implementations. I could not get the per line
parsing to work using the
`require("snacks.picker.source.proc").proc(...)` and fell back to
manually parsing the output after the command finished executing. There
are likely many ways to improve it. I have been using it with telescope
for about a year and so far it worked great. I think more people can
benefit from this picker.

## Related Issue(s)

none

## Screenshots

Demo


https://github.com/user-attachments/assets/6cdfa48e-bc29-4194-8430-092fbc5f3dcd

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-01-16 09:54:31 +01:00
Folke Lemaitre
2479ff7cf4
feat(picker.buffers): del buffer with ctrl+x 2025-01-16 08:54:30 +01:00
Folke Lemaitre
2ab18a0b9f
feat(picker.buffers): delete buffers with dd 2025-01-15 22:18:28 +01:00
Folke Lemaitre
0892db4f42
feat(picker.git): stage/unstage files in git status with <tab> key 2025-01-15 22:12:19 +01:00
Folke Lemaitre
0437cfd98e
feat(picker.grep): added ft (rg's type) and regex (rg's --fixed-strings) options 2025-01-15 06:34:31 +01:00
Folke Lemaitre
559d6c6bf2
feat(snacks): added snacks.picker (#445)
## Description

More info coming tomorrow.

In short:
- very fast. pretty much realtime filtering/sorting in huge repos (like
1.7 million files)
- extensible
- easy to customize the layout (and lots of presets) with
`snacks.layout`
- simple to create custom pickers
- `vim.ui.select`
- lots of builtin pickers
- uses treesitter highlighting wherever it makes sense
- fast lua fuzzy matcher which supports the [fzf
syntax](https://junegunn.github.io/fzf/search-syntax/) and additionally
supports field filters, like `file:lua$ 'function`

There's no snacks picker command, just use lua.

```lua
-- all pickers
Snacks.picker()

-- run files picker
Snacks.picker.files(opts)
Snacks.picker.pick("files", opts)
Snacks.picker.pick({source = "files", ...})
```

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Todo
- [x] issue with preview loc not always correct when scrolling fast in
list (probably due to `snacks.scroll`)
- [x] `grep` (`live_grep`) is sometimes too fast in large repos and can
impact ui rendering. Not very noticeable, but something I want to look
at.
- [x] docs
- [x] treesitter highlights are broken. Messed something up somewhere

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2025-01-14 22:53:59 +01:00