Imported from beardedsakimonkey/nvim-dora (
AGENTS.md). Install upstream withnpx skills add beardedsakimonkey/nvim-dora. Copyright stays with the author.
Repository Notes
- Run the full smoke suite with
./scripts/smoke.sh. The tests live inscripts/tests/*.lua, one file per area, run in order byscripts/smoke.lua; run a single file withDORA_TEST_FILE=scripts/tests/<name>.luausing the nvim invocation fromscripts/smoke.sh(later files may assume state left by earlier ones, so the full suite is authoritative). - When running the smoke suite from Codex, use sandbox escalation. Neovim's filesystem watchers may repeatedly fire inside the sandbox and stall the run.
- Regenerate README config docs with
PANVIMDOC_DIR=~/code/panvimdoc ./scripts/docs.sh. - For ad hoc headless Neovim checks, set
NVIM_LOG_FILE=/dev/nullto avoid creatingnvim.login the repo and useset noswapfileto prevent swap-file errors. - When running
lua-language-server --checkdirectly, setVIMRUNTIMEfrom Neovim first. Otherwise$VIMRUNTIME/luain.luarc.jsondoes not resolve and LuaLS reports spurious undefined Neovim/LSP types. For example:VIMRUNTIME="$(NVIM_LOG_FILE=/dev/null nvim --headless -u NONE -i NONE --noplugin \ -c 'set noswapfile' -c 'lua io.stdout:write(vim.env.VIMRUNTIME)' -c qa)" \ lua-language-server --check=. --checklevel=Hint --configpath=.luarc.json \ --logpath="${TMPDIR:-/tmp}/dora-luals-log" \ --metapath="${TMPDIR:-/tmp}/dora-luals-meta"
Architecture
Each dora window is a session: a scratch buffer named after the browsed
directory, with a DoraState (cwd, cached listings, filter, marks) registered
in dora/store.lua. Actions mutate that state or the filesystem, then
re-render. The modules:
plugin/dora.lua—:Dora, highlight defaults, and the directory auto-open autocmd. Requires no dora module until a command or autocmd fires.lua/dora.lua— the config table andconfigure(). Modules capturerequire'dora'.configat require time, so the table is merged in place and never reassigned.lua/dora/api.lua— every user-facing action (M.*), addressable by name from the keymap config. Also owns session-global state: expanded directories, cut/copy marks, trash history.lua/dora/actions.lua— metadata registry for built-in actions (description, help section, visual variant); keymaps.lua and help_win.lua derive their tables from it.lua/dora/view.lua— the render pipeline: listing cache (with fs watchers) → tree/filter rows → buffer text + extmarks; also cursor placement.lua/dora/tree.lua— operations on the expanded-directories set (folding, and following renames/restores).lua/dora/store.lua— dora buffer →DoraStateregistry.lua/dora/fs.lua— filesystem ops, sync and async; renames editor buffers so they follow moved files.lua/dora/lsp.lua— native LSPwillRenameFiles/didRenameFileshandling, including server registration filters.lua/dora/buffer.lua— dora buffer creation/naming and the buffer-follows-file renames.lua/dora/keymaps.lua— installs keymaps and prefix-hint windows; requires api.lua lazily to avoid a require cycle.lua/dora/ui/{confirm,filter,help,info,preview,prompt}.lua— UI windows, sharinglua/dora/ui/window.luafor float layout.
Adding an action
- Implement
M.<name>()inlua/dora/api.lua(plus a<name>_visualvariant if it should act on visual selections). - Register it in
lua/dora/actions.luawith a description, help section, and (if any) its visual variant. - To ship a default mapping, add it to the keymaps in
lua/dora.luaand regenerate docs with./scripts/docs.sh. - Cover it in the smoke suite (
scripts/tests/).