lifepillar / vim-colortemplate

The Toolkit for Vim Color Scheme Designers!
929 stars 29 forks source link

Error when sourcing a colorscheme if 'compatible' is set #47

Closed romainl closed 3 years ago

romainl commented 3 years ago

See https://github.com/vim/colorschemes/issues/55:


When 'compatible' is set, 'cpoptions' contains C and according to :help 'cpoptions':

C   Do not concatenate sourced lines that start with a
    backslash.  See |line-continuation|.

Therefore, when sourcing a color scheme file, lines like these throw an error:

let g:terminal_ansi_colors = ['#ffffff', '#0000ff', '#00cd00', '#cd00cd',
      \ '#008b8b', '#0000ff', '#ff1493', '#bcbcbc', '#ee0000', '#0000ff',
      \ '#00cd00', '#cd00cd', '#008b8b', '#0000ff', '#ff1493', '#000000']

Now you might wonder "Why on earth would anyone set 'compatible' in 2021?". Good question. A likely scenario is when starting Vim without a vimrc, for example with vim -u NONE. Without a vimrc, 'compatible' is set by default. So doing something like this this gives an error:

vim -u NONE -c "colorscheme blue"

lifepillar commented 3 years ago

Thanks for reporting! This should be fixed in the current master.