├── .gitignore ├── LICENSE ├── README.md ├── after └── plugin │ └── fireplace.vim ├── ftdetect └── hy.vim ├── ftplugin └── hy.vim ├── indent └── hy.vim └── syntax └── hy.vim /.gitignore: -------------------------------------------------------------------------------- 1 | .git 2 | *.swo 3 | *.swp 4 | __pycache__ 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | vim-hy License 2 | ========================== 3 | 4 | Copyright 2013 (c) Morten Linderud. 5 | 6 | Relicensed under the Vim License (below) for distribution with Vim. 7 | 8 | VIM LICENSE 9 | 10 | I) There are no restrictions on distributing unmodified copies of Vim except 11 | that they must include this license text. You can also distribute 12 | unmodified parts of Vim, likewise unrestricted except that they must 13 | include this license text. You are also allowed to include executables 14 | that you made from the unmodified Vim sources, plus your own usage 15 | examples and Vim scripts. 16 | 17 | II) It is allowed to distribute a modified (or extended) version of Vim, 18 | including executables and/or source code, when the following four 19 | conditions are met: 20 | 1) This license text must be included unmodified. 21 | 2) The modified Vim must be distributed in one of the following five ways: 22 | a) If you make changes to Vim yourself, you must clearly describe in 23 | the distribution how to contact you. When the maintainer asks you 24 | (in any way) for a copy of the modified Vim you distributed, you 25 | must make your changes, including source code, available to the 26 | maintainer without fee. The maintainer reserves the right to 27 | include your changes in the official version of Vim. What the 28 | maintainer will do with your changes and under what license they 29 | will be distributed is negotiable. If there has been no negotiation 30 | then this license, or a later version, also applies to your changes. 31 | The current maintainer is Bram Moolenaar . If this 32 | changes it will be announced in appropriate places (most likely 33 | vim.sf.net, www.vim.org and/or comp.editors). When it is completely 34 | impossible to contact the maintainer, the obligation to send him 35 | your changes ceases. Once the maintainer has confirmed that he has 36 | received your changes they will not have to be sent again. 37 | b) If you have received a modified Vim that was distributed as 38 | mentioned under a) you are allowed to further distribute it 39 | unmodified, as mentioned at I). If you make additional changes the 40 | text under a) applies to those changes. 41 | c) Provide all the changes, including source code, with every copy of 42 | the modified Vim you distribute. This may be done in the form of a 43 | context diff. You can choose what license to use for new code you 44 | add. The changes and their license must not restrict others from 45 | making their own changes to the official version of Vim. 46 | d) When you have a modified Vim which includes changes as mentioned 47 | under c), you can distribute it without the source code for the 48 | changes if the following three conditions are met: 49 | - The license that applies to the changes permits you to distribute 50 | the changes to the Vim maintainer without fee or restriction, and 51 | permits the Vim maintainer to include the changes in the official 52 | version of Vim without fee or restriction. 53 | - You keep the changes for at least three years after last 54 | distributing the corresponding modified Vim. When the maintainer 55 | or someone who you distributed the modified Vim to asks you (in 56 | any way) for the changes within this period, you must make them 57 | available to him. 58 | - You clearly describe in the distribution how to contact you. This 59 | contact information must remain valid for at least three years 60 | after last distributing the corresponding modified Vim, or as long 61 | as possible. 62 | e) When the GNU General Public License (GPL) applies to the changes, 63 | you can distribute the modified Vim under the GNU GPL version 2 or 64 | any later version. 65 | 3) A message must be added, at least in the output of the ":version" 66 | command and in the intro screen, such that the user of the modified Vim 67 | is able to see that it was modified. When distributing as mentioned 68 | under 2)e) adding the message is only required for as far as this does 69 | not conflict with the license used for the changes. 70 | 4) The contact information as required under 2)a) and 2)d) must not be 71 | removed or changed, except that the person himself can make 72 | corrections. 73 | 74 | III) If you distribute a modified version of Vim, you are encouraged to use 75 | the Vim license for your changes and make them available to the 76 | maintainer, including the source code. The preferred way to do this is 77 | by e-mail or by uploading the files to a server and e-mailing the URL. 78 | If the number of changes is small (e.g., a modified Makefile) e-mailing a 79 | context diff will do. The e-mail address to be used is 80 | 81 | 82 | IV) It is not allowed to remove this license from the distribution of the Vim 83 | sources, parts of it or from a modified version. You may use this 84 | license for previous Vim releases instead of the license that they came 85 | with, at your option. 86 | 87 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | vim-hy 2 | ====== 3 | 4 | A syntax file for [Hy](http://hylang.org). 5 | 6 | Requires a Vim built with Python support and Hy installed so that Vim can load 7 | it. You can verify this with 8 | 9 | :python import hy 10 | 11 | which should not show an error. 12 | 13 | Installation 14 | ------------ 15 | 16 | If you are using [Plug](https://github.com/junegunn/vim-plug), add this to your plugins list in `.vimrc`: 17 | 18 | Plug 'hylang/vim-hy' 19 | 20 | Otherwise, install using whatever vim plugin approach you prefer. 21 | 22 | Conceal support 23 | --------------- 24 | Use `let g:hy_enable_conceal = 1` to enable support for concealing some 25 | constructs with unicode glyphs. If this option is enabled, this 26 | 27 | (defn something [alpha beta] 28 | (sum (xi + x1 alpha) (range beta))) 29 | 30 | will be displayed like this 31 | 32 | (ƒ something [α β] 33 | (∑ (x¡ + x₁ α) (range β))) 34 | 35 | The full table of concealed symbols looks like this: 36 | 37 | Symbol | Display | Symbol | Display | Symbol | Display 38 | ----------: | :-------- | ------: | :------ | --------: | :------ 39 | `fn` | `λ` | `and` | `∧` | `<=` | `≤` 40 | `lambda` | `λ` | `or` | `∨` | `>=` | `≥` 41 | `defn` | `ƒ` | `not` | `¬` | `!=` | `≠` 42 | `defn/a` | `ƒa` | `fn/a` | `λa` | `lfor` | `s∀` 43 | `sfor` | `s∀` | `dfor` | `d∀` | `gfor` | `g∀` 44 | `*` | `∙` | `->` | `⊳` | `None` | `∅` 45 | `math.sqrt` | `√` | `->>` | `‣` | `math.pi` | `π` 46 | `sum` | `∑` | `for` | `∀` | `some` | `∃` 47 | `in` | `∈` | `alpha` | `α` | `gamma` | `γ` 48 | `not-in` | `∉` | `beta` | `β` | `delta` | `δ` 49 | `epsilon` | `ε` | `xi` | `x¡` | `#%` | `x¡` 50 | `x[0-9]` | `x₀` - `x₉` 51 | 52 | If you do `let g:hy_conceal_fancy=1`, `xi` and `#%` are displayed as `ξ`. 53 | -------------------------------------------------------------------------------- /after/plugin/fireplace.vim: -------------------------------------------------------------------------------- 1 | " This code is almost verbatim from fireplace by Tim Pope. 2 | 3 | augroup fireplace_connect 4 | autocmd FileType hy command! -buffer -bar -nargs=* 5 | \ Connect FireplaceConnect 6 | augroup END 7 | 8 | function! s:set_up_eval() abort 9 | command! -buffer -bang -range=0 -nargs=? Eval :exe s:Eval(0, , , , ) 10 | command! -buffer -bar -nargs=1 -complete=customlist,fireplace#eval_complete Doc :exe s:Doc() 11 | 12 | nmap cp FireplacePrint 13 | nmap cpp FireplaceCountPrint 14 | 15 | nmap cm FireplaceMacroExpand 16 | nmap cmm FireplaceCountMacroExpand 17 | 18 | nmap cqp FireplacePrompt 19 | 20 | map! ( FireplaceRecall 21 | 22 | nmap K FireplaceK 23 | endfunction 24 | 25 | if !exists('s:qffiles') 26 | let s:qffiles = {} 27 | endif 28 | 29 | function! s:buf() abort 30 | if exists('s:input') 31 | return s:input 32 | elseif has_key(s:qffiles, expand('%:p')) 33 | return s:qffiles[expand('%:p')].buffer 34 | else 35 | return '%' 36 | endif 37 | endfunction 38 | 39 | function! s:buffer_path(...) abort 40 | let buffer = a:0 ? a:1 : s:buf() 41 | if getbufvar(buffer, '&buftype') =~# '^no' 42 | return '' 43 | endif 44 | let path = substitute(fnamemodify(bufname(buffer), ':p'), '\C^zipfile:\(.*\)::', '\1/', '') 45 | for dir in fireplace#path(buffer) 46 | if dir !=# '' && path[0 : strlen(dir)-1] ==# dir && path[strlen(dir)] =~# '[\/]' 47 | return path[strlen(dir)+1:-1] 48 | endif 49 | endfor 50 | return '' 51 | endfunction 52 | 53 | function! s:Eval(bang, line1, line2, count, args) abort 54 | let options = {} 55 | if a:args !=# '' 56 | let expr = a:args 57 | else 58 | if a:count ==# 0 59 | let open = '[[{(]' 60 | let close = '[]})]' 61 | let [line1, col1] = searchpairpos(open, '', close, 'bcrn', g:fireplace#skip) 62 | let [line2, col2] = searchpairpos(open, '', close, 'rn', g:fireplace#skip) 63 | if !line1 && !line2 64 | let [line1, col1] = searchpairpos(open, '', close, 'brn', g:fireplace#skip) 65 | let [line2, col2] = searchpairpos(open, '', close, 'crn', g:fireplace#skip) 66 | endif 67 | while col1 > 1 && getline(line1)[col1-2] =~# '[#''`~@]' 68 | let col1 -= 1 69 | endwhile 70 | else 71 | let line1 = a:line1 72 | let line2 = a:line2 73 | let col1 = 1 74 | let col2 = strlen(getline(line2)) 75 | endif 76 | if !line1 || !line2 77 | return '' 78 | endif 79 | let options.file_path = s:buffer_path() 80 | let expr = repeat("\n", line1-1).repeat(" ", col1-1) 81 | if line1 == line2 82 | let expr .= getline(line1)[col1-1 : col2-1] 83 | else 84 | let expr .= getline(line1)[col1-1 : -1] . "\n" 85 | \ . join(map(getline(line1+1, line2-1), 'v:val . "\n"')) 86 | \ . getline(line2)[0 : col2-1] 87 | endif 88 | if a:bang 89 | exe line1.','.line2.'delete _' 90 | endif 91 | endif 92 | if a:bang 93 | try 94 | let result = fireplace#session_eval(expr, options) 95 | if a:args !=# '' 96 | call append(a:line1, result) 97 | exe a:line1 98 | else 99 | call append(a:line1-1, result) 100 | exe a:line1-1 101 | endif 102 | catch /^Clojure:/ 103 | endtry 104 | else 105 | call fireplace#echo_session_eval(expr, options) 106 | endif 107 | return '' 108 | endfunction 109 | 110 | augroup fireplace_bindings 111 | autocmd FileType hy call s:set_up_eval() 112 | augroup END 113 | 114 | function! s:Doc(symbol) abort 115 | let info = fireplace#info(a:symbol) 116 | if has_key(info, 'ns') && has_key(info, 'name') 117 | echo info.ns . ' ' . info.name 118 | elseif has_key(info, "name") 119 | echo info.name 120 | endif 121 | if get(info, 'arglists-str', 'nil') !=# 'nil' 122 | echo info['arglists-str'] 123 | endif 124 | if !empty(get(info, 'doc', '')) 125 | echo "\n" . info.doc 126 | endif 127 | return '' 128 | endfunction 129 | 130 | function! s:K() abort 131 | let word = expand('') 132 | return 'Doc '.word 133 | endfunction 134 | -------------------------------------------------------------------------------- /ftdetect/hy.vim: -------------------------------------------------------------------------------- 1 | au BufRead,BufNewFile *.hy setf hy 2 | 3 | fun! s:DetectHyShebang() 4 | if getline(1) =~# '^#!.*/bin/env\s\+hy\>' 5 | setf hy 6 | endif 7 | endfun 8 | 9 | autocmd BufNewFile,BufRead * call s:DetectHyShebang() 10 | -------------------------------------------------------------------------------- /ftplugin/hy.vim: -------------------------------------------------------------------------------- 1 | " Vim filetype plugin file 2 | " Language: Hy 3 | " Author: György Andorka 4 | " URL: http://github.com/hylang/vim-hy 5 | 6 | if exists("b:did_ftplugin") 7 | finish 8 | endif 9 | 10 | " Start with Clojure ftplugin 11 | runtime! ftplugin/clojure.vim 12 | setlocal iskeyword-=. 13 | 14 | " Hy specific lispwords: 15 | " All core macros in https://hylang.org/hy/doc/v1.0.0/api 16 | " with a simple rule: it should be indented specially (as lispwords) only if 17 | " its first argument is special. 18 | setlocal lispwords=let,if,when,while,for,lfor,dfor,gfor,sfor,with,match,try, 19 | \defn,fn,defmacro,defreader,defclass,except,except* 20 | " 21 | " Hyrule lispwords: 22 | " http://hylang.org/hyrule/doc/v0.6.0 23 | " same rule as above 24 | setlocal lispwords+=ap-if,ap-each,ap-each-while,ap-dotimes,ap-when,ap-with, 25 | \->,->>,as->,some->,doto,block,branch,case,cfor, 26 | \defmain,do-n,ebranch,ecase,list-n,loop,unless,defn+, 27 | \defn/a+,fn+,fn/a+,let+,defmacro-kwargs,defmacro!, 28 | \with-gensyms,seq,defseq,smacrolet 29 | 30 | " Use two semicolons: The Hy style guide recommends a single semicolon for 31 | " margin comments only. 32 | setlocal commentstring=;;\ %s 33 | -------------------------------------------------------------------------------- /indent/hy.vim: -------------------------------------------------------------------------------- 1 | " Vim indent file 2 | " Language: Hy 3 | " Maintainer: Gregor Best 4 | " URL: https://github.com/hylang/vim-hy 5 | " Last Change: 2015 Jun 01 6 | " 7 | " Based on the Lisp indent file by Sergey Khorev (), 8 | " http://sites.google.com/site/khorser/opensource/vim 9 | 10 | " Only load this indent file when no other was loaded. 11 | if exists("b:did_indent") 12 | finish 13 | endif 14 | 15 | " Use the Clojure indenting 16 | runtime! indent/clojure.vim 17 | 18 | if exists("*searchpairpos") 19 | if !exists('g:hy_special_indent_words') 20 | let g:hy_special_indent_words = '' 21 | endif 22 | 23 | function! GetHyIndent() 24 | let prev_line = synIDattr(synID(v:lnum-1, col([v:lnum-1,"$"])-1, 0), "name") 25 | if prev_line == "hyString" || prev_line == "hyStringEscape" 26 | return indent(v:lnum-1) 27 | endif 28 | let l:clojure_align_multiline_strings = g:clojure_align_multiline_strings 29 | let l:clojure_special_indent_words = g:clojure_special_indent_words 30 | let g:clojure_align_multiline_strings = g:->get('hy_align_multiline_strings', 1) 31 | let g:clojure_special_indent_words = g:hy_special_indent_words 32 | try 33 | let l:ret = GetClojureIndent() 34 | finally 35 | let g:clojure_align_multiline_strings = l:clojure_align_multiline_strings 36 | let g:clojure_special_indent_words = l:clojure_special_indent_words 37 | endtry 38 | return l:ret 39 | endfunction 40 | 41 | setlocal indentexpr=GetHyIndent() 42 | 43 | endif 44 | -------------------------------------------------------------------------------- /syntax/hy.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: hy 3 | " License: Same as VIM 4 | " Authors: Morten Linderud 5 | " Alejandro Gómez 6 | " Sunjay Cauligi 7 | " URL: http://github.com/hylang/vim-hy 8 | " 9 | " Modified version of the clojure syntax file: https://github.com/guns/vim-clojure-static/blob/master/syntax/clojure.vim 10 | if exists("b:current_syntax") 11 | finish 12 | endif 13 | 14 | let b:current_syntax = "hy" 15 | 16 | syntax keyword hyAnaphoric ap-if ap-each ap-each-while ap-map ap-map-when 17 | \ ap-filter ap-reject ap-dotimes ap-first ap-last ap-reduce 18 | \ ap-when ap-with 19 | 20 | " as of hy 1.0.0 21 | syntax keyword hyBuiltin 22 | \ annotate as-model chainc del dfor gensym get-macro gfor let lfor 23 | \ local-macros macroexpand macroexpand-1 mangle py pys quasiquote 24 | \ quote read read-many repr repr-register setv setx sfor unmangle 25 | \ unpack-iterable unpack-mapping unquote unquote-splice 26 | 27 | " as of hyrule 0.6.0 28 | syntax keyword hyHyruleBuiltin 29 | \ ameth assoc block butlast cfor coll? comment constantly dec 30 | \ defmacro! defmacro-kwargs defmain defn+ defn/a+ defseq dict=: 31 | \ distinct do-n doto drop-last end-sequence flatten fn+ fn/a+ 32 | \ import-path inc let+ list-n macroexpand-all map-model 33 | \ match-fn-params meth ncut parse-args pformat postwalk pp pprint 34 | \ prewalk profile/calls profile/cpu readable? recursive? rest 35 | \ saferepr seq setv+ sign smacrolet thru walk with-gensyms xor 36 | 37 | " Derived from vim's python syntax file 38 | syntax keyword hyPythonBuiltin 39 | \ abs all any ascii bin bool breakpoint bytearray bytes callable chr 40 | \ classmethod compile complex delattr dict dir divmod enumerate eval 41 | \ exec filter float format frozenset getattr globals hasattr hash 42 | \ help hex id input int isinstance issubclass iter len list locals 43 | \ map max memoryview min next object oct open ord pow print property 44 | \ range repr reversed round set setattr slice sorted staticmethod 45 | \ str sum super tuple type vars zip --package-- __package__ 46 | \ --import-- __import__ --all-- __all__ --doc-- __doc__ --name-- 47 | \ __name__ 48 | 49 | syntax keyword hyAsync await 50 | 51 | syntax keyword hyBoolean True False 52 | 53 | syntax keyword hyConstant None Ellipsis NotImplemented Inf NaN 54 | \ nil " Deprecated 55 | 56 | syntax keyword hyException ArithmeticError AssertionError AttributeError 57 | \ BaseException DeprecationWarning EOFError EnvironmentError 58 | \ Exception FloatingPointError FutureWarning GeneratorExit IOError 59 | \ ImportError ImportWarning IndexError KeyError KeyboardInterrupt 60 | \ LookupError MemoryError NameError NotImplementedError OSError 61 | \ OverflowError PendingDeprecationWarning ReferenceError 62 | \ RuntimeError RuntimeWarning StopIteration SyntaxError 63 | \ SyntaxWarning SystemError SystemExit TypeError UnboundLocalError 64 | \ UnicodeDecodeError UnicodeEncodeError UnicodeError 65 | \ UnicodeTranslateError UnicodeWarning UserWarning VMSError 66 | \ ValueError Warning WindowsError ZeroDivisionError BufferError 67 | \ BytesWarning IndentationError ResourceWarning TabError 68 | 69 | syntax keyword hyStatement 70 | \ break continue do fn global nonlocal return with yield 71 | 72 | syntax keyword hyRepeat loop for while 73 | 74 | syntax keyword hyConditional 75 | \ branch case cond ebranch ecase else if lif match unless when 76 | 77 | syntax keyword hySpecial self 78 | 79 | syntax keyword hyMisc do-mac eval eval-and-compile eval-when-compile pragma 80 | 81 | syntax keyword hyErrorHandling assert except except* finally raise try 82 | 83 | syntax keyword hyInclude export import require 84 | 85 | " Not used at this moment 86 | "syntax keyword hyVariable 87 | 88 | " Keywords are symbols: 89 | " static Pattern symbolPat = Pattern.compile("[:]?([\\D&&[^/]].*/)?([\\D&&[^/]][^/]*)"); 90 | " But they: 91 | " * Must not end in a : or / 92 | " * Must not have two adjacent colons except at the beginning 93 | " * Must not contain any reader metacharacters except for ' and # 94 | syntax match hyKeyword "\v<:{1,2}%([^ \n\r\t()\[\]{}";@^`~\\%/]+/)*[^ \n\r\t()\[\]{}";@^`~\\%/]+:@" 95 | 96 | syntax match hyStringEscape "\v\\%([\\abfnrtv'"]|[0-3]\o{2}|\o{1,2}|x\x{2}|u\x{4}|U\x{8}|N\{[^}]*\})" contained 97 | 98 | syntax region hyString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=hyStringEscape 99 | syntax region hyString start="#\[\[" skip=/\\\\\|\\"/ end="\]\]" contains=hyStringEscape 100 | 101 | syntax match hyCharacter "\\." 102 | syntax match hyCharacter "\\o\%([0-3]\o\{2\}\|\o\{1,2\}\)" 103 | syntax match hyCharacter "\\u\x\{4\}" 104 | syntax match hyCharacter "\\space" 105 | syntax match hyCharacter "\\tab" 106 | syntax match hyCharacter "\\newline" 107 | syntax match hyCharacter "\\return" 108 | syntax match hyCharacter "\\backspace" 109 | syntax match hyCharacter "\\formfeed" 110 | 111 | syntax match hySymbol "\v%([a-zA-Z!$&*_+=|<.>?-]|[^\x00-\x7F])+%(:?%([a-zA-Z0-9!#$%&*_+=|'<.>/?-]|[^\x00-\x7F]))*[#:]@\|->>\|as->\|some->\)\>" 118 | syntax match hyOpInplace "\M\<\(!\|%\|&\|*\|**\|+\|-\|/\|//\|<\|<<\|>\|>>\|^\||\|and\|bnot\|cut\|get\|in\|is\|is-not\|not\|not-in\|or\|of\)=\?\>" 119 | 120 | " Number highlighting taken from vim's syntax/python.vim, 121 | " but modified to allow leading 0 122 | syntax match hyNumber "\<0[oO]\%(_\=\o\)\+\>" 123 | syntax match hyNumber "\<0[xX]\%(_\=\x\)\+\>" 124 | syntax match hyNumber "\<0[bB]\%(_\=[01]\)\+\>" 125 | syntax match hyNumber "\<\%([0-9]\%(_\=\d\)*\|0\+\%(_\=0\)*\)\>" 126 | syntax match hyNumber "\<\d\%(_\=\d\)*[jJ]\>" 127 | syntax match hyNumber "\<\d\%(_\=\d\)*[eE][+-]\=\d\%(_\=\d\)*[jJ]\=\>" 128 | syntax match hyNumber 129 | \ "\<\d\%(_\=\d\)*\.\%([eE][+-]\=\d\%(_\=\d\)*\)\=[jJ]\=\%(\W\|$\)\@=" 130 | syntax match hyNumber 131 | \ "\%(^\|\W\)\zs\%(\d\%(_\=\d\)*\)\=\.\d\%(_\=\d\)*\%([eE][+-]\=\d\%(_\=\d\)*\)\=[jJ]\=\>" 132 | 133 | syntax match hyQuote "'" 134 | syntax match hyQuote "`" 135 | syntax match hyUnquote "\~" 136 | syntax match hyUnquote "\~@" 137 | syntax match hyReaderMacro "\v#[^:[][[:keyword:].]*" 138 | syntax match hyDispatch "\v#[\^/]" 139 | syntax match hyDispatch "\v#_>" 140 | syntax match hyUnpack "\v#\*{1,2}" 141 | syntax match hyKeywordMacro "\v#[=+!-]:\k*" contains=hyKeywordMacroKeyword 142 | syntax match hyKeywordMacroKeyword "\v:\k*" contained 143 | " hy permits no more than 20 params. 144 | syntax match hyAnonArg "%\(20\|1\d\|[1-9]\|&\)\?" 145 | 146 | syntax match hyRegexpEscape "\v\\%(\\|[tnrfae]|c\u|0[0-3]?\o{1,2}|x%(\x{2}|\{\x{1,6}\})|u\x{4})" contained display 147 | syntax region hyRegexpQuoted start=/\v\<@!\\Q/ms=e+1 skip=/\v\\\\|\\"/ end=/\\E/me=s-1 end=/"/me=s-1 contained 148 | syntax region hyRegexpQuote start=/\v\<@!\\Q/ skip=/\v\\\\|\\"/ end=/\\E/ end=/"/me=s-1 contains=hyRegexpQuoted keepend contained 149 | syntax cluster hyRegexpEscapes contains=hyRegexpEscape,hyRegexpQuote 150 | 151 | syntax match hyRegexpPosixCharClass "\v\\[pP]\{%(ASCII|Alnum|Alpha|Blank|Cntrl|Digit|Graph|Lower|Print|Punct|Space|Upper|XDigit)\}" contained display 152 | syntax match hyRegexpJavaCharClass "\v\\[pP]\{java%(Alphabetic|Defined|Digit|ISOControl|IdentifierIgnorable|Ideographic|JavaIdentifierPart|JavaIdentifierStart|Letter|LetterOrDigit|LowerCase|Mirrored|SpaceChar|TitleCase|UnicodeIdentifierPart|UnicodeIdentifierStart|UpperCase|Whitespace)\}" contained display 153 | syntax match hyRegexpUnicodeCharClass "\v\\[pP]\{\cIs%(alnum|alphabetic|assigned|blank|control|digit|graph|hex_digit|hexdigit|ideographic|letter|lowercase|noncharacter_code_point|noncharactercodepoint|print|punctuation|titlecase|uppercase|white_space|whitespace|word)\}" contained display 154 | syntax match hyRegexpUnicodeCharClass "\v\\[pP]%(C|L|M|N|P|S|Z)" contained display 155 | syntax match hyRegexpUnicodeCharClass "\v\\[pP]\{%(Is|gc\=|general_category\=)?%(C[cfnos]|L[CDlmotu]|M[cen]|N[dlo]|P[cdefios]|S[ckmo]|Z[lps])\}" contained display 156 | syntax match hyRegexpUnicodeCharClass "\v\\[pP]\{\c%(Is|sc\=|script\=)%(arab|arabic|armenian|armi|armn|avestan|avst|bali|balinese|bamu|bamum|batak|batk|beng|bengali|bopo|bopomofo|brah|brahmi|brai|braille|bugi|buginese|buhd|buhid|canadian_aboriginal|cans|cari|carian|cham|cher|cherokee|common|copt|coptic|cprt|cuneiform|cypriot|cyrillic|cyrl|deseret|deva|devanagari|dsrt|egyp|egyptian_hieroglyphs|ethi|ethiopic|geor|georgian|glag|glagolitic|goth|gothic|greek|grek|gujarati|gujr|gurmukhi|guru|han|hang|hangul|hani|hano|hanunoo|hebr|hebrew|hira|hiragana|imperial_aramaic|inherited|inscriptional_pahlavi|inscriptional_parthian|ital|java|javanese|kaithi|kali|kana|kannada|katakana|kayah_li|khar|kharoshthi|khmer|khmr|knda|kthi|lana|lao|laoo|latin|latn|lepc|lepcha|limb|limbu|linb|linear_b|lisu|lyci|lycian|lydi|lydian|malayalam|mand|mandaic|meetei_mayek|mlym|mong|mongolian|mtei|myanmar|mymr|new_tai_lue|nko|nkoo|ogam|ogham|ol_chiki|olck|old_italic|old_persian|old_south_arabian|old_turkic|oriya|orkh|orya|osma|osmanya|phag|phags_pa|phli|phnx|phoenician|prti|rejang|rjng|runic|runr|samaritan|samr|sarb|saur|saurashtra|shavian|shaw|sinh|sinhala|sund|sundanese|sylo|syloti_nagri|syrc|syriac|tagalog|tagb|tagbanwa|tai_le|tai_tham|tai_viet|tale|talu|tamil|taml|tavt|telu|telugu|tfng|tglg|thaa|thaana|thai|tibetan|tibt|tifinagh|ugar|ugaritic|unknown|vai|vaii|xpeo|xsux|yi|yiii|zinh|zyyy|zzzz)\}" contained display 157 | syntax match hyRegexpUnicodeCharClass "\v\\[pP]\{\c%(In|blk\=|block\=)%(aegean numbers|aegean_numbers|aegeannumbers|alchemical symbols|alchemical_symbols|alchemicalsymbols|alphabetic presentation forms|alphabetic_presentation_forms|alphabeticpresentationforms|ancient greek musical notation|ancient greek numbers|ancient symbols|ancient_greek_musical_notation|ancient_greek_numbers|ancient_symbols|ancientgreekmusicalnotation|ancientgreeknumbers|ancientsymbols|arabic|arabic presentation forms-a|arabic presentation forms-b|arabic supplement|arabic_presentation_forms_a|arabic_presentation_forms_b|arabic_supplement|arabicpresentationforms-a|arabicpresentationforms-b|arabicsupplement|armenian|arrows|avestan|balinese|bamum|bamum supplement|bamum_supplement|bamumsupplement|basic latin|basic_latin|basiclatin|batak|bengali|block elements|block_elements|blockelements|bopomofo|bopomofo extended|bopomofo_extended|bopomofoextended|box drawing|box_drawing|boxdrawing|brahmi|braille patterns|braille_patterns|braillepatterns|buginese|buhid|byzantine musical symbols|byzantine_musical_symbols|byzantinemusicalsymbols|carian|cham|cherokee|cjk compatibility|cjk compatibility forms|cjk compatibility ideographs|cjk compatibility ideographs supplement|cjk radicals supplement|cjk strokes|cjk symbols and punctuation|cjk unified ideographs|cjk unified ideographs extension a|cjk unified ideographs extension b|cjk unified ideographs extension c|cjk unified ideographs extension d|cjk_compatibility|cjk_compatibility_forms|cjk_compatibility_ideographs|cjk_compatibility_ideographs_supplement|cjk_radicals_supplement|cjk_strokes|cjk_symbols_and_punctuation|cjk_unified_ideographs|cjk_unified_ideographs_extension_a|cjk_unified_ideographs_extension_b|cjk_unified_ideographs_extension_c|cjk_unified_ideographs_extension_d|cjkcompatibility|cjkcompatibilityforms|cjkcompatibilityideographs|cjkcompatibilityideographssupplement|cjkradicalssupplement|cjkstrokes|cjksymbolsandpunctuation|cjkunifiedideographs|cjkunifiedideographsextensiona|cjkunifiedideographsextensionb|cjkunifiedideographsextensionc|cjkunifiedideographsextensiond|combining diacritical marks|combining diacritical marks for symbols|combining diacritical marks supplement|combining half marks|combining marks for symbols|combining_diacritical_marks|combining_diacritical_marks_supplement|combining_half_marks|combining_marks_for_symbols|combiningdiacriticalmarks|combiningdiacriticalmarksforsymbols|combiningdiacriticalmarkssupplement|combininghalfmarks|combiningmarksforsymbols|common indic number forms|common_indic_number_forms|commonindicnumberforms|control pictures|control_pictures|controlpictures|coptic|counting rod numerals|counting_rod_numerals|countingrodnumerals|cuneiform|cuneiform numbers and punctuation|cuneiform_numbers_and_punctuation|cuneiformnumbersandpunctuation|currency symbols|currency_symbols|currencysymbols|cypriot syllabary|cypriot_syllabary|cypriotsyllabary|cyrillic|cyrillic extended-a|cyrillic extended-b|cyrillic supplement|cyrillic supplementary|cyrillic_extended_a|cyrillic_extended_b|cyrillic_supplementary|cyrillicextended-a|cyrillicextended-b|cyrillicsupplement|cyrillicsupplementary|deseret|devanagari|devanagari extended|devanagari_extended|devanagariextended|dingbats|domino tiles|domino_tiles|dominotiles|egyptian hieroglyphs|egyptian_hieroglyphs|egyptianhieroglyphs|emoticons|enclosed alphanumeric supplement|enclosed alphanumerics|enclosed cjk letters and months|enclosed ideographic supplement|enclosed_alphanumeric_supplement|enclosed_alphanumerics|enclosed_cjk_letters_and_months|enclosed_ideographic_supplement|enclosedalphanumerics|enclosedalphanumericsupplement|enclosedcjklettersandmonths|enclosedideographicsupplement|ethiopic|ethiopic extended|ethiopic extended-a|ethiopic supplement|ethiopic_extended|ethiopic_extended_a|ethiopic_supplement|ethiopicextended|ethiopicextended-a|ethiopicsupplement|general punctuation|general_punctuation|generalpunctuation|geometric shapes|geometric_shapes|geometricshapes|georgian|georgian supplement|georgian_supplement|georgiansupplement|glagolitic|gothic|greek|greek and coptic|greek extended|greek_extended|greekandcoptic|greekextended|gujarati|gurmukhi|halfwidth and fullwidth forms|halfwidth_and_fullwidth_forms|halfwidthandfullwidthforms|hangul compatibility jamo|hangul jamo|hangul jamo extended-a|hangul jamo extended-b|hangul syllables|hangul_compatibility_jamo|hangul_jamo|hangul_jamo_extended_a|hangul_jamo_extended_b|hangul_syllables|hangulcompatibilityjamo|hanguljamo|hanguljamoextended-a|hanguljamoextended-b|hangulsyllables|hanunoo|hebrew|high private use surrogates|high surrogates|high_private_use_surrogates|high_surrogates|highprivateusesurrogates|highsurrogates|hiragana|ideographic description characters|ideographic_description_characters|ideographicdescriptioncharacters|imperial aramaic|imperial_aramaic|imperialaramaic|inscriptional pahlavi|inscriptional parthian|inscriptional_pahlavi|inscriptional_parthian|inscriptionalpahlavi|inscriptionalparthian|ipa extensions|ipa_extensions|ipaextensions|javanese|kaithi|kana supplement|kana_supplement|kanasupplement|kanbun|kangxi radicals|kangxi_radicals|kangxiradicals|kannada|katakana|katakana phonetic extensions|katakana_phonetic_extensions|katakanaphoneticextensions|kayah li|kayah_li|kayahli|kharoshthi|khmer|khmer symbols|khmer_symbols|khmersymbols|lao|latin extended additional|latin extended-a|latin extended-b|latin extended-c|latin extended-d|latin-1 supplement|latin-1supplement|latin_1_supplement|latin_extended_a|latin_extended_additional|latin_extended_b|latin_extended_c|latin_extended_d|latinextended-a|latinextended-b|latinextended-c|latinextended-d|latinextendedadditional|lepcha|letterlike symbols|letterlike_symbols|letterlikesymbols|limbu|linear b ideograms|linear b syllabary|linear_b_ideograms|linear_b_syllabary|linearbideograms|linearbsyllabary|lisu|low surrogates|low_surrogates|lowsurrogates|lycian|lydian|mahjong tiles|mahjong_tiles|mahjongtiles|malayalam|mandaic|mathematical alphanumeric symbols|mathematical operators|mathematical_alphanumeric_symbols|mathematical_operators|mathematicalalphanumericsymbols|mathematicaloperators|meetei mayek|meetei_mayek|meeteimayek|miscellaneous mathematical symbols-a|miscellaneous mathematical symbols-b|miscellaneous symbols|miscellaneous symbols and arrows|miscellaneous symbols and pictographs|miscellaneous technical|miscellaneous_mathematical_symbols_a|miscellaneous_mathematical_symbols_b|miscellaneous_symbols|miscellaneous_symbols_and_arrows|miscellaneous_symbols_and_pictographs|miscellaneous_technical|miscellaneousmathematicalsymbols-a|miscellaneousmathematicalsymbols-b|miscellaneoussymbols|miscellaneoussymbolsandarrows|miscellaneoussymbolsandpictographs|miscellaneoustechnical|modifier tone letters|modifier_tone_letters|modifiertoneletters|mongolian|musical symbols|musical_symbols|musicalsymbols|myanmar|myanmar extended-a|myanmar_extended_a|myanmarextended-a|new tai lue|new_tai_lue|newtailue|nko|number forms|number_forms|numberforms|ogham|ol chiki|ol_chiki|olchiki|old italic|old persian|old south arabian|old turkic|old_italic|old_persian|old_south_arabian|old_turkic|olditalic|oldpersian|oldsoutharabian|oldturkic|optical character recognition|optical_character_recognition|opticalcharacterrecognition|oriya|osmanya|phags-pa|phags_pa|phaistos disc|phaistos_disc|phaistosdisc|phoenician|phonetic extensions|phonetic extensions supplement|phonetic_extensions|phonetic_extensions_supplement|phoneticextensions|phoneticextensionssupplement|playing cards|playing_cards|playingcards|private use area|private_use_area|privateusearea|rejang|rumi numeral symbols|rumi_numeral_symbols|ruminumeralsymbols|runic|samaritan|saurashtra|shavian|sinhala|small form variants|small_form_variants|smallformvariants|spacing modifier letters|spacing_modifier_letters|spacingmodifierletters|specials|sundanese|superscripts and subscripts|superscripts_and_subscripts|superscriptsandsubscripts|supplemental arrows-a|supplemental arrows-b|supplemental mathematical operators|supplemental punctuation|supplemental_arrows_a|supplemental_arrows_b|supplemental_mathematical_operators|supplemental_punctuation|supplementalarrows-a|supplementalarrows-b|supplementalmathematicaloperators|supplementalpunctuation|supplementary private use area-a|supplementary private use area-b|supplementary_private_use_area_a|supplementary_private_use_area_b|supplementaryprivateusearea-a|supplementaryprivateusearea-b|surrogates_area|syloti nagri|syloti_nagri|sylotinagri|syriac|tagalog|tagbanwa|tags|tai le|tai tham|tai viet|tai xuan jing symbols|tai_le|tai_tham|tai_viet|tai_xuan_jing_symbols|taile|taitham|taiviet|taixuanjingsymbols|tamil|telugu|thaana|thai|tibetan|tifinagh|transport and map symbols|transport_and_map_symbols|transportandmapsymbols|ugaritic|unified canadian aboriginal syllabics|unified canadian aboriginal syllabics extended|unified_canadian_aboriginal_syllabics|unified_canadian_aboriginal_syllabics_extended|unifiedcanadianaboriginalsyllabics|unifiedcanadianaboriginalsyllabicsextended|vai|variation selectors|variation selectors supplement|variation_selectors|variation_selectors_supplement|variationselectors|variationselectorssupplement|vedic extensions|vedic_extensions|vedicextensions|vertical forms|vertical_forms|verticalforms|yi radicals|yi syllables|yi_radicals|yi_syllables|yijing hexagram symbols|yijing_hexagram_symbols|yijinghexagramsymbols|yiradicals|yisyllables)\}" contained display 158 | 159 | syntax match hyRegexpPredefinedCharClass "\v%(\\[dDsSwW]|\.)" contained display 160 | syntax cluster hyRegexpCharPropertyClasses contains=hyRegexpPosixCharClass,hyRegexpJavaCharClass,hyRegexpUnicodeCharClass 161 | syntax cluster hyRegexpCharClasses contains=hyRegexpPredefinedCharClass,hyRegexpCharClass,@hyRegexpCharPropertyClasses 162 | syntax region hyRegexpCharClass start="\\\@)" contained display 169 | 170 | " Mode modifiers, mode-modified spans, lookaround, regular and atomic 171 | " grouping, and named-capturing. 172 | syntax match hyRegexpMod "\v\(@<=\?:" contained display 173 | syntax match hyRegexpMod "\v\(@<=\?[xdsmiuU]*-?[xdsmiuU]+:?" contained display 174 | syntax match hyRegexpMod "\v\(@<=\?%(\)" contained display 175 | syntax match hyRegexpMod "\v\(@<=\?\<[a-zA-Z]+\>" contained display 176 | 177 | syntax region hyRegexpGroup start="\\\@= conceal cchar=≥ 282 | syntax keyword hyFunc != conceal cchar=≠ 283 | 284 | syntax keyword hyFunc * conceal cchar=∙ 285 | syntax keyword hyFunc math.sqrt conceal cchar=√ 286 | 287 | syntax keyword hyMacro -> conceal cchar=⊳ 288 | syntax keyword hyMacro ->> conceal cchar=‣ 289 | 290 | syntax keyword hyConstant None conceal cchar=∅ 291 | syntax keyword hyConstant math.pi conceal cchar=π 292 | syntax keyword hyConstant sum conceal cchar=∑ 293 | 294 | syntax match hyRepeat contained "l" conceal cchar=l 295 | syntax match hyRepeat contained "s" conceal cchar=s 296 | syntax match hyRepeat contained "d" conceal cchar=d 297 | syntax match hyRepeat contained "g" conceal cchar=g 298 | syntax match hyRepeat contained "for" conceal cchar=∀ 299 | syntax match hyRepeat "for/a" contains=hyRepeat,hyAsync 300 | syntax match hyRepeat "lfor" contains=hyRepeat,hyRepeat 301 | syntax match hyRepeat "sfor" contains=hyRepeat,hyRepeat 302 | syntax match hyRepeat "dfor" contains=hyRepeat,hyRepeat 303 | syntax match hyRepeat "gfor" contains=hyRepeat,hyRepeat 304 | syntax match hyRepeat "cfor" contains=hyRepeat,hyRepeat 305 | syntax keyword hyRepeat for conceal cchar=∀ 306 | 307 | syntax keyword hyMacro some conceal cchar=∃ 308 | syntax keyword hyMacro in conceal cchar=∈ 309 | syntax keyword hyMacro not-in conceal cchar=∉ 310 | 311 | syntax keyword hyVariable alpha conceal cchar=α 312 | syntax keyword hyVariable beta conceal cchar=β 313 | syntax keyword hyVariable gamma conceal cchar=γ 314 | syntax keyword hyVariable delta conceal cchar=δ 315 | syntax keyword hyVariable epsilon conceal cchar=ε 316 | 317 | syntax match hyAnonVarName "x" conceal cchar=x contained 318 | let s:idxchars = ['₀', '₁', '₂', '₃', '₄', '₅', '₆', '₇', '₈', '₉'] 319 | for s:idx in range(0, 9) 320 | execute 'syntax match hyAnonVarIndex "' . s:idx . '" conceal cchar=' . s:idxchars[s:idx] . ' contained' 321 | endfor 322 | if get(g:, "hy_conceal_fancy", 0) == 1 323 | syntax match hyAnonVar "\" contains=hyAnonVarName,hyAnonVarIndex 324 | syntax keyword hyAnonVar xi conceal cchar=ξ 325 | syntax match hyReaderMacro "#%" conceal cchar=ξ 326 | else 327 | syntax match hyAnonVarIndex "i" conceal cchar=¡ contained 328 | syntax match hyReaderMacro contained "#" conceal cchar=x 329 | syntax match hyAnonArg contained "%" conceal cchar=¡ 330 | syntax match hyReaderMacro "#%" contains=hyReaderMacro,hyAnonArg 331 | syntax match hyAnonVar "\" contains=hyAnonVarName,hyAnonVarIndex 332 | endif 333 | 334 | " hi! link Conceal Define 335 | 336 | setlocal conceallevel=2 337 | 338 | " vim:sts=4:sw=4:ts=4:et:smc=20000 339 | --------------------------------------------------------------------------------