diff options
Diffstat (limited to 'lua/functions.lua')
-rw-r--r-- | lua/functions.lua | 10 |
1 files 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 |