kiyoon / telescope-insert-path.nvim

Insert file path on the current buffer using Telescope.nvim
MIT License
32 stars 4 forks source link

load as extension #7

Closed qrockz closed 11 months ago

qrockz commented 11 months ago

Hi,

how can I register and load your nice extension with load_extension ?

kiyoon commented 11 months ago

It doesn't really behave like an extension of Telescope, but rather it provides nice action functions you can easily map to Telescope.

qrockz commented 11 months ago

It doesn't really behave like an extension of Telescope, but rather it provides nice action functions you can easily map to Telescope.

I know, but is it possible to register it as extension?

Like:

local path_actions = require("telescope_insert_path")
    require("telescope").setup({
        extensions = {
            mappings = {
                n = {
                    ["["] = path_actions.insert_reltobufpath_visual,
                },
            },
        },
    })

require('telescope').load_extension 'telescope_insert_path'

something like this? I'm just curios.

kiyoon commented 11 months ago

Maybe it can if you change the structure of the directory and follow extension-like codes. It's been a long time since I read about it and I forgot how it works