Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment with a focus mode based on cursorline #7

Open
reedes opened this issue Jul 4, 2014 · 5 comments
Open

Experiment with a focus mode based on cursorline #7

reedes opened this issue Jul 4, 2014 · 5 comments

Comments

@reedes
Copy link
Collaborator

reedes commented Jul 4, 2014

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
Copy link
Collaborator Author

reedes commented Aug 30, 2014

@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
Copy link
Contributor

mattly commented Aug 30, 2014

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
Copy link
Collaborator Author

reedes commented Aug 30, 2014

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
Copy link
Contributor

mattly commented Aug 31, 2014

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
Copy link
Collaborator Author

reedes commented Sep 1, 2014

  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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants