codekingpro/portable-devtools
114k
1" Vim filetype plugin file2" Language: Raku3" Maintainer: vim-perl <vim-perl@googlegroups.com> (need to be subscribed to post)4" Homepage: https://github.com/Raku/vim-raku5" Bugs/requests: https://github.com/Raku/vim-raku/issues6" Last Change: 2021 Apr 167" 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 | endif13let b:did_ftplugin = 114 15" Make sure the continuation lines below do not cause problems in16" compatibility mode.17let s:save_cpo = &cpo18set cpo-=C19 20setlocal formatoptions-=t21setlocal formatoptions+=crqol22setlocal keywordprg=p6doc23 24setlocal comments=:#\|,:#=,:#25setlocal commentstring=#\ %s26 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,.pm32setlocal define=[^A-Za-z_]33 34" The following line changes a global variable but is necessary to make35" gf and similar commands work. Thanks to Andrew Pimlott for pointing out36" the problem. If this causes a problem for you, add an37" after/ftplugin/raku.vim file that contains38" set isfname-=:39set isfname+=:40setlocal iskeyword=@,48-57,_,192-255,-41 42" Raku exposes its CompUnits through $*REPO, but mapping module names to43" compunit paths is nontrivial. Probably it's more convenient to rely on44" people using zef, which has a handy store of sources for modules it has45" installed.46func s:compareReverseFtime(a, b)47 let atime = getftime(a:a)48 let btime = getftime(a:b)49 return atime > btime ? -1 : atime == btime ? 0 : 150endfunc51 52let &l:path = "lib,."53if exists('$RAKULIB')54 let &l:path = &l:path . "," . $RAKULIB55endif56let &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 equivalent61if get(g:, 'raku_unicode_abbrevs', 0)62 iabbrev <buffer> !(<) ⊄63 iabbrev <buffer> !(<=) ⊈64 iabbrev <buffer> !(>) ⊅65 iabbrev <buffer> !(>=) ⊉66 iabbrev <buffer> !(cont) ∌67 iabbrev <buffer> !(elem) ∉68 iabbrev <buffer> != ≠69 iabbrev <buffer> (&) ∩70 iabbrev <buffer> (+) ⊎71 iabbrev <buffer> (-) ∖72 iabbrev <buffer> (.) ⊍73 iabbrev <buffer> (<) ⊂74 iabbrev <buffer> (<+) ≼75 iabbrev <buffer> (<=) ⊆76 iabbrev <buffer> (>) ⊃77 iabbrev <buffer> (>+) ≽78 iabbrev <buffer> (>=) ⊇79 iabbrev <buffer> (\|) ∪80 iabbrev <buffer> (^) ⊖81 iabbrev <buffer> (atomic) ⚛82 iabbrev <buffer> (cont) ∋83 iabbrev <buffer> (elem) ∈84 iabbrev <buffer> * ×85 iabbrev <buffer> **0 ⁰86 iabbrev <buffer> **1 ¹87 iabbrev <buffer> **2 ²88 iabbrev <buffer> **3 ³89 iabbrev <buffer> **4 ⁴90 iabbrev <buffer> **5 ⁵91 iabbrev <buffer> **6 ⁶92 iabbrev <buffer> **7 ⁷93 iabbrev <buffer> **8 ⁸94 iabbrev <buffer> **9 ⁹95 iabbrev <buffer> ... …96 iabbrev <buffer> / ÷97 iabbrev <buffer> << «98 iabbrev <buffer> <<[=]<< «=«99 iabbrev <buffer> <<[=]>> «=»100 iabbrev <buffer> <= ≤101 iabbrev <buffer> =~= ≅102 iabbrev <buffer> >= ≥103 iabbrev <buffer> >> »104 iabbrev <buffer> >>[=]<< »=«105 iabbrev <buffer> >>[=]>> »=»106 iabbrev <buffer> Inf ∞107 iabbrev <buffer> atomic-add-fetch ⚛+=108 iabbrev <buffer> atomic-assign ⚛=109 iabbrev <buffer> atomic-fetch ⚛110 iabbrev <buffer> atomic-dec-fetch --⚛111 iabbrev <buffer> atomic-fetch-dec ⚛--112 iabbrev <buffer> atomic-fetch-inc ⚛++113 iabbrev <buffer> atomic-inc-fetch ++⚛114 iabbrev <buffer> atomic-sub-fetch ⚛−=115 iabbrev <buffer> e 𝑒116 iabbrev <buffer> o ∘117 iabbrev <buffer> pi π118 iabbrev <buffer> set() ∅119 iabbrev <buffer> tau τ120endif121 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_cpo128unlet s:save_cpo129 