Add nvim-tree, on the right, toggled with <leader>e

Netrw is disabled, as nvim-tree needs to own directory buffers so
`nvim .` opens the tree rather than the two fighting over it. That
removes :Ex, so the Obsidian guide has been updated to point at
<leader>e instead.

No auto-open autocmd: `nvim <path>` opens just the file, and the tree
is there on <leader>e when it is wanted. Placing it on the right also
flips the split direction, so opening a file from the tree puts it to
the left rather than displacing the tree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonny Barnes 2026-08-08 20:36:39 +01:00
commit d245a83f2c
No known key found for this signature in database
3 changed files with 17 additions and 0 deletions

View file

@ -1,4 +1,5 @@
require('config.plugins.fzf-lua')
require('config.plugins.gitsigns')
require('config.plugins.nvim-tree')
require('config.plugins.web-devicons')
require('config.plugins.which-key')

View file

@ -0,0 +1,12 @@
-- Must be set before netrw loads, which happens after init.lua is sourced.
-- nvim-tree takes over directory buffers, so `nvim .` opens the tree.
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.pack.add({ 'https://github.com/nvim-tree/nvim-tree.lua' })
require('nvim-tree').setup({
view = { side = 'right' },
})
vim.keymap.set('n', '<leader>e', '<Cmd>NvimTreeToggle<CR>', { desc = 'Toggle file tree' })