parity(6): insert-mode <Tab>/<S-Tab> table cell nav

`<Tab>` / `<S-Tab>` in insert mode navigate between table cells when
the cursor is on a `|…|` row, otherwise they pass through to their
default insert-mode behaviour (literal tab / shift-tab). Same
`<expr>`-mapping idiom as Cluster 5's smart_return.

  <Tab>    next cell; creates a fresh row below if past the last cell
  <S-Tab>  previous cell; no-op past the first

Cursor lands immediately after the destination cell's leading `|`,
matching upstream vimwiki's `vimwiki#tbl#go_*_cell` behaviour.

Both Lua and VimL counterparts wired into ftplugin's existing
table_editing block (gated alongside `gqq`/`<A-Left>`).

Tests: 4 new in scripts/test-keymaps.lua — next cell, new-row
overflow, previous cell, and pass-through outside a table.

Gates: 421 Rust / 39 Neovim / 12 Vim.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-12 21:37:53 +00:00
parent e347f605ff
commit 2562a046db
5 changed files with 172 additions and 0 deletions
+9
View File
@@ -261,6 +261,15 @@ function M.attach(bufnr, mappings)
{ desc = 'nuwiki: smart return (insert)', expr = true }, bufnr)
end
-- ===== Insert-mode table navigation (Cluster 6) =====
-- Gated under `table_editing` since it's the same surface.
if on('table_editing') then
map('i', '<Tab>', cmd.smart_tab,
{ desc = 'nuwiki: next table cell (insert)', expr = true }, bufnr)
map('i', '<S-Tab>', cmd.smart_shift_tab,
{ desc = 'nuwiki: prev table cell (insert)', expr = true }, bufnr)
end
-- ===== Header levels + nav =====
if on('headers') then
-- vimwiki defaults — buffer-local so they don't clash globally.