From bc8a81d3592dab86334f27d1d43c080ebf680d42 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 14 Oct 2022 17:40:10 +0200 Subject: Update --- autoload/LaTeXtoUnicode.vim | 2 +- autoload/clojurecomplete.vim | 2 +- autoload/coc/source/requirements.vim | 24 +++++++++ autoload/crystal/indent.vim | 6 +-- autoload/csv.vim | 11 ++-- autoload/dart.vim | 98 +++++++++++++++++++++++------------- autoload/fsharp.vim | 2 +- autoload/ledger.vim | 28 ++++++++--- autoload/polyglot/init.vim | 18 +++---- autoload/polyglot/shebang.vim | 1 + autoload/polyglot/sleuth.vim | 15 +++--- autoload/requirements.vim | 70 +++++++++++++++----------- autoload/requirements/utils.vim | 15 ++++++ 13 files changed, 191 insertions(+), 101 deletions(-) create mode 100644 autoload/coc/source/requirements.vim create mode 100644 autoload/requirements/utils.vim (limited to 'autoload') diff --git a/autoload/LaTeXtoUnicode.vim b/autoload/LaTeXtoUnicode.vim index 86420cca..b512a734 100644 --- a/autoload/LaTeXtoUnicode.vim +++ b/autoload/LaTeXtoUnicode.vim @@ -348,7 +348,7 @@ endfunction " be reinstated if needed. function! s:L2U_SetFallbackMapping(s, k) let mmdict = maparg(a:s, 'i', 0, 1) - if empty(mmdict) + if empty(mmdict) || !has_key(mmdict, "rhs") exe 'inoremap ' . a:k . ' ' . a:s return mmdict endif diff --git a/autoload/clojurecomplete.vim b/autoload/clojurecomplete.vim index e5dfb205..31065c1f 100644 --- a/autoload/clojurecomplete.vim +++ b/autoload/clojurecomplete.vim @@ -12,7 +12,7 @@ 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.11.0 +" Clojure version 1.11.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-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","NaN?","PrintWriter-on","StackTraceElement->vec","Throwable->map","abs","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*","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","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","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?","infinite?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iteration","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","let*","letfn","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","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","parse-boolean","parse-double","parse-long","parse-uuid","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","random-uuid","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","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-to-map-for-destructuring","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","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-keys","update-proxy","update-vals","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 diff --git a/autoload/coc/source/requirements.vim b/autoload/coc/source/requirements.vim new file mode 100644 index 00000000..c2c64dbd --- /dev/null +++ b/autoload/coc/source/requirements.vim @@ -0,0 +1,24 @@ +if polyglot#init#is_disabled(expand(':p'), 'requirements', 'autoload/coc/source/requirements.vim') + finish +endif + +"" +" https://github.com/neoclide/coc.nvim/wiki/Create-custom-source +function! coc#source#requirements#init() abort + return { + \ 'shortcut': 'pip', + \ 'priority': 9, + \ 'filetypes': ['requirements'], + \ } +endfunction + +"" +" https://github.com/neoclide/coc.nvim/wiki/Create-custom-source +" +" Completion pip option and PYPI package names. +" Note: completion PYPI package names need install pip-cache from PYPI, +" and run `pip-cache update` first to generate cache. +function! coc#source#requirements#complete(opt, cb) abort + call a:cb(g:requirements#items) +endfunction +" vim: et sw=4 ts=4 sts=4: diff --git a/autoload/crystal/indent.vim b/autoload/crystal/indent.vim index 3e8b07e5..4e9ddcf7 100644 --- a/autoload/crystal/indent.vim +++ b/autoload/crystal/indent.vim @@ -96,7 +96,7 @@ lockvar g:crystal#indent#block_regex " Regex that defines the beginning of a hanging expression. let g:crystal#indent#hanging_assignment_regex = \ '\%('.g:crystal#indent#operator_regex.'\s*\)\@<=' . - \ '\.\@1' + \ '\.\@1' lockvar g:crystal#indent#hanging_assignment_regex " Regex that defines the start-match for the 'end' keyword. @@ -107,7 +107,7 @@ let g:crystal#indent#end_start_regex = \ '\%(\<\%(private\|protected\)\s\+\)\=' . \ '\%(\<\%(abstract\s\+\)\=\%(class\|struct\)\>\|\<\%(def\|module\|macro\|lib\|enum\|annotation\)\>\)' . \ '\|' . - \ '\<\%(if\|unless\|while\|until\|case\|begin\|union\)\>' . + \ '\<\%(if\|unless\|while\|until\|case\|begin\|union\|select\)\>' . \ '\)' . \ '\|' . \ g:crystal#indent#hanging_assignment_regex . @@ -1042,4 +1042,4 @@ endfunction " }}}1 -" vim:sw=2 sts=2 ts=8 fdm=marker et: \ No newline at end of file +" vim:sw=2 sts=2 ts=8 fdm=marker et: diff --git a/autoload/csv.vim b/autoload/csv.vim index ba04d2bc..4111f6ed 100644 --- a/autoload/csv.vim +++ b/autoload/csv.vim @@ -826,8 +826,8 @@ fu! csv#Columnize(field) "{{{3 let colnr = s:columnize_count % s:max_cols let width = get(b:col_width, colnr, 20) let align = 'r' - if exists('b:csv_arrange_align') - let align=b:csv_arrange_align + if exists('b:csv_arrange_align') || exists('g:csv_arrange_align') + let align=get(b:, 'csv_arrange_align', g:csv_arrange_align) let indx=match(align, '\*') if indx > 0 let align = align[0:(indx-1)]. repeat(align[indx-1], len(b:col_width)-indx) @@ -934,6 +934,11 @@ fu! csv#GetColPat(colnr, zs_flag) "{{{3 endfu fu! csv#SetupAutoCmd(window,bufnr) "{{{3 " Setup QuitPre autocommand to quit cleanly + if a:bufnr == 0 + " something went wrong, + " how can this happen? + return + endif aug CSV_QuitPre au! exe "au QuitPre * call CSV_CloseBuffer(".winbufnr(a:window).")" @@ -1024,7 +1029,7 @@ fu! csv#SplitHeaderLine(lines, bang, hor) "{{{3 " disable airline let w:airline_disabled = 1 let win = winnr() - setl scrollbind buftype=nowrite bufhidden=wipe noswapfile nobuflisted + setl scrollbind buftype=nofile bufhidden=wipe noswapfile nobuflisted noa wincmd p let b:csv_SplitWindow = win aug CSV_Preview diff --git a/autoload/dart.vim b/autoload/dart.vim index 28e55552..09ca49e0 100644 --- a/autoload/dart.vim +++ b/autoload/dart.vim @@ -92,9 +92,9 @@ endfunction " Finds the path to `uri`. " -" If the file is a package: uri, looks for a .packages file to resolve the path. -" If the path cannot be resolved, or is not a package: uri, returns the -" original. +" If the file is a package: uri, looks for a package_config.json or .packages +" file to resolve the path. If the path cannot be resolved, or is not a +" package: uri, returns the original. function! dart#resolveUri(uri) abort if a:uri !~# 'package:' return a:uri @@ -102,7 +102,7 @@ function! dart#resolveUri(uri) abort let package_name = substitute(a:uri, 'package:\(\w\+\)\/.*', '\1', '') let [found, package_map] = s:PackageMap() if !found - call s:error('cannot find .packages file') + call s:error('cannot find .packages or package_config.json file') return a:uri endif if !has_key(package_map, package_name) @@ -116,37 +116,63 @@ function! dart#resolveUri(uri) abort \ '') endfunction -" A map from package name to lib directory parse from a '.packages' file. +" A map from package name to lib directory parse from a 'package_config.json' +" or '.packages' file. " " Returns [found, package_map] function! s:PackageMap() abort - let [found, dot_packages] = s:DotPackagesFile() - if !found - return [v:false, {}] - endif - let dot_packages_dir = fnamemodify(dot_packages, ':p:h') - let lines = readfile(dot_packages) - let map = {} - for line in lines - if line =~# '\s*#' - continue + let [found, package_config] = s:FindFile('.dart_tool/package_config.json') + if found + let dart_tool_dir = fnamemodify(package_config, ':p:h') + let content = join(readfile(package_config), "\n") + let packages_dict = json_decode(content) + if packages_dict['configVersion'] != '2' + s:error('Unsupported version of package_config.json') + return [v:false, {}] endif - let package = substitute(line, ':.*$', '', '') - let lib_dir = substitute(line, '^[^:]*:', '', '') - if lib_dir =~# 'file:/' - let lib_dir = substitute(lib_dir, 'file://', '', '') - if lib_dir =~# '/[A-Z]:/' - let lib_dir = lib_dir[1:] + let map = {} + for package in packages_dict['packages'] + let name = package['name'] + let uri = package['rootUri'] + let package_uri = package['packageUri'] + if uri =~# 'file:/' + let uri = substitute(uri, 'file://', '', '') + let lib_dir = resolve(uri.'/'.package_uri) + else + let lib_dir = resolve(dart_tool_dir.'/'.uri.'/'.package_uri) endif - else - let lib_dir = resolve(dot_packages_dir.'/'.lib_dir) - endif - if lib_dir =~# '/$' - let lib_dir = lib_dir[:len(lib_dir) - 2] - endif - let map[package] = lib_dir - endfor - return [v:true, map] + let map[name] = lib_dir + endfor + return [v:true, map] + endif + + let [found, dot_packages] = s:FindFile('.packages') + if found + let dot_packages_dir = fnamemodify(dot_packages, ':p:h') + let lines = readfile(dot_packages) + let map = {} + for line in lines + if line =~# '\s*#' + continue + endif + let package = substitute(line, ':.*$', '', '') + let lib_dir = substitute(line, '^[^:]*:', '', '') + if lib_dir =~# 'file:/' + let lib_dir = substitute(lib_dir, 'file://', '', '') + if lib_dir =~# '/[A-Z]:/' + let lib_dir = lib_dir[1:] + endif + else + let lib_dir = resolve(dot_packages_dir.'/'.lib_dir) + endif + if lib_dir =~# '/$' + let lib_dir = lib_dir[:len(lib_dir) - 2] + endif + let map[package] = lib_dir + endfor + return [v:true, map] + endif + return [v:false, {}] endfunction " Toggle whether dartfmt is run on save or not. @@ -158,17 +184,17 @@ function! dart#ToggleFormatOnSave() abort let g:dart_format_on_save = 1 endfunction -" Finds a file name '.packages' in the cwd, or in any directory above the open +" Finds a file named [a:path] in the cwd, or in any directory above the open " file. " -" Returns [found, file]. -function! s:DotPackagesFile() abort - if filereadable('.packages') - return [v:true, '.packages'] +" Returns [found, file] +function! s:FindFile(path) abort + if filereadable(a:path) + return [v:true, a:path] endif let dir_path = expand('%:p:h') while v:true - let file_path = dir_path.'/.packages' + let file_path = dir_path.'/'.a:path if filereadable(file_path) return [v:true, file_path] endif diff --git a/autoload/fsharp.vim b/autoload/fsharp.vim index 275913cf..bb93b9cd 100644 --- a/autoload/fsharp.vim +++ b/autoload/fsharp.vim @@ -251,7 +251,7 @@ function! fsharp#loadConfig() let g:fsharp#automatic_reload_workspace = 1 endif if !exists('g:fsharp#show_signature_on_cursor_move') - let g:fsharp#show_signature_on_cursor_move = 1 + let g:fsharp#show_signature_on_cursor_move = 0 endif if !exists('g:fsharp#fsi_command') let g:fsharp#fsi_command = "dotnet fsi" diff --git a/autoload/ledger.vim b/autoload/ledger.vim index 90c88802..984070c0 100644 --- a/autoload/ledger.vim +++ b/autoload/ledger.vim @@ -25,7 +25,7 @@ function! ledger#transaction_state_toggle(lnum, ...) abort endf function! ledger#transaction_state_set(lnum, char) abort - " modifies or sets the state of the transaction at the cursor, + " modifies or sets the state of the transaction at the given line no., " removing the state altogether if a:char is empty let trans = s:transaction.from_lnum(a:lnum) if empty(trans) || has_key(trans, 'expr') @@ -130,7 +130,7 @@ function! ledger#transaction_post_state_set(lnum, char) abort return endif - let line = getline('.') + let line = getline(a:lnum) if a:char =~# '^\s*$' let newline = substitute(line, '\V' . state . '\m[ \t]', '', '') elseif state ==# ' ' @@ -457,10 +457,20 @@ endf " Return character position of decimal separator (multibyte safe) function! s:decimalpos(expr) abort - let pos = match(a:expr, '\V' . g:ledger_decimal_sep) - if pos > 0 - let pos = strchars(a:expr[:pos]) - 1 - endif + " Remove trailing comments + let l:expr = substitute(a:expr, '\v +;.*$', '', '') + " Find first or last possible decimal separator candidate + if g:ledger_align_last + let pos = matchend(l:expr, '\v.*[' . g:ledger_decimal_sep . ']') + if pos > 0 + let pos = strchars(a:expr[:pos]) + 1 + endif + else + let pos = match(l:expr, '\v[' . g:ledger_decimal_sep . ']') + if pos > 0 + let pos = strchars(a:expr[:pos]) - 1 + endif + end return pos endf @@ -544,6 +554,10 @@ function! ledger#align_amount_at_cursor() abort endif endf +function! ledger#align_formatexpr(lnum, count) abort + execute a:lnum . ',' . (a:lnum + a:count - 1) . 'call ledger#align_commodity()' +endfunction + " Report generation {{{1 " Helper functions and variables {{{2 @@ -732,8 +746,6 @@ function! ledger#register(file, args) abort endf " Reconcile the given account. -" This function accepts a file path as a third optional argument. -" The default is to use the value of g:ledger_main. " " Parameters: " file The file to be processed diff --git a/autoload/polyglot/init.vim b/autoload/polyglot/init.vim index 45e9aab2..9e991f36 100644 --- a/autoload/polyglot/init.vim +++ b/autoload/polyglot/init.vim @@ -1775,7 +1775,7 @@ if !has_key(g:polyglot_is_disabled, 'prolog') endif if !has_key(g:polyglot_is_disabled, 'bzl') - au BufNewFile,BufRead *.BUILD,*.bazel,*.bzl,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE setf bzl + au BufNewFile,BufRead *.BUILD,*.bazel,*.bzl,*.star,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE setf bzl endif if !has_key(g:polyglot_is_disabled, 'odin') @@ -1783,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,*.url,*/etc/pacman.conf,*/etc/yum.conf,{.,}editorconfig,{.,}flake8,{.,}npmrc,buildozer.spec setf dosini + au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*.url,*/etc/pacman.conf,*/etc/yum.conf,{.,}coveragerc,{.,}editorconfig,{.,}flake8,{.,}npmrc,{.,}pylintrc,buildozer.spec,pylintrc setf dosini au BufNewFile,BufRead php.ini-* call s:StarSetf('dosini') au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini') endif @@ -1873,7 +1873,7 @@ if !has_key(g:polyglot_is_disabled, 'unison') endif if !has_key(g:polyglot_is_disabled, 'typescript') - au BufNewFile,BufRead *.ts setf typescript + au BufNewFile,BufRead *.cts,*.mts,*.ts setf typescript au BufNewFile,BufRead *.tsx setf typescriptreact endif @@ -2233,7 +2233,7 @@ if !has_key(g:polyglot_is_disabled, 'jsonnet') endif if !has_key(g:polyglot_is_disabled, 'json') - au BufNewFile,BufRead *.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}arcconfig,{.,}auto-changelog,{.,}c8rc,{.,}htmlhintrc,{.,}imgbotconfig,{.,}nycrc,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,Pipfile.lock,composer.lock,mcmod.info setf json + au BufNewFile,BufRead *.4DForm,*.4DProject,*.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}arcconfig,{.,}auto-changelog,{.,}c8rc,{.,}htmlhintrc,{.,}imgbotconfig,{.,}nycrc,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,Pipfile.lock,composer.lock,mcmod.info setf json endif if !has_key(g:polyglot_is_disabled, 'json5') @@ -2358,10 +2358,6 @@ if !has_key(g:polyglot_is_disabled, 'git') au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit endif -if !has_key(g:polyglot_is_disabled, 'gdscript') - au BufNewFile,BufRead *.gd setf gdscript3 -endif - if !has_key(g:polyglot_is_disabled, 'fsharp') au! BufNewFile,BufRead,BufWritePost *.fs call polyglot#detect#Fs() au BufNewFile,BufRead *.fsi,*.fsx setf fsharp @@ -2464,7 +2460,7 @@ if !has_key(g:polyglot_is_disabled, 'coffee-script') endif if !has_key(g:polyglot_is_disabled, 'markdown') - au BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr setf markdown + au BufNewFile,BufRead *.livemd,*.markdown,*.md,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr setf markdown endif if !has_key(g:polyglot_is_disabled, 'cmake') @@ -2472,7 +2468,7 @@ if !has_key(g:polyglot_is_disabled, 'cmake') endif if !has_key(g:polyglot_is_disabled, 'clojure') - au BufNewFile,BufRead *.boot,*.cl2,*.clj,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.edn,*.hic,build.boot,profile.boot,riemann.config setf clojure + au BufNewFile,BufRead *.bb,*.boot,*.cl2,*.clj,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.edn,*.hic,build.boot,profile.boot,riemann.config setf clojure endif if !has_key(g:polyglot_is_disabled, 'carp') @@ -2583,7 +2579,7 @@ if !has_key(g:polyglot_is_disabled, 'ant') endif if !has_key(g:polyglot_is_disabled, 'xml') - au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axaml,*.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 + au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axaml,*.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,*.qhelp,*.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/shebang.vim b/autoload/polyglot/shebang.vim index a8f10348..31b97568 100644 --- a/autoload/polyglot/shebang.vim +++ b/autoload/polyglot/shebang.vim @@ -462,6 +462,7 @@ endfunc let s:interpreters = { \ 'osascript': 'applescript', \ 'tcc': 'c', + \ 'bb': 'clojure', \ 'coffee': 'coffee', \ 'crystal': 'crystal', \ 'dart': 'dart', diff --git a/autoload/polyglot/sleuth.vim b/autoload/polyglot/sleuth.vim index ba166bf7..5eb946e1 100644 --- a/autoload/polyglot/sleuth.vim +++ b/autoload/polyglot/sleuth.vim @@ -55,7 +55,7 @@ let s:globs = { \ 'brewfile': 'Brewfile', \ 'bsdl': '*.bsdl,*bsd', \ 'bst': '*.bst', - \ 'bzl': '*.bzl,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE', + \ 'bzl': '*.bzl,*.star,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE', \ 'bzr': 'bzr_log.*', \ 'c': '*.c,*.cats,*.h,*.idc,*.qc', \ 'cabal': '*.cabal', @@ -75,7 +75,7 @@ let s:globs = { \ 'chordpro': '*.chopro,*.crd,*.cho,*.crdpro,*.chordpro', \ 'cl': '*.eni', \ 'clean': '*.dcl,*.icl', - \ 'clojure': '*.clj,*.boot,*.cl2,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.hic,*.edn,riemann.config,build.boot,profile.boot', + \ 'clojure': '*.clj,*.bb,*.boot,*.cl2,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.hic,*.edn,riemann.config,build.boot,profile.boot', \ 'cmake': '*.cmake,*.cmake.in,CMakeLists.txt', \ 'cmod': '*.cmod', \ 'cmusrc': '', @@ -130,7 +130,7 @@ let s:globs = { \ 'dnsmasq': '', \ 'dockerfile': '*.Dockerfile,*.dock,Containerfile,Dockerfile,dockerfile,Dockerfile*', \ 'dosbatch': '*.bat,*.sys', - \ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,*.url,.flake8,buildozer.spec,.editorconfig,.npmrc,php.ini-*', + \ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,*.url,.coveragerc,.flake8,.pylintrc,buildozer.spec,pylintrc,.editorconfig,.npmrc,php.ini-*', \ 'dot': '*.dot,*.gv', \ 'dracula': '*.drac,*.drc,*lvs,*lpe,drac.*', \ 'dsdl': '*.sdl', @@ -181,7 +181,6 @@ let s:globs = { \ 'fvwm': '', \ 'gdb': '.gdbinit', \ 'gdmo': '*.mo,*.gdmo', - \ 'gdscript3': '*.gd', \ 'gedcom': '*.ged,lltxxxxx.txt', \ 'gitcommit': 'COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG', \ 'gitconfig': '*.gitconfig,.gitconfig,.gitmodules', @@ -263,7 +262,7 @@ let s:globs = { \ 'jovial': '*.jov,*.j73,*.jovial', \ 'jproperties': '*.properties,*.properties_??,*.properties_??_??,*.properties_??_??_*', \ 'jq': '*.jq,.jqrc,.jqrc*', - \ 'json': '*.json,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.auto-changelog,.c8rc,.htmlhintrc,.imgbotconfig,.nycrc,.tern-config,.tern-project,.watchmanconfig,Pipfile.lock,composer.lock,mcmod.info', + \ 'json': '*.json,*.4DForm,*.4DProject,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.auto-changelog,.c8rc,.htmlhintrc,.imgbotconfig,.nycrc,.tern-config,.tern-project,.watchmanconfig,Pipfile.lock,composer.lock,mcmod.info', \ 'json5': '*.json5', \ 'jsonc': '*.cjson,*.jsonc,coc-settings.json,.eslintrc.json,.babelrc,.jshintrc,.jslintrc,.mocharc.json,coffeelint.json,tsconfig.json,jsconfig.json', \ 'jsonnet': '*.jsonnet,*.libsonnet', @@ -321,7 +320,7 @@ let s:globs = { \ 'mallard': '*.page', \ 'manconf': 'man.config', \ 'maple': '*.mv,*.mpl,*.mws', - \ 'markdown': '*.md,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr', + \ 'markdown': '*.md,*.livemd,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr', \ 'markdown.mdx': '*.mdx', \ 'mason': '*.mason,*.mhtml,*.comp', \ 'master': '*.mas,*.master', @@ -568,7 +567,7 @@ let s:globs = { \ 'tt2': '*.tt2', \ 'tt2html': '*.tt2', \ 'tutor': '*.tutor', - \ 'typescript': '*.ts', + \ 'typescript': '*.ts,*.cts,*.mts', \ 'typescriptreact': '*.tsx', \ 'uc': '*.uc', \ 'udevconf': '', @@ -614,7 +613,7 @@ let s:globs = { \ 'xhtml': '*.xhtml,*.xht', \ 'xinetd': '', \ 'xmath': '*.msc,*.msf', - \ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axaml,*.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': '*.xml,*.adml,*.admx,*.ant,*.axaml,*.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,*.qhelp,*.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', diff --git a/autoload/requirements.vim b/autoload/requirements.vim index 3d783794..1132d7b2 100644 --- a/autoload/requirements.vim +++ b/autoload/requirements.vim @@ -2,35 +2,47 @@ if polyglot#init#is_disabled(expand(':p'), 'requirements', 'autoload/requ finish endif -" the Requirements File Format syntax support for Vim -" Version: 1.6.0 -" Author: raimon -" License: MIT LICENSE -" The MIT License (MIT) -" -" Copyright (c) 2015 raimon -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to deal -" in the Software without restriction, including without limitation the rights -" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -" copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in all -" copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -" SOFTWARE. +"" +" @section Introduction, intro +" @library +" is generated by . +" See for more information about installation and screenshots. -let s:save_cpo = &cpo -set cpo&vim +"" +" Update cache. +function! requirements#update_cache() abort + let s:items = [] + let l:pip_items = split(system('COMP_WORDS="pip install -" COMP_CWORD=2 PIP_AUTO_COMPLETE=1 pip')) + let l:pypi_items = split(system('pip-cache pkgnames')) + for l:item in l:pip_items + let s:items += [{'word': l:item, 'menu': 'pip'}] + endfor + for l:item in l:pypi_items + let s:items += [{'word': l:item, 'menu': 'pypi'}] + endfor + call writefile([json_encode(s:items)], s:cache) +endfunction -let &cpo = s:save_cpo -unlet s:save_cpo +if exists('*stdpath') + let s:cache_dir_home = stdpath('cache') +else + let s:cache_dir_home = $HOME . '/.cache/nvim' +endif +let s:cache_dir = s:cache_dir_home . '/requirements.vim' +call mkdir(s:cache_dir, 'p') +"" +" Completion cache path. +call g:requirements#utils#plugin.Flag('g:requirements#cache', + \ s:cache_dir . '/requirements.json' + \ ) +let s:cache = g:requirements#cache +try + let s:items = json_decode(readfile(s:cache)[0]) +catch /\v^Vim%(\(\a+\))?:E(684|484|491):/ + call requirements#update_cache() + let s:items = json_decode(readfile(s:cache)[0]) +endtry +"" +" Completion cache contents. For program. +call g:requirements#utils#plugin.Flag('g:requirements#items', s:items) " vim: et sw=4 ts=4 sts=4: diff --git a/autoload/requirements/utils.vim b/autoload/requirements/utils.vim new file mode 100644 index 00000000..963ecb71 --- /dev/null +++ b/autoload/requirements/utils.vim @@ -0,0 +1,15 @@ +if polyglot#init#is_disabled(expand(':p'), 'requirements', 'autoload/requirements/utils.vim') + finish +endif + +"" +" @section Configuration, config + +function! s:Flag(name, default) abort + let l:scope = get(split(a:name, ':'), 0, 'g:') + let l:name = get(split(a:name, ':'), -1) + let {l:scope}:{l:name} = get({l:scope}:, l:name, a:default) +endfunction + +let g:requirements#utils#plugin = {'Flag': funcref('s:Flag')} +" vim: et sw=4 ts=4 sts=4: -- cgit v1.2.3