picker.nvim is a highly customizable and extensible Neovim fuzzy finder plugin
- use nvim-plug
require("plug").add({
{
"wsdjeg/picker.nvim",
config = function()
require("picker").setup({
window = {
width = 0.8, -- set picker screen width, default is 0.8 * vim.o.columns
height = 0.8,
col = 0.1,
row = 0.1,
current_icon = ">",
current_icon_hl = "CursorLine",
enable_preview = false,
preview_timeout = 500,
},
highlight = {
matched = "Tag",
},
prompt = {
position = "bottom", -- set prompt position, bottom or top
icon = ">",
icon_hl = "Error",
insert_timeout = 100,
title = true, -- display/hide source name
},
mappings = {
close = "<Esc>",
next_item = "<Tab>",
previous_item = "<S-Tab>",
open_item = "<Enter>",
toggle_preview = "<C-p>",
},
})
end,
},
})- fuzzy finder picker source.
run :Picker command without source name.
:Picker
- open picker source.
run :Picker command with a name of source.
:Picker <name>
- specific default input
with --input option, users also can specific default input text.
:Picker file --input=foo
or use <cword> for word under cursor.
:Picker help_tags --input=<cword>
| key binding | description |
|---|---|
Tab |
next item |
S-Tab |
previous item |
Enter |
default action |
Esc |
close picker |
builtin sources:
| source | description |
|---|---|
| files | files in current dir |
| async_files | async files source, require job.nvim |
| colorscheme | all colorschemes |
| buftags | ctags outline for current buffer |
| buffers | listed buffers |
| lines | lines in current buffer |
| help_tags | neovim help tags source |
| qflist | quickfix source |
| registers | registers context |
| jumps | jump list |
| marks | marks list |
third party sources:
| source | description |
|---|---|
| mru | most recent used files, need mru.nvim |
| project | project history, need rooter.nvim |
| bookmarks | all bookmarks, need bookmarks.nvim |
| zettelkasten | zettelkasten notes source from zettelkasten.nvim |
| zettelkasten_tags | zettelkasten tags source from zettelkasten.nvim |
| git-branch | git branch source from git.nvim |
| music-player | music-player source form music-player.nvim |
| plug | plugins source for nvim-plug |
a source main module should be picker.sources.<name>,
that means you can create a custom source in lua/picker/sources/ directory in your plugin.
--- @class PickerSource
--- @field get function
--- @field default_action function
--- @field __results nil | table<string>
--- @field preview_win boolean
--- @field preview function
--- @field set function
--- @field actions? tablehow to disable nvim-cmp in picker.nvim buffer?
require("cmp").setup({
enabled = function()
if vim.bo.filetype == "picker-prompt" then
return false
end
return true
end,
})Like this plugin? Star the repository on GitHub.
Love this plugin? Follow me on GitHub.
If you encounter any bugs or have suggestions, please file an issue in the issue tracker
