From 70d1f776689f6a923d9f95e11db063119d8a3b8c Mon Sep 17 00:00:00 2001 From: 0xfa1z Date: Wed, 10 Jul 2024 17:34:01 +0200 Subject: [PATCH] add nvim-tree --- init.lua | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 35721ff5..0e78d327 100644 --- a/init.lua +++ b/init.lua @@ -195,12 +195,18 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the lower win vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) -- Custom key mapping to open netrw -vim.api.nvim_set_keymap('n', 'e', ':Explore', { noremap = true, silent = true }) +-- vim.api.nvim_set_keymap('n', 'e', ':Explore', { noremap = true, silent = true }) +-- Keybinding to toggle nvim-tree +vim.api.nvim_set_keymap('n', 'e', ':NvimTreeToggle', { noremap = true, silent = true }) -- Enable netrw settings vim.g.netrw_banner = 0 vim.g.netrw_liststyle = 3 +-- Disable netrw plugins +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -239,6 +245,26 @@ require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically 'github/copilot.vim', -- GitHub Copilot integration + -- vim-tree + { + 'kyazdani42/nvim-tree.lua', + config = function() + require('nvim-tree').setup { + sort = { + sorter = 'case_sensitive', + }, + view = { + width = 30, + }, + renderer = { + group_empty = true, + }, + filters = { + dotfiles = true, + }, + } + end, + }, -- File explorer -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following