1
0
Fork 0
codesnap.nvim/lua/codesnap/init.lua

27 lines
680 B
Lua
Raw Permalink Normal View History

2024-02-19 14:27:17 +00:00
local table_utils = require("codesnap.utils.table")
local static = require("codesnap.static")
2024-02-19 14:27:17 +00:00
local client = require("codesnap.client")
local visual_utils = require("codesnap.utils.visual")
2024-02-13 06:05:36 +00:00
local main = {}
function main.setup(config)
2024-02-19 14:27:17 +00:00
static.config = table_utils.merge(static.config, config == nil and {} or config)
print(vim.inspect(static.config))
print(table_utils.serialize_json(static.config))
print()
if static.config.auto_load then
client:start()
end
client:send("config_setup", static.config)
end
function main.preview_code()
client:send("preview_code", { content = visual_utils.get_selected_text(), language = vim.bo.filetype })
2024-02-13 06:05:36 +00:00
end
return main