strange problem in vim

R S rafazapa at yahoo.com
Thu May 2 09:57:54 PDT 2013



On Tue, Apr 30, 2013 8:05 AM PDT David Brown wrote:

>R S <rafazapa at yahoo.com> writes:
>
> So I killed that instance of vim. And guess what. The same weirdness
> persists in the virtual terminal itself. Arrow keys and navigation
> keys work as expected, even backspace. But virtually all other keys
> put question marks on the screen.
>
> The up arrow brings the former command (vim). The enter key launches
> it. But at the recovery screen, the keys don't work as they
> should. So, I killed vim again.
>
>The problem is your terminal window, not vim.  Do the recovery in a
>different terminal session.
>
>Initial guess would be that something enabled another input method, and
>the terminal was entering characters for a different language, perhaps
>one without fonts, so that they all ended up as question marks.
>
>David

Thanks David. This makes the most sense, particularly since I *could* get the colon prompt in vim with a key combination that is not mapped to the characters of my alternate keyboard. But how I got switched over is a mystery. I know that [Ctrl][space] will do it, but I wasn't hitting [Ctrl]. But I guess I must have done so somehow.

I was intending to leave that instance open to give time for the solution to appear. But I accidentally closed it by clicking the X icon.

Then it happened again a few days later (editing the same file in the same editor a chance would have it). I accidentally closed that window (after killing vim from another terminal) by hitting [Ctrl][d]. I did it without thinking, like finger-muscle-memory. Just a few seconds later, it occurred to me that it worked. It was a surprise then, but not now because I know that none of the control characters are mapped on my alternate-language keymap.

Thanks for the comment about swap in vim. I've utilized it before, but was unfamiliar with how it works. Loading a document in vim that still has a swap file out there, vim alerts you, with options.

To: Steve
I didn't actually hit Enter after typing :w and seeing ?? instead. Rather I just hit backspace. Once I got the colon prompt through the shifting keys, I was confident that the question marks were *not* masking the characters I was trying to type. In other words, when I saw the colon on screen, I knew that if the colon appears normal, then so should the other characters.

Having switched unwittingly to an alternate keyboard makes the most sense. I'll wait for it to happen again. Then I'll be able to verify it. It may have something to do with the way I do things while editing a perl program in vim since both occurrences coincided in that way. Whatever it is, it happens very rarely.






More information about the KPLUG-List mailing list