VIM c-w suddenly not working in Konsole[solved]

Hi, sorry, I don’t know if this is a problem at the KDE level, Konsole, or VIM. I’ve been running Netrunner 20.01 very happily for about 4 months now, and I am very frequently doing this:

In Konsole, I go into VIM and start editing a document. Then I do :new to get another panel, and then :Explore and start editing a second document, switching back and forth between the documents by using c-w (Ctrl-w) twice. Last night, something happened, and now when I press c-w, the first press makes the mouse pointer visible, and the second press makes the vim cursor blink once, but it does not switch panes.

The first time this happened, I did :new, then :Explore, then navigated up, and did /gyatso (a file name) and then I mistyped maybe hitting Ctrl I think, because vim came up with a small panel near the bottom with an error maybe about jump buffer being empty - something being empty anyway. I don’t know whether this typo caused all this, but since this time, I can no longer switch between panels.

Ctrl-W does exist as a KDE shortcut to close applications, but this has not changed. It’s always like that.

Any thoughts or direction would be greatly appreciated.

More things I’ve tried:

  • Installed Terminator and tried in that, with the same problem, so it’s not just in Konsole
  • Renamed the ~/.vim/vimrc
  • Purged and reinstalled vim and everything starting with vim-
  • Rebooted Netrunner
  • Booted into BunsenLabs (another Debian) and in Terminator, using the same ~/.vim/vimrc from Netrunner KDE, it works fine in BunsenLabs.
  • showkey gives 29 for Ctrl and 17 for u, which I suppose is correct.

So, it seems that something changed in Netrunner KDE environment to affect this. I don’t recall that I did any upgrades in Synaptic, but maybe I did.

Also, if I go to console using Ctrl-Alt-F1, Vim works fine there, with c-w switching between windows panes.

And :verbose map gives:

        Last set from ~/.vim/vimrc line 10
n  K           * z=
        Last set from ~/.vim/vimrc line 31
n  S           * [s
        Last set from ~/.vim/vimrc line 30
v  gx            <Plug>NetrwBrowseXVis
        Last set from /usr/share/vim/vim81/plugin/netrwPlugin.vim line 88
n  gx            <Plug>NetrwBrowseX
        Last set from /usr/share/vim/vim81/plugin/netrwPlugin.vim line 82
n  s           * ]s
        Last set from ~/.vim/vimrc line 29
v  <Plug>NetrwBrowseXVis * :<C-U>call netrw#BrowseXVis()<CR>
        Last set from /usr/share/vim/vim81/plugin/netrwPlugin.vim line 90
n  <Plug>NetrwBrowseX * :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_
gx : '<cfile>')),netrw#CheckIfRemote())<CR>
        Last set from /usr/share/vim/vim81/plugin/netrwPlugin.vim line 84```

This does include <C-U> but that instruction is far beyond my comprehension. Anyone?

Synaptic does not seem to be the issue. Inrecommend creating a new user and try it there to see if it is a configuration issue.

Thank you. I tried that, and when logged in as the new user, vim works fine. The changes window panes as normal. Any further thoughts?

That means the issue is in one of the configuration files. Try removing the konsolerc from ~/.config folder first and relogin to see if it works. If it does not maybe removing the global kglobalshortcutsrc file.

Thank you very much for showing me those files. However, renaming them and logging out did not solve the problem. Other ideas?

It must be another config then. Can you also try to remove ~/.local/share/konsole/* files and see if fit fixes this. (Maybe back them up before deleting just in case)

Thank you, again. Yes, I always just rename them to something. And again, that doesn’t fix it. I appreciate you help. And also, recall that if I use terminator instead of konsole, there is still the problem.

Try removing khotkeysrc from ~/.config and see if it fixes it. Make sure it is really removed even after logging out (maybe use the terminal to double check - also for the other files I mentioned)

Thank you, again, Leszek. I renamed all of these and rebooted:


khotkeysrc and kglobalshortcutsrc come back after reboot or logout/in. I deleted them again, and tried, but no improvement. The two konsole changes also regenerate every time you run konsole, but I assume that’s ok.

In the meantime, a workaround has just come on the page. Rather than Ctrl-w, I can use :winc w . It’s a few more keystrokes, but it is a workaround. If there are more ideas, I’m happy to keep trying to fix this.

I hate this sort of solution, but it is fully solved. In vim, I did :map <C-E> :winc<Space> to shorten the number of keystrokes. That worked fine, but now has started working again, so it is fully functional normal vim in both Konsole and Terminator. I restored all the old config files, and it still works fine. So, I still have no idea what the actual problem was. Perhaps there’s some vim config I don’t know about. ~/.vim/vimrc is unchanged in six months.

So it is solved now. I am glad you found a solution.