diff options
| author | 2026-03-27 14:13:00 +0300 | |
|---|---|---|
| committer | 2026-03-27 14:13:00 +0300 | |
| commit | 3009f160980a3856a54ca387d8c714c35fd94d49 (patch) | |
| tree | d0be23b6bd4e270b0ac33e6047ce808a6ad6da77 /config/nvim/lua/plugins/tree.lua | |
| parent | Added minimap nvim, dap configs, conf syntax(WIP) (diff) | |
| download | dotfiles-3009f160980a3856a54ca387d8c714c35fd94d49.tar.gz dotfiles-3009f160980a3856a54ca387d8c714c35fd94d49.tar.bz2 dotfiles-3009f160980a3856a54ca387d8c714c35fd94d49.tar.xz dotfiles-3009f160980a3856a54ca387d8c714c35fd94d49.zip | |
new version
Diffstat (limited to '')
| -rw-r--r-- | config/nvim/lua/plugins/tree.lua | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/config/nvim/lua/plugins/tree.lua b/config/nvim/lua/plugins/tree.lua index 18f217b..08fed69 100644 --- a/config/nvim/lua/plugins/tree.lua +++ b/config/nvim/lua/plugins/tree.lua @@ -1,5 +1,5 @@ local HEIGHT_RATIO = 0.8 -local WIDTH_RATIO = 0.5 +local WIDTH_RATIO = 0.25 return { "nvim-tree/nvim-tree.lua", dependencies = { @@ -33,37 +33,36 @@ return { on_attach = function(bufnr) local api = require("nvim-tree.api") api.config.mappings.default_on_attach(bufnr) - vim.api.nvim_set_hl(0, "NvimTreeNormal", { bg = vim.o.background == "dark" and "#1c1c1f" or "#e7e7e7" }) end, view = { - float = { - enable = true, - 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() - local border_bg = vim.o.background == "dark" and "#1c1c1f" or "#e7e7e7" - local border_fg = vim.o.background == "dark" and "#333333" or "#999999" - -- Force highlight for border and nvim-tree background - vim.api.nvim_set_hl(0, "FloatBorder", { fg = border_fg, bg = border_bg }) - vim.api.nvim_set_hl(0, "NvimTreeFloatBorder", { fg = border_fg, bg = border_bg }) - vim.api.nvim_set_hl(0, "NvimTreeNormal", { bg = border_bg }) - vim.api.nvim_set_hl(0, "NormalFloat", { bg = border_bg }) - return { - border = "rounded", - relative = "editor", - row = center_y, - col = center_x, - width = window_w_int, - height = window_h_int, - } - end, - }, + -- float = { + -- enable = true, + -- 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() + -- local border_bg = vim.o.background == "dark" and "#1c1c1f" or "#e7e7e7" + -- local border_fg = vim.o.background == "dark" and "#333333" or "#999999" + -- -- Force highlight for border and nvim-tree background + -- vim.api.nvim_set_hl(0, "FloatBorder", { fg = border_fg, bg = border_bg }) + -- vim.api.nvim_set_hl(0, "NvimTreeFloatBorder", { fg = border_fg, bg = border_bg }) + -- vim.api.nvim_set_hl(0, "NvimTreeNormal", { bg = border_bg }) + -- vim.api.nvim_set_hl(0, "NormalFloat", { bg = border_bg }) + -- return { + -- border = "rounded", + -- relative = "editor", + -- row = center_y, + -- col = center_x, + -- width = window_w_int, + -- height = window_h_int, + -- } + -- end, + -- }, width = function() return math.floor(vim.opt.columns:get() * WIDTH_RATIO) end, @@ -80,7 +79,7 @@ return { desc = "Change tree root to CWD", }, { - "<F3>", + "<F4>", "<cmd>NvimTreeToggle<CR>", desc = "Toggle file tree", }, |
