vim/nvim-tree: make sure to load plugin on commands

This commit is contained in:
Fernando Schauenburg 2023-08-08 18:25:20 +02:00
parent deb327e5ce
commit 1c14398a46

View file

@ -2,7 +2,6 @@ return {
'nvim-tree/nvim-tree.lua', 'nvim-tree/nvim-tree.lua',
dependencies = { 'nvim-tree/nvim-web-devicons' }, dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = { opts = {
disable_netrw = true, -- replace netrw with nvim-tree disable_netrw = true, -- replace netrw with nvim-tree
hijack_cursor = true, -- keep the cursor on begin of the filename hijack_cursor = true, -- keep the cursor on begin of the filename
@ -25,24 +24,26 @@ return {
git = { git = {
ignore = false, -- don't hide files from .gitignore ignore = false, -- don't hide files from .gitignore
}, },
view = { view = {
adaptive_size = true, -- resize the window based on the longest line adaptive_size = true, -- resize the window based on the longest line
width = 35, -- a little wider than the default 30 width = 35, -- a little wider than the default 30
}, },
filters = { filters = {
dotfiles = false, -- show files starting with a . dotfiles = false, -- show files starting with a .
custom = { '^\\.git' }, -- don't show .git directory custom = { '^\\.git' }, -- don't show .git directory
}, },
renderer = { renderer = {
add_trailing = true, -- add trailing / to folders add_trailing = true, -- add trailing / to folders
group_empty = true, -- folders that contain only one folder are grouped group_empty = true, -- folders that contain only one folder are grouped
highlight_git = true, -- enable highlight based on git attributes highlight_git = true, -- enable highlight based on git attributes
}, },
}, },
cmd = {
'NvimTreeToggle',
'NvimTreeOpen',
'NvimTreeFocus',
'NvimTreeFindFileToggle'
},
keys = { keys = {
{ '<leader>nn', '<cmd>NvimTreeOpen<cr>' }, { '<leader>nn', '<cmd>NvimTreeOpen<cr>' },
{ '<leader>nf', '<cmd>NvimTreeFindFile<cr>' }, { '<leader>nf', '<cmd>NvimTreeFindFile<cr>' },