* relative rename action * 🔥 remove debug print statement * 🐛 better handling of dot files Also pickout extension in filename with more one dot * 🔧 keymap e for relative-rename action * 📝 update help with relative-rename mapping * ✨ add API for rename_relative * 🚨 correct lint warnings * rename_relative -> rename_root * stylua * ♻️ use fnamemodify instead of custom logic * 💥 refactor renaming api using vim filename modifiers Rename API now supports filename modifiers as arguments, although only with limited support of options. The function signature however will allow improvements going forward. The API signature is backward compatible, although the behviour has changed as per the next comment. This change changes the default behaviour of the renames, rename_full is what rename was, rename now just renames the tail (i.e. the filename) * 🐛 make api rename, without args, functional * ✨ allow modifier argument to be used in API call * 📝 update documentation with new command name * rename-file.fn takes only a modifier as argument * add Api.fs.rename_basename, specify modifiers for rename, rename_sub * add Api.fs.rename_node * rename-file tidy allowed modifiers * 🐛 fix bugs after last refactoring rename ":t" and ":t:r" was moving file to root of project and not maintaining sub-directory * 🐛 correct absolute rename which was loosing sub-directory on rename * 🔥 remove debug print statements * stylua Co-authored-by: Alexander Courtis <alex@courtis.org> |
||
|---|---|---|
| .github | ||
| .hooks | ||
| doc | ||
| lua | ||
| scripts | ||
| .editorconfig | ||
| .luacheckrc | ||
| .luarc.json | ||
| .stylua.toml | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
A File Explorer For Neovim Written In Lua
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 the wiki for Showcases, Tips, Recipes and more.
Requirements
nvim-web-devicons is optional and used to display file icons. It requires a patched font. Your terminal emulator must be configured to use that font, usually "Hack Nerd Font"
Install
Install with vim-plug:
Plug 'nvim-tree/nvim-web-devicons' " optional, for file icons
Plug 'nvim-tree/nvim-tree.lua'
or with packer:
use {
'nvim-tree/nvim-tree.lua',
requires = {
'nvim-tree/nvim-web-devicons', -- optional, for file icons
},
tag = 'nightly' -- optional, updated every week. (see issue #1193)
}
Setup
Setup should be run in a lua file or in a lua heredoc :help lua-heredoc if using in a vim file.
-- examples for your init.lua
-- disable netrw at the very start of your init.lua (strongly advised)
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- set termguicolors to enable highlight groups
vim.opt.termguicolors = true
-- empty setup using defaults
require("nvim-tree").setup()
-- OR setup with some options
require("nvim-tree").setup({
sort_by = "case_sensitive",
view = {
adaptive_size = true,
mappings = {
list = {
{ key = "u", action = "dir_up" },
},
},
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
})
For complete list of available configuration options see :help nvim-tree-setup
Each option is documented in :help nvim-tree.OPTION_NAME. Nested options can be accessed by appending ., for example :help nvim-tree.view.mappings
Commands
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.
Mappings
nvim-tree comes with number of mappings; for default mappings please see :help nvim-tree-default-mappings, for way of configuring mappings see :help nvim-tree-mappings
g? toggles help, showing all the mappings and their actions.
Roadmap
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 public API.
Development is focused on:
- Bug fixes
- Performance
- Quality of Life improvements
- API / Events
- Enhancements to existing features
API
nvim-tree exposes a public API. This is non breaking, with additions made as necessary.
Please raise a feature request if the API is insufficent for your needs. Contributions are always welcome.
Events
Users may subscribe to events that nvim-tree will dispatch in a variety of situations.
Actions
Custom actions may be mapped which can invoke API or perform your own actions.
Contributing
PRs are always welcome. See wiki to get started.
See bug and PR Please issues if you are looking for some work to get you started.
Help Wanted
Developers with the following environments:
- Apple macOS
- Windows
- WSL
- msys
- powershell
Help triaging, diagnosing and fixing issues specific to those environments is needed, as the nvim-tree developers do not have access to or expertise in these environments.
Let us know you're interested by commenting on issues and raising PRs.
Screenshots
See Showcases wiki page for examples of user's configurations with sources.
Please add your own!