From 97af93b2a8ebc89364852e3f63e9fd8cfedaeedf Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Mon, 9 Jun 2025 13:43:45 +0300 Subject: =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B2=D1=91=D0=BB=20dotfiles?= =?UTF-8?q?=20=D0=BD=D0=B0=20stow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/nvim/lua/plugins/tree.lua | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 config/nvim/lua/plugins/tree.lua (limited to 'config/nvim/lua/plugins/tree.lua') diff --git a/config/nvim/lua/plugins/tree.lua b/config/nvim/lua/plugins/tree.lua new file mode 100644 index 0000000..3bf9eed --- /dev/null +++ b/config/nvim/lua/plugins/tree.lua @@ -0,0 +1,54 @@ +local WIDTH_RATIO = 0.25 + +return { + "nvim-tree/nvim-tree.lua", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + opts = { + disable_netrw = true, + hijack_netrw = true, + sort = { + sorter = "case_sensitive", + }, + view = { + width = function() + return math.floor(vim.opt.columns:get() * WIDTH_RATIO) + end, + adaptive_size = true, + centralize_selection = true, + }, + git = { + enable = true, + }, + renderer = { + group_empty = true, + highlight_git = true, + icons = { + show = { + git = true, + }, + }, + }, + filters = { + dotfiles = false, + }, + update_focused_file = { + enable = true, + }, + }, + keys = { + { + "", + function() + local api = require("nvim-tree.api") + local global_cwd = vim.fn.getcwd(-1, -1) + api.tree.change_root(global_cwd) + end, + noremap = true, + silent = true, + desc = "Change tree root to CWD", + }, + { "", ":NvimTreeToggle", noremap = true, silent = true, desc = "Toggle file tree" }, + }, +} -- cgit v1.2.3