From 446d2716e7bb83e58fb516ec27e5c7750069e98c Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Fri, 2 May 2025 16:05:47 +0300 Subject: =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D1=88=D0=B5=D0=BB=20=D0=BD?= =?UTF-8?q?=D0=B0=20lazy=20nvim,=20=D0=BD=D0=B0=D0=B2=D0=B5=D0=BB=20=D0=BF?= =?UTF-8?q?=D0=BE=D1=80=D1=8F=D0=B4=D0=BE=D0=BA=20=D0=B2=20=D0=BF=D0=BB?= =?UTF-8?q?=D0=B0=D0=B3=D0=B8=D0=BD=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/lua/plugins/tree.lua | 68 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 22 deletions(-) (limited to 'nvim/lua/plugins/tree.lua') diff --git a/nvim/lua/plugins/tree.lua b/nvim/lua/plugins/tree.lua index 320849b..4807024 100644 --- a/nvim/lua/plugins/tree.lua +++ b/nvim/lua/plugins/tree.lua @@ -1,27 +1,51 @@ -require("nvim-tree").setup({ - sort = { - sorter = "case_sensitive", +return { + "nvim-tree/nvim-tree.lua", + dependencies = { + "nvim-tree/nvim-web-devicons", }, - view = { - width = 30, - }, - git = { - enable = true, - }, - renderer = { - group_empty = true, - highlight_git = true, - icons = { - show = { - git = true, + opts = { + hijack_directories = { + enable = true, -- Перехватывать открытие директорий + auto_open = true, -- Автоматически открывать при старте + }, + sort = { + sorter = "case_sensitive", + }, + view = { + width = 30, + }, + git = { + enable = true, + }, + renderer = { + group_empty = true, + highlight_git = true, + icons = { + show = { + git = true, + }, }, }, + filters = { + dotfiles = false, + }, + update_focused_file = { + enable = true, + update_root = false, + }, }, - filters = { - dotfiles = false, - }, - update_focused_file = { - enable = true, - update_root = false, + 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