diff --git a/runtime/autoload/clojurecomplete.vim b/runtime/autoload/clojurecomplete.vim index 9f2c39081a..02262a6f91 100644 --- a/runtime/autoload/clojurecomplete.vim +++ b/runtime/autoload/clojurecomplete.vim @@ -4,12 +4,12 @@ " Former Maintainers: Sung Pae " URL: https://github.com/clojure-vim/clojure.vim " License: Vim (see :h license) -" Last Change: 2021-10-26 +" Last Change: 2022-03-24 " -*- COMPLETION WORDS -*- -" Generated from https://github.com/clojure-vim/clojure.vim/blob/62b215f079ce0f3834fd295c7a7f6bd8cc54bcc3/clj/src/vim_clojure_static/generate.clj -" 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"] +" Generated from https://github.com/clojure-vim/clojure.vim/blob/fd280e33e84c88e97860930557dba3ff80b1a82d/clj/src/vim_clojure_static/generate.clj +" Clojure version 1.11.0 +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 function! clojurecomplete#Complete(findstart, base) diff --git a/runtime/autoload/python3complete.vim b/runtime/autoload/python3complete.vim index 0635ef8249..ea0a331369 100644 --- a/runtime/autoload/python3complete.vim +++ b/runtime/autoload/python3complete.vim @@ -2,7 +2,7 @@ " Maintainer: " Previous Maintainer: Aaron Griffin " Version: 0.9 -" Last Updated: 2020 Oct 9 +" Last Updated: 2022 Mar 30 " " Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim " @@ -91,6 +91,9 @@ endfunction function! s:DefPython() py3 << PYTHONEOF +import warnings +warnings.simplefilter(action='ignore', category=FutureWarning) + import sys, tokenize, io, types from token import NAME, DEDENT, NEWLINE, STRING diff --git a/runtime/colors/lists/default.vim b/runtime/colors/lists/default.vim index 5940048129..f05a1ceeae 100644 --- a/runtime/colors/lists/default.vim +++ b/runtime/colors/lists/default.vim @@ -1,5 +1,5 @@ " Maintainer: Drew Vogel -" Last Change: 2021 Jul 25 +" Last Change: 2022 Mar 20 " " Replaced rgb.txt as the source of de facto standard color names. This is " sourced each time the colorscheme command is run. It is also sourced each @@ -430,6 +430,8 @@ call extend(v:colornames, { \ 'yellow2': '#eeee00', \ 'yellow3': '#cdcd00', \ 'yellow4': '#8b8b00', + \ 'dark yellow': '#8b8b00', + \ 'darkyellow': '#8b8b00', \ 'gold1': '#ffd700', \ 'gold2': '#eec900', \ 'gold3': '#cdad00', @@ -506,6 +508,8 @@ call extend(v:colornames, { \ 'orangered2': '#ee4000', \ 'orangered3': '#cd3700', \ 'orangered4': '#8b2500', + \ 'light red': '#ff8b8b', + \ 'lightred': '#ff8b8b', \ 'red1': '#ff0000', \ 'red2': '#ee0000', \ 'red3': '#cd0000', @@ -538,6 +542,8 @@ call extend(v:colornames, { \ 'violetred2': '#ee3a8c', \ 'violetred3': '#cd3278', \ 'violetred4': '#8b2252', + \ 'light magenta': '#ff8bff', + \ 'lightmagenta': '#ff8bff', \ 'magenta1': '#ff00ff', \ 'magenta2': '#ee00ee', \ 'magenta3': '#cd00cd', diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 35169e7650..83a14aa9c0 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 8.2. Last change: 2022 Mar 04 +*autocmd.txt* For Vim version 8.2. Last change: 2022 Mar 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -692,9 +692,9 @@ CursorHoldI Just like CursorHold, but in Insert mode. CursorMoved After the cursor was moved in Normal or Visual mode. Also when the text of the cursor line has been changed, e.g., with "x", "rx" or "p". - Not triggered when there is typeahead, while - executing commands in a script file, when - an operator is pending or when moving to + Not always triggered when there is typeahead, + while executing commands in a script file, + when an operator is pending or when moving to another window while remaining at the same cursor position. For an example see |match-parens|. diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 2d615c5ac2..ba741e23a4 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 8.2. Last change: 2022 Mar 08 +*builtin.txt* For Vim version 8.2. Last change: 2022 Mar 26 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1562,14 +1562,15 @@ confirm({msg} [, {choices} [, {default} [, {type}]]]) or another valid interrupt key, confirm() returns 0. An example: > - :let choice = confirm("What do you want?", "&Apples\n&Oranges\n&Bananas", 2) - :if choice == 0 - : echo "make up your mind!" - :elseif choice == 3 - : echo "tasteful" - :else - : echo "I prefer bananas myself." - :endif + let choice = confirm("What do you want?", + \ "&Apples\n&Oranges\n&Bananas", 2) + if choice == 0 + echo "make up your mind!" + elseif choice == 3 + echo "tasteful" + else + echo "I prefer bananas myself." + endif < In a GUI dialog, buttons are used. The layout of the buttons depends on the 'v' flag in 'guioptions'. If it is included, the buttons are always put vertically. Otherwise, confirm() diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt index 2182ae6974..f112119dc6 100644 --- a/runtime/doc/channel.txt +++ b/runtime/doc/channel.txt @@ -1,4 +1,4 @@ -*channel.txt* For Vim version 8.2. Last change: 2022 Feb 27 +*channel.txt* For Vim version 8.2. Last change: 2022 Mar 26 VIM REFERENCE MANUAL by Bram Moolenaar @@ -53,6 +53,7 @@ RAW nothing known, Vim cannot tell where a message ends NL every message ends in a NL (newline) character JSON JSON encoding |json_encode()| JS JavaScript style JSON-like encoding |js_encode()| +LSP Language Server Protocol encoding |language-server-protocol| Common combination are: - Using a job connected through pipes in NL mode. E.g., to run a style @@ -130,6 +131,7 @@ When using an IPv6 address, enclose it within square brackets. E.g., "js" - Use JS (JavaScript) encoding, more efficient than JSON. "nl" - Use messages that end in a NL character "raw" - Use raw messages + "lsp" - Use language server protocol encoding *channel-callback* *E921* "callback" A function that is called when a message is received that is not handled otherwise (e.g. a JSON message with ID zero). It @@ -140,8 +142,8 @@ When using an IPv6 address, enclose it within square brackets. E.g., endfunc let channel = ch_open("localhost:8765", {"callback": "Handle"}) < - When "mode" is "json" or "js" the "msg" argument is the body - of the received message, converted to Vim types. + When "mode" is "json" or "js" or "lsp" the "msg" argument is + the body of the received message, converted to Vim types. When "mode" is "nl" the "msg" argument is one message, excluding the NL. When "mode" is "raw" the "msg" argument is the whole message @@ -165,7 +167,19 @@ When using an IPv6 address, enclose it within square brackets. E.g., to check for messages, the close_cb may be invoked while still in the callback. The plugin must handle this somehow, it can be useful to know that no more data is coming. - *channel-drop* + If it is not known if there is a message to be read, use a + try/catch block: > + try + let msg = ch_readraw(a:channel) + catch + let msg = 'no message' + endtry + try + let err = ch_readraw(a:channel, #{part: 'err'}) + catch + let err = 'no error' + endtry +< *channel-drop* "drop" Specifies when to drop messages: "auto" When there is no callback to handle a message. The "close_cb" is also considered for this. @@ -443,7 +457,7 @@ to check if there is something to read. Note that when there is no callback, messages are dropped. To avoid that add a close callback to the channel. -To read all output from a RAW channel that is available: > +To read all normal output from a RAW channel that is available: > let output = ch_readraw(channel) To read the error output: > let output = ch_readraw(channel, {"part": "err"}) @@ -503,6 +517,7 @@ ch_evalexpr({handle}, {expr} [, {options}]) *ch_evalexpr()* according to the type of channel. The function cannot be used with a raw channel. See |channel-use|. {handle} can be a Channel or a Job that has a Channel. + When using the "lsp" channel mode, {expr} must be a |Dict|. *E917* {options} must be a Dictionary. It must not have a "callback" entry. It can have a "timeout" entry to specify the timeout @@ -578,7 +593,7 @@ ch_info({handle}) *ch_info()* "err_io" "out", "null", "pipe", "file" or "buffer" "err_timeout" timeout in msec "in_status" "open" or "closed" - "in_mode" "NL", "RAW", "JSON" or "JS" + "in_mode" "NL", "RAW", "JSON", "JS" or "LSP" "in_io" "null", "pipe", "file" or "buffer" "in_timeout" timeout in msec @@ -674,6 +689,7 @@ ch_sendexpr({handle}, {expr} [, {options}]) *ch_sendexpr()* with a raw channel. See |channel-use|. *E912* {handle} can be a Channel or a Job that has a Channel. + When using the "lsp" channel mode, {expr} must be a |Dict|. Can also be used as a |method|: > GetChannel()->ch_sendexpr(expr) @@ -1361,5 +1377,76 @@ The same in |Vim9| script: > # start accepting shell commands startinsert +============================================================================== +14. Language Server Protocol *language-server-protocol* + +The language server protocol specification is available at: + + https://microsoft.github.io/language-server-protocol/specification + +Each LSP protocol message starts with a simple HTTP header followed by the +payload encoded in JSON-RPC format. This is described in: + + https://www.jsonrpc.org/specification + +For messages received on a channel with mode set to "lsp", Vim will process +the HTTP header and decode the payload into a Vim |Dict| type and call the +channel callback or the specified callback function. When sending messages on +a channel using |ch_evalexpr()| or |ch_sendexpr()|, Vim will add the HTTP +header and encode the Vim expression into JSON-RPC. + +To open a channel using the 'lsp' mode, set the 'mode' item in the |ch_open()| +{options} argument to 'lsp'. Example: > + + let ch = ch_open(..., #{mode: 'lsp'}) + +To open a channel using the 'lsp' mode with a job, set the 'in_mode' and +'out_mode' items in the |job_start()| {options} argument to 'lsp'. Example: > + + let job = job_start(...., #{in_mode: 'lsp', out_mode: 'lsp'}) + +To synchronously send a JSON-RPC request to the server, use the |ch_evalexpr()| +function. This function will return the response from the server. You can use +the 'timeout' field in the {options} argument to control the response wait +time. Example: > + + let req = {} + let req.method = 'textDocument/definition' + let req.params = {} + let req.params.textDocument = #{uri: 'a.c'} + let req.params.position = #{line: 10, character: 3} + let resp = ch_evalexpr(ch, req, #{timeout: 100}) + +Note that in the request message the 'id' field should not be specified. If it +is specified, then Vim will overwrite the value with an internally generated +identifier. Vim currently supports only a number type for the 'id' field. + +To send a JSON-RPC request to the server and asynchronously process the +response, use the |ch_sendexpr()| function and supply a callback function. +Example: > + + let req = {} + let req.method = 'textDocument/hover' + let req.params = {} + let req.params.textDocument = #{uri: 'a.c'} + let req.params.position = #{line: 10, character: 3} + let resp = ch_sendexpr(ch, req, #{callback: 'MyFn'}) + +To send a JSON-RPC notification message to the server, use the |ch_sendexpr()| +function. Example: > + + call ch_sendexpr(ch, #{method: 'initialized'}) + +To respond to a JSON-RPC request message from the server, use the +|ch_sendexpr()| function. In the response message, copy the 'id' field value +from the server request message. Example: > + + let resp = {} + let resp.id = req.id + let resp.result = 1 + call ch_sendexpr(ch, resp) + +The JSON-RPC notification messages from the server are delivered through the +|channel-callback| function. vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 5dc3348dbe..6ff7d453bf 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 8.2. Last change: 2022 Mar 13 +*insert.txt* For Vim version 8.2. Last change: 2022 Mar 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -800,7 +800,7 @@ If the previous expansion was split, because it got longer than 'textwidth', then just the text in the current line will be used. If the match found is at the end of a line, then the first word in the next -line will be inserted and the message "word from next line" displayed, if +line will be inserted and the message "Word from other line" displayed, if this word is accepted the next CTRL-X CTRL-P or CTRL-X CTRL-N will search for those lines starting with this word. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 291ac1da70..32afbf83a0 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 8.2. Last change: 2022 Mar 13 +*options.txt* For Vim version 8.2. Last change: 2022 Mar 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -984,7 +984,8 @@ A jump table for the options with a short description can be found at |Q_op|. nostop like start, except CTRL-W and CTRL-U do not stop at the start of insert. - When the value is empty, Vi compatible backspacing is used. + When the value is empty, Vi compatible backspacing is used, none of + the ways mentioned for the items above are possible. For backwards compatibility with version 5.4 and earlier: value effect ~ diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 1ee547ce04..42852219cb 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -1,4 +1,4 @@ -*repeat.txt* For Vim version 8.2. Last change: 2022 Jan 21 +*repeat.txt* For Vim version 8.2. Last change: 2022 Mar 30 VIM REFERENCE MANUAL by Bram Moolenaar @@ -210,22 +210,26 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. To source a range of lines that doesn't start with the |:vim9script| command in Vim9 script context, the - |:vim9cmd| modifier can be used. + |:vim9cmd| modifier can be used. If you use a Visual + selection and type ":", the range in the form "'<,'>" + can come before it: > + :'<,'>vim9cmd source +< Otherwise the range goes after the modifier and must + have a colon prefixed, like all Vim9 ranges: > + :vim9cmd :5,9source - When a range of lines in a buffer is sourced in the +< When a range of lines in a buffer is sourced in the Vim9 script context, the previously defined script-local variables and functions are not cleared. This works like the range started with the ":vim9script noclear" command. The "++clear" argument can be used to clear the script-local variables and functions before sourcing the script. This works like - the range started with the |:vimscript| command + the range started with the `:vim9script` command without the "noclear" argument. See |vim9-reload| for more information. Examples: > - :4,5source - :vim9cmd :'<,'>source :10,18source ++clear *:source!* diff --git a/runtime/doc/tags b/runtime/doc/tags index cccdf85775..9418569095 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -8094,6 +8094,7 @@ lace.vim syntax.txt /*lace.vim* lambda eval.txt /*lambda* lang-variable eval.txt /*lang-variable* language-mapping map.txt /*language-mapping* +language-server-protocol channel.txt /*language-server-protocol* last-pattern pattern.txt /*last-pattern* last-position-jump usr_05.txt /*last-position-jump* last_buffer_nr() builtin.txt /*last_buffer_nr()* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index fd0817def6..916b1db1ad 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 8.2. Last change: 2022 Mar 18 +*todo.txt* For Vim version 8.2. Last change: 2022 Mar 30 VIM REFERENCE MANUAL by Bram Moolenaar @@ -38,6 +38,9 @@ browser use: https://github.com/vim/vim/issues/1234 *known-bugs* -------------------- Known bugs and current work ----------------------- +Allow for: "import autoload '../lib/script.vim'" + avoids going through 'runtimepath' and avoids name collisions. + Really drop the Athena and NeXtaw GUI? Decide end of March. Once Vim9 is stable: @@ -48,6 +51,7 @@ Once Vim9 is stable: vim9instr.c vim9script.c vim9type.c +- Adjust intro message to say "help version9". Further Vim9 improvements, possibly after launch: - Check performance with callgrind and kcachegrind. @@ -417,13 +421,6 @@ register, then "" doesn't contain anything. Make it still follow "+. File marks merging has duplicates since 7.4.1925. (Ingo Karkat, #5733) -"make test_gui" crashed in submenu_change(). Fix and remove workaround in -add_pixmap_args(). -Athena is OK. -Motif: Build on Ubuntu can't enter any text in dialog text fields. -Running test_gui and test_gui_init with Motif sometimes kills the window -manager. Problem with Motif? - When editing a file with ":edit" the output of :swapname is relative, while editing it with "vim file" it is absolute. (#355) Which one should it be? @@ -478,11 +475,6 @@ Test loose_clipboard() by selecting text before suspending. Undo puts cursor in wrong line after "cG" undo. -Implement completion for "breakadd". Should expand the second argument, e.g. -"func", and then function names after ":breakadd func". Including -script-local functions. -Also for ":profile". - :unmap gives error but does remove the mapping. (Antony Scriven, 2019 Dec 19) @@ -2501,10 +2493,6 @@ Works OK when 'cmdheight' is 2. 8 Use a mechanism similar to omni completion to figure out the kind of tab for CTRL-] and jump to the appropriate matching tag (if there are several). - Alternative: be able to define a function that takes the tag name and uses - taglist() to find the right location. With indication of using CTRL-] so - that the context can be taken into account. (Robert Webb) -Patch by Christian Brabandt, 2013 May 31. The utf class table is missing some entries: 0x2212, minus sign diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index f494880e28..7af10024af 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1,4 +1,4 @@ -*vim9.txt* For Vim version 8.2. Last change: 2022 Mar 18 +*vim9.txt* For Vim version 8.2. Last change: 2022 Mar 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -184,8 +184,8 @@ For now you will need to pass the dictionary explicitly: > def DictFunc(d: dict, arg: string) echo d[arg] enddef - var d = {item: 'value', func: DictFunc} - d.func(d, 'item') + var ad = {item: 'value', func: DictFunc} + ad.func(d, 'item') You can call a legacy dict function though: > func Legacy() dict @@ -376,13 +376,23 @@ And with autocommands: > } Although using a :def function probably works better. + *E1022* *E1103* *E1130* *E1131* *E1133* *E1134* *E1235* Declaring a variable with a type but without an initializer will initialize to false (for bool), empty (for string, list, dict, etc.) or zero (for number, any, etc.). This matters especially when using the "any" type, the value will -default to the number zero. - *E1016* *E1052* *E1066* +default to the number zero. For example, when declaring a list, items can be +added: > + var myList: list + myList->add(7) + +Initializing a variable to a null value, e.g. `null_list`, differs from not +initializing the variable. This throws an error: > + var myList = null_list + myList->add(7) # E1130: Cannot add to null list + +< *E1016* *E1052* *E1066* In Vim9 script `:let` cannot be used. An existing variable is assigned to without any command. The same for global, window, tab, buffer and Vim variables, because they are not really declared. Those can also be deleted @@ -1243,7 +1253,7 @@ Closures defined in a loop will share the same context. For example: > A closure must be compiled in the context that it is defined in, so that variables in that context can be found. This mostly happens correctly, except when a function is marked for debugging with `breakadd` after it was compiled. -Make sure the define the breakpoint before compiling the outerh function. +Make sure to define the breakpoint before compiling the outer function. The "inloop" variable will exist only once, all closures put in the list refer to the same instance, which in the end will have the value 4. This is diff --git a/runtime/filetype.vim b/runtime/filetype.vim index ad6ddc65ef..b70b58de8c 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1277,6 +1277,9 @@ au BufNewFile,BufRead *.[Oo][Pp][Ll] setf opl " Oracle config file au BufNewFile,BufRead *.ora setf ora +" Org +au BufNewFile,BufRead *.org,*.org_archive setf org + " Packet filter conf au BufNewFile,BufRead pf.conf setf pf @@ -1732,7 +1735,7 @@ au BufNewFile,BufRead .zshrc,.zshenv,.zlogin,.zlogout,.zcompdump setf zsh au BufNewFile,BufRead *.zsh setf zsh " Scheme -au BufNewFile,BufRead *.scm,*.ss,*.sld,*.rkt,*.rktd,*.rktl setf scheme +au BufNewFile,BufRead *.scm,*.ss,*.sld,*.rkt,*.rktd,*.rktl setf scheme " Screen RC au BufNewFile,BufRead .screenrc,screenrc setf screen diff --git a/runtime/ftplugin/clojure.vim b/runtime/ftplugin/clojure.vim index 81d53b1227..c922d75699 100644 --- a/runtime/ftplugin/clojure.vim +++ b/runtime/ftplugin/clojure.vim @@ -5,7 +5,7 @@ " Meikel Brandmeyer " URL: https://github.com/clojure-vim/clojure.vim " License: Vim (see :h license) -" Last Change: 2021-10-26 +" Last Change: 2022-03-24 if exists("b:did_ftplugin") finish @@ -43,7 +43,7 @@ setlocal commentstring=;\ %s " specially and hence are not indented specially. " " -*- LISPWORDS -*- -" Generated from https://github.com/clojure-vim/clojure.vim/blob/62b215f079ce0f3834fd295c7a7f6bd8cc54bcc3/clj/src/vim_clojure_static/generate.clj +" Generated from https://github.com/clojure-vim/clojure.vim/blob/fd280e33e84c88e97860930557dba3ff80b1a82d/clj/src/vim_clojure_static/generate.clj setlocal lispwords=as->,binding,bound-fn,case,catch,cond->,cond->>,condp,def,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecord,defstruct,deftest,deftest-,deftype,doseq,dotimes,doto,extend,extend-protocol,extend-type,fn,for,if,if-let,if-not,if-some,let,letfn,locking,loop,ns,proxy,reify,set-test,testing,when,when-first,when-let,when-not,when-some,while,with-bindings,with-in-str,with-local-vars,with-open,with-precision,with-redefs,with-redefs-fn,with-test " Provide insert mode completions for special forms and clojure.core. As @@ -66,10 +66,10 @@ endif " Filter files in the browse dialog if (has("gui_win32") || has("gui_gtk")) && !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:browsefilter = "All Files\t*\n" . + \ "Clojure Files\t*.clj;*.cljc;*.cljs;*.cljx\n" . + \ "EDN Files\t*.edn\n" . + \ "Java Files\t*.java\n" let b:undo_ftplugin .= ' | unlet! b:browsefilter' endif diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim index 4a476fd8cf..8c1f47731c 100644 --- a/runtime/ftplugin/ruby.vim +++ b/runtime/ftplugin/ruby.vim @@ -3,7 +3,7 @@ " Maintainer: Tim Pope " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns -" Last Change: 2020 Feb 13 +" Last Change: 2022 Mar 21 if (exists("b:did_ftplugin")) finish @@ -53,7 +53,7 @@ endif " TODO: "setlocal define=^\\s*def -setlocal comments=:# +setlocal comments=b:# setlocal commentstring=#\ %s if !exists('g:ruby_version_paths') @@ -87,8 +87,14 @@ endfunction function! s:build_path(path) abort let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',') - if &g:path !~# '\v^%(\.,)=%(/%(usr|emx)/include,)=,$' - let path = substitute(&g:path,',,$',',','') . ',' . path + if &g:path =~# '\v^%(\.,)=%(/%(usr|emx)/include,)=,$' + let path = path . ',.,,' + elseif &g:path =~# ',\.,,$' + let path = &g:path[0:-4] . path . ',.,,' + elseif &g:path =~# ',,$' + let path = &g:path[0:-2] . path . ',,' + else + let path = substitute(&g:path, '[^,]\zs$', ',', '') . path endif return path endfunction @@ -164,6 +170,8 @@ let b:undo_ftplugin .= "| sil! cunmap | sil! cunmap