[vim/vim] Native way of moving cursor one display line up in insert mode. (Discussion #16823)

11 views
Skip to first unread message

Toby She

unread,
Mar 7, 2025, 11:19:19 AM3/7/25
to vim/vim, Subscribed

Background: you can move one display line up in normal mode using gk and you can easily rebind <up> to gk.

There is no native way of moving one display line up in insert mode. So you would have to use one of the following remap options:

  • <c-o>gk. This options works correctly and I've been using it regularly in vim. However, it can lags significantly when scrolling rapidly sometimes (especially in neovim as it is bloated). I think that is due to the fact that <c-o> leaves and reenters insert mode, and that triggers a bunch of auto commands if you got any.
  • <cmd>normal gk<cr>. This option is very fast. However, when the cursor arrives at the back of a line it is always in front of the last character. e.g.
1 b                                       1 |b                  
2 a|  /** pressing up leads to */	  2  a

It would be great if a new key bind or command is added for going one display line up natively in insert mode.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/repo-discussions/16823@github.com>

Reply all
Reply to author
Forward
0 new messages