Skip to content
프로젝트

소개

임의의 콘솔 명령으로 Telescope 피커를 쉽게 만들 수 있는 Neovim 플러그인입니다.

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

easypick.nvim

Easypick is a neovim plugin that lets you easily create Telescope pickers (see telescope.nvim) from arbitrary console commands.

installation

use {'axkirillov/easypick.nvim', requires = 'nvim-telescope/telescope.nvim'}

configuration

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 <name> (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.

image

Running the :Easypick command with no arguments should result in the picker picker being called image

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

Lua API

You can call your created pickers using lua code in two ways

local pickers = { ... }
require("easypick").setup(pickers = pickers)
require("easypick").one("ls", pickers)
require("easypick").ls()

recipes

More recipes are available in wiki

관련 프로젝트 살펴보기

불러오는 중…