Compare commits

..
2 Commits
Author SHA1 Message Date
Job79 91107348ad feat: use popups for git / sql 2026-09-02 20:08:32 +02:00
Job79 f097f4d3e0 feat: use rounded borders around popups 2026-09-02 20:08:15 +02:00
2 changed files with 16 additions and 3 deletions
+14 -3
View File
@@ -1,11 +1,22 @@
local M = {} local M = {}
--- Opens a TUI application in a new scratch buffer and deletes the buffer on exit. --- Opens a TUI application in a simple centered floating window.
function M.open_terminal_app(cmd) function M.open_terminal_app(cmd)
vim.cmd("enew") local buf = vim.api.nvim_create_buf(false, true)
-- Open a centered floating window (80% screen width/height)
local win = vim.api.nvim_open_win(buf, true, {
relative = "editor",
width = math.floor(vim.o.columns * 0.95),
height = math.floor(vim.o.lines * 0.95),
row = math.floor(vim.o.lines * 0.025),
col = math.floor(vim.o.columns * 0.025),
border = "rounded",
})
vim.fn.termopen(cmd, { vim.fn.termopen(cmd, {
on_exit = function() on_exit = function()
pcall(vim.cmd, "bdelete!") pcall(vim.api.nvim_win_close, win, true)
end, end,
}) })
end end
+2
View File
@@ -18,6 +18,8 @@ vim.o.splitbelow = true -- Horizontal splits will be below
vim.o.splitkeep = 'screen' -- Reduce scroll during window split vim.o.splitkeep = 'screen' -- Reduce scroll during window split
vim.o.splitright = true -- Vertical splits will be to the right vim.o.splitright = true -- Vertical splits will be to the right
vim.o.wrap = false -- Don't visually wrap lines (toggle with \w) vim.o.wrap = false -- Don't visually wrap lines (toggle with \w)
vim.o.winborder = 'rounded' -- Use border in floating windows
vim.o.pumborder = 'rounded' -- Use border in popup menu
vim.o.cmdheight = 0 -- Hide the command line when not in use vim.o.cmdheight = 0 -- Hide the command line when not in use
vim.cmd('syntax off') -- Disable legacy syntax highlighting vim.cmd('syntax off') -- Disable legacy syntax highlighting
require("vim._core.ui2").enable({ -- Enable new ui (requires nightly) require("vim._core.ui2").enable({ -- Enable new ui (requires nightly)