From 5188bb0e10e08d8f8f42702eef51d0ea89874f9d Mon Sep 17 00:00:00 2001 From: Wilson Soetomo Date: Tue, 29 Jul 2025 16:23:06 -0400 Subject: [PATCH] adding sidebar --- lua/custom/keymaps.lua | 3 +++ lua/custom/plugins/plugins.lua | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/lua/custom/keymaps.lua b/lua/custom/keymaps.lua index aacb9d54..12a30e47 100644 --- a/lua/custom/keymaps.lua +++ b/lua/custom/keymaps.lua @@ -35,3 +35,6 @@ end) vim.keymap.set('n', '4', function() harpoon:list():select(4) end) + +-- In your keybindings configuration (e.g., lua/config/keymaps.lua or init.lua) +vim.keymap.set('n', 'w', 'NvimTreeToggle', { desc = 'Toggle NvimTree' }) diff --git a/lua/custom/plugins/plugins.lua b/lua/custom/plugins/plugins.lua index df18bc69..7cf3280a 100644 --- a/lua/custom/plugins/plugins.lua +++ b/lua/custom/plugins/plugins.lua @@ -1,5 +1,8 @@ return { -- Other plugins in here + { + 'nvim-tree/nvim-web-devicons', + }, { 'stevearc/oil.nvim', opts = {}, @@ -50,4 +53,36 @@ return { } end, }, + { + 'nvim-tree/nvim-tree.lua', + version = '*', -- recommended + lazy = false, + dependencies = { + 'nvim-tree/nvim-web-devicons', -- optional, for file icons + }, + opts = { + view = { + side = 'left', + width = 30, + float = { enable = false }, + }, + sync_root_with_cwd = true, + respect_buf_cwd = true, + update_focused_file = { enable = true, update_root = true }, + renderer = { + group_empty = true, + indent_width = 2, + }, + actions = { open_file = { resize_window = true } }, + }, + init = function() + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + end, + -- Other nvim-tree options can go here + -- For example, to automatically close on file selection: + -- auto_close = true, + -- To show hidden files: + -- hide_dotfiles = false, + }, }