# Vim Mode: "\<Shift\>\<O\>" Inserts Extra Space Before Nested List Item

**URL:** <https://forum.obsidian.md/t/vim-mode-shift-o-inserts-extra-space-before-nested-list-item/59209>\
**Category:** Bug graveyard\
**Tags:** vim\
**Created:** [May 5, 2023, 2:26pm UTC](https://forum.obsidian.md/t/vim-mode-shift-o-inserts-extra-space-before-nested-list-item/59209 "2023-05-05T14:26:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DabeDotCom](https://forum.obsidian.md/user_avatar/forum.obsidian.md/dabedotcom/32/47210_2.png) [@DabeDotCom](https://forum.obsidian.md/u/DabeDotCom)\
**Post date:** [May 5, 2023, 2:26pm UTC](https://forum.obsidian.md/t/vim-mode-shift-o-inserts-extra-space-before-nested-list-item/59209/1 "2023-05-05T14:26:53Z")

</div>

It’s a little thing, I know, but when using `Vim Mode` to manage outlines (nested lists), `<O>` and `<Shift><O>` end up messing up the layout ever-so-slightly…

### Steps to reproduce

In Sandbox Vault:

1. Enable `Vim Mode` in the Preferences
2. 'I’nsert a Nested List:

```auto
<i> # (For 'I'nsert Mode)
<Hyphen><Space>One<Enter>
<Tab>Two<Enter>
Three<Escape>

```

Resulting in: (So far so good)

```auto
- One
    - Two
    - Three

```

1. Now, with the cursor on line “Three”, hit `<Shift><O>` to Open a new line (Here’s where you can see it also adds a space before the cursor), then `<Tab><Hyphen><Space>XXX<Escape>`

Note: I see the same behavior if I hit `<O>` (without the shift) on line “Two”…

### Expected result

I’d expect:

```auto
- One
    - Two
    - XXX <-- Aligned with "Two" and "Three"
    - Three

```

### Actual result

Instead I get:

```auto
- One
    - Two
     - XXX <-- Notice the extra <Space>
    - Three

```

### Environment

```auto
SYSTEM INFO:
	Obsidian version: v1.2.7
	Installer version: v0.15.9
	Operating system: Darwin Kernel Version 22.4.0: Mon Mar 6 21:00:17 PST 2023; root:xnu-8796.101.5~3/RELEASE_X86_64 22.4.0
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 2
	Restricted mode: off
	Plugins installed: 0
	Plugins enabled: 0

```

* * *

### Additional information

FWIW, I’ve noticed that the deeper the nesting, the greater the number of spaces — i.e., one sub-level deep → one space; two sub-levels → two spaces, etc.

Thanks! 😃

---

<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:** [May 5, 2023, 2:29pm UTC](https://forum.obsidian.md/t/vim-mode-shift-o-inserts-extra-space-before-nested-list-item/59209/2 "2023-05-05T14:29:14Z")

</div>

I am not sure if you searched before posting, but here:

> [@Vim mode 'o' in list always inserts spaces on newline instead of tabs](https://forum.obsidian.md/t/vim-mode-o-in-list-always-inserts-spaces-on-newline-instead-of-tabs/50757):
>
> [image] o when in a list inserts single spaces instead of expected behavior of either: Tab whitespace inserted on newline corresponding to indent level with or without a continuation of the list item (i.e. -, \>, +), which would be behavior equivalent to Enter/ at the end of the line. Or, empty new line. Steps to reproduce This is replicable in sandbox with vim mode enabled on v1.1.9. Default settings has Editor\>Behavior\>Indent using tabs on, but when using spaces, the indentation is expected…

> [@Vim: O and o should respect/understand current context (lists)](https://forum.obsidian.md/t/vim-o-and-o-should-respect-understand-current-context/48386):
>
> Use case or problem When using Vim key bindings, pressing o or O (open new line) in Normal mode doesn’t behave the same way Enter does in Insert mode, as it doesn’t seem aware of the current Markdown context. For example, unlike Enter, o/O does not: create a new list item when used within a list retain indentation level when used within a code block continue a blockquote In other words, the new line should ideally be a part of the list/blockquote, ie. be prefixed with - , \> or similar, just…

---

<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:** [May 5, 2023, 2:30pm UTC](https://forum.obsidian.md/t/vim-mode-shift-o-inserts-extra-space-before-nested-list-item/59209/3 "2023-05-05T14:30:32Z")

</div>

Closed on May 5, 2023, 2:30pm UTC


