Skip to content
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

Opening selected project in Neogit #145

Open
Riyyi opened this issue Feb 11, 2024 · 0 comments
Open

Opening selected project in Neogit #145

Riyyi opened this issue Feb 11, 2024 · 0 comments

Comments

@Riyyi
Copy link

Riyyi commented Feb 11, 2024

I want to add the ability to open Neogit from the selected project in Telescope to my config.
My first idea requires the ability to customize the Telescope mappings in projects.lua:

map("n", "v", my_neogit_function)
map("i", "<c-v>", my_neogit_function)

Another way would be via my own mapping, which makes a new Telescope picker.
But to keep the presentation of the items the same as the extension,
the create_finder function would need to be exposed, maybe something like this?

diff --git a/lua/telescope/_extensions/projects.lua b/lua/telescope/_extensions/projects.lua
index be35f4f..8d16bf9 100644
--- a/lua/telescope/_extensions/projects.lua
+++ b/lua/telescope/_extensions/projects.lua
@@ -176,5 +176,6 @@ end
 return telescope.register_extension({
   exports = {
     projects = projects,
+    create_finder = create_finder,
   },
 })

This allows me to do the folloing:

pickers.new({}, {
    finder = telescope.extensions.projects.create_finder(),
    -- etc..
}):find()

My preference would be the second option, if this change is acceptable I will make a pull request for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant