Updates to terminal helpers

This commit is contained in:
2026-10-04 11:06:19 +01:00
parent eae0f8f231
commit d0225e35a0
2 changed files with 9 additions and 16 deletions
+9 -1
View File
@@ -76,7 +76,15 @@ helpers.toggle_term = function(cmd, opts, buf_opts)
end
if term_bufnr ~= -1 then
vim.api.nvim_open_win(term_bufnr, true)
vim.api.nvim_open_win(term_bufnr, true, opts.win_opts or {
style = 'minimal',
relative = 'editor',
width = width,
height = height,
row = math.ceil((vim.o.lines - height) / 2),
col = math.ceil((vim.o.columns - width) / 2),
border = 'single',
})
if opts.start_insert then
vim.cmd.startinsert()
end