An extension for telescope.nvim to run scripts from your package.json
.
- Neovim >= 0.6
- telescope.nvim
Install with your preferred package manager, the following example uses packer:
use "luissimas/telescope-nodescripts.nvim"
You can explicitly load the extension (but you don't need to).
require("telescope").load_extension("nodescripts")
The picker can be called using the run
function:
require('telescope').extensions.nodescripts.run({})
No default keybindings are provided, you can set a keybinding for the extension like this:
vim.api.nvim_set_keymap("n", "<leader>fs", ":lua require('telescope').extensions.nodescripts.run({})<Enter>", {noremap = true, silent = true})
The extension can be configured using the extensions
key in telescope's setup function. Here's a example configuration using the default values:
require("telescope").setup {
extensions = {
nodescripts = {
command = "npm run", -- command to run your node scripts
display_method = "vsplit", -- window method to open the terminal
ignore_pre_post = true -- ignore pre and post scripts
}
}
}