mirror of
https://github.com/zoriya/flake.git
synced 2026-08-15 18:43:42 +00:00
Setup snacks terminal
This commit is contained in:
@@ -1,3 +1,29 @@
|
||||
local opencode_cmd = 'opencode --port'
|
||||
---@type snacks.terminal.Opts
|
||||
local snacks_terminal_opts = {
|
||||
win = {
|
||||
position = 'right',
|
||||
enter = true,
|
||||
on_win = function(win)
|
||||
require('opencode.terminal').setup(win.win)
|
||||
end,
|
||||
},
|
||||
}
|
||||
---@type opencode.Opts
|
||||
vim.g.opencode_opts = {
|
||||
server = {
|
||||
start = function()
|
||||
require('snacks.terminal').open(opencode_cmd, snacks_terminal_opts)
|
||||
end,
|
||||
stop = function()
|
||||
require('snacks.terminal').get(opencode_cmd, snacks_terminal_opts):close()
|
||||
end,
|
||||
toggle = function()
|
||||
require('snacks.terminal').toggle(opencode_cmd, snacks_terminal_opts)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
return {
|
||||
{
|
||||
"opencode-nvim",
|
||||
@@ -18,6 +44,7 @@ return {
|
||||
end,
|
||||
desc = "Add range to opencode",
|
||||
mode = { "n", "x" },
|
||||
expr = true,
|
||||
},
|
||||
{
|
||||
"gll",
|
||||
@@ -25,6 +52,7 @@ return {
|
||||
return require("opencode").operator("@this ") .. "_"
|
||||
end,
|
||||
desc = "Add line to opencode",
|
||||
expr = true,
|
||||
},
|
||||
{
|
||||
"gL",
|
||||
|
||||
Reference in New Issue
Block a user