Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/axkirillov/easypick.nvim
A neovim plugin that lets you easily create Telescope pickers from arbitrary console commands
https://github.com/axkirillov/easypick.nvim
cli lua neovim neovim-plugin nvim nvim-plugin telescope telescope-extension
Last synced: 3 days ago
JSON representation
A neovim plugin that lets you easily create Telescope pickers from arbitrary console commands
- Host: GitHub
- URL: https://github.com/axkirillov/easypick.nvim
- Owner: axkirillov
- License: mit
- Created: 2022-06-27T11:21:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-08T09:26:50.000Z (12 days ago)
- Last Synced: 2025-02-09T14:04:43.521Z (10 days ago)
- Topics: cli, lua, neovim, neovim-plugin, nvim, nvim-plugin, telescope, telescope-extension
- Language: Lua
- Homepage:
- Size: 27.3 KB
- Stars: 394
- Watchers: 4
- Forks: 10
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim - axkirillov/easypick.nvim - Easypick lets you easily create Telescope pickers from arbitrary console commands. (Fuzzy Finder / PHP)
README
# easypick.nvim
Easypick is a neovim plugin that lets you easily create Telescope pickers (see [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)) from arbitrary console commands.# installation
```lua
use {'axkirillov/easypick.nvim', requires = 'nvim-telescope/telescope.nvim'}
```# configuration
```lua
local easypick = require("easypick")-- only required for the example to work
local get_default_branch = "git remote show origin | grep 'HEAD branch' | cut -d' ' -f5"
local base_branch = vim.fn.system(get_default_branch) or "main"easypick.setup({
pickers = {
-- add your custom pickers here
-- below you can find some examples of what those can look like-- list files inside current folder with default previewer
{
-- name for your custom picker, that can be invoked using :Easypick (supports tab completion)
name = "ls",
-- the command to execute, output has to be a list of plain text entries
command = "ls",
-- specify your custom previwer, or use one of the easypick.previewers
previewer = easypick.previewers.default()
},-- diff current branch with base_branch and show files that changed with respective diffs in preview
{
name = "changed_files",
command = "git diff --name-only $(git merge-base HEAD " .. base_branch .. " )",
previewer = easypick.previewers.branch_diff({base_branch = base_branch})
},-- list files that have conflicts with diffs in preview
{
name = "conflicts",
command = "git diff --name-only --diff-filter=U --relative",
previewer = easypick.previewers.file_diff()
},
}
})
```# usage
After the setup is called the Easypick command becomes available with all your pickers added to tab completion.
Running the :Easypick command with no arguments should result in the picker picker being called
## one-off picker
A one off picker can be created by calling`require('easypick').one_off('type your command here')`
This will open up a picker just for the typed in command with default selection action and previewer
## actions
The default action opens a file. Specify the `action` field in your picker config if you want a custom action.`easypick.actions.nvim_commandf(template)` takes a template string and inserts the selected entry at the `%s` position, then executes the command.
For example `'!make %s'` will insert the entry at `%s` position and execute the corresponding command
# recipes
More recipes are available in [wiki](https://github.com/axkirillov/easypick.nvim/wiki)