- Notifications
You must be signed in to change notification settings - Fork610
A file explorer tree for neovim written in lua
License
nvim-tree/nvim-tree.lua
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Automatic updates
File type icons
Git integration
Diagnostics integration: LSP and COC
(Live) filtering
Cut, copy, paste, rename, delete, create
Highly customisable
Take a look at thewiki for Showcases, Tips, Recipes and more.
Questions and general support:Discussions
nvim-web-devicons is optional and used to display file icons. It requires apatched font. Your terminal emulator must be configured to use that font, usually "Hack Nerd Font"
Please install via your preferred package manager. SeeInstallation for specific package manager instructions.
nvim-tree/nvim-tree.lua
Major or minor versions may be specified via tags:v<MAJOR>
e.g.v1
orv<MAJOR>.<MINOR>
e.g.v1.23
nvim-tree/nvim-web-devicons
optional, for file icons
Disablingnetrw is strongly advised, see:help nvim-tree-netrw
Setup the plugin in yourinit.lua
-- disable netrw at the very start of your init.luavim.g.loaded_netrw=1vim.g.loaded_netrwPlugin=1-- optionally enable 24-bit colourvim.opt.termguicolors=true-- empty setup using defaultsrequire("nvim-tree").setup()-- OR setup with some optionsrequire("nvim-tree").setup({sort= {sorter="case_sensitive", },view= {width=30, },renderer= {group_empty=true, },filters= {dotfiles=true, },})
Open the tree::NvimTreeOpen
Show the mappings:g?
:help nvim-tree-mappings-default are applied by default however you may customise via |nvim-tree.on_attach| e.g.
localfunctionmy_on_attach(bufnr)localapi=require"nvim-tree.api"localfunctionopts(desc)return {desc="nvim-tree:"..desc,buffer=bufnr,noremap=true,silent=true,nowait=true }end-- default mappingsapi.config.mappings.default_on_attach(bufnr)-- custom mappingsvim.keymap.set('n','<C-t>',api.tree.change_root_to_parent,opts('Up'))vim.keymap.set('n','?',api.tree.toggle_help,opts('Help'))end-- pass to setup along with your other optionsrequire("nvim-tree").setup {---on_attach=my_on_attach,---}
Run:NvimTreeHiTest
to show all the highlights that nvim-tree uses.
They can be customised before or after setup is called and will be immediatelyapplied at runtime. e.g.
vim.cmd([[ :hi NvimTreeExecFile guifg=#ffa0a0 :hi NvimTreeSpecialFile guifg=#ff80ff gui=underline :hi NvimTreeSymlink guifg=Yellow gui=italic :hi link NvimTreeImageFile Title]])
See:help nvim-tree-highlight for details.
Basic commands:
:NvimTreeToggle
Open or close the tree. Takes an optional path argument.
:NvimTreeFocus
Open the tree if it is closed, and then focus on the tree.
:NvimTreeFindFile
Move the cursor in the tree for the current buffer, opening folders if needed.
:NvimTreeCollapse
Collapses the nvim-tree recursively.
nvim-tree is stable and new major features will not be added. The focus is on existing user experience.
Users are encouraged to add their own custom features via the publicAPI.
Development is focused on:
- Bug fixes
- Performance
- Quality of Life improvements
- API / Events
- Enhancements to existing features
nvim-tree exposes a public API. This is non breaking, with additions made as necessary. See:help nvim-tree-api
See wikiRecipes andTips for ideas and inspiration.
Please raise afeature request if the API is insufficient for your needs. Contributions are always welcome, see below.
You may also subscribe to events that nvim-tree will dispatch in a variety of situations, see:help nvim-tree-events
PRs are always welcome. SeeCONTRIBUTING andwiki: Development to get started.
Seebug andPR Please issues if you are looking for some work to get you started.
SeeShowcases wiki page for examples of user's configurations with sources.
Please add your own!
- @alex-courtis Arch Linux
- @gegoune macOS
- @Akmadan23 Linux
- @dependabot[bot] Ubuntu Linux
About
A file explorer tree for neovim written in lua