Compare commits

..

386 Commits

Author SHA1 Message Date
Yee Cheng Chin a4466fe3b6 MacVim r181.1 (prerelease)
Updated to Vim 9.1.1251
2025-03-28 02:21:59 -07:00
Yee Cheng Chin 08f49ae8e9 Merge pull request #1571 from ychin/fix-shortcut-services-text-input
Fix macOS services no longer able to insert texts in non-Visual modes
2025-03-28 00:01:56 -07:00
Yee Cheng Chin 7cb3ab5058 Fix macOS services no longer able to insert texts in non-Visual modes
Interactions with OS services that insert texts were improved in #1552
to make it work in a more integrated fashion instead of a hacky
injection of 's' followed by the text. However, it only accounted for
services that replaces selected texts in visual mode. In other modes,
MacVim would simply ignore the service. This was a regression as
previously it would work everywhere (albeit often times in a
non-intuitive manner since if used in insert mode the user would see an
's' in the beginning). This also affects Shortcuts that a user may have
made that could be invoked from the Services menu or bound to a hotkey.

Fix this properly by allowing this to be used in Normal / Insert /
Cmdline modes in addition to Visual mode.

Even with this fix, there is still a slight difference between the
new behavior and the old hacky solution - the old method would leave the
user in Insert mode, whereas the new method would stay in Normal mode. I
think this is an improvement so no need to fix.

Fix #1569
2025-03-27 23:59:39 -07:00
Yee Cheng Chin b2c10a6c0d Merge pull request #1570 from ychin/fix-ci-respect-matrix-testgui
ci: Fix matrix to use testgui flag properly
2025-03-27 19:49:56 -07:00
Yee Cheng Chin 3d76744ff4 ci: Fix matrix to use testgui flag properly
This flag is there to get CI to only run either GUI or CLI tests, unless
we are publishing a release, in order to cut down on interation time.
When the YAML file was split into two in #1559, there was a mistake
where this matrix flag wasn't ported over properly to an input, causing
it to always evaluate to false.
2025-03-27 17:31:31 -07:00
Yee Cheng Chin 6b809a4c94 Fix pi_netrw.txt build rule to be portable to macOS
This will be fixed upstream later in vim/vim#16996.
2025-03-27 16:55:38 -07:00
Yee Cheng Chin c77b2b3bab Merge remote-tracking branch 'vim/master' 2025-03-27 16:54:24 -07:00
Yee Cheng Chin 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
glepnir 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
zeertzjq 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
Yegappan Lakshmanan 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
John Marriott 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
Yee Cheng Chin 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
Yee Cheng Chin 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
Yegappan Lakshmanan 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
Christian Brabandt 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
Peter Kenny 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
Yee Cheng Chin 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
Christian Brabandt 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
Hirohito Higashi 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
Maxim Kim 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
Christian Brabandt 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
S0AndS0 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
Christian Brabandt 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
Yegappan Lakshmanan 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
Doug Kearns 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
Christian Brabandt 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
phanium 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
Hirohito Higashi 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
Christian Brabandt 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
Yegappan Lakshmanan 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
Zoltan Arpadffy 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
zeertzjq 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
Christ van Willegen 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
Yegappan Lakshmanan 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
Doug Kearns 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
Aliaksei Budavei 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
David Mandelberg 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
Hirohito Higashi 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
Hirohito Higashi 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
Doug Kearns 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
glepnir 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
Maxim Kim 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
Mohamed Akram 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
glepnir 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
Christian Brabandt 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
Maxim Kim 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
zeertzjq 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
Hirohito Higashi 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
Christian Brabandt 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
Christian Brabandt 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
64-bitman 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
Phạm Bình An 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
Christian Brabandt 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
John Marriott 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
zeertzjq 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
Acaibird 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
zeertzjq 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
John Marriott 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
zeertzjq 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
zeertzjq 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
Marat Amerov 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
Doug Kearns 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
Christian Brabandt 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
glepnir 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
64-bitman 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
Aliaksei Budavei 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
John Marriott 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
Eisuke Kawashima 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
Jonathan 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
Jim Zhou 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
RestorerZ 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
Matthias 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
Christopher Plewright 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
John Marriott 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
RestorerZ 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
Christian Brabandt 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
Christian Brabandt 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
Christian Brabandt 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
glepnir 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
RestorerZ 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
zeertzjq 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
Nick Jensen 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
zeertzjq 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
skshetry 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
Hirohito Higashi 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
Doug Kearns 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
Christian Brabandt 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
Jim Zhou 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
glepnir 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
zeertzjq 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
Christian Brabandt 4d2c4b90fb runtime(doc): document gitrebase filetype
closes: #16883

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-13 21:20:20 +01:00
Antonio Giovanni Colombo 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
Ivan Pešić 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
zeertzjq 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
Aurelien Gateau 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
David Mandelberg 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
Christian Brabandt 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
glepnir 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
David Mandelberg 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
zeertzjq 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
Shane Harper 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
Jim Zhou 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
Konfekt 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
Konfekt 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
MuntasirSZN 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
Christian Brabandt 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
zeertzjq 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
David Mandelberg 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
zeertzjq 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
Ivan Pešić 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
Christian Brabandt 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
Doug Kearns 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
Hirohito Higashi 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
Doug Kearns 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
Lee Lindley 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
zeertzjq 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
Anttoni Erkkilä 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
Philip H. 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
Christian Brabandt 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
oreo639 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
MuntasirSZN 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
Christian Brabandt 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
zeertzjq 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
David Mandelberg 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
qaqland 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
David Mandelberg 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:
https://gitlab.gnome.org/GNOME/gnome-terminal/-/blob/2d7e9d78c9631be63b6b381f6966cb8808865ffb/src/org.gnome.Terminal.gschema.xml#L395-398
https://gitlab.gnome.org/chergert/ptyxis/-/blob/8942adde5b98c82c85238851743b371a034a1c1b/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
Aliaksei Budavei 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
glepnir 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
zeertzjq 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
zeertzjq 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
zeertzjq 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
Phạm Bình An 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
Aliaksei Budavei 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
zeertzjq 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
zeertzjq 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
zeertzjq 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
Doug Kearns 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
John Marriott 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
glepnir 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
Maxim Kim 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
MuntasirSZN 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
Christian Brabandt 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
RestorerZ 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
glepnir 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
Eisuke Kawashima 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
David Mandelberg 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
Konfekt 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
Jim Zhou 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
David Mandelberg 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
Konfekt 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
Jim Zhou 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
Jim Zhou 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
A4-Tacks 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
zeertzjq 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
zeertzjq 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
Girish Palya 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
Luca Saccarola 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
zeertzjq 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
Yee Cheng Chin 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
Girish Palya 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
Jim Zhou 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
Christian Brabandt fb792374cf runtime(doc): update how to get Vim
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-03 08:16:27 +01:00
Yee Cheng Chin 15cd80a6d4 Merge pull request #1568 from ychin/remove-colors-plist-fix-ci
Remove Colors.plist and fix CI
2025-03-02 19:43:31 -08:00
Yee Cheng Chin 117efc784e Remove Colors.plist and fix CI
CI is currently failing since :highlight auto-complete relies on loading
v:colornames implicitly, but MacVim has its own special handling and
parses a bundled Colors.plist file instead, which bypasses the whole
system.  Colors.plist was added a long time ago as Vim did not have a
good cross-platform way to specify colors by names, but this has been
alleviated upstream a while ago via runtime/colors/lists/default.vim
which gets sourced for default color values.

To fix this, simply remove the file, as it serves no purpose anymore.
Also remove custom hex color parsing logic which also should simply
defer to Vim instead.
2025-03-02 19:41:23 -08:00
Yee Cheng Chin 597b39d5f6 Merge remote-tracking branch 'vim/master' 2025-03-02 15:19:37 -08:00
Girish Palya 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
Christian Brabandt 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
Yee Cheng Chin 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
Christian Brabandt 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
Antonio Giovanni Colombo 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
Christian Brabandt 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
Christian Brabandt 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
Aliaksei Budavei 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
glepnir 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
glepnir 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
Jim Zhou 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
glepnir 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
Christian Brabandt 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
zeertzjq 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
Luca Saccarola 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
Jim Zhou 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
zeertzjq 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
zeertzjq 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
zeertzjq 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
Doug Kearns 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
Doug Kearns 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
Yegappan Lakshmanan 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
Konfekt 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
Begasus 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
John Marriott 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
RestorerZ 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
Rafael Fontenelle 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
John Marriott 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
Konfekt 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
Yee Cheng Chin 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
RestorerZ aa8345a968 patch 9.1.1149: Unix Makefile does not support Brazilian lang for the installer
Problem:  Unix Makefile does not support Brazilian lang for the
          installer
Solution: add support for language code pt_br (RestorerZ)

This is in preparation of the Portuguese Brazilian translation
that will be merged a bit later.

related: #16692
closes: #16732

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-25 20:35:41 +01:00
Hirohito Higashi 6c0128385e patch 9.1.1148: Vim9: finding imported scripts can be further improved
Problem:  Vim9: finding imported scripts can be further improved
          (after v9.1.1146)
Solution: Eliminate extra find_imported() call (Hirohito Higashi)

related: #16602
related: #16660
closes: #16731

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-02-25 20:29:50 +01:00
brianhuster 00a00f5d3f runtime(lua): Update lua ftplugin and documentation
Problem:
- The doc says the default `g:lua_subversion` is 2, but in fact it is 3
  (see `runtime/syntax/lua.vim`)
- `includeexpr` doesn't work with module in `init.lua`

Solution:
- Update documentation
- Assign value to option `&include`
- Add function `LuaInclude` and assign it to `l:&includeexpr`

closes: #16655

Co-authored-by: dkearns <dougkearns@gmail.com>
Signed-off-by: brianhuster <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-25 20:26:45 +01:00
Girish Palya 12b1eb58ab patch 9.1.1147: preview-window does not scroll correctly
Problem:  preview-window does not scroll correctly
Solution: init firstline = 0 for a preview window
          (Girish Palya)

The 'info' window, which appears during insert-mode completion to display
additional information, was not scrolling properly when using commands like:
	win_execute(popup_findinfo(), "normal! \<PageDown>")
This issue made it impossible to navigate through info window contents using
keyboard-based scrolling.
The fix correctly updates the w_firstline value of the popup window, ensuring
proper scrolling behavior. Mouse scrolling was already working as expected and
remains unaffected.

closes: #16703

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-24 21:39:42 +01:00
RestorerZ f877040a04 nsis: added support for pt-BR to installer and update README.txt
Prepare for PR #16692 which will eventually bring pt-br translation to
the installer and add some clarification on how to test the installer
with different languages

closes: #16725

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-24 19:42:36 +01:00
Emir SARI 25b16d64a0 translation(tr): Update Turkish translations
closes: #16719

Signed-off-by: Emir SARI <emir_sari@icloud.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-24 19:31:06 +01:00
Yegappan Lakshmanan 16f2d3a465 patch 9.1.1146: Vim9: wrong context being used when evaluating class member
Problem:  Vim9: wrong context being used when evaluating class member
          (lifepillar, Ernie Rael)
Solution: Use the correct script context when evaluating a class member
          init expression(Yegappan Lakshmanan)

fixes: #14011
fixes: #14402
closes: #15112
closes: #16660

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-24 19:26:56 +01:00
glepnir 5090a1fecb patch 9.1.1145: multi-line completion has wrong indentation for last line
Problem:  When expanding omni completion items with newlines (e.g.
          `then\n\t\nend`), the end statement gets wrong indentation.
Solution: Add OPENLINE_FORCE_INDENT flag to make open_line() use
          second_line_indent directly (glepnir)

closes: #16614

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Justin M. Keyes <justinkz@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-24 19:10:37 +01:00
Luca Saccarola 5b97947bbd runtime(netrw): runtime(netrw): upstream snapshot of v178
relevant commits:
- refactor: netrw#own#Deprecate -> netrw#msg#Deprecate
- refactor: netrw#own#PathJoin -> netrw#fs#PathJoin
- fix: typos
- refactor: netrw#own#Open -> netrw#os#Open
- deprecate!: netrw#WinPath
- refactor: netrw#WinPath -> netrw#fs module
- refactor: s:ShellEscape -> netrw#os module
- refactor: s:NetrwExe -> netrw#os module
- refactor: s:NetrwGlob -> netrw#fs module
- refactor: s:NetrwGetcwd -> netrw#fs module
- refactor: s:NetrwFullPath -> netrw#fs module
- refactor: s:ComposePath -> netrw#fs module

closes: #16718

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-23 20:37:39 +01:00
Bakudankun b3854bfc54 patch 9.1.1144: no way to create raw strings from a blob
Problem:  no way to create raw strings from a blob
Solution: support the "encoding": "none" option
          to create raw strings (which may be invalid!)
          (Bakudankun)

closes: #16666

Signed-off-by: Bakudankun <bakudankun@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-23 20:29:21 +01:00
Christian Brabandt e0029daa35 patch 9.1.1143: illegal memory access when putting a register
Problem:  illegal memory access when putting a register
Solution: make sure cursor column doesn't become negative

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-23 20:01:54 +01:00
Christian Brabandt 28155d0855 patch 9.1.1142: tests: test_startup fails if $HOME/$XDG_CONFIG_HOME is defined
Problem:  tests: test_startup fails if $HOME/$XDG_CONFIG_HOME is defined
Solution: define $HOME and $XDG_CONFIG_HOME to some non-existing
          directory

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-23 19:55:09 +01:00
Konfekt 094494bf2e runtime(vim): improve &keywordprg in ftplugin
- let keywordprg in vim filetype handle context-sensitive help calls by
  detecting the syntax group of the word under the cursor
- reformat whitespace
- add modeline

related: #16677
closes: #16680

Co-authored-by: Andrew Radev <andrey.radev@gmail.com>
Co-authored-by: "D. Ben Knoble" <ben.knoble+github@gmail.com>
Co-authored-by: Gary Johnson <garyjohn@spocom.com>
Co-authored-by: Tim Pope <code@tpope.net>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-23 16:03:30 +01:00
Doug Kearns 025dc48e88 runtime(vim): Update base-syntax, match :CompilerSet and :SynMenu commands
closes: #16713

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-23 15:48:52 +01:00
Yee Cheng Chin b7717d5706 Merge pull request #1566 from ychin/mouse-wheel-disable-acceleration
Add better scroll wheel support and option to disable acceleration
2025-02-23 03:51:59 -08:00
zeertzjq b8989fb860 patch 9.1.1141: Misplaced comment in readfile()
Problem:  Misplaced comment in readfile().
          (after v9.1.1139)
Solution: Move the comment above S_ISDIR().
          (zeertzjq)

closes: #16714

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-23 09:56:10 +01:00
David Mandelberg ed7d8e55ac patch 9.1.1140: filetype: m17ndb files are not detected
Problem:  filetype: m17ndb files are not detected
Solution: detect m17ndb files as m17ndb filetype,
          include filetype, syntax and indent files for the
          new filetype (David Mandelberg).

References:

https://www.nongnu.org/m17n/manual-en/m17nDBFormat.html describes the
format. https://git.savannah.nongnu.org/cgit/m17n/m17n-db.git/tree/ has
examples of the files.

closes: #16696

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-23 09:41:42 +01:00
Christian Brabandt f1c3134ee1 patch 9.1.1139: [fifo] is not displayed when editing a fifo
Problem:  [fifo] is not displayed when editing a fifo
          (after v7.4.2189)
Solution: stat the filename and detect the type correctly

fixes: #16702
closes: #16705

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-23 09:36:56 +01:00
Yee Cheng Chin a7b8120820 patch 9.1.1138: cmdline completion for :hi is too simplistic
Problem:  Existing cmdline completion for :highlight was barebone and
          only completed the highlight group names.

Solution: Implement full completion for the highlight group arguments
          such as guifg and cterm. If the user tries to complete
          immediately after the '=' (e.g. `hi Normal guifg=<Tab>`), the
          completion will fill in the existing value, similar to how
          cmdline completion for options work (Yee Cheng Chin).

closes: #16712

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-23 09:34:50 +01:00
John Marriott f4b36417e8 patch 9.1.1137: ins_str() is inefficient by calling STRLEN()
Problem:  ins_str() is inefficient by calling STRLLEN()
Solution: refactor ins_str() to take a length argument
          and let all callers provide the correct length
          when calling ins_str() (John Marriott)

closes: #16711

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-23 09:09:59 +01:00
Philip H. 066a5340e3 CI: Install netbeans on windows to make sure to run test_netbeans.vim
otherwise the test src/testdir/test_netbeans.vim wouldn't be executed by
the CI.

closes: #16710

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-23 08:50:54 +01:00
Yee Cheng Chin 95a3120b40 Add better scroll wheel support and option to disable acceleration
macOS applies a acceleration to the mouse scroll wheel which is often
frustrating to use. In particular, a single click on the scroll wheel
generates a fractional scroll, which doesn't do anything in MacVim as it
scrolls by line. Fix this by forcing each scroll event to scroll at
least one line (this is configurable to be higher, or 0 which means use
the old behavior).

Also add an option to simply turn off acceleration and scroll a fixed
number of lines.

Also, fix horizontal scrolling using mouse wheel. In macOS, the way to
scroll horizontally using a normal wheel is to hold Shift key and
scroll, and the OS will convert that to a horizontal scroll event.
However, we were sending the shift modifier to Vim as well, which
interprets it as <S-ScrollWheelRight> which is not what we want (this
scrolls a whole page). We manually remove the shift modifier when we
detect this. It does mean there's functionally no way to send
shift-scroll wheel events to Vim, but it is ok, as macOS generally works
this way and it's consistent with how native GUI apps work.
2025-02-22 22:28:53 -08:00
Yee Cheng Chin 4af6e9a3c7 Merge pull request #1534 from ychin/support-x2-x2-mouse
Support extra side mouse buttons in MacVim (X1 and X2)
2025-02-22 22:18:27 -08:00
David Mandelberg 61af587f26 runtime(dockerfile): set comments in filetype plugin
closes: #16698

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Honza Pokorny <honza@redhat.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-22 15:09:03 +01:00
Konfekt d15114c148 runtime(compiler): include svelte-check compiler
closes: #16704

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-22 15:07:09 +01:00
Christian Brabandt 14e8208d84 runtime(doc): get rid of the titlestring hack for terminal-api
fixes: #16656

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-22 13:36:26 +01:00
Luuk van Baal 7bbb0f357e patch 9.1.1136: Match highlighting marks a buffer region as changed
Problem:  Match highlighting marks a buffer region to be redrawn as if
          its buffer text was changed, unnecessarily invoking syntax code.
Solution: Set the `w_redraw_top/bot` variables instead of the b_mod_* ones
          (Luuk van Baal)

closes: #16697

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-22 09:19:04 +01:00
zeertzjq bf595ae4ac patch 9.1.1135: 'suffixesadd' doesn't work with multiple items
Problem:  'suffixesadd' doesn't work with multiple items
          (after 9.1.1122).
Solution: Don't concat multiple suffixes together.
          (zeertzjq)

fixes: #16694
closes: #16699

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-22 09:13:17 +01:00
Christian Brabandt 51eefba1d6 runtime(filetype): move filetype detection into filetypedetect augroup
closes: #16701

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-22 08:48:06 +01:00
Christ van Willegen 6a15942bc2 CI: add Makefile target to verify default highlighting groups are present
When adding new highlight groups, one needs to make sure to also add a
"default link NewHlGroup ExistingHlGroup" in highlight.c code, so that
when resetting a color scheme the old color won't be left behind.

So add a Makefile in the 'ci' directory that verifies that all
documented '*hl-<groupname>' from the documentation are either reflected
in the source code, or belong to a list of 'known to be ignored'
highlight groups and let that check run as part of the CI test suite.

related: #16676
closes: #16678

Signed-off-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-21 20:23:26 +01:00
David Mandelberg 41a6026f00 patch 9.1.1134: filetype: Guile init file not recognized
Problem:  filetype: Guile init file not recognized
Solution: detect '.guile' file as scheme filetype
          (David Mandelberg)

References:

https://www.gnu.org/software/guile/manual/html_node/Init-File.html
> When run interactively, Guile will load a local initialization file
> from ~/.guile. This file should contain Scheme expressions for
> evaluation.

closes: #16683

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-21 20:13:54 +01:00
David Mandelberg b62bf81488 patch 9.1.1133: filetype: xkb files not recognized everywhere
Problem:  filetype: xkb files not recognized everywhere
Solution: detect xkb files in more places
          (David Mandelberg)

References:
https://xkbcommon.org/doc/current/user-configuration.html#user-config-locations

closes: #16684

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-21 20:09:35 +01:00
zeertzjq 060e6556e2 patch 9.1.1132: Mark positions wrong after triggering multiline completion
Problem:  Mark positions wrong after triggering multiline completion.
Solution: Call deleted_lines_mark() after deleting lines.
          (zeertzjq)

closes: #16687

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-21 20:06:26 +01:00
John Marriott b79fa3d9c8 patch 9.1.1131: potential out-of-memory issue in search.c
Problem:  potential out-of-memory issue in search.c
Solution: improve situation and refactor search.c slightly
          (John Marriott)

- In function update_search_stat():
  add a check for a theoretical null pointer reference, set and remember
  the length of lastpat, remove the three calls to STRLEN() and use the
  various string's associated lengths instead, add a check for an
  out-of-memory condition.

- In function search_for_fuzz_match():
  remove a call to strnsave() and thus avoid having to add a check for
  an out-of-memory condition, also replace the call to STRLEN() by
  ml_get_buf_len().

closes: #16689

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-21 19:59:56 +01:00
glepnir a48693c6c2 runtime(doc): remove resolved complete item from todo list
closes: #16690

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-21 19:52:13 +01:00
zeertzjq 13f100e932 patch 9.1.1130: 'listchars' "precedes" is not drawn on Tabs.
Problem:  'listchars' "precedes" is not drawn on Tabs.
Solution: Only draw 'listchars' "precedes" when not skipping over cells.
          (zeertzjq)

fixes: #5927
closes: #16691

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-21 19:49:44 +01:00
Yee Cheng Chin 8e7808c296 MacVim r181
Updated to Vim 9.1.1128

This update contains a completely new GUI tabs implementation by @sfsam!
It also contains lots of small fixes for window resizing and full screen
mode that aims to make using MacVim feel rock solid and stable.

Defaults Change
====================

New settings defaults related to window sizing #1528:

- "Smoothly resizes window" is now on by default. MacVim's window will
  now resize smoothly instead of snapped to the size of the character
  grid.
- Vim's `guioption` now has `k` set by default (`:h go-k`). This
  prevents MacVim's window size from changing unnecessarily when
  showing/hiding tabs or changing font size.

These should align MacVim better with how other apps work and integrate
better with OS window management, including macOS 15 Sequoia's window
tiling feature.

Features
====================

Tabs
--------------------

MacVim has a new tabs implementation! The old version (PSMTabBarControl)
is not maintained and lacks features such as overflowing tabs and
customizable colors. The new tabs will overflow horizontally and are
scrollable. They also animate when tabs are closed or moved, respect
system settings such as right-to-left locales and high-contrast modes,
and are designed to fit within the currently selected Vim colors.

There are a few ways to customize the colors of the new tabs, under the
"Appearance" settings pane. MacVim defaults to an "Automatic colors"
mode which tries to pick sensible colors automatically based on the
current foreground/background colors. However, you can also configure it
to simply use the tab colors specified by the Vim color scheme (some
color schemes will work better than others depending on their choice of
colors). Another new option is "Use tabs background color" which when
combined with "Transparent title bar" allows the title bar and tabs to
look like a single cohesive whole.

Relevant work:

- #1120 (by @sfsam)
- Also: #1535 / #1536 / #1537 / #1538 / #1539 / #1557 / #1558 / #1560

New Vim features
--------------------

- new bundled color scheme:
    - unokai (vim/vim#16443)
- new bundled optional plugins (use `packadd` to enable them):
    - helptoc: Use `:HelpToc` to show an interactive table of contents
      for Vim help, man pages, Markdown files, and terminal.
      vim/vim#10446
- new options:
    - `set diffopt+=linematch:{n}`. Matches lines better when in diff
      mode. v9.1.1099
    - `findfunc`. Customizes `:find` and other commands. v9.1.0831
    - `set completeopt+=preinsert`. Preview inserted text in completion.
      v9.1.1056
    - `messagesopt`. Allows customizing hit-enter behavior. v9.1.0908
- new functions:
    - `getcellpixels()`. Query the pixel size of a character cell in the
      grid. v9.1.0854 / #1554 / #1555
- Vim tutor has a new interactive plugin (v9.1.0836). There is also now
  a chapter 2 (vim/vim#5729).

Misc New Settings
--------------------

- "Open untitled window" (General) has a new option to only open on
  MacVim re-activation. #1509
- "Show document icon at title bar" (Appearance). Previously MacVim
  implicitly hid the document icon when using transparent title bar.
  This is now customizable. #1510

General
====================

- The MacVim dmg installer has a new design. Courtesy of @jasonlong.
  #1540 #1545
- Legacy builds (macOS 10.9 - 10.12) are no longer built by GitHub
  hosted runners, due to GitHub's deprecation of old runners. They are
  now built by a custom self-hosted VM instead. In the future we hope to
  set up reproducible builds (#1506) so it will not matter who's
  building the app as it would be verifiable. #1559
- "Nightly" build: We now build a dmg installer for every commit. This
  allows for trying out the latest developmental version of MacVim, but
  note that the app will not be signed / notarized, and it will not be
  as polished as official release/pre-release builds. See
  [wiki](https://github.com/macvim-dev/macvim/wiki/Installing) for
  instructions. #1532

Fixes
====================

Apple "Intelligence" Writing Tools
--------------------

macOS 15 Sequoia's Apple "Intelligence" Writing Tools should work
correctly with MacVim now. To use it, select some text, right click to
show menu, and then select the "Writing Tools" sub-menu. As part of this
fix, the integration with the "Services" menu now works more reliably as
well. You can select texts in blockwise visual mode and select a service
and MacVim will try to place the new texts back to the blockwise
selection if possible. #1552

Window resizing and full screen
--------------------

- Flicker begone: Changing font size, showing/hiding tabs or scroll
  bars, or entering non-native full screen should no longer cause MacVim
  to flicker. Previously there could be a momentary but
  distracting/annoying stale image that flashes briefly. #1547 #1549
- Fixed issue where resizing MacVim window would occasionally cause Vim
  to be stuck in a stale wrong size. #1518
- Non-native full screen now supports `blurradius` option. #1546
- Fixed window size not always restoring correctly when exiting full
  screen. Non-native full screen also works more reliably in
  multi-monitor setup. #1525
- Fixed non-native full screen mode when using an external monitor with
  a MacBook with a notch, and having the "Show menu bar in non-native
  mode" option set. Previously MacVim would sometimes miscalculate the
  menu bar height in the second screen. #1548
- Fixed misc issues with non-native full screen's interaction with
  `fuoptions` and also the `transparency` setting, and rare crash. #1521

Other Fixes
--------------------

- Fixed issue where changing font size (using Cmd =/-) with guifont set
  to "-monospace-" would result in guifont being changed to a confusing
  name like ".AppleSystemUIFontMonospaced-Regular". #1544
- "MacVim Website" menu item now goes to the updated URL. #1524
- What's New page now allows changing font size (using Cmd =/-), and
  showing table of contents. #1561 #1562
- Dark mode documentation is now a bit clearer on `v:os_appearance`.
  #1511
- Using dictionary look up on selected texts (by right clicking and then
  selecting "Look Up" in the pop-up menu) is now more resilient as it
  uses Vim's native `getregion()` to determine the selected texts. #1508

Scripting
====================

- Scripting languages versions:
    - Ruby is now built against 3.4, up from 3.3.
    - Perl is now built against 5.34, up from 5.30.

Compatibility
====================

Requires macOS 10.9 or above. (10.9 - 10.12 requires downloading a
separate legacy build)

Script interfaces have compatibility with these versions:

- Lua 5.4
- Perl 5.34
- Python2 2.7
- Python3 3.9 or above
- Ruby 3.4
2025-02-20 16:05:49 -08:00
Yee Cheng Chin 3710248dbc Merge pull request #1562 from ychin/fix-whatsnew-url-comparison
Fix What's New URL checking logic to compare port correctly
2025-02-20 14:47:14 -08:00
Yee Cheng Chin af567e9eb0 Fix What's New URL checking logic to compare port correctly
In a normal HTTP URL the port will be nil, which doesn't equal itself.

This bug was introduced by #1561 when it tried to add more granular
comparison to URL checking to allow for anchor links.
2025-02-20 14:45:48 -08:00
David Mandelberg 3cb41489dc runtime(sieve): set fileformat=dos in filetype plugin
References:
https://datatracker.ietf.org/doc/html/rfc5228#section-2.2

closes: #16685

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 23:22:54 +01:00
John Marriott fbe2dd7b4c patch 9.1.1129: missing out-of-memory test in buf_write()
Problem:  missing out-of-memory test in buf_write()
Solution: Check that the returned allocated buffer is not NULL
          (John Marriott)

closes: #16678

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 23:17:09 +01:00
Yee Cheng Chin 08e946fa19 Merge remote-tracking branch 'vim/master' 2025-02-20 14:16:05 -08:00
Lucas Eekhof 27f5136761 runtime(mail): add commentstring '> %s' to ftplugin
The new native commenting functionality is currently not used when
editing mail. One could reasonably expect it to change the "quote" state
of any given line in the mail (i.e. the preceding ">"), which would be
very handy and feel natural when editing mail. Especially since the
current file already uses "setlocal comments+=n:>".

Solution: Add commentstring to `> %s` to be used in files of type mail.

closes: #16669

Signed-off-by: Lucas Eekhof <105216949+eekhof@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 22:32:07 +01:00
Yegappan Lakshmanan e3fed4828c patch 9.1.1128: patch 9.1.1119 caused a regression with imports
Problem:  patch 9.1.1119 caused a regression with imports
          (girishji)
Solution: revert the script ID change for the class script variable for
          now (Yegappan Lakshmanan)

fixes: #16664
closes: #16670

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 22:20:54 +01:00
dringsim 106899eb21 runtime(dnsmasq): include simple filetype plugin
closes: #16671

Signed-off-by: dringsim <dringsim@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 22:19:23 +01:00
glepnir 52fd867f5e patch 9.1.1127: preinsert text is not cleaned up correctly
Problem:  when 'completeopt' is set to preinsert the preinserted text is
          not cleared when adding new leader (Yee Cheng Chin)
Solution: add a condition to delete preinsert text in edit function
          (glepnir)

closes: #16672

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 22:13:24 +01:00
glepnir 4418041698 patch 9.1.1126: patch 9.1.1121 used a wrong way to handle enter
Problem:  patch 9.1.1121 used a wrong way to handle enter
Solution: compl_enter_selects also needs to consider the selected item
          in ins_compl_new_leader() (glepnir)

closes: #16673

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 22:09:48 +01:00
glepnir 3af0a8d8f5 patch 9.1.1125: cannot loop through pum menu with multiline items
Problem:  cannot loop through pum menu with multiline items with
          fuzzy and noselect in 'completeopt' (Tomasz N)
Solution: remove unnecessary compl_no_select condition (glepnir)

fixes: #16641
closes: #16674

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 22:06:16 +01:00
zeertzjq 08a83a033a patch 9.1.1124: No test for 'listchars' "precedes" with double-width char
Problem:  No test for 'listchars' "precedes" with double-width char.
Solution: Add a test and fix a typo in code (zeertzjq).

closes: #16675

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 22:04:09 +01:00
Yee Cheng Chin e700ddeea4 patch 9.1.1123: popup hi groups not falling back to defaults
Problem:  Highlight groups PopupSelected/PopupNotification/
          MessageWindow are supposed to fall back to default highlight
          groups if they are not defined. However, once a colorscheme
          has defined them, switching to another colorscheme that
          doesn't do so will leave behind a cleared colorscheme, which
          causes the fallback to fail.

Solution: Set up default links to the relevant fallback highlight
          groups, which makes sure a `:hi clear` command will reset the
          state properly (Yee Cheng Chin).

closes: #16676

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 21:58:21 +01:00
David Mandelberg 911742a975 runtime(dosini): Add support for # comments to ftplugin
runtime/syntax/dosini.vim supports both ; and # as comments, and I think
a bunch of the files detected as dosini do too, so add support for # to
the ftplugin.

closes: #16681

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 20:43:10 +01:00
Yee Cheng Chin d5218a81b4 Merge pull request #1561 from ychin/whatsnew-fontsize-allow-anchors
Add font size up/down support and allow anchor links for What's New page
2025-02-20 06:13:14 -08:00
Yee Cheng Chin 7402362114 Add font size up/down support and allow anchor links for What's New page
The anchor links are for table of contents links that our release notes
will start to generate.
2025-02-20 05:54:00 -08:00
Yee Cheng Chin 7861c788f0 Merge pull request #1560 from ychin/tabs-fix-hover-button-image-recursion
Tabs: Fix MMHoverButton poor usage of images and potential stack overflow
2025-02-19 21:37:33 -08:00
Yee Cheng Chin f4680b8f79 Tabs: Fix MMHoverButton poor usage of images and potential stack overflow
Fix hover buttons to not keep setting image on itself everytime a fg
color is changed, leading to each image referring to the last one. If a
display changed happens and macOS triggers a redraw, this could
sometimes lead to a stack overflow crash.

Just simplify the code and properly separate out the image template and
the derived images. This also makes sure we properly free the old
images when we change fg color where we discard the last image and make
a new one.
2025-02-19 21:13:55 -08:00
Yee Cheng Chin 9b30caf13d Merge pull request #1559 from ychin/ci-self-hosted-github-runner-legacy-build
ci: Add support for using self-hosted runners for legacy builds
2025-02-18 23:44:54 -08:00
Yee Cheng Chin 460dffeb9f ci: Add support for using self-hosted runners for legacy builds
MacVim legacy builds target macOS 10.9, which needs Xcode 14.0.1 or
below. However, GitHub Actions no longer has a runner that has that
installed as macos-12 was removed and macos-13 has newer Xcode versions.
We are setting up a custom self-hosted runner that has Xcode 14.0.1
installed and configure GitHub Actions to use that to build legacy
builds. Only do this when making a full release because this has to be
spun up manually.

One big problem with setting up such a workflow is that GitHub Actions'
workflow syntax does not provide a way to selectively skip certain
matrix configuration in the `runs-on` field. The cleanest solution
(which is still quite messy) is to refactor the build-and-test step into
a separate reusable workflow, and have the parent workflow invoke it
with a "skip" boolean flag for each matrix entry. The child workflow
will then use that to selectively decide to run the job or not. It does
mean the CI YAML file is now split into two. This does have some
benefits since if we want to add reproducible builds in the future
(#1506) this would allow us to set up a new workflow that builds MacVim
the same way when a new release is made and verify that it's been built
properly.
2025-02-18 23:12:57 -08:00
Yee Cheng Chin 4af622dfd6 Merge remote-tracking branch 'vim/master' 2025-02-18 20:27:53 -08:00
John Marriott d6e3c9048d patch 9.1.1122: too many strlen() calls in findfile.c
Problem:  too many strlen() calls in findfile.c
Solution: refactor findfile.c and remove calls to strlen()
          (John Marriott)

closes: #16595

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-18 20:45:48 +01:00
glepnir 07f0dbe3aa patch 9.1.1121: Enter does not insert newline with "noselect"
Problem:  Enter does not insert newline with "noselect" when the pum is
          visible (lifepillar)
Solution: When Enter is pressed and no complete-item is selected,
          ins_compl_prep returns false, and the edit function continues
          processing Enter to insert a new line. (glepnir)

fixes: #1653
closes: #16653

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-18 20:27:30 +01:00
Luca Saccarola ee1a24b21d runtime(netrw): fix s:NetrwHome() regression
If $MYVIMDIR is unset netrw creates a directory called '$MYVIMDIR' in
the current directory

fixes: #16609

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-18 20:11:51 +01:00
Christian Brabandt 44c1c04ddb patch 9.1.1120: tests: Test_registers fails
Problem:  tests: Test_registers fails
          (T.J. Townsend, after v9.1.1115)
Solution: require clipboard feature

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-17 22:27:45 +01:00
Christian Brabandt 5647c91355 runtime(doc): add reference to extendnew() at extend()
related: #16607

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-17 21:33:30 +01:00
Yegappan Lakshmanan 778ada48fb patch 9.1.1119: Vim9: Not able to use an autoloaded class from another autoloaded script
Problem:  Vim9: Not able to use an autoloaded class from another
          autoloaded script (Elliot)
Solution: make it work (Yegappan Lakshmanan)

fixes: #15031
closes: #16652

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-17 20:21:23 +01:00
Christian Brabandt b34a688ba0 patch 9.1.1118: tests: test_termcodes fails
Problem:  tests: test_termcodes fails
          (after: v9.1.1114)
Solution: adjust the test for the expected termguicolors value

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-17 20:09:11 +01:00
Doug Kearns 68ba6c2c6c runtime(vim): Update base-syntax, improve performance
Contain the vimNotation syntax group, matching this at top level is
unnecessary and very slow.

The removed vimString and vimNumber definitions are broken and/or never
match. They have long been replaced by newer definitions.

closes: #16645

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-16 16:40:12 +01:00
Hirohito Higashi 5887cce1d7 patch 9.1.1117: there are a few minor style issues
Problem:  there are a few minor style issues
Solution: fix the issues (Hirohito Higashi)

closes: #16646

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-16 16:34:30 +01:00
Yegappan Lakshmanan b5f463ce4f patch 9.1.1116: Vim9: super not supported in lambda expressions
Problem:  Vim9: super not supported in lambda expressions
          (Aliaksei Budavei)
Solution: Support using the super keyword in a closure in an instance
          method (Yegappan Lakshmanan)

fixes: #16586
closes: #16647

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-16 16:25:24 +01:00
Yegappan Lakshmanan 44831e4bea runtime(doc): Update the 'specifies' keyword documentation, slightly reformat
closes: #16648

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-16 16:23:07 +01:00
Christian Brabandt c0f0e2380e patch 9.1.1115: [security]: use-after-free in str_to_reg()
Problem:  [security]: use-after-free in str_to_reg()
          (fizz-is-on-the-way)
Solution: when redirecting the :display command, check that one
          does not output to the register being displayed

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-63p5-mwg2-787v

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-16 16:06:38 +01:00
Christian Brabandt 27822a0441 patch 9.1.1114: enabling termguicolors automatically confuses users
Problem:  enabling termguicolors automatically confuses users. Since
          querying the terminal for the RGB flag happens asynchronously,
          enabling termguicolors is noticeable by users as the highlighting changes
          and is therefore unexpected.
          (after v9.1.1054)
Solution: comment out that part for now. We may need another way to
          enable this in the future.

fixes: #16539
fixes: #16568
fixes: #16649

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-16 09:30:00 +01:00
Yee Cheng Chin 8969ff8787 Merge pull request #1558 from ychin/mmtabs-automatic-colors-tuning
Tabs: Tune automatic colors and use LAB for deriving colors
2025-02-15 03:47:16 -08:00
Yee Cheng Chin 25b448f236 Tabs: Tune automatic colors and use LAB for deriving colors
Tune how automatic colors are derived. It used to use a custom
brightness calculation formula to determine in background color is light
or dark, then then simply interpolate the background color to either
white or black to drive the fill and tab colors. There were a couple
issues:
- Really dark background color would end up interpolating more than a
  moderately dark color, leading to the fill color being desaturated and
  also perceptually far from background color leading to a
  high-constrast look. Ideally we want to have a fixed offset in terms
  of perceptual difference between fill and background color.
- The brightness calculation was wrong and flipped the green and blue
  coefficients. Also, calculating perceptual brightness in sRGB gamma
  space is inherently wrong as the components are not linear.
- Blending colors in sRGB space are also not ideal because we are
  blending in gamma space (not linear), and also perceptually each
  component will contribute differently.

To fix this, use CIE LAB colors and just change the L* component of the
colors in fixed offsets to calculate a new color that's a
brighter/darker version fo the previous one. This is not completely
accurate but gives a more stable result over a large range of input
colors. The new fill / tab colors are a little more saturated as a
result which subjectively may or may not be more pleasant but with
automatic colors it won't be perfect, and the user who cares would
likely use Vim colorscheme mode instead.
2025-02-15 03:20:07 -08:00
Vladyslav Rehan 3f60114236 runtime(keymap): Add ukrainian-enhanced keymap
The "Ukrainian enhanced keymap" allows you to type Ukrainian in Vim
using jcuken Windows layout.

Original file is made by Ivan Korneliuk and can be found at
https://github.com/vansha/ukrainian-enhanced.vim. It is being added here
with the permission of the author.

There is another ukrainian layout already in Vim, namely the
keymap\ukrainian-jcuken.vim script by Anatoli Sakhnik. But this one
differs in way it maps numeric keys. It uses values usual for Windows
users.

closes: #16628

Signed-off-by: Vladyslav Rehan <rehanvladyslav@gmail.com>
Signed-off-by: Ivan Korneliuk <vansha@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-15 09:59:57 +01:00
Yee Cheng Chin 8bac9064f7 Merge pull request #1557 from ychin/mmtabs-vim-colorscheme-fixes
Tabs: Use TabLineFill fg, fix colorscheme w/ transparent/inverse highlights
2025-02-14 21:44:21 -08:00
Yee Cheng Chin aaf55031bf Tabs: Use TabLineFill fg, fix colorscheme w/ transparent/inverse highlights
When using Vim colorscheme mode, fix the fill foreground colors (used
for add tab and scroll buttons) to use the colorscheme's TabLineFill's
guifg colors. Previously they were automatically calculated based on the
other foreground colors which worked for automatic colors but not when
we are using a colorscheme where it may not match. Just use the one
specified in color scheme. Colorschemes like everforest and koehler
should have visible buttons now.

Also, fix the previous broken logic for parsing the colorscheme colors.
It was not accounting for transparent colors where missing colors or
cleared highlight groups should fall through to default bg/fg colors
(e.g. delek and catppuccin do this for TabLineSel). It also wasn't
respecting the `gui=reverse` flag (which means bg/fg colors should be
flipped) that some colorschemes (e.g. Solarized) uses.

Also, include a fix to builtin colorscheme 'retrobox' where the
TabLineFill group isn't set correctly. This is fixed upstream but
including it here to save some round trip time. See
vim/colorschemes#273.
2025-02-14 20:59:07 -08:00
Yee Cheng Chin e67eff2e24 patch 9.1.1113: tests: Test_terminal_builtin_without_gui waits 2 seconds
Problem:  tests: Test_terminal_builtin_without_gui waits 2 seconds
Solution: add --not-a-term to remove the annoying 2s delay in error
          message when Vim detects that stdio are not from a terminal
          (Yee Cheng Chin)

closes: #16635

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-14 18:01:25 +01:00
zeertzjq b6c900be9c patch 9.1.1112: Inconsistencies in get_next_or_prev_match()
Problem:  Inconsistencies in get_next_or_prev_match() (after 9.1.1109).
Solution: Change "file" to "entry" or "match" in comments.  Use the same
          order of branches for PAGEUP and PAGEDOWN (zeertzjq).

closes: #16633

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-14 17:59:31 +01:00
glepnir faf4112cdc runtime(doc): document ComplMatchIns highlight for insert-completion
closes: #16636

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-14 17:57:52 +01:00
Luca Saccarola 73d8222b31 runtime(netrw): upstream snapshot of v177
relevant commits:
- defaults!: use 'suffixes' for 'g:netrw_sort_sequence'
- refactor: remove associated buffer when deliting a file
- refactor: s:NetrwLocalRm
- refactor: s:NetrwDelete
- refactor: s:NetrwLocalRmFile
- feat: use vim.notify on neovim
- fix: prefer v:lua instead of luaeval for vim.deprecate
- chore: remove old batteries

closes: #16638

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-14 17:54:22 +01:00
Yee Cheng Chin 961c25235b Merge pull request #1556 from ychin/fix-test-dark-mode-flakiness
Fix MacVim dark mode test being a little flaky
2025-02-13 23:16:06 -08:00
Yee Cheng Chin fa4f21c122 Fix MacVim dark mode test being a little flaky
We need to make sure to wait for Vim to handle the system appearance
change message before querying it or it would be subject to timing
issues.
2025-02-13 20:50:31 -08:00
Yee Cheng Chin d4f3eca4ee Merge pull request #1555 from ychin/getcellpixels-update-docs-delay
Update getcellpixels() docs to point out the delay in MacVim GUI
2025-02-13 19:24:55 -08:00
Yee Cheng Chin 0b82a98ba9 Update getcellpixels() docs to point out the delay in MacVim GUI
#1554 added support for `getcellpixels()`, but it has a quirk in MacVim
in that it has a slight delay due to MacVim's asynchronous nature. Make
sure the documentation reflects that to avoid surprises.
2025-02-13 19:22:51 -08:00
Yee Cheng Chin 347d8c7327 Merge pull request #1554 from ychin/getcellpixels-support
Implement getcellpixels() for MacVim
2025-02-13 17:58:10 -08:00
Yee Cheng Chin dd1a253df4 Implement getcellpixels() for MacVim
Don't use `gui.char_width` / `char_height` unlike the other GVim
implementations. Those are used for deriving screen pixel sizes and
MacVim has been hard-coding them to 1 for simplicity since the actual
GUI functionality is handled out of the Vim process anyway. Changing
those values would require some refactoring. Instead, just use a new
variable to store them.

Note that there is a delay with this method, as we only update Vim's
knowledge of cell size after MacVim has received the font change
message. This means if a user wants to immediately query getcellpixels()
in vimrc or after changing guifont this will not work. This is a
deliberate design choice to avoid having to add synchronous state query
APIs to MacVim, but it's possible to change it in the future. The
handling of this message did get placed in `processInput:` which means
it will be picked up whenever we sleep or process messages in Vim,
instead of only when waiting for keys (where most of other MacVim
messages are handled in `processInputQueue`).

Related: vim/vim#16004
2025-02-13 17:36:28 -08:00
Yee Cheng Chin e2f0b2421e Merge remote-tracking branch 'vim/master' 2025-02-13 14:15:55 -08:00
Hirohito Higashi bf7c88d852 patch 9.1.1111: Vim9: variable not found in transitive import
Problem:  Vim9: variable not found in transitive import
          (lifepillar)
Solution: fix import and class extends (Hirohito Higashi)

fixes: #16379
related: #16440
closes: #16602

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-02-13 21:04:07 +01:00
Yee Cheng Chin e70587dbdb patch 9.1.1110: Vim tests are slow and flaky
Problem:  Vim tests are slow and flaky at the same time due to reliance
          on timeouts which are unreliable.
Solution: improve Vim test performance and reduce flakiness
          (Yee Cheng Chin)

A lot of Vim tests currently rely on waiting a specific amount of time
before asserting a condition. This is bad because 1) it is slow, as the
timeout is hardcoded, 2) it's unreliable as a resource-starved runner
may overshoot the timeout. Also, there are a lot of builtin sleep
commands in commonly used utilities like VerifyScreenDump and WaitFor()
which leads to a lot of unnecessary idle time.

Fix these issues by doing the following:
1. Make utilities like VerifyScreenDump and WaitFor use the lowest wait
   time possible (1 ms). This essentially turns it into a spin wait. On
   fast machines, these will finish very quickly. For existing tests
   that had an implicit reliance on the old timeouts (e.g.
   VerifyScreenDump had a 50ms wait before), fix the tests to wait that
   specific amount explicitly.
2. Fix tests that sleep or wait for long amounts of time to instead
   explicitly use a callback mechanism to be notified when a child
   terminal job has finished. This allows the test to only take as much
   time as possible instead of having to hard code an unreliable
   timeout.

With these fixes, tests should 1) completely quickly on fast machines,
and 2) on slow machines they will still run to completion albeit slowly.
Note that previoulsy both were not true. The hardcoded timeouts meant
that on fast machines the tests were mostly idling wasting time, whereas
on slow machines, the timeouts often were not generous enough to allow
them to run to completion.

closes: #16615

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 20:55:45 +01:00
glepnir 977561a719 patch 9.1.1109: cmdexpand.c hard to read
Problem:  cmdexpand.c hard to read
Solution: refactor the file slightly (glepnir)

closes: #16621

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 20:48:56 +01:00
Matt Perry d7deeffe11 runtime(exports): include simple filetype plugin
closes: #16625

Signed-off-by: Matt Perry <matt@mattperry.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 20:45:13 +01:00
Matt Perry 407319fe89 runtime(samba): include simple filetype plugin
closes: #16626

Signed-off-by: Matt Perry <matt@mattperry.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 20:42:43 +01:00
zeertzjq 2c47ab8fcd patch 9.1.1108: 'smoothscroll' gets stuck with 'listchars' "eol"
Problem:  'smoothscroll' gets stuck with 'listchars' "eol".
Solution: Count size of 'listchars' "eol" in line size when scrolling.
          (zeertzjq)

related: neovim/neovim#32405
closes: #16627

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 20:34:34 +01:00
glepnir c0b7ca406b patch 9.1.1107: cannot loop through completion menu with fuzzy
Problem:  cannot loop through completion menu with fuzzy and nosort in
          'completeopt'
          (Tomasz N)
Solution: Reset cur to zero and update compl_shown_match when
          'completeopt' contains "nosort" but not "noselect"
          (glepnir)

fixes: #16624
closes: #16629

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 20:27:44 +01:00
Doug Kearns 4f010c90bd runtime(vim): Update base-syntax, always match continuation comments to EOL
closes: #16630

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 20:24:42 +01:00
Wu, Zhenyu 8f3277fbbe runtime(nroff): set define option & add matchit config in ftplugin
closes: #16619

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Aman Verma <amanraoverma@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-12 20:58:57 +01:00
Doug Kearns a9c06429ac runtime(vim): Update base-syntax, match Vim9 boolean and null literals in parens
- Match Vim9 boolean and null literals in parenthesised expressions and
  function argument lists.
- Match read-only registers in expressions.

closes: #16622

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-12 20:44:17 +01:00
Yee Cheng Chin 6eea0b8931 Merge pull request #1553 from ychin/fix-ci-macvim-test-ipcselectedtext
ci: Fix MacVim test breakage for testIPCSelectedText test
2025-02-12 11:41:24 -08:00
Yee Cheng Chin b6dbf0540a ci: Fix MacVim test breakage for testIPCSelectedText test
It seems that the input system is a little flaky and can occasionally
drop the full command. Switching to a regular Vim function seems to
alleviate this for now. This would be looked at and revamped in more
details when we drop Distributed Objects soon.
2025-02-12 11:21:14 -08:00
Yee Cheng Chin 712e067015 Merge pull request #1552 from ychin/fix-writing-tools-and-services-text-replacement
Fix Writing Tools integration and fix up Services integration with texts
2025-02-12 05:42:34 -08:00
Christian Brabandt 88ce0c546b patch 9.1.1106: tests: Test_log_nonexistent() causes asan failure
Problem:  tests: Test_log_nonexistent() causes asan failure
          (Hirohito Higashi)
Solution: don't run vim using system(), but run Vim in a terminal

related: #16602
related: #16610

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-11 22:58:20 +01:00
Yegappan Lakshmanan 7e89800988 patch 9.1.1105: Vim9: no support for protected new() method
Problem:  Vim9: no support for protected new() method
Solution: support the protected "_new()" object method
          (Yegappan Lakshmanan)

closes: #16604

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-11 22:07:05 +01:00
Drew Vogel f0ed0e6f63 patch 9.1.1104: CI: using Ubuntu 22.04 Github runners
Problem:  CI: uses Ubuntu 22.04 runners
Solution: Switch to Ubuntu 24.04 runners, make a few adjustments for
          different $TMPDIR (Drew Vogel)

closes: #16442

Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-11 21:36:33 +01:00
Yee Cheng Chin db26a3b1ac Fix Writing Tools integration and fix up Services integration with texts
Apple "Intelligence" Writing Tools was previously not working correctly
with MacVim. When the user chooses to replace the original selection
with the updated texts, MacVim mistreats the input and treat them as
commands instead of raw texts. The reason was that even though this
service uses the NSServicesMenuRequestor API to obtain the selected
texts, it does not use it to send over the replacement. Instead, it uses
NSTextInput's `insertText:replacementRange` to do so instead, which we
never implemented properly. The reason behind this choice was probably
because Writing Tools first shows a UI with user interaction and has a
delay between obtaining the texts and replacing them, like a regular
Services menu. This means the selection may already be invalid by the
time it requests a replacement.

To fix this, add a new IPC API `replaceSelectedText` to replace the
selected texts and redirect `insertText:replacementRange` to use it if
the replacement range is non-empty. This isn't the most correct
implementation of the protocol but should work in most cases. We don't
have a way to implement it "correctly" as MacVim does not have easy
access to Vim's internal text storage. Also make sure the Service
menu uses this API (for things like "convert to full width" and
Traditional/Simplified Chinese conversions). The old method of simple
injecting a normal mode command `s` before the text was horribly buggy.
It also works with visual block selection properly now.

The implementation uses Vim's register put functionality because Vim
doesn't have an API to simply replace a block of text, and everything
has to go through registers. At the same time, replace the
implementation for the old `selectedText` IPC API to not do this,
because Vim *did* end an API to do so for obtaining texts (via
`getregion()`) and it's more stable to use this than to manually
cache/restore registers.

Related: vim/vim#16596 (fixes `setreg()` which this uses)

Fix #1512
2025-02-11 11:25:33 -08:00
Yee Cheng Chin 5881828104 ci: syntax tests spam output
Currently syntax tests outputs all the Vim commands to the console,
which is annoying for a local developer but also makes the CI output
impossible to parse and just printing all the terminal output comes with
a performance penalty.

So let's just simply redirect all output to /dev/null similar to what
the script tests do.

This can be turned off locally for someone diagnosing issues but it
should not be the default behavior to output all terminal control
sequences to output in CI.

closes: #16612

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-11 20:16:11 +01:00
Drew Vogel 8cc725e927 patch 9.1.1103: if_perl: still some compile errors with Perl 5.38
Problem:  if_perl: still some compile errors with Perl 5.38
Solution: copy declaration of PL_memory_wrap from Perl header
          (Drew Vogel)

closes: #16613

Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-11 20:06:07 +01:00
Christian Brabandt bfc7719e48 patch 9.1.1102: tests: Test_WinScrolled_Resized_eiw() uses wrong filename
Problem:  tests: Test_WinScrolled_Resized_eiw() uses wrong filename
          (Luuk van Baal, after v9.1.1084)
Solution: Rename the filename to something more unique

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-11 20:03:10 +01:00
glepnir 40891bac5d patch 9.1.1101: insexpand.c hard to read
Problem:  insexpand.c hard to read
Solution: refactor slightly to make it better readable
          (glepnir)

Problem:
- Complex while loops with nested conditions
- Redundant if branches
- Hard to understand and maintain

Solution:
- Restructure using while(true) with clear break conditions
- Using ternary to replace some if conditions
- Add descriptive comments for each step

closes: #16600

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-10 22:18:00 +01:00
Christian Brabandt 35e02af7bf patch 9.1.1100: tests: Test_log_nonexistent only works on Linux
Problem:  tests: Test_log_nonexistent only works on Linux
          (after v9.1.1097)
Solution: Add CheckUnix condition

closes: #16476

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-10 22:13:43 +01:00
Doug Kearns 1aa287e048 runtime(vim): Update base-syntax, improve variable matching
- Match variables after operators, including line continuations.
- Match option variables without leading whitespace.
- Explicitly match expression subscripts.
- Match Vim9 variables in LHS of assignments and method calls.
- Match option variables (&option) with a dedicated syntax group like
  environment variables.
- Match list literals, fixes: #5830
- Match :{un}lockvar arguments.
- Match registers and environment variables in :let unpack lists.
- Match lambda expressions
- Match Vim9 scope blocks
- Match variables in :for subject
- Highlight user variables with Normal
- Improve this/super keyword matching, fixes: #15970

closes: #16476

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-10 22:00:27 +01:00
Yegappan Lakshmanan 54d7f18c38 patch 9.1.1099: Vim9: import with extends may crash
Problem:  Vim9: import with extends may crash, v9.1.1087 wasn't the
          correct way to fix it)
Solution: When using an import class, Check for a valid class member
          variable at compile time (Yegappan Lakshmanan)

related: #16601
closes: #16603

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-10 21:35:07 +01:00
glepnir e3647c8bf5 patch 9.1.1098: leaking memory with completing multi lines
Problem:  leaking memory with completing multi lines
          (after v9.1.1086)
Solution: free allocated memory (glepnir)

closes: #16605

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-10 21:16:32 +01:00
Hirohito Higashi c5654b8448 patch 9.1.1097: --log with non-existent path causes a crash
Problem:  --log with non-existent path causes a crash
          (Ekkosun)
Solution: split initialization phase and init the execution stack
          earlier (Hirohito Higashi)

fixes: #16606
closes: #16610

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-10 21:12:19 +01:00
Drew Vogel 97baa1cfe8 patch 9.1.1096: if_perl: Perl 5.38 adds new symbols causing link failure
Problem:  if_perl: Perl 5.38 adds new symbols causing link failure
Solution: add stub symbols (Drew Vogel)

closes: #16611

Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-10 20:17:56 +01:00
Christian Brabandt 7de6b1bb56 patch 9.1.1095: tests: matchparen plugin test wrongly named
Problem:  tests: matchparen plugin test wrongly named
          (zeertzjq)
Solution: rename test_matchparen to test_plugin_matchparen
          to be consistent with the other plugin tests

related: #16599

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-10 20:12:46 +01:00
Yegappan Lakshmanan 68d0858892 patch 9.1.1094: Vim9: problem finding implemented method in type hierarchy
Problem:  Vim9: problem finding implemented method for abstract method
          in type hierarchy (Aliaksei Budavei)
Solution: When checking for abstract methods in an extended class, check
          whether an abstract method is implemented in one of the parent
          classes (Yegappan Lakshmanan)

fixes: #16495
closes: #16497

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-09 19:39:52 +01:00
Doug Kearns f30eb4a170 runtime(qf): Update syntax file, match second delimiter
Match both | separators and link to the Delimiter highlight group.

fixes #16584
closes: #16590

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-09 18:40:05 +01:00
Christian Brabandt 3cfac59f92 patch 9.1.1093: tests: output of test ...win32_ctrl_z depends on python version
Problem:  tests: output of test Test_terminal_eof_arg_win32_ctrl_z depends on python
          version.
Solution: Check for the expected output in both, the second last line
          and last line

It seems python 3.13 changed the output a bit and there is no longer a
trailing blank line.  So to keep compatible with python < 3.13, let's
check for the expected output in either the last line and the second
last line.

closes: #16599

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-09 17:22:30 +01:00
Christian Brabandt 2e4361bd40 patch 9.1.1092: tests: fix expected return code for python 3.13 on Windows
Problem:  tests: fix expected return code for python 3.13 on Windows
Solution: Check for return code 1 or 123 on Windows

There is a regression with python 3.13 on Windows, that it no longer
prints the requested error code, but instead exits with return code 1,
which  breaks the test-suite.

So let's check for either exit code 1 or 123 in tests
Test_terminal_duplicate_eof_arg() and Test_terminal_eof_arg()

This will probably be fixed on the Python side, see the pull request
python/cpython#129901 but in the meantime, let's allow both error codes.

related: #16599
related: python/cpython#129900

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-09 17:18:07 +01:00
Christian Brabandt ec7a4e4d69 patch 9.1.1091: tests: timeout might be a bit too small
Problem:  tests: timeout might be a bit too small
Solution: increase the test timeout from 30 to 45 seconds

related: #16599

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-09 17:16:36 +01:00
Christian Brabandt aae1bfbdb9 patch 9.1.1090: tests: test_terminwscroll_topline2 unreliable
Problem:  tests: test_terminwscroll_topline2 unreliable
          (Yee Cheng Chin)
Solution: instead of using term_wait() with a specific time, use
          terminal-api and to wait until the terminal is finished

call a terminal callback function when finished printing, instead of
using term_wait(), with a defined time, which caused timeouts on CI
with the macos runners

Unfortunately I couldn't figure out how to call the terminal-api on Windows,
so skip the test on Windows. cmd.com echo didn's seem to work and
neither did trying to use python, but perhaps it was just me fighting
with the terminal quoting rules 🤷

related: #16599
related: #16552

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-09 17:10:30 +01:00
Christian Brabandt 6f14ef4b0b patch 9.1.1089: tests: No check when tests are run under Github actions
Problem:  tests: No check when tests are run under Github actions
Solution: Add the CheckGithubActions check command and skip test if
          needed

related: #16599
related: actions/runner-images#11512

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-09 17:05:21 +01:00
Christian Brabandt 934d9ab3a2 patch 9.1.1088: tests: plugin tests are named inconsistently
Problem:  tests: plugin tests are named inconsistently
Solution: group them under a common 'plugin' prefix

related: #16599

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-09 17:03:31 +01:00
Hirohito Higashi 645a4288e2 patch 9.1.1087: Vim9: import with extends may crash
Problem:  Vim9: import with extends may crash
Solution: check otv for being NULL before trying to access it
          (Hirohito Higashi)

closes: #16601

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-09 16:41:23 +01:00
glepnir 76bdb82527 patch 9.1.1086: completion doesn't work with multi lines
Problem:  completion doesn't work with multi lines
          (Łukasz Jan Niemier)
Solution: handle linebreaks in completion code as expected
          (glepnir)

fixes: #2505
closes: #15373

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-08 19:09:02 +01:00
Christoph Sax 746fe54d4f patch 9.1.1085: filetype: cmmt files are not recognized
Problem:  filetype: cmmt files are not recognized
Solution: detect '*.cmmt' as trace32 filetype
          (Christian Sax)

"*.cmmt" files use the same syntax as regular TRACE32 scripts,
but are intended as a kind of script template.

closes: #16598

Signed-off-by: Christoph Sax <c_sax@mailbox.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-08 19:01:05 +01:00
Luuk van Baal b7147f8236 patch 9.1.1084: Unable to persistently ignore events in a window and its buffers
Problem:  Unable to persistently ignore events in a window and its buffers.
Solution: Add 'eventignorewin' option to ignore events in a window and buffer
          (Luuk van Baal)

Add the window-local 'eventignorewin' option that is analogous to
'eventignore', but applies to a certain window and its buffers. Identify
events that should be allowed in 'eventignorewin', adapt "auto_event"
and "event_tab" to encode this information. Window context is not passed
onto apply_autocmds_group(), and when to ignore an event is a bit
ambiguous when "buf" is not "curbuf", rather than a large refactor, only
ignore an event when all windows into "buf" are ignoring the event.

closes: #16530

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-08 18:52:39 +01:00
Eisuke Kawashima a35040f795 runtime(tex): improve syntax highlighting
this change includes the following changes:
- a macro option must be #1–#9
- add \providecommand
- add starred versions of \newcommand, \newenvironment, and their
  variants
- add number of arguments to \(re)newenvironment

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-08 18:32:14 +01:00
Yee Cheng Chin a17f8bfb28 patch 9.1.1083: setreg() doesn't correctly handle mbyte chars in blockwise mode
Problem:  setreg() doesn't correctly handle mbyte chars in blockwise
          mode
Solution: use mb_ptr2len_len function pointer (Yee Cheng Chin)

setreg() will automatically calculate the width when a blockwise mode is
specified, but it does not properly calculate the line widths of mbyte
characters when value is passed as newline-terminated string. It does
work when value is passed as a list of lines though.

Fix this by properly using the mbyte function pointer to increment the
loop counter.

closes: #16596

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-08 18:19:15 +01:00
Julio B a6d5778d9b patch 9.1.1082: unexpected DCS responses may cause out of bounds reads
Problem:  unexpected DCS responses may cause out of bounds reads
          (after v9.1.1054)
Solution: check that the parsed value is '=' as expected
          (Julio B)

Signed-off-by: Julio B <julio.bacel@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-07 20:54:56 +01:00
Yee Cheng Chin 252a1330da Merge pull request #1549 from ychin/no-flicker-enter-nonnative-fullscreen
Reduce flicker when entering non-native full screen
2025-02-06 21:13:24 -08:00
Yee Cheng Chin 16b2af7aa7 Reduce flicker when entering non-native full screen
In #1547, flicker during font size change and showing tab/scrollbar were
reduced. Here, we do something similar for the flicker that happens when
entering non-native full screen, where the temporarily moved text view
shows a brief temporary draw before the updated Vim redraws over it,
leading to a flicker. Use the same mechanism here to block rendering and
offset the text view draw while we wait for Vim to preserve visual
stability as much as possible.

No need to do this for native full screen as the smooth but slow
transition means there isn't a sharp flicker anyway.

Also, reduce the "fill right" behavior of Core Text renderer (#1276).
It's designed to make smooth resizing more seamless but it fills all the
way to the right which makes situations like this or maximizing the
window jarrying as Vim looks stretched horizontally but not vertically
during the resize before Vim catches up and resizes/redraws. Just put a
sane cap of 4 cell widths. This way even if Vim is a little slow to
respond, smooth resize still looks good, but it won't stretch across the
whole screen.
2025-02-06 20:17:45 -08:00
Yee Cheng Chin a3a185c309 Merge pull request #1548 from ychin/non-native-fullscreen-menubar-height-calc
Fix non-native full screen menu sizing / make resize option updates immediate
2025-02-06 19:42:01 -08:00
Yee Cheng Chin 024706611d Fix non-native full screen menu sizing / make resize option updates immediate
Problem: Non-native full screen has an option to show the menu bar but
it does not work properly in some multi-monitor scenarios. On a MacBook
with a notch it would sometimes use the thicker notch menu bar height
even when going full screen on a regular monitor, and when using a
single Space for all displays it would also show a black bar on top on
the screen that does not have the menu bar.

Solution: Use the NSScreen visibleFrame API exclusively instead of
querying the menu bar height which seems to be inconsistent. There are
some quirks with this API (e.g. a one-pixel gap) but we already handle
it when handling non-native full screen on a laptop screen with notch so
it's best to consolidate the code paths.

Also, make the "show menu bar" option immediate when changing it in
preference pane. As a corollary, this also makes changing "smooth
scrolling" option immediate, as well as liveResizeDidEnd's delayed
pending resize.
2025-02-06 18:46:41 -08:00
Zhaoming Luo a41dfcd55b patch 9.1.1081: has('bsd') is true for GNU/Hurd
Problem:  has('bsd') is true for GNU/Hurd
Solution: exclude GNU/Hurd from BSD feature flag
          (Zhaoming Luo)

GNU/Hurd, like Mac OS X, is a BSD-based system. It should exclude
has('bsd') feature just like what Mac OS X does. The __GNU__ pre-defined
macro indicates it's compiled for GNU/Hurd.

closes: #16580

Signed-off-by: Zhaoming Luo <zhmingluo@163.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-06 21:39:35 +01:00
Chris Kipp 9c8f9b10fc patch 9.1.1080: filetype: Mill files are not recognized
Problem:  filetype: Mill files are not recognized
Solution: detect '*.mill' files as scala filetype
          (author)

In the past [Mill](https://mill-build.org/mill/index.html) build files
were always `build.sc` and treated as Scala files. However as the 0.12.x
series of mill you can create a `build.mill` file. You can see a lot of
examples of this if you search
[GitHub](https://github.com/search?q=build.mill&type=code). This small
change just ensures that if you have a `*.mill` file it treats it as a
Scala file.

closes: #16585

Signed-off-by: Chris Kipp <ckipp@pm.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-06 21:26:08 +01:00
Yee Cheng Chin a5e03f68a8 patch 9.1.1079: GUI late startup leads to uninitialized scrollbars
Problem:  GUI late startup leads to uninitialized scrollbars
Solution: initialize scrollbars for all windows in all tabpages
          (Yee Cheng Chin)

GUI startup was erroneously only initializing scrollbars for all windows
in current tab, instead of all tabs. This breaks if the user has created
tab pages before using `:gui` command to enter GUI mode, or sourced a
session file in vimrc.

closes: #16588
related: macvim-dev/macvim#862

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-06 21:18:17 +01:00
Corpulent Robin b69cd52447 runtime(misc): Add support for lz4 to tar & gzip plugin
while at it, clean up the tar plugin a bit and sort the patterns for the
tar and gzip plugin

References:
- https://github.com/lz4/lz4
- https://lz4.org/

closes: #16591

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Corpulent Robin <177767857+corpulentrobin@users.noreply.github.com>
2025-02-06 21:10:49 +01:00
Julio B cde8ff63e2 patch 9.1.1078: Terminal ansi colors off by one after tgc reset
Problem:  Terminal ansi colors off by one after tgc reset
Solution: Set the correct index for libvterm palette,
          revert parts in libvterm/src/pen.c that deviated from upstream
          (Julio B)

fixes: #16568
closes: #16573
related: Vim patch v8.2.0804

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Julio B <julio.bacel@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-06 20:31:27 +01:00
Theodore Dubois f50d5364d7 patch 9.1.1077: included syntax items do not understand contains=TOP
Problem:  Syntax engine interpreted contains=TOP as matching nothing
          inside included files, since :syn-include forces HL_CONTAINED
          on for every included item. After 8.2.2761, interprets
          contains=TOP as contains=@INCLUDED, which is also not correct
          since it doesn't respect exclusions, and doesn't work if there
          is no @INCLUDED cluster.
Solution: revert patch 8.2.2761, instead track groups that have had
          HL_CONTAINED forced, and interpret contains=TOP and
          contains=CONTAINED using this. (Theodore Dubois)

fixes: #11277
closes: #16571

Signed-off-by: Theodore Dubois <tblodt@icloud.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-05 23:59:25 +01:00
Yee Cheng Chin dc49d725a7 Merge pull request #1547 from ychin/font-change-newtab-no-flicker
Reduce flicker when changing fonts/adding tabs in go+=k/fullscreen
2025-02-05 10:02:07 -08:00
Yee Cheng Chin 767ffc4eef Reduce flicker when changing fonts/adding tabs in go+=k/fullscreen
MacVim would previously show a quick flicker when adjusting font (e.g.
Cmd =/-) or showing/hiding tabs/scroll bar when in fixed window size
mode (guioptions+=k or full screen). This was because after the state
change, Vim requests a resize asynchronously to the GUI to fit it in the
window.  MacVim does so after changing the font/showing the tab, leading
to a momentary incorrect result before Vim then redraws the resized
grid. In normal GVim this is not an issue because Vim requests the
resize synchronously in a single-process environment, and we would like
to avoid that as the message passing between Vim/MacVim and designed to
be mostly non-blocking.

To fix this, after receiving the Vim resize request, we block all
further text rendering commands, until Vim has resized / redrawn,
preventing the short period of time where text view is drawing the old
state using the new font. For tabs / scroll bars, the text view itself
has moved after the new layout, so we temporarily apply a render offset
to make the text view pretend it didn't move and looks mostly the same
to the user while we wait for Vim to redraw with the updated grid.

There are some potential ways to still see flicker, but they are mostly
edge cases:

- When changing fonts, if Vim is slow and the user gets MacVim to
  re-draw the text view (e.g. dragging the window to resize) while we
  wait for Vim to resize, it would still draw an incorrect result (since
  it has the new font, but old text grid). This should realistically
  only happen if Vim takes an abnormal amount of time to respond.
- For tabs / scrollbars we have a similar issue. We immediately
  place/remove them while we wait for Vim to resize, which could cause a
  small visual discontinuity (easiest way is to toggle `go+=e`). From
  testing, having the tab bar / etc immediately show up and hide feels
  better as the user feels like something has happened, so keeping the
  responsiveness is more important than delaying showing/hiding the tab
  bar for visual stability (not to mention the deferral is more
  complicated to implement).

If Vim takes a long time to resize/redraw, this change could make font
size change *feel* less responsive because nothing happens on the screen
until the fully redrawn screen is shown. This is ok, and if Vim takes so
long to resize then that's the actual issue to address.

This change also removes unnecessary code:

- Excessive and unnecessary redraws when showing/hiding tabs and setting
  fonts. They were written a long time ago as temporary hacks which
  survived till now. From testing this makes changing font size and
  showing/hiding tabs feel a fair bit more responsive because Vim isn't
  trying to redraw over and over again now.
- Stale "maximize" code that has long been unused. It was trying to solve
  a similar issue but long obsolete and disabled.
2025-02-05 05:19:40 -08:00
Yee Cheng Chin 5c462e7cbc Merge pull request #1546 from ychin/fix-blurradius-fullscreen
Fix non-native full screen to support 'blurradius'
2025-02-04 23:59:36 -08:00
zeertzjq 34e1e8de91 patch 9.1.1076: vim_strnchr() is strange and unnecessary
Problem:  vim_strnchr() is strange and unnecessary (after v9.1.1009)
Solution: Remove vim_strnchr() and use memchr() instead.  Also remove a
          comment referencing an #if that is no longer present.

vim_strnchr() is strange in several ways:
- It's named like vim_strchr(), but unlike vim_strchr() it doesn't
  support finding a multibyte char.
- Its logic is similar to vim_strbyte(), but unlike vim_strbyte() it
  uses char instead of char_u.
- It takes a pointer as its size argument, which isn't convenient for
  all its callers.
- It allows embedded NULs, unlike other "strn*" functions which stop
  when encountering a NUL byte.

In comparison, memchr() also allows embedded NULs, and it converts bytes
in the string to (unsigned char).

closes: #16579

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-04 16:48:36 +01:00
Hirohito Higashi f7cb9f9280 patch 9.1.1075: Vim9: len variable not used in compile_load()
Problem:  Vim9: length variable not used in compile_load()
Solution: use len instead of re-calculating the length
          (Hirohito Higashi)

closes: #16582

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-04 16:40:08 +01:00
Yee Cheng Chin 9162e2c802 Fix non-native full screen to support 'blurradius' 2025-02-04 02:26:08 -08:00
Doug Kearns 4a530a632b runtime(vim): Update base-syntax, match :debuggreedy count prefix
Match :0debuggreedy as a special case until better range/count support
is implemented.

closes: #16572

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-03 18:59:09 +01:00
zeertzjq 449c2e5454 patch 9.1.1074: Strange error when heredoc marker starts with "trim"
Problem:  Strange error when heredoc marker starts with "trim".
Solution: Check for whitespace after "trim" or "eval" (zeertzjq)

For :python3 etc., a heredoc marker that starts with a lower-case letter
is valid, and when it starts with "trim" it works in a script but not in
a function, and this PR makes it works in a function.
For :let, a heredoc marker that starts with a lower-case letter is not
valid, but when it starts with "trim" or "eval" the error can be a bit
confusing in a function, and this PR make it less confusing.

closes: #16574

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-03 18:56:16 +01:00
zeertzjq 23da16d3d0 patch 9.1.1073: tests: test_compiler fails on Windows without Maven
Problem:  tests: test_compiler fails on Windows without Maven.
Solution: Add Xspotbugs directory to $PATH when mvn is not available
          (zeertzjq).

closes: #16576

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-03 18:53:28 +01:00
zeertzjq ccd7f454fc patch 9.1.1072: 'diffopt' "linematch" cannot be used with {n} less than 10
Problem:  'diffopt' "linematch" cannot be used with {n} less than 10
          digits (after v9.1.1022)
Solution: Fix off-by-one error when checking for digit (zeertzjq)

closes: #16577

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-03 18:49:49 +01:00
zeertzjq 04d2a3fdc0 patch 9.1.1071: args missing after failing to redefine a function
Problem:  Arguments of a function are missing after failing to redefine
          it (after 8.2.2505), and heap-use-after-free with script-local
          function (after 9.1.1063).
Solution: Don't clear arguments or free uf_name_exp when failing to
          redefine an existing function (zeertzjq)

closes: #16567

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-02 19:04:22 +01:00
zeertzjq edf0f7db28 patch 9.1.1070: Cannot control cursor positioning of getchar()
Problem:  Cannot control cursor positioning of getchar().
Solution: Add "cursor" flag to {opts}, with possible values "hide",
          "keep" and "msg".

related: #10603
closes: #16569

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-02 19:01:01 +01:00
glepnir 001c26cd61 patch 9.1.1069: preinsert text completions not deleted with <C-W>/<C-U>
Problem:  preinsert text completions not deleted with <C-W>/<C-U>
          (ddad431, after v9.1.1059)
Solution: handle <C-W> or <C-U> specifically and clear the completion
          (glepnir)

fixes: #16557
closes: #16565

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-02 09:36:22 +01:00
zeertzjq e0a2ab397f patch 9.1.1068: getchar() can't distinguish between C-I and Tab
Problem:  getchar() can't distinguish between C-I and Tab.
Solution: Add {opts} to pass extra flags to getchar() and getcharstr(),
          with "number" and "simplify" keys.

related: #10603
closes: #16554

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-02 09:14:35 +01:00
Philip H. cbc1f409c1 CI: bump windows python to 3.13
closes: #16562

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-02 09:08:05 +01:00
Christian Brabandt 44a21351a8 patch 9.1.1067: tests: Test_termwinscroll_topline2 fails on MacOS
Problem:  tests: Test_termwinscroll_topline2 fails on MacOS
          (after v9.1.1062)
Solution: reduce termwinscroll further, increase term_wait time

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-02 09:03:00 +01:00
zeertzjq 2101230f40 patch 9.1.1066: heap-use-after-free and stack-use-after-scope with :14verbose
Problem:  heap-use-after-free and stack-use-after-scope with :14verbose
          when using :return and :try (after 9.1.1063).
Solution: Move back the vim_free(tofree) and the scope of numbuf[].
          (zeertzjq)

closes: #16563

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-02 08:55:57 +01:00
Yee Cheng Chin ac134634d3 Merge pull request #1545 from ychin/fix-dmg-duplicate-images
Fix dmg installer to not have duplicate images and icons
2025-02-01 19:48:02 -08:00
Yee Cheng Chin d04d99de73 Fix dmg installer to not have duplicate images and icons
We added a new step in #1540 to generate the image / icon set for the
dmg installer during the dmg build step, but the intermediate files were
erroneously placed in the same folder as the one being copied over,
causing them to be in the final dmg as well. Just use a scratch folder
instead.
2025-02-01 18:25:22 -08:00
Yee Cheng Chin 7b4df97ece Merge pull request #1540 from ychin/dmg-design-updates
Beautify MacVim's dmg installer background and volume icon
2025-02-01 14:28:36 -08:00
Yee Cheng Chin 1ca0a976db Merge pull request #1544 from ychin/guifont-monospace-fontsizeupdown-keep-alias
Fix fontSizeUp/Down actions to preserve -monospace- font alias
2025-02-01 14:28:06 -08:00
Yee Cheng Chin dbdc27d0f8 Fix fontSizeUp/Down actions to preserve -monospace- font alias
This prevents using Cmd +/- to adjust font size resulting in guifont
being set from "-monospace-" to a non-user-friendly internal name like
".AppleSystemUIFontMonospaced-Regular".
2025-02-01 09:24:11 -08:00
Hans Ginzel 3a621188ee patch 9.1.1065: no digraph for "Approaches the limit"
Problem:  no digraph for "Approaches the limit"
Solution: Add the digraph using .= (Hans Ginzel)

Add digraph Approaches the Limit

≐ U+2250 https://www.fileformat.info/info/unicode/char/2250/index.htm

closes: #16508

Signed-off-by: Hans Ginzel <hans@matfyz.cz>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-01 16:17:14 +01:00
Christ van Willegen c078675ac7 patch 9.1.1064: not possible to use plural forms with gettext()
Problem:  not possible to use plural forms with gettext()
Solution: implement ngettext() Vim script function (Christ van Willegen)

closes: #16561

Signed-off-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-01 15:47:51 +01:00
John Marriott b32800f7c5 patch 9.1.1063: too many strlen() calls in userfunc.c
Problem:  too many strlen() calls in userfunc.c
Solution: refactor userfunc.c and remove calls to strlen(),
          drop set_ufunc_name() and roll it into alloc_ufunc(),
          check for out-of-memory condition in trans_function_name_ext()
          (John Marriott)

closes: #16537

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-01 15:25:34 +01:00
Hirohito Higashi 3219da514c patch 9.1.1062: terminal: E315 when dragging the terminal with the mouse
Problem:  terminal: E315 when dragging the terminal with the mouse
          (user202729)
Solution: call update_topline() and validate_cursor() when clicking
          on the status line with the mouse (Hirohito Higashi)

fixes: #16024
fixes: #16211
closes: #16552

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-01 14:48:35 +01:00
Morton Fox 7c930eb61a runtime(openPlugin): fix unclosed parenthesis in GetWordUnderCursor()
Problem:

Saw the following error when invoking gx mapping with cursor on a URL:

    Error detected while compiling function <SNR>95_GetWordUnderCursor:
    line    7:
    E1123: Missing comma before argument: return expand(user_var)
    E116: Invalid arguments for function dist#vim9#Open

Solution:

The line before "return expand(...)" has two open parentheses but only
one close parenthesis. Add another close parenthesis.

closes: #16553

Signed-off-by: Morton Fox <github@qslw.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-01 10:28:52 +01:00
Hirohito Higashi 195fcc90d0 runtime(doc): Tweak documentation style a bit
closes: #16556

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
2025-02-01 10:26:58 +01:00
Yee Cheng Chin c22b4df9e7 Beautify MacVim's dmg installer background and volume icon
The existing background image for the MacVim dmg installer was quite
old. It did not have a 2x retina version, and design-wise it showed a
redundant MacVim logo when there's already a draggable MacVim app with
the same icon. Update the background image for a cleaner refreshed
design. Image was designed by Jason Long (@jasonlong).

Also, change the dmg's volume icon. We were using the MacVim logo as the
volume icon, but when mounting the image, it could lead to a confusing
state where the user sees a MacVim logo on the desktop, thinking it's
the app itself, but it's actually a dmg volume. Instead, use a new
designed volume icon with the macOS disk image icon overlaid with Vim's
logo/color for styling to make it clear it's a volume, not an app.
2025-01-31 19:56:42 -08:00
Christian Brabandt 85e3f24bea patch 9.1.1061: tests: test_glvs fails when unarchiver not available
Problem:  tests: test_glvs fails when unarchiver not available
          (Brian L. Matthews)
Solution: Check if an unarchiver is available, skip the test otherwise

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-31 17:02:32 +01:00
Christian Brabandt d7f5854fcc patch 9.1.1060: Vim always enables 'termguicolors' in a terminal
Problem:  Vim always enables 'termguicolors' in a terminal, even
          when not wanted (after v9.1.1054)
Solution: Respect `:set notermguicolors` in vimrc file

fixes: #16538
fixes: #16539
closes: #16540

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-31 16:16:48 +01:00
glepnir bfb4eea786 patch 9.1.1059: completion: input text deleted with preinsert when adding leader
Problem:  completion: input text deleted with preinsert when adding leader
Solution: remove compl_length and check the ptr for being equal
          to pattern when preinsert is active (glepnir)

closes: #16545

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-31 15:28:29 +01:00
Ivan Pešić fe0a9a3269 patch 9.1.1058: translation(sr): Missing Serbian translation for the tutor
Problem:  translation(sr): Missing Serbian translation for the tutor
Solution: include new Serbian translation for the new tutor,
          include translation for chapter 2 of the traditional tutor,
          update the Makefiles for installing the runtime files
          (Ivan Pešić)

closes: #16550

Signed-off-by: Ivan Pešić <27575106+eevan78@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-31 15:20:03 +01:00
zeertzjq 8297e2cee3 patch 9.1.1057: Superfluous cleanup steps in test_ins_complete.vim
Problem:  Superfluous cleanup steps in test_ins_complete.vim.
Solution: Remove unnecessary :bw! and :autocmd! commands.
          Also remove unnecessary STRLEN() in insexpand.c
          (zeertzjq)

closes: #16542

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-30 11:04:47 +01:00
Christian Brabandt 6d6ec2ee05 runtime(netrw): correct wrong version check
The version check introduced with commit edd4ac3e8 has a logic error.
Also it should only trigger when trying to use the netrw plugin and not
always.

fixes: #16541

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-30 11:00:35 +01:00
glepnir edd4ac3e89 patch 9.1.1056: Vim doesn't highlight to be inserted text when completing
Problem:  Vim doesn't highlight to be inserted text when completing
Solution: Add support for the "preinsert" 'completeopt' value
          (glepnir)

Support automatically inserting the currently selected candidate word
that does not belong to the latter part of the leader.

fixes: #3433
closes: #16403

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-29 18:58:04 +01:00
Luca Saccarola ec961b05dc runtime(netrw): upstream snapshot of v176
relevant commits:
- deprecate!: netrw#Launch, netrw#Open and gx mappings
- refactor: move some utility functions in a private file
- feat: add function to deprecate features
- refactor!: remove NetrwClean command and function
- refactor: use appropriate directories to store temporary files
- refactor: better way to call vim.ui.open
- refactor(Open): prefer lua wrapper function instead of cmdline
- refactor!: drop vim 7 checks
- refactor: use vim.ui.open when using neovim
- refactor: remove s:CheckIfKde
- refactor: balloon functionality
- refactor!: remove netrw#Access function

closes: #16519

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-29 18:39:30 +01:00
Luca Saccarola 766801295d runtime(dist/vim9): fix regressions in dist#vim9#Open
fixes: #16533
fixes: #16532
closes: #16535

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-29 18:36:01 +01:00
Luca Saccarola a5d19aa44d runtime(hyprlang): fix string recognition
fixes: #16064
closes: #16527

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-29 10:28:42 +01:00
Sergei Trofimovich 04cc897593 patch 9.1.1055: make install fails because of a missing dependency
Problem:  make install fails because of a missing dependency
Solution: add explicit dependencies for tutor/{en,it}
          (Sergei Trofimovich)

Without the change `make install -j16` fails
sometimes due to race condition to create a directory.

It's best reproducible with `make --shuffle`:

    $ make install --shuffle
    ...
    bash install-sh -c -d /vim-9.1.0990/share/vim/vim91/tutor
    chmod 755 /vim-9.1.0990/share/vim/vim91/tutor
    cp ../runtime/tutor/README* ../runtime/tutor/tutor* /vim-9.1.0990/share/vim/vim91/tutor
    cp ../runtime/tutor/en/* /vim-9.1.0990/share/vim/vim91/tutor/en/
    cp: target '/vim-9.1.0990/share/vim/vim91/tutor/en/': No such file or directory
    make[1]: [Makefile:2487: installtutor] Error 1 (ignored) shuffle=2340321974
    cp ../runtime/tutor/it/* /vim-9.1.0990/share/vim/vim91/tutor/it/
    cp: target '/vim-9.1.0990/share/vim/vim91/tutor/it/': No such file or directory
    make[1]: [Makefile:2488: installtutor] Error 1 (ignored) shuffle=2340321974

The fix adds a dependency on targeted directories used to install tutor.

Before the change it too 2-3 attempts to reproduce the install failure.
After the change `vim` survives 150 install attempts without failures.

closes: #16531

Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-28 11:37:52 +01:00
Nir Lichtman db23436b92 runtime(asm): add byte directives to syntax script
closes: #16523

Signed-off-by: Nir Lichtman <nir@lichtman.org>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-26 16:55:54 +01:00
Christian Brabandt 279dd703e1 patch 9.1.1054: Vim doesn't work well with TERM=xterm-direct
Problem:  Vim doesn't work well with TERM=xterm-direct
          (Andrea Pappacoda)
Solution: detect if a terminal supports true-colors and
          enable termguicolors

The terminfo database for xterm-direct contains both the (non-standard)
termcap RGB capability and a number of colors == 0x1000000 so it seems
either of those two options can be used to detect a terminal capable of
displaying true colors.

So set the termguicolor option automatically, when either of the two
options is detected. (for some reasons, my debian xterm (v393) does not
respond to XTGETTCAP query attempts, so falling back to the number of
colors seems like a good compromize)

fixes: #16327
closes: #16490

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-26 10:53:17 +01:00
Yee Cheng Chin bd913cea83 Support extra side mouse buttons in MacVim (X1 and X2) 2025-01-25 17:04:34 -08:00
Christian Brabandt fb49e3cde7 runtime(filetype): commit 99181205c5 breaks V lang detection
so make the regex more strict and have it check for a parenthesis.

See:
https://github.com/vlang/v/blob/master/examples/submodule/mymodules/submodule/sub_functions.v

related: #16513

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-25 16:18:51 +01:00
Luca Saccarola c729d6d154 runtime: decouple Open and Launch commands and gx mapping from netrw
closes: #16494
fixes: ##16486

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-25 16:07:12 +01:00
zeertzjq d65aa1bbdb patch 9.1.1053: "nosort" enables fuzzy filtering even if "fuzzy" isn't in 'completeopt'
Problem:  "nosort" enables fuzzy filtering even if "fuzzy" isn't in
          'completeopt' (after v9.1.1049)
Solution: Only enable fuzzy filtering when "fuzzy" is in 'completeopt'.
          (zeertzjq)

closes: #16510

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-25 15:30:46 +01:00
Peter Benjamin 509a8d58f9 runtime(just): fix typo in syntax file
closes: #16515

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-25 15:27:15 +01:00
Christian Brabandt 99181205c5 runtime(filetype): Improve Verilog detection by checking for modules definition
While at it, also increase the maximum number of lines to check to 500.

fixes: #16513

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-25 15:23:52 +01:00
Yee Cheng Chin 3acfbb4b54 patch 9.1.1052: tests: off-by-one error in CheckCWD in test_debugger.vim
Problem:  tests: off-by-one error in CheckCWD in test_debugger.vim
Solution: Fix off-by-one in CheckCWD leading to local tests failure
          (Yee Cheng Chin)

Vim's test_debugger's Test_debug_backtrace_level test will fail if you
happen to run it in a Vim repository with full path of directory being
exactly 29 characters (e.g. `/Users/bob/developing/src/vim`). The test
does term dump comparison and the printout will overflow if the CWD is
too long. It does have a function to skip to test if it detects that but
it's off by one leading to this one situation where it will fail.

The reason why the logic didn't account for this is that Vim's message
printing will overflow the text if it prints a message at exactly the
width of the terminal. This could be considered a bug / quirk but that
will be another issue.

closes: #16517

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-25 15:14:06 +01:00
Christian Brabandt 08ea2e1fb0 patch 9.1.1051: tests: no support for env variables when running Vim in terminal
Problem:  tests: no support for env variables when running Vim in
          terminal
Solution: support the "env" argument in RunVimInTerminal(),
          close swapfiles properly in test_termcodes,
          use CheckFeature in test_termencoding

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-25 15:01:42 +01:00
896 changed files with 41389 additions and 9774 deletions
+8
View File
@@ -24,6 +24,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
+17
View File
@@ -98,6 +98,7 @@ runtime/compiler/se.vim @dkearns
runtime/compiler/shellcheck.vim @dkearns
runtime/compiler/sml.vim @dkearns
runtime/compiler/spectral.vim @romainl
runtime/compiler/svelte-check.vim @Konfekt
runtime/compiler/stylelint.vim @dkearns
runtime/compiler/tcl.vim @dkearns
runtime/compiler/tidy.vim @dkearns
@@ -153,6 +154,7 @@ runtime/ftplugin/debchangelog.vim @jamessan
runtime/ftplugin/debcontrol.vim @jamessan
runtime/ftplugin/debsources.vim @jamessan
runtime/ftplugin/desktop.vim @e-kwsm
runtime/ftplugin/dnsmasq.vim @dringsim
runtime/ftplugin/dosbatch.vim @mrdubya
runtime/ftplugin/editorconfig.vim @ribru17
runtime/ftplugin/eiffel.vim @dkearns
@@ -160,6 +162,7 @@ runtime/ftplugin/elixir.vim @mhanberg
runtime/ftplugin/erlang.vim @hcs42
runtime/ftplugin/eruby.vim @tpope @dkearns
runtime/ftplugin/expect.vim @dkearns
runtime/ftplugin/exports.vim @mperry2
runtime/ftplugin/fennel.vim @gpanders
runtime/ftplugin/fetchmail.vim @dkearns
runtime/ftplugin/forth.vim @jkotlinski
@@ -222,6 +225,7 @@ runtime/ftplugin/liquid.vim @tpope
runtime/ftplugin/lua.vim @dkearns
runtime/ftplugin/lc.vim @ribru17
runtime/ftplugin/lynx.vim @dkearns
runtime/ftplugin/m17ndb.vim @dseomn
runtime/ftplugin/m3build.vim @dkearns
runtime/ftplugin/m3quake.vim @dkearns
runtime/ftplugin/markdown.vim @tpope
@@ -246,6 +250,7 @@ runtime/ftplugin/pbtxt.vim @lakshayg
runtime/ftplugin/pdf.vim @tpope
runtime/ftplugin/perl.vim @petdance @dkearns
runtime/ftplugin/php.vim @dkearns
runtime/ftplugin/plsql.vim @lee-lindley
runtime/ftplugin/pod.vim @petdance @dkearns
runtime/ftplugin/poefilter.vim @ObserverOfTime
runtime/ftplugin/postscr.vim @mrdubya
@@ -267,6 +272,7 @@ runtime/ftplugin/routeros.vim @zainin
runtime/ftplugin/rst.vim @marshallward
runtime/ftplugin/ruby.vim @tpope @dkearns
runtime/ftplugin/rust.vim @lilyball
runtime/ftplugin/samba.vim @mperry2
runtime/ftplugin/sass.vim @tpope
runtime/ftplugin/scala.vim @derekwyatt
runtime/ftplugin/scheme.vim @evhan
@@ -279,6 +285,7 @@ runtime/ftplugin/slint.vim @ribru17
runtime/ftplugin/snakemake.vim @ribru17
runtime/ftplugin/solidity.vim @cothi
runtime/ftplugin/solution.vim @dkearns
runtime/ftplugin/spajson.vim @dseomn
runtime/ftplugin/spec.vim @ignatenkobrain
runtime/ftplugin/squirrel.vim @ribru17
runtime/ftplugin/ssa.vim @ObserverOfTime
@@ -290,6 +297,7 @@ runtime/ftplugin/systemverilog.vim @Kocha
runtime/ftplugin/swig.vim @jmarrec
runtime/ftplugin/tap.vim @petdance
runtime/ftplugin/tcsh.vim @dkearns
runtime/ftplugin/tera.vim @MuntasirSZN
runtime/ftplugin/terraform.vim @JannoTjarks
runtime/ftplugin/tf.vim @ribru17
runtime/ftplugin/thrift.vim @jiangyinzuo
@@ -363,6 +371,7 @@ runtime/indent/ld.vim @dkearns
runtime/indent/less.vim @genoma
runtime/indent/liquid.vim @tpope
runtime/indent/lua.vim @marcuscf
runtime/indent/m17ndb.vim @dseomn
runtime/indent/make.vim @dkearns
runtime/indent/meson.vim @Liambeguin
runtime/indent/mma.vim @dkearns
@@ -388,6 +397,7 @@ runtime/indent/scheme.vim @evhan
runtime/indent/scss.vim @tpope
runtime/indent/sh.vim @chrisbra
runtime/indent/solidity.vim @cothi
runtime/indent/spajson.vim @dseomn
runtime/indent/systemverilog.vim @Kocha
runtime/indent/tcl.vim @dkearns
runtime/indent/tcsh.vim @dkearns
@@ -404,6 +414,7 @@ runtime/keymap/armenian-eastern_utf-8.vim @blinskey
runtime/keymap/armenian-western_utf-8.vim @blinskey
runtime/keymap/russian-typograph.vim @RestorerZ
runtime/keymap/tamil_tscii.vim @yegappan
runtime/keymap/ukrainian-enhanced.vim @Dolfost
runtime/lang/menu_en_gb.latin1.vim @mrdubya
runtime/lang/menu_ru_ru.cp1251.vim @RestorerZ
runtime/lang/menu_ru_ru.koi8-r.vim @RestorerZ
@@ -415,6 +426,7 @@ runtime/pack/dist/opt/nohlsearch/ @habamax
runtime/plugin/manpager.vim @Konfekt
runtime/syntax/shared/hgcommitDiff.vim @vegerot
runtime/syntax/abaqus.vim @costerwi
runtime/syntax/abnf.vim @A4-Tacks
runtime/syntax/aidl.vim @dpelle
runtime/syntax/ant.vim @dkearns
runtime/syntax/antlr4.vim @jiangyinzuo
@@ -528,6 +540,7 @@ runtime/syntax/liquid.vim @tpope
runtime/syntax/lua.vim @marcuscf
runtime/syntax/lyrics.vim @ObserverOfTime
runtime/syntax/lynx.vim @dkearns
runtime/syntax/m17ndb.vim @dseomn
runtime/syntax/m3build.vim @dkearns
runtime/syntax/m3quake.vim @dkearns
runtime/syntax/mailcap.vim @dkearns
@@ -549,6 +562,7 @@ runtime/syntax/ninja.vim @nico
runtime/syntax/nix.vim @equill
runtime/syntax/nroff.vim @jmarshall
runtime/syntax/nsis.vim @k-takata
runtime/syntax/omnimark.vim @kennypete
runtime/syntax/ondir.vim @jparise
runtime/syntax/opencl.vim @Freed-Wu
runtime/syntax/openvpn.vim @ObserverOfTime
@@ -566,6 +580,7 @@ runtime/syntax/postscr.vim @mrdubya
runtime/syntax/privoxy.vim @dkearns
runtime/syntax/progress.vim @rdnlsmith
runtime/syntax/prolog.vim @XVilka
runtime/syntax/prql.vim @vanillajonathan
runtime/syntax/ps1.vim @heaths
runtime/syntax/ps1xml.vim @heaths
runtime/syntax/psl.vim @danielkho
@@ -597,6 +612,7 @@ runtime/syntax/sed.vim @dkearns
runtime/syntax/shared/debversions.vim @jamessan
runtime/syntax/shaderslang.vim @mTvare6
runtime/syntax/solidity.vim @cothi
runtime/syntax/spajson.vim @dseomn
runtime/syntax/spec.vim @ignatenkobrain
runtime/syntax/sqloracle.vim @chrisbra
runtime/syntax/squirrel.vim @zenmatic
@@ -611,6 +627,7 @@ runtime/syntax/swig.vim @jmarrec
runtime/syntax/systemverilog.vim @Kocha
runtime/syntax/tap.vim @petdance
runtime/syntax/tcsh.vim @dkearns
runtime/syntax/tera.vim @MuntasirSZN
runtime/syntax/teraterm.vim @k-takata
runtime/syntax/terraform.vim @gpanders
runtime/syntax/thrift.vim @jiangyinzuo
+22 -391
View File
@@ -1,5 +1,7 @@
name: MacVim GitHub CI
# Main CI workflow for MacVim. Will build and test MacVim on different platforms.
on:
push:
pull_request:
@@ -11,60 +13,21 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
MACOSX_DEPLOYMENT_TARGET_LEGACY: '10.9'
MACVIM_ARCHS: "x86_64 arm64" # Universal app for Intel/Apple Silicon
MACVIM_ARCHS_LEGACY: "x86_64" # Legacy builds only need to build x86-64 because Apple Silicon can't run on these old OSes
CC: clang
MAKE_BUILD_ARGS: LINK_AS_NEEDED=yes # In macOS we never over-specify link dependencies and we already check against external deps in smoketest. With LTO, linking takes a while, so we want to avoid using link.sh.
VERSIONER_PERL_VERSION: '5.34' # macOS default Perl installation uses this to determine which one to use
vi_cv_path_python: /Library/Frameworks/Python.framework/Versions/2.7/bin/python
vi_cv_path_python3: "%s/bin/python3"
vi_cv_path_plain_lua: "%s/bin/lua"
vi_cv_path_ruby: "%s/opt/ruby/bin/ruby"
vi_cv_dll_name_perl: /System/Library/Perl/%s/darwin-thread-multi-2level/CORE/libperl.dylib
vi_cv_dll_name_python: /Library/Frameworks/Python.framework/Versions/2.7/Python
vi_cv_dll_name_python3: /usr/local/Frameworks/Python.framework/Versions/Current/Python
vi_cv_dll_name_python3_arm64: /opt/homebrew/Frameworks/Python.framework/Versions/Current/Python
vi_cv_dll_name_ruby: /usr/local/opt/ruby/lib/libruby.dylib
vi_cv_dll_name_ruby_arm64: /opt/homebrew/opt/ruby/lib/libruby.dylib
vi_cv_dll_name_lua: /usr/local/lib/liblua.dylib
vi_cv_dll_name_lua_arm64: /opt/homebrew/lib/liblua.dylib
MACVIM_APP: src/MacVim/build/Release/MacVim.app
VIM_BIN: src/MacVim/build/Release/MacVim.app/Contents/MacOS/Vim
MACVIM_BIN: src/MacVim/build/Release/MacVim.app/Contents/MacOS/MacVim
TERM: xterm
BASH_SILENCE_DEPRECATION_WARNING: 1
jobs:
# Builds and test MacVim
build-and-test:
# Test on macOS 11.x / 12.x, and also older versions of Xcode for compatibility testing.
strategy:
fail-fast: false
matrix:
include:
# # Oldest version of Xcode supported on GitHub Action to test source code backwards compatibility
# # This version of Xcode can run on macOS 11 where as 13.3 has to run on macOS 12.
# - os: macos-12
# xcode: '13.2.1'
# extra: [vimtags, check-xcodeproj-compat]
#
# # Older version of Xcode, and used to publish legacy builds (for macOS 10.9 - 10.12)
# - os: macos-12
# xcode: '14.0' # last version of Xcode that uses the macOS 12 SDK, which still supports deploying to macOS 10.9
# publish: true
# legacy: true
# publish_postfix: '_10.9'
# Self-hosted runner with old enough software (Xcode 14.0.1) to be
# able to make legacy builds. We only run this when making a full
# release build.
- os: macos-13-xcode14-self-hosted
publish: true
publish_postfix: '_10.9'
skip: ${{ ! startswith(github.ref, 'refs/tags/release') }}
legacy: true
- os: macos-13
xcode: '15.2'
@@ -75,7 +38,6 @@ jobs:
- os: macos-14
xcode: '15.4'
testgui: false
optimized: true
# Most up to date OS and Xcode. Used to publish release for the main build.
- os: macos-15
@@ -84,346 +46,15 @@ jobs:
publish: true
optimized: true
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up legacy build
if: matrix.legacy
run: |
# Set the correct build env vars to target the correct architectures and min OS targets.
echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET_LEGACY" >> $GITHUB_ENV
echo "MACVIM_ARCHS=$MACVIM_ARCHS_LEGACY" >> $GITHUB_ENV
# Use Sparkle 1 because Sparkle 2 requires newer OS version than our legacy build.
# Later, we pass the --enable-sparkle_1 flag to configure to set the corresponding ifdef.
ln -fhs Sparkle_1.framework src/MacVim/Sparkle.framework
# Sparkle shows a dialog asking if the user wants to check for updates on 2nd launch of
# MacVim. On Sparkle 1 this is annoyingly a modal dialog box and interferes with tests.
# Just disable it by pre-setting to not check for updates.
defaults write org.vim.MacVim SUEnableAutomaticChecks 0
- name: Set up Xcode
if: matrix.xcode != ''
run: |
sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
xcode-select -p
xcodebuild -version
# Set up, install, and cache gettext library for localization.
#
- name: Set up gettext
if: matrix.publish
uses: ./.github/actions/universal-package
with:
formula: gettext
contents: lib/libintl.a,lib/libintl.dylib
# Set up, install, and cache libsodium library for encryption.
- name: Set up libsodium
if: matrix.publish
uses: ./.github/actions/universal-package
with:
formula: libsodium
contents: lib/libsodium.a,lib/libsodium.dylib
# Set up remaining packages and tools
- name: Install packages
run: |
brew install --quiet libtool
- name: Install packages for testing
run: |
# Apple diff is broken. Use GNU diff instead. See http://github.com/vim/vim/issues/14056.
brew install --quiet diffutils
- name: Grant microphone access for macos-14
if: matrix.os == 'macos-14'
run: |
# Temporary fix to fix microphone permission issues for macos-14 when playing sound.
sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR IGNORE INTO access VALUES ('kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159,NULL,NULL,'UNUSED',1687786159);"
- name: Install scripting runtimes
if: matrix.publish
run: |
# We no longer need to install/update Python 3, as it's guaranteed to
# be installed on runners. Since we use stable ABI, the exact version
# on CI does not matter.
brew install --quiet ruby
brew install --quiet lua
if [[ -d $(brew --prefix)/Cellar/perl ]]; then
# We just use system perl to reduce dependencies
brew unlink perl
fi
echo "vi_cv_path_python3=$(printf $vi_cv_path_python3 $(brew --prefix))" >> $GITHUB_ENV
echo "vi_cv_path_plain_lua=$(printf $vi_cv_path_plain_lua $(brew --prefix))" >> $GITHUB_ENV
echo "vi_cv_path_ruby=$(printf $vi_cv_path_ruby $(brew --prefix))" >> $GITHUB_ENV
# With Perl, we need to manually specify the version number because the dylib path depends on it.
echo "vi_cv_dll_name_perl=$(printf $vi_cv_dll_name_perl $VERSIONER_PERL_VERSION)" >> $GITHUB_ENV
# New runner images (macos-13) no longer have Python2 installed. We
# need to install Python2 manually. Installing from the official
# installer is the easiest way as Homebrew no longer ships python@2
# and this way does not invole manual building from source. We
# mostly only need the headers to build a dynamic build anyway.
#
# This will be removed in the future as Python2 has been completely
# unsupported for years.
curl https://www.python.org/ftp/python/2.7.18/python-2.7.18-macosx10.9.pkg -o ~/Downloads/python-2.7.18-macosx10.9.pkg
sudo installer -pkg ~/Downloads/python-2.7.18-macosx10.9.pkg -target /
# All set up steps are done. Build and test MacVim below.
- name: Configure
run: |
set -o verbose
CONFOPT=(
--with-local-dir=$(brew --prefix)
--with-features=huge
--enable-netbeans
--with-tlib=ncurses
--enable-cscope
--enable-gui=macvim
--with-compiledby="GitHub Actions"
)
if ${{ matrix.publish == true }}; then
CONFOPT+=(
--enable-perlinterp=dynamic
--enable-pythoninterp=dynamic
--enable-python3interp=dynamic
--with-python3-stable-abi=3.9 # macOS and Xcode currently ships 3.9, so we don't want go higher than that.
--enable-rubyinterp=dynamic
--enable-luainterp=dynamic
--with-lua-prefix=$(brew --prefix)
--with-macarchs="$MACVIM_ARCHS"
)
else
CONFOPT+=(
--disable-sparkle # Disable Sparkle for testing that this flag builds and works
--enable-nls=no --enable-libsodium=no # Disable gettext and libsodium unless we built them ourselves for publish
)
fi
if ${{ matrix.legacy == true }}; then
CONFOPT+=(
--enable-sparkle_1
)
fi
echo "CONFOPT: ${CONFOPT[@]}"
./configure "${CONFOPT[@]}" --enable-fail-if-missing
sed -i.bak -f ci/config.mk.sed -f ci/config.mk.clang.sed -f ci/config.mk.xcode.sed src/auto/config.mk
if clang --version | grep -qs '^Apple clang version \(1[3-9]\|[2-9]\d\)\.'; then
sed -i.bak -f ci/config.mk.clang-12.sed src/auto/config.mk
fi
if ${{ matrix.optimized == true }}; then
# Additional optimizations like link-time optimizations that are a bit slower to build.
sed -i.bak -f ci/config.mk.optimized.sed src/auto/config.mk
fi
- name: Modify configure result
if: matrix.publish
run: |
# Ruby is keg-only in Homebrew, so need to manually link in the path so Vim will know where to look for the binaries.
perl -p -i -e "s#(?<=-DDYNAMIC_RUBY_DLL=\\\\\").*?(?=\\\\\")#${vi_cv_dll_name_ruby}#" src/auto/config.mk
grep -q -- "-DDYNAMIC_PERL_DLL=\\\\\"${vi_cv_dll_name_perl}\\\\\"" src/auto/config.mk
grep -q -- "-DDYNAMIC_PYTHON_DLL=\\\\\"${vi_cv_dll_name_python}\\\\\"" src/auto/config.mk
grep -q -- "-DDYNAMIC_PYTHON3_DLL=\\\\\"${vi_cv_dll_name_python3}\\\\\"" src/auto/config.mk
grep -q -- "-DDYNAMIC_RUBY_DLL=\\\\\"${vi_cv_dll_name_ruby}\\\\\"" src/auto/config.mk
# Also search for the arm64 overrides for the default library locations, which are different from x86_64
# because Homebrew puts them at a different place.
grep -q -- "-DDYNAMIC_PYTHON3_DLL_ARM64=\\\\\"${vi_cv_dll_name_python3_arm64}\\\\\"" src/auto/config.mk
grep -q -- "-DDYNAMIC_RUBY_DLL_ARM64=\\\\\"${vi_cv_dll_name_ruby_arm64}\\\\\"" src/auto/config.mk
grep -q -- "-DDYNAMIC_LUA_DLL_ARM64=\\\\\"${vi_cv_dll_name_lua_arm64}\\\\\"" src/auto/config.mk
- name: Show configure output
run: |
cat src/auto/config.mk
cat src/auto/config.h
- name: Build
env:
LC_ALL: C
run: |
NPROC=$(getconf _NPROCESSORS_ONLN)
echo "Building MacVim with ${NPROC} cores"
set -o verbose
make ${MAKE_BUILD_ARGS} -j${NPROC}
- name: Check version
run: |
${VIM_BIN} --version
${VIM_BIN} -u NONE -i NONE --not-a-term -esNX -V1 -c 'echo "\nprof_nsec:" .. has("prof_nsec") .. "\n"' -c quit
${VIM_BIN} -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
${VIM_BIN} -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
- name: Smoketest
run: |
set -o verbose
# Make sure there isn't any dynamic linkage to third-party dependencies in the built binary, as we should only use
# static linkage to avoid dependency hell. Test that all those dylib's are in /usr/lib which is bundled with macOS and not third-party.
if otool -L ${VIM_BIN} | grep '\.dylib\s' | grep -v '^\s*/usr/lib/'; then
echo 'Found external dynamic linkage!'; false
fi
# Make sure that --disable-sparkle flag will properly exclude all references to Sparkle symbols. This is
# necessary because we still use weak linking to Sparkle when that flag is set and so references to Sparkle
# wouldn't fail the build (we just remove Sparkle.framework from the built app after the fact).
if ${{ matrix.publish == false }}; then
# Currently we pass --disable-sparkle flag when publish==false
if objdump -t ${MACVIM_BIN} | grep "_SPU\|_SUUpdate"; then
echo 'Found references to Sparkle even when using --disable-sparkle'; false
fi
fi
# Make sure man pages were bundled
man -M `pwd`/${MACVIM_APP}/Contents/man -w mvim
# Make sure xxd was bundled
echo "AB" | ${MACVIM_APP}/Contents/bin/xxd | grep "4142"
- name: Smoketest (publish)
if: matrix.publish
run: |
set -o verbose
macvim_excmd() {
${VIM_BIN} -u NONE -i NONE -g -f -X -V1 -es "$@" -c 'echo ""' -c 'qall!' 2>&1
}
# Smoketest scripting languages
macvim_excmd -c 'lua print("Test")' | grep Test
macvim_excmd -c 'perl VIM::Msg("Test")' | grep Test
macvim_excmd -c 'py3 print("Test")' | grep Test
macvim_excmd -c 'ruby puts("Test")' | grep Test
if [[ "$(uname -m)" == "x86_64" ]]; then
macvim_excmd -c 'py print "x86 Test"' | grep Test
else
# Python2 doesn't work in Apple Silicon, test under Rosetta
(VIM_BIN="arch -x86_64 ${VIM_BIN}"; macvim_excmd -c 'py print "rosetta Test"' | grep Test)
fi
# Check that localized messages work by printing ':version' and checking against localized word
macvim_excmd -c 'lang es_ES' -c 'version' | grep Enlazado
# Check that libsodium is working
macvim_excmd -c 'set cryptmethod=xchacha20v2'
# Make sure we are building universal x86_64 / arm64 builds and didn't accidentally create a thin app.
check_arch() {
local archs=($(lipo -archs "$1"))
if [[ ${archs[@]} != "$MACVIM_ARCHS" ]]; then
echo "Wrong arch(s) in $1: ${archs[@]}"; false
else
lipo -info "$1"
fi
}
check_arch "${VIM_BIN}"
check_arch "${MACVIM_BIN}"
- name: Check Vim help tags
if: contains(matrix.extra, 'vimtags')
run: |
# Confirm that we can build the help tags, and they match what's in source.
make -C runtime/doc vimtags VIMEXE=../../${VIM_BIN}
git diff --exit-code -- runtime/doc/tags
- name: Check Xcode project compatibility version
if: contains(matrix.extra, 'check-xcodeproj-compat')
run: |
# Confirm that the compatibility version of xcodeproj is correct and not outdated.
rm -rf src/MacVim/MacVim_xcode8.xcodeproj
make -C src macvim-xcodeproj-compat
if ! git diff --exit-code -- src/MacVim/MacVim_xcode8.xcodeproj; then
echo 'MacVim_xcode8.xcodeproj is outdated. Run "make -C src macvim-xcodeproj-compat" to re-generate it.'; false
fi
- name: Test MacVim
id: test_macvim
timeout-minutes: 10
run: |
make ${MAKE_BUILD_ARGS} -C src macvim-tests
- name: Upload failed MacVim test results
if: ${{ !cancelled() && failure() && steps.test_macvim.conclusion == 'failure' }}
uses: ./.github/actions/test_macvim_artifacts
- name: Build Vim test binaries
run: |
# Build the unit test binaries first. With link-time-optimization they take some time to link. Running them
# separately de-couples them from the timeout in tests, and allow us to build in parallel jobs (since tests
# can't run in parallel).
NPROC=$(getconf _NPROCESSORS_ONLN)
set -o verbose
make ${MAKE_BUILD_ARGS} -j${NPROC} -C src unittesttargets
- name: Test Vim
if: startsWith(github.ref, 'refs/tags/') || !matrix.testgui
timeout-minutes: 30
run: |
defaults delete org.vim.MacVim # Clean up stale states
# Currently we don't run any non-src tests, as syntax tests are fragile and prone to spamming escape codes.
# This needs to be investigated and fixed upstream.
# MacVim is unlikely to introduce breaking changes in runtime files anyway.
make ${MAKE_BUILD_ARGS} -C src test
- name: Test Vim (GUI)
if: startsWith(github.ref, 'refs/tags/') || matrix.testgui
timeout-minutes: 30
run: |
defaults delete org.vim.MacVim # Clean up stale states
make ${MAKE_BUILD_ARGS} -C src/testdir clean
make ${MAKE_BUILD_ARGS} -C src testgui
- name: Upload failed test files
if: ${{ !cancelled() && failure() }}
uses: ./.github/actions/test_artifacts
- name: Build MacVim dmg image
if: matrix.publish && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master')
run: |
# Use the --skip-jenkins flag to skip the prettify osascript calls which could fail due to permission issues in
# CI environment.
if ${{ matrix.legacy == true }}; then
make -C src macvim-dmg-legacy
else
make -C src macvim-dmg
fi
if ${{ matrix.publish_postfix != '' }}; then
mv src/MacVim/build/Release/MacVim.dmg src/MacVim/build/Release/MacVim${{ matrix.publish_postfix }}.dmg
fi
# Upload the dmg installer only when making tagged release or making a dev build from a master branch.
# Note that this doesn't create a GitHub release for us, because we would prefer to do it manually, for two
# reasons: 1) signing / notarization are currently done out of CI, 2) we want to manually format our release notes
# and add pictures to make them look nice.
- name: Upload MacVim image
if: matrix.publish && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master')
uses: actions/upload-artifact@v4
with:
name: MacVim${{ matrix.publish_postfix }}.dmg
path: src/MacVim/build/Release/MacVim${{ matrix.publish_postfix }}.dmg
# If doing a tagged release, use repository-specified number of retention days (usually 90 days) to make it
# easier to audit. (specify "0" to indicate using repository settings)
#
# Otherwise, we are just doing a dev build for potential testing, just use a maximum of 21 days as we don't
# tend to need these for long.
retention-days: ${{ startsWith(github.ref, 'refs/tags/') && 0 || (github.retention_days > 21 && 21 || 0) }}
uses: ./.github/workflows/macvim-buildtest.yaml
with:
skip: ${{ matrix.skip && true || false }}
os: ${{ matrix.os }}
legacy: ${{ matrix.legacy && true || false }}
xcode: ${{ matrix.xcode }}
testgui: ${{ matrix.testgui && true || false }}
publish: ${{ matrix.publish && true || false }}
publish_postfix: ${{ matrix.publish_postfix }}
optimized: ${{ matrix.optimized && true || false }}
vimtags: ${{ contains(matrix.extra, 'vimtags') }}
check-xcodeproj-compat: ${{ contains(matrix.extra, 'check-xcodeproj-compat') }}
+418
View File
@@ -0,0 +1,418 @@
name: MacVim Build and Test
# Child workflow to be called by other workflows for building/testing MacVim
on:
workflow_call:
inputs:
skip:
type: boolean
os:
type: string
legacy:
type: boolean
xcode:
type: string
testgui:
type: boolean
publish:
type: boolean
publish_postfix:
type: string
optimized:
type: boolean
vimtags:
type: boolean
check-xcodeproj-compat:
type: boolean
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
MACOSX_DEPLOYMENT_TARGET_LEGACY: '10.9'
MACVIM_ARCHS: "x86_64 arm64" # Universal app for Intel/Apple Silicon
MACVIM_ARCHS_LEGACY: "x86_64 arm64" # Build universal for legacy too, mostly just to make building/testing on Apple Silicon CI work. In reality all Apple Silicon Macs shoud use non-legacy.
CC: clang
MAKE_BUILD_ARGS: LINK_AS_NEEDED=yes # In macOS we never over-specify link dependencies and we already check against external deps in smoketest. With LTO, linking takes a while, so we want to avoid using link.sh.
vi_cv_path_python: /Library/Frameworks/Python.framework/Versions/2.7/bin/python
vi_cv_path_python3: "%s/bin/python3"
vi_cv_path_plain_lua: "%s/bin/lua"
vi_cv_path_ruby: "%s/opt/ruby/bin/ruby"
vi_cv_dll_name_perl: /System/Library/Perl/%s/darwin-thread-multi-2level/CORE/libperl.dylib
vi_cv_dll_name_python: /Library/Frameworks/Python.framework/Versions/2.7/Python
vi_cv_dll_name_python3: /usr/local/Frameworks/Python.framework/Versions/Current/Python
vi_cv_dll_name_python3_arm64: /opt/homebrew/Frameworks/Python.framework/Versions/Current/Python
vi_cv_dll_name_ruby: /usr/local/opt/ruby/lib/libruby.dylib
vi_cv_dll_name_ruby_arm64: /opt/homebrew/opt/ruby/lib/libruby.dylib
vi_cv_dll_name_lua: /usr/local/lib/liblua.dylib
vi_cv_dll_name_lua_arm64: /opt/homebrew/lib/liblua.dylib
MACVIM_APP: src/MacVim/build/Release/MacVim.app
VIM_BIN: src/MacVim/build/Release/MacVim.app/Contents/MacOS/Vim
MACVIM_BIN: src/MacVim/build/Release/MacVim.app/Contents/MacOS/MacVim
TERM: xterm
BASH_SILENCE_DEPRECATION_WARNING: 1
jobs:
# Builds and test MacVim
build-and-test:
if: ${{ !inputs.skip }}
runs-on: ${{ inputs.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up legacy build
if: inputs.legacy
run: |
# Set the correct build env vars to target the correct architectures and min OS targets.
echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET_LEGACY" >> $GITHUB_ENV
echo "MACVIM_ARCHS=$MACVIM_ARCHS_LEGACY" >> $GITHUB_ENV
# Use Sparkle 1 because Sparkle 2 requires newer OS version than our legacy build.
# Later, we pass the --enable-sparkle_1 flag to configure to set the corresponding ifdef.
ln -fhs Sparkle_1.framework src/MacVim/Sparkle.framework
# Sparkle shows a dialog asking if the user wants to check for updates on 2nd launch of
# MacVim. On Sparkle 1 this is annoyingly a modal dialog box and interferes with tests.
# Just disable it by pre-setting to not check for updates.
defaults write org.vim.MacVim SUEnableAutomaticChecks 0
- name: Set up Xcode
if: inputs.xcode != ''
run: |
sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode }}.app/Contents/Developer
xcode-select -p
xcodebuild -version
# Set up, install, and cache gettext library for localization.
- name: Set up gettext
if: inputs.publish
uses: ./.github/actions/universal-package
with:
formula: gettext
contents: lib/libintl.a,lib/libintl.dylib
# Set up, install, and cache libsodium library for encryption.
- name: Set up libsodium
if: inputs.publish
uses: ./.github/actions/universal-package
with:
formula: libsodium
contents: lib/libsodium.a,lib/libsodium.dylib
# Set up remaining packages and tools
- name: Install packages
run: |
brew install --quiet libtool
- name: Install packages for testing
run: |
# Apple diff is broken. Use GNU diff instead. See http://github.com/vim/vim/issues/14056.
brew install --quiet diffutils
# Cache Python 2 to avoid downloading the installer every time. This cache shouldn't change
# over time as Python 2.7 is legacy. Can't directly cache to
# /Library/Frameworks/Python.framework due to permission issues.
#
# Note: Legacy self-hosted runner already has this installed and doesn't need this.
- name: Cache Python 2
if: inputs.publish && !inputs.legacy
uses: actions/cache@v4
with:
path: python27-cache
key: ${{ inputs.os }}-python27
- name: Install scripting runtimes
if: inputs.publish
run: |
# We no longer need to install/update Python 3, as it's guaranteed to
# be installed on runners. Since we use stable ABI, the exact version
# on CI does not matter.
brew install --quiet ruby
brew install --quiet lua
if [[ -d $(brew --prefix)/Cellar/perl ]]; then
# We just use system perl to reduce dependencies
brew unlink perl
fi
echo "vi_cv_path_python3=$(printf $vi_cv_path_python3 $(brew --prefix))" >> $GITHUB_ENV
echo "vi_cv_path_plain_lua=$(printf $vi_cv_path_plain_lua $(brew --prefix))" >> $GITHUB_ENV
echo "vi_cv_path_ruby=$(printf $vi_cv_path_ruby $(brew --prefix))" >> $GITHUB_ENV
# With Perl, we need to manually specify the version number because the dylib path depends on it.
export PERL_VERSION=$(perl -e 'print $^V =~ s/v(\d\.\d+).*/\1/r')
echo "vi_cv_dll_name_perl=$(printf $vi_cv_dll_name_perl $PERL_VERSION)" >> $GITHUB_ENV
# New runner images (macos-13) no longer have Python2 installed. We
# need to install Python2 manually. Installing from the official
# installer is the easiest way as Homebrew no longer ships python@2
# and this way does not invole manual building from source. We
# mostly only need the headers to build a dynamic build anyway.
#
# This will be removed in the future as Python2 has been completely
# unsupported for years.
if [ -d /Library/Frameworks/Python.framework/Versions/2.7 ]; then
echo "Python 2.7 already installed"
elif [ -d python27-cache ]; then
sudo cp -R python27-cache /Library/Frameworks/Python.framework/Versions/2.7
else
curl https://www.python.org/ftp/python/2.7.18/python-2.7.18-macosx10.9.pkg -o ~/Downloads/python-2.7.18-macosx10.9.pkg
sudo installer -pkg ~/Downloads/python-2.7.18-macosx10.9.pkg -target /
cp -R /Library/Frameworks/Python.framework/Versions/2.7 python27-cache # Allow this to be cached
fi
# All set up steps are done. Build and test MacVim below.
- name: Configure
run: |
set -o verbose
CONFOPT=(
--with-local-dir=$(brew --prefix)
--with-features=huge
--enable-netbeans
--with-tlib=ncurses
--enable-cscope
--enable-gui=macvim
--with-compiledby="GitHub Actions"
)
if ${{ inputs.publish == true }}; then
CONFOPT+=(
--enable-perlinterp=dynamic
--enable-pythoninterp=dynamic
--enable-python3interp=dynamic
--with-python3-stable-abi=3.9 # macOS and Xcode currently ships 3.9, so we don't want go higher than that.
--enable-rubyinterp=dynamic
--enable-luainterp=dynamic
--with-lua-prefix=$(brew --prefix)
--with-macarchs="$MACVIM_ARCHS"
)
else
CONFOPT+=(
--disable-sparkle # Disable Sparkle for testing that this flag builds and works
--enable-nls=no --enable-libsodium=no # Disable gettext and libsodium unless we built them ourselves for publish
)
fi
if ${{ inputs.legacy == true }}; then
CONFOPT+=(
--enable-sparkle_1
)
fi
echo "CONFOPT: ${CONFOPT[@]}"
./configure "${CONFOPT[@]}" --enable-fail-if-missing
sed -i.bak -f ci/config.mk.sed -f ci/config.mk.clang.sed -f ci/config.mk.xcode.sed src/auto/config.mk
if clang --version | grep -qs '^Apple clang version \(1[3-9]\|[2-9]\d\)\.'; then
sed -i.bak -f ci/config.mk.clang-12.sed src/auto/config.mk
fi
if ${{ inputs.optimized == true }}; then
# Additional optimizations like link-time optimizations that are a bit slower to build.
sed -i.bak -f ci/config.mk.optimized.sed src/auto/config.mk
fi
- name: Modify configure result
if: inputs.publish
run: |
set -o verbose
# Ruby is keg-only in Homebrew, so need to manually link in the path so Vim will know where to look for the binaries.
perl -p -i -e "s#(?<=-DDYNAMIC_RUBY_DLL=\\\\\").*?(?=\\\\\")#${vi_cv_dll_name_ruby}#" src/auto/config.mk
grep -q -- "-DDYNAMIC_PERL_DLL=\\\\\"${vi_cv_dll_name_perl}\\\\\"" src/auto/config.mk
grep -q -- "-DDYNAMIC_PYTHON_DLL=\\\\\"${vi_cv_dll_name_python}\\\\\"" src/auto/config.mk
grep -q -- "-DDYNAMIC_PYTHON3_DLL=\\\\\"${vi_cv_dll_name_python3}\\\\\"" src/auto/config.mk
grep -q -- "-DDYNAMIC_RUBY_DLL=\\\\\"${vi_cv_dll_name_ruby}\\\\\"" src/auto/config.mk
# Also search for the arm64 overrides for the default library locations, which are different from x86_64
# because Homebrew puts them at a different place.
grep -q -- "-DDYNAMIC_PYTHON3_DLL_ARM64=\\\\\"${vi_cv_dll_name_python3_arm64}\\\\\"" src/auto/config.mk
grep -q -- "-DDYNAMIC_RUBY_DLL_ARM64=\\\\\"${vi_cv_dll_name_ruby_arm64}\\\\\"" src/auto/config.mk
grep -q -- "-DDYNAMIC_LUA_DLL_ARM64=\\\\\"${vi_cv_dll_name_lua_arm64}\\\\\"" src/auto/config.mk
- name: Show configure output
run: |
cat src/auto/config.mk
cat src/auto/config.h
- name: Build
env:
LC_ALL: C
run: |
NPROC=$(getconf _NPROCESSORS_ONLN)
echo "Building MacVim with ${NPROC} cores"
set -o verbose
make ${MAKE_BUILD_ARGS} -j${NPROC}
- name: Check version
run: |
${VIM_BIN} --version
${VIM_BIN} -u NONE -i NONE --not-a-term -esNX -V1 -c 'echo "\nprof_nsec:" .. has("prof_nsec") .. "\n"' -c quit
${VIM_BIN} -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
${VIM_BIN} -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
- name: Smoketest
run: |
set -o verbose
# Make sure there isn't any dynamic linkage to third-party dependencies in the built binary, as we should only use
# static linkage to avoid dependency hell. Test that all those dylib's are in /usr/lib which is bundled with macOS and not third-party.
if otool -L ${VIM_BIN} | grep '\.dylib\s' | grep -v '^\s*/usr/lib/'; then
echo 'Found external dynamic linkage!'; false
fi
# Make sure that --disable-sparkle flag will properly exclude all references to Sparkle symbols. This is
# necessary because we still use weak linking to Sparkle when that flag is set and so references to Sparkle
# wouldn't fail the build (we just remove Sparkle.framework from the built app after the fact).
if ${{ inputs.publish == false }}; then
# Currently we pass --disable-sparkle flag when publish==false
if objdump -t ${MACVIM_BIN} | grep "_SPU\|_SUUpdate"; then
echo 'Found references to Sparkle even when using --disable-sparkle'; false
fi
fi
# Make sure man pages were bundled
man -M `pwd`/${MACVIM_APP}/Contents/man -w mvim
# Make sure xxd was bundled
echo "AB" | ${MACVIM_APP}/Contents/bin/xxd | grep "4142"
- name: Smoketest (publish)
if: inputs.publish
run: |
set -o verbose
macvim_excmd() {
${VIM_BIN} -u NONE -i NONE -g -f -X -V1 -es "$@" -c 'echo ""' -c 'qall!' 2>&1
}
# Smoketest scripting languages
macvim_excmd -c 'lua print("Test")' | grep Test
macvim_excmd -c 'perl VIM::Msg("Test")' | grep Test
macvim_excmd -c 'py3 print("Test")' | grep Test
macvim_excmd -c 'ruby puts("Test")' | grep Test
if [[ "$(uname -m)" == "x86_64" ]]; then
macvim_excmd -c 'py print "x86 Test"' | grep Test
else
# Python2 doesn't work in Apple Silicon, test under Rosetta
(VIM_BIN="arch -x86_64 ${VIM_BIN}"; macvim_excmd -c 'py print "rosetta Test"' | grep Test)
fi
# Check that localized messages work by printing ':version' and checking against localized word
macvim_excmd -c 'lang es_ES' -c 'version' | grep Enlazado
# Check that libsodium is working
macvim_excmd -c 'set cryptmethod=xchacha20v2'
# Make sure we are building universal x86_64 / arm64 builds and didn't accidentally create a thin app.
check_arch() {
local archs=($(lipo -archs "$1"))
if [[ ${archs[@]} != "$MACVIM_ARCHS" ]]; then
echo "Wrong arch(s) in $1: ${archs[@]}"; false
else
lipo -info "$1"
fi
}
check_arch "${VIM_BIN}"
check_arch "${MACVIM_BIN}"
- name: Check Vim help tags
if: inputs.vimtags
run: |
# Confirm that we can build the help tags, and they match what's in source.
make -C runtime/doc vimtags VIMEXE=../../${VIM_BIN}
git diff --exit-code -- runtime/doc/tags
- name: Check Xcode project compatibility version
if: inputs['check-xcodeproj-compat']
run: |
# Confirm that the compatibility version of xcodeproj is correct and not outdated.
rm -rf src/MacVim/MacVim_xcode8.xcodeproj
make -C src macvim-xcodeproj-compat
if ! git diff --exit-code -- src/MacVim/MacVim_xcode8.xcodeproj; then
echo 'MacVim_xcode8.xcodeproj is outdated. Run "make -C src macvim-xcodeproj-compat" to re-generate it.'; false
fi
- name: Test MacVim
id: test_macvim
timeout-minutes: 10
run: |
make ${MAKE_BUILD_ARGS} -C src macvim-tests
- name: Upload failed MacVim test results
if: ${{ !cancelled() && failure() && steps.test_macvim.conclusion == 'failure' }}
uses: ./.github/actions/test_macvim_artifacts
- name: Build Vim test binaries
run: |
# Build the unit test binaries first. With link-time-optimization they take some time to link. Running them
# separately de-couples them from the timeout in tests, and allow us to build in parallel jobs (since tests
# can't run in parallel).
NPROC=$(getconf _NPROCESSORS_ONLN)
set -o verbose
make ${MAKE_BUILD_ARGS} -j${NPROC} -C src unittesttargets
- name: Test Vim
if: startsWith(github.ref, 'refs/tags/') || !inputs.testgui
timeout-minutes: 30
run: |
defaults delete org.vim.MacVim # Clean up stale states
# Currently we don't run any non-src tests, as syntax tests are fragile and prone to spamming escape codes.
# This needs to be investigated and fixed upstream.
# MacVim is unlikely to introduce breaking changes in runtime files anyway.
make ${MAKE_BUILD_ARGS} -C src test
- name: Test Vim (GUI)
if: startsWith(github.ref, 'refs/tags/') || inputs.testgui
timeout-minutes: 30
run: |
defaults delete org.vim.MacVim # Clean up stale states
make ${MAKE_BUILD_ARGS} -C src/testdir clean
make ${MAKE_BUILD_ARGS} -C src testgui
- name: Upload failed test files
if: ${{ !cancelled() && failure() }}
uses: ./.github/actions/test_artifacts
- name: Build MacVim dmg image
if: inputs.publish && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master')
run: |
if ${{ inputs.legacy == true }}; then
make -C src macvim-dmg-legacy
else
make -C src macvim-dmg
fi
if ${{ inputs.publish_postfix != '' }}; then
mv src/MacVim/build/Release/MacVim.dmg src/MacVim/build/Release/MacVim${{ inputs.publish_postfix }}.dmg
fi
# Upload the dmg installer only when making tagged release or making a dev build from a master branch.
# Note that this doesn't create a GitHub release for us, because we would prefer to do it manually, for two
# reasons: 1) signing / notarization are currently done out of CI, 2) we want to manually format our release notes
# and add pictures to make them look nice.
- name: Upload MacVim image
if: inputs.publish && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master')
uses: actions/upload-artifact@v4
with:
name: MacVim${{ inputs.publish_postfix }}.dmg
path: src/MacVim/build/Release/MacVim${{ inputs.publish_postfix }}.dmg
# If doing a tagged release, use repository-specified number of retention days (usually 90 days) to make it
# easier to audit. (specify "0" to indicate using repository settings)
#
# Otherwise, we are just doing a dev build for potential testing, just use a maximum of 21 days as we don't
# tend to need these for long.
retention-days: ${{ startsWith(github.ref, 'refs/tags/') && 0 || (github.retention_days > 21 && 21 || 0) }}
+5
View File
@@ -148,6 +148,11 @@ src/xxd/xxd
src/xxd/xxd.dSYM
src/a.out.dSYM
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-*
+15 -3
View File
@@ -98,21 +98,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
+26
View File
@@ -21,6 +21,31 @@ 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.
## 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
@@ -113,3 +138,4 @@ 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
+26 -4
View File
@@ -157,6 +157,7 @@ SRC_ALL = \
src/textobject.c \
src/textprop.c \
src/time.c \
src/tuple.c \
src/typval.c \
src/ui.c \
src/undo.c \
@@ -223,6 +224,7 @@ SRC_ALL = \
src/testdir/samples/*.html \
src/testdir/samples/*.txt \
src/testdir/samples/*.vim \
src/testdir/samples/poc.zip \
src/testdir/samples/test000 \
src/testdir/samples/test.zip \
src/testdir/samples/test_undo.txt.undo \
@@ -231,6 +233,8 @@ SRC_ALL = \
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/proto.h \
src/protodef.h \
@@ -336,6 +340,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 \
@@ -769,14 +774,16 @@ RT_ALL = \
runtime/tools/[a-z]*[a-z0-9] \
runtime/tutor/README.txt \
runtime/tutor/tutor1 \
runtime/tutor/tutor1.utf-8 \
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/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 \
runtime/tutor/tutor2 \
runtime/tutor/tutor2.utf-8 \
runtime/vimrc_example.vim \
runtime/pack/dist/opt/cfilter/plugin/cfilter.vim \
runtime/pack/dist/opt/comment/plugin/comment.vim \
@@ -800,6 +807,7 @@ RT_ALL = \
runtime/pack/dist/opt/editorconfig/plugin/editorconfig.vim \
runtime/pack/dist/opt/helptoc/autoload/helptoc.vim \
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 \
@@ -812,6 +820,9 @@ RT_ALL = \
runtime/pack/dist/opt/netrw/LICENSE.txt \
runtime/pack/dist/opt/netrw/README.md \
runtime/pack/dist/opt/netrw/autoload/netrw.vim \
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 \
@@ -871,6 +882,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 \
@@ -1069,7 +1081,16 @@ LANG_GEN = \
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 \
@@ -1082,7 +1103,6 @@ LANG_GEN = \
runtime/tutor/tutor1.??_??.utf-8 \
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 \
@@ -1143,6 +1163,8 @@ IGNORE = \
.github/workflows/label.yml \
SECURITY.md \
ci/unlisted.make \
ci/hlgroups.make \
ci/hlgroups.ignore \
src/libvterm/CODE-MAP \
runtime/syntax/testdir/input/html_html \
+1
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 && \
+66
View File
@@ -0,0 +1,66 @@
ColorColumn
ComplMatchIns
Conceal
Cursor
CursorColumn
CursorIM
CursorLine
CursorLineNr
debugBreakpoint
debugPC
DiffAdd
DiffChange
DiffDelete
DiffText
Directory
ErrorMsg
FoldColumn
Folded
Ignore
IncSearch
lCursor
LineNr
LineNrAbove
LineNrBelow
MatchParen
Menu
ModeMsg
MoreMsg
MsgArea
NonText
Normal
Pmenu
PmenuSbar
PmenuSel
PmenuThumb
Question
Scrollbar
Search
SignColumn
SpecialKey
SpellBad
SpellCap
SpellLocal
SpellRare
StatusLine
StatusLineNC
StatusLineTerm
StatusLineTermNC
TabLine
TabLineFill
TabLineSel
Terminal
Title
TOhtmlProgress
TOhtml-progress-color
ToolbarButton
ToolbarLine
Tooltip
User1
User1..9
User9
VertSplit
Visual
VisualNOS
WarningMsg
WildMenu
+18
View File
@@ -0,0 +1,18 @@
# vim: ft=make
SHELL = /bin/bash
# Default target to actually run the comparison:
.PHONY: check
.INTERMEDIATE: hlgroups deflinks hlgroups.stripped
check: hlgroups.stripped deflinks
diff hlgroups.stripped deflinks
hlgroups:
grep '\*hl-' ../runtime/doc/*txt | sed -E -e 's/.*:<?\s*//' -e 's/hl-//g' -e 's/\*//g' -e 's/ /\n/g' | sort > hlgroups
deflinks: ../src/highlight.c
grep '"default link' $< | sed 's/.*default link\s*\(.*\)\s.*/\1/' | sort > deflinks
hlgroups.stripped: hlgroups.ignore hlgroups
grep -v -x -F -f hlgroups.ignore hlgroups > hlgroups.stripped
+1 -1
View File
@@ -21,7 +21,7 @@ $(eval all_patterns := $(shell \
p; \
}'))
# In Makefile's `prepeare` target, all the IN_README_DIR files are moved from
# In Makefile's `prepare` target, all the IN_README_DIR files are moved from
# READMEdir to the root, so add those files in their Git-tracked location:
all_patterns := $(all_patterns) \
$(foreach readme, $(IN_README_DIR), READMEdir/$(readme))
+81
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
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>
+4 -2
View File
@@ -1,6 +1,6 @@
# NSIS file to create a self-installing exe for Vim.
# It requires NSIS version 3.0 or later.
# Last Change: 2025 Jan 05
# Last Change: 2025 Feb 24
Unicode true
@@ -216,6 +216,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"
@@ -806,7 +807,8 @@ Function .onInit
ClearErrors
System::Call 'kernel32::GetUserDefaultLocaleName(t.r19, *i${NSIS_MAX_STRLEN})'
StrCmp $R9 "zh-cn" coincide 0
StrCmp $R9 "zh-tw" 0 part
StrCmp $R9 "zh-tw" coincide 0
StrCmp $R9 "pt-br" 0 part
coincide:
System::Call 'User32::CharLower(t r19 r19)*i${NSIS_MAX_STRLEN}'
${StrRep} $lng_usr "$R9" "-" "_"
+29
View File
@@ -18,6 +18,13 @@ allowable length of strings. For example:
drop-down lists on the .vimrc page - 55 characters.
Characters in this case mean characters of the English alphabet.
Once the message translation file is ready, it must be included in the
"gvim.nsi" file.
Find the line "# Include support for other languages:" in the file "gvim.nsi"
and specify the name of the file with your translation below the line
!if ${HAVE_MULTI_LANG}, similar to the entries already there. File names are
specified in alphabetical order.
If you do not yet have a translated "LICENSE" file and/or a main "README.txt"
file, set the following values:
@@ -32,3 +39,25 @@ variables similarly to what is done in the other translation files.
Translation files should be located in the "lang" subdirectory of the root
directory. The name of the files is as follows: "README.xx.txt", where xx is the
language code according to ISO639.
There are two ways to test the installer in different languages:
1. Find and uncomment the "!define MUI_LANGDLL_ALWAYSSHOW" line in the
"gvim.nsi" file and rebuild the installer.
Now every time you run it, you will see a dialog box with the possibility to
select the language of the installer.
2. If the Vim editor is already installed in your system, delete the
"Installer Language" parameter in the Windows registry under
"HKEY_CURRENT_USER\Software\Vim".
Or you can create a file "NoLangInstallerVim.reg" with the following content:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Vim]
"Installer Language"=-
and apply it by double-clicking on it.
After these steps, when you start the installer, a window with the installer
language selection will also be displayed.
+291
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)"
+5 -4
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 11
# Last Change: 2025 Jan 25
# Former Maintainer: Bram Moolenaar <Bram@vim.org>
# These functions are moved here from runtime/filetype.vim to make startup
@@ -1384,7 +1384,7 @@ export def FTdsp()
setf faust
enddef
# Set the filetype of a *.v file to Verilog, V or Cog based on the first 200
# Set the filetype of a *.v file to Verilog, V or Cog based on the first 500
# lines.
export def FTv()
if did_filetype()
@@ -1397,7 +1397,7 @@ export def FTv()
endif
var in_comment = 0
for lnum in range(1, min([line("$"), 200]))
for lnum in range(1, min([line("$"), 500]))
var line = getline(lnum)
# Skip Verilog and V comments (lines and blocks).
if line =~ '^\s*/\*'
@@ -1429,7 +1429,8 @@ export def FTv()
# Verilog: line ends with ';' followed by an optional variable number of
# spaces and an optional start of a comment.
# Example: " b <= a + 1; // Add 1".
if line =~ ';\s*\(/[/*].*\)\?$'
# Alternatively: a module is defined: " module MyModule ( input )"
if line =~ ';\s*\(/[/*].*\)\?$' || line =~ '\C^\s*module\s\+\w\+\s*('
setf verilog
return
endif
+87 -3
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
+119 -9
View File
@@ -2,19 +2,129 @@ vim9script
# Vim runtime support library
#
# Maintainer: The Vim Project <https://github.com/vim/vim>
# Last Change: 2023 Oct 25
# Maintainer: The Vim Project <https://github.com/vim/vim>
# Last Change: 2025 Jan 29
export def IsSafeExecutable(filetype: string, executable: string): bool
if empty(exepath(executable))
return v:false
if empty(exepath(executable))
return v:false
endif
var cwd = getcwd()
return get(g:, filetype .. '_exec', get(g:, 'plugin_exec', 0))
&& (fnamemodify(exepath(executable), ':p:h') !=# cwd
|| (split($PATH, has('win32') ? ';' : ':')->index(cwd) != -1
&& cwd != '.'))
enddef
def Redir(): string
if get(g:, 'netrw_suppress_gx_mesg', true)
if &srr =~# "%s"
return printf(&srr, has("win32") ? "nul" : "/dev/null")
elseif &srr =~# '>&\?$'
return &srr .. (has("win32") ? "nul" : "/dev/null")
else
return &srr .. (has("win32") ? "> nul" : "> /dev/null")
endif
var cwd = getcwd()
return get(g:, filetype .. '_exec', get(g:, 'plugin_exec', 0))
&& (fnamemodify(exepath(executable), ':p:h') !=# cwd
|| (split($PATH, has('win32') ? ';' : ':')->index(cwd) != -1
&& cwd != '.'))
endif
return ''
enddef
if has('unix')
if has('win32unix')
# Cygwin provides cygstart
if executable('cygstart')
export def Launch(args: string)
execute $'silent ! cygstart --hide {args} {Redir()}' | redraw!
enddef
elseif !empty($MSYSTEM) && executable('start')
# MSYS2/Git Bash comes by default without cygstart; see
# https://www.msys2.org/wiki/How-does-MSYS2-differ-from-Cygwin
# Instead it provides /usr/bin/start script running `cmd.exe //c start`
# Adding "" //b` sets void title, hides cmd window and blocks path conversion
# of /b to \b\ " by MSYS2; see https://www.msys2.org/docs/filesystem-paths/
export def Launch(args: string)
execute $'silent !start "" //b {args} {Redir()}' | redraw!
enddef
else
# imitate /usr/bin/start script for other environments and hope for the best
export def Launch(args: string)
execute $'silent !cmd /c start "" /b {args} {Redir()}' | redraw!
enddef
endif
elseif exists('$WSL_DISTRO_NAME') # use cmd.exe to start GUI apps in WSL
export def Launch(args: string)
const command = (args =~? '\v<\f+\.(exe|com|bat|cmd)>')
? $'cmd.exe /c start /b {args} {Redir()}'
: $'nohup {args} {Redir()} &'
execute $'silent ! {command}' | redraw!
enddef
else
export def Launch(args: string)
const fork = has('gui_running') ? '' : '&'
execute $':silent ! nohup {args} {Redir()} {fork}' | redraw!
enddef
endif
elseif has('win32')
export def Launch(args: string)
const shell = (&shell =~? '\<cmd\.exe\>') ? '' : 'cmd.exe /c'
const quotes = empty(shell) ? '' : '""'
execute $'silent ! {shell} start {quotes} /b {args} {Redir()}' | redraw!
enddef
else
export def Launch(dummy: string)
echom 'No common launcher found'
enddef
endif
var os_viewer = null_string
# Git Bash
if has('win32unix')
# (cyg)start suffices
os_viewer = ''
# Windows / WSL
elseif executable('explorer.exe')
os_viewer = 'explorer.exe'
# Linux / BSD
elseif executable('xdg-open')
os_viewer = 'xdg-open'
# MacOS
elseif executable('open')
os_viewer = 'open'
endif
def Viewer(): string
# g:Openprg could be a string of program + its arguments, test if first
# argument is executable
var user_viewer = get(g:, "Openprg", get(g:, "netrw_browsex_viewer", ""))
# Take care of an off-by-one check for "for" too
if executable(trim(user_viewer))
return user_viewer
endif
var args = split(user_viewer, '\s\+\zs')
var viewer = get(args, 0, '')
for arg in args[1 :]
if executable(trim(viewer))
return user_viewer
endif
viewer ..= arg
endfor
if os_viewer == null
echoerr "No program to open this path found. See :help Open for more information."
endif
return os_viewer
enddef
export def Open(file: string)
Launch($"{Viewer()} {shellescape(file, 1)}")
enddef
# Uncomment this line to check for compilation errors early
# defcompile
# vim: ts=8 sts=2 sw=2 et
+12 -34
View File
@@ -12,6 +12,7 @@
" 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)
" }}}
"
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
@@ -100,6 +101,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
@@ -565,73 +570,55 @@ fun! s:GetOneScript(...)
" --------------------------------------------------------------------------
" 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
@@ -648,25 +635,21 @@ fun! s:GetOneScript(...)
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 +664,8 @@ 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
" call Dredir("BUFFER TEST (GetOneScript)","ls!")
" call Dret("GetOneScript")
endfun
" ---------------------------------------------------------------------
+120 -134
View File
@@ -1,10 +1,19 @@
" tar.vim: Handles browsing tarfiles
" AUTOLOAD PORTION
" Date: Nov 11, 2024
" tar.vim: Handles browsing tarfiles - AUTOLOAD PORTION
" 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)
"
" Contains many ideas from Michael Toren's <tar.vim>
"
@@ -17,7 +26,6 @@
" By using this plugin, you agree that in no event will the
" copyright holder be liable for any damages resulting from
" the use of this software.
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" ---------------------------------------------------------------------
" Load Once: {{{1
if &cp || exists("g:loaded_tar")
@@ -32,8 +40,6 @@ if v:version < 702
endif
let s:keepcpo= &cpo
set cpo&vim
"DechoTabOn
"call Decho("loading autoload/tar.vim")
" ---------------------------------------------------------------------
" Default Settings: {{{1
@@ -96,7 +102,6 @@ if !exists("g:tar_shq")
else
let g:tar_shq= "'"
endif
" call Decho("g:tar_shq<".g:tar_shq.">")
endif
" ----------------
@@ -106,29 +111,23 @@ endif
" ---------------------------------------------------------------------
" tar#Browse: {{{2
fun! tar#Browse(tarfile)
" call Dfunc("tar#Browse(tarfile<".a:tarfile.">)")
let repkeep= &report
set report=10
" sanity checks
if !executable(g:tar_cmd)
redraw!
" call Decho('***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system')
echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system'
let &report= repkeep
" call Dret("tar#Browse")
return
endif
if !filereadable(a:tarfile)
" call Decho('a:tarfile<'.a:tarfile.'> not filereadable')
if a:tarfile !~# '^\a\+://'
" if it's an url, don't complain, let url-handlers such as vim do its thing
redraw!
" call Decho("***error*** (tar#Browse) File not readable<".a:tarfile.">")
echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None
endif
let &report= repkeep
" call Dret("tar#Browse : file<".a:tarfile."> not readable")
return
endif
if &ma != 1
@@ -144,7 +143,6 @@ fun! tar#Browse(tarfile)
set ft=tar
" give header
" call Decho("printing header")
let lastline= line("$")
call setline(lastline+1,'" tar.vim version '.g:loaded_tar)
call setline(lastline+2,'" Browsing tarfile '.a:tarfile)
@@ -161,52 +159,50 @@ fun! tar#Browse(tarfile)
let curlast= line("$")
if tarfile =~# '\.\(gz\)$'
" call Decho("1: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif tarfile =~# '\.\(tgz\)$' || tarfile =~# '\.\(tbz\)$' || tarfile =~# '\.\(txz\)$' || tarfile =~# '\.\(tzst\)$'
if has("unix") && executable("file")
let filekind= system("file ".shellescape(tarfile,1))
else
let filekind= ""
endif
elseif tarfile =~# '\.\(tgz\)$' || tarfile =~# '\.\(tbz\)$' || tarfile =~# '\.\(txz\)$' ||
\ tarfile =~# '\.\(tzst\)$' || tarfile =~# '\.\(tlz4\)$'
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." - "
else
elseif header =~? 'lz4'
exe "sil! r! lz4 --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif header =~? 'gzip'
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
endif
elseif tarfile =~# '\.lrp'
" call Decho("2: exe silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ")
exe "sil! r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - "
elseif tarfile =~# '\.\(bz2\|tbz\|tb2\)$'
" call Decho("3: exe silent r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
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\)$'
" call Decho("3: exe silent r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif tarfile =~# '\.\(xz\|txz\)$'
" call Decho("3: exe silent r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
exe "sil! r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif tarfile =~# '\.\(zst\|tzst\)$'
exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif tarfile =~# '\.\(lz4\|tlz4\)$'
exe "sil! r! lz4 --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
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
" call Decho("4: exe silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".shellescape(tarfile,0))
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 Dret("tar#Browse : a:tarfile<".a:tarfile.">")
return
endif
"
@@ -237,29 +233,24 @@ fun! tar#Browse(tarfile)
endif
let &report= repkeep
" call Dret("tar#Browse : b:tarfile<".b:tarfile.">")
endfun
" ---------------------------------------------------------------------
" TarBrowseSelect: {{{2
fun! s:TarBrowseSelect()
" call Dfunc("TarBrowseSelect() b:tarfile<".b:tarfile."> curfile<".expand("%").">")
let repkeep= &report
set report=10
let fname= getline(".")
" call Decho("fname<".fname.">")
if !exists("g:tar_secure") && fname =~ '^\s*-\|\s\+-'
redraw!
echohl WarningMsg | echo '***warning*** (tar#BrowseSelect) rejecting tarfile member<'.fname.'> because of embedded "-"'
" call Dret('tar#BrowseSelect : rejecting tarfile member<'.fname.'> because of embedded "-"')
return
endif
" sanity check
if fname =~ '^"'
let &report= repkeep
" call Dret("TarBrowseSelect")
return
endif
@@ -283,19 +274,19 @@ fun! s:TarBrowseSelect()
exe 'com! -buffer -nargs=? -complete=file TarDiff :call tar#Diff(<q-args>,"'.fnameescape(fname).'")'
let &report= repkeep
" call Dret("TarBrowseSelect : s:tblfile_".winnr()."<".s:tblfile_{winnr()}.">")
endfun
" ---------------------------------------------------------------------
" tar#Read: {{{2
fun! tar#Read(fname,mode)
" call Dfunc("tar#Read(fname<".a:fname.">,mode=".a:mode.")")
let repkeep= &report
set report=10
let tarfile = substitute(a:fname,'tarfile:\(.\{-}\)::.*$','\1','')
let fname = substitute(a:fname,'tarfile:.\{-}::\(.*\)$','\1','')
" be careful not to execute special crafted files
let escape_file = fname->fnameescape()
" changing the directory to the temporary earlier to allow tar to extract the file with permissions intact
" 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
@@ -333,12 +324,13 @@ fun! tar#Read(fname,mode)
" assuming cygwin
let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e')
endif
" call Decho("tarfile<".tarfile.">")
" call Decho("fname<".fname.">")
if fname =~ '\.bz2$' && executable("bzcat")
let decmp= "|bzcat"
let doro = 1
elseif fname =~ '\.bz3$' && executable("bz3cat")
let decmp= "|bz3cat"
let doro = 1
elseif fname =~ '\.t\=gz$' && executable("zcat")
let decmp= "|zcat"
let doro = 1
@@ -351,10 +343,13 @@ fun! tar#Read(fname,mode)
elseif fname =~ '\.zst$' && executable("zstdcat")
let decmp= "|zstdcat"
let doro = 1
elseif fname =~ '\.lz4$' && executable("lz4cat")
let decmp= "|lz4cat"
let doro = 1
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
@@ -367,47 +362,51 @@ fun! tar#Read(fname,mode)
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 "read ".escape_file
elseif tarfile =~# '\.bz3$'
exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".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 "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"
let filekind= s:Header(tarfile)
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 "read ".escape_file
elseif filekind =~ "bzip3"
exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".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." - ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
elseif filekind =~ "Zstandard"
exe "read ".escape_file
elseif filekind =~? "zstd"
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 "read ".escape_file
elseif filekind =~? "gzip"
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 "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 "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 "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 "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 ".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
" call Decho("8: exe silent r! ".g:tar_cmd." -".g:tar_readoptions.tar_secure.shellescape(tarfile,1)." ".shellescape(fname,1).decmp)
exe "silent r! ".g:tar_cmd." -".g:tar_readoptions.shellescape(tarfile,1)." ".tar_secure.shellescape(fname,1).decmp
exe "read ".fname
exe "read ".escape_file
endif
redraw!
@@ -432,16 +431,13 @@ if v:shell_error != 0
set nomod
let &report= repkeep
" call Dret("tar#Read : b:tarfile<".b:tarfile.">")
endfun
" ---------------------------------------------------------------------
" tar#Write: {{{2
fun! tar#Write(fname)
" call Dfunc("tar#Write(fname<".a:fname.">) b:tarfile<".b:tarfile."> tblfile_".winnr()."<".s:tblfile_{winnr()}.">")
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
@@ -449,16 +445,13 @@ fun! tar#Write(fname)
if !exists("g:tar_secure") && a:fname =~ '^\s*-\|\s\+-'
redraw!
echohl WarningMsg | echo '***warning*** (tar#Write) rejecting tarfile member<'.a:fname.'> because of embedded "-"'
" call Dret('tar#Write : rejecting tarfile member<'.fname.'> because of embedded "-"')
return
endif
" sanity checks
if !executable(g:tar_cmd)
redraw!
" call Decho('***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system')
let &report= repkeep
" call Dret("tar#Write")
return
endif
@@ -470,43 +463,43 @@ fun! tar#Write(fname)
call system("bzip2 -d -- ".shellescape(tarfile,0))
let tarfile = substitute(tarfile,'\.bz2','','e')
let compress= "bzip2 -- ".shellescape(tarfile,0)
" call Decho("compress<".compress.">")
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')
let compress= "gzip -- ".shellescape(tarfile,0)
" call Decho("compress<".compress.">")
elseif tarfile =~# '\.tgz'
call system("gzip -d -- ".shellescape(tarfile,0))
let tarfile = substitute(tarfile,'\.tgz','.tar','e')
let compress= "gzip -- ".shellescape(tarfile,0)
let tgz = 1
" call Decho("compress<".compress.">")
elseif tarfile =~# '\.xz'
call system("xz -d -- ".shellescape(tarfile,0))
let tarfile = substitute(tarfile,'\.xz','','e')
let compress= "xz -- ".shellescape(tarfile,0)
" call Decho("compress<".compress.">")
elseif tarfile =~# '\.zst'
call system("zstd --decompress --rm -- ".shellescape(tarfile,0))
let tarfile = substitute(tarfile,'\.zst','','e')
let compress= "zstd --rm -- ".shellescape(tarfile,0)
elseif tarfile =~# '\.lz4'
call system("lz4 --decompress --rm -- ".shellescape(tarfile,0))
let tarfile = substitute(tarfile,'\.lz4','','e')
let compress= "lz4 --rm -- ".shellescape(tarfile,0)
elseif tarfile =~# '\.lzma'
call system("lzma -d -- ".shellescape(tarfile,0))
let tarfile = substitute(tarfile,'\.lzma','','e')
let compress= "lzma -- ".shellescape(tarfile,0)
" call Decho("compress<".compress.">")
endif
" call Decho("tarfile<".tarfile.">")
" Note: no support for name.tar.tbz/.txz/.tgz/.tlz4/.tzst
if v:shell_error != 0
redraw!
" call Decho("***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname)
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname | echohl None
else
" call Decho("tarfile<".tarfile."> fname<".fname.">")
if fname =~ '/'
let dirpath = substitute(fname,'/[^/]\+$','','e')
if has("win32unix") && executable("cygpath")
@@ -521,7 +514,6 @@ fun! tar#Write(fname)
" A file name starting with a dash may be taken as an option. Prepend ./ to avoid that.
let tarfile = substitute(tarfile, '-', './-', '')
endif
" call Decho("tarfile<".tarfile."> fname<".fname.">")
if exists("g:tar_secure")
let tar_secure= " -- "
@@ -534,26 +526,20 @@ fun! tar#Write(fname)
endif
" delete old file from tarfile
" call Decho("system(".g:tar_cmd." ".g:tar_delfile." ".shellescape(tarfile,0)." -- ".shellescape(fname,0).")")
call system(g:tar_cmd." ".g:tar_delfile." ".shellescape(tarfile,0).tar_secure.shellescape(fname,0))
if v:shell_error != 0
redraw!
" call Decho("***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname))
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None
else
" update tarfile with new file
" call Decho(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).tar_secure.shellescape(fname,0))
if v:shell_error != 0
redraw!
" call Decho("***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname))
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None
elseif exists("compress")
" call Decho("call system(".compress.")")
call system(compress)
if exists("tgz")
" call Decho("rename(".tarfile.".gz,".substitute(tarfile,'\.tar$','.tgz','e').")")
call rename(tarfile.".gz",substitute(tarfile,'\.tar$','.tgz','e'))
endif
endif
@@ -561,7 +547,6 @@ fun! tar#Write(fname)
" support writing tarfiles across a network
if s:tblfile_{winnr()} =~ '^\a\+://'
" call Decho("handle writing <".tarfile."> across network to <".s:tblfile_{winnr()}.">")
let tblfile= s:tblfile_{winnr()}
1split|noswapfile enew
let binkeep= &l:binary
@@ -583,13 +568,11 @@ fun! tar#Write(fname)
setlocal nomod
let &report= repkeep
" call Dret("tar#Write")
endfun
" ---------------------------------------------------------------------
" tar#Diff: {{{2
fun! tar#Diff(userfname,fname)
" call Dfunc("tar#Diff(userfname<".a:userfname."> fname<".a:fname.")")
let fname= a:fname
if a:userfname != ""
let fname= a:userfname
@@ -607,133 +590,135 @@ fun! tar#Diff(userfname,fname)
redraw!
echo "***warning*** unable to read file<".fname.">"
endif
" call Dret("tar#Diff")
endfun
" ---------------------------------------------------------------------
" tar#Extract: extract a file from a (possibly compressed) tar archive {{{2
fun! tar#Extract()
" call Dfunc("tar#Extract()")
let repkeep= &report
set report=10
let fname= getline(".")
" call Decho("fname<".fname.">")
if !exists("g:tar_secure") && fname =~ '^\s*-\|\s\+-'
redraw!
echohl WarningMsg | echo '***warning*** (tar#BrowseSelect) rejecting tarfile member<'.fname.'> because of embedded "-"'
" call Dret('tar#BrowseSelect : rejecting tarfile member<'.fname.'> because of embedded "-"')
return
endif
" sanity check
if fname =~ '^"'
let &report= repkeep
" call Dret("TarBrowseSelect")
return
endif
let tarball = expand("%")
" call Decho("tarball<".tarball.">")
let tarbase = substitute(tarball,'\..*$','','')
" call Decho("tarbase<".tarbase.">")
let extractcmd= netrw#WinPath(g:tar_extractcmd)
if filereadable(tarbase.".tar")
" call Decho("system(".extractcmd." ".shellescape(tarbase).".tar ".shellescape(fname).")")
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 Decho("***error*** ".extractcmd." ".tarbase.".tar ".fname.": failed!")
else
echo "***note*** successfully extracted ".fname
endif
elseif filereadable(tarbase.".tgz")
let extractcmd= substitute(extractcmd,"-","-z","")
" call Decho("system(".extractcmd." ".shellescape(tarbase).".tgz ".shellescape(fname).")")
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 Decho("***error*** ".extractcmd."t ".tarbase.".tgz ".fname.": failed!")
else
echo "***note*** successfully extracted ".fname
endif
elseif filereadable(tarbase.".tar.gz")
let extractcmd= substitute(extractcmd,"-","-z","")
" call Decho("system(".extractcmd." ".shellescape(tarbase).".tar.gz ".shellescape(fname).")")
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 Decho("***error*** ".extractcmd." ".tarbase.".tar.gz ".fname.": failed!")
else
echo "***note*** successfully extracted ".fname
endif
elseif filereadable(tarbase.".tbz")
let extractcmd= substitute(extractcmd,"-","-j","")
" call Decho("system(".extractcmd." ".shellescape(tarbase).".tbz ".shellescape(fname).")")
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 Decho("***error*** ".extractcmd."j ".tarbase.".tbz ".fname.": failed!")
else
echo "***note*** successfully extracted ".fname
endif
elseif filereadable(tarbase.".tar.bz2")
let extractcmd= substitute(extractcmd,"-","-j","")
" call Decho("system(".extractcmd." ".shellescape(tarbase).".tar.bz2 ".shellescape(fname).")")
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 Decho("***error*** ".extractcmd."j ".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
echohl Error | echo "***error*** ".extractcmd."j ".tarbase.".tar.bz3 ".fname.": failed!" | echohl NONE
else
echo "***note*** successfully extracted ".fname
endif
elseif filereadable(tarbase.".txz")
let extractcmd= substitute(extractcmd,"-","-J","")
" call Decho("system(".extractcmd." ".shellescape(tarbase).".txz ".shellescape(fname).")")
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 Decho("***error*** ".extractcmd." ".tarbase.".txz ".fname.": failed!")
else
echo "***note*** successfully extracted ".fname
endif
elseif filereadable(tarbase.".tar.xz")
let extractcmd= substitute(extractcmd,"-","-J","")
" call Decho("system(".extractcmd." ".shellescape(tarbase).".tar.xz ".shellescape(fname).")")
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 Decho("***error*** ".extractcmd." ".tarbase.".tar.xz ".fname.": failed!")
else
echo "***note*** successfully extracted ".fname
endif
elseif filereadable(tarbase.".tzst")
let extractcmd= substitute(extractcmd,"-","--zstd","")
" call Decho("system(".extractcmd." ".shellescape(tarbase).".tzst ".shellescape(fname).")")
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 Decho("***error*** ".extractcmd." ".tarbase.".tzst ".fname.": failed!")
else
echo "***note*** successfully extracted ".fname
endif
elseif filereadable(tarbase.".tar.zst")
let extractcmd= substitute(extractcmd,"-","--zstd","")
" call Decho("system(".extractcmd." ".shellescape(tarbase).".tar.zst ".shellescape(fname).")")
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 Decho("***error*** ".extractcmd." ".tarbase.".tar.zst ".fname.": failed!")
else
echo "***note*** successfully extracted ".fname
endif
elseif filereadable(tarbase.".tlz4")
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
else
echo "***note*** successfully extracted ".fname
endif
elseif filereadable(tarbase.".tar.lz4")
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
else
echo "***note*** successfully extracted ".fname
endif
@@ -741,14 +726,11 @@ fun! tar#Extract()
" restore option
let &report= repkeep
" call Dret("tar#Extract")
endfun
" ---------------------------------------------------------------------
" s:Rmdir: {{{2
fun! s:Rmdir(fname)
" call Dfunc("Rmdir(fname<".a:fname.">)")
if has("unix")
call system("/bin/rm -rf -- ".shellescape(a:fname,0))
elseif has("win32") || has("win95") || has("win64") || has("win16")
@@ -758,44 +740,55 @@ fun! s:Rmdir(fname)
call system("del /S ".shellescape(a:fname,0))
endif
endif
" call Dret("Rmdir")
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
" ---------------------------------------------------------------------
" tar#Vimuntar: installs a tarball in the user's .vim / vimfiles directory {{{2
fun! tar#Vimuntar(...)
" call Dfunc("tar#Vimuntar() a:0=".a:0." a:1<".(exists("a:1")? a:1 : "-n/a-").">")
let tarball = expand("%")
" call Decho("tarball<".tarball.">")
let tarbase = substitute(tarball,'\..*$','','')
" call Decho("tarbase<".tarbase.">")
let tarhome = expand("%:p")
if has("win32") || has("win95") || has("win64") || has("win16")
let tarhome= substitute(tarhome,'\\','/','g')
endif
let tarhome= substitute(tarhome,'/[^/]*$','','')
" call Decho("tarhome<".tarhome.">")
let tartail = expand("%:t")
" call Decho("tartail<".tartail.">")
let curdir = getcwd()
" call Decho("curdir <".curdir.">")
" set up vimhome
if a:0 > 0 && a:1 != ""
let vimhome= a:1
else
let vimhome= vimball#VimballHome()
endif
" call Decho("vimhome<".vimhome.">")
" call Decho("curdir<".curdir."> vimhome<".vimhome.">")
if simplify(curdir) != simplify(vimhome)
" copy (possibly compressed) tarball to .vim/vimfiles
" call Decho(netrw#WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome))
call system(netrw#WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome))
" call Decho("exe cd ".fnameescape(vimhome))
exe "cd ".fnameescape(vimhome)
endif
" call Decho("getcwd<".getcwd().">")
" if necessary, decompress the tarball; then, extract it
if tartail =~ '\.tgz'
@@ -807,24 +800,19 @@ fun! tar#Vimuntar(...)
echoerr "unable to decompress<".tartail."> on this system"
if simplify(curdir) != simplify(tarhome)
" remove decompressed tarball, restore directory
" call Decho("delete(".tartail.".tar)")
call delete(tartail.".tar")
" call Decho("exe cd ".fnameescape(curdir))
exe "cd ".fnameescape(curdir)
endif
" call Dret("tar#Vimuntar")
return
endif
else
call vimball#Decompress(tartail,0)
endif
let extractcmd= netrw#WinPath(g:tar_extractcmd)
" call Decho("system(".extractcmd." ".shellescape(tarbase.".tar").")")
call system(extractcmd." ".shellescape(tarbase.".tar"))
" set up help
if filereadable("doc/".tarbase.".txt")
" call Decho("exe helptags ".getcwd()."/doc")
exe "helptags ".getcwd()."/doc"
endif
@@ -833,8 +821,6 @@ fun! tar#Vimuntar(...)
call delete(vimhome."/".tarbase.".tar")
exe "cd ".fnameescape(curdir)
endif
" call Dret("tar#Vimuntar")
endfun
" =====================================================================
+23 -1
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)
+6
View File
@@ -14,6 +14,7 @@
" 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
" 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,
@@ -343,6 +344,11 @@ fun! zip#Extract()
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')
+3 -3
View File
@@ -4,7 +4,7 @@
" Maintainer: Maxim Kim <habamax@gmail.com>, ported from gruvbox8 of Lifepillar <lifepillar@lifepillar.me>
" Website: https://www.github.com/vim/colorschemes
" License: Vim License (see `:help license`)
" Last Change: 2025 Jan 07
" Last Change: 2025 Feb 15
" Generated by Colortemplate v2.2.3
@@ -150,7 +150,7 @@ else
hi StatusLine guifg=#bdae93 guibg=#3c3836 gui=bold,reverse cterm=bold,reverse
hi StatusLineNC guifg=#ebdbb2 guibg=#3c3836 gui=reverse cterm=reverse
hi TabLine guifg=#665c54 guibg=#ebdbb2 gui=NONE cterm=NONE
hi TabLineFill guifg=#ebdbb2 guibg=#ebdbb2 gui=NONE cterm=NONE
hi TabLineFill guifg=#3c3836 guibg=#ebdbb2 gui=NONE cterm=NONE
hi TabLineSel guifg=#282828 guibg=#fbf1c7 gui=bold cterm=bold
hi ToolbarButton guifg=#282828 guibg=#bdae93 gui=bold cterm=bold
hi ToolbarLine guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
@@ -332,7 +332,7 @@ if s:t_Co >= 256
hi StatusLine ctermfg=144 ctermbg=237 cterm=bold,reverse
hi StatusLineNC ctermfg=187 ctermbg=237 cterm=reverse
hi TabLine ctermfg=59 ctermbg=187 cterm=NONE
hi TabLineFill ctermfg=187 ctermbg=187 cterm=NONE
hi TabLineFill ctermfg=237 ctermbg=187 cterm=NONE
hi TabLineSel ctermfg=235 ctermbg=230 cterm=bold
hi ToolbarButton ctermfg=235 ctermbg=144 cterm=bold
hi ToolbarLine ctermfg=NONE ctermbg=NONE cterm=NONE
+2
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'))), ' ')
+2
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,
+3
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.
+21
View File
@@ -0,0 +1,21 @@
" Vim compiler file
" Compiler: svelte-check
" Maintainer: @Konfekt
" 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+=%-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=%A%f:%l:%c,
" CompilerSet errorformat+=%C%t%*\\a\\:\ %m,
" CompilerSet errorformat+=%-G%.%#,
+2
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'
+3 -2
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%.%#
+3 -1
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, '\ ')
+5
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/\(.*\)/\1 *pi_netrw.txt*/' $@.tmp > $@ && \
rm -f $@.tmp
vietnamese.txt:
touch $@
+18 -2
View File
@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 9.1. Last change: 2024 Dec 04
*autocmd.txt* For Vim version 9.1. Last change: 2025 Mar 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -389,6 +389,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
@@ -605,6 +606,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
@@ -936,7 +939,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.
@@ -1236,6 +1241,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
@@ -1350,6 +1359,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*
@@ -2000,6 +2013,9 @@ To disable autocommands for some time use the 'eventignore' option. Note that
this may cause unexpected behavior, make sure you restore 'eventignore'
afterwards, using a |:try| block with |:finally|.
To disable autocmds indefinitely in a specific window use the 'eventignorewin'
option. This can only be used to ignore window and buffer related events.
*:noautocmd* *:noa*
To disable autocommands for just one command use the ":noautocmd" command
modifier. This will set 'eventignore' to "all" for the duration of the
+225 -109
View File
@@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 17
*builtin.txt* For Vim version 9.1. Last change: 2025 Mar 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -207,7 +207,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}
@@ -228,12 +228,12 @@ getbufvar({buf}, {varname} [, {def}])
getcellpixels() List get character cell pixel size
getcellwidths() List get character cell width overrides
getchangelist([{buf}]) List list of change list items
getchar([{expr}]) Number or String
getchar([{expr} [, {opts}]]) Number or String
get one character from the user
getcharmod() Number modifiers for the last typed character
getcharpos({expr}) List position of cursor, mark, etc.
getcharsearch() Dict last character search
getcharstr([{expr}]) String get one character from the user
getcharstr([{expr} [, {opts}]]) String get one character from the user
getcmdcomplpat() String return the completion pattern of the
current command-line completion
getcmdcompltype() String return the type of the current
@@ -348,7 +348,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 +364,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
@@ -416,6 +417,8 @@ mkdir({name} [, {flags} [, {prot}]])
mode([{expr}]) String current editing mode
mzeval({expr}) any evaluate |MzScheme| expression
nextnonblank({lnum}) Number line nr of non-blank line >= {lnum}
ngettext({single}, {plural}, {number}[, {domain}])
String translate text based on {number}
nr2char({expr} [, {utf8}]) String single char with ASCII/UTF-8 value {expr}
or({expr}, {expr}) Number bitwise OR
pathshorten({expr} [, {len}]) String shorten directory names in a path
@@ -509,10 +512,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
@@ -612,8 +615,7 @@ split({expr} [, {pat} [, {keepempty}]])
sqrt({expr}) Float square root of {expr}
srand([{expr}]) List get seed for |rand()|
state([{what}]) String current state of Vim
str2blob({list} [, {options}])
Blob convert list of strings into a Blob
str2blob({list} [, {options}]) Blob convert list of strings into a Blob
str2float({expr} [, {quoted}]) Float convert String to Float
str2list({expr} [, {utf8}]) List convert each character of {expr} to
ASCII/UTF-8 value
@@ -714,6 +716,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}
@@ -735,6 +738,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}
@@ -1310,19 +1314,25 @@ blob2str({blob} [, {options}]) *blob2str()*
items:
encoding Decode the bytes in {blob} using this
encoding. The value is a |String|. See
|encoding-names| for the supported values.
*E1515*
An error is given and an empty List is returned if
an invalid byte sequence is encountered in {blob},
|encoding-names| for the supported values
(plus the special value "none").
*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
potentially invalid string, set "encoding" in {options} to
"none".
Returns an empty List if blob is empty.
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()
@@ -2068,7 +2078,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()
@@ -2111,10 +2122,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.
@@ -2234,7 +2245,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
@@ -2542,8 +2554,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.
@@ -3007,7 +3019,8 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
When {expr3} is omitted then "force" is assumed.
{expr1} is changed when {expr2} is not empty. If necessary
make a copy of {expr1} first.
make a copy of {expr1} first or use |extendnew()| to return a
new List/Dictionary.
{expr2} remains unchanged.
When {expr1} is locked and {expr2} is not empty the operation
fails.
@@ -3469,8 +3482,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}.
@@ -3479,10 +3493,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.
@@ -3508,8 +3522,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
@@ -3682,6 +3696,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
@@ -3884,6 +3907,8 @@ getcellpixels() *getcellpixels()*
On macOS, system Terminal.app returns sizes in points (before
Retina scaling), whereas third-party terminals return raw pixel
sizes (post Retina scaling).
In MacVim, there is a small delay after startup or changing
'guifont' before this will return the updated values.
Return type: list<any>
@@ -3919,14 +3944,16 @@ getchangelist([{buf}]) *getchangelist()*
Return type: list<any>
getchar([{expr}]) *getchar()*
getchar([{expr} [, {opts}]]) *getchar()*
Get a single character from the user or input stream.
If {expr} is omitted, wait until a character is available.
If {expr} is omitted or is -1, wait until a character is
available.
If {expr} is 0, only get a character when one is available.
Return zero otherwise.
If {expr} is 1, only check if a character is available, it is
not consumed. Return zero if no character available.
If you prefer always getting a string use |getcharstr()|.
If you prefer always getting a string use |getcharstr()|, or
specify |FALSE| as "number" in {opts}.
Without {expr} and when {expr} is 0 a whole character or
special key is returned. If it is a single character, the
@@ -3936,7 +3963,8 @@ getchar([{expr}]) *getchar()*
starting with 0x80 (decimal: 128). This is the same value as
the String "\<Key>", e.g., "\<Left>". The returned value is
also a String when a modifier (shift, control, alt) was used
that is not included in the character.
that is not included in the character. |keytrans()| can also
be used to convert a returned String into a readable form.
When {expr} is 0 and Esc is typed, there will be a short delay
while Vim waits to see if this is the start of an escape
@@ -3948,6 +3976,31 @@ getchar([{expr}]) *getchar()*
Use getcharmod() to obtain any additional modifiers.
The optional argument {opts} is a Dict and supports the
following items:
cursor A String specifying cursor behavior
when waiting for a character.
"hide": hide the cursor.
"keep": keep current cursor unchanged.
"msg": move cursor to message area.
(default: "msg")
number If |TRUE|, return a Number when getting
a single character.
If |FALSE|, the return value is always
converted to a String, and an empty
String (instead of 0) is returned when
no character is available.
(default: |TRUE|)
simplify If |TRUE|, include modifiers in the
character if possible. E.g., return
the same value for CTRL-I and <Tab>.
If |FALSE|, don't include modifiers in
the character.
(default: |TRUE|)
When the user clicks a mouse button, the mouse event will be
returned. The position can then be found in |v:mouse_col|,
|v:mouse_lnum|, |v:mouse_winid| and |v:mouse_win|.
@@ -4063,17 +4116,9 @@ getcharsearch() *getcharsearch()*
Return type: dict<any>
getcharstr([{expr}]) *getcharstr()*
Get a single character from the user or input stream as a
string.
If {expr} is omitted, wait until a character is available.
If {expr} is 0 or false, only get a character when one is
available. Return an empty string otherwise.
If {expr} is 1 or true, only check if a character is
available, it is not consumed. Return an empty string
if no character is available.
Otherwise this works like |getchar()|, except that a number
result is converted to a string.
getcharstr([{expr} [, {opts}]]) *getcharstr()*
The same as |getchar()|, except that this always returns a
String, and "number" isn't allowed in {opts}.
Return type: |String|
@@ -4974,6 +5019,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>>>
@@ -5793,8 +5840,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|: >
@@ -5821,12 +5868,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}.
@@ -5850,11 +5897,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
@@ -5862,11 +5909,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.
@@ -6176,9 +6223,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()
@@ -6189,16 +6236,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()
@@ -6292,6 +6340,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
@@ -6340,6 +6390,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.
@@ -6521,6 +6573,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}.
@@ -7251,6 +7322,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:
@@ -7433,11 +7507,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()
@@ -7524,11 +7599,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()
@@ -7563,9 +7639,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)
@@ -7690,6 +7765,20 @@ nextnonblank({lnum}) *nextnonblank()*
Return type: |Number|
ngettext({single}, {plural}, {number}[, {domain}) *ngettext()*
Return a string that contains the correct value for a
message based on the rules for plural form(s) in
a language. Examples: >
ngettext("File", "Files", 2) # returns "Files"
<
Can be used as a |method|: >
1->ngettext("File", "Files") # returns "File"
<
See |gettext()| for information on the domain parameter.
Return type: |String|
nr2char({expr} [, {utf8}]) *nr2char()*
Return a string with a single character, which has the number
value {expr}. Examples: >
@@ -8251,13 +8340,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
@@ -8279,6 +8369,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
@@ -8538,8 +8629,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
@@ -8860,16 +8951,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*
@@ -8896,18 +8987,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()*
@@ -10282,7 +10374,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*
@@ -10633,7 +10725,8 @@ str2blob({list} [, {options}]) *str2blob()*
The argument {options} is a |Dict| and supports the following
items:
encoding Encode the characters using this encoding.
encoding Convert the characters using this encoding
before making the Blob.
The value is a |String|. See |encoding-names|
for the supported values.
@@ -10645,11 +10738,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()
@@ -10892,15 +10986,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,
@@ -11854,6 +11949,25 @@ trunc({expr}) *trunc()*
Return type: |Float|
tuple2list({list}) *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
@@ -11874,6 +11988,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("")
@@ -12739,6 +12854,7 @@ gui_win32s idem, and Win32s system being used (Windows 3.1)
haiku Haiku version of Vim.
hangul_input Compiled with Hangul input support. |hangul|
hpux HP-UX version of Vim.
hurd GNU/Hurd version of Vim
iconv Can use iconv() for conversion.
insert_expand Compiled with support for CTRL-X expansion commands in
Insert mode. (always true)
+6 -1
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 Mar 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1149,6 +1149,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'
+5 -1
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 Mar 08
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
+24 -9
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: 2024 Mar 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -226,14 +226,29 @@ 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:` 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. Will not
be 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.
+4 -3
View File
@@ -1,4 +1,4 @@
*digraph.txt* For Vim version 9.1. Last change: 2023 Oct 20
*digraph.txt* For Vim version 9.1. Last change: 2025 Feb 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -125,8 +125,8 @@ see them.
On most systems Vim uses the same digraphs. They work for the Unicode and
ISO-8859-1 character sets. These default digraphs are taken from the RFC1345
mnemonics. To make it easy to remember the mnemonic, the second character has
a standard meaning:
mnemonics (with some additions). To make it easy to remember the mnemonic,
the second character has a standard meaning:
char name char meaning ~
Exclamation mark ! Grave
@@ -1075,6 +1075,7 @@ char digraph hex dec official name ~
≅ ?= 2245 8773 APPROXIMATELY EQUAL TO
≈ ?2 2248 8776 ALMOST EQUAL TO
≌ =? 224C 8780 ALL EQUAL TO
≐ .= 2250 8784 APPROACHES THE LIMIT
≓ HI 2253 8787 IMAGE OF OR APPROXIMATELY EQUAL TO
≠ != 2260 8800 NOT EQUAL TO
≡ =3 2261 8801 IDENTICAL TO
+340 -61
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 9.1. Last change: 2025 Jan 02
*eval.txt* For Vim version 9.1. Last change: 2025 Mar 23
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,206 @@ 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 uses less memory compared to a List and provides O(1) lookup time.
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 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 +743,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 +776,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 +918,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 +1065,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 +1116,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 +1146,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 +1158,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 +1315,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 +1339,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 +1363,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 +1407,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 +1512,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 +1546,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 +1589,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: >
@@ -2081,7 +2302,7 @@ v:colornames A dictionary that maps color names to hex color strings. These
You can make changes to that file, but make sure to add new
keys instead of updating existing ones, otherwise Vim will skip
loading the file (thinking is hasn't been changed).
loading the file (thinking it hasn't been changed).
*v:completed_item* *completed_item-variable*
v:completed_item
@@ -2630,6 +2851,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|
@@ -2949,13 +3172,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: >
@@ -2972,16 +3195,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}
@@ -3176,23 +3405,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]
@@ -3297,7 +3529,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
@@ -4922,5 +5154,52 @@ executable. It takes the following arguments:
filetype string
executable string
*dist#vim9#Open()* *:Open*
*g:Openprg* *gx*
dist#vim9#Open(file: string) ~
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.
This function is by default called using the gx mapping. In visual mode
tries to open the visually selected text.
Associated setting variables:
`g:gx_word`: control how gx picks up the text under the cursor. Uses
`g:netrw_gx` as a fallback for backward compatibility.
(default: `<cfile>`)
`g:nogx`: disables the gx mapping. Uses `g:netrw_nogx` as a fallback for
backward compatibility. (default: `unset`)
NOTE: Escaping of the path is automatically applied.
Usage: >vim
:call dist#vim9#Open(<path>)
:Open <path>
<
*dist#vim9#Launch()* *:Launch*
dist#vim9#Launch(file: string) ~
Launches <args> with the appropriate system programs. Intended for launching
GUI programs within Vim.
NOTE: escaping of <args> is left to the user
Examples: >vim
vim9script
import autoload 'dist/vim9.vim'
# Execute 'makeprg' into another xterm window
vim9.Launch('xterm ' .. expandcmd(&makeprg))
<
Usage: >vim
:call dist#vim9#Launch(<args>)
:Launch <app> <args>.
<
vim:tw=78:ts=8:noet:ft=help:norl:
+48 -4
View File
@@ -1,4 +1,4 @@
*filetype.txt* For Vim version 9.1. Last change: 2024 Dec 04
*filetype.txt* For Vim version 9.1. Last change: 2025 Mar 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -640,6 +640,25 @@ 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`.
GO *ft-go-plugin*
@@ -744,12 +763,21 @@ Add following lines to $HOME/.vim/ftplugin/json.vim: >
import autoload 'dist/json.vim'
setl formatexpr=json.FormatExpr()
LUA *ft-lua-plugin*
LUA *ft-lua-plugin* *g:lua_folding*
You can enable folding of Lua functions using |fold-expr| by: >
let g:lua_folding = 1
< *g:lua_version* *g:lua_subversion*
Lua filetype's 'includeexpr' and |ft-lua-syntax| highlighting use the global
variables "g:lua_version" and "g:lua_subversion" to determine the version of
Lua to use (5.3 is the default)
For example, to use Lua 5.1, set the variables like this: >
let g:lua_version = 5
let g:lua_subversion = 1
<
MAIL *ft-mail-plugin*
Options:
@@ -762,12 +790,12 @@ Options:
You can also format quoted text with |gq|.
Local mappings:
<LocalLeader>q or \\MailQuote
<LocalLeader>q or \MailQuote
Quotes the text selected in Visual mode, or from the cursor position
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.
@@ -784,6 +812,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.
@@ -814,6 +844,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: >
@@ -865,6 +903,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*
+25 -27
View File
@@ -283,8 +283,6 @@ as general information regarding macOS user defaults.
Here is a list of relevant dictionary entries:
KEY VALUE ~
*MMAllowForceClickLookUp* use Force click for data lookup instead of
<ForceClick> [bool]
*MMCellWidthMultiplier* width of a normal glyph in em units [float]
*MMCmdLineAlignBottom* Pin command-line to bottom of MacVim [bool]
*MMDialogsTrackPwd* open/save dialogs track the Vim pwd [bool]
@@ -307,7 +305,6 @@ KEY VALUE ~
*MMTitlebarAppearsTransparent* enable a transparent titlebar [bool]
*MMAppearanceModeSelection* dark mode selection (|macvim-dark-mode|)[bool]
*MMRendererClipToRow* clip tall characters to the row they are on [bool]
*MMScrollOneDirectionOnly* scroll along one axis only when using trackpad [bool]
*MMSmoothResize* allow smooth resizing of MacVim window [bool]
*MMShareFindPboard* share search text to Find Pasteboard [bool]
*MMTextInsetBottom* text area offset in pixels [int]
@@ -316,12 +313,22 @@ KEY VALUE ~
*MMTextInsetTop* text area offset in pixels [int]
*MMTexturedWindow* use brushed metal window (Tiger only) [bool]
*MMTranslateCtrlClick* interpret ctrl-click as right-click [bool]
*MMUseMouseTime* use mousetime to detect multiple clicks [bool]
*MMVerticalSplit* files open in vertical splits [bool]
*MMZoomBoth* zoom button maximizes both directions [bool]
*MMUpdaterPrereleaseChannel* opt-in to pre-release software update [bool]
*MMShowWhatsNewOnStartup* show "What's New" after updating to new version [bool]
Mouse / Trackpad ~
*MMScrollOneDirectionOnly* scroll along one axis only when using trackpad [bool]
*MMAllowForceClickLookUp* use Force click for data lookup instead of
<ForceClick> [bool]
*MMMouseWheelDisableAcceleration* disable OS scroll wheel acceleration [bool]
*MMMouseWheelNumLines* how many lines to scroll when scroll wheel
acceleration is turned off [int]
*MMMouseWheelMinLines* min number of lines to scroll per scroll wheel
click when acceleration is on [int]
*MMUseMouseTime* use mousetime to detect multiple clicks [bool]
Tabs ~
*MMTabColorsMode* use default/auto/colorscheme for tab colors [int]
*MMWindowUseTabBackgroundColor* use tabs background fill color as window color [bool]
@@ -395,32 +402,23 @@ top of the screen, you can set |MMNonNativeFullScreenShowMenu| to `NO` and
==============================================================================
5. Special colors *macvim-colors*
The colors in MacVim are defined in two dictionaries inside the "Resources"
folder of the application bundle (MacVim.app/Contents/Resources). It is
possible to add more colors by modifying these files. Color names are case
insensitive when accessed from Vim, but in the dictionary they must be
lowercase.
MacVim mostly uses standard Vim colors. See |gui-colors| and |v:colornames|
for how to set and override them.
*SystemColors.plist*
There are only a few system colors that can be accessed from Vim. These
colors are defined in the dictionary "SystemColors.plist". This dictionary
stores (key, value) pairs where the key is the name of the color and the
value is an NSColor selector name.
There are a few additional system colors that can be used in the |:hi|
command. These colors are defined in the dictionary "SystemColors.plist" in
the MacVim.app bundle. These color values correspond to NSColor selectors in
macOS. The available color names are:
The most useful system colors are: >
MacSelectedTextBackgroundColor
MacSecondarySelectedColor
The former is the "Highlight Color" which can be changed in the "Appearance"
section of the System Settings. The latter is the selection color used by
a Cocoa application when it is not in focus.
*Colors.plist*
Apart from the system colors, it is also possible to use the standard X11
color names (see https://en.wikipedia.org/wiki/X11_color_names) which usually
come in a file called "rgb.txt". MacVim does not have such a file, instead it
keeps these colors in a dictionary called "Colors.plist". The key in this
dictionary is the name of the color and the value is an RGB value on the form
#rrggbb stored as an integer.
KEY VALUE ~
MacSecondarySelectedControlColor Selection color when app is not in
focus.
MacSelectedTextBackgroundColor "Highlight Color" which can be changed
in the "Appearance" section of System
Settings.
MacTextBackgroundColor Normal text background color.
MacTextColor Normal text color.
*macvim-colorscheme*
MacVim ships with a custom color scheme that is used instead of the default
+23 -4
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
+3 -3
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 Mar 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -803,8 +803,6 @@ tag char note action in Normal mode ~
|gu| gu{motion} 2 make Nmove text lowercase
|gv| gv reselect the previous Visual area
|gw| gw{motion} 2 format Nmove text and keep cursor
|netrw-gx| gx execute application for file name under the
cursor (only with |netrw| plugin)
|g@| g@{motion} call 'operatorfunc'
|g~| g~{motion} 2 swap case for Nmove text
|g<Down>| g<Down> 1 same as "gj"
@@ -1402,6 +1400,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
+10 -1
View File
@@ -1,4 +1,4 @@
*insert.txt* For Vim version 9.1. Last change: 2024 Dec 31
*insert.txt* For Vim version 9.1. Last change: 2025 Mar 09
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
@@ -657,6 +661,11 @@ CTRL-N (next), and CTRL-P (previous).
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 '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
originally typed text. The CTRL-E will not be inserted.
+112 -38
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 9.1. Last change: 2025 Jan 23
*options.txt* For Vim version 9.1. Last change: 2025 Mar 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2119,13 +2119,35 @@ A jump table for the options with a short description can be found at |Q_op|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'completefuzzycollect'* *'cfc'*
'completefuzzycollect' 'cfc' string (default: empty)
global
A comma-separated list of strings to enable fuzzy collection for
specific |ins-completion| modes, affecting how matches are gathered
during completion. For specified modes, fuzzy matching is used to
find completion candidates instead of the standard prefix-based
matching. This option can contain the following values:
keyword keywords in the current file |i_CTRL-X_CTRL-N|
keywords with flags ".", "w", |i_CTRL-N| |i_CTRL-P|
"b", "u", "U" and "k{dict}" in 'complete'
keywords in 'dictionary' |i_CTRL-X_CTRL-K|
files file names |i_CTRL-X_CTRL-F|
whole_line whole lines |i_CTRL-X_CTRL-L|
When using the 'completeopt' "longest" option value, fuzzy collection
can identify the longest common string among the best fuzzy matches
and insert it automatically.
*'completeitemalign'* *'cia'*
'completeitemalign' 'cia' string (default: "abbr,kind,menu")
global
A comma-separated list of |complete-items| that controls the alignment
and display order of items in the popup menu during Insert mode
completion. The supported values are abbr, kind, and menu. These
options allow to customize how the completion items are shown in the
A comma-separated list of strings that controls the alignment and
display order of items in the popup menu during Insert mode
completion. The supported values are "abbr", "kind", and "menu".
These values allow customizing how |complete-items| are shown in the
popup menu. Note: must always contain those three values in any
order.
@@ -2135,6 +2157,22 @@ A jump table for the options with a short description can be found at |Q_op|.
A comma-separated list of options for Insert mode completion
|ins-completion|. The supported values are:
fuzzy Enable |fuzzy-matching| for completion candidates. This
allows for more flexible and intuitive matching, where
characters can be skipped and matches can be found even
if the exact sequence is not typed. Note: This option
does not affect the collection of candidate list, it only
controls how completion candidates are reduced from the
list of alternatives. If you want to use |fuzzy-matching|
to gather more alternatives for your candidate list,
see |'completefuzzycollect'|.
longest Only insert the longest common text of the matches. If
the menu is displayed you can use CTRL-L to add more
characters. Whether case is ignored depends on the kind
of completion. For buffer text the 'ignorecase' option is
used.
menu Use a popup menu to show the possible completions. The
menu is only shown when there is more than one match and
sufficient colors are available. |ins-completion-menu|
@@ -2143,15 +2181,17 @@ A jump table for the options with a short description can be found at |Q_op|.
Useful when there is additional information about the
match, e.g., what file it comes from.
longest Only insert the longest common text of the matches. If
the menu is displayed you can use CTRL-L to add more
characters. Whether case is ignored depends on the kind
of completion. For buffer text the 'ignorecase' option is
used.
noinsert Do not insert any text for a match until the user selects
a match from the menu. Only works in combination with
"menu" or "menuone". No effect if "longest" is present.
preview Show extra information about the currently selected
completion in the preview window. Only works in
combination with "menu" or "menuone".
noselect Same as "noinsert", except that no menu item is
pre-selected. If both "noinsert" and "noselect" are
present, "noselect" has precedence.
nosort Disable sorting of completion candidates based on fuzzy
scores when "fuzzy" is enabled. Candidates will appear
in their original order.
popup Show extra information about the currently selected
completion in a popup window. Only works in combination
@@ -2166,22 +2206,15 @@ A jump table for the options with a short description can be found at |Q_op|.
See the example at |complete-popuphidden|.
{only works when compiled with the |+textprop| feature}
noinsert Do not insert any text for a match until the user selects
a match from the menu. Only works in combination with
"menu" or "menuone". No effect if "longest" is present.
preinsert
Preinsert the portion of the first candidate word that is
not part of the current completion leader and using the
|hl-ComplMatchIns| highlight group. In order for it to
work, "fuzzy" must not be set and "menuone" must be set.
noselect Same as "noinsert", except that no menu item is
pre-selected. If both "noinsert" and "noselect" are
present, "noselect" has precedence.
fuzzy Enable |fuzzy-matching| for completion candidates. This
allows for more flexible and intuitive matching, where
characters can be skipped and matches can be found even
if the exact sequence is not typed.
nosort Disable sorting of completion candidates based on fuzzy
scores when "fuzzy" is enabled. Candidates will appear
in their original order.
preview Show extra information about the currently selected
completion in the preview window. Only works in
combination with "menu" or "menuone".
*'completepopup'* *'cpp'*
'completepopup' 'cpp' string (default empty)
@@ -2892,7 +2925,8 @@ A jump table for the options with a short description can be found at |Q_op|.
security reasons.
*'dip'* *'diffopt'*
'diffopt' 'dip' string (default "internal,filler,closeoff")
'diffopt' 'dip' string (default
"internal,filler,closeoff,inline:simple")
global
{not available when compiled without the |+diff|
feature}
@@ -2957,6 +2991,21 @@ A jump table for the options with a short description can be found at |Q_op|.
Use the indent heuristic for the internal
diff library.
inline:{text} Highlight inline differences within a change.
See |view-diffs|. Supported values are:
none Do not perform inline highlighting.
simple Highlight from first different
character to the last one in each
line. This is the default if nothing
is set.
char Use internal diff to perform a
character-wise diff and highlight the
difference.
word Use internal diff to perform a
|word|-wise diff and highlight the
difference.
internal Use the internal diff library. This is
ignored when 'diffexpr' is set. *E960*
When running out of memory when writing a
@@ -3292,6 +3341,13 @@ A jump table for the options with a short description can be found at |Q_op|.
Otherwise this is a comma-separated list of event names. Example: >
:set ei=WinEnter,WinLeave
<
*'eventignorewin'* *'eiw'*
'eventignorewin' 'eiw' string (default "")
window-local
Similar to 'eventignore' but applies to a particular window and its
buffers, for which window and buffer related autocommands can be
ignored indefinitely without affecting the global 'eventignore'.
*'expandtab'* *'et'* *'noexpandtab'* *'noet'*
'expandtab' 'et' boolean (default off)
local to buffer
@@ -4451,10 +4507,10 @@ A jump table for the options with a short description can be found at |Q_op|.
v:Visual,V:VisualNOS,w:WarningMsg,
W:WildMenu,f:Folded,F:FoldColumn,
A:DiffAdd,C:DiffChange,D:DiffDelete,
T:DiffText,>:SignColumn,-:Conceal,
B:SpellBad,P:SpellCap,R:SpellRare,
L:SpellLocal,+:Pmenu,=:PmenuSel,
k:PmenuMatch,<:PmenuMatchSel,
T:DiffText,E:DiffTextAdd,>:SignColumn,
-:Conceal,B:SpellBad,P:SpellCap,
R:SpellRare, L:SpellLocal,+:Pmenu,
=:PmenuSel, k:PmenuMatch,<:PmenuMatchSel,
[:PmenuKind,]:PmenuKindSel,
{:PmenuExtra,}:PmenuExtraSel,
x:PmenuSbar,X:PmenuThumb,*:TabLine,
@@ -4506,7 +4562,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|hl-DiffAdd| A added line in diff mode
|hl-DiffChange| C changed line in diff mode
|hl-DiffDelete| D deleted line in diff mode
|hl-DiffText| T inserted text in diff mode
|hl-DiffText| T changed text in diff mode
|hl-DiffTextAdd| E inserted text in diff mode
|hl-SignColumn| > column used for |signs|
|hl-Conceal| - the placeholders used for concealed characters
(see 'conceallevel')
@@ -5189,7 +5246,7 @@ A jump table for the options with a short description can be found at |Q_op|.
set keyprotocol=kitty:kitty,foot:kitty,ghostty:kitty,wezterm:kitty
set keyprotocol+=xterm:mok2
< This means that when 'term' contains "kitty, "foot", "ghostty" or
< This means that when 'term' contains "kitty, "foot", "ghostty" or
"wezterm" somewhere, then the "kitty" protocol is used. When 'term'
contains "xterm" somewhere, then the "mok2" protocol is used.
@@ -6555,6 +6612,15 @@ A jump table for the options with a short description can be found at |Q_op|.
global
Determines the maximum number of items to show in the popup menu for
Insert mode completion. When zero as much space as available is used.
|ins-completion-menu|.
*'pummaxwidth'* *'pmw'*
'pummaxwidth' 'pmw' number (default 0)
global
Determines the maximum width to use for the popup menu for completion.
When zero, there is no maximum width limit, otherwise the popup menu
will never be wider than this value. Truncated text will be indicated
by "..." at the end. Takes precedence over 'pumwidth'.
|ins-completion-menu|.
*'pumwidth'* *'pw'*
@@ -8631,7 +8697,8 @@ A jump table for the options with a short description can be found at |Q_op|.
< You need to do this when your system has no locale support for UTF-8.
*'termguicolors'* *'tgc'* *'notermguicolors'* *'notgc'* *E954*
'termguicolors' 'tgc' boolean (default off)
'termguicolors' 'tgc' boolean (default off unless Vim detects that it runs
in a capable terminal)
global
{not available when compiled without the
|+termguicolors| feature}
@@ -9701,7 +9768,10 @@ A jump table for the options with a short description can be found at |Q_op|.
"lastused" When completing buffer names and more than one buffer
matches, sort buffers by time last used (other than
the current buffer).
When there is only a single match, it is fully completed in all cases.
"noselect" Do not pre-select first menu item and start 'wildmenu'
if it is enabled.
When there is only a single match, it is fully completed in all cases
except when "noselect" is present.
Examples of useful colon-separated values:
"longest:full" Like "longest", but also start 'wildmenu' if it is
@@ -9724,7 +9794,11 @@ A jump table for the options with a short description can be found at |Q_op|.
:set wildmode=list,full
< List all matches without completing, then each full match >
:set wildmode=longest,list
< Complete longest common string, then list alternatives.
< Complete longest common string, then list alternatives >
:set wildmode=noselect:full
< Display 'wildmenu' without completing, then each full match >
:set wildmode=noselect:lastused,full
< Same as above, but sort buffers by time last used.
More info here: |cmdline-completion|.
*'wildoptions'* *'wop'*
+2 -1
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 Mar 21
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
+17 -9
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 Mar 15
>
GETSCRIPT REFERENCE MANUAL by Charles E. Campbell
<
@@ -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.
+6 -4
View File
@@ -1,4 +1,4 @@
*pi_gzip.txt* For Vim version 9.1. Last change: 2023 Nov 14
*pi_gzip.txt* For Vim version 9.1. Last change: 2025 Mar 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -28,12 +28,14 @@ The plugin installs autocommands to intercept reading and writing of files
with these extensions:
extension compression ~
*.Z compress (Lempel-Ziv)
*.gz gzip
*.bz2 bzip2
*.bz3 bzip3
*.gz gzip
*.lz lzip
*.lz4 lz4
*.lzma lzma
*.xz xz
*.lz lzip
*.Z compress (Lempel-Ziv)
*.zst zstd
That's actually the only thing you need to know. There are no options.
-1
View File
@@ -1 +0,0 @@
../pack/dist/opt/netrw/doc/netrw.txt
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -1,4 +1,4 @@
*popup.txt* For Vim version 9.1. Last change: 2025 Jan 08
*popup.txt* For Vim version 9.1. Last change: 2025 Feb 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -504,7 +504,7 @@ popup_menu({what}, {options}) *popup_menu()*
\ mapping: 0,
\ })
< The current line is highlighted with a match using
"PopupSelected", or "PmenuSel" if that is not defined.
|hl-PopupSelected| which is linked to "PmenuSel" by default.
Use {options} to change the properties. Should at least set
"callback" to a function that handles the selected item.
@@ -559,7 +559,7 @@ popup_notification({what}, {options}) *popup_notification()*
\ close: 'click',
\ padding: [0,1,0,1],
\ })
< The PopupNotification highlight group is used instead of
< The |hl-PopupNotification| highlight group is used instead of
WarningMsg if it is defined.
Without the |+timers| feature the popup will not disappear
+8 -1
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 Mar 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1722,6 +1722,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
+2 -1
View File
@@ -1,4 +1,4 @@
*quickref.txt* For Vim version 9.1. Last change: 2024 Nov 02
*quickref.txt* For Vim version 9.1. Last change: 2025 Feb 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -700,6 +700,7 @@ Short explanation of each option: *option-list*
'errorformat' 'efm' description of the lines in the error file
'esckeys' 'ek' recognize function keys in Insert mode
'eventignore' 'ei' autocommand events that are ignored
'eventignorewin' 'eiw' autocommand events that are ignored in a window
'expandtab' 'et' use spaces when <Tab> is inserted
'exrc' 'ex' read .vimrc and .exrc in the current directory
'fileencoding' 'fenc' file encoding for multibyte text
+11 -9
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 Feb 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -828,8 +828,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|
@@ -851,9 +852,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|) (*)
@@ -974,9 +975,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.
+61 -18
View File
@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 9.1. Last change: 2025 Jan 20
*syntax.txt* For Vim version 9.1. Last change: 2025 Mar 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1286,6 +1286,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*
@@ -2343,13 +2358,9 @@ instead, and the name of your source file should be *.pike
LUA *lua.vim* *ft-lua-syntax*
The Lua syntax file can be used for versions 4.0, 5.0, 5.1 and 5.2 (5.2 is
the default). You can select one of these versions using the global variables
lua_version and lua_subversion. For example, to activate Lua
5.1 syntax highlighting, set the variables like this: >
:let lua_version = 5
:let lua_subversion = 1
The Lua syntax file can be used for versions 4.0, 5.0+. You can select one of
these versions using the global variables |g:lua_version| and
|g:lua_subversion|.
MAIL *mail.vim* *ft-mail.vim*
@@ -3501,25 +3512,25 @@ 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)
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>.
@@ -4021,7 +4032,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*
@@ -5432,6 +5465,10 @@ in their own color.
See |:highlight-default| for the optional [default]
argument.
:hi[ghlight][!] [default] link {from-group} {to-group}
:hi[ghlight][!] [default] link {from-group} NONE
See |:hi-link|.
Normally a highlight group is added once when starting up. This sets the
default values for the highlighting. After that, you can use additional
highlight commands to change the arguments that you want to set to non-default
@@ -5795,6 +5832,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|.
@@ -5831,8 +5871,8 @@ CursorLineSign Like SignColumn when 'cursorline' is set for the cursor line.
MatchParen Character under the cursor or just before it, if it
is a paired bracket, and its match. |pi_paren.txt|
*hl-MessageWindow*
MessageWindow Messages popup window used by `:echowindow`. If not defined
|hl-WarningMsg| is used.
MessageWindow Messages popup window used by `:echowindow`. Linked to
|hl-WarningMsg| by default.
*hl-ModeMsg*
ModeMsg 'showmode' message (e.g., "-- INSERT --").
*hl-MsgArea*
@@ -5872,10 +5912,13 @@ PmenuMatchSel Popup menu: Matched text in selected item. Applied in
combination with |hl-PmenuSel|.
*hl-ComplMatchIns*
ComplMatchIns Matched text of the currently inserted completion.
*hl-PopupSelected*
PopupSelected Popup window created with |popup_menu()|. Linked to
|hl-PmenuSel| by default.
*hl-PopupNotification*
PopupNotification
Popup window created with |popup_notification()|. If not
defined |hl-WarningMsg| is used.
Popup window created with |popup_notification()|. Linked to
|hl-WarningMsg| by default.
*hl-Question*
Question |hit-enter| prompt and yes/no questions.
*hl-QuickFixLine*
+76 -13
View File
@@ -131,6 +131,7 @@ $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'*
@@ -165,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'*
@@ -234,6 +236,7 @@ $quote eval.txt /*$quote*
'ef' options.txt /*'ef'*
'efm' options.txt /*'efm'*
'ei' options.txt /*'ei'*
'eiw' options.txt /*'eiw'*
'ek' options.txt /*'ek'*
'emo' options.txt /*'emo'*
'emoji' options.txt /*'emoji'*
@@ -252,6 +255,7 @@ $quote eval.txt /*$quote*
'esckeys' options.txt /*'esckeys'*
'et' options.txt /*'et'*
'eventignore' options.txt /*'eventignore'*
'eventignorewin' options.txt /*'eventignorewin'*
'ex' options.txt /*'ex'*
'expandtab' options.txt /*'expandtab'*
'exrc' options.txt /*'exrc'*
@@ -857,6 +861,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'*
@@ -874,6 +879,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'*
@@ -2156,14 +2162,14 @@ $quote eval.txt /*$quote*
:LP pi_logipat.txt /*:LP*
:LPE pi_logipat.txt /*:LPE*
:LPF pi_logipat.txt /*:LPF*
:Launch pi_netrw.txt /*:Launch*
:Launch eval.txt /*:Launch*
:Lexplore pi_netrw.txt /*:Lexplore*
: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*
:NetrwClean pi_netrw.txt /*:NetrwClean*
:Nexplore pi_netrw.txt /*:Nexplore*
:Next editing.txt /*:Next*
:NoMatchParen pi_paren.txt /*:NoMatchParen*
@@ -2174,7 +2180,7 @@ $quote eval.txt /*$quote*
:Ntree pi_netrw.txt /*:Ntree*
:Nw pi_netrw.txt /*:Nw*
:Nwrite pi_netrw.txt /*:Nwrite*
:Open pi_netrw.txt /*:Open*
:Open eval.txt /*:Open*
:Over terminal.txt /*:Over*
:P various.txt /*:P*
:Pexplore pi_netrw.txt /*:Pexplore*
@@ -2729,6 +2735,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*
@@ -4123,7 +4131,6 @@ CmdwinEnter autocmd.txt /*CmdwinEnter*
CmdwinLeave autocmd.txt /*CmdwinLeave*
ColorScheme autocmd.txt /*ColorScheme*
ColorSchemePre autocmd.txt /*ColorSchemePre*
Colors.plist gui_mac.txt /*Colors.plist*
Command-line cmdline.txt /*Command-line*
Command-line-mode cmdline.txt /*Command-line-mode*
CompleteChanged autocmd.txt /*CompleteChanged*
@@ -4639,9 +4646,34 @@ 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*
E155 sign.txt /*E155*
E156 sign.txt /*E156*
E157 sign.txt /*E157*
@@ -5653,6 +5685,9 @@ MMFullScreenFadeTime gui_mac.txt /*MMFullScreenFadeTime*
MMLoginShell gui_mac.txt /*MMLoginShell*
MMLoginShellArgument gui_mac.txt /*MMLoginShellArgument*
MMLoginShellCommand gui_mac.txt /*MMLoginShellCommand*
MMMouseWheelDisableAcceleration gui_mac.txt /*MMMouseWheelDisableAcceleration*
MMMouseWheelMinLines gui_mac.txt /*MMMouseWheelMinLines*
MMMouseWheelNumLines gui_mac.txt /*MMMouseWheelNumLines*
MMNativeFullScreen gui_mac.txt /*MMNativeFullScreen*
MMNoFontSubstitution gui_mac.txt /*MMNoFontSubstitution*
MMNoTitleBarWindow gui_mac.txt /*MMNoTitleBarWindow*
@@ -5853,6 +5888,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*
@@ -5875,6 +5911,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*
@@ -6688,6 +6726,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*
@@ -6818,6 +6857,7 @@ 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*
@@ -6981,6 +7021,8 @@ disable-menus gui.txt /*disable-menus*
discard editing.txt /*discard*
dist#vim eval.txt /*dist#vim*
dist#vim9 eval.txt /*dist#vim9*
dist#vim9#Launch() eval.txt /*dist#vim9#Launch()*
dist#vim9#Open() eval.txt /*dist#vim9#Open()*
distribute-script usr_51.txt /*distribute-script*
distributed-plugins usr_05.txt /*distributed-plugins*
distribution intro.txt /*distribution*
@@ -7414,6 +7456,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*
@@ -7443,6 +7486,7 @@ 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-go-plugin filetype.txt /*ft-go-plugin*
ft-gprof-plugin filetype.txt /*ft-gprof-plugin*
ft-groff-syntax syntax.txt /*ft-groff-syntax*
@@ -7517,6 +7561,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*
@@ -7630,6 +7675,7 @@ g:NetrwTopLvlMenu pi_netrw.txt /*g:NetrwTopLvlMenu*
g:Netrw_UserMaps pi_netrw.txt /*g:Netrw_UserMaps*
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_curwin options.txt /*g:actual_curwin*
g:ada#Comment ft_ada.txt /*g:ada#Comment*
@@ -7677,6 +7723,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*
@@ -7724,6 +7771,9 @@ g:html_use_input_for_pc syntax.txt /*g:html_use_input_for_pc*
g:html_use_xhtml syntax.txt /*g:html_use_xhtml*
g:html_whole_filler syntax.txt /*g:html_whole_filler*
g:lf_shell_syntax syntax.txt /*g:lf_shell_syntax*
g:lua_folding filetype.txt /*g:lua_folding*
g:lua_subversion filetype.txt /*g:lua_subversion*
g:lua_version filetype.txt /*g:lua_version*
g:macvim_default_touchbar_characterpicker gui_mac.txt /*g:macvim_default_touchbar_characterpicker*
g:macvim_default_touchbar_fullscreen gui_mac.txt /*g:macvim_default_touchbar_fullscreen*
g:markdown_fenced_languages syntax.txt /*g:markdown_fenced_languages*
@@ -7735,8 +7785,6 @@ g:netrw_altv pi_netrw.txt /*g:netrw_altv*
g:netrw_banner pi_netrw.txt /*g:netrw_banner*
g:netrw_bannerbackslash pi_netrw.txt /*g:netrw_bannerbackslash*
g:netrw_browse_split pi_netrw.txt /*g:netrw_browse_split*
g:netrw_browsex_support_remote pi_netrw.txt /*g:netrw_browsex_support_remote*
g:netrw_browsex_viewer pi_netrw.txt /*g:netrw_browsex_viewer*
g:netrw_bufsettings pi_netrw.txt /*g:netrw_bufsettings*
g:netrw_chgperm pi_netrw.txt /*g:netrw_chgperm*
g:netrw_chgwin pi_netrw.txt /*g:netrw_chgwin*
@@ -7765,7 +7813,6 @@ g:netrw_ftp_timelist_cmd pi_netrw.txt /*g:netrw_ftp_timelist_cmd*
g:netrw_ftpextracmd pi_netrw.txt /*g:netrw_ftpextracmd*
g:netrw_ftpmode pi_netrw.txt /*g:netrw_ftpmode*
g:netrw_glob_escape pi_netrw.txt /*g:netrw_glob_escape*
g:netrw_gx pi_netrw.txt /*g:netrw_gx*
g:netrw_hide pi_netrw.txt /*g:netrw_hide*
g:netrw_home pi_netrw.txt /*g:netrw_home*
g:netrw_http_cmd pi_netrw.txt /*g:netrw_http_cmd*
@@ -7791,7 +7838,6 @@ 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_nogx pi_netrw.txt /*g:netrw_nogx*
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*
@@ -7817,7 +7863,6 @@ g:netrw_special_syntax pi_netrw.txt /*g:netrw_special_syntax*
g:netrw_ssh_browse_reject pi_netrw.txt /*g:netrw_ssh_browse_reject*
g:netrw_ssh_cmd pi_netrw.txt /*g:netrw_ssh_cmd*
g:netrw_sshport pi_netrw.txt /*g:netrw_sshport*
g:netrw_suppress_gx_mesg pi_netrw.txt /*g:netrw_suppress_gx_mesg*
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*
@@ -7962,6 +8007,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()*
@@ -8162,6 +8208,7 @@ gvimrc gui.txt /*gvimrc*
gw change.txt /*gw*
gwgw change.txt /*gwgw*
gww change.txt /*gww*
gx eval.txt /*gx*
gzip pi_gzip.txt /*gzip*
gzip-autocmd pi_gzip.txt /*gzip-autocmd*
gzip-example autocmd.txt /*gzip-example*
@@ -8270,6 +8317,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*
@@ -8299,6 +8347,7 @@ hl-PmenuSbar syntax.txt /*hl-PmenuSbar*
hl-PmenuSel syntax.txt /*hl-PmenuSel*
hl-PmenuThumb syntax.txt /*hl-PmenuThumb*
hl-PopupNotification syntax.txt /*hl-PopupNotification*
hl-PopupSelected syntax.txt /*hl-PopupSelected*
hl-Question syntax.txt /*hl-Question*
hl-QuickFixLine syntax.txt /*hl-QuickFixLine*
hl-Scrollbar syntax.txt /*hl-Scrollbar*
@@ -8338,6 +8387,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*
@@ -8742,6 +8792,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()*
@@ -9159,7 +9210,6 @@ netrw-call pi_netrw.txt /*netrw-call*
netrw-cb pi_netrw.txt /*netrw-cb*
netrw-cd pi_netrw.txt /*netrw-cd*
netrw-chgup pi_netrw.txt /*netrw-chgup*
netrw-clean pi_netrw.txt /*netrw-clean*
netrw-contents pi_netrw.txt /*netrw-contents*
netrw-copyright pi_netrw.txt /*netrw-copyright*
netrw-cr pi_netrw.txt /*netrw-cr*
@@ -9198,8 +9248,6 @@ netrw-gitignore pi_netrw.txt /*netrw-gitignore*
netrw-gn pi_netrw.txt /*netrw-gn*
netrw-gp pi_netrw.txt /*netrw-gp*
netrw-grep pi_netrw.txt /*netrw-grep*
netrw-gx pi_netrw.txt /*netrw-gx*
netrw-handler pi_netrw.txt /*netrw-handler*
netrw-help pi_netrw.txt /*netrw-help*
netrw-hexplore pi_netrw.txt /*netrw-hexplore*
netrw-hide pi_netrw.txt /*netrw-hide*
@@ -9328,7 +9376,6 @@ netrw-vexplore pi_netrw.txt /*netrw-vexplore*
netrw-windows-netrc pi_netrw.txt /*netrw-windows-netrc*
netrw-windows-s pi_netrw.txt /*netrw-windows-s*
netrw-write pi_netrw.txt /*netrw-write*
netrw-x pi_netrw.txt /*netrw-x*
netrw-xfer pi_netrw.txt /*netrw-xfer*
netrw.txt pi_netrw.txt /*netrw.txt*
netrw.vim pi_netrw.txt /*netrw.vim*
@@ -9434,6 +9481,7 @@ new-vimscript-8.2 version8.txt /*new-vimscript-8.2*
new-virtedit version6.txt /*new-virtedit*
news intro.txt /*news*
nextnonblank() builtin.txt /*nextnonblank()*
ngettext() builtin.txt /*ngettext()*
no-eval-feature eval.txt /*no-eval-feature*
no-type-checking eval.txt /*no-type-checking*
no_buffers_menu gui.txt /*no_buffers_menu*
@@ -9566,6 +9614,7 @@ 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*
@@ -9647,6 +9696,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*
@@ -9808,6 +9858,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*
@@ -10479,6 +10530,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*
@@ -10728,6 +10780,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*
@@ -10964,6 +11017,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()*
@@ -11049,6 +11103,13 @@ 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-type vim9.txt /*tuple-type*
tuple2list() builtin.txt /*tuple2list()*
tutor usr_01.txt /*tutor*
two-engines pattern.txt /*two-engines*
type() builtin.txt /*type()*
@@ -11246,6 +11307,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*
@@ -11385,6 +11447,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*
+1 -1
View File
@@ -1166,7 +1166,7 @@ Mouse clicks can be mapped. The codes for mouse clicks are:
The X1 and X2 buttons refer to the extra buttons found on some mice. The
'Microsoft Explorer' mouse has these buttons available to the right thumb.
Currently X1 and X2 only work on Win32 and X11 environments.
Currently X1 and X2 only work on MacVim, Win32, and X11 environments.
Examples: >
:noremap <MiddleMouse> <LeftMouse><MiddleMouse>
+8 -7
View File
@@ -1,4 +1,4 @@
*terminal.txt* For Vim version 9.1. Last change: 2025 Jan 11
*terminal.txt* For Vim version 9.1. Last change: 2025 Feb 22
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -999,7 +999,8 @@ term_wait({buf} [, {time}]) *term_wait()*
Wait for pending updates of {buf} to be handled.
{buf} is used as with |term_getsize()|.
{time} is how long to wait for updates to arrive in msec. If
not set then 10 msec will be used.
not set then 10 msec will be used. Queued messages will also
be processed similar to |:sleep|.
Can also be used as a |method|: >
GetBufnr()->term_wait()
@@ -1091,11 +1092,11 @@ Currently supported commands:
Example in JSON: >
["drop", "path/file.txt", {"ff": "dos"}]
A trick to have Vim send this escape sequence: >
exe "set t_ts=\<Esc>]51; t_fs=\x07"
let &titlestring = '["call","Tapi_TryThis",["hello",123]]'
redraw
set t_ts& t_fs&
You can use |echoraw()| to make Vim send this escape sequence: >
call echoraw("\<ESC>]51;[\"call\", \"Tapi_TryThis\", [\"hello\", 123]]\x07")
call echoraw("\<Esc>]51;[\"drop\", \"README.md\"]\x07")
Note: JSON requires double quotes around string values, hence those have to be
escaped.
Rationale: Why not allow for any command or expression? Because that might
create a security problem.
+7 -2
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: >
+16 -24
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 9.1. Last change: 2025 Jan 16
*todo.txt* For Vim version 9.1. Last change: 2025 Mar 27
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.
@@ -467,9 +465,6 @@ IDEA: when drawing the text, store the text byte index in ScreenLinesIdx[].
When converting screen column to text position use this.
The line number can be obtained from win->w_lines[].
Version of getchar() that does not move the cursor - #10603 Use a separate
argument for the new flag.
test_arglist func Test_all_not_allowed_from_cmdwin() hangs on MS-Windows.
Can we add highlighting to ":echowindow"?
@@ -709,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.
@@ -1493,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.
@@ -1517,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
@@ -1796,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)
@@ -2915,6 +2896,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)
@@ -4739,8 +4734,6 @@ Omni completion:
Insert mode completion/expansion:
- Is it possible to keep the complete menu open when calling complete()?
(Prabir Shrestha, 2017 May 19, #1713)
- When 'completeopt' has "noselect" does not insert a newline.
(Lifepillar, 2017 Apr 23, #1653)
- When complete() first argument is before where insert started and
'backspace' is Vi compatible, the completion fails.
(Hirohito Higashi, 2015 Feb 19)
@@ -6281,5 +6274,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:
+3 -3
View File
@@ -1,4 +1,4 @@
*usr_02.txt* For Vim version 9.1. Last change: 2025 Jan 16
*usr_02.txt* For Vim version 9.1. Last change: 2025 Feb 01
VIM USER MANUAL - by Bram Moolenaar
@@ -698,8 +698,8 @@ Summary: *help-summary* >
package-<name>. So >
:help package-comment
<
will bring you to the help section for the included comment plugin and how to
enable it.
will bring you to the help section for the included comment plugin and how
to enable it.
==============================================================================
+28 -3
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 Mar 22
VIM USER MANUAL - by Bram Moolenaar
@@ -437,7 +437,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 +450,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 +464,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|.
+2 -2
View File
@@ -1,4 +1,4 @@
*usr_25.txt* For Vim version 9.1. Last change: 2025 Jan 11
*usr_25.txt* For Vim version 9.1. Last change: 2025 Feb 01
VIM USER MANUAL - by Bram Moolenaar
@@ -190,7 +190,7 @@ This results in the following:
story. ~
JUSTIFYING TEXT *justify* *:Justify* *Justify()* *package-justify*
JUSTIFYING TEXT *justify* *:Justify* *Justify()* *package-justify*
Vim has no built-in way of justifying text. However, there is a neat macro
package that does the job. To use this package, execute the following
+46 -3
View File
@@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 9.1. Last change: 2025 Jan 16
*usr_41.txt* For Vim version 9.1. Last change: 2025 Mar 23
VIM USER MANUAL - by Bram Moolenaar
@@ -801,6 +801,7 @@ String manipulation: *string-functions*
trim() trim characters from a string
bindtextdomain() set message lookup translation base path
gettext() lookup message translation
ngettext() lookup single/plural message translation
str2blob() convert a list of strings into a blob
blob2str() convert a blob into a list of strings
@@ -838,6 +839,30 @@ List manipulation: *list-functions*
repeat() repeat a List multiple times
flatten() flatten a List
flattennew() flatten a copy of a List
items() get List of List index-value pairs
Tuple manipulation: *tuple-functions*
copy() make a shallow copy of a Tuple
count() count number of times a value appears in a
Tuple
deepcopy() make a full copy of a Tuple
empty() check if Tuple is empty
foreach() apply function to Tuple items
get() get an item without error for wrong index
index() index of a value in a Tuple
indexof() index in a Tuple where an expression is true
items() get List of Tuple index-value pairs
join() join Tuple items into a String
len() number of items in a Tuple
list2tuple() convert a list of items into a Tuple
max() maximum value in a Tuple
min() minimum value in a Tuple
reduce() reduce a Tuple to a value
repeat() repeat a Tuple multiple times
reverse() reverse the order of items in a Tuple
slice() take a slice of a Tuple
string() string representation of a Tuple
tuple2list() convert a Tuple of items into a list
Dictionary manipulation: *dict-functions*
get() get an entry without an error for a wrong key
@@ -1233,6 +1258,7 @@ Testing: *test-functions*
test_null_list() return a null List
test_null_partial() return a null Partial function
test_null_string() return a null String
test_null_tuple() return a null Tuple
test_settime() set the time Vim uses internally
test_setmouse() set the mouse position
test_feedinput() add key sequence to input buffer
@@ -1651,8 +1677,8 @@ More information about defining your own functions here: |user-functions|.
==============================================================================
*41.8* Lists and Dictionaries
So far we have used the basic types String and Number. Vim also supports two
composite types: List and Dictionary.
So far we have used the basic types String and Number. Vim also supports
three composite types: List, Tuple and Dictionary.
A List is an ordered sequence of items. The items can be any kind of value,
thus you can make a List of numbers, a List of Lists and even a List of mixed
@@ -1753,6 +1779,23 @@ This looks into lines 1 to 50 (inclusive) and echoes any date found in there.
For further reading see |Lists|.
TUPLE
A Tuple is an immutable ordered sequence of items. An item can be of any
type. Items can be accessed by their index number. To create a Tuple with
three strings: >
var atuple = ('one', 'two', 'three')
The Tuple items are enclosed in parenthesis and separated by commas. To
create an empty Tuple: >
var atuple = ()
The |:for| loop can be used to iterate over the items in a Tuple similar to a
List.
For further reading see |Tuples|.
DICTIONARIES
+8 -9
View File
@@ -1,4 +1,4 @@
*usr_52.txt* For Vim version 9.1. Last change: 2024 Oct 07
*usr_52.txt* For Vim version 9.1. Last change: 2025 Mar 17
VIM USER MANUAL - by Bram Moolenaar
@@ -346,11 +346,8 @@ Have a look at the package located at $VIMRUNTIME/pack/dist/opt/comment/
HIGHLIGHT YANK PLUGIN
Here is an example for highlighting the yanked region. It makes use of the
|getregionpos()| function, available since Vim 9.1.0446.
Copy the following example into a new file and place it into your plugin directory
and it will be active next time you start Vim. |add-plugin|: >
Vim comes with the highlight-yank plugin, written in Vim9 script
|hlyank-install|, here is a simplified implementation: >vim
vim9script
@@ -362,11 +359,10 @@ and it will be active next time you start Vim. |add-plugin|: >
endif
var [beg, end] = [getpos("'["), getpos("']")]
var type = v:event.regtype ?? 'v'
var pos = getregionpos(beg, end, {type: type})
var end_offset = (type == 'V' || v:event.inclusive) ? 1 : 0
var pos = getregionpos(beg, end, {type: type, exclusive: false})
var m = matchaddpos(hlgroup, pos->mapnew((_, v) => {
var col_beg = v[0][2] + v[0][3]
var col_end = v[1][2] + v[1][3] + end_offset
var col_end = v[1][2] + v[1][3] + 1
return [v[0][1], col_beg, col_end - col_beg]
}))
var winid = win_getid()
@@ -376,6 +372,9 @@ and it will be active next time you start Vim. |add-plugin|: >
autocmd TextYankPost * HighlightedYank()
<
For the complete example, have a look into the package located at
`$VIMRUNTIME/pack/dist/opt/hlyank/`
==============================================================================
Next chapter: |usr_90.txt| Installing Vim
+20 -32
View File
@@ -1,4 +1,4 @@
*usr_90.txt* For Vim version 9.1. Last change: 2024 Oct 05
*usr_90.txt* For Vim version 9.1. Last change: 2025 Mar 03
VIM USER MANUAL - by Bram Moolenaar
@@ -28,20 +28,18 @@ is installed in differs.
used. But this may be different for your system. Try finding out where other
packages are installed.
When installing for a single user, you can use your home directory as the
base. The files will be placed in subdirectories like "bin" and "shared/vim".
base. The files will be placed in subdirectories like "bin" and "share/vim".
FROM A PACKAGE
You can get precompiled binaries for many different UNIX systems. There is a
long list with links on this page:
Depending on the Unix/Linux system used, there may exist pre-compiled binary
packages. You need to search for this. We used to keep a list for different
UNIX systems, but that list was outdated so the list was removed.
http://www.vim.org/binaries.html
Volunteers maintain the binaries, so they are often out of date. It is a
good idea to compile your own UNIX version from the source. Also, creating
the editor from the source allows you to control which features are compiled.
This does require a compiler though.
It is a good idea to compile your own UNIX version from the source. Also,
creating the editor from the source allows you to control which features are
compiled. This does require a compiler though.
If you have a Linux distribution, the "vi" program is probably a minimal
version of Vim. It doesn't do syntax highlighting, for example. Try finding
@@ -52,23 +50,18 @@ FROM SOURCES
To compile and install Vim, you will need the following:
- A C compiler (GCC preferred)
- The GZIP program (you can get it from www.gnu.org)
- The Vim source and runtime archives
- A C compiler (GCC or clang preferred)
- git (optionally, only when cloning from github)
- zip/unzip (to uncompress the archive)
- The Vim source archives
To get the Vim archives, look in this file for a mirror near you, this should
provide the fastest download:
To download the Vim source, you can either clone it from the Github project
page: >
git clone https://github.com/vim/vim.git
<
or download the archive directly using:
ftp://ftp.vim.org/pub/vim/MIRRORS
Or use the home site ftp.vim.org, if you think it's fast enough. Go to the
"unix" directory and you'll find a list of files there. The version number is
embedded in the file name. You will want to get the most recent version.
You can get the files for Unix in one big archive that contains everything:
vim-8.2.tar.bz2 ~
You need the bzip2 program to uncompress it.
https://github.com/vim/vim/archive/refs/heads/master.zip
COMPILING
@@ -80,17 +73,12 @@ First create a top directory to work in, for example: >
Then unpack the archives there. You can unpack it like this: >
tar xf path/vim-8.2.tar.bz2
unzip vim-master.zip
If your tar command doesn't support bz2 directly: >
bzip2 -d -c path/vim-8.2.tar.bz2 | tar xf -
Change "path" to where you have downloaded the file.
If you are satisfied with getting the default features, and your environment
is setup properly, you should be able to compile Vim with just this: >
cd vim82/src
cd vim-master/src
make
The make program will run configure and compile everything. Further on we
+3 -4
View File
@@ -1,4 +1,4 @@
*various.txt* For Vim version 9.1. Last change: 2024 Dec 16
*various.txt* For Vim version 9.1. Last change: 2025 Feb 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -768,9 +768,8 @@ K Run a program to lookup the keyword under the
MS-Windows). "gs" stands for "goto sleep".
While sleeping the cursor is positioned in the text,
if at a visible position.
Also process the received netbeans messages. {only
available when compiled with the |+netbeans_intg|
feature}
Queued messages and timers (|+timers|) are processed
during the sleep as well.
*:sl!* *:sleep!*
:[N]sl[eep]! [N][m] Same as above, but hide the cursor.
+92 -43
View File
@@ -1,4 +1,4 @@
*version9.txt* For Vim version 9.1. Last change: 2025 Jan 23
*version9.txt* For Vim version 9.1. Last change: 2025 Mar 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -41551,10 +41551,23 @@ Add support for internal builtin functions with vim9 objects, see
Enum support for Vim9 script |:enum|
Support for protected _new() method
Diff mode ~
---------
Include the "linematch" algorithm for the 'diffopt' setting. This aligns
changes between buffers on similar lines improving the diff highlighting in
Vim
Improve the diff highlighting for changes within a line. Configurable using
the "inline" sub option value for the 'diffopt' setting, with "inline:simple"
being added to the default "diffopt" value (but this does not change how diff
mode works).
*new-other-9.2*
Other new features ~
------------------
The new plugins |comment-install| and |nohlsearch-install| are included.
The new packages |package-comment|, |package-nohlsearch| and |package-hlyank|
are included.
Support for Wayland UI.
@@ -41563,69 +41576,92 @@ Support for the XDG Desktop Specification |xdg-base-dir|
Support for translating messages in Vim script plugins using the |gettext()|
and |bindtextdomain()| functions.
Support highlighting the matched text and the completion kind for insert-mode
Support highlighting the matched text and the completion kind for insert-mode
completion and command-line completion in |ins-completion-menu|, see
|complete-items|
Include the "linematch" algorithm for the 'diffopt' setting. This aligns
changes between buffers on similar lines improving the diff highlighting in
Vim
Support for the |Tuple| data type in Vim script and Vim9 script.
*changed-9.2*
Changed~
-------
- use 'smoothscroll' logic for CTRL-F and CTRL-B for pagewise scrolling
- use 'smoothscroll' logic for CTRL-D and CTRL-U for half-pagewise scrolling
- the default for 'commentstring' contains whitespace padding to have
automatic comments look nicer |comment-install|
- 'completeopt' is now a |global-local| option.
- 'nrformats' accepts the new "blank" suboption, to determine a signed or
unsigned number based on whitespace in front of a minus sign.
- allow to specify a priority when defining a new sign |:sign-define|
- provide information about function arguments using the get(func, "arity")
function |get()-func|
- |:bwipe| also wipes jumplist and tagstack data
- moving in the buffer list using |:bnext| and similar commands, behaves as
documented and skips help buffers (if not run from a help buffer, else
moves to the next/previous help buffer).
Default values: ~
- the default 'history' option value has been increased to 200 and removed
from |defaults.vim|
- the default 'backspace' option for Vim has been set to "indent,eol,start"
and removed from |defaults.vim|
- the default fontsize for the GTK builds of Vim (Windows and Unix) has been
increased to 12pt to accomodate modern high-dpi monitors
- the default value of the 'keyprotocol' option has been updated and support
for the ghostty terminal emulator (using kitty protocol) has been added
Completion: ~
- allow to complete directories from 'cdpath' for |:cd| and similar commands,
add the "cd_in_path" completion type for e.g. |:command-complete| and
|getcompletion()|
- allow to complete shell commands and files using the new shellcmdline
completion type using |:command-complete| and |getcmdcomplpat()|
- add 'cpoptions' flag "z" |cpo-z|, to disable some (traditional) vi
behaviour/inconsistency (see |d-special| and |cw|).
- allow to specify additional attributes in the completion menu (allows to
mark deprecated attributes from LSP server) |complete-items|
- the regex engines match correctly case-insensitive multi-byte characters
(and apply proper case folding)
- the completed word and completion type are provided when handling the
|CompleteDone| autocommand in the |v:event| dictionary
- |complete_info()| returns the list of matches shown in the poppu menu via
the "matches" key
- New option value for 'completeopt':
"nosort" - do not sort completion results
"preinsert" - highlight to be inserted values
- handle multi-line completion as expected
- improved commandline completion for the |:hi| command
- New option value for 'wildmode':
"noselect" - do not auto select an entry in the wildmenu
Options: ~
- the default for 'commentstring' contains whitespace padding to have
automatic comments look nicer |comment-install|
- 'completeopt' is now a |global-local| option.
- 'nrformats' accepts the new "blank" suboption, to determine a signed or
unsigned number based on whitespace in front of a minus sign.
- add 'cpoptions' flag "z" |cpo-z|, to disable some (traditional) vi
behaviour/inconsistency (see |d-special| and |cw|).
- 'rulerformat' now supports the |stl-%!| item
- use 'smoothscroll' logic for CTRL-F / CTRL-B for pagewise scrolling
and CTRL-D / CTRL-U for half-pagewise scrolling
- 'pummaxwidth' maximum width for the completion popup menu
Ex commands: ~
- allow to specify a priority when defining a new sign |:sign-define|
- |:bwipe| also wipes jumplist and tagstack data
- moving in the buffer list using |:bnext| and similar commands, behaves as
documented and skips help buffers (if not run from a help buffer, else
moves to the next/previous help buffer).
- |:keeppatterns| preserves the last substitute pattern when used with |:s|
Functions: ~
- provide information about function arguments using the get(func, "arity")
function |get()-func|
- |setqflist()| and |setloclist()| can optionally try to preserve the current
selection in the quickfix list with the "u" action.
- allow to pass local Vim script variables to python interpreter |py3eval()|
- |getwininfo()| now also returns the "leftcol" property for a window
- |v:stacktrace| The stack trace of the exception most recently caught and
not finished
- Add the optional {opts} |Dict| argument to |getchar()| to control: cursor
behaviour, return type and whether or not to simplify the returned key
Others: ~
- the regex engines match correctly case-insensitive multi-byte characters
(and apply proper case folding)
- the putty terminal is detected using an |TermResponse| autocommand in
|defaults.vim| and Vim switches to a dark background
- the |help-TOC| package is included to ease navigating the documentation.
- an interactive tutor plugin has been included |vim-tutor-mode|, can be
started via |:Tutor|
- improve the |vimtutor| and add a second chapter for more advanced tips
- allow to pass local Vim script variables to python interpreter |py3eval()|
- |getwininfo()| now also returns the "leftcol" property for a window
- 'rulerformat' now supports the |stl-%!| item
- the default 'history' option value has been increased to 200 and removed
from |defaults.vim|
- the default 'backspace' option for Vim has been set to "indent,eol,start"
and removed from |defaults.vim|
- the completed word and completion type are provided when handling the
|CompleteDone| autocommand in the |v:event| dictionary
- the default fontsize for the GTK builds of Vim (Windows and Unix) has been
increased to 12pt to accomodate modern high-dpi monitors
- the default value of the 'keyprotocol' option has been updated by support
for the ghostty terminal emulator (using kitty protocol)
- |complete_info()| returns the list of matches shown in the poppu menu via
the "matches" key
- |v:stacktrace| The stack trace of the exception most recently caught and
not finished
- New option value "nosort" for 'completeopt'
- add |dist#vim9#Launch()| and |dist#vim9#Open()| to the |vim-script-library|
and decouple it from |netrw|
- new digraph "APPROACHES THE LIMIT" using ".="
- |CTRL-C| always closes the active |popup-window|.
*added-9.2*
Added ~
@@ -41649,10 +41685,14 @@ Functions: ~
|getstacktrace()| get current stack trace of Vim scripts
|id()| get unique identifier for a Dict, List, Object,
Channel or Blob variable
|list2tuple()| turn a List of items into a Tuple
|matchbufline()| all the matches of a pattern in a buffer
|matchstrlist()| all the matches of a pattern in a List of strings
|ngettext()| lookup single/plural message translation
|popup_setbuf()| switch to a different buffer in a popup
|str2blob()| convert a List of strings into a blob
|test_null_tuple()| return a null tuple
|tuple2list()| turn a Tuple of items into a List
Autocommands: ~
@@ -41660,6 +41700,7 @@ Autocommands: ~
|CursorMovedC| after the cursor was moved in the command-line
|KeyInputPre| before processing any key event in any mode
|SessionWritePost| after writing the session file |:mksession|
|TabClosedPre| before closing a |tabpage|.
|TermResponseAll| after the terminal response to |t_RV| and others is
received
|WinNewPre| before creating a new window
@@ -41667,7 +41708,8 @@ Autocommands: ~
Highlighting: ~
|hl-ComplMatchIns| matched text of the currently inserted completion.
|hl-ComplMatchIns| matched text of the currently inserted completion
|hl-DiffTextAdd| added text within a changed line
|hl-MsgArea| highlighting of the Command-line and messages area
|hl-PmenuMatch| Popup menu: highlighting of matched text
|hl-PmenuMatchSel| Popup menu: highlighting of matched text in selected
@@ -41676,13 +41718,20 @@ Highlighting: ~
Commands: ~
|[r| and |]r| to move the cursor to previous/next rare word
Ex-Commands: ~
|:iput| like |:put| but adjust indent
|:pbuffer| Edit buffer [N] from the buffer list in the preview
window
Options: ~
'completefuzzycollect' Enable fuzzy collection of candiates for (some)
|ins-completion| modes
'completeitemalign' Order of |complete-items| in Insert mode completion
popup
'eventignorewin' autocommand events that are ignored in a window
'findfunc' Vim function to obtain the results for a |:find|
command
'messagesopt' configure |:messages| and |hit-enter| prompt
+42 -6
View File
@@ -1,4 +1,4 @@
*vim9.txt* For Vim version 9.1. Last change: 2025 Jan 21
*vim9.txt* For Vim version 9.1. Last change: 2025 Mar 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1001,6 +1001,7 @@ empty list and dict is falsy:
string non-empty
blob non-empty
list non-empty (different from JavaScript)
tuple non-empty (different from JavaScript)
dictionary non-empty (different from JavaScript)
func when there is a function name
special true or v:true
@@ -1048,6 +1049,7 @@ In Vim9 script one can use the following predefined values: >
null_function
null_job
null_list
null_tuple
null_object
null_partial
null_string
@@ -1467,15 +1469,16 @@ The following builtin types are supported:
dict<{type}>
job
channel
tuple<{type}>
tuple<{type}, {type}, ...>
tuple<...list<{type}>>
tuple<{type}, ...list<{type}>>
func
func: {type}
func({type}, ...)
func({type}, ...): {type}
void
Not supported yet:
tuple<a: {type}, b: {type}, ...>
These types can be used in declarations, but no simple value will actually
have the "void" type. Trying to use a void (e.g. a function without a
return value) results in error *E1031* *E1186* .
@@ -1483,6 +1486,32 @@ return value) results in error *E1031* *E1186* .
There is no array type, use list<{type}> instead. For a list constant an
efficient implementation is used that avoids allocating a lot of small pieces
of memory.
*tuple-type*
A tuple type can be declared in more or less specific ways:
tuple<number> a tuple with a single item of type |Number|
tuple<number, string> a tuple with two items of type |Number| and
|String|
tuple<number, float, bool> a tuple with three items of type |Number|,
|Float| and |Boolean|.
tuple<...list<number>> a variadic tuple with zero or more items of
type |Number|.
tuple<number, ...list<string>> a tuple with an item of type |Number| followed
by zero or more items of type |String|.
Examples: >
var myTuple: tuple<number> = (20,)
var myTuple: tuple<number, string> = (30, 'vim')
var myTuple: tuple<number, float, bool> = (40, 1.1, true)
var myTuple: tuple<...list<string>> = ('a', 'b', 'c')
var myTuple: tuple<number, ...list<string>> = (3, 'a', 'b', 'c')
<
*variadic-tuple* *E1539*
A variadic tuple has zero or more items of the same type. The type of a
variadic tuple must end with a list type. Examples: >
var myTuple: tuple<...list<number>> = (1, 2, 3)
var myTuple: tuple<...list<string>> = ('a', 'b', 'c')
var myTuple: tuple<...list<bool>> = ()
<
*vim9-func-declaration* *E1005* *E1007*
A partial and function can be declared in more or less specific ways:
func any kind of function reference, no type
@@ -1707,7 +1736,8 @@ argument type checking: >
*E1211* *E1217* *E1218* *E1219* *E1220* *E1221*
*E1222* *E1223* *E1224* *E1225* *E1226* *E1227*
*E1228* *E1238* *E1250* *E1251* *E1252* *E1256*
*E1297* *E1298* *E1301*
*E1297* *E1298* *E1301* *E1528* *E1529* *E1530*
*E1531* *E1534*
Types are checked for most builtin functions to make it easier to spot
mistakes.
@@ -1715,7 +1745,7 @@ Categories of variables, defaults and null handling ~
*variable-categories* *null-variables*
There are categories of variables:
primitive number, float, boolean
container string, blob, list, dict
container string, blob, list, tuple, dict
specialized function, job, channel, user-defined-object
When declaring a variable without an initializer, an explicit type must be
@@ -1845,6 +1875,7 @@ An uninitialized variable is usually equal to null; it depends on its type:
var s: string s == null
var b: blob b != null ***
var l: list<any> l != null ***
var t: tuple<any> t != null ***
var d: dict<any> d != null ***
var f: func f == null
var j: job j == null
@@ -1855,6 +1886,7 @@ A variable initialized to empty equals null_<type>; but not null:
var s2: string = "" == null_string != null
var b2: blob = 0z == null_blob != null
var l2: list<any> = [] == null_list != null
var t2: tuple<any> = () == null_tuple != null
var d2: dict<any> = {} == null_dict != null
NOTE: the specialized variables, like job, default to null value and have no
@@ -1921,6 +1953,10 @@ There is one way to use both legacy and Vim9 syntax in one script file: >
This allows for writing a script that takes advantage of the Vim9 script
syntax if possible, but will also work on a Vim version without it.
Note that Vim9 syntax changed before Vim 9 so that scripts using the current
syntax (such as "import from" instead of "import") might throw errors.
To prevent these, a safer check could be for |v:version| >= 900 instead.
This can only work in two ways:
1. The "if" statement evaluates to false, the commands up to `endif` are
skipped and `vim9script` is then the first command actually executed.
+14 -22
View File
@@ -1,4 +1,4 @@
*vim9class.txt* For Vim version 9.1. Last change: 2024 Dec 29
*vim9class.txt* For Vim version 9.1. Last change: 2025 Feb 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -52,7 +52,6 @@ An interface is used to specify properties of an object:
The class hierarchy allows for single inheritance. Otherwise interfaces are
to be used where needed.
Class modeling ~
You can model classes any way you like. Keep in mind what you are building,
@@ -122,7 +121,6 @@ using the object name followed by a dot following by the member: >
A class name cannot be used as an expression. A class name cannot be used in
the left-hand-side of an assignment.
Object variable write access ~
*read-only-variable*
Now try to change an object variable directly: >
@@ -272,6 +270,9 @@ no need to call "super()" or "new()" on the parent.
When defining the new() method the return type should not be specified. It
always returns an object of the class.
The new() method can be made a protected method by using "_new()". This can
be used to support the singleton design pattern.
*E1386*
When invoking an object method, the method name should be preceded by the
object variable name. An object method cannot be invoked using the class
@@ -623,13 +624,15 @@ once. They can appear in any order, although this order is recommended: >
extends ClassName
implements InterfaceName, OtherInterface
specifies SomeInterface
< *E1355* *E1369*
<
The "specifies" feature is currently not implemented.
*E1355* *E1369*
Each variable and method name can be used only once. It is not possible to
define a method with the same name and different type of arguments. It is not
possible to use a public and protected member variable with the same name. An
object variable name used in a super class cannot be reused in a child class.
Object Variable Initialization ~
If the type of a variable is not explicitly specified in a class, then it is
@@ -686,13 +689,12 @@ A class can implement one or more interfaces. The "implements" keyword can
only appear once *E1350* . Multiple interfaces can be specified, separated by
commas. Each interface name can appear only once. *E1351*
A class defining an interface ~
*specifies*
A class can declare its interface, the object variables and methods, with a
named interface. This avoids the need for separately specifying the
interface, which is often done in many languages, especially Java.
TODO: This is currently not implemented.
Items in a class ~
*E1318* *E1325* *E1388*
@@ -733,25 +735,25 @@ Some of the builtin functions like |empty()|, |len()| and |string()| can be
used with an object. An object can implement a method with the same name as
these builtin functions to return an object-specific value.
*E1412*
*E1412*
The following builtin methods are supported:
*object-empty()*
*object-empty()*
empty() Invoked by the |empty()| function to check whether an object is
empty. If this method is missing, then true is returned. This
method should not accept any arguments and must return a boolean.
*object-len()*
*object-len()*
len() Invoked by the |len()| function to return the length of an
object. If this method is missing in the class, then an error is
given and zero is returned. This method should not accept any
arguments and must return a number.
*object-string()*
*object-string()*
string() Invoked by the |string()| function to get a textual
representation of an object. Also used by the |:echo| command
for an object. If this method is missing in the class, then a
built-in default textual representation is used. This method
should not accept any arguments and must return a string.
*E1413*
*E1413*
A class method cannot be used as a builtin method.
Defining an interface ~
@@ -783,7 +785,6 @@ An interface can only be defined in a |Vim9| script file. *E1342*
An interface cannot "implement" another interface but it can "extend" another
interface. *E1381*
null object ~
When a variable is declared to have the type of an object, but it is not
@@ -792,7 +793,6 @@ does not know what class was supposed to be used. Vim then cannot check if
a variable name is correct and you will get a "Using a null object" error,
even when the variable name is invalid. *E1360* *E1362*
Default constructor ~
*default-constructor*
In case you define a class without a new() method, one will be automatically
@@ -1115,7 +1115,6 @@ For |Vim9| script using the same method name for all constructors seemed like
the right choice, and by calling it new() the relation between the caller and
the method being called is obvious.
No overloading of the constructor ~
In Vim script, both legacy and |Vim9| script, there is no overloading of
@@ -1136,7 +1135,6 @@ That way multiple constructors with different arguments are possible, while it
is very easy to see which constructor is being used. And the type of
arguments can be properly checked.
No overloading of methods ~
Same reasoning as for the constructor: It is often not obvious what type
@@ -1145,7 +1143,6 @@ actually being called. Better just give the methods a different name, then
type checking will make sure it works as you intended. This rules out
polymorphism, which we don't really need anyway.
Single inheritance and interfaces ~
Some languages support multiple inheritance. Although that can be useful in
@@ -1161,7 +1158,6 @@ it will be checked if that change was also changed. The mechanism to assume a
class implements an interface just because the methods happen to match is
brittle and leads to obscure problems, let's not do that.
Using "this.variable" everywhere ~
The object variables in various programming languages can often be accessed in
@@ -1180,7 +1176,6 @@ variables. Simple and consistent. When looking at the code inside a class
it's also directly clear which variable references are object variables and
which aren't.
Using class variables ~
Using "static variable" to declare a class variable is very common, nothing
@@ -1194,7 +1189,6 @@ the class. This has two problems: The class name can be rather long, taking
up quite a bit of space, and when the class is renamed all these places need
to be changed too.
Declaring object and class variables ~
The main choice is whether to use "var" as with variable declarations.
@@ -1248,7 +1242,6 @@ function declaration syntax for class/object variables and methods. Vim9 also
reuses the general function declaration syntax for methods. So, for the sake
of consistency, we require "var" in these declarations.
Using "ClassName.new()" to construct an object ~
Many languages use the "new" operator to create an object, which is actually
@@ -1312,7 +1305,6 @@ An alternative would have been using the "protected" keyword, just like
"public" changes the access in the other direction. Well, that's just to
reduce the number of keywords.
No private object variables ~
Some languages provide several ways to control access to object variables.
+44 -20
View File
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2025 Jan 21
" Last Change: 2025 Mar 18
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Listen very carefully, I will say this only once
@@ -51,8 +51,11 @@ func s:StarSetf(ft)
endif
endfunc
" Vim help file
au BufNewFile,BufRead $VIMRUNTIME/doc/*.txt setf help
" Vim help file, set ft explicitly, because 'modeline' might be off
au BufNewFile,BufRead */doc/*.txt
\ if getline('$') =~ '\(^\|\s\)vim:.*\<\(ft\|filetype\)=help\>'
\| setf help
\| endif
" Abaqus or Trasys
au BufNewFile,BufRead *.inp call dist#ft#Check_inp()
@@ -75,6 +78,9 @@ au BufNewFile,BufRead *.abc setf abc
" ABEL
au BufNewFile,BufRead *.abl setf abel
" ABNF
au BufNewFile,BufRead *.abnf setf abnf
" AceDB
au BufNewFile,BufRead *.wrm setf acedb
@@ -341,6 +347,11 @@ au BufNewFile,BufRead *.capnp setf capnp
" Cgdb config file
au BufNewFile,BufRead cgdbrc setf cgdbrc
" m17n database files. */m17n/* matches installed files, */.m17n.d/* matches
" per-user config files, */m17n-db/* matches the git repo. (must be before
" *.cs)
au BufNewFile,BufRead */{m17n,.m17n.d,m17n-db}/*.{ali,cs,dir,flt,fst,lnm,mic,mim,tbl} setf m17ndb
" C#
au BufNewFile,BufRead *.cs,*.csx,*.cake setf cs
@@ -384,6 +395,12 @@ au BufNewFile,BufRead *.cdl setf cdl
" Conary Recipe
au BufNewFile,BufRead *.recipe setf conaryrecipe
" Containers config files
au BufNewFile,BufRead */containers/containers.conf{,.d/*.conf} setf toml
au BufNewFile,BufRead */containers/containers.conf.modules/*.conf setf toml
au BufNewFile,BufRead */containers/registries.conf{,.d/*.conf} setf toml
au BufNewFile,BufRead */containers/storage.conf setf toml
" Corn config file
au BufNewFile,BufRead *.corn setf corn
@@ -952,7 +969,7 @@ au BufNewFile,BufRead */etc/gitattributes setf gitattributes
au BufNewFile,BufRead .gitignore,*.git/info/exclude setf gitignore
au BufNewFile,BufRead */.config/git/ignore,*.prettierignore setf gitignore
au BufNewFile,BufRead */.config/fd/ignore,.fdignore,.ignore setf gitignore
au BufNewFile,BufRead .rgignore,.dockerignore setf gitignore
au BufNewFile,BufRead .rgignore,.dockerignore,.containerignore setf gitignore
au BufNewFile,BufRead .npmignore,.vscodeignore setf gitignore
au BufNewFile,BufRead git-rebase-todo setf gitrebase
au BufRead,BufNewFile .gitsendemail.msg.?????? setf gitsendemail
@@ -1797,7 +1814,7 @@ au BufNewFile,BufRead *.hook
au BufNewFile,BufRead {.,}makepkg.conf setf sh
" Pacman log
au BufNewFile,BufRead pacman.log setf pacmanlog
au BufRead pacman.log* call s:StarSetf('pacmanlog')
" Pam conf
au BufNewFile,BufRead */etc/pam.conf setf pamconf
@@ -2212,7 +2229,7 @@ au BufNewFile,BufRead *.sass setf sass
au BufNewFile,BufRead *.sa call dist#ft#FTsa()
" Scala
au BufNewFile,BufRead *.scala setf scala
au BufNewFile,BufRead *.scala,*.mill setf scala
" SBT - Scala Build Tool
au BufNewFile,BufRead *.sbt setf sbt
@@ -2347,8 +2364,8 @@ au BufNewFile,BufRead *.zsh,*.zsh-theme,*.zunit setf zsh
" Salt state files
au BufNewFile,BufRead *.sls setf salt
" Scheme, Supertux configuration, Lips.js history ("racket" patterns are now separate, see above)
au BufNewFile,BufRead *.scm,*.ss,*.sld,*.stsg,*/supertux2/config,.lips_repl_history setf scheme
" Scheme, Supertux configuration, Lips.js history, Guile init file ("racket" patterns are now separate, see above)
au BufNewFile,BufRead *.scm,*.ss,*.sld,*.stsg,*/supertux2/config,.lips_repl_history,.guile setf scheme
" Screen RC
au BufNewFile,BufRead .screenrc,screenrc setf screen
@@ -2498,6 +2515,10 @@ au BufNewFile,BufRead *.class
" SMCL
au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl setf smcl
" SPA JSON
au BufNewFile,BufRead */pipewire/*.conf setf spajson
au BufNewFile,BufRead */wireplumber/*.conf setf spajson
" Stored Procedures
au BufNewFile,BufRead *.stp setf stp
@@ -2596,6 +2617,9 @@ au BufRead,BufNewFile *.ttl
" Terminfo
au BufNewFile,BufRead *.ti setf terminfo
" Tera
au BufRead,BufNewFile *.tera setf tera
" Terraform variables
au BufRead,BufNewFile *.tfvars setf terraform-vars
@@ -2640,13 +2664,13 @@ au BufNewFile,BufRead *.tla setf tla
au BufNewFile,BufRead {.,}tmux*.conf setf tmux
" TOML
au BufNewFile,BufRead *.toml setf toml
au BufNewFile,BufRead *.toml,uv.lock setf toml
" TPP - Text Presentation Program
au BufNewFile,BufRead *.tpp setf tpp
" TRACE32 Script Language
au BufNewFile,BufRead *.cmm,*.t32 setf trace32
au BufNewFile,BufRead *.cmm,*.cmmt,*.t32 setf trace32
" Treetop
au BufRead,BufNewFile *.treetop setf treetop
@@ -3273,7 +3297,7 @@ au BufNewFile,BufRead XF86Config*
\|call s:StarSetf('xf86conf')
" XKB
au BufNewFile,BufRead */usr/share/X11/xkb/{compat,geometry,keycodes,symbols,types}/* call s:StarSetf('xkb')
au BufNewFile,BufRead */{,.}xkb/{compat,geometry,keycodes,symbols,types}/* call s:StarSetf('xkb')
" X11 xmodmap
au BufNewFile,BufRead *xmodmap* call s:StarSetf('xmodmap')
@@ -3284,6 +3308,15 @@ au BufNewFile,BufRead */etc/xinetd.d/* call s:StarSetf('xinetd')
" yum conf (close enough to dosini)
au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini')
" Yarn lock
au BufNewFile,BufRead yarn.lock setf yaml
" Zathurarc
au BufNewFile,BufRead zathurarc setf zathurarc
" Rofi stylesheet
au BufNewFile,BufRead *.rasi setf rasi
" Z-Shell script ending in a star
au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump* call s:StarSetf('zsh')
au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh')
@@ -3329,15 +3362,6 @@ au filetypedetect BufNewFile,BufRead,StdinReadPost *
\ setf FALLBACK conf |
\ endif
" Yarn lock
au BufNewFile,BufRead yarn.lock setf yaml
" Zathurarc
au BufNewFile,BufRead zathurarc setf zathurarc
" Rofi stylesheet
au BufNewFile,BufRead *.rasi setf rasi
" If the GUI is already running, may still need to install the Syntax menu.
" Don't do it when the 'M' flag is included in 'guioptions'.
if has("menu") && has("gui_running")
+5 -3
View File
@@ -2,8 +2,7 @@
" Language: C#
" Maintainer: Nick Jensen <nickspoon@gmail.com>
" Former Maintainer: Johannes Zellner <johannes@zellner.org>
" Last Change: 2022-11-16
" 2024 Jan 14 by Vim Project (browsefilter)
" Last Change: 2025-03-14
" License: Vim (see :h license)
" Repository: https://github.com/nickspoons/vim-cs
@@ -21,8 +20,11 @@ setlocal formatoptions-=t formatoptions+=croql
" Set 'comments' to format dashed lists in comments.
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
setlocal commentstring=//\ %s
let b:undo_ftplugin = 'setl com< fo<'
setlocal cinoptions=J1
let b:undo_ftplugin = 'setl com< fo< cino<'
if exists('loaded_matchit') && !exists('b:match_words')
" #if/#endif support included by default
+11
View File
@@ -0,0 +1,11 @@
" Vim filetype plugin
" Language: dnsmasq
" Maintainer: dringsim <dringsim@qq.com>
" Last Change: 2025-02-18
if exists('b:did_ftplugin')
finish
endif
" Behaves mostly just like cfg
runtime! ftplugin/cfg.vim
+3 -2
View File
@@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: Dockerfile
" Maintainer: Honza Pokorny <http://honza.ca>
" Last Change: 2024 Dec 20
" Last Change: 2025 Feb 21
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -11,6 +11,7 @@ endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
setlocal comments=:#
setlocal commentstring=#\ %s
let b:undo_ftplugin = "setl commentstring<"
let b:undo_ftplugin = "setl comments< commentstring<"
+3 -2
View File
@@ -1,7 +1,8 @@
" Vim filetype plugin file
" Language: Configuration File (ini file) for MS-DOS/MS Windows
" Maintainer: This runtime file is looking for a new maintainer.
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
" Latest Revision: 2025 Feb 20
if exists("b:did_ftplugin")
finish
@@ -13,7 +14,7 @@ set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:; commentstring=;\ %s formatoptions-=t formatoptions+=croql
setlocal comments=:;,:# commentstring=;\ %s formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save
+14
View File
@@ -0,0 +1,14 @@
" Vim filetype plugin
" Language: exports(5) configuration file
" Maintainer: Matt Perry <matt@mattperry.com>
" Last Change: 2025 Feb 13
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal comments=:# commentstring=#\ %s
setlocal formatoptions-=t formatoptions+=croql
let b:undo_ftplugin = 'setl com< cms< fo<'
+26 -2
View File
@@ -1,8 +1,10 @@
" Vim filetype plugin file
" Language: Go
" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
" Maintainer: David Barnett (https://github.com/google/vim-ft-go is archived)
" Last Change: 2014 Aug 16
" 2024 Jul 16 by Vim Project (add recommended indent style)
" 2025 Mar 07 by Vim Project (add formatprg and keywordprg option #16804)
" 2025 Mar 18 by Vim Project (use :term for 'keywordprg' #16911)
if exists('b:did_ftplugin')
finish
@@ -10,15 +12,37 @@ endif
let b:did_ftplugin = 1
setlocal formatoptions-=t
setlocal formatprg=gofmt
setlocal comments=s1:/*,mb:*,ex:*/,://
setlocal commentstring=//\ %s
setlocal keywordprg=:GoKeywordPrg
let b:undo_ftplugin = 'setl fo< com< cms<'
command! -buffer -nargs=* GoKeywordPrg call s:GoKeywordPrg()
let b:undo_ftplugin = 'setl fo< com< cms< fp< kp<'
\ . '| delcommand -buffer GoKeywordPrg'
if get(g:, 'go_recommended_style', 1)
setlocal noexpandtab softtabstop=0 shiftwidth=0
let b:undo_ftplugin ..= ' | setl et< sts< sw<'
endif
if !exists('*' .. expand('<SID>') .. 'GoKeywordPrg')
func! s:GoKeywordPrg()
let temp_isk = &l:iskeyword
setl iskeyword+=.
try
let cmd = 'go doc -C ' . shellescape(expand('%:h')) . ' ' . shellescape(expand('<cword>'))
if has('gui_running') || has('nvim')
exe 'hor term' cmd
else
exe '!' . cmd
endif
finally
let &l:iskeyword = temp_isk
endtry
endfunc
endif
" vim: sw=2 sts=2 et
+44 -22
View File
@@ -5,13 +5,24 @@
" Contributor: Dorai Sitaram <ds26@gte.com>
" C.D. MacEachern <craig.daniel.maceachern@gmail.com>
" Tyler Miller <tmillr@proton.me>
" Last Change: 2024 Dec 03
" Phạm Bình An <phambinhanctb2004@gmail.com>
" Last Change: 2025 Feb 27
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
" keep in sync with syntax/lua.vim
if !exists("lua_version")
" Default is lua 5.3
let lua_version = 5
let lua_subversion = 3
elseif !exists("lua_subversion")
" lua_version exists, but lua_subversion doesn't. In this case set it to 0
let lua_subversion = 0
endif
let s:cpo_save = &cpo
set cpo&vim
@@ -21,11 +32,11 @@ setlocal formatoptions-=t formatoptions+=croql
let &l:define = '\<function\|\<local\%(\s\+function\)\='
" TODO: handle init.lua
setlocal includeexpr=tr(v:fname,'.','/')
let &l:include = '\<\%(\%(do\|load\)file\|require\)\s*('
setlocal includeexpr=s:LuaInclude(v:fname)
setlocal suffixesadd=.lua
let b:undo_ftplugin = "setlocal cms< com< def< fo< inex< sua<"
let b:undo_ftplugin = "setl cms< com< def< fo< inc< inex< sua<"
if exists("loaded_matchit") && !exists("b:match_words")
let b:match_ignorecase = 0
@@ -50,20 +61,31 @@ endif
if has("folding") && get(g:, "lua_folding", 0)
setlocal foldmethod=expr
setlocal foldexpr=LuaFold(v:lnum)
setlocal foldexpr=s:LuaFold(v:lnum)
let b:lua_lasttick = -1
let b:undo_ftplugin ..= "|setl foldexpr< foldmethod< | unlet! b:lua_lasttick b:lua_foldlists"
let b:undo_ftplugin ..= " | setl foldexpr< foldmethod< | unlet! b:lua_lasttick b:lua_foldlists"
endif
" The rest of the file needs to be :sourced only once per Vim session
if exists('s:loaded_lua') || &cp
if exists("s:loaded_lua") || &cp
let &cpo = s:cpo_save
unlet s:cpo_save
finish
endif
let s:loaded_lua = 1
function s:LuaInclude(fname) abort
let lua_ver = str2float(printf("%d.%02d", g:lua_version, g:lua_subversion))
let fname = tr(a:fname, '.', '/')
let paths = lua_ver >= 5.03 ? [fname .. ".lua", fname .. "/init.lua"] : [fname .. ".lua"]
for path in paths
if filereadable(path)
return path
endif
endfor
return fname
endfunction
let s:patterns = [
\ ['do', 'end'],
\ ['if\s+.+\s+then', 'end'],
@@ -75,35 +97,35 @@ let s:patterns = [
\ ['local\s+function\s+.+', 'end'],
\ ]
function! LuaFold(lnum) abort
function s:LuaFold(lnum) abort
if b:lua_lasttick == b:changedtick
return b:lua_foldlists[a:lnum-1]
return b:lua_foldlists[a:lnum - 1]
endif
let b:lua_lasttick = b:changedtick
let b:lua_foldlists = []
let foldlist = []
let buf = getline(1, '$')
let buf = getline(1, "$")
for line in buf
for t in s:patterns
let tagopen = '\v^\s*'..t[0]..'\s*$'
let tagclose = '\v^\s*'..t[1]..'\s*$'
let tagopen = '\v^\s*' .. t[0] ..'\s*$'
let tagclose = '\v^\s*' .. t[1] ..'\s*$'
if line =~# tagopen
call add(foldlist, t)
break
call add(foldlist, t)
break
elseif line =~# tagclose
if len(foldlist) > 0 && line =~# foldlist[-1][1]
call remove(foldlist, -1)
else
let foldlist = []
endif
break
if len(foldlist) > 0 && line =~# foldlist[-1][1]
call remove(foldlist, -1)
else
let foldlist = []
endif
break
endif
endfor
call add(b:lua_foldlists, len(foldlist))
endfor
return lua_foldlists[a:lnum-1]
return lua_foldlists[a:lnum - 1]
endfunction
let &cpo = s:cpo_save
+17
View File
@@ -0,0 +1,17 @@
" Vim filetype plugin
" Language: m17n database
" Maintainer: David Mandelberg <david@mandelberg.org>
" Last Change: 2025 Feb 21
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal comments=:;;;,:;;,:;
setlocal commentstring=;\ %s
setlocal iskeyword=!-~,@,^34,^(,^),^92
setlocal lisp
setlocal lispwords=
let b:undo_ftplugin = "setlocal comments< commentstring< iskeyword< lisp< lispwords<"
+5 -2
View File
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: Mail
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2023 Aug 10
" Last Change: 2025 Feb 20
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Only do this when not done yet for this buffer
@@ -10,7 +10,7 @@ if exists("b:did_ftplugin")
endif
let b:did_ftplugin = 1
let b:undo_ftplugin = "setl modeline< tw< fo< comments<"
let b:undo_ftplugin = "setl modeline< tw< fo< comments< commentstring<"
" Don't use modelines in e-mail messages, avoid trojan horses and nasty
" "jokes" (e.g., setting 'textwidth' to 5).
@@ -24,6 +24,9 @@ endif
" Set 'formatoptions' to break text lines and keep the comment leader ">".
setlocal fo+=tcql
" Set commentstring to quoting sign ">" so comment shortcuts can be used to
" edit quoted parts of mail
setlocal commentstring=>\ %s
" Add n:> to 'comments, in case it was removed elsewhere
setlocal comments+=n:>
+18 -1
View File
@@ -6,6 +6,7 @@
" Last Change: 2024 Jun 06 (disabled the q mapping, #8210)
" 2024 Jul 06 (use nnoremap, #15130)
" 2024 Aug 23 (improve the <Plug>ManBS mapping, #15547, #15556)
" 2025 Mar 09 (improve :Man completion for man-db, #16843)
" To make the ":Man" command available before editing a manual page, source
" this script from your startup vimrc file.
@@ -24,6 +25,14 @@ endif
let s:cpo_save = &cpo
set cpo-=C
if !exists('g:ft_man_implementation')
if executable('mandb') > 0
let g:ft_man_implementation = 'man-db'
else
let g:ft_man_implementation = ''
endif
endif
if &filetype == "man"
" Allow hyphen, plus, colon, dot, and commercial at in manual page name.
" Parentheses are not here but in dist#man#PreGetPage()
@@ -60,11 +69,19 @@ if &filetype == "man"
endif
if exists(":Man") != 2
com -nargs=+ -complete=shellcmd Man call dist#man#GetPage(<q-mods>, <f-args>)
if g:ft_man_implementation ==# 'man-db'
com -nargs=+ -complete=customlist,dist#man#ManDbComplete Man call dist#man#GetPage(<q-mods>, <f-args>)
else
com -nargs=+ -complete=shellcmd Man call dist#man#GetPage(<q-mods>, <f-args>)
endif
nnoremap <Leader>K :call dist#man#PreGetPage(0)<CR>
nnoremap <Plug>ManPreGetPage :call dist#man#PreGetPage(0)<CR>
endif
if exists(":ManReload") != 2
com ManReload call dist#man#Reload()
endif
let &cpo = s:cpo_save
unlet s:cpo_save
+17 -2
View File
@@ -2,8 +2,11 @@
" Language: roff(7)
" Maintainer: Aman Verma
" Homepage: https://github.com/a-vrma/vim-nroff-ftplugin
" Document: https://www.gnu.org/software/groff/manual/groff.html
" Previous Maintainer: Chris Spiegel <cspiegel@gmail.com>
" 2024 May 24 by Riley Bruins <ribru17@gmail.com> ('commentstring')
" Last Changes:
" 2024 May 24 by Riley Bruins <ribru17@gmail.com> ('commentstring' #14843)
" 2025 Feb 12 by Wu, Zhenyu <wuzhenyu@ustc.edu> (matchit configuration #16619)
if exists("b:did_ftplugin")
finish
@@ -13,5 +16,17 @@ let b:did_ftplugin = 1
setlocal commentstring=.\\\"\ %s
setlocal comments=:.\\\"
setlocal sections+=Sh
setlocal define=.\s*de
let b:undo_ftplugin = 'setlocal commentstring< comments< sections<'
let b:undo_ftplugin = 'setlocal commentstring< comments< sections< define<'
if exists('loaded_matchit')
let b:match_words = '^\.\s*ie\>:^\.\s*el\>'
\ . ',^\.\s*LB\>:^\.\s*LI\>:^\.\s*LE\>'
\ . ',^\.\s*TS\>:^\.\s*TE\>'
\ . ',^\.\s*PS\>:^\.\s*P[EF]\>'
\ . ',^\.\s*EQ\>:^\.\s*EN\>'
\ . ',^\.\s*[\>:^\.\s*]\>'
\ . ',^\.\s*FS\>:^\.\s*FE\>'
let b:undo_ftplugin .= "| unlet b:match_words"
endif
+17
View File
@@ -0,0 +1,17 @@
" Vim ftplugin file
" Language: Oracle Procedural SQL (PL/SQL)
" Maintainer: Lee Lindley (lee dot lindley at gmail dot com)
" Previous Maintainer: Jeff Lanzarotta (jefflanzarotta at yahoo dot com)
" Previous Maintainer: C. Laurence Gonsalves (clgonsal@kami.com)
" URL: https://github.com/lee-lindley/vim_plsql_syntax
" Last Change: Feb 19, 2025
" History: Enno Konfekt move handling of optional syntax folding from syntax
" file to ftplugin
if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1
if get(g:,"plsql_fold",0) == 1
setlocal foldmethod=syntax
let b:undo_ftplugin = "setl fdm< "
endif
+14
View File
@@ -0,0 +1,14 @@
" Vim filetype plugin
" Language: smb.conf(5) configuration file
" Maintainer: Matt Perry <matt@mattperry.com>
" Last Change: 2025 Feb 13
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal comments=:;,:# commentstring=#\ %s
setlocal formatoptions-=t formatoptions+=croql
let b:undo_ftplugin = 'setl com< cms< fo<'
+3 -1
View File
@@ -6,6 +6,7 @@
" Eisuke Kawashima
" Last Change: 2024 Sep 19 by Vim Project (compiler shellcheck)
" 2024 Dec 29 by Vim Project (improve setting shellcheck compiler)
" 2025 Mar 09 by Vim Project (set b:match_skip)
if exists("b:did_ftplugin")
finish
@@ -30,7 +31,8 @@ if exists("loaded_matchit") && !exists("b:match_words")
\ s:sol .. '\%(for\|while\)\>:' .. s:sol .. 'done\>,' ..
\ s:sol .. 'case\>:' .. s:sol .. 'esac\>'
unlet s:sol
let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words"
let b:match_skip = "synIDattr(synID(line('.'),col('.'),0),'name') =~ 'shSnglCase'"
let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:match_skip"
endif
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
+6 -7
View File
@@ -1,20 +1,19 @@
" Vim filetype plugin file
" Language: Sieve filtering language input file
" Maintainer: This runtime file is looking for a new maintainer.
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
" Latest Revision: 2025 Feb 20
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
let b:undo_ftplugin = "setl com< cms< fo< ff<"
setlocal comments=s1:/*,mb:*,ex:*/,:# commentstring=#\ %s
setlocal formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save
" https://datatracker.ietf.org/doc/html/rfc5228#section-2.2 says
" "newlines (CRLF, never just CR or LF)"
setlocal fileformat=dos
+14
View File
@@ -0,0 +1,14 @@
" Vim filetype plugin
" Language: SPA JSON
" Maintainer: David Mandelberg <david@mandelberg.org>
" Last Change: 2025 Mar 22
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal comments=:###,:##,:#
setlocal commentstring=#\ %s
let b:undo_ftplugin = "setlocal comments< commentstring<"
+30
View File
@@ -0,0 +1,30 @@
" Vim filetype plugin file
" Language: Tera
" Maintainer: Muntasir Mahmud <muntasir.joypurhat@gmail.com>
" Last Change: 2025 Mar 08
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal autoindent
setlocal commentstring={#\ %s\ #}
setlocal comments=s:{#,e:#}
if exists("loaded_matchit")
let b:match_ignorecase = 0
let b:match_words = '{#:##\|#},{% *if:{% *else\>:{% *elif\>:{% *endif %},{% *for\>:{% *endfor %},{% *macro\>:{% *endmacro %},{% *block\>:{% *endblock %},{% *filter\>:{% *endfilter %},{% *set\>:{% *endset %},{% *raw\>:{% *endraw %},{% *with\>:{% *endwith %}'
endif
setlocal includeexpr=substitute(v:fname,'\\([^.]*\\)$','\\1','g')
setlocal suffixesadd=.tera
setlocal expandtab
setlocal shiftwidth=2
setlocal softtabstop=2
let b:undo_ftplugin = "setlocal autoindent< commentstring< comments< " ..
\ "includeexpr< suffixesadd< expandtab< shiftwidth< softtabstop<"
let b:undo_ftplugin .= "|unlet! b:match_ignorecase b:match_words"
+80 -29
View File
@@ -1,9 +1,11 @@
" Vim filetype plugin
" Language: Vim
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2025 Jan 06
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Contributors: Riley Bruins <ribru17@gmail.com> ('commentstring')
" Language: Vim
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2025 Mar 05
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Contributors: Riley Bruins <ribru17@gmail.com> ('commentstring'),
" @Konfekt
" @tpope (s:Help())
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -18,20 +20,21 @@ set cpo&vim
if !exists('*VimFtpluginUndo')
func VimFtpluginUndo()
setl fo< isk< com< tw< commentstring< include< define<
setl fo< isk< com< tw< commentstring< include< define< keywordprg<
sil! delc -buffer VimKeywordPrg
if exists('b:did_add_maps')
silent! nunmap <buffer> [[
silent! vunmap <buffer> [[
silent! xunmap <buffer> [[
silent! nunmap <buffer> ]]
silent! vunmap <buffer> ]]
silent! xunmap <buffer> ]]
silent! nunmap <buffer> []
silent! vunmap <buffer> []
silent! xunmap <buffer> []
silent! nunmap <buffer> ][
silent! vunmap <buffer> ][
silent! xunmap <buffer> ][
silent! nunmap <buffer> ]"
silent! vunmap <buffer> ]"
silent! xunmap <buffer> ]"
silent! nunmap <buffer> ["
silent! vunmap <buffer> ["
silent! xunmap <buffer> ["
endif
unlet! b:match_ignorecase b:match_words b:match_skip b:did_add_maps
endfunc
@@ -48,7 +51,53 @@ setlocal fo-=t fo+=croql
setlocal isk+=#
" Use :help to lookup the keyword under the cursor with K.
setlocal keywordprg=:help
" Distinguish between commands, options and functions.
if !exists("*" .. expand("<SID>") .. "Help")
function s:Help(topic) abort
let topic = a:topic
if get(g:, 'syntax_on', 0)
let syn = synIDattr(synID(line('.'), col('.'), 1), 'name')
if syn ==# 'vimFuncName'
return topic.'()'
elseif syn ==# 'vimOption'
return "'".topic."'"
elseif syn ==# 'vimUserAttrbKey'
return ':command-'.topic
elseif syn =~# 'vimCommand'
return ':'.topic
endif
endif
let col = col('.') - 1
while col && getline('.')[col] =~# '\k'
let col -= 1
endwhile
let pre = col == 0 ? '' : getline('.')[0 : col]
let col = col('.') - 1
while col && getline('.')[col] =~# '\k'
let col += 1
endwhile
let post = getline('.')[col : -1]
if pre =~# '^\s*:\=$'
return ':'.topic
elseif pre =~# '\<v:$'
return 'v:'.topic
elseif pre =~# '<$'
return '<'.topic.'>'
elseif pre =~# '\\$'
return '/\'.topic
elseif topic ==# 'v' && post =~# ':\w\+'
return 'v'.matchstr(post, ':\w\+')
else
return topic
endif
endfunction
endif
command! -buffer -nargs=1 VimKeywordPrg :exe 'help' s:Help(<q-args>)
setlocal keywordprg=:VimKeywordPrg
" Comments starts with # in Vim9 script. We have to guess which one to use.
if "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>'
@@ -77,19 +126,19 @@ if !exists("no_plugin_maps") && !exists("no_vim_maps")
" Move around functions.
nnoremap <silent><buffer> [[ m':call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "bW")<CR>
vnoremap <silent><buffer> [[ m':<C-U>exe "normal! gv"<Bar>call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "bW")<CR>
xnoremap <silent><buffer> [[ m':<C-U>exe "normal! gv"<Bar>call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "bW")<CR>
nnoremap <silent><buffer> ]] m':call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "W")<CR>
vnoremap <silent><buffer> ]] m':<C-U>exe "normal! gv"<Bar>call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "W")<CR>
xnoremap <silent><buffer> ]] m':<C-U>exe "normal! gv"<Bar>call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "W")<CR>
nnoremap <silent><buffer> [] m':call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "bW")<CR>
vnoremap <silent><buffer> [] m':<C-U>exe "normal! gv"<Bar>call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "bW")<CR>
xnoremap <silent><buffer> [] m':<C-U>exe "normal! gv"<Bar>call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "bW")<CR>
nnoremap <silent><buffer> ][ m':call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "W")<CR>
vnoremap <silent><buffer> ][ m':<C-U>exe "normal! gv"<Bar>call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "W")<CR>
xnoremap <silent><buffer> ][ m':<C-U>exe "normal! gv"<Bar>call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "W")<CR>
" Move around comments
nnoremap <silent><buffer> ]" :call search('\%(^\s*".*\n\)\@<!\%(^\s*"\)', "W")<CR>
vnoremap <silent><buffer> ]" :<C-U>exe "normal! gv"<Bar>call search('\%(^\s*".*\n\)\@<!\%(^\s*"\)', "W")<CR>
xnoremap <silent><buffer> ]" :<C-U>exe "normal! gv"<Bar>call search('\%(^\s*".*\n\)\@<!\%(^\s*"\)', "W")<CR>
nnoremap <silent><buffer> [" :call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR>
vnoremap <silent><buffer> [" :<C-U>exe "normal! gv"<Bar>call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR>
xnoremap <silent><buffer> [" :<C-U>exe "normal! gv"<Bar>call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR>
endif
" Let the matchit plugin know what items can be matched.
@@ -101,15 +150,15 @@ if exists("loaded_matchit")
" func name
" require a parenthesis following, then there can be an "endfunc".
let b:match_words =
\ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+\s*(:\%(\%(^\||\)\s*\)\@<=\<retu\%[rn]\>:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' ..
\ '\<\%(wh\%[ile]\|for\)\>:\%(\%(^\||\)\s*\)\@<=\<brea\%[k]\>:\%(\%(^\||\)\s*\)\@<=\<con\%[tinue]\>:\%(\%(^\||\)\s*\)\@<=\<end\%(w\%[hile]\|fo\%[r]\)\>,' ..
\ '\<if\>:\%(\%(^\||\)\s*\)\@<=\<el\%[seif]\>:\%(\%(^\||\)\s*\)\@<=\<en\%[dif]\>,' ..
\ '{:},' ..
\ '\<try\>:\%(\%(^\||\)\s*\)\@<=\<cat\%[ch]\>:\%(\%(^\||\)\s*\)\@<=\<fina\%[lly]\>:\%(\%(^\||\)\s*\)\@<=\<endt\%[ry]\>,' ..
\ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' ..
\ '\<class\>:\<endclass\>,' ..
\ '\<interface\>:\<endinterface\>,' ..
\ '\<enum\>:\<endenum\>'
\ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+\s*(:\%(\%(^\||\)\s*\)\@<=\<retu\%[rn]\>:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' ..
\ '\<\%(wh\%[ile]\|for\)\>:\%(\%(^\||\)\s*\)\@<=\<brea\%[k]\>:\%(\%(^\||\)\s*\)\@<=\<con\%[tinue]\>:\%(\%(^\||\)\s*\)\@<=\<end\%(w\%[hile]\|fo\%[r]\)\>,' ..
\ '\<if\>:\%(\%(^\||\)\s*\)\@<=\<el\%[seif]\>:\%(\%(^\||\)\s*\)\@<=\<en\%[dif]\>,' ..
\ '{:},' ..
\ '\<try\>:\%(\%(^\||\)\s*\)\@<=\<cat\%[ch]\>:\%(\%(^\||\)\s*\)\@<=\<fina\%[lly]\>:\%(\%(^\||\)\s*\)\@<=\<endt\%[ry]\>,' ..
\ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' ..
\ '\<class\>:\<endclass\>,' ..
\ '\<interface\>:\<endinterface\>,' ..
\ '\<enum\>:\<endenum\>'
" Ignore syntax region commands and settings, any 'en*' would clobber
" if-endif.
@@ -117,7 +166,7 @@ if exists("loaded_matchit")
" - au! FileType javascript syntax region foldBraces start=/{/ end=/}/ …
" Also ignore here-doc and dictionary keys (vimVar).
let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name")
\ =~? "comment\\|string\\|vimSynReg\\|vimSet\\|vimLetHereDoc\\|vimVar"'
\ =~? "comment\\|string\\|vimSynReg\\|vimSet\\|vimLetHereDoc\\|vimVar"'
endif
let &cpo = s:cpo_save
@@ -125,3 +174,5 @@ unlet s:cpo_save
" removed this, because 'cpoptions' is a global option.
" setlocal cpo+=M " makes \%( match \)
"
" vim: sw=2 et
+10 -1
View File
@@ -10,7 +10,16 @@ VIMRUNTIME = ..
# If a test succeeds a testdir/*.out file will be written.
# If a test fails a testdir/*.fail file will be written.
test:
VIMRUNTIME=$(VIMRUNTIME) $(VIMPROG) --clean --not-a-term -u testdir/runtest.vim
VIMRUNTIME=$(VIMRUNTIME) $(VIMPROG) --clean --not-a-term -u testdir/runtest.vim || \
{ \
retval=$$?; \
for fail in testdir/*.fail; do \
[ -f "$$fail" ] || continue; \
echo "$$fail:"; \
cat "$$fail"; \
done; \
exit $$retval; \
}
@echo "INDENT TESTS: DONE"
+14
View File
@@ -0,0 +1,14 @@
" Vim indent file
" Language: m17n database
" Maintainer: David Mandelberg <david@mandelberg.org>
" Last Change: 2025 Feb 21
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal autoindent
setlocal nosmartindent
let b:undo_indent = "setlocal autoindent< smartindent<"
+40 -17
View File
@@ -7,6 +7,7 @@
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-sh-indent
" Changelog:
" 20250318 - Detect local arrays in functions
" 20241411 - Detect dash character in function keyword for
" bash mode (issue #16049)
" 20190726 - Correctly skip if keywords in syntax comments
@@ -73,6 +74,8 @@ function! s:indent_value(option)
endfunction
function! GetShIndent()
let mode = mode()
let curline = getline(v:lnum)
let lnum = prevnonblank(v:lnum - 1)
if lnum == 0
@@ -86,8 +89,11 @@ function! GetShIndent()
" Check contents of previous lines
" should not apply to e.g. commented lines
if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>' ||
\ (&ft is# 'zsh' && line =~ '^\s*\<\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>')
if s:start_block(line)
let ind += s:indent_value('default')
elseif line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>\($\|\s\)' ||
\ (&ft is# 'zsh' && line =~ '^\s*\<\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>\($\|\s\)')
if !s:is_end_expression(line)
let ind += s:indent_value('default')
endif
@@ -111,7 +117,7 @@ function! GetShIndent()
let ind += s:indent_value('continuation-line')
endif
elseif s:end_block(line) && !s:start_block(line)
let ind = indent(lnum)
let ind -= s:indent_value('default')
elseif pnum != 0 &&
\ s:is_continuation_line(pline) &&
\ !s:end_block(curline) &&
@@ -122,7 +128,7 @@ function! GetShIndent()
while !s:is_empty(getline(i)) && i > pnum
let i -= 1
endw
if i == pnum
if i == pnum && (s:is_continuation_line(line) || pline =~ '{\s*\(#.*\)\=$')
let ind += ind2
else
let ind = ind2
@@ -136,7 +142,11 @@ function! GetShIndent()
" TODO: should we do the same for other "end" lines?
if curline =~ '^\s*\%(fi\);\?\s*\%(#.*\)\=$'
let ind = indent(v:lnum)
let previous_line = searchpair('\<if\>', '', '\<fi\>\zs', 'bnW', 'synIDattr(synID(line("."),col("."), 1),"name") =~? "comment\\|quote"')
" in insert mode, try to place the cursor after the fi statement
let endp = '\<fi\>' .. (mode ==? 'i' ? '\zs' : '')
let startp = '^\s*\<if\>'
let previous_line = searchpair(startp, '', endp , 'bnW',
\ 'synIDattr(synID(line("."),col("."), 1),"name") =~? "comment\\|quote\\|option"')
if previous_line > 0
let ind = indent(previous_line)
endif
@@ -167,7 +177,13 @@ function! GetShIndent()
elseif match(map(synstack(v:lnum, 1), 'synIDattr(v:val, "name")'), '\c\mheredoc') > -1
return indent(v:lnum)
elseif s:is_comment(line) && s:is_empty(getline(v:lnum-1))
return indent(v:lnum)
if s:is_in_block(v:lnum)
" return indent of line in same block
return indent(lnum)
else
" use indent of current line
return indent(v:lnum)
endif
endif
return ind > 0 ? ind : 0
@@ -203,7 +219,18 @@ function! s:is_function_definition(line)
endfunction
function! s:is_array(line)
return a:line =~ '^\s*\<\k\+\>=('
return a:line =~ '^\s*\(\(declare\|typeset\|local\)\s\+\(-[Aalrtu]\+\s\+\)\?\)\?\<\k\+\>=('
endfunction
function! s:is_in_block(line)
" checks whether a:line is whithin a
" block e.g. a shell function
" foo() {
" ..
" }
let prevline = searchpair('{', '', '}', 'bnW', 'synIDattr(synID(line("."),col("."), 1),"name") =~? "comment\\|quote"')
let nextline = searchpair('{', '', '}', 'nW', 'synIDattr(synID(line("."),col("."), 1),"name") =~? "comment\\|quote"')
return a:line > prevline && a:line < nextline
endfunction
function! s:is_case_label(line, pnum)
@@ -280,15 +307,7 @@ function! s:end_block(line)
endfunction
function! s:start_block(line)
return a:line =~ '{\s*\(#.*\)\?$'
endfunction
function! s:find_start_block(lnum)
let i = a:lnum
while i > 1 && !s:start_block(getline(i))
let i -= 1
endwhile
return i
return a:line =~ '^[^#]*[{(]\s*\(#.*\)\?$'
endfunction
function! s:is_comment(line)
@@ -300,7 +319,11 @@ function! s:is_end_expression(line)
endfunction
function! s:is_bash()
return get(g:, 'is_bash', 0) || get(b:, 'is_bash', 0)
if &ft is# 'bash' || getline(1) is# '#!/bin/bash'
return v:true
else
return get(g:, 'is_bash', 0) || get(b:, 'is_bash', 0)
endif
endfunction
let &cpo = s:cpo_save
+6
View File
@@ -0,0 +1,6 @@
" Vim indent file
" Language: SPA JSON
" Maintainer: David Mandelberg <david@mandelberg.org>
" Last Change: 2025 Mar 22
runtime! indent/json.vim
+2
View File
@@ -4,6 +4,7 @@
" Maintainer: Artem Chuprina <ran@ran.pp.ru>
" Last Changed: 2001 Jun 23
" 2025 Mar 17 by The Vim Project (added /, #16912)
" All characters are given literally, conversion to another encoding (e.g.,
" UTF-8) should work.
@@ -85,3 +86,4 @@ $ ;
& ?
/ .
? ,
\| /
+87
View File
@@ -0,0 +1,87 @@
" Vim Keymap file for ukrainian characters MS Windows enhanced variant.
" This file is based on russian-jcukenwin.vim by Artem Chuprina <ran@ran.pp.ru>.
" Keymap has been originally created by Ivan Korneliuk <vansha@gmail.com>.
" Maintainer: Vladyslav Rehan <rehanvladyslav@gmail.com>
" Last Changed: 2025 feb 13
scriptencoding utf-8
let b:keymap_name = "uk"
loadkeymap
~ RIGHT SINGLE QUOTATION MARK
` ' APOSTROPHE
F А CYRILLIC CAPITAL LETTER A
< Б CYRILLIC CAPITAL LETTER BE
D В CYRILLIC CAPITAL LETTER VE
U Г CYRILLIC CAPITAL LETTER GHE
| Ґ CYRILLIC CAPITAL LETTER GHE WITH UPTURN
L Д CYRILLIC CAPITAL LETTER DE
T Е CYRILLIC CAPITAL LETTER IE
: Ж CYRILLIC CAPITAL LETTER ZHE
P З CYRILLIC CAPITAL LETTER ZE
B И CYRILLIC CAPITAL LETTER I
S І CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
} Ї CYRILLIC CAPITAL LETTER YI
Q Й CYRILLIC CAPITAL LETTER SHORT I
R К CYRILLIC CAPITAL LETTER KA
K Л CYRILLIC CAPITAL LETTER EL
V М CYRILLIC CAPITAL LETTER EM
Y Н CYRILLIC CAPITAL LETTER EN
J О CYRILLIC CAPITAL LETTER O
G П CYRILLIC CAPITAL LETTER PE
H Р CYRILLIC CAPITAL LETTER ER
C С CYRILLIC CAPITAL LETTER ES
N Т CYRILLIC CAPITAL LETTER TE
E У CYRILLIC CAPITAL LETTER U
A Ф CYRILLIC CAPITAL LETTER EF
{ Х CYRILLIC CAPITAL LETTER HA
W Ц CYRILLIC CAPITAL LETTER TSE
X Ч CYRILLIC CAPITAL LETTER CHE
I Ш CYRILLIC CAPITAL LETTER SHA
O Щ CYRILLIC CAPITAL LETTER SHCHA
M Ь CYRILLIC CAPITAL LETTER SOFT SIGN
\" Є CYRILLIC CAPITAL LETTER UKRAINIAN IE
> Ю CYRILLIC CAPITAL LETTER YU
Z Я CYRILLIC CAPITAL LETTER YA
f а CYRILLIC SMALL LETTER A
, б CYRILLIC SMALL LETTER BE
d в CYRILLIC SMALL LETTER VE
u г CYRILLIC SMALL LETTER GHE
\\ ґ CYRILLIC SMALL LETTER GHE WITH UPTURN
l д CYRILLIC SMALL LETTER DE
t е CYRILLIC SMALL LETTER IE
; ж CYRILLIC SMALL LETTER ZHE
p з CYRILLIC SMALL LETTER ZE
b и CYRILLIC SMALL LETTER I
s і CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
] ї CYRILLIC SMALL LETTER YI
q й CYRILLIC SMALL LETTER SHORT I
r к CYRILLIC SMALL LETTER KA
k л CYRILLIC SMALL LETTER EL
v м CYRILLIC SMALL LETTER EM
y н CYRILLIC SMALL LETTER EN
j о CYRILLIC SMALL LETTER O
g п CYRILLIC SMALL LETTER PE
h р CYRILLIC SMALL LETTER ER
c с CYRILLIC SMALL LETTER ES
n т CYRILLIC SMALL LETTER TE
e у CYRILLIC SMALL LETTER U
a ф CYRILLIC SMALL LETTER EF
[ х CYRILLIC SMALL LETTER HA
w ц CYRILLIC SMALL LETTER TSE
x ч CYRILLIC SMALL LETTER CHE
i ш CYRILLIC SMALL LETTER SHA
o щ CYRILLIC SMALL LETTER SHCHA
m ь CYRILLIC SMALL LETTER SOFT SIGN
' є CYRILLIC SMALL LETTER UKRAINIAN IE
. ю CYRILLIC SMALL LETTER YU
z я CYRILLIC SMALL LETTER YA
@ " QUOTATION MARK
# № NUMERO SIGN
$ ; SEMICOLON
^ : COLON
& ? QUESTION MARK
/ . FULL STOP
? , COMMA
+136 -105
View File
@@ -1,8 +1,6 @@
" Menu Translations: Italian / Italiano
" Maintainer: Antonio Colombo <azc100@gmail.com>
" Vlad Sandrini <vlad.gently@gmail.com>
" Luciano Montanaro <mikelima@cirulla.net>
" Last Change: 2023 Aug 22
" Last Change: 2025 Mar 13
" Original translations
" Quit when menu translations have already been done.
@@ -10,7 +8,7 @@ if exists("did_menu_trans")
finish
endif
let did_menu_trans = 1
let s:keepcpo= &cpo
let s:cpo_save= &cpo
set cpo&vim
scriptencoding iso-8859-1
@@ -24,7 +22,7 @@ menut &How-To\ Links Co&Me\.\.\.
menut &Find\.\.\. &Cerca\.\.\.
menut &Credits Cr&Editi
menut Co&pying C&Opie
menut &Sponsor/Register &Sponsor/Registrazione
menut &Sponsor/Register &Sponsor/Registrazione
menut O&rphans O&Rfani
menut &Version &Versione
menut &About &Intro
@@ -41,7 +39,7 @@ menut &New<Tab>:enew &Nuovo<Tab>:enew
menut &Close<Tab>:close &Chiudi<Tab>:close
menut &Save<Tab>:w &Salva<Tab>:w
menut Save\ &As\.\.\.<Tab>:sav Salva\ &Con\ nome\.\.\.<Tab>:sav
menut Split\ &Diff\ with\.\.\. &Differenza\ con\.\.\.
menut Split\ &Diff\ With\.\.\. &Differenza\ con\.\.\.
menut Split\ Patched\ &By\.\.\. Patc&H\ da\.\.\.
menut &Print S&tampa
menut Sa&ve-Exit<Tab>:wqa Sa&Lva\ ed\ esci<Tab>:wqa
@@ -59,12 +57,12 @@ menut &Paste<Tab>"+gP &Incolla<Tab>"+gP
menut Put\ &Before<Tab>[p &Metti\ davanti<Tab>[p
menut Put\ &After<Tab>]p M&Etti\ dietro<Tab>]p
menut &Delete<Tab>x Cance&Lla<Tab>x
menut &Select\ all<Tab>ggVG Seleziona\ &Tutto<Tab>ggVG
menut &Select\ All<Tab>ggVG Seleziona\ &Tutto<Tab>ggVG
menut &Find\.\.\. &Cerca\.\.\.
menut &Find\.\.\.<Tab>/ &Cerca\.\.\.<Tab>/
menut &Find<Tab>/ &Cerca<Tab>/
menut Find\ and\ Rep&lace\.\.\. &Sostituisci\.\.\.
menut Find\ and\ Rep&lace\.\.\.<Tab>:%s &Sostituisci\.\.\.<Tab>:%s
menut Find\ and\ Rep&lace\.\.\.<Tab>:s &Sostituisci\.\.\.<Tab>:s
menut Find\ and\ Rep&lace<Tab>:%s &Sostituisci<Tab>:%s
menut Find\ and\ Rep&lace<Tab>:s &Sostituisci<Tab>:s
menut Settings\ &Window &Finestra\ Impostazioni
menut Startup\ &Settings Impostazioni\ di\ &Avvio
menut &Global\ Settings Impostazioni\ &Globali
@@ -75,12 +73,20 @@ menut Toggle\ Pattern\ &Highlight<Tab>:set\ hls! &Evidenzia\ ricerche\ S
menut Toggle\ &Ignoring\ Case<Tab>:set\ ic! &Ignora\ maiusc\.-minusc\.\ /No<Tab>:set\ ic!
menut Toggle\ &Showing\ Matched\ Pairs<Tab>:set\ sm! Indica\ &Corrispondenze\ /No<Tab>:set\ sm!
menut &Context\ lines &Linee\ di\ contesto
menut &Context\ Lines &Linee\ di\ contesto
"menut &Context\ Lines.\ 1\ &Linee\ di\ contesto.\ 1\
"menut &Context\ Lines.\ 2\ &Linee\ di\ contesto.\ 2\
"menut &Context\ Lines.\ 3\ &Linee\ di\ contesto.\ 3\
"menut &Context\ Lines.\ 4\ &Linee\ di\ contesto.\ 4\
"menut &Context\ Lines.\ 5\ &Linee\ di\ contesto.\ 5\
"menut &Context\ Lines.\ 7\ &Linee\ di\ contesto.\ 7\
"menut &Context\ Lines.\ 10\ &Linee\ di\ contesto.\ 10\
"menut &Context\ Lines.\ 100\ &Linee\ di\ contesto.\ 100\
menut &Virtual\ Edit &Edit\ virtuale
menut Never Mai
menut Block\ Selection Seleziona\ Blocco
menut Insert\ mode Modo\ Insert
menut Insert\ Mode Modo\ Insert
menut Block\ and\ Insert Selezione\ Blocco\ e\ Inserimento
menut Always Sempre
@@ -109,22 +115,13 @@ if has("toolbar")
tmenu ToolBar.Cut Taglia
tmenu ToolBar.Copy Copia
tmenu ToolBar.Paste Incolla
tmenu ToolBar.Find Trova...
tmenu ToolBar.FindNext Trova seguente
tmenu ToolBar.FindPrev Trova precedente
tmenu ToolBar.Replace Sostituisci
if 0 " disabled; These are in the Windows menu
tmenu ToolBar.New Nuovo
tmenu ToolBar.WinSplit Dividi
tmenu ToolBar.WinMax Massimizza
tmenu ToolBar.WinMin Minimizza
tmenu ToolBar.WinClose Chiudi
endif
tmenu ToolBar.LoadSesn Carica sessione
tmenu ToolBar.SaveSesn Salva sessione
tmenu ToolBar.RunScript Esegui script
tmenu ToolBar.Make Esegui make
tmenu ToolBar.Shell Esegui shell
tmenu ToolBar.RunCtags Esegui ctags
tmenu ToolBar.TagJump Salta alla tag
tmenu ToolBar.Help Aiuto
@@ -143,24 +140,23 @@ menut Toggle\ Line\ &Numbering<Tab>:set\ nu! &Numerazione\ S
menut Toggle\ Relati&ve\ Line\ Numbering<Tab>:set\ rnu! Numerazione\ relati&Va\ /No<Tab>:set\ rnu!
menut Toggle\ &List\ Mode<Tab>:set\ list! Modo\ &List\ /No<Tab>:set\ list!
menut Toggle\ Line\ &Wrapping<Tab>:set\ wrap! Linee\ &Continuate\ /No<Tab>:set\ wrap!
menut Toggle\ W&rapping\ at\ word<Tab>:set\ lbr! A\ capo\ alla\ &Parola\ /No<Tab>:set\ lbr!
menut Toggle\ Tab\ &expanding<Tab>:set\ et! &Espandi\ Tabulazione\ /No<Tab>:set\ et!
menut Toggle\ W&rapping\ at\ Word<Tab>:set\ lbr! A\ capo\ alla\ &Parola\ /No<Tab>:set\ lbr!
menut Toggle\ Tab\ &Expanding<Tab>:set\ et! &Espandi\ Tabulazione\ /No<Tab>:set\ et!
menut Toggle\ &Auto\ Indenting<Tab>:set\ ai! Indentazione\ &Automatica\ /No<Tab>:set\ ai!
menut Toggle\ &C-Style\ Indenting<Tab>:set\ cin! Indentazione\ stile\ &C\ /No<Tab>:set\ cin!
menut &Shiftwidth &Spazi\ rientranza
"menut &Shiftwidth.2<Tab>:set\ sw=2\ sw?<CR> &Spazi\ rientranza.2<Tab>:set\ sw=2\ sw?<CR>
"menut &Shiftwidth.3<Tab>:set\ sw=3\ sw?<CR> &Spazi\ rientranza.3<Tab>:set\ sw=3\ sw?<CR>
"menut &Shiftwidth.4<Tab>:set\ sw=4\ sw?<CR> &Spazi\ rientranza.4<Tab>:set\ sw=4\ sw?<CR>
"menut &Shiftwidth.5<Tab>:set\ sw=5\ sw?<CR> &Spazi\ rientranza.5<Tab>:set\ sw=5\ sw?<CR>
"menut &Shiftwidth.6<Tab>:set\ sw=6\ sw?<CR> &Spazi\ rientranza.6<Tab>:set\ sw=6\ sw?<CR>
"menut &Shiftwidth.8<Tab>:set\ sw=8\ sw?<CR> &Spazi\ rientranza.8<Tab>:set\ sw=8\ sw?<CR>
"menut &Shiftwidth.3 &Spazi\ rientranza.3
"menut &Shiftwidth.4 &Spazi\ rientranza.4
"menut &Shiftwidth.5 &Spazi\ rientranza.5
"menut &Shiftwidth.6 &Spazi\ rientranza.6
"menut &Shiftwidth.8 &Spazi\ rientranza.8
menut Soft\ &Tabstop &Tabulazione\ software
"menut Soft\ &Tabstop.2<Tab>:set\ sts=2\ sts? &Tabulazione\ software.2<Tab>:set\ sts=2\ sts?
"menut Soft\ &Tabstop.3<Tab>:set\ sts=3\ sts? &Tabulazione\ software.3<Tab>:set\ sts=3\ sts?
"menut Soft\ &Tabstop.4<Tab>:set\ sts=4\ sts? &Tabulazione\ software.4<Tab>:set\ sts=4\ sts?
"menut Soft\ &Tabstop.5<Tab>:set\ sts=5\ sts? &Tabulazione\ software.5<Tab>:set\ sts=5\ sts?
"menut Soft\ &Tabstop.6<Tab>:set\ sts=6\ sts? &Tabulazione\ software.6<Tab>:set\ sts=6\ sts?
"menut Soft\ &Tabstop.8<Tab>:set\ sts=8\ sts? &Tabulazione\ software.8<Tab>:set\ sts=8\ sts?
"menut Soft\ &Tabstop.2 &Tabulazione\ software.2
"menut Soft\ &Tabstop.3 &Tabulazione\ software.3
"menut Soft\ &Tabstop.4 &Tabulazione\ software.4
"menut Soft\ &Tabstop.5 &Tabulazione\ software.5
"menut Soft\ &Tabstop.6 &Tabulazione\ software.6
"menut Soft\ &Tabstop.8 &Tabulazione\ software.8
menut Te&xt\ Width\.\.\. Lunghe&Zza\ riga\.\.\.
menut &File\ Format\.\.\. Formato\ &File\.\.\.
@@ -173,37 +169,61 @@ menut C&olor\ Scheme Schema\ c&Olori
menut blue blù
menut darkblue blù\ scuro
menut default predefinito
menut delek delek
menut desert deserto
menut elflord signore\ degli\ elfi
menut evening sera
menut habamax habamax
menut industry industria
menut koehler koehler
menut lunaperche luna\ perché
menut morning mattino
menut murphy murphy
menut pablo pablo
menut peachpuff pesca
menut quiet quieto
menut retrobox retrobox
menut ron ron
menut shine brillante
menut sorbet sorbetto
menut slate ardesia
menut torte torta
menut unokai unokai
menut wildcharm fascino\ selvaggio
menut zaibatsu zaibatsu
menut zellner zellner
menut BLUE BLÙ
menut DARKBLUE BLÙ\ SCURO
menut DEFAULT DEFAULT
menut DELEK DELEK
menut DESERT DESERTO
menut ELFLORD SIGNORE\ DEGLI\ ELFI
menut EVENING SERA
menut HABAMAX HABAMAX
menut INDUSTRY INDUSTRIA
menut KOEHLER KOEHLER
menut LUNAPERCHE LUNA\ PERCHÉ
menut MORNING MATTINO
menut MURPHY MURPHY
menut PABLO PABLO
menut PEACHPUFF PESCA
menut QUIET QUIETO
menut RETROBOX RETROBOX
menut RON RON
menut SHINE BRILLANTE
menut SORBET SORBETTO
menut SLATE ARDESIA
menut TORTE TORTA
menut UNOKAI UNOKAI
menut WILDCHARM FASCINO\ SELVAGGIO
menut ZAIBATSU ZAIBATSU
menut ZELLNER ZELLNER
menut Show\ &Keymaps\ in\ Menu Mostra\ Ma&ppe\ tastiera\ in\ Menù
menut &Keymap Ma&ppa\ tastiera
menut None nessuna
menut None Nessuna
menut accents accenti
menut arabic arabo
menut armenian-eastern armeno-orientale
@@ -217,10 +237,11 @@ menut czech ceco
menut dvorak tastiera-dvorak
menut esperanto esperanto
menut french-azerty francese-azerty
menut georgian-qwerty georgiano-qwerty
menut german-qwertz tedesco-qwertz
menut greek greco
menut hebrew ebraico
menut hebrewp ebraicop
menut hebrewp ebraico-fonetico
menut kana kana
menut kazakh-jcuken kazako-jcuken
menut korean coreano
@@ -251,8 +272,9 @@ menut thaana thaana
menut thaana-phonetic thaana-fonetico
menut turkish-f turco-f
menut turkish-q turco-q
menut ukrainian-dvorak ukraino-dvorak
menut ukrainian-jcuken ukraino-jcuken
menut ukrainian-dvorak ucraino-dvorak
menut ukrainian-jcuken ucraino-jcuken
menut ukrainian-enhanced ucraino-migliorato
menut vietnamese-telex vietnamita-telex
menut vietnamese-viqr vietnamita-viqr
menut vietnamese-vni vietnamita-vni
@@ -269,10 +291,11 @@ menut CZECH CECO
menut DVORAK TASTIERA-DVORAK
menut ESPERANTO ESPERANTO
menut FRENCH-AZERTY FRANCESE-AZERTY
menut GEORGIAN-QWERTY GEORGIANO-QWERTY
menut GERMAN-QWERTZ TEDESCO-QWERTZ
menut GREEK GRECO
menut HEBREW EBRAICO
menut HEBREWP EBRAICOP
menut HEBREWP EBRAICO-FONETICO
menut KANA KANA
menut KAZAKH-JCUKEN KAZAKO-JCUKEN
menut KOREAN COREANO
@@ -303,8 +326,9 @@ menut THAANA THAANA
menut THAANA-PHONETIC THAANA-FONETICO
menut TURKISH-F TURCO-F
menut TURKISH-Q TURCO-Q
menut UKRAINIAN-DVORAK UKRAINO-DVORAK
menut UKRAINIAN-JCUKEN UKRAINO-JCUKEN
menut UKRAINIAN-DVORAK UCRAINO-DVORAK
menut UKRAINIAN-JCUKEN UCRAINO-JCUKEN
menut UKRAINIAN-ENHANCED UCRAINO-MIGLIORATO
menut VIETNAMESE-TELEX VIETNAMITA-TELEX
menut VIETNAMESE-VIQR VIETNAMITA-VIQR
menut VIETNAMESE-VNI VIETNAMITA-VNI
@@ -314,37 +338,36 @@ menut Select\ Fo&nt\.\.\. Scegli\ &Font\.\.\.
" Menù strumenti programmazione
menut &Tools &Strumenti
menut &Jump\ to\ this\ tag<Tab>g^] &Vai\ a\ questa\ tag<Tab>g^]
menut Jump\ &back<Tab>^T Torna\ &Indietro<Tab>^T
menut &Jump\ to\ This\ Tag<Tab>g^] &Vai\ a\ questa\ tag<Tab>g^]
menut Jump\ &Back<Tab>^T Torna\ &Indietro<Tab>^T
menut Build\ &Tags\ File Costruisci\ file\ &Tag\
" Menù ortografia / Spelling
menut &Spelling &Ortografia
menut &Spell\ Check\ On Attiva\ &Controllo\ ortografico
menut Spell\ Check\ &Off &Disattiva\ controllo\ ortografico
menut To\ &Next\ error<Tab>]s Errore\ &Seguente<tab>]s
menut To\ &Previous\ error<Tab>[s Errore\ &Precedente<tab>[s
menut To\ &Next\ Error<Tab>]s Errore\ &Seguente<Tab>]s
menut To\ &Previous\ Error<Tab>[s Errore\ &Precedente<Tab>[s
menut Suggest\ &Corrections<Tab>z= &Suggerimenti<Tab>z=
menut &Repeat\ correction<Tab>:spellrepall &Ripeti\ correzione<Tab>:spellrepall
menut Set\ language\ to Imposta\ lingua\ a
menut Set\ language\ to\ "en" Imposta\ lingua\ a\ "en"
menut Set\ language\ to\ "en_au" Imposta\ lingua\ a\ "en_au"
menut Set\ language\ to\ "en_ca" Imposta\ lingua\ a\ "en_ca"
menut Set\ language\ to\ "en_gb" Imposta\ lingua\ a\ "en_gb"
menut Set\ language\ to\ "en_nz" Imposta\ lingua\ a\ "en_nz"
menut Set\ language\ to\ "en_us" Imposta\ lingua\ a\ "en_us"
menut &Repeat\ Correction<Tab>:spellrepall &Ripeti\ correzione<Tab>:spellrepall
menut Set\ Language\ to\ "en" Imposta\ lingua\ a\ "en"
menut Set\ Language\ to\ "en_au" Imposta\ lingua\ a\ "en_au"
menut Set\ Language\ to\ "en_ca" Imposta\ lingua\ a\ "en_ca"
menut Set\ Language\ to\ "en_gb" Imposta\ lingua\ a\ "en_gb"
menut Set\ Language\ to\ "en_nz" Imposta\ lingua\ a\ "en_nz"
menut Set\ Language\ to\ "en_us" Imposta\ lingua\ a\ "en_us"
menut &Find\ More\ Languages &Trova\ altre\ lingue
" Menù piegature / Fold
menut &Folding &Piegature
" apri e chiudi piegature
menut &Enable/Disable\ folds<Tab>zi Pi&egature\ Sì/No<Tab>zi
menut &Enable/Disable\ Folds<Tab>zi Pi&egature\ Sì/No<Tab>zi
menut &View\ Cursor\ Line<Tab>zv &Vedi\ linea\ col\ Cursore<Tab>zv
menut Vie&w\ Cursor\ Line\ only<Tab>zMzx Vedi\ &Solo\ linea\ col\ Cursore<Tab>zMzx
menut C&lose\ More\ folds<Tab>zm C&Hiudi\ più\ piegature<Tab>zm
menut &Close\ All\ folds<Tab>zM &Chiudi\ tutte\ le\ piegature<Tab>zM
menut O&pen\ More\ folds<Tab>zr A&Pri\ più\ piegature<Tab>zr
menut &Open\ All\ folds<Tab>zR &Apri\ tutte\ le\ piegature<Tab>zR
menut Vie&w\ Cursor\ Line\ Only<Tab>zMzx Vedi\ &Solo\ linea\ col\ Cursore<Tab>zMzx
menut C&lose\ More\ Folds<Tab>zm C&Hiudi\ più\ piegature<Tab>zm
menut &Close\ All\ Folds<Tab>zM &Chiudi\ tutte\ le\ piegature<Tab>zM
menut O&pen\ More\ Folds<Tab>zr A&Pri\ più\ piegature<Tab>zr
menut &Open\ All\ Folds<Tab>zR &Apri\ tutte\ le\ piegature<Tab>zR
" metodo piegatura
menut Fold\ Met&hod Meto&Do\ piegatura
menut M&anual &Manuale
@@ -359,7 +382,15 @@ menut Create\ &Fold<Tab>zf Crea\ &Piegatura<Tab>zf
menut &Delete\ Fold<Tab>zd &Togli\ piegatura<Tab>zd
menut Delete\ &All\ Folds<Tab>zD Togli\ &Tutte\ le\ piegature<Tab>zD
" movimenti all'interno delle piegature
menut Fold\ col&umn\ width Larghezza\ piegat&Ure\ in\ colonne
menut Fold\ Col&umn\ Width Larghezza\ piegat&Ure\ in\ colonne
"menut Fold\ Col&umn\ Width.\ &0\ Larghezza\ piegat&Ure\ in\ colonne.\ &0\
"menut Fold\ Col&umn\ Width.\ &2\ Larghezza\ piegat&Ure\ in\ colonne.\ &2\
"menut Fold\ Col&umn\ Width.\ &3\ Larghezza\ piegat&Ure\ in\ colonne.\ &3\
"menut Fold\ Col&umn\ Width.\ &4\ Larghezza\ piegat&Ure\ in\ colonne.\ &4\
"menut Fold\ Col&umn\ Width.\ &5\ Larghezza\ piegat&Ure\ in\ colonne.\ &5\
"menut Fold\ Col&umn\ Width.\ &6\ Larghezza\ piegat&Ure\ in\ colonne.\ &6\
"menut Fold\ Col&umn\ Width.\ &7\ Larghezza\ piegat&Ure\ in\ colonne.\ &7\
"menut Fold\ Col&umn\ Width.\ &8\ Larghezza\ piegat&Ure\ in\ colonne.\ &8\
menut &Diff &Differenza
"
@@ -383,9 +414,9 @@ menut &Open<Tab>:copen &Apri<Tab>:copen
menut &Close<Tab>:cclose &Chiudi<Tab>:cclose
menut &Convert\ to\ HEX<Tab>:%!xxd &Converti\ a\ esadecimale<Tab>:%!xxd
menut Conve&rt\ back<Tab>:%!xxd\ -r Conve&rti\ da\ esadecimale<Tab>:%!xxd\ -r
menut Conve&rt\ Back<Tab>:%!xxd\ -r Conve&rti\ da\ esadecimale<Tab>:%!xxd\ -r
menut Se&T\ Compiler Impo&Sta\ Compilatore
menut Se&t\ Compiler Impo&Sta\ Compilatore
menut Show\ Compiler\ Se&ttings\ in\ Menu Mostra\ Impos&Tazioni\ Compilatore\ nel\ Menù
" Buffers / Buffer
@@ -396,20 +427,20 @@ menut &Delete &Elimina
menut &Alternate &Alternato
menut &Next &Successivo
menut &Previous &Precedente
menut [No\ File] [Nessun\ File]
"menut [No\ File] [Nessun\ File]
" Syntax / Sintassi
menut &Syntax &Sintassi
menut &Show\ File\ Types\ in\ menu Mo&Stra\ tipi\ di\ file\ nel\ menù
menut Set\ '&syntax'\ only &S\ Attiva\ solo\ \ 'syntax'
menut Set\ '&filetype'\ too &F\ Attiva\ anche\ 'filetype'
menut &Show\ File\ Types\ in\ Menu Mo&Stra\ tipi\ di\ file\ nel\ menù
menut Set\ '&syntax'\ Only &S\ Attiva\ solo\ \ 'syntax'
menut Set\ '&filetype'\ Too &F\ Attiva\ anche\ 'filetype'
menut &Off &Disattiva
menut &Manual &Manuale
menut A&utomatic A&Utomatico
menut on/off\ for\ &This\ file Attiva\ Sì/No\ su\ ques&To\ file
menut Co&lor\ test Test\ &Colori
menut &Highlight\ test Test\ &Evidenziamento
menut On/Off\ for\ &This\ File Attiva\ Sì/No\ su\ ques&To\ file
menut Co&lor\ Test Test\ &Colori
menut &Highlight\ Test Test\ &Evidenziamento
menut &Convert\ to\ HTML Converti\ ad\ &HTML
let g:menutrans_set_lang_to = "Cambia linguaggio a"
@@ -432,15 +463,15 @@ menut Move\ &To &Muovi\ verso
menut &Top<Tab>^WK &Cima<Tab>^WK
menut &Bottom<Tab>^WJ &Fondo<Tab>^WJ
menut &Left\ side<Tab>^WH Lato\ &Sinistro<Tab>^WH
menut &Right\ side<Tab>^WL Lato\ &Destro<Tab>^WL
menut &Left\ Side<Tab>^WH Lato\ &Sinistro<Tab>^WH
menut &Right\ Side<Tab>^WL Lato\ &Destro<Tab>^WL
menut Rotate\ &Up<Tab>^WR Ruota\ verso\ l'&Alto<Tab>^WR
menut Rotate\ &Down<Tab>^Wr Ruota\ verso\ il\ &Basso<Tab>^Wr
menut &Equal\ Size<Tab>^W= &Uguale\ ampiezza<Tab>^W=
menut &Max\ Height<Tab>^W_ A&Ltezza\ massima<Tab>^W_
menut M&in\ Height<Tab>^W1_ Al&Tezza\ minima<Tab>^W1_
menut Max\ &Width<Tab>^W\| Lar&Ghezza\ massima<Tab>^W\|
menut Min\ Widt&h<Tab>^W1\| Larg&hhezza\ minima<Tab>^W1\|
menut Min\ Widt&h<Tab>^W1\| Larg&Hezza\ minima<Tab>^W1\|
" The popup menu
menut &Undo &Annulla
@@ -457,43 +488,43 @@ menut Select\ &Sentence Seleziona\ &Frase
menut Select\ Pa&ragraph Seleziona\ Para&Grafo
" The GUI Toolbar / Barra Strumenti
menut Open Apri
menut Save Salva
menut SaveAll Salva\ Tutto
menut Print Stampa
menut Undo Annulla
menut Redo Ripristina
menut Cut Taglia
menut Copy Copia
menut Paste Incolla
"menut Open Apri
"menut Save Salva
"menut SaveAll Salva\ Tutto
"menut Print Stampa
"menut Undo Annulla
"menut Redo Ripristina
"menut Cut Taglia
"menut Copy Copia
"menut Paste Incolla
" -sep3-
menut Find Cerca
menut FindNext Cerca\ Successivo
menut FindPrev Cerca\ Precedente
menut Replace Sostituisci
"menut Find Cerca
"menut FindNext Cerca\ Successivo
"menut FindPrev Cerca\ Precedente
"menut Replace Sostituisci
" -sep4-
menut New Nuova\ finestra
menut WinSplit Dividi\ finestra
menut WinMax Massima\ ampiezza
menut WinMin Minima\ ampiezza
menut WinVSplit Dividi\ verticalmente
menut WinMaxWidth Massima\ larghezza
menut WinMinWidth Minima\ larghezza
menut WinClose Chiudi\ finestra
menut LoadSesn Carica\ Sessione
menut SaveSesn Salva\ Sessione
menut RunScript Esegui\ Script
menut Make Make
menut Shell Shell
menut RunCtags Esegui\ Ctags
menut TagJump Vai\ a\ Tag
menut Help Aiuto
menut FindHelp Cerca\ in\ Aiuto
"menut New Nuova\ finestra
"menut WinSplit Dividi\ finestra
"menut WinMax Massima\ ampiezza
"menut WinMin Minima\ ampiezza
"menut WinVSplit Dividi\ verticalmente
"menut WinMaxWidth Massima\ larghezza
"menut WinMinWidth Minima\ larghezza
"menut WinClose Chiudi\ finestra
"menut LoadSesn Carica\ Sessione
"menut SaveSesn Salva\ Sessione
"menut RunScript Esegui\ Script
"menut Make Make
"menut Shell Shell
"menut RunCtags Esegui\ Ctags
"menut TagJump Vai\ a\ Tag
"menut Help Aiuto
"menut FindHelp Cerca\ in\ Aiuto
so $VIMRUNTIME/lang/macvim_menu/menu_it_it.latin1.apple.vim
so $VIMRUNTIME/lang/macvim_menu/menu_it_it.latin1.custom.vim
let &cpo = s:keepcpo
unlet s:keepcpo
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: set sw=2 :
+2 -1
View File
@@ -2,7 +2,7 @@ vim9script
# Script to define the syntax menu in synmenu.vim
# Maintainer: The Vim Project <https://github.com/vim/vim>
# Last Change: 2023 Aug 10
# Last Change: 2025 Mar 09
# Former Maintainer: Bram Moolenaar <Bram@vim.org>
# This is used by "make menu" in the src directory.
@@ -605,6 +605,7 @@ SynMenu T.TealInfo:tli
SynMenu T.Telix\ Salt:tsalt
SynMenu T.Termcap/Printcap:ptcap
SynMenu T.Terminfo:terminfo
SynMenu T.Tera:tera
SynMenu T.Tera\ Term:teraterm
SynMenu T.TeX.TeX/LaTeX:tex
SynMenu T.TeX.plain\ TeX:plaintex
+7 -1
View File
@@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2024 Dec 07
" Last Change: 2025 Mar 27
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" If there already is an option window, jump to that one.
@@ -867,6 +867,8 @@ endif
if has("insert_expand")
call <SID>AddOption("complete", gettext("specifies how Insert mode completion works for CTRL-N and CTRL-P"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>OptionL("cfc")
call <SID>AddOption("completefuzzycollect", gettext("use fuzzy collection for specific completion modes"))
call <SID>OptionL("cpt")
call <SID>AddOption("completeopt", gettext("whether to use a popup menu for Insert mode completion"))
call <SID>OptionL("cot")
@@ -880,6 +882,8 @@ if has("insert_expand")
call <SID>OptionG("ph", &ph)
call <SID>AddOption("pumwidth", gettext("minimum width of the popup menu"))
call <SID>OptionG("pw", &pw)
call <SID>AddOption("pumaxmwidth", gettext("maximum width of the popup menu"))
call <SID>OptionG("pmw", &pmw)
call <SID>AddOption("completefunc", gettext("user defined function for Insert mode completion"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>OptionL("cfu")
@@ -1362,6 +1366,8 @@ call <SID>AddOption("virtualedit", gettext("when to use virtual editing: \"block
call <SID>OptionG("ve", &ve)
call <SID>AddOption("eventignore", gettext("list of autocommand events which are to be ignored"))
call <SID>OptionG("ei", &ei)
call <SID>AddOption("eventignorewin", gettext("list of autocommand events which are to be ignored in a window"))
call <SID>OptionG("eiw", &eiw)
call <SID>AddOption("loadplugins", gettext("load plugin scripts when starting up"))
call <SID>BinOptionG("lpl", &lpl)
call <SID>AddOption("exrc", gettext("enable reading .vimrc/.exrc/.gvimrc in the current directory"))
+86 -1
View File
@@ -1,7 +1,7 @@
vim9script
# Maintainer: Maxim Kim <habamax@gmail.com>
# Last Update: 2024 Oct 05
# Last Update: 2025 Mar 21
#
# Toggle comments
# Usage:
@@ -76,3 +76,88 @@ export def Toggle(...args: list<string>): string
noautocmd keepjumps setline(lnum1, lines)
return ''
enddef
# Comment text object
# Usage:
# import autoload 'dist/comment.vim'
# onoremap <silent>ic <scriptcmd>comment.ObjComment(v:true)<CR>
# onoremap <silent>ac <scriptcmd>comment.ObjComment(v:false)<CR>
# xnoremap <silent>ic <esc><scriptcmd>comment.ObjComment(v:true)<CR>
# xnoremap <silent>ac <esc><scriptcmd>comment.ObjComment(v:false)<CR>
export def ObjComment(inner: bool)
def IsComment(): bool
var stx = map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')->join()
return stx =~? 'Comment'
enddef
# requires syntax support
if !exists("g:syntax_on")
return
endif
var pos_init = getcurpos()
# If not in comment, search next one,
if !IsComment()
if search('\v\k+', 'W', line(".") + 100, 100, () => !IsComment()) <= 0
return
endif
endif
# Search for the beginning of the comment block
if IsComment()
if search('\v%(\S+)|$', 'bW', 0, 200, IsComment) > 0
search('\v%(\S)|$', 'W', 0, 200, () => !IsComment())
else
cursor(1, 1)
search('\v\S+', 'cW', 0, 200)
endif
endif
var pos_start = getcurpos()
if !inner
var col = pos_start[2]
var prefix = getline(pos_start[1])[ : col - 2]
while col > 0 && prefix[col - 2] =~ '\s'
col -= 1
endwhile
pos_start[2] = col
endif
# Search for the comment end.
if pos_init[1] > pos_start[1]
cursor(pos_init[1], pos_init[2])
endif
if search('\v%(\S+)|$', 'W', 0, 200, IsComment) > 0
search('\S', 'beW', 0, 200, () => !IsComment())
else
if search('\%$', 'W', 0, 200) > 0
search('\ze\S', 'beW', 0, 200, () => !IsComment())
endif
endif
var pos_end = getcurpos()
if !inner
var spaces = matchstr(getline(pos_end[1]), '\%>.c\s*')
pos_end[2] += spaces->len()
if getline(pos_end[1])[pos_end[2] : ] =~ '^\s*$'
&& (pos_start[2] == 1 || getline(pos_start[1])[ : pos_start[2]] =~ '^\s*$')
if search('\v\s*\_$(\s*\n)+', 'eW', 0, 200) > 0
pos_end = getcurpos()
endif
endif
endif
if (pos_end[2] == (getline(pos_end[1])->len() ?? 1)) && pos_start[2] <= 1
cursor(pos_end[1], 1)
normal! V
cursor(pos_start[1], 1)
else
cursor(pos_end[1], pos_end[2])
normal! v
cursor(pos_start[1], pos_start[2])
endif
enddef

Some files were not shown because too many files have changed in this diff Show More