robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
db210dd2a4
master
1" Vim filetype plugin file 2" Language: Raku 3" Maintainer: vim-perl <vim-perl@googlegroups.com> (need to be subscribed to post) 4" Homepage: https://github.com/Raku/vim-raku 5" Bugs/requests: https://github.com/Raku/vim-raku/issues 6" Last Change: 2021 Apr 16 7" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') 8" Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com> 9" 10" Based on ftplugin/perl.vim by Dan Sharp <dwsharp at hotmail dot com> 11 12if exists ( "b:did_ftplugin" ) |finish |endif 13let b: did_ftplugin = 1 14 15" Make sure the continuation lines below do not cause problems in 16" compatibility mode. 17let s: save_cpo = & cpo 18set cpo -= C 19 20setlocal formatoptions -= t 21setlocal formatoptions += crqol 22setlocal keywordprg = p6doc 23 24setlocal comments = :#\|,:#=,:# 25setlocal commentstring = #\ %s 26 27" Provided by Ned Konz <ned at bike-nomad dot com> 28"--------------------------------------------- 29setlocal include = \\<\\(use\\\|require\\)\\> 30setlocal includeexpr = substitute (v:fname,'::','/','g') 31setlocal suffixesadd = .rakumod,.rakudoc,.pm6,.pm 32setlocal define = [^A-Za-z_] 33 34" The following line changes a global variable but is necessary to make 35" gf and similar commands work. Thanks to Andrew Pimlott for pointing out 36" the problem. If this causes a problem for you, add an 37" after/ftplugin/raku.vim file that contains 38" set isfname-=: 39set isfname += : 40setlocal iskeyword = @,48-57,_,192-255,- 41 42" Raku exposes its CompUnits through $*REPO, but mapping module names to 43" compunit paths is nontrivial. Probably it's more convenient to rely on 44" people using zef, which has a handy store of sources for modules it has 45" installed. 46func s: compareReverseFtime ( a , b ) 47let atime = getftime ( a: a ) 48let btime = getftime ( a: b ) 49return atime > btime ? -1 : atime == btime ? 0 : 1 50endfunc 51 52let & l: path = "lib,." 53if exists ( '$RAKULIB' ) 54let & l: path = & l: path . "," . $ RAKULIB 55endif 56let & l: path = & l: path . "," . join ( 57 \sort ( glob ( "~/.zef/store/*/*/lib" , 0 , 1 ), "s:compareReverseFtime" ), 58 \',' ) 59 60" Convert ascii-based ops into their single-character unicode equivalent 61if get ( g:, 'raku_unicode_abbrevs' , 0 ) 62iabbrev <buffer> !(<) ⊄ 63iabbrev <buffer> !(<=) ⊈ 64iabbrev <buffer> !(>) ⊅ 65iabbrev <buffer> !(>=) ⊉ 66iabbrev <buffer> !(cont) ∌ 67iabbrev <buffer> !(elem) ∉ 68iabbrev <buffer> != ≠ 69iabbrev <buffer> (&) ∩ 70iabbrev <buffer> (+) ⊎ 71iabbrev <buffer> (-) ∖ 72iabbrev <buffer> (.) ⊍ 73iabbrev <buffer> (<) ⊂ 74iabbrev <buffer> (<+) ≼ 75iabbrev <buffer> (<=) ⊆ 76iabbrev <buffer> (>) ⊃ 77iabbrev <buffer> (>+) ≽ 78iabbrev <buffer> (>=) ⊇ 79iabbrev <buffer> (\|) ∪ 80iabbrev <buffer> (^) ⊖ 81iabbrev <buffer> (atomic) ⚛ 82iabbrev <buffer> (cont) ∋ 83iabbrev <buffer> (elem) ∈ 84iabbrev <buffer> * × 85iabbrev <buffer> **0 ⁰ 86iabbrev <buffer> **1 ¹ 87iabbrev <buffer> **2 ² 88iabbrev <buffer> **3 ³ 89iabbrev <buffer> **4 ⁴ 90iabbrev <buffer> **5 ⁵ 91iabbrev <buffer> **6 ⁶ 92iabbrev <buffer> **7 ⁷ 93iabbrev <buffer> **8 ⁸ 94iabbrev <buffer> **9 ⁹ 95iabbrev <buffer> ... … 96iabbrev <buffer> / ÷ 97iabbrev <buffer> << « 98iabbrev <buffer> <<[=]<< «=« 99iabbrev <buffer> <<[=]>> «=» 100iabbrev <buffer> <= ≤ 101iabbrev <buffer> =~= ≅ 102iabbrev <buffer> >= ≥ 103iabbrev <buffer> >> » 104iabbrev <buffer> >>[=]<< »=« 105iabbrev <buffer> >>[=]>> »=» 106iabbrev <buffer> Inf ∞ 107iabbrev <buffer> atomic-add-fetch ⚛+= 108iabbrev <buffer> atomic-assign ⚛= 109iabbrev <buffer> atomic-fetch ⚛ 110iabbrev <buffer> atomic-dec-fetch --⚛ 111iabbrev <buffer> atomic-fetch-dec ⚛-- 112iabbrev <buffer> atomic-fetch-inc ⚛++ 113iabbrev <buffer> atomic-inc-fetch ++⚛ 114iabbrev <buffer> atomic-sub-fetch ⚛−= 115iabbrev <buffer> e 𝑒 116iabbrev <buffer> o ∘ 117iabbrev <buffer> pi π 118iabbrev <buffer> set() ∅ 119iabbrev <buffer> tau τ 120endif 121 122" Undo the stuff we changed. 123let b: undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< isk< kp< path<" . 124 \" | unlet! b:browsefilter" 125 126" Restore the saved compatibility options. 127let & cpo = s: save_cpo 128unlet s: save_cpo