update opencode, load env

This commit is contained in:
hlstwizard 2026-04-04 20:03:23 +08:00
parent 83d7ea0443
commit 9d2e376259
1 changed files with 4 additions and 2 deletions

View File

@ -25,18 +25,20 @@ return {
}, },
}, },
config = function() config = function()
local opencode_cmd = [[zsh -ic 'opencode --port']]
---@type opencode.Opts ---@type opencode.Opts
vim.g.opencode_opts = { vim.g.opencode_opts = {
server = { server = {
start = function() start = function()
require('opencode.terminal').open('opencode --port', { require('opencode.terminal').open(opencode_cmd, {
split = 'right', split = 'right',
width = math.max(40, math.floor(vim.o.columns * 0.4)), width = math.max(40, math.floor(vim.o.columns * 0.4)),
}) })
end, end,
stop = function() require('opencode.terminal').close() end, stop = function() require('opencode.terminal').close() end,
toggle = function() toggle = function()
require('opencode.terminal').toggle('opencode --port', { require('opencode.terminal').toggle(opencode_cmd, {
split = 'right', split = 'right',
width = math.max(40, math.floor(vim.o.columns * 0.4)), width = math.max(40, math.floor(vim.o.columns * 0.4)),
}) })