9

When I start vim with one of these plugins:

  • TagBar
  • Session

I see sometimes garbage characters in the buffer when I open vim.

Here are these characters:

;2R^[[>1;2802;0c

By uninstalling these two plugins, I don't see these garbage characters anymore.

If I type dd, it does not even delete these characters. Vim says the buffer is empty.

Putting this command at the end of my .vimrc is a workaround for this problem:

autocmd VimEnter * redraw!

With this, these characters are deleted immediately.

How can I fix this problem?

antoyo
  • 11,097
  • 7
  • 51
  • 82

3 Answers3

10

Vim asks the terminal for its version, what you're seeing is the response (cp. :help v:termresponse). It only appears printed in the terminal; that's why you can't "edit" it and it appears after a redraw.

Why Vim doesn't properly receive it, I don't know. Switching the terminal program might help. You could also try to suppress the query via :set t_RV= in your ~/.vimrc.

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
  • Switching to `bash` or `sh` does the same thing as `zsh`. And adding this line in my `.vimrc` change the garbage text to `;2R`. Is there anything else I can do? Thanks. – antoyo Mar 24 '14 at 21:57
  • The shell doesn't influence this, switching to another _terminal_ might help. – Ingo Karkat Mar 25 '14 at 07:16
  • I tried several terminals (mate terminal, sakura, terminator, patheon terminal and gnome terminal) without success. Have you another idea? Thanks. – antoyo Mar 25 '14 at 21:44
  • Which plugins do you have installed? I'm having the same issue. – acannon828 Aug 06 '16 at 21:51
  • 2
    In my case, this was being caused by: `nnoremap :noh`. Commenting out this line solved the issue. – hackel Sep 06 '16 at 17:32
0

Thanks Ingo! I only get this on the mac, so for me it's

   if has('mac')
   :set t_RV=
   endif
MichaelMoser
  • 3,172
  • 1
  • 26
  • 26
-3

I switched to neovim and I've never seen this issue anymore.

antoyo
  • 11,097
  • 7
  • 51
  • 82