Hasklig icon indicating copy to clipboard operation
Hasklig copied to clipboard

Requesting even more ligatures

Open Fresheyeball opened this issue 11 years ago • 18 comments

I would really love to see all of the following

! @ # $ % ^ & * | ? . , / \ " : ~

as ligatures with all of the following

<.> <. .>

so...

<!> <! !>
<@> <@ @>
<#> <# #>
<$> <$ $>
<%> <% %>
<^> <^ ^>
<&> <& &>
<*> <* *>
<|> <| |>
<?> <? ?>
<.> <. .>
</> </ />
<\> <\ \>
<"> <" ">
<:> <: :>
<~> <~ ~>

as well as the rest of the common binders:

>=> <=<
<**>
>>^ ^<<
<<^ ^>>

It would also be nice if \ without < or > would be displayed as λ. So...

\x -> x + 1
--becomes
λx -> x + 1

Lastly (I promise), it would be nice to see forall get displayed as giant .

Fresheyeball avatar Jan 20 '15 22:01 Fresheyeball

The giant being six characters wide? ;)

soenkehahn avatar Jan 21 '15 03:01 soenkehahn

Lambda can't be done reliably because it's a valid identifier IIRC.

bananu7 avatar Jan 21 '15 15:01 bananu7

Lambda and forall (and compose) are better handled by a concealer in the editor than a typeface, IMHO.

+1 to all the rest, though.

ahammel avatar Jan 21 '15 17:01 ahammel

Good ideas here, though it will take time to work through them.

Some of these are already done for an upcoming version. Contextually changing \ to λ is one of those things I'm not entirely sure would be possible, since it would also be necessary to take into consideration the use of \ in strings as an escape character.

i-tu avatar Jan 26 '15 11:01 i-tu

@ahammel what is a concealer?

Fresheyeball avatar Jan 26 '15 15:01 Fresheyeball

I suppose he meant something like this.

@Fresheyeball Can you explain briefly the typical meaning of using > or < with another symbol, say #? I'm tempted, for example, to replace ~> with a squiggly arrow, but I don't know if that would make any sense semantically.

i-tu avatar Jan 26 '15 16:01 i-tu

@Fresheyeball

What @i-tu said. It's an extension of syntax highlighting that replaces ascii characters with unicode in a context-sensitive way. Recent versions of Vim and Emacs can do that, and probably lots of other editors as well.

I think it makes more sense to use that feature when replacing characters one-for-one than to bake the replacements into the font.

ahammel avatar Jan 26 '15 18:01 ahammel

What about ligatures for != and !== so it can be used in a number of other languages as well (JavaScript, Python, C/C++)

Kronuz avatar May 15 '15 12:05 Kronuz

@ahammel, could you tell me how are these extensions called? I can't find anything. Are they built-in?

semaperepelitsa avatar Jun 11 '15 10:06 semaperepelitsa

@semaperepelitsa: in vim, the feature is called 'conceal', and it's built in to recent versions. :h conceal will give you some general information. Extensions like vim2hs make extensive use of concealment for pretty-printing lambdas and composition, and for a few other things like hiding long {-# LANGUAGE #-} pragmas unless the cursor is on the line.

I believe emacs's font-lock mode can do similar things, but I can't dig up the right keywords at the moment (I'm not an emacs guy).

ahammel avatar Jun 11 '15 15:06 ahammel

+1 for Kronuz suggestion.

I'd love to see ligatures for != >= (as the greater or equal to) and <= (as less than or equal to)

stebet avatar Jun 22 '15 10:06 stebet

Same as @stebet, they are common in other languages and lot of people would appreciate it I think.

GauthierPLM avatar Aug 06 '15 12:08 GauthierPLM

What about some of the ligature examples in FiraCode? https://github.com/tonsky/FiraCode

I would be using it, except I think Source Code Pro is a better source font. And it supports ligatures for languages like JavaScript and PHP.

matthew-dean avatar Sep 14 '15 22:09 matthew-dean

Some of these glyphs will be included in 1.0, but I won't make any promises which ones.

i-tu avatar Oct 31 '15 15:10 i-tu

What about ligatures for != and !== so it can be used in a number of other languages as well (JavaScript, Python, C/C++)

:+1:

Same thing for >=, <= and := (plpgsql)

dorian-marchal avatar Nov 04 '15 23:11 dorian-marchal

<?> is very common in Java, and would be great to ligaturize.

yshavit avatar Jun 16 '16 15:06 yshavit

+1 for <#>

clayrat avatar Jul 13 '16 15:07 clayrat

I created #72 for LiveScript --> ~> ~~> <-- <~ <~~ !-> !-> <-! <~! etc. arrows.

laurentpayot avatar Aug 16 '16 16:08 laurentpayot