Overview
Nvim-Tree is a file explorer written in Lua that provides a fast and feature-rich sidebar for navigating your project files. Plugin: nvim-tree.lua Config File:lua/user/nvim-tree.lua
Features
- Tree-style file navigation
- Git status integration
- LSP diagnostics integration
- Automatic CWD updating
- Custom icons and symbols
- Vim-style keybindings
Quick Start
Toggle File Explorer
Open/close NvimTree:Configuration
Automatic File Tracking
NvimTree automatically focuses on the current file and updates the working directory:Window Settings
The file tree opens on the left side with a fixed width:Icons and Glyphs
File Icons
Folder Icons
Git Status Icons
| Icon | Status |
|---|---|
| “ | Unstaged changes |
S | Staged changes |
| “ | Unmerged files |
➜ | Renamed files |
U | Untracked files |
| “ | Deleted files |
◌ | Ignored files |
LSP Diagnostics
NvimTree displays LSP diagnostics directly in the file tree:Key Mappings
Custom keybindings for navigating the tree:| Key | Action | Description |
|---|---|---|
l, <CR>, o | edit | Open file or expand directory |
h | close_node | Close directory |
v | vsplit | Open file in vertical split |
Default Mappings
In addition to custom mappings, NvimTree includes many default keybindings:a- Create new file/directoryd- Delete file/directoryr- Rename file/directoryx- Cut file/directoryc- Copy file/directoryp- Paste file/directoryR- Refresh treeH- Toggle hidden filesI- Toggle gitignore filesW- Collapse allS- Open system file manager
:help nvim-tree-mappings for a complete list.
Root Folder Display
The root folder displays only the directory name (not full path):Integration with Bufferline
The Bufferline configuration includes an offset for NvimTree:Customization
Change Tree Width
Open on Right Side
Disable Auto CWD Update
Add More Key Mappings
Disable Diagnostics
Custom Diagnostic Icons
Common Actions
Opening Files
<CR>orl- Open in current windowv- Open in vertical split- Add
smapping for horizontal split - Add
tmapping for new tab
Managing Files
a- Create new file (end with/for directory)d- Delete filer- Rename filex- Cut filec- Copy filep- Paste file
Navigation
h- Close folderl- Open folderP- Jump to parent directory-- Navigate up one directory
View Options
H- Toggle hidden filesI- Toggle gitignore filesR- Refresh treeW- Collapse all folders
Related Configuration
- Which-Key - Provides
<leader>eshortcut - Bufferline - Offset integration
- LSP - Diagnostic information

