From 87a26c5bf169bafbee837e2323f24cfb07e35250 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 21 Dec 2021 14:41:23 +0100 Subject: Update --- autoload/ada.vim | 6 +-- autoload/clojurecomplete.vim | 4 +- autoload/csv.vim | 2 +- autoload/fsharp.vim | 65 +++++++++----------------- autoload/go/config.vim | 4 ++ autoload/julia_blocks.vim | 10 ++-- autoload/nim.vim | 6 ++- autoload/polyglot/ft.vim | 46 ++++++++++++++++-- autoload/polyglot/init.vim | 70 ++++++++++++++-------------- autoload/polyglot/sleuth.vim | 16 +++---- autoload/smt2/parser.vim | 2 +- autoload/unison.vim | 108 +++++++++++++++++++++++++++++++++++++++++++ 12 files changed, 235 insertions(+), 104 deletions(-) create mode 100644 autoload/unison.vim (limited to 'autoload') diff --git a/autoload/ada.vim b/autoload/ada.vim index 792fc03f..3d58cbb7 100644 --- a/autoload/ada.vim +++ b/autoload/ada.vim @@ -71,13 +71,13 @@ if exists ('g:ada_with_gnat_project_files') endfor endif -" Section: add standart exception {{{2 +" Section: add standard exception {{{2 " for Item in ['Constraint_Error', 'Program_Error', 'Storage_Error', 'Tasking_Error', 'Status_Error', 'Mode_Error', 'Name_Error', 'Use_Error', 'Device_Error', 'End_Error', 'Data_Error', 'Layout_Error', 'Length_Error', 'Pattern_Error', 'Index_Error', 'Translation_Error', 'Time_Error', 'Argument_Error', 'Tag_Error', 'Picture_Error', 'Terminator_Error', 'Conversion_Error', 'Pointer_Error', 'Dereference_Error', 'Update_Error'] let g:ada#Keywords += [{ \ 'word': Item, \ 'menu': 'exception', - \ 'info': 'Ada standart exception.', + \ 'info': 'Ada standard exception.', \ 'kind': 'x', \ 'icase': 1}] endfor @@ -214,7 +214,7 @@ function ada#Word (...) let l:Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' ) " Cope with tag searching for items in comments; if we are, don't loop - " backards looking for previous lines + " backwards looking for previous lines if l:Column_Nr > strlen(l:Line) " We were in a comment let l:Line = getline(l:Line_Nr) diff --git a/autoload/clojurecomplete.vim b/autoload/clojurecomplete.vim index ea2de428..bc352ccb 100644 --- a/autoload/clojurecomplete.vim +++ b/autoload/clojurecomplete.vim @@ -12,8 +12,8 @@ endif " -*- COMPLETION WORDS -*- " Generated from https://github.com/clojure-vim/clojure.vim/blob/%%RELEASE_TAG%%/clj/src/vim_clojure_static/generate.clj -" Clojure version 1.10.2 -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-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods",".","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","PrintWriter-on","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-tap","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","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","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","case-fallthrough-err-impl","cast","cat","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","completing","concat","cond","cond->","cond->>","condp","conj!","conj","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","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","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-cause","ex-data","ex-info","ex-message","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","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","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-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","monitor-enter","monitor-exit","munge","name","namespace","namespace-munge","nat-int?","neg-int?","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-int?","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","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","quote","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read+string","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","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-tap","remove-watch","repeat","repeatedly","replace","replicate","require","requiring-resolve","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seqable?","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","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","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!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","tap>","test","the-ns","thread-bound?","throw","time","to-array","to-array-2d","trampoline","transduce","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","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","uri?","use","uuid?","val","vals","var","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","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"] +" Clojure version 1.10.3 +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-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods",".","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","PrintWriter-on","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-tap","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","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","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","cast","cat","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","completing","concat","cond","cond->","cond->>","condp","conj!","conj","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","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","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-cause","ex-data","ex-info","ex-message","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","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","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-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","monitor-enter","monitor-exit","munge","name","namespace","namespace-munge","nat-int?","neg-int?","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-int?","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","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","quote","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read+string","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","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-tap","remove-watch","repeat","repeatedly","replace","replicate","require","requiring-resolve","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seqable?","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","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","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!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","tap>","test","the-ns","thread-bound?","throw","time","to-array","to-array-2d","trampoline","transduce","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","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","uri?","use","uuid?","val","vals","var","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","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 for special forms and public vars in clojure.core function! clojurecomplete#Complete(findstart, base) diff --git a/autoload/csv.vim b/autoload/csv.vim index 36a65dd3..34943bc7 100644 --- a/autoload/csv.vim +++ b/autoload/csv.vim @@ -2724,7 +2724,7 @@ fu! csv#Tabularize(bang, first, last) "{{{3 if getline(a:first)[-1:] isnot? b:delimiter let b:col_width[-1] += 1 endif - let marginline = s:td.scol. join(map(copy(b:col_width), 'repeat(s:td.hbar, v:val)'), s:td.cros). s:td.ecol + let marginline = s:td.scol. join(map(copy(b:col_width), 'repeat(s:td.hbar, v:val-1)'), s:td.cros). s:td.ecol call csv#NewDelimiter(s:td.vbar, 1, line('$')) "exe printf('sil %d,%ds/%s/%s/ge', a:first, (a:last+adjust_last), diff --git a/autoload/fsharp.vim b/autoload/fsharp.vim index d18f2bbc..5d8bb79d 100644 --- a/autoload/fsharp.vim +++ b/autoload/fsharp.vim @@ -3,7 +3,6 @@ if polyglot#init#is_disabled(expand(':p'), 'fsharp', 'autoload/fsharp.vim endif " Vim autoload functions - if exists('g:loaded_autoload_fsharp') finish endif @@ -240,14 +239,6 @@ function! fsharp#loadConfig() if !exists('g:fsharp#fsautocomplete_command') let s:fsac = fnamemodify(s:script_root_dir . "fsac/fsautocomplete.dll", ":p") - - " check if FSAC exists - if empty(glob(s:fsac)) - echoerr "FSAC not found. :FSharpUpdateFSAC to download." - let &cpo = s:cpo_save - finish - endif - let g:fsharp#fsautocomplete_command = \ ['dotnet', s:fsac, \ '--background-service-enabled' @@ -331,6 +322,29 @@ function! fsharp#loadConfig() endif endif + " FSI keymaps + if g:fsharp#fsi_keymap == "vscode" + if has('nvim') + let g:fsharp#fsi_keymap_send = "" + let g:fsharp#fsi_keymap_toggle = "" + else + let g:fsharp#fsi_keymap_send = "" + let g:fsharp#fsi_keymap_toggle = "@" + endif + elseif g:fsharp#fsi_keymap == "vim-fsharp" + let g:fsharp#fsi_keymap_send = "i" + let g:fsharp#fsi_keymap_toggle = "e" + elseif g:fsharp#fsi_keymap == "custom" + let g:fsharp#fsi_keymap = "none" + if !exists('g:fsharp#fsi_keymap_send') + echoerr "g:fsharp#fsi_keymap_send is not set" + elseif !exists('g:fsharp#fsi_keymap_toggle') + echoerr "g:fsharp#fsi_keymap_toggle is not set" + else + let g:fsharp#fsi_keymap = "custom" + endif + endif + let s:config_is_loaded = 1 endfunction @@ -398,39 +412,6 @@ endfunction " .NET/F# specific operations -function! s:findWorkspace(dir, cont) - let s:cont_findWorkspace = a:cont - function! s:callback_findWorkspace(result) - let result = a:result - let content = json_decode(result.result.content) - if len(content.Data.Found) < 1 - return [] - endif - let workspace = { 'Type': 'none' } - for found in content.Data.Found - if workspace.Type == 'none' - let workspace = found - elseif found.Type == 'solution' - if workspace.Type == 'project' - let workspace = found - else - let curLen = len(workspace.Data.Items) - let newLen = len(found.Data.Items) - if newLen > curLen - let workspace = found - endif - endif - endif - endfor - if workspace.Type == 'solution' - call s:cont_findWorkspace([workspace.Data.Path]) - else - call s:cont_findWorkspace(workspace.Data.Fsprojs) - endif - endfunction - call s:workspacePeek(a:dir, g:fsharp#workspace_mode_peek_deep_level, g:fsharp#exclude_project_directories, function("s:callback_findWorkspace")) -endfunction - let s:workspace = [] function! fsharp#handle_notifyWorkspace(payload) abort diff --git a/autoload/go/config.vim b/autoload/go/config.vim index f7389cdc..0ee1466f 100644 --- a/autoload/go/config.vim +++ b/autoload/go/config.vim @@ -215,6 +215,10 @@ function! go#config#DebugWindows() abort endfunction +function! go#config#DebugSubstitutePaths() abort + return get(g:, 'go_debug_substitute_paths', []) +endfunction + function! go#config#DebugPreserveLayout() abort return get(g:, 'go_debug_preserve_layout', 0) endfunction diff --git a/autoload/julia_blocks.vim b/autoload/julia_blocks.vim index 6a0c05c9..11bbb435 100644 --- a/autoload/julia_blocks.vim +++ b/autoload/julia_blocks.vim @@ -339,7 +339,7 @@ function! s:on_begin() let [l,c] = [line('.'), col('.')] normal! ^ let patt = '\%<'.(c+1).'c\(' . b:julia_begin_keywordsm . '\)\%>'.(c-1).'c' - let n = search(patt, 'Wnc', l) + let n = search('\C' . patt, 'Wnc', l) call cursor(l, c) return n > 0 endfunction @@ -350,7 +350,7 @@ function! s:matchit() endfunction function! s:move_before_begin() - call search(b:julia_begin_keywordsm, 'Wbc') + call search('\C' . b:julia_begin_keywordsm, 'Wbc') normal! h endfunction @@ -382,7 +382,7 @@ function! s:moveto_block_delim(toend, backwards, ...) normal! bh endif while 1 - let searchret = search(pattern, flags) + let searchret = search('\C' . pattern, flags) if !searchret return ret endif @@ -473,7 +473,7 @@ function! s:moveto_currentblock_end() normal! b endif - let ret = searchpair(b:julia_begin_keywordsm, '', b:julia_end_keywords, flags, b:match_skip) + let ret = searchpair('\C' . b:julia_begin_keywordsm, '', '\C' . b:julia_end_keywords, flags, b:match_skip) if ret <= 0 return s:abort() endif @@ -679,7 +679,7 @@ function! s:find_block(current_mode) normal! l normal! b endif - let searchret = searchpair(b:julia_begin_keywordsm, '', b:julia_end_keywords, flags, b:match_skip) + let searchret = searchpair('\C' . b:julia_begin_keywordsm, '', '\C' . b:julia_end_keywords, flags, b:match_skip) if searchret <= 0 if !b:jlblk_did_select return s:abort() diff --git a/autoload/nim.vim b/autoload/nim.vim index c0faf6e1..7f55f25f 100644 --- a/autoload/nim.vim +++ b/autoload/nim.vim @@ -23,8 +23,8 @@ fun! nim#init() abort if !v:shell_error && expand('%:e') ==# 'nim' let false = 0 " Needed for eval of json let true = 1 " Needed for eval of json - let dumpdata = eval(substitute(raw_dumpdata, "\n", '', 'g')) - + let dumpdata = json_decode(raw_dumpdata) + let b:nim_project_root = dumpdata['project_path'] let b:nim_defined_symbols = dumpdata['defined_symbols'] let b:nim_caas_enabled = g:nim_caas_enabled || index(dumpdata['defined_symbols'], 'forcecaas') != -1 @@ -211,7 +211,9 @@ fun! GotoDefinition_nim_ready(def_output) abort let defBits = split(rawDef, '\t') let file = defBits[4] let line = defBits[5] + let column = defBits[6] exe printf('e +%d %s', line, file) + call cursor(line, column + 1) return 1 endf diff --git a/autoload/polyglot/ft.vim b/autoload/polyglot/ft.vim index e4c32415..56012da1 100644 --- a/autoload/polyglot/ft.vim +++ b/autoload/polyglot/ft.vim @@ -1,7 +1,7 @@ " Vim functions for file type detection " " Maintainer: Bram Moolenaar -" Last Change: 2020 Aug 17 +" Last Change: 2021 Nov 27 " These functions are moved here from runtime/filetype.vim to make startup " faster. @@ -219,6 +219,23 @@ func polyglot#ft#FTe() endif endfunc +" Distinguish between Forth and F#. +" Provided by Doug Kearns. +func polyglot#ft#FTfs() + if exists("g:filetype_fs") + exe "setf " . g:filetype_fs + else + let line = getline(nextnonblank(1)) + " comments and colon definitions + if line =~ '^\s*\.\=( ' || line =~ '^\s*\\G\= ' || line =~ '^\\$' + \ || line =~ '^\s*: \S' + setf forth + else + setf fsharp + endif + endif +endfunc + " Distinguish between HTML, XHTML and Django func polyglot#ft#FThtml() let n = 1 @@ -269,7 +286,10 @@ func polyglot#ft#FTm() return endif - let octave_block_terminators = '\' + " excluding end(for|function|if|switch|while) common to Murphi + let octave_block_terminators = '\' + + let objc_preprocessor = '^\s*#\s*\%(import\|include\|define\|if\|ifn\=def\|undef\|line\|error\|pragma\)\>' let n = 1 let saw_comment = 0 " Whether we've seen a multiline comment leader. @@ -281,12 +301,11 @@ func polyglot#ft#FTm() " anything more definitive. let saw_comment = 1 endif - if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|//\)' + if line =~ '^\s*//' || line =~ '^\s*@import\>' || line =~ objc_preprocessor setf objc return endif - if line =~ '^\s*\%(#\|%!\|[#%]{\=\s*$\)' || - \ line =~ '^\s*unwind_protect\>' || + if line =~ '^\s*\%(#\|%!\)' || line =~ '^\s*unwind_protect\>' || \ line =~ '\%(^\|;\)\s*' .. octave_block_terminators setf octave return @@ -792,6 +811,23 @@ func polyglot#ft#Redif() endwhile endfunc +" This function is called for all files under */debian/patches/*, make sure not +" to non-dep3patch files, such as README and other text files. +func polyglot#ft#Dep3patch() + if expand('%:t') ==# 'series' + return + endif + + for ln in getline(1, 100) + if ln =~# '^\%(Description\|Subject\|Origin\|Bug\|Forwarded\|Author\|From\|Reviewed-by\|Acked-by\|Last-Updated\|Applied-Upstream\):' + setf dep3patch + return + elseif ln =~# '^---' + " end of headers found. stop processing + return + endif + endfor +endfunc " Restore 'cpoptions' let &cpo = s:cpo_save diff --git a/autoload/polyglot/init.vim b/autoload/polyglot/init.vim index fcba050f..1457f11a 100644 --- a/autoload/polyglot/init.vim +++ b/autoload/polyglot/init.vim @@ -1769,10 +1769,6 @@ if !has_key(g:polyglot_is_disabled, 'gitignore') au BufNewFile,BufRead *.git/info/exclude,*/.config/git/ignore,{.,}gitignore setf gitignore endif -if !has_key(g:polyglot_is_disabled, 'tads') - au! BufNewFile,BufRead,BufWritePost *.t call polyglot#detect#T() -endif - if !has_key(g:polyglot_is_disabled, 'prolog') au! BufNewFile,BufRead,BufWritePost *.pl call polyglot#detect#Pl() au BufNewFile,BufRead *.pdb,*.pro,*.prolog,*.yap setf prolog @@ -1787,7 +1783,7 @@ if !has_key(g:polyglot_is_disabled, 'odin') endif if !has_key(g:polyglot_is_disabled, 'dosini') - au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*/etc/pacman.conf,*/etc/yum.conf,{.,}editorconfig,{.,}npmrc,buildozer.spec setf dosini + au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*/etc/pacman.conf,*/etc/yum.conf,{.,}editorconfig,{.,}flake8,{.,}npmrc,buildozer.spec setf dosini au BufNewFile,BufRead php.ini-* call s:StarSetf('dosini') au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini') endif @@ -1961,7 +1957,7 @@ if !has_key(g:polyglot_is_disabled, 'slim') endif if !has_key(g:polyglot_is_disabled, 'sh') - au BufNewFile,BufRead *.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh,*.sh.in,*.tmux,*.tool,*/etc/udev/cdsymlinks.conf,{.,}bash_aliases,{.,}bash_history,{.,}bash_logout,{.,}bash_profile,{.,}bashrc,{.,}cshrc,{.,}env,{.,}env.example,{.,}flaskenv,{.,}login,{.,}profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,login,man,profile setf sh + au BufNewFile,BufRead *.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh,*.sh.in,*.tmux,*.tool,*/etc/udev/cdsymlinks.conf,{.,}bash_aliases,{.,}bash_history,{.,}bash_logout,{.,}bash_profile,{.,}bashrc,{.,}cshrc,{.,}env,{.,}env.example,{.,}flaskenv,{.,}kshrc,{.,}login,{.,}profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile setf sh au BufNewFile,BufRead *.zsh,*/etc/zprofile,{.,}zfbfmarks,{.,}zlogin,{.,}zlogout,{.,}zprofile,{.,}zshenv,{.,}zshrc setf zsh au BufNewFile,BufRead .zsh* call s:StarSetf('zsh') au BufNewFile,BufRead .zlog* call s:StarSetf('zsh') @@ -2011,13 +2007,6 @@ if !has_key(g:polyglot_is_disabled, 'raml') au BufNewFile,BufRead *.raml setf raml endif -if !has_key(g:polyglot_is_disabled, 'raku') - au! BufNewFile,BufRead,BufWritePost *.t call polyglot#detect#T() - au! BufNewFile,BufRead,BufWritePost *.pm call polyglot#detect#Pm() - au! BufNewFile,BufRead,BufWritePost *.pl call polyglot#detect#Pl() - au BufNewFile,BufRead *.6pl,*.6pm,*.nqp,*.p6,*.p6l,*.p6m,*.pl6,*.pm6,*.pod6,*.raku,*.rakudoc,*.rakumod,*.rakutest,*.t6 setf raku -endif - if !has_key(g:polyglot_is_disabled, 'ragel') au BufNewFile,BufRead *.rl setf ragel endif @@ -2097,22 +2086,6 @@ if !has_key(g:polyglot_is_disabled, 'pgsql') au BufNewFile,BufRead *.pgsql let b:sql_type_override='pgsql' | set ft=sql endif -if !has_key(g:polyglot_is_disabled, 'perl') - au! BufNewFile,BufRead,BufWritePost *.t call polyglot#detect#T() - au! BufNewFile,BufRead,BufWritePost *.pm call polyglot#detect#Pm() - au! BufNewFile,BufRead,BufWritePost *.pl call polyglot#detect#Pl() - au BufNewFile,BufRead *.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.psgi,{.,}gitolite.rc,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc setf perl - au BufNewFile,BufRead *.pod setf pod - au BufNewFile,BufRead *.comp,*.mason,*.mhtml setf mason - au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2() - au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2() - au BufNewFile,BufRead *.xs setf xs -endif - -if !has_key(g:polyglot_is_disabled, 'rc') - au BufNewFile,BufRead *.rc,*.rch setf rc -endif - if !has_key(g:polyglot_is_disabled, 'opencl') au BufNewFile,BufRead *.cl,*.opencl setf opencl endif @@ -2225,7 +2198,34 @@ if !has_key(g:polyglot_is_disabled, 'julia') endif if !has_key(g:polyglot_is_disabled, 'jst') - au BufNewFile,BufRead *.ect,*.ejs,*.jst setf jst + au BufNewFile,BufRead *.ect,*.ejs,*.ejs.t,*.jst setf jst +endif + +if !has_key(g:polyglot_is_disabled, 'tads') + au! BufNewFile,BufRead,BufWritePost *.t call polyglot#detect#T() +endif + +if !has_key(g:polyglot_is_disabled, 'raku') + au! BufNewFile,BufRead,BufWritePost *.t call polyglot#detect#T() + au! BufNewFile,BufRead,BufWritePost *.pm call polyglot#detect#Pm() + au! BufNewFile,BufRead,BufWritePost *.pl call polyglot#detect#Pl() + au BufNewFile,BufRead *.6pl,*.6pm,*.nqp,*.p6,*.p6l,*.p6m,*.pl6,*.pm6,*.pod6,*.raku,*.rakudoc,*.rakumod,*.rakutest,*.t6 setf raku +endif + +if !has_key(g:polyglot_is_disabled, 'perl') + au! BufNewFile,BufRead,BufWritePost *.t call polyglot#detect#T() + au! BufNewFile,BufRead,BufWritePost *.pm call polyglot#detect#Pm() + au! BufNewFile,BufRead,BufWritePost *.pl call polyglot#detect#Pl() + au BufNewFile,BufRead *.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.psgi,{.,}gitolite.rc,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc setf perl + au BufNewFile,BufRead *.pod setf pod + au BufNewFile,BufRead *.comp,*.mason,*.mhtml setf mason + au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2() + au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2() + au BufNewFile,BufRead *.xs setf xs +endif + +if !has_key(g:polyglot_is_disabled, 'rc') + au BufNewFile,BufRead *.rc,*.rch setf rc endif if !has_key(g:polyglot_is_disabled, 'jsonnet') @@ -2339,7 +2339,7 @@ endif if !has_key(g:polyglot_is_disabled, 'glsl') au! BufNewFile,BufRead,BufWritePost *.fs call polyglot#detect#Fs() - au BufNewFile,BufRead *.comp,*.fp,*.frag,*.frg,*.fsh,*.fshader,*.geo,*.geom,*.glsl,*.glslf,*.glslv,*.gs,*.gshader,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader setf glsl + au BufNewFile,BufRead *.comp,*.fp,*.frag,*.frg,*.fsh,*.fshader,*.geo,*.geom,*.glsl,*.glslf,*.glslv,*.gs,*.gshader,*.rchit,*.rmiss,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader setf glsl endif if !has_key(g:polyglot_is_disabled, 'git') @@ -2398,7 +2398,7 @@ endif if !has_key(g:polyglot_is_disabled, 'elixir') au BufNewFile,BufRead *.ex,*.exs,mix.lock setf elixir - au BufNewFile,BufRead *.eex,*.html.leex,*.leex setf eelixir + au BufNewFile,BufRead *.eex,*.html.heex,*.html.leex,*.leex setf eelixir endif if !has_key(g:polyglot_is_disabled, 'docker-compose') @@ -2406,7 +2406,7 @@ if !has_key(g:polyglot_is_disabled, 'docker-compose') endif if !has_key(g:polyglot_is_disabled, 'yaml') - au BufNewFile,BufRead *.mir,*.reek,*.rviz,*.sublime-syntax,*.syntax,*.yaml,*.yaml-tmlanguage,*.yaml.sed,*.yml,*.yml.mysql,{.,}clang-format,{.,}clang-tidy,{.,}gemrc,fish_history,fish_read_history,glide.lock,yarn.lock setf yaml + au BufNewFile,BufRead *.mir,*.reek,*.rviz,*.sublime-syntax,*.syntax,*.yaml,*.yaml-tmlanguage,*.yaml.sed,*.yml,*.yml.mysql,{.,}clang-format,{.,}clang-tidy,{.,}gemrc,CITATION.cff,fish_history,fish_read_history,glide.lock,yarn.lock setf yaml endif if !has_key(g:polyglot_is_disabled, 'mysql') @@ -2534,7 +2534,7 @@ endif if !has_key(g:polyglot_is_disabled, 'c/c++') au! BufNewFile,BufRead,BufWritePost *.h call polyglot#detect#H() - au BufNewFile,BufRead *.c++,*.cc,*.cp,*.cpp,*.cxx,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.moc,*.tcc,*.tlh,*.tpp setf cpp + au BufNewFile,BufRead *.c++,*.cc,*.cp,*.cpp,*.cxx,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.ixx,*.moc,*.tcc,*.tlh,*.tpp setf cpp au! BufNewFile,BufRead,BufWritePost *.h call polyglot#detect#H() au BufNewFile,BufRead *.c,*.cats,*.idc,*.qc,*enlightenment/*.cfg setf c endif @@ -2575,7 +2575,7 @@ if !has_key(g:polyglot_is_disabled, 'ant') endif if !has_key(g:polyglot_is_disabled, 'xml') - au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.tpm,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wpl,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*/etc/blkid.tab,*/etc/blkid.tab.old,*/etc/xdg/menus/*.menu,*fglrxrc,{.,}classpath,{.,}cproject,{.,}project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config setf xml + au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.tpm,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wpl,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*/etc/blkid.tab,*/etc/blkid.tab.old,*/etc/xdg/menus/*.menu,*fglrxrc,{.,}classpath,{.,}cproject,{.,}project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config setf xml endif if !has_key(g:polyglot_is_disabled, 'csv') diff --git a/autoload/polyglot/sleuth.vim b/autoload/polyglot/sleuth.vim index e3c0752e..9e943079 100644 --- a/autoload/polyglot/sleuth.vim +++ b/autoload/polyglot/sleuth.vim @@ -85,7 +85,7 @@ let s:globs = { \ 'conf': '*.conf,auto.master,config', \ 'config': 'configure.in,configure.ac,Pipfile', \ 'context': '*.mkii,*.mkiv,*.mkvi', - \ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.tcc,*.tpp,*.moc,*.tlh', + \ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.ixx,*.tcc,*.tpp,*.moc,*.tlh', \ 'cql': '*.cql', \ 'crm': '*.crm', \ 'crontab': 'crontab,crontab.*', @@ -129,7 +129,7 @@ let s:globs = { \ 'dnsmasq': '', \ 'dockerfile': '*.Dockerfile,*.dock,Containerfile,Dockerfile,dockerfile,Dockerfile*', \ 'dosbatch': '*.bat,*.sys', - \ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,buildozer.spec,.editorconfig,.npmrc,php.ini-*', + \ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,.flake8,buildozer.spec,.editorconfig,.npmrc,php.ini-*', \ 'dot': '*.dot,*.gv', \ 'dracula': '*.drac,*.drc,*lvs,*lpe,drac.*', \ 'dsdl': '*.sdl', @@ -143,7 +143,7 @@ let s:globs = { \ 'ecd': '*.ecd', \ 'ecrystal': '*.ecr', \ 'edif': '*.ed\(f\|if\|o\)', - \ 'eelixir': '*.eex,*.html.leex,*.leex', + \ 'eelixir': '*.eex,*.html.heex,*.html.leex,*.leex', \ 'elf': '*.am', \ 'elinks': 'elinks.conf', \ 'elixir': '*.ex,*.exs,mix.lock', @@ -190,7 +190,7 @@ let s:globs = { \ 'gitsendemail': '.gitsendemail.*', \ 'gkrellmrc': 'gkrellmrc,gkrellmrc_?', \ 'gleam': '*.gleam', - \ 'glsl': '*.glsl,*.fp,*.frag,*.frg,*.fs,*.fsh,*.fshader,*.geo,*.geom,*.glslf,*.glslv,*.gs,*.gshader,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader,*.comp', + \ 'glsl': '*.glsl,*.fp,*.frag,*.frg,*.fs,*.fsh,*.fshader,*.geo,*.geom,*.glslf,*.glslv,*.gs,*.gshader,*.rchit,*.rmiss,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader,*.comp', \ 'gmpl': '*.mod', \ 'gnash': 'gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc', \ 'gnuplot': '*.gp,*.gnu,*.gnuplot,*.p,*.plot,*.plt,*.gpi', @@ -265,7 +265,7 @@ let s:globs = { \ 'jsonc': '*.cjson,*.jsonc,coc-settings.json,.eslintrc.json,.babelrc,.jshintrc,.jslintrc,.mocharc.json,coffeelint.json,tsconfig.json,jsconfig.json', \ 'jsonnet': '*.jsonnet,*.libsonnet', \ 'jsp': '*.jsp', - \ 'jst': '*.ejs,*.ect,*.jst', + \ 'jst': '*.ejs,*.ect,*.ejs.t,*.jst', \ 'julia': '*.jl', \ 'just': '*.just,justfile', \ 'kconfig': 'Kconfig,Kconfig.debug,Kconfig.*', @@ -480,7 +480,7 @@ let s:globs = { \ 'services': '', \ 'setserial': '', \ 'sexplib': '*.sexp', - \ 'sh': '*.sh,*.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh.in,*.tmux,*.tool,.bash_aliases,.bash_history,.bash_logout,.bash_profile,.bashrc,.cshrc,.env,.env.example,.flaskenv,.login,.profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,login,man,profile', + \ 'sh': '*.sh,*.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh.in,*.tmux,*.tool,.bash_aliases,.bash_history,.bash_logout,.bash_profile,.bashrc,.cshrc,.env,.env.example,.flaskenv,.kshrc,.login,.profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile', \ 'sieve': '*.siv,*.sieve', \ 'sil': '*.sil', \ 'simula': '*.sim', @@ -611,7 +611,7 @@ let s:globs = { \ 'xhtml': '*.xhtml,*.xht', \ 'xinetd': '', \ 'xmath': '*.msc,*.msf', - \ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,.classpath,.cproject,.project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config,*fglrxrc', + \ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,.classpath,.cproject,.project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config,*fglrxrc', \ 'xml.twig': '*.xml.twig', \ 'xmodmap': '*Xmodmap,*xmodmap*', \ 'xpm': '*.xpm,*.pm', @@ -622,7 +622,7 @@ let s:globs = { \ 'xsl': '*.xslt,*.xsl', \ 'xslt': '*.xsl,*.xslt', \ 'yacc': '*.yy,*.yxx,*.y++', - \ 'yaml': '*.yml,*.mir,*.reek,*.rviz,*.sublime-syntax,*.syntax,*.yaml,*.yaml-tmlanguage,*.yaml.sed,*.yml.mysql,.clang-format,.clang-tidy,.gemrc,glide.lock,yarn.lock,fish_history,fish_read_history', + \ 'yaml': '*.yml,*.mir,*.reek,*.rviz,*.sublime-syntax,*.syntax,*.yaml,*.yaml-tmlanguage,*.yaml.sed,*.yml.mysql,.clang-format,.clang-tidy,.gemrc,CITATION.cff,glide.lock,yarn.lock,fish_history,fish_read_history', \ 'yaml.ansible': 'playbook.y{a,}ml,site.y{a,}ml,main.y{a,}ml,local.y{a,}ml,requirements.y{a,}ml,tasks.*.y{a,}ml,roles.*.y{a,}ml,handlers.*.y{a,}ml', \ 'yaml.docker-compose': 'docker-compose*.yaml,docker-compose*.yml', \ 'z8a': '*.z8a', diff --git a/autoload/smt2/parser.vim b/autoload/smt2/parser.vim index ef4068e5..b9e4837f 100644 --- a/autoload/smt2/parser.vim +++ b/autoload/smt2/parser.vim @@ -157,7 +157,7 @@ def ParseSExpr(scanner: dict): dict scanner->ParseLParen() # Expr* - var exprs: list + var exprs: list> while scanner->AtStartOfExpr() exprs->add(scanner->ParseExpr()) endwhile diff --git a/autoload/unison.vim b/autoload/unison.vim new file mode 100644 index 00000000..cdc2efe5 --- /dev/null +++ b/autoload/unison.vim @@ -0,0 +1,108 @@ +if polyglot#init#is_disabled(expand(':p'), 'unison', 'autoload/unison.vim') + finish +endif + +" Unison functionality for Vim, including type/term omnicompletion. +" +" Maintainer: Unison Computing +" Original Author: Cody Allen (ceedubs) + +if exists('g:autoloaded_unison') + finish +endif +let g:autoloaded_unison = 1 + +let s:required_config_value = "!REQUIRED!" + +" adapted from https://github.com/rust-lang/rust.vim/blob/4aa69b84c8a58fcec6b6dad6fe244b916b1cf830/autoload/rust.vim#L9-L18 +function! s:config(name, default) abort + let name = 'unison_' . a:name + " Local buffer variable with same name takes predeence over global + if has_key(b:, name) + return get(b:, name) + elseif has_key(g:, name) + return get(g:, name) + elseif a:default == s:required_config_value + throw 'Missing required configuration value: ' . name + else + return a:default + endif +endfunction + +function! s:curl_path() abort + return s:config('curl_path', "curl") +endfunction + +function! s:jq_path() abort + return s:config('jq_path', "jq") +endfunction + +function! unison#SetBufferDefaults() abort + if s:config('set_buffer_defaults', 1) + " Since Unison completion is fuzzy and not prefix-based, 'longest' doesn't + " work well, and 'noinsert' behaves a little better. + setlocal completeopt=menuone,noinsert,preview + + setlocal omnifunc=unison#Complete + endif +endfunction + +" Unison completion satisfying the standard vim completion signature, such +" that it can be assigned to omnifunc. +" vim will first call this to find the base input that should be completed, +" and then will call it again with the base input. +function! unison#Complete(findstart, base) abort + if a:findstart + " locate the start of the word + let line = getline('.') + let start = col('.') - 1 + while start > 0 && line[start - 1] !~ '\s' && line[start - 1] != '(' && line[start - 1] != ')' + let start -= 1 + endwhile + return start + else + return unison#CompleteForBase(a:base) + endif +endfunction + +" Return an array of completion items for the provided base input. For example +" base could be 'List.foldL', in which case the top result would probably be +" 'List.foldLeft'. +function! unison#CompleteForBase(base) abort + let resultLimit = s:config('complete_result_limit', 20) + let apiHost = s:config('api_host', 'localhost') + let apiPort = s:config('api_port', s:required_config_value) + let apiToken = s:config('api_token', s:required_config_value) + let apiUri = 'http://' . apiHost . ':' . apiPort . '/' . apiToken . '/api/find' + + let curlCommand = s:curl_path() . " -Gfs + \ --data-urlencode 'limit=" . resultLimit . "' + \ --data-urlencode 'query=" . a:base . "' " + \ . apiUri + + let jqFilter = ' + \ def prettyTermType: .termType|[(.[] | .segment)]|add; + \ def prettyTypeDef: if .tag == "BuiltinObject" then "builtin type " else "" end + (.contents|[(.[] | .segment)]|add); + \ def termToMatch: { + \ word: .bestFoundTermName, + \ info: (.namedTerm.termName + " : " + (.namedTerm|prettyTermType)), + \ menu: .namedTerm|prettyTermType + \ }; + \ def typeToMatch: { + \ word: .bestFoundTypeName, + \ info: (.namedType.typeName + " : " + (.typeDef|prettyTypeDef)), + \ menu: .typeDef|prettyTypeDef + \ }; + \ .[][1]|( + \ (select(.tag == "FoundTermResult")|.contents|termToMatch), + \ (select(.tag == "FoundTypeResult")|.contents|typeToMatch) + \ )' + + let command = curlCommand . " | " . s:jq_path() . " -c '" . jqFilter . "'" + let lines = system(command) + let resultObjects = split(lines, "\n") + call map(resultObjects, {_, val -> json_decode(val)}) + return resultObjects +endfunction + +" vim: set et sw=2 sts=2 ts=2: -- cgit v1.2.3