feat: expose TabsVim_* public functions, remove all OOTB keybindings#11
Conversation
Defines the decision to expose TabsVim_* public functions and remove all OOTB keybindings except mouse DnD infrastructure. Documents the full public function API, recommended vimrc wiring, and trade-off notes for g<number>, <C-]>, and terminal navigation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Promotes functions with real logic to public API (ToggleHorizTerm, ToggleVertTerm, NewTabTerm, CloseOrHide, RenameBuffer, FzfOpenInTab). Removes all nnoremap/tnoremap bindings from the plugin — mouse DnD infrastructure is the only OOTB behavior retained. Simple native commands (tabnew, sp, tabonly, etc.) are documented as direct vimrc mappings with no wrapper. Updates ADR-004 and key-binding SPEC. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors tabs.vim to stop installing user keymaps by default and instead exposes a small public TabsVim_* function API, with new documentation (SPEC + ADR) describing recommended user-side vimrc mappings and the rationale for removing hard-coded bindings.
Changes:
- Removed all user-facing OOTB keybindings from
plugin/tabs.vimand promoted several script-local operations to publicTabsVim_*functions. - Added a new key-binding SPEC documenting the public API and suggested vimrc wiring patterns.
- Added ADR-004 documenting the decision/trade-offs for keybinding cleanup.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| plugin/tabs.vim | Removes hard-coded mappings and exposes public TabsVim_* functions for terminal/window/buffer operations and fzf integration. |
| docs/specs/key-binding.md | New SPEC describing “no OOTB keybindings” posture, public function API, and recommended vimrc mappings. |
| docs/adrs/004.tabs-vim.keybinding-cleanup.md | New ADR explaining why keybindings were removed and why a public function API is the preferred contract. |
Comments suppressed due to low confidence (1)
plugin/tabs.vim:80
TabsVim_CloseOrHide()useswinnr('$') == 1to decide whether to prompt andqall!.winnr('$')is per tab page, so this will incorrectly prompt to quit when closing the only window in a tab even if other tabs exist. Consider checking bothtabpagenr('$') == 1andwinnr('$') == 1(or an equivalent “last tab + last window” condition) before prompting/qall!, and otherwise just close the window/tab normally.
function! TabsVim_CloseOrHide() abort
if winnr('$') == 1
if confirm('Quit Vim?', "&Yes\n&No", 2) == 1
qall!
endif
return
endif
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- TabsVim_CloseOrHide: check tabpagenr('$')==1 && winnr('$')==1 before
quit prompt so closing last window in a tab doesn't wrongly quit Vim
- TabsVim_CloseOrHide: only toggle-hide tracked terminal bufnrs; untracked
terminals (e.g. tab terminals) now fall back to plain close
- TabsVim_FzfOpenInTab: guard against missing fzf.vim with clear warning
- key-binding SPEC: clarify "no user-facing keybindings" to avoid
contradiction with internal F30/F31 DnD aliases
- key-binding SPEC: mark all features as done (✅)
- tabs.vim SPEC: add reference to key-binding SPEC in Related Specs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Addressed all Copilot review comments in 770f02b: plugin/tabs.vim:107 — plugin/tabs.vim:77 — plugin/tabs.vim:80 (suppressed) — docs/specs/key-binding.md:21 — Rephrased to "no user-facing keybindings"; clarified that docs/specs/key-binding.md:129 — Features table updated to ✅ since this PR implements all three items. docs/adrs/004:55 — Updated docs/specs/key-binding.md:35,43,49 / docs/adrs/004:45 — The |
Summary
TabsVim_*function API:ToggleHorizTerm,ToggleVertTerm,NewTabTerm,CloseOrHide,RenameBuffer,FzfOpenInTab:tabnew,:sp,:tabonly, etc.) are documented as direct vimrc mappings — no wrapper exposedkey-bindingSPEC documenting the public API, recommended vimrc wiring, and trade-off notes forg<number>and<C-]>Test plan
TabsVim_ToggleHorizTerm/TabsVim_ToggleVertTermtoggle persistent split terminalsTabsVim_NewTabTermopens terminal in a new tab withnobuflistedTabsVim_CloseOrHideprompts on last window, hides terminal, closes normal splitTabsVim_RenameBufferprompts and renames bufferTabsVim_FzfOpenInTabopens fzf with tabedit sink (requires fzf.vim)