1
0

Removed Copy Pasted Shorthands for vim functions

This commit is contained in:
2025-07-04 11:17:58 +02:00
parent e80a93bc0d
commit 85c5bad010

View File

@@ -53,33 +53,27 @@ vim.opt.statusline = ' #%n %f %h%w%m%r %= %y %l:%c %p%% '
local te_buf = nil
local te_win_id = nil
local v = vim
local fun = v.fn
local cmd = v.api.nvim_command
local gotoid = fun.win_gotoid
local getid = fun.win_getid
local function openTerminal()
if fun.bufexists(te_buf) ~= 1 then
cmd("au TermOpen * setlocal nonumber norelativenumber signcolumn=no")
cmd("sp | winc J | res 10 | te")
te_win_id = getid()
te_buf = fun.bufnr('%')
elseif gotoid(te_win_id) ~= 1 then
cmd("sb " .. te_buf .. "| winc J | res 10")
te_win_id = getid()
if vim.fn.bufexists(te_buf) ~= 1 then
vim.api.nvim_command("au TermOpen * setlocal nonumber norelativenumber signcolumn=no")
vim.api.nvim_command("sp | winc J | res 10 | te")
te_win_id = vim.fn.win_getid()
te_buf = vim.fn.bufnr('%')
elseif vim.fn.win_gotoid(te_win_id) ~= 1 then
vim.api.nvim_command("sb " .. te_buf .. "| winc J | res 10")
te_win_id = vim.fn.win_getid()
end
cmd("startinsert")
vim.api.nvim_command("startinsert")
end
local function hideTerminal()
if gotoid(te_win_id) == 1 then
cmd("hide")
if vim.fn.win_gotoid(te_win_id) == 1 then
vim.api.nvim_command("hide")
end
end
function ToggleTerminal()
if gotoid(te_win_id) == 1 then
if vim.fn.win_gotoid(te_win_id) == 1 then
hideTerminal()
else
openTerminal()