diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-07-25 15:42:07 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-07-25 15:42:07 +0100 |
commit | b529cfbd04c02e31cfa88f2c8d88b5ff532d4f7d (patch) | |
tree | dc432e1b5129a6cdddf67ae6468e72315a0452b6 /runtime | |
parent | cd6ad6439da2ee2d1a8a6934c9d69e9c2664ba55 (diff) |
Update runtime files
Diffstat (limited to 'runtime')
27 files changed, 872 insertions, 460 deletions
diff --git a/runtime/autoload/bitbake.vim b/runtime/autoload/bitbake.vim new file mode 100644 index 0000000000..bb3fc5c0e2 --- /dev/null +++ b/runtime/autoload/bitbake.vim @@ -0,0 +1,95 @@ +" Support for bitbake indenting, see runtime/indent/bitbake.vim + +function s:is_bb_python_func_def(lnum) + let stack = synstack(a:lnum, 1) + if len(stack) == 0 + return 0 + endif + + return synIDattr(stack[0], "name") == "bbPyFuncDef" +endfunction + +function bitbake#Indent(lnum) + if !has('syntax_items') + return -1 + endif + + let stack = synstack(a:lnum, 1) + if len(stack) == 0 + return -1 + endif + + let name = synIDattr(stack[0], "name") + + " TODO: support different styles of indentation for assignments. For now, + " we only support like this: + " VAR = " \ + " value1 \ + " value2 \ + " " + " + " i.e. each value indented by shiftwidth(), with the final quote " completely unindented. + if name == "bbVarValue" + " Quote handling is tricky. kernel.bbclass has this line for instance: + " EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" " HOSTCPP="${BUILD_CPP}"" + " Instead of trying to handle crazy cases like that, just assume that a + " double-quote on a line by itself (following an assignment) means the + " user is closing the assignment, and de-dent. + if getline(a:lnum) =~ '^\s*"$' + return 0 + endif + + let prevstack = synstack(a:lnum - 1, 1) + if len(prevstack) == 0 + return -1 + endif + + let prevname = synIDattr(prevstack[0], "name") + + " Only indent if there was actually a continuation character on + " the previous line, to avoid misleading indentation. + let prevlinelastchar = synIDattr(synID(a:lnum - 1, col([a:lnum - 1, "$"]) - 1, 1), "name") + let prev_continued = prevlinelastchar == "bbContinue" + + " Did the previous line introduce an assignment? + if index(["bbVarDef", "bbVarFlagDef"], prevname) != -1 + if prev_continued + return shiftwidth() + endif + endif + + if !prev_continued + return 0 + endif + + " Autoindent can take it from here + return -1 + endif + + if index(["bbPyDefRegion", "bbPyFuncRegion"], name) != -1 + let ret = python#GetIndent(a:lnum, function('s:is_bb_python_func_def')) + " Should normally always be indented by at least one shiftwidth; but allow + " return of -1 (defer to autoindent) or -2 (force indent to 0) + if ret == 0 + return shiftwidth() + elseif ret == -2 + return 0 + endif + return ret + endif + + " TODO: GetShIndent doesn't detect tasks prepended with 'fakeroot' + " Need to submit a patch upstream to Vim to provide an extension point. + " Unlike the Python indenter, the Sh indenter is way too large to copy and + " modify here. + if name == "bbShFuncRegion" + return GetShIndent() + endif + + " TODO: + " + heuristics for de-denting out of a bbPyDefRegion? e.g. when the user + " types an obvious BB keyword like addhandler or addtask, or starts + " writing a shell task. Maybe too hard to implement... + + return -1 +endfunction diff --git a/runtime/autoload/python.vim b/runtime/autoload/python.vim new file mode 100644 index 0000000000..7e7bca6fb6 --- /dev/null +++ b/runtime/autoload/python.vim @@ -0,0 +1,228 @@ +" Support for Python indenting, see runtime/indent/python.vim + +let s:keepcpo= &cpo +set cpo&vim + +" See if the specified line is already user-dedented from the expected value. +function s:Dedented(lnum, expected) + return indent(a:lnum) <= a:expected - shiftwidth() +endfunction + +let s:maxoff = 50 " maximum number of lines to look backwards for () + +" Some other filetypes which embed Python have slightly different indent +" rules (e.g. bitbake). Those filetypes can pass an extra funcref to this +" function which is evaluated below. +function python#GetIndent(lnum, ...) + let ExtraFunc = a:0 > 0 ? a:1 : 0 + + " If this line is explicitly joined: If the previous line was also joined, + " line it up with that one, otherwise add two 'shiftwidth' + if getline(a:lnum - 1) =~ '\\$' + if a:lnum > 1 && getline(a:lnum - 2) =~ '\\$' + return indent(a:lnum - 1) + endif + return indent(a:lnum - 1) + (exists("g:pyindent_continue") ? eval(g:pyindent_continue) : (shiftwidth() * 2)) + endif + + " If the start of the line is in a string don't change the indent. + if has('syntax_items') + \ && synIDattr(synID(a:lnum, 1, 1), "name") =~ "String$" + return -1 + endif + + " Search backwards for the previous non-empty line. + let plnum = prevnonblank(v:lnum - 1) + + if plnum == 0 + " This is the first non-empty line, use zero indent. + return 0 + endif + + call cursor(plnum, 1) + + " Identing inside parentheses can be very slow, regardless of the searchpair() + " timeout, so let the user disable this feature if he doesn't need it + let disable_parentheses_indenting = get(g:, "pyindent_disable_parentheses_indenting", 0) + + if disable_parentheses_indenting == 1 + let plindent = indent(plnum) + let plnumstart = plnum + else + " searchpair() can be slow sometimes, limit the time to 150 msec or what is + " put in g:pyindent_searchpair_timeout + let searchpair_stopline = 0 + let searchpair_timeout = get(g:, 'pyindent_searchpair_timeout', 150) + + " If the previous line is inside parenthesis, use the indent of the starting + " line. + " Trick: use the non-existing "dummy" variable to break out of the loop when + " going too far back. + let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW', + \ "line('.') < " . (plnum - s:maxoff) . " ? dummy :" + \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" + \ . " =~ '\\(Comment\\|Todo\\|String\\)$'", + \ searchpair_stopline, searchpair_timeout) + if parlnum > 0 + if a:0 > 0 && ExtraFunc(parlnum) + " We may have found the opening brace of a bitbake Python task, e.g. 'python do_task {' + " If so, ignore it here - it will be handled later. + let parlnum = 0 + let plindent = indent(plnum) + let plnumstart = plnum + else + let plindent = indent(parlnum) + let plnumstart = parlnum + endif + else + let plindent = indent(plnum) + let plnumstart = plnum + endif + + " When inside parenthesis: If at the first line below the parenthesis add + " two 'shiftwidth', otherwise same as previous line. + " i = (a + " + b + " + c) + call cursor(a:lnum, 1) + let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW', + \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" + \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" + \ . " =~ '\\(Comment\\|Todo\\|String\\)$'", + \ searchpair_stopline, searchpair_timeout) + if p > 0 + if a:0 > 0 && ExtraFunc(p) + " Currently only used by bitbake + " Handle first non-empty line inside a bitbake Python task + if p == plnum + return shiftwidth() + endif + + " Handle the user actually trying to close a bitbake Python task + let line = getline(a:lnum) + if line =~ '^\s*}' + return -2 + endif + + " Otherwise ignore the brace + let p = 0 + else + if p == plnum + " When the start is inside parenthesis, only indent one 'shiftwidth'. + let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW', + \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" + \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" + \ . " =~ '\\(Comment\\|Todo\\|String\\)$'", + \ searchpair_stopline, searchpair_timeout) + if pp > 0 + return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : shiftwidth()) + endif + return indent(plnum) + (exists("g:pyindent_open_paren") ? eval(g:pyindent_open_paren) : (shiftwidth() * 2)) + endif + if plnumstart == p + return indent(plnum) + endif + return plindent + endif + endif + endif + + + " Get the line and remove a trailing comment. + " Use syntax highlighting attributes when possible. + let pline = getline(plnum) + let pline_len = strlen(pline) + if has('syntax_items') + " If the last character in the line is a comment, do a binary search for + " the start of the comment. synID() is slow, a linear search would take + " too long on a long line. + if synIDattr(synID(plnum, pline_len, 1), "name") =~ "\\(Comment\\|Todo\\)$" + let min = 1 + let max = pline_len + while min < max + let col = (min + max) / 2 + if synIDattr(synID(plnum, col, 1), "name") =~ "\\(Comment\\|Todo\\)$" + let max = col + else + let min = col + 1 + endif + endwhile + let pline = strpart(pline, 0, min - 1) + endif + else + let col = 0 + while col < pline_len + if pline[col] == '#' + let pline = strpart(pline, 0, col) + break + endif + let col = col + 1 + endwhile + endif + + " If the previous line ended with a colon, indent this line + if pline =~ ':\s*$' + return plindent + shiftwidth() + endif + + " If the previous line was a stop-execution statement... + if getline(plnum) =~ '^\s*\(break\|continue\|raise\|return\|pass\)\>' + " See if the user has already dedented + if s:Dedented(a:lnum, indent(plnum)) + " If so, trust the user + return -1 + endif + " If not, recommend one dedent + return indent(plnum) - shiftwidth() + endif + + " If the current line begins with a keyword that lines up with "try" + if getline(a:lnum) =~ '^\s*\(except\|finally\)\>' + let lnum = a:lnum - 1 + while lnum >= 1 + if getline(lnum) =~ '^\s*\(try\|except\)\>' + let ind = indent(lnum) + if ind >= indent(a:lnum) + return -1 " indent is already less than this + endif + return ind " line up with previous try or except + endif + let lnum = lnum - 1 + endwhile + return -1 " no matching "try"! + endif + + " If the current line begins with a header keyword, dedent + if getline(a:lnum) =~ '^\s*\(elif\|else\)\>' + + " Unless the previous line was a one-liner + if getline(plnumstart) =~ '^\s*\(for\|if\|elif\|try\)\>' + return plindent + endif + + " Or the user has already dedented + if s:Dedented(a:lnum, plindent) + return -1 + endif + + return plindent - shiftwidth() + endif + + " When after a () construct we probably want to go back to the start line. + " a = (b + " + c) + " here + if parlnum > 0 + " ...unless the user has already dedented + if s:Dedented(a:lnum, plindent) + return -1 + else + return plindent + endif + endif + + return -1 +endfunction + +let &cpo = s:keepcpo +unlet s:keepcpo diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 5d76ff3a31..d85fb89bce 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1275,7 +1275,7 @@ User Never executed automatically. To be used for if exists('#User#MyEvent') doautocmd User MyEvent endif - +< *SigUSR1* SigUSR1 After the SIGUSR1 signal has been detected. Could be used if other ways of notifying Vim diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index dc68def416..d182f47d90 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -293,7 +293,7 @@ index({object}, {expr} [, {start} [, {ic}]]) Number index in {object} where {expr} appears input({prompt} [, {text} [, {completion}]]) String get input from the user -inputdialog({prompt} [, {text} [, {completion}]]) +inputdialog({prompt} [, {text} [, {cancelreturn}]]) String like input() but in a GUI dialog inputlist({textlist}) Number let the user pick from a choice list inputrestore() Number restore typeahead @@ -1149,7 +1149,7 @@ blob2list({blob}) *blob2list()* Can also be used as a |method|: > GetBlob()->blob2list() - +< *browse()* browse({save}, {title}, {initdir}, {default}) Put up a file requester. This only works when "has("browse")" @@ -2316,7 +2316,9 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined, To check for a supported command always check the return value to be 2. :2match The |:2match| command. - :3match The |:3match| command. + :3match The |:3match| command (but you + probably should not use it, it is + reserved for internal usage) #event autocommand defined for this event #event#pattern autocommand defined for this event and pattern (the pattern is taken @@ -5773,8 +5775,10 @@ matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]]) message will appear and the match will not be added. An ID is specified as a positive integer (zero excluded). IDs 1, 2 and 3 are reserved for |:match|, |:2match| and |:3match|, - respectively. If the {id} argument is not specified or -1, - |matchadd()| automatically chooses a free ID. + respectively. 3 is reserved for use by the + |matchparen|polugin. + If the {id} argument is not specified or -1, |matchadd()| + automatically chooses a free ID. The optional {dict} argument allows for further custom values. Currently this is used to specify a match specific @@ -7475,7 +7479,7 @@ searchcount([{options}]) *searchcount()* " to 1) let result = searchcount() < - The function is useful to add the count to |statusline|: > + The function is useful to add the count to 'statusline': > function! LastSearchCount() abort let result = searchcount(#{recompute: 0}) if empty(result) diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt index 73d619c5d0..0bf98861e6 100644 --- a/runtime/doc/ft_sql.txt +++ b/runtime/doc/ft_sql.txt @@ -506,7 +506,7 @@ documentation. Assuming you have followed the dbext-tutorial you can press <C-C>t to display a list of tables. There is a delay while dbext is creating the table list. After the list is displayed press <C-W>. This will remove both the -popup window and the table name already chosen when the list became active. > +popup window and the table name already chosen when the list became active. 4.3.1 Table Completion: *sql-completion-tables* @@ -514,7 +514,7 @@ Press <C-C>t to display a list of tables from within the database you have connected via the dbext plugin. NOTE: All of the SQL completion popups support typing a prefix before pressing the key map. This will limit the contents of the popup window to just items -beginning with those characters. > +beginning with those characters. 4.3.2 Column Completion: *sql-completion-columns* @@ -587,13 +587,13 @@ popup a list of columns for the customer table. It does this by looking back to the beginning of the select statement and finding a list of the tables specified in the FROM clause. In this case it notes that in the string "customer c", "c" is an alias for the customer table. The optional "AS" -keyword is also supported, "customer AS c". > +keyword is also supported, "customer AS c". 4.3.3 Procedure Completion: *sql-completion-procedures* Similar to the table list, <C-C>p, will display a list of stored -procedures stored within the database. > +procedures stored within the database. 4.3.4 View Completion: *sql-completion-views* diff --git a/runtime/doc/gui_x11.txt b/runtime/doc/gui_x11.txt index 942037a64c..14ed9f5c96 100644 --- a/runtime/doc/gui_x11.txt +++ b/runtime/doc/gui_x11.txt @@ -680,7 +680,7 @@ Of these three, Vim uses PRIMARY when reading and writing the "* register register. Vim does not access the SECONDARY selection. This applies both to the GUI and the terminal version. For non-X11 systems -the plus and the star register both us the system clipboard. +the plus and the star register both use the system clipboard. Examples: (assuming the default option values) - Select a URL in Visual mode in Vim. Go to your browser and click the diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index b376af700b..51cfa46975 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -388,10 +388,10 @@ CTRL-G CTRL-J cursor one line down, insert start column *i_CTRL-G_CTRL-J* CTRL-O execute one command, return to Insert mode *i_CTRL-O* CTRL-\ CTRL-O like CTRL-O but don't move the cursor *i_CTRL-\_CTRL-O* CTRL-L when 'insertmode' is set: go to Normal mode *i_CTRL-L* -CTRL-G u break undo sequence, start new change *i_CTRL-G_u* -CTRL-G U don't break undo with next left/right cursor *i_CTRL-G_U* - movement, if the cursor stays within the - same line +CTRL-G u close undo sequence, start new change *i_CTRL-G_u* +CTRL-G U don't start a new undo block with the next *i_CTRL-G_U* + left/right cursor movement, if the cursor + stays within the same line ----------------------------------------------------------------------- Note: If the cursor keys take you out of Insert mode, check the 'noesckeys' @@ -428,8 +428,8 @@ that, with CTRL-O u. Another example: > :inoremap <CR> <C-]><C-G>u<CR> -This breaks undo at each line break. It also expands abbreviations before -this. +This starts a new undo block at each line break. It also expands +abbreviations before this. An example for using CTRL-G U: > @@ -443,9 +443,9 @@ An example for using CTRL-G U: > inoremap <expr> <End> repeat('<C-G>U<Right>', col('$') - col('.')) inoremap ( ()<C-G>U<Left> -This makes it possible to use the cursor keys in Insert mode, without breaking -the undo sequence and therefore using |.| (redo) will work as expected. -Also entering a text like (with the "(" mapping from above): +This makes it possible to use the cursor keys in Insert mode, without starting +a new undo block and therefore using |.| (redo) will work as expected. Also +entering a text like (with the "(" mapping from above): Lorem ipsum (dolor diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index e4332b8d4a..69557d6146 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -682,19 +682,22 @@ two bytes 0xc3 0xa1. You don't want the 0xc3 byte to be mapped then or otherwise it would be impossible to type the รก character. *<Leader>* *mapleader* -To define a mapping which uses the "mapleader" variable, the special string -"<Leader>" can be used. It is replaced with the string value of "mapleader". -If "mapleader" is not set or empty, a backslash is used instead. Example: > - :map <Leader>A oanother line<Esc> +To define a mapping which uses the "g:mapleader" variable, the special string +"<Leader>" can be used. It is replaced with the string value of +"g:mapleader". If "g:mapleader" is not set or empty, a backslash is used +instead. Example: > + map <Leader>A oanother line<Esc> Works like: > - :map \A oanother line<Esc> -But after: > - :let mapleader = "," + map \A oanother line<Esc> +But after (legacy script): > + let mapleader = "," +Or (Vim9 script): > + g:mapleader = "," It works like: > - :map ,A oanother line<Esc> + map ,A oanother line<Esc> -Note that the value of "mapleader" is used at the moment the mapping is -defined. Changing "mapleader" after that has no effect for already defined +Note that the value of "g:mapleader" is used at the moment the mapping is +defined. Changing "g:mapleader" after that has no effect for already defined mappings. *<LocalLeader>* *maplocalleader* diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index cd9d7bd806..762a84224e 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -4843,7 +4843,7 @@ A jump table for the options with a short description can be found at |Q_op|. help. (Note that previously setting the global option to the empty value did this, which is now deprecated.) When the first character is ":", the command is invoked as a Vim - Ex command prefixed with [count]. + Ex command with [count] added as an argument if it is not zero. When "man", "man -s" or an Ex command is used, Vim will automatically translate a count for the "K" command and pass it as the first argument. For "man -s" the "-s" is removed when there is no count. diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 2b1897fe10..71c752ac42 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -3918,7 +3918,7 @@ netrw: * Installed |g:netrw_clipboard| setting * Installed option bypass for |'guioptions'| a/A settings - * Changed popup_beval() to |popup_atcursor|() + * Changed popup_beval() to |popup_atcursor()| in netrw#ErrorMsg (lacygoill). Apparently popup_beval doesn't reliably close the popup when the mouse is moved. diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index d0d9c35da6..f9d0b66982 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -231,7 +231,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. Examples: > :4,5source :10,18source ++clear - +< *:source!* :so[urce]! {file} Read Vim commands from {file}. These are commands that are executed from Normal mode, like you type diff --git a/runtime/doc/tags b/runtime/doc/tags index ad35a71227..df1a64fb8d 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -10228,6 +10228,7 @@ undo undo.txt /*undo* undo-blocks undo.txt /*undo-blocks* undo-branches undo.txt /*undo-branches* undo-break undo.txt /*undo-break* +undo-close-block undo.txt /*undo-close-block* undo-commands undo.txt /*undo-commands* undo-persistence undo.txt /*undo-persistence* undo-redo undo.txt /*undo-redo* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 594e83c505..20dbce9547 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -38,6 +38,20 @@ browser use: https://github.com/vim/vim/issues/1234 *known-bugs* -------------------- Known bugs and current work ----------------------- +PR to consider: +- Fix CTRL-[ for Win32 on Belgian keyboard #10687 (closes #10454) +- stricter parsing for has('patch-x.y.z') #10752 +- cmdheight=0 #10675 Does it work properly? +- add splitscroll #10682 Useful? Any trouble? Null Chilly says it's OK. + suggestion: names instead of numbers for the option value + +Support virtual text: +- clear b_textprop_text when buffer is cleared +- Remove and free text when textprop is removed with negative ID. +- "gj" does not work correctly +- placement at the end of the line: after the text (text_align: "end"), right + aligned (text_align: "right") + Further Vim9 improvements, possibly after launch: - Use Vim9 for more runtime files. - Check performance with callgrind and kcachegrind. @@ -224,6 +238,10 @@ entry separately. #6609 Multiplexers (screen, tmux) can request it to the underlying terminal, and pass it on with modifications. +When scheme can't be found by configure there is no clear "not found" message: + configure:5769: checking MzScheme install prefix + configure:5781: result: + Can "CSI nr X" be used instead of outputting spaces? Is it faster? #8002 Typed keys invisible after calling interrupt() from a timer. #10631 @@ -1160,9 +1178,6 @@ cmap using execute() has side effects. (Killthemule, 2016 Aug 17, #983) Patch to order results from taglist(). (Duncan McDougall, 2016 Oct 25) -Syntax highlighting for messages with RFC3339 timestamp (#946) -Did maintainer reply? - ml_get errors when reloading file. (Chris Desjardins, 2016 Apr 19) Also with latest version. @@ -3761,6 +3776,7 @@ Syntax highlighting: - use TextMate, vscode uses it. #9087 - Other people don't like it. Vscode is asked to switch to treesitter: https://github.com/microsoft/vscode/issues/50140 + - sublime grammar? 8 Make ":syn off" use 'runtimepath' instead of $VIMRUNTIME. (Gary Johnson) Should do the same for ":syn on" and ":syn manual". 8 Support "containedin" argument for ":syn include", so that the defined diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt index 34d8054333..cc33482473 100644 --- a/runtime/doc/undo.txt +++ b/runtime/doc/undo.txt @@ -105,13 +105,13 @@ change again. But you can do something like this: > After this a "u" command will undo the delete command and the previous change. - *undo-break* -To do the opposite, break a change into two undo blocks, in Insert mode use -CTRL-G u. This is useful if you want an insert command to be undoable in + *undo-break* *undo-close-block* +To do the opposite, use a new undo block for the next change, in Insert mode +use CTRL-G u. This is useful if you want an insert command to be undoable in parts. E.g., for each sentence. |i_CTRL-G_u| -Setting the value of 'undolevels' also breaks undo. Even when the new value -is equal to the old value. In |Vim9| script: > +Setting the value of 'undolevels' also closes the undo block. Even when the +new value is equal to the old value. In |Vim9| script: > &undolevels = &undolevels In legacy script: > let &undolevels = &undolevels diff --git a/runtime/ftplugin/bitbake.vim b/runtime/ftplugin/bitbake.vim new file mode 100644 index 0000000000..99fe334627 --- /dev/null +++ b/runtime/ftplugin/bitbake.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin file +" Language: Bitbake +" Maintainer: Gregory Anders <greg@gpanders.com> +" Repository: https://github.com/openembedded/bitbake +" Latest Revision: 2022-07-23 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal commentstring=#%s +setlocal comments=:# +setlocal suffixesadd=.bb,.bbclass + +let b:undo_ftplugin = "setl cms< com< sua<" diff --git a/runtime/ftplugin/expect.vim b/runtime/ftplugin/expect.vim new file mode 100644 index 0000000000..a4c6af96ce --- /dev/null +++ b/runtime/ftplugin/expect.vim @@ -0,0 +1,24 @@ +" Vim filetype plugin file +" Language: Expect +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2022 Jul 16 + +if exists("b:did_ftplugin") + finish +endif + +" Syntax is similar to Tcl +runtime! ftplugin/tcl.vim + +let s:cpo_save = &cpo +set cpo&vim + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Expect Command Files (*.exp)\t*.exp\n" .. + \ "All Files (*.*)\t*.*\n" +endif + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 diff --git a/runtime/ftplugin/html.vim b/runtime/ftplugin/html.vim index 3179aa2e88..94cb62653f 100644 --- a/runtime/ftplugin/html.vim +++ b/runtime/ftplugin/html.vim @@ -1,16 +1,14 @@ " Vim filetype plugin file -" Language: html -" -" This runtime file is looking for a new maintainer. -" -" Former maintainer: Dan Sharp -" Last Changed: 20 Jan 2009 - -if exists("b:did_ftplugin") | finish | endif +" Language: HTML +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Dan Sharp +" Last Changed: 2022 Jul 20 + +if exists("b:did_ftplugin") + finish +endif let b:did_ftplugin = 1 -" Make sure the continuation lines below do not cause problems in -" compatibility mode. let s:save_cpo = &cpo set cpo-=C @@ -18,36 +16,40 @@ setlocal matchpairs+=<:> setlocal commentstring=<!--%s--> setlocal comments=s:<!--,m:\ \ \ \ ,e:--> -if exists("g:ft_html_autocomment") && (g:ft_html_autocomment == 1) - setlocal formatoptions-=t formatoptions+=croql +let b:undo_ftplugin = "setlocal comments< commentstring< matchpairs<" + +if get(g:, "ft_html_autocomment", 0) + setlocal formatoptions-=t formatoptions+=croql + let b:undo_ftplugin ..= " | setlocal formatoptions<" endif if exists('&omnifunc') setlocal omnifunc=htmlcomplete#CompleteTags call htmlcomplete#DetectOmniFlavor() + let b:undo_ftplugin ..= " | setlocal omnifunc<" endif -" HTML: thanks to Johannes Zellner and Benji Fisher. -if exists("loaded_matchit") - let b:match_ignorecase = 1 - let b:match_words = '<:>,' . - \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' . - \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' . - \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1> |