From: Bram Moolenaar Date: Sun, 22 Sep 2013 12:42:24 +0000 (+0200) Subject: Update runtime files. Add support for J. X-Git-Tag: v7.4.033~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=baca7f705babaa1caeb0bce7f63f6275feca6641;p=vim Update runtime files. Add support for J. --- diff --git a/runtime/autoload/clojurecomplete.vim b/runtime/autoload/clojurecomplete.vim index 704ea074c..aa8751f66 100644 --- a/runtime/autoload/clojurecomplete.vim +++ b/runtime/autoload/clojurecomplete.vim @@ -1,20 +1,22 @@ " Vim completion script -" Language: Clojure -" Maintainer: Sung Pae -" URL: https://github.com/guns/vim-clojure-static -" License: Same as Vim -" Last Change: 05 February 2013 +" Language: Clojure +" Maintainer: Sung Pae +" URL: https://github.com/guns/vim-clojure-static +" License: Same as Vim +" Last Change: 08 September 2013 " Special forms and public vars in clojure.core -" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-002/vim_clojure_static.clj -" Clojure 1.5.0-RC6 -let s:words = ["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-readably*","*read-eval*","*read-whitelist*","*source-path*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods",".","..","/","<","<=","=","==",">",">=","EMPTY-NODE","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc!","assoc","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","booleans","bound-fn","bound-fn*","bound?","butlast","byte","byte-array","bytes","case","cast","catch","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","concat","cond","cond->","cond->>","condp","conj!","conj","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","def","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj!","disj","dissoc!","dissoc","distinct","distinct?","do","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","doubles","drop","drop-last","drop-while","empty","empty?","ensure","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","finally","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","hash","hash-combine","hash-map","hash-set","identical?","identity","if","if-let","if-not","ifn?","import","in-ns","inc","inc'","init-proxy","instance?","int","int-array","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mod","monitor-enter","monitor-exit","munge","name","namespace","namespace-munge","neg?","new","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop!","pop","pop-thread-bindings","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","quot","quote","rand","rand-int","rand-nth","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","realized?","recur","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seque","sequence","sequential?","set!","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","slurp","some","some->","some->>","some-fn","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","symbol","symbol?","sync","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","throw","time","to-array","to-array-2d","trampoline","transient","tree-seq","true?","try","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","update-in","update-proxy","use","val","vals","var","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","when","when-first","when-let","when-not","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"] +" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-005/clj/src/vim_clojure_static/generate.clj +" Clojure version 1.5.1 +let s:words = ["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-readably*","*read-eval*","*source-path*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods",".","..","/","<","<=","=","==",">",">=","EMPTY-NODE","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc!","assoc","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","booleans","bound-fn","bound-fn*","bound?","butlast","byte","byte-array","bytes","case","cast","catch","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","concat","cond","cond->","cond->>","condp","conj!","conj","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","def","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj!","disj","dissoc!","dissoc","distinct","distinct?","do","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","doubles","drop","drop-last","drop-while","empty","empty?","ensure","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","finally","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","hash","hash-combine","hash-map","hash-set","identical?","identity","if","if-let","if-not","ifn?","import","in-ns","inc","inc'","init-proxy","instance?","int","int-array","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mod","monitor-enter","monitor-exit","munge","name","namespace","namespace-munge","neg?","new","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop!","pop","pop-thread-bindings","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","quot","quote","rand","rand-int","rand-nth","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","realized?","recur","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seque","sequence","sequential?","set!","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","slurp","some","some->","some->>","some-fn","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","symbol","symbol?","sync","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","throw","time","to-array","to-array-2d","trampoline","transient","tree-seq","true?","try","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","update-in","update-proxy","use","val","vals","var","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","when","when-first","when-let","when-not","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"] " Simple word completion omnifunc function! clojurecomplete#Complete(findstart, base) - if a:findstart - return searchpos('\<', 'bnW', line('.'))[1] - 1 - else - return { 'words': filter(copy(s:words), 'v:val =~ "\\V\\^' . a:base . '"') } - endif + if a:findstart + return searchpos('\<', 'bnW', line('.'))[1] - 1 + else + return { 'words': filter(copy(s:words), 'v:val =~ "\\V\\^' . a:base . '"') } + endif endfunction + +" vim:sts=8:sw=8:ts=8:noet diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index ea5a493d7..96a9c8b4a 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1126,7 +1126,7 @@ less than one line (the small delete register is used then). An exception is made for the delete operator with these movement commands: |%|, |(|, |)|, |`|, |/|, |?|, |n|, |N|, |{| and |}|. Register "1 is always used then (this is Vi compatible). The "- register is used as well if the delete is within a line. -Note that these character may be mapped. E.g. |%| is mapped by the matchit +Note that these characters may be mapped. E.g. |%| is mapped by the matchit plugin. With each successive deletion or change, Vim shifts the previous contents of register 1 into register 2, 2 into 3, and so forth, losing the previous diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index ddf8aacd6..96dff3509 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -1,4 +1,4 @@ -*diff.txt* For Vim version 7.4. Last change: 2013 Jul 07 +*diff.txt* For Vim version 7.4. Last change: 2013 Sep 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -123,10 +123,14 @@ Since the option values are remembered with the buffer, you can edit another file for a moment and come back to the same file and be in diff mode again. *:diffo* *:diffoff* -:diffo[ff] Switch off diff mode for the current window. +:diffo[ff] Switch off diff mode for the current window. Resets related + options also when 'diff' was not set. :diffo[ff]! Switch off diff mode for the current window and in all windows - in the current tab page where 'diff' is set. + in the current tab page where 'diff' is set. Resetting + related options only happens in a window that has 'diff' set, + if the current window does not have 'diff' set then no options + in it are changed. The ":diffoff" command resets the relevant options to the values they had when using |:diffsplit|, |:diffpatch| , |:diffthis|. or starting Vim in diff mode. diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index 74e08043a..b700d15e3 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -581,8 +581,8 @@ CLOJURE *ft-clojure-indent* *clojure-indent* Clojure indentation differs somewhat from traditional Lisps, due in part to the use of square and curly brackets, and otherwise by community convention. -These conventions are not always universally followed, so the Clojure indent -script offers a few configurable options, listed below. +These conventions are not universally followed, so the Clojure indent script +offers a few configurable options, listed below. If the current vim does not include searchpairpos(), the indent script falls back to normal 'lisp' indenting, and the following options are ignored. diff --git a/runtime/doc/pi_vimball.txt b/runtime/doc/pi_vimball.txt index 720d9478b..bbc74988c 100644 --- a/runtime/doc/pi_vimball.txt +++ b/runtime/doc/pi_vimball.txt @@ -188,7 +188,7 @@ WINDOWS *vimball-windows* * Changed silent! to sil! (shorter) * Safed |'swf'| setting (during vimball extraction, its now turned off) - 32 : May 19, 2010 * (Christian Brabrandt) :so someplugin.vba and + 32 : May 19, 2010 * (Christian Brabandt) :so someplugin.vba and :so someplugin.vba.gz (and the other supported compression types) now works * (Jan Steffens) added support for xz compression diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 9ce30c3f1..0c61721c2 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.4. Last change: 2013 Sep 05 +*todo.txt* For Vim version 7.4. Last change: 2013 Sep 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -36,23 +36,47 @@ not be repeated below, unless there is extra information. NFA engine mismatch, with example. (ZyX, 2013 Aug 29) -php syntax file update. (Jason Woofenden, Aug 30) +NFA engine difference, with test case. (Axel Bender, 2013 Sep 17) +Comments from Vlad Irnov Sep 18. Problem positioning the cursor after auto-formatting without a comment. (Tor Perkins, 2013 Sep 1) +Patch to fix test 92 and 93 failing in a bad way. (Hirohito Higashi, 2013 Sep +11) + +Patch to fix using "p" in Visual block mode. (Christian Brabandt, 2013 Sep 19) + +Using \1 in pattern goes one line too far. (Bohr Shaw, 2013 Sep 5) +Column is OK. "/\v(^.+\n)\1/e" (John Little, Sep 5) +Also, matches start of 2nd line, not the whole line. + +Error for incomplete help argument. (John Beckett, 2013 Sep 12) + Popup menu: first item is not selected when typing more than one character? Patch to add async functionality. (Geoff Greer, 2013 Sep 1) Patch to avoid mouse cursor flickering. (Ken Takata,, 2013 Sep 2) +Patch to make zg and zb work better. (Christian Brabandt, 2013 Sep 8) + +Patch to fix that VC10 does not stat() a symlink to a directory. +(Ken Takata,, 2013 Sep 20) Update Sep 21 + Should win_redr_custom() not be allowed to use recursively? (Yasuhiro Matsumoto, 2013 Aug 15) NFA engine combining character mismatch. (glts, 2013 Aug 27) Remark Dominique, Aug 27 +Patch to make Tcl 8.6 work. (Issue 167) + +Patch to make input() work while inside :normal. (Yasuhiro Matsumoto, 2013 Sep +19) + +Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15) + Issue 164: freeze on regexp search. Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) @@ -61,7 +85,7 @@ Patch to fix substitute prompt with line number. (Benoit Pierre, 2013 Aug 27, third message) Patch to avoid problem with colon in file name. (Yasuhiro Matsumoto, 2013 Sep -5) Only copy file name when needed. +5) Only copy file name when needed: Sep 9. Include systemverilog file? Two votes yes. @@ -69,6 +93,10 @@ Wrapping around end of file does not work for "." after "cgn". (Dimitar Dimitrov) Patch by Christian Brabandt, 2013 Aug 22 +Clang error for integer overflow. (Dominique Pelle, 2013 Sep 21) + +Patch to add v:hlsearch. (ZyX, 2013 Sep 22) + Problem with 'spellsuggest' file, only works for some words. (Cesar Romani, 2013 Aug 20) Depends on file name? (Aug 24) Additional remark by glts: the suggested words are marked bad? @@ -83,6 +111,11 @@ Patch to make has() check for Vim version and patch at the same time. Several syntax file match "^\s*" which may get underlined if that's in the highlight group. Add a "\zs" after it? +Win32: When a directory name contains an exclamation mark, completion doesn't +complete the contents of the directory. No escaping for the "!"? (Jan +Stocker, 2012 Jan 5; 2013 Aug 20) +Patch 2013 Sept 10, test: Sept 11. + Go through more coverity reports. With "$" in 'cpoptions' the popup menu isn't fully drawn. (Matti Niemenmaa, @@ -99,7 +132,7 @@ Patches to fix this. (Ken Takata, 2013 Aug 9) :help gives example for z?, but it does not work. m? and t? do work. Patch to add funcref to Lua. (Luis Carvalho, 2013 Sep 4) -Missing tests. +With tests: Sep 5. Discussion about canonicalization of Hebrew. (Ron Aaron, 2011 April 10) @@ -131,10 +164,6 @@ Works OK for echo, just not for ":call" and ":call call()". (Ted, 2011 Mar Patch by Christian Brabandt, 2013 Mar 23. Not 100% sure this is the right solution. -Win32: When a directory name contains an exclamation mark, completion doesn't -complete the contents of the directory. No escaping for the "!"? (Jan -Stocker, 2012 Jan 5; 2013 Aug 20) - Patch to support expression argument to sort() instead of a function name. Yasuhiro Matsumoto, 2013 May 31. Or should we add a more general mechanism, like lambda functions? @@ -184,6 +213,7 @@ Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec) TCL: With MSVC 2010 doesn't find Tcl_FindExecutable. (tux) Patch to define it. (Ken Takata, 2013 Aug 12) Is this right? +Probably not: http://code.google.com/p/vim/issues/detail?id=167 MS-Windows: Patch to make tests copy files to avoid changing the fileformat of the files under version control. (Taro Muraoka, 2013 Jul 5) @@ -992,8 +1022,6 @@ Also: swap files are in ~/tmp/ One has relative file name ".mozilla/...". Add v:motion_force. (Kana Natsuno, 2008 Dec 6) Maybe call it v:motiontype. -Runtime files for Clojure. (Toralf Wittner, 2008 Jun 25) - MS-Windows: editing the first, empty buffer, 'ffs' set to "unix,dos", ":enew" doesn't set 'ff' to "unix". (Ben Fritz, 2008 Dec 5) Reusing the old buffer probably causes this. diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt index 2589a151a..414a63b5e 100644 --- a/runtime/doc/undo.txt +++ b/runtime/doc/undo.txt @@ -1,4 +1,4 @@ -*undo.txt* For Vim version 7.4. Last change: 2013 Aug 22 +*undo.txt* For Vim version 7.4. Last change: 2013 Sep 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -249,8 +249,9 @@ a simple scheme that maps filesystem paths directly to undo files. Vim will detect if an undo file is no longer synchronized with the file it was written for (with a hash of the file contents) and ignore it when the file was changed after the undo file was written, to prevent corruption. An undo file is also -ignored if its owner differs from the owner of the edited file. Set 'verbose' -to get a message about that when opening a file. +ignored if its owner differs from the owner of the edited file, except when +the owner of the undo file is the current user. Set 'verbose' to get a +message about that when opening a file. Undo files are normally saved in the same directory as the file. This can be changed with the 'undodir' option. diff --git a/runtime/doc/usr_45.txt b/runtime/doc/usr_45.txt index 303698179..828ea6fe2 100644 --- a/runtime/doc/usr_45.txt +++ b/runtime/doc/usr_45.txt @@ -328,8 +328,8 @@ actually use Vim to convert a file. Example: > *45.5* Entering language text Computer keyboards don't have much more than a hundred keys. Some languages -have thousands of characters, Unicode has ten thousands. So how do you type -these characters? +have thousands of characters, Unicode has over hundred thousand. So how do +you type these characters? First of all, when you don't use too many of the special characters, you can use digraphs. This was already explained in |24.9|. When you use a language that uses many more characters than keys on your diff --git a/runtime/doc/version5.txt b/runtime/doc/version5.txt index 15fe92a2c..1cc6a2559 100644 --- a/runtime/doc/version5.txt +++ b/runtime/doc/version5.txt @@ -2020,7 +2020,7 @@ File browser added *file-browser-5.2* The Win32, Athena and Motif GUI bring up a file requester if the user asks to ":browse" for the ":e", ":w", ":r", ":so", ":redirect" and -":mkexrc/vimrc/vsess" commands. ::browse e /foo/bar" opens the requester in +":mkexrc/vimrc/vsess" commands. ":browse e /foo/bar" opens the requester in the /foo/bar directory, so you can have nice mapping rhs's like ":browse so $vim/macros". If no initial dir specified for ":browse e", can be compiled to either begin in the current directory, or that of the current buffer. (Negri diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt index 4cf2e979c..da82dcae0 100644 --- a/runtime/doc/version7.txt +++ b/runtime/doc/version7.txt @@ -2395,7 +2395,7 @@ with special attributes were redrawn. Now only do this for characters that actually are bold. Speeds up displaying considerably. When only highlighting changes and the text is scrolled at the same time -everything is redraw instead of using a scroll and updating the changed text. +everything is redrawn instead of using a scroll and updating the changed text. E.g., when using ":match" to highlight a paren that the cursor landed on. Added SOME_VALID: Redraw the whole window but also try to scroll to minimize redrawing. diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 70c1fe13f..26629bdb7 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2013 Aug 03 +" Last Change: 2013 Sep 22 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -129,7 +129,7 @@ au BufNewFile,BufRead .asoundrc,*/usr/share/alsa/alsa.conf,*/etc/asound.conf set au BufNewFile,BufRead *.aml setf aml " APT config file -au BufNewFile,BufRead apt.conf setf aptconf +au BufNewFile,BufRead apt.conf setf aptconf au BufNewFile,BufRead */.aptitude/config setf aptconf au BufNewFile,BufRead */etc/apt/apt.conf.d/{[-_[:alnum:]]\+,[-_.[:alnum:]]\+.conf} setf aptconf @@ -952,6 +952,9 @@ au BufNewFile,BufRead inittab setf inittab " Inno Setup au BufNewFile,BufRead *.iss setf iss +" J +au BufNewFile,BufRead *.ijs setf j + " JAL au BufNewFile,BufRead *.jal,*.JAL setf jal @@ -2092,7 +2095,7 @@ au BufNewFile,BufRead *.tak setf tak " Task au BufRead,BufNewFile {pending,completed,undo}.data setf taskdata -au BufRead,BufNewFile *.task setf taskedit +au BufRead,BufNewFile *.task setf taskedit " Tcl (JACL too) au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk,*.jacl setf tcl @@ -2217,12 +2220,12 @@ au BufNewFile,BufRead *.uc setf uc au BufNewFile,BufRead */etc/updatedb.conf setf updatedb " Upstart (init(8)) config files -au BufNewFile,BufRead */usr/share/upstart/*.conf setf upstart -au BufNewFile,BufRead */usr/share/upstart/*.override setf upstart +au BufNewFile,BufRead */usr/share/upstart/*.conf setf upstart +au BufNewFile,BufRead */usr/share/upstart/*.override setf upstart au BufNewFile,BufRead */etc/init/*.conf,*/etc/init/*.override setf upstart au BufNewFile,BufRead */.init/*.conf,*/.init/*.override setf upstart -au BufNewFile,BufRead */.config/upstart/*.conf setf upstart -au BufNewFile,BufRead */.config/upstart/*.override setf upstart +au BufNewFile,BufRead */.config/upstart/*.conf setf upstart +au BufNewFile,BufRead */.config/upstart/*.override setf upstart " Vera au BufNewFile,BufRead *.vr,*.vri,*.vrh setf vera diff --git a/runtime/ftplugin/clojure.vim b/runtime/ftplugin/clojure.vim index 91aba80f1..2b935a577 100644 --- a/runtime/ftplugin/clojure.vim +++ b/runtime/ftplugin/clojure.vim @@ -1,22 +1,23 @@ " Vim filetype plugin file -" Language: Clojure -" Author: Meikel Brandmeyer +" Language: Clojure +" Author: Meikel Brandmeyer " -" Maintainer: Sung Pae -" URL: https://github.com/guns/vim-clojure-static -" License: Same as Vim -" Last Change: 30 January 2013 +" Maintainer: Sung Pae +" URL: https://github.com/guns/vim-clojure-static +" License: Same as Vim +" Last Change: 08 September 2013 -" Only do this when not done yet for this buffer if exists("b:did_ftplugin") - finish + finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -let b:undo_ftplugin = 'setlocal define< formatoptions< comments< commentstring<' +let b:undo_ftplugin = 'setlocal iskeyword< define< formatoptions< comments< commentstring<' + +setlocal iskeyword+=?,-,*,!,+,/,=,<,>,.,:,$ " There will be false positives, but this is better than missing the whole set " of user-defined def* definitions. @@ -35,10 +36,10 @@ setlocal commentstring=;\ %s " 'completefunc' so that the user has some form of completion available when " 'omnifunc' is set and no REPL connection exists. for s:setting in ['omnifunc', 'completefunc'] - if exists('&' . s:setting) && empty(eval('&' . s:setting)) - execute 'setlocal ' . s:setting . '=clojurecomplete#Complete' - let b:undo_ftplugin .= ' | setlocal ' . s:setting . '<' - endif + if exists('&' . s:setting) && empty(eval('&' . s:setting)) + execute 'setlocal ' . s:setting . '=clojurecomplete#Complete' + let b:undo_ftplugin .= ' | setlocal ' . s:setting . '<' + endif endfor " Take all directories of the CLOJURE_SOURCE_DIRS environment variable @@ -46,34 +47,34 @@ endfor " " This is a legacy option for VimClojure users. if exists('$CLOJURE_SOURCE_DIRS') - for s:dir in split($CLOJURE_SOURCE_DIRS, (has("win32") || has("win64")) ? ';' : ':') - let s:dir = fnameescape(s:dir) - " Whitespace escaping for Windows - let s:dir = substitute(s:dir, '\', '\\\\', 'g') - let s:dir = substitute(s:dir, '\ ', '\\ ', 'g') - execute "setlocal path+=" . s:dir . "/**" - endfor - let b:undo_ftplugin .= ' | setlocal path<' + for s:dir in split($CLOJURE_SOURCE_DIRS, (has("win32") || has("win64")) ? ';' : ':') + let s:dir = fnameescape(s:dir) + " Whitespace escaping for Windows + let s:dir = substitute(s:dir, '\', '\\\\', 'g') + let s:dir = substitute(s:dir, '\ ', '\\ ', 'g') + execute "setlocal path+=" . s:dir . "/**" + endfor + let b:undo_ftplugin .= ' | setlocal path<' endif " Skip brackets in ignored syntax regions when using the % command if exists('loaded_matchit') - let b:match_words = &matchpairs - let b:match_skip = 's:comment\|string\|regex\|character' - let b:undo_ftplugin .= ' | unlet! b:match_words b:match_skip' + let b:match_words = &matchpairs + let b:match_skip = 's:comment\|string\|regex\|character' + let b:undo_ftplugin .= ' | unlet! b:match_words b:match_skip' endif " Win32 can filter files in the browse dialog if has("gui_win32") && !exists("b:browsefilter") - let b:browsefilter = "Clojure Source Files (*.clj)\t*.clj\n" . - \ "ClojureScript Source Files (*.cljs)\t*.cljs\n" . - \ "Java Source Files (*.java)\t*.java\n" . - \ "All Files (*.*)\t*.*\n" - let b:undo_ftplugin .= ' | unlet! b:browsefilter' + let b:browsefilter = "Clojure Source Files (*.clj)\t*.clj\n" . + \ "ClojureScript Source Files (*.cljs)\t*.cljs\n" . + \ "Java Source Files (*.java)\t*.java\n" . + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin .= ' | unlet! b:browsefilter' endif let &cpo = s:cpo_save unlet! s:cpo_save s:setting s:dir -" vim:sts=4 sw=4 et: +" vim:sts=8:sw=8:ts=8:noet diff --git a/runtime/ftplugin/j.vim b/runtime/ftplugin/j.vim new file mode 100644 index 000000000..8e3bc67ed --- /dev/null +++ b/runtime/ftplugin/j.vim @@ -0,0 +1,17 @@ +" Vim filetype plugin +" Language: J +" Maintainer: David Bürgin <676c7473@gmail.com> +" Last Change: 2013-09-21 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal iskeyword=48-57,65-90,_,97-122 +setlocal comments=:NB. +setlocal commentstring=NB.\ %s +setlocal formatoptions-=t formatoptions+=croql +setlocal shiftwidth=2 softtabstop=2 expandtab + +let b:undo_ftplugin = "setl et< sts< sw< fo< cms< com< isk<" diff --git a/runtime/indent/clojure.vim b/runtime/indent/clojure.vim index 9a00fb325..7d0c2aa91 100644 --- a/runtime/indent/clojure.vim +++ b/runtime/indent/clojure.vim @@ -1,16 +1,20 @@ " Vim indent file -" Language: Clojure -" Author: Meikel Brandmeyer -" URL: http://kotka.de/projects/clojure/vimclojure.html +" Language: Clojure +" Author: Meikel Brandmeyer +" URL: http://kotka.de/projects/clojure/vimclojure.html " -" Maintainer: Sung Pae -" URL: https://github.com/guns/vim-clojure-static -" License: Same as Vim -" Last Change: 30 January 2013 +" Maintainer: Sung Pae +" URL: https://github.com/guns/vim-clojure-static +" License: Same as Vim +" Last Change: 08 September 2013 + +" TODO: Indenting after multibyte characters is broken: +" (let [Δ (if foo +" bar ; Indent error +" baz)]) -" Only load this indent file when no other was loaded. if exists("b:did_indent") - finish + finish endif let b:did_indent = 1 @@ -25,290 +29,277 @@ setlocal indentkeys=!,o,O if exists("*searchpairpos") - if !exists('g:clojure_maxlines') - let g:clojure_maxlines = 100 - endif - - if !exists('g:clojure_fuzzy_indent') - let g:clojure_fuzzy_indent = 1 - endif - - if !exists('g:clojure_fuzzy_indent_patterns') - let g:clojure_fuzzy_indent_patterns = ['^with', '^def', '^let'] - endif - - if !exists('g:clojure_fuzzy_indent_blacklist') - let g:clojure_fuzzy_indent_blacklist = ['-fn$', '\v^with-%(meta|out-str|loading-context)$'] - endif - - if !exists('g:clojure_special_indent_words') - let g:clojure_special_indent_words = 'deftype,defrecord,reify,proxy,extend-type,extend-protocol,letfn' - endif - - if !exists('g:clojure_align_multiline_strings') - let g:clojure_align_multiline_strings = 0 - endif - - function! s:SynIdName() - return synIDattr(synID(line("."), col("."), 0), "name") - endfunction - - function! s:CurrentChar() - return getline('.')[col('.')-1] - endfunction - - function! s:CurrentWord() - return getline('.')[col('.')-1 : searchpos('\v>', 'n', line('.'))[1]-2] - endfunction - - function! s:IsParen() - return s:CurrentChar() =~ '\v[\(\)\[\]\{\}]' && - \ s:SynIdName() !~? '\vstring|comment' - endfunction - - " Returns 1 if string matches a pattern in 'patterns', which may be a - " list of patterns, or a comma-delimited string of implicitly anchored - " patterns. - function! s:MatchesOne(patterns, string) - let list = type(a:patterns) == type([]) - \ ? a:patterns - \ : map(split(a:patterns, ','), '"^" . v:val . "$"') - for pat in list - if a:string =~ pat | return 1 | endif - endfor - endfunction - - function! s:SavePosition() - let [ _b, l, c, _o ] = getpos(".") - let b = bufnr("%") - return [b, l, c] - endfunction - - function! s:RestorePosition(value) - let [b, l, c] = a:value - if bufnr("%") != b - execute b "buffer!" - endif - call setpos(".", [0, l, c, 0]) - endfunction - - function! s:MatchPairs(open, close, stopat) - " Stop only on vector and map [ resp. {. Ignore the ones in strings and - " comments. - if a:stopat == 0 - let stopat = max([line(".") - g:clojure_maxlines, 0]) - else - let stopat = a:stopat - endif - - let pos = searchpairpos(a:open, '', a:close, 'bWn', "!s:IsParen()", stopat) - return [pos[0], virtcol(pos)] - endfunction - - function! s:ClojureCheckForStringWorker() - " Check whether there is the last character of the previous line is - " highlighted as a string. If so, we check whether it's a ". In this - " case we have to check also the previous character. The " might be the - " closing one. In case the we are still in the string, we search for the - " opening ". If this is not found we take the indent of the line. - let nb = prevnonblank(v:lnum - 1) - - if nb == 0 - return -1 - endif - - call cursor(nb, 0) - call cursor(0, col("$") - 1) - if s:SynIdName() !~? "string" - return -1 - endif - - " This will not work for a " in the first column... - if s:CurrentChar() == '"' - call cursor(0, col("$") - 2) - if s:SynIdName() !~? "string" - return -1 - endif - if s:CurrentChar() != '\\' - return -1 - endif - call cursor(0, col("$") - 1) - endif - - let p = searchpos('\(^\|[^\\]\)\zs"', 'bW') - - if p != [0, 0] - return p[1] - 1 - endif - - return indent(".") - endfunction - - function! s:CheckForString() - let pos = s:SavePosition() - try - let val = s:ClojureCheckForStringWorker() - finally - call s:RestorePosition(pos) - endtry - return val - endfunction - - function! s:ClojureIsMethodSpecialCaseWorker(position) - " Find the next enclosing form. - call search('\S', 'Wb') - - " Special case: we are at a '(('. - if s:CurrentChar() == '(' - return 0 - endif - call cursor(a:position) - - let nextParen = s:MatchPairs('(', ')', 0) - - " Special case: we are now at toplevel. - if nextParen == [0, 0] - return 0 - endif - call cursor(nextParen) - - call search('\S', 'W') - if g:clojure_special_indent_words =~ '\<' . s:CurrentWord() . '\>' - return 1 - endif - - return 0 - endfunction - - function! s:IsMethodSpecialCase(position) - let pos = s:SavePosition() - try - let val = s:ClojureIsMethodSpecialCaseWorker(a:position) - finally - call s:RestorePosition(pos) - endtry - return val - endfunction - - function! GetClojureIndent() - " Get rid of special case. - if line(".") == 1 - return 0 - endif - - " We have to apply some heuristics here to figure out, whether to use - " normal lisp indenting or not. - let i = s:CheckForString() - if i > -1 - return i + !!g:clojure_align_multiline_strings - endif - - call cursor(0, 1) - - " Find the next enclosing [ or {. We can limit the second search - " to the line, where the [ was found. If no [ was there this is - " zero and we search for an enclosing {. - let paren = s:MatchPairs('(', ')', 0) - let bracket = s:MatchPairs('\[', '\]', paren[0]) - let curly = s:MatchPairs('{', '}', bracket[0]) - - " In case the curly brace is on a line later then the [ or - in - " case they are on the same line - in a higher column, we take the - " curly indent. - if curly[0] > bracket[0] || curly[1] > bracket[1] - if curly[0] > paren[0] || curly[1] > paren[1] - return curly[1] - endif - endif - - " If the curly was not chosen, we take the bracket indent - if - " there was one. - if bracket[0] > paren[0] || bracket[1] > paren[1] - return bracket[1] - endif - - " There are neither { nor [ nor (, ie. we are at the toplevel. - if paren == [0, 0] - return 0 - endif - - " Now we have to reimplement lispindent. This is surprisingly easy, as - " soon as one has access to syntax items. - " - " - Check whether we are in a special position after a word in - " g:clojure_special_indent_words. These are special cases. - " - Get the next keyword after the (. - " - If its first character is also a (, we have another sexp and align - " one column to the right of the unmatched (. - " - In case it is in lispwords, we indent the next line to the column of - " the ( + sw. - " - If not, we check whether it is last word in the line. In that case - " we again use ( + sw for indent. - " - In any other case we use the column of the end of the word + 2. - call cursor(paren) - - if s:IsMethodSpecialCase(paren) - return paren[1] + &shiftwidth - 1 - endif - - " In case we are at the last character, we use the paren position. - if col("$") - 1 == paren[1] - return paren[1] - endif - - " In case after the paren is a whitespace, we search for the next word. - normal! l - if s:CurrentChar() == ' ' - normal! w - endif - - " If we moved to another line, there is no word after the (. We - " use the ( position for indent. - if line(".") > paren[0] - return paren[1] - endif - - " We still have to check, whether the keyword starts with a (, [ or {. - " In that case we use the ( position for indent. - let w = s:CurrentWord() - if stridx('([{', w[0]) > -1 - return paren[1] - endif - - " Test words without namespace qualifiers and leading reader macro - " metacharacters. - " - " e.g. clojure.core/defn and #'defn should both indent like defn. - let ww = substitute(w, "\\v%(.*/|[#'`~@^,]*)(.*)", '\1', '') - - if &lispwords =~ '\V\<' . ww . '\>' - return paren[1] + &shiftwidth - 1 - endif - - if g:clojure_fuzzy_indent - \ && !s:MatchesOne(g:clojure_fuzzy_indent_blacklist, ww) - \ && s:MatchesOne(g:clojure_fuzzy_indent_patterns, ww) - return paren[1] + &shiftwidth - 1 - endif - - normal! W - if paren[0] < line(".") - return paren[1] + &shiftwidth - 1 - endif - - normal! ge - return virtcol(".") + 1 - endfunction - - setlocal indentexpr=GetClojureIndent() + if !exists('g:clojure_maxlines') + let g:clojure_maxlines = 100 + endif + + if !exists('g:clojure_fuzzy_indent') + let g:clojure_fuzzy_indent = 1 + endif + + if !exists('g:clojure_fuzzy_indent_patterns') + let g:clojure_fuzzy_indent_patterns = ['^with', '^def', '^let'] + endif + + if !exists('g:clojure_fuzzy_indent_blacklist') + let g:clojure_fuzzy_indent_blacklist = ['-fn$', '\v^with-%(meta|out-str|loading-context)$'] + endif + + if !exists('g:clojure_special_indent_words') + let g:clojure_special_indent_words = 'deftype,defrecord,reify,proxy,extend-type,extend-protocol,letfn' + endif + + if !exists('g:clojure_align_multiline_strings') + let g:clojure_align_multiline_strings = 0 + endif + + function! s:SynIdName() + return synIDattr(synID(line("."), col("."), 0), "name") + endfunction + + function! s:CurrentChar() + return getline('.')[col('.')-1] + endfunction + + function! s:CurrentWord() + return getline('.')[col('.')-1 : searchpos('\v>', 'n', line('.'))[1]-2] + endfunction + + function! s:IsParen() + return s:CurrentChar() =~ '\v[\(\)\[\]\{\}]' && + \ s:SynIdName() !~? '\vstring|regex|comment|character' + endfunction + + " Returns 1 if string matches a pattern in 'patterns', which may be a + " list of patterns, or a comma-delimited string of implicitly anchored + " patterns. + function! s:MatchesOne(patterns, string) + let list = type(a:patterns) == type([]) + \ ? a:patterns + \ : map(split(a:patterns, ','), '"^" . v:val . "$"') + for pat in list + if a:string =~ pat | return 1 | endif + endfor + endfunction + + function! s:MatchPairs(open, close, stopat) + " Stop only on vector and map [ resp. {. Ignore the ones in strings and + " comments. + if a:stopat == 0 + let stopat = max([line(".") - g:clojure_maxlines, 0]) + else + let stopat = a:stopat + endif + + let pos = searchpairpos(a:open, '', a:close, 'bWn', "!s:IsParen()", stopat) + return [pos[0], virtcol(pos)] + endfunction + + function! s:ClojureCheckForStringWorker() + " Check whether there is the last character of the previous line is + " highlighted as a string. If so, we check whether it's a ". In this + " case we have to check also the previous character. The " might be the + " closing one. In case the we are still in the string, we search for the + " opening ". If this is not found we take the indent of the line. + let nb = prevnonblank(v:lnum - 1) + + if nb == 0 + return -1 + endif + + call cursor(nb, 0) + call cursor(0, col("$") - 1) + if s:SynIdName() !~? "string" + return -1 + endif + + " This will not work for a " in the first column... + if s:CurrentChar() == '"' + call cursor(0, col("$") - 2) + if s:SynIdName() !~? "string" + return -1 + endif + if s:CurrentChar() != '\\' + return -1 + endif + call cursor(0, col("$") - 1) + endif + + let p = searchpos('\(^\|[^\\]\)\zs"', 'bW') + + if p != [0, 0] + return p[1] - 1 + endif + + return indent(".") + endfunction + + function! s:CheckForString() + let pos = getpos('.') + try + let val = s:ClojureCheckForStringWorker() + finally + call setpos('.', pos) + endtry + return val + endfunction + + function! s:ClojureIsMethodSpecialCaseWorker(position) + " Find the next enclosing form. + call search('\S', 'Wb') + + " Special case: we are at a '(('. + if s:CurrentChar() == '(' + return 0 + endif + call cursor(a:position) + + let nextParen = s:MatchPairs('(', ')', 0) + + " Special case: we are now at toplevel. + if nextParen == [0, 0] + return 0 + endif + call cursor(nextParen) + + call search('\S', 'W') + if g:clojure_special_indent_words =~ '\<' . s:CurrentWord() . '\>' + return 1 + endif + + return 0 + endfunction + + function! s:IsMethodSpecialCase(position) + let pos = getpos('.') + try + let val = s:ClojureIsMethodSpecialCaseWorker(a:position) + finally + call setpos('.', pos) + endtry + return val + endfunction + + function! GetClojureIndent() + " Get rid of special case. + if line(".") == 1 + return 0 + endif + + " We have to apply some heuristics here to figure out, whether to use + " normal lisp indenting or not. + let i = s:CheckForString() + if i > -1 + return i + !!g:clojure_align_multiline_strings + endif + + call cursor(0, 1) + + " Find the next enclosing [ or {. We can limit the second search + " to the line, where the [ was found. If no [ was there this is + " zero and we search for an enclosing {. + let paren = s:MatchPairs('(', ')', 0) + let bracket = s:MatchPairs('\[', '\]', paren[0]) + let curly = s:MatchPairs('{', '}', bracket[0]) + + " In case the curly brace is on a line later then the [ or - in + " case they are on the same line - in a higher column, we take the + " curly indent. + if curly[0] > bracket[0] || curly[1] > bracket[1] + if curly[0] > paren[0] || curly[1] > paren[1] + return curly[1] + endif + endif + + " If the curly was not chosen, we take the bracket indent - if + " there was one. + if bracket[0] > paren[0] || bracket[1] > paren[1] + return bracket[1] + endif + + " There are neither { nor [ nor (, ie. we are at the toplevel. + if paren == [0, 0] + return 0 + endif + + " Now we have to reimplement lispindent. This is surprisingly easy, as + " soon as one has access to syntax items. + " + " - Check whether we are in a special position after a word in + " g:clojure_special_indent_words. These are special cases. + " - Get the next keyword after the (. + " - If its first character is also a (, we have another sexp and align + " one column to the right of the unmatched (. + " - In case it is in lispwords, we indent the next line to the column of + " the ( + sw. + " - If not, we check whether it is last word in the line. In that case + " we again use ( + sw for indent. + " - In any other case we use the column of the end of the word + 2. + call cursor(paren) + + if s:IsMethodSpecialCase(paren) + return paren[1] + &shiftwidth - 1 + endif + + " In case we are at the last character, we use the paren position. + if col("$") - 1 == paren[1] + return paren[1] + endif + + " In case after the paren is a whitespace, we search for the next word. + call cursor(0, col('.') + 1) + if s:CurrentChar() == ' ' + call search('\v\S', 'W') + endif + + " If we moved to another line, there is no word after the (. We + " use the ( position for indent. + if line(".") > paren[0] + return paren[1] + endif + + " We still have to check, whether the keyword starts with a (, [ or {. + " In that case we use the ( position for indent. + let w = s:CurrentWord() + if stridx('([{', w[0]) > -1 + return paren[1] + endif + + " Test words without namespace qualifiers and leading reader macro + " metacharacters. + " + " e.g. clojure.core/defn and #'defn should both indent like defn. + let ww = substitute(w, "\\v%(.*/|[#'`~@^,]*)(.*)", '\1', '') + + if &lispwords =~ '\V\<' . ww . '\>' + return paren[1] + &shiftwidth - 1 + endif + + if g:clojure_fuzzy_indent + \ && !s:MatchesOne(g:clojure_fuzzy_indent_blacklist, ww) + \ && s:MatchesOne(g:clojure_fuzzy_indent_patterns, ww) + return paren[1] + &shiftwidth - 1 + endif + + call search('\v\_s', 'cW') + call search('\v\S', 'W') + if paren[0] < line(".") + return paren[1] + &shiftwidth - 1 + endif + + call search('\v\S', 'bW') + return virtcol(".") + 1 + endfunction + + setlocal indentexpr=GetClojureIndent() else - " In case we have searchpairpos not available we fall back to - " normal lisp indenting. - setlocal indentexpr= - setlocal lisp - let b:undo_indent .= '| setlocal lisp<' + " In case we have searchpairpos not available we fall back to + " normal lisp indenting. + setlocal indentexpr= + setlocal lisp + let b:undo_indent .= '| setlocal lisp<' endif @@ -390,9 +381,8 @@ setlocal lispwords+=while " Exception handling setlocal lispwords+=catch -setlocal lispwords+=try " For aesthetics when enclosing single line let &cpo = s:save_cpo unlet! s:save_cpo -" vim:sts=4 sw=4 et: +" vim:sts=8:sw=8:ts=8:noet diff --git a/runtime/indent/j.vim b/runtime/indent/j.vim new file mode 100644 index 000000000..056c20a4e --- /dev/null +++ b/runtime/indent/j.vim @@ -0,0 +1,37 @@ +" Vim indent file +" Language: J +" Maintainer: David Bürgin <676c7473@gmail.com> +" Last Change: 2013-09-21 + +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal indentexpr=GetJIndent() +setlocal indentkeys-=0{,0},\:,0# +setlocal indentkeys+=0),=case.,=catch.,=catchd.,=catcht.,=do.,=else.,=elseif.,=end.,=fcase. + +let b:undo_indent = "setl indk< inde<" + +if exists("*GetJIndent") + finish +endif + +function GetJIndent() + let prevlnum = prevnonblank(v:lnum-1) + if prevlnum == 0 + return 0 + endif + + let indent = indent(prevlnum) + if getline(prevlnum) =~# '^\s*\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|fcase\|for\%(_\a\k*\)\=\|if\|select\|try\|whil\%(e\|st\)\)\.' + if getline(prevlnum) !~# '\ +" Maintainer: David Necas (Yeti) " License: This file can be redistribued and/or modified under the same terms " as Vim itself. -" Last Change: 2006-12-13 -" URL: http://trific.ath.cx/Ftp/vim/syntax/apache.vim +" Last Change: 2013-09-16 " Notes: Last synced with apache-2.2.3, version 1.x is no longer supported " TODO: see particular FIXME's scattered through the file " make it really linewise? @@ -30,7 +28,10 @@ syn keyword apacheFixme FIXME TODO XXX NOT syn case ignore syn match apacheAnything "\s[^>]*" contained syn match apacheError "\w\+" contained -syn region apacheString start=+"+ end=+"+ skip=+\\\\\|\\\"+ +syn region apacheString start=+"+ end=+"+ skip=+\\\\\|\\\"+ oneline + +" Following is to prevent escaped quotes from being parsed as strings. +syn match apacheSkipQuote +\\"+ " Core and mpm syn keyword apacheDeclaration AccessFileName AddDefaultCharset AllowOverride AuthName AuthType ContentDigest DefaultType DocumentRoot ErrorDocument ErrorLog HostNameLookups IdentityCheck Include KeepAlive KeepAliveTimeout LimitRequestBody LimitRequestFields LimitRequestFieldsize LimitRequestLine LogLevel MaxKeepAliveRequests NameVirtualHost Options Require RLimitCPU RLimitMEM RLimitNPROC Satisfy ScriptInterpreterSource ServerAdmin ServerAlias ServerName ServerPath ServerRoot ServerSignature ServerTokens TimeOut UseCanonicalName diff --git a/runtime/syntax/clojure.vim b/runtime/syntax/clojure.vim index 3108148ff..09b8b1dd6 100644 --- a/runtime/syntax/clojure.vim +++ b/runtime/syntax/clojure.vim @@ -1,24 +1,22 @@ " Vim syntax file -" Language: Clojure -" Authors: Toralf Wittner -" modified by Meikel Brandmeyer -" URL: http://kotka.de/projects/clojure/vimclojure.html +" Language: Clojure +" Authors: Toralf Wittner +" modified by Meikel Brandmeyer +" URL: http://kotka.de/projects/clojure/vimclojure.html " -" Maintainer: Sung Pae -" URL: https://github.com/guns/vim-clojure-static -" License: Same as Vim -" Last Change: 05 February 2013 - -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif +" Contributors: Joel Holdbrooks (Regexp support, bug fixes) +" +" Maintainer: Sung Pae +" URL: https://github.com/guns/vim-clojure-static +" License: Same as Vim +" Last Change: 08 September 2013 -setlocal iskeyword+=?,-,*,!,+,/,=,<,>,.,:,$ +if exists("b:current_syntax") + finish +endif -" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-002/vim_clojure_static.clj -" Clojure 1.5.0-RC6 +" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-005/clj/src/vim_clojure_static/generate.clj +" Clojure version 1.5.1 syntax keyword clojureConstant nil syntax keyword clojureBoolean false true syntax keyword clojureSpecial . catch clojure.core/fn clojure.core/let clojure.core/loop def do finally fn if let loop monitor-enter monitor-exit new quote recur set! throw try var @@ -28,7 +26,7 @@ syntax keyword clojureRepeat clojure.core/doall clojure.core/dorun clojure.core/ syntax keyword clojureDefine clojure.core/definline clojure.core/definterface clojure.core/defmacro clojure.core/defmethod clojure.core/defmulti clojure.core/defn clojure.core/defn- clojure.core/defonce clojure.core/defprotocol clojure.core/defrecord clojure.core/defstruct clojure.core/deftype definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype syntax keyword clojureMacro -> ->> .. amap and areduce as-> assert binding bound-fn clojure.core/-> clojure.core/->> clojure.core/.. clojure.core/amap clojure.core/and clojure.core/areduce clojure.core/as-> clojure.core/assert clojure.core/binding clojure.core/bound-fn clojure.core/comment clojure.core/declare clojure.core/delay clojure.core/dosync clojure.core/doto clojure.core/extend-protocol clojure.core/extend-type clojure.core/for clojure.core/future clojure.core/gen-class clojure.core/gen-interface clojure.core/import clojure.core/io! clojure.core/lazy-cat clojure.core/lazy-seq clojure.core/letfn clojure.core/locking clojure.core/memfn clojure.core/ns clojure.core/or clojure.core/proxy clojure.core/proxy-super clojure.core/pvalues clojure.core/refer-clojure clojure.core/reify clojure.core/some-> clojure.core/some->> clojure.core/sync clojure.core/time clojure.core/with-bindings clojure.core/with-in-str clojure.core/with-loading-context clojure.core/with-local-vars clojure.core/with-open clojure.core/with-out-str clojure.core/with-precision clojure.core/with-redefs comment declare delay dosync doto extend-protocol extend-type for future gen-class gen-interface import io! lazy-cat lazy-seq letfn locking memfn ns or proxy proxy-super pvalues refer-clojure reify some-> some->> sync time with-bindings with-in-str with-loading-context with-local-vars with-open with-out-str with-precision with-redefs syntax keyword clojureFunc * *' + +' - -' ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods / < <= = == > >= accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root ancestors apply array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn* bound? butlast byte byte-array bytes cast char char-array char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version clojure.core/* clojure.core/*' clojure.core/+ clojure.core/+' clojure.core/- clojure.core/-' clojure.core/->ArrayChunk clojure.core/->Vec clojure.core/->VecNode clojure.core/->VecSeq clojure.core/-cache-protocol-fn clojure.core/-reset-methods clojure.core// clojure.core/< clojure.core/<= clojure.core/= clojure.core/== clojure.core/> clojure.core/>= clojure.core/accessor clojure.core/aclone clojure.core/add-classpath clojure.core/add-watch clojure.core/agent clojure.core/agent-error clojure.core/agent-errors clojure.core/aget clojure.core/alength clojure.core/alias clojure.core/all-ns clojure.core/alter clojure.core/alter-meta! clojure.core/alter-var-root clojure.core/ancestors clojure.core/apply clojure.core/array-map clojure.core/aset clojure.core/aset-boolean clojure.core/aset-byte clojure.core/aset-char clojure.core/aset-double clojure.core/aset-float clojure.core/aset-int clojure.core/aset-long clojure.core/aset-short clojure.core/assoc clojure.core/assoc! clojure.core/assoc-in clojure.core/associative? clojure.core/atom clojure.core/await clojure.core/await-for clojure.core/await1 clojure.core/bases clojure.core/bean clojure.core/bigdec clojure.core/bigint clojure.core/biginteger clojure.core/bit-and clojure.core/bit-and-not clojure.core/bit-clear clojure.core/bit-flip clojure.core/bit-not clojure.core/bit-or clojure.core/bit-set clojure.core/bit-shift-left clojure.core/bit-shift-right clojure.core/bit-test clojure.core/bit-xor clojure.core/boolean clojure.core/boolean-array clojure.core/booleans clojure.core/bound-fn* clojure.core/bound? clojure.core/butlast clojure.core/byte clojure.core/byte-array clojure.core/bytes clojure.core/cast clojure.core/char clojure.core/char-array clojure.core/char? clojure.core/chars clojure.core/chunk clojure.core/chunk-append clojure.core/chunk-buffer clojure.core/chunk-cons clojure.core/chunk-first clojure.core/chunk-next clojure.core/chunk-rest clojure.core/chunked-seq? clojure.core/class clojure.core/class? clojure.core/clear-agent-errors clojure.core/clojure-version clojure.core/coll? clojure.core/commute clojure.core/comp clojure.core/comparator clojure.core/compare clojure.core/compare-and-set! clojure.core/compile clojure.core/complement clojure.core/concat clojure.core/conj clojure.core/conj! clojure.core/cons clojure.core/constantly clojure.core/construct-proxy clojure.core/contains? clojure.core/count clojure.core/counted? clojure.core/create-ns clojure.core/create-struct clojure.core/cycle clojure.core/dec clojure.core/dec' clojure.core/decimal? clojure.core/delay? clojure.core/deliver clojure.core/denominator clojure.core/deref clojure.core/derive clojure.core/descendants clojure.core/destructure clojure.core/disj clojure.core/disj! clojure.core/dissoc clojure.core/dissoc! clojure.core/distinct clojure.core/distinct? clojure.core/double clojure.core/double-array clojure.core/doubles clojure.core/drop clojure.core/drop-last clojure.core/drop-while clojure.core/empty clojure.core/empty? clojure.core/ensure clojure.core/enumeration-seq clojure.core/error-handler clojure.core/error-mode clojure.core/eval clojure.core/even? clojure.core/every-pred clojure.core/every? clojure.core/ex-data clojure.core/ex-info clojure.core/extend clojure.core/extenders clojure.core/extends? clojure.core/false? clojure.core/ffirst clojure.core/file-seq clojure.core/filter clojure.core/filterv clojure.core/find clojure.core/find-keyword clojure.core/find-ns clojure.core/find-protocol-impl clojure.core/find-protocol-method clojure.core/find-var clojure.core/first clojure.core/flatten clojure.core/float clojure.core/float-array clojure.core/float? clojure.core/floats clojure.core/flush clojure.core/fn? clojure.core/fnext clojure.core/fnil clojure.core/force clojure.core/format clojure.core/frequencies clojure.core/future-call clojure.core/future-cancel clojure.core/future-cancelled? clojure.core/future-done? clojure.core/future? clojure.core/gensym clojure.core/get clojure.core/get-in clojure.core/get-method clojure.core/get-proxy-class clojure.core/get-thread-bindings clojure.core/get-validator clojure.core/group-by clojure.core/hash clojure.core/hash-combine clojure.core/hash-map clojure.core/hash-set clojure.core/identical? clojure.core/identity clojure.core/ifn? clojure.core/in-ns clojure.core/inc clojure.core/inc' clojure.core/init-proxy clojure.core/instance? clojure.core/int clojure.core/int-array clojure.core/integer? clojure.core/interleave clojure.core/intern clojure.core/interpose clojure.core/into clojure.core/into-array clojure.core/ints clojure.core/isa? clojure.core/iterate clojure.core/iterator-seq clojure.core/juxt clojure.core/keep clojure.core/keep-indexed clojure.core/key clojure.core/keys clojure.core/keyword clojure.core/keyword? clojure.core/last clojure.core/line-seq clojure.core/list clojure.core/list* clojure.core/list? clojure.core/load clojure.core/load-file clojure.core/load-reader clojure.core/load-string clojure.core/loaded-libs clojure.core/long clojure.core/long-array clojure.core/longs clojure.core/macroexpand clojure.core/macroexpand-1 clojure.core/make-array clojure.core/make-hierarchy clojure.core/map clojure.core/map-indexed clojure.core/map? clojure.core/mapcat clojure.core/mapv clojure.core/max clojure.core/max-key clojure.core/memoize clojure.core/merge clojure.core/merge-with clojure.core/meta clojure.core/method-sig clojure.core/methods clojure.core/min clojure.core/min-key clojure.core/mod clojure.core/munge clojure.core/name clojure.core/namespace clojure.core/namespace-munge clojure.core/neg? clojure.core/newline clojure.core/next clojure.core/nfirst clojure.core/nil? clojure.core/nnext clojure.core/not clojure.core/not-any? clojure.core/not-empty clojure.core/not-every? clojure.core/not= clojure.core/ns-aliases clojure.core/ns-imports clojure.core/ns-interns clojure.core/ns-map clojure.core/ns-name clojure.core/ns-publics clojure.core/ns-refers clojure.core/ns-resolve clojure.core/ns-unalias clojure.core/ns-unmap clojure.core/nth clojure.core/nthnext clojure.core/nthrest clojure.core/num clojure.core/number? clojure.core/numerator clojure.core/object-array clojure.core/odd? clojure.core/parents clojure.core/partial clojure.core/partition clojure.core/partition-all clojure.core/partition-by clojure.core/pcalls clojure.core/peek clojure.core/persistent! clojure.core/pmap clojure.core/pop clojure.core/pop! clojure.core/pop-thread-bindings clojure.core/pos? clojure.core/pr clojure.core/pr-str clojure.core/prefer-method clojure.core/prefers clojure.core/print clojure.core/print-ctor clojure.core/print-simple clojure.core/print-str clojure.core/printf clojure.core/println clojure.core/println-str clojure.core/prn clojure.core/prn-str clojure.core/promise clojure.core/proxy-call-with-super clojure.core/proxy-mappings clojure.core/proxy-name clojure.core/push-thread-bindings clojure.core/quot clojure.core/rand clojure.core/rand-int clojure.core/rand-nth clojure.core/range clojure.core/ratio? clojure.core/rational? clojure.core/rationalize clojure.core/re-find clojure.core/re-groups clojure.core/re-matcher clojure.core/re-matches clojure.core/re-pattern clojure.core/re-seq clojure.core/read clojure.core/read-line clojure.core/read-string clojure.core/realized? clojure.core/reduce clojure.core/reduce-kv clojure.core/reduced clojure.core/reduced? clojure.core/reductions clojure.core/ref clojure.core/ref-history-count clojure.core/ref-max-history clojure.core/ref-min-history clojure.core/ref-set clojure.core/refer clojure.core/release-pending-sends clojure.core/rem clojure.core/remove clojure.core/remove-all-methods clojure.core/remove-method clojure.core/remove-ns clojure.core/remove-watch clojure.core/repeat clojure.core/repeatedly clojure.core/replace clojure.core/replicate clojure.core/require clojure.core/reset! clojure.core/reset-meta! clojure.core/resolve clojure.core/rest clojure.core/restart-agent clojure.core/resultset-seq clojure.core/reverse clojure.core/reversible? clojure.core/rseq clojure.core/rsubseq clojure.core/satisfies? clojure.core/second clojure.core/select-keys clojure.core/send clojure.core/send-off clojure.core/send-via clojure.core/seq clojure.core/seq? clojure.core/seque clojure.core/sequence clojure.core/sequential? clojure.core/set clojure.core/set-agent-send-executor! clojure.core/set-agent-send-off-executor! clojure.core/set-error-handler! clojure.core/set-error-mode! clojure.core/set-validator! clojure.core/set? clojure.core/short clojure.core/short-array clojure.core/shorts clojure.core/shuffle clojure.core/shutdown-agents clojure.core/slurp clojure.core/some clojure.core/some-fn clojure.core/sort clojure.core/sort-by clojure.core/sorted-map clojure.core/sorted-map-by clojure.core/sorted-set clojure.core/sorted-set-by clojure.core/sorted? clojure.core/special-symbol? clojure.core/spit clojure.core/split-at clojure.core/split-with clojure.core/str clojure.core/string? clojure.core/struct clojure.core/struct-map clojure.core/subs clojure.core/subseq clojure.core/subvec clojure.core/supers clojure.core/swap! clojure.core/symbol clojure.core/symbol? clojure.core/take clojure.core/take-last clojure.core/take-nth clojure.core/take-while clojure.core/test clojure.core/the-ns clojure.core/thread-bound? clojure.core/to-array clojure.core/to-array-2d clojure.core/trampoline clojure.core/transient clojure.core/tree-seq clojure.core/true? clojure.core/type clojure.core/unchecked-add clojure.core/unchecked-add-int clojure.core/unchecked-byte clojure.core/unchecked-char clojure.core/unchecked-dec clojure.core/unchecked-dec-int clojure.core/unchecked-divide-int clojure.core/unchecked-double clojure.core/unchecked-float clojure.core/unchecked-inc clojure.core/unchecked-inc-int clojure.core/unchecked-int clojure.core/unchecked-long clojure.core/unchecked-multiply clojure.core/unchecked-multiply-int clojure.core/unchecked-negate clojure.core/unchecked-negate-int clojure.core/unchecked-remainder-int clojure.core/unchecked-short clojure.core/unchecked-subtract clojure.core/unchecked-subtract-int clojure.core/underive clojure.core/update-in clojure.core/update-proxy clojure.core/use clojure.core/val clojure.core/vals clojure.core/var-get clojure.core/var-set clojure.core/var? clojure.core/vary-meta clojure.core/vec clojure.core/vector clojure.core/vector-of clojure.core/vector? clojure.core/with-bindings* clojure.core/with-meta clojure.core/with-redefs-fn clojure.core/xml-seq clojure.core/zero? clojure.core/zipmap coll? commute comp comparator compare compare-and-set! compile complement concat conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn? fnext fnil force format frequencies future-call future-cancel future-cancelled? future-done? future? gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity ifn? in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last line-seq list list* list? load load-file load-reader load-string loaded-libs long long-array longs macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers print print-ctor print-simple print-str printf println println-str prn prn-str promise proxy-call-with-super proxy-mappings proxy-name push-thread-bindings quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reduced reduced? reductions ref ref-history-count ref-max-history ref-min-history ref-set refer release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off send-via seq seq? seque sequence sequential? set set-agent-send-executor! set-agent-send-off-executor! set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? take take-last take-nth take-while test the-ns thread-bound? to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? with-bindings* with-meta with-redefs-fn xml-seq zero? zipmap -syntax keyword clojureVariable *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *default-data-reader-fn* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *read-whitelist* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* EMPTY-NODE char-escape-string char-name-string clojure.core/*1 clojure.core/*2 clojure.core/*3 clojure.core/*agent* clojure.core/*allow-unresolved-vars* clojure.core/*assert* clojure.core/*clojure-version* clojure.core/*command-line-args* clojure.core/*compile-files* clojure.core/*compile-path* clojure.core/*compiler-options* clojure.core/*data-readers* clojure.core/*default-data-reader-fn* clojure.core/*e clojure.core/*err* clojure.core/*file* clojure.core/*flush-on-newline* clojure.core/*fn-loader* clojure.core/*in* clojure.core/*math-context* clojure.core/*ns* clojure.core/*out* clojure.core/*print-dup* clojure.core/*print-length* clojure.core/*print-level* clojure.core/*print-meta* clojure.core/*print-readably* clojure.core/*read-eval* clojure.core/*read-whitelist* clojure.core/*source-path* clojure.core/*unchecked-math* clojure.core/*use-context-classloader* clojure.core/*verbose-defrecords* clojure.core/*warn-on-reflection* clojure.core/EMPTY-NODE clojure.core/char-escape-string clojure.core/char-name-string clojure.core/default-data-readers clojure.core/primitives-classnames clojure.core/print-dup clojure.core/print-method clojure.core/unquote clojure.core/unquote-splicing default-data-readers primitives-classnames print-dup print-method unquote unquote-splicing +syntax keyword clojureVariable *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *default-data-reader-fn* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* EMPTY-NODE char-escape-string char-name-string clojure.core/*1 clojure.core/*2 clojure.core/*3 clojure.core/*agent* clojure.core/*allow-unresolved-vars* clojure.core/*assert* clojure.core/*clojure-version* clojure.core/*command-line-args* clojure.core/*compile-files* clojure.core/*compile-path* clojure.core/*compiler-options* clojure.core/*data-readers* clojure.core/*default-data-reader-fn* clojure.core/*e clojure.core/*err* clojure.core/*file* clojure.core/*flush-on-newline* clojure.core/*fn-loader* clojure.core/*in* clojure.core/*math-context* clojure.core/*ns* clojure.core/*out* clojure.core/*print-dup* clojure.core/*print-length* clojure.core/*print-level* clojure.core/*print-meta* clojure.core/*print-readably* clojure.core/*read-eval* clojure.core/*source-path* clojure.core/*unchecked-math* clojure.core/*use-context-classloader* clojure.core/*verbose-defrecords* clojure.core/*warn-on-reflection* clojure.core/EMPTY-NODE clojure.core/char-escape-string clojure.core/char-name-string clojure.core/default-data-readers clojure.core/primitives-classnames clojure.core/print-dup clojure.core/print-method clojure.core/unquote clojure.core/unquote-splicing default-data-readers primitives-classnames print-dup print-method unquote unquote-splicing " Keywords are symbols: " static Pattern symbolPat = Pattern.compile("[:]?([\\D&&[^/]].*/)?([\\D&&[^/]][^/]*)"); @@ -36,13 +34,15 @@ syntax keyword clojureVariable *1 *2 *3 *agent* *allow-unresolved-vars* *assert* " * Must not end in a : or / " * Must not have two adjacent colons except at the beginning " * Must not contain any reader metacharacters except for ' and # -syntax match clojureKeyword "\v:{1,2}%([^ \n\r\t()\[\]{}";@^`~\\%/]+/)*[^ \n\r\t()\[\]{}";@^`~\\%/]+:@" + +syntax match clojureStringEscape "\v\\%([\\btnfr"]|u\x{4}|[0-3]\o{2}|\o{1,2})" contained -syntax region clojureString start=/L\="/ skip=/\\\\\|\\"/ end=/"/ +syntax region clojureString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=clojureStringEscape syntax match clojureCharacter "\\." -syntax match clojureCharacter "\\o[0-7]\{3\}" -syntax match clojureCharacter "\\u[0-9]\{4\}" +syntax match clojureCharacter "\\o\%([0-3]\o\{2\}\|\o\{1,2\}\)" +syntax match clojureCharacter "\\u\x\{4\}" syntax match clojureCharacter "\\space" syntax match clojureCharacter "\\tab" syntax match clojureCharacter "\\newline" @@ -50,16 +50,17 @@ syntax match clojureCharacter "\\return" syntax match clojureCharacter "\\backspace" syntax match clojureCharacter "\\formfeed" -let s:radixChars = "0123456789abcdefghijklmnopqrstuvwxyz" +syntax match clojureSymbol "\v%([a-zA-Z!$&*_+=|<.>?-]|[^\x00-\x7F])+%(:?%([a-zA-Z0-9!#$%&*_+=|'<.>/?-]|[^\x00-\x7F]))*[#:]@"' + execute 'syntax match clojureNumber "\v\c<[-+]?' . s:radix . 'r[' . strpart(s:radix_chars, 0, s:radix) . ']+>"' endfor -unlet! s:radixChars s:radix +unlet! s:radix_chars s:radix -syntax match clojureNumber "\<-\=[0-9]\+\(\.[0-9]*\)\=\(M\|\([eE][-+]\?[0-9]\+\)\)\?\>" -syntax match clojureNumber "\<-\=[0-9]\+N\?\>" -syntax match clojureNumber "\<-\=0x[0-9a-fA-F]\+\>" -syntax match clojureNumber "\<-\=[0-9]\+/[0-9]\+\>" +syntax match clojureNumber "\v<[-+]?%(0\o*|0x\x+|[1-9]\d*)N?>" +syntax match clojureNumber "\v<[-+]?%(0|[1-9]\d*|%(0|[1-9]\d*)\.\d*)%(M|[eE][-+]?\d+)?>" +syntax match clojureNumber "\v<[-+]?%(0|[1-9]\d*)/%(0|[1-9]\d*)>" syntax match clojureVarArg "&" @@ -69,66 +70,110 @@ syntax match clojureUnquote "\~" syntax match clojureUnquote "\~@" syntax match clojureMeta "\^" syntax match clojureDeref "@" -syntax match clojureAnonArg "%\(\d\|&\)\?" -syntax match clojureDispatch "\v#[\^\'\=\<]?" - -syntax region clojureRegexp start=/L\=\#"/ skip=/\\\\\|\\"/ end=/"/ - -syntax match clojureComment ";.*$" contains=clojureTodo,@Spell +syntax match clojureDispatch "\v#[\^'=<_]?" + +" Clojure permits no more than 20 params. +syntax match clojureAnonArg "%\(20\|1\d\|[1-9]\|&\)\?" + +syntax match clojureRegexpEscape "\v\\%([\\tnrfae()\[\]{}^$*?+]|c\u|0[0-3]?\o{1,2}|x%(\x{2}|\{\x{1,6}\})|u\x{4})" contained display +syntax region clojureRegexpQuoted start=/\\Q/ms=e+1 skip=/\\\\\|\\"/ end=/\\E/me=s-1 end=/"/me=s-1 contained +syntax region clojureRegexpQuote start=/\\Q/ skip=/\\\\\|\\"/ end=/\\E/ end=/"/me=s-1 contains=clojureRegexpQuoted keepend contained + +" Character property classes +" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-005/clj/src/vim_clojure_static/generate.clj +" Java version 1.7.0_40 +syntax match clojureRegexpPosixCharClass "\v\\[pP]\{%(Blank|P%(unct|rint)|Digit|Graph|A%(l%(pha|num)|SCII)|XDigit|Space|Upper|Lower|Cntrl)\}" contained display +syntax match clojureRegexpJavaCharClass "\v\\[pP]\{java%(U%(pperCase|nicodeIdentifier%(Start|Part))|Mirrored|Alphabetic|SpaceChar|D%(efined|igit)|Whitespace|L%(etter%(OrDigit)?|owerCase)|TitleCase|I%(de%(ographic|ntifierIgnorable)|SOControl)|JavaIdentifier%(Start|Part))\}" contained display +syntax match clojureRegexpUnicodeCharClass "\v\\[pP]\{\cIs%(blank|hex%(digit|_digit)|uppercase|digit|control|a%(ssigned|l%(phabetic|num))|graph|ideographic|p%(rint|unctuation)|titlecase|w%(hite%(_space|space)|ord)|l%(owercase|etter)|noncharacter%(codepoint|_code_point))\}" contained display +syntax match clojureRegexpUnicodeCharClass "\v\\[pP][MLNPSZC]" contained display +syntax match clojureRegexpUnicodeCharClass "\v\\[pP]\{%(C[fonsc]?|L[DmloutC]?|S[kmoc]?|P[edfiosc]?|M[enc]?|Z[lps]?|N[dlo]?)\}" contained display +syntax match clojureRegexpUnicodeCharClass "\v\\[pP]\{%(Is|gc\=|general_category\=)?%(C[fonsc]?|L[DmloutC]?|S[kmoc]?|P[edfiosc]?|M[enc]?|Z[lps]?|N[dlo]?)\}" contained display +syntax match clojureRegexpUnicodeCharClass "\v\\[pP]\{\c%(Is|sc\=|script\=)%(h%(ira%(gana)?|an%([io]|g%(ul)?|unoo)?|ebr%(ew)?)|yi%(ii)?|java%(nese)?|c%(prt|y%(r%(illic|l)|priot)|h%(er%(okee)?|am)|uneiform|o%(mmon|pt%(ic)?)|a%(n%(adian_aboriginal|s)|ri%(an)?))|i%(mperial_aramaic|tal|n%(herited|scriptional_pa%(rthian|hlavi)))|a%(r%(ab%(ic)?|m%([in]|enian))|v%(st|estan))|g%(oth%(ic)?|u%(j%(arati|r)|r%(mukhi|u))|lag%(olitic)?|eor%(gian)?|re%(k|ek))|b%(u%(gi%(nese)?|h%(d|id))|ra%(i%(lle)?|h%(mi)?)|a%(mum?|t%(k|ak)|li%(nese)?)|opo%(mofo)?|eng%(ali)?)|s%(ha%(w|vian)|und%(anese)?|y%(r%(iac|c)|lo%(ti_nagri)?)|inh%(ala)?|a%(ur%(ashtra)?|rb|m%(r|aritan)))|d%(srt|e%(va%(nagari)?|seret))|l%(a%(na|oo?|t%(n|in))|epc%(ha)?|i%(n%(ear_b|b)|mbu?|su)|y%([dc]i%(an)?))|p%(h%(oenician|nx|li|ag%(s_pa)?)|rti)|e%(gyp%(tian_hieroglyphs)?|thi%(opic)?)|r%(jng|un%(ic|r)|ejang)|u%(nknown|gar%(itic)?)|vaii?|n%(koo?|ew_tai_lue)|m%(y%(mr|anmar)|tei|a%(nd%(aic)?|layalam)|ong%(olian)?|eetei_mayek|lym)|z%(inh|yyy|zzz)|t%(glg|fng|i%(finagh|b%(t|etan))|ha%(i|a%(na)?)|elu%(gu)?|a%(i_%(viet|le|tham)|l[eu]|g%(alog|b%(anwa)?)|vt|m%(l|il)))|x%(sux|peo)|o%(r%(iya|kh|ya)|sma%(nya)?|g%(am|ham)|l%(ck|d_%(south_arabian|turkic|italic|persian)|_chiki))|k%(a%(takana|yah_li|n%(nada|a)|li|ithi)|h%(m%(r|er)|ar%(oshthi)?)|thi|nda))\}" contained display +syntax match clojureRegexpUnicodeCharClass "\v\\[pP]\{\c%(In|blk\=|block\=)%(s%(a%(maritan|urashtra)|mall%(_form_variants| form variants|formvariants)|inhala|y%(loti%(nagri|[_ ]nagri)|riac)|havian|p%(ecials|acing%(modifierletters|_modifier_letters| modifier letters))|u%(p%(erscripts%(andsubscripts|_and_subscripts| and subscripts)|plementa%(ry%( private use area-[ab]|_private_use_area_[ab]|privateusearea-[ab])|l%( %(arrows-[ab]|punctuation|mathematical operators)|arrows-[ab]|_%(punctuation|mathematical_operators|arrows_[ab])|punctuation|mathematicaloperators)))|ndanese|rrogates_area))|l%(a%(o|tin%(_%(extended_%(a%(dditional)?|[dcb])|1_supplement)| extended%(-[dacb]| additional)|-1%( supplement|supplement)|extended%(additional|-[dacb])))|e%(pcha|tterlike%(symbols|[_ ]symbols))|y[cd]ian|i%(su|mbu|near%(b%(ideograms|syllabary)|_b_%(ideograms|syllabary)| b %(ideograms|syllabary)))|ow%([_ ]surrogates|surrogates))|b%(a%(sic%(latin|[_ ]latin)|tak|linese|mum%([_ ]supplement|supplement)?)|yzantine%(_musical_symbols| musical symbols|musicalsymbols)|engali|u%(ginese|hid)|lock%(elements|[_ ]elements)|ra%(hmi|ille%([ _]patterns|patterns))|o%(x%(drawing|[_ ]drawing)|pomofo%([ _]extended|extended)?))|t%(a%(g%(s|alog|banwa)|mil|i%( %(viet|xuan jing symbols|le|tham)|viet|le|_%(xuan_jing_symbols|viet|le|tham)|tham|xuanjingsymbols))|ha%(i|ana)|elugu|i%(finagh|betan)|ransport%(_and_map_symbols| and map symbols|andmapsymbols))|n%(ew%(_tai_lue| tai lue|tailue)|umber%([ _]forms|forms)|ko)|m%(iscellaneous%(_%(mathematical_symbols_[ab]|symbols%(_and_%(arrows|pictographs))?|technical)|mathematicalsymbols-[ab]|technical| %(symbols%( and %(arrows|pictographs))?|mathematical symbols-[ab]|technical)|symbols%(and%(arrows|pictographs))?)|eetei%(mayek|[_ ]mayek)|a%(ndaic|thematical%(alphanumericsymbols|operators|_%(alphanumeric_symbols|operators)| %(operators|alphanumeric symbols))|hjong%(tiles|[_ ]tiles)|layalam)|yanmar%(_extended_a|extended-a| extended-a)?|o%(difier%( tone letters|toneletters|_tone_letters)|ngolian)|usical%(symbols|[_ ]symbols))|p%(h%(a%(gs[-_]pa|istos%(disc|[_ ]disc))|o%(netic%(_extensions%(_supplement)?| extensions%( supplement)?|extensions%(supplement)?)|enician))|rivate%(usearea|_use_area| use area)|laying%(cards|[_ ]cards))|javanese|u%(garitic|nified%(_canadian_aboriginal_syllabics%(_extended)?| canadian aboriginal syllabics%( extended)?|canadianaboriginalsyllabics%(extended)?))|o%(riya|gham|l%([ _]chiki|d%(turkic|_%(south_arabian|turkic|italic|persian)|italic|persian| %(south arabian|turkic|italic|persian)|southarabian)|chiki)|smanya|ptical%(_character_recognition| character recognition|characterrecognition))|v%(e%(dic%(extensions|[_ ]extensions)|rtical%([ _]forms|forms))|a%(i|riation%(_selectors%(_supplement)?| selectors%( supplement)?|selectors%(supplement)?)))|a%(vestan|l%(phabetic%(_presentation_forms| presentation forms|presentationforms)|chemical%(symbols|[_ ]symbols))|ncient%( %(symbols|greek %(musical notation|numbers))|symbols|greek%(musicalnotation|numbers)|_%(symbols|greek_%(musical_notation|numbers)))|egean%([ _]numbers|numbers)|r%(menian|rows|abic%( %(presentation forms-[ab]|supplement)|_%(presentation_forms_[ab]|supplement)|presentationforms-[ab]|supplement)?))|i%(nscriptional%(pa%(rthian|hlavi)|%([_ ]pa%(rthian|hlavi)))|deographic%( description characters|descriptioncharacters|_description_characters)|pa%(extensions|[_ ]extensions)|mperial%(aramaic|[_ ]aramaic))|yi%(%([_ ]%(radicals|syllables))|radicals|syllables|jing%(hexagramsymbols|_hexagram_symbols| hexagram symbols))|k%(a%(yah%(li|[_ ]li)|n%(nada|bun|a%([_ ]supplement|supplement)|gxi%(radicals|[_ ]radicals))|ithi|takana%(phoneticextensions|_phonetic_extensions| phonetic extensions)?)|h%(aroshthi|mer%(symbols|[_ ]symbols)?))|d%(e%(vanagari%([ _]extended|extended)?|seret)|omino%(tiles|[_ ]tiles)|ingbats)|g%(lagolitic|othic|reek%(andcoptic| %(and coptic|extended)|extended|_extended)?|u%(rmukhi|jarati)|e%(o%(metric%([_ ]shapes|shapes)|rgian%([_ ]supplement|supplement)?)|neral%(punctuation|[_ ]punctuation)))|e%(nclosed%( %(ideographic supplement|cjk letters and months|alphanumeric%( supplement|s))|cjklettersandmonths|_%(ideographic_supplement|alphanumeric%(_supplement|s)|cjk_letters_and_months)|alphanumerics%(upplement)?|ideographicsupplement)|moticons|thiopic%(extended%(-a)?| %(extended%(-a)?|supplement)|_%(extended%(_a)?|supplement)|supplement)?|gyptian%(hieroglyphs|[_ ]hieroglyphs))|r%(ejang|u%(nic|mi%(numeralsymbols|_numeral_symbols| numeral symbols)))|c%(jk%(_%(compatibility%(_%(ideographs%(_supplement)?|forms))?|radicals_supplement|unified_ideographs%(_extension_[dacb])?|s%(trokes|ymbols_and_punctuation))|compatibility%(ideographs%(supplement)?|forms)?|unifiedideographs%(extension[dacb])?|radicalssupplement|s%(ymbolsandpunctuation|trokes)| %(unified ideographs%( extension [dacb])?|s%(trokes|ymbols and punctuation)|radicals supplement|compatibility%( %(forms|ideographs%( supplement)?))?))|h%(am|erokee)|u%(neiform%(_numbers_and_punctuation| numbers and punctuation|numbersandpunctuation)?|rrency%(symbols|[_ ]symbols))|y%(rillic%(_%(extended_[ab]|supplementary)| %(extended-[ab]|supplement%(ary)?)|extended-[ab]|supplement%(ary)?)?|priot%([_ ]syllabary|syllabary))|o%(ntrol%(pictures|[_ ]pictures)|unting%(rodnumerals|_rod_numerals| rod numerals)|m%(bining%(halfmarks|diacriticalmarks%(forsymbols|supplement)?| %(marks for symbols|half marks|diacritical marks%( %(for symbols|supplement))?)|marksforsymbols|_%(marks_for_symbols|half_marks|diacritical_marks%(_supplement)?))|mon%( indic number forms|indicnumberforms|_indic_number_forms))|ptic)|arian)|h%(i%(ragana|gh%(_%(private_use_surrogates|surrogates)| %(private use surrogates|surrogates)|surrogates|privateusesurrogates))|ebrew|a%(n%(unoo|gul%(jamo%(extended-[ab])?| %(jamo%( extended-[ab])?|syllables|compatibility jamo)|_%(syllables|jamo%(_extended_[ab])?|compatibility_jamo)|syllables|compatibilityjamo))|lfwidth%( and fullwidth forms|andfullwidthforms|_and_fullwidth_forms))))\}" contained display + +syntax match clojureRegexpPredefinedCharClass "\v%(\\[dDsSwW]|\.)" contained display +syntax cluster clojureRegexpCharPropertyClasses contains=clojureRegexpPosixCharClass,clojureRegexpJavaCharClass,clojureRegexpUnicodeCharClass +syntax cluster clojureRegexpCharClasses contains=clojureRegexpPredefinedCharClass,clojureRegexpCharClass,@clojureRegexpCharPropertyClasses +syntax region clojureRegexpCharClass start="\[" skip=/\\\\\|\\]/ end="]" contained contains=clojureRegexpPredefinedCharClass,@clojureRegexpCharPropertyClasses +syntax match clojureRegexpBoundary "\\[bBAGZz]" contained display +syntax match clojureRegexpBoundary "[$^]" contained display +syntax match clojureRegexpQuantifier "[?*+][?+]\=" contained display +syntax match clojureRegexpQuantifier "\v\{\d+%(,|,\d+)?}\??" contained display +syntax match clojureRegexpOr "|" contained display +syntax match clojureRegexpBackRef "\v\\%([1-9]\d*|k\<[a-zA-z]+\>)" contained display + +" Mode modifiers, mode-modified spans, lookaround, regular and atomic +" grouping, and named-capturing. +syntax match clojureRegexpMod "\v\(@<=\?:" contained display +syntax match clojureRegexpMod "\v\(@<=\?[xdsmiuU]*-?[xdsmiuU]+:?" contained display +syntax match clojureRegexpMod "\v\(@<=\?%(\)" contained display +syntax match clojureRegexpMod "\v\(@<=\?\<[a-zA-Z]+\>" contained display + +syntax region clojureRegexpGroup start="(" skip=/\\\\\|\\)/ end=")" matchgroup=clojureRegexpGroup contained contains=clojureRegexpMod,clojureRegexpQuantifier,clojureRegexpBoundary,clojureRegexpEscape,@clojureRegexpCharClasses +syntax region clojureRegexp start=/\#"/ skip=/\\\\\|\\"/ end=/"/ contains=@clojureRegexpCharClasses,clojureRegexpEscape,clojureRegexpQuote,clojureRegexpBoundary,clojureRegexpQuantifier,clojureRegexpOr,clojureRegexpBackRef,clojureRegexpGroup keepend + +syntax keyword clojureCommentTodo contained FIXME XXX TODO FIXME: XXX: TODO: + +syntax match clojureComment ";.*$" contains=clojureCommentTodo,@Spell syntax match clojureComment "#!.*$" -syntax match clojureComment "#_" - -syntax keyword clojureTodo contained FIXME XXX TODO FIXME: XXX: TODO: -syntax region clojureSexp matchgroup=clojureParen start="(" matchgroup=clojureParen end=")" contains=TOP,@Spell -syntax region clojureVector matchgroup=clojureParen start="\[" matchgroup=clojureParen end="\]" contains=TOP,@Spell -syntax region clojureMap matchgroup=clojureParen start="{" matchgroup=clojureParen end="}" contains=TOP,@Spell +syntax region clojureSexp matchgroup=clojureParen start="(" matchgroup=clojureParen end=")" contains=TOP,@Spell +syntax region clojureVector matchgroup=clojureParen start="\[" matchgroup=clojureParen end="]" contains=TOP,@Spell +syntax region clojureMap matchgroup=clojureParen start="{" matchgroup=clojureParen end="}" contains=TOP,@Spell " Highlight superfluous closing parens, brackets and braces. syntax match clojureError "]\|}\|)" syntax sync fromstart -if version >= 600 - command -nargs=+ HiLink highlight default link -else - command -nargs=+ HiLink highlight link -endif - -HiLink clojureConstant Constant -HiLink clojureBoolean Boolean -HiLink clojureCharacter Character -HiLink clojureKeyword Keyword -HiLink clojureNumber Number -HiLink clojureString String -HiLink clojureRegexp Constant - -HiLink clojureVariable Identifier -HiLink clojureCond Conditional -HiLink clojureDefine Define -HiLink clojureException Exception -HiLink clojureFunc Function -HiLink clojureMacro Macro -HiLink clojureRepeat Repeat - -HiLink clojureSpecial Special -HiLink clojureVarArg Special -HiLink clojureQuote SpecialChar -HiLink clojureUnquote SpecialChar -HiLink clojureMeta SpecialChar -HiLink clojureDeref SpecialChar -HiLink clojureAnonArg SpecialChar -HiLink clojureDispatch SpecialChar - -HiLink clojureComment Comment -HiLink clojureTodo Todo - -HiLink clojureError Error - -HiLink clojureParen Delimiter - -delcommand HiLink +highlight default link clojureConstant Constant +highlight default link clojureBoolean Boolean +highlight default link clojureCharacter Character +highlight default link clojureKeyword Keyword +highlight default link clojureNumber Number +highlight default link clojureString String +highlight default link clojureStringEscape Character + +highlight default link clojureRegexp Constant +highlight default link clojureRegexpEscape Character +highlight default link clojureRegexpCharClass SpecialChar +highlight default link clojureRegexpPosixCharClass clojureRegexpCharClass +highlight default link clojureRegexpJavaCharClass clojureRegexpCharClass +highlight default link clojureRegexpUnicodeCharClass clojureRegexpCharClass +highlight default link clojureRegexpPredefinedCharClass clojureRegexpCharClass +highlight default link clojureRegexpBoundary SpecialChar +highlight default link clojureRegexpQuantifier SpecialChar +highlight default link clojureRegexpMod SpecialChar +highlight default link clojureRegexpOr SpecialChar +highlight default link clojureRegexpBackRef SpecialChar +highlight default link clojureRegexpGroup clojureRegexp +highlight default link clojureRegexpQuoted clojureString +highlight default link clojureRegexpQuote clojureRegexpBoundary + +highlight default link clojureVariable Identifier +highlight default link clojureCond Conditional +highlight default link clojureDefine Define +highlight default link clojureException Exception +highlight default link clojureFunc Function +highlight default link clojureMacro Macro +highlight default link clojureRepeat Repeat + +highlight default link clojureSpecial Special +highlight default link clojureVarArg Special +highlight default link clojureQuote SpecialChar +highlight default link clojureUnquote SpecialChar +highlight default link clojureMeta SpecialChar +highlight default link clojureDeref SpecialChar +highlight default link clojureAnonArg SpecialChar +highlight default link clojureDispatch SpecialChar + +highlight default link clojureComment Comment +highlight default link clojureCommentTodo Todo + +highlight default link clojureError Error + +highlight default link clojureParen Delimiter let b:current_syntax = "clojure" -" vim:sts=4 sw=4 et: +" vim:sts=8:sw=8:ts=8:noet:smc=0 diff --git a/runtime/syntax/css.vim b/runtime/syntax/css.vim index 8b36b7232..daca2e052 100644 --- a/runtime/syntax/css.vim +++ b/runtime/syntax/css.vim @@ -6,7 +6,7 @@ " Nikolai Weibull (Add CSS2 support) " Maintainer: Jules Wang " URL: https://github.com/JulesWang/css.vim -" Last Change: 2013 Jul 23 +" Last Change: 2013 Aug 28 " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded @@ -21,6 +21,9 @@ elseif exists("b:current_syntax") && b:current_syntax == "css" finish endif +" Required for cssHacks +setlocal iskeyword-=_ + let s:cpo_save = &cpo set cpo&vim @@ -37,12 +40,12 @@ syn keyword cssTagName link map menu meta noframes noscript ol optgroup syn keyword cssTagName option p param pre q s samp script select small syn keyword cssTagName span strike strong style sub sup table tbody td syn keyword cssTagName textarea tfoot th thead title tr tt ul u var -syn keyword cssTagName object +syn keyword cssTagName object svg -" HTML5 new tags 5*6=30 -syn keyword cssTagName article aside audio bdi canvas command -syn keyword cssTagName datalist details embed figcaption figure footer -syn keyword cssTagName header hgroup keygen mark meter nav +" 34 HTML5 tags +syn keyword cssTagName article aside audio bdi canvas command data +syn keyword cssTagName datalist details dialog embed figcaption figure footer +syn keyword cssTagName header hgroup keygen main mark menuitem meter nav syn keyword cssTagName output progress rt rp ruby section syn keyword cssTagName source summary time track video wbr @@ -50,14 +53,12 @@ syn keyword cssTagName source summary time track video wbr syn keyword cssDeprecated acronym applet basefont big center dir syn keyword cssDeprecated font frame frameset noframes strike tt -"syn match cssTagName "\" syn match cssTagName "\*" " selectors -syn match cssSelectorOp "[,>+]" +syn match cssSelectorOp "[,>+~]" syn match cssSelectorOp2 "[~|^$*]\?=" contained -" FIXME: add HTML5 attribute -syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" transparent contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ +syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ " .class and #id syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+" @@ -68,26 +69,57 @@ catch /^.*/ syn match cssIdentifier "#[A-Za-z_@][A-Za-z0-9_@-]*" endtry -syn match cssTagName "@page\>" nextgroup=cssDefinition -" FIXME: use cssVendor here -syn match cssTagName "@\(-\(webkit\|moz\|o\|ms\)-\)\=keyframes\>" nextgroup=cssDefinition - -syn match cssMedia "@media\>" nextgroup=cssMediaType skipwhite skipnl -syn keyword cssMediaType contained screen print aural braile embosed handheld projection ty tv all nextgroup=cssMediaComma,cssMediaBlock skipwhite skipnl -"syn match cssMediaComma "," nextgroup=cssMediaType skipwhite skipnl -syn region cssMediaBlock transparent matchgroup=cssBraces start='{' end='}' contains=cssTagName,cssError,cssComment,cssDefinition,cssURL,cssUnicodeEscape,cssIdentifier - -syn match cssValueInteger contained "[-+]\=\d\+" -syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\=" -syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\)" -syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)" -syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)" -syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)" - +" digits +syn match cssValueInteger contained "[-+]\=\d\+" contains=cssUnitDecorators +syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\=" contains=cssUnitDecorators +syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\)" contains=cssUnitDecorators +syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)" contains=cssUnitDecorators +syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)" contains=cssUnitDecorators +syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)" contains=cssUnitDecorators + + +" @media +syn match cssMedia "@media\>" nextgroup=cssMediaType,cssMediaFeature,cssMediaBlock,cssMediaComma,cssMediaKeyword2 skipwhite skipnl +syn keyword cssMediaType contained screen print aural braille embossed handheld projection tty tv all contained skipwhite skipnl nextgroup=cssMediaFeature,cssMediaBlock +syn match cssMediaFeature /\(and\)\=\s*(.\{-})/ contained skipwhite skipnl contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor nextgroup=cssMediaFeature,cssMediaBlock,cssMediaComma +syn keyword cssMediaKeyword and contained +syn keyword cssMediaKeyword2 only not contained nextgroup=cssMediaType skipwhite skipnl + +syn region cssMediaBlock transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssTagName,cssClassName,cssIdentifier,cssPseudoClass,cssSelectorOp,cssSelectorOp2,cssAttributeSelector fold +syn match cssMediaComma "," nextgroup=cssMediaType,cssMediaKeyword2 skipwhite skipnl contained + +" Reference: http://www.w3.org/TR/css3-mediaqueries/ +syn keyword cssMediaProp contained width height orientation monochrome scan grid +syn match cssMediaProp contained /\(\(device\)-\)\=aspect-ratio/ +syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-pixel-ratio/ +syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-\(height\|width\)/ +syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|color\(-index\)\=\)/ +syn keyword cssMediaAttr contained portrait landscape progressive interlace + +" @page +syn match cssPage "@page\>" nextgroup=cssPagePseudo,cssDefinition skipwhite skipnl +syn match cssPagePseudo /:\(left\|right\|first\|\)/ nextgroup=cssDefinition contained skipwhite skipnl +syn match cssPageHeaderProp /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained +syn keyword cssPageProp content size contained + +" @keyframe +syn match cssKeyFrame "@\(-.*-\)\=keyframes\>\(\s*\<\S*\>\)\=" nextgroup=cssKeyFrameBlock contains=cssVendor skipwhite skipnl +syn region cssKeyFrameBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssKeyFrameSelector,cssDefinition +syn match cssKeyFrameSelector /\(\d*%\|from\|to\)\=/ contained skipwhite skipnl + +" @import +syn region cssInclude start=/@import\>/ end=/\ze;/ contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType,cssStringQ,cssStringQQ +syn region cssInclude start=/@charset\>/ end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment +syn region cssInclude start=/@namespace\>/ end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment + +" @font-face +" http://www.w3.org/TR/css3-fonts/#at-font-face-rule syn match cssFontDescriptor "@font-face\>" nextgroup=cssFontDescriptorBlock skipwhite skipnl syn region cssFontDescriptorBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssComment,cssError,cssUnicodeEscape,cssFontProp,cssFontAttr,cssCommonAttr,cssStringQ,cssStringQQ,cssFontDescriptorProp,cssValue.*,cssFontDescriptorFunction,cssUnicodeRange,cssFontDescriptorAttr -syn match cssFontDescriptorProp contained "\<\(unicode-range\|unit-per-em\|panose-1\|cap-height\|x-height\|definition-src\)\>" -syn keyword cssFontDescriptorProp contained src stemv stemh slope ascent descent widths bbox baseline centerline mathline topline +"syn match cssFontDescriptorProp contained "\<\(unicode-range\|unit-per-em\|panose-1\|cap-height\|x-height\|definition-src\)\>" +"syn keyword cssFontDescriptorProp contained src stemv stemh slope ascent descent widths bbox baseline centerline mathline topline +syn keyword cssFontDescriptorProp contained src +syn match cssFontDescriptorProp contained "\" syn keyword cssFontDescriptorAttr contained all syn region cssFontDescriptorFunction contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline keepend syn match cssUnicodeRange contained "U+[0-9A-Fa-f?]\+" @@ -124,7 +156,7 @@ syn keyword cssColor contained slategray slategrey snow springgreen steelblue ta syn keyword cssColor contained thistle tomato turquoise violet wheat syn keyword cssColor contained whitesmoke yellowgreen -" FIXME: These are actually case-insentivie too, but (a) specs recommend using +" FIXME: These are actually case-insensitive too, but (a) specs recommend using " mixed-case (b) it's hard to highlight the word `Background' correctly in " all situations syn case match @@ -135,48 +167,73 @@ syn match cssImportant contained "!\s*important\>" syn match cssColor contained "\" syn match cssColor contained "\" -syn match cssColor contained "#[0-9A-Fa-f]\{3\}\>" -syn match cssColor contained "#[0-9A-Fa-f]\{6\}\>" - -syn region cssURL contained matchgroup=cssFunctionName start="\" +syn match cssColor contained "#[0-9A-Fa-f]\{3\}\>" contains=cssUnitDecorators +syn match cssColor contained "#[0-9A-Fa-f]\{6\}\>" contains=cssUnitDecorators + +syn region cssURL contained matchgroup=cssFunctionName start="\