estilo icon indicating copy to clipboard operation
estilo copied to clipboard

Question: conditional styles

Open mhartington opened this issue 7 years ago • 4 comments

In oceanic-next, I have support setup for conditional italics/bolds, if the terminal supports it.

let s:bold = ""
if exists('g:oceanic_next_terminal_bold')
  let s:bold = "bold"

endif
let g:oceanic_next_terminal_bold = get(g:, 'oceanic_next_terminal_bold', 0)

And is used like so

call <sid>hi("markdownBold", s:gui0A, "", s:cterm0A, "", s:bold)

Would something like this be supported by estilo?

mhartington avatar Sep 18 '16 14:09 mhartington

I plan to support conditional styles in colorschemes, but I still don't know how to implement it in a template based generator. I'm open to ideas, do you have any suggestion?

jacoborus avatar Sep 18 '16 15:09 jacoborus

No ideas right now, but can try to think of something and make a PR

mhartington avatar Sep 20 '16 12:09 mhartington

I'll try this weekend

jacoborus avatar Sep 20 '16 13:09 jacoborus

I was thinking about this, and probably can be solved by some conventions.

let s:bold = ""
if exists('g:<<colorscheme_name>>_terminal_bold')
  let s:bold = "bold"

endif
let g:<<colorscheme_name>>_terminal_bold = get(g:, '<<colorscheme_name>>_terminal_bold', 0)

The issue is that if some users change their colorscheme often they end up having a lot of colorscheme-specific variables in their .vimrc. We can have a convention like this:

let s:bold = ""
if exists('g:estilo_terminal_bold')
  let s:bold = "bold"

endif
let g:<<estilo_name>>_terminal_bold = get(g:, 'estilo_terminal_bold', 0)

I'd be happy to give it a crack, but I'm not that confortable with Javascript, but this could be fun 💃

rakr avatar Sep 28 '16 23:09 rakr