From aed8ce9da277f5ecffe968b324f242c41c3b752a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 10:50:31 +0200 Subject: Adding upstream version 2:9.0.1378. Signed-off-by: Daniel Baumann --- runtime/doc/ft_raku.txt | 126 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 runtime/doc/ft_raku.txt (limited to 'runtime/doc/ft_raku.txt') diff --git a/runtime/doc/ft_raku.txt b/runtime/doc/ft_raku.txt new file mode 100644 index 0000000..3d1179e --- /dev/null +++ b/runtime/doc/ft_raku.txt @@ -0,0 +1,126 @@ +*ft_raku.txt* The Raku programming language filetype + + *vim-raku* + +Vim-raku provides syntax highlighting, indentation, and other support for +editing Raku programs. + +1. Using Unicode in your Raku files |raku-unicode| + +============================================================================== +1. Using Unicode in your Raku files *raku-unicode* + +Defining new operators using Unicode symbols is a good way to make your +Raku program easy to read. See: +https://perl6advent.wordpress.com/2012/12/18/day-18-formulas-resistance-is-futile/ + +While Raku does define ASCII alternatives for some common operators (see +https://docs.raku.org/language/unicode_ascii), using the full range of +Unicode operators is highly desirable. Your operating system provides input +facilities, but using the features built in to Vim may be preferable. + +The natural way to produce these symbols in Vim is to use digraph shortcuts +(:help |digraphs-use|). Many of them are defined; type `:digraphs` to get +the list. A convenient way to read the list of digraphs is to save them in a +file. From the shell: > + vim +'redir >/tmp/vim-digraphs-listing.txt' +digraphs +'redir END' +q + +Some of them are available with standard Vim digraphs: + << « /0 ∅ !< ≮ ~ + >> » Ob ∘ !> ≯ ~ + ., … 00 ∞ (C ⊂ ~ + (U ∩ -: ÷ )C ⊃ ~ + )U ∪ (_ ⊆ >= ≥ ~ + ?= ≅ )_ ⊇ =< ≤ ~ + (- ∈ ?= ≅ != ≠ ~ + -) ∋ ?- ≃ ~ + +The Greek alphabet is available with '*' followed by a similar Latin symbol: + *p π ~ + *t τ ~ + *X × ~ + +Numbers, subscripts and superscripts are available with 's' and 'S': + 0s ₀ 0S ⁰ ~ + 1s ₁ 1S ¹ ~ + 2s ₂ 9S ⁹ ~ + +But some don't come defined by default. Those are digraph definitions you can +add in your ~/.vimrc file. > + exec 'digraph \\ ' .. char2nr('∖') + exec 'digraph \< ' .. char2nr('≼') + exec 'digraph \> ' .. char2nr('≽') + exec 'digraph (L ' .. char2nr('⊈') + exec 'digraph )L ' .. char2nr('⊉') + exec 'digraph (/ ' .. char2nr('⊄') + exec 'digraph )/ ' .. char2nr('⊅') + exec 'digraph )/ ' .. char2nr('⊅') + exec 'digraph U+ ' .. char2nr('⊎') + exec 'digraph 0- ' .. char2nr('⊖') + " Euler's constant + exec 'digraph ne ' .. char2nr('𝑒') + " Raku's atomic operations marker + exec 'digraph @@ ' .. char2nr('⚛') + +Alternatively, you can write Insert mode abbreviations that convert ASCII- +based operators into their single-character Unicode equivalent. > + iabbrev !(<) ⊄ + iabbrev !(<=) ⊈ + iabbrev !(>) ⊅ + iabbrev !(>=) ⊉ + iabbrev !(cont) ∌ + iabbrev !(elem) ∉ + iabbrev != ≠ + iabbrev (&) ∩ + iabbrev (+) ⊎ + iabbrev (-) ∖ + iabbrev (.) ⊍ + iabbrev (<) ⊂ + iabbrev (<+) ≼ + iabbrev (<=) ⊆ + iabbrev (>) ⊃ + iabbrev (>+) ≽ + iabbrev (>=) ⊇ + iabbrev (\|) ∪ + iabbrev (^) ⊖ + iabbrev (atomic) ⚛ + iabbrev (cont) ∋ + iabbrev (elem) ∈ + iabbrev * × + iabbrev **0 ⁰ + iabbrev **1 ¹ + iabbrev **2 ² + iabbrev **3 ³ + iabbrev **4 ⁴ + iabbrev **5 ⁵ + iabbrev **6 ⁶ + iabbrev **7 ⁷ + iabbrev **8 ⁸ + iabbrev **9 ⁹ + iabbrev ... … + iabbrev / ÷ + iabbrev << « + iabbrev <<[=]<< «=« + iabbrev <<[=]>> «=» + iabbrev <= ≤ + iabbrev =~= ≅ + iabbrev >= ≥ + iabbrev >> » + iabbrev >>[=]<< »=« + iabbrev >>[=]>> »=» + iabbrev Inf ∞ + iabbrev atomic-add-fetch ⚛+= + iabbrev atomic-assign ⚛= + iabbrev atomic-fetch ⚛ + iabbrev atomic-dec-fetch --⚛ + iabbrev atomic-fetch-dec ⚛-- + iabbrev atomic-fetch-inc ⚛++ + iabbrev atomic-inc-fetch ++⚛ + iabbrev atomic-sub-fetch ⚛−= + iabbrev e 𝑒 + iabbrev o ∘ + iabbrev pi π + iabbrev set() ∅ + iabbrev tau τ +< + vim:tw=78:ts=8:noet:ft=help:norl: -- cgit v1.2.3