obsidian-vimrc-support icon indicating copy to clipboard operation
obsidian-vimrc-support copied to clipboard

exmap fails for command names including dashes ("-")

Open jasht1 opened this issue 8 months ago • 0 comments

Please Review Before Posting!

  • [ ~ ] I checked that the bug does not happen in the CodeMirror Vim demo. If it does, please report it there and not here.

[!note] vimrc access The link above doesn't work for me, site never loads but this CodeMirror Vim demo dose, not sure if I'm missing something obvious but I don't see how to set any vimrc bindings on the live demo.

  • [ x ] I'm reasonably sure that this bug is indeed about the Vimrc file support and not a general Vim in Obsidian issue. If it's a general Vim issue, report it here.

Describe the bug:

Using dashes ("-") in the name you choose for the exmap command may make it fail. I'm reporting this as this confused me for some time before noticing the the common fault, thought I'd put up an issue in case this was getting anyone else.

To Reproduce:

Try adding the following to .obsidian.vimrc

exmap tabnext obcommand workspace:next-tab
nmap [b :tabnext<CR>

exmap obsidian-previous-tab obcommand workspace:previous-tab
nmap ]b :obsidian-previous-tab<CR>

in this case next tab would work and previous tab would not.

Environment (please complete the following information):

  • OS: Debian / POPOS
  • Vimrc plugin version: 0.10.2

Additional context:

Other examples are:

" this would fail
exmap close-tab-group obcommand workspace:close-tab-group

" however this will work fine
exmap close_tab_group obcommand workspace:close-tab-group
"

jasht1 avatar Jun 19 '25 14:06 jasht1