1

I am trying to move to VIM as my main text editor, already spent a lot of time setting everything and reading about VIM.

Now everything is pretty much ok, except one thing that bothers me all the time I see it. When I start VIM (I am using only terminal version) sometimes there is some kind of broken escape sequence or something in the status line, that does not look right

Also typying any command with : will replace symbols as you type, that does not look ok as well.

I checked my .vimrc multiple times and have not found anything that could cause this. The only thing that comes to my mind is, maybe, I messed up with VIM events and TMUX hooks

in my tmux.conf

set-hook -g pane-focus-in 'if -F "#{==:#{pane_current_command},Vim}" "set -g status off; set -g pane-border-status off" "set -g status on; set -g pane-border-status bottom"'

in .vimrc

autocmd VimEnter * silent !tmux set -g status off
autocmd VimEnter * silent !tmux set -g pane-border-status off
autocmd VimLeave * silent !tmux set -g status on
autocmd VimLeave * silent !tmux set -g pane-border-status bottom
au FocusLost * :set laststatus=0
au FocusGained * :set laststatus=2
autocmd InsertLeave * redraw!

But they also looks fine :/

My setup is:

  • macOS 10.4.15
  • iTerm2 3.2.9
  • ohMyZsh
  • tmux
  • macvim 8.1.950

Thank you for your help

SOLUTION: as @Nicholas Marriott point out, These are responses to DSR (Device Status Report) which comes from resize when hiding/showing tmux status bar. In my case there ware a bit overkill in setup. First, there were tmux hook for pane focus:

set-hook -g pane-focus-in 'if -F "#{==:#{pane_current_command},Vim}" "set -g status off; set -g pane-border-status off" "set -g status on; set -g pane-border-status bottom"'

this one supposed to show/hide tmux bar when switching between panes or windows with at least one with VIM opened. Then I had this one in my .vimrc:

  autocmd VimEnter * silent !tmux set -g status off
  autocmd VimEnter * silent !tmux set -g pane-border-status off

that suposed to do the same but on VimEnter event, I wrote them becuse I thought tmux pane-focus-in hook would not fire when Vim start (pane stays the same with same focus), actually that's not true, it would.

Unfortunately, I don't understand what exactly happens when set -g status off and set -g pane-border-status off executes twice, maybe the second one is ignored by tmux and vim cannot recognize it, but removing it from .vimrc config did help to get rid of those symbols

0

These are responses to DSR (Device Status Report), my guess is vim sends this on resize (turning the tmux status lines on and off will resize). Seems like vim isn't correctly parsing the responses.

  • Thank you, looks like you are right, I should have tried to disable these events one by one before posting this question. Is there something I can do about this though, like ignore/hide them? – DeltaBravo May 24 at 12:05
  • Ok, I've played around with these events and hooks and looks like there was a bit "overkill" in my setup, I will edit my question, thanks again! – DeltaBravo May 24 at 12:23
  • It seems like a vim problem, it is asking for these it should be consuming them. Possibly you can stop it asking but I don't know how. – Nicholas Marriott May 24 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.