From b82b4091d1b6ca0b92f8e7802a80c2607236defc Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Wed, 1 Oct 2025 13:30:09 +0545 Subject: [PATCH] refactor(files): simplify nvim-tree configuration and improve UI --- lazy-lock.json | 1 - lua/plugins/completion.lua | 5 +-- lua/plugins/files.lua | 73 +++++++++++++++----------------------- 3 files changed, 30 insertions(+), 49 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 5814a95..822f6e8 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -36,7 +36,6 @@ "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, "nvim-ufo": { "branch": "main", "commit": "d31e2a9fd572a25a4d5011776677223a8ccb7e35" }, - "nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "snacks.nvim": { "branch": "main", "commit": "bfe8c26dbd83f7c4fbc222787552e29b4eccfcc0" }, diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua index b0c0dfe..d1c69fc 100644 --- a/lua/plugins/completion.lua +++ b/lua/plugins/completion.lua @@ -6,7 +6,7 @@ return { dependencies = { 'rafamadriz/friendly-snippets' }, config = function() local luasnip = require('luasnip') - + require('luasnip.loaders.from_vscode').lazy_load() require('luasnip.loaders.from_vscode').lazy_load({ paths = { vim.fn.stdpath('config') .. '/snippets' }, }) @@ -19,9 +19,6 @@ return { { 'saghen/blink.cmp', version = '*', - dependencies = { - 'L3MON4D3/LuaSnip', - }, config = function() require('blink.cmp').setup({ appearance = { diff --git a/lua/plugins/files.lua b/lua/plugins/files.lua index 7a0ab8c..7cdea82 100644 --- a/lua/plugins/files.lua +++ b/lua/plugins/files.lua @@ -42,57 +42,42 @@ return { { 'nvim-tree/nvim-tree.lua', config = function() - local nvimtree = require('nvim-tree') - - vim.g.loaded_netrw = 1 - vim.g.loaded_netrwPlugin = 1 - - nvimtree.setup({ + require('nvim-tree').setup({ + filters = { dotfiles = false }, + disable_netrw = true, + hijack_cursor = true, + sync_root_with_cwd = true, + update_focused_file = { + enable = true, + update_root = false, + }, view = { width = 30, - relativenumber = true, side = 'right', - }, - sync_root_with_cwd = true, - renderer = { - indent_markers = { - enable = true, - }, - icons = { - glyphs = { - folder = { - arrow_closed = '›', - arrow_open = '⌄', - }, - git = { - staged = 'A', - unstaged = 'M', - unmerged = '!', - renamed = 'R', - untracked = 'U', - deleted = 'D', - ignored = '◌', - }, - }, - }, - }, - actions = { - open_file = { - window_picker = { - enable = false, - }, - }, - }, - filters = { - dotfiles = true, - custom = { '.DS_Store' }, + preserve_window_proportions = true, }, git = { - ignore = false, + enable = false, + ignore = true, + }, + renderer = { + root_folder_label = false, + indent_markers = { enable = true }, + icons = { + glyphs = { + default = '󰈚', + folder = { + default = '', + empty = '', + empty_open = '', + open = '', + symlink = '', + }, + }, + }, }, }) - - vim.keymap.set('n', 'eo', 'NvimTreeToggle', { desc = 'Toggle file explorer' }) end, + vim.keymap.set('n', 'eo', 'NvimTreeToggle', { desc = 'Toggle file explorer' }), }, }