Commit graph

37 commits

Author SHA1 Message Date
Folke Lemaitre
d0a0046e37
fix(picker.lsp): lazy resolve item lsp locations. Fixes #650 2025-01-20 09:56:12 +01:00
Folke Lemaitre
83baea06d6
feat(picker.buffer): add filetype to bufname for buffers without name 2025-01-19 23:40:36 +01:00
Folke Lemaitre
70106a7930
fix(picker.buffers): add buf number to text 2025-01-19 22:34:57 +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
eb0e5b7efe
fix(picker.lsp.symbols): only include filename for search with workspace symbols
Some checks failed
CI / ci (push) Failing after 0s
2025-01-19 18:30:18 +01:00
Folke Lemaitre
79d27f19dc
fix(picker.lsp): added support for single location result 2025-01-19 18:14:06 +01:00
Folke Lemaitre
50f3c3e5b1
feat(picker): added support for live args for grep and files. Closes #601 2025-01-19 17:54:25 +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
8563dfce68
feat(picker): added git_branches picker. Closes #614 2025-01-19 16:24:35 +01:00
Folke Lemaitre
903431903b
fix(picker.git): git log file/line for a file not in cwd. Fixes #616 2025-01-19 14:22:30 +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
320a4a62a1
feat(picker.frecency): cleanup old entries from sqlite3 database 2025-01-18 11:35:23 +01:00
Folke Lemaitre
c45a94044b
fix(picker.list): newlines in text. Fixes #607. Closes #580 2025-01-18 10:37:00 +01:00
Folke Lemaitre
a01e0f5368
fix(picker.proc): correct offset for carriage returns. Fixes #599 2025-01-18 09:47:11 +01:00
Folke Lemaitre
74feefc522
feat(picker.smart): better frecency bonus 2025-01-17 23:46:06 +01:00
Kristijan Husak
43c312dfc1
fix(picker): show all files in git status (#586)
## Description

When new folder is created in a git project, and there are files inside,
git status picker only shows the folder without any preview. Adding
`-uall` to the commands lists them all.

## Related Issue(s)



## Screenshots

Before: 

![screenshot_2025_01_17_15_42_14](https://github.com/user-attachments/assets/e556f563-dc63-472e-9543-bc784e6e1a35)

After: 

![screenshot_2025_01_17_15_43_13](https://github.com/user-attachments/assets/d6b6d715-02fd-4c77-b167-5c62058153dc)
2025-01-17 20:41:13 +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
c43969dabd
feat(picker): use an sqlite3 database for frecency data when available 2025-01-16 23:59:08 +01:00
Folke Lemaitre
1481a90aff
fix(picker.git): git_file and git_line should only show diffs including the file. Fixes #522 2025-01-16 23:21:49 +01:00
Folke Lemaitre
40d08bd901
fix(picker): preview / lsp / diagnostics positions were wrong; Should all be (1-0) indexed. Fixes #543 2025-01-16 22:56:56 +01:00
Folke Lemaitre
4823f2da65
fix(picker.files): ignore errors since it's not possible to know if the error isbecause of an incomplete pattern. Fixes #551 2025-01-16 22:31:34 +01:00
Folke Lemaitre
1534f24da9
style(picker): cleanup 2025-01-16 13:03:41 +01:00
Folke Lemaitre
772f3e9b89
feat(picker): added smart picker 2025-01-16 13:01:05 +01:00
Folke Lemaitre
de01218d1d
style(picker.git): lua annotations 2025-01-16 09:58:57 +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
a2fb70e8ba
fix(picker.git): use Snacks.git.get_root instead vim.fs.root for backward compatibility 2025-01-15 21:18:52 +01:00
Kristijan Husak
2cc7cf42e9
fix(picker): set correct cwd for git status picker (#505)
## Description

Cwd was wrong for git status picker.

## Related Issue(s)

- Fixes #504
2025-01-15 20:44:04 +01:00
Folke Lemaitre
96ffaba71b
feat(picker.recent): include open files in recent files. Closes #487 2025-01-15 17:59:01 +01:00
Folke Lemaitre
b15e2585eb
style(picker): more useful transform 2025-01-15 10:59:26 +01:00
Folke Lemaitre
b45d12ce78
style(picker): recent is alias for recent_files 2025-01-15 10:59:04 +01:00
Folke Lemaitre
000db17bf9
feat(picker): added preliminary support for combining finder results. More info coming soon 2025-01-15 10:58:31 +01:00
Folke Lemaitre
ae2de9aa81
fix(grep): explicitely set --no-hidden because of the git filter 2025-01-15 09:53:52 +01:00
Folke Lemaitre
fc06a363b9
fix(lsp): use treesitter highlights for LSP locations 2025-01-15 09:33:18 +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