3

I'm getting very odd characters (001B in a block, which apparently is escape?) in vim when I enter a newline, and sometimes when I switch to normal mode.

You can see the result here:

Screenshot of odd characters

What's odd is that it behaves normally in gvim/macvim/iTerm2 vim, but not gnome-terminal. I'm using base16-shell to get base16-ocean, and the colortest succeeds.

Here is my corresponding vimrc:

.vimrc

Chai T. Rex
  • 5,323

2 Answers2

1

Per @egmont, Solution is to update vim's cursors to avoid gnome-terminals' vte bug.

See solution at my updated vimrc: https://github.com/mjedmonds/.dotfiles/commit/41c1d4639d7b2b047d260602f27a80695cf73f9c

0

Thanks to @mjedmonds for the original solution. I found it quite good for Terminator but still had a couple of buggy screens (vim from ptipython for one) and issues with the initial cursor. So I removed the apple filters and added a little - potential users will probably benefit from comparing the two.

" Solve extra characters on vim screens in terminator in Linux
" Enable different cursors based on the mode from
" https://github.com/mjedmonds/dotfiles/commit/41c1d4639d7b2b047d260602f27a80695cf73f9c
" Information on cursors to complete it from
" https://vim.fandom.com/wiki/Change_cursor_shape_in_different_modes"

if has("autocmd") au BufNewFile,VimEnter,BufEnter,InsertLeave * \ silent execute '!echo -ne "\e[2 q"' | redraw! au InsertEnter,InsertChange * \ if v:insertmode == 'i' | \ silent execute '!echo -ne "\e[6 q"' | redraw! | \ elseif v:insertmode == 'r' | \ silent execute '!echo -ne "\e[4 q"' | redraw! | \ endif au VimLeave * silent execute '!echo -ne "\e[ q"' | redraw! endif

let &t_SI = "<Esc>P<Esc><Esc>]50;CursorShape=1\x7<Esc>\" let &t_SR = "<Esc>P<Esc><Esc>]50;CursorShape=2\x7<Esc>\" let &t_EI = "<Esc>P<Esc><Esc>]50;CursorShape=2\x7<Esc>\"

John 9631
  • 877