Commit graph

85 commits

Author SHA1 Message Date
Folke Lemaitre
3d695ab7d0
feat(picker.git): added all option to also list remote branched for git_branches. Closes #1465 2025-03-01 09:48:31 +01:00
Folke Lemaitre
c864a7d378
feat(picker.input): added some ctrl+r keymaps similar to cmdline. Closes #1420 2025-02-25 13:53:12 +01:00
Folke Lemaitre
4551f499c7
fix(picker): go back to last window on cancel instead of main 2025-02-20 06:24:06 +01:00
Folke Lemaitre
570c035b94
fix(picker.actions): better set cmdline. Closes #1291 2025-02-18 23:00:02 +01:00
Folke Lemaitre
b39a3ba40a
fix(picker.git): better handling of multi file staging 2025-02-13 20:27:29 +01:00
Folke Lemaitre
f6a807da6d
feat(picker.actions): option to disable notify for yank action. Closes #1117 2025-02-13 11:59:24 +01:00
Folke Lemaitre
eae55e7ca3
fix(picker.actions): reverse prev/next on select with a reversed list layout. Closes #1124 2025-02-13 11:55:37 +01:00
Folke Lemaitre
e326de9e0c
fix(picker.actions): check that plugin exists before loading it in help. Closes #1134 2025-02-13 11:43:07 +01:00
Folke Lemaitre
1491b543ef
fix(picker.actions): don't delete empty buffer when its in another tabpage. Closes #1005
Some checks failed
CI / ci (push) Failing after 0s
2025-02-12 18:48:45 +01:00
Folke Lemaitre
9ab6637df0
fix(picker.actions): use vim.v.register instead of + as default. 2025-02-10 20:47:31 +01:00
Folke Lemaitre
593adccd90
refactor(picker): refactor all the things 2025-02-10 20:26:14 +01:00
Folke Lemaitre
3841a8705a
fix(picker.help): make sure plugin is loaded for which we want to view the help 2025-02-10 14:56:50 +01:00
Folke Lemaitre
a17788539a
feat(picker.actions): cmd action now always allows to edit the command. Closes #1033
Some checks failed
CI / ci (push) Failing after 0s
2025-02-09 17:34:55 +01:00
Folke Lemaitre
a386e4270b
feat(picker.actions) list up/down now use count. Closes #1021
Some checks failed
CI / ci (push) Failing after 0s
2025-02-08 22:07:22 +01:00
Folke Lemaitre
3baf95d3a1
feat(picker.undo): ctrl+y to yank added lines, ctrl+shift+y to yank deleted lines 2025-02-07 21:58:34 +01:00
Folke Lemaitre
811a24cc16
feat(picker.undo): added ctrl+y to yank added lines from undo 2025-02-07 10:21:18 +01:00
Folke Lemaitre
81f90062c5
feat(explorer): added ctrl+t to open a terminal in the item's directory 2025-02-07 09:10:10 +01:00
Folke Lemaitre
71eae96bfa
fix(picker): exit insert mode before closing with <c-c> to prevent cursor shifting left. Close #956 2025-02-06 07:13:52 +01:00
Ian Liu
337a3ae7ee
feat(picker.git): add confirmation before deleting a git branch (#951)
## Description

A minor update to add a confirmation dialogue before deleting a branch
in `git_branches`.

## 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. -->

---------

Co-authored-by: Ian Liu <ian.liu@tupl.com>
2025-02-05 22:02:12 +01:00
Ian Liu
8676c409e1
feat(picker.git): add create and delete branch to git_branches (#909)
Some checks failed
CI / ci (push) Failing after 0s
## Description

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

This PR adds two actions: `git_create_branch` and `git_delete_branch`.
They are aimed to be included in the `git_branches` picker to easily
create/delete git branches with custom keymaps.

## 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. -->

---------

Co-authored-by: Ian Liu <ian.liu@tupl.com>
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-02-05 20:01:44 +01:00
Folke Lemaitre
27cba535a6
feat(picker): pin picker as a split to left/bottom/top/right with ctrl+z+(hjkl) 2025-02-05 07:13:15 +01:00
Folke Lemaitre
4b9ea98007
fix(picker.actions): don't reuse_win in floating windows (like the picker preview) 2025-02-04 23:34:56 +01:00
jdrouhard
6d3c135235
fix(picker.actions): fix qflist position (#911)
vim.fn.setqflist() and vim.fn.setloclist() use (1,1)-indexing, but
vim.api.nvim_win_set_cursor() uses (1,0)-indexing. Adjust for this when
sending items to qflist/loclist.
2025-02-04 21:56:18 +01:00
Folke Lemaitre
762821e420
fix(picker.actions): close preview before buffer delete
Some checks failed
CI / ci (push) Failing after 0s
2025-02-03 15:22:21 +01:00
Folke Lemaitre
95d3e7f961
fix(picker.actions): get win after splitting or tabnew. Fixes #896 2025-02-03 14:26:54 +01:00
Folke Lemaitre
abc0bbd160
refactor(picker.actions): generic picker action 2025-02-03 13:03:22 +01:00
Anton Kastritskii
62d99ed2a3
feat(picker.commands): do not autorun commands that require arguments (#879)
## Description

Currently when you use picker.commands to select a command that requires
an argument, it will cause an error. `:BlickCmd` is one example. To
avoid the error we can feed the keys to enter the command mode and
populate the command and leave it to the user what they want to do.

This is also what telescope
[does](415af52339/lua/telescope/builtin/__internal.lua (L399))
in its builtin command picker.

nargs values `*` or `?` mean that the command can be executed both with
arguments and without. I think it is safer to leave it to the user to
decide if they want them to either trigger a run or provide the
arguments. But happy to change it if you think running the commands by
default makes sense.

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-02-02 22:16:41 +01:00
Folke Lemaitre
3d2a07503f
feat(picker.projects): default to tcd instead of cd 2025-02-02 19:28:55 +01:00
Folke Lemaitre
6f8f0d3c72
feat(picker.projects): projects now automatically processes dev folders and added a bunch of actions/keymaps. Closes #871 2025-02-02 16:09:00 +01:00
Folke Lemaitre
4a50291448
fix(picker.list): better virtual scrolling that works from any window 2025-02-01 23:40:07 +01:00
Folke Lemaitre
2946875af0
fix(picker.actions): reworked split/vsplit/drop/tab cmds to better do what's intended. Closes #854 2025-02-01 16:32:03 +01:00
Folke Lemaitre
f0f053a1d9
fix(picker): better main window management. Closes #842 2025-02-01 11:26:19 +01:00
Jiahe Jiang
de16b44f97
fix(picker): enforce bottom positioning for quickfix and location lists (#845)
## Description

This PR addresses an issue where the quickfix list (qflist) would open
on the left side of the screen when using vertical splits. By replacing
the default :copen command with :botright copen, this update ensures
that the qflist consistently opens at the bottom, regardless of the
current window layout.

## Reproduce:

1. Open Neovim: Start Neovim normally.
2. Create a Vertical Split
3. Use picker to pick anything
4. Press <c-q> to send them to quickfix list

```lua
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

vim.g.mapleader = " "

require("lazy.minit").repro({
	spec = {
		{
			"Isrothy/snacks.nvim",
			branch = "bottom-positioning-for-qf",
			lazy = false,
			keys = {
				{
					"<LEADER>ff",
					function()
						Snacks.picker.files()
					end,
					desc = "Files",
				},
			opts = {},
		},
		-- add any other plugins here
	},
})

```

## Screenshots

before:
<img width="1439" alt="Screenshot 2025-01-31 at 23 48 59"
src="https://github.com/user-attachments/assets/d21b9668-ff4d-4464-84b4-48c47c48153a"
/>

after:
<img width="1438" alt="Screenshot 2025-01-31 at 23 50 11"
src="https://github.com/user-attachments/assets/6aba0840-2125-4336-92e2-7152e8669aa6"
/>
2025-02-01 06:56:06 +01:00
Folke Lemaitre
d962d5f335
fix(picker.actions): tab -> tabnew. Closes #842 2025-02-01 06:51:51 +01:00
Folke Lemaitre
6dbc26757c
fix(picker): make pick_win work with split layouts. Closes #834 2025-01-31 19:14:16 +01:00
Folke Lemaitre
ae897f329f
feat(picker.lines): jump to first position of match. Closes #806 2025-01-31 14:13:36 +01:00
Folke Lemaitre
ff022416dd
fix(picker.actions): fix split/vsplit/tab. Closes #818 2025-01-31 13:48:30 +01:00
Folke Lemaitre
b37ea748b6
fix(picker): no need to track jumping 2025-01-31 06:11:03 +01:00
Folke Lemaitre
f40f338d66
fix(picker): make jumping work again... 2025-01-31 00:06:50 +01:00
Folke Lemaitre
87dab7eca7
fix(picker): show help for input / list window with ?. 2025-01-30 23:06:51 +01:00
Folke Lemaitre
15a94117e1
fix(picker): add proper close 2025-01-30 22:57:54 +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
4e7356c9ad
refactor(picker.actions): move pick_win to util so it can be used outside the picker. Closes #623 2025-01-30 21:04:05 +01:00
Folke Lemaitre
ba5a70b84d
fix(picker.actions): when only 1 win, pick_win will select that automatically. Show warning when no windows. See #623 2025-01-30 20:57:17 +01:00
Folke Lemaitre
94a04062ea
style(picker): remove debug :) 2025-01-30 19:12:45 +01:00
Folke Lemaitre
a998c714c3
fix(picker): only do preview scrolling when preview is scrolling and removed default preview horizontal scrolling keymaps 2025-01-30 18:17:32 +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
3564f4fede feat(picker.actions): separate edit_split etc in separate split and edit actions. Fixes #791 2025-01-30 17:56:14 +01:00
Folke Lemaitre
7f0cde31c4 refactor(picker.input): do startinsert when entering the input window 2025-01-30 17:56:14 +01:00
Folke Lemaitre
ad8f16632c
feat(picker): added support to keep the picker open when focusing another window (auto_close = false) 2025-01-29 18:05:48 +01:00