Enable Vim Syntax Highlighting By Default

后端 未结 6 1453
死守一世寂寞
死守一世寂寞 2020-12-07 14:07

I know how to turn syntax highlighting on and off in vim by running this in the editor:

:syntax on/off

But I want syntax highlighting to be

6条回答
  •  离开以前
    2020-12-07 14:59

    In my $HOME/.vimrc I load a color scheme (solarized) and found that I need to place syntax on after I load the plugin. If it's before loading the plugin it doesn't work.

    " this turns syntax highlighting on by default
    
    set rtp+=~/.vim/bundle/Vundle.vim
    call vundle#begin()
    Plugin 'lifepillar/vim-solarized8'
    
    syntax on
    
    " this does not turn syntax highlighting on by default
    
    syntax on
    
    set rtp+=~/.vim/bundle/Vundle.vim
    call vundle#begin()
    Plugin 'lifepillar/vim-solarized8'
    

提交回复
热议问题