esm7/obsidian-vimrc-support

vmap doesn't seem to work with toggle commands

adaitche opened this issue · 0 comments

I am trying to create a shortcut for various toggle commands for lists. For example, toggling a list to a numbered list.

Reproduce

Setup

Here is what I put in my .vimrc:

exmap toggleNumberedList obcommand editor:toggle-numbered-list
nmap gl1 :toggleNumberedList
vmap gl1 :toggleNumberedList

Problem

When I do a visual select of a bullet list and press gl1, only the last item is turned into a numbered item. For example, the result is

- foo
- bar
1. baz

after selecting the whole list and applying the command.

Environment

  • OS: MacOS
  • Vimrc plugin version: 0.9