If you're using NvChad, a popular Neovim config framework, and you'd like your file explorer (NvimTree) to appear on the right side instead of the default left, here's how to do it.
Step-by-Step Instructions
- Open the following file in your config directory:
~/.config/nvim/lua/plugins/init.lua
- Add the following snippet to configure the position of NvimTree:
{
"nvim-tree/nvim-tree.lua",
opts = {
view = {
side = "right"
}
}
}
- Save the file and restart Neovim.
That’s it! NvimTree should now appear on the right-hand side of your screen.
Why Move NvimTree to the Right?
- Prevents code from shifting when toggling the tree — no layout disruption
- Allows you to enable/disable the tree without feeling distracted
- Better visual separation in widescreen monitors
If you ever want to move it back, just change "right"
to "left"
in the config.
Tip: Plugin syncing is automatically applied after a Neovim restart. No need to run additional commands.