# Vim \`gj\` at the end of a file teleports cursor to the top

**URL:** <https://forum.obsidian.md/t/vim-gj-at-the-end-of-a-file-teleports-cursor-to-the-top/118092>\
**Category:** Bug reports\
**Tags:** vim, upstream-bug, repro\
**Created:** [September 8, 2026, 5:41pm UTC](https://forum.obsidian.md/t/vim-gj-at-the-end-of-a-file-teleports-cursor-to-the-top/118092 "2026-09-08T17:41:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Catalyst\_42](https://forum.obsidian.md/user_avatar/forum.obsidian.md/catalyst_42/32/74849_2.png) [@Catalyst\_42](https://forum.obsidian.md/u/Catalyst_42)\
**Post date:** [September 8, 2026, 5:41pm UTC](https://forum.obsidian.md/t/vim-gj-at-the-end-of-a-file-teleports-cursor-to-the-top/118092/1 "2026-09-08T17:41:53Z")

</div>

After the latest update (I guess it was 1.13.6), the behavior of the Vim `gj` motion has changed. It is very similar to [this old bug](https://forum.obsidian.md/t/vim-mode-gj-at-the-end-of-a-file-jumps-to-another-part-of-the-file/45508), but it behaves differently: when you press `gj` while the cursor is in the middle of a line (do not matter how many lines you above the end) and you repetitively press `gj`, at the end of the file cursor will jump back to the top.

## Steps to reproduce

1. Open a `Sandbox Vault`
2. Go to Settings \> Editor \> Scroll to the bottom and enable Vim mode (`:q` to unlock it)
3. Open any note, for example the `Start here` one
4. Scroll to the bottom of the page and place the cursor on the line that contains the text, for example, this one: `> If you spot a typo or a mistake, ...`
5. Press `ESC` to enter Vim Normal Mode
6. Press `l` a few times to move the cursor to the middle of the line
7. Press `gj` repeatedly until the cursor reaches the bottom of the page
8. Press `gj` once more - the cursor teleports to the first line of the note

Notes:

- If you start pressing `gj` while the cursor is at the very first character of a line (column 0, or Vim `0` command at a line), the issue does not occur
- The last line of a file should be empty, otherwise the issue does not occur

I originally noticed this behavior because I am using the `obsidian-vimrc-support` plugin with `j` remapped to `gj`. However, the issue also reproduces in a sandbox vault without any plugins, so it is not plugin‑related.

As far as I can tell, this bug was not present before version 1.13.6, cuz I use `j` to `gj` remap for a very long time.

### Did you read and follow the [Troubleshooting Guide](https://forum.obsidian.md/t/about-the-bug-reports-category/24/11) ? [Yes/No]

Yes

### Expected result

The `gj` just should stop the cursor at the bottom of a page

### Actual result

It teleports back on top

### Environment

Reproduced on Ubuntu 26 and macOS Tahoe 26.

SYSTEM INFO:  
Obsidian version: 1.13.7  
Installer version: 1.12.7  
Operating system: Darwin Kernel Version 25.6.0: Fri Jul 31 19:18:29 PDT 2026; root:xnu-12377.161.14~5/RELEASE\_ARM64\_T8122 25.6.0  
Login status: logged in  
Language: ru  
Catalyst license: none  
Insider build toggle: off  
Live preview: on  
Base theme: adapt to system  
Community theme: AnuPpuccin 1.5.0  
Snippets enabled: 3  
Restricted mode: off  
Plugins installed: 9  
Plugins enabled: 5  
1: Clear Unused Images v1.1.1  
2: Templater v2.20.3  
3: Custom File Explorer sorting v3.1.6  
4: Vimrc Support v0.10.2  
5: Style Settings v1.0.9

---

<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:** [September 8, 2026, 9:33pm UTC](https://forum.obsidian.md/t/vim-gj-at-the-end-of-a-file-teleports-cursor-to-the-top/118092/2 "2026-09-08T21:33:52Z")

</div>

I can’t reproduce. Download and reinstall Obsidian. Post a screen recording of this happening in the sandbox vault

---

<div class="post-metadata">

**Author:** ![Catalyst\_42](https://forum.obsidian.md/user_avatar/forum.obsidian.md/catalyst_42/32/74849_2.png) [@Catalyst\_42](https://forum.obsidian.md/u/Catalyst_42)\
**Post date:** [September 9, 2026, 8:50pm UTC](https://forum.obsidian.md/t/vim-gj-at-the-end-of-a-file-teleports-cursor-to-the-top/118092/3 "2026-09-09T20:50:55Z")

</div>

Here’s the examples, I made a small video on [YouTube](https://youtu.be/cv6Kk5PoEE0)

---

<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:** [September 9, 2026, 9:03pm UTC](https://forum.obsidian.md/t/vim-gj-at-the-end-of-a-file-teleports-cursor-to-the-top/118092/4 "2026-09-09T21:03:29Z")

</div>

did you download and reinstall Obsidian?

---

<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:** [September 9, 2026, 9:06pm UTC](https://forum.obsidian.md/t/vim-gj-at-the-end-of-a-file-teleports-cursor-to-the-top/118092/5 "2026-09-09T21:06:09Z")

</div>

Ok, I can reproduce the problem.
