2024-02-13 06:20:51 +00:00
|
|
|
local codesnap = require("codesnap")
|
2024-02-13 06:05:36 +00:00
|
|
|
|
2024-04-02 10:18:37 +00:00
|
|
|
local function take_snapshot(take_snapshot_function)
|
|
|
|
return function(detail)
|
|
|
|
local args = detail.fargs
|
2024-02-19 14:27:17 +00:00
|
|
|
|
2024-04-02 10:18:37 +00:00
|
|
|
take_snapshot_function(args[1])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
vim.api.nvim_create_user_command("CodeSnap", take_snapshot(codesnap.copy_into_clipboard), { nargs = "*", range = "%" })
|
|
|
|
|
|
|
|
vim.api.nvim_create_user_command("CodeSnapSave", take_snapshot(codesnap.save_snapshot), { nargs = "*", range = "%" })
|