VIM text objects

Unsure if this should be a bug or feature request, since it is inconsistent vim behavior and should be easy to fix.

You have not implemented all text objects for vim.

Steps to reproduce

When in vim mode, hover cursor inside either parenthesis, curly brackets, square brackets, single or double quotes or a sentence (unsure if this should work for more things as well).
If inside parenthesis, select inside with vi(. This will do visual mode for the content of the parenthesis. Select around with va(
Delete or change in and around with di(, da(, ci( and ca( respectively.
Should work for all the objects.
Should also work to have the number of actions at the start, 3daw should delete 3 words.

Expected result

Expected that this will work consistently for all the objects listed, but it only works for the single and double quotation marks.

Actual result

Sometimes nothing happens.
It works for words (ciw), paragraphs (vip) and as said, single and double quotation marks.

Environment

Running on Arch Linux.

  • Obsidian version: 0.8.9

Additional information

Here is a resource for the expected result and how the text object/motion should work.

1 Like

Vim mode in general is a bit half implemented.
gq (wrap text to match the max line length) for example doesn’t work either which is something I use a lot in other editors.

1 Like

we haven’t implemented much the VIM functionality. The work comes from Codemirror and it is an emulation not a full vim mode. If there is something specific that works in vanilla codemirror+vim mode but it doesn’t work in obsidian, open a bug report and we’ll consider fixing it.