-
-
Notifications
You must be signed in to change notification settings - Fork 300
Description
Is your feature request related to a problem? Please describe.
I created a telescope plugin for myself that takes a filepath and presents options to open it in the current window, new tab, vsplit left, vsplit right, split above, and split below. Ideally, I would like to get the filepath that was selected from the lspsaga finder UI to open up my telescope picker to choose the desired action. This would normalize my bindings across neovim while reducing steps to remember.
Describe the solution you'd like
There's two options that could work:
- Support something like the following:
require("lspsaga").setup({ finder = { keys = { "<cr>" = function (filepath) ... end }, }, })
- Create module-level functions for common actions that one could replace with their own implementations. Less ideal monkey-patching actions but it would work, and I have an emacs-inspired advising system that would make it more manageable.
telescope = require('telescope') telescope.actions.open = function (filepath) telescope._extensions.find_menu.find_menu({ filepath = filepath }) end
Describe alternatives you've considered
I looked at the finder implementation and saw that it's mostly iterating the config settings for keys, so was thinking I could do something like the following:
require("lspsaga").setup({
finder = {
keys = {
"Telescope file_menu filepath=" = "<CR>",
},
},
})
But that doesn't seem to work, I'll have to check but maybe unsupported commands are stripped from the config?
I could fork it and make my changes, but then I'll have to be on top of your upstream changes and I'd much rather try and find a way to make lspsaga better than create a worse version of it.
Additional context
Open to alternative ideas here!