SKulibin
SKulibin

Reputation: 749

jumping with Ctrl-] in vim does not work

I am working with vim on debian. When I press ctrl-] vim beeps, inserts a new line and goes to "visual block". It does not jump to tag. The same happens with :ctrl-]. Even in insert-mode with ctrl-] vim exits from insert-mode, insert new line and goes to 'visual block'.

But when I use such lines in .vimrc

nnoremap <F3> <c-]>

vnoremap <F3> <c-]>

jumping with F3 works.

Command :verbose map c-] returns No mapping found

update: As we have discovered in insert mode we can see how vim is interpreting <c-]>. In insert mode after <c-V><c-]> the correct output should be ^] . But my output is

t
^C

Screenshots: after <c-v> I get enter image description here

And after <c-v><c-]> enter image description here.

So vim isn't receiving the keystrokes properly. How to check what changes input?

Upvotes: 1

Views: 1881

Answers (1)

zmo
zmo

Reputation: 24812

  • try running vim -u NONE to check if that's happening without any configuration, that way you can be sure it's not a mapping or misconfiguration.

    • if that solves the issue, check your vim configuration!
  • Also try doing it in gvim and gvim -u NONE to narrow down the issue to what it's very likely to be. If that works it's a shell or terminal misconfiguration.

    • if it still fails in the windowed GUI of vim, that means this is X that is wrong, try using xev to see what your key outputs, and xmodmap to printout the values assigned to all your keys on your keyboard layout.
  • Try using another terminal (like urxvt, gnome-terminal, xterm or the raw linux console), to determine whether it's a terminal emulator misconfiguration of your keys or if it's your shell.

    • if it's your terminal emulator, then get through the configuration or reset its configuration, there's something setup that shouldn't have been.
  • Try changing shell to see if that improves (by I doubt it will)… And add the following configuration files in your home directory:

.inputrc

Tab: complete
set meta-flag on
set input-meta on
set output-meta on
set convert-meta off

If that's not enough, you might want to check as well you stty settings for your current shell as well.

If none of that helps, then… take a big hammer and hit very hard your keyboard and your computer, that won't solve your situation, but you'll feel better!

hammer computer

HTH

Upvotes: 1

Related Questions