Neovim Telescope Plugin Development Setup
This needs a write up but here's the code in the mean time.
Directory Structure
~/Desktop/extension_name
└── lua
└── telescope
└── _extensions
└── extension_name.lua
Extension File
local pickers = require "telescope.pickers"
local finders = require "telescope.finders"
local run_extension = function()
pickers.new({}, {
prompt_title = "grimoire",
finder = finders.new_table {
results = { "red", "green", "blue" }
},
}):find()
end
return require("telescope").register_extension {
exports = {
extension_name = run_extension
},
}
Configuration Setup
require('lazy').setup({
{ dir = "~/Desktop/extension_name" },
-- other plugins
}, {})
pcall(require('telescope').load_extension, 'extension_name')
Notes
- The docs show moving the code for the plugin to other files. I haven't had a problem keeping it directly in this file for small processes.
- docs https://github.com/nvim-telescope/telescope.nvim/blob/master/developers.md
-- end of line --