diff --git a/lazy-lock.json b/lazy-lock.json index 61070de..5814a95 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -31,10 +31,12 @@ "nvim-genghis": { "branch": "main", "commit": "cdf584d05ffc9d5c1f247079991552249e4f7487" }, "nvim-lint": { "branch": "master", "commit": "335a6044be16d7701001059cba9baa36fbeef422" }, "nvim-lspconfig": { "branch": "master", "commit": "db8fef885009fdec0daeff3e5dda92e1f539611e" }, + "nvim-tree.lua": { "branch": "master", "commit": "87d096a39cb2d5d43e6771563575ff042a79f48b" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "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/core/options.lua b/lua/core/options.lua index edd8863..30a5502 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -60,6 +60,9 @@ for k, v in pairs(options) do vim.opt[k] = v end +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + vim.opt.path:append({ '**' }) vim.opt.shortmess:append({ W = true, I = true, c = true }) -- disable greeting diff --git a/lua/plugins/files.lua b/lua/plugins/files.lua index 32375bd..7a0ab8c 100644 --- a/lua/plugins/files.lua +++ b/lua/plugins/files.lua @@ -39,4 +39,60 @@ return { }) end, }, + { + 'nvim-tree/nvim-tree.lua', + config = function() + local nvimtree = require('nvim-tree') + + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + + nvimtree.setup({ + 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' }, + }, + git = { + ignore = false, + }, + }) + + vim.keymap.set('n', 'eo', 'NvimTreeToggle', { desc = 'Toggle file explorer' }) + end, + }, }