macvim-dev / macvim-dev/macvim
Support OpenType features, like discretionary ligatures and stylistic sets
Nobody has claimed this yet.
- Dominant language
- Vim Script
- Stars
- 7.9k
- Forks
- 691
- PR merge metrics
- No merged PRs in 30d
Description
Many modern, well-made fonts include "OpenType features" that let you fine-tune typographic settings, like the appearance of 0 (slashed vs. dotted), or single/double story a/g. Like code ligatures, which MacVim already supports, these features can improve code legibility.
Is your feature request related something that is currently hard to do? Please describe.
Currently, it's not possible to enable OpenType features.
Also, not all fonts "provide" ligatures in the same way. Fira Code, for example, uses calt (contextual alternates), while Recursive uses the feature flag dlig. With Recursive, set macligatures doesn't turn on ligatures, suggesting that MacVim only supports calt. If OpenType features were supported, it would be possible to use all typography features a font provides, regardless of implementation.
Describe the solution you'd like
MacVim could provide an option, like macligatures, which takes a comma-separated list of OpenType features to enable. These features are four-letter flags, like dlig and ss01.
set macfontfeatures=dlig,ss01
Additional context
This may be a duplicate of #491, but I'm not sure of the difference between "language tags" as described there, and "OpenType features", which is how these settings are described in font documentation that I've seen.
- Examples of OpenType features:
https://github.com/arrowtype/recursive#opentype-features - Discussion of
caltvsdlig, concluding thatdligfits the OpenType spec better:
https://github.com/arrowtype/recursive/issues/106
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating MacVim's existing macligatures option and the font-configuration entry point. Review how feature flags such as dlig and ss01 should be represented; done means a comma-separated setting enables the requested OpenType features, including features implemented differently from calt.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, vim
- Domain
- desktop, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100