ConEmu: Vim Syntax Highlight

情到浓时终转凉″ 提交于 2019-11-27 20:13:41

问题


Is it possible to get vim syntax highlighting in ConEmu?


回答1:


Note. Some updated information may exists on the project site.

Well, builds since 130120 supports 256 colors in vim. You need to

  • Check options "Inject ConEmuHk" and "ANSI X3.64 / xterm 256 colors" on "Features" page
  • Check option "TrueMod (24bit color) support" on "Colors" page
  • Edit your vimrc file, sample lines are here. Of course, you need some 256-color vim scheme, it is zenburn in the last line of this example.

    set term=xterm
    set t_Co=256
    let &t_AB="\e[48;5;%dm"
    let &t_AF="\e[38;5;%dm"
    colorscheme zenburn
    
  • And "vim" must be vim.exe ATM.

Note. 'Original' Vim (Win32 console executable from gvim##.exe and vim##w32.zip) passed tests. MinGW's Vim fails to switch to using Ansi sequences.




回答2:


I know is an old question. But what worked for me was similar to the selected answer except that instead of setting term to xterm, set it to pcansi that way the keyboard keys will still work. For ConEmu in the %HOMEPATH%_vimrc

if !empty($CONEMUBUILD)
    set term=pcansi
    set t_Co=256
    let &t_AB="\e[48;5;%dm"
    let &t_AF="\e[38;5;%dm"
    set bs=indent,eol,start
    colorscheme wombat256
endif                      



来源:https://stackoverflow.com/questions/14315519/conemu-vim-syntax-highlight

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!