I'm using SpaceVim with Neovim, and often times I'd experience this cursor jumping issue (as if ^
has been pressed in normal mode) while using it. I doubt the bug is on the Neovim end, otherwise a lot more people definitely would've raised it by now.
An issue has already been opened in SpaceVim about it: https://github.com/SpaceVim/SpaceVim/issues/3159
However we don't know how to reproduce it.
I've personally notice it occurring most often while:
navigating a line with
w
ore
; and when that becomes the case, doing something likecw
becomes extremely annoying as it ends up jumping the cursor to the first non-blank character of the line and changing that instead of the actual word I wantedwhile saving the file with either the normal Vim command of
:w
or the SpaceVim keybinding ofSpace f s
; thereby it doesn't appear those specific keybindings are the problem. And when this misbehavior is activated, this jumping to the line start reliably occurs on every subsequent saves
It also appears to happen regardless of the filetypes (for myself those are most often: .md
, .vim
, .lua
, .py
)
The only "workaround" I found is to activate another buffer by switching to it, either by just opening it if it's hidden, or switching to buffers in other tabs, or even opening a split (a help split works) in the same tab. This will suppress the problem for some time, could be for a long while, but also could happen again soon after a few more line navigations.
At this point I'm not even quite sure how to go about to diagnose this bug. The submitter already went and disabled many of the layers (and thereby most of the plugins), and he claims it still occurs. Is it caused by some autocmds
perhaps? But that also seems dubious since it occurs very unpredictably while just navigating. Also the fact that switching to another buffer then switching back temporarily suppresses the problem leads me to think that maybe there's some buffer state variable/property that gets reset every time you exit and enter it?
Any ideas on how to proceed on fixing this is appreciated.
:debug
,-V
(verbose logging—level 9 or higher could be useful),-D
debugging, or our how to debug my vimrc postvim -w scriptout
to record your keystrokes to a file. If you manage to reproduce the issue, you can then stop recording and see if you can reproduce it again usingvim -s scriptout
(you can edit the scriptout file to remove extraneous parts.) If you manage to reproduce it consistently with that script, you can then use that as a basis to debug your vimrc and plugins. You can also check if someone with the same setup can also reproduce the issue. Good luck!