Skip to content

Commit

Permalink
vim: unset ConEmuANSI env var in GUIs
Browse files Browse the repository at this point in the history
  • Loading branch information
janlazo committed Sep 30, 2017
1 parent d73c1a7 commit 87a0f93
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
5 changes: 5 additions & 0 deletions ginit.vim
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ if exists(':GuiFont') == 2
GuiFont! Monospace:h12
endif
endif

" Unset ConEmu env vars so terminal Vim does not break in winpty
if !empty($ConEmuANSI)
let $ConEmuANSI = ''
endif
26 changes: 16 additions & 10 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,23 @@ if has('win32')
let &runtimepath = join(map(split(&runtimepath, ','), 'expand(v:val)'), ',')

" Force xterm rendering in ConEmu for truecolor
if $ConEmuANSI ==# 'ON' && !has('gui_running')
if has('builtin_terms') && $ConEmuTask !~# 'Shells::cmd'
set term=xterm
set t_Co=256
let &t_AB = "\e[48;5;%dm"
let &t_AF = "\e[38;5;%dm"
endif
if $ConEmuANSI ==# 'ON'
if has('gui_running')
" Vim (winpty) terminal inherits ConEmu env vars
" This breaks terminal Vim in GVim
let $ConEmuANSI = ''
else
if has('builtin_terms') && $ConEmuTask !~# 'Shells::cmd'
set term=xterm
set t_Co=256
let &t_AB = "\e[48;5;%dm"
let &t_AF = "\e[38;5;%dm"
endif

inoremap <Char-0x07F> <BS>
nnoremap <Char-0x07F> <BS>
vnoremap <Char-0x07F> <BS>
inoremap <Char-0x07F> <BS>
nnoremap <Char-0x07F> <BS>
vnoremap <Char-0x07F> <BS>
endif
endif

if !empty($SHELL)
Expand Down

0 comments on commit 87a0f93

Please sign in to comment.