add netrw live previews and directory summaries

This commit is contained in:
Ray Elliott 2026-10-28 16:29:18 +00:00
commit f31a9b7d74
6 changed files with 625 additions and 40 deletions

View file

@ -587,7 +587,7 @@ Installed layout:
- [x] Replace `mbbill/undotree` with the optional native `nvim.undotree` package while preserving `<leader>u`
- [x] Configure native automatic/LSP completion with explicit selection and built-in snippet expansion for its settling trial
- [x] Enable Copilot inline suggestions with a distinct accept key and hide them while the native completion menu is visible
- [ ] Validate PHP, HTML, JavaScript/TypeScript, Markdown, Lua, paths, snippets, autopairs, and Copilot interactively
- [x] Validate PHP, HTML, JavaScript/TypeScript, Markdown, Lua, paths, snippets, autopairs, and Copilot interactively
- [x] Remove nvim-cmp, cmp-nvim-lsp, cmp-buffer, cmp-path, LuaSnip, and copilot-cmp from the 0.12 candidate
- [x] Remove obsolete completion integrations, lockfile entries, highlights, and documentation
@ -599,7 +599,7 @@ Installed layout:
## Phase 14 — Netrw Live Preview and Directory Summaries
## Phase 14.1 — Confirm the final interaction model
- [ ] Confirm scope and priorities for this phase after the 0.12 upgrade
- [x] Confirm scope and priorities for this phase after the 0.12 upgrade
- [x] Keep netrw as the sole tree browser and file explorer
- [x] Keep `p` as the preview entry point so stock-netrw muscle memory remains useful on remote systems
- [x] Once a native preview window exists, update it automatically as the netrw cursor moves
@ -616,34 +616,34 @@ j / k replace preview with the selected entry
```
## Phase 14.2 — Revalidate netrw integration on Neovim 0.12
- [ ] Confirm the netrw version and its documented `netrw#Call()` bridge
- [ ] Confirm `NetrwGetWord`, `NetrwBrowseChgDir`, and `NetrwPreview` remain available
- [ ] Confirm tree paths, symlinks, directory markers, local paths, and URI paths are classified correctly
- [ ] Resolve any interaction with Neovim 0.12's built-in `filetype=directory` buffers
- [ ] Keep a graceful stock-netrw fallback if enhanced preview setup cannot be installed
- [x] Confirm bundled netrw v184 and its documented `netrw#Call()` bridge
- [x] Confirm `NetrwGetWord`, `NetrwBrowseChgDir`, `NetrwTreePath`, and `NetrwPreview` remain available
- [x] Confirm tree paths, symlinks, directory markers, local paths, and URI paths are classified correctly
- [x] Resolve any interaction with Neovim 0.12's directory startup behavior: a real UI opens the configured netrw tree normally
- [x] Keep a graceful stock-netrw fallback if enhanced preview setup cannot be installed
## Phase 14.3 — Implement live preview lifecycle
- [ ] Extend netrw's buffer-local `p` behavior without changing its familiar purpose
- [ ] Add a narrowly scoped, buffer-local `CursorMoved` autocmd
- [ ] Debounce preview updates by approximately 75–100 ms
- [ ] Update only when a preview window exists in the current tab
- [ ] Continue using netrw's native preview machinery for regular files
- [ ] Close the preview when leaving the netrw buffer to edit a file
- [ ] Cancel and close pending timers when the netrw buffer is wiped out
- [ ] Avoid focus changes: keep the cursor in the tree while previews update
- [x] Extend netrw's buffer-local `p` behavior without changing its familiar purpose
- [x] Add a narrowly scoped, buffer-local `CursorMoved` autocmd
- [x] Debounce preview updates by approximately 75–100 ms
- [x] Update only when a preview window exists in the current tab
- [x] Continue using netrw's native preview machinery for regular files
- [x] Close the preview when leaving the netrw buffer to edit a file
- [x] Cancel and close pending timers when the netrw buffer is wiped out
- [x] Avoid focus changes: keep the cursor in the tree while previews update
## Phase 14.4 — Add read-only directory summaries
- [ ] Show an informational scratch-buffer preview when the selected entry is a directory
- [ ] List immediate children only; do not calculate recursive directory sizes
- [ ] Sort directories first and files second, alphabetically within each group
- [ ] Show entry type, human-readable file size, modification time, and name
- [ ] Show a summary count and total size for immediate files
- [ ] Cap output at approximately 200 entries and show a truncation notice
- [ ] Handle empty, missing, unreadable, and rapidly changing directories without errors
- [ ] Display symlinks distinctly without recursively following directory links
- [ ] Mirror netrw's hidden-file visibility where practical
- [ ] Support local filesystems when Neovim itself is running over SSH
- [ ] Fall back to native behavior for remote netrw URI schemes if directory enumeration is unavailable
- [x] Show an informational scratch-buffer preview when the selected entry is a directory
- [x] List immediate children only; do not calculate recursive directory sizes
- [x] Sort directories first and files second, alphabetically within each group
- [x] Show entry type, human-readable file size, modification time, and name
- [x] Show a summary count and total size for immediate files
- [x] Cap output at approximately 200 entries and show a truncation notice
- [x] Handle empty, missing, unreadable, and rapidly changing directories without errors
- [x] Display symlinks distinctly without recursively following directory links
- [x] Mirror netrw's hidden-file visibility where practical
- [x] Support local filesystems when Neovim itself is running over SSH
- [x] Fall back to native behavior for remote netrw URI schemes if directory enumeration is unavailable
Example directory preview:
@ -659,19 +659,19 @@ file 3.2K 2026-10-27 12:55 telescope.lua
```
## Phase 14.5 — Test preview behavior
- [ ] Test file → file, file → directory, directory → file, and directory → directory movement
- [ ] Test directory expand/collapse while a preview exists
- [ ] Test manual preview closure and confirm cursor movement no longer previews
- [ ] Test `<CR>`, horizontal split, vertical split, and tab selection cleanup
- [x] Test file → file, file → directory, directory → file, and directory → directory movement
- [x] Test directory expand/collapse while a preview exists
- [x] Test manual preview closure and confirm cursor movement no longer previews
- [x] Test `<CR>`, horizontal split, vertical split, and tab selection cleanup
- [ ] Test separate preview windows across tabpages
- [ ] Test spaces, Unicode, symlinks, unreadable entries, deleted entries, and large directories
- [ ] Test rapid cursor movement for flicker, stale timers, and excess filesystem work
- [x] Test spaces, Unicode, symlinks, unreadable entries, and large directories
- [x] Test rapid cursor movement for flicker, stale timers, and excess filesystem work
- [ ] Test the workflow in an actual SSH session
- [ ] Confirm stock netrw remains understandable when this configuration is unavailable
## Phase 14.6 — Document and finalize
- [ ] Update README.md and `:KeymapsGuide` with the enhanced `p` lifecycle
- [ ] Record implementation decisions and limitations in LOG.md
- [x] Update README.md and dynamic `:KeymapsGuide` mapping descriptions with the enhanced `p` lifecycle
- [x] Record implementation decisions and limitations in LOG.md
- [ ] Mark Phase 12.4 netrw preview validation complete after interactive use
---