An extension for telescope.nvim that allows you to insert simple, predefined text.
TODO
Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'jvgrootveld/telescope-simple-insert'
You can setup the extension by adding the following to your config:
require'telescope'.load_extension('simple_insert')
And by creating one or more json
source files in the directory data/simple-insert-sources/
with format:
[
{ "display": "Item to search", "insert" : "Item to insert" },
{ "display": "Other item to search", "insert" : "Other item to insert" }
]
Select predefined entry to insert.
require'telescope'.extensions.simple_insert.select{}
vim.api.nvim_set_keymap(
'n',
'<leader>i',
":lua require'telescope'.extensions.simple_insert.select{}<CR>",
{noremap = true, silent = true}
)
<c-o>
: Open source file or show a select window if multiple source files are present.
Some ideas to add
- Add functionality to create new source file.
- Insert entry at the end of the current line on mapping.
If you have any ideas to add to this plugin, please create an issue!