You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're new to Nvim lua programming, take a look at Neovim Plugins Challenges (thanks @uanela) for some excercises to get you started on a variety of APIs, options and use cases.
Clean Room
It is strongly advised to develop in a "clean room" using the minimal configuration, so that your plugins and other customisations don't interfere with nvim-tree.
See bug report for some background on the minimal configuration.
cp .github/ISSUE_TEMPLATE/nvt-min.lua /tmp
Change
"nvim-tree/nvim-tree.lua",
to your fork e.g.
"~/src/nvim-tree.lua.myfork",
Run with
nvim -nu /tmp/nvt-min.lua
Lua Language Server
luals is strongly advised during development. It provides autocomplete, navigation etc. as well as diagnostics.
scripts/luals-check.sh is run during CI and must return no issues.
EmmyLuaCodeStyle is the default lua-language-server formatter. It's CodeFormat utility is used for CI and CLI styling.
You can format via the standard vim.lsp.buf.format()
A convenience function and mapping:
localfunctionformat()
-- use LSP formatting if available for this bufferfor_, clientinipairs(vim.lsp.get_clients({ bufnr=0 })) doifclient.server_capabilities.documentFormattingProviderthenvim.lsp.buf.format()
returnendend-- fall back to vim nativevim.cmd([[silent! norm! gg=G``]])
endvim.keymap.set("n", "<leader>f", format, { desc="format" })
Setup may be run many times by the user and you are encouraged to test it.
:lua_G.setup()
OS Feature Flags
OS may be tested via utils.lua convenience fields.
Windows
Please ensure that windows specific fixes and features are behind the appropriate feature flag(s).
e.g.
--- path is an executable file or directory---@paramabsolute_pathstring---@returnbooleanfunctionM.is_executable(absolute_path)
ifM.is_windowsorM.is_wslthen--- executable detection on windows is buggy and not performant hence it is disabledreturnfalseelsereturnvim.loop.fs_access(absolute_path, "X") orfalseend