Skip to content

Commit 70d1f77

Browse files
author
0xfa1z
committed
add nvim-tree
1 parent 6652a3c commit 70d1f77

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

init.lua

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,18 @@ vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower win
195195
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
196196

197197
-- Custom key mapping to open netrw
198-
vim.api.nvim_set_keymap('n', '<leader>e', ':Explore<CR>', { noremap = true, silent = true })
198+
-- vim.api.nvim_set_keymap('n', '<leader>e', ':Explore<CR>', { noremap = true, silent = true })
199+
-- Keybinding to toggle nvim-tree
200+
vim.api.nvim_set_keymap('n', '<leader>e', ':NvimTreeToggle<CR>', { noremap = true, silent = true })
199201

200202
-- Enable netrw settings
201203
vim.g.netrw_banner = 0
202204
vim.g.netrw_liststyle = 3
203205

206+
-- Disable netrw plugins
207+
vim.g.loaded_netrw = 1
208+
vim.g.loaded_netrwPlugin = 1
209+
204210
-- [[ Basic Autocommands ]]
205211
-- See `:help lua-guide-autocommands`
206212

@@ -239,6 +245,26 @@ require('lazy').setup({
239245
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
240246
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
241247
'github/copilot.vim', -- GitHub Copilot integration
248+
-- vim-tree
249+
{
250+
'kyazdani42/nvim-tree.lua',
251+
config = function()
252+
require('nvim-tree').setup {
253+
sort = {
254+
sorter = 'case_sensitive',
255+
},
256+
view = {
257+
width = 30,
258+
},
259+
renderer = {
260+
group_empty = true,
261+
},
262+
filters = {
263+
dotfiles = true,
264+
},
265+
}
266+
end,
267+
}, -- File explorer
242268

243269
-- NOTE: Plugins can also be added by using a table,
244270
-- with the first argument being the link and the following

0 commit comments

Comments
 (0)