Compare commits

...

761 Commits

Author SHA1 Message Date
87757c6b0a patch 9.1.1552: [security]: path traversal issue in tar.vim
Problem:  [security]: path traversal issue in tar.vim
          (@ax)
Solution: warn the user for such things, drop leading /, don't
          forcefully overwrite files when writing temporary files,
          refactor autoload/tar.vim

tar.vim: drop leading / in path names

A tar archive containing files with leading `/` may cause confusions as
to where the content is extracted.  Let's make sure we drop the leading
`/` and use a relative path instead.

Also while at it, had to refactor it quite a bit and increase the
minimum supported Vim version to v9. Also add a test for some basic tar
functionality

closes: #17733
2025-07-15 21:58:08 +02:00
586294a041 patch 9.1.1551: [security]: path traversal issue in zip.vim
Problem:  [security]: path traversal issue in zip.vim (@ax)
Solution: drop leading ../ on write of zipfiles, don't forcefully
          overwrite existing files

A zip plugin which contains filenames with leading '../'  may cause
confusion as to where the content will be extracted.  Let's drop such
things and make sure we use a relative filename instead and don't
forcefully overwrite temporary files. Also, warn the user of such
things.

related: #17733

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-15 21:57:48 +02:00
3f9d2378bd patch 9.1.1550: defaults: 'showcmd' is not enabled in non-compatible mode on Unix
Problem:  defaults: 'showcmd' is not enabled in non-compatible mode on
          Unix
Solution: Always enable 'showcmd' in non-compatible mode, drop it from
          defaults.vim.

'showcmd' was already always enabled in Vim compatible mode except for
UNIX environments. So let's just enable it always, there is no good
reason why UNIX platforms should be handled differently than other
platforms, especially since `defaults.vim` did enable this option
anyhow.

closes: #17739

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-15 21:26:25 +02:00
d128889b30 patch 9.1.1549: filetype: pkl files are not recognized
Problem:  filetype: pkl files are not recognized
Solution: detect *.pkl files as pkl filetype, include
          a filetype plugin (Riley Bruins)

References:
https://pkl-lang.org/
https://github.com/apple/pkl

closes: #17751

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-15 21:21:29 +02:00
0992f62fc1 patch 9.1.1548: filetype: OpenFGA files are not recognized
Problem:  filetype: OpenFGA files are not recognized
Solution: detect *.fga files as fga filetype, include an fga filetype
          plugin (Riley Bruins)

References:
https://github.com/openfga
https://marketplace.visualstudio.com/items?itemName=openfga.openfga-vscode

closes: #17752

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-15 21:17:02 +02:00
9a667b4dba runtime(swig): add 'comments', 'commentstring' in filetype plugin
Reference:
https://www.swig.org/Doc1.3/SWIG.html#SWIG_nn5

closes: #17753

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-15 21:13:41 +02:00
30df42557c runtime(twig): include twig filetype plugin
closes: #17754

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-15 21:09:43 +02:00
690a42d54e patch 9.1.1547: Wayland: missing ifdef
Problem:  Wayland: missing ifdef
Solution: Add #ifdef around ch_log() call
          (Foxe Chen)

closes: #17763

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-15 21:06:37 +02:00
5d552d652b translation: ignore vim.pot creation date, regenerate it, rm allfiles
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-15 21:03:39 +02:00
8de753148f patch 9.1.1546: Vim9: error with has() and short circuit evaluation
Problem:  Vim9: error with has() and short circuit evaluation
Solution: Only eval, if ctx_skip is not SKIP_YES (Yegappan Lakshmanan).

fixes: #17750
closes: #17755

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-15 20:30:52 +02:00
edce68912e runtime(python2): Highlight b-strings in Python 2.7
related: #14033
related: #17726

closes: #17757

Signed-off-by: Rob B <github@0x7e.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-15 20:23:59 +02:00
3ab6941713 runtime(doc): Tweak documentation
closes: #17759

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-15 20:06:49 +02:00
f10fa3928c patch 9.1.1545: typo in os_unix.c
Problem:  Typo in os_unix.c
Solution: Correct the typo (Foxe Chen)

closes: #17761

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-15 20:02:57 +02:00
a24f5be86d runtime(python): highlight bytes in python
- Highlight bytes literals
- Do not highlight Unicode escape sequences in bytes literals

fixes: #14033
fixes: #17726
closes: #17728

Signed-off-by: Rob B <github@0x7e.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-14 22:30:59 +02:00
baa781a4c3 runtime(python2): highlight unicode strings in python2
fixes: #14033
fixes: #17726
closes: #17729

Signed-off-by: Rob B <github@0x7e.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-14 22:21:44 +02:00
836e54f5de patch 9.1.1544: :retab cannot be limited to indentation only
Problem:  :retab cannot be limited to indentation only
Solution: add the optional -indentonly parameter
          (Hirohito Higashi)

closes: #17730

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-14 22:11:34 +02:00
e85a66a4d4 runtime(erlang): Add support for triple-quoted strings and docstrings
Erlang recently added the `-moduledoc` attribute as well as triple
quoted strings and the `~` prefix for binary strings, see [1].

Erlang also added nominal types. See EEP-69 [2].

This commit removes the documentation of "g:erlang_highlight_bifs" and
"g:erlang_highlight_special_atoms", which are not longer supported.
"g:erlang_old_style_highlight" is kept undocumented (as it should not be
used by new users).

This commit contains the modifications in the following PR and commits:

- vim-erlang/vim-erlang-runtime#58
- vim-erlang/vim-erlang-runtime@43d18d3
- vim-erlang/vim-erlang-runtime@ac88ebf
- vim-erlang/vim-erlang-runtime@19c1be9
- vim-erlang/vim-erlang-runtime@7f5cefc
- vim-erlang/vim-erlang-runtime@976b10b

[1]: https://www.erlang.org/doc/system/documentation.html
[2]: https://www.erlang.org/eeps/eep-0069

closes: #17687

Co-authored-by: Johannes Christ <jc@jchri.st>
Signed-off-by: Csaba Hoch <csaba@cursorinsight.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-14 22:03:06 +02:00
d0bf380efa patch 9.1.1543: Wayland: clipboard appears to not be working
Problem:  Wayland: clipboard appears to not be working
          (Fuad Veliev)
Solution: Explicitly set selection each time (Foxe Chen)

fixes: #17732
closes: #17740

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-14 21:54:23 +02:00
6865bdc914 patch 9.1.1542: Coverity complains about uninitialized variable
Problem:  Coverity complains about uninitialized variable
          (Tony Mechelynck)
Solution: Initialize variables

closes: #17717

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-14 21:46:46 +02:00
ada6b27ff1 patch 9.1.1541: Vim9: error when last enum value ends with a comma
Problem:  Vim9: error when last enum value ends with a comma
Solution: Allow trailing commas in enum values (Yegappan Lakshmanan).

closes: #17744

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-14 21:27:34 +02:00
1341176e7b runtime(vim): Update help syntax file, improve highlighting of included Vim examples
- Take over as file maintainer.
- Improve highlighting of legacy script examples by using :syn-iskeyword
  with the default 'iskeyword' value. Vim9 script examples are not
  supported yet.
- Match admonition labels in more contexts.
- Match URLs in more contexts.

fixes #17721
closes: #17731

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-13 17:53:26 +02:00
f6a308c65b patch 9.1.1540: completion: menu state wrong on interruption
Problem:  completion: menu state wrong on interruption
          (Maxim Kim)
Solution: Call show_pum() if completion was interrupted
          (Girish Palya).

Popup menu was not built after fuzzy sorting, so internal state wasn't
reflected on screen.

No test. Couldn't get the terminal test to trigger both interruption and
refresh together.

fixes: #17725
closes: #17736

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-13 17:01:57 +02:00
fe1d3c8af7 patch 9.1.1539: completion: messages don't respect 'shm' setting
Problem:  completion: messages don't respect 'shm' setting
Solution: Turn off completion messages when 'shortmess' includes "c"
          (Girish Palya).

`:set shortmess+=c` is intended to reduce noise during completion by
suppressing messages.
Previously, some completion messages still appeared regardless of this setting.

This change ensures that **all** completion-related messages are suppressed
when `'c'` is present in `'shortmess'`.

Not entirely sure if the original behavior was intentional. If there's a
reason certain messages were always shown, feel free to close this without
merging.

closes: #17737

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-13 16:53:53 +02:00
ce1d1969f3 runtime(vim): Update base syntax, improve :match highlighting
- Match the range prefix separately as a count.
- Match an explicit count of 1, rarely used but seen in the wild.
- Allow whitespace between the count and command.

closes: #17717

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-13 09:05:23 +02:00
2ab4f907a2 translation(it): update Italian message translations
Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-13 08:31:33 +02:00
59bd74ed4c translation: include vim.pot in the repository
Translators would like to work with the vim.pot file directly, without
having to clone and potentially build vim.

So let's include it.

closes: #17734

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-13 08:26:57 +02:00
6f85cec4fb runtime(python): update rendering of Unicode named literals in syntax script
This change:

* enforces that the alias starts with a letter
* allows the other words in an alias to be separated by either a space
  or a hyphen, but not both or double separators
* allows only a letter after space, possibly followed by letters or
  digits
* allows both letters and digits after a hyphen

Tested with:

    a = '\N{Cyrillic Small Letter Zhe} is pronounced as zh in pleasure'
    b = '\N{NO-BREAK SPACE} is needed here'
    # ... other tests here
    r = '\N{HENTAIGANA LETTER E-1} is a Japanese hiragana letter archaic ye'
    s = '\N{CUNEIFORM SIGN NU11 TENU} is a correction alias'
    t = '\N{RECYCLING SYMBOL FOR TYPE-1 PLASTICS} base shape is a triangle'
    print(a)
    print(b)
    print(r)
    print(s)
    print(t)

The tests confirm the behavior and are selected from real Unicode
tables/aliases to check these combinations based on the specification.

fixes: #17323
closes: #17735

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-13 08:23:24 +02:00
68ee1cf7de translation(ru): Update messages translation
closes: #17719

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-11 19:40:39 +02:00
7306e8fcdb tests: string options in gen_opt_test.vim not fully sorted
Problem:  tests: string options in gen_opt_test.vim aren't fully sorted.
Solution: Sort the string options alphabetically.  Also make description
          of 'maxsearchcount' start with lower-case for consistency with
          other options, update documentation for searchcount().

closes: #17720

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-11 19:17:07 +02:00
41adebe572 check.vim: detect trailing whitespace
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-10 21:01:27 +02:00
87406c33c7 runtime(help_ru): Update help_ru syntax script
closes: #17718

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-10 20:52:18 +02:00
6ac2e4aa0a runtime(vim): Update base syntax, improve function call highlighting
- Match more function calls.
- Contain function call syntax groups.
- Improve differentiation between Ex commands and builtin functions with
  the same name.  Remove special cases.  Command modifiers are not
  currently well differentiated from functions.

closes: #17712

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-10 20:50:06 +02:00
ea528a9482 patch 9.1.1537: helptoc: still some issues when markdown code blocks
Problem:  helptoc: still some issues when parsing markdown code blocks
          (VimWei)
Solution: assign nextline to curline before starting the next loop
          iteration; when processing fenced code blocks, flip the
          skip_fence variable, update the test to be more comprehensive

related: https://github.com/vim/vim/issues/17699#issuecomment-3055603968
closes: #17716

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-10 20:44:51 +02:00
48d7f5b5a3 patch 9.1.1536: tests: test_plugin_comment uses wrong :Check command
Problem:  tests: test_plugin_comment.vim uses :CheckScreenDump check but
          doesn't actually use a screen dump.
Solution: Use :CheckRunVimInTerminal instead, remove a few empty lines.

test_plugin_comment.vim uses :CheckScreenDump to test for the screen
dump feature in each single test case.

However, since we are not actually using any screen dumps, it would be
more correct to use :CheckRunVimInTerminal, since this is the actual
command that we want to run.

And instead of verifying this for each single test, let's just do it
once when sourcing the file. While doing this, also remove some white
spaces.

closes: #17711

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-10 20:40:09 +02:00
b7b7fa04bf patch 9.1.1535: the maximum search count uses hard-coded value 99
Problem:  The maximum search count uses a hard-coded value of 99
          (Andres Monge, Joschua Kesper)
Solution: Make it configurable using the 'maxsearchcount' option.

related: #8855
fixes: #17527
closes: #17695

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-10 20:34:41 +02:00
bda2e4eb16 patch 9.1.1534: unnecessary code in tabpanel.c
Problem:  unnecessary code in tabpanel.c
Solution: remove it (Hirohito Higashi)

closes: #17713

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-10 20:16:14 +02:00
6715b3510e patch 9.1.1533: helptoc: does not handle code sections in markdown well
Problem:  helptoc: does not handle code sections in markdown well
          (VimWei)
Solution: Skip over fenced code sections (lacygoill), add a test.

fixes: #17699
closes: #17710

Co-authored-by: lagygoill <lacygoill@lacygoill.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-09 20:26:07 +02:00
3987eac572 runtime(doc): clarify how ex ranges are adjusted when acting on folds
closes: #17696

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-09 19:59:22 +02:00
a46e9e45a9 translation(ru): update vim-ru according to patch 9.1.1485
closes: #17709

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-09 19:45:43 +02:00
43855b7396 translation(ru): update vimtutor-ru man according to commit 5bbdd0b
closes: #17708

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-09 19:43:51 +02:00
49b89bb172 translation(ru): Update main readme.ru.txt according to commit 2bfd1ee
closes: #17707

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-09 19:41:21 +02:00
41ee98c3c5 runtime(filetype): fix incorrect pattern and break early
- Using `\n` is incorrect, as result of getline() does not contain line
  breaks and only uses `\n` for NUL bytes.
- Return when b:asmsyntax is set, like many other filetypes.

closes: #17706

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-09 18:23:52 +02:00
bda55df3b8 Revert "runtime(haskell): Add single quote to iskeyword in ftplugin (#8191)"
This reverts commit 5e6e4042b1.

related: #8191

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-09 18:18:22 +02:00
c4bca1de0b patch 9.1.1532: termdebug: not enough ways to configure breakpoints
Problem:  termdebug: not enough ways to configure breakpoints
Solution: add the termdebug_config['signs'] config setting, rework the
          termdebug test cases (Dimitry Ishenko)

Allow to configure custom breakpoint signs so one can do something like
this:

```vim
let g:termdebug_config['signs'] = ['>1', '>2', '>3', '>4', '>5', '>6', '>7', '>8', '>9']
let g:termdebug_config['sign'] = '>>'
```

where the first 9 breakpoints will have their own signs and the rest
will be the same (>>).

While at it, rework the test for the termdebug plugin:

- Added test for g:termdebug_config['signs'].
- Added test for g:termdebug_config['sign'].
- Moved test for g:termdebug_config['sign_decimal'] into
  Test_termdebug_basic()

closes: #17694

Signed-off-by: Dimitry Ishenko <dimitry.ishenko@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-08 23:13:14 +02:00
8331310c06 patch 9.1.1531: confusing error with nested legacy function
Problem:  confusing error with nested legacy function
          (lacygoill)
Solution: clarify error message E1117 with :def or :func (Hirohito Higashi)

fixes: #17697
closes: #17702

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-08 23:07:21 +02:00
1adada0158 patch 9.1.1530: Missing version change in v9.1.1529
Problem:  Missing version change from v9.1.1529
Solution: Update version.c with latest patch

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-08 23:04:36 +02:00
dbe45be625 patch 9.1.1529: Win32: the toolbar in the GUI is old and dated
Problem:  Win32: the toolbar in the GUI is old and dated
Solution: Include improved icons from Fatcow (CC by 3.0)
          (RestorerZ)

closes: vim/vim-win32-installer#372
closes: #17698

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-08 23:00:13 +02:00
f2ec8d4afc patch 9.1.1528: completion: crash with getcompletion()
Problem:  completion: crash with getcompletion()
          (zeertzjq)
Solution: Don't set may_expand_pattern in f_getcompletion(),
          unset may_expand_pattern() once it is not longer needed
          (Girish Palya).

fixes: #17680
closes: #17686

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-08 22:12:37 +02:00
2ffd35fe8f patch 9.1.1527: Vim9: Crash with string compound assignment
Problem:  Vim9: Crash when using string compound assignment with wrong
          data type (lacygoill)
Solution: verify expected member type (Hirohito Higashi)

fixes: #17675
closes: #17693

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-08 21:49:56 +02:00
32a1b26ef3 runtime(filetype): improve asm heuristics and move into FTasmsyntax()
fixes: #17474
closes: #17683

Signed-off-by: Wu Yongwei <wuyongwei@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-08 21:42:37 +02:00
93c2d5bf7f patch 9.1.1526: completion: search completion match may differ in case
Problem:  completion: search completion match may differ in case
          (techntools)
Solution: add "exacttext" to 'wildoptions' value (Girish Palya)

This flag does the following:

exacttext
      When this flag is present, search pattern completion
      (e.g., in |/|, |?|, |:s|, |:g|, |:v|, and |:vim|)
      shows exact buffer text as menu items, without
      preserving regex artifacts like position
      anchors (e.g., |/\<|). This provides more intuitive
      menu items that match the actual buffer text. However,
      searches may be less accurate since the pattern is not
      preserved exactly.
      By default, Vim preserves the typed pattern (with
      anchors) and appends the matched word. This preserves
      search correctness, especially when using regular
      expressions or with 'smartcase' enabled. However, the
      case of the appended matched word may not exactly
      match the case of the word in the buffer.

fixes: #17654
closes: #17667

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-08 21:29:02 +02:00
b3eaae21b9 runtime(netrw): restore blank line cleanup after file listing
Problem:  v182 refactoring removed blank line cleanup (g/^$/d) from
          s:LocalListing(), causing empty lines between directories
          and files.
Solution: Add the missing cleanup after append() in s:PerformListing()
          (uma-chan).

closes: #17672

Co-authored-by: Luca Saccarola <96259932+saccarosium@users.noreply.github.com>
Signed-off-by: uma-chan <127664533+i9wa4@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-07 22:04:11 +02:00
eb380b991c patch 9.1.1525: tests: testdir/ is a bit messy
Problem:  tests: testdir is a bit messy
Solution: move test scripts into testdir/util/ directory

src/testdir/ has become a dumping ground mixing test cases with utility
functions. Let's fix this by moving all utility functions into the
testdir/util/ directory

Also a few related changes had to be done:
- Update Filelist
- update README.txt and mention the new directory layout
- fix shadowbuild by linking the util directory into the shadow dir

closes: #17677

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-07 20:53:55 +02:00
b0905e269d patch 9.1.1524: tests: too many imports in the test suite
Problem:  tests: too many imports in the test suite
Solution: Clean up the imported scripts

Most tests make use of check.vim, so let's just source it once in
runtest.vim instead of having each test manually source it.

runtest.vim already sources shared.vim, which again sources
view_util.vim, so we don't need to source those two common
dependencies in all the other tests

And then check.vim sources term_util.vim already, so we can in addition
drop sourcing it explicitly in each single test script.

Note: test_expand_func.vim had to be updated to account for the changed
number of sourced files.

And finally check.vim uses line-continuation so let's also explicitly
enable line continuation via the 'cpo' option value.

related: #17677

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-07 20:39:29 +02:00
a4874d4d36 patch 9.1.1523: tests: test_clipmethod fails in non X11 environment
Problem:  tests: test_clipmethod fails in non X11 environment
Solution: test that $DISPLAY is available

related: #17677

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-07 20:07:06 +02:00
bcb06c92c4 patch 9.1.1522: tests: still some ANSI escape sequences in test output
Problem:  tests: still some ANSI escape sequences in test messages output
Solution: update the cleanup regexp to also handle those ANSI escape
          sequences: `<esc>|2h` and `<esc>|31H` like in this log output:

```
2025-07-05T20:02:47.6350409Z <esc>|2hExecuted 171 tests in   4.739708 seconds<esc>|31H
```

related: #17677

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-07 20:03:03 +02:00
0cd7f3536b patch 9.1.1521: completion: pum does not reset scroll pos on reopen with 'noselect'
Problem:  When 'wildmode' is set to include "noselect", the popup menu (pum)
          incorrectly retained its scroll position when reopened. This
          meant that after scrolling down through the menu with `<C-n>`,
          reopening the menu (e.g., by retyping the command and
          triggering completion again) would show the menu starting from
          the previously scrolled position, rather than from the top.
          This could confuse users, as the first visible item would not
          be the first actual match in the list.

Solution: Ensure that the popup menu resets its scroll position to the
          top when reopened (Girish Palya).

closes: #17673

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-07 19:47:53 +02:00
af22007784 patch 9.1.1520: completion: search completion doesn't handle 'smartcase' well
Problem:  When using `/` or `?` in command-line mode with 'ignorecase' and
          'smartcase' enabled, the completion menu could show items that
          don't actually match any text in the buffer due to case mismatches

Solution: Instead of validating menu items only against the user-typed
          pattern, the new logic also checks whether the completed item
          matches actual buffer content. If needed, it retries the match
          using a lowercased version of the candidate, respecting
          smartcase semantics.

closes: #17665

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-07 19:42:10 +02:00
faed074ab7 patch 9.1.1519: tests: Test_termdebug_decimal_breakpoints() may fail
Problem:  Test_termdebug_decimal_breakpoints() fails with List index out
          of range, because when adding the second breakpoint, the
          cursor is still on the very first line (a header include line)
          and therefore gdb refuses to set the breakpoint with:
          `msg="No compiled code for line 1 in file XTD_decimal.c"`
Solution: Run the program, so that it will break at the very first
          defined breakpoint and then once we are in the program,
          set further breakpoints

closes: #17689

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-07 19:38:27 +02:00
57d6d00433 runtime(doc): Add documentation style
closes: #17627

Co-authored-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-07 19:19:48 +02:00
e2c0f81dd0 patch 9.1.1518: getcompletiontype() may crash
Problem:  getcompletiontype() crashes when no completion is available
          (after v9.1.1509).
Solution: Don't call set_expand_context() (zeertzjq)

fixes: #17681
closes: #17684

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-06 20:26:56 +02:00
d6a5edd613 runtime(optwin): add missing values for tabpanel option
closes: #17685

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-06 20:17:36 +02:00
89cce31ebc translation(tr): Update Turkish translations
closes: #17688

Signed-off-by: Emir SARI <emir_sari@icloud.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-06 20:12:20 +02:00
f79695c2d8 runtime(doc): fix a few typos introduced in 0ae9e19540
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-06 18:27:22 +02:00
244198f039 runtime(autopkgtest): add ftplugin file for autopkgtest
closes: #17679

Signed-off-by: James McCoy <jamessan@debian.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-06 18:01:18 +02:00
e9d331d173 runtime(autopkgtest): add syntax file for autopkgtest
related: #17679

Signed-off-by: James McCoy <jamessan@debian.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-06 18:00:28 +02:00
48c823ca01 runtime(debcontrol): move kernel/architecture definitions to shared/debarchitectures.vim
related: #17679

Signed-off-by: James McCoy <jamessan@debian.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-06 17:59:40 +02:00
5bcc492649 patch 9.1.1517: filetype: autopkgtest files are not recognized
Problem:  filetype: autopkgtest files are not recognized
Solution: detect */debian/tests/control files as autopkgtest filetype
          (James McCoy)

Autopkgtest is a Debian tool for testing installed versions of packages
when other, related packages are updated.

Reference:
- https://www.debian.org/doc/debian-policy/autopkgtest.txt

related: #17679

Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-06 17:57:35 +02:00
08e5b128b8 patch 9.1.1516: tests: no test that 'incsearch' is updated after search completion
Problem:  tests: no test that 'incsearch' is updated after accepting
          search completion.
Solution: Add a test case (zeertzjq).

closes: #17682

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-06 11:06:44 +02:00
21449ee49c patch 9.1.1515: Coverity complains about potential unterminated strings
Problem:    memcpy() in ExpandRTDir_int() may create unterminated strings
Solution:   Use vim_snprintf() to construct complete paths safely
            (glepnir).

related: neovim/neovim#34795
closes: #17669

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-06 11:02:51 +02:00
b7b4bb36aa patch 9.1.1514: Coverity complains about the use of tmpfile()
Problem:  coverity complains about the use of tmpfile()
Solution: use vim_tempname() instead to create anonym file

related: #17097
closes: #17674

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-06 10:39:59 +02:00
88be7a6c68 patch 9.1.1513: resizing Vim window causes unexpected internal window width
Problem:  resizing Vim window causes unexpected internal window width
          (chdiza, after v9.1.1465)
Solution: move the column calculation around (Hirohito Higashi)

fixes: #17657
fixes: #17595
closes: #17668

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-06 10:34:48 +02:00
0ae9e19540 runtime(doc): add a section for options influencing search
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-06 10:26:01 +02:00
7a734b7148 tests: fix typo in comment (after v9.1.1511)
related: #17660

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-05 17:02:04 +02:00
5911ac5023 runtime(vim): Update base-syntax, match :filetype in functions
closes: #17671

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-05 16:48:02 +02:00
ba11e78f1d patch 9.1.1512: completion: can only complete from keyword characters
Problem:  completion: can only complete from keyword characters
Solution: remove this restriction, allow completion functions when
          called from i_CTRL-N/i_CTRL-P to be triggered from non-keyword
          characters (Girish Palya)

Previously, functions specified in the `'complete'` option were
restricted to starting completion only from keyword characters (as
introduced in PR 17065). This change removes that restriction.

With this change, user-defined functions (e.g., `omnifunc`, `userfunc`)
used in `'complete'` can now initiate completion even when triggered
from non-keyword characters. This makes it easier to reuse existing
functions alongside other sources without having to consider whether the
cursor is on a keyword or non-keyword character, or worry about where
the replacement should begin (i.e., the `findstart=1` return value).

The logic for both the “collection” and “filtering” phases now fully
respects each source’s specified start column. This also extends to
fuzzy matching, making completions more predictable.

Internally, this builds on previously merged infrastructure that tracks
per-source metadata. This PR focuses on applying that metadata to
compute the leader string and insertion text appropriately for each
match.

Also, a memory corruption has been fixed in prepare_cpt_compl_funcs().

closes: #17651

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-05 16:11:44 +02:00
96076bf41e patch 9.1.1511: tests: two edit tests change v:testing from 1 to 0
Problem:  tests: two edit tests change v:testing from 1 to 0.
Solution: Don't change v:testing in these two tests, since it's already
          set to 1 in runtest.vim (zeertzjq).

closes: #17660

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-05 15:39:56 +02:00
5e34eec6f8 patch 9.1.1510: Search completion may use invalid memory
Problem:  Search completion may use invalid memory (after 9.1.1490).
Solution: Don't get two line pointers at the same time (zeertzjq).

closes: #17661

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-05 15:37:17 +02:00
96b3ef2389 patch 9.1.1509: patch 9.1.1505 was not good
Problem:  Patch 9.1.1505 was not good
Solution: Revert "patch 9.1.1505: not possible to return completion type
          for :ex command" and instead add the getcompletiontype()
          function (Hirohito Higashi).

related: #17606
closes: #17662

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-05 15:34:24 +02:00
a8b86605f3 runtime(vim): Update base-syntax, match escape sequences in :command blocks
- Match escape sequences in :command replacement blocks.
- Match :substitute after escape sequences (a temporary fix until Ex
  commands are contained).

fixes: #17326
closes: #17663

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-05 15:21:46 +02:00
f9d87fa6ba runtime(go): fix b:undo_ftplugin
last `unmap` can cause the error "E31: No such mapping" when
`doaudocmd FileType go` if appending other commands to `b:undo_ftplugin` i.e.
the space and the next bar as `let b:undo_ftplugin .= ' | setl ...'`.

closes: #17664

Signed-off-by: ichizok <gclient.gaap@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-05 15:18:41 +02:00
a494ce1c64 patch 9.1.1508: string manipulation can be improved in cmdexpand.c
Problem:  String manipulation can be improved in cmdexpand.c
Solution: Refactor cmdexpand.c to remove calls to
          STRLEN()/STRMOVE()/STRCAT() (John Marriott)

This commit does the following:

In function nextwild():
  - slightly refactor the for loop to remove an array access
  - call STRLEN() and store it's result for reuse
  - move some variables closer to where they are used, renaming some on
    the way

In function ExpandOne():
  - move some calculations outside of the for loops
  - factor out calls to STRCAT() (which has an inherent STRLEN() call) in
    the for loop
  - move some variables closer to where they are used

In function expand_files_and_dirs():
  - factor out calls to STRMOVE() (which has an inherent STRLEN() call)

In function get_filetypecmd_arg():
  - move declarations of the string arrays into the blocks where they are
    used

In function get_breakadd_arg():
  - move declaration of the string array into the block where it is
    used

In function globpath():
  - factor out calls to STRLEN() and STRCAT()
  - move some variables closer to where they are used

And finally some minor cosmetic style changes

closes: #17639

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-03 21:28:50 +02:00
c233c2e6a5 runtime(vim): Update base-syntax and generator, match all default highlight groups
- Match Conceal, ComplMatchIns, MsgArea, Terminal, and User[1-9]
  highlight groups.
- Generate the vimGroup syntax group from runtime/syncolor.vim.
- Match :SynColor and :SynLink as special user commands.

fixes #17467
closes: #17556

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-03 20:59:11 +02:00
a9b5e4af43 runtime(vim): Update base-syntax and generator, generate command modifiers
Generate Ex command modifiers from the modifier table in src/ex_docmd.c

closes: #17564

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-03 20:47:50 +02:00
4ade668fb6 patch 9.1.1507: symlinks are resolved on :cd commands
Problem:  File paths change from symlink to target path after :cd command
          when editing files through symbolic links
Solution: Add "~" flag to 'cpoptions' to control symlink resolution.
          When not included (default), symlinks are resolved maintaining
          backward compatibility. When included, symlinks are preserved
          providing the improved behavior. (glepnir)

related: neovim/neovim#15695
closes: #17628

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-03 20:44:50 +02:00
0d50d6089d runtime(postscr): Correct some standard font names in syntax
closes: #17647

Signed-off-by: Mike Williams <mrmrdubya@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-03 20:31:52 +02:00
29ebebd343 runtime(optwin): show 'guiligatures' option also on MS-Windows builds
closes: #17650

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-03 20:27:37 +02:00
29b29c6b30 patch 9.1.1506: tests: missing cleanup in Test_search_cmdline_incsearch_highlight()
Problem:  tests: missing cleanup test_override('char_avail', 0) in
          Test_search_cmdline_incsearch_highlight().
Solution: Add the missing cleanup (zeertzjq).

closes: #17655

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-03 20:02:02 +02:00
5d2354fc07 patch 9.1.1505: not possible to return completion type for :ex command
Problem:  not possible to return command-line completion type for :ex
          command
Solution: make getcmdcompltype() accept an optional and return the
          command-line completion for that arg (Shougo Matsushita).

closes: #17606

Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-03 19:57:00 +02:00
20eb68a8f2 patch 9.1.1504: filetype: numbat files are not recognized
Problem:  filetype: numbat files are not recognized
Solution: detect *.nbt files as numbat filetype (0xadk)

References:
- https://github.com/sharkdp/numbat
- https://github.com/sharkdp/numbat/tree/master/numbat/modules

closes: #17643

Signed-off-by: 0xadk <0xadk@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-02 19:46:05 +02:00
b46e3aa0fa patch 9.1.1503: filetype: haxe files are not recognized
Problem:  filetype: haxe files are not recognized
Solution: detect *.hx files as haxe filetype (0xadk)

References:
- https://haxe.org/
- https://code.haxe.org/category/beginner/hello-world.html

closes: #17644

Signed-off-by: 0xadk <0xadk@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-02 19:41:11 +02:00
fdcdded4d5 patch 9.1.1502: filetype: quickbms files are not recognized
Problem:  filetype: quickbms files are not recognized
Solution: detect *.bms files as quickbms filetype
          (0xadk)

Reference:
- https://aluigi.altervista.org/quickbms.htm

closes: #17645

Signed-off-by: 0xadk <0xadk@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-02 19:33:36 +02:00
b211916e0a patch 9.1.1501: filetype: flix files are not recognized
Problem:  filetype: flix files are not recognized
Solution: detect *.flix files as flix filetype
          (0xadk)

References:
- https://flix.dev/
- https://doc.flix.dev/introduction.html

closes: #17646

Signed-off-by: 0xadk <0xadk@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-02 18:55:55 +02:00
5ecee30dcd runtime(go): add section movement mappings to ftplugin
closes: #17641

Signed-off-by: Rob B <github@0x7e.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-02 18:47:50 +02:00
651edf33eb runtime(doc): Tweak documentation style
closes: #17638

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-01 22:07:50 +02:00
b84ab0288f patch 9.1.1500: if_python: typo in python error variable
Problem:  if_python: typo in python error variable
Solution: fix typo (Damien Lejay)

closes: #17640

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-01 21:57:59 +02:00
54585fd04c patch 9.1.1499: MS-Windows: no indication of ARM64 architecture
Problem:  MS-Windows: no indication of ARM64 architecture
Solution: Add ARM64 to version output and include in nsis installer
          (RestorerZ)

related: vim/vim-win32-installer#381
closes: #17642

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-01 21:30:21 +02:00
523f9f5898 runtime(tutor): regenerate utf-8 version of French vimtutor manpage
related: #17546

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-30 20:28:46 +02:00
ba479348d4 runtime(netrw): upstream snapshot of v183
relevant commits:
- distribution: remove NetrwSettings.vim

closes: #17635

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-30 20:26:03 +02:00
a5b744ef93 runtime(vim): Update base-syntax, improve :syn-sync line defaults
Set minlines and maxlines to 100 and 200 respectively.  Set these after
the script interface syntax files have been loaded to ensure the values
set in those are overridden.

fixes #17580
closes: #17614

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-30 20:22:38 +02:00
fa16c7ab3f patch 9.1.1498: completion: 'complete' funcs behave different to 'omnifunc'
Problem:  completion: Functions specified in the 'complete' option did
          not have the leader string removed when called with findstart = 0,
          unlike 'omnifunc' behavior
Solution: update behaviour and make behaviour consistent (Girish Palya)

closes: #17636

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-30 20:18:14 +02:00
e92989b07a patch 9.1.1497: Link error with shm_open()
Problem:  Link error with shm_open()
          (gcanat, after v9.1.1485)
Solution: use AC_LINK_IFELSE instead of AC_COMPILE_IFELSE

fixes: #17634

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-29 22:39:14 +02:00
66b72f48c3 patch 9.1.1496: terminal: still not highlighting empty cells correctly
Problem:  terminal: still not highlighting empty cells correctly
          (Yousef Mohammed, after v9.1.1489)
Solution: Use vcol instead of col

closes: #17632

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-29 22:22:05 +02:00
2bfd1ee161 README: mention POSIX vi as a goal of this project
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-29 18:29:27 +02:00
7a4cf4b256 patch 9.1.1495: Wayland: uses $XDG_SEAT to determine seat
Problem:  Wayland: uses $XDG_SEAT to determine seat to use
          (dr0bz, after v9.1.1485)
Solution: Do not try to determine the seat from $XDG_SEAT, remove the
          code that checks for this environment variable (Foxe Chen).

related: https://github.com/vim/vim/issues/5157#issuecomment-3015248239
closes: #17625

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-29 18:00:46 +02:00
1c0746829e ci: Use tmate for debugging Github Actions CI
closes: #17631

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-29 17:57:32 +02:00
73aa24ea72 ci: disable installing netbeans on Windows runners
It causes CI to fail because the netbeans package has been moved

related: tunisiano187/Chocolatey-packages#3916
related: #17631

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-29 17:57:00 +02:00
d419fa2115 patch 9.1.1494: runtime(tutor): no French translation for Chapter 2
Problem:  runtime(tutor): no French translation for Chapter 2
Solution: add and refine French translation of tutor2, update French
          vimtutor manpage (Damien Lejay)

- Add runtime/tutor/tutor2.fr.utf-8
- Improve translation based on review
- Update references in tutor1.fr and vimtutor-fr.1
- Adjust MAINTAINERS accordingly

closes: #17546

Co-authored-by: Gabriel Dupras <57042631+gdupras@users.noreply.github.com>
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-29 17:51:33 +02:00
30dcd0e1fd runtime(tutor): apply fixes to runtime/tutor/tutor2
- Fix minor typos and formatting
- Restore accidentally removed file
- Normalize <C-r> to <CTRL-R>
- Apply reviewer suggestions

related: #17546

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-29 17:49:09 +02:00
5e35184241 translation(it): updated Italian manpage
Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-29 17:37:43 +02:00
7cf35bc1be patch 9.1.1493: manually comparing positions on buffer
Problem:  manually comparing positions on buffer
          (after v9.1.1490)
Solution: use the LTOREQ_POS() macro, fix a few other minor style issues
          (glepnir)

closes: #17629

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-29 16:51:40 +02:00
44a2e3c5d4 nsis: copy tutor directory recursively
fixes: vim/vim-win32-installer#382
closes: #17630

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-29 16:23:33 +02:00
bbeaa94e0e patch 9.1.1492: tests: failure when Wayland compositor fails to start
Problem:  tests: failure when Wayland compositor fails to start
Solution: instead of throwing an error causing a failure, throw
          "Skipped", so that the Vim test suite continues and does not
          fail

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-28 21:03:25 +02:00
3b03b435a2 patch 9.1.1491: missing out-of-memory checks in cmdexpand.c
Problem:  missing out-of-memory checks in cmdexpand.c
Solution: add out-of-memory checks for expand_files_and_dirs(),
          ExpandUserDefined() and ExpandUserList()
          (John Marriott)

closes: #17570

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-28 20:41:54 +02:00
32f4febdc8 runtime(vim): re-generate vim syntax script after v9.1.1487
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-28 20:23:32 +02:00
6b49fba8c8 patch 9.1.1490: 'wildchar' does not work in search contexts
Problem:  'wildchar' does not work in search contexts
Solution: implement search completion when 'wildchar' is typed
          (Girish Palya).

This change enhances Vim's command-line completion by extending
'wildmode' behavior to search pattern contexts, including:

- '/' and '?' search commands
- ':s', ':g', ':v', and ':vim' commands

Completions preserve the exact regex pattern typed by the user,
appending the completed word directly to the original input. This
ensures that all regex elements — such as '<', '^', grouping brackets
'()', wildcards '\*', '.', and other special characters — remain intact
and in their original positions.

---

**Use Case**

While searching (using `/` or `?`) for lines containing a pattern like
`"foobar"`, you can now type a partial pattern (e.g., `/f`) followed by
a trigger key (`wildchar`) to open a **popup completion menu** showing
all matching words.

This offers two key benefits:

1. **Precision**: Select the exact word you're looking for without
typing it fully.
2. **Memory aid**: When you can’t recall a full function or variable
name, typing a few letters helps you visually identify and complete the
correct symbol.

---

**What’s New**

Completion is now supported in the following contexts:

- `/` and `?` search commands
- `:s`, `:g`, `:v`, and `:vimgrep` ex-commands

---

**Design Notes**

- While `'wildchar'` (usually `<Tab>`) triggers completion, you'll have
to use `<CTRL-V><Tab>` or "\t" to search for a literal tab.
- **Responsiveness**: Search remains responsive because it checks for
user input frequently.

---

**Try It Out**

Basic setup using the default `<Tab>` as the completion trigger:

```vim
set wim=noselect,full wop=pum wmnu
```

Now type:

```
/foo<Tab>
```

This opens a completion popup for matches containing "foo".
For matches beginning with "foo" type `/\<foo<Tab>`.

---

**Optional: Autocompletion**

For automatic popup menu completion as you type in search or `:`
commands, include this in your `.vimrc`:

```vim
vim9script
set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu

autocmd CmdlineChanged [:/?] CmdComplete()

def CmdComplete()
  var [cmdline, curpos, cmdmode] = [getcmdline(), getcmdpos(),
expand('<afile>') == ':']
  var trigger_char = '\%(\w\|[*/:.-]\)$'
  var not_trigger_char = '^\%(\d\|,\|+\|-\)\+$'  # Exclude numeric range
  if getchar(1, {number: true}) == 0  # Typehead is empty, no more
pasted input
      && !wildmenumode() && curpos == cmdline->len() + 1
      && (!cmdmode || (cmdline =~ trigger_char && cmdline !~
not_trigger_char))
    SkipCmdlineChanged()
    feedkeys("\<C-@>", "t")
    timer_start(0, (_) => getcmdline()->substitute('\%x00', '',
'ge')->setcmdline())  # Remove <C-@>
  endif
enddef

def SkipCmdlineChanged(key = ''): string
  set ei+=CmdlineChanged
  timer_start(0, (_) => execute('set ei-=CmdlineChanged'))
  return key == '' ? '' : ((wildmenumode() ? "\<C-E>" : '') .. key)
enddef

**Optional: Preserve history recall behavior**
cnoremap <expr> <Up> SkipCmdlineChanged("\<Up>")
cnoremap <expr> <Down> SkipCmdlineChanged("\<Down>")

**Optional: Customize popup height**
autocmd CmdlineEnter : set bo+=error | exec $'set ph={max([10,
winheight(0) - 4])}'
autocmd CmdlineEnter [/?] set bo+=error | set ph=8
autocmd CmdlineLeave [:/?] set bo-=error ph&
```

closes: #17570

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-28 19:59:36 +02:00
1fa3f0c215 runtime(doc): fix :vmap example to avoid unwanted spaces with JJ
fixes: #17621
closes: #17623

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-28 19:19:04 +02:00
a899b27206 patch 9.1.1489: terminal: no visual highlight of empty cols with empty 'listchars'
Problem:  terminal: no visual highlight of empty cols when 'listchars'
          is empty (Yousef Mohammed)
Solution: reset wlv.win_attr when column is zero and we are drawing a
          terminal buffer

fixes: #17559
closes: #17618

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-28 18:44:08 +02:00
792379eedf patch 9.1.1488: configure: using obsolete macro AC_PROG_GCC_TRADITIONAL
Problem:  configure: using obsolete macro AC_PROG_GCC_TRADITIONAL
Solution: drop it from configure.ac, regenerate auto/configure

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-28 18:37:49 +02:00
b657310bd3 runtime(doc): Fix modeline in wayland.txt
related: #17619

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-28 18:34:48 +02:00
76866af3a5 patch 9.1.1487: :cl doesn't invoke :clist
Problem:  :cl doesn't invoke :clist
          (after v9.1.1485)
Solution: fix order of definition in ex_cmds.h
          (Hirohito Higashi)

closes: #17619

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-28 18:29:45 +02:00
73b9650519 patch 9.1.1486: documentation issues with Wayland
Problem:  documentation issues with Wayland
          (after v9.1.1485)
Solution: Tweak documentation style. Capitalize the first letter of
          Wayland (Hirohito Higashi)

related: #17619

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-28 18:18:21 +02:00
d3d54f473f Maintainers: Update MAINTAINERS file
closes: #17622

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-28 18:13:02 +02:00
b90c2395b2 patch 9.1.1485: missing Wayland clipboard support
Problem:  missing Wayland clipboard support
Solution: make it work (Foxe Chen)

fixes: #5157
closes: #17097

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-27 21:10:35 +02:00
03125277e9 runtime(pandoc): sync syntax script with upstream
closes: #17598

Signed-off-by: Jake Zimmerman <zimmerman.jake@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-27 18:38:34 +02:00
ef925556cb runtime(netrw): upstream snapshot of v182
relevant commits:
- refactor: cleanup netrw#BrowseX
- fix: correctly handle symlinks in treeview
- chore: add minimalrc for reproducing issues
- refactor: simplify s:NetrwInit with the 'newer' assignment syntax
- refactor: remove balloon functionality
- Tune local file listing especially for Windows network drives
- interim fix for browse open with multiple windows

closes: #17616

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-27 18:28:17 +02:00
223189389a patch 9.1.1484: tests: Turkish locale tests fails on Mac
Problem:  tests: Turkish locale tests fails on Mac
          (after v9.1.1480)
Solution: skip the test Test_pos_percentage_in_turkish_locale() on Mac

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-26 23:06:23 +02:00
81f9815831 patch 9.1.1483: not possible to translation position in buffer
Problem:  not possible to translation position in buffer
Solution: use _() macro to mark the output as translatable
          (Emir SARI)

Row/Column indicator separator is currently not customizable. Some
languages have a space after the comma as the usual practice, plus this
would help translators use a custom separator like colons if necessary.

Additionally, after a save, the line and the byte indicator is also
hardcoded, this enables i18n for that as well.

closes: #17608

Signed-off-by: Emir SARI <emir_sari@icloud.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-26 20:38:16 +02:00
fe803c8c04 patch 9.1.1482: scrolling with 'splitkeep' and line()
Problem:  Topline is preemptively updated by line() in WinResized
          autocmd with 'splitkeep' != "cursor".
Solution: Set `skip_update_topline` when 'splitkeep' != "cursor".
          (Luuk van Baal)

related: neovim/neovim#34666
closes: #17613

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-26 20:34:15 +02:00
26ebe21caa runtime(doc): mismatch between the :uniq document's description and examples
closes: #17612

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-26 20:31:24 +02:00
5d14da3690 runtime(diff): fix regex for matching no-eol match
closes: #17610

Signed-off-by: A4-Tacks <wdsjxhno1001@163.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-26 20:29:18 +02:00
2249cc0a47 runtime(netrw): remove the fun from netrw :)
closes: #17584

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-25 21:23:43 +02:00
1c471ac548 runtime(doc): update description of :uniq command
The examples mention the [u] flag, so at least the [u] flag should be
introduced before the examples.

Slightly reword the sentence about trailing/leading white space.

closes: #17604

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-25 21:07:25 +02:00
037c32e428 runtime(vim): Update base-syntax, match unamed register alias
The unamed register may be referenced as both @" and @@.

Remove the unused vimPlainRegister syntax group.

fixes: #17603.
closes: #17605

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-25 20:58:50 +02:00
42d2c5e803 patch 9.1.1481: gcc complains about uninitialized variable
Problem:  gcc complains about uninitialized variable
          (Tony Mechelynck, after v9.1.1476)
Solution: initialize variable

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-25 20:54:11 +02:00
fa0b069728 runtime(doc): improve documentation style in editing.txt
Usually, Vim's document provides example code after explanations.
However some part of the editing.txt doesn't follow the style, therefore
this commit modifies it so that it follows the usual style.

closes: #17607

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: mityu <mityu.mail@gmail.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-25 20:46:34 +02:00
1c2c4ecb4c patch 9.1.1480: Turkish translation outdated
Problem:  Turkish translation outdated
Solution: Update Turkish translations, enable disabled test from
          v9.1.1479 (Emir SARI)

closes: #17597

Signed-off-by: Emir SARI <emir_sari@icloud.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-25 20:32:27 +02:00
8fe9e55a7d patch 9.1.1479: regression when displaying localized percentage position
Problem:  regression when displaying localized percentage position
          (after v9.1.1291)
Solution: calculate percentage first (Emir SARI)

Cleanups made in ec032de broke the Turkish percent display, failing to
prepend it properly in cases between 0 and 10. In Turkish, the percent
sign is prepended to the number, so it was displaying it as `% 5`
(should have been `%5`), while displaying numbers bigger than 9 properly.

related: #17597

Signed-off-by: Emir SARI <emir_sari@icloud.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-25 20:22:43 +02:00
468c62e4fd translation(it): update Italian manpage for vimtutor
Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-24 21:17:25 +02:00
ca793e60db runtime(vim): Update base-syntax, match :uniq command
closes: #17601

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-24 20:23:34 +02:00
fc378a88d8 patch 9.1.1478: Unused assignment in ex_uniq()
Problem:  Unused assignment in ex_uniq() (after v9.1.1476)
Solution: Remove the assignment and the wrong comments above
          (zeertzjq).

closes: #17596

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-24 20:02:28 +02:00
a931371694 runtime(vim): Update base-syntax, match OR operator in :echo and :execute
Don't match the OR operator in expressions as a trailing bar.

closes: #17533

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-23 21:51:44 +02:00
74f0a77bb9 patch 9.1.1476: no easy way to deduplicate text
Problem:  no easy way to deduplicate text
Solution: add the :uniq ex command
          (Hirohito Higashi)

closes: #17538

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-23 21:42:36 +02:00
159d392427 runtime(java): Complement the recognition of type parameter sections
In addition to matching type parameter sections of generic
classes and records and interfaces, match such sections of
generic methods and constructors.  As before, opt for it by
defining "g:java_highlight_generics"; the diamond form still
does not qualify for this kind of recognition.

And make section patterns agree with one another in syntax
items.

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html#jls-4.5
https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.4.4
https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.8.4

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-23 20:02:14 +02:00
1be5b375c4 patch 9.1.1476: missing out-of-memory checks in cmdexpand.c
Problem:  missing out-of-memory checks in cmdexpand.c
Solution: add missing out-of-memory checks, re-order code
          (John Marriott)

This commit does the following:
- in cmdline_pum_create() add out-of-memory check call of ALLOC_MULT()
- in expand_cmdline() move check for out-of-memory to cover both
  assignments of file_str
- in nextwild() don't free `p2` until after it's last use.

closes: #17592

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-23 19:57:29 +02:00
5bbdd0b082 runtime(doc): vimtutor starts Vim in nocompatible mode
closes: #17593

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-23 19:52:42 +02:00
a9b95c3d33 runtime(doc): remove wrong documentation of the :digraph command
fixes: #17583

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-22 20:32:15 +02:00
cd68f21f60 patch 9.1.1475: completion: regression when "nearest" in 'completeopt'
Problem:  completion: regression when "nearest" in 'completeopt'
Solution: fix compare function (Girish Palya)

closes: #17577

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-22 20:23:54 +02:00
1cbe3e89c9 runtime(comment): add <Plug>-mappings
vim9script <expr> mappings relying on imports cannot be evaluated
outside of the script file with the imports, so do not work with plugins
like vim-which-key, which evaluates <expr> mappings to apply them.

Using <Plug> mappings is one way to address this, and has the added
benefit of reading like a description for users finding the mappings.

fixes: #17523
closes: #17563

Signed-off-by: Mark Woods <mwoods.online.ie@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-22 20:20:34 +02:00
c877057e81 runtime(openPlugin): add <Plug>-mappings
vim9script <scriptcmd> mappings relying on imports cannot be evaluated
outside of the script file with the imports, so do not work with plugins
like vim-which-key, which applies the mappings using feedkeys().

Using <Plug> mappings is one way to address this, and has the added
benefit of reading like a description for users finding the mappings.

related: #17563

Signed-off-by: Mark Woods <mwoods.online.ie@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-22 20:20:23 +02:00
46b02602d6 patch 9.1.1474: missing out-of-memory check in mark.c
Problem:  missing out-of-memory check in mark.c
Solution: bail out, if mark_line() returns NULL
          (John Marriott)

closes: #17578

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-22 19:44:27 +02:00
8d9d2b222d runtime(tutor): Make all tutor files utf-8 only
In this commit, all legacy encodings for tutor files are removed.

* All the tutor files `tutor1.xx` and `tutor2.xx` are now `utf-8`
* All `README.xx.txt` files are now `utf-8`
* All makefiles are removed, as they are no longer needed
* The `tutor.vim` script is simplified
* The `README` indicates `utf-8` as a requirement
* update vimtutor.bat file

In 2025, there is no realistic scenario where a beginner starts the Vim
9.1 tutor on a machine that lacks UTF-8 support.
This change will ease the maintenance of the tutor files. Cf #17562 for
an example.

closes: #17582
closes: #17586

Co-authored-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-22 19:42:43 +02:00
dcff497373 runtime(vim): Update base-syntax, match bare mark ranges
Remove unmatchable :normal {mark,register} matches. The arg to :normal
is now handled separately and contained marks and registers are no
longer matched.

closes: #17571

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-22 18:47:49 +02:00
99b9847bd8 runtime(vim): Update base-syntax, fix Vim9 :import expression comment handling
The required space in Vim9 continuation comments (#\ comment) was
accidentally removed in commit 6acca4b as trailing whitespace.

closes: #17573

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-20 18:59:21 +02:00
d75ab0cbf5 patch 9.1.1473: inconsistent range arg for :diffget/diffput
Problem:  inconsistent range arg for :diffget/diffput
Solution: fix the range specification, place the cursor for :diffput and
          :diffget consistently on the last line (Yee Cheng Chin)

Previously, `:<range>diffget` only allowed using 1 or above in the range
value, making it impossible to use the command for a diff block at the
beginning of the file. Fix the range specification so the user can now
use 0 to specify the space before the first line. This allows
`:0,$+1diffget` to work to retrieve all the changes from the other file
instead of missing the first diff block. Also do this for `:diffput`.

Also, make `:diffput` work more similar to `:diffget`. Make it so that
if the cursor is on the last line and a new line is inserted in the
other file, doing `:diffput` will select that diff block below the line,
just like `:diffget` would.

Also clean up the logic a little bit for edge cases and for handling
line matched diff blocks better.

closes: #17579

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-20 18:44:18 +02:00
476b65ebac runtime(doc): mention using <script> instead of <sfile> in :autocmd
fixes: #17569

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-19 19:40:51 +02:00
c50f4d07c4 patch 9.1.1472: if_python: PySequence_Fast_{GET_SIZE,GET_ITEM} removed
Problem:  if_python: PySequence_Fast_{GET_SIZE,GET_ITEM} removed with
          python3.14 in stable ABI
Solution: use PySequence_{Size,GetItem} instead (Zdenek Dohnal)

Python 3.14 removed those two functions from stable API because of
reasoning these function shouldn't be part of stable API at the first
place.

Moving to PySequence_GetSize and PySequence_GetItem fixes the build
failure when Vim is built with dynamic Python and stable API for Python
3.8.

closes: #17575

Signed-off-by: Zdenek Dohnal <zdohnal@redhat.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-19 19:35:32 +02:00
5fbe72edda patch 9.1.1471: completion: inconsistent ordering with CTRL-P
Problem:  completion: inconsistent ordering with CTRL-P
          (zeertzjq)
Solution: reset compl_curr_match when using CTRL-P (Girish Palya)

fixes: #17425
closes: #17434

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-18 19:15:45 +02:00
1c00af2a24 runtime(doc): Remove obsolete labelling from 'h' occasion in :help 'highlight'
The 'h' occasion is now used for "matched text of currently inserted
completion" (defaulting to ComplMatchIns).

closes: #17572

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-18 19:12:07 +02:00
8b92af645c runtime(hgcommit): set comments and commentstring options in filetype plugin
closes: #17480

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-18 18:47:57 +02:00
736cd18671 runtime(ishd): set comments and commentstring options in filetype plugin
closes: #17490

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-18 18:46:12 +02:00
e4c157b9c1 runtime(nroff,groff): update commentstyle in filetype plugins
closes: #17516

Signed-off-by: jtmr05 <62111562+jtmr05@users.noreply.github.com>
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-18 18:41:14 +02:00
8e83105798 patch 9.1.1470: use-after-free with popup callback on error
Problem:  use-after-free with popup callback on error
          (Brian Carbone, lifepillar)
Solution: check if the popup window is valid before accessing it

fixes: #17558
closes: #17565

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-18 18:33:31 +02:00
9d065a4862 patch 9.1.1469: potential buffer-underflow with invalid hl_id
Problem:  potential buffer-underflow with invalid hl_id (mugitya03)
Solution: assert that the return-code of syn_get_final_id() if > 0

As a safety check, syn_get_final_id() may return zero when either the
provided hl_id is zero or larger than expected.

However, many callers of syn_get_final_id() do not check that the return
value is larger than zero but re-use the returned highlight id directly
like this:

  hl_id = syn_get_final_id(hl_id);
  sgp = &HL_TABLE()[hl_id - 1];	    // index is ID minus one

in which case, this would cause a buffer underrun and an access violation.

Let's use assert(hl_id > 0); to make sure that hl_id is larger than
zero.

Note to myself: I'll need to compile releases builds using -DNDEBUG once
a new release will be made

fixes: #17475
closes: #17512

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-18 18:31:19 +02:00
03e5ee25fd patch 9.1.1468: filetype: bright(er)script files are not recognized
Problem:  filetype: bright(er)script files are not recognized
Solution: detect *.bs files as brighterscript filetype and *.brs as
          brightscript filetype, include filetype plugins (Riley Bruins)

closes: #17566

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-18 18:23:05 +02:00
fff0132399 patch 9.1.1467: too many strlen() calls
Problem:  too many strlen() calls
Solution: Change expand_env() to return string length
          (John Marriott)

This commit does the following changes:
- In expand_env_esc():
  - return the length of the returned dst string.
  - refactor to remove some calls to STRLEN() and STRCAT()
  - add check for out-of-memory condition.
- Change call sites in various source files to use the return value

closes: #17561

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-18 18:20:11 +02:00
8311e7d6b4 runtime(vim): fix incorrect highlighting of User autocmds
There is no pattern after the user event name. The user event name is
the pattern.

closes: #17568

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-18 18:02:47 +02:00
48295111e5 patch 9.1.1466: filetype: not all lex files are recognized
Problem:  filetype: not all lex files are recognized
Solution: detect *.ll as lex, llvm or lifelines filetype, depending on
          the content (Eisuke Kawashima)

closes: #17560

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-17 20:30:52 +02:00
acd04b2fd7 patch 9.1.1465: tabpanel: not correctly drawn with 'equalalways'
Problem:  tabpanel: not correctly drawn with 'equalalways'
Solution: call win_equal() (Hirohito Higashi)

closes: #17554

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-16 20:26:08 +02:00
b7ebe610cc translation(de): update German messages translation
closes: #17555

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-16 20:23:00 +02:00
234c728c53 runtime(optwin): fix tabpanel typo in optwin
related: #17555

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-16 20:22:30 +02:00
cb27992cda patch 9.1.1464: gv does not work in operator-pending mode
Problem:  gv does not work in operator-pending mode
          (liushapku)
Solution: remove the check for checkclearop in nv_gv_cmd()
          (phanium)

fixes: #3666
closes: #17551

Signed-off-by: phanium <91544758+phanen@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-16 20:19:15 +02:00
93318a9933 patch 9.1.1463: Integer overflow in getmarklist() after linewise operation
Problem:  Integer overflow in getmarklist() after linewise operation.
Solution: Don't add 1 to MAXCOL (zeertzjq)

related: neovim/neovim#34524
closes: #17552

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-16 20:10:38 +02:00
8ae8b304ee patch 9.1.1462: missing change from patch v9.1.1461
Problem:  missing change from patch v9.1.1461
Solution: change wrong TPL_LCOL macro in a few more places

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-16 20:07:54 +02:00
152a450d88 runtime(sh): reset g:sh_fold_enabled after outputting its value in syntax script
fixes: #10701
closes: #17557

Signed-off-by: hakkadaikon <hakkadaikon@yahoo.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-16 19:54:37 +02:00
7841ca185d runtime(vimtutor): vimtutor throws Access Denied Error on MS-Windows
Problem:  MS-Windows: vimtutor throws Access Denied Error
Solution: switch the order of redirects. First redirect stdout, than
          stderr to stdout, Try to access $TEMP before current directory
          (which is usually c:\Program Files\vim\vim91\ and not writable
          for normal users)

closes: #17550

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-16 19:48:03 +02:00
e5c96e344c patch 9.1.1461: tabpanel: tabpanel vanishes with popup menu
Problem:  tabpanel: tabpanel vanishes with popup menu
Solution: remove pum-related test in tabpanel_leftcol(), refactor a few
          related functions (Hirohito Higashi)

This commit does the following:
- Delete unnecessary pum-related checks in the tabpanel_leftcol()
  function
- remove pum-related check in tabpanel_leftcol()
- The argument of the TPL_LCOL() macro has been deleted.
- The argument of the tabpanel_leftcol() function has been changed
  to void
- The return type of the `win_comp_pos()` function has been changed to
  void

closes: #17549

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-16 19:39:24 +02:00
e5297e39b3 patch 9.1.1460: MS-Windows: too many strlen() calls in os_win32.c
Problem:  MS-Windows: too many strlen() calls in os_win32.c
Solution: refactor code and remove calls to strlen() and wcscat()
          (John Marriott)

This commit does the following changes:
- in mch_get_exe_name():
  - refactor to remove call to wcsrchr().
  - refactor to replace calls to wcscat() with wcscpy().
  - move variables closer to where they are used.
  - change test to make sure that concatenating path and exe_pathw
    will fit inside the environment string (taking into account that
    path may be NULL).
- in executable_exists():
  - add namelen argument.
  - use string_T to store some strings.
  - refactor to remove calls to STRLEN() (via STRCAT()).
- in mch_getperm():
  - move call to mch_stat() into return statement and drop unneeded
    variable.
- in mch_wrename():
  - refactor to use wide character comparisons.
- some cosmetic code styling changes (removing extraneous spaces, etc).

closes: 17542

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-15 16:50:38 +02:00
f548ec46e4 runtime(keymaps): Add Azerbaijani keymap
closes: #17541

Signed-off-by: Rasul Samadzade <rasul.samadzade@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-15 16:33:35 +02:00
6897f18ee6 patch 9.1.1459: xxd: coloring output is inefficient
Problem:  xxd prints color escape sequences for every octet
          even if the color doesn't change
Solution: use separate arrays for colors and text and only
          print escape sequences when the color changes
          (Emanuel Krollmann)

fixes: #15122
closes: #17535

Signed-off-by: Emanuel Krollmann <E.Krollmann@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-15 16:24:09 +02:00
f5aa269f2d patch 9.1.1458: tabpanel: tabs not properly updated with 'stpl'
Problem:  tabpanel: tabs not properly updated with 'stpl'
Solution: remember the Column offset per tabpage
          (Hirohito Higashi)

fixes: #17519
closes: #17544

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-15 16:09:22 +02:00
631a50ceb9 runtime(doc): mention cannot ignored events in eventignorewin
closes: #17545

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-15 16:05:10 +02:00
7e47c1e735 runtime(netrw): remove g:netrw_quiet and reindent to 4 spaces
closes: #17539

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-15 15:26:44 +02:00
aef2e53cf8 runtime(comment): handle special chars ^$[ robustly
Make sure comment toggling works when 'commentstring' contains
any of the following regex special characters by escaping them:

^ $ [

closes: #17537

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-13 20:18:50 +02:00
1ded411a41 runtime(debcontrol): add hurd-amd64 architecture to syntax script
closes: #17525

Signed-off-by: Yuqian Yang <crupest@crupest.life>
Signed-off-by: James McCoy <jamessan@debian.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-13 20:11:42 +02:00
d296af94d0 runtime(masm): set 'com' and 'cms' options in ftplugin
closes: #17484

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 22:07:40 +02:00
85f0711b4e runtime(zimbu): set 'commentstring' option in ftplugin
closes: #17478

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 22:05:31 +02:00
91af4c4180 runtime(doc): improve the wording of 'sts', 'varts' and 'varsts' values
closes: #17522

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 21:56:19 +02:00
f5e3b5c04f runtime(netrw): refactor netrw#ErrorMsg -> netrw#msg#Notify
closes: #17526

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 21:51:42 +02:00
2eb995b569 runtime(defaults): Update the "Last Changes" header in defaults.vim
This change was forgotten from commit 6f6c0dba9f

closes: #17536

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 21:40:45 +02:00
a9657c8952 patch 9.1.1457: compile warning with tabpanelopt
Problem:  compile warning with tabpanelopt
Solution: declare arg as UNUSED (John Marriott)

closes: #17528

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 21:37:18 +02:00
532a5fb131 patch 9.1.1456: comment plugin fails toggling if 'cms' contains \
Problem:  comment plugin fails toggling if 'cms' contains \
Solution: escape backslash (Maxim Kim)

groff could be commented using \" or \# and comment plugin fails to
uncomment such things.

NOTE: if newstyle comment would be introduced, e.g. .\#
for groff test would need to be adjusted.

closes: #17530

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 21:31:00 +02:00
16e9b477ab runtime(doc): remove an obsolete item from todo.txt
I cannot reproduce this defect.  The replication instructions refer to
Mercurial version numbers and I no longer use Mercurial for my Vim
source.  I tried comparing various Git versions of the example file,
src/if_cscope.c, and still couldn't reproduce the defect.  Also, I use
Vim's diff mode a lot and haven't seen such a problem in a long time.
I am confident that it has been fixed.

Therefore, the item should be removed from todo.txt.

closes: #17534

Signed-off-by: Gary Johnson <garyjohn@spocom.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 21:15:07 +02:00
ae31d7bfb4 patch 9.1.1455: Haiku: dailog objects created with no reference
Problem:  Haiku: dailog objects created with no reference
Solution: delete the objects before returning (jinyaoguo)

In the functions gui_mch_dialog() and gui_mch_font_dialog(), Dialog
objects are created but never escape the function scope. The call to
dialog->Go() only returns a boolean value and does not retain any
reference to the Dialog object itself, which may lead to potential
memory leak.

Fix this by deleting the object after using it.

closes: #17501

Signed-off-by: jinyaoguo <guo846@purdue.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-11 21:30:01 +02:00
51289207f8 runtime(vim): Update base-syntax, improve function definition matching
- Fix highlighting of function names including /fu\%[nction]/ (E.g.,
  s:func(), foo.fu(), fu.func())
- Match :delfunction argument.

Reported by Aliaksei Budavei.

closes: #17428

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-11 21:16:14 +02:00
6cc9bd4001 patch 9.1.1454: tests: no test for pum at line break position
Problem:  Missing test case for pum display on a wrapped line.
Solution: Add a test case to cover pum behavior at line break positions.
          (glepnir)

closes: #17520

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-11 21:14:02 +02:00
5923216f79 runtime(openPlugin): Open should open file names with spaces in Windows
Use <f-args> instead of <q-args> in commands:

- :Open
- :Launch
- :URLOpen

fixes #17468
closes: #17517

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-11 21:12:27 +02:00
053aee01f7 runtime(doc): add more pointers to 'completeopt'
Before this commit, I had trouble finding information about configuring
the insert mode completion. In particular, it was not clear that the
'wildopt' config that I already had in my vimrc does not apply here.

Also, `insert.txt` barely mentioned 'completeopt' except when
describing popups (I was more interested in bash-like behavior
where the unique prefix of all completions is completed first).

I'm hoping these edits will make the relevant docs easier to find.

closes: #17515

Signed-off-by: Ilya Grigoriev <ilyagr@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-11 21:07:35 +02:00
600cd88cdf runtime(netrw): remove comment separators
closes: #17514

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-11 20:42:41 +02:00
e965b7ac5f patch 9.1.1453: tests: Test_geometry() may fail
Problem:  tests: Test_geometry() may fail
          (Gary Johnson)
Solution: allow a slightly smaller value when checking the number of
          lines.

fixes: #17491

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 21:29:43 +02:00
6701480c43 runtime(filetype): Use s:StarSetf for all patterns ending in *
Problem:  Some filetype autocmds with patterns ending in * do not skip
          filenames matching g:ignored_patterns.
Solution: Move these autocmds to the appropriate section and call
          s:StarSetf() to set the filetype.

- Affected filetypes: dosini, execline, foam, messages, nginx, tmux.
- Convert foam filetype patterns to use wildcard matching.

closes: #17422

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 21:15:22 +02:00
bfa16364f1 runtime(doc): update documentation on tabstop settings
Unify the treatment of tabstop, correct errors and deprecate smarttab
usage.

closes: #17444

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 21:12:31 +02:00
274efcc7e6 runtime(vim): Update base-syntax, contain let-heredocs
Limit heredoc matches to assignment statements.  Matching these at the
top level is very slow.

closes: #17473

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 21:02:43 +02:00
138fb951e0 runtime(reva): set 'cms' option in ftplugin, update URL
closes: #17488

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 21:00:07 +02:00
a0316cd299 runtime(abap): set 'comments' and 'commentstring' option in ftplugin
Reference:
https://en.wikipedia.org/wiki/ABAP#Comments

closes: #17489

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:57:14 +02:00
ecf8f15884 patch 9.1.1452: completion: redundant check for completion flags
Problem:  completion: redundant check for completion flags
Solution: refactor code slightly (glepnir)

refactor: nest fuzzy completion logic to avoid duplicate flag checks

- Combine COT_FUZZY checks into single nested condition
- Reduce redundant bitwise operations in ins_compl_new_leader()

closes: #17494

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:52:41 +02:00
30b4ddf925 patch 9.1.1451: tabpanel rendering artifacts when scrolling
Problem:  tabpanel rendering artifacts when scrolling
Solution: update scrolling logic (Hirohito Higashi)

fixes: #17495
closes: #17496

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:42:06 +02:00
1319009d59 runtime(netrw): get rid of s:Strlen() and use strdisplaywidth()
closes: #17498

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:39:50 +02:00
c413ac7068 runtime(java): Match raw-, non-generic-, and generic-type names of "java.lang"
And only match innermost element types of parameterised
array types.

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html#jls-4.8
https://docs.oracle.com/javase/specs/jls/se21/html/jls-6.html#jls-6.1
https://docs.oracle.com/javase/specs/jls/se21/html/jls-10.html

closes: #17499

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:37:39 +02:00
572d46035f runtime(gdshader): add comments and commentstring to ftplugin
closes: #17500

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:35:03 +02:00
a304e49790 patch 9.1.1450: Session has wrong arglist with :tcd and :arglocal
Problem:  Session has wrong arglist with :tcd and :arglocal.
Solution: Also use absolute path for :argadd when there is tabpage-local
          directory (zeertzjq).

related: neovim/neovim#34405
closes: #17503

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:31:44 +02:00
30cf017f2a runtime(8th): updated 8th syntax script
closes: #17505

Signed-off-by: Ron Aaron <ron@aaron-tech.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:27:57 +02:00
ed4eb74f7a patch 9.1.1449: typo in pum_display()
Problem:  typo in pum_display()
Solution: update the comment, remove empty new lines
          (glepnir)

closes: #17506

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:23:42 +02:00
72c3ca9f8d CI: update Cirrus runner to FreeBSD 14.3
closes: #17508

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:22:10 +02:00
3ca6776a57 patch 9.1.1448: tabpanel is not displayed correctly when msg_scrolled
Problem:  tabpanel is not displayed correctly when msg_scrolled
Solution: remove the msg_scrolled condition (Hirohito Higashi)

fixes: #17502
closes: #17510

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:20:22 +02:00
91782b4aeb patch 9.1.1447: completion: crash when backspacing with fuzzy completion
Problem:  completion: crash when backspacing with fuzzy completion
Solution: Don't dereference compl_first_match when it's NULL
          (zeertzjq).

related: neovim/neovim#34419
closes: #17511

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:06:53 +02:00
446a98f0b6 runtime(rpl): set commentstring option in ftplugin
closes: #17487

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-09 21:10:11 +02:00
9e9fe66437 runtime(postscr): set commentstring option in ftplugin
closes: #17486

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-09 21:08:33 +02:00
de535cfe77 runtime(occam): set commentstring option in ftplugin
closes: #17485

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-09 21:06:23 +02:00
df630970bf runtime(lprolog): set com, cms options for lambda prolog
closes: #17481

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-09 21:03:04 +02:00
aa9fc8eb94 runtime(vue): set 'com' and 'cms' options in ftplugin
closes: #17479

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-09 20:57:02 +02:00
601cfa9a23 patch 9.1.1446: filetype: cuda-gdb config files are not recognized
Problem:  filetype: cuda-gdb config files are not recognized
Solution: detect .cuda-gdbinit and cuda-gdbinit files as gdb filetype
          (Wu Zhenyu)

closes: #17471

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-09 20:48:24 +02:00
328332b0b0 patch 9.1.1445: negative matchfuzzy scores although there is a match
Problem:  negative matchfuzzy scores although there is a match
          (Maxim Kim)
Solution: reset the score if a match has been found but the score is
          negative (Girish Palya)

The fuzzy algorithm may miss some matches in long strings due to recursion
limits. As a result, the score can end up negative even when matches exist.
In such cases, reset the score to ensure it is non-negative.

fixes: ##17449
closes: #17469

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-09 20:43:03 +02:00
de1c7ac432 patch 9.1.1444: Unused assignment in set_fuzzy_score()
Problem:  Unused assignment in set_fuzzy_score() (after 9.1.1441).
Solution: Remove it (zeertzjq).

closes: #17472

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-09 20:34:57 +02:00
82a96e3dc0 patch 9.1.1443: potential buffer underflow in insertchar()
Problem:  potential buffer underflow in insertchar()
Solution: verify that end_len is larger than zero
          (jinyaoguo)

When parsing the end-comment leader, end_len can be zero if
copy_option_part() writes no characters. The existing check
unconditionally accessed lead_end[end_len-1], causing potential
underflow when end_len == 0.

This change adds an end_len > 0 guard to ensure we only index lead_end
if there is at least one character.

closes: #17476

Signed-off-by: jinyaoguo <guo846@purdue.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-09 20:31:17 +02:00
69565e3618 patch 9.1.1442: tests: Test_diff_fold_redraw() is insufficient
Problem:  tests: Test_diff_fold_redraw() is insufficient
          (after v9.1.1439, Christ van Willegen)
Solution: improve the test (Gary Johnson)

The original Test_diff_fold_redraw() function, added 2025-06-08 at patch
9.1.1439, had a bug and didn't do a very good job of testing the fold
behavior.  This new version is simpler and more thorough.

The bug was that it checked the fold state of one window twice instead
of checking both windows.

closes: #17492

Signed-off-by: Gary Johnson <garyjohn@spocom.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-09 20:19:35 +02:00
09a62e6f64 runtime(netrw): cleanup Decho related comments
closes: #17465

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-09 16:04:05 +02:00
b8ee1cf56e patch 9.1.1441: completion: code can be improved
Problem:  completion: code can be improved
Solution: remove reposition_match() and use mergesort_list(),
          for fuzzy completion, sort by fuzzy score immediately after
          setting a new leader (Girish Palya)

closes: #17460

Co-authored-by: glepnir <glephunter@gmail.com>
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-08 16:20:06 +02:00
80a7921a02 runtime(nginx): Add NGINX directive for background cache updates
Docs: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_background_update

closes: #17458

Signed-off-by: S0AndS0 <strangerthanbland@gmail.com>
Signed-off-by: Chris Aumann <me@chr4.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-08 16:15:00 +02:00
9cb27a57c8 patch 9.1.1440: too many strlen() calls in os_win32.c
Problem:  too many strlen() calls in os_win32.c
Solution: refactor code and remove calls to strlen()
          (John Marriott)

The following changes have been made:
- In mch_init_g():
  - refactor to remove calls to STRLEN().
  - use vim_strnsave() instead of vim_strsave().
  - set a flag if vimrun_path is stored in allocated memory so it can be
     freed at exit.
- In mch_exit() free vimrun_path if it was stored in allocated memory.
- In fname_case() make a small optimisation by measuring the length of
  name only if needed.
- In copy_extattr() make a small optimisation by replacing call to
  STRCAT() with STRCPY().

closes: #17462

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-08 16:05:53 +02:00
3fa0d3514b patch 9.1.1439: Last diff folds not merged
Problem:  Last diff folds not merged (after v8.1.1922)
Solution: loop over all windows in the current tabpage and update all
          folds (Gary Johnson)

This commit fixes a bug where the last two folds of a diff are not
merged when the last difference between the two diff'd buffers is
resolved.

Normally, when two buffers are diff'd, folding is used to show only the
text that differs and to hide the text that is the same between the two
buffers.  When a difference is resolved by making a block of text the
same in both buffers, the folds are updated to merge that block with the
folds above and below it into one closed fold.

That updating of the folds did not occur when the block of text was the
last diff block in the buffers.

The bug was introduced by this patch on August 24, 2019:

    patch 8.1.1922: in diff mode global operations can be very slow

    Problem:    In diff mode global operations can be very slow.
    Solution:   Do not call diff_redraw() many times, call it once when
		redrawing.  And also don't update folds multiple times.

Unfortunately, folds were then not updated often enough.

The problem was fixed by adding a short loop to the ex_diffgetput()
function in diff.c to update all the folds in the current tab when the
last difference is removed.

A test for this was added to test_diffmode.vim.  Two of the reference
screen dumps for another test in that file,
Test_diffget_diffput_linematch(), had to be changed to have all the
folds closed rather than to have the last diff block remain open.

closes: #17457

Signed-off-by: Gary Johnson <garyjohn@spocom.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-08 16:00:06 +02:00
c4eb1cb17b patch 9.1.1438: tests: Test_breakindent_list_split() fails
Problem:  tests: Test_breakindent_list_split() fails
          (Phạm Bình An)
Solution: Always reset "&columns" and "&lines" for GUI builds
          (Aliaksei Budavei)

Ensure that "&columns" and "&lines" are always set to their
default values before calling "SetUp()", if any, for EACH
test run by a GUI build to avoid yet-to-be-run tests from
inheriting possibly changed values (after window resizing)
and leading to broken assumptions about available estate and
occasional test failures.

fixes: #17453
closes: #17447

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-08 15:52:42 +02:00
0174d8f386 patch 9.1.1437: MS-Windows: internal compile error in uc_list()
Problem:  MS-Windows: internal compile error in uc_list() with VS 17.14
          (ibear)
Solution: refactor code slightly (Mike Williams)

fixes: #17402
closes: #17464

Signed-off-by: Mike Williams <mrmrdubya@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-08 15:41:52 +02:00
8f7256a5ee runtime(doc): fix some style issues and remove obsolete docs
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-07 18:31:42 +02:00
834bb85172 runtime(vim): vimHLGroup is not highlighted correctly
Problem: vimHLGroup is not highlighted in "hi def link"
          and "hi clear" commands
Solution: highlight vimHLGroup similarly to vimGroup
          (Eisuke Kawashima)

closes: #17450

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-07 17:59:11 +02:00
6acca4bc59 runtime(vim): remove trailing whitespace in Vim syntax generator
related: #17450

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-07 17:56:57 +02:00
ce2769b5fe patch 9.1.1436: GUI control code is displayed on the console on startup
Problem:  GUI control code is displayed on the console on startup
Solution: check if Vim is starting up (Hirohito Higashi)

closes: #17456

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-07 17:49:35 +02:00
2897a8d040 CI: bump xcode to 16.4
closes: #17446

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-07 17:45:21 +02:00
d1a975ae64 runtime(netrw): upstream snapshot of v181
closes: #17461

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-07 17:35:18 +02:00
eb59129d2c runtime(typescript): remove Fixedgq() function from indent script
Problem:
1. The `Fixedgq()` function is broken (see #17412)
2. The `'formatexpr'` for Typescript is not documented, which causes
   confusion to users when they try to set `'formatprg'`, since
   `'formatexpr'` always takes precedence over `'formatprg'`. See also
   https://github.com/HerringtonDarkholme/yats.vim/issues/209
3. Typescript already has a very good and popular formatter called
   `prettier`, that can be easily integrated to Vim via `'formatprg'`
   (see #16989). I don't think there are any good reasons to reinvent a
   half-baked version in Vim.

Solution:  Remove the Fixedgq() 'formatexpr' function.

fixes: #17412
closes: #17452

Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-05 21:21:35 +02:00
002548b81e runtime(doc): Add missing 'wfb' (winfixbuf) tag
closes: #17455

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-05 21:18:09 +02:00
8cd42a58b4 patch 9.1.1435: completion: various flaws in fuzzy completion
Problem:  completion: various flaws in fuzzy completion
Solution: fix the issues (Girish Palya)

- Remove the brittle `qsort()` on `compl_match_array`.
- Add a stable, non-recursive `mergesort` for the internal doubly
  linked list of matches.
- The sort now happens directly on the internal representation (`compl_T`),
  preserving sync with external structures and making sorting stable.
- Update fuzzy match logic to enforce `max_matches` limits after
  sorting.
- Remove `trim_compl_match_array()`, which is no longer necessary.
- Fixe test failures by correctly setting `selected` index and
  maintaining match consistency.
- Introduce `mergesort_list()` in `misc2.c`, which operates generically
  over doubly linked lists.
- Remove `pum_score` and `pum_idx` variables

fixes: #17387
closes: #17430

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-05 21:09:24 +02:00
738df3887f patch 9.1.1434: MS-Windows: missing out-of-memory checks in os_win32.c
Problem:  MS-Windows: missing out-of-memory checks in os_win32.c
Solution: Add out-of-memory checks to os_win32.c (John Marriott)

closes: #17441

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-05 20:49:39 +02:00
8f751d56f4 patch 9.1.1433: Unnecessary :if when writing session
Problem:  Unnecessary :if in session where both branches have the same
          effect (after 9.1.1431).
Solution: Remove the superfluous :if (zeertzjq).

closes: #17448

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-05 20:25:51 +02:00
1cccdebc0f runtime(vim): Update base-syntax, improve Vim9 block start pattern
The opening curly brace must be followed by whitespace, comment or
trailing bar.

closes: #17454

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-05 20:23:07 +02:00
a2dd40c057 runtime(openPlugin): Add URLOpen to not expand special chars
closes: #17424

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-04 21:59:01 +02:00
dfed077e06 runtime(doc): fix small errors from rev 2090405de5
- update the netrw window to current version (and trim it slightly to 80
  chars)
- remove a trailing double quote

Co-authored-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-04 21:40:21 +02:00
08896dd330 patch 9.1.1432: GTK GUI: Buffer menu does not handle unicode correctly
Problem:  GTK GUI: Buffer menu does not handle unicode correctly
Solution: Get rid of the BMHash() function (SUN Haitao)

fixes: #17403
closes: #17405

Signed-off-by: SUN Haitao <sunhaitao@devtaste.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-04 21:25:31 +02:00
d6c9ac97a0 runtime(doc): clarify the effect of 'smarttab'
closes: #17426

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-04 21:19:18 +02:00
0ca5966196 patch 9.1.1431: Hit-Enter Prompt when loading session files
Problem:  Hit-Enter Prompt when loading session files
Solution: use set+= for 'shortmess' to keep the existing flags
          (Miguel Barro)

closes: #17445

Signed-off-by: Miguel Barro <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-04 21:03:27 +02:00
bb78ea23c6 runtime(mbsync): Add support for TLSType in syntax script
closes: #17438

Signed-off-by: Filippo Bonazzi <filippo.bonazzi@suse.com>
Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-04 20:13:57 +02:00
862cb37544 patch 9.1.1430: tabpanel may flicker in the GUI
Problem:  tabpanel may flicker in the GUI
Solution: call scroll_start() and scroll_region_reset()
          (Hirohito Higashi)

fixes: #17440
closes: #17442

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-04 20:05:59 +02:00
c2c9132420 runtime(new-tutor): update the "correct" text in tutor.tutor.json
Change from "Document '&variable'" to the expected correct result
"TODO: Document '&variable'"

closes: #17417

Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-03 21:20:00 +02:00
a1522f7c0d patch 9.1.1429: dragging outside the tabpanel changes tabpagenr
Problem:  dragging outside the tabpanel changes tabpagenr (char101)
Solution: set in_tab_line and in_tabpanel variables (Hirohito Higashi)

fixes: #17385
closes: #17431

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-03 21:09:06 +02:00
86d46a7018 patch 9.1.1428: completion: register completion needs cleanup
Problem:  completion: register completion needs cleanup
Solution: slightly refactor get_register_completion()
          (glepnir)

closes: #17432

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-03 21:04:44 +02:00
b29e37133d patch 9.1.1427: rendering artifacts with the tabpanel
Problem:  rendering artifacts with the tabpanel
          (char101)
Solution: prevent double redraw, use Columns instead of frame width
          (Hirohito Higashi)

fixes: #17429
closes: #17435

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-03 20:57:57 +02:00
2090405de5 runtime(doc): make examples verbatim to prevent conceal/tag parsing
closes: #17437

Signed-off-by: Yochem van Rosmalen <git@yochem.nl>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-03 20:54:33 +02:00
bfeefc474a runtime(doc): clarify the effect of exclusive single char selections
closes: #17410

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-02 19:56:57 +02:00
d5fdfa5c9c patch 9.1.1426: completion: register contents not completed
Problem:  CTRL-X CTRL-R only completes individual words from registers,
          making it difficult to insert complete register content.
Solution: Add consecutive CTRL-X CTRL-R support - first press completes
          words, second press completes full register lines, similar to
          CTRL-X CTRL-L and CTRL-X CTRL-P behavior (glepnir).

closes: #17395

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-02 19:45:41 +02:00
3993cd619a runtime(vim): Update base-syntax, bug fixes
- Contain :profdel arguments.
- Fix string highlighting immediately after lambda -> operators.

Reported by Aliaksei Budavei.

closes: #17427

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-02 19:31:10 +02:00
3b9b95dc63 patch 9.1.1425: tabpanel: there are still some problems with the tabpanel
Problem:  tabpanel: there are still some problems with the tabpanel with
          column handling
Solution: fix the problems and refactor Tabpanel feature (Hirohito
          Higashi).

fixes: #17423
fixes: #17332
closes: #17336

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-01 20:22:55 +02:00
6c40df09e0 patch 9.1.1424: PMenu selection broken with multi-line selection and limits
Problem:  PMenu selection broken with multi-line selection and limits
          (Maxim Kim)
Solution: update completion match index when limiting the completion
          sources (Girish Palya)

fixes: #17394
closes: #17401

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-01 20:11:59 +02:00
cba66cf894 patch 9.1.1423: :tag command not working correctly using Vim9 Script
Problem:  :tag command not working correctly using Vim9 Script
Solution: inject a ':' before the numeric address, to make the command
          valid in Vim9 context

fixes: #17415
closes: #17418

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-01 19:47:03 +02:00
98c29dbfd1 patch 9.1.1422: scheduling of complete function can be improved
Problem:  scheduling of complete function can be improved
Solution: call user completion functions earlier when just determining
          the insertion column (Girish Palya)

This change improves the scheduling behavior of async user-defined
completion functions (such as `F{func}`, `F`, or `'o'` values in the
`'complete'` option), particularly benefiting LSP clients.

Currently, these user functions are invoked twice:

1. First with `findstart = 1` to determine the completion start
   position.
2. Then with `findstart = 0` to retrieve the actual matches.

Previously, both calls were executed back-to-back. With this change, the
first call (`findstart = 1`) is performed earlier—before any matches are
gathered from other sources.

This adjustment gives event-driven completion sources (e.g., LSP
clients) more time to send their requests while Vim concurrently
collects matches from other sources like the current buffer.

Not sure about the real-world performance gains, but this approach
should, in theory, improve responsiveness and reduce latency for
asynchronous completions.

To test, try using yegappan LSP client:

```vim
set cpt+=o^10
autocmd VimEnter * g:LspOptionsSet({ autoComplete: false, omniComplete: true })
```

If you prefer to use 'native' auto-completion (without plugins), try the
following configuration:

```vim
set cot=menuone,popup,noselect,nearest
autocmd TextChangedI * InsComplete()
def InsComplete()
  if getcharstr(1) == '' && getline('.')->strpart(0, col('.') - 1) =~ '\k$'
    SkipTextChangedI()
    feedkeys("\<c-n>", "n")
  endif
enddef
inoremap <silent> <c-e> <c-r>=<SID>SkipTextChangedI()<cr><c-e>
inoremap <silent> <c-y> <c-r>=<SID>SkipTextChangedI()<cr><c-y>
def SkipTextChangedI(): string
  set eventignore+=TextChangedI
  timer_start(1, (_) => {
    set eventignore-=TextChangedI
  })
  return ''
enddef
inoremap <silent><expr> <tab> pumvisible() ? "\<c-n>" : "\<tab>"
inoremap <silent><expr> <s-tab> pumvisible() ? "\<c-p>" : "\<s-tab>"
```

closes: #17396

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-01 19:40:00 +02:00
95ea0b0f8d runtime(doc): make 'shiftwidth' setting more precise
closes: #17414

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-01 19:10:36 +02:00
a541f1de2b patch 9.1.1421: tests: need a test for the new-style tutor.tutor
Problem:  tests: need a test for the new-style tutor.tutor, patch
          9.1.1384 broke the expected positions for the signs
Solution: Update all number keys in tutor.tutor.json to match the
          correct line numbers in tutor.tutor, replace tabs by spaces,
          add a screen-dump test to verify it does not regress
          (Pham Bình An)

closes: #17416

Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-01 18:58:09 +02:00
b577ad50d0 runtime(java): Match annotation- and interface-type names of "java.lang"
Complement the documented support for the recognition of all
public types of the "java.lang" package (":help java.vim").
(The original syntax item generator may have, inadvertently,
contributed via suppressing "NullPointerException"s to not
having annotation and interface types qualify in general.)

Also, re-link usage instructions for the alternative syntax
item generator to a rolling "master"'s version.

closes: #17419

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-01 18:29:37 +02:00
0aaf6f8bbb runtime(vim): Update base-syntax, improve :profile highlighting
Match full :profile and :profdel commands.

closes: #17420

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-01 18:26:39 +02:00
086b3b5b79 runtime(vim): Update base-syntax, improve :mark and :substitute highlighting
- Match full :mark and :k commands.
- Match 2 and 3 letter :s repeat commands.
- Match :s [count] argument.

closes: #17408

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-31 17:52:48 +02:00
54a09e7e86 patch 9.1.1420: tests: could need some more tests for shebang lines
Problem:  tests: could need some more tests for shebang lines
Solution: add more shebang patterns to test_filetype.vim
          (Eisuke Kawashima)

closes: #17409

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-31 12:30:59 +02:00
055cca88c4 runtime(java): Reference a modern syntax item generator for type names
And generalise the sourcing of "javaid.vim" for Java
buffers.

Resolves zzzyxwvut/java-vim#10.
closes: #17411

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-31 12:25:15 +02:00
8cc6d8b187 patch 9.1.1419: It is difficult to ignore all but some events
Problem:  It is difficult to ignore all but some events.
Solution: Add support for a "-" prefix syntax in '(win)eventignore' that
          subtracts an event from the ignored set if present
          (Luuk van Baal).

closes: #17392

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-31 12:10:31 +02:00
647d7f7389 runtime(doc): fix typo in tag for helptoc package
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-31 12:06:49 +02:00
77959dc644 runtime(doc): CI fails with trailing whitespace error in usr_30.txt
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-30 20:14:16 +02:00
6b2c1ad054 runtime(doc): clarify behaviour of set maxcombine=0
related: #17400

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-30 17:43:42 +02:00
a54baccdd5 runtime(doc): update todo list
It is now possible to use omni-completion by adding the "o" flag to
'complete'

fixes: #17393

Co-authored-by: Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-30 17:38:30 +02:00
a4a3f712e2 runtime(doc): clarify tabstop settings and guidance
closes: #17381

Signed-off-by: Damien Lejay <damien@lejay.be>
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-30 17:36:37 +02:00
570e71a277 runtime(vim): Update base-syntax, improve :set highlighting
- Match comments and trailing bar after :set without args.
- Match the <...> form for key code options.
- Remove orphaned vim_ex_python[3x]* dump files (Aliaksei Budavei).

closes: #17397

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-30 16:17:30 +02:00
d65cdadb7b runtime(doc): Fix typos and language in documentation for tabpanel.
closes: #17407

Signed-off-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-30 16:05:58 +02:00
5199567fd0 patch 9.1.1418: configures GUI auto detection favors GTK2
Problem:  configures GUI auto detection favors GTK2
Solution: make configure favor GTK3 over GTK2 for the GUI
          when auto detecting the gui toolkit (Drew Vogel).

Prior to these changes if the dev packages for both GTK2 and GTK3 were
installed, the `--enable-gui=auto` would used GTK2. After these changes
it will use GTK3. Users can still use `--enable-gui=gtk2` to
specifically select GTK2.

In addition to the prioritization change, this also brings some cleanups
to the GTK autoconf code:

* The `AM_PATH_GTK` macro had an unused third argument that has been
  removed.
* The `AM_PATH_GTK` macro checked the `SKIP_GTK2` & `SKIP_GTK3`
  variables but the code that decided whether to call it also checked
  those. Now just the calling code does so.
* The `AM_PATH_GTK` macro set a default minimum version based on
  `SKIP_GTK2` and `SKIP_GTK3` but the calling code was also expected to
  pass a version. Now the calling code _must_ pass a version.
* The GTK test program previous used `gtk_(major|minor|micro)_version`
  as all of: a C variable name, a C macro provided only by GTK2, and an
  autoconf variable name. It also needlessly parsed a `x.y.z` version
  string when the same string was already parsed by autoconf + sed. Now
  the parsed values are used directly in the test program.
* The GTK test program previous created a test program `conf.gtktest`
  which was cleaned up by the autoconf script. This appeared to be a
  crude way to debug whether an erroring configure run had actually run
  the test program. Instead the autoconf script now outputs more messaging
  and the user can check `config.log` to determine the status of the
  configure script.

I'm not an autoconf expert and I don't have access to some of the older
systems we try to support with gvim. So I would very much appreciate if
anyone could run this on their systems to ensure it doesn't misbehave.

While my motivation here is mainly to further establish GTK3 as the
primary GUI mode, this should at least partially address the concern
described in #15437.

Here are a few test runs with both GTK 2 and GTK 3 installed:

```
    --with-features=huge \
    --enable-gui \
    --enable-gtk3-check=no \
    --enable-gtktest \
```

```
checking --enable-gui argument... yes/auto - automatic GUI support
checking whether or not to look for GTK+ 2... yes
checking whether or not to look for GNOME... no
checking whether or not to look for GTK+ 3... no
checking whether or not to look for Motif... yes
checking for pkg-config... /usr/bin/pkg-config
checking --disable-gtktest argument... gtk test enabled
checking for pkg-config gtk+-2.0... found
checking for GTK - version >= 2.2.0... yes; found version 2.24.33
checking ability to compile GTK test program... yes
```

```
    --with-features=huge \
    --enable-gui \
    --enable-gtk2-check=no \
    --enable-gtktest \
```

```
checking --enable-gui argument... yes/auto - automatic GUI support
checking whether or not to look for GTK+ 2... no
checking whether or not to look for GTK+ 3... yes
checking whether or not to look for Motif... yes
checking for pkg-config... /usr/bin/pkg-config
checking --disable-gtktest argument... gtk test enabled
checking for pkg-config gtk+-3.0... found
checking for GTK - version >= 3.0.0... yes; found version 3.24.49
checking ability to compile GTK test program... yes
```

```
    --with-features=huge \
```

```
checking --enable-gui argument... yes/auto - automatic GUI support
checking whether or not to look for GTK+ 2... yes
checking whether or not to look for GNOME... no
checking whether or not to look for GTK+ 3... yes
checking whether or not to look for Motif... yes
checking for pkg-config... /usr/bin/pkg-config
checking --disable-gtktest argument... gtk test enabled
checking for pkg-config gtk+-3.0... found
checking for GTK - version >= 3.0.0... yes; found version 3.24.49
checking ability to compile GTK test program... yes
```

```
    --with-features=huge \
    --disable-gtktest \
```

```
checking --enable-gui argument... yes/auto - automatic GUI support
checking whether or not to look for GTK+ 2... yes
checking whether or not to look for GNOME... no
checking whether or not to look for GTK+ 3... yes
checking whether or not to look for Motif... yes
checking for pkg-config... /usr/bin/pkg-config
checking --disable-gtktest argument... gtk test disabled
checking for pkg-config gtk+-3.0... found
checking for GTK - version >= 3.0.0... yes; found version 3.24.49
```

```
    --with-features=huge \
    --enable-gui=gtk2 \
```

```
checking --enable-gui argument... GTK+ 2.x GUI support
checking for pkg-config... /usr/bin/pkg-config
checking --disable-gtktest argument... gtk test enabled
checking for pkg-config gtk+-2.0... found
checking for GTK - version >= 2.2.0... yes; found version 2.24.33
checking ability to compile GTK test program... yes
```

```
    --with-features=huge \
    --enable-gui=gtk3 \
```

```
checking --enable-gui argument... GTK+ 3.x GUI support
checking for pkg-config... /usr/bin/pkg-config
checking --disable-gtktest argument... gtk test enabled
checking for pkg-config gtk+-3.0... found
checking for GTK - version >= 3.0.0... yes; found version 3.24.49
checking ability to compile GTK test program... yes
```

And here is a similar run with the GTK 3 dev package removed:

```
    --with-features=huge \
    --enable-gui=gtk3 \
    --enable-fail-if-missing \
```

```
checking --disable-gtktest argument... gtk test enabled
checking for pkg-config gtk+-3.0... no; consider installing your distro
GTK -dev package
configure: error: pkg-config could not find gtk+-3.0
```

closes: #17369

Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-28 21:17:15 +02:00
49864aecd0 patch 9.1.1417: missing info about register completion in complete_info()
Problem:  missing info about register completion in complete_info()
          (after v9.1.1408)
Solution: update documentation and mention that register is used as
          source, add a test (glepnir)

closes: #17389

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-28 20:42:42 +02:00
19ef6b0b4b patch 9.1.1416: completion limits not respected for fuzzy completions
Problem:  completion limits not respected when using fuzzy completion
          (Maxim Kim)
Solution: trim completion array (Girish Palya)

fixes: #17379
closes: #17386

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-28 20:33:12 +02:00
0bc8709a63 runtime(doc): Correct allowed flags after :substitute repeat
closes: #17391

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-28 20:23:29 +02:00
ac83b3c373 patch 9.1.1415: potential use-after free when there is an error in 'tabpanel'
Problem:  potential use-after free when there is an error in 'tabpanel'
          option (@char101, after v9.1.1391)
Solution: check if p_tpl has been set to null before accessing it again.

While at it slightly change starts_with_percent_and_bang() and use the
existing opt_name and opt_scope variables.

fixes: #17364
closes: #17388

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-27 20:49:34 +02:00
f0c7090a38 runtime(doc): trailing whitespace in options.txt, delete it.
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-26 21:18:19 +02:00
e99987d3c0 translation(hy): renamed am.po -> hy.po for armenian lang translations
According to ISO-639, the correct 2 letter language code is HY not AM,
so let's rename am.po.

Also, add hy.po to the CHECKFILES Make target and convert the file to
Unix lineformat.

closes: #17380

Signed-off-by: Gagik Hakobyan <hakgagik@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-26 21:11:51 +02:00
a6172f8c5c runtime(doc): Correct allowed characters at :help 'filetype'
closes: #17366

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-26 20:32:35 +02:00
2c7ccaab87 patch 9.1.1414: MS-Windows: compile warnings in os_win32.c
Problem:  MS-Windows: compile warnings in os_win32.c
Solution: update function declarations, correctly access param arg in
          set_flag() using (sig_atomic_t) cast (John Marriott)

closes: #17368

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-26 20:25:38 +02:00
318ff9c362 patch 9.1.1413: spurious CursorHold triggered in GUI on startup
Problem:  spurious CursorHold triggered in GUI on startup
Solution: init global did_cursorhold flag to true
          (Gary Johnson)

When Vim is started in GUI mode, the CursorHold autocommand event is
triggered 'updatetime' milliseconds later, even when the user has not
pressed a key.  This is different from the behavior of Vim in terminal
mode, which does not trigger a CursorHold autocommand event at startup,
and contradicts the description of the CursorHold event in ":help
CursorHold", which states that the event is "[n]ot triggered until the
user has pressed a key".

The fix is to change the initial value of did_cursorhold from FALSE to
TRUE.  While it is true that the CursorDone event has not been done yet
at startup, it should appear to have been done until the user presses
a key.

fixes #17350
closes: #17382

Signed-off-by: Gary Johnson <garyjohn@spocom.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-26 20:10:25 +02:00
a004e5108c patch 9.1.1412: tests: Test_tabpanel_tabonly() fails on larger screens
Problem:  tests: Test_tabpanel_tabonly() fails on larger screens
Solution: re-generate screendump file for 78 column large terminal

closes: #17376

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-26 19:54:07 +02:00
a88c5bdcce patch 9.1.1411: crash when calling non-existing function for tabpanel
Problem:  crash when calling non-existing function for tabpanel (Yamagi,
          after v9.1.1391)
Solution: check if there was an error and if there was, set tabpanel
          option to empty to prevent showing errors on every redraw

fixes: #17364
closes: #17375
closes: #17371

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-26 19:51:03 +02:00
7c621052c3 patch 9.1.1410: out-of-bounds access with 'completefunc'
Problem:  out-of-bounds access with 'completefunc' (csetc)
Solution: check if it is safe to advance cpt_sources_index
          (Girish Palya)

fixes: #17363
closes: #17374

Co-authored-by: @csetc
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-26 19:41:59 +02:00
14f6da5ba8 patch 9.1.1409: using f-flag in 'complete' conflicts with Neovim
Problem:  using f-flag in 'complete' conflicts with Neovims filename
          completion (glepnir, after v9.1.1301).
Solution: use upper-case "F" flag for completion functions
          (Girish Palya).

fixes: #17347
closes: #17378

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-26 19:04:25 +02:00
0546068aae patch 9.1.1408: not easily possible to complete from register content
Problem:  not easily possible to complete from register content
Solution: add register-completion submode using i_CTRL-X_CTRL-R
          (glepnir)

closes: #17354

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-26 18:25:57 +02:00
69c3493adc runtime(doc): clarify license conditions for distributed runtime files
related: #17372

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-25 17:07:51 +02:00
c8b7e6129a runtime: Add license information for HCL and Terraform runtime files
fixes: #17372
closes: #17377

Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-25 17:01:45 +02:00
5717ee33db patch 9.1.1407: Can't use getpos('v') in OptionSet when using setbufvar()
Problem:  Can't use getpos('v') in OptionSet when using setbufvar().
Solution: Don't reset Visual selection when switching to the same
          buffer (zeertzjq).

closes: #17373

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-25 16:59:50 +02:00
9772025d24 patch 9.1.1406: crash when importing invalid tuple
Problem:  crash when importing invalid tuple
          (Yang LUO, Yanju Chen)
Solution: set type to VAR_UNKNOWN, so that it isn't freed
          (Yegappan Lakshmanan)

closes: #17362

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-23 17:39:44 +02:00
9ff1e598e8 patch 9.1.1405: tests: no test for mapping with special keys in session file
Problem:  tests: no test for mapping with special keys in session file.
Solution: Add a special keys to an existing test.  Also test with UTF-8
          characters containing 0x80 or 0x9b bytes (zeertzjq).

closes: #17360

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-23 17:16:17 +02:00
e8302da74a patch 9.1.1404: wrong link to Chapter 2 in new-tutor
Problem:  wrong link to Chapter 2 in vim-01-beginner.tutor
Solution: Fix the link to Chapter 2, add test for links in tutor files
          (Phạm Bình An)

In order to write the test, I expose the function `s:GlobTutorials` as
`tutor#GlobTutorials` and make it also accept a `locale` argument.

closes: #17356

Signed-off-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-22 22:53:28 +02:00
f4b2fce71c runtime(vim): Update base-syntax, fix missing luaParenError error
We shouldn't assume that the luaParenError syntax group is present in
the, possibly custom, included file or that it hasn't already been
removed.  However, issue #11277 has been fixed so it no longer needs to
be cleared.

Fixes comment https://github.com/vim/vim/pull/15375#issuecomment-2899791944

related: #15375
closes: #17357

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-22 22:48:58 +02:00
598bbb1941 patch 9.1.1403: expansion of 'tabpanelopt' value adds wrong values
Problem:  expansion of 'tabpanelopt' value adds wrong values
          (Shane-XB-Qian, after v9.1.1391)
Solution: update tabpanelopt expansion function and expand only valid
          values (Hirohito Higashi)

related: #17263
closes: #17359

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-22 22:41:05 +02:00
5b07aff2f6 patch 9.1.1402: multi-byte mappings not properly stored in session file
Problem:  multi-byte mappings not properly stored in session file
Solution: unescape the mapping before writing out the mapping, prefer
          single-byte mapping name if possible (Miguel Barro)

closes: #17355

Signed-off-by: GuyBrush <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-22 22:34:31 +02:00
1a8be6b447 runtime(syntax-tests): rename kornshell syntax tests and regenerate 00 dumps
related: #17348

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-22 21:55:58 +02:00
b0691b46bd runtime(sh): Fix various syntax highlighting problems in ksh93 scripts
- Fixed syntax highlighting for ksh93 namespace variables starting
  with '${.'
- Added support for the alarm, eloop, fds, mkservice, pids, poll and
  sha2sum builtins (which are indeed ksh93 builtins, albeit whether or
  not they are available depends on the ksh release and the compiled
  SHOPT options).
- Added support for the many Unix commands provided by ksh93's libcmd
  as builtin commands (since these are general commands, scripts for
  other shells like bash will also highlight these).
  - The dumps for the sh_0{2,5,6,8,9}.sh were recreated due to this
    change affecting commands those scripts call (e.g. 'wc').
- Enabled ${parameter/pattern/string} and friends for ksh syntax.
- Enabled case modification for ksh. See also:
  https://github.com/ksh93/ksh/commit/c1762e03
- Enabled ;;& support for ksh. See also:
  https://github.com/ksh93/ksh/commit/fc89d20a
- Added many special ksh variables using 93u+m's data/variables.c
  as a reference.

If vim can't figure out which ksh release is in play using e.g.
the hashbang path, in such a case a generic default that enables
everything and the kitchen sink will be used. Otherwise, features will
be disabled if it's absolutely known a certain feature will not be
present. Examples:
   - ERRNO is ksh88 specific, so that is locked to ksh88.
   - Only 93u+m (assumed for generic) has SRANDOM, and only 93u+m
     and 93v- have case modification support.
   - 93u+ and 93v- have VPATH and CSWIDTH variables (the latter
     is vestigal, but still present in the hardcoded variable table).
   - 93v- and ksh2020 have (buggy and near unusable) implementations
     of compgen and complete.
   - Only mksh provides function substitutions, i.e. ${|command;}.

This took the better part of my day to implement. It seems to work well
enough though. (Also had to regenerate the dumps again while testing
it, as now there are dup scripts with mere hashbang differences, used
solely for testing syntax highlighting differences.)

closes: #17348

Signed-off-by: Johnothan King <johnothanking@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-21 21:21:14 +02:00
56b1207e66 patch 9.1.1401: list not materialized in prop_list()
Problem:  list not materialized in prop_list()
          (Nickwiz)
Solution: materialize list before accessing it

fixes: #17298
closes: #17349

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-21 21:01:40 +02:00
1307743697 patch 9.1.1400: [security]: use-after-free when evaluating tuple fails
Problem:  [security]: use-after-free when evaluating tuple fails
Solution: return early in case of an error (Yegappan Lakshmanan)

closes: #17351

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-21 20:54:27 +02:00
681f1c914f patch 9.1.1399: tests: test_codestyle fails for auto-generated files
Problem:  tests: test_codestyle fails for auto-generated files.
          While those files are already ignored in Test_source_Files(),
          the newly added Test_indent_of_source_files() does not filter
          those out and causes test failures on appveyor.
Solution: factor out the generation of all c files into a common function
          and filter out auto-generated files if_ole.h, iid_ole.c and
          dlldata.c

closes: #17352

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-21 20:50:11 +02:00
719ec0fe15 runtime(tar): preserve pwd when reading and writing tar files
While at it, use `:lcd` to temporarily set the window local directory
instead of `:cd` for the global working directory.

fixes: #17334
closes: #17339

Signed-off-by: Michele Sorcinelli <michelesr@autistici.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-19 19:48:04 +02:00
5a8f9958e2 runtime(doc): remove outdated Contribution section in pi_tutor
Problem:  The Github repo link in the Contribution section has been
          archived for 5 years. So people who want to contribute to the
          tutor plugin should just send PR to Vim repo, similar to most
          other Vim features, so there is no need for a Contribution
          section in the plugin doc.

Solution: Replace it with an Original Author note at the beginning of
          the help document.

closes: #17341

Signed-off-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-19 19:34:44 +02:00
5ad53ca99f runtime(muttrc): fix mangled keywords in syntax script
Regression introduced in commit 10f23e10a9 ("Update syntax/muttrc.vim to
latest mutt (#12797)", 2023-08-15)

Affected keywords:
  invresume_draft_files
  invresume_edited_draft_files
  mailcap_path
  mark_macro_prefix

closes: #17344

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-19 19:31:23 +02:00
7b5550fac7 runtime(vim): Update base-syntax, improve :import highlighting
- Match "autoload" as a keyword in :import commands.
- Match an expression argument for the filename.

closes: #15375

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-18 20:37:34 +02:00
0816f17e9a patch 9.1.1398: completion: trunc does not follow Pmenu highlighting attributes
Problem:  When items are combined with user-defined highlight attributes
          (e.g., strikethrough), trunc inherits these attributes, making
          the text difficult to read.
Solution: trunc now uses the original Pmenu and PmenuSel highlight
          attributes (glepnir)

closes: #17340

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-18 20:14:53 +02:00
a577e4289c runtime(vim): Update base-syntax, improve script-interface command highlighting
- Normalise interface heredoc highlighting with that used for
  :let-heredocs.
- Remove interface feature testing.  The Lua and Python interface
  command scripts are now highlighted by default.  Loading all syntax
  files incurs an undesirable load-time burden so highlighting of the
  less popular MzScheme, Perl, Ruby and Tcl interfaces is disabled by
  default.  g:vimsyn_embed can still be used to customise the supported
  interfaces.
- Always highlight interface ex-commands as valid commands, even when
  the corresponding command-script highlighting is disabled.
- Highlight simple command-script statements as well as heredocs.
- Remove error highlighting of heredoc and statement command-script
  regions when an interface is disabled.  These are now highlighted as
  plain text.
- Allow indented heredoc end tokens when "trim" is specified.
- Match interface heredocs in :def functions.
- Fix runaway vimEmbedError regions.  These regions have been removed.
- Use python2 syntax for :python, and :pythonx when 'pyxversion' is
  appropriately set.

closes: #15522

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-17 16:29:13 +02:00
2a1e253e26 patch 9.1.1397: tabpanel not correctly updated on :tabonly
Problem:  tabpanel not correctly updated on :tabonly
          (Maxim Kim)
Solution: force a redraw, take 'equalalways' into account
          (Naruhiko Nishino)

related: https://github.com/vim/vim/pull/17330#issuecomment-2888146370
closes: #17337

Signed-off-by: Naruhiko Nishino <naru123456789@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-17 16:19:24 +02:00
7b9eb6389d patch 9.1.1396: 'errorformat' is a global option
Problem:  The 'grepformat' option is global option, but it would be
          useful to have it buffer-local, similar to 'errorformat' and
          other quickfix related options (Dani Dickstein)
Solution: Add the necessary code to support global-local 'grepformat',
          allowing different buffers to parse different grep output
          formats (glepnir)

fixes: #17316
closes: #17315

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-16 19:49:23 +02:00
670d0c1468 patch 9.1.1395: search_stat not reset when pattern differs in case
Problem:  search_stat not reset when pattern differs in case
          (tahzibijafar)
Solution: use STRNCMP instead of MB_STRNICMP macro

There was a long standing todo comment, that using MB_STRNICMP is wrong.
So let's change it to STRNCMP() instead. Even if it not handle
multi-byte characters correctly, then Vim will rather recompute the
search stat, instead of re-using the old (and possibly wrong) value.

fixes: #17312
closes: #17314

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-16 19:38:50 +02:00
c659e4a516 patch 9.1.1394: tabpanel not correctly redrawn on tabonly
Problem:  tabpanel not correctly redrawn on tabonly
          (Maxim Kim, after v9.1.1391)
Solution: force redraw of the tabpanel, tweak style
          (Hirohito Higashi)

fixes: #17322
closes: #17330

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-16 19:36:56 +02:00
ba19b65899 runtime(doc): fix typo in description of :redrawtabpanel
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-15 20:16:04 +02:00
Kat
6451e5f517 runtime(gleam): add @Spell clusters to syntax script
closes: #17324

Signed-off-by: Kat <65649991+00-kat@users.noreply.github.com>
Signed-off-by: Kirill Morozov <kirill@robotix.pro>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-15 20:10:48 +02:00
1aa68dffbf runtime(pandoc): update YAML metadata block parsing in compiler runtime
Previously the incorrect regexp forced title to be a single letter
because of using '+' instead of the '\+' regexp modifier.

closes: #17321

Signed-off-by: Alexander Abrosimov <alexander.n.abrosimov@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-15 20:06:29 +02:00
31be82e66d patch 9.1.1393: missing test for switching buffers and reusing curbuf
Problem:  The check in buf_freeall that restores curwin subtly prevents
          leaving an unloaded buffer in a window when reusing curbuf, if
          autocommands switch to a different buffer.
Solution: Add a test case that covers this. Also ensure splitting isn't
          possible, as that could do the same (Sean Dewar)

closes: #17325

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-15 19:59:37 +02:00
c49cb93a86 patch 9.1.1392: missing patch number
Problem:  missing patch number
          (Tony Mechelynck)
Solution: add missing patche number

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-14 23:32:13 +02:00
be5bd4d629 patch 9.1.1391: Vim does not have a vertical tabpanel
Problem:  Vim does not have a tabpanel
Solution: include the tabpanel feature
          (Naruhiko Nishino, thinca)

closes: #17263

Co-authored-by: thinca <thinca@gmail.com>
Signed-off-by: Naruhiko Nishino <naru123456789@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-14 21:20:28 +02:00
7200eae212 git: git: ignore more style changes from v9.1.1390
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-14 21:03:39 +02:00
e89aef3f65 patch 9.1.1390: style: more wrong indentation
Problem:  style: more wrong indentation
Solution: reformat a few more places
          (Yegappan Lakshmanan)

closes: #17309

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-14 20:31:55 +02:00
08db2f4f28 patch 9.1.1389: completion: still some issue when 'isexpand' contains a space
Problem:  Cannot get completion startcol when space is not the first
          trigger character (after v9.1.1383)
Solution: Detect the next comma followed by a space in the option string
          and use in next compare loop (glepnir)

closes: #17311

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-14 20:26:19 +02:00
c6c72d165c patch 9.1.1388: Scrolling one line too far with 'nosmoothscroll' page scrolling
Problem:  One-off error in "count" to make "w_skipcol" zero with
          'nosmoothscroll' page scrolling when last virtual line
          in a buffer line is exactly the entire window width.
          (Hirohito Higashi)
Solution: Properly compute the smallest integer value necessary
          to make "w_skipcol" zero (Luuk van Baal)

fixes: #17317
closes: #17318

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-14 20:21:55 +02:00
0077282c82 patch 9.1.1387: memory leak when buflist_new() fails to reuse curbuf
Problem:  buflist_new() leaks ffname and fails to reuse curbuf when
          autocommands from buf_freeall change curbuf. Plus, a new
          buffer is not allocated in this case, despite what the comment
          above claims.
Solution: Remove the condition so ffname is not leaked and so a new
          buffer is allocated like before v8.2.4791. It should not be
          possible for undo_ftplugin or buf_freeall autocommands to
          delete the buffer as they set b_locked, but to stay consistent
          with other uses of buf_freeall, guard against that anyway
          (Sean Dewar).

Note that buf is set to NULL if it was deleted to guard against the (rare)
possibility of messing up the "buf != curbuf" condition below if a new buffer
happens to be allocated at the same address.

closes: #17319

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-14 20:16:52 +02:00
c952fd1b24 patch 9.1.1386: MS-Windows: some minor problems building on AARCH64
Problem:  MS-Windows: some minor problems building on AARCH64
Solution: Update Make_cyg_ming with aarch64 specific changes,
          document how to build on aarch64 using msys2 packages

closes: #17048

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-14 20:14:30 +02:00
acf0ebe8a8 patch 9.1.1385: inefficient loop for 'nosmoothscroll' scrolling
Problem:  Loop that ensures "w_skipcol" is zero with 'nosmoothscroll'
	  for (half)-page scrolling is inefficient.
Solution: Calculate the required "count" instead of looping until
	  "w_skipcol" is zero (Luuk van Baal).

fixes: #17301
closes: #17306

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-12 20:47:00 +02:00
13bea589a2 patch 9.1.1384: still some problem with the new tutors filetype plugin
Problem:  still some problem with the new tutors filetype plugin
Solution: refactor code to enable/disable tutor mode into
          tutor#EnableInteractive() function, include a test
          (Phạm Bình An)

I find it annoying that Tutor's interactive mode is always on (or debug
mode is off) even when I open a tutor file with :edit command.
I think it makes more sense to make this "interactive mode":

- Always on when it is opened with :Tutor command
- Off otherwise

For more references, see `:help` feature, it is a much better than
:Tutor, since I don't have to run `:let g:help_debug = 1` just to be able
to edit and save a help file

Therefore, I remove `g:tutor_debug`

closes: #17299

Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-12 20:39:24 +02:00
8d0e42b710 patch 9.1.1383: completion: 'isexpand' option does not handle space char correct
Problem:  When a space character is used as a trigger in 'isexpand' option
          it doesn't get recognized because skip_to_option_part() skips
          spaces after a comma, treating them as option separators
          rather than option value (after v9.1.1341)
Solution: manually set the part to a space character (glepnir).

closes: #17305

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-12 20:28:28 +02:00
e62244f22d runtime(getscript): CI: failure on powershell
Problem:  The CheckVimScriptURL() function does not work properly on
          pwershell. Most likely this is because curl is aliased to
          Invoke-WebRequest on Powershell and redirection seems to work
          slightly different
Solution: Disable CheckVimScriptURL() on Powershell and then simplify
          the curl download logic

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-11 18:30:24 +02:00
411730e277 patch 9.1.1382: if_ruby: unused compiler warnings from ruby internals
Problem:  if_ruby: unused compiler warnings from ruby internals
Solution: disable -Wunused-parameter for if_ruby internal code
          (Philip H.)

closes: #17297

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-11 15:01:31 +02:00
74e8f28b5c runtime(getscript): check for network errors
related: #17249

Co-authored-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-11 14:57:26 +02:00
5a18ccf490 patch 9.1.1381: completion: cannot return to original text
Problem:  Cannot return to the original text after selecting the next
          item when the currently selected item is the last one.
Solution: When continuing to move down past the last item, locate the
          original completion at the head/tail nodes of the completed
          linked list (glepnir).

closes: #17300

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-11 13:48:33 +02:00
d4110e0695 patch 9.1.1380: 'eventignorewin' only checked for current buffer
Problem:  When an autocommand executes for a non-current buffer,
          'eventignorewin' is only checked from the buffer's last
          wininfo (overwrites win_ignore in the loop), not from the
          value of 'eventignorewin' in all windows showing the buffer as
          described (after v9.1.1084)

Solution: Fix the check and don't use wininfo, as that may only contain
          windows that recently showed the buffer. Consider all the
          buffer's windows in all tabpages (Sean Dewar).

closes: #17294

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-11 13:45:21 +02:00
7344024536 runtime(java): Search type and method declarations with "&inc" and "&def"
=============== LIMITATIONS AND OBSERVATIONS ===============

* Remember that external-type names can only be found when
  they match filenames resolvable in "&path" with "import"
  declarations; load the source file of an external type to
  look up its nested types and sibling top types, if any.

* Strive to narrow the search by assigning only relevant
  pathnames for directories *or* an archive to "&path", e.g.
  ":set path-=/usr/include".

* Use "{Visual}gf" on fully-qualified names.

* Accept the fact that "&define" cannot contain end-of-line
  characters (":help definition-search").  A declaration
  whose matchable header is not contained within a line can
  be found iff all of its non-optional components belong to
  the same line; for types, such components are a keyword,
  e.g. "class", followed by a run of blank characters and
  an identifier, e.g. "Test"; for methods: a return type,
  e.g. "String", or a keyword "void", followed by a run of
  blank characters and an identifier, e.g. "toString", that
  is followed by "(".

* The members of the "java.lang" package are usually not
  associated with "import" declarations; to look up their
  declarations, load a source file for a member of that
  package, and then use, on a simple name of interest for
  a member, either "[-Ctrl-d" etc. for local declarations
  or "gf" for external declarations, assuming that "." *or*
  the appropriate pathname for a JDK archive is assigned to
  "&path".

* Follow the above instruction made for the "java.lang"
  members for any type whose simple name is not associated
  with an "import" declaration, i.e. a member type of the
  same package that is declared in another compilation unit.

* Append the "$" character to "&iskeyword" when looking up
  declarations of generated code.

See zzzyxwvut/java-vim#4.

closes: #17281

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-10 21:44:07 +02:00
dc7ed8f946 runtime(html): Optionally fold tags with the "expr" method
Tag folding poses a few difficulties.  Many elements, e.g.
"blockquote", are always delimited by start and end tags;
end tags for some elements, e.g. "p", can be omitted in
certain contexts; void elements, e.g. "hr", have no end tag.
Although the rules for supporting omissible end tags are
ad-hoc and involved, they apply to elements in scope.
Assuming syntactical wellformedness, an end tag can be
associated with its nearest matching start tag discoverable
in scope and towards the beginning of a file, whereas all
unbalanced tags and inlined tags can be disregarded.

For example:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <p>Paragraph #1.		<!--  = : 2 -->
    <p>				<!-- >3 : 3 -->
      Paragraph #2.		<!--  = : 3 -->
    </p>			<!-- <3 : 3 -->
    <p>Paragraph #3.</p>	<!--  = : 2 -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

(HTML comments here, "<!-- ... -->", record two values for
each folded line that are separated by ":", a value obtained
from "&foldexpr" and a value obtained from "foldlevel()".)

Innermost foldedable tags will be flattened.  For example:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre><code>		<!-- >4 : 4 -->
[CODE SNIPPET]			<!--  = : 4 -->
      </code></pre>		<!-- <4 : 4 -->
    </div>			<!-- <3 : 3 -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

No folding will be requested for the "<code>"-"</code>" tag
pair and reflected by "&foldexpr" because such a fold would
have claimed the same lines that the immediate fold of the
"<pre>"-"</pre>" tag already claims.

Run-on folded tags may confuse Vim.  When a file such as:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre>			<!-- >4 : 4 -->
	<code>			<!-- >5 : 5 -->
[CODE SNIPPET #1]		<!--  = : 5 -->
	</code>			<!-- <5 : 5 -->
      </pre>			<!-- <4 : 4 -->
    </div>			<!-- <3 : 3 -->
				<!--  = : 3 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre>			<!-- >4 : 4 -->
	<code>			<!-- >5 : 5 -->
[CODE SNIPPET #2]		<!--  = : 5 -->
	</code>			<!-- <5 : 5 -->
      </pre>			<!-- <4 : 4 -->
    </div>			<!-- <3 : 3 -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

is reformatted as follows:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre>			<!-- >4 : 4 -->
	<code>			<!-- >5 : 5 -->
[CODE SNIPPET #1]		<!--  = : 5 -->
	</code>			<!-- <5 : 5 -->
      </pre>			<!-- <4 : 4 -->
    </div><div class="block"><pre><code> <!-- <3 : 3 -->
[CODE SNIPPET #2]		<!--  = : 2 ? -->
	</code>			<!-- <5 : 2 ? -->
      </pre>			<!-- <4 : 2 ? -->
    </div>			<!-- <3 : 2 ? -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

"&foldexpr" values will not be used as is for the lines
between (and including) "[CODE SNIPPET #2]" and "</div>".
(Cf. v9.1.0002.)

Having syntax highlighting in effect, tag folding using the
"fold-expr" method can be enabled with:
------------------------------------------------------------
	let g:html_expr_folding = 1
------------------------------------------------------------

By default, tag folding will be redone from scratch after
each occurrence of a TextChanged or an InsertLeave event.
Such frequency may not be desired, especially for large
files, and this recomputation can be disabled with:
------------------------------------------------------------
	let g:html_expr_folding_without_recomputation = 1
        doautocmd FileType
------------------------------------------------------------

To force another recomputation, do:
------------------------------------------------------------
	unlet! b:foldsmap
	normal zx
------------------------------------------------------------

References:
https://web.archive.org/web/20250328105626/https://html.spec.whatwg.org/multipage/syntax.html#optional-tags
https://en.wikipedia.org/wiki/Dangling_else

closes: #17141

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-10 21:40:41 +02:00
3704b5b58a runtime(tutor): improve tutor.vim plugin and filetype plugin
- Set g:tutor_debug on startup if it doesn't exist so that users can get
  cmdline completion when interactively setting it.
- set b:undo_ftplugin in filetype plugin
- set default runtime file headers

closes: #17274

Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-10 21:20:57 +02:00
839b79eeb3 runtime(sh): Update syntax, improve wildcard character class matching
- Default to POSIX supported classes.
- Add a KornShell specific class list.
- Remove "or" from the Bash class list, presumably a typo.

closes: #17293

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
2025-05-10 20:57:10 +02:00
cf488ebf6c patch 9.1.1379: MS-Windows: error when running evim when space in path
Problem:  MS-Windows: error when running evim when space in path of Vim
Solution: properly parse quoted strings (Miguel Barro)

When vim is installed in a path with whitespaces (like
`C:\Program Files (x86)\Vim\vim91\vim.exe`). Launching `evim` or
`vim -d` will try to open the file ` (x86)\Vim\vim91\vim.exe`.

Modern versions of vim simplify shell operation by parsing its own
command line. For example on Linux all vim flavours like `evim`, `rvim`,
etc are symlinks to vim. Then vim uses the `parse_command_name()`
function to identify which version of vim it should launch.
For `evim` if a GUI is available `gvim` is launched for better user
experience. In order to launch `gvim` the original command line is
parsed to be passed *verbatim* to the new instance.
This parsing did not properly handle quoted command lines with
whitespaces such as
```
"C:\Program Files (x86)\Vim\vim91\vim.exe" -y myfile.txt
```

closes: #17295

Signed-off-by: Miguel Barro <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-10 20:44:33 +02:00
1b186833c1 patch 9.1.1378: sign without text overwrites number option
Problem:  When 'signcolumn' is set to `number` but a line has a sign
          without text, the line number disappears (finite-state-machine)
Solution: Verify that a sign actually contains text before rendering the
          line number (glepnir)

fixes: #17169
closes: #17282

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-10 14:59:08 +02:00
0553f2ff0d runtime(doc): clarify single/multibyte support for 'fillchars'
closes: #17287

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-10 14:56:17 +02:00
d8ebccbb10 patch 9.1.1377: patch v9.1.1370 causes some GTK warning messages
Problem:  Some GTK3 users experienced unexpectedly small windows at
          startup (after v9.1.1368, @berggeist, Tony Mechelynck)
Solution: Update window manager hints in gui_mch_open, partly revert
          v9.1.1370 (Drew Vogel)

fixes: #17279
closes: #17288

Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-10 14:46:28 +02:00
6b7637e6bb runtime(lf): use syn iskeyword in syntax script
Sets 'syn iskeyword' in syntax/lf.vim to fix the missing lf keyword
highlighting in lines like 'map e :open; open' (first 'open' not
highlighted).

applies PR andis-sprinkis/lf-vim#21 by @joelim-work
closes: andis-sprinkis/lf-vim#14

Co-authored-by: Joe Lim <50560759+joelim-work@users.noreply.github.com>
Signed-off-by: Andis Spriņķis <andis@sprinkis.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-10 14:42:25 +02:00
270124f46a patch 9.1.1376: quickfix dummy buffer may remain as dummy buffer
Problem:  when failing to wipeout a quickfix dummy buffer, it will
          remain as a dummy buffer, despite being kept.
Solution: clear its dummy BF_DUMMY flag in this case (Sean Dewar).

closes: #17283

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-10 14:33:28 +02:00
b4074ead5c patch 9.1.1375: [security]: possible heap UAF with quickfix dummy buffer
Problem:  heap use-after-free possible when autocommands switch away from the
          quickfix dummy buffer, but leave it open in a window.
Solution: close its windows first before attempting the wipe.
          (Sean Dewar)

related: #17283

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-10 14:30:36 +02:00
9955c125fa CI: use deb822 style for llvm source
closes: #17285

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-10 14:25:37 +02:00
9973b39a17 runtime(doc): remove duplicate sentence in builtin.txt
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-09 08:19:51 +02:00
314150912e typo in comment in gui.c
Problem:  typo in comment in gui.c (after v9.1.1367)
Solution: fix the typo  (Christ van Willegen)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-09 00:08:01 +02:00
17ad852a62 runtime(doc): update return types for builtin functions
fixes: #17273

credit: Github user @msoyka2024
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-09 00:05:36 +02:00
dc314053e1 patch 9.1.1374: completion: 'smartcase' not respected when filtering matches
Problem:  Currently, 'smartcase' is respected when completing keywords
          using <C-N>, <C-P>, <C-X><C-N>, and <C-X><C-P>. However, when
          a user continues typing and the completion menu is filtered
          using cached matches, 'smartcase' is not applied. This leads
          to poor-quality or irrelevant completion suggestions, as shown
          in the example below.
Solution: When filtering cached completion items after typing additional
          characters, apply case-sensitive comparison if 'smartcase' is
          enabled and the typed pattern includes uppercase characters.
          This ensures consistent and expected completion behavior.
          (Girish Palya)

closes: #17271

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-08 23:28:52 +02:00
c3fbaa086e patch 9.1.1373: 'completeopt' checking logic can be simplified
Problem:  Flag checking logic uses a temporary variable and multiple
          bitwise operations in insexpand.c
Solution: Consolidate into a single equality check using bitwise OR and
          comparison (glepnir)

closes: #17276

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-08 23:05:10 +02:00
1eb8d08738 git: ignore more style changes from v9.1.1371 and v9.1.1372
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-08 23:01:41 +02:00
a4a00a7ad0 patch 9.1.1372: style: braces issues in various files
Problem:  style: braces issues in various files
Solution: fix style (Hirohito Higashi)

closes: #17277

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-08 22:58:31 +02:00
19e1dd6b6a patch 9.1.1371: style: indentation and brace issues in insexpand.c
Problem:  style: indentation issue in insexpand.c
Solution: update style (glepnir)

closes: #17278

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-08 22:50:38 +02:00
ea67ba718d patch 9.1.1370: CI Tests favor GTK2 over GTK3
Problem:  CI Tests favor GTK2 over GTK3
Solution: Install GTK3 dependencies and debug packages for CI workflows,
          update ASAN suppression list, update required dependency
          checks for the tests (Drew Vogel)

closes: #17253

Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-07 22:05:17 +02:00
9670f61d46 patch 9.1.1369: configure still using autoconf 2.71
Problem:  configure still using autoconf 2.71
Solution: regenerate with autoconf 2.72

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-07 21:44:33 +02:00
48b19b29ee patch 9.1.1368: GTK3 and GTK4 will drop numeric cursor support.
Problem:  GTK3 and GTK4 will drop numeric cursor support.
Solution: Adopt GTK3 code and use CSS cursor convention (Drew Vogel).

closes: #14610

Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-07 21:36:03 +02:00
d2fcbb465d patch 9.1.1367: too many strlen() calls in gui.c
Problem:  too many strlen() calls in gui.c
Solution: refactor gui.c slightly (John Marriott)

This does the following changes:
- use macro STRCMP() instead of strcmp().
- refactor gui_outstr_nowrap() to remove call to STRLEN().
- refactor get_tabline_label() in attempt to simply it. At the same time
  use standard looping construct for iterating over windows in a tab.
  Move variables closer to where they are used. Add check that we don't
  exceed size of NameBuff.
- small optimisation in get_find_dialog_text() to measure the string
  length once.

closes: #17269

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-07 19:59:42 +02:00
38972d8b1a patch 9.1.1366: v9.1.1364 unintentionally changed sign.c and sound.c
Problem:  v9.1.1364 unintentionally changed sign.c and sound.c
Solution: revert those parts, adjust the test (Hirohito Higashi)

closes: #17264

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-06 18:13:29 +02:00
0fb6ceac4c runtime(lua): update 'path' option in filetype plugin
Problem:  Lua doesn't support importing module in path related to current
          file like JS does (https://www.reddit.com/r/lua/comments/wi0bau/whats_the_correct_way_to_run_a_lua_file_that_uses/)
Solution: Remove `.` from Lua buffer-local option `'path'`

closes: #17267

Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-06 18:08:38 +02:00
87947a9a76 runtime(sh): Update syntax, match KornShell compound arrays
closes: #17268

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-06 17:59:25 +02:00
55f9e2bef9 runtime(doc): Tweak documentation style in develop.txt
closes: #17252

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-05 20:19:09 +02:00
ba0062b0c7 runtime(helptoc): the helptoc package can be improved
Adds the following changes:
- New Maintainer: Pete Kenny
- New filetypes supported (asciidoc, html, tex, vim, xhtml)
- improved Markdown support
- Sanitised ToCs and popup presentation
- Configuration improvements and options
- Add helptoc.txt help file

closes: #17255

Signed-off-by: Peter Kenny <github.com@k1w1.cyou>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-05 20:15:39 +02:00
adfeb4ad95 runtime(spec): add more local macro names according to rpm 4.20
closes: #17258

Signed-off-by: fundawang <fundawang@yeah.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-05 20:12:40 +02:00
fe22867ef5 runtime(sh): Update syntax, fix single-quoted strings in parameter expansions
Ignore single-quoted backslash escape sequences in parameter expansions.

\' is not an escaped single quote in ${foo:-'word\'}.

closes: #17261

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-05 20:10:11 +02:00
13bd43c1e5 runtime(new-tutor): Update Serbian translation of chapter 1
closes: #17262

Signed-off-by: Ivan Pešić <27575106+eevan78@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-05 20:07:46 +02:00
51f6a78ce2 patch 9.1.1365: MS-Windows: compile warnings and too many strlen() calls
Problem:  MS-Windows: compile warnings and too many strlen() calls  in
          os_mswin.c
Solution: refactor os_mswin.c and fix the warning (John Marriott)

This change does the following:

- Fix compile warnings (clang 20.1.3) in `mch_libcall()`:
```
os_mswin.c:902:21: warning: cast from 'MYSTRPROCSTR' (aka 'char *(*)(char *)') to 'MYSTRPROCINT' (aka 'int (*)(char *)') converts to incompatible function type [-Wcast-function-type-mismatch]`
  902 |                     retval_int = ((MYSTRPROCINT)ProcAdd)((LPSTR)argstring);`
      |                                   ^~~~~~~~~~~~~~~~~~~~~`
os_mswin.c:914:21: warning: cast from 'MYINTPROCSTR' (aka 'char *(*)(int)') to 'MYINTPROCINT' (aka 'int (*)(int)') converts to incompatible function type [-Wcast-function-type-mismatch]`
  914 |                     retval_int = ((MYINTPROCINT)ProcAddI)(argint);`
      |                                   ^~~~~~~~~~~~~~~~~~~~~~`
2 warnings generated.
```

- Refactor `stat_impl()` to remove call to `STRLEN()` (via `STRCAT()`).

- Refactor `Messaging_WndProc()`, `enumWindowsGetServer()` and
  `serverSendToVim()` to remove calls to `STRLEN()`.

- Use `string_T` to store field `name` in `struct charset_pair` and
  `struct quality_pair`. This means we can dispense with some calls to
  `STRLEN()`.

- Use `ARRAY_LENGTH()` macro to determine end of array in
  `charset_id2name()` and `quality_id2name()` to be consistent with the
  rest of the code base.

closes: #17222

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-04 21:35:36 +02:00
8ac3f5dd3a git: ignore indentation changes for git-blame (after v9.1.1364)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-04 21:13:47 +02:00
562610cfa3 patch 9.1.1364: style: more indentation issues
Problem:  style: more indentation issues
Solution: fix indentation style
          (Yegappan Lakshmanan)

closes: #17256

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-04 21:10:06 +02:00
e957cba081 runtime(vim): Update base-syntax, match quote separated numbers
closes: #17250

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-04 21:01:18 +02:00
ba2ed6ac04 git: ignore indentation changes for git-blame (after v9.1.1363)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-04 20:08:45 +02:00
c2a9000bc1 patch 9.1.1363: style: inconsistent indentation in various files
Problem:  style: inconsistent indentation in various files
Solution: fix style, updated codestyle test
          (Naruhiko Nishino)

closes: #17254

Signed-off-by: Naruhiko Nishino <naru123456789@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-04 20:05:47 +02:00
41cddfa177 patch 9.1.1362: Vim9: type ignored when adding tuple to instance list var
Problem:  Vim9: type ignored when adding tuple to instance list var
          (Lifepillar)
Solution: When getting the typval of class and object member variables,
          set the variable type (Yegappan Lakshmanan)

fixes: #17236
closes: #17244

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-03 19:11:45 +02:00
951d025af1 runtime(tutor): Add Galician language versions of tutor1 and tutor2
Both latin-1 and utf-8 versions are included.

closes: #17245

Signed-off-by: fernandovilarino <fernando@cvc.uab.es>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-03 19:07:35 +02:00
6cb1c82840 patch 9.1.1361: [security]: possible use-after-free when closing a buffer
Problem:  [security]: Possible to open more windows into a closing
          buffer without splitting, bypassing existing "b_locked_split"
          checks and triggering use-after-free
Solution: Disallow switching to a closing buffer. Editing a closing
          buffer (via ":edit", etc.) was fixed in v9.1.0764, but add an
          error message and check just "b_locked_split", as "b_locked"
          is necessary only when the buffer shouldn't be wiped, and may
          be set for buffers that are in-use but not actually closing.
          (Sean Dewar)

closes: #17246

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-03 18:37:27 +02:00
c3f48e3a76 runtime(abnf): include ABNF filetype plugin
closes: #17239

Signed-off-by: A4-Tacks <wdsjxhno1001@163.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-02 15:40:33 +02:00
af4a5d6e2a patch 9.1.1360: filetype: GNU Radio companion files are not recognized
Problem:  filetype: GNU Radio companion files are not recognized
Solution: detect *.grc files as xml or yaml filetype depending on the
          first line (zeertzjq).

Ref:
- https://wiki.gnuradio.org/index.php/XML_GRC
- https://wiki.gnuradio.org/index.php/YAML_GRC

closes: #17241

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-02 15:35:58 +02:00
9c9200d1ea patch 9.1.1359: filetype: GNU Radio config files are not recognized
Problem:  filetype: GNU Radio config files are not recognized.
Solution: detect GNU Radio config files as confini filetype.  Only
          allow '#' as start of comment in confini syntax (zeertzjq).

Ref:
- https://wiki.gnuradio.org/index.php/Configuration_Files

closes: #17242

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-02 15:32:23 +02:00
7292c0cb15 patch 9.1.1358: if_lua: compile warnings with gcc15
Problem:  if_lua: compile warnings with gcc15
Solution: update function prototypes (lilydjwg)

see also https://github.com/ruby/ruby/pull/13202.

closes: #17243

Signed-off-by: lilydjwg <lilydjwg@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-02 15:17:14 +02:00
1c58019a82 runtime(vim): Update base-syntax, improve enum highlighting
Match enum values and missing class keywords.

fixes: #15970

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-01 17:43:17 +02:00
83cb8174c8 runtime(doc): update example ctags program and links
- :helptags is also a tags generating program, it deserves mentioning
- JTags seems too dead: its website has been sold, the source, binary
  can't be found anywhere.
- update link of ptags

closes: #17233

Signed-off-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-01 17:40:15 +02:00
6af20a9be3 patch 9.1.1357: Vim incorrectly escapes tags with "[" in a help buffer
Problem:  Vim incorrectly escapes tags containing "[" in a help buffer
Solution: check if the buffer has the "help" filetype set, instead of
          already being a help buffer (Phạm Bình An)

fixes: #17224
closes: #17232

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-01 17:30:58 +02:00
f5bfc48c05 patch 9.1.1356: Vim9: crash when unletting variable
Problem:  Vim9: crash when unletting variable
Solution: fix crash, allow to use :unlet
          (Hirohito Higashi)

closes: #17226

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-01 08:56:39 +02:00
f57c065e75 runtime(sh): Update syntax, highlight escaped chars in test expressions
Highlight escape characters in unquoted test expression operands.

E.g., [[ foo == \[bar\] ]]

fixes #17221

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-30 20:04:28 +02:00
ff3d4b2d49 runtime(doc): document that :b cannot handle buffer names starting with "+"
closes: #17229

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-30 19:54:52 +02:00
fb08192ca7 runtime(doc): clarify the use of 'tagfunc', update a comment in tags.c
related: #17228

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-30 19:35:09 +02:00
fa8b7db99a runtime(doc): tweak documentation style in options.txt
closes: #17229

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-30 19:12:37 +02:00
c3e71d4da6 patch 9.1.1355: The pum_redraw() function is too complex
Problem:  The pum_redraw function is too complex and difficult to
          maintain with nested loops and mixed responsibilities handling
          both RTL and LTR text rendering.
Solution: Extracted core rendering logic into dedicated helper functions
          (pum_display_rtl_text, pum_display_ltr_text, pum_draw_scrollbar,
          pum_process_item) while preserving the original behavior. This
          improves code readability and maintainability (glepnir).

closes: #17204

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-29 18:27:05 +02:00
a74d5503d5 patch 9.1.1354: tests: Test_terminalwinscroll_topline() fails on Windows
Problem:  tests: Test_terminalwinscroll_topline() fails on Windows
          (after v9.1.1348)
Solution: instead of disabling it in Github Actions runners, disable it
          for all Windows runs

related: #17196

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-29 18:21:31 +02:00
612f63bf81 patch 9.1.1353: missing change from v9.1.1350
Problem:  missing change from v9.1.1350
Solution: update the test Test_CmdlineTrigger() (Girish Palya)

related: #17217

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-28 18:29:52 +02:00
be51e90497 git: ignore reformatting commit for git-blame (after v9.1.1352)
related: #17219

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-28 18:10:29 +02:00
355db99d12 patch 9.1.1352: style: inconsistent indent in insexpand.c
Problem:  style: inconsistent indent in insexpand.c
Solution: fix indentation (Hirohito Higashi)

closes: #17219

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-28 18:07:02 +02:00
9240369774 patch 9.1.1351: Return value of getcmdline() inconsistent in CmdlineLeavePre
Problem:  Return value of getcmdline() inconsistent in CmdlineLeavePre
          when leaving cmdline in different ways (after v9.1.1329).
Solution: Trigger CmdlineLeavePre before calling abandon_cmdline() so
          that getcmdline() can return the command line (zeertzjq).

closes: #17218

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-28 18:04:00 +02:00
6220bbad4e patch 9.1.1350: tests: typo in Test_CmdlineLeavePre_cabbr()
Problem:  tests: typo in Test_CmdlineLeavePre_cabbr()
          (after v9.1.1349)
Solution: fix typo, disable failing test on Windows for now
          (Girish Palya)

closes: #17217

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-28 18:00:40 +02:00
910bfd5d38 runtime(java): Consent to HTML tags folding in Javadoc comments
HTML tags in Javadoc comments can additionally be folded
after applying
------------------------------------------------------------
	let g:html_syntax_folding = 1
	set foldmethod=syntax
------------------------------------------------------------

and giving explicit consent with
------------------------------------------------------------
	let g:java_consent_to_html_syntax_folding = 1
------------------------------------------------------------

Do not default to this kind of folding unless ALL start tags
and optional end tags are balanced in Javadoc comments;
otherwise, put up with creating runaway folds that break
syntax highlighting.

resolves: zzzyxwvut/java-vim#8.
closes: #17216

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-28 17:58:22 +02:00
e3302cf2b1 runtime(syntax-tests): Regenerate changed syntax test pages for vim
See #17213 (v9.1.1348~1).

closes: #17215

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-28 17:55:05 +02:00
46755e6b52 patch 9.1.1349: CmdlineLeavePre may trigger twice
Problem:  CmdlineLeavePre may trigger twice
          (after v9.1.1329)
Solution: check that the key was typed, trigger it when it wasn't before
          (Girish Palya)

There are two problems:
- CmdlineLeavePre may be triggered twice when a cabbr is present.
- CmdlineLeavePre fails to trigger when exiting the command-line via
  <Backspace>.

Check if the Carriage Return (Enter) key was actually typed.
Trigger the event when the command-line is exited using Backspace and
other keys.

closes: #17214

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-27 19:28:06 +02:00
b9ffbf57f8 runtime(vim): Update base-syntax, fix inline Vim9 dict comments at SOL
Match Vim9 comments at start-of-line (no leading whitespace) in
dictionaries, lists and parenthesised expressions and argument lists.

Addresses https://github.com/vim/vim/pull/14975#issuecomment-2832643115

Report and fix by Aliaksei Budavei.

closes: #17211

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-27 19:17:06 +02:00
fa9753a721 patch 9.1.1348: still E315 with the terminal feature
Problem:  still E315 with the terminal feature
          (user202729)
Solution: call update_topline() in limit_scrollback()
          (Hirohito Higashi)

fixes: #17195
closes: #17196

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-27 15:36:43 +02:00
fbe4a8f5c0 runtime(doc): Fix notation of "Vim script" and "Vim9 script"
closes: #17213

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-27 15:28:30 +02:00
411ae580a9 patch 9.1.1347: small problems with gui_w32.c
Problem:  small problems with gui_w32.c
Solution: fix compile warnings and refactor code (John Marriott)

Compiler (clang v20.1.3) warnings on `_OnMenuSelect()` and
`_OnGetDpiScaledSize()`:
```
clang -c -I. -Iproto -DWIN32 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601
-DHAVE_PATHDEF -DFEAT_HUGE -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO
-pipe -Wall -Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=1 -Wall -Wextra -Wshadow -Wstrict-prototypes
-Wmissing-prototypes -Wno-deprecated-declarations
-Wno-error=missing-field-initializers -Werror=uninitialized
-Wunused-but-set-variable -DEXITFREE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD
gui_w32.c -o gobjx86-64/gui_w32.o
gui_w32.c:5038:55: warning: comparison of integers of different signs:
'UINT' (aka 'unsigned int') and 'int' [-Wsign-compare]
 5038 |                 && GetMenuState(s_menuBar, pMenu->id, MF_BYCOMMAND) != -1)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~
gui_w32.c:5054:26: warning: unused parameter 'hwnd' [-Wunused-parameter]
 5054 | _OnGetDpiScaledSize(HWND hwnd, UINT dpi, SIZE *size)
      |                          ^
2 warnings generated.
```

This commit contains the following changes:
- Fixes Warning 1:
  The prototype of `GetMenuState()` says that it returns a UINT, but
  returns -1 on failure. Huh?!?

  Also, Microsoft says that this function has been superseded (see
  https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmenustate)
  and replaced by `GetMenuItemInfo()`. Both of these functions have a
  minimum support of Windows 2000.
  Therefore in `_OnMenuSelect()`, replace the call to `GetMenuState()`
  with `GetMenuItemInfo()`.

- Fixes Warning 2:
  Add `UNUSED` to the definition of `_OnGetDpiScaledSize()`.

- Simplify `logfont2name()`.
- Add small optimisations in `_OnNotify()` and `gui_mch_do_spawn()`.
- Add out-of-memory check in `gui_mch_do_spawn()`.
- Code cosmetics (see definitions of `process_message_usual_key_classic()`
  and `process_message()`).

closes: #17208

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-27 15:05:06 +02:00
ffc89e47d0 runtime(doc): clarify complete_match() and 'isexpand' option
clarify complete_match() documentation to better explain its backward
search behavior, argument handling, and return value format and add an
example of isexpand

closes: #17212

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-27 14:59:17 +02:00
c29b533cf1 runtime(vim): Update base-syntax, match continued strings and tail comments
Continued strings are currently only matched after operators, in
parenthesised expressions and in function call argument lists.

closes: #14975

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-26 20:14:15 +02:00
c5cb6b2ee4 runtime(doc): tagfunc should refer to 'complete' option
fixes: #17205

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-26 20:06:41 +02:00
c25368ba14 patch 9.1.1346: missing out-of-memory check in textformat.c
Problem:  missing out-of-memory check in textformat.c
Solution: add out-of-memory check, add small optimizations to
          internal_format() and same_leader() (John Marriott)

closes: #17200

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-25 19:14:38 +02:00
cf2642fc72 patch 9.1.1345: tests: Test_xxd_color2() test failure dump diff is misleading
Problem:  tests: Test_xxd_color2() test failure dump diff is misleading
Solution: Ensure the reference dump and the test dump are both processed the
          same (Drew Vogel).

Background:

Commit b6dc76b6fd sought to make the xxd
screendump tests compatible with non-standard `XXD` overrides. It provides a
vim script that matches a very general `xxd` command pattern but then also
removed the matching line from the reference dump. This second step was
unnecessary because `VerifyScreenDump()` runs the associated vim script against
both the reference dump and the test dump.

Problem Details:

As part of some unrelated work, the GUI tests were failing with a window size 1
column too narrow. The screendumps in `Test_xxd_color2` were failing as a
result. When I loaded the diff using `term_dumpdiff()` the associated vim
scripts are not run. As a result, the test dump contained the `xxd` invocation
on line 1 while reference dump did not. This throws the diff off, obscuring the
true issue of the GUI window being too narrow.

Verification:

In addition to the test suite, locally I've tried to recreate the issue being
fixed in b6dc76b6fd. Setting a very non-standard
`XXD` path, this test still passes:

```
XXD=/home/dvogel/opt/vim/bin/xxd TEST_FILTER=Test_xxd_color2 TERM=xterm-color make test_xxd
rm -f test_xxd.res test.log messages starttime
if test -n "${ASAN_OPTIONS}"; then \
   XXD=../xxd/xxd; export XXD; ASAN_OPTIONS="${ASAN_OPTIONS}_test_xxd" \
UBSAN_OPTIONS="${UBSAN_OPTIONS}_test_xxd" VIMRUNTIME=../../runtime  ../vim -f \
-u unix.vim --gui-dialog-file guidialog -U NONE --noplugin --not-a-term -S \
runtest.vim test_xxd.vim ; \
fi

From test_xxd.vim:
Executed Test_xxd_color2()               in   0.066049 seconds
Filtered 17 tests with $TEST_FILTER and $TEST_SKIP_PAT
Executed 1 test                          in   0.096862 seconds
```

closes: #17202

Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-25 19:06:53 +02:00
35cfc3d3c4 runtime(debversions): Add questing (25.10) as Ubuntu release name
closes: #17201

Signed-off-by: James McCoy <jamessan@debian.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-25 19:04:20 +02:00
3accf046ec patch 9.1.1344: double free in f_complete_match() (after v9.1.1341)
Problem:  double free in f_complete_match() (after v9.1.1341)
Solution: remove additional free of trig pointer, correctly free
          regmatch.regprog and before_cursor in the error case

closes: #17203

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-25 19:01:06 +02:00
e380b5cbba patch 9.1.1343: filetype: IPython files are not recognized
Problem:  filetype: IPython files are not recognized
          (user202729)
Solution: detect *.ipy files as python filetype

fixes: #17163

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-24 22:34:46 +02:00
e36a931d9b runtime(groff,nroff): improve ftplugin
- set options in ftplugin but not in syntax
- implement ftplugin/groff.vim (wrapper of ftplugin/nroff.vim)

closes: #17174

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-24 22:26:02 +02:00
f102f4c2e8 patch 9.1.1342: Shebang filetype detection can be improved
Problem:  Shebang filetype detection can be improved
Solution: Improve detection logic (Eisuke Kawashima)

Vim does not correctly detect filetype from
  - `#!/usr/bin/env --split-string=awk -f`
  - `#!/usr/bin/env -S -i awk -f`
  - `#!/usr/bin/env -S VAR= awk -f`
So update the current detection logic to detect those cases.

closes: #17199

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-24 22:03:21 +02:00
bcd5995b40 patch 9.1.1341: cannot define completion triggers
Problem:  Cannot define completion triggers and act upon it
Solution: add the new option 'isexpand' and add the complete_match()
          function to return the completion matches according to the
          'isexpand' setting (glepnir)

Currently, completion trigger position is determined solely by the
'iskeyword' pattern (\k\+$), which causes issues when users need
different completion behaviors - such as triggering after '/' for
comments or '.' for methods. Modifying 'iskeyword' to include these
characters has undesirable side effects on other Vim functionality that
relies on keyword definitions.

Introduce a new buffer-local option 'isexpand' that allows specifying
different completion triggers and add the complete_match() function that
finds the appropriate start column for completion based on these
triggers, scanning backwards from cursor position.

This separation of concerns allows customized completion behavior
without affecting iskeyword-dependent features. The option's
buffer-local nature enables per-filetype completion triggers.

closes: #16716

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-24 21:48:35 +02:00
32f49738d1 runtime(gleam): update filetype plugin, include new compiler and syntax script
closes: #17172

Signed-off-by: Kirill Morozov <mail2kirill@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-24 21:30:59 +02:00
a3422aa317 patch 9.1.1340: cannot complete :filetype arguments
Problem:  cannot complete :filetype arguments (Phạm Bình An)
Solution: add :filetype ex command completion, add "filetypecmd"
          completion type for getcompletion()

fixes: #17165
closes: #17167

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-23 21:12:26 +02:00
031f2273cb patch 9.1.1339: missing out-of-memory checks for enc_to_utf16()/utf16_to_enc()
Problem:  missing out-of-memory checks for enc_to_utf16() and
          utf16_to_enc()
Solution: Add out-of-memory checks and fix a few other minor issues
          (John Marriott)

This change does:
-  add missing out-of-memory checks for enc_to_utf16() and
   utf16_to_enc()
-  add a small optimisation in mch_errmsg_c() and mch_msg_c() (in
   message.c) to only call STRLEN() if needed.
-  fix a memory leak in winpty_term_and_job_init() (in terminal.c).

closes: #17191

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-23 20:56:08 +02:00
ec270a5f55 patch 9.1.1338: Calling expand() interferes with cmdcomplete_info()
Problem:  Calling expand() interferes with cmdcomplete_info()
          (after 9.1.1329).
Solution: Only clear cmdline_orig when starting/ending cmdline mode
          (zeertzjq).

closes: #17192

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-23 20:50:23 +02:00
1343681aba patch 9.1.1337: Undo corrupted with 'completeopt' "preinsert" when switching buffer
Problem:  Undo corrupted with 'completeopt' "preinsert" when switching
          buffer or window.
Solution: Do not delete preinsert text when switching buffer or window.
          (zeertzjq)

related: neovim/neovim#33581
closes: #17193

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-23 20:46:35 +02:00
229f79c168 runtime(yaml): fix wrong order of undo_ftplugin suboptions
This commit fixes the following error message:
```
Compiler not supported: make inc< sw< sts<
```

1. orginal value: `setl com< cms< et< fo<| compiler make inc< sw< sts<`
2. correct value: `setl com< cms< et< fo< inc< sw< sts< | compiler make`

While at it, let's also document the g:yaml_recommended_style variable.

closes: #17179

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Vincent Law <vlaw@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-22 20:35:11 +02:00
7bc988067e runtime(make): do not automatically indent after a special target
prevent indentation if the previous line starts with e.g. `.PHONY:`

closes: #17183

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-22 20:20:46 +02:00
dd776dd5f0 patch 9.1.1336: comment plugin does not support case-insensitive 'commentstring'
Problem:  comment plugin does not support case-insensitive
          'commentstring' (char101)
Solution: Use pattern '\c' to make the regex case-insensitive
          (Maxim Kim)

fixes: #17184
closes: #17186

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-22 20:14:30 +02:00
362be6ba27 patch 9.1.1335: Coverity complains about Null pointer dereferences
Problem:  Coverity complains about Null pointer dereferences
Solution: before accessing ccline->cmdbuff check that ccline is not NULL

Fixes: Coverity issue 1646601
closes: #17189

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-22 20:06:53 +02:00
d847b241f5 patch 9.1.1334: Coverity complains about unchecked return value
Problem:  Coverity complains about unchecked return value
Solution: cast return value to (void)

Fixes: Coverity issue 1646574
related: #17189

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-22 20:05:46 +02:00
7dfc9e6121 patch 9.1.1333: Coverity: complains about unutilized variable
Problem:  Coverity: complains about unutilized variable
Solution: initialize typval properly
          (author)

Fixes: Coverity issue: 1646573
       tmp.v_lock is left unitialized
related: #17189

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-22 20:01:04 +02:00
69e6ab6db3 patch 9.1.1332: Vim9: segfault when using super within a lambda
Problem:  Vim9: segfault when using super within a lambda
          (lifepillar)
Solution: inherit the class from the current function
          (Yegappan Lakshmanan)

fixes: #17166
closes: #17185

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-22 19:55:38 +02:00
5c3d1e3258 patch 9.1.1331: Leaking memory with cmdcomplete()
Problem:  Leaking memory with cmdcomplete()
          (zeertzjq, after v9.1.1329)
Solution: free the memory (Girish Palya)

closes: #17190

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-22 19:52:16 +02:00
fa3b1043c6 runtime(vim): Update base-syntax, improve :autocmd highlighting
- Match full :autocmd, :doautocmd and :doautoall commands.
- Add filename pattern (wildcard) highlighting.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-22 19:48:13 +02:00
31b78cce6e runtime(doc): update documentation
closes: #17180

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-21 19:39:15 +02:00
b753d80e59 runtime(doc): clarify return type for findfile()/finddir()
closes: #17171

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-21 11:31:58 +02:00
926e2af42e patch 9.1.1330: may receive E315 in terminal
Problem:  may receive E315 in terminal
Solution: call check_cursor() (Hirohito Higashi)

fixes: #16024
fixes: #16211
fixes: #17099
closes: #17170

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-21 11:23:12 +02:00
16341e7090 CI: add sway compositor to CI tests, to prepare for better Wayland testing
closes: #17162

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-21 11:20:44 +02:00
92f68e26ec patch 9.1.1329: cannot get information about command line completion
Problem:  cannot get information about command line completion
Solution: add CmdlineLeavePre autocommand and cmdcomplete_info() Vim
          script function (Girish Palya)

This commit introduces two features to improve introspection and control
over command-line completion in Vim:

- Add CmdlineLeavePre autocmd event:

  A new event triggered just before leaving the command line and before
  CmdlineLeave. It allows capturing completion-related state that is
  otherwise cleared by the time CmdlineLeave fires.

- Add cmdcomplete_info() Vim script function:

  Returns a Dictionary with details about the current command-line
  completion state.

These are similar in spirit to InsertLeavePre and complete_info(),
but focused on command-line mode.

**Use case:**

In [[PR #16759](https://github.com/vim/vim/pull/16759)], two examples
demonstrate command-line completion: one for live grep, and another for
fuzzy file finding. However, both examples share two key limitations:

1. **Broken history recall (`<Up>`)**
   When selecting a completion item via `<Tab>` or `<C-n>`, the original
pattern used for searching (e.g., a regex or fuzzy string) is
overwritten in the command-line history. This makes it impossible to
recall the original query later.
   This is especially problematic for interactive grep workflows, where
it’s useful to recall a previous search and simply select a different
match from the menu.

2. **Lack of default selection on `<CR>`**
   Often, it’s helpful to allow `<CR>` (Enter) to accept the first match
in the completion list, even when no item is explicitly selected. This
behavior is particularly useful in fuzzy file finding.

----
Below are the updated examples incorporating these improvements:

**Live grep, fuzzy find file, fuzzy find buffer:**

```vim
command! -nargs=+ -complete=customlist,GrepComplete Grep VisitFile()
def GrepComplete(arglead: string, cmdline: string, cursorpos: number):
list<any>
    return arglead->len() > 1 ? systemlist($'grep -REIHns "{arglead}"' ..
       ' --exclude-dir=.git --exclude=".*" --exclude="tags" --exclude="*.swp"') : []
enddef
def VisitFile()
    if (selected_match != null_string)
        var qfitem = getqflist({lines: [selected_match]}).items[0]
        if qfitem->has_key('bufnr') && qfitem.lnum > 0
            var pos = qfitem.vcol > 0 ? 'setcharpos' : 'setpos'
            exec $':b +call\ {pos}(".",\ [0,\ {qfitem.lnum},\ {qfitem.col},\ 0]) {qfitem.bufnr}'
            setbufvar(qfitem.bufnr, '&buflisted', 1)
        endif
    endif
enddef
nnoremap <leader>g :Grep<space>
nnoremap <leader>G :Grep <c-r>=expand("<cword>")<cr>
command! -nargs=* -complete=customlist,FuzzyFind Find
execute(selected_match != '' ? $'edit {selected_match}' : '')
var allfiles: list<string>
autocmd CmdlineEnter : allfiles = null_list
def FuzzyFind(arglead: string, _: string, _: number): list<string>
    if allfiles == null_list
        allfiles = systemlist($'find {get(g:, "fzfind_root", ".")} \! \(
-path "*/.git" -prune -o -name "*.swp" \) -type f -follow')
    endif
    return arglead == '' ? allfiles : allfiles->matchfuzzy(arglead)
enddef
nnoremap <leader><space> :<c-r>=execute('let
fzfind_root="."')\|''<cr>Find<space><c-@>
nnoremap <leader>fv :<c-r>=execute('let
fzfind_root="$HOME/.vim"')\|''<cr>Find<space><c-@>
nnoremap <leader>fV :<c-r>=execute('let
fzfind_root="$VIMRUNTIME"')\|''<cr>Find<space><c-@>
command! -nargs=* -complete=customlist,FuzzyBuffer Buffer execute('b '
.. selected_match->matchstr('\d\+'))
def FuzzyBuffer(arglead: string, _: string, _: number): list<string>
    var bufs = execute('buffers', 'silent!')->split("\n")
    var altbuf = bufs->indexof((_, v) => v =~ '^\s*\d\+\s\+#')
    if altbuf != -1
        [bufs[0], bufs[altbuf]] = [bufs[altbuf], bufs[0]]
    endif
    return arglead == '' ? bufs : bufs->matchfuzzy(arglead)
enddef
nnoremap <leader><bs> :Buffer <c-@>
var selected_match = null_string
autocmd CmdlineLeavePre : SelectItem()
def SelectItem()
    selected_match = ''
    if getcmdline() =~ '^\s*\%(Grep\|Find\|Buffer\)\s'
        var info = cmdcomplete_info()
        if info != {} && info.pum_visible && !info.matches->empty()
            selected_match = info.selected != -1 ? info.matches[info.selected] : info.matches[0]
            setcmdline(info.cmdline_orig). # Preserve search pattern in history
        endif
    endif
enddef
```

**Auto-completion snippet:**

```vim
set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu
autocmd CmdlineChanged : CmdComplete()
def CmdComplete()
    var [cmdline, curpos] = [getcmdline(), getcmdpos()]
    if getchar(1, {number: true}) == 0  # Typehead is empty (no more pasted input)
            && !pumvisible() && curpos == cmdline->len() + 1
            && cmdline =~ '\%(\w\|[*/:.-]\)$' && cmdline !~ '^\d\+$'  # Reduce noise
        feedkeys("\<C-@>", "ti")
        SkipCmdlineChanged()  # Suppress redundant completion attempts
        # Remove <C-@> that get inserted when no items are available
        timer_start(0, (_) => getcmdline()->substitute('\%x00', '', 'g')->setcmdline())
    endif
enddef
cnoremap <expr> <up> SkipCmdlineChanged("\<up>")
cnoremap <expr> <down> SkipCmdlineChanged("\<down>")
autocmd CmdlineEnter : set bo+=error
autocmd CmdlineLeave : set bo-=error
def SkipCmdlineChanged(key = ''): string
    set ei+=CmdlineChanged
    timer_start(0, (_) => execute('set ei-=CmdlineChanged'))
    return key != '' ? ((pumvisible() ? "\<c-e>" : '') .. key) : ''
enddef
```

These customizable snippets can serve as *lightweight* and *native*
alternatives to picker plugins like **FZF** or **Telescope** for common,
everyday workflows. Also, live grep snippet can replace **cscope**
without the overhead of building its database.

closes: #17115

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-21 11:12:41 +02:00
eac45c558e patch 9.1.1328: too many strlen() calls in indent.c
Problem:  too many strlen() calls in indent.c
Solution: refactor indent.c slightly and remove strlen() calls
          (John Marriott)

closes: #17156

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-21 11:03:21 +02:00
2cb42efc18 patch 9.1.1327: filetype: nroff detection can be improved
Problem:  filetype: nroff detection can be improved
Solution: improve nroff detection (Eisuke Kawashima)

- explicitly check roff comments and macros typically found in manpages
- do not try to detect alphabetically-sectioned files, except for n, as
  nroff
    - l: > 'l' happens to be a section for historical reasons
         <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=391977>
    - n: e.g. /usr/share/man/mann/Tcl.n.gz
    - o: unsure (perhaps fedora-specific)
    - p: unsure (perhaps fedora-specific)

closes: #17160

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-21 10:51:05 +02:00
187df69fd1 runtime(doc): cross-link :| meaning :p and explain E749
E749 is given when :print (with any range) is issued on an empty buffer,
like the one you get with :new or :enew. Furthermore, due to Vi
compatibility :| is a synonym.

As a result, mappings intended to include a <bar> separator (esp. in the
case of boolean or "||") between commands can generate E749 on startup
when placed in a vimrc if the bars are not properly encoded or escaped.
[1]. Document this failure mode and synonym near the generated error,
and cross link with :help :bar. Note that one must read or scroll quite
a bit to find the mention of :| behaving like :print!

[1]: https://vi.stackexchange.com/q/46625/10604

closes: #17173

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-21 10:20:36 +02:00
f39de60608 runtime(doc): style: clarify to prefer 2 spaces after a sentence
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-21 10:15:02 +02:00
e125ee4b9f runtime(pov): deprecate #render and #statistics in syntax script
- 3.1g: active
  https://www.povray.org/ftp/pub/povray/Old-Versions/Official-3.1g/Docs/povuser.pdf#page=172
- 3.5 or later: deprecated
  https://www.povray.org/ftp/pub/povray/Old-Versions/Official-3.5/Linux/povlinux.tgz
  ─ povray-3.50c/html/povdoc_172.html
  - https://www.povray.org/documentation/3.7.0/r3_3.html#r3_3_2_7_1

closes: #17177

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-21 09:45:39 +02:00
9919085491 patch 9.1.1326: invalid cursor position after 'tagfunc'
Problem:  invalid cursor position after 'tagfunc'
          (gandalf4a)
Solution: call check_cursor() after executing the 'tagfunc'

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-20 19:35:49 +02:00
7938c40b34 runtime(keymaps): update Brazilian keymaps
closes: #17161

Signed-off-by: LuMarquesIlva <luismarques0504@proton.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-20 17:10:20 +02:00
67fe77d272 patch 9.1.1325: tests: not checking error numbers properly
Problem:  tests: not checking error numbers properly.
Solution: Add a trailing comma to avoid matching a different error
          number with the same prefix (zeertzjq)

closes: #17159

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-20 10:21:18 +02:00
2398460232 runtime(doc): clarify 'includeexpr' is not used for <cfile>
fixes: #17139

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-19 11:55:26 +02:00
3041cf67d3 runtime(filetype): improve *.h filetype detection
This commit changes *.h files to default to C (instead of C++), and
deprecates the existing `g:c_syntax_for_h` and `g:ch_syntax_for_h`
variables in favor of a unified `g:filetype_h`, like is used for other
ambiguous file extensions.

closes: #17135

Signed-off-by: Amelia Clarke <selene@perilune.dev>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-19 11:48:10 +02:00
5ecb452f5b runtime(indent-tests): Raise timeouts for "search*()"es
Related to #15974 and #16870.

closes: #17116

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-19 11:36:05 +02:00
4e3df44aa2 runtime(indent-tests): Annotate timed "search*()"es for tracing
related: #17116

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-19 11:35:38 +02:00
fe8508eda0 runtime(indent-tests): Instrument timed "search*()" calls
The offered "tracer.vim" script can be used to measure and
record elapsed time for explicitly annotated "search*()"es,
set off with "VIM_INDENT_TEST_TRACE_(START|END)" comment
markers, in indent plugins.

related: #17116

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-19 11:35:02 +02:00
6924eb81f4 patch 9.1.1324: undefined behaviour if X11 connection dies
Problem:  undefined behaviour if X11 connection dies
Solution: call setjmp() before the main_loop() and restore x11 state
          if the X11 connection dies (Foxe Chen)

fixes: #698
closes: #17142

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-19 11:25:18 +02:00
baa8c90cc0 patch 9.1.1323: b:undo_ftplugin not executed when re-using buffer
Problem:  b:undo_ftplugin not executed when re-using buffer
          (archy3)
Solution: explicitly execute b:undo_ftplugin in buflist_new() when
          re-using the current buffer

fixes: #17113
closes: #17133

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-19 11:14:11 +02:00
8167799651 CI: coverity.yml: remove python2-dev pkg and retire --enable-pythoninterp
follow-up: ded2b41326

closes: #17157

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-19 11:09:30 +02:00
54081f0ce0 runtime(nix): set iskeyword and b:match_words in ftplugin
closes: #17154

Signed-off-by: Arnie97 <arnie97@gmail.com>
Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-18 19:34:14 +02:00
cb3b752f95 runtime(doc): clarify "nearest" value for 'completeopt'
closes: #17146

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-18 18:52:28 +02:00
13960a8779 CI: GCC 13 install fails, so disable that particular ppa
closes: #17149

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-18 18:50:50 +02:00
0ed11ba223 runtime(doc): Tweak documentation style a bit
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-18 18:46:23 +02:00
ded2b41326 CI: update coverity runner to Ubuntu 24.04
closes: #17150

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-18 18:42:24 +02:00
7e93d4c617 patch 9.1.1322: small delete register cannot paste multi-line correctly
Problem:  small delete register cannot paste multi-line correctly
          (after v8.2.2189)
Solution: caused by 032a2d050b, so make
          this logic handle charwise only (phanium)

closes: #17151

Signed-off-by: phanium <91544758+phanen@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-18 18:32:52 +02:00
aee34ef23e patch 9.1.1321: filetype: MS ixx and mpp files are not recognized
Problem:  filetype: MS ixx and mpp files are not recognized
Solution: detect *.mpp and *.ixx files as c++ filetype
          (Hampus Avekvist)

closes: #17155

Signed-off-by: Hampus Avekvist <hampus.avekvist@hey.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-18 18:21:34 +02:00
1d96caaa4b patch 9.1.1320: filetype: alsoft config files are not recognized
Problem:  filetype: alsoft config files are not recognized
Solution: detect alsoft config files as dosini filetype
          (David Mandelberg)

References:
* code with paths to config: ReadALConfig() in
  https://github.com/kcat/openal-soft/blob/master/alc/alconfig.cpp
* example config:
  https://github.com/kcat/openal-soft/blob/master/alsoftrc.sample

closes: #17140

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-18 11:41:44 +02:00
98800979dc patch 9.1.1319: Various typos in the code, issue with test_inst_complete.vim
Problem:  Various typos in the code, redundant and strange use of
          :execute in test_ins_complete.vim (after 9.1.1315).
Solution: Fix typos in the code and in the documentation, use the
          executed command directly (zeertzjq).

closes: #17143

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-18 10:57:33 +02:00
e9a27ef373 patch 9.1.1318: tests: test_format fails
Problem:  tests: test_format fails (after 9.1.1314).
Solution: Increase the string size.  Add missing test_format.res in
          NEW_TESTS_RES (zeertzjq).

closes: #17144

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-18 10:47:58 +02:00
ash
8f09684569 runtime(jjdescription): Don't require a space to start comments
Since jj v0.24.0 (December 2024), `JJ:` comments are recognised even
when not followed by a space.

closes: #17130

Signed-off-by: ash <ash@sorrel.sh>
Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-17 20:48:33 +02:00
cca5dea76e patch 9.1.1317: noisy error when restoring folds from session fails
Problem:  noisy error when restoring folds from session fails
Solution: ignore errors silently when sourcing session file.
          (Igor Lacerda)

fixes: #15813
closes: #17127

Signed-off-by: Igor Lacerda <igorlfs@ufmg.br>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-17 20:43:25 +02:00
7ddba51635 patch 9.1.1316: missing memory allocation failure in os_mswin.c
Problem:  missing memory allocation failure in os_mswin.c
Solution: check for memory allocation failure and return early.
          (John Marriott)

closes: #17134

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-17 20:35:42 +02:00
cfe502c575 patch 9.1.1315: completion: issue with fuzzy completion and 'completefuzzycollect'
Problem:  chain complete does not work when 'cot' includes fuzzy
          and 'completefuzzycollect' collects wrong next word.
          (Konfekt)
Solution: compl_startpos is not set correctly, remove next word check
          in search_for_fuzzy_match (glepnir).

fixes #17131
fixes #16942
closes: #17136

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-17 20:17:53 +02:00
06fdfa11c5 patch 9.1.1314: max allowed string width too small
Problem:  max allowed string width too small
Solution: increased MAX_ALLOWED_STRING_WIDTH from 6400 to 1MiB
          (Hirohito Higashi)

closes: #17138

Co-authored-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-17 20:13:05 +02:00
b53d4fb63e patch 9.1.1313: compile warning about uninitialized value
Problem:  compile warning about uninitialized value
          (Tony Mechelynck, after v9.1.1311)
Solution: initialize variable on declaration

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-16 21:12:30 +02:00
ad503fe927 patch 9.1.1312: tests: Test_backupskip() fails when HOME is defined
Problem:  tests: Test_backupskip() fails when HOME is defined
Solution: unset $HOME temporarily

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-16 20:25:47 +02:00
0ac1eb3555 patch 9.1.1311: completion: not possible to limit number of matches
Problem:  completion: not possible to limit number of matches
Solution: allow to limit the matches for 'complete' sources by using the
          "{flag}^{limit}" notation (Girish Palya)

This change extends the 'complete'  option to support limiting the
number of matches returned from individual completion sources.

**Rationale:** In large files, certain sources (such as the current
buffer) can generate an overwhelming number of matches, which may cause
more relevant results from other sources (e.g., LSP or tags) to be
pushed out of view. By specifying per-source match limits, the
completion menu remains balanced and diverse, improving visibility and
relevance of suggestions.

A caret (`^`) followed by a number can be appended to a source flag to
specify the maximum number of matches for that source. For example:
```
  :set complete=.^9,w,u,t^5
```
In this configuration:
- The current buffer (`.`) will return up to 9 matches.
- The tag completion (`t`) will return up to 5 matches.
- Other sources (`w`, `u`) are not limited.

This feature is fully backward-compatible and does not affect behavior
when the `^count` suffix is not used.

The caret (`^`) was chosen as the delimiter because it is least likely
to appear in file names.

closes: #17087

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-16 20:18:33 +02:00
1c2b258250 patch 9.1.1310: completion: redundant check for preinsert effect
Problem:  Duplicate check for preinsert effect, particularly for Ctrl_w
          and Ctrl_U.
Solution: Remove the specific check for Ctrl_w and Ctrl_U to eliminate
          redundancy (glepnir).

closes: #17129

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-16 19:41:19 +02:00
40daa1358c runtime(gleam): Update ftplugin, use recommended_style config variable
Wrap the setting of basic whitespace formatting options in a conditional
block, following the de facto standard.

Setting 'et', 'sts' and 'sw' can be disabled by setting
"gleam_recommended_style" to false.

Follow up to PR #17086.

closes: #17128

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-16 18:29:15 +02:00
031919c7ac patch 9.1.1309: tests: no test for 'pummaxwidth' with non-truncated "kind"
Problem:  tests: no test for 'pummaxwidth' with non-truncated "kind".
Solution: Add a test with "kind" and larger 'pummaxwidth' (zeertzjq).

closes: #17126

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-16 18:23:23 +02:00
fbbaa6ebe9 runtime: set 'cpoptions' for line-continuation in various runtime files
closes: #17121

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-16 18:20:59 +02:00
470317f78b runtime(tar): remove dependency on netrw#WinPath, include mapping doc
related: #17124

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-16 17:14:55 +02:00
839fd94265 runtime(netrw): remove deprecated functions
closes: #17124

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-15 20:28:09 +02:00
b156588eb7 patch 9.1.1308: completion: cannot order matches by distance to cursor
Problem:  During insert-mode completion, the most relevant match is often
          the one closest to the cursor—frequently just above the current line.
          However, both `<C-N>` and `<C-P>` tend to rank candidates from the
          current buffer that appear above the cursor near the bottom of the
          completion menu, rather than near the top. This ordering can feel
          unintuitive, especially when `noselect` is active, as it doesn't
          prioritize the most contextually relevant suggestions.

Solution: This change introduces a new sub-option value "nearest" for the
          'completeopt' setting. When enabled, matches from the current buffer
          are prioritized based on their proximity to the cursor position,
          improving the relevance of suggestions during completion
          (Girish Palya).

Key Details:
- Option: "nearest" added to 'completeopt'
- Applies to: Matches from the current buffer only
- Effect: Sorts completion candidates by their distance from the cursor
- Interaction with other options:
  - Has no effect if the `fuzzy` option is also present

This feature is helpful especially when working within large buffers where
multiple similar matches may exist at different locations.

You can test this feature with auto-completion using the snippet below. Try it
in a large file like `vim/src/insexpand.c`, where you'll encounter many
potential matches. You'll notice that the popup menu now typically surfaces the
most relevant matches—those closest to the cursor—at the top. Sorting by
spatial proximity (i.e., contextual relevance) often produces more useful
matches than sorting purely by lexical distance ("fuzzy").

Another way to sort matches is by recency, using an LRU (Least Recently Used)
cache—essentially ranking candidates based on how recently they were used.
However, this is often overkill in practice, as spatial proximity (as provided
by the "nearest" option) is usually sufficient to surface the most relevant
matches.

```vim
set cot=menuone,popup,noselect,nearest inf

def SkipTextChangedIEvent(): string
    # Suppress next event caused by <c-e> (or <c-n> when no matches found)
    set eventignore+=TextChangedI
    timer_start(1, (_) => {
        set eventignore-=TextChangedI
    })
    return ''
enddef

autocmd TextChangedI * InsComplete()

def InsComplete()
    if getcharstr(1) == '' && getline('.')->strpart(0, col('.') - 1) =~ '\k$'
        SkipTextChangedIEvent()
        feedkeys("\<c-n>", "n")
    endif
enddef

inoremap <silent> <c-e> <c-r>=<SID>SkipTextChangedIEvent()<cr><c-e>

inoremap <silent><expr> <tab>   pumvisible() ? "\<c-n>" : "\<tab>"
inoremap <silent><expr> <s-tab> pumvisible() ? "\<c-p>" : "\<s-tab>"
```

closes: #17076

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-15 20:16:00 +02:00
f35bd76b31 patch 9.1.1307: make syntax does not reliably detect different flavors
Problem:  GNU extensions, such as `ifeq` and `wildcard` function, are
          highlighted in BSDmakefile
Solution: detect BSD, GNU, or Microsoft implementation according to
	  filename, user-defined global variables, or file contents

closes: #17089

Co-authored-by: Roland Hieber <rohieb@users.noreply.github.com>
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-15 19:20:06 +02:00
32f2bb6e1e patch 9.1.1306: completion menu rendering can be improved
Problem:  Parts of the popup menu were rendered twice when the popup was
          at maximum width because the truncation flag was being set too
          liberally.
Solution: Make the truncation condition more precise by only setting it
          when there's exactly one character of space remaining
          (glepnir).

closes: #17108

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-15 19:06:58 +02:00
cf7f01252f patch 9.1.1305: completion menu active after switching windows/tabs
Problem:  When switching to another window or tab page while the
          completion menu is active, the menu stays visible, although it
          belongs to the previous window/tab page context (Evgeni
          Chasnovski).
Solution: Track the window and tab page where completion started. Detect
          changes in the main editing loop and cancel completion mode if
          the current window or tab page differs from where completion
          started.

fixes: #17090
closes: #17101

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-15 19:02:00 +02:00
babdb0554a patch 9.1.1304: filetype: some man files are not recognized
Problem:  filetype: some man files are not recognized
          (e.g. 1p (POSIX commands))
Solution: update the filetype detection pattern and detect more man
          files as nroff (Eisuke Kawashima)

- sections are revised referring to
    - debian-12:/etc/manpath.config
    - fedora-41:/etc/man_db.conf
- detection logic is improved
- detection test is implemented

closes: #17117

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-15 18:30:05 +02:00
d62377386c runtime(netrw): upstream snapshot of v180
relevant commits:
- fix(gvim): don't set previous jump
- don't overwrite copy, copydir, mkdir and move command options
- fix: correctly name deprecate function
- refactor: remove s:NetrwBufRemover
- refactor: s:NetrwDelete -> netrw#fs#Remove
- defaults!: remove g:netrw_use_errorwindow

fixes: #17114
closes: #17123

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-15 18:26:32 +02:00
2137710b43 patch 9.1.1303: missing out-of-memory check in linematch.c
Problem:  missing out-of-memory check in linematch.c
Solution: return early in case of memory allocation failure, move the
          pow() calculation ouside of the for() loop
          (John Marriott)

closes: #17118

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-15 18:15:24 +02:00
d2079cff48 patch 9.1.1302: Coverity warns about using uninitialized value
Problem:  Coverity warns about using uninitialized value
          (Coverity, Tony Mechelynck, after v9.1.1301)
Solution: initialize callback pointer to NULL

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-15 18:10:26 +02:00
cbe53191d0 patch 9.1.1301: completion: cannot configure completion functions with 'complete'
Problem:  completion: cannot configure completion functions with
          'complete'
Solution: add support for setting completion functions using the f and o
          flag for 'complete' (Girish Palya)

This change adds two new values to the `'complete'` (`'cpt'`) option:
- `f` – invokes the function specified by the `'completefunc'` option
- `f{func}` – invokes a specific function `{func}` (can be a string or `Funcref`)

These new flags extend keyword completion behavior (e.g., via `<C-N>` /
`<C-P>`) by allowing function-based sources to participate in standard keyword
completion.

**Key behaviors:**

- Multiple `f{func}` values can be specified, and all will be called in order.
- Functions should follow the interface defined in `:help complete-functions`.
- When using `f{func}`, escaping is required for spaces (with `\`) and commas
  (with `\\`) in `Funcref` names.
- If a function sets `'refresh'` to `'always'`, it will be re-invoked on every
  change to the input text. Otherwise, Vim will attempt to reuse and filter
  existing matches as the input changes, which matches the default behavior of
  other completion sources.
- Matches are inserted at the keyword boundary for consistency with other completion methods.
- If finding matches is time-consuming, `complete_check()` can be used to
  maintain responsiveness.
- Completion matches are gathered in the sequence defined by the `'cpt'`
  option, preserving source priority.

This feature increases flexibility of standard completion mechanism and may
reduce the need for external completion plugins for many users.

**Examples:**

Complete matches from [LSP](https://github.com/yegappan/lsp) client. Notice the use of `refresh: always` and `function()`.

```vim
set cpt+=ffunction("g:LspCompletor"\\,\ [5]). # maxitems = 5

def! g:LspCompletor(maxitems: number, findstart: number, base: string): any
    if findstart == 1
        return g:LspOmniFunc(findstart, base)
    endif
    return {words: g:LspOmniFunc(findstart, base)->slice(0, maxitems), refresh: 'always'}
enddef
autocmd VimEnter * g:LspOptionsSet({ autoComplete: false, omniComplete: true })
```

Complete matches from `:iabbrev`.

```vim
set cpt+=fAbbrevCompletor

def! g:AbbrevCompletor(findstart: number, base: string): any
    if findstart > 0
        var prefix = getline('.')->strpart(0, col('.') - 1)->matchstr('\S\+$')
        if prefix->empty()
            return -2
        endif
        return col('.') - prefix->len() - 1
    endif
    var lines = execute('ia', 'silent!')
    if lines =~? gettext('No abbreviation found')
        return v:none  # Suppresses warning message
    endif
    var items = []
    for line in lines->split("\n")
        var m = line->matchlist('\v^i\s+\zs(\S+)\s+(.*)$')
        if m->len() > 2 && m[1]->stridx(base) == 0
            items->add({ word: m[1], info: m[2], dup: 1 })
        endif
    endfor
    return items->empty() ? v:none :
        items->sort((v1, v2) => v1.word < v2.word ? -1 : v1.word ==# v2.word ? 0 : 1)
enddef
```

**Auto-completion:**

Vim's standard completion frequently checks for user input while searching for
new matches. It is responsive irrespective of file size. This makes it
well-suited for smooth auto-completion. You can try with above examples:

```vim
set cot=menuone,popup,noselect inf

autocmd TextChangedI * InsComplete()

def InsComplete()
    if getcharstr(1) == '' && getline('.')->strpart(0, col('.') - 1) =~ '\k$'
        SkipTextChangedIEvent()
        feedkeys("\<c-n>", "n")
    endif
enddef

inoremap <silent> <c-e> <c-r>=<SID>SkipTextChangedIEvent()<cr><c-e>

def SkipTextChangedIEvent(): string
    # Suppress next event caused by <c-e> (or <c-n> when no matches found)
    set eventignore+=TextChangedI
    timer_start(1, (_) => {
        set eventignore-=TextChangedI
    })
    return ''
enddef
```

closes: #17065

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: glepnir <glephunter@gmail.com>
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-14 22:13:15 +02:00
10f69298b4 patch 9.1.1300: wrong detection of -inf
Problem:  wrong detection of -inf
Solution: correctly compare 4 characters and not 3
          (John Marriott)

closes: #17109

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-14 21:19:34 +02:00
4ec93fec12 runtime(doc): update enum helptext
closes: #17112

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-14 21:14:33 +02:00
836b87d699 patch 9.1.1299: filetype: mbsyncrc files are not recognized
Problem:  filetype: mbsyncrc files are not recognized
Solution: detect isyncrc and "*.mbsyncrc" files as mbsync filetype,
          include filetype and syntax plugin (Pierrick Guillaume)

mbsync is a command line application which synchronizes mailboxes;
currently Maildir and IMAP4 mailboxes are supported.
New messages, message deletions and flag changes can be propagated both ways;
the operation set can be selected in a fine-grained manner.

References:
mbsync syntax overview: mbsync manual (isync v1.4.4)
https://isync.sourceforge.io/mbsync.html

Upstream support for the mbsync filetype.
Original plugin: https://github.com/Fymyte/mbsync.vim

closes: #17103

Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-13 18:25:33 +02:00
906f306812 CI: install xcode 16.3 on macos-15 runner
closes: #17111

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-13 18:19:56 +02:00
f4b1a60dd1 runtime(doc): update options.txt and clarify 'wildmode' further
related: #17100

Co-authored-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-13 18:09:50 +02:00
3cbd7f18e3 runtime(gleam): update Maintainer and filetype options
closes: #17086

Signed-off-by: Kirill Morozov <kirill@robotix.pro>
Signed-off-by: Trilowy <49493635+trilowy@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-13 17:58:32 +02:00
3956c5b53c patch 9.1.1298: define_function() is too long
Problem:  define_function() is too long
Solution: refactor and split up into smaller functions
          (Yegappan Lakshmanan)

closes: #17105

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-13 17:49:50 +02:00
c98250377d patch 9.1.1297: Ctrl-D scrolling can get stuck
Problem:  cursor_correct() calculates a valid cursor position which
	  is later changed by update_topline() and causes Ctrl-D
          scrolling to be stuck (Daniel Steinberg, after v9.1.0258).
Solution: Update the valid cursor position before validating topline
          (Luuk van Baal).

fixes: #17106
closes: #17110

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-13 17:45:34 +02:00
829eda7d38 runtime(new-tutor): update tutor and correct comandline completion
Problem: Some parts of the tutor are outdated.

- For example, pressing `<Tab>` after typing `:e` does not complete the
command `:edit`, but shows a completion menu with the first entry being
`:earlier`.

closes: #17107

Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-13 17:44:24 +02:00
d4dbf822dc patch 9.1.1296: completion: incorrect truncation logic
Problem:  completion: incorrect truncation logic (after: v9.1.1284)
Solution: replace string allocation with direct screen rendering and
          fixe RTL/LTR truncation calculations (glepnir)

closes: #17081

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-12 18:39:16 +02:00
cf665ccd37 patch 9.1.1295: clientserver: does not handle :stopinsert correctly
Problem:  clientserver: When in insert mode, a :stopinsert command
          is not correctly processed (user202729)
Solution: If the :stopinsert command is received while waiting for
          input, stuff the NOP key into the type-ahead buffer and
          detect that :stopinsert was used in edit() so that the
          cursor position is decremented.

fixes: #17016
closes: #17024

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-12 18:09:28 +02:00
6f6c0dba9f runtime(doc): disable last-position-jump in diff mode
This has been bothering me quite for some time and I never knew why it
happened. Just today it occurred to me this might have been because of
the last-position-jump.

So I figured, let's fix it for everybody, not just me.

closes: #17092

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-12 18:07:39 +02:00
eded33621b runtime(doc): Improve 'wildmode' setting desciption
closes: #17100

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-12 18:03:32 +02:00
bc27b6e34f patch 9.1.1294: gui tabline menu does not use confirm when closing tabs
Problem:  gui tabline menu does not use confirm when closing tabs
Solution: use ":confirm tabclose" explicitly (JMcKiern)

closes: #17093

Signed-off-by: JMcKiern <jmckiern@tcd.ie>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-12 11:51:00 +02:00
ab2fe65fbf runtime(doc): correct backslash escaping comma example
closes: #17096

Signed-off-by: Qiming zhao <chemzqm@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-12 11:40:17 +02:00
0e59e67a63 patch 9.1.1293: comment plugin does not handle 'exclusive' selection for comment object
Problem:  comment plugin does not handle 'exclusive' selection for
          comment object (@mawkish)
Solution: handle special case selection='exclusive' for inline comment
          object (Maxim Kim)

fixes: #17023
closes: #17098

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-12 11:34:08 +02:00
c8ce81b0dc patch 9.1.1292: statusline not correctly evaluated
Problem:  statusline not correctly evaluated
          (Peter Kenny, after v9.1.1291)
Solution: revert part of patch v9.1.1291
          (Hirohito Higashi)

fixes: #17095
closes: #17094

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-12 11:28:18 +02:00
d82f3cae39 runtime(sh): Do not look up a "sh" utility in $PATH for "sh_13.sh"
Dash may not be installed on a BSD CI runner, list it in the
shebang line.

See #17084
closes: #17094

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-12 11:18:10 +02:00
5c84d12df1 runtime(filetype): make shell filetype detection more robust
closes: #17063

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-10 21:55:00 +02:00
ec032de646 patch 9.1.1291: too many strlen() calls in buffer.c
Problem:  too many strlen() calls in buffer.c
Solution: refactor buffer.c and remove strlen() calls
          (John Marriott)

closes: #17063

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-10 21:34:19 +02:00
06a41ad084 runtime(keymaps): include 2 Brazilian Keymaps
closes: #17072

Signed-off-by: Elsarques <luismarques0504@proton.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-10 20:04:59 +02:00
9b171bdfd6 runtime(vim): Update-base-syntax, match full :*grep, :make, :sort and :filter commands
closes: #17082

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-10 19:59:22 +02:00
b0e19f9e1b patch 9.1.1290: tests: missing cleanup in test_filetype.vim
Problem:  tests: missing cleanup in test_filetype.vim, wrong name in
          test_plugin_matchparen
Solution: Add :bwipe corresponding to :split, rename test case

closes: #17088

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-10 19:54:16 +02:00
96a0b2a6d5 patch 9.1.1289: tests: no test for matchparen plugin with WinScrolled event
Problem:  tests: no test for matchparen plugin with WinScrolled event
Solution: add missing test

closes: #10942

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-09 19:29:18 +02:00
f9f53f5a8f runtime(remind): include remind.vim ftplugin
closes: #17085

Signed-off-by: Joe Reynolds <joereynolds952@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-09 19:27:37 +02:00
520a2c7852 runtime(vim): Update base-syntax, improve :command highlighting
- Match multiline :command definitions.
- Match custom completion funcref var names.

fixes: #17001
closes: #17067

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-08 20:50:00 +02:00
0b540c6f38 runtime(help): add omni completion and 'iskeyword' to filetype plugin
Problem:

- Help tags provide a good way to navigate the Vim documentation, but
  many help documents don't use them effectively. I think one of the
  reasons is that help writers have to look up help tags manually with
  `:help` command, which is not very convenient.
- 'iskeyword' is only set for help buffers opened by `:help` command.
  That means if I'm editing a help file, I cannot jump to tag in same
  file using `Ctrl-]` unless I manually set it, which is annoying.

Solution:

- Add omni completion for Vim help tags.
- Set 'iskeyword' for `ft-help`

closes: #17073

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-08 20:47:58 +02:00
7517a8cadf runtime(lf): improve syntax script, add filetype plugin
- Greatly improve detection and highlighting of command/shell regions,
  input-device key labels, escape sequences (@joelim-work)
- Add ftplugin for formatoptions, toggling comment areas
  (@andis-sprinkis)
- Add a few missing lf option keywords, rm. old non-working code, misc.
  formatting (@andis-sprinkis)

closes: #17078

Signed-off-by: Andis Spriņķis <andis@sprinkis.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-08 20:34:14 +02:00
b71f1309a2 patch 9.1.1288: Using wrong window in ll_resize_stack()
Problem:  Using wrong window in ll_resize_stack()
          (after v9.1.1287)
Solution: Use "wp" instead of "curwin", even though they are always the
          same value.  Fix typos in documentation (zeertzjq).

closes: #17080

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-08 20:31:21 +02:00
2525573de7 runtime(doc): rename wrong option to 'pummaxwidth'
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-08 08:36:18 +02:00
adcfb6caeb patch 9.1.1287: quickfix code can be further improved
Problem:  quickfix code can be further improved (after v9.1.1283)
Solution: slightly refactor quickfix.c (Hirohito Higashi)

- remove error message output
- adjust comments
- rename functions:
  - qf_init_quickfix_stack() --> qf_init_stack()
  - qf_resize_quickfix_stack() --> qf_resize_stack()
  - qf_resize_stack() --> qf_resize_stack_base()

Now qf_alloc_stack() can handle both quickfix/location lists.

closes: #17068

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-07 21:19:07 +02:00
e370141bf4 patch 9.1.1286: filetype: help files not detected when 'iskeyword' includes ":"
Problem:  Help files not detected when 'iskeyword' includes ":".
Solution: Do not use \< and \> in the pattern (zeertzjq).

fixes: #17069
closes: #17071

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-07 21:14:41 +02:00
5ce1e4ad4a patch 9.1.1285: Vim9: no error message for missing method after "super."
Problem:  Vim9: no error message for missing method after "super."
Solution: output an error message, add a few more tests
          (Yegappan Lakshmanan).

closes: #17070

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-07 21:09:18 +02:00
b87620466c patch 9.1.1284: not possible to configure pum truncation char
Problem:  not possible to configure the completion menu truncation
          character
Solution: add the "trunc" suboption to the 'fillchars' setting to
          configure the truncation indicator (glepnir).

closes: #17006

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-07 21:05:16 +02:00
2ffb4d0298 runtime(lua): fix whitespace style issues in lua ftplugin
related: #17049

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-07 14:10:58 +02:00
00b927b295 runtime(lua): improve foldexpr, add vim9 script version
closes: #17049

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-06 17:40:43 +02:00
2afdb3a65b runtime(doc): Fix minor typo in options.txt
closes: #17060

Signed-off-by: clach04 <clach04@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-06 17:37:12 +02:00
9cd6d82fbb runtime(fstab): set formatoptions-=t in filetype plugin
closes: #17020

Signed-off-by: Radu Dineiu <radu.dineiu@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-06 17:34:58 +02:00
9adb310cf3 runtime(svelte): add matchit support to svelte filetype plugin
closes: #17052

Signed-off-by: 231tr0n <zeltronsrikar@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-06 17:28:11 +02:00
88d41ab270 patch 9.1.1283: quickfix stack is limited to 10 items
Problem:  quickfix and location-list stack is limited to 10 items
Solution: add the 'chistory' and 'lhistory' options to configure a
          larger quickfix/location list stack
          (64-bitman)

closes: #16920

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: 64-bitman <60551350+64-bitman@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-06 17:20:39 +02:00
c54a8eb258 patch 9.1.1282: Build and test failure without job feature
Problem:  Build and test failure without job feature
          (lazypingu)
Solution: Adjust ifdefs, add CheckFeature job to tests

fixes: #17053
closes: #17059

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-06 16:15:10 +02:00
221927b2bf patch 9.1.1281: extra newline output when editing stdin
Problem:  extra newline output when editing stdin
Solution: remove outputting when reading from stdin in non-terminal mode
          (Abhijit Barik)

fixes: #16856
closes: #17047

Co-authored-by: LemonBoy <LemonBoy@users.noreply.github.com>
Signed-off-by: Abhijit Barik <Abhijit.Barik@ivanti.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-06 16:12:06 +02:00
ba73766788 patch 9.1.1280: trailing additional semicolon in get_matches_in_str()
Problem:  trailing additional semicolon in get_matches_in_str()
          (Hirohito Higashi)
Solution: remove it (Satoru Kitaguchi)

closes: #17066

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Satoru Kitaguchi <rule.the.fate.myfirststory@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-06 16:04:59 +02:00
8daae6fea9 patch 9.1.1279: Vim9: null_object and null_class are no reserved names
Problem:  Vim9: null_object and null_class are no reserved names
Solution: Add null_object and null_class as reserved names.
          (Yegappan Lakshmanan)

closes: #17054

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-05 16:03:27 +02:00
d22f43111b patch 9.1.1278: Vim9: too long functions in vim9type.c
Problem:  Vim9: too long functions in vim9type.c
Solution: refactor into separate functions
          (Yegappan Lakshmanan)

closes: #17056

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-05 15:57:12 +02:00
2f5a8c0b5b runtime(vim): Update base-syntax, match full :redir command
closes: #17057

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-05 15:55:36 +02:00
d84cbdb5a3 patch 9.1.1277: tests: trailing comment char in test_popupwin
Problem:  tests: trailing comment char in test_popupwin
Solution: remove crufty tail comment (Doug Kearns)

Remove a crufty tail comment from Test_popup_with_border_and_padding().
The line used to be in a string list and the closing quote and comma
persist.

closes: #17058

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-05 15:51:26 +02:00
9aa120f7ad patch 9.1.1276: inline word diff treats multibyte chars as word char
Problem:  inline word diff treats multibyte chars as word char
          (after 9.1.1243)
Solution: treat all non-alphanumeric characters as non-word characters
          (Yee Cheng Chin)

Previously inline word diff simply used Vim's definition of keyword to
determine what is a word, which leads to multi-byte character classes
such as emojis and CJK (Chinese/Japanese/Korean) characters all
classifying as word characters, leading to entire sentences being
grouped as a single word which does not provide meaningful information
in a diff highlight.

Fix this by treating all non-alphanumeric characters (with class number
above 2) as non-word characters, as there is usually no benefit in using
word diff on them. These include CJK characters, emojis, and also
subscript/superscript numbers. Meanwhile, multi-byte characters like
Cyrillic and Greek letters will still continue to considered as words.

Note that this is slightly inconsistent with how words are defined
elsewhere, as Vim usually considers any character with class >=2 to be
a "word".

related: #16881 (diff inline highlight)
closes: #17050

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-04 19:16:21 +02:00
b8d5c85099 runtime(doc): update WinScrolled documentation
closes: #17036

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-04 19:11:13 +02:00
2a6be83512 runtime(vim): Update base-syntax, improve :set backslash handling
Improve backslash handling in :set option values. There is no special
handling for options supporting Windows path separators yet.

See :help option-backslash.

Remove the vimSetString syntax group. Option string values cannot be
specified with a quoted string, this is a command terminating tail
comment.

fixes: #16913
closes: #17034

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-03 21:39:24 +02:00
d211558044 patch 9.1.1275: MS-Windows: Not possible to pass additional flags to Make_mvc
Problem:  MS-Windows: Not possible to pass additional flags to Make_mvc
Solution: Introduce $CI_FLAGS and use it to pass additional flags for
          the Github CI in order to treat size conversion warnings
          (C4267) as errors (Yegappan Lakshmanan)

closes: #17028

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-03 21:35:00 +02:00
6fa62085ff patch 9.1.1274: Vim9: no support for object<type> as variable type
Problem:  Vim9: no support for object<type> as variable type
Solution: add support for object<type> (Yegappan Lakshmanan)

closes: #17041

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-03 21:32:00 +02:00
f16d8b2dda patch 9.1.1273: Coverity warns about using uninitialized value
Problem:  Coverity warns about using uninitialized value
          (after 9.1.1270).
Solution: Put an empty string in "buf" when allocation fails (zeertzjq).

closes: #17040

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-03 21:21:15 +02:00
3e50a28a03 patch 9.1.1272: completion: in keyword completion Ctrl_P cannot go back after Ctrl_N
Problem:  completion: in keyword completion Ctrl_P cannot go back after
          Ctrl_N
Solution: in find_compl_when_fuzzy() always return first match of array, after Ctrl_P
          use compl_shown_match->cp_next instead of compl_first_match.
          (glepnir)

closes: #17043

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-03 21:17:06 +02:00
6099db9a60 runtime(sh): Update syntax file, command substitution opening paren at EOL
Allow the opening parenthesis of a command substitution to appear at
EOL.

This fixes the issue raised in
https://github.com/vim/vim/issues/17026#issuecomment-2774112284.

closes: #17044

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-03 21:13:39 +02:00
e74ec3f523 patch 9.1.1271: filetype: Power Query files are not recognized
Problem:  filetype: Power Query files are not recognized
Solution: detect '*.pq' as pq filetype, include pq syntax and filetype
          plugin (Anarion Dunedain)

Microsoft Power Query provides a powerful data import experience that
encompasses many features. Power Query works with desktop Analysis
Services, Excel, and Power BI workbooks, in addition to many online
services, such as Fabric, Power BI service, Power Apps, Microsoft 365
Customer Insights, and more. A core capability of Power Query is to
filter and combine, that is, to mash-up data from one or more of a rich
collection of supported data sources. Any such data mashup is expressed
using the Power Query M formula language. The M language is a
functional, case sensitive language similar to F#.

Reference:
- Power Query M formula language overview:
  https://learn.microsoft.com/en-us/powerquery-m/

closes: #17045

Signed-off-by: Anarion Dunedain <anarion80@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-03 21:08:25 +02:00
c1e019247d translation(ru): fix and updated messages translation
closes: #17046

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-03 21:04:57 +02:00
df68419ba0 runtime(doc): clarify the use of change marks when writing a buffer
related: #17008

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-03 12:35:51 +02:00
a359c9c25e runtime(zip): add *.whl to the list of zip extensions
This commits adds the extension *.whl to the list of zip extensions.
Wheel (WHL) files are binary distribution files for python packages.

Reference:
https://packaging.python.org/en/latest/specifications/binary-distribution-format/

fixes: #17038

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-02 20:45:57 +02:00
7fb90815a0 patch 9.1.1270: missing out-of-memory checks in buffer.c
Problem:  missing out-of-memory checks in buffer.c
Solution: handle out-of-memory situations during allocation
          (John Marriott)

closes: #17031

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-02 20:32:35 +02:00
8293574c8b runtime(doc): update pi_zip.txt with current list of zip file extensions
closes: #17037

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-02 20:28:23 +02:00
e4e4d1c381 patch 9.1.1269: completion: compl_shown_match is updated when starting keyword completion
Problem:  compl_shown_match is updated when starting keyword completion
          and does not include fuzzy matching.
Solution: Do not update compl_shown_match when starting keyword
          completion, since it is the one already selected by the
          keyword completion direction. (glepnir)

closes: #17033

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-02 20:18:25 +02:00
7f518e044f patch 9.1.1268: filetype: dax files are not recognized
Problem:  filetype: dax files are not recognized
Solution: detect "*.dax" as dax filetype, include dax filetype and
          syntax plugin (Anarion Dunedain)

Data Analysis Expressions (DAX) is a formula expression language used in
Analysis Services, Power BI, and Power Pivot in Excel. DAX formulas
include functions, operators, and values to perform advanced
calculations and queries on data in related tables and columns in
tabular data models.

DAX language overview:
- https://learn.microsoft.com/en-us/dax/dax-overview

closes: #17035

Signed-off-by: Anarion Dunedain <anarion80@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-02 19:54:31 +02:00
9301b437bc runtime(openPlugin): fix E480 when opening URLs with wildcards on Windows
This might be a bug in Windows Vim, as when using the following command
it throws E480:
```
:com! -complete=file -nargs=1 :Echo echo <q-args>
:Echo ?
E480: No match ?
```

Work-around this by using `-nargs=*` to allow more arguments, even
though this is not completely correct.

fixes: #17029

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-02 19:41:21 +02:00
de8f8f732a patch 9.1.1267: Vim9: no support for type list/dict<object<any>>
Problem:  Vim9: no support for type list/dict<object<any>>
Solution: add proper support for t_object_any
          (Yegappan Lakshmanan)

closes: #17025

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-01 20:43:36 +02:00
7b6add0b4a patch 9.1.1266: MS-Windows: type conversion warnings
Problem:  MS-Windows: type conversion warnings
Solution: cast the variables (Yegappan Lakshmanan)

closes: #17027

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-01 20:38:37 +02:00
2f4aa50c91 translation(ru): Updated messages translation
closes: #17030

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-01 20:36:27 +02:00
71f17fdd5f patch 9.1.1265: tests: no tests for typing normal char during completion
Problem:  tests: no tests for typing normal char during completion
Solution: add a test verifying the default behaviour (see :h
          popupmenu-completion)

related: #17019

Co-authored-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-31 20:57:13 +02:00
4ac995bf93 runtime(rust): set formatprg to rustfmt
closes: #16967

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-31 20:54:50 +02:00
b1d6db0be5 patch 9.1.1264: Vim9: error when comparing objects
Problem:  Vim9: error when comparing objects
          (lifepillar)
Solution: When comparing object types, compare their classes
          (Yegappan Lakshmanan)

fixes: #17014
closes: #17018

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-31 20:35:44 +02:00
20393bc02d runtime(doc): update last change date for diff.txt
related: #16997

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-30 15:39:41 +02:00
1c2f475850 runtime(doc): Update the tuple help text
closes: #17009

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-30 15:37:24 +02:00
583f5aee96 patch 9.1.1263: string length wrong in get_last_inserted_save()
Problem:  string length wrong in get_last_inserted_save()
          (after v9.1.1222)
Solution: when removing trailing ESC, also decrease the string length
          (Christ van Willegen)

closes: #16961

Signed-off-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-30 15:26:01 +02:00
f13c856154 patch 9.1.1262: heap-buffer-overflow with narrow 'pummaxwidth' value
Problem:  heap-buffer-overflow occurs with narrow 'pummaxwidth' value
          (after v9.1.1250)
Solution: test that st_end points after st pointer (Hirohito Higashi)

closes: #17005

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-30 15:19:05 +02:00
c6336acfe3 patch 9.1.1261: No test for 'pummaxwidth' non-truncated items
Problem:  No test for 'pummaxwidth' non-truncated items (after v9.1.1250)
Solution: Add shorter items to Test_pum_maxwidth_multibyte() (zeertzjq).

closes: #17007

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-30 15:07:35 +02:00
649a237bc8 runtime(debversions): Add release name for Debian 15 - duke
https://lists.debian.org/debian-devel-announce/2025/01/msg00004.html

closes: #17010

Signed-off-by: James McCoy <jamessan@debian.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-30 15:05:46 +02:00
53fed23cb7 patch 9.1.1260: Hang when filtering buffer with NUL bytes
Problem:  Hang when filtering buffer with NUL bytes (after 9.1.1050).
Solution: Don't subtract "written" from "lplen" repeatedly (zeertzjq).

related: neovim/neovim#33173
closes: #17011

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-30 15:01:56 +02:00
e9a369f9c3 runtime(odin): add new keywords to syntax script
closes: #17012

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-30 15:00:00 +02:00
a580761a45 patch 9.1.1259: some issues with comment package and tailing spaces
Problem:  some issues with comment package and tailing spaces
Solution: correctly capture trailing spaces with the ac/ic text object
          (Maxim Kim)

This commit fixes a few issues with the comment package:

1) both ac and ic incorrectly miss the last //

```
// hello trailing spaces
//
```

2) fix ac/ic with last empty comment line,
   vac should also select last line with #

```py
 # print("hello")
 # print("world")
 #
 #
$endofbuffer$
```

closes: #17013

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-30 14:55:26 +02:00
bb8e5ddb97 ci: Check and confirm Vim feature flags exist before testing
Vim tests for features such as python3 relies on checking the feature
flag exists by doing `has('python3')`. However, if the feature itself is
broken and the flag returns 0, the relevant tests will simply silently
get ignored and CI will passed erroneously. As a preventive measure, as
basic checks to make sure certain feature flags are correct as a basic
smoke test.

Currently only checking two types of feature flags:

1. Features that depend on system packages being installed properly
   (e.g. sodium) and could be erroneously dropped if the CI environment
   changed or a bug exists in the configure script.
2. Scripting languages. When in dynamic mode, these feature flags (e.g.
   "ruby", "python3") will return 0 when the lib cannot be found or the
   code has an initialization bug. This happened in #16964 where CI
   still passed despite Python 3 being broken.

closes: #16998

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-30 14:48:29 +02:00
1054b18291 runtime(java): Make changes for JDK 24 in syntax script
- "Demote" SecurityManager from the list of java.lang class
  types to javaLangDeprecated.
- Reintroduce supported syntax-preview-feature numbers 455
  and 476 as _new numbers_ 488 and 494, respectively.

References:
- https://openjdk.org/jeps/486 (Permanently Disable the Security Manager)
- https://openjdk.org/jeps/488 (Primitive Types in Patterns etc.)
- https://openjdk.org/jeps/494 (Module Import Declarations)

closes: #16977

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-29 09:16:30 +01:00
f2b16986a1 patch 9.1.1258: regexp: max \U and \%U value is limited by INT_MAX
Problem:  regexp: max \U and \%U value is limited by INT_MAX but gives a
          confusing error message (related: v8.1.0985).
Solution: give a better error message when the value reaches INT_MAX

When searching Vim allows to get up to 8 hex characters using the /\V
and /\%V regex atoms.  However, when using "/\UFFFFFFFF" the code point is
already above what an integer variable can hold, which is 2,147,483,647.

Since patch v8.1.0985, Vim already limited the max codepoint to INT_MAX
(otherwise it caused a crash in the nfa regex engine), but instead of
error'ing out it silently fell back to parse the number as a backslash
value and not as a codepoint value and as such this "/[\UFFFFFFFF]" will
happily find a "\" or an literal "F".  And this "/[\d127-\UFFFFFFFF]"
will error out as "reverse range in character class).

Interestingly, the max Unicode codepoint value is U+10FFFF which still
fits into an ordinary integer value,  which means, that we don't even
need to parse 8 hex characters, but 6 should have been enough.

However, let's not limit Vim to search for only max 6 hex characters
(which would be a backward incompatible change), but instead allow all 8
characters and only if the codepoint reaches INT_MAX, give a more
precise error message (about what the max unicode codepoint value is).
This allows to search for "[\U7FFFFFFE]" (will likely return "E486
Pattern not found") and "[/\U7FFFFFF]" now errors "E1517: Value too
large, max Unicode codepoint is U+10FFFF".

While this change is straight forward on architectures where long is 8
bytes, this is not so simple on Windows or 32bit architectures where long
is 4 bytes (and therefore the test fails there).  To account for that,
let's make use of the vimlong_T number type and make a few corresponding
changes in the regex engine code and cast the value to the expected data
type. This however may not work correctly on systems that doesn't have
the long long datatype (e.g. OpenVMS) and probably the test will fail
there.

fixes: #16949
closes: #16994

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-29 09:08:58 +01:00
90e52490b3 patch 9.1.1257: Mixing vim_strsize() with mb_ptr2cells() in pum_redraw()
Problem:  Mixing vim_strsize() with mb_ptr2cells() in pum_redraw().
Solution: Change vim_strsize() to mb_string2cells() (zeertzjq).

Since vim_strsize() uses ptr2cells() for the cell width of each char, it
is strange to mix it with mb_ptr2cells(), which is used both just below
and in pum_screen_puts_with_attr(), and screen_puts_len() also uses
something similar.  Meanwhile mb_string2cells() uses mb_ptr2cells() for
the cell width of each char.

Note that the vim_strsize() and mb_string2cells() actually return the
same value here, as the transstr() above makes sure the string only
contains printable chars, and ptr2cells() and mb_ptr2cells() only return
different values for unprintable chars.

closes: #17003

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-29 09:05:52 +01:00
0dc9a0bc60 runtime(lf): add lf r34 keywords to syntax script
closes: #17002

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-29 09:03:54 +01:00
0980e41161 patch 9.1.1256: if_python: duplicate tuple data entries
Problem:  if_python: duplicate tuple data entries
          (after v9.1.1239)
Solution: clean up duplicates (Yegappan Lakshmanan)

closes: #17004

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-29 08:53:12 +01:00
722fbd1554 runtime(vim): Update base-syntax, match tuples
Tuples were introduced in commit 9cb865e.  See PR #16776.

fixes: #16965
closes: #16935

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-28 19:36:37 +01:00
532c5aec6f patch 9.1.1255: missing test condition for 'pummaxwidth' setting
Problem:  missing test condition for 'pummaxwidth' setting, pummaxwidth
          not effective when width is 32 and height is 10
          (after v9.1.1250)
Solution: add missing comparison condition in pum_width()
          (glepnir)

closes: #16999

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-28 19:21:59 +01:00
aa68f8a095 patch 9.1.1254: need more tests for the comment plugin
Problem:  need more tests for the comment plugin
Solution: add a tests for the [gb]:comment_first_col setting
          (Maxim Kim)

closes: #16995

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-28 19:17:53 +01:00
ce80c59bfd patch 9.1.1253: abort when closing window with attached quickfix data
Problem:  If win_close() is called with a window that has quickfix stack
          attached to it, the corresponding quickfix buffer will be
          closed and freed after the buffer was already closed. At that
          time curwin->w_buffer points to NULL, which the CHECK_CURBUF
          will catch and abort if ABORT_ON_ERROR is defined
Solution: in wipe_qf_buffer() temporarily point curwin->w_buffer back to
          curbuf, the window will be closed anyhow, so it shouldn't
          matter that curbuf->b_nwindows isn't incremented.

closes: #16993
closes: #16985

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-28 19:13:32 +01:00
c5aad6cca5 runtime(doc): non-portable sed regex in Makefile for pi_netrw.txt rule
Previously it was using '\0' in sed which is non-portable and does not
work in macOS. Fix this by using the '$' (end-of-line) regex atom (which
needs to be doubled in the Makefile) to append at the end instead. An
alternative would have been to use '&' which is the more portable
version of '\0'.

closes: #16996

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-28 19:11:11 +01:00
5a307c361c patch 9.1.1252: typos in code and docs related to 'diffopt' "inline:"
Problem:  Typos in code and docs related to 'diffopt' "inline:".
          (after v9.1.1243)
Solution: Fix typos and slightly improve the docs.
          (zeertzjq)

closes: #16997

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-28 19:04:06 +01:00
e06b2aea43 patch 9.1.1251: if_python: build error with tuples and dynamic python
Problem:  if_python: build error with tuples and dynamic python
          (after v9.1.1239)
Solution: Fix build error and test failures (Yee Cheng Cin)

closes: #16992

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-27 20:15:26 +01:00
88d75934c3 patch 9.1.1250: cannot set the maximum popup menu width
Problem:  cannot set the maximum popup menu width
          (Lucas Mior)
Solution: add the new global option value 'pummaxwidth'
          (glepnir)

fixes: #10901
closes: #16943

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-27 20:09:07 +01:00
757c37da6d patch 9.1.1249: tests: no test that 'listchars' "eol" doesn't affect "gM"
Problem:  No test that 'listchars' "eol" doesn't affect "gM".
Solution: Add a test (zeertzjq).

closes: #16990

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-27 18:21:49 +01:00
29d11a8326 runtime(doc): group python interface related items in todo.txt
While at it, remove the item about merged PR #12032

closes: #16984

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-03-27 18:20:30 +01:00
45377e2096 patch 9.1.1248: compile error when building without FEAT_QUICKFIX
Problem:  compile error when building without FEAT_QUICKFIX
Solution: adjust ifdefs in popupwin.c, add CheckFeature quickfix
          to a few tests (John Marriott, Hirohito Higashi)

closes: #16940
closes: #16962

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-27 18:16:52 +01:00
7d8e7df551 patch 9.1.1247: fragile setup to get (preferred) keys from key_name_entry
Problem:  fragile setup to get (preferred) keys from key_name_entry
          (after v9.1.1179)
Solution: refactor the code further, fix a bug with "pref_name" key
          entry introduced in v9.1.1180 (Yee Cheng Chin)

The optimization introduced for using bsearch() with key_name_entry
in #16788 was fragile as it required synchronizing a non-obvious index
(e.g. IDX_KEYNAME_SWU) with the array that could be accidentally changed
by any one adding a key to it. Furthermore, the "pref_name" that was
introduced in that change was unnecessary, and in fact introduced a bug,
as we don't always want to use the canonical name.

The bug is triggered when the user triggers auto-complete using a
keycode, such as `:set <Scroll<Tab>`. The bug would end up showing two
copies of `<ScrollWheelUp>` because both entries end up using the
canonical name.

In this change, remove `pref_name`, and simply use a boolean to track
whether an entry is an alt name or not and modify logic to respect that.

Add test to make sure auto-complete works with alt names

closes: #16987

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-27 17:51:03 +01:00
4f9b1243e3 patch 9.1.1246: coverity complains about some changes in v9.1.1243
Problem:  coverity complains about some changes in v9.1.1243
Solution: remove duplicate code in diff_find_changed() (Yee Cheng Chin)

closes: #16988

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-27 17:34:50 +01:00
d9b82cfe84 patch 9.1.1245: need some more tests for curly braces evaluation
Problem:  need some more tests for curly braces evaluation
Solution: Add a test for the regression introduced by patch v9.1.1242
          (Yegappan Lakshmanan)

closes: #16986

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-27 17:31:31 +01:00
35cb38d34b patch 9.1.1244: part of patch v9.1.1242 was wrong
Problem:  part of patch v9.1.1242 was wrong
Solution: revert part of the patch

fixes: #16983
related: #16972

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-26 20:36:12 +01:00
14dec7b204 runtime(omnimark): update and rewrite syntax script in Vim9 script
Note: this commit rewrites the omnimark syntax script in Vim9 script and
      is therefore probably incompatible with Neovim

closes: #16979

Signed-off-by: Peter Kenny <github.com@k1w1.cyou>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-26 19:52:50 +01:00
9943d4790e patch 9.1.1243: diff mode is lacking for changes within lines
Problem:  Diff mode's inline highlighting is lackluster. It only
          performs a line-by-line comparison, and calculates a single
          shortest range within a line that could encompass all the
          changes. In lines with multiple changes, or those that span
          multiple lines, this approach tends to end up highlighting
          much more than necessary.

Solution: Implement new inline highlighting modes by doing per-character
          or per-word diff within the diff block, and highlight only the
          relevant parts, add "inline:simple" to the defaults (which is
          the old behaviour)

This change introduces a new diffopt option "inline:<type>". Setting to
"none" will disable all inline highlighting, "simple" (the default) will
use the old behavior, "char" / "word" will perform a character/word-wise
diff of the texts within each diff block and only highlight the
differences.

The new char/word inline diff only use the internal xdiff, and will
respect diff options such as algorithm choice, icase, and misc iwhite
options. indent-heuristics is always on to perform better sliding.

For character highlight, a post-process of the diff results is first
applied before we show the highlight. This is because a naive diff will
create a result with a lot of small diff chunks and gaps, due to the
repetitive nature of individual characters. The post-process is a
heuristic-based refinement that attempts to merge adjacent diff blocks
if they are separated by a short gap (1-3 characters), and can be
further tuned in the future for better results. This process results in
more characters than necessary being highlighted but overall less visual
noise.

For word highlight, always use first buffer's iskeyword definition.
Otherwise if each buffer has different iskeyword settings we would not
be able to group words properly.

The char/word diffing is always per-diff block, not per line, meaning
that changes that span multiple lines will show up correctly.
Added/removed newlines are not shown by default, but if the user has
'list' set (with "eol" listchar defined), the eol character will be be
highlighted correctly for the specific newline characters.

Also, add a new "DiffTextAdd" highlight group linked to "DiffText" by
default. It allows color schemes to use different colors for texts that
have been added within a line versus modified.

This doesn't interact with linematch perfectly currently. The linematch
feature splits up diff blocks into multiple smaller blocks for better
visual matching, which makes inline highlight less useful especially for
multi-line change (e.g. a line is broken into two lines). This could be
addressed in the future.

As a side change, this also removes the bounds checking introduced to
diff_read() as they were added to mask existing logic bugs that were
properly fixed in #16768.

closes: #16881

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-26 19:46:09 +01:00
06774a271a patch 9.1.1242: Crash when evaluating variable name
Problem:  Crash when evaluating variable name (after v9.1.0870)
Solution: calculate the strlen() directly instead of pointer
          arithmetics, fix missing assignment to lp->ll_name_end in
          get_lval() (zeertzjq)

closes: #16972
fixes: vim-airline/vim-airline#2710
related: #16066

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-26 19:25:57 +01:00
4dd17a90ee patch 9.1.1241: wrong preprocessort indentation in term.c
Problem:  wrong preprocessort indentation in term.c
Solution: update indentation (Hirohito Higashi)

closes: #16981

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-26 19:08:46 +01:00
08283b28af patch 9.1.1240: Regression with ic/ac text objects and comment plugin
Problem:  Regression with ic/ac text objects and comment plugin
Solution: Fix regression, update tests (Maxim Kim)

fix regression: sometimes ic/ac should be line-wise

```
int main() {
    // multilple comments
    // cursor is between them
}

 # dac ->

int main() {
}
```

closes: #16947
closes: #16980

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-26 19:05:35 +01:00
f9f4e27ad7 runtime(hyprlang): save and restore cpo setting in syntax script
fixes: #16970
closes: #16973

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-26 19:00:15 +01:00
052b86ba63 runtime(solidity): update syntax script with error definitions
closes: #16978

References:
- https://docs.soliditylang.org/en/latest/contracts.html#transient-storage
- https://soliditylang.org/blog/2021/04/21/custom-errors/

Signed-off-by: S0AndS0 <strangerthanbland@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-26 18:57:55 +01:00
721be7fd0b runtime(doc): add back help tag "pi_netrw.txt"
closes: #16974

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-26 18:53:46 +01:00
038be2701d patch 9.1.1239: if_python: no tuple data type support
Problem:  if_python: no tuple data type support (after v9.1.1232)
Solution: Add support for using Vim tuple in the python interface
          (Yegappan Lakshmanan)

closes: #16964

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-26 18:46:21 +01:00
9d5487f6fd runtime(doc): Add missing garbagecollect() hypertext link
closes: #16975

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-25 21:04:23 +01:00
20e46fa65b Improve contributing guide by adding a section on signing off commits
related: #16957
closes: #16976

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-25 21:02:20 +01:00
7746348c5d patch 9.1.1238: wrong cursor column with 'set splitkeep=screen'
Problem:  With ':set splitkeep=screen', cursor did't restore column
          correctly when splitting a window on a line longer than the
          last line on the screen (after v9.1.0707)
Solution: Restore cursor column in `win_fix_scroll()` since it may be
          changed in `getvcol()` after 396fd1ec29 (phanium).

Example:
```
echo longlonglongling\nshort | vim - -u NONE --cmd 'set
splitkeep=screen' +'norm $' +new +q
```

fixes: #16968
closes: #16971

Signed-off-by: phanium <91544758+phanen@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-25 20:15:31 +01:00
2726821d38 patch 9.1.1237: Compile error with C89 compiler in term.c
Problem:  Compile error with C89 compiler in term.c
          (Zoltan Arpadffy)
Solution: split out LOG_TR macro into 2 different macros. LOG_TR1 that
          takes only a single argument and LOG_TRN that takes 2
          arguments. Remove the use of ##__VA_ARGS__ since the macro is
          now always called with 2 arguments (Hirohito Higashi)

related: #16962
closes: #16969

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-25 20:08:32 +01:00
35cb03648f patch 9.1.1236: tests: test_comments leaves swapfiles around
Problem:  tests: test_comments leaves swapfiles around
Solution: use ':bw!' instead of ':close!'

closes: #16955

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-24 20:38:42 +01:00
d2232d70c8 patch 9.1.1235: cproto files are outdated
Problem:  cproto files are outdated
Solution: regenerate proto files by running make proto
          (Yegappan Lakshmanan)

closes: #16956

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-24 20:36:14 +01:00
7cedae3ec3 patch 9.1.1234: Compile error when SIZE_MAX is not defined
Problem:  Compile error when SIZE_MAX is not defined
Solution: Define SIZE_MAX (Zoltan Arpadffy)

related: #16962

Signed-off-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-24 20:33:08 +01:00
b42b9fc41f patch 9.1.1233: Coverity warns about NULL pointer when triggering WinResized
Problem:  Coverity warns about NULL pointer when triggering WinResized
Solution: Add OOM checks for windows_list like for scroll_dict. Remove
          void casts that are unnecessary after 9.1.1084 (zeertzjq).

closes: #16959

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-24 20:22:23 +01:00
92e109fc13 runtime(doc): Fix an omission in the documentation.
closes: #16960

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-24 20:12:37 +01:00
9cb865e95b patch 9.1.1232: Vim script is missing the tuple data type
Problem:  Vim script is missing the tuple data type
Solution: Add support for the tuple data type
          (Yegappan Lakshmanan)

closes: #16776

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-23 16:42:16 +01:00
adb703e1b9 runtime(vim): Update base-syntax, match protected constructors
Support for protected constructors was added in commit 7e89800.

closes: 16618

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-23 16:14:20 +01:00
b5459ee104 runtime(syntax-tests): Do not ignore failed screendumps
The process of preparing and submitting syntax tests is
fraught with challenges that can turn away many aspiring
contributors from ever attempting it.  (Out of 69 languages
introduced since v9.0.1627, there are only syntax tests for
Tera.)

After v9.1.1176~1, one visual clue for admitting syntax test
failures previously available with e.g. "git status" is gone
after all files under "failed/" have been made ignored for
Git and Mercurial.  There isn't a single way to go about it:
some people may move files from "failed/" to "dumps/" after
each iteration; some people may only move "good" iteration
files; when a test file is refactored to a great extent,
some people may prefer deleting all test-related files under
"dumps/" before moving files from "failed/".  The usability
of reporting, at any time, that there are some _untracked_
files under "failed/" cannot be overstated.  Without it, the
chances are greater for pushing mismatched changesets.  And
when tests fail then everyone but the author will be kept in
the dark about the cause: were some updated screendumps not
committed _or_ was a wrong version of the syntax plugin
committed?

Another file, "testdir/Xfilter" (v9.1.0763), that will be
created to establish communication from Make to Vim about
what subset of syntax tests is requested for running, should
also be not ignored but rather deleted once its contents are
read.  Unless it is explicitly deleted _after test failure_,
the file may contain new *and* old test names when another
testing attempt is under way.  And by virtue of it being
ignored, the reason for also running not requested tests
will be as ever puzzling.

Both Git and Mercurial support per-user configuration; such
wide-reaching settings hardly belong to clonable defaults.

Also, match literal dots in testname filters.

Also, discover and report _some_ disused screendump files
tracked under "dumps/".

References:
- https://git-scm.com/docs/gitignore
- https://www.mercurial-scm.org/help/topics/config#ui

closes: #16917

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-23 10:42:23 +01:00
4e7b4308fb patch 9.1.1231: filetype: SPA JSON files are not recognized
Problem:  filetype: SPA (single page application) JSON files are not
          recognized (used by pipewire and wireplumber)
Solution: detect pipewire and wireplumber configuration files as spajson
          filetype, include filetype, indent and syntax scripts for this
          new filetype (David Mandelberg).

I looked at all the files found by this command to see if the syntax
highlighting looked reasonable:

```
find {~/.config,/etc,/usr/share}/{pipewire,wireplumber} -type f -name \*.conf
```

References:
*   pipewire config files: https://docs.pipewire.org/page_config.html
*   wireplumber config files:
    https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/conf_file.html
    and
*   https://pipewire.pages.freedesktop.org/wireplumber/daemon/locations.html

closes: #16950

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-23 10:26:00 +01:00
932a535bfa runtime(doc): update and correct str2blob() and blob2str() examples
closes: #16952

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-23 10:20:20 +01:00
e14aa3c035 runtime(hlyank): update the hlyank package
closes: #16944

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-22 15:58:59 +01:00
19d4f99a34 runtime(syntax-tests): Add non-Latin-1 character filters for C syntax tests
See pull request #14767.

Rename the Vim :keymap filter files so they're, again, associated with
the correct dump files.

closes: #16560

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-21 18:17:17 +01:00
8a63529a2f patch 9.1.1230: inconsistent CTRL-C behaviour for popup windows
Problem:  Ctrl-C closes popup windows that have a filter callback,
          but does not close popups without a filter callback.
Solution: Modified popup_do_filter() to also close popups without
          filter callback when Ctrl-C is pressed (glepnir).

fixes: #16839
closes: #16928

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-21 18:12:32 +01:00
9712a2534f patch 9.1.1229: the comment plugin can be improved
Problem:  the comment plugin can be improved
Solution: add comment text objects "ic" and "ac"
          (Maxim Kim)

closes: #16938

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-21 18:04:37 +01:00
51a06ecee0 runtime(sh): consider sh as POSIX shell by default
Also, do not set g:is_kornshell when g:is_posix is set. BSD shells are
POSIX but many are derived from the ash shell.

closes: #16939

Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-21 17:52:08 +01:00
5753084042 patch 9.1.1228: completion: current position column wrong after got a match
Problem:  The current_pos.col was incorrectly updated to the length of
          the matching text. This will cause the next search to start
          from the wrong position.
Solution: current_pos has already been updated in search_str_in_line and
          does not need to be changed (glepnir)

closes: #16941

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-21 17:16:21 +01:00
83d74404bb runtime(hlyank): add the hlyank package
closes: #16919
related: #16866

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-19 21:55:59 +01:00
51ff18e319 patch 9.1.1227: no tests for the comment package
Problem:  no tests for the comment package
Solution: add some tests (Maxim Kim).

closes: #16933

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-19 20:54:12 +01:00
7a5115ce50 patch 9.1.1226: "shellcmdline" completion doesn't work with input()
Problem:  "shellcmdline" completion doesn't work with input().
Solution: Use set_context_for_wildcard_arg().  Fix indent in nextwild()
          (zeertzjq).

There are some other inconsistencies for input() completion (ref #948),
but since "shellcmdline" currently doesn't work at all, it makse sense
to at least make it work.

fixes: #16932
closes: #16934

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-19 20:29:58 +01:00
e4e0a2468c patch 9.1.1225: extra NULL check in VIM_CLEAR()
Problem:  extra NULL check in VIM_CLEAR()
Solution: remove the NULL check and rely on the NULL check in vim_free()
          instead (Hirohito Higashi).

closes: #16936

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-19 20:28:20 +01:00
40ab82b974 runtime(sh): remove invalid commented out line in syntax script
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-18 23:12:52 +01:00
711f4a07f3 runtime(sh): update sh indent script
fixes: #16930

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-18 22:36:28 +01:00
e08f10a55c patch 9.1.1224: cannot :put while keeping indent
Problem:  cannot :put while keeping indent (Peter Aronoff)
Solution: add the :iput ex command (64-bitman)

fixes: #16225
closes: #16886

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: 64-bitman <60551350+64-bitman@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-18 22:14:34 +01:00
11ab02c819 runtime(go): use :term for keywordprg for nvim/gvim
Problem:
- The document from `go doc` can be very long, and you can scroll if
  using `!` to run shell command in Gvim.
- I realize that I didn't fully mimic behavior of default keywordprg
  in Nvim in the last commit.

Solution:
- Use builtin terminal for keywordprg in Gvim
- In Nvim (both TUI and GUI), it should mimic the behavior of Vim
  `:term`, `:Man`, and `:help`

closes: #16911

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-18 21:05:35 +01:00
d5afc74403 patch 9.1.1223: wrong translation used for encoding failures
Problem:  wrong translation for encoding failures because of using
          literal "from" and "to" in the resulting error message
          (RestorerZ)
Solution: use separate error messages for errors "from" and "to"
          encoding errors.

fixes: #16898
closes: #16918

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-18 20:55:42 +01:00
8ac0f73eb1 patch 9.1.1222: using wrong length for last inserted string
Problem:  using wrong length for last inserted string
          (Christ van Willegen, after v9.1.1212)
Solution: use the correct length in get_last_insert_save(), make
          get_last_insert() return a string_T (John Marriott)

closes: #16921

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-18 20:49:01 +01:00
a3a7d10bfb patch 9.1.1221: Wrong cursor pos when leaving Insert mode just after 'autoindent'
Problem:  Wrong cursor position and '^' mark when leaving Insert mode
          just after 'autoindent' and cursor on last char of line.
Solution: Don't move cursor to NUL when it wasn't moved to the left
          (zeertzjq).

fixes: #15581
related: neovim/neovim#30165 neovim/neovim#32943
closes: #16922

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-18 20:41:24 +01:00
18a6853a76 patch 9.1.1220: filetype: uv.lock file not recognized
Problem:  filetype: uv.lock file not recognized
Solution: detect uv.lock file as toml filetype
          (Acaibird)

closes: #16924

Signed-off-by: Acaibird <durbannhawkey42@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-18 20:35:29 +01:00
c4815c157b patch 9.1.1219: Strange error with wrong type for matchfuzzy() "camelcase"
Problem:  Strange error with type for matchfuzzy() "camelcase".
Solution: Show the error "Invalid value for argument camelcase" instead
          of "Invalid argument: camelcase" (zeertzjq).

Note that using tv_get_string() will lead to confusion, as when the
value cannot be converted to a string tv_get_string() will also give an
error about that, but "camelcase" takes a boolean, not a string.  Also
don't use tv_get_string() for the "limit" argument above.

closes: #16926

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-18 20:28:00 +01:00
c00729824d patch 9.1.1218: missing out-of-memory check in filepath.c
Problem:  missing out-of-memory check in filepath.c
Solution: Add check for NULL (John Marriott)

closes: #16906

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-17 21:14:17 +01:00
85627732e0 patch 9.1.1217: tests: typos in test_matchfuzzy.vim
Problem:  tests: typos in test_matchfuzzy.vim (after 9.1.1214).
Solution: Fix the typos.  Consistently put the function call on the
          second line in assertions for camelcase (zeertzjq).

closes: #16907

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-17 21:06:02 +01:00
61b3544424 patch 9.1.1216: Pasting the '.' register multiple times may not work
Problem:  Pasting the '.' register multiple times may work incorrectly
          when the last insert starts with Ctrl-D and ends with '0'.
          (after 9.1.1212)
Solution: Restore the missing assignment (zeertzjq).

closes: #16908

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-17 21:02:50 +01:00
ad2f6b6662 runtime(keymap) Add forward slash (/) to russian-jcukenwin keymap
closes: #16912

Signed-off-by: Marat Amerov <maratamerov@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-17 20:45:03 +01:00
dd3f1c0dda runtime(vim): Update base-syntax, match multiline return types
fixes #14442.
closes: #16914

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-17 20:27:13 +01:00
762a79e15c patch 9.1.1215: Patch 9.1.1213 has some issues
Problem:  Patch 9.1.1213 has some issues
Solution: revert it for now

This reverts commit 250739d442.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-16 21:39:58 +01:00
28e40a7b55 patch 9.1.1214: matchfuzzy() can be improved for camel case matches
Problem:  When searching for "Cur", CamelCase matches like "lCursor" score
          higher than exact prefix matches like Cursor, which is
          counter-intuitive (Maxim Kim).
Solution: Add a 'camelcase' option to matchfuzzy() that lets users disable
          CamelCase bonuses when needed, making prefix matches rank higher.
          (glepnir)

fixes: #16504
closes: #16797

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-16 21:29:19 +01:00
250739d442 patch 9.1.1213: cannot :put while keeping indent
Problem:  cannot :put while keeping indent
          (Peter Aronoff)
Solution: add the :iput ex command (64-bitman)

fixes: #16225
closes: #16886

Signed-off-by: 64-bitman <60551350+64-bitman@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-16 21:15:11 +01:00
7ceca3eb00 runtime(syntax-tests): Support "wait-free" test failure
When certain changes guarantee failure for old syntax tests,
opt for faster failure by reducing the number of screendumps
made for each file "page" to be no greater than the assigned
value of a VIM_SYNTAX_TEST_WAIT_TIME environment variable.
(This variable will be ignored and more screendumps may be
made when Make is GNU Make and a parent Makefile is used.)

Barring regressions, and assuming that v9.1.1163~1 succeeds
in providing a correct synchronisation mechanism outside of
"VerifyScreenDump()", and assuming that "readfile()" always
obtains the latest contents written by "term_dumpwrite()" in
"VerifyScreenDump()"; making a single screendump of a file
"page" and following it with a single reading of the written
screendump file should be enough to decide whether to pass
or fail a syntax test.

In addition, re-enable self testing after v9.1.1183~2.

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-16 20:59:28 +01:00
34954972c2 patch 9.1.1212: too many strlen() calls in edit.c
Problem:  too many strlen() calls in edit.c
Solution: refactor edit.c and remove strlen() calls
          (John Marriott)

This commit attempts to make edit.c more efficient by:

- in truncate_spaces() pass in the length of the string.
- return a string_T from get_last_insert(), so that the length of the
  string is available to the caller.
- refactor stuff_insert():

  - replace calls to stuffReadbuff() (which calls STRLEN() on it's
    string argument) with stuffReadbuffLen() (which gets the length of
    it's string argument passed in).
  - replace call to vim_strrchr() which searches from the start of the
    string with a loop which searches from end of the string to find the
    last ESC character.

- change get_last_insert_save() to call get_last_insert() to get the
  last_insert string (the logic is in one place).

closes: #16863

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-16 20:49:52 +01:00
20d23ce93b patch 9.1.1212: filetype: logrotate'd pacmanlogs are not recognized
Problem:  filetype: logrotate'd pacmanlogs are not recognized
Solution: also detect pacman.log* files as pacmanlog filetype,
          remove BufNewFile autocmd (Eisuke Kawashima)

closes: #16873

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-16 20:37:14 +01:00
3c7d9b11c8 runtime(prql): include prql syntax script
References:
https://prql-lang.org/
https://github.com/PRQL/prql

closes: #16885

Signed-off-by: Jonathan <vanillajonathan@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-16 20:32:13 +01:00
bcf66e0141 patch 9.1.1211: TabClosedPre is triggered just before the tab is being freed
Problem:  TabClosedPre is triggered just before the tab is being freed,
          which limited its functionality.
Solution: Trigger it a bit earlier and also on :tabclose and :tabonly
          (Jim Zhou)

closes: #16890

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-16 20:24:57 +01:00
21ac3a49b5 patch 9.1.1210: translation(ru): missing Russian translation for the new tutor
Problem:  translation(ru): missing Russian translation for the new tutor
Solution: include new Russian translation, update the Makefile for
          installing the new translations (RestorerZ)

closes: #16901

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-16 20:03:51 +01:00
2c9f49b200 patch 9.1.1209: colorcolumn not drawn after virtual text lines
Problem:  colorcolumn not drawn after virtual text lines
Solution: show colorcolumn on correct line with virtual text by adding
          the size of p_extra to virtual column offset (Matthias)

When a line has two or more lines of virtual text above it, the color
column used to appear on the line of the second virtual text line, while
the first virtual text line and the "real" text line did not have a
color column.

The color column for "above" virtual text is positioned by taking the
offset of the size of the virtual text lines and subtracting it from the
"virtual column" that we are in. If the result equals the color column,
this column is colored.

The "virtual column" is calculated from the beginning of the first
virtual text line and continues over the newlines up to the end of the
"real" text. However, the offset from the virtual text was reset at
every line.

Adding all those offsets together leads to the color column being placed
consistently at the line of the "real" text.

related: #12004
related: #16868
closes: #16904

Signed-off-by: Matthias <matthias.rader@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-16 19:27:51 +01:00
ab281f8b34 patch 9.1.1208: MS-Windows: not correctly restoring alternate screen on Win 10
Problem:  MS-Windows: not correctly restoring alternate screen on Win 10
          after ssh (Daniel Viberg)
Solution: return a bit later in RestoreConsoleBuffer()
          (Christopher Plewright)

fixes: #16418
closes: #16897

Signed-off-by: Christopher Plewright <chris@createng.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-16 19:14:31 +01:00
1064426d15 patch 9.1.1207: MS-Windows: build warning in filepath.c
Problem:  MS-Windows: build warning in filepath.c
          (after v9.1.1204)
Solution: add type cast (John Marriott)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-16 19:06:31 +01:00
8322923b40 translation(ru): include Russian translation for chapter two of the tutorial
closes: #16900

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-15 10:31:10 +01:00
13dcea2df1 runtime(matchparen): line continuation causes failure in CI
so let's remove the line continuation

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-15 10:24:11 +01:00
63a885b650 patch 9.1.1206: tests: test_filetype fails when a file is a directory
Problem:  tests: test_filetype fails when a file is a directory
          (Eisuke Kawashima)
Solution: When encountering a directory instead of a file, skip that
          particular filetype test

fixes: #16894

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-15 10:19:48 +01:00
5f2a959553 runtime(doc): symlinking netrw.txt causes problems during install on Windows
So let's remove the symlink and copy the netrw documentation back into
runtime/doc directory. While at it, add a Makefile target to do this
whenever runtime/pack/dist/opt/netrw/doc/netrw.txt is updated.

fixes: #16878
fixes: #16872

Co-authored-by: Brandon Maier <brandon.maier@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-15 10:04:39 +01:00
84a7503e29 patch 9.1.1205: completion: preinserted text not removed when closing pum
Problem:  completion: preinserted text not removed when closing pum
Solution: delete preinsert text inside in ins_compl_stop() (glepnir).

closes: #16891

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-15 09:59:22 +01:00
8021830827 runtime(tutor): updated Russian translation for tutor chapter 1
closes: #16899

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-15 09:58:02 +01:00
00a749bd90 patch 9.1.1204: MS-Windows: crash when passing long string to expand()
Problem:  MS-Windows: crash when passing long string to expand() with
          'wildignorecase'.
Solution: Use the same buflen as unix_expandpath() in dos_expandpath().
          Remove an unnecessary STRLEN() while at it (zeertzjq).

closes: #16896

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-15 09:53:32 +01:00
96395e1512 runtime(cs): Update C# runtime files
closes: #16884

Signed-off-by: Nick Jensen <nickspoon@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-15 09:50:41 +01:00
47071c6076 patch 9.1.1203: matchparen keeps cursor on case label in sh filetype
Problem:  matchparen keeps cursor on case label in sh filetype
          (@categorical, after 9.1.1187).
Solution: Use :defer so that cursor is always restored, remove checks
          for older Vims, finish early if Vim does not support :defer

fixes: #16887
closes: #16888

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-15 09:43:07 +01:00
2329bd427a runtime(doc): fix a typo in gitrebase filetype
Introduced in 4d2c4b90f.

closes: #16892

Signed-off-by: skshetry <18718008+skshetry@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-15 09:34:39 +01:00
3ca914ec74 runtime(doc): Tweak documentation style a bit
closes: #16893

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-15 09:32:28 +01:00
b55f0221cc runtime(vim): Sync syntax generator base file with output file.
Synchronisation was lost in commit 0fab891 and the error propagated to
the output file in commit 5606ca5.

closes: #16889

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-15 09:30:00 +01:00
f22580e57c runtime(doc): update a few minor omissions from 5876016 and 4d2c4b9
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-14 12:05:52 +01:00
5606ca5349 patch 9.1.1202: Missing TabClosedPre autocommand
Problem:  Missing TabClosedPre autocommand
          (zoumi)
Solution: Add the TabClosedPre autcommand (Jim Zhou).

fixes: #16518
closes: #16855

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-13 21:58:25 +01:00
587601671c patch 9.1.1201: 'completefuzzycollect' does not handle dictionary correctly
Problem:  'completefuzzycollect' does not handle dictionary correctly
Solution: check for ctrl_x_mode_dictionary (glepnir)

closes: #16867

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-13 21:39:51 +01:00
1dc731a49f runtime(doc): make :h 'completefuzzycollect' a bit clearer
- Fix grammar
- Use "matches" instead of "items" ("completion candidates" is used in
  some other places, but it's a bit verbose)
- "When set" is a bit vague, instead use "For specified modes"

closes: #16871

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-13 21:30:43 +01:00
4d2c4b90fb runtime(doc): document gitrebase filetype
closes: #16883

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-13 21:20:20 +01:00
c1c1019fa3 translation(it): update menu_it
Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-13 20:38:44 +01:00
6b01f02712 translation(sr): Add chapter two of the new tutor
Add chapter two to the Serbian translation of the new tutor.
Update the Filelist with two new files.

closes: #16875

Signed-off-by: Ivan Pešić <27575106+eevan78@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-13 20:33:26 +01:00
1830e787f6 patch 9.1.1200: cmdline pum not cleared for input() completion
Problem:  Cmdline pum not cleared for input() completion.
Solution: Temporary reset RedrawingDisabled in cmdline_pum_cleanup(),
          like what is done in wildmenu_cleanup() (zeertzjq).

fixes: #16874
closes: #16876

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-13 20:29:13 +01:00
0adbe639a5 patch 9.1.1199: gvim uses hardcoded xpm icon file
Problem:  Many X11/Wayland desktops support icon themes, and many themes
          provide a gvim icon, but this icon is ignored for the window
          itself because it is hardcoded in the source code.
Solution: Read the icon from the theme instead (Aurelien Gateau).

closes: #16859

Signed-off-by: Aurelien Gateau <mail@agateau.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-12 23:16:42 +01:00
54c88d0cf8 runtime(indent-tests): GitHub Actions doesn't show why indent tests failed
Problem:  GitHub Actions doesn't show why indent tests failed
Solution: Send the .fail files to stdout

References:
https://github.com/vim/vim/pull/16852#issuecomment-2719041781

closes: #16870

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-12 22:43:08 +01:00
f209dcd3de patch 9.1.1198: [security]: potential data loss with zip.vim
Problem:  [security]: potential data loss with zip.vim and special
          crafted zip files (RyotaK)
Solution: use glob '[-]' to protect filenames starting with '-'

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-693p-m996-3rmf

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-12 22:04:01 +01:00
53b14578e0 patch 9.1.1197: process_next_cpt_value() uses wrong condition
Problem:  process_next_cpt_value() uses wrong condition
Solution: use cfc_has_mode() instead and remove redundant else if branch
          (glepnir)

closes: #16833

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-12 21:28:39 +01:00
7546afbf52 patch 9.1.1196: filetype: config files for container tools are not recognized
Problem:  filetype: config files for container tools are not recognized
Solution: detect the ones that aren't detected yet as toml filetype
          (David Mandelberg)

The .containerignore format doesn't look exactly the same as gitignore,
but very close. And .dockerignore is already using gitignore.

References:
https://github.com/containers/common/blob/main/docs/containerignore.5.md
https://github.com/containers/common/blob/main/docs/containers.conf.5.md
https://github.com/containers/storage/blob/main/docs/containers-storage.conf.5.md
https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md
https://github.com/containers/image/blob/main/docs/containers-registries.conf.d.5.md

I wasn't sure exactly how to interpret what containers.conf(5) was
saying about modules, so I looked at
https://github.com/containers/common/tree/main/pkg/config/testdata/modules
to get examples, and based the detection off those.

closes: #16852

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-12 21:23:39 +01:00
c1c3b5d6a0 runtime(doc): remove unnecessary "an"
"umask" is pronounce like "youmask", so having an "an" before it is a
bit strange.  In other places in the help, "umask" is not preceded by
either "a" or "an", and sometimes preceded by "the".

Also, "Note" is usually followed either by ":" or "that" in builtin.txt,
so add a ":" after "Note".

closes: 16860

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-12 21:16:13 +01:00
2d18789aa6 patch 9.1.1195: inside try-block: fn body executed with default arg undefined
Problem:  inside try-block: fn body executed when default arg is
          undefined
Solution: When inside a try-block do not execute function body after an
          error in evaluating a default argument expression
          (Shane Harper).

closes: #16865

Signed-off-by: Shane Harper <shane@shaneharper.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-12 21:12:12 +01:00
7db96134c2 runtime(doc): Update doc 52.6
Problem: the highlight-yank plugin exmaple provided in the doc behaves
	 incorrectly when selection is set to exclusive.

Solution: use a unified offset of 1 and pass 'exclusive: false' to
	  getregionpos(), while at it, also clarify when the
          TextYankPost autocommand triggers.

closes: #16866

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-12 20:57:24 +01:00
23473303b7 runtime(compiler): allow customizing exe and args for tsc
closes: #16853

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-11 21:40:04 +01:00
4fa2dd2405 runtime(compiler): add comment for Dispatch
closes: #16854

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-11 21:35:48 +01:00
a8aeeeb9aa runtime(tera): remove unwanted code and fix issues in syntax script
closes: #16857

Signed-off-by: MuntasirSZN <muntasir.joypurhat@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-11 21:17:45 +01:00
0a336ccb57 runtime(doc): clarify that a umask is applied to mkdir()
fixes: #16849

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-11 21:15:30 +01:00
6763b0ee95 patch 9.1.1194: filetype: false positive help filetype detection
Problem:  filetype: false positive help filetype detection
Solution: Only detect a file as help if modeline appears either at start
          of line or is preceded by whitespace (zeertzjq).

closes: #16845

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-10 21:30:29 +01:00
c2623824a7 runtime(man): improve :Man completion for man-db
On man-db systems, complete with actual man sections and pages, instead
of shell commands.

I tried to come up with a portable solution for multiple man
implementations in https://github.com/vim/vim/discussions/16794 but I
think the differences between implementations were too large to do that
without overly complicated code. So instead, I implemented it for man-db
(which I think is common on Linux) and hopefully left it easier for
other people to implement it on other systems in the future if they want
to.

closes: #16843

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-10 21:26:50 +01:00
969e11a18b patch 9.1.1193: Unnecessary use of STRCAT() in au_event_disable()
Problem:  Unnecessary use of STRCAT() in au_event_disable().  STRCAT()
          seeks to the end of new_ei, but here the end is already known.
Solution: Use STRCPY() and add p_ei_len to new_ei.  Also fix a typo in a
          comment.  Add a test that 'eventignore' works in :argdo
          (zeertzjq).

closes: #16844

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-10 21:15:19 +01:00
835bc014c0 translation(sr): Update Serbian messages translation
closes: #16846

Signed-off-by: Ivan Pešić <27575106+eevan78@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-10 21:13:08 +01:00
8d67cbfa1f runtime(doc): document vim syntax switches
related: #16727
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-10 21:10:22 +01:00
0fab89117f runtime(vim): Update base-syntax, improve :syntax highlighting
- Highlight missing :syntax subcommands.
- Don't highlight user specified syntax group names.

closes: #16847

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-10 21:04:53 +01:00
e671b1b6d1 patch 9.1.1192: Vim crashes with term response debug logging enabled
Problem:  Vim crashes with term response debug logging enabled and
          running in a non-writeable directory
Solution: use ch_log() instead of custom termresponse logging function
          (Hirohito Higashi)

closes: #16840

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-09 16:35:14 +01:00
3dca512939 runtime(vim): Update base-syntax and generator, only match valid predefined variables
- Only match valid predefined and option variables.
- Match scope dictionaries.
- Highlight scope prefixed variables as a scope dictionary accessor. The
  vimVarScope syntax group can be linked to vimVar to disable this.
- Include support for Neovim-only predefined and option variables.

Temporary collateral damage - scope dictionaries match instead of keys
in dictionary literals.

closes: #16727

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-09 16:30:28 +01:00
42e498d9c4 runtime(plsql): move fold option from syntax to filetype plugin
closes: #16838

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Lee Lindley <lee.lindley@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-09 16:25:17 +01:00
d6c7913e24 patch 9.1.1191: tests: test for patch 9.1.1186 doesn't fail without the patch
Problem:  Test for patch 9.1.1186 doesn't fail without the patch.
Solution: Set 'nomodeline' in the test (zeertzjq).

closes: #16835

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-09 16:14:45 +01:00
f4d87ff888 patch 9.1.1190: C indentation does not detect multibyte labels
Problem:  C indentation does not detect multibyte labels
Solution: Correctly skip over multibyte characters
          (Anttoni Erkkilä)

closes: #16770

Signed-off-by: Anttoni Erkkilä <anttoni.erkkila@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-09 16:07:15 +01:00
ccf2731fd1 CI: Update clang to version 20
closes: #16836

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-09 16:03:47 +01:00
d49ba7b92a runtime(sh): set b:match_skip to ignore matches for matchit
related: #16801
closes: chrisbra/matchit#50
closes: #16834

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-09 10:16:30 +01:00
0a825bdde8 patch 9.1.1189: if_python: build error due to incompatible pointer types
Problem:  if_python: build error due to incompatible pointer types
Solution: cast pointer to PyObject* (oreo639)

Avoid build failure due to -Wincompatible-pointer-types becoming an error in
gcc 14.
When Py_LIMITED_API is < 0x030b0000, then the for Py_XDECREF must be PyObject*.
Vim targets Py_LIMITED_API = 0x03080000 (python 3.8).

closes: #16824

Signed-off-by: oreo639 <oreo6391@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-09 08:54:21 +01:00
14da0fb2d8 patch 9.1.1188: runtime(tera): tera support can be improved
Problem:  runtime(tera): tera support can be improved
Solution: update tera filetype plugin, include a tera syntax script
          include tera syntax tests, update the filetype test,
          update makemenu and synmenu vim scripts
          (MuntasirSZN)

closes: #16830

Signed-off-by: MuntasirSZN <muntasir.joypurhat@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-09 08:52:05 +01:00
9102ac11ab patch 9.1.1187: matchparen plugin wrong highlights shell case statement
Problem:  matchparen plugin wrong highlights shell case statement
          (Swudu Susuwu)
Solution: return early, if we are in a shSnglCase syntax element

The shell syntax element "case $var in foobar)" uses closing parenthesis
but there is no corresponding opening parenthesis for that syntax
element. However matchparen is not aware of such things and will happily
try to match just the next opening parenthesis.

So let's just add a way to opt out for such cases. In this case, use the
syntax state to check if the closing parenthesis belongs to the syntax
item "shSnglCase" and if it is, do not try to find a corresponding
opening parenthesis.

Since inspecting the syntax state might be expensive, put the whole
check behind a filetype test, so that matchparen will only perform this
particular check, when it knows the current buffer is a "sh" filetype.

fixes: #16801
closes: #16831

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-09 08:40:33 +01:00
d89770eb98 runtime(doc): use GNOME instead of Gnome
It's called "GNOME Terminal" in
https://gitlab.gnome.org/GNOME/gnome-terminal It's also called GNOME
Terminal in English Wikipedia
https://en.wikipedia.org/wiki/GNOME_Terminal and the Wikipedia pages of
8 other languages.

Also, make line wrapping the same in insert.txt and cmdline.txt.

closes: #16832

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-09 08:38:35 +01:00
16d6fff98e patch 9.1.1186: filetype: help files in git repos are not detected
Problem:  filetype: help files in git repos are not detected
Solution: detect */doc/*.txt files as help if they end with a help
          modeline, even if 'modeline' is off

Here's how I checked that this would still detect vim's own help files
correctly:

$ find . -type f -path '*/doc/*.txt' \
> -exec awk '{ } ENDFILE { print FILENAME ":" $0; }' '{}' + |
> grep -v 'vim:.*\<\(ft\|filetype\)=help\>'
./src/libvterm/doc/seqs.txt: 23    DECSM 42         = DECNRCM, national/multinational character

closes: #16817

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-08 17:21:16 +01:00
ce4f9d2a10 runtime(nohlsearch): fix CursorHold loop
fix exception when entering the insert mode with paste

closes: #16818

Co-authored-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: qaqland <qaq@qaq.land>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-08 17:16:18 +01:00
3d1a437f1b runtime(doc): warn users about potentially risky hotkey
Also, mention that CTRL-SHIFT-V might be mapped to paste text, similar
to the note about CTRL-V.

References:
2d7e9d78c9/src/org.gnome.Terminal.gschema.xml (L395-398)
8942adde5b/src/org.gnome.Ptyxis.gschema.xml.in (L529-L533)

closes: #16816

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-08 17:06:50 +01:00
f63c3467b1 runtime(syntax-tests): Improve parts of "runtest.vim"
* Accommodate the calling of "EraseLineAndReturnCarriage()"
  to not interfere with the "skipped" and "failed" reports.

* Create the "failed" directory, if unavailable, without
  relying on "VerifyScreenDump()" to do it so that reporting
  with "Xtestscript#s:AssertCursorForwardProgress()" can be
  uniformly attempted.

* Make an only list copy of the "Xtestscript" contents and
  share it with every syntax test.

* Narrow the scope of the "filetype" and "failed_root" local
  variables.

closes: #16789

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-08 16:58:17 +01:00
dd42b05f8a patch 9.1.1185: endless loop with completefuzzycollect and no match found
Problem:  endless loop with completefuzzycollect and no match found
Solution: move pointer to line end and break loop

closes: #16820

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-08 16:52:55 +01:00
af05694900 runtime(doc): CmdUndefined and FuncUndefined can always be nested
closes: #16825

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-08 16:45:20 +01:00
b7dc5d3b61 patch 9.1.1184: Unnecessary use of vim_tolower() in vim_strnicmp_asc()
Problem:  Unnecessary use of vim_tolower() in vim_strnicmp_asc().
Solution: Use TOLOWER_ASC() instead (zeertzjq).

It was passing *s1 and *s2 to vim_tolower(). When char is signed, which
is the case on most platforms, c < 0x80 is always true, so it already
behaves the same as TOLOWER_ASC().

closes: #16826

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-08 16:42:48 +01:00
62f19541f4 patch 9.1.1083: "above" virtual text breaks cursorlineopt=number
Problem:  "above" virtual text breaks cursorlineopt=number.
Solution: Take "above" virtual text into account when applying
          CursorLineNr highlight.

fixes: #16828
closes: #16829

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-08 16:27:37 +01:00
62e822808e runtime(go): add 'keywordprg' and 'formatprg' to ftplugin
closes: #16804

Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-07 19:19:31 +01:00
6852e5c597 runtime(syntax-tests): Re-introduce support for "phoney" languages
As of patch v9.1.1176~1, there are no longer makeshift Make
targets to accommodate language names that can match phoney
targets.  For example, "clean_" was previously generated for
Clean because otherwise it clashed with the "clean" target.

Additionally, enable test filtering for makeshift targets.

Reference:
https://wiki.clean.cs.ru.nl/Clean

closes: #16810

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-07 19:12:45 +01:00
53d59ecc1d patch 9.1.1182: No cmdline completion for 'completefuzzycollect'
Problem:  No cmdline completion for the 'completefuzzycollect' option
          (after v9.1.1178)
Solution: Add cmdline completion for the 'completefuzzycollect' option,
          improve its description in optwin.vim (zeertzjq).

closes: #16813

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-07 19:09:09 +01:00
4422de6316 patch 9.1.1181: Unnecessary STRLEN() calls in insexpand.c
Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: #16814

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-07 19:06:02 +01:00
b3a9127494 patch 9.1.1180: short-description
Problem:  The meaning of <Tab> depends on unspecified behavior
          (after 9.1.1179).
Solution: Return TAB in case bsearch() finds K_TAB.  Rename alt_name to
          pref_name as that's closer to it meaning (zeertzjq).

The man page of bsearch() says:

    The bsearch() function returns a pointer to a matching member of the
    array, or NULL if no match is found.  If there are multiple elements
    that match the key, the element returned is unspecified.

So it's possible that bsearch() finds K_TAB instead of TAB when trying
to get the key code for <Tab>. Actually, it can happen when adding a
single key to end of the table:

closes: #16821

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

diff --git a/src/misc2.c b/src/misc2.c
index 151745ca2..90f108a24 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1141,7 +1141,8 @@ static struct key_name_entry
     {TRUE, K_XRIGHT, STRING_INIT("xRight"), NULL},
     {TRUE, K_XUP, STRING_INIT("xUp"), NULL},
     {TRUE, K_ZEND, STRING_INIT("zEnd"), NULL},
-    {TRUE, K_ZHOME, STRING_INIT("zHome"), NULL}
+    {TRUE, K_ZHOME, STRING_INIT("zHome"), NULL},
+    {TRUE, -1, STRING_INIT("zzDummyKey"), NULL}
     // NOTE: When adding a long name update MAX_KEY_NAME_LEN.
 };
 #undef STRING_INIT

Meanwhile IDX_KEYNAME_TAB doesn't do anything, as TAB and K_TAB have the
same name.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-07 18:51:40 +01:00
6bdfeb099a runtime(vim): Update base-syntax, bug fixes
- Allow trailing backslashes in option values.
- Match :map-special modifier.
- Match :map-arguments case-sensitively.
- Remove <*Leader> from map modifier list and allow in RHS of a mapping.

closes: #16822

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-07 18:49:11 +01:00
4a1e6dacbb patch 9.1.1179: too many strlen() calls in misc2.c
Problem:  too many strlen() calls in misc2.c
Solution: refactor misc2.c and use bsearch() instead of a linear search
          to find matches in the key_names_table array (John Marriott).

This commit changes misc2.c to use bsearch() to perform string searches of
the key_names_table array.

Implementation detail:
- Some entries in this array have alternate names. Add field alt_name to
  point to the alternate name.
- Some entries in this array are only available if a given feature is
  defined. Keep them in the array, but add a boolean field enabled to
  indicate if the record can be used or not. If the feature is not
  available, the corresponding enabled field is set to FALSE.

In my measurements running the test suite on a huge non-gui build on
linux, the number of string comparisons in get_special_key_code():
Before (linear search): 2,214,957
After (binary search): 297,770

A side effect of this is 1477 calls to STRLEN() in
get_special_key_name() for the same test run are no longer necessary.

While we are here, refactor call_shell() and the mshape_names array to
remove some STRLEN() calls.

closes: #16788

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-06 22:26:23 +01:00
f31cfa29bf patch 9.1.1178: not possible to generate completion candidates using fuzzy matching
Problem:  not possible to generate completion candidates using fuzzy
          matching
Solution: add the 'completefuzzycollect' option for (some) ins-completion
          modes (glepnir)

fixes #15296
fixes #15295
fixes #15294
closes: #16032

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-06 21:59:13 +01:00
25e833f4ec editorconfig: set editing style for comment and hlsearch package
closes: #16805

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-06 21:14:20 +01:00
5daaf23268 patch 9.1.1177: filetype: tera files not detected
Problem:  filetype: tera files not detected
Solution: detect '*.tera' files as tera filetype,
          include a simple filetype plugin
          (MuntasirSZN)

closes: #16806

Signed-off-by: MuntasirSZN <muntasir.joypurhat@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-06 21:06:38 +01:00
ec6e82af04 runtime(doc): revert modeline change in vim9.txt
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-06 21:01:26 +01:00
2323f225ca runtime(new-tutor): add chapter two to the interactive tutorial
closes: #16803

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-05 21:49:37 +01:00
34a7d82aae patch 9.1.1176: wrong indent when expanding multiple lines
Problem:  wrong indentation of lastline when expanding multiple lines
Solution: Check OPENLINE_FORCE_INDENT flag in open_line() (glepnir)

closes: #16786

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-05 21:18:20 +01:00
2e18facede test(runtime/syntax): improve syntax tests
When a syntax file is changed, timestamps of the corresponding files are
updated.

NOTE: At the moment this script does not strictly track dependency, like
cpp on c.

Also update ignore files

closes #16548

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-05 21:15:45 +01:00
273926e5c0 editorconfig: set indent config for *.vim files
I tried to figure out what was the most common using modelines. Note
that there are 2401 vim files, and the numbers in the other command
outputs below add up to significantly less than that, so it's possible
that my estimate of what's most common is way off.

```
$ find . -name \*.vim | wc -l
2401
```

It looks like 2 is the most common value by far for shiftwidth and
softtabstop, so I used that for indent_size.

```
$ git grep -hE '(^|\s)((vi|vim|ex):|(vi|[vV]im|ex):\s*set? .*:)' -- '*.vim' |
> grep -Eo '\<(sw|shiftwidth)=[0-9]+' | cut -d = -f 2 |
> sort | uniq -c | sort -n
      2 0
     14 3
     18 8
     75 4
    610 2

$ git grep -hE '(^|\s)((vi|vim|ex):|(vi|[vV]im|ex):\s*set? .*:)' -- '*.vim' |
> grep -Eo '\<(sts|softtabstop)=[^ :]+' | cut -d = -f 2 |
> sort | uniq -c | sort -n
      2 -1
      7 8
      9 0
      9 3
     43 4
    469 2
```

Similarly, 8 is by far the most common tabstop, so I didn't adjust that.

```
$ git grep -hE '(^|\s)((vi|vim|ex):|(vi|[vV]im|ex):\s*set? .*:)' -- '*.vim' |
> grep -Eo '\<(ts|tabstop)=[0-9]+' | cut -d = -f 2 |
> sort | uniq -c | sort -n
      1 20
      1 6
      1 9
      2 10
      2 16
      2 17
      3 15
      4 3
      5 18
      9 2
     40 4
    497 8
```

And expandtab is significantly more common than noexpandtab. Taking that
in combination with the common shiftwidth and softtabstop of 2 but
tabstop of 8, I set indent_style to space.

```
$ git grep -hE '(^|\s)((vi|vim|ex):|(vi|[vV]im|ex):\s*set? .*:)' -- '*.vim' |
> grep -Eo '\<(no)?(et|expandtab)\>' | sort | uniq -c | sort -n
     15 noexpandtab
     86 noet
    115 et
    309 expandtab
```

I did try to look at a few of the less common values for those options
to see if there was any obvious pattern, like all *.vim files in one
directory having a different setting. The only real pattern I noticed
was in runtime/pack/dist/opt/netrw, but that looks like it's imported
from a separate repository? So I think it might make more sense for them
to create their own .editorconfig file rather than putting settings for
that directory in this one.

closes: #16777

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-05 21:07:59 +01:00
de4b244bfc runtime(doc): mention alternative check for vim9script
Vim9 syntax changed before Vim 9 leading to errors thrown if checked for
availability of Vim9script in Vim Version 8.2 such as

This check seems to work as well and throws less errors on Vim 8.2 such
as on Ubuntu 22.04

closes: #16783

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-05 21:05:24 +01:00
c8cce711dd patch 9.1.1175: inconsistent behaviour with exclusive selection and motion commands
Problem:  inconsistent behaviour with exclusive selection and motion
          commands (aidancz)
Solution: adjust cursor position when selection is exclusive
          (Jim Zhou)

fixes: #16278
closes: #16784

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-05 20:47:29 +01:00
b34ce3e205 runtime(man): don't add jumps when loading a manpage
Without this change, pressing K while in one manpage to load another
one, then pressing CTRL-O to go back, results in going to the bottom of
the current (second) manpage. With this change, it goes back to the
previous manpage.

closes: #16791

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-05 20:38:20 +01:00
08a410f674 runtime(vim): recognize <...> strings (and keys) for 'keywordprg'
see :help E499 and :h key-notation

closes: #16795

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-05 20:33:00 +01:00
f7087cbec7 patch 9.1.1174: tests: Test_complete_cmdline() may fail
Problem:  tests: when the file 'TestCommand?Test' exists,
          'Test_complete_cmdline()' will fail when writing the file. And
          there's no related cleaning operation for this kind of file
          before the test run.
Solution: modify `write` to `write!` to override (Jim Zhou).

closes: #16799

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-05 20:25:11 +01:00
4783a2c073 runtime(doc): mention bzip3 in gzip plugin documentation
closes: #16800

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-05 20:22:24 +01:00
9f827ec587 patch 9.1.1173: filetype: ABNF files are not detected
Problem:  filetype: ABNF files are not detected
Solution: detect '.abnf' file as abnf filetype and
          include an abnf syntax plugin (A4-Tacks).

References:
- RFC5234
- RFC7405

closes: #16802

Signed-off-by: A4-Tacks <wdsjxhno1001@163.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-05 20:19:32 +01:00
3ed6659549 patch 9.1.1172: [security]: overflow with 'nostartofline' and Ex command in tag file
Problem:  heap-buffer-overflow with 'nostartofline' and Ex command in
          tag file.
Solution: Set cursor column when moving cursor to line 1 (zeertzjq).

closes: #16796

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-05 20:05:18 +01:00
a95085e0fc patch 9.1.1171: tests: wrong arguments passed to assert_equal()
Problem:  tests: wrong arguments passed to assert_equal()
          (after v9.1.1167).
Solution: Swap arguments in the assert_equal() call (zeertzjq).

closes: #16782

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-04 21:33:57 +01:00
4ec46f3210 patch 9.1.1170: wildmenu highlighting in popup can be improved
Problem:  wildmenu highlighting in popup can be improved
Solution: Check if the completion items contain submatches of the
          entered text (Girish Palya).

This update enables highlighting in the popup menu even when the matched
fragment or pattern appears within an item (string) rather than only at the
beginning. This is especially useful for custom completion, where menu items
may not always start with the typed pattern.

For specific use cases, refer to the two examples in
https://github.com/vim/vim/pull/16759

A sliding window approach is used with direct string comparison. Performance
is not a concern, as highlighting is applied only to displayed lines, even if
the menu list is arbitrarily long.

closes: #16785

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-04 20:56:30 +01:00
29d596c80a runtime(netrw): upstream snapshot of v179
closes: #16787

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-04 20:36:31 +01:00
659cb28c25 runtime(doc): fix typo "bet" in :h 'completeopt'
closes: #16773

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-03 20:18:04 +01:00
0b5fe42071 patch 9.1.1169: using global variable for get_insert()/get_lambda_name()
Problem:  using global variable for get_insert()/get_lambda_name()
          (after v9.1.1151)
Solution: let the functions return a string_T object instead
          (Yee Cheng Chin)

In #16720, `get_insert()` was modified to store a string length in a
global variable to be queried immediately by another `get_insert_len()`
function, which is somewhat fragile. Instead, just have the function
itself return a `string_T` object instead. Also do the same for
`get_lambda_name()` which has similar issues.

closes: #16775

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-03 20:12:05 +01:00
d2219d547d patch 9.1.1168: wrong flags passed down to nextwild()
Problem:  wrong flags passed down to nextwild()
          (zeertzjq, after v9.1.1166)
Solution: only pass options flags (Girish Palya)

`options` needs to be passed into nextwild() since it may contain
WILD_KEEP_SOLE_ITEM which prevents the menu items list from getting
freed if there is only 1 item left (if `noselect` is set).

closes: #16778

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-03 20:01:06 +01:00
360a39ae6c patch 9.1.1167: mark '] wrong after copying text object
Problem:  mark '] wrong after copying text object (ubaldot)
Solution: Adjust position of '] for non-linewise, exclusive motions
          (Jim Zhou)

related: #16679
closes: #16772

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-03 19:58:25 +01:00
fb792374cf runtime(doc): update how to get Vim
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-03 08:16:27 +01:00
2bacc3e5fb patch 9.1.1166: command-line auto-completion hard with wildmenu
Problem:  command-line auto-completion hard with wildmenu
Solution: implement "noselect" wildoption value (Girish Palya)

When `noselect` is present in `wildmode` and 'wildmenu' is enabled, the
completion menu appears without pre-selecting the first item.

This change makes it easier to implement command-line auto-completion,
where the menu dynamically appears as characters are typed, and `<Tab>`
can be used to manually select an item. This can be achieved by
leveraging the `CmdlineChanged` event to insert `wildchar(m)`,
triggering completion menu.

Without this change, auto-completion using the 'wildmenu' mechanism is
not feasible, as it automatically inserts the first match, preventing
dynamic selection.

The following Vimscript snippet demonstrates how to configure
auto-completion using `noselect`:

```vim
vim9script
set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu
autocmd CmdlineChanged : timer_start(0, function(CmdComplete, [getcmdline()]))

def CmdComplete(cur_cmdline: string, timer: number)
  var [cmdline, curpos] = [getcmdline(), getcmdpos()]
  if cur_cmdline ==# cmdline  # Avoid completing each character in keymaps and pasted text
    && !pumvisible() && curpos == cmdline->len() + 1

    if cmdline[curpos - 2] =~ '[\w*/:]'  # Reduce noise by completing only selected characters
      feedkeys("\<C-@>", "ti")
      set eventignore+=CmdlineChanged  # Suppress redundant completion attempts
      timer_start(0, (_) => {
        getcmdline()->substitute('\%x00$', '', '')->setcmdline()  # Remove <C-@> if no completion items exist
        set eventignore-=CmdlineChanged
      })
    endif
  endif
enddef
```

fixes: #16551
closes: #16759

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-02 23:02:42 +01:00
a250738303 runtime(tar): use readblob() instead of shelling out to file(1)
fixes: ##16761
closes: #16769

Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-02 22:24:28 +01:00
bc08ceb755 patch 9.1.1165: diff: regression with multi-file diff blocks
Problem:  Vim's diff block merging algorithm when doing a multi-file diff
          is buggy when two different diff hunks overlap a single
          existing diff block (after v9.1.0743)

Solution: fix a couple bugs in this logic:

1. Fix regression from v9.1.0743 where it's not correctly expanding the
   2nd overlap correctly, where it always expands without taking into
   account that this was always taken care of when the first overlap
   happened. Instead, we should only grow the 2nd overlap if it overhangs
   outside the existing diff block, and if we encounter a new overlapping
   diff block (due to overlap chaining).
2. When we expand a diff block to match the hunk size on the orig side
   (when handling the first overlap), we expand the same amount of lines
   in the new side. This is not sound if there exists a second overlap
   hunk that we haven't processed yet, and that hunk has different
   number of lines in orig/new. Fix this by doing the corresponding
   counter adjustment when handling 2nd/3rd/etc overlap by calculating
   the difference in lines between orig and new side.
   (Yee Cheng Chin)

closes: #16768

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-02 22:05:37 +01:00
334a13bff7 patch 9.1.1164: [security]: code execution with tar.vim and special crafted tar files
Problem:  editing a special crafted tar file allows code execution
          (RyotaK, after 129a8446d2)
Solution: escape the filename before feeding it to the `:read` command

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-wfmf-8626-q3r3

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-02 19:37:29 +01:00
8872012e5f translation(it): Update Italian translation
Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-01 17:27:37 +01:00
8ac975d97e runtime(tar): fix syntax error in tar.vim
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-01 17:13:40 +01:00
1a741d3cb8 patch 9.1.1163: $MYVIMDIR is set too late
Problem:  $MYVIMDIR is set too late and not available while sourcing
          runtime files (Maxim Kim, after v9.1.1159)
Solution: Also set it when $MYVIMRC file is found

fixes: #16764
closes: #16767

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-01 16:30:33 +01:00
7003a5d63f runtime(syntax-tests): Apply stronger synchronisation between buffers
The current lightweight synchronisation with ":redraw" needs further
reinforcement in the light of v9.1.1110.  And, with v9.1.0820, make
another synchronisation point _before_ the first (or only) screenful is
dumped.

Also add a script to regenerate all screendumps.

closes: #16632

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-01 16:28:20 +01:00
ff159253eb patch 9.1.1162: completion popup not cleared in cmdline
Problem:  When an info popup spans into the cmdline area and ESC is
          pressed, some content remains visible on screen (yu3s)
Solution: Add popup_overlays_cmdline() check in screen_fill() to prevent
          prematurely clearing the clear_cmdline flag (glepnir).

fixes: #15627
closes: #16765

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-01 16:19:44 +01:00
94a045ed56 patch 9.1.1161: preinsert requires bot "menu" and "menuone" to be set
Problem:  preinsert requires bot "menu" and "menuone" to be set,
          but "menu" is redundant (after v9.1.1160)
Solution: preinsert only requires menuone (glepnir)

closes: #16763

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-01 16:12:23 +01:00
56957ed410 runtime(misc): add support for bzip3 to tar, vimball and gzip plugins
fixes: #16751
closes: #16755

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-28 18:06:14 +01:00
a2c5559f29 patch 9.1.1160: Ctrl-Y does not work well with "preinsert" when completing items
Problem:  The 'preinsert' feature requires Ctrl-Y to confirm insertion,
          but Ctrl-Y only works when the popup menu (pum) is displayed.
          Without enforcing this dependency, it could lead to confusing
          behavior or non-functional features.

Solution: Modify ins_compl_has_preinsert() to check for both 'menu' and
          'menuone' flags when 'preinsert' is set. Update documentation
          to clarify this requirement. This avoids adding complex
          conditional behaviors. (glepnir)

fixes: #16728
closes: #16753

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-28 17:43:42 +01:00
3e2affc324 patch 9.1.1159: $MYVIMDIR may not always be set
Problem:  $MYVIMDIR may not always be set (after 9.1.0718)
          (sandwm)
Solution: always set $MYVIMDIR to first item in runtimepath
          (except when using --clean), update it when changing &rtp

fixes: #16609
closes: #16709

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-28 17:34:46 +01:00
5e8b2268e1 patch 9.1.1158: :verbose set has wrong file name with :compiler!
Problem:  :verbose set has wrong file name with :compiler!
Solution: Add -keepscript (zeertzjq)

closes: #16752

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-28 17:32:07 +01:00
da53af57a7 runtime(netrw): correctly handle shellslash variable
closes: #16758

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-28 17:30:25 +01:00
3255af850e patch 9.1.1157: command completion wrong for input()
Problem:  command completion wrong for input()
          (Cdrman Fu)
Solution: Set commandline completion context explicitly
          (Jim Zhou)

fixes #16723
closes: #16733

Signed-off-by: Jim Zhou <csd_189@163.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-27 19:29:50 +01:00
85a50fe825 runtime(doc): fix confusing docs for 'completeitemalign'
closes: #16743

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-27 19:24:32 +01:00
4be1ab80be patch 9.1.1156: tests: No test for what patch 9.1.1152 fixes
Problem:  No test for what patch 9.1.1152 fixes.
Solution: Add a test (zeertzjq).

closes: #16742

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-27 19:22:26 +01:00
fce1fa5b61 patch 9.1.1155: Mode message not cleared after :silent message
Problem:  Mode message not cleared after :silent message
          (after 9.0.1634).
Solution: Don't reset mode_displayed when the message is empty.
          (zeertzjq)

fixes: neovim/neovim#32641
closes: #16744

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-27 19:19:36 +01:00
0b8205484b runtime(lua): Improve 'include' and make '*expr' functions script-local
- Prevent 'include' from matching variable assignments as calls to
  require() and others.
- Use script-local functions for 'includeexpr' and 'foldexpr'.
- Formatting fixes.

closes: #16746

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-27 19:17:33 +01:00
60bd140256 runtime(vim): Update base-syntax, match Vim9 function calls after "|"
Match Vim9 function calls after ex-bar.  These are also currently
matched but invalid syntax for legacy script.

fixes: #16721
closes: #16747

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-27 19:15:20 +01:00
e9ae35f265 patch 9.1.1154: Vim9: not able to use autoload class accross scripts
Problem:  Vim9: not able to use autoload class accross scripts
Solution: make it work, re-enable the test (Yegappan Lakshmanan)

fixes: #15031
closes: #16748

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-27 19:12:00 +01:00
3d75ec7401 runtime(compiler): improve svelte-check
closes: #16749

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-27 19:09:52 +01:00
dbedc0924d patch 9.1.1153: build error on Haiku
Problem:  build error on Haiku
Solution: define XDG_RUNTIME_PATH variables
          (Begasus)

closes: #16737

Signed-off-by: Begasus <begasus@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-26 22:26:16 +01:00
18bacc811c patch 9.1.1152: Patch v9.1.1151 causes problems
Problem:  Patch v9.1.1151 causes problems
Solution: partially revert it (John Marriott)

closes: #16736

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-26 19:14:06 +01:00
397700e507 runtime(new-tutor): update examples from Neovim to Vim
closes: #16741

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-26 19:00:48 +01:00
b2bd8de154 nsis: add Portuguese Brazilian translation to nsis installer
closes: #16692

Co-authored-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-25 21:05:22 +01:00
d3c4b7e946 patch 9.1.1151: too many strlen() calls in getchar.c
Problem:  too many strlen() calls in getchar.c
Solution: store last inserted and recorded lengths,
          add functions to retrieve those and use those
          functions (John Marriott)

closes: #16720

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-25 20:56:38 +01:00
580e457a2a runtime(vim): make VimKeywordPrg even smarter for regexes
closes: #16729

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-25 20:53:55 +01:00
9b41e8f766 patch 9.1.1150: :hi completion may complete to wrong value
Problem:  :highlight auto-complettion has a minor bug where an existing
          highlight group with a cterm color being unset would result in
          it being auto-completed to -1 in cmdline which is invalid.

Solution: Correctly check for whether an int value is set to non-zero
          before retrieving the existing value for auto-complete. Also
          do this for attr/string values as they previously worked only
          by accident (Yee Cheng Chin).

closes: #16726

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-25 20:41:52 +01:00
2028 changed files with 122696 additions and 80291 deletions

View File

@ -5,9 +5,9 @@ env:
freebsd_task:
name: FreeBSD
matrix:
- name: FreeBSD 14.2
- name: FreeBSD 14.3
freebsd_instance:
image_family: freebsd-14-2
image_family: freebsd-14-3
timeout_in: 20m
install_script:
- pkg install -y gettext

View File

@ -20,6 +20,14 @@ indent_size = 2
# https://spec.commonmark.org/0.31.2/#hard-line-breaks
trim_trailing_whitespace = false
[*.vim]
indent_style = space
indent_size = 2
[runtime/pack/dist/opt/{comment,nohlsearch}/**.vim]
indent_style = space
indent_size = 4
[runtime/doc/**.txt]
# It can mess up some documentation by trying to strip trailing whitespaces
trim_trailing_whitespace = false

View File

@ -13,3 +13,15 @@
# change indentation style of netrw plugin
c363ca1ecd1f8db03663ef98dcf41eeacc3c22c7
c673b805ad80d0aef07e745d412a2bf298ba1c07
# fix indentation style in insexpand.c v9.1.1352
355db99d12a89f05765948b33eecd6d9733e16bb
# fix indentation styles in various files v9.1.1363
c2a9000bc1b4a2cbcfeef55450c184b16906d910
# indentation style in various files v9.1.1364
562610cfa327c8ebff12a1700525e17a070d5e2c
# Patch v9.1.1371
19e1dd6b6aeb96d64122332a8c3d17b9d5ca007b
# Patch v9.1.1372
a4a00a7ad0cfa26685c057c11a09bec2c962346a
# Patch v9.1.1390
e89aef3f65388a8b627c77f250525f2a264716c5

5
.gitattributes vendored
View File

@ -1 +1,6 @@
src/testdir/test42.in diff
# ignore vim.pot creation date when diffing
# set this up using:
# git config diff.ignore_pot_date.textconv 'grep -v "^.POT-Creation-Date:.*"'
src/po/vim.pot diff=ignore_pot_date

1337
.github/MAINTAINERS vendored

File diff suppressed because it is too large Load Diff

View File

@ -21,8 +21,8 @@ jobs:
env:
CC: ${{ matrix.compiler }}
GCC_VER: 13
CLANG_VER: 19
GCC_VER: 14
CLANG_VER: 20
TEST: test
SRCDIR: ./src
LEAK_CFLAGS: -DEXITFREE
@ -110,20 +110,53 @@ jobs:
run: |
sudo bash ci/remove_snap.sh
- name: Enable debug packages
run: |
# Some of the ASAN suppressions are in libraries linked with dlopen
# and symbolization of them requires these debug packages.
sudo apt install ubuntu-dbgsym-keyring
sudo cp ci/ddebs.list /etc/apt/sources.list.d/ddebs.list
sudo cp ci/pinned-pkgs /etc/apt/preferences.d/pinned-pkgs
- name: Install packages
run: |
# This is added by default, and it is often broken, but we don't need anything from it
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
PKGS=( \
gettext \
libgtk2.0-dev:${{ matrix.architecture }} \
x11-utils \
labwc \
wl-clipboard \
wayland-utils \
libgtk-3-dev:${{ matrix.architecture }} \
libgtk-3-bin:${{ matrix.architecture }} \
desktop-file-utils \
libc6-dbgsym:${{ matrix.architecture }} \
libtool-bin \
libncurses-dev:${{ matrix.architecture }} \
libxt-dev:${{ matrix.architecture }} \
libegl-mesa0:${{ matrix.architecture }} \
libegl1:${{ matrix.architecture }} \
libegl1-mesa-dev:${{ matrix.architecture }} \
libepoxy-dev:${{ matrix.architecture }} \
libwayland-egl1:${{ matrix.architecture }} \
libwayland-client0:${{ matrix.architecture }} \
libwayland-cursor0:${{ matrix.architecture }} \
locales-all \
software-properties-common \
)
if ${{ contains(matrix.extra, 'asan') }} && ${{ contains(matrix.architecture, 'native') }}; then
PKGS+=( \
libepoxy0-dbgsym:${{ matrix.architecture }} \
libxdamage1-dbgsym:${{ matrix.architecture }} \
libxcb1-dbgsym:${{ matrix.architecture }} \
libgtk-3-bin-dbgsym:${{ matrix.architecture }} \
libgtk-3-0t64-dbgsym:${{ matrix.architecture }} \
libglib2.0-0t64-dbgsym:${{ matrix.architecture }} \
libglib2.0-bin-dbgsym:${{ matrix.architecture }} \
libglib2.0-dev-bin-dbgsym:${{ matrix.architecture }} \
)
fi
if ${{ matrix.features == 'huge' }}; then
LUA_VER=${{ matrix.lua_ver || '5.4' }}
PKGS+=( \
@ -143,13 +176,14 @@ jobs:
libattr1-dev
)
fi
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y "${PKGS[@]}"
sudo apt-get update && sudo apt-get upgrade -y --allow-downgrades && sudo apt-get install -y --allow-downgrades "${PKGS[@]}"
- name: Install gcc-${{ env.GCC_VER }}
if: matrix.compiler == 'gcc'
run: |
# ubuntu-toolchain-r/test PPA for gcc-13 compiler
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
# disabled because the installation failed, causing test failures
# sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -y
sudo apt-get install -y gcc-${{ env.GCC_VER }}:${{ matrix.architecture }}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ env.GCC_VER }} 100
@ -158,9 +192,14 @@ jobs:
- name: Install clang-${{ env.CLANG_VER }}
if: matrix.compiler == 'clang'
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
. /etc/lsb-release
sudo add-apt-repository -y "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-${{ env.CLANG_VER }} main"
curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/llvm-archive-keyring.gpg > /dev/null
echo "Types: deb
URIs: https://apt.llvm.org/${DISTRIB_CODENAME}/
Suites: llvm-toolchain-${DISTRIB_CODENAME}-${{ env.CLANG_VER }}
Components: main
Signed-By: /usr/share/keyrings/llvm-archive-keyring.gpg" | sudo tee /etc/apt/sources.list.d/llvm-toolchain.sources > /dev/null
sudo apt-get update -y
sudo apt-get install -y clang-${{ env.CLANG_VER }} llvm-${{ env.CLANG_VER }}
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{ env.CLANG_VER }} 100
sudo update-alternatives --set clang /usr/bin/clang-${{ env.CLANG_VER }}
@ -220,6 +259,8 @@ jobs:
echo "TEST=-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim"
fi
echo "CFLAGS=${CFLAGS}"
# Disables GTK attempt to integrate with the accessibility service that does run in CI.
echo "NO_AT_BRIDGE=1"
) >> $GITHUB_ENV
- name: Set up system
@ -266,20 +307,24 @@ jobs:
"${SRCDIR}"/vim --version
"${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
"${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
if ${{ matrix.features == 'huge' }}; then
# Also check that optional and dynamic features are configured and working
"${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 \
-c "let g:required=['gettext', 'sodium', 'sound', 'perl', 'python3', 'lua', 'ruby', 'tcl']" \
-S ci/if_feat_check.vim -c quit
fi
- name: Test
if: matrix.architecture != 'arm64'
timeout-minutes: 25
run: |
make ${SHADOWOPT} ${TEST}
# `sg audio` does not work on arm64 runner due to permission ('Incorrect password' error).
- name: Test on arm64
if: matrix.architecture == 'arm64'
timeout-minutes: 25
run: |
make ${SHADOWOPT} ${TEST}
# Enable to debug failing tests live and ssh into the CI runners
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: true
- if: ${{ !cancelled() }}
uses: ./.github/actions/test_artifacts
@ -349,7 +394,7 @@ jobs:
if: matrix.runner == 'macos-15'
run: |
# Xcode 16 has compiler bugs which are fixed in 16.2+
sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
- name: Set up environment
run: |
@ -392,6 +437,12 @@ jobs:
"${SRCDIR}"/vim --version
"${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
"${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
if ${{ matrix.features == 'huge' }}; then
# Also check that optional and dynamic features are configured and working
"${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 \
-c "let g:required=['sound', 'perl', 'python3', 'lua', 'ruby', 'tcl']" \
-S ci/if_feat_check.vim -c quit
fi
- name: Install packages for testing
run: |
@ -608,11 +659,13 @@ jobs:
DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR% ^
DYNAMIC_PYTHON3_STABLE_ABI=%PYTHON3_STABLE% ^
DYNAMIC_SODIUM=yes SODIUM=%SODIUM_DIR%
DYNAMIC_SODIUM=yes SODIUM=%SODIUM_DIR% ^
CI_FLAGS=/we4267
) else (
nmake -nologo -f Make_mvc.mak ^
FEATURES=${{ matrix.features }} ^
GUI=%GUI% IME=yes ICONV=yes VIMDLL=${{ matrix.VIMDLL }}
GUI=%GUI% IME=yes ICONV=yes VIMDLL=${{ matrix.VIMDLL }} ^
CI_FLAGS=/we4267
)
- name: Build (MinGW)
@ -663,6 +716,11 @@ jobs:
src\vim --version || exit 1
src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
if "${{ matrix.features }}"=="HUGE" (
src\vim -u NONE -i NONE --not-a-term -esNX -V1 ^
-c "let g:required=['gettext', 'sodium', 'sound', 'python3', 'lua']" ^
-S ci/if_feat_check.vim -c quit
)
)
#- name: Prepare Artifact
@ -678,16 +736,17 @@ jobs:
# name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
# path: ./artifacts
- name: Install packages for testing
shell: bash
run: |
if ${{ matrix.features != 'TINY' }}; then
if ${{ matrix.arch == 'x64' }}; then
choco install netbeans --no-progress
else
exit 0
fi
fi
# disabled because of https://github.com/tunisiano187/Chocolatey-packages/issues/3916
#- name: Install packages for testing
# shell: bash
# run: |
# if ${{ matrix.features != 'TINY' }}; then
# if ${{ matrix.arch == 'x64' }}; then
# choco install netbeans --no-progress
# else
# exit 0
# fi
# fi
- name: Test and show the result of testing gVim
if: matrix.GUI == 'yes' || matrix.VIMDLL == 'yes'

View File

@ -9,7 +9,7 @@ permissions:
jobs:
scan:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
CC: gcc
@ -36,7 +36,6 @@ jobs:
gettext \
libcanberra-dev \
libperl-dev \
python2-dev \
python3-dev \
liblua5.4-dev \
lua5.4 \
@ -53,7 +52,7 @@ jobs:
echo "$(pwd)/cov-scan/bin" >> $GITHUB_PATH
(
echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
echo "CONFOPT=--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
) >> $GITHUB_ENV
- name: Configure

8
.gitignore vendored
View File

@ -22,6 +22,8 @@ src/auto/osdef.h
src/auto/link.log
src/auto/link.sed
src/auto/pathdef.c
src/auto/wayland/*.c
src/auto/wayland/*.h
# Windows
*.exe
@ -64,7 +66,6 @@ src/xxd/xxd.dSYM
*~
*.pyc
*.log
src/po/vim.pot
src/tags
/tags
/GPATH
@ -96,6 +97,11 @@ src/json_test
src/message_test
src/kword_test
runtime/syntax/testdir/done/
runtime/syntax/testdir/messages
runtime/syntax/testdir/testdeps.mk
runtime/syntax/testdir/vimcmd
# Generated by "make install"
runtime/doc/doctags
runtime/doc/tags-*

View File

@ -24,6 +24,8 @@ src/auto/osdef.h
src/auto/link.log
src/auto/link.sed
src/auto/pathdef.c
src/auto/wayland/*.c
src/auto/wayland/*.h
# Windows
*.exe
@ -66,7 +68,6 @@ src/xxd/xxd.dSYM
*~
*.pyc
*.log
src/po/vim.pot
src/tags
/tags
/GPATH
@ -98,21 +99,33 @@ src/json_test
src/message_test
src/kword_test
runtime/syntax/testdir/done/
runtime/syntax/testdir/messages
runtime/syntax/testdir/testdeps.mk
runtime/syntax/testdir/vimcmd
# Generated by "make install"
runtime/doc/doctags
runtime/doc/tags-*
# Temporarily generated by "runtime/syntax/generator/make"
runtime/syntax/generator/generator.err
runtime/syntax/generator/sanity_check.err
runtime/syntax/generator/vim.vim.rc
# Generated by "make shadow". The directory names could be anything but we
# restrict them to shadow (the default) or shadow-*
src/shadow
src/shadow-*
src/runtime
src/pixmaps
src/LICENSE
src/README.txt
# other files possibly created by tools
src/cscope.out
# Linter/language server files
/.cache/clangd/
/.ccls-cache/
/compile_commands.json
.cache/clangd/
.ccls-cache/
compile_commands.json

View File

@ -3,7 +3,7 @@
Patches are welcome in whatever form.
Discussions about patches happen on the [vim-dev][0] mailing list.
If you create a pull request on GitHub it will be
forwarded to the vim-dev mailing list. You can also send your patch there
forwarded to the vim-dev mailing list. You can also send your patch there
directly (but please note, the initial posting is subject to moderation).
In that case an attachment with a unified diff format is preferred.
Information about the mailing list can be found [on the Vim website][0]
@ -12,23 +12,48 @@ A pull request has the advantage that it will trigger the Continuous
Integration tests, you will be warned of problems (you can ignore the coverage
warning, it's noisy).
Please consider adding a test. All new functionality should be tested and bug
Please consider adding a test. All new functionality should be tested and bug
fixes should be tested for regressions: the test should fail before the fix and
pass after the fix. Look through recent patches for examples and find help
with ":help testing". The tests are located under "src/testdir".
pass after the fix. Look through recent patches for examples and find help
with ":help testing". The tests are located under "src/testdir".
Contributions will be distributed with Vim under the Vim license. Providing a
Contributions will be distributed with Vim under the Vim license. Providing a
change to be included implies that you agree with this and your contribution
does not cause us trouble with trademarks or patents. There is no CLA to sign.
does not cause us trouble with trademarks or patents. There is no CLA to sign.
## Signing-off commits
While not required, it's recommended to use **Signed-off commits** to ensure
transparency, accountability, and compliance with open-source best practices.
Signed-off commits follow the [Developer Certificate of Origin (DCO)][15],
which confirms that contributors have the right to submit their changes under
the project's license. This process adds a `Signed-off-by` line to commit
messages, verifying that the contributor agrees to the project's licensing
terms. To sign off a commit, simply use the -s flag when committing:
```sh
git commit -s
```
This ensures that every contribution is properly documented and traceable,
aligning with industry standards used in projects like the Linux Kernel or
the git project. By making Signed-off commits a standard practice, we help
maintain a legally compliant and well-governed codebase while fostering trust
within our contributor community.
When merging PRs into Vim, the current maintainer @chrisbra usually adds missing
`Signed-off-by` trailers for the author user name and email address as well for
anybody that explicitly *ACK*s a pull request as a statement that those
approvers are happy with that particular change.
# Reporting issues
We use GitHub issues, but that is not a requirement. Writing to the Vim
We use GitHub issues, but that is not a requirement. Writing to the Vim
mailing list is also fine.
Please use the GitHub issues only for actual issues. If you are not 100% sure
that your problem is a Vim issue, please first discuss this on the Vim user
mailing list. Try reproducing the problem without any of your plugins or settings:
mailing list. Try reproducing the problem without any of your plugins or settings:
vim --clean
@ -46,13 +71,13 @@ Or open [the todo file][todo list] on GitHub to see the latest version.
# Syntax, indent and other runtime files
The latest version of these files can be obtained from the repository.
They are usually not updated with numbered patches. However, they may
They are usually not updated with numbered patches. However, they may
or may not work with older Vim releases (since they may contain new features).
If you find a problem with one of these files or have a suggestion for
improvement, please first try to contact the maintainer directly.
Look in the header of the file for the name, email address, github handle and/or
upstream repository. You may also check the [MAINTAINERS][11] file.
upstream repository. You may also check the [MAINTAINERS][11] file.
The maintainer will take care of issues and send updates to the Vim project for
distribution with Vim.
@ -63,23 +88,25 @@ If the maintainer does not respond, contact the [vim-dev][0] mailing list.
If you want to contribute new runtime files for Vim or Neovim, please create a
PR with your changes against this repository here. For new filetypes, do not forget:
* to add a new [filetype test][12] (keep it similar to the other filetype tests).
* all configuration switches should be documented
- to add a new [filetype test][12] (keep it similar to the other filetype tests).
- all configuration switches should be documented
(check [filetype.txt][13] and/or [syntax.txt][14] for filetype and syntax plugins)
* add yourself as Maintainer to the top of file (again, keep the header similar to
- add yourself as Maintainer to the top of file (again, keep the header similar to
other runtime files)
* add yourself to the [MAINTAINERS][11] file.
- add yourself to the [MAINTAINERS][11] file.
# Translations
Translating messages and runtime files is very much appreciated! These things
Translating messages and runtime files is very much appreciated! These things
can be translated:
* Messages in Vim, see [src/po/README.txt][1]
Also used for the desktop icons.
* Menus, see [runtime/lang/README.txt][2]
* Vim tutor, see [runtime/tutor/README.txt][3]
* Manual pages, see [runtime/doc/\*.1][4] for examples
* Installer, see [nsis/lang/README.txt][5]
- Messages in Vim, see [src/po/README.txt][1]
Also used for the desktop icons.
- Menus, see [runtime/lang/README.txt][2]
- Vim tutor, see [runtime/tutor/README.txt][3]
- Manual pages, see [runtime/doc/\*.1][4] for examples
- Installer, see [nsis/lang/README.txt][5]
The help files can be translated and made available separately.
See https://www.vim.org/translations.php for examples.
@ -88,9 +115,11 @@ See https://www.vim.org/translations.php for examples.
Please have a look at the following [discussion][6], which should give you some
ideas. Please also check the [develop.txt][7] helpfile for the recommended
style. Often it's also beneficial to check the surrounding code for the style
coding style. Often it's also beneficial to check the surrounding code for the style
being used.
For the recommended documentation style, please check [helphelp.txt][16].
# I have a question
If you have some question on the style guide, please contact the [vim-dev][0]
@ -113,3 +142,5 @@ mailing list. For other questions please use the [Vi Stack Exchange][8] website,
[12]: https://github.com/vim/vim/blob/master/src/testdir/test_filetype.vim
[13]: https://github.com/vim/vim/blob/master/runtime/doc/filetype.txt
[14]: https://github.com/vim/vim/blob/master/runtime/doc/syntax.txt
[15]: https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin
[16]: https://github.com/vim/vim/blob/master/runtime/doc/helphelp.txt

146
Filelist
View File

@ -23,8 +23,12 @@ SRC_ALL = \
ci/appveyor.bat \
ci/config.mk*.sed \
ci/if_ver*.vim \
ci/if_feat_check.vim \
ci/setup-xvfb.sh \
ci/setup-sway.sh \
ci/remove_snap.sh \
ci/ddebs.list \
ci/pinned-pkgs \
src/Make_all.mak \
src/README.md \
src/alloc.c \
@ -147,6 +151,7 @@ SRC_ALL = \
src/strings.c \
src/structs.h \
src/syntax.c \
src/tabpanel.c \
src/tag.c \
src/term.c \
src/terminal.c \
@ -157,6 +162,7 @@ SRC_ALL = \
src/textobject.c \
src/textprop.c \
src/time.c \
src/tuple.c \
src/typval.c \
src/ui.c \
src/undo.c \
@ -178,62 +184,67 @@ SRC_ALL = \
src/winclip.c \
src/window.c \
src/xxd/xxd.c \
src/testdir/gen_opt_test.vim \
src/testdir/README.txt \
src/testdir/Make_all.mak \
src/testdir/*.in \
src/testdir/*.py \
src/testdir/keycode_check.vim \
src/testdir/keycode_check.json \
src/testdir/lsan-suppress.txt \
src/testdir/sautest/autoload/*.vim \
src/testdir/testluaplugin/lua/testluaplugin/*.lua \
src/testdir/check.vim \
src/testdir/Make_all.mak \
src/testdir/README.txt \
src/testdir/commondumps.vim \
src/testdir/gui_init.vim \
src/testdir/gui_preinit.vim \
src/testdir/mouse.vim \
src/testdir/runtest.vim \
src/testdir/screendump.vim \
src/testdir/setup.vim \
src/testdir/setup_gui.vim \
src/testdir/shared.vim \
src/testdir/vim9.vim \
src/testdir/script_util.vim \
src/testdir/summarize.vim \
src/testdir/term_util.vim \
src/testdir/view_util.vim \
src/testdir/viewdumps.vim \
src/testdir/test[0-9]*.ok \
src/testdir/test77a.ok \
src/testdir/test77a.com \
src/testdir/test_*.vim \
src/testdir/crash/* \
src/testdir/dumps/*.dump \
src/testdir/dumps/*.vim \
src/testdir/keycode_check.json \
src/testdir/keycode_check.vim \
src/testdir/lsan-suppress.txt \
src/testdir/python2/*.py \
src/testdir/python3/*.py \
src/testdir/python_after/*.py \
src/testdir/python_before/*.py \
src/testdir/pythonx/*.py \
src/testdir/pythonx/topmodule/__init__.py \
src/testdir/pythonx/topmodule/submodule/__init__.py \
src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py \
src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py \
src/testdir/python_after/*.py \
src/testdir/python_before/*.py \
src/testdir/pyxfile/*.py \
src/testdir/dumps/*.dump \
src/testdir/dumps/*.vim \
src/testdir/ru_RU/LC_MESSAGES/Makefile \
src/testdir/ru_RU/LC_MESSAGES/__PACKAGE__.mo \
src/testdir/ru_RU/LC_MESSAGES/__PACKAGE__.po \
src/testdir/runtest.vim \
src/testdir/samples/*.html \
src/testdir/samples/*.txt \
src/testdir/samples/*.vim \
src/testdir/samples/test000 \
src/testdir/samples/evil.zip \
src/testdir/samples/evil.tar \
src/testdir/samples/poc.zip \
src/testdir/samples/sample.tar \
src/testdir/samples/test.zip \
src/testdir/samples/test000 \
src/testdir/samples/test_undo.txt.undo \
src/testdir/samples/testa.zip \
src/testdir/color_ramp.vim \
src/testdir/sautest/autoload/*.vim \
src/testdir/silent.wav \
src/testdir/popupbounce.vim \
src/testdir/crash/* \
src/testdir/ru_RU/LC_MESSAGES/Makefile \
src/testdir/ru_RU/LC_MESSAGES/__PACKAGE__.po \
src/testdir/ru_RU/LC_MESSAGES/__PACKAGE__.mo \
src/testdir/test77a.com \
src/testdir/test77a.ok \
src/testdir/test[0-9]*.ok \
src/testdir/test_*.vim \
src/testdir/testluaplugin/lua/testluaplugin/*.lua \
src/testdir/util/check.vim \
src/testdir/util/color_ramp.vim \
src/testdir/util/gen_opt_test.vim \
src/testdir/util/gui_init.vim \
src/testdir/util/gui_preinit.vim \
src/testdir/util/mouse.vim \
src/testdir/util/popupbounce.vim \
src/testdir/util/screendump.vim \
src/testdir/util/script_util.vim \
src/testdir/util/setup.vim \
src/testdir/util/setup_gui.vim \
src/testdir/util/shared.vim \
src/testdir/util/summarize.vim \
src/testdir/util/term_util.vim \
src/testdir/util/view_util.vim \
src/testdir/util/vim9.vim \
src/testdir/util/window_manager.vim \
src/testdir/viewdumps.vim \
src/proto.h \
src/protodef.h \
src/proto/alloc.pro \
@ -329,6 +340,7 @@ SRC_ALL = \
src/proto/spellsuggest.pro \
src/proto/strings.pro \
src/proto/syntax.pro \
src/proto/tabpanel.pro \
src/proto/tag.pro \
src/proto/term.pro \
src/proto/terminal.pro \
@ -338,6 +350,7 @@ SRC_ALL = \
src/proto/textobject.pro \
src/proto/textprop.pro \
src/proto/time.pro \
src/proto/tuple.pro \
src/proto/typval.pro \
src/proto/ui.pro \
src/proto/undo.pro \
@ -481,6 +494,12 @@ SRC_UNIX = \
src/gui_xmebwp.h \
src/gui_x11.c \
src/gui_x11_pm.h \
src/auto/wayland/README.txt \
src/auto/wayland/Makefile \
src/auto/wayland/protocols/ext-data-control-v1.xml \
src/auto/wayland/protocols/wlr-data-control-unstable-v1.xml \
src/auto/wayland/protocols/xdg-shell.xml \
src/auto/wayland/protocols/primary-selection-unstable-v1.xml \
src/if_xcmdsrv.c \
src/link.sh \
src/installman.sh \
@ -499,18 +518,21 @@ SRC_UNIX = \
src/proto/gui_motif.pro \
src/proto/gui_xmdlg.pro \
src/proto/gui_x11.pro \
src/proto/wayland.pro \
src/proto/if_xcmdsrv.pro \
src/proto/os_unix.pro \
src/proto/pty.pro \
src/pty.c \
src/testdir/Makefile \
src/testdir/unix.vim \
src/testdir/util/unix.vim \
src/toolcheck \
src/vim_icon.xbm \
src/vim_mask.xbm \
src/vimtutor \
src/gvimtutor \
src/wayland.c \
src/which.sh \
src/gen-wayland-protocols.sh \
src/xxd/Makefile \
# Source files for both MS Windows and Unix-like.
@ -596,7 +618,7 @@ SRC_DOS = \
src/testdir/Make_dos.mak \
src/testdir/Make_mvc.mak \
src/testdir/Make_ming.mak \
src/testdir/dos.vim \
src/testdir/util/dos.vim \
src/uninstall.c \
src/vim.rc \
src/vim.manifest \
@ -649,7 +671,7 @@ SRC_AMI = \
src/os_amiga.h \
src/proto/os_amiga.pro \
src/testdir/Make_amiga.mak \
src/testdir/amiga.vim \
src/testdir/util/amiga.vim \
src/xxd/Make_amiga.mak \
# Source files for Haiku (also in the extra archive).
@ -680,7 +702,7 @@ SRC_VMS = \
src/os_vms_mms.c \
src/proto/os_vms.pro \
src/testdir/Make_vms.mms \
src/testdir/vms.vim \
src/testdir/util/vms.vim \
src/xxd/Make_vms.mms \
vimtutor.com \
@ -773,10 +795,8 @@ RT_ALL = \
runtime/tutor/tutor1 \
runtime/tutor/en/vim-01-beginner.tutor \
runtime/tutor/en/vim-01-beginner.tutor.json \
runtime/tutor/it/vim-01-beginner.tutor \
runtime/tutor/it/vim-01-beginner.tutor.json \
runtime/tutor/sr/vim-01-beginner.tutor \
runtime/tutor/sr/vim-01-beginner.tutor.json \
runtime/tutor/en/vim-02-beginner.tutor \
runtime/tutor/en/vim-02-beginner.tutor.json \
runtime/tutor/tutor.tutor \
runtime/tutor/tutor.tutor.json \
runtime/tutor/tutor.vim \
@ -803,7 +823,10 @@ RT_ALL = \
runtime/pack/dist/opt/editorconfig/ftdetect/editorconfig.vim \
runtime/pack/dist/opt/editorconfig/plugin/editorconfig.vim \
runtime/pack/dist/opt/helptoc/autoload/helptoc.vim \
runtime/pack/dist/opt/helptoc/doc/helptoc.txt \
runtime/pack/dist/opt/helptoc/doc/tags \
runtime/pack/dist/opt/helptoc/plugin/helptoc.vim \
runtime/pack/dist/opt/hlyank/plugin/hlyank.vim \
runtime/pack/dist/opt/justify/plugin/justify.vim \
runtime/pack/dist/opt/matchit/plugin/matchit.vim \
runtime/pack/dist/opt/matchit/doc/matchit.txt \
@ -819,7 +842,6 @@ RT_ALL = \
runtime/pack/dist/opt/netrw/autoload/netrw/fs.vim \
runtime/pack/dist/opt/netrw/autoload/netrw/os.vim \
runtime/pack/dist/opt/netrw/autoload/netrw/msg.vim \
runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim \
runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim \
runtime/pack/dist/opt/netrw/doc/netrw.txt \
runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim \
@ -858,6 +880,7 @@ RT_SCRIPTS = \
runtime/indent/testdir/*.vim \
runtime/indent/testdir/*.in \
runtime/indent/testdir/*.ok \
runtime/indent/testdir/tools/* \
runtime/ftplugin/*.vim \
runtime/ftplugin/logtalk.dict \
runtime/ftplugin/README.txt \
@ -878,6 +901,7 @@ RT_SCRIPTS = \
runtime/syntax/testdir/input/setup/*.* \
runtime/syntax/testdir/dumps/*.dump \
runtime/syntax/testdir/dumps/*.vim \
runtime/syntax/testdir/tools/* \
runtime/syntax/generator/Makefile \
runtime/syntax/generator/README.md \
runtime/syntax/generator/gen_syntax_vim.vim \
@ -920,7 +944,6 @@ RT_DOS = \
README_dos.txt \
runtime/doc/Make_mvc.mak \
runtime/indent/Make_mvc.mak \
runtime/tutor/Make_mvc.mak \
runtime/lang/Make_mvc.mak \
vimtutor.bat \
@ -1074,24 +1097,20 @@ LANG_GEN = \
runtime/keymap/README.txt \
runtime/keymap/*.vim \
runtime/tutor/README.*.txt \
runtime/tutor/Makefile \
runtime/tutor/Make_all.mak \
runtime/tutor/tutor1.utf-8 \
runtime/tutor/it/vim-01-beginner.tutor \
runtime/tutor/it/vim-01-beginner.tutor.json \
runtime/tutor/ru/vim-01-beginner.tutor \
runtime/tutor/ru/vim-01-beginner.tutor.json \
runtime/tutor/ru/vim-02-beginner.tutor \
runtime/tutor/ru/vim-02-beginner.tutor.json \
runtime/tutor/sr/vim-01-beginner.tutor \
runtime/tutor/sr/vim-01-beginner.tutor.json \
runtime/tutor/sr/vim-02-beginner.tutor \
runtime/tutor/sr/vim-02-beginner.tutor.json \
runtime/tutor/tutor1.?? \
runtime/tutor/tutor1.??.utf-8 \
runtime/tutor/tutor1.??.euc \
runtime/tutor/tutor1.??.sjis \
runtime/tutor/tutor1.??.iso9 \
runtime/tutor/tutor1.??.big5 \
runtime/tutor/tutor1.??.cp1250 \
runtime/tutor/tutor1.??.cp1251 \
runtime/tutor/tutor1.??.cp737 \
runtime/tutor/tutor1.??_??.utf-8 \
runtime/tutor/tutor1.??_?? \
runtime/tutor/tutor1.bar \
runtime/tutor/tutor1.bar.utf-8 \
runtime/tutor/tutor2.utf-8 \
runtime/tutor/tutor2.?? \
runtime/tutor/tutor2.??.utf-8 \
runtime/spell/README.txt \
runtime/spell/??/*.diff \
runtime/spell/??/main.aap \
@ -1135,6 +1154,7 @@ LANG_SRC = \
src/po/sjiscorr.c \
src/po/big5corr.c \
src/po/*.po \
src/po/vim.pot \
# The language files for the Win32 lang archive.
LANG_DOS = \

View File

@ -63,6 +63,7 @@ VIM_FOR_SYNTAXTEST = ../../src/vim
# (For local testing only with GNU Make.)
VIM_SYNTAX_TEST_FILTER =
VIM_SYNTAX_TEST_WAIT_TIME =
syntaxtest:
cd runtime/syntax && \
@ -114,6 +115,7 @@ MINOR = 1
# - With these features: "make depend" (works best with gcc).
# - If you have a lint program: "make lint" and check the output (ignore GTK
# warnings).
# - compile release versions using -DNDEBUG to disable assert()s
# - If you have valgrind, enable it in src/testdir/Makefile and run "make
# test". Enable EXITFREE, disable GUI, scheme and tcl to avoid false alarms.
# Check the valgrind output.

View File

@ -32,6 +32,10 @@ All commands are given with normal keyboard characters, so those who can type
with ten fingers can work very fast. Additionally, function keys can be
mapped to commands by the user, and the mouse can be used.
Vim also aims to provide a (mostly) POSIX-compatible vi implementation, when
compiled with a minimal feature set (typically called vim.tiny), which is used
by many Linux distributions as the default vi editor.
Vim runs under MS-Windows (7, 8, 10, 11), macOS, Haiku, VMS and almost all
flavours of UNIX. Porting to other systems should not be very difficult.
Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me/NT/2000/XP/Vista,

View File

@ -15,6 +15,10 @@ All commands are given with normal keyboard characters, so those who can type
with ten fingers can work very fast. Additionally, function keys can be
mapped to commands by the user, and the mouse can be used.
Vim also aims to provide a (mostly) POSIX-compatible vi implementation, when
compiled with a minimal feature set (typically called vim.tiny), which is used
by many Linux distributions as the default vi editor.
Vim runs under MS-Windows (7, 8, 10, 11), macOS, Haiku, VMS and almost all
flavours of UNIX. Porting to other systems should not be very difficult.
Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me/NT/2000/XP/Vista,

View File

@ -71,7 +71,7 @@ cd src
echo "Building MSVC 64bit console Version"
nmake -f Make_mvc.mak CPU=AMD64 ^
OLE=no GUI=no IME=yes ICONV=yes DEBUG=no ^
FEATURES=%FEATURE%
FEATURES=%FEATURE% CI_CFLAGS=/we4267
if not exist vim.exe (
echo Build failure.
exit 1
@ -85,11 +85,11 @@ if "%FEATURE%" == "HUGE" (
OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no POSTSCRIPT=yes ^
PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 ^
PYTHON3_VER=%PYTHON3_VER% DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR% ^
FEATURES=%FEATURE%
FEATURES=%FEATURE% CI_CFLAGS=/we4267
) ELSE (
nmake -f Make_mvc.mak CPU=AMD64 ^
OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no ^
FEATURES=%FEATURE%
FEATURES=%FEATURE% CI_CFLAGS=/we4267
)
if not exist gvim.exe (
echo Build failure.

3
ci/ddebs.list Normal file
View File

@ -0,0 +1,3 @@
deb http://ddebs.ubuntu.com noble main restricted universe multiverse
deb http://ddebs.ubuntu.com noble-updates main restricted universe multiverse
deb http://ddebs.ubuntu.com noble-proposed main restricted universe multiverse

15
ci/if_feat_check.vim Normal file
View File

@ -0,0 +1,15 @@
if 1 " This prevents it from being run in tiny versions
" Check for required features
if exists("g:required")
for feature in g:required
if !has(feature)
echo "Error: Feature '" .. feature .. "' not found"
echo ''
cquit
endif
endfor
echo "\nChecked features: " .. string(g:required)
echo ''
endif
endif
" vim: sts=2 sw=2 et

View File

@ -1,6 +1,6 @@
" Print all interface versions for Ubuntu. Part 1.
" Print all interface versions. Part 1.
if 1
if 1 " This prevents it from being run in tiny versions
execute 'source' expand('<sfile>:h') .. '/if_ver-cmd.vim'
echo "*** Interface versions ***\n"

View File

@ -1,6 +1,8 @@
" Print py3 interface versions for Ubuntu. Part 2.
" Print py3 interface versions. Part 2.
" This is done separately from part 1 because Vim cannot concurrently load
" Python 2 and 3 together.
if 1
if 1 " This prevents it from being run in tiny versions
execute 'source' expand('<sfile>:h') .. '/if_ver-cmd.vim'
echo 'Python 3:'

69
ci/pinned-pkgs Normal file
View File

@ -0,0 +1,69 @@
# Unfortunately ubtunu does not keep the debug packages strictly up-to-date
# with the main packages. So this file needs to pin the main packages back to
# the version for which debug packages are available.
Package: libwayland-client0
Pin: version 1.20.0-1
Pin-Priority: 1000
Package: libwayland-client0
Pin: version 1.20.0-1ubuntu0.1
Pin-Priority: 100
Package: libwayland-cursor0
Pin: version 1.20.0-1
Pin-Priority: 1000
Package: libwayland-cursor0
Pin: version 1.20.0-1ubuntu0.1
Pin-Priority: 100
Package: libwayland-egl1
Pin: version 1.20.0-1
Pin-Priority: 1000
Package: libwayland-egl1
Pin: version 1.20.0-1ubuntu0.1
Pin-Priority: 100
Package: libwayland-dev
Pin: version 1.20.0-1
Pin-Priority: 1000
Package: libwayland-dev
Pin: version 1.20.0-1ubuntu0.1
Pin-Priority: 100
Package: libwayland-server0
Pin: version 1.20.0-1
Pin-Priority: 1000
Package: libwayland-server0
Pin: version 1.20.0-1ubuntu0.1
Pin-Priority: 100
Package: libwayland-bin
Pin: version 1.20.0-1
Pin-Priority: 1000
Package: libwayland-bin
Pin: version 1.20.0-1ubuntu0.1
Pin-Priority: 100
# As of 2025-04-27 the base library package libgtk-3-0t64 is still at 3.24.41-4ubuntu1.2
Package: libgtk-3-0t64-dbgsym
Pin: version 3.24.41-4ubuntu1.2
Pin-Priority: 1000
Package: libgtk-3-0t64-dbgsym
Pin: version 3.24.41-4ubuntu1.3
Pin-Priority: 100
# As of 2025-04-27 the base binary package libgtk-3-bin is still at 3.24.41-4ubuntu1.2
Package: libgtk-3-bin-dbgsym
Pin: version 3.24.41-4ubuntu1.2
Pin-Priority: 1000
Package: libgtk-3-bin-dbgsym
Pin: version 3.24.41-4ubuntu1.3
Pin-Priority: 100

81
lang/LICENSE.pt_br.txt Normal file
View File

@ -0,0 +1,81 @@
LICENÇA DO VIM
I) Não há restrições para distribuir cópias não modificadas do Vim, exceto
que elas devem incluir este texto de licença. Você também pode distribuir
partes não modificadas do Vim, igualmente irrestritas, exceto que elas
devem incluir este texto de licença. Você também tem permissão para incluir
executáveis que você fez a partir das fontes não modificadas do Vim, além
de seus próprios exemplos de uso e scripts do Vim.
II) É permitido distribuir uma versão modificada (ou estendida) do Vim,
incluindo executáveis e/ou código-fonte, quando as quatro
condições a seguir forem atendidas:
1) Este texto de licença deve ser incluído sem modificações.
2) O Vim modificado deve ser distribuído de uma das cinco formas a seguir:
a) Se você fizer alterações no Vim, deverá descrever claramente na
distribuição como entrar em contato com você. Quando o mantenedor
solicitar a você (de qualquer forma) uma cópia do Vim modificado que
você distribuiu, você deverá disponibilizar suas alterações,
incluindo o código-fonte, ao mantenedor sem taxa. O mantenedor
reserva o direito de incluir suas alterações na versão oficial
do Vim. O que o mantenedor fará com suas alterações e sob qual
licença elas serão distribuídas é negociável. Se não houve negociação
então esta licença, ou uma versão posterior, também se aplica às suas
alterações. Os mantenedores atuais estão listados aqui:
https://github.com/orgs/vim/people. Se isso mudar, será anunciado em
lugares apropriados (provavelmente vim.sf.net, www.vim.org e/ou
comp.editors). Quando for completamente impossível contatar o
mantenedor, a obrigação de enviar a ele suas alterações cessa.
Uma vez que o mantenedor tenha confirmado que ele recebeu suas
alterações, elas não precisarão ser enviadas novamente.
b) Se você recebeu um Vim modificado que foi distribuído como
mencionado em a), você tem permissão para distribuí-lo sem
modificações, como mencionado em I). Se você fizer alterações
adicionais, o texto em a) se aplica a essas alterações.
c) Forneça todas as alterações, incluindo o código-fonte, com cada cópia
do Vim modificado que você distribuir. Isso pode ser feito na forma
de um diff de contexto. Você pode escolher qual licença usar para o
novo código que você adicionar. As alterações e sua licença não devem
restringir outros de fazer suas próprias alterações na versão oficial
do Vim.
d) Quando você tem um Vim modificado que inclui alterações conforme
mencionado em c), você pode distribuí-lo sem o código-fonte para as
alterações se as três condições a seguir forem atendidas:
- A licença que se aplica às alterações permite que você distribua
as alterações para o mantenedor do Vim sem taxa ou restrição, e
permite que o mantenedor do Vim inclua as alterações na
versão oficial do Vim sem taxa ou restrição.
- Você mantém as alterações por pelo menos três anos após a última
distribuição do Vim modificado correspondente. Quando o mantenedor
ou alguém para quem você distribuiu o Vim modificado solicitar a
você (de qualquer forma) as alterações dentro deste período, você
deve disponibilizá-las a ele.
- Você descreve claramente na distribuição como entrar em contato
com você. Estas informações de contato devem permanecer válidas por
pelo menos três anos após a última distribuição do Vim modificado
correspondente, ou pelo maior tempo possível.
e) Quando a Licença Pública Geral GNU (GPL) se aplica às alterações,
você pode distribuir o Vim modificado sob a GNU GPL versão 2 ou
qualquer versão posterior.
3) Uma mensagem deve ser adicionada, no mínimo na saída do comando
":version" e na tela de introdução, de modo que o usuário do Vim
modificado seja capaz de ver que ele foi modificado. Ao distribuir
conforme mencionado em 2)e), só é necessário adicionar a mensagem
na medida em que isso não entre em conflito com a licença usada para
as alterações.
4) As informações de contato conforme exigido em 2)a) e 2)d) não devem ser
removidas ou alteradas, exceto que a própria pessoa pode fazer
correções.
III) Se você distribuir uma versão modificada do Vim, encorajamos que use
a licença do Vim para suas alterações e disponibilizá-las ao
mantenedor, incluindo o código-fonte. A maneira preferida de fazer isso é
por e-mail ou enviando os arquivos para um servidor e enviando a URL por
e-mail. Se o número de alterações for pequeno (por exemplo, um Makefile
modificado), enviar um diff de contexto por e-mail será suficiente.
O endereço de e-mail a ser usado é <maintainer@vim.org>
IV) Não é permitido remover esta licença da distribuição das fontes do Vim,
partes dela ou de uma versão modificada. Você pode usar esta licença
para versões anteriores do Vim em vez da licença com a qual elas vieram,
a seu critério.

131
lang/README.pt_br.txt Normal file
View File

@ -0,0 +1,131 @@
README.txt para a versão 9.1 do Vim: Vi IMproved.
O QUE É VIM?
Vim é uma versão muito melhorada do bom e velho editor UNIX Vi. Muitos novos
recursos foram adicionados: desfazer multinível, destaque de sintaxe, histórico
de linha de comando, ajuda on-line, verificação ortográfica, completar
nome de arquivo, operações de bloco, linguagem de script, etc. Há também uma
interface gráfica (GUI) disponível. Ainda assim, a compatibilidade com Vi é
mantida, aqueles que têm Vi "nos dedos" se sentirão em casa.
Veja "runtime/doc/vi_diff.txt" para diferenças com Vi.
Este editor é muito útil para editar programas e outros arquivos de texto
simples. Todos os comandos são fornecidos com caracteres normais do teclado,
então aqueles que podem digitar com dez dedos podem trabalhar muito rápido.
Além disso, as teclas de função podem ser mapeadas para comandos pelo usuário,
e o mouse pode ser usado.
O Vim funciona em MS-Windows (7, 8, 10, 11), macOS, Haiku, VMS e quase todos
os sabores do UNIX. A portabilidade para outros sistemas não deve ser difícil.
Versões mais antigas do Vim rodam em MS-DOS, MS-Windows 95/98/Me/NT/2000/XP/Vista,
Amiga DOS, Atari MiNT, BeOS, RISC OS e OS/2. Eles não são mais mantidos.
DISTRIBUIÇÃO
Você pode frequentemente usar seu gerenciador de pacotes favorito para
instalar o Vim. No Mac e Linux, uma pequena versão do Vim é pré-instalada,
você ainda precisa instalar o Vim se quiser mais recursos.
Existem distribuições separadas para Unix, PC, Amiga e alguns outros sistemas.
Este arquivo README.txt vem com o arquivo de tempo de execução. Ele inclui a
documentação, arquivos de sintaxe e outros arquivos que são usados em
tempo de execução. Para executar o Vim, você deve obter um dos arquivos
binários ou um arquivo fonte. Qual deles você precisa depende do sistema em
que deseja executá-lo e se você deseja ou deve compilá-lo você mesmo.
Verifique "https://www.vim.org/download.php" para uma visão geral das
distribuições disponíveis atualmente.
Alguns lugares populares para obter o Vim mais recente:
* Confira o repositório git do github: https://github.com/vim/vim.
* Obtenha o código-fonte como um arquivo: https://github.com/vim/vim/tags.
* Obtenha um executável do Windows do repositório vim-win32-installer:
https://github.com/vim/vim-win32-installer/releases.
COMPILAR
Se você obteve uma distribuição binária, não precisa compilar o Vim. Se você
obteve uma distribuição de origem, todo o material para compilar o Vim está no
diretório "src". Veja src/INSTALL para instruções.
INSTALAÇÃO
Veja um desses arquivos para instruções específicas do sistema. No diretório
READMEdir (no repositório) ou no diretório superior (se você descompactar um
arquivo):
README_ami.txt Amiga
README_unix.txt Unix
README_dos.txt MS-DOS e MS-Windows
README_mac.txt Macintosh
README_haiku.txt Haiku
README_vms.txt VMS
Existem outros arquivos README_*.txt, dependendo da distribuição que você usou.
DOCUMENTAÇÃO
O tutor do Vim é um curso de treinamento de uma hora para iniciantes.
Frequentemente, ele pode ser iniciado como "vimtutor". Veja ":help tutor"
para mais informações.
O melhor é usar ":help" no Vim. Se você ainda não tem um executável, leia
"runtime/doc/help.txt". Ele contém direcionamentos para os outros arquivos
de documentação. O Manual do Usuário é lido como um livro e é recomendado
para aprender a usar o Vim. Veja ":help user-manual".
CÓPIA
O Vim é um Charityware. Você pode usá-lo e copiá-lo o quanto quiser, mas
encorajamos que faça uma doação para ajudar órfãos em Uganda. Leia o arquivo
"runtime/doc/uganda.txt" para detalhes (execute ":help uganda" dentro do Vim).
Resumo da licença: Não há restrições quanto ao uso ou distribuição de uma
cópia não modificada do Vim. Partes do Vim também podem ser distribuídas, mas
o texto da licença deve sempre ser incluído. Para versões modificadas, algumas
restrições se aplicam. A licença é compatível com GPL, você pode compilar o Vim
com bibliotecas GPL e distribuí-lo.
PATROCÍNIO
Corrigir bugs e adicionar novos recursos exige muito tempo e esforço.
Para mostrar seu apreço pelo trabalho e motivar os desenvolvedores a continuar
trabalhando no Vim, envie uma doação.
O dinheiro que você doou será usado principalmente para ajudar crianças em
Uganda. Veja "runtime/doc/uganda.txt". Mas, ao mesmo tempo, as doações aumentam
a motivação da equipe de desenvolvimento para continuar trabalhando no Vim!
Para as informações mais recentes sobre patrocínio, consulte o site do Vim:
https://www.vim.org/sponsor/
CONTRIBUIÇÕES
Se você gostaria de ajudar a tornar o Vim melhor, veja o arquivo CONTRIBUTING.md.
INFORMAÇÕES
Se você estiver no macOS, pode usar o MacVim: https://macvim.org
As últimas notícias sobre o Vim podem ser encontradas na página inicial do Vim:
https://www.vim.org/
Se você tiver problemas, dê uma olhada na documentação ou dicas do Vim:
https://www.vim.org/docs.php
https://vim.fandom.com/wiki/Vim_Tips_Wiki
Se você ainda tiver problemas ou quaisquer outras perguntas, use uma das listas
de discussão para discuti-las com usuários e desenvolvedores do Vim:
https://www.vim.org/maillist.php
Se nada mais funcionar, relate os bugs diretamente para a lista de discussão
vim-dev:
<vim-dev@vim.org>
AUTOR PRINCIPAL
A maior parte do Vim foi criada por Bram Moolenaar <Bram@vim.org>,
":help Bram-Moolenaar"
Envie quaisquer outros comentários, patches, flores e sugestões para
a lista de discussão vim-dev: <vim-dev@vim.org>

View File

@ -20,6 +20,11 @@ README.ru.txt для версии 9.1 программы Vim — Vi IMproved.
функциональные клавиши клавиатуры необходимые команды, и использовать
манипулятор «мышь».
В редакторе Vim также обеспечивается (насколько это возможно) совместимость
с POSIX-реализацией редактора vi, если он скомпилирован с минимальным набором
функционала (обычно называемый vim.tiny). Данная сборка чаще всего используется
во многих дистрибутивах Linux в качестве предустановленного редактора vi.
Редактор Vim работает в ОС MS Windows (7, 8, 10, 11), macOS, Haiku, VMS и
практически во всех UNIX-подобных системах. А перенос на другие платформы не
должен представлять особой сложности.
@ -36,7 +41,7 @@ MS Windows 95/98/Me/NT/2000/XP/Vista, AmigaDOS, Atari MiNT, BeOS и RISC OS.
возможностей.
Существуют отдельные версии для Unix, PC, Amiga и некоторых других систем.
Данный файл README.rux.txt поставляется вместе с архивом рабочих файлов
Данный файл README.ru.txt поставляется вместе с архивом рабочих файлов
программы. Этот архив включает в себя документацию, файлы подсветки синтаксиса
и другие файлы, которые используются редактором во время работы. Чтобы
запустить программу Vim, вы должны получить либо архив с исполняемыми файлами,
@ -96,7 +101,7 @@ README_vms.txt VMS
Редактор Vim является благотворительным программным обеспечением.
Использование и копирование программы Vim не ограничено, однако рекомендуется
сделать добровольное пожертвование для нуждающихся детей в Уганде. Чтобы узнать
подробности, прочитайте, пожалуйста, файл "runtime/doc/uganda.rux" (введите
подробности, прочитайте, пожалуйста, файл "runtime/doc/uganda.txt" (введите
команду ":help uganda" в редакторе Vim).
Краткое описание лицензии.
@ -116,7 +121,7 @@ README_vms.txt VMS
над редактором Vim можно с помощью оказания финансовой поддержки.
Пожертвованные вами деньги будут в основном направлены на оказание помощи детям
Уганды, см. "runtime/doc/uganda.rux". Однако в любом случае финансирование
Уганды, см. "runtime/doc/uganda.txt". Однако в любом случае финансирование
будет способствовать повышению заинтересованности команды разработчиков
в продолжении работы над редактором Vim!

View File

@ -46,6 +46,10 @@ MKNSISFLAGS = $(MKNSISFLAGS) /DHAVE_MULTI_LANG=$(HAVE_MULTI_LANG)
MKNSISFLAGS = $(MKNSISFLAGS) /DWIN64=$(WIN64)
!ENDIF
!IFDEF ARM64
MKNSISFLAGS = $(MKNSISFLAGS) /DARM64=$(ARM64)
!ENDIF
!IFDEF INCLUDE_LIBGCC
MKNSISFLAGS = $(MKNSISFLAGS) /DINCLUDE_LIBGCC=$(INCLUDE_LIBGCC)
!ENDIF

View File

@ -39,6 +39,10 @@ ifdef WIN64
MKNSISFLAGS := $(MKNSISFLAGS) -DWIN64=$(WIN64)
endif
ifdef ARM64
MKNSISFLAGS := $(MKNSISFLAGS) -DARM64=$(ARM64)
endif
ifdef INCLUDE_LIBGCC
MKNSISFLAGS := $(MKNSISFLAGS) -DINCLUDE_LIBGCC=$(INCLUDE_LIBGCC)
endif

View File

@ -101,6 +101,8 @@ Variables and their values available for building the installer (not mandatory):
"HAVE_NLS=0" — do not add native language support.
"HAVE_MULTI_LANG=0" — to create an English-only the installer.
"WIN64=1" — to create a 64-bit the installer.
"ARM64=1" — to create the installer for ARM64. The WIN64 variable
must be set to 1.
"X=<scriptcmd>" — executes scriptcmd in script. If multiple scriptcmd
are specified, they are separated by a semicolon.
Example "X=OutFile MyVim.exe;XPMode on"

View File

@ -53,6 +53,18 @@ Unicode true
!define WIN64 0
!endif
# if you want to create the installer for ARM64, use the /DARM64=1 on
# the command line makensis.exe. This property will be set to 1.
!ifndef ARM64
!define ARM64 0
!else
!if ${ARM64} > 0
!if ${WIN64} < 1
!define /redef WIN64 1
!endif
!endif
!endif
# if you don't want to include libgcc_s_sjlj-1.dll in the package, use the
# switch /DINCLUDE_LIBGCC=0 on the command line makensis.exe.
!ifndef INCLUDE_LIBGCC
@ -113,9 +125,13 @@ ${StrRep}
!define UNINST_REG_KEY_VIM "${UNINST_REG_KEY}\${PRODUCT}"
!if ${WIN64}
Name "${PRODUCT} (x64)"
!if ${ARM64}
Name "${PRODUCT} (ARM64)"
!else
Name "${PRODUCT} (x64)"
!endif
!else
Name "${PRODUCT}"
Name "${PRODUCT}"
!endif
OutFile gvim${VER_MAJOR}${VER_MINOR}.exe
CRCCheck force
@ -216,6 +232,7 @@ Page custom SetCustom ValidateCustom
# Include support for other languages:
!if ${HAVE_MULTI_LANG}
!include "lang\portuguesebr.nsi"
!include "lang\danish.nsi"
!include "lang\dutch.nsi"
!include "lang\german.nsi"
@ -497,7 +514,7 @@ Section "$(str_section_exe)" id_section_exe
File ${VIMRT}\tools\*.*
SetOutPath $0\tutor
File /x Makefile /x *.info ${VIMRT}\tutor\*.*
File /r /x *.info ${VIMRT}\tutor\*.*
SectionEnd
##########################################################

291
nsis/lang/portuguesebr.nsi Normal file
View File

@ -0,0 +1,291 @@
# vi:set ts=8 sts=4 sw=4 et fdm=marker:
#
# portuguesebr.nsi: Brazilian Portuguese strings for gvim NSIS installer.
#
# Locale ID : 1046
# Locale Name : pt-BR
# fileencoding : UTF-8
# Author : Rafael Fontenelle
!insertmacro MUI_LANGUAGE "PortugueseBR"
# Overwrite the default translation.
# These strings should be always English. Otherwise dosinst.c fails.
LangString ^SetupCaption ${LANG_PORTUGUESEBR} \
"Configuração do $(^Name)"
LangString ^UninstallCaption ${LANG_PORTUGUESEBR} \
"Desinstalação do $(^Name)"
##############################################################################
# License file for the license page {{{1
##############################################################################
LicenseLangString page_lic_file ${LANG_PORTUGUESEBR} "..\lang\LICENSE.pt_br.nsis.txt"
##############################################################################
# README.txt file, which is opened after installation {{{1
##############################################################################
LangString vim_readme_file ${LANG_PORTUGUESEBR} "README.pt_br.txt"
##############################################################################
# MUI Configuration Strings {{{1
##############################################################################
#LangString str_dest_folder ${LANG_PORTUGUESEBR} \
# "Pasta de destino (Deve terminar com $\"vim$\")"
LangString str_show_readme ${LANG_PORTUGUESEBR} \
"Mostrar o README ao concluir a instalação"
# Install types:
LangString str_type_typical ${LANG_PORTUGUESEBR} \
"Típica"
LangString str_type_minimal ${LANG_PORTUGUESEBR} \
"Mínima"
LangString str_type_full ${LANG_PORTUGUESEBR} \
"Completa"
##############################################################################
# Section Titles & Description {{{1
##############################################################################
LangString str_section_old_ver ${LANG_PORTUGUESEBR} \
"Desinstalar versões existentes"
LangString str_desc_old_ver ${LANG_PORTUGUESEBR} \
"Desinstala versões do Vim existentes no seu sistema."
LangString str_section_exe ${LANG_PORTUGUESEBR} \
"Vim GUI e arquivos de runtime"
LangString str_desc_exe ${LANG_PORTUGUESEBR} \
"Executáveis e arquivos de runtime do Vim GUI. Este componente \
é obrigatório."
LangString str_section_console ${LANG_PORTUGUESEBR} \
"Programa de console do Vim"
LangString str_desc_console ${LANG_PORTUGUESEBR} \
"Versão de console do Vim (vim.exe)."
LangString str_section_batch ${LANG_PORTUGUESEBR} \
"Criar arquivos .bat"
LangString str_desc_batch ${LANG_PORTUGUESEBR} \
"Cria arquivos .bat para variantes do Vim no diretório Windows para \
usar na linha de comando."
LangString str_group_icons ${LANG_PORTUGUESEBR} \
"Criar ícones para o Vim"
LangString str_desc_icons ${LANG_PORTUGUESEBR} \
"Cria ícones para Vim em vários locais para facilitar o acesso rápido."
LangString str_section_desktop ${LANG_PORTUGUESEBR} \
"Na área de trabalho"
LangString str_desc_desktop ${LANG_PORTUGUESEBR} \
"Cria ícones para executáveis do gVim na área de trabalho."
LangString str_section_start_menu ${LANG_PORTUGUESEBR} \
"Na pasta Programas do Menu Iniciar"
LangString str_desc_start_menu ${LANG_PORTUGUESEBR} \
"Adiciona Vim na pasta de programas do menu iniciar."
#LangString str_section_quick_launch ${LANG_PORTUGUESEBR} \
# "Na barra de Inicialização Rápida"
#LangString str_desc_quick_launch ${LANG_PORTUGUESEBR} \
# "Adiciona um atalho para o Vim na barra de inicialização rápida."
LangString str_section_edit_with ${LANG_PORTUGUESEBR} \
"Adicionar menu de contexto do Vim"
LangString str_desc_edit_with ${LANG_PORTUGUESEBR} \
"Adiciona o Vim à lista $\"Abrir com...$\" do menu de contexto."
#LangString str_section_edit_with32 ${LANG_PORTUGUESEBR} \
# "Versão 32 bits"
#LangString str_desc_edit_with32 ${LANG_PORTUGUESEBR} \
# "Adiciona o Vim à lista $\"Abrir com...$\" do menu de contexto \
# para aplicativos 32 bits."
#LangString str_section_edit_with64 ${LANG_PORTUGUESEBR} \
# "Versão 64 bits"
#LangString str_desc_edit_with64 ${LANG_PORTUGUESEBR} \
# "Adiciona o Vim à lista $\"Abrir com...$\" do menu de contexto \
# para aplicativos 64 bits."
LangString str_section_vim_rc ${LANG_PORTUGUESEBR} \
"Criar configuração padrão"
LangString str_desc_vim_rc ${LANG_PORTUGUESEBR} \
"Cria um arquivo de configuração padrão (_vimrc) se não já existir."
LangString str_group_plugin ${LANG_PORTUGUESEBR} \
"Criar diretórios de plugins"
LangString str_desc_plugin ${LANG_PORTUGUESEBR} \
"Cria diretórios de plugins. Diretórios de plugins permitem estender \
o Vim adicionando um arquivo a um direótrio."
LangString str_section_plugin_home ${LANG_PORTUGUESEBR} \
"Privados"
LangString str_desc_plugin_home ${LANG_PORTUGUESEBR} \
"Cria diretórios de plugins no diretório HOME."
LangString str_section_plugin_vim ${LANG_PORTUGUESEBR} \
"Compartilhados"
LangString str_desc_plugin_vim ${LANG_PORTUGUESEBR} \
"Cria diretórios de plugins no diretório de instalação do Vim, \
o qual é usado por todos os usuários do sistema."
LangString str_section_nls ${LANG_PORTUGUESEBR} \
"Suporte ao idioma nativo"
LangString str_desc_nls ${LANG_PORTUGUESEBR} \
"Instala arquivos para suporte ao idioma nativo."
LangString str_unsection_register ${LANG_PORTUGUESEBR} \
"Desregistrar Vim"
LangString str_desc_unregister ${LANG_PORTUGUESEBR} \
"Remove os registras do Vim do sistema."
LangString str_unsection_exe ${LANG_PORTUGUESEBR} \
"Remover arquivos executáveis/runtime do Vim"
LangString str_desc_rm_exe ${LANG_PORTUGUESEBR} \
"Remove todos os arquivos executáveis e de runtime do Vim."
LangString str_ungroup_plugin ${LANG_PORTUGUESEBR} \
"Remover diretórios de plugins"
LangString str_desc_rm_plugin ${LANG_PORTUGUESEBR} \
"Remove os diretórios de plugins se eles estiverem vazios."
LangString str_unsection_plugin_home ${LANG_PORTUGUESEBR} \
"Privados"
LangString str_desc_rm_plugin_home ${LANG_PORTUGUESEBR} \
"Remove os diretórios de plugins do diretório HOME."
LangString str_unsection_plugin_vim ${LANG_PORTUGUESEBR} \
"Compartilhados"
LangString str_desc_rm_plugin_vim ${LANG_PORTUGUESEBR} \
"Remove os diretórios de plugins do diretório de instalação do Vim."
LangString str_unsection_rootdir ${LANG_PORTUGUESEBR} \
"Remover diretório raiz do Vim"
LangString str_desc_rm_rootdir ${LANG_PORTUGUESEBR} \
"Remove o diretório raiz do Vim. Ele contém seus \
arquivos de configuração do Vim!"
##############################################################################
# Messages {{{1
##############################################################################
#LangString str_msg_too_many_ver ${LANG_PORTUGUESEBR} \
# "Encontradas $vim_old_ver_count versões do Vim em seu sistema.$\r$\n\
# Este instalador só consegue lidar com ${VIM_MAX_OLD_VER} versões\
# no máximo.$\r$\n\
# Por favor, remova algumas versões e comece novamente."
#LangString str_msg_invalid_root ${LANG_PORTUGUESEBR} \
# "Caminho de instalação inválido: $vim_install_root!$\r$\n\
# Ele deve terminar com $\"vim$\"."
#LangString str_msg_bin_mismatch ${LANG_PORTUGUESEBR} \
# "Incompatibilidade de caminho de binários!$\r$\n$\r$\n\
# Esperava que o caminho de binários fosse $\"$vim_bin_path$\",$\r$\n\
# mas o sistema indica que o caminho de binários é $\"$INSTDIR$\"."
#LangString str_msg_vim_running ${LANG_PORTUGUESEBR} \
# "Vim ainda está em execução em seu sistema.$\r$\n\
# Por favor, feche todas as instâncias do Vim para poder continuar."
#LangString str_msg_register_ole ${LANG_PORTUGUESEBR} \
# "Tentativa de registrar o Vim com OLE. \
# Não há mensagem que indique se isso funciona ou não."
#LangString str_msg_unreg_ole ${LANG_PORTUGUESEBR} \
# "Tentando desregistrar o Vim com OLE. \
# Não há mensagem que indique se isso funciona ou não."
#LangString str_msg_rm_start ${LANG_PORTUGUESEBR} \
# "Desinstalando a seguinte versão:"
#LangString str_msg_rm_fail ${LANG_PORTUGUESEBR} \
# "Falha ao desinstalar a seguinte versão:"
#LangString str_msg_no_rm_key ${LANG_PORTUGUESEBR} \
# "Não foi possível encontrar a chave de registro do desinstalador."
#LangString str_msg_no_rm_reg ${LANG_PORTUGUESEBR} \
# "Não foi possível encontrar o desinstalador a partir do registro."
#LangString str_msg_no_rm_exe ${LANG_PORTUGUESEBR} \
# "Não foi possível acessar o desinstalador."
#LangString str_msg_rm_copy_fail ${LANG_PORTUGUESEBR} \
# "Falha ao copiar o desinstalador para um diretório temporário."
#LangString str_msg_rm_run_fail ${LANG_PORTUGUESEBR} \
# "Falha ao executar o desinstalador."
#LangString str_msg_abort_install ${LANG_PORTUGUESEBR} \
# "Instalador será interrompido."
LangString str_msg_install_fail ${LANG_PORTUGUESEBR} \
"A instalação falhou. Mais sorte na próxima vez."
LangString str_msg_rm_exe_fail ${LANG_PORTUGUESEBR} \
"Alguns arquivos em $0 não foram excluídos!$\r$\n\
Você deve fazê-lo manualmente."
#LangString str_msg_rm_root_fail ${LANG_PORTUGUESEBR} \
# "AVISO: Não foi possível remover $\"$vim_install_root$\", \
# pois não está vazio!"
LangString str_msg_uninstalling ${LANG_PORTUGUESEBR} \
"Desinstalando a versão antiga..."
LangString str_msg_registering ${LANG_PORTUGUESEBR} \
"Registrando..."
LangString str_msg_unregistering ${LANG_PORTUGUESEBR} \
"Desregistrando..."
##############################################################################
# Dialog Box {{{1
##############################################################################
LangString str_vimrc_page_title ${LANG_PORTUGUESEBR} \
"Escolher configurações do _vimrc"
LangString str_vimrc_page_subtitle ${LANG_PORTUGUESEBR} \
"Escolha as configurações para melhorias, teclado e mouse."
LangString str_msg_compat_title ${LANG_PORTUGUESEBR} \
" Comportamento Vi / Vim "
LangString str_msg_compat_desc ${LANG_PORTUGUESEBR} \
"&Compatibilidade e melhorias"
LangString str_msg_compat_vi ${LANG_PORTUGUESEBR} \
"Compatível com Vi"
LangString str_msg_compat_vim ${LANG_PORTUGUESEBR} \
"Vim original"
LangString str_msg_compat_defaults ${LANG_PORTUGUESEBR} \
"Vim com algumas melhorias (carrega defaults.vim)"
LangString str_msg_compat_all ${LANG_PORTUGUESEBR} \
"Vim com todas as melhorias (carrega vimrc_example.vim) (Padrão)"
LangString str_msg_keymap_title ${LANG_PORTUGUESEBR} \
" Mapeamentos "
LangString str_msg_keymap_desc ${LANG_PORTUGUESEBR} \
"&Remapear algumas teclas para o Windows (Ctrl-V, Ctrl-C, Ctrl-A, Ctrl-S, Ctrl-F, etc)"
LangString str_msg_keymap_default ${LANG_PORTUGUESEBR} \
"Não remapear teclas (Padrão)"
LangString str_msg_keymap_windows ${LANG_PORTUGUESEBR} \
"Remapear algumas teclas"
LangString str_msg_mouse_title ${LANG_PORTUGUESEBR} \
" Mouse "
LangString str_msg_mouse_desc ${LANG_PORTUGUESEBR} \
"&Comportamento de botões direito e esquerdo"
LangString str_msg_mouse_default ${LANG_PORTUGUESEBR} \
"Direito: menu popup, Esquerdo: modo visual (Padrão)"
LangString str_msg_mouse_windows ${LANG_PORTUGUESEBR} \
"Direito: menu popup, Esquerdo: modo de seleção (Windows)"
LangString str_msg_mouse_unix ${LANG_PORTUGUESEBR} \
"Direito: estende seleção, Esquerdo: modo visual (Unix)"

View File

@ -3,7 +3,7 @@ vim9script
# Vim functions for file type detection
#
# Maintainer: The Vim Project <https://github.com/vim/vim>
# Last Change: 2025 Jan 25
# Last Change: 2025 Jul 09
# Former Maintainer: Bram Moolenaar <Bram@vim.org>
# These functions are moved here from runtime/filetype.vim to make startup
@ -30,12 +30,8 @@ export def Check_inp()
enddef
# This function checks for the kind of assembly that is wanted by the user, or
# can be detected from the first five lines of the file.
# can be detected from the beginning of the file.
export def FTasm()
# tiasm uses `* commment`
if join(getline(1, 10), "\n") =~ '\%(\%(^\|\n\)\*\|Texas Instruments Incorporated\)'
setf tiasm
endif
# make sure b:asmsyntax exists
if !exists("b:asmsyntax")
b:asmsyntax = ""
@ -65,9 +61,30 @@ export def FTasmsyntax()
var match = matchstr(head, '\sasmsyntax=\zs[a-zA-Z0-9]\+\ze\s')
if match != ''
b:asmsyntax = match
elseif ((head =~? '\.title') || (head =~? '\.ident') || (head =~? '\.macro') || (head =~? '\.subtitle') || (head =~? '\.library'))
b:asmsyntax = "vmasm"
return
endif
# Use heuristics
var is_slash_star_encountered = false
var i = 1
const n = min([50, line("$")])
while i <= n
const line = getline(i)
if line =~ '^/\*'
is_slash_star_encountered = true
endif
if line =~# '^; Listing generated by Microsoft' || line =~? '^\%(\%(CONST\|_BSS\|_DATA\|_TEXT\)\s\+SEGMENT\>\)\|\s*\.[2-6]86P\?\>\|\s*\.XMM\>'
b:asmsyntax = "masm"
return
elseif line =~ 'Texas Instruments Incorporated' || (line =~ '^\*' && !is_slash_star_encountered)
# tiasm uses `* commment`, but detection is unreliable if '/*' is seen
b:asmsyntax = "tiasm"
return
elseif ((line =~? '\.title\>\|\.ident\>\|\.macro\>\|\.subtitle\>\|\.library\>'))
b:asmsyntax = "vmasm"
return
endif
i += 1
endwhile
enddef
var ft_visual_basic_content = '\c^\s*\%(Attribute\s\+VB_Name\|Begin\s\+\%(VB\.\|{\%(\x\+-\)\+\x\+}\)\)'
@ -184,9 +201,18 @@ enddef
export def FTll()
if getline(1) =~ ';\|\<source_filename\>\|\<target\>'
setf llvm
else
setf lifelines
return
endif
var n = 1
while n < 100 && n <= line("$")
var line = getline(n)
if line =~ '^\s*%'
setf lex
return
endif
n += 1
endwhile
setf lifelines
enddef
export def FTlpc()
@ -203,19 +229,36 @@ export def FTlpc()
setf c
enddef
export def FTheader()
if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1
if exists("g:c_syntax_for_h")
setf objc
else
setf objcpp
# Searches within the first `maxlines` lines of the file for distinctive
# Objective-C or C++ syntax and returns the appropriate filetype. Returns a
# null_string if the search was inconclusive.
def CheckObjCOrCpp(maxlines = 100): string
var n = 1
while n < maxlines && n <= line('$')
const line = getline(n)
if line =~ '\v^\s*\@%(class|interface|end)>'
return 'objcpp'
elseif line =~ '\v^\s*%(class|namespace|template|using)>'
return 'cpp'
endif
elseif exists("g:c_syntax_for_h")
++n
endwhile
return null_string
enddef
# Determines whether a *.h file is C, C++, Ch, or Objective-C/Objective-C++.
export def FTheader()
if exists('g:filetype_h')
execute $'setf {g:filetype_h}'
elseif exists('g:c_syntax_for_h')
setf c
elseif exists("g:ch_syntax_for_h")
elseif exists('g:ch_syntax_for_h')
setf ch
else
setf cpp
# Search the first 100 lines of the file for distinctive Objective-C or C++
# syntax and set the filetype accordingly. Otherwise, use C as the default
# filetype.
execute $'setf {CheckObjCOrCpp() ?? 'c'}'
endif
enddef
@ -557,17 +600,47 @@ export def FTm()
enddef
export def FTmake()
# Check if it is a Microsoft Makefile
unlet! b:make_microsoft
# Check if it is a BSD, GNU, or Microsoft Makefile
unlet! b:make_flavor
# 1. filename
if expand('%:t') == 'BSDmakefile'
b:make_flavor = 'bsd'
setf make
return
elseif expand('%:t') == 'GNUmakefile'
b:make_flavor = 'gnu'
setf make
return
endif
# 2. user's setting
if exists('g:make_flavor')
b:make_flavor = g:make_flavor
setf make
return
elseif get(g:, 'make_microsoft')
echom "make_microsoft is deprecated; try g:make_flavor = 'microsoft' instead"
b:make_flavor = 'microsoft'
setf make
return
endif
# 3. try to detect a flavor from file content
var n = 1
while n < 1000 && n <= line('$')
var line = getline(n)
if line =~? '^\s*!\s*\(ifn\=\(def\)\=\|include\|message\|error\)\>'
b:make_microsoft = 1
b:make_flavor = 'microsoft'
break
elseif line =~ '^ *ifn\=\(eq\|def\)\>' || line =~ '^ *[-s]\=include\s'
elseif line =~ '^\.\%(export\|error\|for\|if\%(n\=\%(def\|make\)\)\=\|info\|warning\)\>'
b:make_flavor = 'bsd'
break
elseif line =~ '^ *\w\+\s*[!?:+]='
elseif line =~ '^ *\%(ifn\=\%(eq\|def\)\|define\|override\)\>'
b:make_flavor = 'gnu'
break
elseif line =~ '\$[({][a-z-]\+\s\+\S\+' # a function call, e.g. $(shell pwd)
b:make_flavor = 'gnu'
break
endif
n += 1
@ -592,14 +665,19 @@ export def FTmms()
setf mmix
enddef
# This function checks if one of the first five lines start with a dot. In
# that case it is probably an nroff file: 'filetype' is set and 1 is returned.
# This function checks if one of the first five lines start with a typical
# nroff pattern in man files. In that case it is probably an nroff file:
# 'filetype' is set and 1 is returned.
export def FTnroff(): number
if getline(1)[0] .. getline(2)[0] .. getline(3)[0]
.. getline(4)[0] .. getline(5)[0] =~ '\.'
setf nroff
return 1
endif
var n = 1
while n <= 5
var line = getline(n)
if line =~ '^\%([.'']\s*\%(TH\|D[dt]\|S[Hh]\|d[es]1\?\|so\)\s\+\S\|[.'']\s*ig\>\|\%([.'']\s*\)\?\\"\)'
setf nroff
return 1
endif
n += 1
endwhile
return 0
enddef
@ -875,16 +953,16 @@ export def SetFileTypeSH(name: string, setft = true): string
if setft && expand("<amatch>") =~ g:ft_ignore_pat
return ''
endif
if name =~ '\<csh\>'
if name =~ '^csh$' || name =~ '^#!.\{-2,}\<csh\>'
# Some .sh scripts contain #!/bin/csh.
return SetFileTypeShell("csh", setft)
elseif name =~ '\<tcsh\>'
elseif name =~ '^tcsh$' || name =~ '^#!.\{-2,}\<tcsh\>'
# Some .sh scripts contain #!/bin/tcsh.
return SetFileTypeShell("tcsh", setft)
elseif name =~ '\<zsh\>'
elseif name =~ '^zsh$' || name =~ '^#!.\{-2,}\<zsh\>'
# Some .sh scripts contain #!/bin/zsh.
return SetFileTypeShell("zsh", setft)
elseif name =~ '\<ksh\>'
elseif name =~ '^ksh$' || name =~ '^#!.\{-2,}\<ksh\>'
b:is_kornshell = 1
if exists("b:is_bash")
unlet b:is_bash
@ -892,7 +970,8 @@ export def SetFileTypeSH(name: string, setft = true): string
if exists("b:is_sh")
unlet b:is_sh
endif
elseif exists("g:bash_is_sh") || name =~ '\<bash\>' || name =~ '\<bash2\>'
elseif exists("g:bash_is_sh") || name =~ '^bash2\=$' ||
\ name =~ '^#!.\{-2,}\<bash2\=\>'
b:is_bash = 1
if exists("b:is_kornshell")
unlet b:is_kornshell
@ -900,7 +979,7 @@ export def SetFileTypeSH(name: string, setft = true): string
if exists("b:is_sh")
unlet b:is_sh
endif
elseif name =~ '\<sh\>' || name =~ '\<dash\>'
elseif name =~ '^\%(da\)\=sh$' || name =~ '^#!.\{-2,}\<\%(da\)\=sh\>'
# Ubuntu links "sh" to "dash", thus it is expected to work the same way
b:is_sh = 1
if exists("b:is_kornshell")

View File

@ -5,6 +5,8 @@
" Autoload Split: Bram Moolenaar
" Last Change: 2024 Jan 17 (make it work on AIX, see #13847)
" 2024 Jul 06 (honor command modifiers, #15117)
" 2025 Mar 05 (add :keepjumps, #16791)
" 2025 Mar 09 (improve :Man completion for man-db, #16843)
let s:cpo_save = &cpo
set cpo-=C
@ -34,6 +36,88 @@ endtry
unlet! uname_s
let s:man_db_pages_by_section = v:null
func! s:ManDbPagesBySection() abort
if s:man_db_pages_by_section isnot v:null
return s:man_db_pages_by_section
endif
let s:man_db_pages_by_section = {}
let list_command = 'apropos --long .'
let unparsed_lines = []
for line in systemlist(list_command)
" Typical lines:
" vim (1) - Vi IMproved, a programmer's text editor
"
" Unusual lines:
" pgm_read_ T _ (3avr) - (unknown subject)
"
" Code that shows the line's format:
" https://gitlab.com/man-db/man-db/-/blob/2607d203472efb036d888e9e7997724a41a53876/src/whatis.c#L409
let match = matchlist(line, '^\(.\{-1,}\) (\(\S\+\)) ')
if empty(match)
call add(unparsed_lines, line)
continue
endif
let [page, section] = match[1:2]
if !has_key(s:man_db_pages_by_section, section)
let s:man_db_pages_by_section[section] = []
endif
call add(s:man_db_pages_by_section[section], page)
endfor
if !empty(unparsed_lines)
echomsg 'Unable to parse ' .. string(len(unparsed_lines)) .. ' lines ' ..
\ 'from the output of `' .. list_command .. '`. Example lines:'
for line in unparsed_lines[:9]
echomsg line
endfor
endif
return s:man_db_pages_by_section
endfunc
func! dist#man#Reload() abort
if g:ft_man_implementation ==# 'man-db'
let s:man_db_pages_by_section = v:null
call s:ManDbPagesBySection()
endif
endfunc
func! s:StartsWithCaseInsensitive(haystack, needle) abort
if empty(a:needle)
return v:true
endif
return a:haystack[:len(a:needle)-1] ==? a:needle
endfunc
func! dist#man#ManDbComplete(arg_lead, cmd_line, cursor_pos) abort
let args = split(trim(a:cmd_line[: a:cursor_pos - 1], '', 1), '', v:true)
let pages_by_section = s:ManDbPagesBySection()
if len(args) > 2
" Page in the section args[1]. At least on Debian testing as of
" 2025-03-06, man seems to match sections case-insensitively and match any
" prefix of the section. E.g., `man 3 sigprocmask` and `man 3PoSi
" sigprocmask` with both load sigprocmask(3posix) even though the 3 in the
" first command is also the name of a different section.
let results = []
for [section, pages] in items(pages_by_section)
if s:StartsWithCaseInsensitive(section, args[1])
call extend(results, pages)
endif
endfor
else
" Could be a section, or a page in any section. Add space after sections
" since there has to be a second argument in that case.
let results = flattennew(values(pages_by_section), 1)
for section in keys(pages_by_section)
call add(results, section .. ' ')
endfor
endif
call sort(results)
call uniq(results)
call filter(results,
\ {_, val -> s:StartsWithCaseInsensitive(val, a:arg_lead)})
return results
endfunc
func s:ParseIntoPageAndSection()
" Accommodate a reference that terminates in a hyphen.
"
@ -188,7 +272,7 @@ func dist#man#GetPage(cmdmods, ...)
setl buftype=nofile noswapfile
setl fdc=0 ma nofen nonu nornu
%delete _
keepjumps %delete _
let unsetwidth = 0
if empty($MANWIDTH)
let $MANWIDTH = winwidth(0)
@ -218,10 +302,10 @@ func dist#man#GetPage(cmdmods, ...)
endif
" Remove blank lines from top and bottom.
while line('$') > 1 && getline(1) =~ '^\s*$'
1delete _
keepjumps 1delete _
endwhile
while line('$') > 1 && getline('$') =~ '^\s*$'
$delete _
keepjumps $delete _
endwhile
1
setl ft=man nomod

View File

@ -4,7 +4,7 @@ vim9script
# Invoked from "scripts.vim" in 'runtimepath'
#
# Maintainer: The Vim Project <https://github.com/vim/vim>
# Last Change: 2025 Jan 20
# Last Change: 2025 Apr 24
# Former Maintainer: Bram Moolenaar <Bram@vim.org>
export def DetectFiletype()
@ -26,8 +26,9 @@ def DetectFromHashBang(firstline: string)
# "#!/usr/bin/bash" to make matching easier.
# Recognize only a few {options} that are commonly used.
if line1 =~ '^#!\s*\S*\<env\s'
line1 = substitute(line1, '\S\+=\S\+', '', 'g')
line1 = substitute(line1, '\(-[iS]\|--ignore-environment\|--split-string\)', '', '')
line1 = substitute(line1, '\s\zs--split-string[ \t=]', '', '')
line1 = substitute(line1, '\s\zs[A-Za-z0-9_]\+=\S*\ze\s', '', 'g')
line1 = substitute(line1, '\s\zs\%(-[iS]\+\|--ignore-environment\)\ze\s', '', 'g')
line1 = substitute(line1, '\<env\s\+', '', '')
endif

View File

@ -1,9 +1,9 @@
" Vim runtime support library,
" runs the vim9 script version or legacy script version
" runs the Vim9 script version or legacy script version
" on demand (mostly for Neovim compatability)
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2023 Nov 04
" Last Change: 2025 Apr 27
" enable the zip and gzip plugin by default, if not set

View File

@ -2,7 +2,7 @@ vim9script
# Language: Vim script
# Maintainer: github user lacygoill
# Last Change: 2024 Dec 26
# Last Change: 2025 Apr 13
#
# Includes changes from The Vim Project:
# - 2024 Feb 09: Fix indent after literal Dict (A. Radev via #13966)
@ -981,8 +981,10 @@ def SearchPair( # {{{3
if end == '[' || end == ']'
e = e->escape('[]')
endif
# VIM_INDENT_TEST_TRACE_START
return searchpair('\C' .. s, (middle == '' ? '' : '\C' .. middle), '\C' .. e,
flags, (): bool => InCommentOrString(), stopline, TIMEOUT)
# VIM_INDENT_TEST_TRACE_END dist#vimindent#SearchPair
enddef
def SearchPairStart( # {{{3
@ -1268,7 +1270,9 @@ def NonCommentedMatch(line: dict<any>, pat: string): bool # {{{3
var pos: list<number> = getcurpos()
cursor(line.lnum, 1)
# VIM_INDENT_TEST_TRACE_START
var match_lnum: number = search(pat, 'cnW', line.lnum, TIMEOUT, (): bool => InCommentOrString())
# VIM_INDENT_TEST_TRACE_END dist#vimindent#NonCommentedMatch
setpos('.', pos)
return match_lnum > 0
enddef

View File

@ -12,6 +12,8 @@
" autoloading search path fix
" substitution of hardcoded commands with global variables
" 2024 Nov 12 by Vim Project: fix problems on Windows (#16036)
" 2025 Feb 28 by Vim Project: add support for bzip3 (#16755)
" 2025 May 11 by Vim Project: check network connectivity (#17249)
" }}}
"
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
@ -100,6 +102,10 @@ if !exists("g:GetLatestVimScripts_bunzip2")
let g:GetLatestVimScripts_bunzip2= "bunzip2"
endif
if !exists("g:GetLatestVimScripts_bunzip3")
let g:GetLatestVimScripts_bunzip3= "bunzip3"
endif
if !exists("g:GetLatestVimScripts_gunzip")
let g:GetLatestVimScripts_gunzip= "gunzip"
endif
@ -142,9 +148,6 @@ if g:GetLatestVimScripts_allowautoinstall
elseif exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim)
let s:autoinstall= $HOME."/".s:dotvim
endif
" call Decho("s:autoinstall<".s:autoinstall.">")
"else "Decho
" call Decho("g:GetLatestVimScripts_allowautoinstall=".g:GetLatestVimScripts_allowautoinstall.": :AutoInstall: disabled")
endif
" ---------------------------------------------------------------------
@ -158,24 +161,19 @@ silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts()
" scripts based on the list in
" (first dir in runtimepath)/GetLatest/GetLatestVimScripts.dat
fun! getscript#GetLatestVimScripts()
" call Dfunc("GetLatestVimScripts() autoinstall<".s:autoinstall.">")
" insure that wget is executable
if executable(g:GetLatestVimScripts_wget) != 1
echoerr "GetLatestVimScripts needs ".g:GetLatestVimScripts_wget." which apparently is not available on your system"
" call Dret("GetLatestVimScripts : wget not executable/available")
return
endif
" Find the .../GetLatest subdirectory under the runtimepath
for datadir in split(&rtp,',') + ['']
if isdirectory(datadir."/GetLatest")
" call Decho("found directory<".datadir.">")
let datadir= datadir . "/GetLatest"
break
endif
if filereadable(datadir."GetLatestVimScripts.dat")
" call Decho("found ".datadir."/GetLatestVimScripts.dat")
break
endif
endfor
@ -183,32 +181,25 @@ fun! getscript#GetLatestVimScripts()
" Sanity checks: readability and writability
if datadir == ""
echoerr 'Missing "GetLatest/" on your runtimepath - see :help glvs-dist-install'
" call Dret("GetLatestVimScripts : unable to find a GetLatest subdirectory")
return
endif
if filewritable(datadir) != 2
echoerr "(getLatestVimScripts) Your ".datadir." isn't writable"
" call Dret("GetLatestVimScripts : non-writable directory<".datadir.">")
return
endif
let datafile= datadir."/GetLatestVimScripts.dat"
if !filereadable(datafile)
echoerr "Your data file<".datafile."> isn't readable"
" call Dret("GetLatestVimScripts : non-readable datafile<".datafile.">")
return
endif
if !filewritable(datafile)
echoerr "Your data file<".datafile."> isn't writable"
" call Dret("GetLatestVimScripts : non-writable datafile<".datafile.">")
return
endif
" --------------------
" Passed sanity checks
" --------------------
" call Decho("datadir <".datadir.">")
" call Decho("datafile <".datafile.">")
" don't let any event handlers interfere (like winmanager's, taglist's, etc)
let eikeep = &ei
let hlskeep = &hls
@ -221,25 +212,20 @@ fun! getscript#GetLatestVimScripts()
" 3. split window
" 4. edit datafile
let origdir= getcwd()
" call Decho("exe cd ".fnameescape(substitute(datadir,'\','/','ge')))
exe "cd ".fnameescape(substitute(datadir,'\','/','ge'))
split
" call Decho("exe e ".fnameescape(substitute(datafile,'\','/','ge')))
exe "e ".fnameescape(substitute(datafile,'\','/','ge'))
res 1000
let s:downloads = 0
let s:downerrors= 0
let s:message = []
" Check on dependencies mentioned in plugins
" call Decho(" ")
" call Decho("searching plugins for GetLatestVimScripts dependencies")
let lastline = line("$")
" call Decho("lastline#".lastline)
let firstdir = substitute(&rtp,',.*$','','')
let plugins = split(globpath(firstdir,"plugin/**/*.vim"),'\n')
let plugins += split(globpath(firstdir,"ftplugin/**/*.vim"),'\n')
let plugins += split(globpath(firstdir,"AsNeeded/**/*.vim"),'\n')
" extend the search to the packages too (this script predates the feature)
let plugins += split(globpath(firstdir,"pack/*/start/*/plugin/**/*.vim"),'\n')
let plugins += split(globpath(firstdir,"pack/*/opt/*/plugin/**/*.vim"),'\n')
let plugins += split(globpath(firstdir,"pack/*/start/*/ftplugin/**/*.vim"),'\n')
@ -252,14 +238,10 @@ fun! getscript#GetLatestVimScripts()
" It reads the plugin script at the end of the GetLatestVimScripts.dat
" file, examines it, and then removes it.
for plugin in plugins
" call Decho(" ")
" call Decho("plugin<".plugin.">")
" read plugin in
" evidently a :r creates a new buffer (the "#" buffer) that is subsequently unused -- bwiping it
$
" call Decho(".dependency checking<".plugin."> line$=".line("$"))
" call Decho("..exe silent r ".fnameescape(plugin))
exe "silent r ".fnameescape(plugin)
exe "silent bwipe ".bufnr("#")
@ -267,7 +249,6 @@ fun! getscript#GetLatestVimScripts()
let depscript = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e')
let depscriptid = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\(\d\+\)\s\+.*$','\1','')
let llp1 = lastline+1
" call Decho("..depscript<".depscript.">")
" found a "GetLatestVimScripts: # #" line in the script;
" check if it's already in the datafile by searching backwards from llp1,
@ -281,21 +262,17 @@ fun! getscript#GetLatestVimScripts()
" this second search is taken when, for example, a 0 0 scriptname is to be skipped over
let srchline= search('\<'.noai_script.'\>','bW')
endif
" call Decho("..noai_script<".noai_script."> depscriptid#".depscriptid." srchline#".srchline." curline#".line(".")." lastline#".lastline)
if srchline == 0
" found a new script to permanently include in the datafile
let keep_rega = @a
let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','')
echomsg "Appending <".@a."> to ".datafile." for ".depscript
" call Decho("..Appending <".@a."> to ".datafile." for ".depscript)
exe lastline."put a"
let @a = keep_rega
let lastline = llp1
let curline = curline + 1
let foundscript = foundscript + 1
" else " Decho
" call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")")
endif
let curline = curline + 1
@ -304,12 +281,8 @@ fun! getscript#GetLatestVimScripts()
" llp1: last line plus one
let llp1= lastline + 1
" call Decho(".deleting lines: ".llp1.",$d")
exe "silent! ".llp1.",$d"
endfor
" call Decho("--- end dependency checking loop --- foundscript=".foundscript)
" call Decho(" ")
" call Dredir("BUFFER TEST (GetLatestVimScripts 1)","ls!")
if foundscript == 0
setlocal nomod
@ -318,32 +291,32 @@ fun! getscript#GetLatestVimScripts()
" --------------------------------------------------------------------
" Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat
" --------------------------------------------------------------------
" call Decho("begin: checking out-of-date scripts using datafile<".datafile.">")
setlocal lz
1
" /^-----/,$g/^\s*\d/call Decho(getline("."))
1
/^-----/,$g/^\s*\d/call s:GetOneScript()
" call Decho("--- end out-of-date checking --- ")
" Final report (an echomsg)
try
silent! ?^-------?
catch /^Vim\%((\a\+)\)\=:E114/
" call Dret("GetLatestVimScripts : nothing done!")
return
endtry
exe "norm! kz\<CR>"
redraw!
if !empty(s:message)
echohl WarningMsg
for mess in s:message
echom mess
endfor
let s:downerrors += len(s:message)
endif
let s:msg = ""
if s:downloads == 1
let s:msg = "Downloaded one updated script to <".datadir.">"
elseif s:downloads == 2
let s:msg= "Downloaded two updated scripts to <".datadir.">"
elseif s:downloads > 1
let s:msg= "Downloaded ".s:downloads." updated scripts to <".datadir.">"
else
let s:msg= "Everything was already current"
let s:msg= empty(s:message) ? "Everything was already current" : "There were some errors"
endif
if s:downerrors > 0
let s:msg= s:msg." (".s:downerrors." downloading errors)"
@ -361,8 +334,6 @@ fun! getscript#GetLatestVimScripts()
let &hls = hlskeep
let &acd = acdkeep
setlocal nolz
" call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!")
" call Dret("GetLatestVimScripts : did ".s:downloads." downloads")
endfun
" ---------------------------------------------------------------------
@ -371,8 +342,6 @@ endfun
" ScriptID, SourceID, and Filename.
" It downloads any scripts that have newer versions from vim.sourceforge.net.
fun! s:GetOneScript(...)
" call Dfunc("GetOneScript()")
" set options to allow progress to be shown on screen
let rega= @a
let t_ti= &t_ti
@ -398,13 +367,9 @@ fun! s:GetOneScript(...)
let srcid = a:2
let fname = a:3
let cmmnt = ""
" call Decho("scriptid<".scriptid.">")
" call Decho("srcid <".srcid.">")
" call Decho("fname <".fname.">")
else
let curline = getline(".")
if curline =~ '^\s*#'
" call Dret("GetOneScript : skipping a pure comment line")
return
endif
let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(.\{-}\)\(\s*#.*\)\=$'
@ -428,36 +393,26 @@ fun! s:GetOneScript(...)
catch /^Vim\%((\a\+)\)\=:E486/
let cmmnt= ""
endtry
" call Decho("curline <".curline.">")
" call Decho("parsepat<".parsepat.">")
" call Decho("scriptid<".scriptid.">")
" call Decho("srcid <".srcid.">")
" call Decho("fname <".fname.">")
endif
" plugin author protection from downloading his/her own scripts atop their latest work
" When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname
if scriptid == 0 || srcid == 0
" When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname
" call Dret("GetOneScript : skipping a scriptid==srcid==0 line")
return
endif
let doautoinstall= 0
if fname =~ ":AutoInstall:"
" call Decho("case AutoInstall: fname<".fname.">")
let aicmmnt= substitute(fname,'\s\+:AutoInstall:\s\+',' ','')
" call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall)
if s:autoinstall != ""
let doautoinstall = g:GetLatestVimScripts_allowautoinstall
endif
else
let aicmmnt= fname
endif
" call Decho("aicmmnt<".aicmmnt.">: doautoinstall=".doautoinstall)
exe "norm z\<CR>"
redraw!
" call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid)
echo 'considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid
" grab a copy of the plugin's vim.sourceforge.net webpage
@ -465,15 +420,17 @@ fun! s:GetOneScript(...)
let tmpfile = tempname()
let v:errmsg = ""
" Check if URLs are reachable
if !CheckVimScriptURL(scriptid, srcid)
return
endif
" make up to three tries at downloading the description
let itry= 1
while itry <= 3
" call Decho(".try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr)
if has("win32") || has("win16") || has("win95")
" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)."|bw!")
new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)|bw!
else
" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr))
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr)
endif
if itry == 1
@ -491,7 +448,6 @@ fun! s:GetOneScript(...)
endif
let itry= itry + 1
endwhile
" call Decho(" --- end downloading tries while loop --- itry=".itry)
" testing: did finding "Click on the package..." fail?
if findpkg == 0 || itry >= 4
@ -502,12 +458,9 @@ fun! s:GetOneScript(...)
let &t_te = t_te
let &rs = rs
let s:downerrors = s:downerrors + 1
" call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">")
echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">"
" call Dret("GetOneScript : srch for /Click on the package/ failed")
return
endif
" call Decho('found "Click on the package to download"')
let findsrcid= search('src_id=','W')
if findsrcid == 0
@ -518,28 +471,22 @@ fun! s:GetOneScript(...)
let &t_te = t_te
let &rs = rs
let s:downerrors = s:downerrors + 1
" call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">")
echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">"
" call Dret("GetOneScript : srch for /src_id/ failed")
return
endif
" call Decho('found "src_id=" in description page')
let srcidpat = '^\s*<td class.*src_id=\(\d\+\)">\([^<]\+\)<.*$'
let latestsrcid= substitute(getline("."),srcidpat,'\1','')
let sname = substitute(getline("."),srcidpat,'\2','') " script name actually downloaded
" call Decho("srcidpat<".srcidpat."> latestsrcid<".latestsrcid."> sname<".sname.">")
silent q!
call delete(tmpfile)
" convert the strings-of-numbers into numbers
let srcid = srcid + 0
let latestsrcid = latestsrcid + 0
" call Decho("srcid=".srcid." latestsrcid=".latestsrcid." sname<".sname.">")
" has the plugin's most-recent srcid increased, which indicates that it has been updated
if latestsrcid > srcid
" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."]: need to update <".sname.">")
let s:downloads= s:downloads + 1
if sname == bufname("%")
@ -550,88 +497,65 @@ fun! s:GetOneScript(...)
" -----------------------------------------------------------------------------
" the plugin has been updated since we last obtained it, so download a new copy
" -----------------------------------------------------------------------------
" call Decho(".downloading new <".sname.">")
echomsg ".downloading new <".sname.">"
if has("win32") || has("win16") || has("win95")
" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)."|bw!")
new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)|bw!
else
" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)
endif
" --------------------------------------------------------------------------
" AutoInstall: only if doautoinstall has been requested by the plugin itself
" --------------------------------------------------------------------------
" call Decho("checking if plugin requested autoinstall: doautoinstall=".doautoinstall)
if doautoinstall
" call Decho(" ")
" call Decho("Autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname))
if filereadable(sname)
" call Decho("<".sname."> is readable")
" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall))
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall)
let curdir = fnameescape(substitute(getcwd(),'\','/','ge'))
let installdir= curdir."/Installed"
if !isdirectory(installdir)
call mkdir(installdir)
endif
" call Decho("curdir<".curdir."> installdir<".installdir.">")
" call Decho("exe cd ".fnameescape(s:autoinstall))
exe "cd ".fnameescape(s:autoinstall)
" determine target directory for moves
let firstdir= substitute(&rtp,',.*$','','')
let pname = substitute(sname,'\..*','.vim','')
" call Decho("determine tgtdir: is <".firstdir.'/AsNeeded/'.pname." readable?")
if filereadable(firstdir.'/AsNeeded/'.pname)
let tgtdir= "AsNeeded"
else
let tgtdir= "plugin"
endif
" call Decho("tgtdir<".tgtdir."> pname<".pname.">")
" decompress
if sname =~ '\.bz2$'
" call Decho("decompress: attempt to bunzip2 ".sname)
exe "sil !".g:GetLatestVimScripts_bunzip2." ".shellescape(sname)
let sname= substitute(sname,'\.bz2$','','')
" call Decho("decompress: new sname<".sname."> after bunzip2")
elseif sname =~ '\.bz3$'
exe "sil !".g:GetLatestVimScripts_bunzip3." ".shellescape(sname)
let sname= substitute(sname,'\.bz3$','','')
elseif sname =~ '\.gz$'
" call Decho("decompress: attempt to gunzip ".sname)
exe "sil !".g:GetLatestVimScripts_gunzip." ".shellescape(sname)
let sname= substitute(sname,'\.gz$','','')
" call Decho("decompress: new sname<".sname."> after gunzip")
elseif sname =~ '\.xz$'
" call Decho("decompress: attempt to unxz ".sname)
exe "sil !".g:GetLatestVimScripts_unxz." ".shellescape(sname)
let sname= substitute(sname,'\.xz$','','')
" call Decho("decompress: new sname<".sname."> after unxz")
else
" call Decho("no decompression needed")
endif
" distribute archive(.zip, .tar, .vba, .vmb, ...) contents
if sname =~ '\.zip$'
" call Decho("dearchive: attempt to unzip ".sname)
exe "silent !".g:GetLatestVimScripts_unzip." -o ".shellescape(sname)
elseif sname =~ '\.tar$'
" call Decho("dearchive: attempt to untar ".sname)
exe "silent !tar -xvf ".shellescape(sname)
elseif sname =~ '\.tgz$'
" call Decho("dearchive: attempt to untar+gunzip ".sname)
exe "silent !tar -zxvf ".shellescape(sname)
elseif sname =~ '\.taz$'
" call Decho("dearchive: attempt to untar+uncompress ".sname)
exe "silent !tar -Zxvf ".shellescape(sname)
elseif sname =~ '\.tbz$'
" call Decho("dearchive: attempt to untar+bunzip2 ".sname)
exe "silent !tar -jxvf ".shellescape(sname)
elseif sname =~ '\.txz$'
" call Decho("dearchive: attempt to untar+xz ".sname)
exe "silent !tar -Jxvf ".shellescape(sname)
elseif sname =~ '\.vba$\|\.vmb$'
" call Decho("dearchive: attempt to handle a vimball: ".sname)
silent 1split
if exists("g:vimball_home")
let oldvimballhome= g:vimball_home
@ -645,28 +569,22 @@ fun! s:GetOneScript(...)
else
unlet g:vimball_home
endif
else
" call Decho("no dearchiving needed")
endif
" ---------------------------------------------
" move plugin to plugin/ or AsNeeded/ directory
" ---------------------------------------------
if sname =~ '.vim$'
" call Decho("dearchive: attempt to simply move ".sname." to ".tgtdir)
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".tgtdir
else
" call Decho("dearchive: move <".sname."> to installdir<".installdir.">")
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".installdir
endif
if tgtdir != "plugin"
" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape("plugin/".pname)." ".tgtdir)
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape("plugin/".pname)." ".tgtdir
endif
" helptags step
let docdir= substitute(&rtp,',.*','','e')."/doc"
" call Decho("helptags: docdir<".docdir.">")
exe "helptags ".fnameescape(docdir)
exe "cd ".fnameescape(curdir)
endif
@ -681,13 +599,42 @@ fun! s:GetOneScript(...)
" update the data in the <GetLatestVimScripts.dat> file
call setline(line("."),modline)
" call Decho("update data in ".expand("%")."#".line(".").": modline<".modline.">")
" else " Decho
" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."], no need to update")
endif
endfun
" CheckVimScriptURL: Check Network Connection {{{1
" Check status code of scriptaddr and downloadaddr
" return v:true if the script is downloadable or v:false in case of errors
fun CheckVimScriptURL(script_id, src_id)
" doesn't work with powershell
if !executable('curl') || &shell =~? 'pwsh\|powershell'
return v:true
endif
let output = has("win32") ? ' -o NUL ' : ' -o /dev/null '
let temp = tempname()
defer delete(temp)
let script_url = g:GetLatestVimScripts_scriptaddr . a:script_id
let download_url = g:GetLatestVimScripts_downloadaddr . a:src_id
let script_cmd = 'curl -s -I -w "%{http_code}"' . output . shellescape(script_url) . ' >' . shellescape(temp)
call system(script_cmd)
let script_status = readfile(temp, 'b')[0]
let download_cmd = 'curl -s -I -w "%{http_code}"' . output . shellescape(download_url) . ' >' . shellescape(temp)
call system(download_cmd)
let download_status = readfile(temp, 'b')[0]
if script_status !=# '200'
let s:message += [ printf('Error: Failed to reach script: %s', a:script_id) ]
return v:false
endif
" call Dredir("BUFFER TEST (GetOneScript)","ls!")
" call Dret("GetOneScript")
if download_status !=# '200'
let s:message += [ printf('Error: Failed to download script %s', a:script_id) ]
return v:false
endif
return v:true
endfun
" ---------------------------------------------------------------------

View File

@ -2,6 +2,21 @@
" Maintainer: Gregory Anders
" Last Change: 2024-09-03
" Based on: https://github.com/hashivim/vim-terraform
" License: ISC
"
" Copyright (c) 2014-2016 Mark Cornick <mark@markcornick.com>
"
" Permission to use, copy, modify, and/or distribute this software for any purpose
" with or without fee is hereby granted, provided that the above copyright notice
" and this permission notice appear in all copies.
"
" THE SOFTWARE IS PROVIDED 'AS IS' AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
" FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
" OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
" TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
" THIS SOFTWARE.
function! hcl#indentexpr(lnum)
" Beginning of the file should have no indent

View File

@ -0,0 +1,192 @@
" HTML folding script, :h ft-html-plugin
" Latest Change: 2025 May 10
" Original Author: Aliaksei Budavei <0x000c70@gmail.com>
function! htmlfold#MapBalancedTags() abort
" Describe only _a capturable-name prefix_ for start and end patterns of
" a tag so that start tags with attributes spanning across lines can also be
" matched with a single call of "getline()".
let tag = '\m\c</\=\([0-9A-Za-z-]\+\)'
let names = []
let pairs = []
let ends = []
let pos = getpos('.')
try
call cursor(1, 1)
let [lnum, cnum] = searchpos(tag, 'cnW')
" Pair up nearest non-inlined tags in scope.
while lnum > 0
let name_attr = synIDattr(synID(lnum, cnum, 0), 'name')
if name_attr ==# 'htmlTag' || name_attr ==# 'htmlScriptTag'
let name = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '')
if !empty(name)
call insert(names, tolower(name), 0)
call insert(pairs, [lnum, -1], 0)
endif
elseif name_attr ==# 'htmlEndTag'
let name = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '')
if !empty(name)
let idx = index(names, tolower(name))
if idx >= 0
" Dismiss inlined balanced tags and opened-only tags.
if pairs[idx][0] != lnum
let pairs[idx][1] = lnum
call add(ends, lnum)
endif
" Claim a pair.
let names[: idx] = repeat([''], (idx + 1))
endif
endif
endif
" Advance the cursor, at "<", past "</a", "<a>", etc.
call cursor(lnum, (cnum + 3))
let [lnum, cnum] = searchpos(tag, 'cnW')
endwhile
finally
call setpos('.', pos)
endtry
if empty(ends)
return {}
endif
let folds = {}
let pending_end = ends[0]
let level = 0
while !empty(pairs)
let [start, end] = remove(pairs, -1)
if end < 0
continue
endif
if start >= pending_end
" Mark a sibling tag.
call remove(ends, 0)
while start >= ends[0]
" Mark a parent tag.
call remove(ends, 0)
let level -= 1
endwhile
let pending_end = ends[0]
else
" Mark a child tag.
let level += 1
endif
" Flatten the innermost inlined folds.
let folds[start] = get(folds, start, ('>' . level))
let folds[end] = get(folds, end, ('<' . level))
endwhile
return folds
endfunction
" See ":help vim9-mix".
if !has("vim9script")
finish
endif
def! g:htmlfold#MapBalancedTags(): dict<string>
# Describe only _a capturable-name prefix_ for start and end patterns of
# a tag so that start tags with attributes spanning across lines can also be
# matched with a single call of "getline()".
const tag: string = '\m\c</\=\([0-9A-Za-z-]\+\)'
var names: list<string> = []
var pairs: list<list<number>> = []
var ends: list<number> = []
const pos: list<number> = getpos('.')
try
cursor(1, 1)
var [lnum: number, cnum: number] = searchpos(tag, 'cnW')
# Pair up nearest non-inlined tags in scope.
while lnum > 0
const name_attr: string = synIDattr(synID(lnum, cnum, 0), 'name')
if name_attr ==# 'htmlTag' || name_attr ==# 'htmlScriptTag'
const name: string = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '')
if !empty(name)
insert(names, tolower(name), 0)
insert(pairs, [lnum, -1], 0)
endif
elseif name_attr ==# 'htmlEndTag'
const name: string = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '')
if !empty(name)
const idx: number = index(names, tolower(name))
if idx >= 0
# Dismiss inlined balanced tags and opened-only tags.
if pairs[idx][0] != lnum
pairs[idx][1] = lnum
add(ends, lnum)
endif
# Claim a pair.
names[: idx] = repeat([''], (idx + 1))
endif
endif
endif
# Advance the cursor, at "<", past "</a", "<a>", etc.
cursor(lnum, (cnum + 3))
[lnum, cnum] = searchpos(tag, 'cnW')
endwhile
finally
setpos('.', pos)
endtry
if empty(ends)
return {}
endif
var folds: dict<string> = {}
var pending_end: number = ends[0]
var level: number = 0
while !empty(pairs)
const [start: number, end: number] = remove(pairs, -1)
if end < 0
continue
endif
if start >= pending_end
# Mark a sibling tag.
remove(ends, 0)
while start >= ends[0]
# Mark a parent tag.
remove(ends, 0)
level -= 1
endwhile
pending_end = ends[0]
else
# Mark a child tag.
level += 1
endif
# Flatten the innermost inlined folds.
folds[start] = get(folds, start, ('>' .. level))
folds[end] = get(folds, end, ('<' .. level))
endwhile
return folds
enddef
" vim: fdm=syntax sw=2 ts=8 noet

View File

@ -20,10 +20,12 @@ let g:python_indent = extend(get(g:, 'python_indent', {}), #{
let s:maxoff = 50 " maximum number of lines to look backwards for ()
function s:SearchBracket(fromlnum, flags)
" VIM_INDENT_TEST_TRACE_START
return searchpairpos('[[({]', '', '[])}]', a:flags,
\ {-> synstack('.', col('.'))
\ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\|String\)$'}) >= 0},
\ [0, a:fromlnum - s:maxoff]->max(), g:python_indent.searchpair_timeout)
" VIM_INDENT_TEST_TRACE_END python#s:SearchBracket
endfunction
" See if the specified line is already user-dedented from the expected value.

View File

@ -1,5 +1,6 @@
" Author: Stephen Sugden <stephen@stephensugden.com>
" Last Modified: 2023-09-11
" Last Change: 2025 Mar 31 by Vim project (rename s:RustfmtConfigOptions())
"
" Adapted from https://github.com/fatih/vim-go
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
@ -61,7 +62,7 @@ function! s:RustfmtWriteMode()
endif
endfunction
function! s:RustfmtConfigOptions()
function! rustfmt#RustfmtConfigOptions()
let l:rustfmt_toml = findfile('rustfmt.toml', expand('%:p:h') . ';')
if l:rustfmt_toml !=# ''
return '--config-path '.shellescape(fnamemodify(l:rustfmt_toml, ":p"))
@ -84,7 +85,7 @@ function! s:RustfmtCommandRange(filename, line1, line2)
let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]}
let l:write_mode = s:RustfmtWriteMode()
let l:rustfmt_config = s:RustfmtConfigOptions()
let l:rustfmt_config = rustfmt#RustfmtConfigOptions()
" FIXME: When --file-lines gets to be stable, add version range checking
" accordingly.
@ -99,7 +100,7 @@ endfunction
function! s:RustfmtCommand()
let write_mode = g:rustfmt_emit_files ? '--emit=stdout' : '--write-mode=display'
let config = s:RustfmtConfigOptions()
let config = rustfmt#RustfmtConfigOptions()
return join([g:rustfmt_command, write_mode, config, g:rustfmt_options])
endfunction

View File

@ -1,9 +1,22 @@
" tar.vim: Handles browsing tarfiles - AUTOLOAD PORTION
" Date: Feb 06, 2025
" Date: Mar 01, 2025
" Version: 32b (with modifications from the Vim Project)
" Maintainer: This runtime file is looking for a new maintainer.
" Former Maintainer: Charles E Campbell
" License: Vim License (see vim's :help license)
" Last Change:
" 2024 Jan 08 by Vim Project: fix a few problems (#138331, #12637, #8109)
" 2024 Feb 19 by Vim Project: announce adoption
" 2024 Nov 11 by Vim Project: support permissions (#7379)
" 2025 Feb 06 by Vim Project: add support for lz4 (#16591)
" 2025 Feb 28 by Vim Project: add support for bzip3 (#16755)
" 2025 Mar 01 by Vim Project: fix syntax error in tar#Read()
" 2025 Mar 02 by Vim Project: escape the filename before using :read
" 2025 Mar 02 by Vim Project: determine the compression using readblob()
" instead of shelling out to file(1)
" 2025 Apr 16 by Vim Project: decouple from netrw by adding s:WinPath()
" 2025 May 19 by Vim Project: restore working directory after read/write
" 2025 Jul 13 by Vim Project: warn with path traversal attacks
"
" Contains many ideas from Michael Toren's <tar.vim>
"
@ -22,9 +35,9 @@ if &cp || exists("g:loaded_tar")
finish
endif
let g:loaded_tar= "v32b"
if v:version < 702
if v:version < 900
echohl WarningMsg
echo "***warning*** this version of tar needs vim 7.2"
echo "***warning*** this version of tar needs vim 9.0"
echohl Normal
finish
endif
@ -34,10 +47,10 @@ set cpo&vim
" ---------------------------------------------------------------------
" Default Settings: {{{1
if !exists("g:tar_browseoptions")
let g:tar_browseoptions= "Ptf"
let g:tar_browseoptions= "tf"
endif
if !exists("g:tar_readoptions")
let g:tar_readoptions= "pPxf"
let g:tar_readoptions= "pxf"
endif
if !exists("g:tar_cmd")
let g:tar_cmd= "tar"
@ -46,6 +59,7 @@ if !exists("g:tar_writeoptions")
let g:tar_writeoptions= "uf"
endif
if !exists("g:tar_delfile")
" Note: not supported on BSD
let g:tar_delfile="--delete -f"
endif
if !exists("g:netrw_cygwin")
@ -94,10 +108,26 @@ if !exists("g:tar_shq")
endif
endif
let g:tar_secure=' -- '
let g:tar_leading_pat='^\%([.]\{,2\}/\)\+'
" ----------------
" Functions: {{{1
" ----------------
" ---------------------------------------------------------------------
" s:Msg: {{{2
fun! s:Msg(func, severity, msg)
redraw!
if a:severity =~? 'error'
echohl Error
else
echohl WarningMsg
endif
echo $"***{a:severity}*** ({a:func}) {a:msg}"
echohl None
endfunc
" ---------------------------------------------------------------------
" tar#Browse: {{{2
fun! tar#Browse(tarfile)
@ -106,16 +136,14 @@ fun! tar#Browse(tarfile)
" sanity checks
if !executable(g:tar_cmd)
redraw!
echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system'
call s:Msg('tar#Browse', 'error', $"{g:tar_cmd} not available on your system")
let &report= repkeep
return
endif
if !filereadable(a:tarfile)
if a:tarfile !~# '^\a\+://'
" if it's an url, don't complain, let url-handlers such as vim do its thing
redraw!
echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None
call s:Msg('tar#Browse', 'error', $"File not readable<{a:tarfile}>")
endif
let &report= repkeep
return
@ -136,7 +164,7 @@ fun! tar#Browse(tarfile)
let lastline= line("$")
call setline(lastline+1,'" tar.vim version '.g:loaded_tar)
call setline(lastline+2,'" Browsing tarfile '.a:tarfile)
call setline(lastline+3,'" Select a file with cursor and press ENTER')
call setline(lastline+3,'" Select a file with cursor and press ENTER, "x" to extract a file')
keepj $put =''
keepj sil! 0d
keepj $
@ -153,21 +181,19 @@ fun! tar#Browse(tarfile)
elseif tarfile =~# '\.\(tgz\)$' || tarfile =~# '\.\(tbz\)$' || tarfile =~# '\.\(txz\)$' ||
\ tarfile =~# '\.\(tzst\)$' || tarfile =~# '\.\(tlz4\)$'
if has("unix") && executable("file")
let filekind= system("file ".shellescape(tarfile,1))
else
let filekind= ""
endif
let header= s:Header(tarfile)
if filekind =~ "bzip2"
if header =~? 'bzip2'
exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif filekind =~ "XZ"
elseif header =~? 'bzip3'
exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif header =~? 'xz'
exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif filekind =~ "Zstandard"
elseif header =~? 'zstd'
exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif filekind =~ "LZ4"
elseif header =~? 'lz4'
exe "sil! r! lz4 --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
else
elseif header =~? 'gzip'
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
endif
@ -175,6 +201,8 @@ fun! tar#Browse(tarfile)
exe "sil! r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - "
elseif tarfile =~# '\.\(bz2\|tbz\|tb2\)$'
exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif tarfile =~# '\.\(bz3\|tb3\)$'
exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif tarfile =~# '\.\(lzma\|tlz\)$'
exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif tarfile =~# '\.\(xz\|txz\)$'
@ -191,28 +219,18 @@ fun! tar#Browse(tarfile)
exe "sil! r! ".g:tar_cmd." -".g:tar_browseoptions." ".shellescape(tarfile,1)
endif
if v:shell_error != 0
redraw!
echohl WarningMsg | echo "***warning*** (tar#Browse) please check your g:tar_browseoptions<".g:tar_browseoptions.">"
call s:Msg('tar#Browse', 'warning', $"please check your g:tar_browseoptions '<{g:tar_browseoptions}>'")
return
endif
"
" The following should not be neccessary, since in case of errors the
" previous if statement should have caught the problem (because tar exited
" with a non-zero exit code).
" if line("$") == curlast || ( line("$") == (curlast + 1) &&
" \ getline("$") =~# '\c\<\%(warning\|error\|inappropriate\|unrecognized\)\>' &&
" \ getline("$") =~ '\s' )
" redraw!
" echohl WarningMsg | echo "***warning*** (tar#Browse) ".a:tarfile." doesn't appear to be a tar file" | echohl None
" keepj sil! %d
" let eikeep= &ei
" set ei=BufReadCmd,FileReadCmd
" exe "r ".fnameescape(a:tarfile)
" let &ei= eikeep
" keepj sil! 1d
" call Dret("tar#Browse : a:tarfile<".a:tarfile.">")
" return
" endif
" remove tar: Removing leading '/' from member names
" Note: the message could be localized
if search('^tar: ') > 0 || search(g:tar_leading_pat) > 0
call append(3,'" Note: Path Traversal Attack detected!')
let b:leading_slash = 1
" remove the message output
sil g/^tar: /d
endif
" set up maps supported for tar
setlocal noma nomod ro
@ -231,12 +249,7 @@ fun! s:TarBrowseSelect()
let repkeep= &report
set report=10
let fname= getline(".")
if !exists("g:tar_secure") && fname =~ '^\s*-\|\s\+-'
redraw!
echohl WarningMsg | echo '***warning*** (tar#BrowseSelect) rejecting tarfile member<'.fname.'> because of embedded "-"'
return
endif
let ls= get(b:, 'leading_slash', 0)
" sanity check
if fname =~ '^"'
@ -258,7 +271,8 @@ fun! s:TarBrowseSelect()
wincmd _
endif
let s:tblfile_{winnr()}= curfile
call tar#Read("tarfile:".tarfile.'::'.fname,1)
let b:leading_slash= ls
call tar#Read("tarfile:".tarfile.'::'.fname)
filetype detect
set nomod
exe 'com! -buffer -nargs=? -complete=file TarDiff :call tar#Diff(<q-args>,"'.fnameescape(fname).'")'
@ -268,24 +282,18 @@ endfun
" ---------------------------------------------------------------------
" tar#Read: {{{2
fun! tar#Read(fname,mode)
fun! tar#Read(fname)
let repkeep= &report
set report=10
let tarfile = substitute(a:fname,'tarfile:\(.\{-}\)::.*$','\1','')
let fname = substitute(a:fname,'tarfile:.\{-}::\(.*\)$','\1','')
" changing the directory to the temporary earlier to allow tar to extract the file with permissions intact
if !exists("*mkdir")
redraw!
echohl Error | echo "***error*** (tar#Write) sorry, mkdir() doesn't work on your system" | echohl None
let &report= repkeep
return
endif
" be careful not to execute special crafted files
let escape_file = fname->substitute(g:tar_leading_pat, '', '')->fnameescape()
let curdir= getcwd()
let b:curdir= curdir
let tmpdir= tempname()
let b:curdir= tmpdir
let b:tmpdir= curdir
let b:tmpdir= tmpdir
if tmpdir =~ '\.'
let tmpdir= substitute(tmpdir,'\.[^.]*$','','e')
endif
@ -293,10 +301,9 @@ fun! tar#Read(fname,mode)
" attempt to change to the indicated directory
try
exe "cd ".fnameescape(tmpdir)
exe "lcd ".fnameescape(tmpdir)
catch /^Vim\%((\a\+)\)\=:E344/
redraw!
echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None
call s:Msg('tar#Read', 'error', "cannot lcd to temporary directory")
let &report= repkeep
return
endtry
@ -306,7 +313,7 @@ fun! tar#Read(fname,mode)
call s:Rmdir("_ZIPVIM_")
endif
call mkdir("_ZIPVIM_")
cd _ZIPVIM_
lcd _ZIPVIM_
if has("win32unix") && executable("cygpath")
" assuming cygwin
@ -316,7 +323,10 @@ fun! tar#Read(fname,mode)
if fname =~ '\.bz2$' && executable("bzcat")
let decmp= "|bzcat"
let doro = 1
elseif fname =~ '\.t\=gz$' && executable("zcat")
elseif fname =~ '\.bz3$' && executable("bz3cat")
let decmp= "|bz3cat"
let doro = 1
elseif fname =~ '\.t\=gz$' && executable("zcat")
let decmp= "|zcat"
let doro = 1
elseif fname =~ '\.lzma$' && executable("lzcat")
@ -334,71 +344,71 @@ fun! tar#Read(fname,mode)
else
let decmp=""
let doro = 0
if fname =~ '\.bz2$\|\.gz$\|\.lzma$\|\.xz$\|\.zip$\|\.Z$'
if fname =~ '\.bz2$\|\.bz3$\|\.gz$\|\.lzma$\|\.xz$\|\.zip$\|\.Z$'
setlocal bin
endif
endif
if exists("g:tar_secure")
let tar_secure= " -- "
else
let tar_secure= " "
endif
if tarfile =~# '\.bz2$'
exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp
exe "read ".escape_file
elseif tarfile =~# '\.bz3$'
exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp
exe "read ".escape_file
elseif tarfile =~# '\.\(gz\)$'
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp
exe "read ".escape_file
elseif tarfile =~# '\(\.tgz\|\.tbz\|\.txz\)'
if has("unix") && executable("file")
let filekind= system("file ".shellescape(tarfile,1))
else
let filekind= ""
endif
if filekind =~ "bzip2"
exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
elseif filekind =~ "XZ"
exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
elseif filekind =~ "Zstandard"
exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
else
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
let filekind= s:Header(tarfile)
if filekind =~? "bzip2"
exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp
exe "read ".escape_file
elseif filekind =~ "bzip3"
exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp
exe "read ".escape_file
elseif filekind =~? "xz"
exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp
exe "read ".escape_file
elseif filekind =~? "zstd"
exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp
exe "read ".escape_file
elseif filekind =~? "gzip"
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp
exe "read ".escape_file
endif
elseif tarfile =~# '\.lrp$'
exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp
exe "read ".escape_file
elseif tarfile =~# '\.lzma$'
exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp
exe "read ".escape_file
elseif tarfile =~# '\.\(xz\|txz\)$'
exe "sil! r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
exe "sil! r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp
exe "read ".escape_file
elseif tarfile =~# '\.\(lz4\|tlz4\)$'
exe "sil! r! lz4 --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
exe "sil! r! lz4 --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp
exe "read ".escape_file
else
if tarfile =~ '^\s*-'
" A file name starting with a dash is taken as an option. Prepend ./ to avoid that.
let tarfile = substitute(tarfile, '-', './-', '')
endif
exe "silent r! ".g:tar_cmd." -".g:tar_readoptions.shellescape(tarfile,1)." ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
exe "silent r! ".g:tar_cmd." -".g:tar_readoptions.shellescape(tarfile,1)." ".g:tar_secure.shellescape(fname,1).decmp
exe "read ".escape_file
endif
if get(b:, 'leading_slash', 0)
sil g/^tar: /d
endif
redraw!
if v:shell_error != 0
cd ..
if v:shell_error != 0
lcd ..
call s:Rmdir("_ZIPVIM_")
exe "cd ".fnameescape(curdir)
echohl Error | echo "***error*** (tar#Read) sorry, unable to open or extract ".tarfile." with ".fname | echohl None
exe "lcd ".fnameescape(curdir)
call s:Msg('tar#Read', 'error', $"sorry, unable to open or extract {tarfile} with {fname}")
endif
if doro
@ -407,45 +417,63 @@ if v:shell_error != 0
endif
let b:tarfile= a:fname
exe "file tarfile::".fnameescape(fname)
" cleanup
keepj sil! 0d
set nomod
let &report= repkeep
exe "lcd ".fnameescape(curdir)
silent exe "file tarfile::". fname->fnameescape()
endfun
" ---------------------------------------------------------------------
" tar#Write: {{{2
fun! tar#Write(fname)
let pwdkeep= getcwd()
let repkeep= &report
set report=10
" temporary buffer variable workaround because too fucking tired. but it works now
let curdir= b:curdir
let tmpdir= b:tmpdir
if !exists("g:tar_secure") && a:fname =~ '^\s*-\|\s\+-'
redraw!
echohl WarningMsg | echo '***warning*** (tar#Write) rejecting tarfile member<'.a:fname.'> because of embedded "-"'
return
endif
" sanity checks
if !executable(g:tar_cmd)
redraw!
let &report= repkeep
return
endif
let tarfile = substitute(b:tarfile,'tarfile:\(.\{-}\)::.*$','\1','')
let fname = substitute(b:tarfile,'tarfile:.\{-}::\(.*\)$','\1','')
if get(b:, 'leading_slash', 0)
call s:Msg('tar#Write', 'error', $"sorry, not attempting to update {tarfile} with {fname}")
let &report= repkeep
return
endif
if !isdirectory(fnameescape(tmpdir))
call mkdir(fnameescape(tmpdir), 'p')
endif
exe $"lcd {fnameescape(tmpdir)}"
if isdirectory("_ZIPVIM_")
call s:Rmdir("_ZIPVIM_")
endif
call mkdir("_ZIPVIM_")
lcd _ZIPVIM_
let dir = fnamemodify(fname, ':p:h')
if dir !~# '_ZIPVIM_$'
call mkdir(dir)
endif
" handle compressed archives
if tarfile =~# '\.bz2'
call system("bzip2 -d -- ".shellescape(tarfile,0))
let tarfile = substitute(tarfile,'\.bz2','','e')
let compress= "bzip2 -- ".shellescape(tarfile,0)
elseif tarfile =~# '\.bz3'
call system("bzip3 -d -- ".shellescape(tarfile,0))
let tarfile = substitute(tarfile,'\.bz3','','e')
let compress= "bzip3 -- ".shellescape(tarfile,0)
elseif tarfile =~# '\.gz'
call system("gzip -d -- ".shellescape(tarfile,0))
let tarfile = substitute(tarfile,'\.gz','','e')
@ -472,10 +500,10 @@ fun! tar#Write(fname)
let tarfile = substitute(tarfile,'\.lzma','','e')
let compress= "lzma -- ".shellescape(tarfile,0)
endif
" Note: no support for name.tar.tbz/.txz/.tgz/.tlz4/.tzst
if v:shell_error != 0
redraw!
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname | echohl None
call s:Msg('tar#Write', 'error', $"sorry, unable to update {tarfile} with {fname}")
else
if fname =~ '/'
@ -493,28 +521,22 @@ fun! tar#Write(fname)
let tarfile = substitute(tarfile, '-', './-', '')
endif
if exists("g:tar_secure")
let tar_secure= " -- "
else
let tar_secure= " "
endif
exe "w! ".fnameescape(fname)
" don't overwrite a file forcefully
exe "w ".fnameescape(fname)
if has("win32unix") && executable("cygpath")
let tarfile = substitute(system("cygpath ".shellescape(tarfile,0)),'\n','','e')
endif
" delete old file from tarfile
call system(g:tar_cmd." ".g:tar_delfile." ".shellescape(tarfile,0).tar_secure.shellescape(fname,0))
" Note: BSD tar does not support --delete flag
call system(g:tar_cmd." ".g:tar_delfile." ".shellescape(tarfile,0).g:tar_secure.shellescape(fname,0))
if v:shell_error != 0
redraw!
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None
call s:Msg('tar#Write', 'error', $"sorry, unable to update {fnameescape(tarfile)} with {fnameescape(fname)} --delete not supported?")
else
" update tarfile with new file
call system(g:tar_cmd." -".g:tar_writeoptions." ".shellescape(tarfile,0).tar_secure.shellescape(fname,0))
call system(g:tar_cmd." -".g:tar_writeoptions." ".shellescape(tarfile,0).g:tar_secure.shellescape(fname,0))
if v:shell_error != 0
redraw!
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None
call s:Msg('tar#Write', 'error', $"sorry, unable to update {fnameescape(tarfile)} with {fnameescape(fname)}")
elseif exists("compress")
call system(compress)
if exists("tgz")
@ -540,9 +562,9 @@ fun! tar#Write(fname)
endif
" cleanup and restore current directory
cd ..
lcd ..
call s:Rmdir("_ZIPVIM_")
exe "cd ".fnameescape(curdir)
exe "lcd ".fnameescape(pwdkeep)
setlocal nomod
let &report= repkeep
@ -555,6 +577,7 @@ fun! tar#Diff(userfname,fname)
if a:userfname != ""
let fname= a:userfname
endif
exe "lcd ".fnameescape(b:tmpdir). '/_ZIPVIM_'
if filereadable(fname)
" sets current file (from tarball) for diff'ing
" splits window vertically
@ -578,12 +601,6 @@ fun! tar#Extract()
set report=10
let fname= getline(".")
if !exists("g:tar_secure") && fname =~ '^\s*-\|\s\+-'
redraw!
echohl WarningMsg | echo '***warning*** (tar#BrowseSelect) rejecting tarfile member<'.fname.'> because of embedded "-"'
return
endif
" sanity check
if fname =~ '^"'
let &report= repkeep
@ -593,20 +610,20 @@ fun! tar#Extract()
let tarball = expand("%")
let tarbase = substitute(tarball,'\..*$','','')
let extractcmd= netrw#WinPath(g:tar_extractcmd)
let extractcmd= s:WinPath(g:tar_extractcmd)
if filereadable(tarbase.".tar")
call system(extractcmd." ".shellescape(tarbase).".tar ".shellescape(fname))
if v:shell_error != 0
echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar ".fname.": failed!" | echohl NONE
call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tar {fname}: failed!")
else
echo "***note*** successfully extracted ".fname
echo "***note*** successfully extracted ". fname
endif
elseif filereadable(tarbase.".tgz")
let extractcmd= substitute(extractcmd,"-","-z","")
call system(extractcmd." ".shellescape(tarbase).".tgz ".shellescape(fname))
if v:shell_error != 0
echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tgz ".fname.": failed!" | echohl NONE
call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tgz {fname}: failed!")
else
echo "***note*** successfully extracted ".fname
endif
@ -615,7 +632,7 @@ fun! tar#Extract()
let extractcmd= substitute(extractcmd,"-","-z","")
call system(extractcmd." ".shellescape(tarbase).".tar.gz ".shellescape(fname))
if v:shell_error != 0
echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar.gz ".fname.": failed!" | echohl NONE
call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tar.gz {fname}: failed!")
else
echo "***note*** successfully extracted ".fname
endif
@ -624,7 +641,7 @@ fun! tar#Extract()
let extractcmd= substitute(extractcmd,"-","-j","")
call system(extractcmd." ".shellescape(tarbase).".tbz ".shellescape(fname))
if v:shell_error != 0
echohl Error | echo "***error*** ".extractcmd."j ".tarbase.".tbz ".fname.": failed!" | echohl NONE
call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tbz {fname}: failed!")
else
echo "***note*** successfully extracted ".fname
endif
@ -633,7 +650,16 @@ fun! tar#Extract()
let extractcmd= substitute(extractcmd,"-","-j","")
call system(extractcmd." ".shellescape(tarbase).".tar.bz2 ".shellescape(fname))
if v:shell_error != 0
echohl Error | echo "***error*** ".extractcmd."j ".tarbase.".tar.bz2 ".fname.": failed!" | echohl NONE
call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tar.bz2 {fname}: failed!")
else
echo "***note*** successfully extracted ".fname
endif
elseif filereadable(tarbase.".tar.bz3")
let extractcmd= substitute(extractcmd,"-","-j","")
call system(extractcmd." ".shellescape(tarbase).".tar.bz3 ".shellescape(fname))
if v:shell_error != 0
call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tar.bz3 {fname}: failed!")
else
echo "***note*** successfully extracted ".fname
endif
@ -642,7 +668,7 @@ fun! tar#Extract()
let extractcmd= substitute(extractcmd,"-","-J","")
call system(extractcmd." ".shellescape(tarbase).".txz ".shellescape(fname))
if v:shell_error != 0
echohl Error | echo "***error*** ".extractcmd." ".tarbase.".txz ".fname.": failed!" | echohl NONE
call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.txz {fname}: failed!")
else
echo "***note*** successfully extracted ".fname
endif
@ -651,7 +677,7 @@ fun! tar#Extract()
let extractcmd= substitute(extractcmd,"-","-J","")
call system(extractcmd." ".shellescape(tarbase).".tar.xz ".shellescape(fname))
if v:shell_error != 0
echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar.xz ".fname.": failed!" | echohl NONE
call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tar.xz {fname}: failed!")
else
echo "***note*** successfully extracted ".fname
endif
@ -660,7 +686,7 @@ fun! tar#Extract()
let extractcmd= substitute(extractcmd,"-","--zstd","")
call system(extractcmd." ".shellescape(tarbase).".tzst ".shellescape(fname))
if v:shell_error != 0
echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tzst ".fname.": failed!" | echohl NONE
call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tzst {fname}: failed!")
else
echo "***note*** successfully extracted ".fname
endif
@ -669,7 +695,7 @@ fun! tar#Extract()
let extractcmd= substitute(extractcmd,"-","--zstd","")
call system(extractcmd." ".shellescape(tarbase).".tar.zst ".shellescape(fname))
if v:shell_error != 0
echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar.zst ".fname.": failed!" | echohl NONE
call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tar.zst {fname}: failed!")
else
echo "***note*** successfully extracted ".fname
endif
@ -678,7 +704,7 @@ fun! tar#Extract()
let extractcmd= substitute(extractcmd,"-","-I lz4","")
call system(extractcmd." ".shellescape(tarbase).".tlz4 ".shellescape(fname))
if v:shell_error != 0
echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tlz4 ".fname.": failed!" | echohl NONE
call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tlz4 {fname}: failed!")
else
echo "***note*** successfully extracted ".fname
endif
@ -687,7 +713,7 @@ fun! tar#Extract()
let extractcmd= substitute(extractcmd,"-","-I lz4","")
call system(extractcmd." ".shellescape(tarbase).".tar.lz4".shellescape(fname))
if v:shell_error != 0
echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar.lz4 ".fname.": failed!" | echohl NONE
call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tar.lz4 {fname}: failed!")
else
echo "***note*** successfully extracted ".fname
endif
@ -700,15 +726,49 @@ endfun
" ---------------------------------------------------------------------
" s:Rmdir: {{{2
fun! s:Rmdir(fname)
if has("unix")
call system("/bin/rm -rf -- ".shellescape(a:fname,0))
elseif has("win32") || has("win95") || has("win64") || has("win16")
if &shell =~? "sh$"
call system("/bin/rm -rf -- ".shellescape(a:fname,0))
else
call system("del /S ".shellescape(a:fname,0))
endif
call delete(a:fname, 'rf')
endfun
" s:FileHeader: {{{2
fun! s:Header(fname)
let header= readblob(a:fname, 0, 6)
if header[0:2] == str2blob(['BZh']) " bzip2 header
return "bzip2"
elseif header[0:2] == str2blob(['BZ3']) " bzip3 header
return "bzip3"
elseif header == str2blob(["\3757zXZ\n"]) " xz header
return "xz"
elseif header[0:3] == str2blob(["\x28\xB5\x2F\xFD"]) " zstd header
return "zstd"
elseif header[0:3] == str2blob(["\004\"M\030"]) " lz4 header
return "lz4"
elseif (header[0:1] == str2blob(["\037\235"]) ||
\ header[0:1] == str2blob(["\037\213"]) ||
\ header[0:1] == str2blob(["\037\236"]) ||
\ header[0:1] == str2blob(["\037\240"]) ||
\ header[0:1] == str2blob(["\037\036"]))
return "gzip"
endif
return "unknown"
endfun
" ---------------------------------------------------------------------
" s:WinPath: {{{2
fun! s:WinPath(path)
if (!g:netrw_cygwin || &shell !~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$') && has("win32")
" remove cygdrive prefix, if present
let path = substitute(a:path, '/cygdrive/\(.\)', '\1:', '')
" remove trailing slash (Win95)
let path = substitute(path, '\(\\\|/\)$', '', 'g')
" remove escaped spaces
let path = substitute(path, '\ ', ' ', 'g')
" convert slashes to backslashes
let path = substitute(path, '/', '\', 'g')
else
let path = a:path
endif
return path
endfun
" ---------------------------------------------------------------------
@ -732,8 +792,8 @@ fun! tar#Vimuntar(...)
if simplify(curdir) != simplify(vimhome)
" copy (possibly compressed) tarball to .vim/vimfiles
call system(netrw#WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome))
exe "cd ".fnameescape(vimhome)
call system(s:WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome))
exe "lcd ".fnameescape(vimhome)
endif
" if necessary, decompress the tarball; then, extract it
@ -747,14 +807,14 @@ fun! tar#Vimuntar(...)
if simplify(curdir) != simplify(tarhome)
" remove decompressed tarball, restore directory
call delete(tartail.".tar")
exe "cd ".fnameescape(curdir)
exe "lcd ".fnameescape(curdir)
endif
return
endif
else
call vimball#Decompress(tartail,0)
endif
let extractcmd= netrw#WinPath(g:tar_extractcmd)
let extractcmd= s:WinPath(g:tar_extractcmd)
call system(extractcmd." ".shellescape(tarbase.".tar"))
" set up help
@ -765,7 +825,7 @@ fun! tar#Vimuntar(...)
if simplify(tarhome) != simplify(vimhome)
" remove decompressed tarball, restore directory
call delete(vimhome."/".tarbase.".tar")
exe "cd ".fnameescape(curdir)
exe "lcd ".fnameescape(curdir)
endif
endfun

View File

@ -157,12 +157,14 @@ function! s:Sort(a, b)
return retval
endfunction
function! s:GlobTutorials(name)
" returns a list of all tutor files matching the given name
function! tutor#GlobTutorials(name, locale)
let locale = a:locale
" search for tutorials:
" 1. non-localized
let l:tutors = s:GlobPath(&rtp, 'tutor/'.a:name.'.tutor')
" 2. localized for current locale
let l:locale_tutors = s:GlobPath(&rtp, 'tutor/'.s:Locale()[0].'/'.a:name.'.tutor')
let l:locale_tutors = s:GlobPath(&rtp, 'tutor/'.locale.'/'.a:name.'.tutor')
" 3. fallback to 'en'
if len(l:locale_tutors) == 0
let l:locale_tutors = s:GlobPath(&rtp, 'tutor/en/'.a:name.'.tutor')
@ -187,7 +189,7 @@ function! tutor#TutorCmd(tutor_name)
let l:tutor_name = fnamemodify(l:tutor_name, ':r')
endif
let l:tutors = s:GlobTutorials(l:tutor_name)
let l:tutors = tutor#GlobTutorials(l:tutor_name, s:Locale()[0])
if len(l:tutors) == 0
echom "No tutorial with that name found"
@ -210,10 +212,32 @@ function! tutor#TutorCmd(tutor_name)
call tutor#SetupVim()
exe "edit ".l:to_open
call tutor#EnableInteractive(v:true)
endfunction
function! tutor#TutorCmdComplete(lead,line,pos)
let l:tutors = s:GlobTutorials('*')
let l:tutors = tutor#GlobTutorials('*', s:Locale()[0])
let l:names = uniq(sort(map(l:tutors, 'fnamemodify(v:val, ":t:r")'), 's:Sort'))
return join(l:names, "\n")
endfunction
" Enables/disables interactive mode.
function! tutor#EnableInteractive(enable)
let enable = a:enable
if enable
setlocal buftype=nofile
setlocal concealcursor+=inv
setlocal conceallevel=2
call tutor#ApplyMarks()
augroup tutor_interactive
autocmd! TextChanged,TextChangedI <buffer> call tutor#ApplyMarksOnChanged()
augroup END
else
setlocal buftype<
setlocal concealcursor<
setlocal conceallevel<
if exists('#tutor_interactive')
autocmd! tutor_interactive * <buffer>
endif
endif
endfunction

View File

@ -2,8 +2,10 @@
" Maintainer: This runtime file is looking for a new maintainer.
" Original Author: Charles E. Campbell
" Date: Apr 11, 2016
" Version: 37
" Version: 37 (with modifications from the Vim Project)
" GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim
" Last Change:
" 2025 Feb 28 by Vim Project: add support for bzip3 (#16755)
" Copyright: (c) 2004-2011 by Charles E. Campbell
" The VIM LICENSE applies to Vimball.vim, and Vimball.txt
" (see |copyright|) except use "Vimball" instead of "Vim".
@ -530,6 +532,26 @@ fun! vimball#Decompress(fname,...)
exe "e ".escape(fname,' \')
if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
elseif expand("%") =~ '.*\.bz3' && executable("bunzip3")
" handle *.bz3 with bunzip3
silent exe "!bunzip3 ".shellescape(a:fname)
if v:shell_error != 0
call vimball#ShowMesg(s:WARNING,"(vimball#Decompress) bunzip3 may have failed with <".a:fname.">")
endif
let fname= substitute(a:fname,'\.bz3$','','')
exe "e ".escape(fname,' \')
if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
elseif expand("%") =~ '.*\.bz3' && executable("bzip3")
" handle *.bz3 with bzip3 -d
silent exe "!bzip3 -d ".shellescape(a:fname)
if v:shell_error != 0
call vimball#ShowMesg(s:WARNING,'(vimball#Decompress) "bzip3 -d" may have failed with <'.a:fname.">")
endif
let fname= substitute(a:fname,'\.bz3$','','')
exe "e ".escape(fname,' \')
if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
elseif expand("%") =~ '.*\.zip' && executable("unzip")
" handle *.zip with unzip
silent exe "!unzip ".shellescape(a:fname)

View File

@ -14,6 +14,8 @@
" 2024 Aug 05 by Vim Project: clean-up and make it work with shellslash on Windows
" 2024 Aug 18 by Vim Project: correctly handle special globbing chars
" 2024 Aug 21 by Vim Project: simplify condition to detect MS-Windows
" 2025 Mar 11 by Vim Project: handle filenames with leading '-' correctly
" 2025 Jul 12 by Vim Project: drop ../ on write to prevent path traversal attacks
" License: Vim License (see vim's :help license)
" Copyright: Copyright (C) 2005-2019 Charles E. Campbell {{{1
" Permission is hereby granted to use and distribute this code,
@ -235,59 +237,62 @@ endfun
" zip#Write: {{{2
fun! zip#Write(fname)
let dict = s:SetSaneOpts()
let need_rename = 0
defer s:RestoreOpts(dict)
" sanity checks
if !executable(substitute(g:zip_zipcmd,'\s\+.*$','',''))
call s:Mess('Error', "***error*** (zip#Write) sorry, your system doesn't appear to have the ".g:zip_zipcmd." program")
return
endif
if !exists("*mkdir")
call s:Mess('Error', "***error*** (zip#Write) sorry, mkdir() doesn't work on your system")
return
call s:Mess('Error', "***error*** (zip#Write) sorry, your system doesn't appear to have the ".g:zip_zipcmd." program")
return
endif
let curdir= getcwd()
let tmpdir= tempname()
if tmpdir =~ '\.'
let tmpdir= substitute(tmpdir,'\.[^.]*$','','e')
let tmpdir= substitute(tmpdir,'\.[^.]*$','','e')
endif
call mkdir(tmpdir,"p")
" attempt to change to the indicated directory
if s:ChgDir(tmpdir,s:ERROR,"(zip#Write) cannot cd to temporary directory")
return
return
endif
" place temporary files under .../_ZIPVIM_/
if isdirectory("_ZIPVIM_")
call delete("_ZIPVIM_", "rf")
call delete("_ZIPVIM_", "rf")
endif
call mkdir("_ZIPVIM_")
cd _ZIPVIM_
if has("unix")
let zipfile = substitute(a:fname,'zipfile://\(.\{-}\)::[^\\].*$','\1','')
let fname = substitute(a:fname,'zipfile://.\{-}::\([^\\].*\)$','\1','')
let zipfile = substitute(a:fname,'zipfile://\(.\{-}\)::[^\\].*$','\1','')
let fname = substitute(a:fname,'zipfile://.\{-}::\([^\\].*\)$','\1','')
else
let zipfile = substitute(a:fname,'^.\{-}zipfile://\(.\{-}\)::[^\\].*$','\1','')
let fname = substitute(a:fname,'^.\{-}zipfile://.\{-}::\([^\\].*\)$','\1','')
let zipfile = substitute(a:fname,'^.\{-}zipfile://\(.\{-}\)::[^\\].*$','\1','')
let fname = substitute(a:fname,'^.\{-}zipfile://.\{-}::\([^\\].*\)$','\1','')
endif
if fname =~ '^[.]\{1,2}/'
call system(g:zip_zipcmd." -d ".s:Escape(fnamemodify(zipfile,":p"),0)." ".s:Escape(fname,0))
let fname = fname->substitute('^\([.]\{1,2}/\)\+', '', 'g')
let need_rename = 1
endif
if fname =~ '/'
let dirpath = substitute(fname,'/[^/]\+$','','e')
if has("win32unix") && executable("cygpath")
let dirpath = substitute(fname,'/[^/]\+$','','e')
if has("win32unix") && executable("cygpath")
let dirpath = substitute(system("cygpath ".s:Escape(dirpath,0)),'\n','','e')
endif
call mkdir(dirpath,"p")
endif
call mkdir(dirpath,"p")
endif
if zipfile !~ '/'
let zipfile= curdir.'/'.zipfile
let zipfile= curdir.'/'.zipfile
endif
exe "w! ".fnameescape(fname)
" don't overwrite files forcefully
exe "w ".fnameescape(fname)
if has("win32unix") && executable("cygpath")
let zipfile = substitute(system("cygpath ".s:Escape(zipfile,0)),'\n','','e')
let zipfile = substitute(system("cygpath ".s:Escape(zipfile,0)),'\n','','e')
endif
if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$'
@ -296,21 +301,24 @@ fun! zip#Write(fname)
call system(g:zip_zipcmd." -u ".s:Escape(fnamemodify(zipfile,":p"),0)." ".s:Escape(fname,0))
if v:shell_error != 0
call s:Mess('Error', "***error*** (zip#Write) sorry, unable to update ".zipfile." with ".fname)
call s:Mess('Error', "***error*** (zip#Write) sorry, unable to update ".zipfile." with ".fname)
elseif s:zipfile_{winnr()} =~ '^\a\+://'
" support writing zipfiles across a network
let netzipfile= s:zipfile_{winnr()}
1split|enew
let binkeep= &binary
let eikeep = &ei
set binary ei=all
exe "noswapfile e! ".fnameescape(zipfile)
call netrw#NetWrite(netzipfile)
let &ei = eikeep
let &binary = binkeep
q!
unlet s:zipfile_{winnr()}
" support writing zipfiles across a network
let netzipfile= s:zipfile_{winnr()}
1split|enew
let binkeep= &binary
let eikeep = &ei
set binary ei=all
exe "noswapfile e! ".fnameescape(zipfile)
call netrw#NetWrite(netzipfile)
let &ei = eikeep
let &binary = binkeep
q!
unlet s:zipfile_{winnr()}
elseif need_rename
exe $"sil keepalt file {fnameescape($"zipfile://{zipfile}::{fname}")}"
call s:Mess('Warning', "***error*** (zip#Browse) Path Traversal Attack detected, dropping relative path")
endif
" cleanup and restore current directory
@ -319,7 +327,6 @@ fun! zip#Write(fname)
call s:ChgDir(curdir,s:WARNING,"(zip#Write) unable to return to ".curdir."!")
call delete(tmpdir, "rf")
setlocal nomod
endfun
" ---------------------------------------------------------------------
@ -332,17 +339,25 @@ fun! zip#Extract()
" sanity check
if fname =~ '^"'
return
return
endif
if fname =~ '/$'
call s:Mess('Error', "***error*** (zip#Extract) Please specify a file, not a directory")
return
call s:Mess('Error', "***error*** (zip#Extract) Please specify a file, not a directory")
return
elseif fname =~ '^[.]\?[.]/'
call s:Mess('Error', "***error*** (zip#Browse) Path Traversal Attack detected, not extracting!")
return
endif
if filereadable(fname)
call s:Mess('Error', "***error*** (zip#Extract) <" .. fname .."> already exists in directory, not overwriting!")
return
call s:Mess('Error', "***error*** (zip#Extract) <" .. fname .."> already exists in directory, not overwriting!")
return
endif
let target = fname->substitute('\[', '[[]', 'g')
" unzip 6.0 does not support -- to denote end-of-arguments
" unzip 6.1 (2010) apparently supports, it, but hasn't been released
" so the workaround is to use glob '[-]' so that it won't be considered an argument
" else, it would be possible to use 'unzip -o <file.zip> '-d/tmp' to extract the whole archive
let target = target->substitute('^-', '[&]', '')
if &shell =~ 'cmd' && has("win32")
let target = target
\ ->substitute('[?*]', '[&]', 'g')
@ -357,13 +372,12 @@ fun! zip#Extract()
" extract the file mentioned under the cursor
call system($"{g:zip_extractcmd} -o {shellescape(b:zipfile)} {target}")
if v:shell_error != 0
call s:Mess('Error', "***error*** ".g:zip_extractcmd." ".b:zipfile." ".fname.": failed!")
call s:Mess('Error', "***error*** ".g:zip_extractcmd." ".b:zipfile." ".fname.": failed!")
elseif !filereadable(fname)
call s:Mess('Error', "***error*** attempted to extract ".fname." but it doesn't appear to be present!")
call s:Mess('Error', "***error*** attempted to extract ".fname." but it doesn't appear to be present!")
else
echomsg "***note*** successfully extracted ".fname
echomsg "***note*** successfully extracted ".fname
endif
endfun
" ---------------------------------------------------------------------

View File

@ -6,6 +6,7 @@ vim9script
# Contributors: Enno Nagel
# Last Change: 2024 Mar 29
# 2024 Apr 03 by The Vim Project (removed :CompilerSet definition)
# 2025 Mar 11 by The Vim Project (add comment for Dispatch)
if exists("g:current_compiler")
finish
@ -15,6 +16,7 @@ import autoload '../autoload/context.vim'
g:current_compiler = 'context'
# CompilerSet makeprg=context
if get(b:, 'context_ignore_makefile', get(g:, 'context_ignore_makefile', 0)) ||
(!filereadable('Makefile') && !filereadable('makefile'))
var makeprg = join(context.ConTeXtCmd(shellescape(expand('%:p:t'))), ' ')

View File

@ -0,0 +1,25 @@
" Vim compiler file
" Language: Gleam
" Maintainer: Kirill Morozov <kirill@robotix.pro>
" Based On: https://github.com/gleam-lang/gleam.vim
" Last Change: 2025 Apr 21
if exists('current_compiler')
finish
endif
let current_compiler = "gleam_build"
CompilerSet makeprg=gleam\ build
" Example error message:
"
" error: Unknown variable
" ┌─ /home/michael/root/projects/tutorials/gleam/try/code/src/main.gleam:19:18
" │
" 19 │ Ok(tuple(name, spot))
" │ ^^^^ did you mean `sport`?
"
" The name `spot` is not in scope here.
CompilerSet errorformat=%Eerror:\ %m,%Wwarning:\ %m,%C\ %#┌─%#\ %f:%l:%c\ %#-%#
" vim: sw=2 sts=2 et

View File

@ -2,6 +2,7 @@
" Compiler: Java Development Kit Compiler
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2024 Nov 19 (enable local javac_makeprg_params)
" 2025 Mar 11 (add comment for Dispatch)
if exists("current_compiler")
finish
@ -11,6 +12,7 @@ let current_compiler = "javac"
let s:cpo_save = &cpo
set cpo&vim
" CompilerSet makeprg=javac
execute $'CompilerSet makeprg=javac\ {escape(get(b:, 'javac_makeprg_params', get(g:, 'javac_makeprg_params', '')), ' \|"')}'
CompilerSet errorformat=%E%f:%l:\ error:\ %m,

View File

@ -2,6 +2,7 @@
" Compiler: Pandoc
" Maintainer: Konfekt
" Last Change: 2024 Nov 19
" 2025 May 15 Update the title regex for CompilerSet #17321
"
" Expects output file extension, say `:make html` or `:make pdf`.
" Passes additional arguments to pandoc, say `:make html --self-contained`.
@ -51,7 +52,7 @@ endfunction
execute 'CompilerSet makeprg=pandoc'..escape(
\ ' --standalone'..
\ (s:PandocFiletype(&filetype) ==# 'markdown' && (getline(1) =~# '^%\s\+\S\+' || (search('^title:\s+\S+', 'cnw') > 0)) ?
\ (s:PandocFiletype(&filetype) ==# 'markdown' && (getline(1) =~# '^%\s\+\S\+' || (search('^title:\s\+\S\+', 'cnw') > 0)) ?
\ '' : ' --metadata title=%:t:r:S')..
\ ' '..s:PandocLang()..
\ ' --from='..s:PandocFiletype(&filetype)..

View File

@ -6,6 +6,7 @@
" 2024 Apr 03 by the Vim Project (removed :CompilerSet definition)
" 2024 Apr 05 by the Vim Project (avoid leaving behind g:makeprg)
" 2024 Nov 19 by the Vim Project (properly escape makeprg setting)
" 2025 Mar 11 by the Vim Project (add comment for Dispatch)
if exists("current_compiler")
finish
@ -50,6 +51,8 @@ let s:makeprg = g:ps1_makeprg_cmd .. ' %:p:S'
" + CategoryInfo : ObjectNotFound: (Write-Ouput:String) [], CommandNotFoundException
" + FullyQualifiedErrorId : CommandNotFoundException
" CompilerSet makeprg=pwsh
" CompilerSet makeprg=powershell
execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' \|"')
" Showing error in context with underlining.

View File

@ -1,19 +1,21 @@
" Vim compiler file
" Compiler: svelte-check
" Maintainer: @Konfekt
" Last Change: 2025 Feb 22
" Last Change: 2025 Feb 27
if exists("current_compiler") | finish | endif
let current_compiler = "svelte-check"
CompilerSet makeprg=npx\ svelte-check\ --output\ machine
CompilerSet errorformat=%*\\d\ %t%*\\a\ \"%f\"\ %l:%c\ %m
CompilerSet errorformat=%*\\d\ %t%*\\a\ \"%f\"\ %l:%c\ \"%m\",
CompilerSet errorformat+=%-G%*\\d\ START\ %.%#,
CompilerSet errorformat+=%-G%*\\d\ COMPLETED\ %.%#,
CompilerSet errorformat+=%-G%.%#
" " Fall-back for versions of svelte-check that don't support --output machine
" " before May 2020 https://github.com/sveltejs/language-tools/commit/9f7a90379d287a41621a5e78af5b010a8ab810c3
" " which is before the first production release 1.1.31 of Svelte-Check
" CompilerSet makeprg=npx\ svelte-check
" CompilerSet errorformat=%E%f:%l:%c,
" CompilerSet errorformat+=%+ZError\:\ %m,
" CompilerSet errorformat+=%-G%.%#
" CompilerSet errorformat=%A%f:%l:%c,
" CompilerSet errorformat+=%C%t%*\\a\\:\ %m,
" CompilerSet errorformat+=%-G%.%#,

View File

@ -6,6 +6,7 @@
" 2024 Apr 03 by the Vim Project (removed :CompilerSet definition)
" 2024 Apr 05 by the Vim Project (avoid leaving behind g:makeprg)
" 2024 Nov 19 by the Vim Project (properly escape makeprg setting)
" 2025 Mar 11 by the Vim Project (add comment for Dispatch)
if exists("current_compiler")
finish
@ -28,6 +29,7 @@ if exists('b:tex_ignore_makefile') || exists('g:tex_ignore_makefile') ||
let current_compiler = "latex"
endif
let s:makeprg=current_compiler .. ' -interaction=nonstopmode'
" CompilerSet makeprg=latex
execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' \|"')
else
let current_compiler = 'make'

View File

@ -2,6 +2,7 @@
" Compiler: TypeScript Compiler
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2024 Apr 03
" 2025 Mar 11 by The Vim Project (add comment for Dispatch, add tsc_makeprg variable)
if exists("current_compiler")
finish
@ -11,9 +12,9 @@ let current_compiler = "tsc"
let s:cpo_save = &cpo
set cpo&vim
" CompilerSet makeprg=tsc
" CompilerSet makeprg=npx\ tsc
CompilerSet makeprg=tsc
execute $'CompilerSet makeprg={escape(get(b:, 'tsc_makeprg', get(g:, 'tsc_makeprg', 'tsc')), ' \|"')}'
CompilerSet errorformat=%f\ %#(%l\\,%c):\ %trror\ TS%n:\ %m,
\%trror\ TS%n:\ %m,
\%-G%.%#

View File

@ -2,8 +2,9 @@
" Language: Typst
" Previous Maintainer: Gregory Anders
" Maintainer: Luca Saccarola <github.e41mv@aleeas.com>
" Based On: https://github.com/kaarmu/typst.vim
" Last Change: 2024 Dec 09
" Based on: https://github.com/kaarmu/typst.vim
" 2025 Mar 11 by the Vim Project (add comment for Dispatch)
if exists('current_compiler')
finish
@ -13,4 +14,5 @@ let current_compiler = get(g:, 'typst_cmd', 'typst')
" With `--diagnostic-format` we can use the default errorformat
let s:makeprg = [current_compiler, 'compile', '--diagnostic-format', 'short', '%:S']
" CompilerSet makeprg=typst
execute 'CompilerSet makeprg=' . join(s:makeprg, '\ ')

View File

@ -1,7 +1,7 @@
" The default vimrc file.
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2024 Dec 01
" Last Change: 2025 Jul 13
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
"
" This is loaded if no vimrc file was found.
@ -34,7 +34,6 @@ silent! while 0
silent! endwhile
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set ttimeout " time out for key codes
set ttimeoutlen=100 " wait up to 100ms after Esc for special key
@ -107,6 +106,7 @@ if 1
\ let line = line("'\"")
\ | if line >= 1 && line <= line("$") && &filetype !~# 'commit'
\ && index(['xxd', 'gitrebase', 'tutor'], &filetype) == -1
\ && !&diff
\ | execute "normal! g`\""
\ | endif

View File

@ -153,6 +153,7 @@ DOCS = \
vim9class.txt \
visual.txt \
vietnamese.txt \
wayland.txt \
windows.txt \
workshop.txt
@ -309,6 +310,7 @@ HTMLS = \
vim9.html \
vim9class.html \
visual.html \
wayland.html \
windows.html \
workshop.html

View File

@ -141,6 +141,11 @@ os_risc.txt:
os_win32.txt:
touch $@
pi_netrw.txt: ../pack/dist/opt/netrw/doc/netrw.txt
cp ../pack/dist/opt/netrw/doc/netrw.txt $@.tmp
sed -e '1s/$$/ *pi_netrw.txt*/' $@.tmp > $@ && \
rm -f $@.tmp
vietnamese.txt:
touch $@

View File

@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 9.1. Last change: 2025 Feb 08
*autocmd.txt* For Vim version 9.1. Last change: 2025 Jun 19
VIM REFERENCE MANUAL by Bram Moolenaar
@ -130,6 +130,10 @@ exception is that "<sfile>" is expanded when the autocmd is defined. Example:
:au BufNewFile,BufRead *.html so <sfile>:h/html.vim
Here Vim expands <sfile> to the name of the file containing this line.
However, <sfile> works differently in a function, in which case it's better to
use `:execute` with <script> to achieve the same purpose:
>
:exe $'au BufNewFile,BufRead *.html so {expand("<script>:h")}/html.vim'
`:autocmd` adds to the list of autocommands regardless of whether they are
already present. When your .vimrc file is sourced twice, the autocommands
@ -387,6 +391,7 @@ Name triggered by ~
|TabNew| after creating a new tab page
|WinClosed| after closing a window
|TabClosed| after closing a tab page
|TabClosedPre| before closing a tab page
|WinEnter| after entering another window
|WinLeave| before leaving a window
|TabEnter| after entering another tab page
@ -397,6 +402,7 @@ Name triggered by ~
|CmdlineChanged| after a change was made to the command-line text
|CmdlineEnter| after the cursor moves to the command line
|CmdlineLeave| before the cursor leaves the command line
|CmdlineLeavePre| before preparing to leave the command line
|InsertEnter| starting Insert mode
|InsertChange| when typing <Insert> while in Insert or Replace mode
@ -592,7 +598,8 @@ BufWriteCmd Before writing the whole buffer to a file.
The buffer contents should not be changed.
When the command resets 'modified' the undo
information is adjusted to mark older undo
states as 'modified', like |:write| does.
states as 'modified', like |:write| does. Use
the |'[| and |']| marks for the range of lines.
|Cmd-event|
*BufWritePost*
BufWritePost After writing the whole buffer to a file
@ -603,6 +610,8 @@ CmdUndefined When a user command is used but it isn't
when it's used. The pattern is matched
against the command name. Both <amatch> and
<afile> are set to the name of the command.
This is triggered even when inside an
autocommand defined without |autocmd-nested|.
NOTE: Autocompletion won't work until the
command is defined. An alternative is to
always define the user command and have it
@ -635,6 +644,18 @@ CmdlineLeave Before leaving the command line; including
<afile> is set to a single character,
indicating the type of command-line.
|cmdwin-char|
*CmdlineLeavePre*
CmdlineLeavePre Just before leaving the command line, and
before |CmdlineLeave|. Useful for capturing
completion info with |cmdcomplete_info()|, as
this information is cleared before
|CmdlineLeave| is triggered. Triggered for
non-interactive use of ":" in a mapping, but
not when using |<Cmd>|. Also triggered when
abandoning the command line by typing CTRL-C
or <Esc>. <afile> is set to a single
character indicating the command-line type.
See |cmdwin-char| for details.
*CmdwinEnter*
CmdwinEnter After entering the command-line window.
Useful for setting options specifically for
@ -883,14 +904,14 @@ FileType When the 'filetype' option has been set. The
FileWriteCmd Before writing to a file, when not writing the
whole buffer. Should do the writing to the
file. Should not change the buffer. Use the
'[ and '] marks for the range of lines.
|'[| and |']| marks for the range of lines.
|Cmd-event|
*FileWritePost*
FileWritePost After writing to a file, when not writing the
whole buffer.
*FileWritePre*
FileWritePre Before writing to a file, when not writing the
whole buffer. Use the '[ and '] marks for the
whole buffer. Use the |'[| and |']| marks for the
range of lines.
*FilterReadPost*
FilterReadPost After reading a file from a filter command.
@ -934,7 +955,9 @@ FuncUndefined When a user function is used but it isn't
when it's used. The pattern is matched
against the function name. Both <amatch> and
<afile> are set to the name of the function.
Not triggered when compiling a |Vim9|
This is triggered even when inside an
autocommand defined without |autocmd-nested|,
but not triggered when compiling a |Vim9|
function.
NOTE: When writing Vim scripts a better
alternative is to use an autoloaded function.
@ -1228,6 +1251,10 @@ Syntax When the 'syntax' option has been set. The
See |:syn-on|.
*TabClosed*
TabClosed After closing a tab page.
*TabClosedPre*
TabClosedPre Before closing a tab page. The window layout
is locked, thus opening and closing of windows
is prohibited.
*TabEnter*
TabEnter Just after entering a tab page. |tab-page|
After triggering the WinEnter and before
@ -1342,6 +1369,10 @@ TextYankPost After text has been yanked or deleted in the
called recursively.
It is not allowed to change the buffer text,
see |textlock|. *E1064*
Also triggered indirectly when Vim tries to
become owner of the Visual selection because
of setting "autoselect" for 'guioptions' or
'clipboard'.
{only when compiled with the +eval feature}
*User*
@ -1467,6 +1498,13 @@ WinScrolled After any window in the current tab page
or changed width or height. See
|win-scrolled-resized|.
Note: This can not be skipped with
`:noautocmd`, because it triggers after
processing normal commands when Vim is back in
the main loop. If you want to disable this,
consider setting the 'eventignore' option
instead.
The pattern is matched against the |window-ID|
of the first window that scrolled or resized.
Both <amatch> and <afile> are set to the

View File

@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.1. Last change: 2025 Feb 23
*builtin.txt* For Vim version 9.1. Last change: 2025 Jul 14
VIM REFERENCE MANUAL by Bram Moolenaar
@ -129,11 +129,14 @@ charidx({string}, {idx} [, {countcc} [, {utf16}]])
chdir({dir}) String change current working directory
cindent({lnum}) Number C indent for line {lnum}
clearmatches([{win}]) none clear all matches
cmdcomplete_info() Dict get current cmdline completion
information
col({expr} [, {winid}]) Number column byte index of cursor or mark
complete({startcol}, {matches}) none set Insert mode completion
complete_add({expr}) Number add completion match
complete_check() Number check for key typed during completion
complete_info([{what}]) Dict get current completion information
complete_match([{lnum}, {col}]) List get completion column and trigger text
confirm({msg} [, {choices} [, {default} [, {type}]]])
Number number of choice picked by user
copy({expr}) any make a shallow copy of {expr}
@ -191,9 +194,8 @@ filter({expr1}, {expr2}) List/Dict/Blob/String
remove items from {expr1} where
{expr2} is 0
finddir({name} [, {path} [, {count}]])
String find directory {name} in {path}
findfile({name} [, {path} [, {count}]])
String find file {name} in {path}
String/List find dir/file {name} in {path}
flatten({list} [, {maxdepth}]) List flatten {list} up to {maxdepth} levels
flattennew({list} [, {maxdepth}])
List flatten a copy of {list}
@ -207,7 +209,7 @@ foldclosedend({lnum}) Number last line of fold at {lnum} if closed
foldlevel({lnum}) Number fold level at {lnum}
foldtext() String line displayed for closed fold
foldtextresult({lnum}) String text for closed fold at {lnum}
foreach({expr1}, {expr2}) List/Dict/Blob/String
foreach({expr1}, {expr2}) List/Tuple/Dict/Blob/String
for each item in {expr1} call {expr2}
foreground() Number bring the Vim window to the foreground
fullcommand({name} [, {vim9}]) String get full command from {name}
@ -247,6 +249,8 @@ getcmdtype() String return current command-line type
getcmdwintype() String return current command-line window type
getcompletion({pat}, {type} [, {filtered}])
List list of cmdline completion matches
getcompletiontype({pat}) String return the type of the command-line
completion using {pat}
getcurpos([{winnr}]) List position of the cursor
getcursorcharpos([{winnr}]) List character position of the cursor
getcwd([{winnr} [, {tabnr}]]) String get the current working directory
@ -348,7 +352,7 @@ job_start({command} [, {options}])
Job start a job
job_status({job}) String get the status of {job}
job_stop({job} [, {how}]) Number stop {job}
join({list} [, {sep}]) String join {list} items into one String
join({expr} [, {sep}]) String join items in {expr} into one String
js_decode({string}) any decode JS style JSON
js_encode({expr}) String encode JS style JSON
json_decode({string}) any decode JSON
@ -364,6 +368,7 @@ line2byte({lnum}) Number byte count of line {lnum}
lispindent({lnum}) Number Lisp indent for line {lnum}
list2blob({list}) Blob turn {list} of numbers into a Blob
list2str({list} [, {utf8}]) String turn {list} of numbers into a String
list2tuple({list}) Tuple turn {list} of items into a tuple
listener_add({callback} [, {buf}])
Number add a callback to listen to changes
listener_flush([{buf}]) none invoke listener callbacks
@ -511,10 +516,10 @@ remove({blob}, {idx} [, {end}]) Number/Blob
remove bytes {idx}-{end} from {blob}
remove({dict}, {key}) any remove entry {key} from {dict}
rename({from}, {to}) Number rename (move) file from {from} to {to}
repeat({expr}, {count}) List/Blob/String
repeat({expr}, {count}) List/Tuple/Blob/String
repeat {expr} {count} times
resolve({filename}) String get filename a shortcut points to
reverse({obj}) List/Blob/String
reverse({obj}) List/Tuple/Blob/String
reverse {obj}
round({expr}) Float round off {expr}
rubyeval({expr}) any evaluate |Ruby| expression
@ -713,6 +718,7 @@ test_null_job() Job null value for testing
test_null_list() List null value for testing
test_null_partial() Funcref null value for testing
test_null_string() String null value for testing
test_null_tuple() Tuple null value for testing
test_option_not_set({name}) none reset flag indicating option was set
test_override({expr}, {val}) none test with Vim internal overrides
test_refcount({expr}) Number get the reference count of {expr}
@ -734,6 +740,7 @@ tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr}
trim({text} [, {mask} [, {dir}]])
String trim characters in {mask} from {text}
trunc({expr}) Float truncate Float {expr}
tuple2list({tuple}) List turn {tuple} of items into a list
type({expr}) Number type of value {expr}
typename({expr}) String representation of the type of {expr}
undofile({name}) String undo file name for {name}
@ -1311,7 +1318,7 @@ blob2str({blob} [, {options}]) *blob2str()*
encoding. The value is a |String|. See
|encoding-names| for the supported values
(plus the special value "none").
*E1515*
*E1515* *E1516*
When current 'encoding' is "utf-8", an error is given and an
empty List is returned if an invalid byte sequence is
encountered in {blob}. To suppress this validation and get
@ -1323,9 +1330,11 @@ blob2str({blob} [, {options}]) *blob2str()*
See also |str2blob()|
Examples: >
blob2str(0z6162) returns ["ab"]
blob2str(0zC2ABC2BB) returns ["«»"]
blob2str(0zABBB, {'encoding': 'latin1'}) returns ["«»"]
blob2str(0z6162) returns ['ab']
blob2str(0zC2ABC2BB) returns ['«»']
blob2str(0z610A62) returns ['a', 'b']
blob2str(0z610062) returns ['a\nb']
blob2str(0zABBB, {'encoding': 'latin1'}) returns ['«»']
<
Can also be used as a |method|: >
GetBlob()->blob2str()
@ -1827,6 +1836,29 @@ clearmatches([{win}]) *clearmatches()*
Return type: |Number|
cmdcomplete_info() *cmdcomplete_info()*
Returns a |Dictionary| with information about cmdline
completion. See |cmdline-completion|.
The items are:
cmdline_orig The original command-line string before
completion began.
pum_visible |TRUE| if popup menu is visible.
See |pumvisible()|.
matches List of all completion candidates. Each item
is a string.
selected Selected item index. First index is zero.
Index is -1 if no item is selected (showing
typed text only, or the last completion after
no item is selected when using the <Up> or
<Down> keys)
Returns an empty |Dictionary| if no completion was attempted,
if there was only one candidate and it was fully completed, or
if an error occurred.
Return type: dict<any>
col({expr} [, {winid}]) *col()*
The result is a Number, which is the byte index of the column
position given with {expr}.
@ -1977,6 +2009,7 @@ complete_info([{what}]) *complete_info()*
"omni" Omni completion |i_CTRL-X_CTRL-O|
"spell" Spelling suggestions |i_CTRL-X_s|
"eval" |complete()| completion
"register" Words from registers |i_CTRL-X_CTRL-R|
"unknown" Other internal modes
If the optional {what} list argument is supplied, then only
@ -2002,6 +2035,50 @@ complete_info([{what}]) *complete_info()*
<
Return type: dict<any>
complete_match([{lnum}, {col}]) *complete_match()*
Searches backward from the given position and returns a List
of matches according to the 'isexpand' option. When no
arguments are provided, uses the current cursor position.
Each match is represented as a List containing
[startcol, trigger_text] where:
- startcol: column position where completion should start,
or -1 if no trigger position is found. For multi-character
triggers, returns the column of the first character.
- trigger_text: the matching trigger string from 'isexpand',
or empty string if no match was found or when using the
default 'iskeyword' pattern.
When 'isexpand' is empty, uses the 'iskeyword' pattern "\k\+$"
to find the start of the current keyword.
Examples: >
set isexpand=.,->,/,/*,abc
func CustomComplete()
let res = complete_match()
if res->len() == 0 | return | endif
let [col, trigger] = res[0]
let items = []
if trigger == '/*'
let items = ['/** */']
elseif trigger == '/'
let items = ['/*! */', '// TODO:', '// fixme:']
elseif trigger == '.'
let items = ['length()']
elseif trigger =~ '^\->'
let items = ['map()', 'reduce()']
elseif trigger =~ '^\abc'
let items = ['def', 'ghk']
endif
if items->len() > 0
let startcol = trigger =~ '^/' ? col : col + len(trigger)
call complete(startcol, items)
endif
endfunc
inoremap <Tab> <Cmd>call CustomComplete()<CR>
<
Return type: list<list<any>>
*confirm()*
confirm({msg} [, {choices} [, {default} [, {type}]]])
confirm() offers the user a dialog, from which a choice can be
@ -2071,7 +2148,8 @@ copy({expr}) *copy()*
that the original |List| can be changed without changing the
copy, and vice versa. But the items are identical, thus
changing an item changes the contents of both |Lists|.
A |Dictionary| is copied in a similar way as a |List|.
A |Tuple| or |Dictionary| is copied in a similar way as a
|List|.
Also see |deepcopy()|.
Can also be used as a |method|: >
mylist->copy()
@ -2114,10 +2192,10 @@ cosh({expr}) *cosh()*
count({comp}, {expr} [, {ic} [, {start}]]) *count()* *E706*
Return the number of times an item with value {expr} appears
in |String|, |List| or |Dictionary| {comp}.
in |String|, |List|, |Tuple| or |Dictionary| {comp}.
If {start} is given then start with the item with this index.
{start} can only be used with a |List|.
{start} can only be used with a |List| or a |Tuple|.
When {ic} is given and it's |TRUE| then case is ignored.
@ -2237,7 +2315,8 @@ deepcopy({expr} [, {noref}]) *deepcopy()* *E698*
|Dictionary|, a copy for it is made, recursively. Thus
changing an item in the copy does not change the contents of
the original |List|.
A |Dictionary| is copied in a similar way as a |List|.
A |Tuple| or |Dictionary| is copied in a similar way as a
|List|.
When {noref} is omitted or zero a contained |List| or
|Dictionary| is only copied once. All references point to
@ -2545,8 +2624,8 @@ echoraw({string}) *echoraw()*
empty({expr}) *empty()*
Return the Number 1 if {expr} is empty, zero otherwise.
- A |List| or |Dictionary| is empty when it does not have any
items.
- A |List|, |Tuple| or |Dictionary| is empty when it does
not have any items.
- A |String| is empty when its length is zero.
- A |Number| and |Float| are empty when their value is zero.
- |v:false|, |v:none| and |v:null| are empty, |v:true| is not.
@ -3090,7 +3169,7 @@ feedkeys({string} [, {mode}]) *feedkeys()*
Can also be used as a |method|: >
GetInput()->feedkeys()
<
Return type: |String| or list<string> depending on {list}
Return type: |Number|
filecopy({from}, {to}) *filecopy()*
@ -3228,7 +3307,8 @@ finddir({name} [, {path} [, {count}]]) *finddir()*
Can also be used as a |method|: >
GetName()->finddir()
<
Return type: |String|
Return type: list<string> if {count} is negative, |String|
otherwise
findfile({name} [, {path} [, {count}]]) *findfile()*
@ -3242,7 +3322,8 @@ findfile({name} [, {path} [, {count}]]) *findfile()*
Can also be used as a |method|: >
GetName()->findfile()
<
Return type: |String|
Return type: list<string> if {count} is negative, |String|
otherwise
flatten({list} [, {maxdepth}]) *flatten()*
@ -3473,8 +3554,9 @@ foldtextresult({lnum}) *foldtextresult()*
Return type: |String|
foreach({expr1}, {expr2}) *foreach()*
{expr1} must be a |List|, |String|, |Blob| or |Dictionary|.
foreach({expr1}, {expr2}) *foreach()* *E1525*
{expr1} must be a |List|, |Tuple|, |String|, |Blob| or
|Dictionary|.
For each item in {expr1} execute {expr2}. {expr1} is not
modified; its values may be, as with |:lockvar| 1. |E741|
See |map()| and |filter()| to modify {expr1}.
@ -3483,10 +3565,10 @@ foreach({expr1}, {expr2}) *foreach()*
If {expr2} is a |string|, inside {expr2} |v:val| has the value
of the current item. For a |Dictionary| |v:key| has the key
of the current item and for a |List| |v:key| has the index of
the current item. For a |Blob| |v:key| has the index of the
current byte. For a |String| |v:key| has the index of the
current character.
of the current item and for a |List| or a |Tuple| |v:key| has
the index of the current item. For a |Blob| |v:key| has the
index of the current byte. For a |String| |v:key| has the
index of the current character.
Examples: >
call foreach(mylist, 'used[v:val] = true')
< This records the items that are in the {expr1} list.
@ -3512,8 +3594,8 @@ foreach({expr1}, {expr2}) *foreach()*
Can also be used as a |method|: >
mylist->foreach(expr2)
<
Return type: |String|, |Blob| list<{type}> or dict<{type}>
depending on {expr1}
Return type: |String|, |Blob|, list<{type}>, tuple<{type}> or
dict<{type}> depending on {expr1}
*foreground()*
foreground() Move the Vim window to the foreground. Useful when sent from
@ -3686,6 +3768,15 @@ get({list}, {idx} [, {default}]) *get()* *get()-list*
<
Return type: any, depending on {list}
get({tuple}, {idx} [, {default}]) *get()-tuple*
Get item {idx} from |Tuple| {tuple}. When this item is not
available return {default}. Return zero when {default} is
omitted.
Preferably used as a |method|: >
mytuple->get(idx)
<
Return type: any, depending on {tuple}
get({blob}, {idx} [, {default}]) *get()-blob*
Get byte {idx} from |Blob| {blob}. When this byte is not
available return {default}. Return -1 when {default} is
@ -4121,6 +4212,9 @@ getcmdcompltype() *getcmdcompltype()*
|getcmdprompt()|, |getcmdcomplpat()| and |setcmdline()|.
Returns an empty string when completion is not defined.
To get the type of the command-line completion for a specified
string, use |getcompletiontype()|.
Return type: |String|
@ -4226,6 +4320,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
file file and directory names
file_in_path file and directory names in |'path'|
filetype filetype names |'filetype'|
filetypecmd |:filetype| suboptions
function function name
help help subjects
highlight highlight groups
@ -4238,6 +4333,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
messages |:messages| suboptions
option options
packadd optional package |pack-add| names
retab |:retab| suboptions
runtime |:runtime| completion
scriptnames sourced script names |:scriptnames|
shellcmd Shell command
@ -4278,6 +4374,15 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
<
Return type: list<string>
getcompletiontype({pat}) *getcompletiontype()*
Return the type of the command-line completion using {pat}.
When no corresponding completion type is found, an empty
string is returned.
To get the current command-line completion type, use
|getcmdcompltype()|.
Return type: |String|
*getcurpos()*
getcurpos([{winid}])
Get the position of the cursor. This is like getpos('.'), but
@ -4638,8 +4743,9 @@ getmousepos() *getmousepos()*
start of the clicked char
All numbers are 1-based.
If not over a window, e.g. when in the command line, then only
"screenrow" and "screencol" are valid, the others are zero.
If not over a window, e.g. when in the command line or within
|tabpanel|, then only "screenrow" and "screencol" are valid,
the others are zero.
When on the status line below a window or the vertical
separator right of a window, the "line" and "column" values
@ -4872,7 +4978,7 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()*
Can also be used as a |method|: >
GetRegname()->getreg()
<
Return type: |String|
Return type: |String| or list<string> depending on {list}
getreginfo([{regname}]) *getreginfo()*
@ -4951,6 +5057,10 @@ getregion({pos1}, {pos2} [, {opts}]) *getregion()*
- It is evaluated in current window context, which makes a
difference if the buffer is displayed in a window with
different 'virtualedit' or 'list' values.
- When specifying an exclusive selection and {pos1} and {pos2}
are equal, the returned list contains a single character as
if selection is inclusive, to match the behavior of an empty
exclusive selection in Visual mode.
Examples: >
:xnoremap <CR>
@ -4998,6 +5108,8 @@ getregionpos({pos1}, {pos2} [, {opts}]) *getregionpos()*
Can also be used as a |method|: >
getpos('.')->getregionpos(getpos("'a"))
<
For an example, see the highlight-yank plugin |52.6|
Return type: list<list<list<number>>>
@ -5817,8 +5929,8 @@ id({item}) *id()*
< prevents {item} from being garbage collected and provides a
way to get the {item} from the `id`.
{item} may be a List, Dictionary, Object, Job, Channel or
Blob. If the item is not a permitted type, or it is a null
{item} may be a List, Tuple, Dictionary, Object, Job, Channel
or Blob. If the item is not a permitted type, or it is a null
value, then an empty String is returned.
Can also be used as a |method|: >
@ -5845,12 +5957,12 @@ index({object}, {expr} [, {start} [, {ic}]]) *index()*
Find {expr} in {object} and return its index. See
|indexof()| for using a lambda to select the item.
If {object} is a |List| return the lowest index where the item
has a value equal to {expr}. There is no automatic
conversion, so the String "4" is different from the Number 4.
And the number 4 is different from the Float 4.0. The value
of 'ignorecase' is not used here, case matters as indicated by
the {ic} argument.
If {object} is a |List| or a |Tuple| return the lowest index
where the item has a value equal to {expr}. There is no
automatic conversion, so the String "4" is different from the
Number 4. And the number 4 is different from the Float 4.0.
The value of 'ignorecase' is not used here, case matters as
indicated by the {ic} argument.
If {object} is |Blob| return the lowest index where the byte
value is equal to {expr}.
@ -5874,11 +5986,11 @@ index({object}, {expr} [, {start} [, {ic}]]) *index()*
indexof({object}, {expr} [, {opts}]) *indexof()*
Returns the index of an item in {object} where {expr} is
v:true. {object} must be a |List| or a |Blob|.
v:true. {object} must be a |List|, a |Tuple| or a |Blob|.
If {object} is a |List|, evaluate {expr} for each item in the
List until the expression is v:true and return the index of
this item.
If {object} is a |List| or a |Tuple|, evaluate {expr} for each
item in the List or Tuple until the expression is v:true
and return the index of this item.
If {object} is a |Blob| evaluate {expr} for each byte in the
Blob until the expression is v:true and return the index of
@ -5886,11 +5998,11 @@ indexof({object}, {expr} [, {opts}]) *indexof()*
{expr} must be a |string| or |Funcref|.
If {expr} is a |string|: If {object} is a |List|, inside
{expr} |v:key| has the index of the current List item and
|v:val| has the value of the item. If {object} is a |Blob|,
inside {expr} |v:key| has the index of the current byte and
|v:val| has the byte value.
If {expr} is a |string|: If {object} is a |List| or a |Tuple|,
inside {expr} |v:key| has the index of the current List or
Tuple item and |v:val| has the value of the item. If {object}
is a |Blob|, inside {expr} |v:key| has the index of the
current byte and |v:val| has the byte value.
If {expr} is a |Funcref| it must take two arguments:
1. the key or the index of the current item.
@ -6200,9 +6312,9 @@ items({dict}) *items()*
echo key .. ': ' .. value
endfor
<
A List or a String argument is also supported. In these
cases, items() returns a List with the index and the value at
the index.
A |List|, a |Tuple| or a |String| argument is also supported.
In these cases, items() returns a List with the index and the
value at the index.
Can also be used as a |method|: >
mydict->items()
@ -6213,16 +6325,17 @@ items({dict}) *items()*
job_ functions are documented here: |job-functions-details|
join({list} [, {sep}]) *join()*
Join the items in {list} together into one String.
join({expr} [, {sep}]) *join()*
Join the items in {expr} together into one String. {expr} can
be a |List| or a |Tuple|.
When {sep} is specified it is put in between the items. If
{sep} is omitted a single space is used.
Note that {sep} is not added at the end. You might want to
add it there too: >
let lines = join(mylist, "\n") .. "\n"
< String items are used as-is. |Lists| and |Dictionaries| are
converted into a string like with |string()|.
The opposite function is |split()|.
< String items are used as-is. |Lists|, |Tuples| and
|Dictionaries| are converted into a string like with
|string()|. The opposite function is |split()|.
Can also be used as a |method|: >
mylist->join()
@ -6316,6 +6429,8 @@ json_encode({expr}) *json_encode()*
|Funcref| not possible, error
|List| as an array (possibly null); when
used recursively: []
|Tuple| as an array (possibly null); when
used recursively: []
|Dict| as an object (possibly null); when
used recursively: {}
|Blob| as an array of the individual bytes
@ -6364,6 +6479,8 @@ len({expr}) *len()* *E701*
used, as with |strlen()|.
When {expr} is a |List| the number of items in the |List| is
returned.
When {expr} is a |Tuple| the number of items in the |Tuple| is
returned.
When {expr} is a |Blob| the number of bytes is returned.
When {expr} is a |Dictionary| the number of entries in the
|Dictionary| is returned.
@ -6545,6 +6662,25 @@ list2str({list} [, {utf8}]) *list2str()*
Return type: |String|
list2tuple({list}) *list2tuple()*
Create a Tuple from a shallow copy of the list items.
Examples: >
list2tuple([1, 2, 3]) returns (1, 2, 3)
< |tuple2list()| does the opposite.
This function doesn't recursively convert all the List items
in {list} to a Tuple. Note that the items are identical
between the list and the tuple, changing an item changes the
contents of both the tuple and the list.
Returns an empty tuple on error.
Can also be used as a |method|: >
GetList()->list2tuple()
<
Return type: tuple<{type}> (depending on the given |List|)
listener_add({callback} [, {buf}]) *listener_add()*
Add a callback function that will be invoked when changes have
been made to buffer {buf}.
@ -7275,6 +7411,9 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()*
given sequence.
limit Maximum number of matches in {list} to be
returned. Zero means no limit.
camelcase Use enhanced camel case scoring making results
better suited for completion related to
programming languages. Defaults to v:true.
If {list} is a list of dictionaries, then the optional {dict}
argument supports the following additional items:
@ -7457,11 +7596,12 @@ max({expr}) *max()*
Return the maximum value of all items in {expr}. Example: >
echo max([apples, pears, oranges])
< {expr} can be a |List| or a |Dictionary|. For a Dictionary,
it returns the maximum of all values in the Dictionary.
If {expr} is neither a List nor a Dictionary, or one of the
items in {expr} cannot be used as a Number this results in
an error. An empty |List| or |Dictionary| results in zero.
< {expr} can be a |List|, a |Tuple| or a |Dictionary|. For a
Dictionary, it returns the maximum of all values in the
Dictionary. If {expr} is neither a List nor a Tuple nor a
Dictionary, or one of the items in {expr} cannot be used as a
Number this results in an error. An empty |List|, |Tuple|
or |Dictionary| results in zero.
Can also be used as a |method|: >
mylist->max()
@ -7548,11 +7688,12 @@ min({expr}) *min()*
Return the minimum value of all items in {expr}. Example: >
echo min([apples, pears, oranges])
< {expr} can be a |List| or a |Dictionary|. For a Dictionary,
it returns the minimum of all values in the Dictionary.
If {expr} is neither a List nor a Dictionary, or one of the
items in {expr} cannot be used as a Number this results in
an error. An empty |List| or |Dictionary| results in zero.
< {expr} can be a |List|, a |Tuple| or a |Dictionary|. For a
Dictionary, it returns the minimum of all values in the
Dictionary. If {expr} is neither a List nor a Tuple nor a
Dictionary, or one of the items in {expr} cannot be used as a
Number this results in an error. An empty |List|, |Tuple| or
|Dictionary| results in zero.
Can also be used as a |method|: >
mylist->min()
@ -7587,9 +7728,8 @@ mkdir({name} [, {flags} [, {prot}]]) *mkdir()* *E739*
If {prot} is given it is used to set the protection bits of
the new directory. The default is 0o755 (rwxr-xr-x: r/w for
the user, readable for others). Use 0o700 to make it
unreadable for others. This is only used for the last part of
{name}. Thus if you create /tmp/foo/bar then /tmp/foo will be
created with 0o755.
unreadable for others. This is used for the newly created
directories. Note: umask is applied to {prot} (on Unix).
Example: >
:call mkdir($HOME .. "/tmp/foo/bar", "p", 0o700)
@ -8111,7 +8251,8 @@ printf({fmt}, {expr1} ...) *printf()*
< 1.41
You will get an overflow error |E1510|, when the field-width
or precision will result in a string longer than 6400 chars.
or precision will result in a string longer than 1 MiB
(1024*1024 = 1048576) chars.
*E1500*
You cannot mix positional and non-positional arguments: >
@ -8289,13 +8430,14 @@ py3eval({expr} [, {locals}]) *py3eval()*
converted to Vim data structures.
If a {locals} |Dictionary| is given, it defines set of local
variables available in the expression. The keys are variable
names and the values are the variable values. |Dictionary| and
|List| values are referenced, and may be updated by the
expression (as if |python-bindeval| was used).
names and the values are the variable values. |Dictionary|,
|List| and |Tuple| values are referenced, and may be updated
by the expression (as if |python-bindeval| was used).
Numbers and strings are returned as they are (strings are
copied though, Unicode strings are additionally converted to
'encoding').
Lists are represented as Vim |List| type.
Tuples are represented as Vim |Tuple| type.
Dictionaries are represented as Vim |Dictionary| type with
keys converted to strings.
Note that in a `:def` function local variables are not visible
@ -8317,6 +8459,7 @@ pyeval({expr} [, {locals}]) *pyeval()*
Numbers and strings are returned as they are (strings are
copied though).
Lists are represented as Vim |List| type.
Tuples are represented as Vim |Tuple| type.
Dictionaries are represented as Vim |Dictionary| type,
non-string keys result in error.
Note that in a `:def` function local variables are not visible
@ -8576,8 +8719,8 @@ readfile({fname} [, {type} [, {max}]])
reduce({object}, {func} [, {initial}]) *reduce()* *E998*
{func} is called for every item in {object}, which can be a
|String|, |List| or a |Blob|. {func} is called with two
arguments: the result so far and current item. After
|String|, |List|, |Tuple| or a |Blob|. {func} is called with
two arguments: the result so far and current item. After
processing all items the result is returned. *E1132*
{initial} is the initial result. When omitted, the first item
@ -8898,16 +9041,16 @@ repeat({expr}, {count}) *repeat()*
result. Example: >
:let separator = repeat('-', 80)
< When {count} is zero or negative the result is empty.
When {expr} is a |List| or a |Blob| the result is {expr}
concatenated {count} times. Example: >
When {expr} is a |List|, a |Tuple| or a |Blob| the result is
{expr} concatenated {count} times. Example: >
:let longlist = repeat(['a', 'b'], 3)
< Results in ['a', 'b', 'a', 'b', 'a', 'b'].
Can also be used as a |method|: >
mylist->repeat(count)
<
Return type: |String|, |Blob| or list<{type}> depending on
{expr}
Return type: |String|, |Blob|, list<{type}> or tuple<{type}>
depending on {expr}
resolve({filename}) *resolve()* *E655*
@ -8934,18 +9077,19 @@ resolve({filename}) *resolve()* *E655*
reverse({object}) *reverse()*
Reverse the order of items in {object}. {object} can be a
|List|, a |Blob| or a |String|. For a List and a Blob the
items are reversed in-place and {object} is returned.
|List|, a |Tuple|, a |Blob| or a |String|. For a List and a
Blob the items are reversed in-place and {object} is returned.
For a Tuple, a new Tuple is returned.
For a String a new String is returned.
Returns zero if {object} is not a List, Blob or a String.
If you want a List or Blob to remain unmodified make a copy
first: >
Returns zero if {object} is not a List, Tuple, Blob or a
String. If you want a List or Blob to remain unmodified make
a copy first: >
:let revlist = reverse(copy(mylist))
< Can also be used as a |method|: >
mylist->reverse()
<
Return type: |String|, |Blob| or list<{type}> depending on
{object}
Return type: |String|, |Blob|, list<{type}> or tuple<{type}>
depending on {object}
round({expr}) *round()*
@ -9235,11 +9379,12 @@ searchcount([{options}]) *searchcount()*
To get the last search count when |n| or |N| was pressed, call
this function with `recompute: 0` . This sometimes returns
wrong information because |n| and |N|'s maximum count is 99.
If it exceeded 99 the result must be max count + 1 (100). If
you want to get correct information, specify `recompute: 1`: >
wrong information because of 'maxsearchcount'.
If the count exceeded 'maxsearchcount', the result must be
'maxsearchcount' + 1. If you want to get correct information,
specify `recompute: 1`: >
" result == maxcount + 1 (100) when many matches
" result == 'maxsearchcount' + 1 when many matches
let result = searchcount(#{recompute: 0})
" Below returns correct result (recompute defaults
@ -9326,7 +9471,7 @@ searchcount([{options}]) *searchcount()*
result. if search exceeded
total count, "total" value
becomes `maxcount + 1`
(default: 99)
(default: 'maxsearchcount')
pos |List| `[lnum, col, off]` value
when recomputing the result.
this changes "current" result
@ -9704,6 +9849,7 @@ setcursorcharpos({list})
Can also be used as a |method|: >
GetCursorPos()->setcursorcharpos()
<
Returns 0 when the position could be set, -1 otherwise.
Return type: |Number|
@ -10298,7 +10444,7 @@ slice({expr}, {start} [, {end}]) *slice()*
Can also be used as a |method|: >
GetList()->slice(offset)
<
Return type: list<{type}>
Return type: list<{type}> or tuple<{type}>
sort({list} [, {how} [, {dict}]]) *sort()* *E702*
@ -10662,11 +10808,12 @@ str2blob({list} [, {options}]) *str2blob()*
See also |blob2str()|
Examples: >
str2blob(["ab"]) returns 0z6162
str2blob(["«»"]) returns 0zC2ABC2BB
str2blob(["a\nb"]) returns 0z610A62
str2blob(readfile('myfile.txt'))
str2blob(["ab"]) returns 0z6162
str2blob(["«»"]) returns 0zC2ABC2BB
str2blob(["a\nb"]) returns 0z610062
str2blob(["a","b"]) returns 0z610A62
str2blob(["«»"], {'encoding': 'latin1'}) returns 0zABBB
str2blob(readfile('myfile.txt'))
<
Can also be used as a |method|: >
GetListOfStrings()->str2blob()
@ -10909,15 +11056,16 @@ string({expr}) *string()*
Funcref function('name')
Blob 0z00112233.44556677.8899
List [item, item]
Tuple (item, item)
Dictionary {key: value, key: value}
Class class SomeName
Object object of SomeName {lnum: 1, col: 3}
Enum enum EnumName
EnumValue enum name.value {name: str, ordinal: nr}
When a |List| or |Dictionary| has a recursive reference it is
replaced by "[...]" or "{...}". Using eval() on the result
will then fail.
When a |List|, |Tuple| or |Dictionary| has a recursive
reference it is replaced by "[...]" or "(...)" or "{...}".
Using eval() on the result will then fail.
For an object, invokes the string() method to get a textual
representation of the object. If the method is not present,
@ -11871,6 +12019,25 @@ trunc({expr}) *trunc()*
Return type: |Float|
tuple2list({tuple}) *tuple2list()*
Create a List from a shallow copy of the tuple items.
Examples: >
tuple2list((1, 2, 3)) returns [1, 2, 3]
< |list2tuple()| does the opposite.
This function doesn't recursively convert all the Tuple items
in {tuple} to a List. Note that the items are identical
between the list and the tuple, changing an item changes the
contents of both the tuple and the list.
Returns an empty list on error.
Can also be used as a |method|: >
GetTuple()->tuple2list()
<
Return type: list<{type}> (depending on the given |Tuple|)
*type()*
type({expr}) The result is a Number representing the type of {expr}.
Instead of using the number directly, it is better to use the
@ -11891,6 +12058,7 @@ type({expr}) The result is a Number representing the type of {expr}.
Typealias: 14 |v:t_typealias|
Enum: 15 |v:t_enum|
EnumValue: 16 |v:t_enumvalue|
Tuple: 17 |v:t_tuple|
For backward compatibility, this method can be used: >
:if type(myvar) == type(0)
:if type(myvar) == type("")
@ -11991,6 +12159,7 @@ uniq({list} [, {func} [, {dict}]]) *uniq()* *E882*
:let newlist = uniq(copy(mylist))
< The default compare function uses the string representation of
each item. For the use of {func} and {dict} see |sort()|.
For deduplicating text in the current buffer see |:uniq|.
Returns zero if {list} is not a |List|.
@ -12885,6 +13054,8 @@ vms VMS version of Vim.
vreplace Compiled with |gR| and |gr| commands. (always true)
vtp Compiled for vcon support |+vtp| (check vcon to find
out if it works in the current console).
wayland Compiled with Wayland protocol support.
wayland_clipboard Compiled with support for Wayland selections/clipboard
wildignore Compiled with 'wildignore' option.
wildmenu Compiled with 'wildmenu' option.
win16 old version for MS-Windows 3.1 (always false)

View File

@ -1,4 +1,4 @@
*change.txt* For Vim version 9.1. Last change: 2024 Dec 15
*change.txt* For Vim version 9.1. Last change: 2025 Jul 15
VIM REFERENCE MANUAL by Bram Moolenaar
@ -20,6 +20,7 @@ commands with the "." command.
5. Copying and moving text |copy-move|
6. Formatting text |formatting|
7. Sorting text |sorting|
8. Deduplicating text |deduplicating|
For inserting text see |insert.txt|.
@ -156,8 +157,8 @@ only after a '.').
The 'B' and 'M' flags in 'formatoptions' change the behavior for inserting
spaces before and after a multibyte character |fo-table|.
The '[ mark is set at the end of the first line that was joined, '] at the end
of the resulting line.
The |'[| mark is set at the end of the first line that was joined, |']| at the
end of the resulting line.
==============================================================================
@ -664,8 +665,9 @@ For other systems the tmpnam() library function is used.
Repeat last :substitute with same search pattern and
substitute string, but without the same flags. You
may add [flags], see |:s_flags|.
Note that after `:substitute` the '&' flag can't be
used, it's recognized as a pattern separator.
Note that after `:substitute` the '&' and '#' flags
can't be used, they're recognized as a pattern
separator.
The space between `:substitute` and the 'c', 'g',
'i', 'I' and 'r' flags isn't required, but in scripts
it's a good idea to keep it to avoid confusion.
@ -989,22 +991,26 @@ This replaces each 'E' character with a euro sign. Read more in |<Char->|.
4.4 Changing tabs *change-tabs*
*:ret* *:retab* *:retab!*
:[range]ret[ab][!] [new_tabstop]
:[range]ret[ab][!] [-indentonly] [{new-tabstop}]
Replace all sequences of white-space containing a
<Tab> with new strings of white-space using the new
tabstop value given. If you do not specify a new
tabstop size or it is zero, Vim uses the current value
of 'tabstop'.
<Tab> with new strings of white-space using
{new-tabstop}. If you do not specify {new-tabstop} or
it is zero, Vim uses the current value of 'tabstop'.
The current value of 'tabstop' is always used to
compute the width of existing tabs.
With !, Vim also replaces strings of only normal
spaces with tabs where appropriate.
With 'expandtab' on, Vim replaces all tabs with the
appropriate number of spaces.
This command sets 'tabstop' to the new value given,
and if performed on the whole file, which is default,
should not make any visible change.
Careful: This command modifies any <Tab> characters
This command sets 'tabstop' to {new-tabstop} and if
performed on the whole file, which is default, should
not make any visible change.
When [-indentonly] is specified, only the leading
white-space will be targeted. Any other consecutive
white-space will not be changed.
Warning: This command modifies any <Tab> characters
inside of strings in a C program. Use "\t" to avoid
this (that's a good habit anyway).
`:retab!` may also change a sequence of spaces by
@ -1149,6 +1155,11 @@ inside of strings can change! Also see 'softtabstop' option. >
:[line]pu[t]! [x] Put the text [from register x] before [line] (default
current line).
*:ip* *:iput*
:[line]ip[ut] [x] like |:put|, but adjust indent to the current line
:[line]ip[ut]! [x] like |:put|!, but adjust indent to the current line
["x]]p or *]p* *]<MiddleMouse>*
["x]]<MiddleMouse> Like "p", but adjust the indent to the current line.
Using the mouse only works when 'mouse' contains 'n'
@ -1183,8 +1194,8 @@ the ":put" command, Vim always inserts the text in the next line. You can
exchange two characters with the command sequence "xp". You can exchange two
lines with the command sequence "ddp". You can exchange two words with the
command sequence "deep" (start with the cursor in the blank space before the
first word). You can use the "']" or "`]" command after the put command to
move the cursor to the end of the inserted text, or use "'[" or "`[" to move
first word). You can use the |']| or |`]| command after the put command to
move the cursor to the end of the inserted text, or use |'[| or |`[| to move
the cursor to the start.
*put-Visual-mode* *v_p* *v_P*
@ -1889,6 +1900,7 @@ And a few warnings:
Vim has a sorting function and a sorting command. The sorting function can be
found here: |sort()|, |uniq()|.
Also see |:uniq|.
*:sor* *:sort*
:[range]sor[t][!] [b][f][i][l][n][o][r][u][x] [/{pattern}/]
@ -1898,7 +1910,7 @@ found here: |sort()|, |uniq()|.
With [!] the order is reversed.
With [i] case is ignored.
*:sort-l*
With [l] sort uses the current collation locale.
Implementation details: strcoll() is used to compare
strings. See |:language| to check or set the collation
@ -1931,13 +1943,14 @@ found here: |sort()|, |uniq()|.
With [b] sorting is done on the first binary number in
the line (after or inside a {pattern} match).
*:sort-u* *:sort-uniq*
With [u] (u stands for unique) only keep the first of
a sequence of identical lines (ignoring case when [i]
is used). Without this flag, a sequence of identical
lines will be kept in their original order.
Note that leading and trailing white space may cause
lines to be different.
When you just want to make things unique, use |:uniq|.
When /{pattern}/ is specified and there is no [r] flag
the text matched with {pattern} is skipped, so that
@ -1984,4 +1997,55 @@ The sorting can be interrupted, but if you interrupt it too late in the
process you may end up with duplicated lines. This also depends on the system
library function used.
==============================================================================
8. Deduplicating text *deduplicating* *unique*
Vim has a deduplicating function and a deduplicating command. The
deduplicating function can be found here: |uniq()|.
Also see |:sort-uniq|.
*:uni* *:uniq*
:[range]uni[q][!] [i][l][r][u] [/{pattern}/]
Remove duplicate lines that are adjacent to each other
in [range]. When no range is given, all lines are
processed.
With [i] case is ignored when comparing lines.
With [l] comparison uses the current collation locale.
See |:sort-l| for more details.
With [r] comparison is done on the text that matches
/{pattern}/ instead of the full line.
With [u] only keep lines that do not repeat (i.e., are
not immediately followed by the same line).
With [!] only keep lines that are immediately followed
by a duplicate.
If both [!] and [u] are given, [u] is ignored and [!]
takes effect.
When /{pattern}/ is specified and [r] is not used, the
text matched with {pattern} is skipped and comparison
is done on what comes after the match.
'ignorecase' applies to the pattern, but 'smartcase'
is not used.
Instead of the slash any non-letter can be used.
For example, to remove adjacent duplicate lines based
on the second comma-separated field: >
:uniq /[^,]*,/
< Or to keep only unique lines ignoring the first 5
characters: >
:uniq u /.\{5}/
< If {pattern} is empty (e.g. // is used), the last
search pattern is used.
Note that leading and trailing white space may cause
lines to be considered different.
To remove all duplicates regardless of position, use
|:sort-u| or external tools.
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -1,4 +1,4 @@
*cmdline.txt* For Vim version 9.1. Last change: 2024 Oct 05
*cmdline.txt* For Vim version 9.1. Last change: 2025 Jun 28
VIM REFERENCE MANUAL by Bram Moolenaar
@ -88,6 +88,10 @@ CTRL-SHIFT-V *c_CTRL-SHIFT-V* *c_CTRL-SHIFT-Q*
CTRL-SHIFT-Q Works just like CTRL-V, unless |modifyOtherKeys| is active,
then it inserts the Escape sequence for a key with modifiers.
In the GUI the |key-notation| is inserted without simplifying.
Note: When CTRL-SHIFT-V is intercepted by your system (e.g.,
to paste text) you can often use CTRL-SHIFT-Q instead.
However, in some terminals (e.g. GNOME Terminal), CTRL-SHIFT-Q
quits the terminal without confirmation.
*c_<Left>* *c_Left*
<Left> cursor left. See 'wildmenu' for behavior during wildmenu
@ -411,7 +415,7 @@ CTRL-D List names that match the pattern in front of the cursor.
to the end.
The 'wildoptions' option can be set to "tagfile" to list the
file of matching tags.
*c_CTRL-I* *c_wildchar* *c_<Tab>*
*c_CTRL-I* *c_wildchar* *c_<Tab>* */_<Tab>*
'wildchar' option
A match is done on the pattern in front of the cursor. The
match (if there are several, the first match) is inserted
@ -421,6 +425,10 @@ CTRL-D List names that match the pattern in front of the cursor.
again and there were multiple matches, the next
match is inserted. After the last match, the first is used
again (wrap around).
In search context use <CTRL-V><Tab> or "\t" to search for a
literal <Tab> instead of triggering completion.
The behavior can be changed with the 'wildmode' option.
*c_<S-Tab>*
<S-Tab> Like 'wildchar' or <Tab>, but begin with the last match and
@ -454,7 +462,7 @@ CTRL-G When 'incsearch' is set, entering a search pattern for "/" or
"?" and the current match is displayed then CTRL-G will move
to the next match (does not take |search-offset| into account)
Use CTRL-T to move to the previous match. Hint: on a regular
keyboard T is above G.
keyboard G is below T.
*c_CTRL-T* */_CTRL-T*
CTRL-T When 'incsearch' is set, entering a search pattern for "/" or
"?" and the current match is displayed then CTRL-T will move

View File

@ -1,4 +1,4 @@
*develop.txt* For Vim version 9.1. Last change: 2024 Dec 25
*develop.txt* For Vim version 9.1. Last change: 2025 May 05
VIM REFERENCE MANUAL by Bram Moolenaar
@ -192,7 +192,7 @@ For any non-trivial change, please always create a pull request on github,
since this triggers the test suite.
*style-clang-format*
sound.c and sign.c can be (semi-) automatically formated using the
sound.c and sign.c can be (semi-) automatically formatted using the
`clang-format` formatter according to the distributed .clang-format file.
Other source files do not yet correspond to the .clang-format file. This may
change in the future and they may be reformatted as well.
@ -215,7 +215,7 @@ them:
- flexible array members: Not supported by HP-UX C compiler (John Marriott)
COMMENTS *style-comments*
COMMENTS *style-comments*
Try to avoid putting multiline comments inside a function body: if the
function is so complex that you need to separately comment parts of it, you
@ -230,8 +230,7 @@ For everything else use: >
// comment
<
INDENTATION *style-indentation*
INDENTATION *style-indentation*
We use 4 space to indent the code. If you are using Vim to edit the source,
you don't need to do anything due to the |modeline|.
@ -239,7 +238,7 @@ you don't need to do anything due to the |modeline|.
For other editors an `.editorconfig` is provided at the root of the repo.
DECLARATIONS *style-declarations*
DECLARATIONS *style-declarations*
Declare, when possible, `for` loop variables in the guard:
OK: >
@ -259,113 +258,75 @@ Wrong: >
int *ptr;
<
BRACES *style-braces*
BRACES *style-braces*
All curly braces must be returned onto a new line:
OK: >
if (cond)
{
cmd;
cmd;
cmd;
cmd;
}
else
{
cmd;
cmd;
cmd;
cmd;
}
<
Wrong: >
if (cond) {
cmd;
cmd;
cmd;
cmd;
} else {
cmd;
cmd;
cmd;
cmd;
}
<
OK: >
while (cond)
{
cmd;
cmd;
}
<
Wrong: >
while (cond) {
cmd;
cmd;
}
<
When a block has one line, including comments, the braces can be left out.
OK: >
if (cond)
do
{
cmd;
else
cmd;
} while (cond);
<
or >
do
{
cmd;
cmd;
}
while (cond);
<
Wrong: >
if (cond)
/*
* comment
*/
do {
cmd;
else
cmd;
} while (cond);
<
When an `if`/`else` has braces on one block, the other should have it too.
OK: >
if (cond)
{
cmd;
}
else
{
cmd;
cmd;
}
<
Wrong: >
if (cond)
cmd;
else
{
cmd;
cmd;
}
if (cond)
{
cmd;
cmd;
}
else
cmd;
<
OK: >
while (cond)
cmd;
<
Wrong:
>
while (cond)
if (cond)
cmd;
<
TYPES *style-types*
Use descriptive types. You can find a list of them in the src/structs.h file
and probably in a typedef in the file you are working on.
Use descriptive types. These are defined in src/vim.h, src/structs.h etc.
Note that all custom types are postfixed with "_T"
OK: >
int is_valid_line_number(linenr_T lnum);
Example: >
linenr_T
buf_T
pos_T
<
Wrong: >
int is_valid_line_number(unsigned long lnum);
<
SPACES AND PUNCTUATION *style-spaces*
@ -386,8 +347,8 @@ Wrong: func(arg1,arg2); for (i = 0;i < 2;++i)
Use a space before and after '=', '+', '/', etc.
Wrong: var=a*5;
OK: var = a * 5;
Wrong: var=a*5;
Use empty lines to group similar actions together.
@ -412,7 +373,6 @@ Wrong: >
while (buf != NULL && !got_int)
<
FUNCTIONS *style-functions*
Use function declarations with the return type on a separate indented line.

View File

@ -1,4 +1,4 @@
*diff.txt* For Vim version 9.1. Last change: 2024 Feb 01
*diff.txt* For Vim version 9.1. Last change: 2025 Jun 20
VIM REFERENCE MANUAL by Bram Moolenaar
@ -226,14 +226,28 @@ The diffs are highlighted with these groups:
|hl-DiffAdd| DiffAdd Added (inserted) lines. These lines exist in
this buffer but not in another.
|hl-DiffChange| DiffChange Changed lines.
|hl-DiffText| DiffText Changed text inside a Changed line. Vim
finds the first character that is different,
and the last character that is different
(searching from the end of the line). The
text in between is highlighted. This means
that parts in the middle that are still the
same are highlighted anyway. The 'diffopt'
flags "iwhite" and "icase" are used here.
|hl-DiffText| DiffText Changed text inside a Changed line. Exact
behavior depends on the `inline:` setting in
'diffopt'.
With `inline:` set to "simple", Vim finds the
first character that is different, and the
last character that is different (searching
from the end of the line). The text in
between is highlighted. This means that parts
in the middle that are still the same are
highlighted anyway. The 'diffopt' flags
"iwhite" and "icase" are used here.
With `inline:` set to "char" or "word", Vim
uses the internal diff library to perform a
detailed diff between the changed blocks and
highlight the exact difference between the
two. Will respect any 'diffopt' flag that
affects internal diff.
Not used when `inline:` is set to "none".
|hl-DiffTextAdd| DiffTextAdd Added text inside a Changed line. Similar to
DiffText, but used when there is no
corresponding text in other buffers. Not used
when `inline:` is set to "simple" or "none".
|hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines,
because they don't really exist in this
buffer.
@ -290,18 +304,20 @@ that the buffers will be equal within the specified range.
When no [range] is given, the diff at the cursor position or just above it is
affected. When [range] is used, Vim tries to only put or get the specified
lines. When there are deleted lines, this may not always be possible.
affected. There can be deleted lines below the last line of the buffer. When
the cursor is on the last line in the buffer and there is no diff above this
line, and no [range] is given, the diff below the cursor position will be used
instead.
There can be deleted lines below the last line of the buffer. When the cursor
is on the last line in the buffer and there is no diff above this line, the
":diffget" and "do" commands will obtain lines from the other buffer.
When [range] is used, Vim tries to only put or get the specified lines. When
there are deleted lines, they will be used if they are between the lines
specified by [range].
To be able to get those lines from another buffer in a [range] it's allowed to
use the last line number plus one. This command gets all diffs from the other
buffer: >
To be able to put or get those lines to/from another buffer in a [range] it's
allowed to use 0 and the last line number plus one. This command gets all
diffs from the other buffer: >
:1,$+1diffget
:0,$+1diffget
Note that deleted lines are displayed, but not counted as text lines. You
can't move the cursor into them. To fill the deleted lines with the lines

View File

@ -1,4 +1,4 @@
*editing.txt* For Vim version 9.1. Last change: 2024 Oct 14
*editing.txt* For Vim version 9.1. Last change: 2025 Jun 25
VIM REFERENCE MANUAL by Bram Moolenaar
@ -974,8 +974,9 @@ Note: When the 'write' option is off, you are not able to write any file.
executed like with ":!{cmd}", any '!' is replaced with
the previous command |:!|.
The default [range] for the ":w" command is the whole buffer (1,$). If you
write the whole buffer, it is no longer considered changed. When you
The default [range] for the ":w" command is the whole buffer (1,$). The |'[|
and |']| marks will be set to the [range] being used for the write command.
If you write the whole buffer, it is no longer considered changed. When you
write it to a different file with ":w somefile" it depends on the "+" flag in
'cpoptions'. When included, the write command will reset the 'modified' flag,
even though the buffer itself may still be different from its file.
@ -1341,9 +1342,15 @@ b:browsefilter variable. You would most likely set b:browsefilter in a
filetype plugin, so that the browse dialog would contain entries related to
the type of file you are currently editing. Disadvantage: This makes it
difficult to start editing a file of a different type. To overcome this, you
may want to add "All Files (*.*)\t*\n" as the final filter on Windows or "All
Files (*)\t*\n" on other platforms, so that the user can still access any
desired file.
can add the following as the final filter on Windows: >
All Files\t(*.*)\t*\n
<
Or the following on other platforms, so that the user can still access any
desired file: >
All Files\t(*)\t*\n
<
To avoid setting browsefilter when Vim does not actually support it, you can
use has("browsefilter"): >

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 9.1. Last change: 2025 Feb 23
*eval.txt* For Vim version 9.1. Last change: 2025 Jul 13
VIM REFERENCE MANUAL by Bram Moolenaar
@ -21,9 +21,10 @@ a remark is given.
1.1 Variable types
1.2 Function references |Funcref|
1.3 Lists |Lists|
1.4 Dictionaries |Dictionaries|
1.5 Blobs |Blobs|
1.6 More about variables |more-variables|
1.4 Tuples |Tuples|
1.5 Dictionaries |Dictionaries|
1.6 Blobs |Blobs|
1.7 More about variables |more-variables|
2. Expression syntax |expression-syntax|
3. Internal variable |internal-variables|
4. Builtin Functions |functions|
@ -46,8 +47,8 @@ Profiling is documented at |profiling|.
1.1 Variable types ~
*E712* *E896* *E897* *E899* *E1098*
*E1107* *E1135* *E1138*
There are ten types of variables:
*E1107* *E1135* *E1138* *E1523*
There are eleven types of variables:
*Number* *Integer*
Number A 32 or 64 bit signed number. |expr-number|
@ -63,6 +64,10 @@ String A NUL terminated string of 8-bit unsigned characters (bytes).
List An ordered sequence of items, see |List| for details.
Example: [1, 2, ['a', 'b']]
Tuple An ordered immutable sequence of items, see |Tuple| for
details.
Example: (1, 2, ('a', 'b'))
Dictionary An associative, unordered array: Each entry has a key and a
value. |Dictionary|
Examples:
@ -165,16 +170,17 @@ A List, Dictionary or Float is not a Number or String, thus evaluate to FALSE.
*E611* *E745* *E728* *E703* *E729* *E730* *E731* *E908* *E910*
*E913* *E974* *E975* *E976* *E1319* *E1320* *E1321* *E1322*
*E1323* *E1324*
|List|, |Dictionary|, |Funcref|, |Job|, |Channel|, |Blob|, |Class| and
|object| types are not automatically converted.
*E1323* *E1324* *E1520* *E1522*
|List|, |Tuple|, |Dictionary|, |Funcref|, |Job|, |Channel|, |Blob|, |Class|
and |object| types are not automatically converted.
*E805* *E806* *E808*
When mixing Number and Float the Number is converted to Float. Otherwise
there is no automatic conversion of Float. You can use str2float() for String
to Float, printf() for Float to String and float2nr() for Float to Number.
*E362* *E891* *E892* *E893* *E894* *E907* *E911* *E914*
*E362* *E891* *E892* *E893* *E894*
*E907* *E911* *E914* *E1521*
When expecting a Float a Number can also be used, but nothing else.
*no-type-checking*
@ -267,9 +273,9 @@ position in the sequence.
List creation ~
*E696* *E697*
A List is created with a comma-separated list of items in square brackets.
A List is created with a comma-separated sequence of items in square brackets.
Examples: >
:let mylist = [1, two, 3, "four"]
:let mylist = [1, "two", 3, "four"]
:let emptylist = []
An item can be any expression. Using a List for an item creates a
@ -327,13 +333,13 @@ similar to -1. >
:let otherlist = mylist[:] " make a copy of the List
Notice that the last index is inclusive. If you prefer using an exclusive
index use the |slice()| method.
index use the |slice()| function.
If the first index is beyond the last item of the List or the second item is
If the first index is beyond the last item of the List or the last index is
before the first item, the result is an empty list. There is no error
message.
If the second index is equal to or greater than the length of the list the
If the last index is equal to or greater than the length of the list the
length minus one is used: >
:let mylist = [0, 1, 2, 3]
:echo mylist[2:8] " result: [2, 3]
@ -463,8 +469,8 @@ Changing the order of items in a list: >
For loop ~
The |:for| loop executes commands for each item in a List, String or Blob.
A variable is set to each item in sequence. Example with a List: >
The |:for| loop executes commands for each item in a List, Tuple, String or
Blob. A variable is set to each item in sequence. Example with a List: >
:for item in mylist
: call Doit(item)
:endfor
@ -497,6 +503,8 @@ It is also possible to put remaining items in a List variable: >
: endif
:endfor
For a Tuple one tuple item at a time is used.
For a Blob one byte at a time is used.
For a String one character, including any composing characters, is used as a
@ -527,8 +535,216 @@ Don't forget that a combination of features can make things simple. For
example, to add up all the numbers in a list: >
:exe 'let sum = ' .. join(nrlist, '+')
1.4 Tuples ~
*tuple* *Tuple* *Tuples*
*E1532* *E1533*
A Tuple is an ordered sequence of items. An item can be of any type. Items
can be accessed by their index number. A Tuple is immutable.
1.4 Dictionaries ~
A Tuple is similar to a List but uses less memory and provides O(1) lookup
time for an item.
Tuple creation ~
*E1526* *E1527*
A Tuple is created with a comma-separated sequence of items in parentheses.
Examples: >
:let mytuple = (1, "two", 3, "four")
:let tuple = (5,)
:let emptytuple = ()
An item can be any expression. If there is only one item in the tuple, then
the item must be followed by a comma.
Using a Tuple for an item creates a Tuple of Tuples: >
:let nesttuple = ((11, 12), (21, 22), (31, 32))
Tuple index ~
*tuple-index* *E1519*
An item in the Tuple can be accessed by putting the index in square brackets
after the Tuple. Indexes are zero-based, thus the first item has index zero.
>
:let item = mytuple[0] " get the first item: 1
:let item = mytuple[2] " get the third item: 3
When the resulting item is a tuple this can be repeated: >
:let item = nesttuple[0][1] " get the first tuple, second item: 12
<
A negative index is counted from the end. Index -1 refers to the last item in
the Tuple, -2 to the last but one item, etc. >
:let last = mytuple[-1] " get the last item: "four"
To avoid an error for an invalid index use the |get()| function. When an item
is not available it returns zero or the default value you specify: >
:echo get(mytuple, idx)
:echo get(mytuple, idx, "NONE")
Tuple modification ~
*tuple-modification*
A tuple is immutable and items cannot be added or removed from a tuple. But
List and Dict items within a tuple can be modified: >
:let tuple = (1, [2, 3], {'a': 4})
:let tuple[1][0] = 10
:let tuple[2]['a'] = 20
Tuple concatenation ~
*tuple-concatenation*
Two tuples can be concatenated with the "+" operator: >
:let longtuple = mytuple + (5, 6)
:let longtuple = (5, 6) + mytuple
To prepend or append an item, turn it into a tuple by putting () around it.
The item must be followed by a comma.
*E1540*
Two variadic tuples with same item type can be concatenated but with different
item types cannot be concatenated. Examples: >
var a: tuple<...list<number>> = (1, 2)
var b: tuple<...list<string>> = ('a', 'b')
echo a + b # not allowed
var a: tuple<number, number> = (1, 2)
var b: tuple<...list<string>> = ('a', 'b')
echo a + b # allowed
var a: tuple<...list<number>> = (1, 2)
var b: tuple<number, number> = (3, 4)
echo a + b # not allowed
var a: tuple<...list<number>> = (1, 2)
var b: tuple<number, ...list<number>> = (3, 4)
echo a + b # not allowed
<
Note that a tuple is immutable and items cannot be added or removed from a
tuple.
Subtuple ~
*subtuple*
A part of the Tuple can be obtained by specifying the first and last index,
separated by a colon in square brackets: >
:let shorttuple = mytuple[2:-1] " get Tuple (3, "four")
Omitting the first index is similar to zero. Omitting the last index is
similar to -1. >
:let endtuple = mytuple[2:] " from item 2 to the end: (3, "four")
:let shorttuple = mytuple[2:2] " Tuple with one item: (3,)
:let othertuple = mytuple[:] " make a copy of the Tuple
Notice that the last index is inclusive. If you prefer using an exclusive
index, use the |slice()| function.
If the first index is beyond the last item of the Tuple or the last index is
before the first item, the result is an empty tuple. There is no error
message.
If the last index is equal to or greater than the length of the tuple, the
length minus one is used: >
:let mytuple = (0, 1, 2, 3)
:echo mytuple[2:8] " result: (2, 3)
NOTE: mytuple[s:e] means using the variable "s:e" as index. Watch out for
using a single letter variable before the ":". Insert a space when needed:
mytuple[s : e].
Tuple identity ~
*tuple-identity*
When variable "aa" is a tuple and you assign it to another variable "bb", both
variables refer to the same tuple: >
:let aa = (1, 2, 3)
:let bb = aa
<
Making a copy of a tuple is done with the |copy()| function. Using [:] also
works, as explained above. This creates a shallow copy of the tuple: For
example, changing a list item in the tuple will also change the item in the
copied tuple: >
:let aa = ([1, 'a'], 2, 3)
:let bb = copy(aa)
:let aa[0][1] = 'aaa'
:echo aa
< ([1, aaa], 2, 3) >
:echo bb
< ([1, aaa], 2, 3)
To make a completely independent tuple, use |deepcopy()|. This also makes a
copy of the values in the tuple, recursively. Up to a hundred levels deep.
The operator "is" can be used to check if two variables refer to the same
Tuple. "isnot" does the opposite. In contrast, "==" compares if two tuples
have the same value. >
:let atuple = (1, 2, 3)
:let btuple = (1, 2, 3)
:echo atuple is btuple
< 0 >
:echo atuple == btuple
< 1
Note about comparing tuples: Two tuples are considered equal if they have the
same length and all items compare equal, as with using "==". There is one
exception: When comparing a number with a string they are considered
different. There is no automatic type conversion, as with using "==" on
variables. Example: >
echo 4 == "4"
< 1 >
echo (4,) == ("4",)
< 0
Thus comparing Tuples is more strict than comparing numbers and strings. You
can compare simple values this way too by putting them in a tuple: >
:let a = 5
:let b = "5"
:echo a == b
< 1 >
:echo (a,) == (b,)
< 0
Tuple unpack ~
To unpack the items in a tuple to individual variables, put the variables in
square brackets, like list items: >
:let [var1, var2] = mytuple
When the number of variables does not match the number of items in the tuple
this produces an error. To handle any extra items from the tuple, append ";"
and a variable name (which will then be of type tuple): >
:let [var1, var2; rest] = mytuple
This works like: >
:let var1 = mytuple[0]
:let var2 = mytuple[1]
:let rest = mytuple[2:]
Except that there is no error if there are only two items. "rest" will be an
empty tuple then.
Tuple functions ~
*E1536*
Functions that are useful with a Tuple: >
:let xs = count(tuple, 'x') " count number of 'x's in tuple
:if empty(tuple) " check if tuple is empty
:let i = index(tuple, 'x') " index of first 'x' in tuple
:let l = items(tuple) " list of items in a tuple
:let string = join(tuple, ', ') " create string from tuple items
:let l = len(tuple) " number of items in tuple
:let big = max(tuple) " maximum value in tuple
:let small = min(tuple) " minimum value in tuple
:let r = repeat(tuple, n) " repeat a tuple n times
:let r = reverse(tuple) " reverse a tuple
:let s = slice(tuple, n1, n2) " slice a tuple
:let s = string(tuple) " String representation of tuple
:let l = tuple2list(tuple) " convert a tuple to list
:let t = list2tuple(list) " convert a list to tuple
<
*E1524*
A tuple cannot be used with the |map()|, |mapnew()| and |filter()| functions.
1.5 Dictionaries ~
*dict* *Dict* *Dictionaries* *Dictionary*
A Dictionary is an associative array: Each entry has a key and a value. The
entry can be located with the key. The entries are stored without a specific
@ -537,10 +753,10 @@ ordering.
Dictionary creation ~
*E720* *E721* *E722* *E723*
A Dictionary is created with a comma-separated list of entries in curly
A Dictionary is created with a comma-separated sequence of entries in curly
braces. Each entry has a key and a value, separated by a colon. Each key can
only appear once. Examples: >
:let mydict = {1: 'one', 2: 'two', 3: 'three'}
:let mydict = {'one': 1, 'two': 2, 'three': 3}
:let emptydict = {}
< *E713* *E716* *E717*
A key is always a String. You can use a Number, it will be converted to a
@ -570,8 +786,11 @@ An extra comma after the last entry is ignored.
Accessing entries ~
The normal way to access an entry is by putting the key in square brackets: >
:let mydict = {'one': 1, 'two': 2, 'three': 3}
:let val = mydict["one"]
:let mydict["four"] = 4
:let val = mydict.one
:let mydict.four = 4
You can add new entries to an existing Dictionary this way, unlike Lists.
@ -709,7 +928,7 @@ Functions that can be used with a Dictionary: >
:call map(dict, '">> " .. v:val') " prepend ">> " to each item
1.5 Blobs ~
1.6 Blobs ~
*blob* *Blob* *Blobs* *E978*
A Blob is a binary object. It can be used to read an image from a file and
send it over a channel, for example.
@ -856,7 +1075,7 @@ Making a copy of a Blob is done with the |copy()| function. Using [:] also
works, as explained above.
1.6 More about variables ~
1.7 More about variables ~
*more-variables*
If you need to know the type of a variable or expression, use the |type()|
function.
@ -907,16 +1126,18 @@ Expression syntax summary, from least to most significant:
etc. As above, append ? for ignoring case, # for
matching case
expr5 is expr5 same |List|, |Dictionary| or |Blob| instance
expr5 isnot expr5 different |List|, |Dictionary| or |Blob|
expr5 is expr5 same |List|, |Tuple|, |Dictionary| or |Blob|
instance
expr5 isnot expr5 different |List|, |Tuple|, |Dictionary| or
|Blob| instance
|expr5| expr6
expr6 << expr6 bitwise left shift
expr6 >> expr6 bitwise right shift
|expr6| expr7
expr7 + expr7 ... number addition, list or blob concatenation
expr7 + expr7 ... number addition, list or tuple or blob
concatenation
expr7 - expr7 ... number subtraction
expr7 . expr7 ... string concatenation
expr7 .. expr7 ... string concatenation
@ -935,8 +1156,10 @@ Expression syntax summary, from least to most significant:
+ expr9 unary plus
|expr10| expr11
expr10[expr1] byte of a String or item of a |List|
expr10[expr1] byte of a String or item of a |List| or
|Tuple|
expr10[expr1 : expr1] substring of a String or sublist of a |List|
or a slice of a |Tuple|
expr10.name entry in a |Dictionary|
expr10(expr1, ...) function call with |Funcref| variable
expr10->name(expr1, ...) |method| call
@ -945,6 +1168,7 @@ Expression syntax summary, from least to most significant:
"string" string constant, backslash is special
'string' string constant, ' is doubled
[expr1, ...] |List|
(expr1, ...) |Tuple|
{expr1: expr1, ...} |Dictionary|
#{key: expr1, ...} legacy |Dictionary|
&option option value
@ -1101,10 +1325,11 @@ Examples:
"abc" == "Abc" evaluates to 1 if 'ignorecase' is set, 0 otherwise
NOTE: In |Vim9| script 'ignorecase' is not used.
*E691* *E692*
*E691* *E692* *E1517* *E1518*
A |List| can only be compared with a |List| and only "equal", "not equal",
"is" and "isnot" can be used. This compares the values of the list,
recursively. Ignoring case means case is ignored when comparing item values.
Same applies for a |Tuple|.
*E735* *E736*
A |Dictionary| can only be compared with a |Dictionary| and only "equal", "not
@ -1124,12 +1349,13 @@ Dictionary and arguments, use |get()| to get the function name: >
if get(Part1, 'name') == get(Part2, 'name')
" Part1 and Part2 refer to the same function
< *E1037*
Using "is" or "isnot" with a |List|, |Dictionary| or |Blob| checks whether
the expressions are referring to the same |List|, |Dictionary| or |Blob|
instance. A copy of a |List| is different from the original |List|. When
using "is" without a |List|, |Dictionary| or |Blob|, it is equivalent to
using "equal", using "isnot" equivalent to using "not equal". Except that
a different type means the values are different: >
Using "is" or "isnot" with a |List|, |Tuple|, |Dictionary| or |Blob| checks
whether the expressions are referring to the same |List|, |Tuple|,
|Dictionary| or |Blob| instance. A copy of a |List| or |Tuple| is different
from the original |List| or |Tuple|. When using "is" without a |List|,
|Tuple|, |Dictionary| or |Blob|, it is equivalent to using "equal", using
"isnot" is equivalent to using "not equal". Except that a different type
means the values are different: >
echo 4 == '4'
1
echo 4 is '4'
@ -1147,7 +1373,7 @@ that: >
because 'x' converted to a Number is zero. However: >
echo [0] == ['x']
0
Inside a List or Dictionary this conversion is not used.
Inside a List or Tuple or Dictionary this conversion is not used.
In |Vim9| script the types must match.
@ -1191,13 +1417,14 @@ topmost bit (sometimes called the sign bit) is cleared. If the right operand
expr6 and expr7 *expr6* *expr7* *E1036* *E1051*
---------------
expr7 + expr7 Number addition, |List| or |Blob| concatenation *expr-+*
*expr-+*
expr7 + expr7 Number addition, |List| or |Tuple| or |Blob| concatenation
expr7 - expr7 Number subtraction *expr--*
expr7 . expr7 String concatenation *expr-.*
expr7 .. expr7 String concatenation *expr-..*
For |Lists| only "+" is possible and then both expr7 must be a list. The
result is a new list with the two lists Concatenated.
result is a new list with the two lists concatenated. Same for a |Tuple|.
For String concatenation ".." is preferred, since "." is ambiguous, it is also
used for |Dict| member access and floating point numbers.
@ -1295,7 +1522,8 @@ in any order. E.g., these are all possible:
expr10->(expr1, ...)[expr1]
Evaluation is always from left to right.
expr10[expr1] item of String or |List| *expr-[]* *E111*
*expr-[]* *E111*
expr10[expr1] item of String or |List| or |Tuple|
*E909* *subscript* *E1062*
In legacy Vim script:
If expr10 is a Number or String this results in a String that contains the
@ -1328,6 +1556,8 @@ Generally, if a |List| index is equal to or higher than the length of the
|List|, or more negative than the length of the |List|, this results in an
error.
A |Tuple| index is similar to a |List| index as explained above.
expr10[expr1a : expr1b] substring or |sublist| *expr-[:]* *substring*
@ -1369,6 +1599,7 @@ just above. Also see |sublist| below. Examples: >
:let l = mylist[:3] " first four items
:let l = mylist[4:4] " List with one item
:let l = mylist[:] " shallow copy of a List
A |Tuple| slice is similar to a |List| slice.
If expr10 is a |Blob| this results in a new |Blob| with the bytes in the
indexes expr1a and expr1b, inclusive. Examples: >
@ -2009,6 +2240,15 @@ v:charconvert_to
The name of the character encoding of a file after conversion.
Only valid while evaluating the 'charconvert' option.
*v:clipmethod*
v:clipmethod The current method of accessing the clipboard that is being
used. Can either have the value of:
wayland The Wayland protocol is being used.
x11 X11 selections are being used.
none The above methods are unavailable or
cannot be used.
See 'clipmethod' for more details.
*v:cmdarg* *cmdarg-variable*
v:cmdarg This variable is used for two purposes:
1. The extra arguments given to a file read/write command.
@ -2615,6 +2855,8 @@ v:t_typealias Value of |typealias| type. Read-only. See: |type()|
v:t_enum Value of |enum| type. Read-only. See: |type()|
*v:t_enumvalue* *t_enumvalue-variable*
v:t_enumvalue Value of |enumvalue| type. Read-only. See: |type()|
*v:t_tuple* *t_tuple-variable*
v:t_tuple Value of |Tuple| type. Read-only. See: |type()|
*v:termresponse* *termresponse-variable*
v:termresponse The escape sequence returned by the terminal for the |t_RV|
@ -2736,6 +2978,12 @@ v:vim_did_enter Zero until most of startup is done. It is set to one just
*v:warningmsg* *warningmsg-variable*
v:warningmsg Last given warning message. It's allowed to set this variable.
*v:wayland_display*
v:wayland_display
The name of the Wayland display that Vim is connected to.
Equivalent to the $WAYLAND_DISPLAY environment variable.
If this is empty, then Vim is not connected to any display.
*v:windowid* *windowid-variable*
v:windowid When any X11/Wayland based GUI is running or when running in a
terminal and Vim connects to the X server (|-X|) this will be
@ -2934,13 +3182,13 @@ declarations and assignments do not use a command. |vim9-declaration|
:let &g:{option-name} -= {expr1}
Like above, but only set the global value of an option
(if there is one). Works like |:setglobal|.
*E1093*
*E1093* *E1537* *E1538* *E1535*
:let [{name1}, {name2}, ...] = {expr1} *:let-unpack* *E687* *E688*
{expr1} must evaluate to a |List|. The first item in
the list is assigned to {name1}, the second item to
{name2}, etc.
{expr1} must evaluate to a |List| or a |Tuple|. The
first item in the list or tuple is assigned to
{name1}, the second item to {name2}, etc.
The number of names must match the number of items in
the |List|.
the |List| or |Tuple|.
Each name can be one of the items of the ":let"
command as mentioned above.
Example: >
@ -2957,16 +3205,22 @@ declarations and assignments do not use a command. |vim9-declaration|
:let [{name1}, {name2}, ...] .= {expr1}
:let [{name1}, {name2}, ...] += {expr1}
:let [{name1}, {name2}, ...] -= {expr1}
Like above, but append/add/subtract the value for each
|List| item.
:let [{name1}, {name2}, ...] *= {expr1}
:let [{name1}, {name2}, ...] /= {expr1}
:let [{name1}, {name2}, ...] %= {expr1}
Like above, but append, add, subtract, multiply,
divide, or modulo the value for each |List| or |Tuple|
item.
:let [{name}, ..., ; {lastname}] = {expr1} *E452*
Like |:let-unpack| above, but the |List| may have more
items than there are names. A list of the remaining
items is assigned to {lastname}. If there are no
remaining items {lastname} is set to an empty list.
Like |:let-unpack| above, but the |List| or |Tuple|
may have more items than there are names. A list or a
tuple of the remaining items is assigned to
{lastname}. If there are no remaining items,
{lastname} is set to an empty list or tuple.
Example: >
:let [a, b; rest] = ["aval", "bval", 3, 4]
:let [a, b; rest] = ("aval", "bval", 3, 4)
<
:let [{name}, ..., ; {lastname}] .= {expr1}
:let [{name}, ..., ; {lastname}] += {expr1}
@ -3161,23 +3415,26 @@ text...
get an error message: "E940: Cannot lock or unlock
variable {name}".
[depth] is relevant when locking a |List| or
|Dictionary|. It specifies how deep the locking goes:
[depth] is relevant when locking a |List|, a |Tuple|
or a |Dictionary|. It specifies how deep the locking
goes:
0 Lock the variable {name} but not its
value.
1 Lock the |List| or |Dictionary| itself,
cannot add or remove items, but can
still change their values.
1 Lock the |List| or |Tuple| or
|Dictionary| itself, cannot add or
remove items, but can still change
their values.
2 Also lock the values, cannot change
the items. If an item is a |List| or
|Dictionary|, cannot add or remove
items, but can still change the
|Tuple| or |Dictionary|, cannot add or
remove items, but can still change the
values.
3 Like 2 but for the |List| /
|Dictionary| in the |List| /
3 Like 2 but for the |List| / |Tuple| /
|Dictionary| in the |List| / |Tuple| /
|Dictionary|, one level deeper.
The default [depth] is 2, thus when {name} is a |List|
or |Dictionary| the values cannot be changed.
The default [depth] is 2, thus when {name} is a
|List|, a |Tuple| or a |Dictionary| the values cannot
be changed.
Example with [depth] 0: >
let mylist = [1, 2, 3]
@ -3282,7 +3539,7 @@ text...
:endfo[r] *:endfo* *:endfor*
Repeat the commands between `:for` and `:endfor` for
each item in {object}. {object} can be a |List|,
a |Blob| or a |String|. *E1177*
a |Tuple|, a |Blob| or a |String|. *E1177*
Variable {var} is set to the value of each item.
In |Vim9| script the loop variable must not have been
@ -4907,7 +5164,11 @@ executable. It takes the following arguments:
filetype string
executable string
*dist#vim9#Open()* *:Open*
*package-open*
The |:Open| and |:Launch| command are provided by the included plugin
$VIMRUNTIME/plugin/openPlugin.vim
*dist#vim9#Open()* *:Open* *:URLOpen*
*g:Openprg* *gx*
dist#vim9#Open(file: string) ~
@ -4915,6 +5176,11 @@ Opens `path` with the system default handler (macOS `open`, Windows
`explorer.exe`, Linux `xdg-open`, …). If the variable |g:Openprg| exists the
string specified in the variable is used instead.
The |:Open| user command uses file completion for its argument.
The |:URLOpen| user command works the same but does not perform file
completion and therefore does not expand special characters |cmdline-special|.
This function is by default called using the gx mapping. In visual mode
tries to open the visually selected text.
@ -4932,17 +5198,19 @@ NOTE: Escaping of the path is automatically applied.
Usage: >vim
:call dist#vim9#Open(<path>)
:Open <path>
:URLOpen <path>
<
*dist#vim9#Launch()* *:Launch*
*dist#vim9#Launch()* *:Launch*
dist#vim9#Launch(file: string) ~
Launches <args> with the appropriate system programs. Intended for launching
GUI programs within Vim.
The |:Launch| user command uses shell completion for its first argument.
NOTE: escaping of <args> is left to the user
Examples: >vim
Examples: >
vim9script
import autoload 'dist/vim9.vim'

View File

@ -1,4 +1,4 @@
*filetype.txt* For Vim version 9.1. Last change: 2025 Feb 25
*filetype.txt* For Vim version 9.1. Last change: 2025 May 10
VIM REFERENCE MANUAL by Bram Moolenaar
@ -153,11 +153,17 @@ variables can be used to overrule the filetype used for certain extensions:
*.f g:filetype_f |ft-forth-syntax|
*.frm g:filetype_frm |ft-form-syntax|
*.fs g:filetype_fs |ft-forth-syntax|
*.h g:c_syntax_for_h |ft-c-syntax|
*.h g:c_syntax_for_h |ft-c-syntax| (deprecated)
*.h g:ch_syntax_for_h |ft-ch-syntax| (deprecated)
*.h g:filetype_h |ft-c-syntax|
|ft-ch-syntax|
|ft-cpp-syntax|
*.i g:filetype_i |ft-progress-syntax|
*.inc g:filetype_inc
*.lsl g:filetype_lsl
*.m g:filetype_m |ft-mathematica-syntax|
*[mM]makefile,*.mk,*.mak,[mM]akefile*
g:make_flavor |ft-make-syntax|
*.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md
g:filetype_md |ft-pandoc-syntax|
*.mod g:filetype_mod
@ -263,7 +269,7 @@ D. If your filetype can only be detected by inspecting the contents of the
item of the 'runtimepath' option. Example for Unix: >
:!mkdir ~/.vim
<
2. Create a vim script file for doing this. Example: >
2. Create a Vim script file for doing this. Example: >
if did_filetype() " filetype already set..
finish " ..don't do these checks
endif
@ -640,6 +646,35 @@ One command, :DiffGitCached, is provided to show a diff of the current commit
in the preview window. It is equivalent to calling "git diff --cached" plus
any arguments given to the command.
GIT REBASE *ft-gitrebase-plugin*
The gitrebase filetype defines the following buffer-local commands, to help
with interactive `git rebase`: >
:Drop " to discard this commit
:Edit " to stop for editing this commit
:Fixup " to squash (but discard the message) into the previous one
:Pick " to pick this commit (the cursor is on)
:Reword " to pick this commit, but change the commit message
:Squash " to squash this commit into the previous one
In addition, the following command can be used to cycle between the different
possibilities: >
:Cycle " to cycle between the previous commands
<
The `:Cycle` command is also mapped to the CTRL-A and CTRL-X keys.
For details, see `git-rebase --help`.
GLEAM *ft-gleam-plugin*
By default the following options are set for the recommended gleam style: >
setlocal expandtab shiftwidth=2 softtabstop=2
To disable this behavior, set the following variable in your vimrc: >
let g:gleam_recommended_style = 0
GO *ft-go-plugin*
@ -667,6 +702,32 @@ HARE *ft-hare*
Since the text for this plugin is rather long it has been put in a separate
file: |ft_hare.txt|.
HTML *ft-html-plugin*
Tag folding poses a few difficulties. Many elements, e.g. `blockquote`, are
always delimited by start and end tags; end tags for some elements, e.g. `p`,
can be omitted in certain contexts; void elements, e.g. `hr`, have no end tag.
Although the rules for supporting omissible end tags are ad-hoc and involved
[0], they apply to elements in scope. Assuming syntactical wellformedness, an
end tag can be associated with its nearest matching start tag discoverable in
scope [1] and towards the beginning of a file, whereas all unbalanced tags and
inlined tags can be disregarded. Having syntax highlighting in effect, tag
folding using the |fold-expr| method can be enabled with: >
let g:html_expr_folding = 1
<
By default, tag folding will be redone from scratch after each occurrence of
a |TextChanged| or an |InsertLeave| event. Such frequency may not be desired,
especially for large files, and this recomputation can be disabled with: >
let g:html_expr_folding_without_recomputation = 1
doautocmd FileType
<
To force another recomputation, do: >
unlet! b:foldsmap
normal zx
<
[0] https://html.spec.whatwg.org/multipage/syntax.html#optional-tags
[1] https://en.wikipedia.org/wiki/Dangling_else
IDRIS2 *ft-idris2-plugin*
By default the following options are set: >
@ -776,7 +837,7 @@ Local mappings:
to the end of the file in Normal mode. This means "> " is inserted in
each line.
MAN *ft-man-plugin* *:Man* *man.vim*
MAN *ft-man-plugin* *:Man* *:ManReload* *man.vim*
This plugin displays a manual page in a nice way. See |find-manpage| in the
user manual for more information.
@ -793,6 +854,8 @@ Commands:
Man {name} Display the manual page for {name} in a window.
Man {number} {name}
Display the manual page for {name} in a section {number}.
ManReload Reload the cache of available man pages used for |:Man| argument
completion.
Global mapping:
<Leader>K Displays the manual page for the word under the cursor.
@ -823,6 +886,14 @@ desired folding style instead. For example: >
If you would like :Man {number} {name} to behave like man {number} {name} by
not running man {name} if no page is found, then use this: >
let g:ft_man_no_sect_fallback = 1
<
*g:ft_man_implementation*
The completion for the :Man command tries to guess which implementation of man
the system has. If it guesses wrong, you can set g:ft_man_implementation to
one of these values:
'man-db' https://man-db.nongnu.org/
'' Unknown, fall back to completing shell commands
instead of man pages.
You may also want to set 'keywordprg' to make the |K| command open a manual
page in a Vim window: >
@ -874,6 +945,12 @@ the PDF. The following are treated as tags:
These maps can be disabled with >
:let g:no_pdf_maps = 1
PLSQL *ft-plsql-plugin*
To enable syntax folding in PL/SQL filetypes, set the following variable: >
:let g:plsql_fold = 1
<
PYTHON *ft-python-plugin* *PEP8*
@ -992,6 +1069,13 @@ functions with [[ and ]]. Move around comments with ]" and [".
The mappings can be disabled with: >
let g:no_vim_maps = 1
YAML *ft-yaml-plugin*
By default, the YAML filetype plugin enables the following options: >
setlocal shiftwidth=2 softtabstop=2
To disable this, set the following variable: >
let g:yaml_recommended_style = 0
ZIG *ft-zig-plugin*

View File

@ -1,4 +1,4 @@
*fold.txt* For Vim version 9.1. Last change: 2024 Dec 17
*fold.txt* For Vim version 9.1. Last change: 2025 Jul 15
VIM REFERENCE MANUAL by Bram Moolenaar
@ -164,7 +164,7 @@ level is found.
If this proves difficult, the next best thing could be to cache all fold
levels in a buffer-local variable (b:foldlevels) that is only updated on
|b:changedtick|:
>vim
>
vim9script
def MyFoldFunc(): number
if b:lasttick == b:changedtick
@ -642,14 +642,17 @@ what you type!
When using an operator, a closed fold is included as a whole. Thus "dl"
deletes the whole closed fold under the cursor.
For Ex commands that work on buffer lines the range is adjusted to always
For Ex commands that operate on buffer lines, the range is adjusted to always
start at the first line of a closed fold and end at the last line of a closed
fold. Thus this command: >
fold. Thus, this command: >
:s/foo/bar/g
when used with the cursor on a closed fold, will replace "foo" with "bar" in
all lines of the fold.
This does not happen for |:folddoopen| and |:folddoclosed|.
Note that for some Ex commands like |:source| the range is only adjusted when
using a two line specifiers [range].
When editing a buffer that has been edited before, the last used folding
settings are used again. For manual folding the defined folds are restored.
For all folding methods the manually opened and closed folds are restored.

View File

@ -1,4 +1,4 @@
*help.txt* For Vim version 9.1. Last change: 2024 Dec 06
*help.txt* For Vim version 9.1. Last change: 2025 Jun 27
VIM - main help file
k
@ -187,6 +187,9 @@ GUI ~
|gui_w32.txt| Win32 GUI
|gui_x11.txt| X11 GUI
System Integration ~
|wayland.txt| Wayland protocol support
Interfaces ~
|if_cscop.txt| using Cscope with Vim
|if_lua.txt| Lua interface

View File

@ -1,4 +1,4 @@
*helphelp.txt* For Vim version 9.1. Last change: 2025 Jan 11
*helphelp.txt* For Vim version 9.1. Last change: 2025 Jul 07
VIM REFERENCE MANUAL by Bram Moolenaar
@ -287,9 +287,11 @@ The latter supports the following normal commands: >
<Home> | select first entry
<End> | select last entry
The plugin can also provide a table of contents in man pages, markdown files,
and terminal buffers. In the latter, the entries will be the past executed
shell commands. To find those, the following pattern is used: >
The plugin can also provide a table of contents in buffers of the following
filetypes: asciidoc, html, man, markdown, tex, vim, and xhtml. In addition
it also provide a table of contents for a terminal buffer, which produces
entries that are the past executed shell commands. To find those, by default,
the following pattern is used: >
^\w\+@\w\+:\f\+\$\s
@ -303,6 +305,10 @@ Tip: After inserting a pattern to look for with the `/` command, if you press
<Esc> instead of <CR>, you can then get more context for each remaining entry
by pressing `J` or `K`.
Refer to |helptoc.txt| for more details about helptoc, particularly about
using it with filetypes other than help, and configuring its options.
Note: You need to `packadd helptoc` before you can jump to |helptoc.txt|.
==============================================================================
2. Translated help files *help-translated*
@ -383,6 +389,10 @@ standard Vim help files, except for the first line. If you are writing a new
help file it's best to copy one of the existing files and use it as a
template.
Vim help files generally use 2 spaces after a sentence (since they are written
using a fixed-width font and that was the prefered style in the 70s/80s), like
what is described here: https://english.stackexchange.com/a/2602
The first line in a help file should have the following format:
*plugin_name.txt* {short description of the plugin}
@ -400,9 +410,27 @@ and 'tabstop' options and the 'filetype' to "help". Never set a global option
in such a modeline, that can have undesired consequences.
STYLE
If your Vim has 'modeline' enabled, Vim should follow the preferred style
automatically when editing built-in help files.
Vim help files should be formatted for a 'textwidth' of 78 characters, so they
look good in a typical 80 x 24 terminal window.
Use two spaces between the final dot of a sentence of the first letter of the
next sentence. Like this.
Use tab characters for aligning content, with a 'tabstop' setting of 8.
This also helps reduce the file size.
Always use |:retab| after you have finished editing. Don't blindly use
|:retab!|, always review what will be changed to avoid unwanted changes.
TAGS
To define a help tag, place the name between asterisks (*tag-name*). The
To define a help tag, place the name between asterisks ("*tag-name*"). The
tag-name should be different from all the Vim help tag names and ideally
should begin with the name of the Vim plugin. The tag name is usually right
aligned on a line.
@ -471,8 +499,13 @@ highlighting. So do these:
You can find the details in $VIMRUNTIME/syntax/help.vim
GENDER NEUTRAL LANGUAGE
FILETYPE COMPLETION *ft-help-omni*
To get completion for help tags when writing a tag reference, you can use the
|i_CTRL-X_CTRL-O| command.
GENDER NEUTRAL LANGUAGE
*gender-neutral* *inclusion*
Vim is for everybody, no matter race, gender or anything. For new or updated
help text, gender neutral language is recommended. Some of the help text is

View File

@ -1,4 +1,4 @@
*if_perl.txt* For Vim version 9.1. Last change: 2023 May 14
*if_perl.txt* For Vim version 9.1. Last change: 2025 Apr 27
VIM REFERENCE MANUAL by Sven Verdoolaege
@ -74,7 +74,7 @@ The ActiveState one should work, Strawberry Perl is a good alternative.
|script-here|.
Example vim script: >
Example Vim script: >
function! WhitePearl()
perl << EOF

View File

@ -1,4 +1,4 @@
*if_pyth.txt* For Vim version 9.1. Last change: 2024 Nov 09
*if_pyth.txt* For Vim version 9.1. Last change: 2025 Mar 26
VIM REFERENCE MANUAL by Paul Moore
@ -184,8 +184,9 @@ vim.eval(str) *python-eval*
evaluator (see |expression|). Returns the expression result as:
- a string if the Vim expression evaluates to a string or number
- a list if the Vim expression evaluates to a Vim list
- a tuple if the Vim expression evaluates to a Vim tuple
- a dictionary if the Vim expression evaluates to a Vim dictionary
Dictionaries and lists are recursively expanded.
Dictionaries, lists and tuples are recursively expanded.
Examples: >
:" value of the 'textwidth' option
:py text_width = vim.eval("&tw")
@ -196,6 +197,8 @@ vim.eval(str) *python-eval*
:" Result is a string! Use string.atoi() to convert to a number.
:py str = vim.eval("12+12")
:
:py tuple = vim.eval('(1, 2, 3)')
:
:py tagList = vim.eval('taglist("eval_expr")')
< The latter will return a python list of python dicts, for instance:
[{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name': ~
@ -207,8 +210,8 @@ vim.eval(str) *python-eval*
vim.bindeval(str) *python-bindeval*
Like |python-eval|, but returns special objects described in
|python-bindeval-objects|. These python objects let you modify (|List|
or |Dictionary|) or call (|Funcref|) vim objects.
|python-bindeval-objects|. These python objects let you modify
(|List|, |Tuple| or |Dictionary|) or call (|Funcref|) vim objects.
vim.strwidth(str) *python-strwidth*
Like |strwidth()|: returns number of display cells str occupies, tab
@ -688,6 +691,22 @@ vim.List object *python-List*
print isinstance(l, vim.List) # True
class List(vim.List): # Subclassing
vim.Tuple object *python-Tuple*
Sequence-like object providing access to vim |Tuple| type.
Supports `.locked` attribute, see |python-.locked|. Also supports the
following methods:
Method Description ~
__new__(), __new__(iterable)
You can use `vim.Tuple()` to create new vim tuples.
Without arguments constructs empty list.
Examples: >
t = vim.Tuple("abc") # Constructor, result: ('a', 'b', 'c')
print t[1:] # slicing
print t[0] # getting item
for i in t: # iteration
print isinstance(t, vim.Tuple) # True
class Tuple(vim.Tuple): # Subclassing
vim.Function object *python-Function*
Function-like object, acting like vim |Funcref| object. Accepts special
keyword argument `self`, see |Dictionary-function|. You can also use

View File

@ -1,4 +1,4 @@
*index.txt* For Vim version 9.1. Last change: 2025 Jan 03
*index.txt* For Vim version 9.1. Last change: 2025 Jun 28
VIM REFERENCE MANUAL by Bram Moolenaar
@ -163,6 +163,7 @@ commands in CTRL-X submode *i_CTRL-X_index*
|i_CTRL-X_CTRL-N| CTRL-X CTRL-N next completion
|i_CTRL-X_CTRL-O| CTRL-X CTRL-O omni completion
|i_CTRL-X_CTRL-P| CTRL-X CTRL-P previous completion
|i_CTRL-X_CTRL-R| CTRL-X CTRL-R complete contents from registers
|i_CTRL-X_CTRL-S| CTRL-X CTRL-S spelling suggestions
|i_CTRL-X_CTRL-T| CTRL-X CTRL-T complete identifiers from thesaurus
|i_CTRL-X_CTRL-Y| CTRL-X CTRL-Y scroll down
@ -1263,6 +1264,7 @@ tag command action ~
|:class| :class start of a class declaration
|:clast| :cla[st] go to the specified error, default last one
|:clearjumps| :cle[arjumps] clear the jump list
|:clipreset| :clip[reset] reset 'clipmethod'
|:clist| :cl[ist] list all errors
|:close| :clo[se] close current window
|:cmap| :cm[ap] like ":map" but for Command-line mode
@ -1400,6 +1402,8 @@ tag command action ~
|:inoremenu| :inoreme[nu] like ":noremenu" but for Insert mode
|:intro| :int[ro] print the introductory message
|:interface| :interface start of an interface declaration
|:iput| :ip[ut] like |:put|, but adjust the indent to the
current line
|:isearch| :is[earch] list one line where identifier matches
|:isplit| :isp[lit] split window and jump to definition of
identifier
@ -1581,6 +1585,7 @@ tag command action ~
|:redraw| :redr[aw] force a redraw of the display
|:redrawstatus| :redraws[tatus] force a redraw of the status line(s)
|:redrawtabline| :redrawt[abline] force a redraw of the tabline
|:redrawtabpanel| :redrawtabp[anel] force a redraw of the tabpanel
|:registers| :reg[isters] display the contents of registers
|:resize| :res[ize] change current window height
|:retab| :ret[ab] change tab size
@ -1736,6 +1741,7 @@ tag command action ~
|:unabbreviate| :una[bbreviate] remove abbreviation
|:unhide| :unh[ide] open a window for each loaded file in the
buffer list
|:uniq| :uni[q] uniq lines
|:unlet| :unl[et] delete variable
|:unlockvar| :unlo[ckvar] unlock variables
|:unmap| :unm[ap] remove mapping
@ -1772,6 +1778,7 @@ tag command action ~
|:winsize| :wi[nsize] get or set window size (obsolete)
|:wincmd| :winc[md] execute a Window (CTRL-W) command
|:winpos| :winp[os] get or set window position
|:wlrestore| :wl[restore] restore the Wayland compositor connection
|:wnext| :wn[ext] write to a file and go to next file in
argument list
|:wprevious| :wp[revious] write to a file and go to previous file in

View File

@ -1,4 +1,4 @@
*insert.txt* For Vim version 9.1. Last change: 2025 Feb 14
*insert.txt* For Vim version 9.1. Last change: 2025 Jul 05
VIM REFERENCE MANUAL by Bram Moolenaar
@ -222,6 +222,10 @@ CTRL-Q Same as CTRL-V.
CTRL-SHIFT-V *i_CTRL-SHIFT-V* *i_CTRL-SHIFT-Q*
CTRL-SHIFT-Q Works just like CTRL-V, unless |modifyOtherKeys| is active,
then it inserts the Escape sequence for a key with modifiers.
Note: When CTRL-SHIFT-V is intercepted by your system (e.g.,
to paste text) you can often use CTRL-SHIFT-Q instead.
However, in some terminals (e.g. GNOME Terminal), CTRL-SHIFT-Q
quits the terminal without confirmation.
CTRL-X Enter CTRL-X mode. This is a sub-mode where commands can
be given to complete words or scroll the window. See
@ -525,7 +529,7 @@ paragraph, no matter where the cursor currently is. Or you can use Visual
mode: hit "v", move to the end of the block, and type "gq". See also |gq|.
==============================================================================
4. 'expandtab', 'smarttab' and 'softtabstop' options *ins-expandtab*
4. 'expandtab', 'softtabstop' and 'smarttab' options *ins-expandtab*
If the 'expandtab' option is on, spaces will be used to fill the amount of
whitespace of the tab. If you want to enter a real <Tab>, type CTRL-V first
@ -536,13 +540,6 @@ number of characters in the line increases. Backspacing will delete one
space at a time. The original character will be put back for only one space
that you backspace over (the last one).
*ins-smarttab*
When the 'smarttab' option is on, a <Tab> inserts 'shiftwidth' positions at
the beginning of a line and 'tabstop' positions in other places. This means
that often spaces instead of a <Tab> character are inserted. When 'smarttab'
is off, a <Tab> always inserts 'tabstop' positions, and 'shiftwidth' is only
used for ">>" and the like.
*ins-softtabstop*
When the 'softtabstop' option is non-zero, a <Tab> inserts 'softtabstop'
positions, and a <BS> used to delete white space, will delete 'softtabstop'
@ -557,6 +554,13 @@ the cursor. Otherwise you cannot always delete a single character before the
cursor. You will have to delete 'softtabstop' characters first, and then type
extra spaces to get where you want to be.
*ins-smarttab*
When the 'smarttab' option is on, the <Tab> key indents by 'shiftwidth' if the
cursor is in leading whitespace. The <BS> key has the opposite effect. This
behaves as if 'softtabstop' were set to the value of 'shiftwidth'. This option
allows the user to set 'softtabstop' to a value other than 'shiftwidth' and
still use the <Tab> key for indentation.
==============================================================================
5. Replace mode *Replace* *Replace-mode* *mode-replace*
@ -644,7 +648,8 @@ Completion can be done for:
10. User defined completion |i_CTRL-X_CTRL-U|
11. omni completion |i_CTRL-X_CTRL-O|
12. Spelling suggestions |i_CTRL-X_s|
13. keywords in 'complete' |i_CTRL-N| |i_CTRL-P|
13. completions from 'complete' |i_CTRL-N| |i_CTRL-P|
14. contents from registers |i_CTRL-X_CTRL-R|
Additionally, |i_CTRL-X_CTRL-Z| stops completion without changing the text.
@ -654,13 +659,16 @@ and one of the CTRL-X commands. You exit CTRL-X mode by typing a key that is
not a valid CTRL-X mode command. Valid keys are the CTRL-X command itself,
CTRL-N (next), and CTRL-P (previous).
By default, the possible completions are showed in a menu and the first
completion is inserted into the text. This can be adjusted with 'completeopt'.
To get the current completion information, |complete_info()| can be used.
Also see the 'infercase' option if you want to adjust the case of the match.
When inserting a selected candidate word from the |popup-menu|, the part of
the candidate word that does not match the query is highlighted using
|hl-ComplMatchIns|. If fuzzy is enabled in 'completopt', highlighting will not
be applied.
|hl-ComplMatchIns|. If fuzzy is enabled in 'completeopt', highlighting will
not be applied.
*complete_CTRL-E*
When completion is active you can use CTRL-E to stop it and go back to the
@ -1015,6 +1023,26 @@ CTRL-X CTRL-V Guess what kind of item is in front of the cursor and
completion, for example: >
:imap <Tab> <C-X><C-V>
Completing contents from registers *compl-register-words*
*i_CTRL-X_CTRL-R*
CTRL-X CTRL-R Guess what kind of item is in front of the cursor from
all registers and find the first match for it.
Further use of CTRL-R (without CTRL-X) will insert the
register content, see |i_CTRL-R|.
'ignorecase' applies to the matching.
CTRL-N Search forwards for next match. This match replaces
the previous one.
CTRL-P Search backwards for previous match. This match
replaces the previous one.
CTRL-X CTRL-R Further use of CTRL-X CTRL-R will copy the line
following the previous expansion in other contexts
unless a double CTRL-X is used (e.g. this switches
from completing register words to register contents).
User defined completion *compl-function*
Completion is done by a function that can be defined by the user with the
@ -1075,25 +1103,23 @@ CTRL-X s Locate the word in front of the cursor and find the
previous one.
Completing keywords from different sources *compl-generic*
Completing from different sources *compl-generic*
*i_CTRL-N*
CTRL-N Find next match for words that start with the
keyword in front of the cursor, looking in places
specified with the 'complete' option. The found
keyword is inserted in front of the cursor.
CTRL-N Find the next match for a word ending at the cursor,
using the sources specified in the 'complete' option.
All sources complete from keywords, except functions,
which may complete from non-keyword. The matched
text is inserted before the cursor.
*i_CTRL-P*
CTRL-P Find previous match for words that start with the
keyword in front of the cursor, looking in places
specified with the 'complete' option. The found
keyword is inserted in front of the cursor.
CTRL-P Same as CTRL-N, but find the previous match.
CTRL-N Search forward for next matching keyword. This
keyword replaces the previous matching keyword.
CTRL-N Search forward through the matches and insert the
next one.
CTRL-P Search backwards for next matching keyword. This
keyword replaces the previous matching keyword.
CTRL-P Search backward through the matches and insert the
previous one.
CTRL-X CTRL-N or
CTRL-X CTRL-P Further use of CTRL-X CTRL-N or CTRL-X CTRL-P will
@ -1163,6 +1189,9 @@ For example, the function can contain this: >
let matches = ... list of words ...
return {'words': matches, 'refresh': 'always'}
<
If looking for matches is time-consuming, |complete_check()| may be used to
maintain responsiveness.
*complete-items*
Each list item can either be a string or a Dictionary. When it is a string it
is used as the completion. When it is a Dictionary it can contain these
@ -1340,6 +1369,7 @@ use all space available.
The 'pumwidth' option can be used to set a minimum width. The default is 15
characters.
*compl-states*
There are three states:
1. A complete match has been inserted, e.g., after using CTRL-N or CTRL-P.
2. A cursor key has been used to select another match. The match was not

View File

@ -1,4 +1,4 @@
*map.txt* For Vim version 9.1. Last change: 2024 Oct 08
*map.txt* For Vim version 9.1. Last change: 2025 Jul 14
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1654,6 +1654,7 @@ completion can be enabled:
-complete=messages |:messages| suboptions
-complete=option options
-complete=packadd optional package |pack-add| names
-complete=retab |:retab| suboptions
-complete=runtime file and directory names in |'runtimepath'|
-complete=scriptnames sourced script names
-complete=shellcmd Shell command

View File

@ -1,4 +1,4 @@
*motion.txt* For Vim version 9.1. Last change: 2024 Dec 17
*motion.txt* For Vim version 9.1. Last change: 2025 Apr 03
VIM REFERENCE MANUAL by Bram Moolenaar
@ -895,12 +895,12 @@ Numbered mark should be stored. See |viminfo-file-marks|.
*'[* *`[*
'[ `[ To the first character of the previously changed
or yanked text.
'[ `[ To the first character of the previously changed,
or yanked text. Also set when writing the buffer.
*']* *`]*
'] `] To the last character of the previously changed or
yanked text.
yanked text. Also set when writing the buffer.
After executing an operator the Cursor is put at the beginning of the text
that was operated upon. After a put command ("p" or "P") the cursor is

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
*pattern.txt* For Vim version 9.1. Last change: 2024 Dec 26
*pattern.txt* For Vim version 9.1. Last change: 2025 Jul 10
VIM REFERENCE MANUAL by Bram Moolenaar
@ -141,6 +141,7 @@ CTRL-C Interrupt current (search) command. Use CTRL-Break on
help users who use "vim file | grep word" and don't
know how to get out (blindly typing :qa<CR> would
work).
If a popup is open, the active popup will be closed.
*:noh* *:nohlsearch*
:noh[lsearch] Stop the highlighting for the 'hlsearch' option. It
@ -182,6 +183,17 @@ matches in every line with `:vglobal`.
For the |:s| command the "e" flag can be used to avoid the error message
|:s_flags|.
*search-options*
The following options affect how a search is performed in Vim:
'hlsearch' highlight matches
'ignorecase' ignore case when searching
'imsearch' use |IME| when entering the search pattern
'incsearch' show matches incrementally as the pattern is typed
'maxsearchcount' maximum number for the search count |shm-S|
'shortmess' suppress messages |shm-s|; show search count |shm-S|
'smartcase' override 'ignorecase' if pattern contains uppercase
'wrapscan' continue searching from the start of the file
*search-offset* *{offset}*
These commands search for the specified pattern. With "/" and "?" an
additional offset may be given. There are two types of offsets: line offsets
@ -1221,7 +1233,8 @@ x A single character, with no special meaning, matches itself
\o40 octal number of character up to 0o377
\x20 hexadecimal number of character up to 0xff
\u20AC hex. number of multibyte character up to 0xffff
\U1234 hex. number of multibyte character up to 0xffffffff
\U1234 hex. number of multibyte character up to 8 characters
0xffffffff |E1541|
NOTE: The other backslash codes mentioned above do not work inside
[]!
- Matching with a collection can be slow, because each character in
@ -1262,7 +1275,8 @@ x A single character, with no special meaning, matches itself
\%u20AC Matches the character specified with up to four hexadecimal
characters.
\%U1234abcd Matches the character specified with up to eight hexadecimal
characters, up to 0x7fffffff
characters, up to 0x7fffffff (the maximum allowed value is INT_MAX
|E1541|, but the maximum valid Unicode codepoint is U+10FFFF).
==============================================================================
7. Ignoring case in a pattern */ignorecase*

View File

@ -1,4 +1,4 @@
*pi_getscript.txt* For Vim version 9.1. Last change: 2024 Oct 05
*pi_getscript.txt* For Vim version 9.1. Last change: 2025 Apr 27
>
GETSCRIPT REFERENCE MANUAL by Charles E. Campbell
<
@ -156,7 +156,7 @@ may have. As an example, consider: >
" GetLatestVimScripts: 884 1 :AutoInstall: AutoAlign.vim
This comment line tells getscript.vim to check vimscript #884 and that the
This comment line tells getscript.vim to check Vim script #884 and that the
script is automatically installable. Getscript will also use this line to
help build the GetLatestVimScripts.dat file, by including a line such as: >
@ -348,38 +348,43 @@ after/syntax/c.vim contained in it to overwrite a user's c.vim.
Doesn't override vimball installation.
>
g:GetLatestVimScripts_scriptaddr
< default='https://www.vim.org/scripts/script.php?script_id='
< default='https://www.vim.org/scripts/script.php?script_id='
Override this if your system needs
... ='http://vim.sourceforge.net/script.php?script_id='
>
g:GetLatestVimScripts_downloadaddr
< default='https://www.vim.org/scripts/download_script.php?src_id='
< default='https://www.vim.org/scripts/download_script.php?src_id='
Override this if your system needs
... ='http://vim.sourceforge.net/scripts/download_script.php?src_id='
>
g:GetLatestVimScripts_bunzip2
< default= bunzip2
< default= bunzip2
This variable holds the name of the command to decompress .bz2
files
>
g:GetLatestVimScripts_bunzip3
< default= bunzip3
This variable holds the name of the command to decompress .bz3
files
>
g:GetLatestVimScripts_gunzip
< default= gunzip
< default= gunzip
This variable holds the name of the command to decompress .gz
files
>
g:GetLatestVimScripts_unxz
< default= unxz
< default= unxz
This variable holds the name of the command to decompress .xz
files
>
g:GetLatestVimScripts_unzip
< default= unzip
< default= unzip
This variable holds the name of the command to decompress .zip
files
Note: The variables associated with decompression commands help workaround
crossplatform issues. For example, on Windows is possible to delegate this
calls into `wsl` by doing: >
crossplatform issues. For example, on Windows is possible to delegate
this calls into `wsl` by doing: >
let g:GetLatestVimScripts_bunzip2= "wsl -e bunzip2"
let g:GetLatestVimScripts_gunzip= "wsl -e gunzip"
@ -409,6 +414,8 @@ The AutoInstall process will:
Windows: $HOME\vimfiles
if the downloaded file ends with ".bz2"
bunzip2 it
else if the downloaded file ends with ".bz3"
bunzip3 it
else if the downloaded file ends with ".gz"
gunzip it
if the resulting file ends with ".zip"
@ -422,6 +429,7 @@ The AutoInstall process will:
==============================================================================
9. GetLatestVimScripts History *getscript-history* *glvs-hist* {{{1
v38 Feb 25, 2025 : * handles additional decompression option for .bzip3 files.
v37 Sep 23, 2024 : * Support for the new vimball's .vmb extension (old .vba
extension conflicted with visual basic).
* Support for |glvs-autoinstall| in ftplugins and packages.

View File

@ -1,4 +1,4 @@
*pi_gzip.txt* For Vim version 9.1. Last change: 2025 Feb 06
*pi_gzip.txt* For Vim version 9.1. Last change: 2025 Mar 05
VIM REFERENCE MANUAL by Bram Moolenaar
@ -29,6 +29,7 @@ with these extensions:
extension compression ~
*.bz2 bzip2
*.bz3 bzip3
*.gz gzip
*.lz lzip
*.lz4 lz4

View File

@ -1 +0,0 @@
../pack/dist/opt/netrw/doc/netrw.txt

3624
runtime/doc/pi_netrw.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,10 @@
*pi_tar.txt* For Vim version 9.1. Last change: 2024 May 11
*pi_tar.txt* For Vim version 9.1. Last change: 2025 Jul 15
+====================+
| Tar File Interface |
+====================+
Author: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
(remove NOSPAM from Campbell's email first)
Original Author: Charles E. Campbell
Copyright 2005-2017: *tar-copyright*
The VIM LICENSE (see |copyright|) applies to the files in this
package, including tarPlugin.vim, tar.vim, and pi_tar.txt. Like
@ -61,7 +60,7 @@ Copyright 2005-2017: *tar-copyright*
the file mentioned in the tarball. If the current directory is not
correct for that path, :TarDiff will fail to find the associated file.
If the [filename] is given, that that filename (and path) will be used
If the [filename] is given, that filename (and path) will be used
to specify the associated file.
@ -74,6 +73,15 @@ Copyright 2005-2017: *tar-copyright*
let g:loaded_tarPlugin= 1
let g:loaded_tar = 1
<
*tar-mappings*
MAPPINGS~
The following (buffer-local) mappings are available in a tar buffer:
<CR> Open selected file for editing, any changes will be
written back to the archive.
<LeftMouse> same as <CR>
x Extract selected file.
==============================================================================
3. Options *tar-options*
@ -86,24 +94,25 @@ Copyright 2005-2017: *tar-copyright*
*g:tar_readoptions* "OPxf" used to extract a file from a tarball
*g:tar_cmd* "tar" the name of the tar program
*g:tar_nomax* 0 if true, file window will not be maximized
*g:tar_secure* undef if exists:
"--"s will be used to prevent unwanted
option expansion in tar commands.
Please be sure that your tar command
accepts "--"; Posix compliant tar
utilities do accept them.
if not exists:
The tar plugin will reject any tar
files or member files that begin with
"-"
Not all tar's support the "--" which is why
it isn't default.
*g:tar_writeoptions* "uf" used to update/replace a file
==============================================================================
4. History *tar-history*
unreleased:
Jul 13, 2025 * drop leading /
May 19, 2025 * restore working directory after read/write
Apr 16, 2025 * decouple from netrw by adding s:WinPath()
instead of shelling out to file(1)
Mar 02, 2025 * determine the compression using readblob()
Mar 02, 2025 * escape the filename before using :read
Mar 01, 2025 * fix syntax error in tar#Read()
Feb 28, 2025 * add support for bzip3 (#16755)
Feb 06, 2025 * add support for lz4 (#16591)
Nov 11, 2024 * support permissions (#7379)
Feb 19, 2024 * announce adoption
Jan 08, 2024 * fix a few problems (#138331, #12637, #8109)
v31 Apr 02, 2017 * (klartext) reported that browsing encrypted
files in a zip archive created unencrypted
swap files. I am applying a similar fix

View File

@ -1,10 +1,12 @@
*pi_tutor.txt* For Vim version 9.1. Last change: 2024 Dec 17
*pi_tutor.txt* For Vim version 9.1. Last change: 2025 May 19
INTERACTIVE TUTORIALS FOR VIM *vim-tutor-mode*
vim-tutor-mode provides a system to follow and create interactive tutorials
for vim and third party plugins. It replaces the venerable `vimtutor` system.
Original Author: Felipe Morales <https://github.com/fmoralesc>
=============================================================================
1. Usage *vim-tutor-usage*
@ -47,13 +49,5 @@ to be detected by the :Tutor command.
It is recommended to use a less formal style when writing tutorials than in
regular documentation (unless the content requires it).
=============================================================================
3. Contributing
Development of the plugin is done over at github [1]. Feel free to report
issues and make suggestions.
[1]: https://github.com/fmoralesc/vim-tutor-mode
=============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -1,4 +1,4 @@
*pi_zip.txt* For Vim version 9.1. Last change: 2023 Nov 05
*pi_zip.txt* For Vim version 9.1. Last change: 2025 Jul 15
+====================+
| Zip File Interface |
@ -100,15 +100,29 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
should be treated as zip files.
Alternatively, one may change *g:zipPlugin_ext* in one's .vimrc.
Currently (11/30/15) it holds: >
Currently (as of April 2025) it holds: >
let g:zipPlugin_ext= '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,
\ *.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,
\ *.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm,
\ *.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx,*.epub'
let g:zipPlugin_ext='*.aar,*.apk,*.celzip,*.crtx,*.docm,*.docx,
\ *.dotm,*.dotx,*.ear,*.epub,*.gcsx,*.glox,*.gqsx,*.ja,*.jar,*.kmz,
\ *.odb,*.odc,*.odf,*.odg,*.odi,*.odm,*.odp,*.ods,*.odt,*.otc,*.otf,
\ *.otg,*.oth,*.oti,*.otp,*.ots,*.ott,*.oxt,*.potm,*.potx,*.ppam,
\ *.ppsm,*.ppsx,*.pptm,*.pptx,*.sldx,*.thmx,*.vdw,*.war,*.whl,*.wsz,
\ *.xap,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip'
==============================================================================
4. History *zip-history* {{{1
unreleased:
Jul 12, 2025 * drop ../ on write to prevent path traversal attacks
Mar 11, 2025 * handle filenames with leading '-' correctly
Aug 21, 2024 * simplify condition to detect MS-Windows
Aug 18, 2024 * correctly handle special globbing chars
Aug 05, 2024 * clean-up and make it work with shellslash on Windows
Aug 05, 2024 * workaround for the FreeBSD's unzip
Aug 04, 2024 * escape '[' in name of file to be extracted
Jul 30, 2024 * fix opening remote zipfile
Jul 24, 2024 * use delete() function
Jul 23, 2024 * fix 'x' command
Jun 16, 2024 * handle whitespace on Windows properly (#14998)
v33 Dec 07, 2021 * *.xlam mentioned twice in zipPlugin
v32 Oct 22, 2021 * to avoid an issue with a vim 8.2 patch, zipfile: has
been changed to zipfile:// . This often shows up

View File

@ -1,4 +1,4 @@
*quickfix.txt* For Vim version 9.1. Last change: 2025 Jan 11
*quickfix.txt* For Vim version 9.1. Last change: 2025 Apr 06
VIM REFERENCE MANUAL by Bram Moolenaar
@ -43,12 +43,12 @@ From inside Vim an easy way to run a command and handle the output is with the
The 'errorformat' option should be set to match the error messages from your
compiler (see |errorformat| below).
*quickfix-ID*
*quickfix-stack* *quickfix-ID*
Each quickfix list has a unique identifier called the quickfix ID and this
number will not change within a Vim session. The |getqflist()| function can be
used to get the identifier assigned to a list. There is also a quickfix list
number which may change whenever more than ten lists are added to a quickfix
stack.
number which may change whenever more than 'chistory' lists are added to a
quickfix stack.
*location-list* *E776*
A location list is a window-local quickfix list. You get one after commands
@ -860,10 +860,12 @@ using these functions are below:
=============================================================================
3. Using more than one list of errors *quickfix-error-lists*
So far has been assumed that there is only one list of errors. Actually the
ten last used lists are remembered. When starting a new list, the previous
ones are automatically kept. Two commands can be used to access older error
lists. They set one of the existing error lists as the current one.
So far it has been assumed that there is only one list of errors. Actually
there can be multiple used lists that are remembered; see 'chistory' and
'lhistory'.
When starting a new list, the previous ones are automatically kept. Two
commands can be used to access older error lists. They set one of the
existing error lists as the current one.
*:colder* *:col* *E380*
:col[der] [count] Go to older error list. When [count] is given, do
@ -1722,6 +1724,13 @@ shells and OSes and also does not allow to use other available TeX options,
if any. If your TeX doesn't support "-interaction=nonstopmode", please
report it with different means to express \nonstopmode from the command line.
TSC COMPILER *compiler-tsc*
The executable and compiler options can be added to 'makeprg' by setting the
b/g:tsc_makeprg variable. For example: >
let b:tsc_makeprg = "npx tsc --noEmit"
TYPST COMPILER *compiler-typst*
Vim includes a compiler plugin for Typst files. This compiler is enabled

View File

@ -1,4 +1,4 @@
*quickref.txt* For Vim version 9.1. Last change: 2025 Feb 08
*quickref.txt* For Vim version 9.1. Last change: 2025 Jun 28
VIM REFERENCE MANUAL by Bram Moolenaar
@ -639,12 +639,14 @@ Short explanation of each option: *option-list*
'cdpath' 'cd' list of directories searched with ":cd"
'cedit' key used to open the command-line window
'charconvert' 'ccv' expression for character encoding conversion
'chistory' 'chi' maximum number of quickfix lists in history
'cindent' 'cin' do C program indenting
'cinkeys' 'cink' keys that trigger indent when 'cindent' is set
'cinoptions' 'cino' how to do indenting when 'cindent' is set
'cinscopedecls' 'cinsd' words that are recognized by 'cino-g'
'cinwords' 'cinw' words where 'si' and 'cin' add an indent
'clipboard' 'cb' use the clipboard as the unnamed register
'clipmethod' 'cpm' specify order of what clipboard methods to use
'cmdheight' 'ch' number of lines to use for the command-line
'cmdwinheight' 'cwh' height of the command-line window
'colorcolumn' 'cc' columns to highlight
@ -786,6 +788,7 @@ Short explanation of each option: *option-list*
'langremap' 'lrm' do apply 'langmap' to mapped characters
'laststatus' 'ls' tells when last window has status lines
'lazyredraw' 'lz' don't redraw while executing macros
'lhistory' 'lhi' maximum number of location lists in history
'linebreak' 'lbr' wrap long lines at a blank
'lines' number of lines in the display
'linespace' 'lsp' number of pixel lines to use between characters
@ -916,9 +919,9 @@ Short explanation of each option: *option-list*
'signcolumn' 'scl' when to display the sign column
'smartcase' 'scs' no ignore case when pattern has uppercase
'smartindent' 'si' smart autoindenting for C programs
'smarttab' 'sta' use 'shiftwidth' when inserting <Tab>
'smarttab' 'sta' <Tab> in leading whitespace indents by 'shiftwidth'
'smoothscroll' 'sms' scroll by screen lines when 'wrap' is set
'softtabstop' 'sts' number of spaces that <Tab> uses while editing
'softtabstop' 'sts' number of columns between two soft tab stops
'spell' enable spell checking
'spellcapcheck' 'spc' pattern to locate end of a sentence
'spellfile' 'spf' files where |zg| and |zw| store words
@ -940,7 +943,7 @@ Short explanation of each option: *option-list*
'tabclose' 'tcl' which tab page to focus when closing a tab
'tabline' 'tal' custom format for the console tab pages line
'tabpagemax' 'tpm' maximum number of tab pages for |-p| and "tab all"
'tabstop' 'ts' number of spaces that <Tab> in file uses
'tabstop' 'ts' number of columns between two tab stops
'tagbsearch' 'tbs' use binary searching in tags files
'tagcase' 'tc' how to handle case when searching in tags files
'tagfunc' 'tfu' function to get list of tag matches
@ -985,8 +988,8 @@ Short explanation of each option: *option-list*
'undoreload' 'ur' max nr of lines to save for undo on a buffer reload
'updatecount' 'uc' after this many characters flush swap file
'updatetime' 'ut' after this many milliseconds flush swap file
'varsofttabstop' 'vsts' a list of number of spaces when typing <Tab>
'vartabstop' 'vts' a list of number of spaces for <Tab>s
'varsofttabstop' 'vsts' a list of number of columns between soft tab stops
'vartabstop' 'vts' a list of number of columns between tab stops
'verbose' 'vbs' give informative messages
'verbosefile' 'vfile' file to write messages in
'viewdir' 'vdir' directory where to store files with :mkview
@ -1016,6 +1019,9 @@ Short explanation of each option: *option-list*
'winminwidth' 'wmw' minimal number of columns for any window
'winptydll' name of the winpty dynamic library
'winwidth' 'wiw' minimal number of columns for current window
'wlseat' 'wse' the Wayland seat to use
'wlsteal' 'wst' allow focus stealing functionality for Wayland
'wltimeoutlen' 'wtm' timeout to use when polling in Wayland
'wrap' long lines wrap and continue on the next line
'wrapmargin' 'wm' chars from the right where wrapping starts
'wrapscan' 'ws' searches wrap around the end of the file

View File

@ -1,4 +1,4 @@
*repeat.txt* For Vim version 9.1. Last change: 2024 Oct 16
*repeat.txt* For Vim version 9.1. Last change: 2025 Jul 15
VIM REFERENCE MANUAL by Bram Moolenaar
@ -233,7 +233,12 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
Examples: >
:4,5source
:10,18source ++clear
<
< Implementation detail: When sourcing a [range] of
lines that falls inside a folded region, the range
will be adjusted to the start and end of the fold,
but only if a two line specifiers range was used.
*:source!*
:so[urce]! {file} Read Vim commands from {file}. These are commands
that are executed from Normal mode, like you type

View File

@ -1,4 +1,4 @@
*starting.txt* For Vim version 9.1. Last change: 2024 Dec 19
*starting.txt* For Vim version 9.1. Last change: 2025 Jun 28
VIM REFERENCE MANUAL by Bram Moolenaar
@ -559,6 +559,12 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
client-server messages), call the |serverlist()| function.
This does not enable the XSMP handler though.
*-Y*
-Y Do not try connecting to the Wayland compositor. Is only
relevant for Unix when compiled with the |+wayland| feature,
otherwise it's ignored. Note that this will make any feature
that uses Wayland unavailable, such as the clipboard.
*-s*
-s {scriptin} The script file "scriptin" is read. The characters in the
file are interpreted as if you had typed them. The same can
@ -828,8 +834,9 @@ accordingly. Vim proceeds in this order:
easy to copy it to another system.
If Vim was started with "-u filename", the file "filename" is used.
All following initializations until 4. are skipped. $MYVIMRC and
$MYVIMDIR are not set.
All following initializations until 4. are skipped. `$MYVIMRC` and
`$MYVIMDIR` are not set (but `$MYVIMDIR` will be set, if 'rtp' is
updated).
"vim -u NORC" can be used to skip these initializations without
reading a file. "vim -u NONE" also skips loading plugins. |-u|
@ -850,9 +857,9 @@ accordingly. Vim proceeds in this order:
*VIMINIT* *.vimrc* *_vimrc* *EXINIT* *.exrc* *_exrc*
*$MYVIMRC* *$MYVIMDIR*
c. Five places are searched for initializations. The first that exists
is used, the others are ignored. The $MYVIMRC environment variable is
set to the file that was first found, unless $MYVIMRC was already set
and when using VIMINIT. The $MYVIMDIR environment variable is
is used, the others are ignored. The `$MYVIMRC` environment variable is
set to the file that was first found, unless `$MYVIMRC` was already set
when using VIMINIT. The `$MYVIMDIR` environment variable is
set to the personal 'rtp' directory, however it is not verified
that the directory actually exists.
I The environment variable VIMINIT (see also |compatible-default|) (*)
@ -973,9 +980,10 @@ accordingly. Vim proceeds in this order:
The |v:vim_did_enter| variable is set to 1.
The |VimEnter| autocommands are executed.
The $MYVIMRC or $MYGVIMRC environment variable will be set to the first found
vimrc and/or gvimrc file while $MYVIMDIR is set to the users personal runtime
directory 'rtp' (typically the first entry in 'runtimepath').
The `$MYVIMRC` or `$MYGVIMRC` environment variable will be set to the first found
vimrc and/or gvimrc file while `$MYVIMDIR` is set to the users personal runtime
directory 'rtp' (typically the first entry in 'runtimepath'). If 'rtp'
changes, `$MYVIMDIR` will be updated.
Note: These environment variables resolve symbolic links, but 'rtp' does not.

View File

@ -1,4 +1,4 @@
*syntax.txt* For Vim version 9.1. Last change: 2025 Feb 25
*syntax.txt* For Vim version 9.1. Last change: 2025 Jul 14
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1056,8 +1056,12 @@ Variable Highlight ~
*c_ansi_typedefs* ... but do standard ANSI types
*c_ansi_constants* ... but do standard ANSI constants
*c_no_utf* don't highlight \u and \U in strings
*c_syntax_for_h* for *.h files use C syntax instead of C++ and use objc
syntax instead of objcpp
*c_syntax_for_h* use C syntax for *.h files instead of C++/ObjC/ObjC++
(NOTE: This variable is deprecated and no longer
necessary, as *.h files now default to C, unless the
file contains C++ or Objective-C syntax. If the
automated detection fails, the default filetype can
be adjusted using `g:filetype_h`.)
*c_no_if0* don't highlight "#if 0" blocks as comments
*c_no_cformat* don't highlight %-formats in strings
*c_no_c99* don't highlight C99 standard items
@ -1116,8 +1120,11 @@ the C syntax file. See |c.vim| for all the settings that are available for C.
By setting a variable you can tell Vim to use Ch syntax for *.h files, instead
of C or C++: >
:let ch_syntax_for_h = 1
:let g:filetype_h = 'ch'
NOTE: In previous versions of Vim, the following (now-deprecated) variable was
used, but is no longer the preferred approach: >
:let ch_syntax_for_h = 1
CHILL *chill.vim* *ft-chill-syntax*
@ -1286,6 +1293,21 @@ doesn't work for you, or you don't edit Progress at all, use this in your
startup vimrc: >
:let filetype_w = "cweb"
CSHARP *cs.vim* *ft-cs-syntax*
C# raw string literals may use any number of quote marks to encapsulate the
block, and raw interpolated string literals may use any number of braces to
encapsulate the interpolation, e.g. >
$$$""""Hello {{{name}}}""""
<
By default, Vim highlights 3-8 quote marks, and 1-8 interpolation braces.
The maximum numbers of quotes and braces recognized can configured using the
following variables:
Variable Default ~
g:cs_raw_string_quote_count 8
g:cs_raw_string_interpolation_brace_count 8
DART *dart.vim* *ft-dart-syntax*
@ -1551,15 +1573,47 @@ ERLANG *erlang.vim* *ft-erlang-syntax*
Erlang is a functional programming language developed by Ericsson. Files with
the following extensions are recognized as Erlang files: erl, hrl, yaws.
The BIFs (built-in functions) are highlighted by default. To disable this,
put the following line in your vimrc: >
Vim highlights triple-quoted docstrings as comments by default.
:let g:erlang_highlight_bifs = 0
If you want triple-quoted docstrings highlighted as Markdown, add the
following line to your |.vimrc|: >
To enable highlighting some special atoms, put this in your vimrc: >
:let g:erlang_use_markdown_for_docs = 1
:let g:erlang_highlight_special_atoms = 1
The plain text inside the docstrings (that is, the characters that are not
highlighted by the Markdown syntax) is still highlighted as a comment.
If you want to highlight the plain text inside the docstrings using a
different highlight group, add the following line to your |.vimrc| (the
example highlights plain text using the String highlight group): >
:let g:erlang_docstring_default_highlight = 'String'
If you don't enable Markdown, this line highlights the full docstrings
according to the specified highlight group.
Use the following line to disable highlighting for the plain text: >
:let g:erlang_docstring_default_highlight = ''
Configuration examples: >
" Highlight docstrings as Markdown.
:let g:erlang_use_markdown_for_docs = 1
" 1. Highlight Markdown elements in docstrings as Markdown.
" 2. Highlight the plain text in docstrings as String.
:let g:erlang_use_markdown_for_docs = 1
:let g:erlang_docstring_default_highlight = 'String'
" Highlight docstrings as strings (no Markdown).
:let g:erlang_docstring_default_highlight = 'String'
" 1. Highlight Markdown elements in docstrings as Markdown.
" 2. Don't highlight the plain text in docstrings.
:let g:erlang_use_markdown_for_docs = 1
:let g:erlang_docstring_default_highlight = ''
<
ELIXIR *elixir.vim* *ft-elixir-syntax*
@ -2045,13 +2099,8 @@ old way, put the following line into your Vim startup file: >
All (exported) public types declared in `java.lang` are always automatically
imported and available as simple names. To highlight them, use: >
:let g:java_highlight_java_lang_ids = 1
You can also highlight types of most standard Java packages if you download
the javaid.vim script at http://www.fleiner.com/vim/download.html. If you
prefer to only highlight types of a certain package, say `java.io`, use the
following: >
:let g:java_highlight_java_io = 1
Check the javaid.vim file for a list of all the packages that are supported.
You can also generate syntax items for other public and protected types and
opt in to highlight some of their names; see |java-package-info-url|.
Headers of indented function declarations can be highlighted (along with parts
of lambda expressions and method reference expressions), but it depends on how
@ -2153,6 +2202,13 @@ line for any comments written in this way, and showing the contents of a first
line otherwise, with >
:let g:java_foldtext_show_first_or_second_line = 1
HTML tags in Javadoc comments can additionally be folded by following the
instructions listed under |html-folding| and giving explicit consent with >
:let g:java_consent_to_html_syntax_folding = 1
Do not default to this kind of folding unless ALL start tags and optional end
tags are balanced in Javadoc comments; otherwise, put up with creating runaway
folds that break syntax highlighting.
Trailing whitespace characters or a run of space characters before a tab
character can be marked as an error with >
:let g:java_space_errors = 1
@ -2187,17 +2243,18 @@ cycles for such a feature to become either integrated into the platform or
withdrawn from this effort. To cater for early adopters, there is optional
support in Vim for syntax related preview features that are implemented. You
can request it by specifying a list of preview feature numbers as follows: >
:let g:java_syntax_previews = [455, 476]
:let g:java_syntax_previews = [488, 494]
The supported JEP numbers are to be drawn from this table:
`430`: String Templates [JDK 21]
`455`: Primitive types in Patterns, instanceof, and switch
`476`: Module Import Declarations
`488`: Primitive types in Patterns, instanceof, and switch
`494`: Module Import Declarations
Note that as soon as the particular preview feature will have been integrated
into the Java platform, its entry will be removed from the table and related
optionality will be discontinued.
*java-package-info-url*
https://github.com/zzzyxwvut/java-vim/blob/master/tools/javaid/src/javaid/package-info.java
JSON *json.vim* *ft-json-syntax* *g:vim_json_conceal*
*g:vim_json_warnings*
@ -2378,11 +2435,16 @@ Comments are also highlighted by default. You can turn this off by using: >
:let make_no_comments = 1
Microsoft Makefile handles variable expansion and comments differently
(backslashes are not used for escape). If you see any wrong highlights
because of this, you can try this: >
There are various Make implementations, which add extensions other than the
POSIX specification and thus are mutually incompatible. If the filename is
BSDmakefile or GNUmakefile, the corresponding implementation is automatically
determined; otherwise vim tries to detect it by the file contents. If you see
any wrong highlights because of this, you can enforce a flavor by setting one
of the following: >
:let make_microsoft = 1
:let g:make_flavor = 'bsd' " or
:let g:make_flavor = 'gnu' " or
:let g:make_flavor = 'microsoft'
MAPLE *maple.vim* *ft-maple-syntax*
@ -2436,6 +2498,12 @@ have the following in your .vimrc: >
let filetype_m = "mma"
MBSYNC *mbsync.vim* *ft-mbsync-syntax*
The mbsync application uses a configuration file to setup mailboxes names,
user and password. All files ending with `.mbsyncrc` or with the name
`isyncrc` will be recognized as mbsync configuration files.
MEDIAWIKI *ft-mediawiki-syntax*
By default, syntax highlighting includes basic HTML tags like style and
@ -3066,7 +3134,7 @@ PRINTCAP + TERMCAP *ft-ptcap-syntax* *ft-termcap-syntax*
This syntax file applies to the printcap and termcap databases.
In order for Vim to recognize printcap/termcap files that do not match
the patterns *printcap*, or *termcap*, you must put additional patterns
the patterns "*printcap*", or "*termcap*", you must put additional patterns
appropriate to your system in your |myfiletypefile| file. For these
patterns, you must set the variable "b:ptcap_type" to either "print" or
"term", and then the 'filetype' option to ptcap.
@ -3497,25 +3565,29 @@ cases pertain, then the first line of the file is examined (ex. looking for
/bin/sh /bin/ksh /bin/bash). If the first line specifies a shelltype, then
that shelltype is used. However some files (ex. .profile) are known to be
shell files but the type is not apparent. Furthermore, on many systems sh is
symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" (Posix).
symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" (POSIX).
One may specify a global default by instantiating one of the following
variables in your <.vimrc>:
ksh: >
let g:is_kornshell = 1
< posix: (using this is nearly the same as setting g:is_kornshell to 1) >
< posix: (default) >
let g:is_posix = 1
< bash: >
let g:is_bash = 1
< sh: (default) Bourne shell >
< dash: >
let g:is_dash = 1
< sh: Bourne shell >
let g:is_sh = 1
< (dash users should use posix)
Specific shell features are automatically enabled based on the shell detected
from the shebang line ("#! ..."). For KornShell Vim detects different shell
features for mksh, ksh88, ksh93, ksh93u, ksh93v, and ksh2020.
If there's no "#! ..." line, and the user hasn't availed himself/herself of a
default sh.vim syntax setting as just shown, then syntax/sh.vim will assume
the Bourne shell syntax. No need to quote RFCs or market penetration
the POSIX shell syntax. No need to quote RFCs or market penetration
statistics in error reports, please -- just select the default version of the
sh your system uses and install the associated "let..." in your <.vimrc>.
@ -3956,6 +4028,7 @@ names whose syntax definitions will be included in Typst files. Example: >
VIM *vim.vim* *ft-vim-syntax*
*g:vimsyn_minlines* *g:vimsyn_maxlines*
There is a trade-off between more accurate syntax highlighting versus screen
updating speed. To improve accuracy, you may wish to increase the
g:vimsyn_minlines variable. The g:vimsyn_maxlines variable may be used to
@ -3979,10 +4052,9 @@ embedded script highlighting they wish to have. >
g:vimsyn_embed =~ 'r' : support embedded Ruby
g:vimsyn_embed =~ 't' : support embedded Tcl
<
By default, g:vimsyn_embed is a string supporting interpreters that your vim
itself supports. Concatenate the indicated characters to support multiple
types of embedded interpreters (e.g., g:vimsyn_embed = "mp" supports embedded
mzscheme and embedded perl).
By default, g:vimsyn_embed is unset, and the Lua and Python script interfaces
are supported.
*g:vimsyn_folding*
Some folding is now supported with when 'foldmethod' is set to "syntax": >
@ -3991,15 +4063,15 @@ Some folding is now supported with when 'foldmethod' is set to "syntax": >
g:vimsyn_folding =~ 'c' : fold Vim9 classes
g:vimsyn_folding =~ 'e' : fold Vim9 enums
g:vimsyn_folding =~ 'f' : fold functions
g:vimsyn_folding =~ 'h' : fold heredocs
g:vimsyn_folding =~ 'h' : fold let heredocs
g:vimsyn_folding =~ 'i' : fold Vim9 interfaces
g:vimsyn_folding =~ 'H' : fold Vim9 legacy headers
g:vimsyn_folding =~ 'l' : fold Lua script
g:vimsyn_folding =~ 'm' : fold MzScheme script
g:vimsyn_folding =~ 'p' : fold Perl script
g:vimsyn_folding =~ 'P' : fold Python script
g:vimsyn_folding =~ 'r' : fold Ruby script
g:vimsyn_folding =~ 't' : fold Tcl script
g:vimsyn_folding =~ 'l' : fold Lua heredocs
g:vimsyn_folding =~ 'm' : fold MzScheme heredocs
g:vimsyn_folding =~ 'p' : fold Perl heredocs
g:vimsyn_folding =~ 'P' : fold Python heredocs
g:vimsyn_folding =~ 'r' : fold Ruby heredocs
g:vimsyn_folding =~ 't' : fold Tcl heredocs
<
By default, g:vimsyn_folding is unset. Concatenate the indicated characters
@ -4017,7 +4089,29 @@ highlighting is to put the following line in your |vimrc|: >
let g:vimsyn_noerror = 1
<
To suppress only specific errors, define the following variables: >
g:vimsyn_nobehaveerror = 1 " :behave error
g:vimsyn_vimFTError = 1 " :filetype error
g:vimsyn_noaugrouperror = 1 " :augroup error
g:vimsyn_noopererror = 1 " operator error
g:vimsyn_notypealiaserror = 1 " Vim9 type alias error
g:vimsyn_novimfunctionerror = 1 " Vim9 method error
g:vimsyn_nousercmderror = 1 " :com error
g:vimsyn_novimsynerror = 1 " :syn error
g:vimsyn_novimsyncaseerror = 1 " :syn case error
g:vimsyn_novimsynconcealerror = 1 " :syn conceal error
g:vimsyn_novimsynfoldlevelerror = 1 " :syn foldlevel error
g:vimsyn_novimsynspellerror = 1 " :syn spell error
g:vimsyn_novimsyncerror = 1 " :syn sync error
g:vimsyn_novimhictermerror = 1 " :hi error
g:vimsyn_vimhikeyerror = 1 " :hi key=arg error
<
To force highlighting of Neovim specific Vim script elements (even if not
using Neovim), set >
let g:vimsyn_vim_features = ['nvim']
<
WDL *wdl.vim* *wdl-syntax*
@ -5795,6 +5889,9 @@ DiffChange Diff mode: Changed line. |diff.txt|
DiffDelete Diff mode: Deleted line. |diff.txt|
*hl-DiffText*
DiffText Diff mode: Changed text within a changed line. |diff.txt|
*hl-DiffTextAdd*
DiffTextAdd Diff mode: Added text within a changed line. Linked to
|hl-DiffText| by default. |diff.txt|
*hl-EndOfBuffer*
EndOfBuffer Filler lines (~) after the last line in the buffer.
By default, this is highlighted like |hl-NonText|.
@ -5926,6 +6023,12 @@ TabLine Tab pages line, not active tab page label.
TabLineFill Tab pages line, where there are no labels.
*hl-TabLineSel*
TabLineSel Tab pages line, active tab page label.
*hl-TabPanel*
TabPanel TabPanel, not active tab page label.
*hl-TabPanelFill*
TabPanelFill TabPanel, where there are no labels.
*hl-TabPanelSel*
TabPanelSel TabPanel, active tab page label.
*hl-Terminal*
Terminal |terminal| window (see |terminal-size-color|).
*hl-Title*

View File

@ -1,4 +1,4 @@
*tabpage.txt* For Vim version 9.1. Last change: 2024 Jul 12
*tabpage.txt* For Vim version 9.1. Last change: 2025 Jul 01
VIM REFERENCE MANUAL by Bram Moolenaar
@ -14,10 +14,13 @@ when used in combination with more than one tab page.
2. Commands |tab-page-commands|
3. Other items |tab-page-other|
4. Setting 'tabline' |setting-tabline|
5. Setting 'guitablabel' |setting-guitablabel|
5. Setting 'tabpanel' |setting-tabpanel|
6. Setting 'guitablabel' |setting-guitablabel|
{not able to use multiple tab pages when the |+windows| feature was disabled
at compile time}
{not able to use |tabpanel| feature when the |+tabpanel| feature was disabled
at compile time}
==============================================================================
1. Introduction *tab-page-intro*
@ -364,8 +367,8 @@ The 'tabline' option allows you to define your preferred way to tab pages
labels. This isn't easy, thus an example will be given here.
For basics see the 'statusline' option. The same items can be used in the
'tabline' option. Additionally, the |tabpagebuflist()|, |tabpagenr()| and
|tabpagewinnr()| functions are useful.
'tabline' and 'tabpanel' option. Additionally, the |tabpagebuflist()|,
|tabpagenr()| and |tabpagewinnr()| functions are useful.
Since the number of tab labels will vary, you need to use an expression for
the whole option. Something like: >
@ -418,7 +421,66 @@ clever way when there is not enough room. Check the 'columns' option for the
space available.
==============================================================================
5. Setting 'guitablabel' *setting-guitablabel*
5. Setting 'tabpanel' *tabpanel* *setting-tabpanel*
The tabpanel is a vertical sidebar that displays tab page labels along the
side of the window. It looks like this:
>
+-----------+----------------------------------
|(1) |text text text text text text text
| ~/aaa.txt|text text text text text text text
|(2) |text text text text text text text
| ~/.vimrc |text text text text text text text
|(3) |text text text text text text text
| ~/bbb.js |text text text text text text text
| ~/ccc.css|text text text text text text text
| |text text text text text text text
| |text text text text text text text
| |text text text text text text text
<
To configure the tabpanel, use the following options: 'tabpanel',
'showtabpanel' and 'tabpanelopt'.
The 'tabpanel' option functions similar to 'statusline' or 'tabline', and the
'showtabpanel' option functions similar to 'laststatus' or 'showtabline'.
The "columns:" item of 'tabpanelopt' option specifies the width of the
tabpanel:
>
+------ This width
|
<----+----->
+-----------+----------------------------------
|(1) |text text text text text text text
| ~/aaa.txt|text text text text text text text
|(2) |text text text text text text text
<
The "align:" item of the 'tabpanelopt' option determines whether the tabpanel
will be displayed on the left or right side of the window:
>
+----------------------------------+-----------
|text text text text text text text|(1)
|text text text text text text text| ~/aaa.txt
|text text text text text text text|(2)
<
The "vert" item of the 'tabpanelopt' option specifies whether a vertical
separator should be displayed between the tabpanel and the display part of the
window:
>
+------ This is
|
v
+-----------+----------------------------------
|(1) |text text text text text text text
| ~/aaa.txt|text text text text text text text
|(2) |text text text text text text text
<
The vertical separator character is taken from "tpl_vert" in 'fillchars'.
You can customize the appearance of the tab page labels using the highlight
groups: |hl-TabPanel| |hl-TabPanelSel| |hl-TabPanelFill|
==============================================================================
6. Setting 'guitablabel' *setting-guitablabel*
When the GUI tab pages line is displayed, 'guitablabel' can be used to
specify the label to display for each tab page. Unlike 'tabline', which

View File

@ -129,10 +129,13 @@ $quote eval.txt /*$quote*
'cdpath' options.txt /*'cdpath'*
'cedit' options.txt /*'cedit'*
'cf' options.txt /*'cf'*
'cfc' options.txt /*'cfc'*
'cfu' options.txt /*'cfu'*
'ch' options.txt /*'ch'*
'character' intro.txt /*'character'*
'charconvert' options.txt /*'charconvert'*
'chi' options.txt /*'chi'*
'chistory' options.txt /*'chistory'*
'ci' options.txt /*'ci'*
'cia' options.txt /*'cia'*
'cin' options.txt /*'cin'*
@ -146,6 +149,7 @@ $quote eval.txt /*$quote*
'cinw' options.txt /*'cinw'*
'cinwords' options.txt /*'cinwords'*
'clipboard' options.txt /*'clipboard'*
'clipmethod' options.txt /*'clipmethod'*
'cm' options.txt /*'cm'*
'cmdheight' options.txt /*'cmdheight'*
'cmdwinheight' options.txt /*'cmdwinheight'*
@ -162,6 +166,7 @@ $quote eval.txt /*$quote*
'compatible' options.txt /*'compatible'*
'complete' options.txt /*'complete'*
'completefunc' options.txt /*'completefunc'*
'completefuzzycollect' options.txt /*'completefuzzycollect'*
'completeitemalign' options.txt /*'completeitemalign'*
'completeopt' options.txt /*'completeopt'*
'completepopup' options.txt /*'completepopup'*
@ -174,6 +179,7 @@ $quote eval.txt /*$quote*
'copyindent' options.txt /*'copyindent'*
'cot' options.txt /*'cot'*
'cp' options.txt /*'cp'*
'cpm' options.txt /*'cpm'*
'cpo' options.txt /*'cpo'*
'cpoptions' options.txt /*'cpoptions'*
'cpp' options.txt /*'cpp'*
@ -432,6 +438,8 @@ $quote eval.txt /*$quote*
'infercase' options.txt /*'infercase'*
'insertmode' options.txt /*'insertmode'*
'is' options.txt /*'is'*
'ise' options.txt /*'ise'*
'isexpand' options.txt /*'isexpand'*
'isf' options.txt /*'isf'*
'isfname' options.txt /*'isfname'*
'isi' options.txt /*'isi'*
@ -461,6 +469,8 @@ $quote eval.txt /*$quote*
'lazyredraw' options.txt /*'lazyredraw'*
'lbr' options.txt /*'lbr'*
'lcs' options.txt /*'lcs'*
'lhi' options.txt /*'lhi'*
'lhistory' options.txt /*'lhistory'*
'linebreak' options.txt /*'linebreak'*
'lines' options.txt /*'lines'*
'linespace' options.txt /*'linespace'*
@ -496,6 +506,7 @@ $quote eval.txt /*$quote*
'maxmem' options.txt /*'maxmem'*
'maxmempattern' options.txt /*'maxmempattern'*
'maxmemtot' options.txt /*'maxmemtot'*
'maxsearchcount' options.txt /*'maxsearchcount'*
'mco' options.txt /*'mco'*
'mef' options.txt /*'mef'*
'menc' options.txt /*'menc'*
@ -535,6 +546,7 @@ $quote eval.txt /*$quote*
'mousetime' options.txt /*'mousetime'*
'mp' options.txt /*'mp'*
'mps' options.txt /*'mps'*
'msc' options.txt /*'msc'*
'msm' options.txt /*'msm'*
'mzq' options.txt /*'mzq'*
'mzquantum' options.txt /*'mzquantum'*
@ -795,6 +807,7 @@ $quote eval.txt /*$quote*
'nowinfixheight' options.txt /*'nowinfixheight'*
'nowinfixwidth' options.txt /*'nowinfixwidth'*
'nowiv' options.txt /*'nowiv'*
'nowlsteal' options.txt /*'nowlsteal'*
'nowmnu' options.txt /*'nowmnu'*
'nowrap' options.txt /*'nowrap'*
'nowrapscan' options.txt /*'nowrapscan'*
@ -802,6 +815,7 @@ $quote eval.txt /*$quote*
'nowriteany' options.txt /*'nowriteany'*
'nowritebackup' options.txt /*'nowritebackup'*
'nows' options.txt /*'nows'*
'nowst' options.txt /*'nowst'*
'noxtermcodes' options.txt /*'noxtermcodes'*
'nrformats' options.txt /*'nrformats'*
'nu' options.txt /*'nu'*
@ -841,6 +855,7 @@ $quote eval.txt /*$quote*
'pm' options.txt /*'pm'*
'pmbcs' options.txt /*'pmbcs'*
'pmbfn' options.txt /*'pmbfn'*
'pmw' options.txt /*'pmw'*
'popt' options.txt /*'popt'*
'pp' options.txt /*'pp'*
'preserveindent' options.txt /*'preserveindent'*
@ -858,6 +873,7 @@ $quote eval.txt /*$quote*
'prompt' options.txt /*'prompt'*
'pt' options.txt /*'pt'*
'pumheight' options.txt /*'pumheight'*
'pummaxwidth' options.txt /*'pummaxwidth'*
'pumwidth' options.txt /*'pumwidth'*
'pvh' options.txt /*'pvh'*
'pvp' options.txt /*'pvp'*
@ -949,6 +965,7 @@ $quote eval.txt /*$quote*
'showmatch' options.txt /*'showmatch'*
'showmode' options.txt /*'showmode'*
'showtabline' options.txt /*'showtabline'*
'showtabpanel' options.txt /*'showtabpanel'*
'shq' options.txt /*'shq'*
'si' options.txt /*'si'*
'sidescroll' options.txt /*'sidescroll'*
@ -1002,6 +1019,7 @@ $quote eval.txt /*$quote*
'statusline' options.txt /*'statusline'*
'stl' options.txt /*'stl'*
'stmp' options.txt /*'stmp'*
'stpl' options.txt /*'stpl'*
'sts' options.txt /*'sts'*
'su' options.txt /*'su'*
'sua' options.txt /*'sua'*
@ -1173,6 +1191,8 @@ $quote eval.txt /*$quote*
'tabclose' options.txt /*'tabclose'*
'tabline' options.txt /*'tabline'*
'tabpagemax' options.txt /*'tabpagemax'*
'tabpanel' options.txt /*'tabpanel'*
'tabpanelopt' options.txt /*'tabpanelopt'*
'tabstop' options.txt /*'tabstop'*
'tag' options.txt /*'tag'*
'tagbsearch' options.txt /*'tagbsearch'*
@ -1223,6 +1243,8 @@ $quote eval.txt /*$quote*
'toolbar' options.txt /*'toolbar'*
'toolbariconsize' options.txt /*'toolbariconsize'*
'top' options.txt /*'top'*
'tpl' options.txt /*'tpl'*
'tplo' options.txt /*'tplo'*
'tpm' options.txt /*'tpm'*
'tr' options.txt /*'tr'*
'ts' options.txt /*'ts'*
@ -1289,6 +1311,7 @@ $quote eval.txt /*$quote*
'wcr' options.txt /*'wcr'*
'wd' options.txt /*'wd'*
'weirdinvert' options.txt /*'weirdinvert'*
'wfb' options.txt /*'wfb'*
'wfh' options.txt /*'wfh'*
'wfw' options.txt /*'wfw'*
'wh' options.txt /*'wh'*
@ -1317,6 +1340,9 @@ $quote eval.txt /*$quote*
'winwidth' options.txt /*'winwidth'*
'wiv' options.txt /*'wiv'*
'wiw' options.txt /*'wiw'*
'wlseat' options.txt /*'wlseat'*
'wlsteal' options.txt /*'wlsteal'*
'wltimeoutlen' options.txt /*'wltimeoutlen'*
'wm' options.txt /*'wm'*
'wmh' options.txt /*'wmh'*
'wmnu' options.txt /*'wmnu'*
@ -1330,6 +1356,9 @@ $quote eval.txt /*$quote*
'writebackup' options.txt /*'writebackup'*
'writedelay' options.txt /*'writedelay'*
'ws' options.txt /*'ws'*
'wse' options.txt /*'wse'*
'wst' options.txt /*'wst'*
'wtm' options.txt /*'wtm'*
'ww' options.txt /*'ww'*
'xtermcodes' options.txt /*'xtermcodes'*
'{ motion.txt /*'{*
@ -1468,6 +1497,7 @@ $quote eval.txt /*$quote*
+sun_workshop various.txt /*+sun_workshop*
+syntax various.txt /*+syntax*
+system() various.txt /*+system()*
+tabpanel various.txt /*+tabpanel*
+tag_any_white various.txt /*+tag_any_white*
+tag_binary various.txt /*+tag_binary*
+tag_old_static various.txt /*+tag_old_static*
@ -1494,6 +1524,8 @@ $quote eval.txt /*$quote*
+visualextra various.txt /*+visualextra*
+vreplace various.txt /*+vreplace*
+vtp various.txt /*+vtp*
+wayland various.txt /*+wayland*
+wayland_clipboard various.txt /*+wayland_clipboard*
+wildignore various.txt /*+wildignore*
+wildmenu various.txt /*+wildmenu*
+windows various.txt /*+windows*
@ -1564,6 +1596,7 @@ $quote eval.txt /*$quote*
-V starting.txt /*-V*
-W starting.txt /*-W*
-X starting.txt /*-X*
-Y starting.txt /*-Y*
-Z starting.txt /*-Z*
-b starting.txt /*-b*
-background gui_x11.txt /*-background*
@ -1784,6 +1817,7 @@ $quote eval.txt /*$quote*
/\{- pattern.txt /*\/\\{-*
/\~ pattern.txt /*\/\\~*
/^ pattern.txt /*\/^*
/_<Tab> cmdline.txt /*\/_<Tab>*
/_CTRL-G cmdline.txt /*\/_CTRL-G*
/_CTRL-L cmdline.txt /*\/_CTRL-L*
/_CTRL-T cmdline.txt /*\/_CTRL-T*
@ -2140,6 +2174,7 @@ $quote eval.txt /*$quote*
:Lfilter quickfix.txt /*:Lfilter*
:LogiPat pi_logipat.txt /*:LogiPat*
:Man filetype.txt /*:Man*
:ManReload filetype.txt /*:ManReload*
:MkVimball pi_vimball.txt /*:MkVimball*
:N editing.txt /*:N*
:Nexplore pi_netrw.txt /*:Nexplore*
@ -2183,6 +2218,7 @@ $quote eval.txt /*$quote*
:TermdebugCommand terminal.txt /*:TermdebugCommand*
:Texplore pi_netrw.txt /*:Texplore*
:Tutor pi_tutor.txt /*:Tutor*
:URLOpen eval.txt /*:URLOpen*
:Until terminal.txt /*:Until*
:Up terminal.txt /*:Up*
:UseVimball pi_vimball.txt /*:UseVimball*
@ -2384,6 +2420,8 @@ $quote eval.txt /*$quote*
:clast quickfix.txt /*:clast*
:cle motion.txt /*:cle*
:clearjumps motion.txt /*:clearjumps*
:clip various.txt /*:clip*
:clipreset various.txt /*:clipreset*
:clist quickfix.txt /*:clist*
:clo windows.txt /*:clo*
:close windows.txt /*:close*
@ -2707,6 +2745,8 @@ $quote eval.txt /*$quote*
:insert insert.txt /*:insert*
:interface vim9class.txt /*:interface*
:intro starting.txt /*:intro*
:ip change.txt /*:ip*
:iput change.txt /*:iput*
:is tagsrch.txt /*:is*
:isearch tagsrch.txt /*:isearch*
:isp tagsrch.txt /*:isp*
@ -3127,6 +3167,8 @@ $quote eval.txt /*$quote*
:redrawstatus various.txt /*:redrawstatus*
:redrawt various.txt /*:redrawt*
:redrawtabline various.txt /*:redrawtabline*
:redrawtabp various.txt /*:redrawtabp*
:redrawtabpanel various.txt /*:redrawtabpanel*
:reg change.txt /*:reg*
:registers change.txt /*:registers*
:res windows.txt /*:res*
@ -3307,6 +3349,9 @@ $quote eval.txt /*$quote*
:so repeat.txt /*:so*
:sor change.txt /*:sor*
:sort change.txt /*:sort*
:sort-l change.txt /*:sort-l*
:sort-u change.txt /*:sort-u*
:sort-uniq change.txt /*:sort-uniq*
:source repeat.txt /*:source*
:source! repeat.txt /*:source!*
:source-range repeat.txt /*:source-range*
@ -3541,6 +3586,8 @@ $quote eval.txt /*$quote*
:undolist undo.txt /*:undolist*
:unh windows.txt /*:unh*
:unhide windows.txt /*:unhide*
:uni change.txt /*:uni*
:uniq change.txt /*:uniq*
:unl eval.txt /*:unl*
:unlet eval.txt /*:unlet*
:unlet-$ eval.txt /*:unlet-$*
@ -3623,6 +3670,8 @@ $quote eval.txt /*$quote*
:winp gui.txt /*:winp*
:winpos gui.txt /*:winpos*
:winsize gui.txt /*:winsize*
:wl wayland.txt /*:wl*
:wlrestore wayland.txt /*:wlrestore*
:wn editing.txt /*:wn*
:wnext editing.txt /*:wnext*
:wp editing.txt /*:wp*
@ -4067,6 +4116,7 @@ Cmdline-mode cmdline.txt /*Cmdline-mode*
CmdlineChanged autocmd.txt /*CmdlineChanged*
CmdlineEnter autocmd.txt /*CmdlineEnter*
CmdlineLeave autocmd.txt /*CmdlineLeave*
CmdlineLeavePre autocmd.txt /*CmdlineLeavePre*
CmdwinEnter autocmd.txt /*CmdwinEnter*
CmdwinLeave autocmd.txt /*CmdwinLeave*
ColorScheme autocmd.txt /*ColorScheme*
@ -4586,9 +4636,37 @@ E1512 options.txt /*E1512*
E1513 message.txt /*E1513*
E1514 options.txt /*E1514*
E1515 builtin.txt /*E1515*
E1516 builtin.txt /*E1516*
E1517 eval.txt /*E1517*
E1518 eval.txt /*E1518*
E1519 eval.txt /*E1519*
E152 helphelp.txt /*E152*
E1520 eval.txt /*E1520*
E1521 eval.txt /*E1521*
E1522 eval.txt /*E1522*
E1523 eval.txt /*E1523*
E1524 eval.txt /*E1524*
E1525 builtin.txt /*E1525*
E1526 eval.txt /*E1526*
E1527 eval.txt /*E1527*
E1528 vim9.txt /*E1528*
E1529 vim9.txt /*E1529*
E153 helphelp.txt /*E153*
E1530 vim9.txt /*E1530*
E1531 vim9.txt /*E1531*
E1532 eval.txt /*E1532*
E1533 eval.txt /*E1533*
E1534 vim9.txt /*E1534*
E1535 eval.txt /*E1535*
E1536 eval.txt /*E1536*
E1537 eval.txt /*E1537*
E1538 eval.txt /*E1538*
E1539 vim9.txt /*E1539*
E154 helphelp.txt /*E154*
E1540 eval.txt /*E1540*
E1541 vi_diff.txt /*E1541*
E1547 various.txt /*E1547*
E1548 wayland.txt /*E1548*
E155 sign.txt /*E155*
E156 sign.txt /*E156*
E157 sign.txt /*E157*
@ -5756,6 +5834,7 @@ TSQL ft_sql.txt /*TSQL*
TTpro-telnet syntax.txt /*TTpro-telnet*
Tab intro.txt /*Tab*
TabClosed autocmd.txt /*TabClosed*
TabClosedPre autocmd.txt /*TabClosedPre*
TabEnter autocmd.txt /*TabEnter*
TabLeave autocmd.txt /*TabLeave*
TabNew autocmd.txt /*TabNew*
@ -5778,6 +5857,8 @@ TextChangedP autocmd.txt /*TextChangedP*
TextChangedT autocmd.txt /*TextChangedT*
TextYankPost autocmd.txt /*TextYankPost*
Transact-SQL ft_sql.txt /*Transact-SQL*
Tuple eval.txt /*Tuple*
Tuples eval.txt /*Tuples*
U undo.txt /*U*
UTF-8 mbyte.txt /*UTF-8*
UTF8-xterm mbyte.txt /*UTF8-xterm*
@ -6527,6 +6608,7 @@ close_cb channel.txt /*close_cb*
closure eval.txt /*closure*
cmdarg-variable eval.txt /*cmdarg-variable*
cmdbang-variable eval.txt /*cmdbang-variable*
cmdcomplete_info() builtin.txt /*cmdcomplete_info()*
cmdline-arguments vi_diff.txt /*cmdline-arguments*
cmdline-changed version5.txt /*cmdline-changed*
cmdline-completion cmdline.txt /*cmdline-completion*
@ -6587,6 +6669,7 @@ compiler-ruff quickfix.txt /*compiler-ruff*
compiler-select quickfix.txt /*compiler-select*
compiler-spotbugs quickfix.txt /*compiler-spotbugs*
compiler-tex quickfix.txt /*compiler-tex*
compiler-tsc quickfix.txt /*compiler-tsc*
compiler-typst quickfix.txt /*compiler-typst*
compiler-vaxada ft_ada.txt /*compiler-vaxada*
compl-current insert.txt /*compl-current*
@ -6598,7 +6681,9 @@ compl-generic insert.txt /*compl-generic*
compl-keyword insert.txt /*compl-keyword*
compl-omni insert.txt /*compl-omni*
compl-omni-filetypes insert.txt /*compl-omni-filetypes*
compl-register-words insert.txt /*compl-register-words*
compl-spelling insert.txt /*compl-spelling*
compl-states insert.txt /*compl-states*
compl-stop insert.txt /*compl-stop*
compl-tag insert.txt /*compl-tag*
compl-thesaurus insert.txt /*compl-thesaurus*
@ -6619,6 +6704,7 @@ complete_add() builtin.txt /*complete_add()*
complete_check() builtin.txt /*complete_check()*
complete_info() builtin.txt /*complete_info()*
complete_info_mode builtin.txt /*complete_info_mode*
complete_match() builtin.txt /*complete_match()*
completed_item-variable eval.txt /*completed_item-variable*
completion-functions usr_41.txt /*completion-functions*
complex-change change.txt /*complex-change*
@ -6711,12 +6797,14 @@ cpo-x options.txt /*cpo-x*
cpo-y options.txt /*cpo-y*
cpo-z options.txt /*cpo-z*
cpo-{ options.txt /*cpo-{*
cpo-~ options.txt /*cpo-~*
cpp.vim syntax.txt /*cpp.vim*
crash-recovery recover.txt /*crash-recovery*
creating-menus gui.txt /*creating-menus*
credits intro.txt /*credits*
crontab options.txt /*crontab*
cs-find if_cscop.txt /*cs-find*
cs.vim syntax.txt /*cs.vim*
cs7-problem term.txt /*cs7-problem*
cscope if_cscop.txt /*cscope*
cscope-commands if_cscop.txt /*cscope-commands*
@ -6803,6 +6891,7 @@ debugger-support debugger.txt /*debugger-support*
debugger.txt debugger.txt /*debugger.txt*
dec-mouse options.txt /*dec-mouse*
decada_members ft_ada.txt /*decada_members*
deduplicating change.txt /*deduplicating*
deepcopy() builtin.txt /*deepcopy()*
default-constructor vim9class.txt /*default-constructor*
defaults.vim starting.txt /*defaults.vim*
@ -7314,6 +7403,7 @@ ft-context-intro ft_context.txt /*ft-context-intro*
ft-context-mappings ft_context.txt /*ft-context-mappings*
ft-context-settings ft_context.txt /*ft-context-settings*
ft-cpp-syntax syntax.txt /*ft-cpp-syntax*
ft-cs-syntax syntax.txt /*ft-cs-syntax*
ft-csh-syntax syntax.txt /*ft-csh-syntax*
ft-css-omni insert.txt /*ft-css-omni*
ft-csv-syntax syntax.txt /*ft-csv-syntax*
@ -7343,14 +7433,18 @@ ft-freebasic-syntax syntax.txt /*ft-freebasic-syntax*
ft-fvwm-syntax syntax.txt /*ft-fvwm-syntax*
ft-gdscript-plugin filetype.txt /*ft-gdscript-plugin*
ft-gitcommit-plugin filetype.txt /*ft-gitcommit-plugin*
ft-gitrebase-plugin filetype.txt /*ft-gitrebase-plugin*
ft-gleam-plugin filetype.txt /*ft-gleam-plugin*
ft-go-plugin filetype.txt /*ft-go-plugin*
ft-gprof-plugin filetype.txt /*ft-gprof-plugin*
ft-groff-syntax syntax.txt /*ft-groff-syntax*
ft-gsp-syntax syntax.txt /*ft-gsp-syntax*
ft-hare filetype.txt /*ft-hare*
ft-haskell-syntax syntax.txt /*ft-haskell-syntax*
ft-help-omni helphelp.txt /*ft-help-omni*
ft-html-indent indent.txt /*ft-html-indent*
ft-html-omni insert.txt /*ft-html-omni*
ft-html-plugin filetype.txt /*ft-html-plugin*
ft-html-syntax syntax.txt /*ft-html-syntax*
ft-htmlos-syntax syntax.txt /*ft-htmlos-syntax*
ft-ia64-syntax syntax.txt /*ft-ia64-syntax*
@ -7384,6 +7478,7 @@ ft-markdown-syntax syntax.txt /*ft-markdown-syntax*
ft-masm-syntax syntax.txt /*ft-masm-syntax*
ft-mathematica-syntax syntax.txt /*ft-mathematica-syntax*
ft-matlab-indent indent.txt /*ft-matlab-indent*
ft-mbsync-syntax syntax.txt /*ft-mbsync-syntax*
ft-mediawiki-syntax syntax.txt /*ft-mediawiki-syntax*
ft-metafont ft_mp.txt /*ft-metafont*
ft-metafont-intro ft_mp.txt /*ft-metafont-intro*
@ -7417,6 +7512,7 @@ ft-php-syntax syntax.txt /*ft-php-syntax*
ft-php3-syntax syntax.txt /*ft-php3-syntax*
ft-phtml-syntax syntax.txt /*ft-phtml-syntax*
ft-plaintex-syntax syntax.txt /*ft-plaintex-syntax*
ft-plsql-plugin filetype.txt /*ft-plsql-plugin*
ft-posix-syntax syntax.txt /*ft-posix-syntax*
ft-postscr-syntax syntax.txt /*ft-postscr-syntax*
ft-ppwiz-syntax syntax.txt /*ft-ppwiz-syntax*
@ -7480,6 +7576,7 @@ ft-xml-omni insert.txt /*ft-xml-omni*
ft-xml-syntax syntax.txt /*ft-xml-syntax*
ft-xpm-syntax syntax.txt /*ft-xpm-syntax*
ft-yaml-indent indent.txt /*ft-yaml-indent*
ft-yaml-plugin filetype.txt /*ft-yaml-plugin*
ft-yaml-syntax syntax.txt /*ft-yaml-syntax*
ft-zig-plugin filetype.txt /*ft-zig-plugin*
ft-zimbu-plugin filetype.txt /*ft-zimbu-plugin*
@ -7532,6 +7629,7 @@ g:Netrw_corehandler pi_netrw.txt /*g:Netrw_corehandler*
g:Netrw_funcref pi_netrw.txt /*g:Netrw_funcref*
g:Openprg eval.txt /*g:Openprg*
g:actual_curbuf options.txt /*g:actual_curbuf*
g:actual_curtabpage options.txt /*g:actual_curtabpage*
g:actual_curwin options.txt /*g:actual_curwin*
g:ada#Comment ft_ada.txt /*g:ada#Comment*
g:ada#Ctags_Kinds ft_ada.txt /*g:ada#Ctags_Kinds*
@ -7578,6 +7676,7 @@ g:filetype_csh syntax.txt /*g:filetype_csh*
g:filetype_haredoc ft_hare.txt /*g:filetype_haredoc*
g:filetype_md syntax.txt /*g:filetype_md*
g:filetype_r syntax.txt /*g:filetype_r*
g:ft_man_implementation filetype.txt /*g:ft_man_implementation*
g:ftplugin_rust_source_path ft_rust.txt /*g:ftplugin_rust_source_path*
g:gnat ft_ada.txt /*g:gnat*
g:gnat.Error_Format ft_ada.txt /*g:gnat.Error_Format*
@ -7649,7 +7748,6 @@ g:netrw_dav_cmd pi_netrw.txt /*g:netrw_dav_cmd*
g:netrw_decompress pi_netrw.txt /*g:netrw_decompress*
g:netrw_dirhistmax pi_netrw.txt /*g:netrw_dirhistmax*
g:netrw_dynamic_maxfilenamelen pi_netrw.txt /*g:netrw_dynamic_maxfilenamelen*
g:netrw_errorlvl pi_netrw.txt /*g:netrw_errorlvl*
g:netrw_fastbrowse pi_netrw.txt /*g:netrw_fastbrowse*
g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd*
g:netrw_ffkeep pi_netrw.txt /*g:netrw_ffkeep*
@ -7689,7 +7787,6 @@ g:netrw_maxfilenamelen pi_netrw.txt /*g:netrw_maxfilenamelen*
g:netrw_menu pi_netrw.txt /*g:netrw_menu*
g:netrw_mkdir_cmd pi_netrw.txt /*g:netrw_mkdir_cmd*
g:netrw_mousemaps pi_netrw.txt /*g:netrw_mousemaps*
g:netrw_nobeval pi_netrw.txt /*g:netrw_nobeval*
g:netrw_preview pi_netrw.txt /*g:netrw_preview*
g:netrw_rcp_cmd pi_netrw.txt /*g:netrw_rcp_cmd*
g:netrw_remote_mkdir pi_netrw.txt /*g:netrw_remote_mkdir*
@ -7718,7 +7815,6 @@ g:netrw_sshport pi_netrw.txt /*g:netrw_sshport*
g:netrw_timefmt pi_netrw.txt /*g:netrw_timefmt*
g:netrw_tmpfile_escape pi_netrw.txt /*g:netrw_tmpfile_escape*
g:netrw_uid pi_netrw.txt /*g:netrw_uid*
g:netrw_use_errorwindow pi_netrw.txt /*g:netrw_use_errorwindow*
g:netrw_use_noswf pi_netrw.txt /*g:netrw_use_noswf*
g:netrw_use_nt_rcp pi_netrw.txt /*g:netrw_use_nt_rcp*
g:netrw_usetab pi_netrw.txt /*g:netrw_usetab*
@ -7761,7 +7857,6 @@ g:tar_copycmd pi_tar.txt /*g:tar_copycmd*
g:tar_extractcmd pi_tar.txt /*g:tar_extractcmd*
g:tar_nomax pi_tar.txt /*g:tar_nomax*
g:tar_readoptions pi_tar.txt /*g:tar_readoptions*
g:tar_secure pi_tar.txt /*g:tar_secure*
g:tar_writeoptions pi_tar.txt /*g:tar_writeoptions*
g:termdebug_config terminal.txt /*g:termdebug_config*
g:termdebugger terminal.txt /*g:termdebugger*
@ -7859,6 +7954,7 @@ get()-blob builtin.txt /*get()-blob*
get()-dict builtin.txt /*get()-dict*
get()-func builtin.txt /*get()-func*
get()-list builtin.txt /*get()-list*
get()-tuple builtin.txt /*get()-tuple*
get-ms-debuggers debug.txt /*get-ms-debuggers*
getbufinfo() builtin.txt /*getbufinfo()*
getbufline() builtin.txt /*getbufline()*
@ -7881,6 +7977,7 @@ getcmdscreenpos() builtin.txt /*getcmdscreenpos()*
getcmdtype() builtin.txt /*getcmdtype()*
getcmdwintype() builtin.txt /*getcmdwintype()*
getcompletion() builtin.txt /*getcompletion()*
getcompletiontype() builtin.txt /*getcompletiontype()*
getcurpos() builtin.txt /*getcurpos()*
getcursorcharpos() builtin.txt /*getcursorcharpos()*
getcwd() builtin.txt /*getcwd()*
@ -8165,6 +8262,7 @@ hl-DiffAdd syntax.txt /*hl-DiffAdd*
hl-DiffChange syntax.txt /*hl-DiffChange*
hl-DiffDelete syntax.txt /*hl-DiffDelete*
hl-DiffText syntax.txt /*hl-DiffText*
hl-DiffTextAdd syntax.txt /*hl-DiffTextAdd*
hl-Directory syntax.txt /*hl-Directory*
hl-EndOfBuffer syntax.txt /*hl-EndOfBuffer*
hl-ErrorMsg syntax.txt /*hl-ErrorMsg*
@ -8213,6 +8311,9 @@ hl-TOhtmlProgress syntax.txt /*hl-TOhtmlProgress*
hl-TabLine syntax.txt /*hl-TabLine*
hl-TabLineFill syntax.txt /*hl-TabLineFill*
hl-TabLineSel syntax.txt /*hl-TabLineSel*
hl-TabPanel syntax.txt /*hl-TabPanel*
hl-TabPanelFill syntax.txt /*hl-TabPanelFill*
hl-TabPanelSel syntax.txt /*hl-TabPanelSel*
hl-Terminal syntax.txt /*hl-Terminal*
hl-Title syntax.txt /*hl-Title*
hl-ToolbarButton gui.txt /*hl-ToolbarButton*
@ -8234,6 +8335,7 @@ hlexists() builtin.txt /*hlexists()*
hlget() builtin.txt /*hlget()*
hlsearch-variable eval.txt /*hlsearch-variable*
hlset() builtin.txt /*hlset()*
hlyank-install usr_05.txt /*hlyank-install*
holy-grail index.txt /*holy-grail*
home intro.txt /*home*
home-replace editing.txt /*home-replace*
@ -8351,6 +8453,7 @@ i_CTRL-X_CTRL-L insert.txt /*i_CTRL-X_CTRL-L*
i_CTRL-X_CTRL-N insert.txt /*i_CTRL-X_CTRL-N*
i_CTRL-X_CTRL-O insert.txt /*i_CTRL-X_CTRL-O*
i_CTRL-X_CTRL-P insert.txt /*i_CTRL-X_CTRL-P*
i_CTRL-X_CTRL-R insert.txt /*i_CTRL-X_CTRL-R*
i_CTRL-X_CTRL-S insert.txt /*i_CTRL-X_CTRL-S*
i_CTRL-X_CTRL-T insert.txt /*i_CTRL-X_CTRL-T*
i_CTRL-X_CTRL-U insert.txt /*i_CTRL-X_CTRL-U*
@ -8413,7 +8516,6 @@ improvements-6 version6.txt /*improvements-6*
improvements-7 version7.txt /*improvements-7*
improvements-8 version8.txt /*improvements-8*
improvements-9 version9.txt /*improvements-9*
improvements-9.2 version9.txt /*improvements-9.2*
in_bot channel.txt /*in_bot*
in_buf channel.txt /*in_buf*
in_io-buffer channel.txt /*in_io-buffer*
@ -8504,6 +8606,7 @@ i} motion.txt /*i}*
j motion.txt /*j*
java-cinoptions indent.txt /*java-cinoptions*
java-indenting indent.txt /*java-indenting*
java-package-info-url syntax.txt /*java-package-info-url*
java.vim syntax.txt /*java.vim*
javascript-cinoptions indent.txt /*javascript-cinoptions*
javascript-indenting indent.txt /*javascript-indenting*
@ -8544,7 +8647,6 @@ jsbterm-mouse options.txt /*jsbterm-mouse*
json.vim syntax.txt /*json.vim*
json_decode() builtin.txt /*json_decode()*
json_encode() builtin.txt /*json_encode()*
jtags tagsrch.txt /*jtags*
jump-motions motion.txt /*jump-motions*
jumplist motion.txt /*jumplist*
jumplist-stack motion.txt /*jumplist-stack*
@ -8638,6 +8740,7 @@ list-modification eval.txt /*list-modification*
list-repeat windows.txt /*list-repeat*
list2blob() builtin.txt /*list2blob()*
list2str() builtin.txt /*list2str()*
list2tuple() builtin.txt /*list2tuple()*
listener_add() builtin.txt /*listener_add()*
listener_flush() builtin.txt /*listener_flush()*
listener_remove() builtin.txt /*listener_remove()*
@ -8802,6 +8905,7 @@ matlab-indent indent.txt /*matlab-indent*
matlab-indenting indent.txt /*matlab-indenting*
max() builtin.txt /*max()*
maxcol-variable eval.txt /*maxcol-variable*
mbsync.vim syntax.txt /*mbsync.vim*
mbyte-IME mbyte.txt /*mbyte-IME*
mbyte-XIM mbyte.txt /*mbyte-XIM*
mbyte-combining mbyte.txt /*mbyte-combining*
@ -9134,7 +9238,6 @@ netrw-rightmouse pi_netrw.txt /*netrw-rightmouse*
netrw-s pi_netrw.txt /*netrw-s*
netrw-s-cr pi_netrw.txt /*netrw-s-cr*
netrw-settings pi_netrw.txt /*netrw-settings*
netrw-settings-window pi_netrw.txt /*netrw-settings-window*
netrw-sexplore pi_netrw.txt /*netrw-sexplore*
netrw-sort pi_netrw.txt /*netrw-sort*
netrw-sort-sequence pi_netrw.txt /*netrw-sort-sequence*
@ -9398,9 +9501,11 @@ package-doc repeat.txt /*package-doc*
package-documentation repeat.txt /*package-documentation*
package-editorconfig usr_05.txt /*package-editorconfig*
package-helptoc helphelp.txt /*package-helptoc*
package-hlyank usr_05.txt /*package-hlyank*
package-justify usr_25.txt /*package-justify*
package-matchit usr_05.txt /*package-matchit*
package-nohlsearch usr_05.txt /*package-nohlsearch*
package-open eval.txt /*package-open*
package-termdebug terminal.txt /*package-termdebug*
package-translate_example repeat.txt /*package-translate_example*
package-translation repeat.txt /*package-translation*
@ -9479,6 +9584,7 @@ phtml.vim syntax.txt /*phtml.vim*
pi_getscript.txt pi_getscript.txt /*pi_getscript.txt*
pi_gzip.txt pi_gzip.txt /*pi_gzip.txt*
pi_logipat.txt pi_logipat.txt /*pi_logipat.txt*
pi_netrw.txt pi_netrw.txt /*pi_netrw.txt*
pi_paren.txt pi_paren.txt /*pi_paren.txt*
pi_spec.txt pi_spec.txt /*pi_spec.txt*
pi_tar.txt pi_tar.txt /*pi_tar.txt*
@ -9640,6 +9746,7 @@ python-2-and-3 if_pyth.txt /*python-2-and-3*
python-Dictionary if_pyth.txt /*python-Dictionary*
python-Function if_pyth.txt /*python-Function*
python-List if_pyth.txt /*python-List*
python-Tuple if_pyth.txt /*python-Tuple*
python-VIM_SPECIAL_PATH if_pyth.txt /*python-VIM_SPECIAL_PATH*
python-_get_paths if_pyth.txt /*python-_get_paths*
python-bindeval if_pyth.txt /*python-bindeval*
@ -9717,6 +9824,7 @@ quickfix-pandoc quickfix.txt /*quickfix-pandoc*
quickfix-parse quickfix.txt /*quickfix-parse*
quickfix-perl quickfix.txt /*quickfix-perl*
quickfix-size quickfix.txt /*quickfix-size*
quickfix-stack quickfix.txt /*quickfix-stack*
quickfix-title quickfix.txt /*quickfix-title*
quickfix-valid quickfix.txt /*quickfix-valid*
quickfix-window quickfix.txt /*quickfix-window*
@ -9949,6 +10057,7 @@ search() builtin.txt /*search()*
search()-sub-match builtin.txt /*search()-sub-match*
search-commands pattern.txt /*search-commands*
search-offset pattern.txt /*search-offset*
search-options pattern.txt /*search-options*
search-pattern pattern.txt /*search-pattern*
search-range pattern.txt /*search-range*
search-replace change.txt /*search-replace*
@ -9997,6 +10106,7 @@ settagstack() builtin.txt /*settagstack()*
setting-guifont gui.txt /*setting-guifont*
setting-guitablabel tabpage.txt /*setting-guitablabel*
setting-tabline tabpage.txt /*setting-tabline*
setting-tabpanel tabpage.txt /*setting-tabpanel*
setuid change.txt /*setuid*
setwinvar() builtin.txt /*setwinvar()*
sftp pi_netrw.txt /*sftp*
@ -10310,6 +10420,7 @@ subscript eval.txt /*subscript*
substitute() builtin.txt /*substitute()*
substitute-CR version6.txt /*substitute-CR*
substring eval.txt /*substring*
subtuple eval.txt /*subtuple*
suffixes cmdline.txt /*suffixes*
suspend starting.txt /*suspend*
swap-exists-choices usr_11.txt /*swap-exists-choices*
@ -10559,6 +10670,7 @@ t_ti term.txt /*t_ti*
t_tp version4.txt /*t_tp*
t_ts term.txt /*t_ts*
t_ts_old version4.txt /*t_ts_old*
t_tuple-variable eval.txt /*t_tuple-variable*
t_typealias-variable eval.txt /*t_typealias-variable*
t_u7 term.txt /*t_u7*
t_ue term.txt /*t_ue*
@ -10585,6 +10697,7 @@ tabpage.txt tabpage.txt /*tabpage.txt*
tabpagebuflist() builtin.txt /*tabpagebuflist()*
tabpagenr() builtin.txt /*tabpagenr()*
tabpagewinnr() builtin.txt /*tabpagewinnr()*
tabpanel tabpage.txt /*tabpanel*
tag tagsrch.txt /*tag*
tag-! tagsrch.txt /*tag-!*
tag-binary-search tagsrch.txt /*tag-binary-search*
@ -10621,6 +10734,7 @@ tar-contents pi_tar.txt /*tar-contents*
tar-copyright pi_tar.txt /*tar-copyright*
tar-history pi_tar.txt /*tar-history*
tar-manual pi_tar.txt /*tar-manual*
tar-mappings pi_tar.txt /*tar-mappings*
tar-options pi_tar.txt /*tar-options*
tar-usage pi_tar.txt /*tar-usage*
tcl if_tcl.txt /*tcl*
@ -10795,6 +10909,7 @@ test_null_job() testing.txt /*test_null_job()*
test_null_list() testing.txt /*test_null_list()*
test_null_partial() testing.txt /*test_null_partial()*
test_null_string() testing.txt /*test_null_string()*
test_null_tuple() testing.txt /*test_null_tuple()*
test_option_not_set() testing.txt /*test_option_not_set()*
test_override() testing.txt /*test_override()*
test_refcount() testing.txt /*test_refcount()*
@ -10880,6 +10995,14 @@ try-echoerr eval.txt /*try-echoerr*
try-finally eval.txt /*try-finally*
try-nested eval.txt /*try-nested*
try-nesting eval.txt /*try-nesting*
tuple eval.txt /*tuple*
tuple-concatenation eval.txt /*tuple-concatenation*
tuple-functions usr_41.txt /*tuple-functions*
tuple-identity eval.txt /*tuple-identity*
tuple-index eval.txt /*tuple-index*
tuple-modification eval.txt /*tuple-modification*
tuple-type vim9.txt /*tuple-type*
tuple2list() builtin.txt /*tuple2list()*
tutor usr_01.txt /*tutor*
two-engines pattern.txt /*two-engines*
type() builtin.txt /*type()*
@ -10918,6 +11041,7 @@ undofile() builtin.txt /*undofile()*
undotree() builtin.txt /*undotree()*
unicode mbyte.txt /*unicode*
uniq() builtin.txt /*uniq()*
unique change.txt /*unique*
unix os_unix.txt /*unix*
unlisted-buffer windows.txt /*unlisted-buffer*
up-down-motions motion.txt /*up-down-motions*
@ -10991,6 +11115,7 @@ v:beval_winnr eval.txt /*v:beval_winnr*
v:char eval.txt /*v:char*
v:charconvert_from eval.txt /*v:charconvert_from*
v:charconvert_to eval.txt /*v:charconvert_to*
v:clipmethod eval.txt /*v:clipmethod*
v:cmdarg eval.txt /*v:cmdarg*
v:cmdbang eval.txt /*v:cmdbang*
v:collate eval.txt /*v:collate*
@ -11076,6 +11201,7 @@ v:t_none eval.txt /*v:t_none*
v:t_number eval.txt /*v:t_number*
v:t_object eval.txt /*v:t_object*
v:t_string eval.txt /*v:t_string*
v:t_tuple eval.txt /*v:t_tuple*
v:t_typealias eval.txt /*v:t_typealias*
v:termblinkresp eval.txt /*v:termblinkresp*
v:termrbgresp eval.txt /*v:termrbgresp*
@ -11093,6 +11219,7 @@ v:version eval.txt /*v:version*
v:versionlong eval.txt /*v:versionlong*
v:vim_did_enter eval.txt /*v:vim_did_enter*
v:warningmsg eval.txt /*v:warningmsg*
v:wayland_display eval.txt /*v:wayland_display*
v:windowid eval.txt /*v:windowid*
v_! change.txt /*v_!*
v_$ visual.txt /*v_$*
@ -11215,6 +11342,7 @@ variable-categories vim9.txt /*variable-categories*
variable-scope eval.txt /*variable-scope*
variable-types vim9.txt /*variable-types*
variables eval.txt /*variables*
variadic-tuple vim9.txt /*variadic-tuple*
various various.txt /*various*
various-cmds various.txt /*various-cmds*
various-functions usr_41.txt /*various-functions*
@ -11304,6 +11432,7 @@ vim-modes-intro intro.txt /*vim-modes-intro*
vim-raku ft_raku.txt /*vim-raku*
vim-script-intro usr_41.txt /*vim-script-intro*
vim-script-library eval.txt /*vim-script-library*
vim-script-notation usr_41.txt /*vim-script-notation*
vim-security intro.txt /*vim-security*
vim-shebang various.txt /*vim-shebang*
vim-tutor-create pi_tutor.txt /*vim-tutor-create*
@ -11449,6 +11578,17 @@ w:quickfix_title quickfix.txt /*w:quickfix_title*
w:var eval.txt /*w:var*
waittime channel.txt /*waittime*
warningmsg-variable eval.txt /*warningmsg-variable*
wayland wayland.txt /*wayland*
wayland-and-x11 wayland.txt /*wayland-and-x11*
wayland-focus-steal wayland.txt /*wayland-focus-steal*
wayland-gnome wayland.txt /*wayland-gnome*
wayland-gui wayland.txt /*wayland-gui*
wayland-persist wayland.txt /*wayland-persist*
wayland-primary-selection wayland.txt /*wayland-primary-selection*
wayland-seat wayland.txt /*wayland-seat*
wayland-selections wayland.txt /*wayland-selections*
wayland-useful wayland.txt /*wayland-useful*
wayland.txt wayland.txt /*wayland.txt*
wdl-syntax syntax.txt /*wdl-syntax*
wdl.vim syntax.txt /*wdl.vim*
white-space pattern.txt /*white-space*

View File

@ -1,4 +1,4 @@
*tagsrch.txt* For Vim version 9.1. Last change: 2024 Aug 01
*tagsrch.txt* For Vim version 9.1. Last change: 2025 May 01
VIM REFERENCE MANUAL by Bram Moolenaar
@ -526,7 +526,7 @@ directory where the tag file is.
==============================================================================
5. Tags file format *tags-file-format* *E431*
*ctags* *jtags*
*ctags*
A tags file can be created with an external command, for example "ctags". It
will contain a tag for each function. Some versions of "ctags" will also make
a tag for each "#defined" macro, typedefs, enums, etc.
@ -542,13 +542,11 @@ exuberant ctags This is a very good one. It works for C, C++, Java,
many items. See http://ctags.sourceforge.net.
No new version since 2009.
etags Connected to Emacs. Supports many languages.
JTags For Java, in Java. It can be found at
http://www.fleiner.com/jtags/.
|:helptags| For Vim's |help| files
ptags.py For Python, in Python. Found in your Python source
directory at Tools/scripts/ptags.py.
ptags For Perl, in Perl. It can be found at (link seems
dead):
http://www.eleves.ens.fr:8080/home/nthiery/Tags/.
ptags For Perl, in Perl. It can be found at
https://metacpan.org/pod/Vim::Tag
gnatxref For Ada. See http://www.gnuada.org/. gnatxref is
part of the gnat package.
@ -894,8 +892,8 @@ Common arguments for the commands above:
7. Using 'tagfunc' *tag-function*
It is possible to provide Vim with a function which will generate a list of
tags used for commands like |:tag|, |:tselect| and Normal mode tag commands
like |CTRL-]|.
tags used for commands like |:tag|, |:tselect|, Normal mode tag commands like
|CTRL-]| and for the |taglist()| function.
The function used for generating the taglist is specified by setting the
'tagfunc' option. The function will be called with three arguments:
@ -914,7 +912,7 @@ Currently up to three flags may be passed to the tag function:
(mnemonic: the tag function may use the context around the
cursor to perform a better job of generating the tag list.)
'i' In Insert mode, the user was completing a tag (with
|i_CTRL-X_CTRL-]| or 'completeopt' contains `t`).
|i_CTRL-X_CTRL-]| or 'complete' contains "`t`" or "`]`").
'r' The first argument to tagfunc should be interpreted as a
|pattern| (see |tag-regexp|), such as when using: >
:tag /pat
@ -950,15 +948,14 @@ It is not allowed to close a window or change window from inside 'tagfunc'.
The following is a hypothetical example of a function used for 'tagfunc'. It
uses the output of |taglist()| to generate the result: a list of tags in the
inverse order of file names.
>
function TagFunc(pattern, flags, info)
function CompareFilenames(item1, item2)
let f1 = a:item1['filename']
let f2 = a:item2['filename']
return f1 >=# f2 ?
\ -1 : f1 <=# f2 ? 1 : 0
endfunction
>vim
function CompareFilenames(item1, item2)
let f1 = a:item1['filename']
let f2 = a:item2['filename']
return f1 >=# f2 ? -1 : f1 <=# f2 ? 1 : 0
endfunction
function TagFunc(pattern, flags, info)
let result = taglist(a:pattern)
call sort(result, "CompareFilenames")
@ -966,5 +963,7 @@ inverse order of file names.
endfunc
set tagfunc=TagFunc
<
Note: When executing |taglist()| the 'tagfunc' function won't be called
recursively.
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -1,4 +1,4 @@
*terminal.txt* For Vim version 9.1. Last change: 2025 Feb 22
*terminal.txt* For Vim version 9.1. Last change: 2025 Jul 08
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1711,6 +1711,9 @@ than 99 will be displayed as "9+".
If you want to customize the breakpoint signs to show `>>` in the signcolumn: >
let g:termdebug_config['sign'] = '>>'
You can also specify individual signs for the first several breakpoints: >
let g:termdebug_config['signs'] = ['>1', '>2', '>3', '>4', '>5', '>6', '>7', '>8', '>9']
let g:termdebug_config['sign'] = '>>'
If you would like to use decimal (base 10) breakpoint signs: >
let g:termdebug_config['sign_decimal'] = 1
If the variable g:termdebug_config does not yet exist, you can use: >

View File

@ -1,4 +1,4 @@
*testing.txt* For Vim version 9.1. Last change: 2024 Jul 18
*testing.txt* For Vim version 9.1. Last change: 2025 Mar 25
VIM REFERENCE MANUAL by Bram Moolenaar
@ -68,7 +68,7 @@ test_feedinput({string}) *test_feedinput()*
test_garbagecollect_now() *test_garbagecollect_now()*
Like garbagecollect(), but executed right away. This must
Like |garbagecollect()|, but executed right away. This must
only be called directly to avoid any structure to exist
internally, and |v:testing| must have been set before calling
any function. *E1142*
@ -364,6 +364,11 @@ test_null_string() *test_null_string()*
Return type: |String|
test_null_tuple() *test_null_tuple()*
Return a |Tuple| that is null. Only useful for testing.
Return type: |Tuple|
test_option_not_set({name}) *test_option_not_set()*
Reset the flag that indicates option {name} was set. Thus it
looks like it still has the default value. Use like this: >

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 9.1. Last change: 2025 Feb 21
*todo.txt* For Vim version 9.1. Last change: 2025 Jun 12
VIM REFERENCE MANUAL by Bram Moolenaar
@ -357,8 +357,6 @@ https://github.com/vim/vim/pull/5566
PR #11579 to add visualtext(), return Visually selected text.
PR #12032: Support Python 3 stable ABI.
PR #11860: Add more info to 'colorcolumn': display a character and highlight
for each separate entry. Disadvantage: option value gets very complicated
with multiple entries, e.g. every 8 columns.
@ -706,8 +704,6 @@ find them. (Max Kukartsev, #6218)
Enable 'termbidi' if $VTE_VERSION >= 5703 ?
Python 3.8 doesn't work. (Antonios Hadjigeorgalis, #5509)
"--cleanFOO" does not result in an error. (#5537)
Output from assert_equalfile() doesn't give a hint about what's different.
@ -1490,8 +1486,6 @@ github with a URL like this:
https://github.com/vim/vim/compare/v7.4.920%5E...v7.4.920.diff
Diff for version.c contains more context, can't skip a patch.
Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
Comparing nested structures with "==" uses a different comparator than when
comparing individual items.
@ -1514,9 +1508,6 @@ C highlighting: modern C allows: /* comment */ #ifdef
and also line continuation after #include.
I can't recommend it though.
Build with Python on Mac does not always use the right library.
(Kazunobu Kuriyama, 2015 Mar 28)
To support Thai (and other languages) word boundaries, include the ICU
library: http://userguide.icu-project.org/boundaryanalysis
@ -1793,13 +1784,6 @@ Problem with refresh:always in completion. (Tyler Wade, 2013 Mar 17)
b:undo_ftplugin cannot call a script-local function. (Boris Danilov, 2013 Jan
7)
Win32: The Python interface only works with one version of Python, selected at
compile time. Can this be made to work with version 2.1 and 2.2 dynamically?
Python: Be able to define a Python function that can be called directly from
Vim script. Requires converting the arguments and return value, like with
vim.bindeval().
Patch for :tabcloseleft, after closing a tab go to left tab. (William Bowers,
2012 Aug 4)
@ -2218,8 +2202,6 @@ displayed in a window should return the value that's stored for that buffer.
":he ctrl_u" can be auto-corrected to ":he ctrl-u".
Diff mode out of sync. (Gary Johnson, 2010 Aug 4)
Win32: completion of file name ":e c:\!test" results in ":e c:\\!test", which
does not work. (Nieko Maatjes, 2009 Jan 8, Ingo Karkat, 2009 Jan 22)
@ -2912,6 +2894,20 @@ Quickfix/Location List:
7 Add a command that goes back to the position from before jumping to the
first quickfix location.
Python Interface:
- Python 3.8 doesn't work. (Antonios Hadjigeorgalis, #5509)
- Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
- Build with Python on Mac does not always use the right library.
(Kazunobu Kuriyama, 2015 Mar 28)
- Win32: The Python interface only works with one version of Python,
selected at compile time. Can this be made to work with version 2.1 and
2.2 dynamically?
- Be able to define a Python function that can be called directly from Vim
script. Requires converting the arguments and return value, like with
vim.bindeval().
Vi incompatibility:
- Try new POSIX tests, made after my comments. (Geoff Clare, 2005 April 7)
Version 1.5 is in ~/src/posix/1.5. (Lynne Canal)
@ -4704,8 +4700,6 @@ Autocommands:
Omni completion:
- Add a flag to 'complete' to be able to do omni completion with CTRL-N (and
mix it with other kinds of completion).
- Ideas from the Vim 7 BOF at SANE:
- For interpreted languages, use the interpreter to obtain information.
Should work for Java (Eclipse does this), Python, Tcl, etc.
@ -4751,20 +4745,10 @@ Insert mode completion/expansion:
7 When expanding file names with an environment variable, add the match with
the unexpanded var. So $HOME/tm expands to "/home/guy/tmp" and
"$HOME/tmp"
8 When there is no word before the cursor but something like "sys." complete
with "sys.". Works well for C and similar languages.
9 ^X^L completion doesn't repeat correctly. It uses the first match with
the last added line, instead of continuing where the last match ended.
(Webb)
8 Add option to set different behavior for Insert mode completion:
- ignore/match case
- different characters than 'iskeyword'
8 Add option 'isexpand', containing characters when doing expansion (so that
"." and "\" can be included, without changing 'iskeyword'). (Goldfarb)
Also: 'istagword': characters used for CTRL-].
When 'isexpand' or 'istagword' are empty, use 'iskeyword'.
Alternative: Use a pattern so that start and end of a keyword can be
defined, only allow dash in the middle, etc.
8 Add option 'istagword': characters used for CTRL-]. like 'isexpand'
8 Add a command to undo the completion, go back to the original text.
7 Completion of an abbreviation: Can leave letters out, like what Instant
text does: www.textware.com
@ -4776,7 +4760,6 @@ Insert mode completion/expansion:
7 When expanding $HOME/dir with ^X^F keep the $HOME (with an option?).
7 Add CTRL-X command in Insert mode like CTRL-X CTRL-N, that completes WORDS
instead of words.
8 Add CTRL-X CTRL-R: complete words from register contents.
8 Add completion of previously inserted texts (like what CTRL-A does).
Requires remembering a number of insertions.
8 Add 'f' flag to 'complete': Expand file names.
@ -6276,5 +6259,4 @@ Far future and "big" extensions:
are reflected in each Vim immediately. Could work with local files but
also over the internet. See http://www.codingmonkeys.de/subethaedit/.
vim:tw=78:sw=4:sts=4:ts=8:noet:ft=help:norl:
vim: set fo+=n :
vim:tw=78:sw=4:sts=4:ts=8:noet:ft=help:norl:fo+=n:

View File

@ -1,4 +1,4 @@
*uganda.txt* For Vim version 9.1. Last change: 2024 Aug 14
*uganda.txt* For Vim version 9.1. Last change: 2025 Jul 08
VIM REFERENCE MANUAL by Bram Moolenaar
@ -21,6 +21,13 @@ Uganda anyway.
The Open Publication License applies to the Vim documentation, see
|manual-copyright|.
The icons used for the toolbar in the Win32 GUI are from the "Farm-Fresh Web
Icons" set. These icons are licensed under the Creative Commons Attribution
3.0 License and were created by FatCow Web Hosting. They were previously
available at http://www.fatcow.com/free-icons and are still available at:
https://www.iconarchive.com/show/farm-fresh-icons-by-fatcow.1.html
=== begin of license ===
VIM LICENSE
@ -127,6 +134,9 @@ Note:
contact information with the "--with-modified-by" configure argument or the
MODIFIED_BY define.
- This license applies to the source code of Vim. However, different license
conditions may apply to some runtime files included with Vim; these will be
specified in the header of each respective file.
==============================================================================
Kibaale Children's Centre *kcc* *Kibaale* *charity*

View File

@ -1,4 +1,4 @@
*usr_02.txt* For Vim version 9.1. Last change: 2025 Feb 01
*usr_02.txt* For Vim version 9.1. Last change: 2025 Jun 03
VIM USER MANUAL - by Bram Moolenaar
@ -438,9 +438,9 @@ of the tag given by the word under the cursor.)
After a few jumps, you might want to go back. CTRL-T (pop tag) takes you
back to the preceding position. CTRL-O (jump to older position) also works
nicely here.
At the top of the help screen, there is the notation *help.txt*. This name
between "*" characters is used by the help system to define a tag (hyperlink
destination).
At the top of the help screen, there is the notation "*help.txt*". This
name between "*" characters is used by the help system to define a tag
(hyperlink destination).
See |29.1| for details about using tags.
To get help on a given subject, use the following command: >

View File

@ -1,4 +1,4 @@
*usr_05.txt* For Vim version 9.1. Last change: 2025 Jan 11
*usr_05.txt* For Vim version 9.1. Last change: 2025 Apr 10
VIM USER MANUAL - by Bram Moolenaar
@ -307,23 +307,27 @@ This switches on three very clever mechanisms:
filetypes. See |:filetype-indent-on| and 'indentexpr'.
*restore-cursor* *last-position-jump* >
*restore-cursor* *last-position-jump* >vim
augroup RestoreCursor
autocmd!
autocmd BufReadPost *
\ let line = line("'\"")
\ | if line >= 1 && line <= line("$") && &filetype !~# 'commit'
\ && index(['xxd', 'gitrebase'], &filetype) == -1
\ && !&diff
\ | execute "normal! g`\""
\ | endif
augroup END
Another autocommand. This time it is used after reading any file. The
complicated stuff after it checks if the '" mark is defined, and jumps to it
if so. It doesn't do that for a commit or rebase message, which are likely
a different one than last time, and when using xxd(1) to filter and edit
binary files, which transforms input files back and forth, causing them to
have dual nature, so to speak. See also |using-xxd|.
if so. It doesn't do that when:
- editing a commit or rebase message, which are likely a different one than
last time,
- using xxd(1) to filter and edit binary files, which transforms input files
back and forth, causing them to have dual nature, so to speak (see also
|using-xxd|) and
- Vim is in diff mode
The backslash at the start of a line is used to continue the command from the
previous line. That avoids a line getting very long. See |line-continuation|.
@ -437,7 +441,7 @@ After restarting your Vim, the plugin is active and you can read about it at: >
:h editorconfig.txt
Adding comment package *comment-install* *package-comment*
Adding the comment package *comment-install* *package-comment*
Load the plugin with this command: >
packadd comment
@ -450,7 +454,7 @@ the package loaded. Once the package is loaded, read about it at: >
:h comment.txt
Adding nohlsearch package *nohlsearch-install* *package-nohlsearch*
Adding the nohlsearch package *nohlsearch-install* *package-nohlsearch*
Load the plugin with this command: >
packadd nohlsearch
@ -464,6 +468,31 @@ To disable the effect of the plugin after it has been loaded: >
au! nohlsearch
<
Adding the highlight-yank package *hlyank-install* *package-hlyank*
Load the plugin with this command: >
packadd hlyank
<
This package briefly highlights the affected region of the last |yank|
command. See |52.6| for a simplified implementation using the
|getregionpos()| function.
The plugin understands the following configuration variables (the settings
show the default values).
To specify a different highlighting group, use: >
:let g:hlyank_hlgroup = 'IncSearch'
<
To use a different highlighting duration, use: >
:let g:hlyank_duration = 300
The unit is milliseconds, and the upper limit is 3000 ms. If you set a value
higher than this, the highlighting duration will be 3000 ms.
To highlight in visual mode, use: >
:let g:hlyank_invisual = v:true
To disable the effect of the plugin after it has been loaded: >
au! hlyank
More information about packages can be found here: |packages|.

View File

@ -1,4 +1,4 @@
*usr_11.txt* For Vim version 9.1. Last change: 2020 Oct 25
*usr_11.txt* For Vim version 9.1. Last change: 2025 Jun 03
VIM USER MANUAL - by Bram Moolenaar
@ -127,7 +127,7 @@ Example: >
vim -r .help.txt.swo
This is also handy when the swap file is in another directory than expected.
Vim recognizes files with the pattern *.s[uvw][a-z] as swap files.
Vim recognizes files with the pattern "*.s[uvw][a-z]" as swap files.
If this still does not work, see what file names Vim reports and rename the
files accordingly. Check the 'directory' option to see where Vim may have

View File

@ -1,4 +1,4 @@
*usr_22.txt* For Vim version 9.1. Last change: 2024 Oct 05
*usr_22.txt* For Vim version 9.1. Last change: 2025 Jun 04
VIM USER MANUAL - by Bram Moolenaar
@ -27,23 +27,25 @@ Vim has a plugin that makes it possible to edit a directory. Try this: >
:edit .
Through the magic of autocommands and Vim scripts, the window will be filled
with the contents of the directory. It looks like this:
with the contents of the directory. It looks like this (slightly cleaned up
so that it fits within 80 chars): >
" ============================================================================ ~
" Netrw Directory Listing (netrw v109) ~
" Sorted by name ~
" Sort sequence: [\/]$,\.h$,\.c$,\.cpp$,*,\.info$,\.swp$,\.o$\.obj$,\.bak$ ~
" Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:exec ~
" ============================================================================ ~
../ ~
./ ~
check/ ~
Makefile ~
autocmd.txt ~
change.txt ~
eval.txt ~
filetype.txt ~
help.txt.info ~
" ===========================================================================
" Netrw Directory Listing (netrw v180)
" /path/to/vim/runtime/doc
" Sorted by name
" Sort sequence: [\/]$,*,\(\.bak\|\~\|\.o\|\.h\|\.info\|\.swp\)[*@]\=$
" Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:special
" ===========================================================================
../
./
check/
Makefile
autocmd.txt
change.txt
eval.txt
filetype.txt
help.txt.info
You can see these items:

View File

@ -1,4 +1,4 @@
*usr_24.txt* For Vim version 9.1. Last change: 2018 Mar 18
*usr_24.txt* For Vim version 9.1. Last change: 2025 Jun 22
VIM USER MANUAL - by Bram Moolenaar
@ -187,6 +187,7 @@ with a certain type of item:
CTRL-X CTRL-D macro definitions (also in included files)
CTRL-X CTRL-I current and included files
CTRL-X CTRL-K words from a dictionary
CTRL-X CTRL-R contents from registers
CTRL-X CTRL-T words from a thesaurus
CTRL-X CTRL-] tags
CTRL-X CTRL-V Vim command line
@ -567,14 +568,13 @@ that combination. Thus CTRL-K dP also works. Since there is no digraph for
using. Always use ":digraphs" to find out which digraphs are currently
available.
You can define your own digraphs. Example: >
You can define your own digraphs by specifying the target character with a
decimal number. Example: >
:digraph a" ä
:digraph a\" 228
This defines that CTRL-K a" inserts an ä character. You can also specify the
character with a decimal number. This defines the same digraph: >
:digraph a" 228
This defines that CTRL-K a" inserts an ä character. Note: we had to escape
the " character since otherwise it would act as a comment character.
More information about digraphs here: |digraphs|
Another way to insert special characters is with a keymap. More about that

View File

@ -1,4 +1,4 @@
*usr_25.txt* For Vim version 9.1. Last change: 2025 Feb 01
*usr_25.txt* For Vim version 9.1. Last change: 2025 Jun 13
VIM USER MANUAL - by Bram Moolenaar
@ -200,7 +200,7 @@ command: >vim
Or put this line in your |vimrc|: >vim
packadd! justify
:packadd! justify
This Vim script file defines a new visual command "_j". To justify a block of
text, highlight the text in Visual mode and then execute "_j".
@ -215,27 +215,28 @@ An alternative is to filter the text through an external program. Example: >
*25.3* Indents and tabs
Indents can be used to make text stand out from the rest. The example texts
in this manual, for example, are indented by eight spaces or a tab. You would
normally enter this by typing a tab at the start of each line. Take this
in this manual, for example, are indented by eight columns. You would
normally enter this by typing <Tab> at the start of each line. Take this
text:
the first line ~
the second line ~
This is entered by typing a tab, some text, <Enter>, tab and more text.
This is entered by typing <Tab>, some text, <Enter>, <Tab> and more text.
The 'autoindent' option inserts indents automatically: >
:set autoindent
When a new line is started it gets the same indent as the previous line. In
the above example, the tab after the <Enter> is not needed anymore.
the above example, pressing the <Tab> key after <Enter> is not needed anymore.
INCREASING INDENT
To increase the amount of indent in a line, use the ">" operator. Often this
is used as ">>", which adds indent to the current line.
To increase the amount of indent in a line, use the ">" operator, in Normal
mode. Often this is used as ">>", which adds indent to the current line.
In Insert mode, use <C-t>.
The amount of indent added is specified with the 'shiftwidth' option. The
default value is 8. To make ">>" insert four spaces worth of indent, for
default value is 8. To make ">>" insert four columns worth of indent, for
example, type this: >
:set shiftwidth=4
@ -248,46 +249,27 @@ When used on the second line of the example text, this is what you get:
"4>>" will increase the indent of four lines.
TABSTOP
SOFT TAB STOPS
If you want to make indents a multiple of 4, you set 'shiftwidth' to 4. But
when pressing a <Tab> you still get 8 spaces worth of indent. To change this,
set the 'softtabstop' option: >
when pressing a <Tab> you still get 8 columns worth of indent. To change
this, set the 'softtabstop' option: >
:set softtabstop=4
This will make the <Tab> key insert 4 spaces worth of indent. If there are
already four spaces, a <Tab> character is used (saving seven characters in the
file). (If you always want spaces and no tab characters, set the 'expandtab'
option.)
Vim now creates invisible tab stops for your cursor every 4 columns; hitting
<Tab> jumps to the next stop and inserts the exact mix of spaces or tabs
needed.
Note:
You could set the 'tabstop' option to 4. However, if you edit the
file another time, with 'tabstop' set to the default value of 8, it
will look wrong. In other programs and when printing the indent will
also be wrong. Therefore it is recommended to keep 'tabstop' at eight
all the time. That's the standard value everywhere.
all the time. That's the standard value everywhere on UNIX-like
systems.
CHANGING TABS
You edit a file which was written with a tabstop of 3. In Vim it looks ugly,
because it uses the normal tabstop value of 8. You can fix this by setting
'tabstop' to 3. But you have to do this every time you edit this file.
Vim can change the use of tabstops in your file. First, set 'tabstop' to
make the indents look good, then use the ":retab" command: >
:set tabstop=3
:retab 8
The ":retab" command will change 'tabstop' to 8, while changing the text such
that it looks the same. It changes spans of white space into tabs and spaces
for this. You can now write the file. Next time you edit it the indents will
be right without setting an option.
Warning: When using ":retab" on a program, it may change white space inside
a string constant. Therefore it's a good habit to use "\t" instead of a
real tab.
==============================================================================
*25.4* Dealing with long lines
@ -576,6 +558,32 @@ The "gR" command uses Virtual Replace mode. This preserves the layout:
inp 0.786 0.534 0.693 ~
REFORMATTING TABS IN TABLES
You edit a file that contains tabular data and the original author of the file
decided to align the tabular data using tab characters (instead of spaces).
Alas, they were using tab stops separated by 4 columns and Vim's default
is 8 columns; the table looks wrong! What can be done?
To fix the appearance without modifying the file, adjust the setting
temporarily: >
:set tabstop=4
This updates the visual layout, but the file itself remains unchanged.
Another possibility is to permanently reformat the file. For this Vim
provides the |:retab| command. First, set 'tabstop' to match original layout
(as above), then run: >
:retab 8
The ":retab" command will change 'tabstop' to 8, while changing the text such
that it looks the same. It changes spans of white space into tabs and spaces
for this. You can now write the file.
Warning: When using ":retab" on a program, it may change white space inside
a string constant. Therefore it's a good habit to use "\t" instead of a
real tab.
==============================================================================
Next chapter: |usr_26.txt| Repeating

View File

@ -1,4 +1,4 @@
*usr_27.txt* For Vim version 9.1. Last change: 2019 Jul 14
*usr_27.txt* For Vim version 9.1. Last change: 2025 Jul 06
VIM USER MANUAL - by Bram Moolenaar
@ -8,6 +8,7 @@
In chapter 3 a few simple search patterns were mentioned |03.9|. Vim can do
much more complex searches. This chapter explains the most often used ones.
A detailed specification can be found here: |pattern|
Options affecting how search is done can be found here: |search-options|
|27.1| Ignoring case
|27.2| Wrapping around the file end

Some files were not shown because too many files have changed in this diff Show More