-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
32 lines (26 loc) · 840 Bytes
/
main.lua
File metadata and controls
32 lines (26 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
-- lua/neopencode/main.lua
local M = {}
function M.setup(options)
local config = require("neopencode.config")
config.options = vim.tbl_deep_extend("force", config.options, options or {})
vim.api.nvim_create_user_command("OpencodeFile", function()
require("neopencode.actions").send_file()
end, {
nargs = 0,
desc = "Send the current file to neopencode.ai",
})
vim.api.nvim_create_user_command("OpencodeSelect", function(opts)
require("neopencode.actions").send_selection(opts.line1, opts.line2)
end, {
nargs = 0,
range = true,
desc = "Send the selected lines to neopencode.ai",
})
vim.api.nvim_create_user_command("OpencodeSelectSession", function()
require("neopencode.session").select_session()
end, {
nargs = 0,
desc = "Select an neopencode.ai session",
})
end
return M