ft_raku.txt 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. *ft_raku.txt* The Raku programming language filetype
  2. *vim-raku*
  3. Vim-raku provides syntax highlighting, indentation, and other support for
  4. editing Raku programs.
  5. 1. Using Unicode in your Raku files |raku-unicode|
  6. ==============================================================================
  7. 1. Using Unicode in your Raku files *raku-unicode*
  8. Defining new operators using Unicode symbols is a good way to make your
  9. Raku program easy to read. See:
  10. https://perl6advent.wordpress.com/2012/12/18/day-18-formulas-resistance-is-futile/
  11. While Raku does define ASCII alternatives for some common operators (see
  12. https://docs.raku.org/language/unicode_ascii), using the full range of
  13. Unicode operators is highly desirable. Your operating system provides input
  14. facilities, but using the features built in to Vim may be preferable.
  15. The natural way to produce these symbols in Vim is to use digraph shortcuts
  16. (:help |digraphs-use|). Many of them are defined; type `:digraphs` to get
  17. the list. A convenient way to read the list of digraphs is to save them in a
  18. file. From the shell: >
  19. vim +'redir >/tmp/vim-digraphs-listing.txt' +digraphs +'redir END' +q
  20. Some of them are available with standard Vim digraphs:
  21. << « /0 ∅ !< ≮ ~
  22. >> » Ob ∘ !> ≯ ~
  23. ., … 00 ∞ (C ⊂ ~
  24. (U ∩ -: ÷ )C ⊃ ~
  25. )U ∪ (_ ⊆ >= ≥ ~
  26. ?= ≅ )_ ⊇ =< ≤ ~
  27. (- ∈ ?= ≅ != ≠ ~
  28. -) ∋ ?- ≃ ~
  29. The Greek alphabet is available with '*' followed by a similar Latin symbol:
  30. *p π ~
  31. *t τ ~
  32. *X × ~
  33. Numbers, subscripts and superscripts are available with 's' and 'S':
  34. 0s ₀ 0S ⁰ ~
  35. 1s ₁ 1S ¹ ~
  36. 2s ₂ 9S ⁹ ~
  37. But some don't come defined by default. Those are digraph definitions you can
  38. add in your ~/.vimrc file. >
  39. exec 'digraph \\ ' .. char2nr('∖')
  40. exec 'digraph \< ' .. char2nr('≼')
  41. exec 'digraph \> ' .. char2nr('≽')
  42. exec 'digraph (L ' .. char2nr('⊈')
  43. exec 'digraph )L ' .. char2nr('⊉')
  44. exec 'digraph (/ ' .. char2nr('⊄')
  45. exec 'digraph )/ ' .. char2nr('⊅')
  46. exec 'digraph )/ ' .. char2nr('⊅')
  47. exec 'digraph U+ ' .. char2nr('⊎')
  48. exec 'digraph 0- ' .. char2nr('⊖')
  49. " Euler's constant
  50. exec 'digraph ne ' .. char2nr('𝑒')
  51. " Raku's atomic operations marker
  52. exec 'digraph @@ ' .. char2nr('⚛')
  53. Alternatively, you can write Insert mode abbreviations that convert ASCII-
  54. based operators into their single-character Unicode equivalent. >
  55. iabbrev <buffer> !(<) ⊄
  56. iabbrev <buffer> !(<=) ⊈
  57. iabbrev <buffer> !(>) ⊅
  58. iabbrev <buffer> !(>=) ⊉
  59. iabbrev <buffer> !(cont) ∌
  60. iabbrev <buffer> !(elem) ∉
  61. iabbrev <buffer> != ≠
  62. iabbrev <buffer> (&) ∩
  63. iabbrev <buffer> (+) ⊎
  64. iabbrev <buffer> (-) ∖
  65. iabbrev <buffer> (.) ⊍
  66. iabbrev <buffer> (<) ⊂
  67. iabbrev <buffer> (<+) ≼
  68. iabbrev <buffer> (<=) ⊆
  69. iabbrev <buffer> (>) ⊃
  70. iabbrev <buffer> (>+) ≽
  71. iabbrev <buffer> (>=) ⊇
  72. iabbrev <buffer> (\|) ∪
  73. iabbrev <buffer> (^) ⊖
  74. iabbrev <buffer> (atomic) ⚛
  75. iabbrev <buffer> (cont) ∋
  76. iabbrev <buffer> (elem) ∈
  77. iabbrev <buffer> * ×
  78. iabbrev <buffer> **0 ⁰
  79. iabbrev <buffer> **1 ¹
  80. iabbrev <buffer> **2 ²
  81. iabbrev <buffer> **3 ³
  82. iabbrev <buffer> **4 ⁴
  83. iabbrev <buffer> **5 ⁵
  84. iabbrev <buffer> **6 ⁶
  85. iabbrev <buffer> **7 ⁷
  86. iabbrev <buffer> **8 ⁸
  87. iabbrev <buffer> **9 ⁹
  88. iabbrev <buffer> ... …
  89. iabbrev <buffer> / ÷
  90. iabbrev <buffer> << «
  91. iabbrev <buffer> <<[=]<< «=«
  92. iabbrev <buffer> <<[=]>> «=»
  93. iabbrev <buffer> <= ≤
  94. iabbrev <buffer> =~= ≅
  95. iabbrev <buffer> >= ≥
  96. iabbrev <buffer> >> »
  97. iabbrev <buffer> >>[=]<< »=«
  98. iabbrev <buffer> >>[=]>> »=»
  99. iabbrev <buffer> Inf ∞
  100. iabbrev <buffer> atomic-add-fetch ⚛+=
  101. iabbrev <buffer> atomic-assign ⚛=
  102. iabbrev <buffer> atomic-fetch ⚛
  103. iabbrev <buffer> atomic-dec-fetch --⚛
  104. iabbrev <buffer> atomic-fetch-dec ⚛--
  105. iabbrev <buffer> atomic-fetch-inc ⚛++
  106. iabbrev <buffer> atomic-inc-fetch ++⚛
  107. iabbrev <buffer> atomic-sub-fetch ⚛−=
  108. iabbrev <buffer> e 𝑒
  109. iabbrev <buffer> o ∘
  110. iabbrev <buffer> pi π
  111. iabbrev <buffer> set() ∅
  112. iabbrev <buffer> tau τ
  113. <
  114. vim:tw=78:ts=8:noet:ft=help:norl: