Added
- Custom surround pairs (
vim.obsidian.surround/surroundmap) — define custom single-character triggers that map to arbitrary delimiter strings, with fullys/ds/cssupport including multi-character delimiters (#36)vim.obsidian.surround.set("l", { left = "[[", right = "]]" })— register a custom pairvim.obsidian.surround.del("l")— remove a custom pairvim.obsidian.surround.add({ { "l", left = "[[", right = "]]" }, { "m", left = "$$", right = "$$" } })— batch registration- Vimrc:
surroundmap l [[ ]]/surroundunmap l - Reserved characters (`( ) [ ] { } < > b B r a t T f F " ' ``) are rejected with a descriptive error
- Requires fork mode (bundled vim engine) — custom pairs are registered via
Vim.registerSurroundPair()on the codemirror-vim fork - Fork:
customSurroundPairsregistry,findSurroundingMultiChar()algorithm for multi-char delimiter matching,openWidth/closeWidthsupport indeleteSurroundPair/changeSurroundPair - Plugin:
src/lua/api.ts(vim.obsidian.surroundsub-table),src/vimrc/parser.ts+src/vimrc/loader.ts(surroundmap/surroundunmapcommands),src/main.ts(applyLuaSurroundPairslifecycle)
vim.obsidian.cursor.set()— structured cursor shape configuration — set per-mode cursor shapes via a Lua table instead of theguicursorformat stringvim.obsidian.cursor.set({ normal = "block", insert = "bar", operator_pending = "underline" })— partial tables allowed- Valid shapes:
block,bar,underline,hollow - Equivalent to
vim.opt.guicursorbut uses a table API - Plugin:
src/lua/api.ts(onCursorConfigcallback,vim.obsidian.cursorsub-table)
vim.obsidian.modeprompt.set()— batch mode prompt configuration — set status bar mode text for multiple modes in a single callvim.obsidian.modeprompt.set({ normal = "NOR", insert = "INS", visual_line = "V-LN" })— partial tables allowed- 11 mode keys supported with snake_case Lua names mapped to camelCase settings keys
- Equivalent to setting individual
vim.g.mode_prompt_*variables - Plugin:
src/lua/api.ts(onModePromptConfigcallback,vim.obsidian.modepromptsub-table)
vim.obsidian.leader.set()— leader binding convenience API — bind leader key sequences to Obsidian commands with automatic:obprefix, leader key prepend, and which-key label registrationvim.obsidian.leader.set("e", "file-explorer:reveal-active-file", { desc = "Reveal" })— single bindingvim.obsidian.leader.add({ { "ff", "switcher:open", desc = "Find file" } })— batch registrationdescoption auto-registers a which-key command label- For general-purpose keymaps or Lua callbacks, use
vim.keymap.setinstead - Plugin:
src/lua/api.ts(onLeaderBinding/onLeaderBindingDelcallbacks,vim.obsidian.leadersub-table)
Fixed
vim.g.mode_prompt_*read returns nil for settings-UI-set values — thegetModePromptcallback was defined in theVimApiCallbacksinterface but not wired up inloader.ts. Readingvim.g.mode_prompt_normalreturned nil unless the value was also set viavim.gin the same init.lua session. Fixed by implementing the callback in the loader.- Plugin:
src/lua/loader.ts(getModePromptcallback)
- Plugin:
Documentation
docs/configuration/lua-config.md: added 4 new Obsidian namespace sections — cursor shapes (vim.obsidian.cursor), mode prompts (vim.obsidian.modeprompt), custom surround pairs (vim.obsidian.surround), leader bindings (vim.obsidian.leader) — with API tables, examples, and cross-referencesKNOWN_LIMITATIONS.md: updated Lua supported APIs list to includevim.obsidian.cursor.set,vim.obsidian.modeprompt.set,vim.obsidian.surround.set/del/add,vim.obsidian.leader.set/del/add; updated surround section with custom pairs documentation and issue #36 reference
Full Changelog: 0.37.0...0.38.0