Add bottom terminal command

main
Ensar Sarajčić 2022-05-05 21:57:46 +02:00
parent fb1d18ac84
commit 797eba7ed4
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,39 @@
-- Common UI components
local nui_split = require("nui.split")
local nui_popup = require("nui.popup")
local M = {}
function M.new_bottom_split(opts)
local split = nui_split(vim.tbl_extend("force", {
relative = "editor",
position = "bottom",
size = "20%",
}, opts))
split:mount()
return split
end
function M.new_centered_popup(opts)
local split = nui_popup(vim.tbl_extend('force', {
enter = true,
focusable = true,
border = {
style = "rounded",
},
position = "50%",
size = {
width = "80%",
height = "60%",
},
}, opts))
split:mount()
return split
end
return M

View File

@ -80,3 +80,9 @@ end
-- Selections
-- Using telescope for select UI
-- Terminal
vim.api.nvim_create_user_command("BottomTerminal", function()
require("esensar.ui").new_bottom_split({})
vim.fn.termopen(os.getenv("SHELL"))
end, {})