Open pauldhunt opened 9 years ago
+1 That would be so awesome! I would REALLY appreciate this. EDIT: Hasklig support in particular, not just ligatures in general.
Very much so. I did not know what this was, I searched, found it and fell in love. +1 for Hasklig-style ligatures. P.S. how did I survive coding without this until now?
My primary IDE doesn't support these at the time, but in hopes that it will — +1 :smile:
This would be great also for me. Thank you in advance. +1
I don't like the idea, because in a monospace font I prefer to see exactly what I type. Especially if you use the font for documentation. So my vote is to keep a saparate Hasklig fork for those who really want to use it.
I’d also rather keep those decorations off the official coding fonts… Maybe shipping them in separate “Alt” fonts?
+1 if there is a switch for this feature or another font file is provided.
@artcs Just to be clear, all pauldhunt is asking is if we want extra characters included in the official font. The automatic substitution of => to ⇒ is not a feature of the font, rather is requires a plugin for your text editor.
So I don't see why the inclusion of some extra ligatures in the font will be a concern (except for maybe size) as you don't have to ever actually use them and they are not substituted into your code by default.
@ldmldmldm You can add any glyph you want of course. It just shouldn`t be a default ligature feature in the font.
@artcs Well arguably it's a font designed for source code, so it kinda makes sense for it to posses programming relevant ligatures.
Maybe I miss understand the difference between ligatures and glyphs, but from my understanding '&' is a ligature for 'and', yet you are not forced to use either one, '&' is just another glyph right?
Or is ampersand a unique example (if it is more than just an extra glyph then I could understand having a version with and a version without)?
I'd love to see these ligatures, too :+1:.
what i’d like feedback on is which ligatures would be most useful. for those of you that are interested, if you could perhaps make a ranked list that would be enlightening to me. thanks.
For me, a useful "very basic" set would be: /= == ++ :: -> => && || Very close after that: <- >> >>= (<< and =<< might be placed here, too, otherwise it might look strange to have ligatures for one "direction" but not the other if both are used in a piece of code, I personally just don't need them that often) Next up: <> <$> <+> <*>
I'll leave it to others to be greedy and request more :).
That's a good starting point, but certainly <- is in the critical list as it's essential syntax for monad compressions (do x <- f y; ...
). (OT: but the /= looks rather ugly in Hasklig).
Not sure if all of these are doable, but in my case the ranked list would look as follows:
->
=>
&&
||
::
===
==
[]
++
--
__
Definitely these ->
<-
::
>>=
<<=
=>
&&
||
An image I came across at http://sublimetext.userecho.com/topic/433445-/#comment-1286505
PragmataPro is a fantastic professional font. I used it for all of my Haskell programming before switching to SCP. I would love to see some of the ligatures included in a future release.
Source Code Pro already looks great! I would only use ligatures if they are still recognizable, that is, close to the original character sequence. So I am mainly looking for fine-tuned kerning, better positioning and subtle beauty. :)
Anyway, here's what I often use (mainly in JavaScript, Go & templating):
//
[]
()
{}
{{
}}
{{.}}
==
===
!=
!==
<-
<<
...
:=
+=
-=
<=
>=
++
--
||
&&
""
''
@pauldhunt , I would be more than happy to collaborate if you decide to make coding ligatures part of SCP. +1
There's work to be done in improving the coding ligature user experience, particularly in allowing the editor or user to pick the correct ligatures to show according to programming language. I don't know if this could be done with OpenType, or if several versions of the typeface need to be distributed for each programming language. Honestly, I don't know what OpenType is practically capable of. Some discussion: https://github.com/i-tu/Hasklig/issues/21
I'm -1 on this if it is on by default, part of the reason I use SCP everywhere is that I can tell what (printable) characters are there in my source. If these don't affect normal use in a terminal or other text editor, then I'm ±0 on it.
I like ligatures support but I would like to see it as an option and not default.
It seems that this is something that editors would have to opt into. (See http://blog.atom.io/2015/10/29/atom-1-1-is-out.html) - if that's right there doesn't seem much of a reason not to do this.
Monoid (http://larsenwork.com/monoid/) gets something right that Hasklig doesn't, editor support for placing the cursor in the middle of a ligature. From my use, it feels as though Hasklig uses a single wide ligature in place of the first character and zero-width blanks for the remaining characters, where Monoid splits the display evenly out among the characters.
I'm not a fan of the way Monoid looks, but it feels as though it's done the ligatures a better way. That said, Hasklig is still a step up on no ligatures at all.
Please do this. The plug-in support method to replace key combinations with ligatures is awfully broken, it would be much better as an extended version of an existing font.
Does anyone want to take on the task of compiling a set of ligatures to be added to a future version of SCP? I’m afraid I do not want to sink the time into sussing out all the useful combinations. Ideally, a table that shows what ligatures would be needed for which programming languages would be best so that I can try to prioritize in what order to add things. Thanks.
Hi, I hope you can use a public spreadsheet. I am primarily a JavaScript developer, so I added ligatures for this language. public google drive spreadsheet
Hi. I was thinking of analyzing some large repositories of code in various languages to estimate the percentage use of the various ligatures in each language.
@sladiri a very nice start! thanks for sharing.
@harrisonrodgers that would be greatly helpful. :smile:
VS code insider builds seems to support ligatures as in Hasklig => https://github.com/Microsoft/vscode/pull/1510 - and, as noted above, they are opt-in.
Hi. Here are my results after analyzing a pile of repositories. Currently it is helpful to determine the most common ligatures for each language, but not to compare languages.
@harrisonrodgers this is somewhat interesting, are the number simply the number of times found in some unspecified amount of code? this data could be more interesting if it calculated the frequency as a percentage of the total amount of code queried.
Yes, currently the numbers are simply the count of occurrences in whatever github repository I scanned. Rather than providing simply a ranked order of ligatures for each language I thought it might be useful to have the count to know at what point the ranked order starts to become meaningless.
Right now the results are only useful to determine, for example, what ten ligatures could be implemented for each language to have the most noticeable impact in each.
This would be great. I like SCP very much...
+1 ! I would love to see that. My question is what would be the difference comparing to Hasklig? Hasklig is basically SCP plus ligatures.
+1 from me, and Intellij IDEA now makes it possible to turn these on with a checkbox in preferences.
@jianghaizhu so should we just leave the ligatures to Hasklig and not incorporate into SCP?
@pauldhunt If the implementation is the same as Hasklig, what is the point? However, personally I think the way MONOID did is better. An article by the author of MONOID explained some of the differences. I like the Editability feature very much. Of course you can design your own implementation.
@pauldhunt I'm kind of +0 on this (but downloading haskelig to try)… since it's a fork, and ligatures are optional, would it be an option to merge hasklig back in? edit ok, ligatures do seem to be nice. If they are always on in safari though as monoid says, then that would not be good to include them.
Another problem in Hasklig is that it lacks the ligatures for <=
and >=
where most languages use them as less or equal
and larger or equal
. It is really inconvenient for people who are not using Hask.
+1 and all the ligatures that are supported by Fira code would make it awesome .especially != , => , ->, ++ , -- , <> and few more that already there in Hasklig and FiraCode
Agree with @jianghaizhu on this ..It would be really nice if we can get the following three atleast
<= and >= and != .As they are commonly used in all the programming languages . Fira code seems to support them
With all the IntelliJ based IDEs supporting ligatures nowadays there is definitely interest in them. With the recently launched AndroidStudio 2.4 preview, AS also supports ligatures so all the Android developers could benefit as well.
This would be great, most of the editors/IDEs I use can utilize these now.
+1
+1 do it! FiraCode is a temp solution, but Source Code Pro ligatures is the way!
I'm with @killua99, using FiraCode but really wishing it would come to Source Code Pro!
+1
I would like to! I'm now using FiraCode for the ligatures, but I love (and miss) Source Code Pro!
@pauldhunt This seems to be a very desirable feature for SCP based on the reactions here. Any thoughts about if you would work on this?
I guess this is an invitation for +1’s, even though I generally dislike them. GitHub should have a polling feature, hmmmmm...
Hasklig
Also, if you have any insights about what works and what doesn’t in terms of coding ligatures, please post here.