Skip to content

Commit

Permalink
chore: refactor the terminal plugin a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarmos-san committed Nov 16, 2024
1 parent b42d3b3 commit 492b60f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions dotfiles/.config/nvim/lua/terminal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,19 @@ M.setup = {
end,

vertical = function()
local width = math.floor(vim.o.columns * 0.5) -- Set the width for the new split (50% of the current width)
local height = vim.api.nvim_win_get_height(0) -- Use the current window's height
local row = 0 -- Start from the top of the window
local col = vim.api.nvim_win_get_width(0) -- Place it at the right side of the current window
-- local width = math.floor(vim.o.columns * 0.5) -- Set the width for the new split (50% of the current width)
-- local height = vim.api.nvim_win_get_height(0) -- Use the current window's height
-- local row = 0 -- Start from the top of the window
-- local col = vim.api.nvim_win_get_width(0) -- Place it at the right side of the current window

-- Create the terminal inside the vertical split
create_term(width, height, row, col, {})
-- create_term(width, height, row, col, {})
-- TODO: Refactor the function
local buf = vim.api.nvim_create_buf(false, true)

-- Create a buffer to open the terminal in
vim.api.nvim_open_win(buf, true, { split = "right", win = 0 })
vim.fn.termopen(vim.o.shell)
end,
}

Expand Down

0 comments on commit 492b60f

Please sign in to comment.