Edit 4: I think I’ve fixed the issue. I uninstalled vim, deleted ~/.viminfo and /etc/vimrc, then reinstalled vim. I jumped around a file a bit, went in and out of edit mode, and type a bunch of ~ and it didn’t jump the text around at all. Still not sure what I did, but it appears this variation of turning it on and off again worked.

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 to the last line, putting the last line at the top of the editing screen so that’s the only line of text showing.

I thought maybe I had set an option that would show up in ~/.vimrc, but there’s no ~/.vimrc file. There is a /etc/vimrc file, and a ~/.viminfo file.

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.

Edit 3: I just installed neovim and in neovim it acts as expected when I type the ~. Something I did notice is 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. I think this was the normal behavior in vim prior to whatever the heck I did.

Hoping someone knows what the heck I did. Thank you!

Edit: clarified what happens when I try to type ~

Edit 2: added details of the .vimrc and .viminfo files

  • harsh3466OP
    link
    fedilink
    arrow-up
    1
    ·
    19 hours ago

    That’s what I thought too, but there’s no .vimrc. That was the first thing I checked. I should have included that.

    • catloaf@lemm.ee
      link
      fedilink
      English
      arrow-up
      3
      ·
      19 hours ago

      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.

      • harsh3466OP
        link
        fedilink
        arrow-up
        1
        ·
        18 hours ago

        I just installed neovim and in neovim it acts as expected when I type the ~. Something I did notice is 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.