preservim / vim-colors-pencil

Light (& dark) color scheme inspired by iA Writer
Other
606 stars 73 forks source link

Experiment with a focus mode based on cursorline #7

Open reedes opened 10 years ago

reedes commented 10 years ago

There may be better ways to offer focus, such as that of http://github.com/junegunn/limelight.vim

This experiment takes a different colorscheme-scoped approach to selectively dim colors via the highlight generator h().

Attached is image showing with bg=light. To see the focus in action, check out the branch: https://github.com/reedes/vim-colors-pencil/tree/focus-support

and then run the command...

:ToggleFocus

screen shot 2014-08-29 at 10 52 37 pm

reedes commented 10 years ago

@mattly What do you think of colorscheme-scoped definitions of a 'focus mode'?

The only base color I adjusted was medium_gray to reflect IA Writer's color for dimmed text.

I see that the cursor fg needs tweaking, but otherwise it's pretty close.

mattly commented 10 years ago

Hm. While I have limelight installed, I never use it.

Unfortunately I also think this highlights (pun intended, sorry) a problem with vim: lack of first-class color support makes it unclear where something like this should reside. Plugins can't accurately predict how they'll behave across all color schemes, and ideally color schemes should be lookup tables that respond to a handful of toggles.

I'll give it a shot over the weekend though, I have a piece I've been meaning to finish.

reedes commented 10 years ago

Agreed that it's unclear where the responsibility should reside. Plugins that muddy the lines separating color/syntax/etc. always seem to make compromises that sacrifice some strength of Vim. My repurposing of cursorline skirts the edge of such compromise.

Those toggles (notably set bg=) could be thought of as sub-schemes -- variants on the mother color scheme to suit a particular purpose. They are specified explicitly by the scheme's designer rather than calculated algorithmically (as with Limelight). Ideally the set of toggles could be generic enough to be used across color schemes that support them.

Thanks for giving it a try. I'll be flipping between it and Limelight over the coming weeks to see if either is compelling.

mattly commented 10 years ago

Initial thoughts:

1) it doesn't play well with Goyo which I use instead of say, Vimroom, or MacVim's fullscreen mode. 2) Limelight seems to favor highlighting something over highlighting nothing. I prefer that behavior. 3) A handful of times I've gotten into a weird state where the cursor line is on but focus highlighting isn't. 4) After upgrading to a Retina Mac, I use M+ 1mn Light as my main font, which is already pretty lightweight, and I find the effect a bit annoying: screen shot 2014-08-31 at 2 50 12 pm

reedes commented 10 years ago
  1. I tried with Goyo but didn't have an issue. What were the symptoms?
  2. Agreed that limelight will highlight two paragraphs, if you're between them, as well as highlighting entire paragraphs with hard line breaks. I'm not sure where my preference lies just yet, but I would like to see that behavior with color scheme-specified colors (rather than algorithmic.)
  3. That's odd. Haven't seen that problem yet. Does it occur outside of Goyo?
  4. Agreed that it depends on the font used. I've found that using Adobe's Source Code Pro ExtraLight with a dark background is fine, but suffers with a light background. It's part of the reason I wrote Thematic.