diff --git a/lua/freeze-code/commands.lua b/lua/freeze-code/commands.lua index 8f3813b..439d895 100644 --- a/lua/freeze-code/commands.lua +++ b/lua/freeze-code/commands.lua @@ -1,6 +1,7 @@ local M = {} local utils = require("freeze-code.utils") +local config = require("freeze-code.config") local logger = utils.logger local os_utils = utils.os local is_win = os_utils.is_win @@ -92,6 +93,11 @@ end local copy_by_os = function(opts) local cmd = {} local filename = vim.fn.expand(opts.output) + if config.config.copy_cmd ~= "" then + local command = string.gsub(config.config.copy_cmd, "filename", filename) + cmd = { command } + return vim.fn.system(cmd) + end if vim.fn.executable("gclip") ~= 0 then cmd = { "gclip", "-copy", "-f", filename } return vim.fn.system(cmd) diff --git a/lua/freeze-code/config.lua b/lua/freeze-code/config.lua index 90f6820..ca48382 100644 --- a/lua/freeze-code/config.lua +++ b/lua/freeze-code/config.lua @@ -26,7 +26,7 @@ local default_config = { _installed = vim.fn.exepath("freeze") ~= "", install_path = vim.env.HOME .. "/.local/bin", freeze_path = vim.fn.exepath("freeze"), - copy_cmd = vim.env.HOME .. "/dev/nvim_plugins/freeze-code.nvim/bin/pngcopy-macos", + copy_cmd = "", copy = false, open = false, dir = vim.env.PWD,