-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible to use with Lazy.nvim? #20
Comments
There might be a better way to do this, but adding |
Hi John, did you solve this problem? I don't use easypick anymore, but I had no problems with Lazy, when I did |
I'm having trouble getting this working with Lazy as well. My config is below. I'm able to invoke the return {
"axkirillov/easypick.nvim",
dependencies = "nvim-telescope/telescope.nvim",
config = function()
local easypick = require("easypick")
-- required for git pickers
local get_default_branch = "git rev-parse --symbolic-full-name refs/remotes/origin/HEAD | sed 's!.*/!!'"
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(),
},
},
})
end,
} |
Hello. I will paste my full easypick config here. -- get default branch
local default_branch = vim.fn.system("git rev-parse --symbolic-full-name refs/remotes/origin/HEAD | sed 's!.*/!!'") or
"main"
return {
'axkirillov/easypick.nvim',
branch = 'develop',
dependencies = 'nvim-telescope/telescope.nvim',
config = function()
local easypick = require("easypick")
easypick.setup({
pickers = {
{
name = "changed files",
command = "git diff --name-only $(git merge-base HEAD " .. default_branch .. " )",
previewer = easypick.previewers.branch_diff({ base_branch = default_branch })
},
{
name = "conflicts",
command = "git diff --name-only --diff-filter=U --relative",
previewer = easypick.previewers.file_diff(),
},
}
})
local ns = { noremap = true, silent = true }
vim.keymap.set("n", "<C-p>", ":Easypick<CR>", ns)
end
} |
For me it works. The only problem I sometimes have, is that in some repos |
Actually, this command works reliably for me |
@jondkinney easypick is not a telescope extension, so you don't need this line require("telescope").load_extension "easypick" |
Hi @axkirillov thanks for your reply. I've tried both your original suggestion and replacing the Is there any more information I can provide to help debug this? I am on Windows using Neovim v0.10.2. |
@russell-knight what happens, when you do |
I can't figure out the right config to get the plugin to load properly within the context of my AstroNvim setup using the Lazy.nvim plugin manager.
Lazy shows that easypick is loaded, but
:Easypick
isn't an available user command to run.Here's the current config I'm trying to use:
Any pointers would be greatly appreciated!
The text was updated successfully, but these errors were encountered: