I’m hoping someone can help me with this.
I was holding my laptop while I had a vile open in vim, and I slipped, mashing a bunch of keys on the keyboard by mistake.
After doing this, I can’t type the ~
character anymore. Anytime I try to type it, it jumps the text putting focus on the line the cursor was on where I was trying to type.
I’ve searched and had no luck finding out what I did to cause this behavior. I also tried looking through the vim manpage and couldn’t find any info there either.
Hoping someone knows what the heck I did. Thank you!
vim will load some other rc file if it cant find your ~/.vimrc. check what it has loaded with
:scriptnames
also, try starting vim in a brand new terminal with
vim -u NONE
and check if it’s still happening.I think I fixed it with a variation of turning it off and on again. I deleted vim, deleted ~/.viminfo and deleted /etc/vimrc, then reinstalled. So far it’s working as expected.
Try starting vim without config, I think that’s
vim -u NONE
Does it still occur then?
If not, it’s a config issue in
/etc/vimrc
and/or~/.vimrc
(or maybe~/.config/vim/vimrc
or something?)If it does, it has to be something else.
I tried opening it without config and it acted even weirder, but that still helped me get towards my solution which is in the update in the post. Short of it is I uninstalled and removed .viminfo and /etc/vimrc then reinstalled
Did your keyboard mapping get changed? Try running this to check the current locale:
localectl status
Other settings are generally dependent on the distro you’re using.
I checked the locale and it is correct. I’m on Arch, and I just installed neovim to compare the cursor and typing behaviors, and in neovim it acts as expected when I type the
~
.I did notice that in vim, I now have a blinking block cursor in insert mode as well as in visual mode, while in neovim, it’s a block cursor in visual mode and a vertical bar cursor in insert mode. This was the normal behavior in vim prior to whatever the heck I did.
Edit: grammar
I’d guess if you set some option, it’s in ~/.vimrc now.
That’s what I thought too, but there’s no .vimrc. That was the first thing I checked. I should have included that.
Hmm. Does it do it in other editors? My next guess is that it’s a laptop keyboard thing, like with the Fn key.
I can’t imagine you completely remapped a key or created a shortcut just by mashing keys. I’m not even sure where that config would live.