Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2061b93
docs(#3088): extract api/tree.lua
alex-courtis Jan 17, 2026
c689008
docs(#3088): extract api/tree.lua
alex-courtis Jan 17, 2026
521e467
docs(#2934): move help diff check after lint
alex-courtis Jan 17, 2026
10be08b
docs(#3088): update api.tree references, remove old doc
alex-courtis Jan 17, 2026
060455e
docs(#3088): extract api/config/mappings.lua
alex-courtis Jan 17, 2026
4292f97
docs(#3088): api.config.mappings -> api.map
alex-courtis Jan 18, 2026
6f2551b
docs(#3088): extract api/filter.lua
alex-courtis Jan 18, 2026
2201bb0
docs(#3088): move api.git into api.tree
alex-courtis Jan 18, 2026
052d39f
docs(#3088): extract api/health.lua, tidy formatting
alex-courtis Jan 18, 2026
fdba900
docs(#3088): extract api/health.lua, tidy formatting
alex-courtis Jan 18, 2026
cdf1148
docs(#3088): remove command descriptions, show lua, link to api
alex-courtis Jan 18, 2026
8169547
docs(#3088): extract api/marks.lua
alex-courtis Jan 18, 2026
ac9424a
docs(#3088): remove completed legacy api.lua members
alex-courtis Jan 18, 2026
3a08fa2
docs(#3088): extract api/events.lua
alex-courtis Jan 18, 2026
219984a
docs(#3088): extract api/events.lua
alex-courtis Jan 18, 2026
0ad171b
docs(#3088): extract api/fs.lua
alex-courtis Jan 18, 2026
56e61c2
docs(#3088): extract api/commands.lua
alex-courtis Jan 18, 2026
3c65e3f
docs(#3088): extract api/node.lua functions, doc TODO
alex-courtis Jan 18, 2026
9a8fb71
docs(#3088): move all nvim-tree-api to generated doc
alex-courtis Jan 18, 2026
e9b5ca6
docs(#3088): old api is now impl, use new api
alex-courtis Jan 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ M.self = false

M.ignore = {
"631", -- max_line_length
"212", -- TODO #3088 make luacheck understand @meta
}

-- Global objects defined by the C code
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ help-update:
# --ignore-blank-lines is used as nightly has removed unnecessary blank lines that stable (0.11.5) currently inserts
#
help-check: help-update
git diff --ignore-blank-lines --exit-code doc/nvim-tree-lua.txt
@scripts/lintdoc.sh
git diff --ignore-blank-lines --exit-code doc/nvim-tree-lua.txt


.PHONY: all lint style check luacheck style-check style-doc luals style-fix help-update help-check
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ local function my_on_attach(bufnr)
end

-- default mappings
api.config.mappings.default_on_attach(bufnr)
api.map.default_on_attach(bufnr)

-- custom mappings
vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
Expand Down
4,096 changes: 1,998 additions & 2,098 deletions doc/nvim-tree-lua.txt

Large diffs are not rendered by default.

51 changes: 0 additions & 51 deletions lua/nvim-tree/_meta/api.lua

This file was deleted.

5 changes: 5 additions & 0 deletions lua/nvim-tree/_meta/api_decorator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ local nvim_tree = { api = { decorator = {} } }
---Names of builtin decorators or your decorator classes. Builtins are ordered lowest to highest priority.
---@alias nvim_tree.api.decorator.Name "Git" | "Opened" | "Hidden" | "Modified" | "Bookmarks" | "Diagnostics" | "Copied" | "Cut" | nvim_tree.api.decorator.UserDecorator

---A string for rendering, with optional highlight groups to apply to it
---@class (exact) nvim_tree.api.HighlightedString
---@field str string
---@field hl string[]

---Custom decorator, see :help nvim-tree-decorators
---
---@class (exact) nvim_tree.api.decorator.UserDecorator
Expand Down
2 changes: 1 addition & 1 deletion lua/nvim-tree/_meta/config/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ error("Cannot require a meta file")



---Configure [nvim-tree-api.tree.expand_all()] and [nvim-tree-api.node.expand()]
---Configure [nvim_tree.api.tree.expand_all()] and [nvim_tree.api.node.expand()]
---@class nvim_tree.Config.Actions.ExpandAll
---
---Limit the number of folders being explored when expanding every folder. Avoids hanging Nvim when running this action on very large folders.
Expand Down
14 changes: 7 additions & 7 deletions lua/nvim-tree/_meta/config/filters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ error("Cannot require a meta file")
---
---Filters can be set at startup or toggled live via API with default mappings.
---
---`I `{git_ignored}` `|nvim-tree-api.tree.toggle_gitignore_filter()|
---`I `{git_ignored}` `|nvim_tree.api.tree.toggle_gitignore_filter()|
---Ignore files based on `.gitignore`. Requires |nvim_tree.Config.Git|
---
---`H `{dotfiles}` `|nvim-tree-api.tree.toggle_hidden_filter()|
---`H `{dotfiles}` `|nvim_tree.api.tree.toggle_hidden_filter()|
---Filter dotfiles: files/directories starting with a `.`
---
---`C `{git_clean}` `|nvim-tree-api.tree.toggle_git_clean_filter()|
---`C `{git_clean}` `|nvim_tree.api.tree.toggle_git_clean_filter()|
---Filter files with no git status. `.gitignore` files will not be filtered when {git_ignored}, as they are effectively dirty.
---
---`B `{no_buffer}` `|nvim-tree-api.tree.toggle_no_buffer_filter()|
---`B `{no_buffer}` `|nvim_tree.api.tree.toggle_no_buffer_filter()|
---Filter files that have no |buflisted()| buffer. For performance reasons buffer delete/wipe may not be immediately shown. A reload or filesystem event will always result in an update.
---
---`M `{no_bookmark}` `|nvim-tree-api.tree.toggle_no_bookmark_filter()|
---`M `{no_bookmark}` `|nvim_tree.api.tree.toggle_no_bookmark_filter()|
---Filter files that are not bookmarked. Enabling this is not useful as there is no means yet to persist bookmarks.
---
---`U `{custom}` `|nvim-tree-api.tree.toggle_custom_filter()|
---`U `{custom}` `|nvim_tree.api.tree.toggle_custom_filter()|
---Disable specific file/directory names via:
---- a list of backslash escaped |vim.regex| strings e.g. `"^\\.git""`
---- a function passed the absolute path of the directory.
---
---All filters including live filter may be disabled via {enable} and toggled with |nvim-tree-api.tree.toggle_enable_filters()|
---All filters including live filter may be disabled via {enable} and toggled with |nvim_tree.api.tree.toggle_enable_filters()|
---
---Files/directories may be {exclude}d from filtering: they will always be shown, overriding {git_ignored}, {dotfiles} and {custom}.
---@class nvim_tree.Config.Filters
Expand Down
2 changes: 1 addition & 1 deletion lua/nvim-tree/actions/tree/find-file.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local finders_find_file = require("nvim-tree.actions.finders.find-file")
local M = {}

--- Find file or buffer
---@param opts ApiTreeFindFileOpts|nil|boolean legacy -> opts.buf
---@param opts nvim_tree.api.tree.find_file.Opts|nil|boolean legacy -> opts.buf
function M.fn(opts)
-- legacy arguments
if type(opts) == "string" then
Expand Down
6 changes: 3 additions & 3 deletions lua/nvim-tree/actions/tree/modifiers/collapse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

---Collapse a node, root if nil
---@param node Node?
---@param opts ApiCollapseOpts
---@param opts nvim_tree.api.tree.collapse.Opts
local function collapse(node, opts)
local explorer = core.get_explorer()
if not explorer then
Expand Down Expand Up @@ -60,7 +60,7 @@ local function collapse(node, opts)
end


---@param opts ApiCollapseOpts|boolean|nil legacy -> opts.keep_buffers
---@param opts nvim_tree.api.tree.collapse.Opts|boolean|nil legacy -> opts.keep_buffers
function M.all(opts)
-- legacy arguments
if type(opts) == "boolean" then
Expand All @@ -73,7 +73,7 @@ function M.all(opts)
end

---@param node Node
---@param opts ApiCollapseOpts?
---@param opts nvim_tree.api.tree.collapse.Opts?
function M.node(node, opts)
collapse(node, opts or {})
end
Expand Down
6 changes: 3 additions & 3 deletions lua/nvim-tree/actions/tree/modifiers/expand.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ local function gen_iterator(should_descend)
end

---@param node Node?
---@param expand_opts ApiTreeExpandOpts?
---@param expand_opts nvim_tree.api.tree.expand.Opts?
local function expand_node(node, expand_opts)
if not node then
return
Expand All @@ -141,14 +141,14 @@ end

---Expand the directory node or the root
---@param node Node
---@param expand_opts ApiTreeExpandOpts?
---@param expand_opts nvim_tree.api.tree.expand.Opts?
function M.all(node, expand_opts)
expand_node(node and node:as(DirectoryNode) or core.get_explorer(), expand_opts)
end

---Expand the directory node or parent node
---@param node Node
---@param expand_opts ApiTreeExpandOpts?
---@param expand_opts nvim_tree.api.tree.expand.Opts?
function M.node(node, expand_opts)
if not node then
return
Expand Down
2 changes: 1 addition & 1 deletion lua/nvim-tree/actions/tree/open.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local finders_find_file = require("nvim-tree.actions.finders.find-file")
local M = {}

---Open the tree, focusing if already open.
---@param opts ApiTreeOpenOpts|nil|string legacy -> opts.path
---@param opts nvim_tree.api.tree.open.Opts|nil|string legacy -> opts.path
function M.fn(opts)
-- legacy arguments
if type(opts) == "string" then
Expand Down
2 changes: 1 addition & 1 deletion lua/nvim-tree/actions/tree/resize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local view = require("nvim-tree.view")
local M = {}

---Resize the tree, persisting the new size.
---@param opts ApiTreeResizeOpts|nil
---@param opts nvim_tree.api.tree.resize.Opts|nil
function M.fn(opts)
if opts == nil then
-- reset to config values
Expand Down
2 changes: 1 addition & 1 deletion lua/nvim-tree/actions/tree/toggle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local finders_find_file = require("nvim-tree.actions.finders.find-file")
local M = {}

---Toggle the tree.
---@param opts ApiTreeToggleOpts|nil|boolean legacy -> opts.find_file
---@param opts nvim_tree.api.tree.toggle.Opts|nil|boolean legacy -> opts.find_file
---@param no_focus string|nil legacy -> opts.focus
---@param cwd boolean|nil legacy -> opts.path
---@param bang boolean|nil legacy -> opts.update_root
Expand Down
Loading
Loading