Skip to content

feat(buffers): add vim buffer command parity - #300

Merged
fcoury-oai merged 1 commit into
fcoury/enewfrom
fcoury/buffer-command-parity
Aug 21, 2026
Merged

fcoury-oai merged 1 commit into
fcoury/enewfrom
fcoury/buffer-command-parity

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

#299 adds :enew, but unnamed buffers still lack the surrounding Vim workflow for opening splits, listing and selecting buffers, assigning filenames, and saving drafts. Existing name-based picker selection also cannot distinguish multiple [No Name] buffers, and mistyped colon commands can expand into unrelated destructive actions.

Stacked on #299.

  • Add :new, :vnew, and Ctrl-w n for fresh unnamed buffers in splits, including optional file paths.
  • Add :b/:buffer, :b#, :bnext, :bprevious, and :ls/:buffers/:files with stable buffer numbers, alternate-buffer selection, and ambiguity checks.
  • Add :file {path} to name a buffer without writing and :saveas {path} to write it under a new name; include filename completion for the new commands.
  • Expose stable buffer IDs through the plugin API and update the buffer picker to distinguish and select duplicate unnamed buffers.
  • Reject unknown colon commands without expanding them into accidental writes, reloads, splits, or deletions; preserve the intentional :wq shortcut.

How to Test

  1. Run :new and :vnew, then :ls; confirm each new split has its own numbered [No Name] buffer. Switch with :b <number> and :b#, and confirm the buffer picker opens the selected unnamed buffer rather than another buffer with the same display name.
  2. Modify an unnamed buffer and run :file notes.txt; confirm the buffer is named without creating a file or clearing its unsaved changes. Run :saveas notes.txt; confirm the file is written and the buffer becomes clean.
  3. Modify an existing file without saving, then run :eneww or :lss; confirm the command is rejected and the unsaved buffer, disk contents, and window layout remain unchanged.
  4. Run cargo test --test editing buffer and cargo test --lib buffer_picker_lists_and_opens_existing_buffers; expect the buffer-command and duplicate-unnamed-picker regressions to pass.

@fcoury-oai
fcoury-oai merged commit 6a086d5 into fcoury/enew Aug 21, 2026
1 check passed
@fcoury-oai
fcoury-oai deleted the fcoury/buffer-command-parity branch August 21, 2026 21:51
fcoury-oai added a commit that referenced this pull request Aug 21, 2026
* feat(buffers): add unnamed buffer creation

* feat(buffers): add vim buffer command parity (#300)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant