diff --git a/neovim/README.md b/neovim/README.md index 598d131..a9bdada 100644 --- a/neovim/README.md +++ b/neovim/README.md @@ -47,6 +47,12 @@ machine gets the same set. not shift the text sideways. - **netrw is disabled** and nvim-tree takes over directory buffers, so `nvim .` opens the tree rather than netrw. The tree opens on the **right**. +- **The tree shows gitignored files**, unlike nvim-tree's default — so `.env` is + visible, at the cost of `vendor/`, `node_modules/` and friends also showing. + `I` in the tree hides them again for the session. +- **The tree follows the current buffer**, expanding folders to reveal whatever + you open — including files opened from fzf-lua. It does not change the tree + root to do so, so opening a file from outside the root won't reveal it. - **Diagnostic signs are letters** (`E` `W` `I` `H`) rather than icons, and do not update while you are in insert mode. diff --git a/neovim/config/plugins/nvim-tree.lua b/neovim/config/plugins/nvim-tree.lua index 99318bc..b77fd5a 100644 --- a/neovim/config/plugins/nvim-tree.lua +++ b/neovim/config/plugins/nvim-tree.lua @@ -7,6 +7,12 @@ vim.pack.add({ 'https://github.com/nvim-tree/nvim-tree.lua' }) require('nvim-tree').setup({ view = { side = 'right' }, + -- nvim-tree hides gitignored files by default; show them, so things like + -- .env are visible. `I` in the tree toggles this back off per session. + filters = { git_ignored = false }, + -- Reveal the current buffer in the tree on BufEnter, expanding folders to + -- get to it, so opening a file from fzf-lua moves the tree with you. + update_focused_file = { enable = true }, }) vim.keymap.set('n', 'e', 'NvimTreeToggle', { desc = 'Toggle file tree' })