aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2023-09-04 22:51:46 +0200
committersrdusr <trevorgray@srdusr.com>2023-09-04 22:51:46 +0200
commit36d11ecbd919f98bb53a1e9406caa3ba102a5ba1 (patch)
tree2d611e184c2390ac792defa2b98dc2f749fed846
parent7a045812d1a80448e1593278b8a7479a48185cdc (diff)
downloaddotfiles-36d11ecbd919f98bb53a1e9406caa3ba102a5ba1.tar.gz
dotfiles-36d11ecbd919f98bb53a1e9406caa3ba102a5ba1.zip
More configurations for float window
-rw-r--r--lua/plugins/nvim-tree.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua
index 742ffad..e24a299 100644
--- a/lua/plugins/nvim-tree.lua
+++ b/lua/plugins/nvim-tree.lua
@@ -72,6 +72,33 @@ local renderer = {
icons = icons,
}
+local system_open = { cmd = 'zathura' }
+
+local HEIGHT_RATIO = 0.8
+local WIDTH_RATIO = 0.15
+
+local float = {
+ enable = false,
+ open_win_config = function()
+ local screen_w = vim.opt.columns:get()
+ local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get()
+ local window_w = screen_w * WIDTH_RATIO
+ local window_h = screen_h * HEIGHT_RATIO
+ local window_w_int = math.floor(window_w)
+ local window_h_int = math.floor(window_h)
+ local center_x = (screen_w - window_w) / 2
+ local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get()
+ return {
+ border = 'rounded',
+ relative = 'editor',
+ row = center_y,
+ col = center_x,
+ width = window_w_int,
+ height = window_h_int,
+ }
+ end,
+}
+
local view = {
cursorline = false,
hide_root_folder = false,