-
-
Save dusanx/10aec304ba2bdabdb1c552d9031138a3 to your computer and use it in GitHub Desktop.
Short JS code to test combination of all ligatures for some font and
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var list = ` | |
!= | |
!== | |
!=< | |
=| | |
=|| | |
=|: | |
=/ | |
=/= | |
=/< | |
!≡ | |
!≡≡ | |
≡/ | |
≡/≡ | |
#( | |
#_ | |
#? | |
#_( | |
#{ | |
#> | |
## | |
#[ | |
$> | |
%= | |
&% | |
&& | |
&+ | |
&- | |
&/ | |
&= | |
&&& | |
(| | |
*> | |
++ | |
+++ | |
+= | |
+> | |
++= | |
-- | |
-< | |
-<< | |
-= | |
-> | |
->> | |
--- | |
--> | |
-+- | |
-\/ | |
-|> | |
-<| | |
->- | |
-<- | |
-| | |
-|| | |
-|: | |
.= | |
/= | |
/== | |
/-\ | |
/-: | |
/-> | |
/=> | |
/-< | |
/=< | |
/=: | |
//= | |
:= | |
:≡ | |
:=> | |
:-\ | |
| |
:=/ | |
:-/ | |
:-| | |
:=| | |
:|- | |
:|= | |
<$> | |
<* | |
<*> | |
<+> | |
<- | |
<<= | |
<= | |
<=> | |
<> | |
<|> | |
<<- | |
<| | |
<=< | |
<~ | |
<~~ | |
<<~ | |
<$ | |
<+ | |
<!> | |
<@> | |
<#> | |
<%> | |
<^> | |
<&> | |
<?> | |
<.> | |
</> | |
<\> | |
<"> | |
<:> | |
<~> | |
<**> | |
<<^ | |
<-> | |
<!-- | |
<-- | |
<~< | |
<==> | |
<|- | |
<<| | |
<|| | |
<-< | |
<--> | |
<== | |
<<== | |
<-\ | |
<-/ | |
<=\ | |
<=/ | |
=<< | |
== | |
=== | |
==> | |
=> | |
=~ | |
=>> | |
=~= | |
=>> | |
=>= | |
=<= | |
=< | |
==< | |
=<| | |
≡≡ | |
≡≡≡ | |
≡:≡ | |
>- | |
>= | |
>>- | |
>>= | |
>=> | |
>>^ | |
>>| | |
>!= | |
>-> | |
>== | |
>/= | |
>-| | |
>=| | |
>-\ | |
>=\ | |
>-/ | |
>=/ | |
>λ= | |
?. | |
[[ | |
[| | |
[BUG] | |
[DEBUG] | |
[ERR] | |
[ERROR] | |
[FAIL] | |
[FATAL] | |
[FIXME] | |
[HACK] | |
[INFO] | |
[INFO ] | |
[KO] | |
[MARK] | |
[NOTE] | |
[OK] | |
[PASS] | |
[PASS ] | |
[TODO] | |
[TRACE] | |
[VERBOSE] | |
[WARN] | |
[WARN ] | |
[WARNING] | |
]] | |
\= | |
\== | |
\/- | |
\-/ | |
\-: | |
\-> | |
\=> | |
\-< | |
\=< | |
\=: | |
_|_ | |
^= | |
^<< | |
^>> | |
^^ | |
|) | |
|= | |
|>= | |
|> | |
|+| | |
|-> | |
|--> | |
|=> | |
|==> | |
|>- | |
|<< | |
||> | |
|>> | |
|- | |
||- | |
||= | |
|-: | |
|=: | |
|-< | |
|=< | |
|--< | |
|==< | |
|] | |
~= | |
~> | |
~~> | |
~>> | |
`; | |
list = list.replace(/\n/g, ''); | |
console.log(list); | |
var final = ""; | |
for (var i = 0; i < list.length; i++) { | |
var char = list[i]; | |
if (char.charCodeAt(0) <= 127) { | |
if (!final.includes(char)) final += char; | |
} | |
} | |
console.log(''); | |
console.log(''); | |
console.log('Final command, with escaped characters:'); | |
final = final.split('').sort().join('').replace(' ', '\\ ').replace('"', '\\"').replace("|", '\\|'); | |
console.log(':set guiligatures=' + final); | |
console.log(''); | |
console.log('Make sure to check if everything looks correct with :set guiligatures?'); | |
console.log("If some of the characters doesn't show up probably needs to have backslash in front."); |
Gist updated to output escaped string ready for vim, so now final output for Pragmata Pro looks like:
Final command, with escaped characters:
:set guiligatures=\ !\"#$%&()*+-./:<=>?@ABCDEFGHIKLMNOPRSTUVWX[]^_{\|~
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pragmata Pro users: since I don't use Pragmata Pro, list of ligatures is taken from
https://gist.github.com/fabrizioschiavi/f40a54c8211833c75c81ec82f0c0dd1c
Line 70 (71 in gist above) is especially problematic since it contains space+space+multibyte utf-8 characters. I have no idea if that's how this font is supposed to work, anything above ascii 127 won't make into the list anyway, it already falls to Pango, so maybe that line shoulld be removed?