From d0225e35a0afa7810657a586a6f7da25967798a4 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 4 Oct 2026 11:06:19 +0100 Subject: [PATCH] Updates to terminal helpers --- lua/helpers.lua | 10 +++++++++- lua/projects/framework_utils/laravel.lua | 15 --------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/lua/helpers.lua b/lua/helpers.lua index f63add9..8667f31 100644 --- a/lua/helpers.lua +++ b/lua/helpers.lua @@ -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 diff --git a/lua/projects/framework_utils/laravel.lua b/lua/projects/framework_utils/laravel.lua index 0f5b82d..443ad03 100644 --- a/lua/projects/framework_utils/laravel.lua +++ b/lua/projects/framework_utils/laravel.lua @@ -116,21 +116,6 @@ end local function laravel_utils(dir) map('D', function() - local term_bufnr = -1 - for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do - if vim.bo[bufnr].buftype == 'terminal' then - local name = vim.api.nvim_buf_get_name(bufnr) - if name:match '/bin/var-dump-server$' then - term_bufnr = bufnr - end - end - end - - if term_bufnr ~= -1 then - vim.api.nvim_open_win(term_bufnr, true) - return - end - helpers.open_term { cmd = dir .. 'vendor/bin/var-dump-server', buf_opts = {