Skip to content

Commit 5188bb0

Browse files
author
Wilson Soetomo
committed
adding sidebar
1 parent d5b58a5 commit 5188bb0

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

lua/custom/keymaps.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ end)
3535
vim.keymap.set('n', '<leader>4', function()
3636
harpoon:list():select(4)
3737
end)
38+
39+
-- In your keybindings configuration (e.g., lua/config/keymaps.lua or init.lua)
40+
vim.keymap.set('n', '<leader>w', '<cmd>NvimTreeToggle<CR>', { desc = 'Toggle NvimTree' })

lua/custom/plugins/plugins.lua

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
return {
22
-- Other plugins in here
3+
{
4+
'nvim-tree/nvim-web-devicons',
5+
},
36
{
47
'stevearc/oil.nvim',
58
opts = {},
@@ -50,4 +53,36 @@ return {
5053
}
5154
end,
5255
},
56+
{
57+
'nvim-tree/nvim-tree.lua',
58+
version = '*', -- recommended
59+
lazy = false,
60+
dependencies = {
61+
'nvim-tree/nvim-web-devicons', -- optional, for file icons
62+
},
63+
opts = {
64+
view = {
65+
side = 'left',
66+
width = 30,
67+
float = { enable = false },
68+
},
69+
sync_root_with_cwd = true,
70+
respect_buf_cwd = true,
71+
update_focused_file = { enable = true, update_root = true },
72+
renderer = {
73+
group_empty = true,
74+
indent_width = 2,
75+
},
76+
actions = { open_file = { resize_window = true } },
77+
},
78+
init = function()
79+
vim.g.loaded_netrw = 1
80+
vim.g.loaded_netrwPlugin = 1
81+
end,
82+
-- Other nvim-tree options can go here
83+
-- For example, to automatically close on file selection:
84+
-- auto_close = true,
85+
-- To show hidden files:
86+
-- hide_dotfiles = false,
87+
},
5388
}

0 commit comments

Comments
 (0)