Skip to content

Conversation

@jez
Copy link

@jez jez commented Feb 18, 2022

This PR implements two somewhat orthogonal changes.

If you'd like to only have one of these changes but not the other, I'm
happy to split this PR up and send the changes individually, but since
the two of them together would have merge conflicts independently, I've
authored them in a single PR.

The two changes:

  1. Allow b: variants of the documented configuration variables.
    This allows setting things like goyo_width to different settings
    in different file types or different buffers, by setting a
    buffer-scoped variable.

  2. Default goyo_width to &textwidth + 1 if it is set and neither
    b:goyo_width nor g:goyo_width are set. The + 1 is to handle an
    off-by-one error where for a line that has exactly &textwidth
    characters, goyo would force the line to wrap.

I've been using these changes locally for some files where I have
textwidth set to values larger and smaller than 80, and have been
working well.


Thanks for your work on Goyo by the way—it makes writing in Vim rather
enjoyable.

This PR implements two somewhat orthogonal changes.

If you'd like to only have one of these changes but not the other, I'm
happy to split this PR up and send the changes individually, but since
the two of them together would have merge conflicts independently, I've
authored them in a single PR.

The two changes:

1.  Allow `b:` variants of the documented configuration variables.
    This allows setting things like `goyo_width` to different settings
    in different file types or different buffers, by setting a
    buffer-scoped variable.

2.  Default `goyo_width` to `&textwidth + 1` if it is set and neither
    `b:goyo_width` nor `g:goyo_width` are set. The `+ 1` is to handle an
    off-by-one error where for a line that has exactly `&textwidth`
    characters, goyo would force the line to wrap.

I've been using these changes locally for some files where I have
`textwidth` set to values larger and smaller than 80, and have been
working well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant