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
|
|
@ -1,4 +1,5 @@
|
||||||
require('config.plugins.fzf-lua')
|
require('config.plugins.fzf-lua')
|
||||||
require('config.plugins.gitsigns')
|
require('config.plugins.gitsigns')
|
||||||
|
require('config.plugins.nvim-tree')
|
||||||
require('config.plugins.web-devicons')
|
require('config.plugins.web-devicons')
|
||||||
require('config.plugins.which-key')
|
require('config.plugins.which-key')
|
||||||
|
|
|
||||||
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' })
|
||||||
|
|
@ -8,6 +8,10 @@
|
||||||
"rev": "31d6fb2d618bca1482b9f274751ead5f03461408",
|
"rev": "31d6fb2d618bca1482b9f274751ead5f03461408",
|
||||||
"src": "https://github.com/lewis6991/gitsigns.nvim"
|
"src": "https://github.com/lewis6991/gitsigns.nvim"
|
||||||
},
|
},
|
||||||
|
"nvim-tree.lua": {
|
||||||
|
"rev": "b2aadda94b107480c48e548d6db51c6840b7b33c",
|
||||||
|
"src": "https://github.com/nvim-tree/nvim-tree.lua"
|
||||||
|
},
|
||||||
"nvim-web-devicons": {
|
"nvim-web-devicons": {
|
||||||
"rev": "2ae6958df7ced50baac5035cec0c15799eedfbf7",
|
"rev": "2ae6958df7ced50baac5035cec0c15799eedfbf7",
|
||||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue