From 08e6a880f51114a2c8b48e0541256716bd20d608 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 2 Jan 2023 17:36:26 +0100 Subject: [PATCH] feat(util): float_term using lazy's API --- lua/lazyvim/util.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lua/lazyvim/util.lua b/lua/lazyvim/util.lua index f070a9c2..882a1627 100644 --- a/lua/lazyvim/util.lua +++ b/lua/lazyvim/util.lua @@ -62,4 +62,17 @@ function M.telescope(builtin, opts) end end +function M.float_term(cmd, opts) + opts = vim.tbl_deep_extend("force", { + terminal = true, + close_on_exit = true, + enter = true, + float = { + size = { width = 0.9, height = 0.9 }, + margin = { top = 0, right = 0, bottom = 0, left = 0 }, + }, + }, opts or {}) + require("lazy.util").open_cmd(cmd, opts) +end + return M