Skip to content

wsdjeg/picker.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

picker.nvim

picker.nvim is a highly customizable and extensible Neovim fuzzy finder plugin

GPLv3 License

picker-neovim

Installation

require("plug").add({
	{
		"wsdjeg/picker.nvim",
		config = function()
			require("picker").setup({
				window = {
					width = 0.8,
					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", --- bottom or top
					icon = ">",
					icon_hl = "Error",
				},
				mappings = {
					close = "<Esc>",
					next_item = "<Tab>",
					previous_item = "<S-Tab>",
					open_item = "<Enter>",
					toggle_preview = "<C-p>",
				},
			})
		end,
	},
})

Usage

  1. fuzzy finder picker source.

run :Picker command without source name.

:Picker
  1. open picker source.

run :Picker command with a name of source.

:Picker <name>
  1. 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 bindings

key binding description
Tab next item
S-Tab previous item
Enter default action
Esc close picker

Available sources

builtin sources:

source description
files files in current dir
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

Custom source

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? table

Self-Promotion

Like this plugin? Star the repository on GitHub.

Love this plugin? Follow me on GitHub.

Feedback

If you encounter any bugs or have suggestions, please file an issue in the issue tracker

Credits