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:
parent
865b52c2e5
commit
d245a83f2c
3 changed files with 17 additions and 0 deletions
12
neovim/config/plugins/nvim-tree.lua
Normal file
12
neovim/config/plugins/nvim-tree.lua
Normal 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' })
|
||||
Loading…
Reference in a new issue