mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
feat(picker.files): added ft
option to filter by extension(s)
This commit is contained in:
parent
d56cd48e4c
commit
12a7ea28b9
5 changed files with 25 additions and 2 deletions
|
@ -49,8 +49,8 @@ Open the repo of the active file in the browser (e.g., GitHub)
|
|||
end
|
||||
vim.ui.open(url)
|
||||
end,
|
||||
---@type "repo" | "branch" | "file" | "commit"
|
||||
what = "file", -- what to open. not all remotes support all types
|
||||
---@type "repo" | "branch" | "file" | "commit" | "permalink"
|
||||
what = "commit", -- what to open. not all remotes support all types
|
||||
branch = nil, ---@type string?
|
||||
line_start = nil, ---@type number?
|
||||
line_end = nil, ---@type number?
|
||||
|
@ -73,16 +73,19 @@ Open the repo of the active file in the browser (e.g., GitHub)
|
|||
["github%.com"] = {
|
||||
branch = "/tree/{branch}",
|
||||
file = "/blob/{branch}/{file}#L{line_start}-L{line_end}",
|
||||
permalink = "/blob/{commit}/{file}#L{line_start}-L{line_end}",
|
||||
commit = "/commit/{commit}",
|
||||
},
|
||||
["gitlab%.com"] = {
|
||||
branch = "/-/tree/{branch}",
|
||||
file = "/-/blob/{branch}/{file}#L{line_start}-L{line_end}",
|
||||
permalink = "/-/blob/{commit}/{file}#L{line_start}-L{line_end}",
|
||||
commit = "/-/commit/{commit}",
|
||||
},
|
||||
["bitbucket%.org"] = {
|
||||
branch = "/src/{branch}",
|
||||
file = "/src/{branch}/{file}#lines-{line_start}-L{line_end}",
|
||||
permalink = "/src/{commit}/{file}#lines-{line_start}-L{line_end}",
|
||||
commit = "/commits/{commit}",
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1221,6 +1221,7 @@ FILES *snacks-picker-sources-files*
|
|||
---@field follow? boolean follow symlinks
|
||||
---@field exclude? string[] exclude patterns
|
||||
---@field args? string[] additional arguments
|
||||
---@field ft? string|string[] file extension(s)
|
||||
---@field rtp? boolean search in runtimepath
|
||||
{
|
||||
finder = "files",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue