A nvim plugin which searches a file and runs a command on it
Find and run a test in a split.
nnoremap <C-t> <cmd>lua require('zond').find_and_run({ title = 'Run a test', filter = '.spec.ts$', cmd = 'vsplit term://npx jest %s' })<cr>
- nvim-telescope/telescope.nvim is required.
Using vim-plug
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.0' }
Plug 'mrded/nvim-zond'
Using dein
call dein#add('nvim-telescope/telescope.nvim', { 'rev': '0.1.0' })
call dein#add('mrded/nvim-zond')
Using packer.nvim
use {
'mrded/nvim-zond',
requires = { {'nvim-telescope/telescope.nvim', tag = '0.1.0'} }
}
require('zond').find_and_run({
title = 'Run a test', -- (optional) a modal title.
filter = '.spec.ts$', -- (optional) a regex filter for the file search.
cmd = 'vsplit term://npx jest %s' -- a command to be run. %s will be replaced with a file path.
})