From 4a61ce3e2a7b11e5d94fc047ffdd7351623df199 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 2 Jun 2024 22:11:24 +0200 Subject: make terminal windows unlisted --- lua/functions.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/functions.lua b/lua/functions.lua index aa5e32f..3b52a55 100644 --- a/lua/functions.lua +++ b/lua/functions.lua @@ -50,7 +50,13 @@ function _G.toggle_terminal() if vim.fn.win_gotoid(vim.g.term_win) == 1 then vim.cmd("quit!") else - vim.cmd("botright new") + local terminal_buffer = vim.api.nvim_create_buf(false, false) + + vim.api.nvim_open_win( + terminal_buffer, + true, + { split = "below", vertical = true } + ) vim.api.nvim_win_set_height(vim.fn.win_getid(), vim.g.terminal_height) @@ -63,7 +69,7 @@ function _G.toggle_terminal() vim.fn.termopen(vim.env.SHELL, {detach=0}) - vim.g.term_buf = vim.fn.bufnr("") + vim.g.term_buf = terminal_buffer vim.o.number = false vim.o.relativenumber = false -- cgit v1.2.3-18-g5258