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
xterm-256color-italic
, nothing wrong I think :/ – DeltaBravo May 24 '19 at 11:59