Vim shows garbage characters
Asked Answered
C

4

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?

Commissionaire answered 7/2, 2014 at 3:16 Comment(0)
C
-3

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

Commissionaire answered 10/8, 2016 at 13:38 Comment(0)
D
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.

Dermatoglyphics answered 7/3, 2014 at 13:58 Comment(5)
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.Commissionaire
The shell doesn't influence this, switching to another terminal might help.Dermatoglyphics
I tried several terminals (mate terminal, sakura, terminator, patheon terminal and gnome terminal) without success. Have you another idea? Thanks.Commissionaire
Which plugins do you have installed? I'm having the same issue.Dowager
In my case, this was being caused by: nnoremap <Esc> :noh<CR>. Commenting out this line solved the issue.Any
S
0

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

   if has('mac')
   :set t_RV=
   endif
Symphonic answered 8/11, 2021 at 4:44 Comment(0)
R
0

This fixed it for me

:echo v:termresponse

inside vim, with this value I put that into set t_RV= inside my .vimrc.

Rowel answered 23/8 at 18:3 Comment(0)
C
-3

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

Commissionaire answered 10/8, 2016 at 13:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.