summaryrefslogtreecommitdiff
path: root/config/nvim/lua/plugins/tree.lua
diff options
context:
space:
mode:
author2025-06-09 13:43:45 +0300
committer2025-06-09 13:55:38 +0300
commit97af93b2a8ebc89364852e3f63e9fd8cfedaeedf (patch)
tree27e2added74ee6c0ff91c9e7927491c661a8bb36 /config/nvim/lua/plugins/tree.lua
parent04.06.2025 (diff)
downloaddotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.tar.gz
dotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.tar.bz2
dotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.tar.xz
dotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.zip
Перевёл dotfiles на stow
Diffstat (limited to 'config/nvim/lua/plugins/tree.lua')
-rw-r--r--config/nvim/lua/plugins/tree.lua54
1 files changed, 54 insertions, 0 deletions
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 = {
+ {
+ "<C-c>",
+ 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",
+ },
+ { "<F3>", ":NvimTreeToggle<CR>", noremap = true, silent = true, desc = "Toggle file tree" },
+ },
+}