# Vim: O and o don't respect current context

**URL:** <https://forum.obsidian.md/t/vim-o-and-o-dont-respect-current-context/48232>\
**Category:** Bug graveyard\
**Tags:** vim\
**Created:** [November 24, 2022, 10:09am UTC](https://forum.obsidian.md/t/vim-o-and-o-dont-respect-current-context/48232 "2022-11-24T10:09:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobiasvl](https://forum.obsidian.md/user_avatar/forum.obsidian.md/tobiasvl/32/41243_2.png) [@tobiasvl](https://forum.obsidian.md/u/tobiasvl)\
**Post date:** [November 24, 2022, 10:09am UTC](https://forum.obsidian.md/t/vim-o-and-o-dont-respect-current-context/48232/1 "2022-11-24T10:09:25Z")

</div>

### 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](https://forum.obsidian.md/uploads/default/original/3X/0/f/0f55c927faad67b7b02be5d41ba7ffb315772521.png)

---

<div class="post-metadata">

**Author:** ![obsequious](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/o/4af34b/32.png) [@obsequious](https://forum.obsidian.md/u/obsequious)\
**Post date:** [November 24, 2022, 11:32am UTC](https://forum.obsidian.md/t/vim-o-and-o-dont-respect-current-context/48232/2 "2022-11-24T11:32:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tobiasvl](https://forum.obsidian.md/user_avatar/forum.obsidian.md/tobiasvl/32/41243_2.png) [@tobiasvl](https://forum.obsidian.md/u/tobiasvl)\
**Post date:** [November 24, 2022, 11:43am UTC](https://forum.obsidian.md/t/vim-o-and-o-dont-respect-current-context/48232/3 "2022-11-24T11:43:08Z")

</div>

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](https://forum.obsidian.md/uploads/default/original/3X/a/1/a12c467f9029dcf6960ddd716a82c1c856331989.png)

Obsidian:  
 ![image](https://forum.obsidian.md/uploads/default/original/3X/e/e/ee45bd6cd1f090fb081ef58e84c0957c7c00cf01.png)

---

<div class="post-metadata">

**Author:** ![obsequious](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/o/4af34b/32.png) [@obsequious](https://forum.obsidian.md/u/obsequious)\
**Post date:** [November 24, 2022, 6:11pm UTC](https://forum.obsidian.md/t/vim-o-and-o-dont-respect-current-context/48232/4 "2022-11-24T18:11:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [November 24, 2022, 7:00pm UTC](https://forum.obsidian.md/t/vim-o-and-o-dont-respect-current-context/48232/5 "2022-11-24T19:00:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [December 5, 2022, 2:20pm UTC](https://forum.obsidian.md/t/vim-o-and-o-dont-respect-current-context/48232/6 "2022-12-05T14:20:25Z")

</div>

Closed on December 5, 2022, 2:20pm UTC


