Vim: O and o don't respect current context

Steps to reproduce

  • Position the cursor anywhere within a bulleted or numbered list, or a blockquote
  • If you’re not in Vim’s normal mode, enter it by pressing Esc
  • Press o or O to open a new line

Expected result

The new line should be a part of the list/blockquote, ie. be prefixed with - , > or similar, just like if you had pressed Enter in insert mode (or non-Vim mode).

Actual result

The new line is completely empty.

Environment

  • Operating system: Windows 11
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v1.0.3
    Installer version: v1.0.3
    Operating system: Windows 10 Pro 10.0.22621
    Login status: logged in
    Catalyst license: none
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: Minimal
    Snippets enabled: 1
    Restricted mode: off
    Plugins installed: 28
    Plugins enabled: 26
    1: Calendar v1.5.10
    2: Tasks v1.18.1
    3: Tracker v1.10.9
    4: Better Word Count v0.8.1
    5: Novel word count v2.9.1
    6: Longform v2.0.0
    7: Icon Folder v1.4.1
    8: Daily Stats v1.0.4
    9: Commander v0.3.0
    10: Kindle Highlights v1.8.1
    11: Automatically reveal active file v1.0.2
    12: Focus Mode v1.11.4
    13: Advanced Tables v0.17.3
    14: Rollover Daily Todos v1.1.1
    15: Minimal Theme Settings v6.1.0
    16: Contextual Typography v2.2.4
    17: Checklist v2.2.10
    18: Style Settings v0.4.12
    19: Pipe tricks v1.1.0
    20: Auto Link Title v1.2.5
    21: Custom File Explorer sorting v1.2.0
    22: Github Publisher v4.5.1
    23: Frontmatter Links v1.1.0
    24: Waypoint v1.3.0
    25: Daily Notes Viewer v0.2.1
    26: Omnisearch v1.8.1

RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.


Additional information

image

That’s more a feature request than a bug.

Some people may like this behavior as it’s more standard vim.

I wonder if you could nunmap o and then nmap o A<CR> if you’re using the Vimrc Support plugin

Yes, I suppose it could be considered a feature request, although I’m not sure I understand why you consider this behavior “more standard Vim”?

For example, using o in Vim always respects autoindent and keeps the indentation level if applicable, which o in Obsidion doesn’t do either:

Vim:
image

Obsidian:
image

1 Like

o does respect autoindent outside fenced code blocks.
So perhaps your bug report should be narrowed to what happens inside code blocks.

This is not a bug. It means that the vim emulator should be aware of the markdown syntax to understand that it should do what you are asking. Please, open a FR.