Formatting in vim's normal mode

Use case or problem

There is. I possibility to do text formatting VIM’s normal mode. You have to switch to the insert mode to get formatting related hotkeys.

VIM’s modal editing feature lends itself perfectly to do text formatting, such as

  • making a 2 words bold
  • in/decrease the level of a heading
  • in/decrease level of list
  • etc

Proposed solution

Use an appropriate key sequence using a leader key to do formatting.

For example making 2 words bold could be done with ˋmb2wˋ, where ˋmˋ is the leader key (for markdown), ˋbˋ for bold and ˋ2wˋ a movement. Or increase the level heading with ml (I think this isn’t even possible with the current hockey’s, is it?).

Using a leader key avoids possible collisions with other key bindings.

Current workaround (optional)

Drop into insert mode to get (a subset of possible) formatting related hockey’s

Related feature requests (optional)

2 Likes

Related: See wishlist of https://github.com/esm7/obsidian-vimrc-support

Things I’d love to add:

  • Implement some standard vim-markdown motions for Obsidian, e.g. [[, or implement for CodeMirror the 1-2 missing Ex commands required to define these keymaps in the Vimrc.