add a way to copy pytest <fn> -N <cw> to clipboard

This commit is contained in:
Michael Peters 2024-10-16 16:45:17 -07:00
parent 79a2d63604
commit a16b913719

View File

@ -16,3 +16,12 @@ local function gitblame_toggle_summary()
end
vim.api.nvim_create_user_command('GitBlameToggleSummary', gitblame_toggle_summary, {})
-- Copy pytest <filename> -N <current word> to Clipboard
local function copy_pytest_command()
local fp = vim.fn.expand('%:~:.')
local word = vim.fn.expand('<cword>')
vim.fn.setreg('+', 'pytest ' .. fp .. ' -N ' .. word)
end
vim.api.nvim_create_user_command('P', copy_pytest_command, {})