Skip to content

Instantly share code, notes, and snippets.

@dusanx
Last active October 3, 2021 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dusanx/10aec304ba2bdabdb1c552d9031138a3 to your computer and use it in GitHub Desktop.
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
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.");
@dusanx
Copy link
Author

dusanx commented Oct 1, 2021

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?

@dusanx
Copy link
Author

dusanx commented Oct 3, 2021

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