diff --git a/.gitattributes b/.gitattributes
index bad1d9edb2..46ac5f9cc6 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,4 +1,13 @@
-src/testdir/test42.in diff
+# The old test .ok files are expected to use LF line endings, even on Windows.
+# In src/testdir/Make_mvc.mak and src/testdir/Make_ming.mak, the test result
+# files .out are converted to LF line endings before being compared.
+# Therefore, if the .ok files' line endings are not specified and are
+# converted to CRLF, the comparison between .ok and .out will fail.
+src/testdir/test*.ok text eol=lf
+
+# This ok file contains literal CR LF endings. Should not be touched by git,
+# so handle as binary
+src/testdir/test21.ok -text
# `vim.pot` is updated every time any of the *.c files are modified. And as it
# contains line numbers for strings from *.c files, inserting a line into a
@@ -24,7 +33,7 @@ src/po/vim.pot -diff
src/po/vim.pot diff=ignore_vim_pot
# GitHub reacts to the `linguist-generated` attribute, by ignoring marked files
-# for the repository's language statistics and hiddning changes in these files
+# for the repository's language statistics and hiding changes in these files
# by default in diffs.
#
# https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github
diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS
index d904e1c95a..f21bc31b0c 100644
--- a/.github/MAINTAINERS
+++ b/.github/MAINTAINERS
@@ -13,6 +13,7 @@ nsis/lang/russian.nsi @RestorerZ
runtime/autoload/freebasic.vim @dkearns
runtime/autoload/hare.vim @selenebun
runtime/autoload/hcl.vim @gpanders
+runtime/autoload/javascriptcomplete.vim @jsit
runtime/autoload/modula2.vim @dkearns
runtime/autoload/rubycomplete.vim @segfault @dkearns
runtime/autoload/rust.vim @lilyball
@@ -44,6 +45,7 @@ runtime/colors/torte.vim @habamax @romainl @neutaaaaan
runtime/colors/wildcharm.vim @habamax @romainl @neutaaaaan
runtime/colors/zaibatsu.vim @habamax @romainl @neutaaaaan
runtime/colors/zellner.vim @habamax @romainl @neutaaaaan
+runtime/compiler/biome.vim @Konfekt
runtime/compiler/checkstyle.vim @dkearns
runtime/compiler/cm3.vim @dkearns
runtime/compiler/cucumber.vim @tpope
@@ -125,9 +127,12 @@ runtime/ftplugin/asy.vim @avidseeker
runtime/ftplugin/autohotkey.vim @telemachus
runtime/ftplugin/awk.vim @dkearns
runtime/ftplugin/basic.vim @dkearns
+runtime/ftplugin/bicep.vim @scottmckendry
+runtime/ftplugin/bicep-params.vim @scottmckendry
runtime/ftplugin/brighterscript.vim @ribru17
runtime/ftplugin/brightscript.vim @ribru17
runtime/ftplugin/bst.vim @tpope
+runtime/ftplugin/bpftrace.vim @sgruszka
runtime/ftplugin/c3.vim @ttytm
runtime/ftplugin/cabal.vim @ribru17
runtime/ftplugin/cedar.vim @ribru17
@@ -219,11 +224,14 @@ runtime/ftplugin/kivy.vim @ribru17
runtime/ftplugin/kotlin.vim @udalov
runtime/ftplugin/lc.vim @ribru17
runtime/ftplugin/ldapconf.vim @ribru17
+runtime/ftplugin/leex.vim @jparise
runtime/ftplugin/leo.vim @ribru17
runtime/ftplugin/less.vim @genoma
runtime/ftplugin/lex.vim @ribru17
runtime/ftplugin/lf.vim @andis-sprinkis
runtime/ftplugin/liquid.vim @tpope
+runtime/ftplugin/logtalk.dict @pmoura
+runtime/ftplugin/logtalk.vim @pmoura
runtime/ftplugin/lua.vim @dkearns
runtime/ftplugin/lynx.vim @dkearns
runtime/ftplugin/m17ndb.vim @dseomn
@@ -286,6 +294,7 @@ runtime/ftplugin/sed.vim @dkearns
runtime/ftplugin/sh.vim @dkearns
runtime/ftplugin/shaderslang.vim @mTvare6
runtime/ftplugin/slint.vim @ribru17
+runtime/ftplugin/sml.vim @tocariimaa
runtime/ftplugin/snakemake.vim @ribru17
runtime/ftplugin/solidity.vim @coti-z
runtime/ftplugin/solution.vim @dkearns
@@ -331,6 +340,7 @@ runtime/import/dist/vimhighlight.vim @lacygoill
runtime/indent/arduino.vim @k-takata
runtime/indent/astro.vim @wuelnerdotexe
runtime/indent/basic.vim @dkearns
+runtime/indent/bpftrace.vim @sgruszka
runtime/indent/bst.vim @tpope
runtime/indent/cdl.vim @dkearns
runtime/indent/chatito.vim @ObserverOfTime
@@ -374,8 +384,10 @@ runtime/indent/kdl.vim @imsnif @jiangyinzuo
runtime/indent/kotlin.vim @udalov
runtime/indent/krl.vim @KnoP-01
runtime/indent/ld.vim @dkearns
+runtime/indent/lf.vim @andis-sprinkis
runtime/indent/less.vim @genoma
runtime/indent/liquid.vim @tpope
+runtime/indent/logtalk.vim @pmoura
runtime/indent/lua.vim @marcuscf
runtime/indent/m17ndb.vim @dseomn
runtime/indent/make.vim @dkearns
@@ -448,6 +460,7 @@ runtime/syntax/asy.vim @avidseeker
runtime/syntax/autohotkey.vim @mmikeww
runtime/syntax/awk.vim @dkearns
runtime/syntax/basic.vim @dkearns
+runtime/syntax/bpftrace.vim @sgruszka
runtime/syntax/bst.vim @tpope
runtime/syntax/bzl.vim @dbarnett
runtime/syntax/bzr.vim @hdima
@@ -462,6 +475,7 @@ runtime/syntax/chuck.vim @andreacfromtheapp
runtime/syntax/clojure.vim @axvr
runtime/syntax/codeowners.vim @jparise
runtime/syntax/cs.vim @nickspoons
+runtime/syntax/css.vim @jsit
runtime/syntax/csv.vim @habamax
runtime/syntax/cucumber.vim @tpope
runtime/syntax/d.vim @JesseKPhillips
@@ -546,10 +560,12 @@ runtime/syntax/kivy.vim @prophittcorey
runtime/syntax/kotlin.vim @udalov
runtime/syntax/kdl.vim @imsnif @jiangyinzuo
runtime/syntax/krl.vim @KnoP-01
+runtime/syntax/leex.vim @jparise
runtime/syntax/less.vim @genoma
runtime/syntax/lf.vim @andis-sprinkis
runtime/syntax/liquid.vim @tpope
runtime/syntax/log.vim @mao-yining
+runtime/syntax/logtalk.vim @pmoura
runtime/syntax/lua.vim @marcuscf
runtime/syntax/lynx.vim @dkearns
runtime/syntax/lyrics.vim @ObserverOfTime
diff --git a/.github/actions/test_artifacts/action.yml b/.github/actions/test_artifacts/action.yml
index e68fec961b..0afcd6d779 100644
--- a/.github/actions/test_artifacts/action.yml
+++ b/.github/actions/test_artifacts/action.yml
@@ -1,31 +1,41 @@
name: 'test_artifacts'
description: "Upload failed test artifacts"
+inputs:
+ artifact-name:
+ description: Name of the artifact
+ required: true
+
runs:
using: "composite"
steps:
- - name: Collect matrix properties for naming
- uses: actions/github-script@v8
- id: matrix-props
- env:
- MATRIX_PROPS: ${{ toJSON(matrix) }}
- with:
- # An array-flattening-to-string JavaScript function.
- script: |
- const f = function (x) { return x.toString().length > 0; }
- const g = function (x) {
- return (Array.isArray(x))
- ? x.filter(f)
- .map((function (h) { return function (y) { return h(y); }; })(g))
- .join('-')
- : x;
- }
- return Object.values(JSON.parse(process.env.MATRIX_PROPS))
- .filter(f)
- .map(g)
- .join('-');
- # By default, the JSON-encoded return value of the function is
- # set as the "result".
- result-encoding: string
+# MacVim: We don't use a matrix within the reused
+# workflow, and so would prefer to manually pass
+# in the name of the artifact rather than deriving
+# it from the matrix automatically like in Vim
+# upstream.
+# - name: Collect matrix properties for naming
+# uses: actions/github-script@v8
+# id: matrix-props
+# env:
+# MATRIX_PROPS: ${{ toJSON(inputs) }}
+# with:
+# # An array-flattening-to-string JavaScript function.
+# script: |
+# const f = function (x) { return x.toString().length > 0; }
+# const g = function (x) {
+# return (Array.isArray(x))
+# ? x.filter(f)
+# .map((function (h) { return function (y) { return h(y); }; })(g))
+# .join('-')
+# : x;
+# }
+# return Object.values(JSON.parse(process.env.MATRIX_PROPS))
+# .filter(f)
+# .map(g)
+# .join('-');
+# # By default, the JSON-encoded return value of the function is
+# # set as the "result".
+# result-encoding: string
- name: Upload failed tests
uses: actions/upload-artifact@v4
with:
@@ -35,7 +45,7 @@ runs:
github.run_attempt,
github.job,
strategy.job-index,
- steps.matrix-props.outputs.result) }}
+ inputs.artifact-name) }}
# A file, directory or wildcard pattern that describes what
# to upload.
diff --git a/.github/actions/test_macvim_artifacts/action.yml b/.github/actions/test_macvim_artifacts/action.yml
index e02eec625e..a0ec557045 100644
--- a/.github/actions/test_macvim_artifacts/action.yml
+++ b/.github/actions/test_macvim_artifacts/action.yml
@@ -1,6 +1,14 @@
# This is a clone of test_artifacts for MacVim-specific files
+# This should be almost identical to test_artifacts, other than the artifact
+# name/path. In the future we could potentially combine the two, but for now
+# it's simpler to keep them separate to ease upstream merging.
name: 'test_macvim_artifacts'
description: "Upload failed MacVim test artifacts"
+inputs:
+ artifact-name:
+ description: Name of the artifact
+ required: true
+
runs:
using: "composite"
steps:
@@ -8,7 +16,12 @@ runs:
uses: actions/upload-artifact@v4
with:
# Name of the artifact to upload.
- name: ${{ github.workflow }}-${{ github.job }}-${{ join(matrix.*, '-') }}-failed-macvim-tests
+ name: ${{ format('GH-{0}-{1}-{2}-{3}-{4}-failed-macvim-tests',
+ github.run_id,
+ github.run_attempt,
+ github.job,
+ strategy.job-index,
+ inputs.artifact-name) }}
# A file, directory or wildcard pattern that describes what
# to upload.
diff --git a/.github/actions/universal-package/action.yml b/.github/actions/universal-package/action.yml
index 6d5f0a9e5a..0ea6df8532 100644
--- a/.github/actions/universal-package/action.yml
+++ b/.github/actions/universal-package/action.yml
@@ -7,15 +7,19 @@ description: Create universal Homebrew package which contains x86_64 and arm64
# that has both x86_64 and arm64 arch, as Homebrew's distributed bottles are thin binaries with only one arch.
#
# We still use Homebrew to manage the library because their formulas are up to date and have correct build instructions
-# that will work. This way we don't have to manually configuring and building and updating the package info.
+# that will work. This way we don't have to manually configure, build, and update the package info.
inputs:
formula:
- description: Formura name
+ description: Formula name
required: true
contents:
description: Path for contents in package's keg
required: true
+ gnuiconv:
+ description: Use the Homebrew GNU libiconv instead of system one
+ type: boolean
+ required: false
runs:
using: 'composite'
steps:
@@ -31,14 +35,24 @@ runs:
# version and stomp what we have here.
brew update
+ brew cat ${formula} >${formula}.rb
+
+ if [[ "${{ inputs.gnuiconv }}" == "true" ]]; then
+ # Modify formula to build using Homebrew libiconv. Usually just adding "depends_on" is enough, but since we
+ # override "CC" to use vanilla system clang, we need to manually inject the compilation/link flags to specify
+ # the locations.
+ sed -i.bak '/^[[:blank:]]*def install$/i\'$'\n depends_on "libiconv"\n' ${formula}.rb
+ sed -i.bak '/^[[:blank:]]*def install$/a\'$'\n ENV["CFLAGS"] += " -I'$(brew --prefix)$'/opt/libiconv/include"\n' ${formula}.rb
+ sed -i.bak '/^[[:blank:]]*def install$/a\'$'\n ENV["LDFLAGS"] += " -L'$(brew --prefix)$'/opt/libiconv/lib"\n' ${formula}.rb
+ fi
+
# Patch the official Homebrew formula to explicitly build for min deployment target and a universal binary. We
# also need to explicitly use system Clang because Homebrew's bundled clang script tries to inject -march
# compiler flags that will cause universal builds to fail as Clang does not like that.
- brew cat ${formula} | \
- sed '/^[[:blank:]]*def install$/a\'$'\n ENV["MACOSX_DEPLOYMENT_TARGET"] = "'${MACOSX_DEPLOYMENT_TARGET}$'"\n' | \
- sed '/^[[:blank:]]*def install$/a\'$'\n ENV["CC"] = "/usr/bin/clang"\n' | \
- sed '/^[[:blank:]]*def install$/a\'$'\n ENV["CFLAGS"] = "-arch x86_64 -arch arm64"\n' | \
- sed '/^[[:blank:]]*def install$/a\'$'\n ENV["LDFLAGS"] = "-arch x86_64 -arch arm64"\n' >${formula}.rb
+ sed -i.bak '/^[[:blank:]]*def install$/a\'$'\n ENV["MACOSX_DEPLOYMENT_TARGET"] = "'${MACOSX_DEPLOYMENT_TARGET}$'"\n' ${formula}.rb
+ sed -i.bak '/^[[:blank:]]*def install$/a\'$'\n ENV["CC"] = "/usr/bin/clang"\n' ${formula}.rb
+ sed -i.bak '/^[[:blank:]]*def install$/a\'$'\n ENV["CFLAGS"] = "-arch x86_64 -arch arm64"\n' ${formula}.rb
+ sed -i.bak '/^[[:blank:]]*def install$/a\'$'\n ENV["LDFLAGS"] = "-arch x86_64 -arch arm64"\n' ${formula}.rb
# Homebrew requires formula files to be placed in taps and disallows
# installing from raw paths, so we manually create a taps folder for a
@@ -85,7 +99,9 @@ runs:
brew list ${formula} &>/dev/null || brew install --quiet --formula -s macvim-dev/deps/${formula}
# If formula was cached, this step is necessary to relink it to brew prefix (e.g. /usr/local)
- brew unlink ${formula} && brew link ${formula}
+ # The "-f" is there to force link keg-only formulas. Homebrew doesn't provide a command to just link in the
+ # optional /opt/homebrew/opt/... folders, so we have to resort to doing this.
+ brew unlink ${formula} && brew link -f ${formula}
echo '::endgroup::'
echo '::group::Verify built version'
diff --git a/.github/labeler.yml b/.github/labeler.yml
index 5b884c89e0..720765d383 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -128,9 +128,12 @@ runtime:
- all:
- changed-files:
- any-glob-to-any-file:
- - 'runtime/ftplugin'
- - 'runtime/syntax'
- - 'runtime/indent'
+ - 'runtime/autoload/**/*.vim'
+ - 'runtime/colors/**/*.vim'
+ - 'runtime/compiler/**/*.vim'
+ - 'runtime/ftplugin/**/*.vim'
+ - 'runtime/indent/**/*.vim'
+ - 'runtime/syntax/**/*.vim'
- 'runtime/pack/dist/opt/termdebug/plugin/termdebug.vim'
termdebug:
diff --git a/.github/workflows/ci-macvim.yaml b/.github/workflows/ci-macvim.yaml
index 7bd4fedcc8..2aa9b0c337 100644
--- a/.github/workflows/ci-macvim.yaml
+++ b/.github/workflows/ci-macvim.yaml
@@ -29,20 +29,14 @@ jobs:
skip: ${{ ! startswith(github.ref, 'refs/tags/release') }}
legacy: true
- - os: macos-13
- xcode: '15.2'
- testgui: true
- extra: [vimtags, check-xcodeproj-compat]
-
- # Below runners use Apple Silicon.
- os: macos-14
xcode: '15.4'
- testgui: false
+ testgui: true
+ extra: [vimtags, check-xcodeproj-compat]
- # Most up to date OS and Xcode. Used to publish release for the main build.
- os: macos-15
xcode: '16.4'
- testgui: true
+ testgui: false
publish: true
optimized: true
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index ac9e71ae52..3364adf340 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -44,7 +44,7 @@ jobs:
steps:
- name: Checkout repository from github
- uses: actions/checkout@v5
+ uses: actions/checkout@v6
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
index f74174636b..04859a9758 100644
--- a/.github/workflows/coverity.yml
+++ b/.github/workflows/coverity.yml
@@ -19,7 +19,7 @@ jobs:
steps:
- name: Checkout repository from github
if: env.TOKEN
- uses: actions/checkout@v5
+ uses: actions/checkout@v6
- name: Download Coverity
if: env.TOKEN
diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml
index 59ced56920..4eac572158 100644
--- a/.github/workflows/link-check.yml
+++ b/.github/workflows/link-check.yml
@@ -8,7 +8,7 @@ jobs:
lychee:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v5
+ - uses: actions/checkout@v6
- name: Run Lychee
uses: lycheeverse/lychee-action@v2
with:
diff --git a/.github/workflows/macvim-buildtest.yaml b/.github/workflows/macvim-buildtest.yaml
index 3cd5987636..5bee202306 100644
--- a/.github/workflows/macvim-buildtest.yaml
+++ b/.github/workflows/macvim-buildtest.yaml
@@ -64,7 +64,7 @@ jobs:
runs-on: ${{ inputs.os }}
steps:
- name: Checkout
- uses: actions/checkout@v5
+ uses: actions/checkout@v6
- name: Set up legacy build
if: inputs.legacy
@@ -89,6 +89,15 @@ jobs:
xcode-select -p
xcodebuild -version
+ # Set up, install, and cache GNU libiconv library to work around Apple iconv issues.
+
+ - name: Set up libiconv
+ if: inputs.publish
+ uses: ./.github/actions/universal-package
+ with:
+ formula: libiconv
+ contents: opt/libiconv/lib/libiconv.a,opt/libiconv/lib/libiconv.dylib
+
# Set up, install, and cache gettext library for localization.
- name: Set up gettext
@@ -97,6 +106,7 @@ jobs:
with:
formula: gettext
contents: lib/libintl.a,lib/libintl.dylib
+ gnuiconv: true # gettext needs to match MacVim in using the same version of iconv
# Set up, install, and cache libsodium library for encryption.
@@ -125,7 +135,7 @@ jobs:
# 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
+ uses: actions/cache@v5
with:
path: python27-cache
key: ${{ inputs.os }}-python27
@@ -222,6 +232,9 @@ jobs:
sed -i.bak -f ci/config.mk.optimized.sed src/auto/config.mk
fi
+ # Use Homebrew GNU libiconv since Apple iconv has been broken since macOS 14
+ sed -i.bak -f ci/config.mk.brew-libiconv.sed src/auto/config.mk
+
- name: Modify configure result
if: inputs.publish
run: |
@@ -271,6 +284,11 @@ jobs:
echo 'Found external dynamic linkage!'; false
fi
+ # Make sure we are not using system iconv, which has been buggy since macOS 14.
+ if otool -L ${VIM_BIN} | grep '^\s*/usr/lib/libiconv'; then
+ echo 'Using system iconv! We should be linking against GNU iconv instead.'; 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).
@@ -348,11 +366,17 @@ jobs:
id: test_macvim
timeout-minutes: 10
run: |
+ echo '::group::Build MacVim test binaries'
+ # Build test binaries in a separate step to allow grouping in the CI output to make the output more concise.
+ make ${MAKE_BUILD_ARGS} -C src macvim-tests-binaries
+ echo '::endgroup::'
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
+ with:
+ artifact-name: ${{ format('{0}-{1}', inputs.os, inputs.xcode) }}
- name: Build Vim test binaries
run: |
@@ -385,6 +409,8 @@ jobs:
- name: Upload failed test files
if: ${{ !cancelled() && failure() }}
uses: ./.github/actions/test_artifacts
+ with:
+ artifact-name: ${{ format('{0}-{1}', inputs.os, inputs.xcode) }}
- name: Build MacVim dmg image
if: inputs.publish && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master')
@@ -405,7 +431,7 @@ jobs:
# 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@v5
+ uses: actions/upload-artifact@v6
with:
name: MacVim${{ inputs.publish_postfix }}.dmg
path: src/MacVim/build/Release/MacVim${{ inputs.publish_postfix }}.dmg
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index b37315d030..133c5c7edb 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -12,10 +12,10 @@ A pull request has the advantage that it will trigger the Continuous
Integration tests, you will be warned of problems (you can ignore the coverage
warning, it's noisy).
-Please consider adding a test. All new functionality should be tested and bug
-fixes should be tested for regressions: the test should fail before the fix and
-pass after the fix. Look through recent patches for examples and find help
-with ":help testing". The tests are located under "src/testdir".
+Please always add a test, if possible. All new functionality should be tested
+and bug fixes should be tested for regressions: the test should fail before the
+fix and pass after the fix. Look through recent patches for examples and find
+help with ":help testing". The tests are located under "src/testdir".
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
@@ -46,6 +46,15 @@ When merging PRs into Vim, the current maintainer @chrisbra usually adds missing
anybody that explicitly *ACK*s a pull request as a statement that those
approvers are happy with that particular change.
+## Using AI
+
+When using AI for contributions, please disclose this. Any AI-generated code
+must follow the Vim code style. In particular, [test_codestyle.vim][18]
+must not report any failures. Check the CI output for any test failures.
+
+Ensure that changes are properly tested. Do not submit a single PR that
+addresses multiple unrelated issues.
+
# Reporting issues
We use GitHub [issues][17], but that is not a requirement. Writing to the Vim
@@ -160,3 +169,4 @@ mailing list. For other questions please use the [Vi Stack Exchange][8] website,
[15]: https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin
[16]: https://github.com/vim/vim/blob/master/runtime/doc/helphelp.txt
[17]: https://github.com/vim/vim/issues
+[18]: https://github.com/vim/vim/blob/master/src/testdir/test_codestyle.vim
diff --git a/Filelist b/Filelist
index 9ab71cb892..7c8d1dd9e4 100644
--- a/Filelist
+++ b/Filelist
@@ -829,6 +829,10 @@ RT_ALL = \
runtime/pack/dist/opt/editorconfig/doc/editorconfig.txt \
runtime/pack/dist/opt/editorconfig/ftdetect/editorconfig.vim \
runtime/pack/dist/opt/editorconfig/plugin/editorconfig.vim \
+ runtime/pack/dist/opt/helpcurwin/autoload/helpcurwin.vim \
+ runtime/pack/dist/opt/helpcurwin/doc/helpcurwin.txt \
+ runtime/pack/dist/opt/helpcurwin/doc/tags \
+ runtime/pack/dist/opt/helpcurwin/plugin/helpcurwin.vim \
runtime/pack/dist/opt/helptoc/autoload/helptoc.vim \
runtime/pack/dist/opt/helptoc/doc/helptoc.txt \
runtime/pack/dist/opt/helptoc/doc/tags \
@@ -852,7 +856,11 @@ RT_ALL = \
runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim \
runtime/pack/dist/opt/netrw/doc/netrw.txt \
runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim \
- runtime/pack/dist/opt/netrw/syntax/netrw.vim
+ runtime/pack/dist/opt/netrw/syntax/netrw.vim \
+ runtime/pack/dist/opt/osc52/plugin/osc52.vim \
+ runtime/pack/dist/opt/osc52/autoload/osc52.vim \
+ runtime/pack/dist/opt/osc52/doc/osc52.txt \
+ runtime/pack/dist/opt/osc52/doc/tags
# Runtime files for all distributions without CR/LF translation.
RT_ALL_BIN = \
diff --git a/README_vim.md b/README_vim.md
index 30b0bd7b51..66a1e6cb8b 100644
--- a/README_vim.md
+++ b/README_vim.md
@@ -1,16 +1,3 @@
-
-
Special thanks for supporting Vim by donating to the ICCF:
-
-
-
-
-
-
-### [Warp, built for coding with multiple AI agents.](https://www.warp.dev/vim)
-[Available for MacOS, Linux, & Windows](https://www.warp.dev/vim)
-
-
-
# [](https://www.vim.org)
[](https://github.com/vim/vim/actions?query=workflow%3A%22GitHub+CI%22)
diff --git a/ci/config.mk.brew-libiconv.sed b/ci/config.mk.brew-libiconv.sed
new file mode 100644
index 0000000000..6bfc3d6919
--- /dev/null
+++ b/ci/config.mk.brew-libiconv.sed
@@ -0,0 +1,8 @@
+# Use Homebrew GNU libiconv to work around broken Apple iconv. Use static
+# linking as we don't want our binary releases to pull in third-party
+# dependencies.
+#
+# If gettext is configured in the build, it also needs to be built against GNU
+# libiconv. Otherwise we would get a link error from this.
+/^CFLAGS[[:blank:]]*=/s/$/ -I\/opt\/homebrew\/opt\/libiconv\/include/
+/^LIBS[[:blank:]]*=/s/-liconv/\/opt\/homebrew\/opt\/libiconv\/lib\/libiconv.a/
diff --git a/ci/config.mk.sed b/ci/config.mk.sed
index d888901931..f667b2c04f 100644
--- a/ci/config.mk.sed
+++ b/ci/config.mk.sed
@@ -1,3 +1,3 @@
/^CFLAGS[[:blank:]]*=/s/$/ -Wall -Wextra -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Werror -Wno-deprecated-declarations/
-/^PERL_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unused-function -Wno-shadow/
+/^PERL_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unused-function -Wno-strict-prototypes -Wno-shadow/
/^RUBY_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unused-parameter -Wno-strict-prototypes/
diff --git a/lang/LICENSE.ru.txt b/lang/LICENSE.ru.txt
index ba9deae972..d51f178c7d 100644
--- a/lang/LICENSE.ru.txt
+++ b/lang/LICENSE.ru.txt
@@ -1,3 +1,8 @@
+Примечание. Данный текст перевода лицензии Vim предоставляется с целью
+ознакомления и не является юридически значимым. Переводчик не несёт
+ответственности за возможные неточности и ошибки при переводе лицензии.
+Единственно юридически значимым является текст лицензии Vim на английском языке.
+
ЛИЦЕНЗИЯ VIM
I) Неизменённые копии программы Vim могут распространяться без ограничения
@@ -29,15 +34,15 @@ II) Изменённую (или дополненную) версию прогр
будут распространяться на условиях настоящей лицензии или более
поздней её версии. Лица, в данное время являющиеся ответственными
за разработку, указаны в перечне, размещённом по адресу:
- https://github.com/orgs/vim/people. В случае изменения этой
- информации, актуальные данные будут опубликованы на
- соответствующих ресурсах (вероятнее всего по интернет‐адресам
- vim.sf.net, www.vim.org и/или comp.editors). В случае полной
- невозможности установить контакт с ответственным разработчиком,
- обязательства по отправке изменений утрачивают силу. После
- передачи подтверждения о получении изменений от ответственного
- разработчика, необходимость в повторной отправке копии изменённой
- программы Vim неприменима.
+ https://github.com/orgs/vim/people.
+ При изменении этой информации, актуальные данные будут
+ опубликованы на соответствующих ресурсах (вероятнее всего
+ по интернет‐адресам vim.sf.net, www.vim.org и/или comp.editors).
+ В случае полной невозможности связаться с ответственным
+ разработчиком, обязательства по отправке изменений утрачивают
+ силу. После передачи подтверждения о получении изменений
+ от ответственного разработчика, необходимость в повторной
+ отправке копии изменённой программы Vim неприменима.
b) Если лицом получена изменённая версия программа Vim,
распространяющаяся на условиях, указанных в ч. II) п. 2) пп. а)
допускается дальнейшее её распространение этим лицом без внесения
diff --git a/lang/LICENSE.zh_cn.txt b/lang/LICENSE.zh_cn.txt
new file mode 100644
index 0000000000..e3eef9a32d
--- /dev/null
+++ b/lang/LICENSE.zh_cn.txt
@@ -0,0 +1,60 @@
+注意: 本译文仅供参考。若因译文错漏引发任何问题,译者概不承担责任。VIM 许可证的
+完整英文版本为唯一法律依据。如有任何疑问,以英文原文为准。
+
+VIM 许可证
+
+I) 可以任意发布没有修改的 Vim 的拷贝,但是必须保证包含本许可证。您也可以发布
+ 未经修改的部分 Vim,同样也必须包含这份许可证。发布由未经修改的 Vim 源代码
+ 所编译出的 Vim 可执行文件,外加您自己的应用实例和 Vim 脚本也是允许的。
+
+II) 在满足以下全部四个条件的前提下,您可以发布经过修改 (或扩充) 的 Vim 版本,
+ 包括可执行文件 和/或 源代码:
+ 1) 本许可证必须包含在内,并且不能被修改。
+ 2) 经过修改的 Vim 必须以下述五种方式之一发布:
+ a) 如果您本人对 Vim 做了改动,您必须在发布版本里清楚地说明如何与您联系。
+ 当 Vim 的维护者 (以任何方式) 向您索取您所发布的 Vim 时,您必须把所做
+ 的改动包括源代码无偿地提供出来。维护者保留把这些改动加入 Vim 正式版本
+ 的权利。至于维护者怎样处理这些改动,以及用什么许可证发布,可以协商。
+ 如果没有协商,那么,本许可证,或者它更新的版本,同样适用于您做出的改
+ 动。Vim 现在的几位维护者可见:
+ https://github.com/orgs/vim/people
+ 如果维护者发生变动,会在合适的地方 (很可能是 vim.sf.net、www.vim.org
+ 和/或 comp.editors) 公布,当完全不能与维护者联系时,发送变更的约定自
+ 动终止。一旦维护者确认收到了您所做的修改,您就不必再次发送了。
+
+ b) 如果您得到的是一个修改过的 Vim,并且它是在条件 a) 下发布的,那么您可
+ 以不加改动地在条件 I) 下发布它;如果您又做了额外的改动,则这些改动受
+ 到 a) 款条文的约束。
+
+ c) 在您发布的经过修改的 Vim 的每一份拷贝里,提供所有的变更部分,包括源代
+ 码。提供的形式可以采用上下文风格的差异比较记录 (context diff)。您可以
+ 为添加的新代码选择许可证,但是这些更改和为其选择的许可证不能限制他人
+ 对 Vim 正式版本作出自己的改动。
+
+ d) 在满足以下全部三个条件的前提下,您可以继续发布带有条件 c) 所提及之变
+ 更的经过修改的 Vim,而不必在发布时提供更改部分的源代码:
+ - 这些变更所附带的许可证允许您把这些变更无偿地并且没有任何限制地提供
+ 给 Vim 的维护者,而且允许 Vim 的维护者无偿地并且没有任何限制地把这
+ 些更改加入到 Vim 的正式版本中。
+ - 从您最后一次发布更改的 Vim 之日起,您要保存这些改动至少三年时间。在
+ 这期间,维护者或别人 (以任何方式) 向您要求提供这些变更时,您必须提
+ 供给他。
+ - 您要在发布版本中清楚地说明如何与您联系,这个联系方式必须保证自最后
+ 一次发布相应的经过修改的 Vim 之日起至少三年有效,或尽可能长。
+ e) 当这些变更以 GPL (GNU General Public License,GNU 通用公共许可证) 发
+ 布时,您可以在 GPL 版本 2,或更高版本的 GPL 下发布修改过的 Vim。
+ 3) 必须添加一条改动的信息。至少要放在 "version" 命令的输出和启动画面里,好
+ 让用户知道自己用的是一个修改过的 Vim。当以 2)e) 条件发布时,只有不与变
+ 更适用的许可证冲突,这个信息的添加才是必要的。
+ 4) 在 2)a) 和 2)d) 条件里要求的联系方式不能随便更改或删除,除非是作者自己
+ 作出的更正。
+
+III) 如果您发布一个更改过的 Vim,强烈建议您对变更部分使用 Vim 的许可证,并且对
+ 维护者提供变更部分并开放源代码。最好的方式是通过电子邮件或者把文件放到服
+ 务器上,通过电子邮件传送 URL。如果只修改了很少的部分 (例如,只是一个修改
+ 过的 Makefile),那么传送一个上下文风格的差异比较记录 (context diff) 就可
+ 以了。电子邮件的地址是
+
+IV) 不允许从 Vim 的源代码的发行版本或其中部分的源代码里删除本许可证,即使来自
+ 更改过的版本也是如此。您可能想用这份许可证代替以前版本的 Vim 里的许可证,
+ 这可以由您自行决定。
diff --git a/lang/README.zh_cn.txt b/lang/README.zh_cn.txt
new file mode 100644
index 0000000000..94e8d8dd3b
--- /dev/null
+++ b/lang/README.zh_cn.txt
@@ -0,0 +1,122 @@
+Vim: Vi IMproved 9.1 版本的 README.txt 文件
+
+
+什 么 是 VIM ?
+
+Vim 是经典 UNIX 编辑器 Vi 的一个极大改进版本。它新增了许多功能:多级撤销、语法高
+亮、命令行历史、在线帮助、拼写检查、文件名补全、块操作、脚本语言等。同时也提供了
+图形用户界面(GUI)。尽管如此,Vi 兼容性依然得以保留,习惯使用 Vi 的用户操作时仍
+会感到得心应手。与 Vi 的差异请参阅 "runtime/doc/vi_diff.txt"。
+
+此编辑器对于编辑代码和其他纯文本文件非常有用。所有命令都通过常规键盘字符输入,因
+此熟练盲打的用户能够高效工作。此外,用户可以将功能键映射到命令,并且可以使用鼠标。
+
+Vim 也致力于提供一个(基本)符合 POSIX 标准的 vi 实现。当它以最小功能集(通常称
+为 vim.tiny)编译时,被许多 Linux 发行版用作默认的 vi 编辑器。
+
+Vim 可在 MS-Windows (7, 8, 10, 11)、macOS、Haiku、VMS 以及几乎所有 UNIX 变体上运
+行。移植到其他系统应该不太困难。旧版本的 Vim 曾在 Amiga DOS、Atari MiNT、BeOS、
+MS-DOS、MS-Windows 95/98/Me/NT/2000/XP/Vista、RISC OS 和 OS/2 上运行。这些版本的
+维护现已终止。
+
+
+获 取 途 径
+
+通常你可以使用你喜欢的软件包管理器来安装 Vim。在 Mac 和 Linux 上,会预装一个简化
+版的 Vim,如果你需要更多功能,仍需要安装完整的 Vim。
+
+有针对 Unix、PC、Amiga 和其他一些系统的独立发行版。本 README.txt 文件随运行时存
+档一起提供。该存档包含文档、语法文件以及其他运行时使用的文件。要运行 Vim,你必须
+获取二进制存档或源代码存档之一。您需要哪一种取决于您想要运行 Vim 的系统以及您是
+否希望或必须自行编译。请查阅 "https://www.vim.org/download.php" 以了解当前可用的
+发行版概览。
+
+获取最新版 Vim 的常见方式:
+* 从 github 检出 git 仓库:https://github.com/vim/vim。
+* 以存档形式获取源代码:https://github.com/vim/vim/tags。
+* 从 vim-win32-installer 仓库获取 Windows 可执行文件:
+ https://github.com/vim/vim-win32-installer/releases。
+
+
+编 译
+
+如果你获得的是二进制发行版,则无需编译 Vim。如果你获得的是源代码发行版,编译 Vim
+所需的所有内容都在 "src" 目录中。请参阅 src/INSTALL 文件中的说明。
+
+
+安 装
+
+请查阅以下文件之一以获取系统特定的安装说明。这些文件位于仓库中的 READMEdir 目录,
+或者在你解压缩存档后的顶级目录中:
+
+README_ami.txt Amiga
+README_unix.txt Unix
+README_dos.txt MS-DOS 和 MS-Windows
+README_mac.txt Macintosh
+README_haiku.txt Haiku
+README_vms.txt VMS
+
+根据你使用的发行版,可能还有其他 README_*.txt 文件。
+
+
+文 档
+
+Vim tutor 是为初学者设计的一小时培训课程。通常可以通过 "vimtutor" 命令启动。更多
+信息请参阅 ":help tutor"。
+
+最佳方式是在 Vim 中使用 ":help" 命令。如果您尚未安装可执行文件,请阅读
+"runtime/doc/help.txt"。该文件包含指向其他文档文件的指引。用户手册采用书籍体例编
+排,是学习使用 Vim 的推荐资料。具体请参阅 ":help user-manual"。
+
+
+复 制 与 版 权
+
+Vim 是慈善软件。您可以尽情使用和复制它,但鼓励您捐款以帮助乌干达的孤儿。请阅读
+"runtime/doc/uganda.txt" 文件了解详情(在 Vim 中执行 ":help uganda")。
+
+许可摘要:对于未经修改的 Vim 副本,其使用或分发不受任何限制。Vim 的部分内容亦可
+分发,但必须始终包含许可文本。对于修改版本,则需遵循若干限制条款。本许可证与 GPL
+兼容,您可使用 GPL 库编译 Vim 并进行分发。
+
+
+赞 助
+
+修复错误与增添新功能均需投入大量时间与精力。为支持开发工作并激励开发者持续完善
+Vim,敬请通过捐赠表达您的认可。
+
+您捐赠的资金将主要用于帮助乌干达的儿童。请参阅 "runtime/doc/uganda.txt"。但同时,
+您的捐赠也将激励开发团队持续投入 Vim 的开发工作。
+
+关于赞助的最新信息,请查看 Vim 网站:
+ https://www.vim.org/sponsor/
+
+
+贡 献
+
+如果您想帮助改进 Vim,请参阅 CONTRIBUTING.md 文件。
+
+
+信 息 与 支 持
+
+如果您在 macOS 上,可以使用 MacVim:https://macvim.org
+
+关于 Vim 的最新消息可以在 Vim 主页上找到:
+ https://www.vim.org/
+
+如果您遇到问题,请查阅 Vim 文档或使用技巧:
+ https://www.vim.org/docs.php
+ https://vim.fandom.com/wiki/Vim_Tips_Wiki
+
+如果您仍有问题或其他疑问,请使用其中一个邮件列表与 Vim 用户和开发者讨论:
+ https://www.vim.org/maillist.php
+
+如果其他方法都无效,请直接将错误报告发送到 vim-dev 邮件列表:
+
+
+
+主 要 作 者
+
+Vim 主要由 Bram Moolenaar 创建,可通过 ":help Bram-Moolenaar" 命
+令了解更多信息。
+
+请将任何其他评论、补丁、鲜花和建议发送到 vim-dev 邮件列表:
diff --git a/nsis/README.txt b/nsis/README.txt
index c4f3645ab1..01c6c5d3b0 100644
--- a/nsis/README.txt
+++ b/nsis/README.txt
@@ -35,7 +35,7 @@ Preparatory stage
and for the 64-bit version — "winpty.dll" from x64/bin to "winpty64.dll".
Put the renamed file and "winpty-agent.exe" in "../.." (above the "vim91"
directory). However, you can specify a different directory by specifying
- the appropriate makefile value. How to do this is described below.
+ the appropriate makefile value. How to do this is described below.
6. To use stronger encryption, add the Sodium library. You can get it here:
https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19-msvc.zip
@@ -64,7 +64,7 @@ Preparatory stage
The default is "../..". However, you can specify a
different directory by specifying the appropriate makefile value. How to do
- this is described below.
+ this is described below.
8. Install NSIS if you didn't do that already.
Download Unicode version the ShellExecAsUser plug-in for NSIS from:
@@ -80,7 +80,7 @@ Installer assembly stage
After the installer is created and you copy it to the desired location, run
the following command in the "/nsis" directory
nmake.exe -lf Make_mvc.mak clean
-
+
On UNIX-like systems, go to the "/nsis" directory and type the command
make -f Makefile [variables] all
diff --git a/nsis/lang/simpchinese.nsi b/nsis/lang/simpchinese.nsi
index 0c9290eab4..fb4d5087f7 100644
--- a/nsis/lang/simpchinese.nsi
+++ b/nsis/lang/simpchinese.nsi
@@ -22,16 +22,14 @@ LangString ^UninstallCaption ${LANG_SIMPCHINESE} \
# Translated license file for the license page {{{1
##############################################################################
-LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt"
-#LicenseLangString page_lic_file ${LANG_SIMPCHINESE} \
-# "..\lang\LICENSE.zh_cn.nsis.txt"
+LicenseLangString page_lic_file ${LANG_SIMPCHINESE} \
+ "..\lang\LICENSE.zh_cn.nsis.txt"
##############################################################################
# Translated README.txt file, which is opened after installation {{{1
##############################################################################
-LangString vim_readme_file 0 "README.txt"
-#LangString vim_readme_file ${LANG_SIMPCHINESE} "README.zh_cn.txt"
+LangString vim_readme_file ${LANG_SIMPCHINESE} "README.zh_cn.txt"
##############################################################################
# MUI Configuration Strings {{{1
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index 791dccf67c..20c8d2ec89 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -3,7 +3,7 @@ vim9script
# Vim functions for file type detection
#
# Maintainer: The Vim Project
-# Last Change: 2025 Oct 28
+# Last Change: 2026 Jan 06
# Former Maintainer: Bram Moolenaar
# These functions are moved here from runtime/filetype.vim to make startup
@@ -29,6 +29,28 @@ export def Check_inp()
endif
enddef
+# Erlang Application Resource Files (*.app.src is matched by extension)
+# See: https://erlang.org/doc/system/applications
+export def FTapp()
+ if exists("g:filetype_app")
+ exe "setf " .. g:filetype_app
+ return
+ endif
+ const pat = '^\s*{\s*application\s*,\s*\(''\=\)' .. expand("%:t:r:r") .. '\1\s*,'
+ var line: string
+ for lnum in range(1, min([line("$"), 100]))
+ line = getline(lnum)
+ # skip Erlang comments, might be something else
+ if line =~ '^\s*%' || line =~ '^\s*$'
+ continue
+ elseif line =~ '^\s*{' &&
+ getline(lnum, lnum + 9)->filter((_, v) => v !~ '^\s*%')->join(' ') =~# pat
+ setf erlang
+ endif
+ return
+ endfor
+enddef
+
# This function checks for the kind of assembly that is wanted by the user, or
# can be detected from the beginning of the file.
export def FTasm()
@@ -1659,6 +1681,7 @@ const ft_from_ext = {
# XA65 MOS6510 cross assembler
"a65": "a65",
# Applescript
+ "applescript": "applescript",
"scpt": "applescript",
# Applix ELF
"am": "elf",
@@ -1723,7 +1746,7 @@ const ft_from_ext = {
"bst": "bst",
# Bicep
"bicep": "bicep",
- "bicepparam": "bicep",
+ "bicepparam": "bicep-params",
# BIND zone
"zone": "bindzone",
# Blank
@@ -1735,6 +1758,8 @@ const ft_from_ext = {
# BSDL
"bsd": "bsdl",
"bsdl": "bsdl",
+ # Bpftrace
+ "bt": "bpftrace",
# C3
"c3": "c3",
"c3i": "c3",
@@ -1851,6 +1876,9 @@ const ft_from_ext = {
"elv": "elvish",
# Faust
"lib": "faust",
+ # Fennel
+ "fnl": "fennel",
+ "fnlm": "fennel",
# Libreoffice config files
"xcu": "xml",
"xlb": "xml",
@@ -1889,6 +1917,9 @@ const ft_from_ext = {
# Diff files
"diff": "diff",
"rej": "diff",
+ # Djot
+ "dj": "djot",
+ "djot": "djot",
# DOT
"dot": "dot",
"gv": "dot",
@@ -1951,6 +1982,8 @@ const ft_from_ext = {
"fish": "fish",
# Flix
"flix": "flix",
+ # Fluent
+ "ftl": "fluent",
# Focus Executable
"fex": "focexec",
"focexec": "focexec",
@@ -2093,6 +2126,8 @@ const ft_from_ext = {
"tmpl": "template",
# Hurl
"hurl": "hurl",
+ # Hylo
+ "hylo": "hylo",
# Hyper Builder
"hb": "hb",
# Httest
@@ -2202,6 +2237,10 @@ const ft_from_ext = {
"k": "kwt",
# Kivy
"kv": "kivy",
+ # Koka
+ "kk": "koka",
+ # Kos
+ "kos": "kos",
# Kotlin
"kt": "kotlin",
"ktm": "kotlin",
@@ -2225,6 +2264,8 @@ const ft_from_ext = {
"ldg": "ledger",
"ledger": "ledger",
"journal": "ledger",
+ # Leex
+ "xrl": "leex",
# Leo
"leo": "leo",
# Less
@@ -2332,6 +2373,8 @@ const ft_from_ext = {
# N1QL
"n1ql": "n1ql",
"nql": "n1ql",
+ # Nickel
+ "ncl": "nickel",
# Nim file
"nim": "nim",
"nims": "nim",
@@ -2344,6 +2387,8 @@ const ft_from_ext = {
"norg": "norg",
# Novell netware batch files
"ncf": "ncf",
+ # N-Quads
+ "nq": "nq",
# Not Quite C
"nqc": "nqc",
# NSE - Nmap Script Engine - uses Lua syntax
@@ -2570,6 +2615,8 @@ const ft_from_ext = {
"builder": "ruby",
"rxml": "ruby",
"rjs": "ruby",
+ # Sorbet (Ruby typechecker)
+ "rbi": "ruby",
# Rust
"rs": "rust",
# S-lang
@@ -2702,6 +2749,7 @@ const ft_from_ext = {
"nut": "squirrel",
# Starlark
"ipd": "starlark",
+ "sky": "starlark",
"star": "starlark",
"starlark": "starlark",
# OpenVPN configuration
@@ -2968,6 +3016,7 @@ const ft_from_ext = {
"usd": "usd",
# Rofi stylesheet
"rasi": "rasi",
+ "rasinc": "rasi",
# Zsh module
# mdd: https://github.com/zsh-users/zsh/blob/57248b88830ce56adc243a40c7773fb3825cab34/Etc/zsh-development-guide#L285-L288
# mdh, pro: https://github.com/zsh-users/zsh/blob/57248b88830ce56adc243a40c7773fb3825cab34/Etc/zsh-development-guide#L268-L271
@@ -2998,6 +3047,8 @@ const ft_from_name = {
"apt.conf": "aptconf",
# BIND zone
"named.root": "bindzone",
+ # Brewfile (uses Ruby syntax)
+ "Brewfile": "ruby",
# Busted (Lua unit testing framework - configuration files)
".busted": "lua",
# Bun history
@@ -3066,6 +3117,8 @@ const ft_from_name = {
".editorconfig": "editorconfig",
# Elinks configuration
"elinks.conf": "elinks",
+ # Erlang
+ "rebar.config": "erlang",
# Exim
"exim.conf": "exim",
# Exports
diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim
index 5fb45ccc51..de168f0c09 100644
--- a/runtime/autoload/dist/script.vim
+++ b/runtime/autoload/dist/script.vim
@@ -4,7 +4,7 @@ vim9script
# Invoked from "scripts.vim" in 'runtimepath'
#
# Maintainer: The Vim Project
-# Last Change: 2025 Aug 09
+# Last Change: 2025 Dec 22
# Former Maintainer: Bram Moolenaar
export def DetectFiletype()
@@ -233,6 +233,10 @@ export def Exe2filetype(name: string, line1: string): string
elseif name =~ '^execlineb\>'
return 'execline'
+ # Bpftrace
+ elseif name =~ '^bpftrace\>'
+ return 'bpftrace'
+
# Vim
elseif name =~ '^vim\>'
return 'vim'
diff --git a/runtime/autoload/dist/vim9.vim b/runtime/autoload/dist/vim9.vim
index fa14bdaf04..53385e0824 100644
--- a/runtime/autoload/dist/vim9.vim
+++ b/runtime/autoload/dist/vim9.vim
@@ -3,7 +3,7 @@ vim9script
# Vim runtime support library
#
# Maintainer: The Vim Project
-# Last Change: 2025 Aug 15
+# Last Change: 2025 Dec 21
export def IsSafeExecutable(filetype: string, executable: string): bool
if empty(exepath(executable))
@@ -60,15 +60,19 @@ if has('unix')
enddef
else
export def Launch(args: string)
- const fork = has('gui_running') ? '' : '&'
+ 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 /c'
- const quotes = empty(shell) ? '' : '""'
- execute $'silent ! {shell} start {quotes} /b {args} {Redir()}' | redraw!
+ try
+ execute ':silent !start' args | redraw!
+ catch /^Vim(!):E371:/
+ echohl ErrorMsg
+ echom "dist#vim9#Launch(): can not start" args
+ echohl None
+ endtry
enddef
else
export def Launch(dummy: string)
@@ -81,7 +85,10 @@ var os_viewer = null_string
if has('win32unix')
# (cyg)start suffices
os_viewer = ''
-# Windows / WSL
+# Windows
+elseif has('win32')
+ os_viewer = '' # Use :!start
+# WSL
elseif executable('explorer.exe')
os_viewer = 'explorer.exe'
# Linux / BSD
@@ -126,6 +133,11 @@ export def Open(file: string)
&shellslash = false
defer setbufvar('%', '&shellslash', true)
endif
+ if &shell == 'pwsh' || &shell == 'powershell'
+ const shell = &shell
+ setlocal shell&
+ defer setbufvar('%', '&shell', shell)
+ endif
Launch($"{Viewer()} {shellescape(file, 1)}")
enddef
diff --git a/runtime/autoload/getscript.vim b/runtime/autoload/getscript.vim
index 1e3b5b39d6..27a5a49535 100644
--- a/runtime/autoload/getscript.vim
+++ b/runtime/autoload/getscript.vim
@@ -14,6 +14,7 @@
" 2024 Nov 12 by Vim Project: fix problems on Windows (#16036)
" 2025 Feb 28 by Vim Project: add support for bzip3 (#16755)
" 2025 May 11 by Vim Project: check network connectivity (#17249)
+" 2025 Dec 21 by Vim Project: make the wget check more robust (#18987)
" }}}
"
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
@@ -58,7 +59,10 @@ endif
" wget vs curl {{{2
if !exists("g:GetLatestVimScripts_wget")
- if executable("wget")
+ if executable("wget.exe")
+ " enforce extension: windows powershell desktop version has a wget alias that hides wget.exe
+ let g:GetLatestVimScripts_wget= "wget.exe"
+ elseif executable("wget")
let g:GetLatestVimScripts_wget= "wget"
elseif executable("curl.exe")
" enforce extension: windows powershell desktop version has a curl alias that hides curl.exe
@@ -73,7 +77,7 @@ endif
" options that wget and curl require:
if !exists("g:GetLatestVimScripts_options")
- if g:GetLatestVimScripts_wget == "wget"
+ if g:GetLatestVimScripts_wget =~ "wget"
let g:GetLatestVimScripts_options= "-q -O"
elseif g:GetLatestVimScripts_wget =~ "curl"
let g:GetLatestVimScripts_options= "-s -o"
diff --git a/runtime/autoload/gnat.vim b/runtime/autoload/gnat.vim
index 0def6723b2..585be2e1e0 100644
--- a/runtime/autoload/gnat.vim
+++ b/runtime/autoload/gnat.vim
@@ -3,7 +3,7 @@
" Language: Ada (GNAT)
" $Id: gnat.vim 887 2008-07-08 14:29:01Z krischik $
" Copyright: Copyright (C) 2006 Martin Krischik
-" Maintainer: Martin Krischi k
+" Maintainer: Martin Krischi
" Ned Okie
" $Author: krischik $
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
diff --git a/runtime/autoload/sqlcomplete.vim b/runtime/autoload/sqlcomplete.vim
index adbdbab894..4017ae9b05 100644
--- a/runtime/autoload/sqlcomplete.vim
+++ b/runtime/autoload/sqlcomplete.vim
@@ -3,6 +3,7 @@
" Maintainer: David Fishburn
" Version: 16.0
" Last Change: 2017 Oct 15
+" 2025 Nov 11 by Vim project: only set 'omnifunc' if dbext script was loaded #18716
" Homepage: http://www.vim.org/scripts/script.php?script_id=1572
" Usage: For detailed help
" ":help sql.txt"
@@ -98,12 +99,11 @@
" Set completion with CTRL-X CTRL-O to autoloaded function.
" This check is in place in case this script is
" sourced directly instead of using the autoload feature.
-if exists('&omnifunc')
- " Do not set the option if already set since this
- " results in an E117 warning.
- if &omnifunc == ""
- setlocal omnifunc=sqlcomplete#Complete
- endif
+"
+" Do not set the option if already set since this
+" results in an E117 warning.
+if exists('&omnifunc') && &omnifunc == "" && exists('g:loaded_dbext')
+ setlocal omnifunc=sqlcomplete#Complete
endif
if exists('g:loaded_sql_completion')
diff --git a/runtime/autoload/tutor.vim b/runtime/autoload/tutor.vim
index c3b5df37d9..a31f74680a 100644
--- a/runtime/autoload/tutor.vim
+++ b/runtime/autoload/tutor.vim
@@ -211,7 +211,7 @@ function! tutor#TutorCmd(tutor_name)
endif
call tutor#SetupVim()
- exe "drop ".l:to_open
+ exe "drop ".fnameescape(l:to_open)
call tutor#EnableInteractive(v:true)
endfunction
diff --git a/runtime/autoload/xmlformat.vim b/runtime/autoload/xmlformat.vim
index c89c8784b9..c541e65755 100644
--- a/runtime/autoload/xmlformat.vim
+++ b/runtime/autoload/xmlformat.vim
@@ -1,5 +1,5 @@
" Vim plugin for formatting XML
-" Last Change: 2020 Jan 06
+" Last Change: 2023 March 15th
" Version: 0.3
" Author: Christian Brabandt
" Repository: https://github.com/chrisbra/vim-xml-ftplugin
@@ -37,13 +37,17 @@ func! xmlformat#Format() abort
" Keep empty input lines?
if empty(line)
call add(result, '')
+ let current += 1
continue
elseif line !~# '<[/]\?[^>]*>'
- let nextmatch = match(list, '<[/]\?[^>]*>', current)
- if nextmatch > -1
- let line .= ' '. join(list[(current + 1):(nextmatch-1)], " ")
- call remove(list, current+1, nextmatch-1)
+ let nextmatch = match(list, '^\s*$\|<[/]\?[^>]*>', current)
+ if nextmatch > -1
+ let lineEnd = nextmatch
+ else
+ let lineEnd = len(list)
endif
+ let line .= ' '. join(list[(current + 1):(lineEnd-1)], " ")
+ call remove(list, current+1, lineEnd-1)
endif
" split on `>`, but don't split on very first opening <
" this means, items can be like ['', 'tag content']
@@ -79,9 +83,13 @@ func! xmlformat#Format() abort
if s:EndTag(t[1])
call s:DecreaseIndent()
endif
- "for y in t[1:]
- let result+=s:FormatContent(t[1:])
- "endfor
+ let result+=s:FormatContent(t[1:])
+ if s:IsTag(t[1])
+ let lastitem = t[1]
+ continue
+ endif
+ elseif s:IsComment(item)
+ let result+=s:FormatContent([item])
else
call add(result, s:Indent(item))
endif
@@ -94,7 +102,7 @@ func! xmlformat#Format() abort
if !empty(result)
let lastprevline = getline(v:lnum + count_orig)
let delete_lastline = v:lnum + count_orig - 1 == line('$')
- exe v:lnum. ",". (v:lnum + count_orig - 1). 'd'
+ exe 'silent ' .. v:lnum. ",". (v:lnum + count_orig - 1). 'd'
call append(v:lnum - 1, result)
" Might need to remove the last line, if it became empty because of the
" append() call
diff --git a/runtime/autoload/zip.vim b/runtime/autoload/zip.vim
index 49e4e81981..74b0d28fa0 100644
--- a/runtime/autoload/zip.vim
+++ b/runtime/autoload/zip.vim
@@ -17,6 +17,7 @@
" 2025 Mar 11 by Vim Project: handle filenames with leading '-' correctly
" 2025 Jul 12 by Vim Project: drop ../ on write to prevent path traversal attacks
" 2025 Sep 22 by Vim Project: support PowerShell Core
+" 2025 Dec 20 by Vim Project: use :lcd instead of :cd
" 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,
@@ -371,7 +372,7 @@ fun! zip#Write(fname)
call mkdir(tmpdir,"p")
" attempt to change to the indicated directory
- if s:ChgDir(tmpdir,s:ERROR,"(zip#Write) cannot cd to temporary directory")
+ if s:ChgDir(tmpdir,s:ERROR,"(zip#Write) cannot lcd to temporary directory")
return
endif
@@ -380,7 +381,7 @@ fun! zip#Write(fname)
call delete("_ZIPVIM_", "rf")
endif
call mkdir("_ZIPVIM_")
- cd _ZIPVIM_
+ lcd _ZIPVIM_
if has("unix")
let zipfile = substitute(a:fname,'zipfile://\(.\{-}\)::[^\\].*$','\1','')
@@ -455,7 +456,7 @@ fun! zip#Write(fname)
endif
" cleanup and restore current directory
- cd ..
+ lcd ..
call delete("_ZIPVIM_", "rf")
call s:ChgDir(curdir,s:WARNING,"(zip#Write) unable to return to ".curdir."!")
call delete(tmpdir, "rf")
@@ -536,7 +537,7 @@ endfun
" s:ChgDir: {{{2
fun! s:ChgDir(newdir,errlvl,errmsg)
try
- exe "cd ".fnameescape(a:newdir)
+ exe "lcd ".fnameescape(a:newdir)
catch /^Vim\%((\a\+)\)\=:E344/
redraw!
if a:errlvl == s:NOTE
diff --git a/runtime/compiler/biome.vim b/runtime/compiler/biome.vim
new file mode 100644
index 0000000000..57a80d4b1b
--- /dev/null
+++ b/runtime/compiler/biome.vim
@@ -0,0 +1,23 @@
+" Vim compiler file
+" Compiler: Biome (= linter for JavaScript, TypeScript, JSX, TSX, JSON,
+" JSONC, HTML, Vue, Svelte, Astro, CSS, GraphQL and GritQL files)
+" Maintainer: @Konfekt
+" Last Change: 2025 Nov 12
+if exists("current_compiler") | finish | endif
+let current_compiler = "biome"
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+exe 'CompilerSet makeprg=' .. escape('biome check --linter-enabled=true --formatter-enabled=false --assist-enabled=false --reporter=github '
+ \ .. get(b:, 'biome_makeprg_params', get(g:, 'biome_makeprg_params', '')), ' \|"')
+
+CompilerSet errorformat=::%trror%.%#file=%f\\,line=%l\\,%.%#col=%c\\,%.%#::%m
+CompilerSet errorformat+=::%tarning%.%#file=%f\\,line=%l\\,%.%#col=%c\\,%.%#::%m
+CompilerSet errorformat+=::%totice%.%#file=%f\\,line=%l\\,%.%#col=%c\\,%.%#::%m
+CompilerSet errorformat+=%-G\\s%#
+CompilerSet errorformat+=%-Gcheck\ %.%#
+CompilerSet errorformat+=%-G%.%#Some\ errors\ were\ emitted\ while\ running\ checks%.
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/cppcheck.vim b/runtime/compiler/cppcheck.vim
index 033613c091..17f79f4fa0 100644
--- a/runtime/compiler/cppcheck.vim
+++ b/runtime/compiler/cppcheck.vim
@@ -1,7 +1,7 @@
" vim compiler file
" Compiler: cppcheck (C++ static checker)
" Maintainer: Vincent B. (twinside@free.fr)
-" Last Change: 2024 Nov 19 by @Konfekt
+" Last Change: 2025 Nov 06 by @Konfekt
if exists("current_compiler") | finish | endif
let current_compiler = "cppcheck"
@@ -18,14 +18,14 @@ if !exists('g:c_cppcheck_params')
let s:undo_compiler = 'unlet! g:c_cppcheck_params'
endif
-let &l:makeprg = 'cppcheck --quiet'
+exe 'CompilerSet makeprg=' .. escape('cppcheck --quiet'
\ ..' --template="{file}:{line}:{column}: {severity}: [{id}] {message} {callstack}"'
\ ..' '..get(b:, 'c_cppcheck_params', get(g:, 'c_cppcheck_params', (&filetype ==# 'cpp' ? ' --language=c++' : '')))
\ ..' '..get(b:, 'c_cppcheck_includes', get(g:, 'c_cppcheck_includes',
\ (filereadable('compile_commands.json') ? '--project=compile_commands.json' :
\ (!empty(glob('*'..s:slash..'compile_commands.json', 1, 1)) ? '--project='..glob('*'..s:slash..'compile_commands.json', 1, 1)[0] :
- \ (empty(&path) ? '' : '-I')..join(map(filter(split(&path, ','), 'isdirectory(v:val)'),'shellescape(v:val)'), ' -I')))))
-exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"')
+ \ (empty(&path) ? '' : '-I')..join(map(filter(split(&path, ','), 'isdirectory(v:val)'),'shellescape(v:val)'), ' -I'))))),
+ \ ' \|"')
CompilerSet errorformat=
\%f:%l:%c:\ %tarning:\ %m,
diff --git a/runtime/compiler/gcc.vim b/runtime/compiler/gcc.vim
index 7b6ebb98f4..1d5900eb27 100644
--- a/runtime/compiler/gcc.vim
+++ b/runtime/compiler/gcc.vim
@@ -6,6 +6,7 @@
" by Daniel Hahler, 2019 Jul 12
" added line suggested by Anton Lindqvist 2016 Mar 31
" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition)
+" 2025 Dec 17 by The Vim Project (correctly parse: 'make: *** [Makefile:2: all] Error 1')
if exists("current_compiler")
finish
@@ -16,6 +17,7 @@ let s:cpo_save = &cpo
set cpo&vim
CompilerSet errorformat=
+ \make:\ ***\ [%f:%l:\ %m,
\%*[^\"]\"%f\"%*\\D%l:%c:\ %m,
\%*[^\"]\"%f\"%*\\D%l:\ %m,
\\"%f\"%*\\D%l:%c:\ %m,
diff --git a/runtime/compiler/gnat.vim b/runtime/compiler/gnat.vim
index 086edbede3..696d1c6eb4 100644
--- a/runtime/compiler/gnat.vim
+++ b/runtime/compiler/gnat.vim
@@ -3,7 +3,7 @@
" Language: Ada (GNAT)
" $Id: gnat.vim 887 2008-07-08 14:29:01Z krischik $
" Copyright: Copyright (C) 2006 Martin Krischik
-" Maintainer: Martin Krischi k
+" Maintainer: Martin Krischi
" Ned Okie
" $Author: krischik $
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
diff --git a/runtime/compiler/maven.vim b/runtime/compiler/maven.vim
index 72e74e301d..1657da75a4 100644
--- a/runtime/compiler/maven.vim
+++ b/runtime/compiler/maven.vim
@@ -7,24 +7,54 @@
" Original Source: https://github.com/mikelue/vim-maven-plugin/blob/master/compiler/maven.vim
" (distributed under same terms as LICENSE per
" https://github.com/mikelue/vim-maven-plugin/issues/13)
-" Last Change: 2024 Nov 12
+" Last Change: 2025 Nov 18
if exists("current_compiler")
finish
endif
let current_compiler = "maven"
+" CompilerSet makeprg=mvn
execute $'CompilerSet makeprg=mvn\ --batch-mode\ {escape(get(b:, 'maven_makeprg_params', get(g:, 'maven_makeprg_params', '')), ' \|"')}'
" Error message for POM
CompilerSet errorformat=[FATAL]\ Non-parseable\ POM\ %f:\ %m%\\s%\\+@%.%#line\ %l\\,\ column\ %c%.%#,
CompilerSet errorformat+=[%tRROR]\ Malformed\ POM\ %f:\ %m%\\s%\\+@%.%#line\ %l\\,\ column\ %c%.%#
+" Handle Non-parseable POM with '@:' embedded in the 'position:' clause.
+CompilerSet errorformat+=[FATAL]\ Non-parseable\ POM\ %f:\ %m%\\s%\\+%.%#@%l:%c%.%#,
+CompilerSet errorformat+=[%tRROR]\ Malformed\ POM\ %f:\ %m%\\s%\\+%.%#@%l:%c%.%#,
-" Java related build messages
+" JavaC messages with paths relative to module root:
+" With column:
CompilerSet errorformat+=[%tARNING]\ %f:[%l\\,%c]\ %m
CompilerSet errorformat+=[%tRROR]\ %f:[%l\\,%c]\ %m
CompilerSet errorformat+=%A[%t%[A-Z]%#]\ %f:[%l\\,%c]\ %m,%Z
CompilerSet errorformat+=%A%f:[%l\\,%c]\ %m,%Z
+" Without column:
+CompilerSet errorformat+=[%tARNING]\ %f:[%l]\ %m
+CompilerSet errorformat+=[%tRROR]\ %f:[%l]\ %m
+CompilerSet errorformat+=%A[%t%[A-Z]%#]\ %f:[%l]\ %m,%Z
+CompilerSet errorformat+=%A%f:[%l]\ %m,%Z
+
+" Plug-in messages with absolute paths:
+" with column:
+CompilerSet errorformat+=[%tARNING]\ %f:%l:%c:\ %m
+CompilerSet errorformat+=[%tRROR]\ %f:%l:%c:\ %m
+CompilerSet errorformat+=%A[%t%[A-Z]%#]\ %f:%l:%c:\ %m,%Z
+CompilerSet errorformat+=%A%f:%l:%c:\ %m,%Z
+" without column:
+CompilerSet errorformat+=[%tARNING]\ %f:%l:\ %m
+CompilerSet errorformat+=[%tRROR]\ %f:%l:\ %m
+CompilerSet errorformat+=%A[%t%[A-Z]%#]\ %f:%l:\ %m,%Z
+CompilerSet errorformat+=%A%f:%l:\ %m,%Z
+
+" SpotBugs
+CompilerSet errorformat+=[%tRROR]\ %m%\\s%\\+\[%*[^]]]%\\s%\\+In\ %f\ %.%#,
+CompilerSet errorformat+=[%tARNING]\ %m%\\s%\\+\[%*[^]]]%\\s%\\+In\ %f\ %.%#,
+CompilerSet errorformat+=[%tRROR]\ %.%#\ [aA]t\ %f:\[lines\ %l-%\\d\\+]\ %.%#,
+CompilerSet errorformat+=[%tARNING]\ %.%#\ [aA]t\ %f:\[lines\ %l-%\\d\\+]\ %.%#,
+CompilerSet errorformat+=[%tRROR]\ %.%#\ [aA]t\ %f:\[line\ %l]\ %.%#,
+CompilerSet errorformat+=[%tARNING]\ %.%#\ [aA]t\ %f:\[line\ %l]\ %.%#,
" jUnit related build messages
CompilerSet errorformat+=%+E\ \ %#test%m,%Z
@@ -36,5 +66,7 @@ CompilerSet errorformat+=%+Z%\\s%#at\ %f(%\\f%\\+:%l),
CompilerSet errorformat+=%+C%.%#
" Misc message removal
+" CompilerSet errorformat+=%-GPicked\ up\ _JAVA_OPTIONS\ %.%#,
+CompilerSet errorformat+=%-GAudit\ done.,
CompilerSet errorformat+=%-G[INFO]\ %.%#,
CompilerSet errorformat+=%-G[debug]\ %.%#
diff --git a/runtime/compiler/mypy.vim b/runtime/compiler/mypy.vim
index 907b98b777..c7a575ce2d 100644
--- a/runtime/compiler/mypy.vim
+++ b/runtime/compiler/mypy.vim
@@ -1,7 +1,7 @@
" Vim compiler file
" Compiler: Mypy (Python static checker)
" Maintainer: @Konfekt
-" Last Change: 2024 Nov 19
+" Last Change: 2025 Nov 06
if exists("current_compiler") | finish | endif
let current_compiler = "mypy"
@@ -10,9 +10,9 @@ let s:cpo_save = &cpo
set cpo&vim
" CompilerSet makeprg=mypy
-let &l:makeprg = 'mypy --show-column-numbers '
- \ ..get(b:, 'mypy_makeprg_params', get(g:, 'mypy_makeprg_params', '--strict --ignore-missing-imports'))
-exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"')
+exe 'CompilerSet makeprg=' .. escape('mypy --show-column-numbers '
+ \ ..get(b:, 'mypy_makeprg_params', get(g:, 'mypy_makeprg_params', '--strict --ignore-missing-imports')),
+ \ ' \|"')
CompilerSet errorformat=%f:%l:%c:\ %t%*[^:]:\ %m
let &cpo = s:cpo_save
diff --git a/runtime/compiler/perl.vim b/runtime/compiler/perl.vim
index 6aeaac3fa1..04643af26c 100644
--- a/runtime/compiler/perl.vim
+++ b/runtime/compiler/perl.vim
@@ -1,6 +1,6 @@
" Vim compiler file
" Compiler: Perl syntax checks (perl -Wc)
-" Maintainer: vim-perl
+" Maintainer: vim-perl (need to be subscribed to post)
" Author: Christian J. Robinson
" Homepage: https://github.com/vim-perl/vim-perl
" Bugs/requests: https://github.com/vim-perl/vim-perl/issues
diff --git a/runtime/compiler/perlcritic.vim b/runtime/compiler/perlcritic.vim
index 4b5f34dd2e..d50bc31129 100644
--- a/runtime/compiler/perlcritic.vim
+++ b/runtime/compiler/perlcritic.vim
@@ -1,6 +1,6 @@
" Vim compiler file
" Compiler: perlcritic
-" Maintainer: vim-perl
+" Maintainer: vim-perl (need to be subscribed to post)
" Author: Doug Kearns
" Homepage: https://github.com/vim-perl/vim-perl
" Bugs/requests: https://github.com/vim-perl/vim-perl/issues
diff --git a/runtime/compiler/podchecker.vim b/runtime/compiler/podchecker.vim
index 20faaa4bcc..744c1034d6 100644
--- a/runtime/compiler/podchecker.vim
+++ b/runtime/compiler/podchecker.vim
@@ -1,6 +1,6 @@
" Vim compiler file
" Compiler: podchecker
-" Maintainer: vim-perl
+" Maintainer: vim-perl (need to be subscribed to post)
" Author: Doug Kearns
" Homepage: https://github.com/vim-perl/vim-perl
" Bugs/requests: https://github.com/vim-perl/vim-perl/issues
diff --git a/runtime/compiler/pylint.vim b/runtime/compiler/pylint.vim
index 96abf315ab..749fe7d134 100644
--- a/runtime/compiler/pylint.vim
+++ b/runtime/compiler/pylint.vim
@@ -3,6 +3,7 @@
" Maintainer: Daniel Moch
" Last Change: 2024 Nov 07 by The Vim Project (added params variable)
" 2024 Nov 19 by the Vim Project (properly escape makeprg setting)
+" 2025 Nov 06 by the Vim Project (do not set buffer-local makeprg)
if exists("current_compiler") | finish | endif
let current_compiler = "pylint"
@@ -11,10 +12,10 @@ let s:cpo_save = &cpo
set cpo&vim
" CompilerSet makeprg=ruff
-let &l:makeprg = 'pylint ' .
+exe 'CompilerSet makeprg=' .. escape('pylint ' .
\ '--output-format=text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" --reports=no ' .
- \ get(b:, "pylint_makeprg_params", get(g:, "pylint_makeprg_params", '--jobs=0'))
-exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"')
+ \ get(b:, "pylint_makeprg_params", get(g:, "pylint_makeprg_params", '--jobs=0')),
+ \ ' \|"')
CompilerSet errorformat=%A%f:%l:%c:%t:\ %m,%A%f:%l:\ %m,%A%f:(%l):\ %m,%-Z%p^%.%#,%-G%.%#
let &cpo = s:cpo_save
diff --git a/runtime/compiler/pyright.vim b/runtime/compiler/pyright.vim
new file mode 100644
index 0000000000..a7dad6f377
--- /dev/null
+++ b/runtime/compiler/pyright.vim
@@ -0,0 +1,25 @@
+" Vim compiler file
+" Compiler: Pyright (Python Type Checker)
+" Maintainer: @konfekt
+" Last Change: 2025 Dec 26
+
+if exists("current_compiler") | finish | endif
+let current_compiler = "pyright"
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" CompilerSet makeprg=pyright
+" CompilerSet makeprg=basedpyright
+exe 'CompilerSet makeprg=' .. escape(
+ \ get(b:, 'pyright_makeprg', get(g:, 'pyright_makeprg', 'pyright')),
+ \ ' \|"')
+CompilerSet errorformat=
+ \%E%f:%l:%c\ -\ error:\ %m,
+ \%W%f:%l:%c\ -\ warning:\ %m,
+ \%N%f:%l:%c\ -\ note:\ %m,
+ \%C[ \t]\ %.%#,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/rime_deployer.vim b/runtime/compiler/rime_deployer.vim
index e0c8daef6e..5331412dc3 100644
--- a/runtime/compiler/rime_deployer.vim
+++ b/runtime/compiler/rime_deployer.vim
@@ -3,6 +3,7 @@
" Maintainer: Wu, Zhenyu
" URL: https://rime.im
" Latest Revision: 2024-04-09
+" Last Change: 2025 Nov 16 by The Vim Project (set errorformat)
if exists('b:current_compiler')
finish
@@ -25,6 +26,8 @@ for s:shared_data_dir in ['/sdcard/rime-data', '/run/current-system/sw/share/rim
endfor
execute 'CompilerSet makeprg=rime_deployer\ --build\ %:p:h:S\' s:shared_data_dir
unlet s:prefix s:shared_data_dir
+" CompilerSet errorformat=%f:%l:%c:\ %m,%f:%l:\ %m
+CompilerSet errorformat&
let &cpoptions = s:save_cpoptions
unlet s:save_cpoptions
diff --git a/runtime/compiler/ruff.vim b/runtime/compiler/ruff.vim
index 318f4fe5cb..d4f564b06a 100644
--- a/runtime/compiler/ruff.vim
+++ b/runtime/compiler/ruff.vim
@@ -3,6 +3,8 @@
" Maintainer: @pbnj-dragon
" Last Change: 2024 Nov 07
" 2024 Nov 19 by the Vim Project (properly escape makeprg setting)
+" 2025 Nov 06 by the Vim Project (do not set buffer-local makeprg)
+" 2024 Dec 24 by the Vim Project (mute Found messages)
if exists("current_compiler") | finish | endif
let current_compiler = "ruff"
@@ -11,10 +13,11 @@ let s:cpo_save = &cpo
set cpo&vim
" CompilerSet makeprg=ruff
-let &l:makeprg= 'ruff check --output-format=concise '
- \ ..get(b:, 'ruff_makeprg_params', get(g:, 'ruff_makeprg_params', '--preview'))
-exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"')
+exe 'CompilerSet makeprg=' .. escape('ruff check --output-format=concise '
+ \ ..get(b:, 'ruff_makeprg_params', get(g:, 'ruff_makeprg_params', '--preview')),
+ \ ' \|"')
CompilerSet errorformat=%f:%l:%c:\ %m,%f:%l:\ %m,%f:%l:%c\ -\ %m,%f:
+CompilerSet errorformat+=%-GFound\ %.%#
let &cpo = s:cpo_save
unlet s:cpo_save
diff --git a/runtime/compiler/rustc.vim b/runtime/compiler/rustc.vim
index b3c8091987..0b48891852 100644
--- a/runtime/compiler/rustc.vim
+++ b/runtime/compiler/rustc.vim
@@ -2,6 +2,8 @@
" Compiler: Rust Compiler
" Maintainer: Chris Morgan
" Latest Revision: 2023-09-11
+" 2025 Nov 15 by Vim project: remove test for Vim patch 7.4.191
+" 2025 Dec 18 by Vim project: detect more errors #18957
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
if exists("current_compiler")
@@ -17,11 +19,7 @@ set cpo&vim
if get(g:, 'rustc_makeprg_no_percent', 0)
CompilerSet makeprg=rustc
else
- if has('patch-7.4.191')
- CompilerSet makeprg=rustc\ \%:S
- else
- CompilerSet makeprg=rustc\ \"%\"
- endif
+ CompilerSet makeprg=rustc\ \%:S
endif
" New errorformat (after nightly 2016/08/10)
@@ -32,8 +30,10 @@ CompilerSet errorformat=
\%Eerror:\ %m,
\%Eerror[E%n]:\ %m,
\%Wwarning:\ %m,
+ \%Wwarning[E%n]:\ %m,
\%Inote:\ %m,
\%C\ %#-->\ %f:%l:%c,
+ \%C\ %#╭▸\ %f:%l:%c,
\%E\ \ left:%m,%C\ right:%m\ %f:%l:%c,%Z
" Old errorformat (before nightly 2016/08/10)
diff --git a/runtime/compiler/tombi.vim b/runtime/compiler/tombi.vim
index bab95ba24c..7a286723cd 100644
--- a/runtime/compiler/tombi.vim
+++ b/runtime/compiler/tombi.vim
@@ -1,7 +1,7 @@
" Vim compiler file
" Language: TOML
" Maintainer: Konfekt
-" Last Change: 2025 Oct 28
+" Last Change: 2025 Oct 29
if exists("current_compiler") | finish | endif
let current_compiler = "tombi"
@@ -44,7 +44,7 @@ if s:tombi_nocolor
if &shell =~# '\v<%(cmd|cmd)>'
CompilerSet makeprg=set\ NO_COLOR=1\ &&\ tombi\ lint
elseif &shell =~# '\v<%(powershell|pwsh)>'
- CompilerSet makeprg=$env:NO_COLOR="1";\ tombi\ lint
+ CompilerSet makeprg=$env:NO_COLOR=\"1\";\ tombi\ lint
else
echoerr "tombi compiler: Unsupported shell for Windows"
endif
diff --git a/runtime/compiler/ty.vim b/runtime/compiler/ty.vim
new file mode 100644
index 0000000000..d9ee5aae8a
--- /dev/null
+++ b/runtime/compiler/ty.vim
@@ -0,0 +1,20 @@
+" Vim compiler file
+" Compiler: Ty (Python Type Checker)
+" Maintainer: @konfekt
+" Last Change: 2024 Dec 24
+
+if exists("current_compiler") | finish | endif
+let current_compiler = "ty"
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" CompilerSet makeprg=ty
+exe 'CompilerSet makeprg=' .. escape(
+ \ get(b:, 'ty_makeprg', get(g:, 'ty_makeprg', 'ty check --no-progress --color=never'))
+ \ ..' --output-format=concise', ' \|"')
+CompilerSet errorformat=%f:%l:%c:\ %m,%f:%l:\ %m,%f:%l:%c\ -\ %m,%f:
+CompilerSet errorformat+=%-GFound\ %.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/vimdoc.vim b/runtime/compiler/vimdoc.vim
index a30355f855..ca34f105e4 100644
--- a/runtime/compiler/vimdoc.vim
+++ b/runtime/compiler/vimdoc.vim
@@ -2,6 +2,7 @@
" Language: vimdoc
" Maintainer: Wu, Zhenyu
" Latest Revision: 2024-04-13
+" Last Change: 2025 Nov 16 by The Vim Project (set errorformat)
"
" If you can not find 'vimdoc' in the package manager of your distribution e.g
" 'pip', then you may need to build it from its source.
@@ -15,6 +16,8 @@ let s:save_cpoptions = &cpoptions
set cpoptions&vim
CompilerSet makeprg=vimdoc
+" CompilerSet errorformat=%f:%l:%c:\ %m,%f:%l:\ %m
+CompilerSet errorformat&
let &cpoptions = s:save_cpoptions
unlet s:save_cpoptions
diff --git a/runtime/compiler/yamllint.vim b/runtime/compiler/yamllint.vim
index 88e2efb27a..adb1dbdee7 100644
--- a/runtime/compiler/yamllint.vim
+++ b/runtime/compiler/yamllint.vim
@@ -3,6 +3,7 @@
" Maintainer: Romain Lafourcade
" Last Change: 2021 July 21
" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition)
+" 2025 Nov 16 by The Vim Project (set errorformat)
if exists("current_compiler")
finish
@@ -10,4 +11,6 @@ endif
let current_compiler = "yamllint"
CompilerSet makeprg=yamllint\ -f\ parsable
+" CompilerSet errorformat=%f:%l:%c:\ [%t%*[^]]]\ %m,%f:%l:%c:\ [%*[^]]]\ %m
+CompilerSet errorformat&
diff --git a/runtime/compiler/zig_build_exe.vim b/runtime/compiler/zig_build_exe.vim
index 259d0e267b..440eff7885 100644
--- a/runtime/compiler/zig_build_exe.vim
+++ b/runtime/compiler/zig_build_exe.vim
@@ -1,7 +1,7 @@
" Vim compiler file
" Compiler: Zig Compiler (zig build-exe)
" Upstream: https://github.com/ziglang/zig.vim
-" Last Change: 2024 Apr 05 by The Vim Project (removed :CompilerSet definition)
+" Last Change: 2025 Nov 16 by The Vim Project (set errorformat)
if exists('current_compiler')
finish
@@ -12,11 +12,9 @@ let current_compiler = 'zig_build_exe'
let s:save_cpo = &cpo
set cpo&vim
-if has('patch-7.4.191')
- CompilerSet makeprg=zig\ build-exe\ \%:S\ \$*
-else
- CompilerSet makeprg=zig\ build-exe\ \"%\"\ \$*
-endif
+CompilerSet makeprg=zig\ build-exe\ \%:S\ \$*
+" CompilerSet errorformat=%f:%l:%c: %t%*[^:]: %m, %f:%l:%c: %m, %f:%l: %m
+CompilerSet errorformat&
let &cpo = s:save_cpo
unlet s:save_cpo
diff --git a/runtime/compiler/zig_test.vim b/runtime/compiler/zig_test.vim
index dafeb6f1e3..afe57ad4d3 100644
--- a/runtime/compiler/zig_test.vim
+++ b/runtime/compiler/zig_test.vim
@@ -1,7 +1,7 @@
" Vim compiler file
" Compiler: Zig Compiler (zig test)
" Upstream: https://github.com/ziglang/zig.vim
-" Last Change: 2024 Apr 05 by The Vim Project (removed :CompilerSet definition)
+" Last Change: 2025 Nov 16 by The Vim Project (set errorformat)
if exists('current_compiler')
finish
@@ -12,11 +12,9 @@ let current_compiler = 'zig_test'
let s:save_cpo = &cpo
set cpo&vim
-if has('patch-7.4.191')
- CompilerSet makeprg=zig\ test\ \%:S\ \$*
-else
- CompilerSet makeprg=zig\ test\ \"%\"\ \$*
-endif
+CompilerSet makeprg=zig\ test\ \%:S\ \$*
+" CompilerSet errorformat=%f:%l:%c: %t%*[^:]: %m, %f:%l:%c: %m, %f:%l: %m
+CompilerSet errorformat&
let &cpo = s:save_cpo
unlet s:save_cpo
diff --git a/runtime/defaults.vim b/runtime/defaults.vim
index 5c7100edc2..9306af3fbb 100644
--- a/runtime/defaults.vim
+++ b/runtime/defaults.vim
@@ -1,7 +1,7 @@
" The default vimrc file.
"
" Maintainer: The Vim Project
-" Last Change: 2025 Sep 10
+" Last Change: 2025 Nov 28
" Former Maintainer: Bram Moolenaar
"
" This is loaded if no vimrc file was found.
@@ -136,7 +136,7 @@ if &t_Co > 2 || has("gui_running")
syntax on
" I like highlighting strings inside C comments.
- " Revert with ":unlet c_comment_strings".
+ " Revert with ":unlet g:c_comment_strings".
let c_comment_strings=1
endif
diff --git a/runtime/doc/arabic.txt b/runtime/doc/arabic.txt
index 72c9ed8e12..832b426dda 100644
--- a/runtime/doc/arabic.txt
+++ b/runtime/doc/arabic.txt
@@ -1,7 +1,7 @@
-*arabic.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*arabic.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Nadim Shaikli
+ VIM REFERENCE MANUAL by Nadim Shaikli
Arabic Language support (options & mappings) for Vim *Arabic*
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 318b57b548..665b5893c8 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1,7 +1,7 @@
-*autocmd.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*autocmd.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Automatic commands *autocommand* *autocommands*
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index e0ef87ea61..0b68f91b8b 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1,7 +1,7 @@
-*builtin.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*builtin.txt* For Vim version 9.1. Last change: 2026 Jan 03
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Builtin functions *builtin-functions*
@@ -23,9 +23,11 @@ Use CTRL-] on the function name to jump to the full explanation.
USAGE RESULT DESCRIPTION ~
-abs({expr}) Float or Number absolute value of {expr}
+abs({expr}) Float/Number
+ absolute value of {expr}
acos({expr}) Float arc cosine of {expr}
-add({object}, {item}) List/Blob append {item} to {object}
+add({object}, {item}) List/Blob
+ append {item} to {object}
and({expr}, {expr}) Number bitwise AND
append({lnum}, {text}) Number append {text} below line {lnum}
appendbufline({buf}, {lnum}, {text})
@@ -33,7 +35,8 @@ appendbufline({buf}, {lnum}, {text})
in buffer {buf}
argc([{winid}]) Number number of files in the argument list
argidx() Number current index in the argument list
-arglistid([{winnr} [, {tabnr}]]) Number argument list id
+arglistid([{winnr} [, {tabnr}]])
+ Number argument list id
argv({nr} [, {winid}]) String {nr} entry of the argument list
argv([-1, {winid}]) List the argument list
asin({expr}) Float arc sine of {expr}
@@ -43,7 +46,7 @@ assert_equal({exp}, {act} [, {msg}])
assert_equalfile({fname-one}, {fname-two} [, {msg}])
Number assert file contents are equal
assert_exception({error} [, {msg}])
- Number assert {error} is in v:exception
+ Number assert {error} is in |v:exception|
assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]])
Number assert {cmd} fails
assert_false({actual} [, {msg}])
@@ -81,8 +84,8 @@ bufexists({buf}) Number |TRUE| if buffer {buf} exists
buflisted({buf}) Number |TRUE| if buffer {buf} is listed
bufload({buf}) Number load buffer {buf} if not loaded yet
bufloaded({buf}) Number |TRUE| if buffer {buf} is loaded
-bufname([{buf}]) String Name of the buffer {buf}
-bufnr([{buf} [, {create}]]) Number Number of the buffer {buf}
+bufname([{buf}]) String name of the buffer {buf}
+bufnr([{buf} [, {create}]]) Number number of the buffer {buf}
bufwinid({buf}) Number window ID of buffer {buf}
bufwinnr({buf}) Number window number of buffer {buf}
byte2line({byte}) Number line number at byte count {byte}
@@ -121,7 +124,8 @@ ch_setoptions({handle}, {options})
ch_status({handle} [, {options}])
String status of channel {handle}
changenr() Number current change number
-char2nr({expr} [, {utf8}]) Number ASCII/UTF-8 value of first char in {expr}
+char2nr({expr} [, {utf8}]) Number ASCII/UTF-8 value of first char in
+ {expr}
charclass({string}) Number character class of {string}
charcol({expr} [, {winid}]) Number column number of cursor or mark
charidx({string}, {idx} [, {countcc} [, {utf16}]])
@@ -136,7 +140,6 @@ complete({startcol}, {matches}) none set Insert mode completion
complete_add({expr}) Number add completion match
complete_check() Number check for key typed during completion
complete_info([{what}]) Dict get current completion information
-complete_match([{lnum}, {col}]) List get completion column and trigger text
confirm({msg} [, {choices} [, {default} [, {type}]]])
Number number of choice picked by user
copy({expr}) any make a shallow copy of {expr}
@@ -181,10 +184,12 @@ expand({expr} [, {nosuf} [, {list}]])
expandcmd({string} [, {options}])
String expand {string} like with `:edit`
extend({expr1}, {expr2} [, {expr3}])
- List/Dict insert items of {expr2} into {expr1}
+ List/Dict
+ insert items of {expr2} into {expr1}
extendnew({expr1}, {expr2} [, {expr3}])
- List/Dict like |extend()| but creates a new
- List or Dictionary
+ List/Dict
+ like |extend()| but creates a new List
+ or Dictionary
feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer
filecopy({from}, {to}) Number |TRUE| if copying file {from} to {to}
worked
@@ -195,7 +200,8 @@ filter({expr1}, {expr2}) List/Dict/Blob/String
{expr2} is 0
finddir({name} [, {path} [, {count}]])
findfile({name} [, {path} [, {count}]])
- String/List find dir/file {name} in {path}
+ String/List
+ find dir/file {name} in {path}
flatten({list} [, {maxdepth}]) List flatten {list} up to {maxdepth} levels
flattennew({list} [, {maxdepth}])
List flatten a copy of {list}
@@ -217,7 +223,8 @@ funcref({name} [, {arglist}] [, {dict}])
Funcref reference to function {name}
function({name} [, {arglist}] [, {dict}])
Funcref named reference to function {name}
-garbagecollect([{atexit}]) none free memory, breaking cyclic references
+garbagecollect([{atexit}]) none free memory, breaking cyclic
+ references
get({list}, {idx} [, {def}]) any get item {idx} from {list} or {def}
get({dict}, {key} [, {def}]) any get item {key} from {dict} or {def}
get({func}, {what}) any get property of funcref/partial {func}
@@ -230,7 +237,7 @@ 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} [, {opts}]]) Number or String
+getchar([{expr} [, {opts}]]) Number/String
get one character from the user
getcharmod() Number modifiers for the last typed character
getcharpos({expr}) List position of cursor, mark, etc.
@@ -246,7 +253,8 @@ getcmdprompt() String return the current command-line prompt
getcmdscreenpos() Number return cursor screen position in
command-line
getcmdtype() String return current command-line type
-getcmdwintype() String return current command-line window type
+getcmdwintype() String return current command-line window
+ type
getcompletion({pat}, {type} [, {filtered}])
List list of cmdline completion matches
getcompletiontype({pat}) String return the type of the command-line
@@ -264,7 +272,8 @@ getimstatus() Number |TRUE| if the IME status is active
getjumplist([{winnr} [, {tabnr}]])
List list of jump list items
getline({lnum}) String line {lnum} of current buffer
-getline({lnum}, {end}) List lines {lnum} to {end} of current buffer
+getline({lnum}, {end}) List lines {lnum} to {end} of current
+ buffer
getloclist({nr}) List list of location list items
getloclist({nr}, {what}) Dict get specific location list properties
getmarklist([{buf}]) List list of global/local marks
@@ -276,7 +285,8 @@ getpos({expr}) List position of cursor, mark, etc.
getqflist() List list of quickfix items
getqflist({what}) Dict get specific quickfix list properties
getreg([{regname} [, 1 [, {list}]]])
- String or List contents of a register
+ String/List
+ contents of a register
getreginfo([{regname}]) Dict information about a register
getregion({pos1}, {pos2} [, {opts}])
List get the text from {pos1} to {pos2}
@@ -287,7 +297,8 @@ getscriptinfo([{opts}]) List list of sourced scripts
getstacktrace() List get current stack trace of Vim scripts
gettabinfo([{expr}]) List list of tab pages
gettabvar({nr}, {varname} [, {def}])
- any variable {varname} in tab {nr} or {def}
+ any variable {varname} in tab {nr} or
+ {def}
gettabwinvar({tabnr}, {winnr}, {name} [, {def}])
any {name} in {winnr} in tab page {tabnr}
gettagstack([{nr}]) Dict get the tag stack of window {nr}
@@ -306,8 +317,8 @@ globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])
has({feature} [, {check}]) Number |TRUE| if feature {feature} supported
has_key({dict}, {key}) Number |TRUE| if {dict} has entry {key}
haslocaldir([{winnr} [, {tabnr}]])
- Number |TRUE| if the window executed |:lcd|
- or |:tcd|
+ Number |TRUE| if the window executed `:lcd` or
+ `:tcd`
hasmapto({what} [, {mode} [, {abbr}]])
Number |TRUE| if mapping to {what} exists
histadd({history}, {item}) Number add an item to a history
@@ -333,9 +344,13 @@ inputdialog({prompt} [, {text} [, {cancelreturn}]])
inputlist({textlist}) Number let the user pick from a choice list
inputrestore() Number restore typeahead
inputsave() Number save and clear typeahead
-inputsecret({prompt} [, {text}]) String like input() but hiding the text
-insert({object}, {item} [, {idx}]) List insert {item} in {object} [before {idx}]
-instanceof({object}, {class}) Number |TRUE| if {object} is an instance of {class}
+inputsecret({prompt} [, {text}])
+ String like input() but hiding the text
+insert({object}, {item} [, {idx}])
+ List insert {item} in {object}
+ [before {idx}]
+instanceof({object}, {class}) Number |TRUE| if {object} is an instance of
+ {class}
interrupt() none interrupt script execution
invert({expr}) Number bitwise invert
isabsolutepath({path}) Number |TRUE| if {path} is an absolute path
@@ -347,7 +362,8 @@ isnan({expr}) Number |TRUE| if {expr} is NaN
items({expr}) List key/index-value pairs in {expr}
job_getchannel({job}) Channel get the channel handle for {job}
job_info([{job}]) Dict get information about {job}
-job_setoptions({job}, {options}) none set options for {job}
+job_setoptions({job}, {options})
+ none set options for {job}
job_start({command} [, {options}])
Job start a job
job_status({job}) String get the status of {job}
@@ -359,9 +375,10 @@ json_decode({string}) any decode JSON
json_encode({expr}) String encode JSON
keys({dict}) List keys in {dict}
keytrans({string}) String translate internal keycodes to a form
- that can be used by |:map|
+ that can be used by `:map`
len({expr}) Number the length of {expr}
-libcall({lib}, {func}, {arg}) String call {func} in library {lib} with {arg}
+libcall({lib}, {func}, {arg}) String call {func} in library {lib} with
+ {arg}
libcallnr({lib}, {func}, {arg}) Number idem, but return a Number
line({expr} [, {winid}]) Number line nr of cursor, last line or mark
line2byte({lnum}) Number byte count of line {lnum}
@@ -380,7 +397,7 @@ luaeval({expr} [, {expr}]) any evaluate |Lua| expression
map({expr1}, {expr2}) List/Dict/Blob/String
change each item in {expr1} to {expr2}
maparg({name} [, {mode} [, {abbr} [, {dict}]]])
- String or Dict
+ String/Dict
rhs of mapping {name} in mode {mode}
mapcheck({name} [, {mode} [, {abbr}]])
String check for mappings matching {name}
@@ -395,7 +412,7 @@ matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]])
Number highlight {pattern} with {group}
matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]])
Number highlight positions with {group}
-matcharg({nr}) List arguments of |:match|
+matcharg({nr}) List arguments of `:match`
matchbufline({buf}, {pat}, {lnum}, {end}, [, {dict})
List all the {pat} matches in buffer {buf}
matchdelete({id} [, {win}]) Number delete match identified by {id}
@@ -406,7 +423,8 @@ matchfuzzy({list}, {str} [, {dict}])
matchfuzzypos({list}, {str} [, {dict}])
List fuzzy match {str} in {list}
matchlist({expr}, {pat} [, {start} [, {count}]])
- List match and submatches of {pat} in {expr}
+ List match and submatches of {pat} in
+ {expr}
matchstr({expr}, {pat} [, {start} [, {count}]])
String {count}'th match of {pat} in {expr}
matchstrlist({list}, {pat} [, {dict})
@@ -423,11 +441,13 @@ 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}
+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
perleval({expr}) any evaluate |Perl| expression
-popup_atcursor({what}, {options}) Number create popup window near the cursor
+popup_atcursor({what}, {options})
+ Number create popup window near the cursor
popup_beval({what}, {options}) Number create popup window for 'ballooneval'
popup_clear() none close all popup windows
popup_close({id} [, {result}]) none close popup window {id}
@@ -447,7 +467,8 @@ popup_menu({what}, {options}) Number create a popup window used as a menu
popup_move({id}, {options}) none set position of popup window {id}
popup_notification({what}, {options})
Number create a notification popup window
-popup_setbuf({id}, {buf}) Bool set the buffer for the popup window {id}
+popup_setbuf({id}, {buf}) Bool set the buffer for the popup window
+ {id}
popup_setoptions({id}, {options})
none set options for popup window {id}
popup_settext({id}, {text}) none set the text of popup window {id}
@@ -457,10 +478,13 @@ preinserted() Number whether text is inserted after cursor
prevnonblank({lnum}) Number line nr of non-blank line <= {lnum}
printf({fmt}, {expr1}...) String format text
prompt_getprompt({buf}) String get prompt text
-prompt_setcallback({buf}, {expr}) none set prompt callback function
-prompt_setinterrupt({buf}, {text}) none set prompt interrupt function
+prompt_setcallback({buf}, {expr})
+ none set prompt callback function
+prompt_setinterrupt({buf}, {text})
+ none set prompt interrupt function
prompt_setprompt({buf}, {text}) none set prompt text
-prop_add({lnum}, {col}, {props}) none add one text property
+prop_add({lnum}, {col}, {props})
+ none add one text property
prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...])
none add multiple text properties
prop_clear({lnum} [, {lnum-end} [, {props}]])
@@ -494,6 +518,8 @@ readdirex({dir} [, {expr} [, {dict}]])
List file info in {dir} selected by {expr}
readfile({fname} [, {type} [, {max}]])
List get list of lines from file {fname}
+redraw_listener_add({opts}) Number add callbacks to listen for redraws
+redraw_listener_remove({id}) none remove a redraw listener
reduce({object}, {func} [, {initial}])
any reduce {object} using {func}
reg_executing() String get the executing register name
@@ -526,9 +552,10 @@ round({expr}) Float round off {expr}
rubyeval({expr}) any evaluate |Ruby| expression
screenattr({row}, {col}) Number attribute at screen position
screenchar({row}, {col}) Number character at screen position
-screenchars({row}, {col}) List List of characters at screen position
+screenchars({row}, {col}) List list of characters at screen position
screencol() Number current cursor column
-screenpos({winid}, {lnum}, {col}) Dict screen row and col of a text character
+screenpos({winid}, {lnum}, {col})
+ Dict screen row and col of a text character
screenrow() Number current cursor row
screenstring({row}, {col}) String characters at screen position
search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])
@@ -569,7 +596,9 @@ setqflist({list} [, {action}]) Number modify quickfix list using {list}
setqflist({list}, {action}, {what})
Number modify specific quickfix list props
setreg({n}, {v} [, {opt}]) Number set register to value and type
-settabvar({nr}, {varname}, {val}) none set {varname} in tab page {nr} to {val}
+settabvar({nr}, {varname}, {val})
+ none set {varname} in tab page {nr} to
+ {val}
settabwinvar({tabnr}, {winnr}, {varname}, {val})
none set {varname} in window {winnr} in tab
page {tabnr} to {val}
@@ -601,7 +630,8 @@ sign_unplacelist({list}) List unplace a list of signs
simplify({filename}) String simplify filename as much as possible
sin({expr}) Float sine of {expr}
sinh({expr}) Float hyperbolic sine of {expr}
-slice({expr}, {start} [, {end}]) String, List or Blob
+slice({expr}, {start} [, {end}])
+ String/List/Blob
slice of a String, List or Blob
sort({list} [, {how} [, {dict}]])
List sort {list}, compare with {how}
@@ -631,7 +661,8 @@ strcharpart({str}, {start} [, {len} [, {skipcc}]])
String {len} characters of {str} at
character {start}
strchars({expr} [, {skipcc}]) Number character count of the String {expr}
-strdisplaywidth({expr} [, {col}]) Number display length of the String {expr}
+strdisplaywidth({expr} [, {col}])
+ Number display length of the String {expr}
strftime({format} [, {time}]) String format time with a specified format
strgetchar({str}, {index}) Number get char {index} from {str}
stridx({haystack}, {needle} [, {start}])
@@ -639,20 +670,24 @@ stridx({haystack}, {needle} [, {start}])
string({expr}) String String representation of {expr} value
strlen({expr}) Number length of the String {expr}
strpart({str}, {start} [, {len} [, {chars}]])
- String {len} bytes/chars of {str} at
- byte {start}
+ String {len} bytes/chars of {str} at byte
+ {start}
strptime({format}, {timestring})
- Number Convert {timestring} to unix timestamp
+ Number convert {timestring} to unix timestamp
strridx({haystack}, {needle} [, {start}])
Number last index of {needle} in {haystack}
strtrans({expr}) String translate string to make it printable
strutf16len({string} [, {countcc}])
- Number number of UTF-16 code units in {string}
-strwidth({expr}) Number display cell length of the String {expr}
-submatch({nr} [, {list}]) String or List
- specific match in ":s" or substitute()
+ Number number of UTF-16 code units in
+ {string}
+strwidth({expr}) Number display cell length of the String
+ {expr}
+submatch({nr} [, {list}]) String/List
+ specific match in `:substitute` or
+ substitute()
substitute({expr}, {pat}, {sub}, {flags})
- String all {pat} in {expr} replaced with {sub}
+ String all {pat} in {expr} replaced with
+ {sub}
swapfilelist() List swap files found in 'directory'
swapinfo({fname}) Dict information about swap file {fname}
swapname({buf}) String swap file of buffer {buf}
@@ -661,12 +696,14 @@ synIDattr({synID}, {what} [, {mode}])
String attribute {what} of syntax ID {synID}
synIDtrans({synID}) Number translated syntax ID of {synID}
synconcealed({lnum}, {col}) List info about concealing
-synstack({lnum}, {col}) List stack of syntax IDs at {lnum} and {col}
+synstack({lnum}, {col}) List stack of syntax IDs at {lnum} and
+ {col}
system({expr} [, {input}]) String output of shell command/filter {expr}
systemlist({expr} [, {input}]) List output of shell command/filter {expr}
tabpagebuflist([{arg}]) List list of buffer numbers in tab page
tabpagenr([{arg}]) Number number of current or last tab page
-tabpagewinnr({tabarg} [, {arg}]) Number number of current window in tab page
+tabpagewinnr({tabarg} [, {arg}])
+ Number number of current window in tab page
tagfiles() List tags files used
taglist({expr} [, {filename}]) List list of tags matching {expr}
tan({expr}) Float tangent of {expr}
@@ -696,7 +733,8 @@ term_setansicolors({buf}, {colors})
none set ANSI palette in GUI color mode
term_setapi({buf}, {expr}) none set |terminal-api| function name prefix
term_setkill({buf}, {how}) none set signal to stop job in terminal
-term_setrestore({buf}, {command}) none set command to restore terminal
+term_setrestore({buf}, {command})
+ none set command to restore terminal
term_setsize({buf}, {rows}, {cols})
none set the size of a terminal
term_start({cmd} [, {options}]) Number open a terminal window and run a job
@@ -736,8 +774,10 @@ timer_start({time}, {callback} [, {options}])
Number create a timer
timer_stop({timer}) none stop a timer
timer_stopall() none stop all timers
-tolower({expr}) String the String {expr} switched to lowercase
-toupper({expr}) String the String {expr} switched to uppercase
+tolower({expr}) String the String {expr} switched to
+ lowercase
+toupper({expr}) String the String {expr} switched to
+ uppercase
tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr}
to chars in {tostr}
trim({text} [, {mask} [, {dir}]])
@@ -756,7 +796,7 @@ utf16idx({string}, {idx} [, {countcc} [, {charidx}]])
Number UTF-16 index of byte {idx} in {string}
values({dict}) List values in {dict}
virtcol({expr} [, {list} [, {winid}])
- Number or List
+ Number/List
screen column of cursor or mark
virtcol2col({winid}, {lnum}, {col})
Number byte index of a character on screen
@@ -783,7 +823,8 @@ winheight({nr}) Number height of window {nr}
winlayout([{tabnr}]) List layout of windows in tab {tabnr}
winline() Number window line of the cursor
winnr([{expr}]) Number number of current window
-winrestcmd() String returns command to restore window sizes
+winrestcmd() String returns command to restore window
+ sizes
winrestview({dict}) none restore view of current window
winsaveview() Dict save view of current window
winwidth({nr}) Number width of window {nr}
@@ -911,7 +952,7 @@ appendbufline({buf}, {lnum}, {text}) *appendbufline()*
for an invalid {lnum}, since {lnum} isn't actually used.
Can also be used as a |method| after a List, the base is
- passed as the second argument: >
+ passed as the third argument: >
mylist->appendbufline(buf, lnum)
<
Return type: |Number|
@@ -2074,51 +2115,6 @@ complete_info([{what}]) *complete_info()*
Return type: dict
-complete_match([{lnum}, {col}]) *complete_match()*
- Searches backward from the given position and returns a List
- of matches according to the 'isexpand' option. When no
- arguments are provided, uses the current cursor position.
-
- Each match is represented as a List containing
- [startcol, trigger_text] where:
- - startcol: column position where completion should start,
- or -1 if no trigger position is found. For multi-character
- triggers, returns the column of the first character.
- - trigger_text: the matching trigger string from 'isexpand',
- or empty string if no match was found or when using the
- default 'iskeyword' pattern.
-
- When 'isexpand' is empty, uses the 'iskeyword' pattern "\k\+$"
- to find the start of the current keyword.
-
- Examples: >
- set isexpand=.,->,/,/*,abc
- func CustomComplete()
- let res = complete_match()
- if res->len() == 0 | return | endif
- let [col, trigger] = res[0]
- let items = []
- if trigger == '/*'
- let items = ['/** */']
- elseif trigger == '/'
- let items = ['/*! */', '// TODO:', '// fixme:']
- elseif trigger == '.'
- let items = ['length()']
- elseif trigger =~ '^\->'
- let items = ['map()', 'reduce()']
- elseif trigger =~ '^\abc'
- let items = ['def', 'ghk']
- endif
- if items->len() > 0
- let startcol = trigger =~ '^/' ? col : col + len(trigger)
- call complete(startcol, items)
- endif
- endfunc
- inoremap call CustomComplete()
-<
- Return type: list>
-
-
confirm({msg} [, {choices} [, {default} [, {type}]]]) *confirm()*
confirm() offers the user a dialog, from which a choice can be
made. It returns the number of the choice. For the first
@@ -2759,13 +2755,18 @@ executable({expr}) *executable()*
then the name is also tried without adding an extension.
On MS-Windows it only checks if the file exists and is not a
directory, not if it's really executable.
+
On MS-Windows an executable in the same directory as the Vim
executable is always found. Since this directory is added to
$PATH it should also work to execute it |win32-PATH|.
- *NoDefaultCurrentDirectoryInExePath*
- On MS-Windows an executable in Vim's current working directory
- is also normally found, but this can be disabled by setting
- the $NoDefaultCurrentDirectoryInExePath environment variable.
+ *$NoDefaultCurrentDirectoryInExePath*
+ On MS-Windows when using cmd.exe as 'shell' an executable in
+ Vim's current working directory is also normally found, which
+ can be disabled by setting the
+ `$NoDefaultCurrentDirectoryInExePath` environment variable.
+ This variable is always set by Vim when executing external
+ commands (e.g., via |:!|, |:make|, or |system()|) for security
+ reasons.
The result is a Number:
1 exists
@@ -2935,7 +2936,7 @@ exists({expr}) *exists()*
Can also be used as a |method|: >
Varname()->exists()
<
- Return type: |String|
+ Return type: |Number|
exists_compiled({expr}) *exists_compiled()*
@@ -2952,7 +2953,7 @@ exists_compiled({expr}) *exists_compiled()*
Can only be used in a |:def| function. *E1233*
This does not work to check for arguments or local variables.
- Return type: |String|
+ Return type: |Number|
exp({expr}) *exp()*
@@ -4882,6 +4883,11 @@ getpos({expr}) *getpos()*
within the line. To get the character position in the line,
use |getcharpos()|.
+ The visual marks |'<| and |'>| refer to the beginning and end
+ of the visual selection relative to the buffer. Note that
+ this differs from |setpos()|, where they are relative to the
+ cursor position.
+
Note that for '< and '> Visual mode matters: when it is "V"
(visual line mode) the column of '< is zero and the column of
'> is a large number equal to |v:maxcol|.
@@ -5393,9 +5399,13 @@ getwininfo([{winid}]) *getwininfo()*
{only with the +quickfix feature}
quickfix 1 if quickfix or location list window
{only with the +quickfix feature}
+ status_height status lines height (0 or 1)
+ tabnr tab page number
terminal 1 if a terminal window
{only with the +terminal feature}
- tabnr tab page number
+ textoff number of columns occupied by any
+ 'foldcolumn', 'signcolumn' and line
+ number in front of the text
topline first displayed buffer line
variables a reference to the dictionary with
window-local variables
@@ -5404,9 +5414,6 @@ getwininfo([{winid}]) *getwininfo()*
otherwise
wincol leftmost screen column of the window;
"col" from |win_screenpos()|
- textoff number of columns occupied by any
- 'foldcolumn', 'signcolumn' and line
- number in front of the text
winid |window-ID|
winnr window number
winrow topmost screen line of the window;
@@ -6823,9 +6830,10 @@ listener_add({callback} [, {buf} [, {unbuffered}]]) *listener_add()*
The entries are in the order the changes were made, thus the
most recent change is at the end.
- Because of the third trigger reason for triggering a callback
- listed above, the line numbers passed to the callback are not
- guaranteed to be valid. If this is a problem then make
+ Because of the third reason for triggering a callback listed
+ above, the line numbers passed to the callback are not
+ guaranteed to be valid. In particular, the end value can be
+ greater than line('$') + 1. If this is a problem then make
{unbuffered} |TRUE|.
When {unbuffered} is |TRUE| the {callback} is invoked for every
@@ -8379,24 +8387,24 @@ printf({fmt}, {expr1} ...) *printf()*
*E1502*
You can re-use a [field-width] (or [precision]) argument: >
- echo printf("%1$d at width %2$d is: %01$*2$d", 1, 2)
+ echo printf("%1$d at width %2$d is: %1$0*2$d", 1, 2)
< 1 at width 2 is: 01
However, you can't use it as a different type: >
- echo printf("%1$d at width %2$ld is: %01$*2$d", 1, 2)
+ echo printf("%1$d at width %2$ld is: %1$0*2$d", 1, 2)
< E1502: Positional argument 2 used as field width reused as
different type: long int/int
*E1503*
When a positional argument is used, but not the correct number
or arguments is given, an error is raised: >
- echo printf("%1$d at width %2$d is: %01$*2$.*3$d", 1, 2)
+ echo printf("%1$d at width %2$d is: %1$0*2$.*3$d", 1, 2)
< E1503: Positional argument 3 out of bounds: %1$d at width
- %2$d is: %01$*2$.*3$d
+ %2$d is: %1$0*2$.*3$d
Only the first error is reported: >
- echo printf("%01$*2$.*3$d %4$d", 1, 2)
-< E1503: Positional argument 3 out of bounds: %01$*2$.*3$d
+ echo printf("%1$0*2$.*3$d %4$d", 1, 2)
+< E1503: Positional argument 3 out of bounds: %1$0*2$.*3$d
%4$d
*E1504*
@@ -8828,6 +8836,48 @@ readfile({fname} [, {type} [, {max}]]) *readfile()*
Return type: list or list
+redraw_listener_add({opts}) *redraw_listener_add()*
+ Add a listener that holds callback functions that will be
+ called at specific times in the redraw cycle. {opts} is a
+ dictionary that contain the callback functions to be defined.
+ At least one callback must be specified. *E1571*
+ Returns a unique ID that can be passed to
+ |redraw_listener_remove()|.
+
+ {opts} may have the following entries:
+
+ on_start Called first on each screen redraw. Takes no
+ arguments and returns nothing.
+ on_end Called at the end of each screen redraw.
+ Takes no arguments and returns nothing.
+
+ A good use case for this function is with the |listener_add()|
+ callback with unbuffered set to TRUE. This allows you to
+ modify the state on buffer changes, and finally render that
+ state just before the next redraw, only if it has changed.
+ Attempting to render or redraw for every single buffer change
+ would be very inefficient.
+
+ You may not call redraw_listener_add() during any of the
+ callbacks defined in {opts}. *E1570*
+
+ Can also be used as a |method|: >
+ GetOpts()->redraw_listener_add()
+<
+ Return type: |Number|
+
+
+redraw_listener_remove({id}) *redraw_listener_remove()*
+ Remove a redraw listener previously added with
+ |redraw_listener_add()|. Returns FALSE when {id} could not be
+ found, TRUE when {id} was removed.
+
+ Can also be used as a |method|: >
+ GetRedrawListenerId()->redraw_listener_remove()
+<
+ Return type: |Number|
+
+
reduce({object}, {func} [, {initial}]) *reduce()* *E998*
{func} is called for every item in {object}, which can be a
|String|, |List|, |Tuple| or a |Blob|. {func} is called with
@@ -10111,9 +10161,14 @@ setpos({expr}, {list}) *setpos()*
preferred column is not set. When it is present and setting a
mark position it is not used.
- Note that for '< and '> changing the line number may result in
- the marks to be effectively be swapped, so that '< is always
- before '>.
+ Note that for |'<| and |'>| changing the line number may
+ result in the marks to be effectively swapped, so that |'<| is
+ always before |'>|.
+
+ The visual marks |'<| and |'>| refer to the beginning and end
+ of the visual selection relative to the cursor position.
+ Note that this differs from |getpos()|, where they are
+ relative to the buffer.
Returns 0 when the position could be set, -1 otherwise.
An error message is given if {expr} is invalid.
@@ -11604,7 +11659,7 @@ synIDtrans({synID}) *synIDtrans()*
synconcealed({lnum}, {col}) *synconcealed()*
- The result is a |List| with currently three items:
+ The result is a |List| with three items:
1. The first item in the list is 0 if the character at the
position {lnum} and {col} is not part of a concealable
region, 1 if it is. {lnum} is used like with |getline()|.
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 86b2d18772..de5cd0bfb9 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1,7 +1,7 @@
-*change.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*change.txt* For Vim version 9.1. Last change: 2026 Jan 08
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
This file describes commands that delete or change text. In this context,
@@ -1094,7 +1094,8 @@ inside of strings can change! Also see 'softtabstop' option. >
*:y* *:yank* *E850*
:[range]y[ank] [x] Yank [range] lines [into register x]. Yanking to the
"* or "+ registers is possible only when the
- |+clipboard| feature is included.
+ |+clipboard| or |+clipboard_provider| features are
+ included.
:[range]y[ank] [x] {count}
Yank {count} lines, starting with last line number
@@ -1776,7 +1777,9 @@ l Long lines are not broken in insert mode: When a line was longer than
automatically format it.
*fo-m*
m Also break at a multibyte character above 255. This is useful for
- Asian text where every character is a word on its own.
+ Asian text where every character is a word on its own. Note that
+ line breaks may also be added after punctuation characters such as
+ colons to match the CJK linebreaking rules.
*fo-M*
M When joining lines, don't insert a space before or after a multibyte
character. Overrules the 'B' flag.
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt
index 2965483465..1750d1cb28 100644
--- a/runtime/doc/channel.txt
+++ b/runtime/doc/channel.txt
@@ -1,7 +1,7 @@
-*channel.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*channel.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Inter-process communication *channel*
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index ede9a5ec03..4c607c9179 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -1,7 +1,7 @@
-*cmdline.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*cmdline.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
*Cmdline-mode* *Command-line-mode*
diff --git a/runtime/doc/debug.txt b/runtime/doc/debug.txt
index 4e75c174b8..eee4089a47 100644
--- a/runtime/doc/debug.txt
+++ b/runtime/doc/debug.txt
@@ -1,7 +1,7 @@
-*debug.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*debug.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Debugging Vim *debug-vim*
diff --git a/runtime/doc/debugger.txt b/runtime/doc/debugger.txt
index 164dfbf902..6cb01466f8 100644
--- a/runtime/doc/debugger.txt
+++ b/runtime/doc/debugger.txt
@@ -1,7 +1,7 @@
-*debugger.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*debugger.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Gordon Prieur
+ VIM REFERENCE MANUAL by Gordon Prieur
Debugger Support Features *debugger-support*
diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt
index 922da72727..8526926d58 100644
--- a/runtime/doc/develop.txt
+++ b/runtime/doc/develop.txt
@@ -1,7 +1,7 @@
-*develop.txt* For Vim version 9.1. Last change: 2025 Oct 09
+*develop.txt* For Vim version 9.1. Last change: 2025 Dec 13
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Development of Vim. *development*
@@ -153,7 +153,7 @@ VIM IS... NOT *design-not*
everything but the kitchen sink, but some people say that you can clean one
with it. ;-)"
To use Vim with gdb see |terminal-debugger|. Other (older) tools can be
- found at http://www.agide.org (link seems dead) and http://clewn.sf.net.
+ found at http://clewn.sf.net.
- Vim is not a fancy GUI editor that tries to look nice at the cost of
being less consistent over all platforms. But functional GUI features are
welcomed.
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt
index 419373a8de..8ff2937f00 100644
--- a/runtime/doc/diff.txt
+++ b/runtime/doc/diff.txt
@@ -1,7 +1,7 @@
-*diff.txt* For Vim version 9.1. Last change: 2025 Oct 14
+*diff.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
*diff* *vimdiff* *gvimdiff* *diff-mode*
diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt
index ac3ae71b5c..575ae822b2 100644
--- a/runtime/doc/digraph.txt
+++ b/runtime/doc/digraph.txt
@@ -1,7 +1,7 @@
-*digraph.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*digraph.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Digraphs *digraph* *digraphs* *Digraphs*
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 6141dcec12..2e75fb9a80 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,7 +1,7 @@
-*editing.txt* For Vim version 9.1. Last change: 2025 Oct 14
+*editing.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Editing files *edit-files*
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 497c1a1b5b..c82e24f133 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,7 +1,7 @@
-*eval.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*eval.txt* For Vim version 9.1. Last change: 2025 Dec 27
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Expression evaluation *expression* *expr* *E15* *eval*
@@ -38,6 +38,7 @@ a remark is given.
12. The sandbox |eval-sandbox|
13. Textlock |textlock|
14. Vim script library |vim-script-library|
+15. Clipboard providers |clipboard-providers|
Testing support is documented in |testing.txt|.
Profiling is documented at |profiling|.
@@ -1348,7 +1349,13 @@ To compare Funcrefs to see if they refer to the same function, ignoring bound
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*
+<
+ *E1437*
+An |Object| can only be compared with another |Object|, using only the
+"equal", "not equal", "is" and "isnot" operators |expr4|. An |enum| is also a
+type of |Object|, and the same rules apply.
+
+ *E1037*
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
@@ -2247,7 +2254,14 @@ v:clipmethod The current method of accessing the clipboard that is being
x11 X11 selections are being used.
none The above methods are unavailable or
cannot be used.
- See 'clipmethod' for more details.
+ If it is set to a value not in the above list, then a
+ clipboard provider with the given name is being used for the
+ clipboard functionality. See 'clipmethod' for more details.
+
+ *v:clipproviders*
+v:clipproviders
+ A dictionary containing clipboard providers, see
+ |clipboard-providers| for more information.
*v:cmdarg* *cmdarg-variable*
v:cmdarg This variable is used for two purposes:
@@ -2381,8 +2395,8 @@ v:echospace Number of screen cells that can be used for an `:echo` message
available above the last line.
*v:errmsg* *errmsg-variable*
-v:errmsg Last given error message. It's allowed to set this variable.
- Example: >
+v:errmsg Last error message that occurred (not necessarily displayed).
+ It's allowed to set this variable. Example: >
:let v:errmsg = ""
:silent! next
:if v:errmsg != ""
@@ -3003,6 +3017,10 @@ v:versionlong Like v:version, but also including the patchlevel in the last
v:vim_did_enter Zero until most of startup is done. It is set to one just
before |VimEnter| autocommands are triggered.
+ *v:vim_did_init* *vim_did_init-variable*
+v:vim_did_init Zero until initialization is done. It is set to one just
+ after |vimrc| is sourced and before |load-plugins|.
+
*v:warningmsg* *warningmsg-variable*
v:warningmsg Last given warning message. It's allowed to set this
variable.
@@ -3709,19 +3727,22 @@ text...
*:cat* *:catch*
*E603* *E604* *E605* *E654* *E1033*
-:cat[ch] /{pattern}/ The following commands until the next `:catch`,
+:cat[ch] [/{pattern}/] The following commands until the next `:catch`,
`:finally`, or `:endtry` that belongs to the same
`:try` as the `:catch` are executed when an exception
matching {pattern} is being thrown and has not yet
been caught by a previous `:catch`. Otherwise, these
commands are skipped.
- When {pattern} is omitted all errors are caught.
- Examples: >
+ Pattern can start with "Vim({cmd})" to indicate an
+ exception that occurred when executing the Ex command
+ {cmd}. When {pattern} is omitted all errors are
+ caught. Examples: >
:catch /^Vim:Interrupt$/ " catch interrupts (CTRL-C)
- :catch /^Vim\%((\a\+)\)\=:E/ " catch all Vim errors
- :catch /^Vim\%((\a\+)\)\=:/ " catch errors and interrupts
+ :catch /^Vim\%((\S\+)\)\=:E/ " catch all Vim errors
+ :catch /^Vim\%((\S\+)\)\=:/ " catch errors and interrupts
:catch /^Vim(write):/ " catch all errors in :write
- :catch /^Vim\%((\a\+)\)\=:E123:/ " catch error E123
+ :catch /^Vim(!):/ " catch all errors in :!
+ :catch /^Vim\%((\S\+)\)\=:E123:/ " catch error E123
:catch /my-exception/ " catch user exception
:catch /.*/ " catch everything
:catch " same as /.*/
@@ -3844,7 +3865,7 @@ text...
when the screen is redrawn.
*:echow* *:echowin* *:echowindow*
-:[N]echow[indow] {expr1} ..
+:[N]echow[indow] {expr1} ...
Like |:echomsg| but when the messages popup window is
available the message is displayed there. This means
it will show for three seconds and avoid a
@@ -5228,7 +5249,7 @@ $VIMRUNTIME/plugin/openPlugin.vim
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
+`start`, Linux `xdg-open`, …). If the variable |g:Openprg| exists the
string specified in the variable is used instead.
The |:Open| user command uses file completion for its argument.
@@ -5277,5 +5298,117 @@ Usage: >vim
:call dist#vim9#Launch()
:Launch .
<
-
+==============================================================================
+15. Clipboard providers *clipboard-providers*
+
+The clipboard provider feature allows the "+" |quoteplus| and "*" |quotestar|
+registers to be overridden by custom Vim script functions. There can be
+multiple providers, and Vim chooses which one to use based on 'clipmethod'.
+
+Despite the name, it should be treated separate from the clipboard
+functionality. It essentially overrides the existing behaviour of the
+clipboard registers.
+
+ *clipboard-providers-clipboard*
+The clipboard provider feature will respect the "unnamed" and "unnamedplus"
+values in the 'clipboard' option. Any other value will be ignored.
+
+ *clipboard-providers-no-clipboard*
+If the |+clipboard| feature is not enabled, then the "+" and "*" registers
+will not be enabled/available unless |v:clipmethod| is set to a provider. If
+it is set to a provider, then the clipboard registers will be exposed despite
+not having the |+clipboard| feature.
+
+ *clipboard-providers-plus*
+If on a platform that only has the "*" register, then the "+" register will
+only be available when |v:clipmethod| is set to a provider. If you want to
+check if the "+" is available for use, it can be checked with: >
+ if has('unnamedplus')
+<
+ *clipboard-providers-clipmethod*
+To integrate the providers with Vim's clipboard functionality, the
+'clipmethod' option is used on all platforms. The names of clipboard
+providers should be put inside the option, and if Vim chooses it, then it
+overrides the "+" and "*" registers. Note that the "+" and "*" will not be
+saved in the viminfo at all.
+
+ *clipboard-providers-define*
+To define a clipboard provider, the |v:clipproviders| vim variable is used. It
+is a |dict| where each key is the clipboard provider name, and the value is
+another |dict| declaring the "available", "copy", and "paste" callbacks: >vim
+ let v:clipproviders["myprovider"] = {
+ \ "available": function("Available"),
+ \ "paste": {
+ \ "+": function("Paste"),
+ \ "*": function("Paste")
+ \ },
+ \ "copy": {
+ \ "+": function("Copy"),
+ \ "*": function("Copy")
+ \ }
+ \ }
+ set clipmethod^=myprovider
+<
+Each callback can either be a name of a function in a string, a |Funcref|, or
+a |lambda| expression.
+
+With the exception of the "available" callback if a callback is not provided,
+Vim will not invoke anything, and this is not an error.
+
+ *clipboard-providers-textlock*
+In both the "paste" and "copy" callbacks, it is not allowed to change the
+buffer text, see |textlock|.
+
+ *clipboard-providers-available*
+The "available" callback is optional, does not take any arguments and should
+return a |boolean| or non-zero number, which tells Vim if it is available
+for use. If it is not, then Vim skips over it and tries the next 'clipmethod'
+value. If the "available" callback is not provided, Vim assumes the provider
+is always available for use (true).
+
+ *clipboard-providers-paste*
+The "paste" callback takes the following arguments in the following order:
+ 1. Name of the register being accessed, either "+" or "*".
+
+It should return a |list| or |tuple| containing the following elements in
+order:
+ 1. Register type (and optional width) conforming to |setreg()|. If it
+ is an empty string, then the type is automatically chosen.
+ 2. A |list| of strings to return to Vim, each representing a line.
+
+ *clipboard-providers-copy*
+The "copy" callback returns nothing and takes the following arguments in the
+following order:
+ 1. Name of the register being accessed, either "+" or "*".
+ 2. Register type conforming to |getregtype()|
+ 3. List of strings to use, each representing a line.
+
+Below is a sample script that makes use of the clipboard provider feature: >vim
+ func Available()
+ return v:true
+ endfunc
+
+ func Copy(reg, type, str)
+ echom "Register: " .. a:reg
+ echom "Register type: " .. a:type
+ echom "Contents: " .. string(a:str)
+ endfunc
+
+ func Paste(reg)
+ return ("b40", ["this", "is", "the", a:reg, "register!"])
+ endfunc
+
+ let v:clipproviders["test"] = {
+ \ "available": function("Available"),
+ \ "copy": {
+ \ "+": function("Copy"),
+ \ "*": function("Copy")
+ \ },
+ \ "paste": {
+ \ "+": function("Paste"),
+ \ "*": function("Paste")
+ \ }
+ \ }
+ set clipmethod^=test
+<
vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/farsi.txt b/runtime/doc/farsi.txt
index f4474038d4..d5ae408935 100644
--- a/runtime/doc/farsi.txt
+++ b/runtime/doc/farsi.txt
@@ -1,7 +1,7 @@
-*farsi.txt* For Vim version 9.1. Last change: 2019 May 05
+*farsi.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Mortaza Ghassab Shiran
+ VIM REFERENCE MANUAL by Mortaza Ghassab Shiran
Right to Left and Farsi Mapping for Vim *farsi* *Farsi*
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index b363b11293..8ec0fa43ad 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -1,7 +1,7 @@
-*filetype.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*filetype.txt* For Vim version 9.1. Last change: 2025 Dec 07
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Filetypes *filetype* *file-type*
@@ -138,6 +138,7 @@ what kind of file it is. This doesn't always work. A number of global
variables can be used to overrule the filetype used for certain extensions:
file name variable ~
+ *.app g:filetype_app
*.asa g:filetype_asa |ft-aspperl-syntax|
|ft-aspvbs-syntax|
*.asm g:asmsyntax |ft-asm-syntax|
diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt
index 40cff059c6..dd2a0a04b4 100644
--- a/runtime/doc/fold.txt
+++ b/runtime/doc/fold.txt
@@ -1,7 +1,7 @@
-*fold.txt* For Vim version 9.1. Last change: 2025 Oct 03
+*fold.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Folding *Folding* *folding* *folds*
diff --git a/runtime/doc/ft_rust.txt b/runtime/doc/ft_rust.txt
index 4f4e3a85e7..b1789b8141 100644
--- a/runtime/doc/ft_rust.txt
+++ b/runtime/doc/ft_rust.txt
@@ -60,8 +60,8 @@ g:rust_conceal_pub~
*g:rust_recommended_style*
g:rust_recommended_style~
Set this option to enable vim indentation and textwidth settings to
- conform to style conventions of the rust standard library (i.e. use 4
- spaces for indents and sets 'textwidth' to 99). This option is enabled
+ conform to style conventions of the Rust style guide (i.e. use 4
+ spaces for indents and set 'textwidth' to 100). This option is enabled
by default. To disable it: >
let g:rust_recommended_style = 0
<
diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt
index 0096e083fb..60de2a28a5 100644
--- a/runtime/doc/gui.txt
+++ b/runtime/doc/gui.txt
@@ -1,7 +1,7 @@
-*gui.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*gui.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Vim's Graphical User Interface *gui* *GUI*
diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt
index 1c33ff6962..475b12e962 100644
--- a/runtime/doc/gui_w32.txt
+++ b/runtime/doc/gui_w32.txt
@@ -1,7 +1,7 @@
-*gui_w32.txt* For Vim version 9.1. Last change: 2025 Oct 11
+*gui_w32.txt* For Vim version 9.1. Last change: 2025 Dec 21
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Vim's Win32 Graphical User Interface *gui-w32* *win32-gui*
@@ -504,4 +504,25 @@ To use the system's default title bar colors, set highlighting groups to
hi TitleBar guibg=NONE guifg=NONE
hi TitleBarNC guibg=NONE guifg=NONE
<
+
+Full Screen *gui-w32-fullscreen*
+
+To enable fullscreen mode in the Windows GUI version of Vim, add the 's' flag
+to the 'guioptions' setting.
+
+For convenience, you can define a command or mapping to toggle fullscreen mode:
+>
+ command! ToggleFullscreen {
+ if &guioptions =~# 's'
+ set guioptions-=s
+ else
+ set guioptions+=s
+ endif
+ }
+
+ map &go =~# 's' ? ":se go-=s" : ":se go+=s"
+
+The fullscreen mode will occupy the entire screen area while hiding window
+decorations such as the title bar and borders.
+
vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/gui_x11.txt b/runtime/doc/gui_x11.txt
index 7810e3d31a..2d08876b5b 100644
--- a/runtime/doc/gui_x11.txt
+++ b/runtime/doc/gui_x11.txt
@@ -1,7 +1,7 @@
-*gui_x11.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*gui_x11.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Vim's Graphical User Interface *gui-x11* *GUI-X11*
diff --git a/runtime/doc/hangulin.txt b/runtime/doc/hangulin.txt
index 3f37d8eb83..a643c2fa40 100644
--- a/runtime/doc/hangulin.txt
+++ b/runtime/doc/hangulin.txt
@@ -1,7 +1,8 @@
-*hangulin.txt* For Vim version 9.1. Last change: 2019 Nov 21
+*hangulin.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Chi-Deok Hwang and Sung-Hyun Nam
+ VIM REFERENCE MANUAL by Chi-Deok Hwang and Sung-Hyun Nam
+
*hangul*
Vim had built-in support for hangul, the Korean language, for users without
diff --git a/runtime/doc/hebrew.txt b/runtime/doc/hebrew.txt
index 64b9c60bc6..2cbd81979a 100644
--- a/runtime/doc/hebrew.txt
+++ b/runtime/doc/hebrew.txt
@@ -1,7 +1,7 @@
-*hebrew.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*hebrew.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Ron Aaron and Avner Lottem
+ VIM REFERENCE MANUAL by Ron Aaron and Avner Lottem
Hebrew Language support (options & mapping) for Vim *hebrew*
diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt
index d39292baf2..eabf59529c 100644
--- a/runtime/doc/help.txt
+++ b/runtime/doc/help.txt
@@ -1,4 +1,4 @@
-*help.txt* For Vim version 9.1. Last change: 2025 Jun 27
+*help.txt* For Vim version 9.1. Last change: 2025 Nov 01
VIM - main help file
k
@@ -44,7 +44,7 @@ BASIC:
|quickref| Overview of the most common commands you will use
|tutor| 30-minute interactive course for beginners
|copying| About copyrights
-|iccf| Helping poor children in Uganda
+|Kuwasha| Helping poor children in Uganda
|sponsor| Sponsor Vim development, become a registered Vim user
|www| Vim on the World Wide Web
|bugs| Where to send bug reports
diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt
index d10cb2c14a..c014e558c1 100644
--- a/runtime/doc/helphelp.txt
+++ b/runtime/doc/helphelp.txt
@@ -1,7 +1,7 @@
-*helphelp.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*helphelp.txt* For Vim version 9.1. Last change: 2025 Dec 02
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Help on help files *helphelp*
@@ -158,11 +158,12 @@ When no argument is given to |:help| the file given with the 'helpfile' option
will be opened. Otherwise the specified tag is searched for in all "doc/tags"
files in the directories specified in the 'runtimepath' option.
-If you would like to open the help in the current window, see this tip:
-|help-curwin|.
-
The initial height of the help window can be set with the 'helpheight' option
(default 20).
+
+If you want to open help on {subject} in the current window, the helpcurwin
+optional package can be used. See |package-helpcurwin|.
+
*help-buffer-options*
When the help buffer is created, several local options are set to make sure
the help text is displayed as it was intended:
diff --git a/runtime/doc/howto.txt b/runtime/doc/howto.txt
index 2d8c8b5c4f..596afb83d7 100644
--- a/runtime/doc/howto.txt
+++ b/runtime/doc/howto.txt
@@ -1,7 +1,7 @@
-*howto.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*howto.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
How to ... *howdoi* *how-do-i* *howto* *how-to*
diff --git a/runtime/doc/if_cscop.txt b/runtime/doc/if_cscop.txt
index e96a04ecf1..1ecd5ba719 100644
--- a/runtime/doc/if_cscop.txt
+++ b/runtime/doc/if_cscop.txt
@@ -1,7 +1,8 @@
-*if_cscop.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*if_cscop.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Andy Kahn
+ VIM REFERENCE MANUAL by Andy Kahn
+
*cscope* *Cscope*
This document explains how to use Vim's cscope interface.
diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt
index f0d77cffda..20183858d7 100644
--- a/runtime/doc/if_lua.txt
+++ b/runtime/doc/if_lua.txt
@@ -1,7 +1,7 @@
-*if_lua.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*if_lua.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Luis Carvalho
+ VIM REFERENCE MANUAL by Luis Carvalho
The Lua Interface to Vim *lua* *Lua*
diff --git a/runtime/doc/if_mzsch.txt b/runtime/doc/if_mzsch.txt
index d76816dbec..8159eb678f 100644
--- a/runtime/doc/if_mzsch.txt
+++ b/runtime/doc/if_mzsch.txt
@@ -1,7 +1,7 @@
-*if_mzsch.txt* For Vim version 9.1. Last change: 2025 Oct 14
+*if_mzsch.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Sergey Khorev
+ VIM REFERENCE MANUAL by Sergey Khorev
The MzScheme Interface to Vim *mzscheme* *MzScheme*
diff --git a/runtime/doc/if_ole.txt b/runtime/doc/if_ole.txt
index c546e971a6..c0f1472c6e 100644
--- a/runtime/doc/if_ole.txt
+++ b/runtime/doc/if_ole.txt
@@ -1,7 +1,7 @@
-*if_ole.txt* For Vim version 9.1. Last change: 2023 Nov 19
+*if_ole.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Paul Moore
+ VIM REFERENCE MANUAL by Paul Moore
The OLE Interface to Vim *ole-interface*
diff --git a/runtime/doc/if_perl.txt b/runtime/doc/if_perl.txt
index 616c3b31cd..54fd6a0be4 100644
--- a/runtime/doc/if_perl.txt
+++ b/runtime/doc/if_perl.txt
@@ -1,9 +1,10 @@
-*if_perl.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*if_perl.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Sven Verdoolaege
+ VIM REFERENCE MANUAL by Sven Verdoolaege
and Matt Gerassimof
+
Perl and Vim *perl* *Perl*
1. Editing Perl files |perl-editing|
diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt
index 0402e2cbbd..65d1c8bedf 100644
--- a/runtime/doc/if_pyth.txt
+++ b/runtime/doc/if_pyth.txt
@@ -1,7 +1,7 @@
-*if_pyth.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*if_pyth.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Paul Moore
+ VIM REFERENCE MANUAL by Paul Moore
The Python Interface to Vim *python* *Python*
diff --git a/runtime/doc/if_ruby.txt b/runtime/doc/if_ruby.txt
index c024b48e3c..14558fab1e 100644
--- a/runtime/doc/if_ruby.txt
+++ b/runtime/doc/if_ruby.txt
@@ -1,7 +1,8 @@
-*if_ruby.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*if_ruby.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Shugo Maeda
+ VIM REFERENCE MANUAL by Shugo Maeda
+
The Ruby Interface to Vim *ruby* *Ruby*
diff --git a/runtime/doc/if_sniff.txt b/runtime/doc/if_sniff.txt
index ff587ad249..eeff3cd5d8 100644
--- a/runtime/doc/if_sniff.txt
+++ b/runtime/doc/if_sniff.txt
@@ -1,7 +1,7 @@
-*if_sniff.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*if_sniff.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Anton Leherbauer
+ VIM REFERENCE MANUAL by Anton Leherbauer
The SNiFF+ support was removed at patch 7.4.1433. If you want to check it out
diff --git a/runtime/doc/if_tcl.txt b/runtime/doc/if_tcl.txt
index a5c098297d..c925944023 100644
--- a/runtime/doc/if_tcl.txt
+++ b/runtime/doc/if_tcl.txt
@@ -1,7 +1,7 @@
-*if_tcl.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*if_tcl.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Ingo Wilken
+ VIM REFERENCE MANUAL by Ingo Wilken
The Tcl Interface to Vim *tcl* *Tcl* *TCL*
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
index afd3954654..0be5703687 100644
--- a/runtime/doc/indent.txt
+++ b/runtime/doc/indent.txt
@@ -1,7 +1,7 @@
-*indent.txt* For Vim version 9.1. Last change: 2025 Oct 14
+*indent.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
This file is about indenting C programs and other files.
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 7bda20b248..3e03a5da7c 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1,7 +1,8 @@
-*index.txt* For Vim version 9.1. Last change: 2025 Aug 06
+*index.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
*index*
This file contains a list of all commands for each mode, with a tag and a
@@ -169,7 +170,7 @@ commands in CTRL-X submode *i_CTRL-X_index*
|i_CTRL-X_CTRL-Y| CTRL-X CTRL-Y scroll down
|i_CTRL-X_CTRL-U| CTRL-X CTRL-U complete with 'completefunc'
|i_CTRL-X_CTRL-V| CTRL-X CTRL-V complete like in : command line
-|i_CTRL-X_CTRL-Z| CTRL-X CTRL-Z stop completion, keeping the text as-is
+|i_CTRL-X_CTRL-Z| CTRL-X CTRL-Z stop completion, text is unchanged
|i_CTRL-X_CTRL-]| CTRL-X CTRL-] complete tags
|i_CTRL-X_s| CTRL-X s spelling suggestions
@@ -807,7 +808,8 @@ tag char note action in Normal mode ~
|g@| g@{motion} call 'operatorfunc'
|g~| g~{motion} 2 swap case for Nmove text
|g| g 1 same as "gj"
-|g| g 1 same as "g$"
+|g| g 1 same as "g$" but go to the rightmost
+ non-blank character instead
|g| g 1 same as "g0"
|g| g same as
g same as
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index b0bd39a281..4890892197 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1,7 +1,7 @@
-*insert.txt* For Vim version 9.1. Last change: 2025 Oct 17
+*insert.txt* For Vim version 9.1. Last change: 2026 Jan 07
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
*Insert* *Insert-mode*
@@ -1720,7 +1720,7 @@ Complete:
Notes
- It doesn't complete command arguments that rely on 'shellcmd' completion
- type in Windows and WSL due to general slowness of canditate gathering,
+ type in Windows and WSL due to general slowness of candidate gathering,
e.g.
>
terminal dir
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index 46aa9428f3..9595345290 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -1,7 +1,7 @@
-*intro.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*intro.txt* For Vim version 9.1. Last change: 2025 Nov 27
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Introduction to Vim *ref* *reference*
@@ -275,7 +275,7 @@ Vim would never have become what it is now, without the help of these people!
improvements
Doug Kearns Runtime file maintainer
Foxe Chen Wayland support, new features
- glepnir completion feature
+ glepnir work on improving completion feature, fixes
Girish Palya autocompletion (ins/cmdline), omnifunc
composing, search/subst completion, and more.
Hirohito Higashi lots of patches and fixes
@@ -450,6 +450,8 @@ notation meaning equivalent decimal value(s) ~
delete 127
command sequence intro ALT-Esc 155 **
CSI when typed in the GUI **
+ operating system command 157 **
+ received OSC response **
end-of-line (can be , or ,
depends on system and 'fileformat') **
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 98ac3e1181..ee46180a65 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1,7 +1,7 @@
-*map.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*map.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Key mapping, abbreviations and user-defined commands.
@@ -1753,7 +1753,7 @@ by default correspond to the current line, last line and the whole buffer,
relate to arguments, (loaded) buffers, windows or tab pages.
Possible values are (second column is the short name used in listing):
- -addr=lines Range of lines (this is the default for -range)
+ -addr=lines Range of lines (the default for -range)
-addr=arguments arg Range for arguments
-addr=buffers buf Range for buffers (also not loaded buffers)
-addr=loaded_buffers load Range for loaded buffers
@@ -1761,8 +1761,7 @@ Possible values are (second column is the short name used in listing):
-addr=tabs tab Range for tab pages
-addr=quickfix qf Range for quickfix entries
-addr=other ? Other kind of range; can use ".", "$" and "%"
- as with "lines" (this is the default for
- -count)
+ as with "lines" (the default for -count)
Special cases ~
diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt
index ea545874c2..9c99f22c4e 100644
--- a/runtime/doc/mbyte.txt
+++ b/runtime/doc/mbyte.txt
@@ -1,7 +1,7 @@
-*mbyte.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*mbyte.txt* For Vim version 9.1. Last change: 2025 Dec 17
- VIM REFERENCE MANUAL by Bram Moolenaar et al.
+ VIM REFERENCE MANUAL by Bram Moolenaar et al.
Multi-byte support *multibyte* *multi-byte*
@@ -601,7 +601,7 @@ Each field means:
- AVE: AVERAGE_WIDTH field. Ten times average width in pixels.
- CR: CHARSET_REGISTRY field. The name of the charset group.
- CE: CHARSET_ENCODING field. The rest of the charset name. For some
- charsets, such as JIS X 0208, if this field is 0, code points has
+ charsets, such as JIS X 0208, if this field is 0, codepoints has
the same value as GL, and GR if 1.
For example, in case of a 16 dots font corresponding to JIS X 0208, it is
@@ -997,8 +997,8 @@ recommended to test with an alternative one.
For proper integration with Vim's |+multi_byte_ime| system, changes in the
input method's status must be detectable by the `ImmGetOpenStatus()` function
-in Vims source code. Currently, some input methods that support multi-language
-input may have internal state changes that gVim cannot capture.
+in Vim's source code. Currently, some input methods that support
+multi-language input may have internal state changes that gVim cannot capture.
Cursor color when IME or XIM is on *CursorIM*
diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt
index 33b8fbdfee..cbbd3f4c34 100644
--- a/runtime/doc/message.txt
+++ b/runtime/doc/message.txt
@@ -1,7 +1,7 @@
-*message.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*message.txt* For Vim version 9.1. Last change: 2025 Dec 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
This file contains an alphabetical list of messages and error messages that
@@ -644,6 +644,22 @@ Set the 'autoread' option if you want to do this automatically.
This message is not given when 'buftype' is not empty.
Also see the |FileChangedShell| autocommand.
+You will be given a dialog with the following options:
+
+"OK": Dismiss the warning and continue editing. No changes are
+ loaded, the buffer remains as it is.
+
+"Load File": Reload the file from disk, replacing the current buffer
+ contents. Any changes you made in Vim that haven't been saved
+ will be lost.
+
+"Load File and Options":
+ Reload the file from disk and, in addition, apply relevant
+ file settings, such as indentation, syntax highlighting, text
+ width, and other filetype-specific options. This ensures the
+ buffer matches the file's intended configuration according to
+ your current settings and autocommands.
+
There is one situation where you get this message even though there is nothing
wrong: If you save a file in Windows on the day the daylight saving time
starts. It can be fixed in one of these ways:
@@ -832,6 +848,8 @@ and the screen is about to be redrawn:
like pressing . This makes it impossible to select text though.
-> For the GUI clicking the left mouse button in the last line works like
pressing .
+-> |q| won't start recording into a register (rationale: it is often used as
+ "quit" prompt key by users)
If you accidentally hit or and you want to see the displayed
text then use |g<|. This only works when 'more' is set.
diff --git a/runtime/doc/mlang.txt b/runtime/doc/mlang.txt
index e98e15e1dd..4719126c76 100644
--- a/runtime/doc/mlang.txt
+++ b/runtime/doc/mlang.txt
@@ -1,7 +1,7 @@
-*mlang.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*mlang.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Multi-language features *multilang* *multi-lang*
diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt
index e0c9d8ba64..582712fbb0 100644
--- a/runtime/doc/motion.txt
+++ b/runtime/doc/motion.txt
@@ -1,7 +1,7 @@
-*motion.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*motion.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Cursor motions *cursor-motions* *navigation*
diff --git a/runtime/doc/netbeans.txt b/runtime/doc/netbeans.txt
index 871302616f..1332a8fb98 100644
--- a/runtime/doc/netbeans.txt
+++ b/runtime/doc/netbeans.txt
@@ -1,7 +1,7 @@
-*netbeans.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*netbeans.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Gordon Prieur et al.
+ VIM REFERENCE MANUAL by Gordon Prieur et al.
*netbeans* *NetBeans* *netbeans-support*
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 0d8c668e3b..e0406f5fb2 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,7 +1,7 @@
-*options.txt* For Vim version 9.1. Last change: 2025 Oct 28
+*options.txt* For Vim version 9.1. Last change: 2026 Jan 07
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Options *options*
@@ -1675,7 +1675,8 @@ A jump table for the options with a short description can be found at |Q_op|.
a modified version of the following command in your vimrc file to
override it: >
:let &cdpath = ',' .. substitute(substitute($CDPATH, '[, ]', '\\\0', 'g'), ':', ',', 'g')
-< This option cannot be set from a |modeline| or in the |sandbox|, for
+< Environment variables are expanded |:set_env|.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
(parts of 'cdpath' can be passed to the shell to expand file names).
@@ -1819,13 +1820,19 @@ A jump table for the options with a short description can be found at |Q_op|.
for X-windows, "" otherwise)
global
{only in GUI versions or when the |+xterm_clipboard|
- or |+wayland_clipboard| features are included}
+ or |+wayland_clipboard| features or
+ |+clipboard_provider| features are included}
This option is a list of comma-separated names.
Note: if one of the items is "exclude:", then you can't add an item
after that. Therefore do not append an item with += but use ^= to
prepend, e.g.: >
set clipboard^=unnamed
< When using the GUI see |'go-A'|.
+ When using the |clipboard-providers| feature, only the "unnamed" and
+ "unnamedplus" features will be recognized If compiled without the
+ |+clipboard| feature but compiled with the |+clipboard_provider|
+ feature, then they will be the only values allowed and the other
+ values will be invalid.
These names are recognized:
*clipboard-unnamed*
@@ -1847,11 +1854,10 @@ A jump table for the options with a short description can be found at |Q_op|.
option, yank operations (but not delete, change or
put) will additionally copy the text into register
'*'. If Wayland is being used and the compositor does
- not support the primary-selection-unstable-v1
- protocol, then the regular selection is used in its
- place. Only available with the |+X11| or
- |+wayland_clipboard| feature. Availability can be
- checked with: >
+ not support the primary selection then the regular
+ selection is used in its place. Only available with
+ the |+X11| or |+wayland_clipboard| feature.
+ Availability can be checked with: >
if has('unnamedplus')
<
*clipboard-autoselect*
@@ -1916,18 +1922,22 @@ A jump table for the options with a short description can be found at |Q_op|.
for VMS: "x11",
otherwise: "")
global
- {only when the |+xterm_clipboard| or
- |+wayland_clipboard| features are included}
- Specifies which method of accessing the system clipboard is used,
- depending on which method works first or is available. Supported
- methods are:
+ {only when the |+xterm_clipboard|, |+wayland_clipboard|,
+ or |+eval| features are included}
+ Specifies which method of accessing the system clipboard (or clipboard
+ provider) is used. Methods are tried in the order given; the first
+ working method is used. Supported methods are:
wayland Wayland selections
x11 X11 selections
+ Use a clipboard provider with the given name
Note: This option is ignored when either the GUI is running or if Vim
is run on a system without Wayland or X11 support, such as Windows or
- macOS. The GUI or system way of accessing the clipboard is always
- used instead.
+ macOS. The GUI or system way of accessing the clipboard is used
+ instead, meaning |v:clipmethod| will be set to "none". The
+ exception to this is the |clipboard-providers| feature, in which if
+ a clipboard provider is being used, then it will override the existing
+ clipboard functionality.
The option value is a list of comma separated items. The list is
parsed left to right in order, and the first method that Vim
@@ -2006,8 +2016,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'commentstring'* *'cms'* *E537*
'commentstring' 'cms' string (default "/* %s */")
local to buffer
- {not available when compiled without the |+folding|
- feature}
A template for a comment. The "%s" in the value is replaced with the
comment text, and should be padded with a space when possible.
Currently used to add markers for folding, see |fold-marker|. Also
@@ -2227,11 +2235,13 @@ A jump table for the options with a short description can be found at |Q_op|.
*'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:
+ DEPRECATED: This option is no longer used; changing it has no effect.
+ When 'completeopt' contains "fuzzy", Vim will internally use the
+ equivalent of:
+ "keyword,files,whole_line"
+
+ The values below are kept for compatibility and for scripts that
+ may read this option:
keyword keywords in the current file |i_CTRL-X_CTRL-N|
keywords with flags ".", "w", |i_CTRL-N| |i_CTRL-P|
@@ -2242,10 +2252,6 @@ A jump table for the options with a short description can be found at |Q_op|.
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
@@ -2265,12 +2271,7 @@ A jump table for the options with a short description can be found at |Q_op|.
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'.
+ if the exact sequence is not typed.
longest
When 'autocomplete' is not active, only the longest common
@@ -3081,6 +3082,7 @@ A jump table for the options with a short description can be found at |Q_op|.
To include a comma in a file name precede it with a backslash. Spaces
after a comma are ignored, otherwise spaces are included in the file
name. See |option-backslash| about using backslashes.
+ Environment variables are expanded |:set_env|.
This has nothing to do with the |Dictionary| variable type.
Where to find a list of words?
- On FreeBSD, there is the file "/usr/share/dict/words".
@@ -3224,9 +3226,10 @@ A jump table for the options with a short description can be found at |Q_op|.
internal Use the internal diff library. This is
ignored when 'diffexpr' is set. *E960*
When running out of memory when writing a
- buffer this item will be ignored for diffs
- involving that buffer. Set the 'verbose'
- option to see when this happens.
+ buffer or the diff is larger than 1 GB this
+ item will be ignored for diffs involving that
+ buffer. Set the 'verbose' option to see when
+ this happens.
iwhite Ignore changes in amount of white space. Adds
the "-b" flag to the "diff" command if
@@ -4286,7 +4289,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'fsync'* *'fs'* *'nofsync'* *'nofs'*
'fsync' 'fs' boolean (default on)
- global
+ global or local to buffer |global-local|
When on, the library function fsync() will be called after writing a
file. This will flush a file to disk, ensuring that it is safely
written even on filesystems which do metadata-only journaling. This
@@ -4295,6 +4298,8 @@ A jump table for the options with a short description can be found at |Q_op|.
turning this off increases the chances of data loss after a crash. On
systems without an fsync() implementation, this variable is always
off.
+ This is a |global-local| option, so it can be set per buffer, for
+ example when writing to a slow filesystem.
Also see 'swapsync' for controlling fsync() on swap files.
'fsync' also applies to |writefile()| (unless a flag is used to
overrule it) and when writing undo files (see |undo-persistence|).
@@ -4626,11 +4631,11 @@ A jump table for the options with a short description can be found at |Q_op|.
choices.
*'go-C'*
'C' Use |hl-TitleBar| and |hl-TitleBarNC| if available.
- Currently only works for MS-Window GUI.
+ Currently only works for MS-Windows GUI.
See |gui-w32-title-bar| for details.
*'go-d'*
'd' Use dark theme variant if available. Currently only works for
- GTK+ GUI.
+ MS-Windows and GTK+ GUI.
*'go-e'*
'e' Add tab pages when indicated with 'showtabline'.
'guitablabel' can be used to change the text in the labels.
@@ -4668,6 +4673,12 @@ A jump table for the options with a short description can be found at |Q_op|.
*'go-T'*
'T' Include Toolbar. Currently only in Win32, GTK+, Motif,
Photon and MacVim GUIs.
+ *'go-s'*
+ 's' Enable fullscreen mode. Currently only supported in the
+ MS-Windows GUI version. When set, the window will occupy the
+ entire screen and remove window decorations. Define custom
+ mappings to toggle this mode conveniently. For detailed usage
+ instructions, see |gui-w32-fullscreen|.
*'go-r'*
'r' Right-hand scrollbar is always present.
*'go-R'*
@@ -5335,23 +5346,6 @@ A jump table for the options with a short description can be found at |Q_op|.
and there is a letter before it, the completed part is made uppercase.
With 'noinfercase' the match is used as-is.
- *'isexpand'* *'ise'*
-'isexpand' 'ise' string (default: "")
- local to buffer
- Defines characters and patterns for completion in insert mode. Used
- by the |complete_match()| function to determine the starting position
- for completion. This is a comma-separated list of triggers. Each
- trigger can be:
- - A single character like "." or "/"
- - A sequence of characters like "->", "/*", or "/**"
-
- Note: Use "\\," to add a literal comma as trigger character, see
- |option-backslash|.
-
- Examples: >
- set isexpand=.,->,/*,\\,
-<
-
*'insertmode'* *'im'* *'noinsertmode'* *'noim'*
'insertmode' 'im' boolean (default off)
global
@@ -6183,7 +6177,8 @@ A jump table for the options with a short description can be found at |Q_op|.
When the number of matches exceeds this value, Vim shows ">" instead
of the exact count to keep searching fast.
Note: larger values may impact performance.
- The value must be between 1 and 9999.
+ The value must be between 1 and 9999. See also the |searchcount()|
+ function.
*'menuitems'* *'mis'*
'menuitems' 'mis' number (default 25)
@@ -6254,7 +6249,7 @@ A jump table for the options with a short description can be found at |Q_op|.
:set mkspellmem=900000,3000,800
< If you have less than 512 Mbyte |:mkspell| may fail for some
languages, no matter what you set 'mkspellmem' to.
-
+ Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -6677,6 +6672,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'packpath'* *'pp'*
'packpath' 'pp' string (default: see 'runtimepath')
Directories used to find packages. See |packages|.
+ Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -7501,6 +7497,7 @@ A jump table for the options with a short description can be found at |Q_op|.
runtime files.
When Vim is started with |--clean| the home directory entries are not
included.
+ Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -8002,7 +7999,8 @@ A jump table for the options with a short description can be found at |Q_op|.
"search hit TOP, continuing at BOTTOM" messages are only
indicated by a "W" (Mnemonic: Wrapped) letter before the
search count statistics. The maximum limit can be set with
- the 'maxsearchcount' option.
+ the 'maxsearchcount' option, see also |searchcount()|
+ function.
This gives you the opportunity to avoid that a change between buffers
requires you to hit , but still gives as useful a message as
@@ -8279,7 +8277,7 @@ A jump table for the options with a short description can be found at |Q_op|.
when it is turned off. It is also reset when 'compatible' is set.
The 'L' flag in 'cpoptions' alters tab behavior when 'list' is
- enabled. See also |ins-expandtab| ans user manual section |30.5| for
+ enabled. See also |ins-expandtab| and user manual section |30.5| for
in-depth explanations.
If Vim is compiled with the |+vartabs| feature then the value of
@@ -8333,6 +8331,7 @@ A jump table for the options with a short description can be found at |Q_op|.
name if you want to. However, it will then only be used when
'spellfile' is set to it, for entries in 'spelllang' only files
without region name will be found.
+ Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -8460,7 +8459,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Only one of "best", "double" or "fast" may be used. The others may
appear several times in any order. Example: >
:set sps=file:~/.vim/sugg,best,expr:MySuggest()
-<
+< Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -9298,8 +9297,9 @@ A jump table for the options with a short description can be found at |Q_op|.
name. See |option-backslash| about using backslashes. The use of
|:set+=| and |:set-=| is preferred when adding or removing directories
from the list. This avoids problems when a future version uses
- another default. Backticks cannot be used in this option for security
- reasons.
+ another default.
+ Environment variables are expanded |:set_env|.
+ Backticks cannot be used in this option for security reasons.
*'thesaurusfunc'* *'tsrfu'*
'thesaurusfunc' 'tsrfu' string (default: empty)
@@ -9639,6 +9639,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'ttytype' 'tty' string (default from $TERM)
global
Alias for 'term', see above.
+ Environment variables are expanded |:set_env|.
*'undodir'* *'udir'*
'undodir' 'udir' string (default ".")
@@ -9656,6 +9657,7 @@ A jump table for the options with a short description can be found at |Q_op|.
undo file that exists is used. When it cannot be read an error is
given, no further entry is used.
See |undo-persistence|.
+ Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -9807,6 +9809,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Setting 'verbosefile' to a new value is like making it empty first.
The difference with |:redir| is that verbose messages are not
displayed when 'verbosefile' is set.
+ Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -9821,6 +9824,7 @@ A jump table for the options with a short description can be found at |Q_op|.
feature}
Name of the directory where to store files for |:mkview|.
For $XDG_CONFIG_HOME see |xdg-base-dir|.
+ Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -9976,6 +9980,7 @@ A jump table for the options with a short description can be found at |Q_op|.
When equal to "NONE" no viminfo file will be read or written.
This option can be set with the |-i| command line flag. The |--clean|
command line flag sets it to "NONE".
+ Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
diff --git a/runtime/doc/os_390.txt b/runtime/doc/os_390.txt
index b30c1b2b06..4d2b7e8a7b 100644
--- a/runtime/doc/os_390.txt
+++ b/runtime/doc/os_390.txt
@@ -1,7 +1,8 @@
-*os_390.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*os_390.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Ralf Schandl
+ VIM REFERENCE MANUAL by Ralf Schandl
+
*zOS* *z/OS* *OS390* *os390* *MVS*
This file contains the particulars for the z/OS UNIX version of Vim.
diff --git a/runtime/doc/os_amiga.txt b/runtime/doc/os_amiga.txt
index 046a24fb94..1fc95cf84b 100644
--- a/runtime/doc/os_amiga.txt
+++ b/runtime/doc/os_amiga.txt
@@ -1,7 +1,7 @@
-*os_amiga.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*os_amiga.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
*Amiga*
diff --git a/runtime/doc/os_beos.txt b/runtime/doc/os_beos.txt
index 5ac41597ff..5ad853e6ee 100644
--- a/runtime/doc/os_beos.txt
+++ b/runtime/doc/os_beos.txt
@@ -1,7 +1,7 @@
-*os_beos.txt* For Vim version 9.1. Last change: 2020 Jun 07
+*os_beos.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
*beos* *BeOS* *BeBox*
diff --git a/runtime/doc/os_dos.txt b/runtime/doc/os_dos.txt
index 7e85f7145a..da11d53dc2 100644
--- a/runtime/doc/os_dos.txt
+++ b/runtime/doc/os_dos.txt
@@ -1,7 +1,7 @@
-*os_dos.txt* For Vim version 9.1. Last change: 2025 Aug 06
+*os_dos.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
*dos* *DOS*
diff --git a/runtime/doc/os_haiku.txt b/runtime/doc/os_haiku.txt
index bdabbb14fa..8ad23c3fa6 100644
--- a/runtime/doc/os_haiku.txt
+++ b/runtime/doc/os_haiku.txt
@@ -1,7 +1,7 @@
-*os_haiku.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*os_haiku.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
*Haiku*
diff --git a/runtime/doc/os_mac.txt b/runtime/doc/os_mac.txt
index a7760f373f..72759acb30 100644
--- a/runtime/doc/os_mac.txt
+++ b/runtime/doc/os_mac.txt
@@ -1,7 +1,7 @@
-*os_mac.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*os_mac.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar et al.
+ VIM REFERENCE MANUAL by Bram Moolenaar et al.
*mac* *Mac* *macintosh* *Macintosh*
diff --git a/runtime/doc/os_mint.txt b/runtime/doc/os_mint.txt
index 4ad0399d79..67f999b553 100644
--- a/runtime/doc/os_mint.txt
+++ b/runtime/doc/os_mint.txt
@@ -1,7 +1,7 @@
-*os_mint.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*os_mint.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Jens M. Felderhoff
+ VIM REFERENCE MANUAL by Jens M. Felderhoff
*MiNT* *Atari*
diff --git a/runtime/doc/os_msdos.txt b/runtime/doc/os_msdos.txt
index d6d67f0040..b2cdba4854 100644
--- a/runtime/doc/os_msdos.txt
+++ b/runtime/doc/os_msdos.txt
@@ -1,7 +1,7 @@
-*os_msdos.txt* For Vim version 9.1. Last change: 2016 Feb 26
+*os_msdos.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
*msdos* *ms-dos* *MSDOS* *MS-DOS*
diff --git a/runtime/doc/os_os2.txt b/runtime/doc/os_os2.txt
index bd24d139ae..69faf08267 100644
--- a/runtime/doc/os_os2.txt
+++ b/runtime/doc/os_os2.txt
@@ -1,7 +1,7 @@
-*os_os2.txt* For Vim version 9.1. Last change: 2015 Dec 31
+*os_os2.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Paul Slootman
+ VIM REFERENCE MANUAL by Paul Slootman
*os2* *OS2* *OS/2*
diff --git a/runtime/doc/os_qnx.txt b/runtime/doc/os_qnx.txt
index e55bdf82e3..d4e2f1ee86 100644
--- a/runtime/doc/os_qnx.txt
+++ b/runtime/doc/os_qnx.txt
@@ -1,7 +1,7 @@
-*os_qnx.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*os_qnx.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Julian Kinraid
+ VIM REFERENCE MANUAL by Julian Kinraid
*QNX* *qnx*
diff --git a/runtime/doc/os_risc.txt b/runtime/doc/os_risc.txt
index dad3549b98..fb5d57caf3 100644
--- a/runtime/doc/os_risc.txt
+++ b/runtime/doc/os_risc.txt
@@ -1,7 +1,7 @@
-*os_risc.txt* For Vim version 9.1. Last change: 2011 May 10
+*os_risc.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Thomas Leonard
+ VIM REFERENCE MANUAL by Thomas Leonard
*riscos* *RISCOS* *RISC-OS*
diff --git a/runtime/doc/os_unix.txt b/runtime/doc/os_unix.txt
index 90069a20b2..029f9998ed 100644
--- a/runtime/doc/os_unix.txt
+++ b/runtime/doc/os_unix.txt
@@ -1,7 +1,7 @@
-*os_unix.txt* For Vim version 9.1. Last change: 2022 Nov 25
+*os_unix.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
*unix* *Unix*
diff --git a/runtime/doc/os_vms.txt b/runtime/doc/os_vms.txt
index 8a800c10c9..ab072d48b3 100644
--- a/runtime/doc/os_vms.txt
+++ b/runtime/doc/os_vms.txt
@@ -1,4 +1,4 @@
-*os_vms.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*os_vms.txt* For Vim version 9.1. Last change: 2025 Nov 09
VIM REFERENCE MANUAL
diff --git a/runtime/doc/os_win32.txt b/runtime/doc/os_win32.txt
index 53b967f896..4831ff43f6 100644
--- a/runtime/doc/os_win32.txt
+++ b/runtime/doc/os_win32.txt
@@ -1,7 +1,7 @@
-*os_win32.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*os_win32.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by George Reilly
+ VIM REFERENCE MANUAL by George Reilly
*win32* *Win32* *MS-Windows*
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index 3381694595..6cafb688a7 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -1,7 +1,7 @@
-*pattern.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*pattern.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Patterns and search commands *pattern-searches*
diff --git a/runtime/doc/pi_gzip.txt b/runtime/doc/pi_gzip.txt
index cb4fc6b3b8..23e2610da7 100644
--- a/runtime/doc/pi_gzip.txt
+++ b/runtime/doc/pi_gzip.txt
@@ -1,7 +1,7 @@
-*pi_gzip.txt* For Vim version 9.1. Last change: 2025 Mar 05
+*pi_gzip.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Editing compressed files with Vim *gzip* *bzip2* *compress*
diff --git a/runtime/doc/pi_paren.txt b/runtime/doc/pi_paren.txt
index 049889699d..81d941313c 100644
--- a/runtime/doc/pi_paren.txt
+++ b/runtime/doc/pi_paren.txt
@@ -1,7 +1,7 @@
-*pi_paren.txt* For Vim version 9.1. Last change: 2024 Nov 04
+*pi_paren.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Highlighting matching parens *matchparen*
diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt
index 41f4da5455..5a874552f4 100644
--- a/runtime/doc/popup.txt
+++ b/runtime/doc/popup.txt
@@ -1,10 +1,10 @@
-*popup.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*popup.txt* For Vim version 9.1. Last change: 2026 Jan 08
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
-Displaying text in a floating window. *popup* *popup-window* *popupwin*
+Displaying text in a popup window. *popup* *popup-window* *popupwin*
1. Introduction |popup-intro|
diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt
index 0c980a0691..845892cae2 100644
--- a/runtime/doc/print.txt
+++ b/runtime/doc/print.txt
@@ -1,7 +1,7 @@
-*print.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*print.txt* For Vim version 9.1. Last change: 2025 Dec 17
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Printing *printing*
@@ -311,7 +311,7 @@ another font will be used as follows:
if o: is missing, then use b:
Some CJK fonts do not contain characters for codes in the ASCII code range.
-Also, some characters in the CJK ASCII code ranges differ in a few code points
+Also, some characters in the CJK ASCII code ranges differ in a few codepoints
from traditional ASCII characters. There are two additional fields to control
printing of characters in the ASCII code range.
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index a3226020aa..73e4205d7b 100644
--- a/runtime/doc/quickfix.txt
+++ b/runtime/doc/quickfix.txt
@@ -1,7 +1,7 @@
-*quickfix.txt* For Vim version 9.1. Last change: 2025 Oct 28
+*quickfix.txt* For Vim version 9.1. Last change: 2025 Dec 27
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
This subject is introduced in section |30.1| of the user manual.
@@ -1281,6 +1281,17 @@ For writing a compiler plugin, see |write-compiler-plugin|.
Use the |compiler-make| plugin to undo the effect of a compiler plugin.
+BIOME *compiler-biome* *quickfix-biome*
+
+Biome check lints JavaScript, TypeScript, JSX, TSX, JSON, JSONC, HTML, Vue,
+Svelte, Astro, CSS, GraphQL and GritQL files.
+
+Commonly used compiler options can be added to 'makeprg' by setting the
+b/g:biome_makeprg_params variable. For example (global default is ""): >
+
+ let b:biome_makeprg_params = "--diagnostic-level=error --staged"
+
+
CPPCHECK *quickfix-cppcheck* *compiler-cppcheck*
Use g/b:`c_cppcheck_params` to set cppcheck parameters. The global
@@ -1643,6 +1654,22 @@ b/g:mypy_makeprg_params variable. For example: >
The global default is "--strict --ignore-missing-imports".
+PYRIGHT TYPE CHECKER *compiler-pyright*
+
+Commonly used compiler options can be added to 'makeprg' by setting the
+b/g:pyright_makeprg_params variable.
+
+The global default is "pyright".
+
+TY TYPE CHECKER *compiler-ty*
+
+Commonly used compiler options and executable can be set by the
+b/g:ty_makeprg variable. For example: >
+
+ let b:ty_makeprg = "uv run ty"
+
+The global default is "ty --no-progress --color=never".
+
RUFF LINTER *compiler-ruff*
Commonly used compiler options can be added to 'makeprg' by setting the
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index 99dcc3d0e5..cccf426e50 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -1,7 +1,8 @@
-*quickref.txt* For Vim version 9.1. Last change: 2025 Aug 23
+*quickref.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
Quick reference guide
diff --git a/runtime/doc/quotes.txt b/runtime/doc/quotes.txt
index 0eeb1b6916..590aaae72d 100644
--- a/runtime/doc/quotes.txt
+++ b/runtime/doc/quotes.txt
@@ -1,7 +1,7 @@
-*quotes.txt* For Vim version 9.1. Last change: 2018 Mar 29
+*quotes.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
*quotes*
diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt
index b399b23933..3d919be498 100644
--- a/runtime/doc/recover.txt
+++ b/runtime/doc/recover.txt
@@ -1,7 +1,7 @@
-*recover.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*recover.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Recovery after a crash *crash-recovery*
diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt
index 2c10813550..f2976577d2 100644
--- a/runtime/doc/remote.txt
+++ b/runtime/doc/remote.txt
@@ -1,7 +1,7 @@
-*remote.txt* For Vim version 9.1. Last change: 2025 Aug 22
+*remote.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Vim client-server communication *client-server*
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index d1b2012ced..be31c098eb 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -1,7 +1,7 @@
-*repeat.txt* For Vim version 9.1. Last change: 2025 Oct 13
+*repeat.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Repeating commands, Vim scripts and debugging *repeating*
@@ -328,6 +328,12 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
you will need to write `filetype plugin indent on`
AFTER all `packadd!` commands.
+ To programmatically decide if `!` is needed during
+ startup, check |v:vim_did_init|: use `!` if 0 (to not
+ duplicate |load-plugins| step), no `!` otherwise (to
+ force load plugin files as otherwise they won't be
+ loaded automatically).
+
Also see |pack-add|.
{only available when compiled with |+eval|}
diff --git a/runtime/doc/rileft.txt b/runtime/doc/rileft.txt
index 8589bb6a35..108c996b36 100644
--- a/runtime/doc/rileft.txt
+++ b/runtime/doc/rileft.txt
@@ -1,7 +1,7 @@
-*rileft.txt* For Vim version 9.1. Last change: 2022 Oct 12
+*rileft.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Avner Lottem
+ VIM REFERENCE MANUAL by Avner Lottem
updated by Nadim Shaikli
diff --git a/runtime/doc/russian.txt b/runtime/doc/russian.txt
index bf6493d5e3..24b96619dd 100644
--- a/runtime/doc/russian.txt
+++ b/runtime/doc/russian.txt
@@ -1,7 +1,7 @@
-*russian.txt* For Vim version 9.1. Last change: 2006 Apr 24
+*russian.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Vassily Ragosin
+ VIM REFERENCE MANUAL by Vassily Ragosin
Russian language localization and support in Vim *russian* *Russian*
diff --git a/runtime/doc/scroll.txt b/runtime/doc/scroll.txt
index f0ec16b6f8..055f8254de 100644
--- a/runtime/doc/scroll.txt
+++ b/runtime/doc/scroll.txt
@@ -1,7 +1,7 @@
-*scroll.txt* For Vim version 9.1. Last change: 2024 Jul 06
+*scroll.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Scrolling *scrolling*
diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt
index f49f74e944..12982d7e48 100644
--- a/runtime/doc/sign.txt
+++ b/runtime/doc/sign.txt
@@ -1,7 +1,7 @@
-*sign.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*sign.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Gordon Prieur
+ VIM REFERENCE MANUAL by Gordon Prieur
and Bram Moolenaar
diff --git a/runtime/doc/sponsor.txt b/runtime/doc/sponsor.txt
index 8a35e29849..fbe67e8d03 100644
--- a/runtime/doc/sponsor.txt
+++ b/runtime/doc/sponsor.txt
@@ -1,7 +1,7 @@
-*sponsor.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*sponsor.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
@@ -28,30 +28,6 @@ If you would like to support MacVim development itself, visit:
https://github.com/sponsors/macvim-dev
-REGISTERED VIM USER *register*
-
-You can become a registered Vim user by sending at least 10 euro. This works
-similar to sponsoring Vim, see |sponsor| above. Registration was made
-possible for the situation where your boss or bookkeeper may be willing to
-register software, but does not like the terms "sponsoring" and "donation".
-
-More explanations can be found in the |register-faq|.
-
-
-VOTE FOR FEATURES *vote-for-features*
-
-Note: Voting for features has been discontinued since the passing of |Bram| in
-2023. The following two links still work, but they are no longer updated. So
-they now only provide a historic view as of summer 2023.
-
-The voting results appear on the results page, which is visible for everybody:
-http://www.vim.org/sponsor/vote_results.php
-
-Additionally, once you have sent 100 euro or more in total, your name appears
-in the "Vim hall of honour": http://www.vim.org/sponsor/hall_of_honour.php
-But only if you enable this on your account page.
-
-
HOW TO SEND MONEY *send-money*
Credit card Through PayPal, see the PayPal site for information:
@@ -64,77 +40,45 @@ Credit card Through PayPal, see the PayPal site for information:
In Euro countries a bank transfer is preferred, this has lower
costs.
-Other methods See |iccf-donations|.
+Other methods See |donate|.
Include "Vim sponsor" or "Vim registration" in the comment of
your money transfer.
QUESTIONS AND ANSWERS *sponsor-faq* *register-faq*
-Why should I give money?
+Why should I give money?~
If you do not show your appreciation for Vim, the development team will be
less motivated to fix bugs and add new features. They will do something else
instead.
-How much money should I send?
+How much money should I send?~
That is up to you. The more you give, the more children will be helped.
An indication for individuals that use Vim at home: 10 Euro per year. For
professional use: 30 Euro per year per person.
-How do I become a Vim sponsor or registered Vim user?
-
-Send money, as explained above |send-money| and include your e-mail address.
-When the money has been received you will receive a unique registration key.
-This key can be used on the Vim website to get an extra page where you can
-choose whether others will be able to see that you donated. There is a link
-to this page on your "My Account" page.
-
-
-What is the difference between sponsoring and registering?
-
-It has a different name. Use the term "registration" if your boss doesn't
-like "sponsoring" or "donation". The benefits are the same.
-
-
-How can I send money?
+How can I send money?~
See |send-money|. Check the web site for the most recent information:
http://www.vim.org/sponsor/
-Why don't you use the SourceForge donation system?
-
-SourceForge takes 5% of the donations for themselves. If you want to support
-SourceForge you can send money to them directly.
-
-
-I cannot afford to send money, may I still use Vim?
-
-Yes.
-
-
-I did not register Vim, can I use all available features?
+I cannot afford to send money, may I still use Vim?~
Yes.
-I noticed a bug, do I need to register before I can report it?
-
-No, suggestions for improving Vim can always be given. For improvements use
-the developer |maillist|, for reporting bugs see |bugs|.
-
-
-How about Charityware?
+How about Charityware?~
Currently the Vim donations go to |uganda| anyway. Thus it doesn't matter if
-you sponsor Vim or ICCF.
+you sponsor Vim or Kuwasha.
-I donated $$$, now please add feature XYZ!
+I donated $$$, now please add feature XYZ!~
There is no direct relation between your donation and the work developers do.
Otherwise you would be paying for work and we would have to pay tax over the
@@ -142,15 +86,12 @@ donation. If you want to hire one of the developers for specific work,
contact them directly, don't use the donation system.
-Are the donations tax deductible?
+Are the donations tax deductible?~
-That depends on your country. The donations to help the children in |Uganda|
-are tax deductible in Holland, Germany, Canada and in the USA. See the ICCF
-website https://iccf-holland.org/donate.html (Note: this process is currently
-undergoing some changes and will be done differently in the future).
+Possibly. Please refer to |Kuwasha| for this question.
-Can you send me a bill?
+Can you send me a bill?~
No, because there is no relation between the money you send and the work that
is done. But a receipt is possible.
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 70e4875633..784536b3a1 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -1,7 +1,7 @@
-*starting.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*starting.txt* For Vim version 9.1. Last change: 2025 Dec 20
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Starting Vim *starting*
@@ -843,6 +843,9 @@ accordingly. Vim proceeds in this order:
If Vim was started in Ex mode with the "-s" argument, all following
initializations until 4. are skipped. Only the "-u" option is
interpreted.
+
+ The |v:vim_did_init| variable is set to 1 after this step is finished.
+
*evim.vim*
a. If Vim was started as |evim| or |eview| or with the |-y| argument, the
script $VIMRUNTIME/evim.vim will be loaded.
@@ -1285,7 +1288,7 @@ CTRL-Z Suspend Vim, like ":stop".
Works in Normal and in Visual mode. In Insert and
Command-line mode, the CTRL-Z is inserted as a normal
character. In Visual mode Vim goes back to Normal
- mode.
+ mode before suspending.
Note: if CTRL-Z undoes a change see |mswin.vim|.
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index b443efe538..0a6e820c13 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt* For Vim version 9.1. Last change: 2025 Oct 14
+*syntax.txt* For Vim version 9.1. Last change: 2026 Jan 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1125,6 +1125,7 @@ new-generation language oriented to full-scenario intelligence.
All highlighting is enabled by default. To disable highlighting for a
specific group, set the corresponding variable to 0 in your |vimrc|.
All options to disable highlighting are: >
+ :let g:cangjie_builtin_color = 0
:let g:cangjie_comment_color = 0
:let g:cangjie_identifier_color = 0
:let g:cangjie_keyword_color = 0
diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt
index 590221bc36..73a9ddbc02 100644
--- a/runtime/doc/tabpage.txt
+++ b/runtime/doc/tabpage.txt
@@ -1,7 +1,7 @@
-*tabpage.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*tabpage.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Editing with windows in multiple tab pages. *tab-page* *tabpage*
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 924e2bbb88..4e2373ff8f 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -9,6 +9,7 @@ $HOME-windows options.txt /*$HOME-windows*
$MYGVIMRC gui.txt /*$MYGVIMRC*
$MYVIMDIR starting.txt /*$MYVIMDIR*
$MYVIMRC starting.txt /*$MYVIMRC*
+$NoDefaultCurrentDirectoryInExePath builtin.txt /*$NoDefaultCurrentDirectoryInExePath*
$VIM starting.txt /*$VIM*
$VIM-use version5.txt /*$VIM-use*
$VIMRUNTIME starting.txt /*$VIMRUNTIME*
@@ -384,6 +385,7 @@ $quote eval.txt /*$quote*
'go-m' options.txt /*'go-m'*
'go-p' options.txt /*'go-p'*
'go-r' options.txt /*'go-r'*
+'go-s' options.txt /*'go-s'*
'go-t' options.txt /*'go-t'*
'go-v' options.txt /*'go-v'*
'gp' options.txt /*'gp'*
@@ -457,8 +459,6 @@ $quote eval.txt /*$quote*
'infercase' options.txt /*'infercase'*
'insertmode' options.txt /*'insertmode'*
'is' options.txt /*'is'*
-'ise' options.txt /*'ise'*
-'isexpand' options.txt /*'isexpand'*
'isf' options.txt /*'isf'*
'isfname' options.txt /*'isfname'*
'isi' options.txt /*'isi'*
@@ -1431,6 +1431,7 @@ $quote eval.txt /*$quote*
+cindent various.txt /*+cindent*
+clientserver various.txt /*+clientserver*
+clipboard various.txt /*+clipboard*
++clipboard_provider various.txt /*+clipboard_provider*
+clipboard_working various.txt /*+clipboard_working*
+cmd editing.txt /*+cmd*
+cmdline_compl various.txt /*+cmdline_compl*
@@ -3879,6 +3880,7 @@ $quote eval.txt /*$quote*
motion.txt /**
map.txt /**
intro.txt /**
+ intro.txt /**
scroll.txt /**
scroll.txt /**
map.txt /**
@@ -4003,6 +4005,7 @@ $quote eval.txt /*$quote*
term.txt /**
-xterm term.txt /*-xterm*
term.txt /**
+ intro.txt /**
term.txt /**
term.txt /**
= change.txt /*=*
@@ -4721,6 +4724,7 @@ E1433 vim9.txt /*E1433*
E1434 vim9.txt /*E1434*
E1435 vim9class.txt /*E1435*
E1436 vim9class.txt /*E1436*
+E1437 eval.txt /*E1437*
E144 various.txt /*E144*
E145 starting.txt /*E145*
E146 change.txt /*E146*
@@ -4806,6 +4810,8 @@ E1567 remote.txt /*E1567*
E1568 options.txt /*E1568*
E1569 builtin.txt /*E1569*
E157 sign.txt /*E157*
+E1570 builtin.txt /*E1570*
+E1571 builtin.txt /*E1571*
E158 sign.txt /*E158*
E159 sign.txt /*E159*
E16 cmdline.txt /*E16*
@@ -5794,6 +5800,7 @@ KVim gui_x11.txt /*KVim*
KeyInputPre autocmd.txt /*KeyInputPre*
Kibaale uganda.txt /*Kibaale*
Korean mbyte.txt /*Korean*
+Kuwasha uganda.txt /*Kuwasha*
L motion.txt /*L*
Linux-backspace options.txt /*Linux-backspace*
List eval.txt /*List*
@@ -5873,7 +5880,6 @@ Neovim intro.txt /*Neovim*
NetBSD-backspace options.txt /*NetBSD-backspace*
NetBeans netbeans.txt /*NetBeans*
NetUserPass() pi_netrw.txt /*NetUserPass()*
-NoDefaultCurrentDirectoryInExePath builtin.txt /*NoDefaultCurrentDirectoryInExePath*
None eval.txt /*None*
Normal intro.txt /*Normal*
Normal-mode intro.txt /*Normal-mode*
@@ -6792,6 +6798,16 @@ clipboard-autoselectml options.txt /*clipboard-autoselectml*
clipboard-autoselectplus options.txt /*clipboard-autoselectplus*
clipboard-exclude options.txt /*clipboard-exclude*
clipboard-html options.txt /*clipboard-html*
+clipboard-providers eval.txt /*clipboard-providers*
+clipboard-providers-available eval.txt /*clipboard-providers-available*
+clipboard-providers-clipboard eval.txt /*clipboard-providers-clipboard*
+clipboard-providers-clipmethod eval.txt /*clipboard-providers-clipmethod*
+clipboard-providers-copy eval.txt /*clipboard-providers-copy*
+clipboard-providers-define eval.txt /*clipboard-providers-define*
+clipboard-providers-no-clipboard eval.txt /*clipboard-providers-no-clipboard*
+clipboard-providers-paste eval.txt /*clipboard-providers-paste*
+clipboard-providers-plus eval.txt /*clipboard-providers-plus*
+clipboard-providers-textlock eval.txt /*clipboard-providers-textlock*
clipboard-unnamed options.txt /*clipboard-unnamed*
clipboard-unnamedplus options.txt /*clipboard-unnamedplus*
clojure-indent indent.txt /*clojure-indent*
@@ -6842,6 +6858,7 @@ compile-changes-7 version7.txt /*compile-changes-7*
compile-changes-8 version8.txt /*compile-changes-8*
compile-changes-9 version9.txt /*compile-changes-9*
compile-changes-9.2 version9.txt /*compile-changes-9.2*
+compiler-biome quickfix.txt /*compiler-biome*
compiler-compaqada ft_ada.txt /*compiler-compaqada*
compiler-cppcheck quickfix.txt /*compiler-cppcheck*
compiler-decada ft_ada.txt /*compiler-decada*
@@ -6859,6 +6876,7 @@ compiler-mypy quickfix.txt /*compiler-mypy*
compiler-pandoc quickfix.txt /*compiler-pandoc*
compiler-perl quickfix.txt /*compiler-perl*
compiler-pylint quickfix.txt /*compiler-pylint*
+compiler-pyright quickfix.txt /*compiler-pyright*
compiler-pytest quickfix.txt /*compiler-pytest*
compiler-pyunit quickfix.txt /*compiler-pyunit*
compiler-ruff quickfix.txt /*compiler-ruff*
@@ -6867,6 +6885,7 @@ compiler-spotbugs quickfix.txt /*compiler-spotbugs*
compiler-tex quickfix.txt /*compiler-tex*
compiler-tombi quickfix.txt /*compiler-tombi*
compiler-tsc quickfix.txt /*compiler-tsc*
+compiler-ty quickfix.txt /*compiler-ty*
compiler-typst quickfix.txt /*compiler-typst*
compiler-vaxada ft_ada.txt /*compiler-vaxada*
compl-current insert.txt /*compl-current*
@@ -6901,7 +6920,6 @@ complete_add() builtin.txt /*complete_add()*
complete_check() builtin.txt /*complete_check()*
complete_info() builtin.txt /*complete_info()*
complete_info_mode builtin.txt /*complete_info_mode*
-complete_match() builtin.txt /*complete_match()*
completed_item-variable eval.txt /*completed_item-variable*
completion-functions usr_41.txt /*completion-functions*
complex-change change.txt /*complex-change*
@@ -6918,6 +6936,7 @@ conversion-server mbyte.txt /*conversion-server*
convert-to-HTML syntax.txt /*convert-to-HTML*
convert-to-XHTML syntax.txt /*convert-to-XHTML*
convert-to-XML syntax.txt /*convert-to-XML*
+convert_:function_to_:def vim9.txt /*convert_:function_to_:def*
convert_legacy_function_to_vim9 vim9.txt /*convert_legacy_function_to_vim9*
copy() builtin.txt /*copy()*
copy-diffs diff.txt /*copy-diffs*
@@ -8340,6 +8359,7 @@ gui-vert-scroll gui.txt /*gui-vert-scroll*
gui-w32 gui_w32.txt /*gui-w32*
gui-w32-cmdargs gui_w32.txt /*gui-w32-cmdargs*
gui-w32-dialogs gui_w32.txt /*gui-w32-dialogs*
+gui-w32-fullscreen gui_w32.txt /*gui-w32-fullscreen*
gui-w32-printing gui_w32.txt /*gui-w32-printing*
gui-w32-start gui_w32.txt /*gui-w32-start*
gui-w32-title-bar gui_w32.txt /*gui-w32-title-bar*
@@ -8417,7 +8437,6 @@ help helphelp.txt /*help*
help-TOC helphelp.txt /*help-TOC*
help-buffer-options helphelp.txt /*help-buffer-options*
help-context help.txt /*help-context*
-help-curwin tips.txt /*help-curwin*
help-notation helphelp.txt /*help-notation*
help-summary usr_02.txt /*help-summary*
help-tags tags 1
@@ -8708,7 +8727,6 @@ i` motion.txt /*i`*
ia64.vim syntax.txt /*ia64.vim*
ib motion.txt /*ib*
iccf uganda.txt /*iccf*
-iccf-donations uganda.txt /*iccf-donations*
icon-changed version4.txt /*icon-changed*
iconise starting.txt /*iconise*
iconize starting.txt /*iconize*
@@ -8806,6 +8824,7 @@ instanceof() builtin.txt /*instanceof()*
intel-itanium syntax.txt /*intel-itanium*
intellimouse-wheel-problems gui_w32.txt /*intellimouse-wheel-problems*
interactive-functions usr_41.txt /*interactive-functions*
+interface vim9class.txt /*interface*
interfaces-5.2 version5.txt /*interfaces-5.2*
internal-error message.txt /*internal-error*
internal-variables eval.txt /*internal-variables*
@@ -9774,6 +9793,7 @@ os_risc.txt os_risc.txt /*os_risc.txt*
os_unix.txt os_unix.txt /*os_unix.txt*
os_vms.txt os_vms.txt /*os_vms.txt*
os_win32.txt os_win32.txt /*os_win32.txt*
+osc52-install usr_05.txt /*osc52-install*
other-features vi_diff.txt /*other-features*
out_buf channel.txt /*out_buf*
out_cb channel.txt /*out_cb*
@@ -9791,12 +9811,14 @@ package-create repeat.txt /*package-create*
package-doc repeat.txt /*package-doc*
package-documentation repeat.txt /*package-documentation*
package-editorconfig usr_05.txt /*package-editorconfig*
+package-helpcurwin tips.txt /*package-helpcurwin*
package-helptoc helphelp.txt /*package-helptoc*
package-hlyank usr_05.txt /*package-hlyank*
package-justify usr_25.txt /*package-justify*
package-matchit usr_05.txt /*package-matchit*
package-nohlsearch usr_05.txt /*package-nohlsearch*
package-open eval.txt /*package-open*
+package-osc52 usr_05.txt /*package-osc52*
package-termdebug terminal.txt /*package-termdebug*
package-translate_example repeat.txt /*package-translate_example*
package-translation repeat.txt /*package-translation*
@@ -10101,6 +10123,7 @@ quake.vim syntax.txt /*quake.vim*
quickfix quickfix.txt /*quickfix*
quickfix-6 version6.txt /*quickfix-6*
quickfix-ID quickfix.txt /*quickfix-ID*
+quickfix-biome quickfix.txt /*quickfix-biome*
quickfix-buffer quickfix.txt /*quickfix-buffer*
quickfix-changedtick quickfix.txt /*quickfix-changedtick*
quickfix-context quickfix.txt /*quickfix-context*
@@ -10186,6 +10209,8 @@ recovery recover.txt /*recovery*
recursive_mapping map.txt /*recursive_mapping*
redo undo.txt /*redo*
redo-register undo.txt /*redo-register*
+redraw_listener_add() builtin.txt /*redraw_listener_add()*
+redraw_listener_remove() builtin.txt /*redraw_listener_remove()*
reduce() builtin.txt /*reduce()*
ref intro.txt /*ref*
reference intro.txt /*reference*
@@ -10194,7 +10219,6 @@ reg_executing() builtin.txt /*reg_executing()*
reg_recording() builtin.txt /*reg_recording()*
regexp pattern.txt /*regexp*
regexp-changes-5.4 version5.txt /*regexp-changes-5.4*
-register sponsor.txt /*register*
register-faq sponsor.txt /*register-faq*
register-functions usr_41.txt /*register-functions*
register-variable eval.txt /*register-variable*
@@ -11124,6 +11148,7 @@ termcap-cursor-shape term.txt /*termcap-cursor-shape*
termcap-options term.txt /*termcap-options*
termcap-title term.txt /*termcap-title*
termda1-variable eval.txt /*termda1-variable*
+termdebug terminal.txt /*termdebug*
termdebug-commands terminal.txt /*termdebug-commands*
termdebug-communication terminal.txt /*termdebug-communication*
termdebug-customizing terminal.txt /*termdebug-customizing*
@@ -11428,6 +11453,7 @@ v:char eval.txt /*v:char*
v:charconvert_from eval.txt /*v:charconvert_from*
v:charconvert_to eval.txt /*v:charconvert_to*
v:clipmethod eval.txt /*v:clipmethod*
+v:clipproviders eval.txt /*v:clipproviders*
v:cmdarg eval.txt /*v:cmdarg*
v:cmdbang eval.txt /*v:cmdbang*
v:collate eval.txt /*v:collate*
@@ -11533,6 +11559,7 @@ v:var eval.txt /*v:var*
v:version eval.txt /*v:version*
v:versionlong eval.txt /*v:versionlong*
v:vim_did_enter eval.txt /*v:vim_did_enter*
+v:vim_did_init eval.txt /*v:vim_did_init*
v:warningmsg eval.txt /*v:warningmsg*
v:wayland_display eval.txt /*v:wayland_display*
v:windowid eval.txt /*v:windowid*
@@ -11768,6 +11795,7 @@ vim9-access-modes vim9class.txt /*vim9-access-modes*
vim9-autoload vim9.txt /*vim9-autoload*
vim9-boolean vim9.txt /*vim9-boolean*
vim9-class vim9class.txt /*vim9-class*
+vim9-class-type vim9.txt /*vim9-class-type*
vim9-classes vim9.txt /*vim9-classes*
vim9-const vim9.txt /*vim9-const*
vim9-curly vim9.txt /*vim9-curly*
@@ -11775,14 +11803,18 @@ vim9-debug repeat.txt /*vim9-debug*
vim9-declaration vim9.txt /*vim9-declaration*
vim9-declarations usr_41.txt /*vim9-declarations*
vim9-differences vim9.txt /*vim9-differences*
+vim9-enum-type vim9.txt /*vim9-enum-type*
+vim9-enumvalue-type vim9.txt /*vim9-enumvalue-type*
vim9-export vim9.txt /*vim9-export*
vim9-false-true vim9.txt /*vim9-false-true*
vim9-final vim9.txt /*vim9-final*
vim9-func-declaration vim9.txt /*vim9-func-declaration*
+vim9-func-type vim9.txt /*vim9-func-type*
vim9-function-defined-later vim9.txt /*vim9-function-defined-later*
vim9-gotchas vim9.txt /*vim9-gotchas*
vim9-ignored-argument vim9.txt /*vim9-ignored-argument*
vim9-import vim9.txt /*vim9-import*
+vim9-interface-type vim9.txt /*vim9-interface-type*
vim9-lambda vim9.txt /*vim9-lambda*
vim9-lambda-arguments vim9.txt /*vim9-lambda-arguments*
vim9-line-continuation vim9.txt /*vim9-line-continuation*
@@ -11791,15 +11823,19 @@ vim9-mix vim9.txt /*vim9-mix*
vim9-namespace vim9.txt /*vim9-namespace*
vim9-no-dict-function vim9.txt /*vim9-no-dict-function*
vim9-no-shorten vim9.txt /*vim9-no-shorten*
+vim9-object-type vim9.txt /*vim9-object-type*
+vim9-partial-declaration vim9.txt /*vim9-partial-declaration*
vim9-rationale vim9.txt /*vim9-rationale*
vim9-reload vim9.txt /*vim9-reload*
vim9-s-namespace vim9.txt /*vim9-s-namespace*
vim9-scopes vim9.txt /*vim9-scopes*
vim9-string-index vim9.txt /*vim9-string-index*
+vim9-typealias-type vim9.txt /*vim9-typealias-type*
vim9-types vim9.txt /*vim9-types*
vim9-unpack-ignore vim9.txt /*vim9-unpack-ignore*
vim9-user-command vim9.txt /*vim9-user-command*
vim9-variable-arguments vim9.txt /*vim9-variable-arguments*
+vim9-white-space vim9.txt /*vim9-white-space*
vim9.txt vim9.txt /*vim9.txt*
vim9class.txt vim9class.txt /*vim9class.txt*
vim9script vim9.txt /*vim9script*
@@ -11807,6 +11843,7 @@ vim: options.txt /*vim:*
vim_announce intro.txt /*vim_announce*
vim_dev intro.txt /*vim_dev*
vim_did_enter-variable eval.txt /*vim_did_enter-variable*
+vim_did_init-variable eval.txt /*vim_did_init-variable*
vim_mac intro.txt /*vim_mac*
vim_mac_group gui_mac.txt /*vim_mac_group*
vim_starting builtin.txt /*vim_starting*
@@ -11879,7 +11916,6 @@ vms-notes os_vms.txt /*vms-notes*
vms-problems os_vms.txt /*vms-problems*
vms-started os_vms.txt /*vms-started*
vms-usage os_vms.txt /*vms-usage*
-vote-for-features sponsor.txt /*vote-for-features*
votes-for-changes todo.txt /*votes-for-changes*
vreplace-mode insert.txt /*vreplace-mode*
vt100-cursor-keys term.txt /*vt100-cursor-keys*
diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt
index dcd6f05c3e..17f7234639 100644
--- a/runtime/doc/tagsrch.txt
+++ b/runtime/doc/tagsrch.txt
@@ -1,7 +1,7 @@
-*tagsrch.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*tagsrch.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Tags and special searches *tags-and-searches*
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt
index 53a6fc0c9b..505b06a103 100644
--- a/runtime/doc/term.txt
+++ b/runtime/doc/term.txt
@@ -1,7 +1,7 @@
-*term.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*term.txt* For Vim version 9.1. Last change: 2025 Nov 11
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Terminal information *terminal-info*
@@ -1167,7 +1167,8 @@ 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 MacVim, Win32, and X11 environments.
+Currently, X1 and X2 work only on MacVim, Win32 and X11 environments, and in
+terminals that support xterm-like mouse functionality.
Examples: >
:noremap
diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt
index f7fe330167..8b7df8e406 100644
--- a/runtime/doc/terminal.txt
+++ b/runtime/doc/terminal.txt
@@ -1,4 +1,4 @@
-*terminal.txt* For Vim version 9.1. Last change: 2025 Oct 14
+*terminal.txt* For Vim version 9.1. Last change: 2026 Jan 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1263,7 +1263,7 @@ Alternatively, press "s" to swap the first and second dump. Do this several
times so that you can spot the difference in the context of the text.
==============================================================================
-6. Debugging *terminal-debug* *terminal-debugger* *package-termdebug*
+6. Debugging *terminal-debug* *terminal-debugger* *package-termdebug* *termdebug*
The Terminal debugging plugin can be used to debug a program with gdb and view
the source code in a Vim window. Since this is completely contained inside
@@ -1877,7 +1877,7 @@ Contributions for termdebug improvements are welcome.
However, it is fairly common that during the development process you need some
mechanisms like `echo` statements (or similar) to help you in your job.
For this reason, you can set: >
- let g:termdebug_config['debug'] = true
+ let g:termdebug_config['debug'] = v:true
<
This sets the `DEBUG` variable to `true`, which can be referenced in the
source code. An example of its usage follows: >
diff --git a/runtime/doc/textprop.txt b/runtime/doc/textprop.txt
index fbef22842b..87374d6233 100644
--- a/runtime/doc/textprop.txt
+++ b/runtime/doc/textprop.txt
@@ -1,7 +1,7 @@
-*textprop.txt* For Vim version 9.1. Last change: 2025 Oct 14
+*textprop.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Displaying text with properties attached. *textprop* *text-properties*
diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt
index c362bea164..8a0da14375 100644
--- a/runtime/doc/tips.txt
+++ b/runtime/doc/tips.txt
@@ -1,7 +1,7 @@
-*tips.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*tips.txt* For Vim version 9.1. Last change: 2025 Dec 02
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Tips and ideas for using Vim *tips*
@@ -30,7 +30,7 @@ Executing shell commands in a window |shell-window|
Hex editing |hex-editing|
Using <> notation in autocommands |autocmd-<>|
Highlighting matching parens |match-parens|
-Opening help in the current window |help-curwin|
+Opening help in the current window |package-helpcurwin|
==============================================================================
Editing C programs *C-editing*
@@ -544,28 +544,22 @@ A slightly more advanced version is used in the |matchparen| plugin.
<
==============================================================================
-Opening help in the current window *help-curwin*
+Opening help in the current window *package-helpcurwin*
-By default, help is displayed in a split window. If you prefer it opens in
-the current window, try this custom `:HelpCurwin` command:
->
- command -bar -nargs=? -complete=help HelpCurwin execute s:HelpCurwin()
- let s:did_open_help = v:false
-
- function s:HelpCurwin(subject) abort
- let mods = 'silent noautocmd keepalt'
- if !s:did_open_help
- execute mods .. ' help'
- execute mods .. ' helpclose'
- let s:did_open_help = v:true
- endif
- if !getcompletion(a:subject, 'help')->empty()
- execute mods .. ' edit ' .. &helpfile
- set buftype=help
- endif
- return 'help ' .. a:subject
- endfunction
-<
+By default, help is displayed in a split window. In some scenarios, you may
+prefer to open the help in the current window. The optional helpcurwin
+package makes this possible. Load the package manually, or in your |vimrc|,
+with: >vim
+ packadd helpcurwin
+<
+After it has loaded:
+- The command `:HelpCurwin` {subject} can be used to open help in the current
+ window.
+- If the current window contains a modified buffer, the plugin asks for
+ confirmation before replacing it. If confirmed, the buffer becomes
+ hidden |hidden-buffer|.
+- The help file, |helpcurwin.txt|, will be available and describes the plugin
+ in more details.
vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index cdafaf05e9..14efc5731b 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 9.1. Last change: 2025 Sep 02
+*todo.txt* For Vim version 9.1. Last change: 2025 Dec 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -205,11 +205,8 @@ Popup windows:
positioned? PopupNew? Could be used to set some options or move it out of
the way. (#5737)
However, it may also cause trouble, changing the popup of another plugin.
-- Should popup_getoptions() also return the mask? #7774
- Add a way to use popup_menu() synchronously: instead of invoking the
callback, return the choice. (Ben Jackson, #6534)
-- When using a popup for the info of a completion menu, and there is not
- enough space, let the popup overlap with the menu. (#4544)
- Implement flip option.
- Make redrawing more efficient and avoid flicker:
- put popup menu also in popup_mask?
@@ -309,8 +306,6 @@ Problem with Visual highlight when 'linebreak' and 'showbreak' are set.
GUI Scroll test fails on FreeBSD when using Motif. See FIXME in
Test_scrollbars in src/test_gui.vim
-Support dark mode for MS-Windows: #12282
-
Remote command escapes single quote with backslash, should be doubling the
single quote in vim_strsave_escaped_ext() #12202.
@@ -370,9 +365,6 @@ Can we not request XT key sequences, or reduce them drastically?
Issue #10512: Dynamic loading broken with Perl 5.36
Damien has a patch (2022 Dec 4)
-Request #11965: Allow several "%=" items in 'statusline', makes it possible
-to have text in the center.
-
Add some kind of ":whathappend" command and functions to make visible what the
last few typed keys and executed commands are. To be used when the user
wonders what went wrong. Could also be used for statistics #12046.
@@ -382,10 +374,6 @@ wonders what went wrong. Could also be used for statistics #12046.
- executed command lines
- with more verbosity: what scripts/functions/autocommands were executed
-NFA regexp does not handle composing characters well: #10286
- [ɔ̃] matches both ɔ and ɔ̃
- \(ɔ\|ɔ̃\) matches ɔ and not ɔ̃
-
Is there a way to make 'autowriteall' make a clean exit when the xterm is
closed? (Dennis Nazic says files are preserved, okt 28). Perhaps handle TERM
like HUP?
@@ -419,8 +407,6 @@ In a timer callback, when using ":echo" and then input() the message is
overwritten. Could use ":echowin" and call redraw_cmd() in get_user_input().
#11299
-Syntax include problem: #11277. Related to Patch 8.2.2761
-
To avoid flicker: add an option that when a screen clear is requested, instead
of clearing it draws everything and uses "clear to end of line" for every line.
Resetting 't_ut' already causes this?
@@ -519,8 +505,6 @@ there is a match do not scan the directory (possibly speeds up :find a lot).
globpath() does not use 'wildignorecase' at all? (related to #8350)
-mksession uses :buffer instead of :edit in one place but not another. #10629
-
Add 'termguiattr' option, use "gui=" attributes in the terminal? Would work
with 'termguicolors'. #1740
@@ -538,9 +522,6 @@ when redirecting to a local variable (function or script) storing the value
won't work. At least give an error. Is there a way to make it work?
#10616
-Completion for ":runtime" should show valid values, not what's in the current
-directory. (#11447)
-
Add a "description" property to mappings. #12205
Add an option to start_timer() to return from the input loop with K_IGNORE.
@@ -5786,7 +5767,6 @@ Argument list:
Registers:
-8 Don't display empty registers with ":display". (Etienne)
8 Add put command that overwrites existing text. Should also work for
blocks. Useful to move text around in a table. Works like using "R ^R r"
for every line.
diff --git a/runtime/doc/uganda.txt b/runtime/doc/uganda.txt
index 1abc2bd3ea..a8c7fffc1a 100644
--- a/runtime/doc/uganda.txt
+++ b/runtime/doc/uganda.txt
@@ -1,23 +1,35 @@
-*uganda.txt* For Vim version 9.1. Last change: 2025 Aug 10
+*uganda.txt* For Vim version 9.1. Last change: 2026 Jan 07
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
*uganda* *Uganda* *copying* *copyright* *license*
SUMMARY
- *iccf* *ICCF*
+ *Kuwasha*
Vim is Charityware. You can use and copy it as much as you like, but you are
encouraged to make a donation for needy children in Uganda. Please see |kcc|
-below or visit the ICCF web site, available at these URLs:
+below or visit the Kuwasha web site, available at the following URL:
- https://iccf-holland.org/
- https://www.vim.org/iccf/
- https://www.iccf.nl/
+ https://www.kuwasha.net
You can also sponsor the development of Vim, see |sponsor|. The money goes to
Uganda anyway.
+ *iccf* *ICCF*
+ICCF Holland and Kuwasha~
+
+|Bram| Moolenaar's charity, ICCF Holland, has long supported the education of
+children in Uganda through the Kibaale Children's Centre. Following Bram's
+passing in 2023, ICCF Holland transferred all activities to its sister charity
+Kuwasha in Canada and dissolved at the end of 2025.
+
+Donations from Vim users are still welcome and will continue to go directly to
+Uganda. To continue supporting this cause, please send contributions to
+Kuwasha.
+
+License~
+
The Open Publication License applies to the Vim documentation, see
|manual-copyright|.
@@ -53,12 +65,14 @@ II) It is allowed to distribute a modified (or extended) version of Vim,
maintainer will do with your changes and under what license they
will be distributed is negotiable. If there has been no negotiation
then this license, or a later version, also applies to your changes.
- The current maintainers are listed here: https://github.com/orgs/vim/people.
- If this changes it will be announced in appropriate places (most likely
- vim.sf.net, www.vim.org and/or comp.editors). When it is completely
- impossible to contact the maintainer, the obligation to send him
- your changes ceases. Once the maintainer has confirmed that he has
- received your changes they will not have to be sent again.
+ The current maintainers are listed here:
+ https://github.com/orgs/vim/people
+ If this changes it will be announced in appropriate places (most
+ likely vim.sf.net, www.vim.org and/or comp.editors). When it is
+ completely impossible to contact the maintainer, the obligation to
+ send him your changes ceases. Once the maintainer has confirmed
+ that he has received your changes they will not have to be sent
+ again.
b) If you have received a modified Vim that was distributed as
mentioned under a) you are allowed to further distribute it
unmodified, as mentioned at I). If you make additional changes the
@@ -185,84 +199,43 @@ medical help. Since 2020 a maternity ward was added and 24/7 service is
available. When needed, transport to a hospital is offered. Immunization
programs are carried out and help is provided when an epidemic is breaking out
(measles and cholera have been a problem).
- *donate*
-Summer 1994 to summer 1995 I spent a whole year at the centre, working as a
-volunteer. I have helped to expand the centre and worked in the area of water
-and sanitation. I learned that the help that the KCC provides really helps.
-When I came back to Holland, I wanted to continue supporting KCC. To do this
-I'm raising funds and organizing the sponsorship program. Please consider one
-of these possibilities:
-
-1. Sponsor a child in primary school: 17 euro a month (or more).
-2. Sponsor a child in secondary school: 25 euro a month (or more).
-3. Sponsor the clinic: Any amount a month or quarter
-4. A one-time donation
-
-Compared with other organizations that do child sponsorship the amounts are
-very low. This is because the money goes directly to the centre. Less than
-5% is used for administration. This is possible because this is a small
-organization that works with volunteers. If you would like to sponsor a
-child, you should have the intention to do this for at least one year.
-
-How do you know that the money will be spent right? First of all you have my
-personal guarantee as the author of Vim. I trust the people that are working
-at the centre, I know them personally. Furthermore, the centre has been
+
+Summer 1994 to summer 1995 Bram spent a whole year at the centre, working as a
+volunteer. Bram helped to expand the centre and worked in the area of water
+and sanitation. Bram learned that the help that the KCC provides really
+helps. When Bram came back to Holland, he wanted to continue supporting KCC.
+To do this he has been raising funds and organizing the sponsorship program.
+
+How do you know that the money will be spent right? First of all you have the
+personal guarantee of Bram as the author of Vim, who knew the people working
+at the centre personally. Furthermore, the centre has been
co-sponsored and inspected by World Vision, Save the Children Fund and is now
-under the supervision of Pacific Academy Outreach Society. The centre is
-visited about once a year to check the progress (at our own cost). I have
-visited the centre myself many times, starting in 1993. The visit reports are
-on the ICCF web site.
+under the supervision of Pacific Academy Outreach Society. Bram has
+visited the centre many times, starting in 1993. The visit reports are
+have been shared on the ICCF web site (may no longer be available).
-If you have any further questions, send e-mail: .
+If you have any further questions, send an e-mail: info@kuwasha.net.
The address of the centre is:
Kibaale Children's Centre
p.o. box 1658
Masaka, Uganda, East Africa
-Sending money: *iccf-donations*
-
-Check the ICCF web site for the latest information! See |iccf| for the URL.
-
+ *donate*
+Sending money:
-USA: The methods mentioned below can be used.
- If you must send a check send it to our Canadian partner:
- https://www.kuwasha.net/
+Check the Kuwasha web site for the latest information!
-Canada: Contact Kuwasha in Surrey, Canada. They take care of the
- Canadian sponsors for the children in Kibaale. Kuwasha
- forwards 100% of the money to the project in Uganda. You can
- send them a one time donation directly.
Look on their site for information about sponsorship:
- https://www.kuwasha.net/
+ https://www.kuwasha.net/
If you make a donation to Kuwasha you will receive a tax
receipt which can be submitted with your tax return.
-Holland: Transfer to the account of "Stichting ICCF Holland" in
- Amersfoort. This will allow for tax deduction if you live in
- Holland. ING bank, IBAN: NL95 INGB 0004 5487 74
-
-Germany: It is possible to make donations that allow for a tax return.
- Check the ICCF web site for the latest information:
- https://iccf-holland.org/germany.html
-
-Europe: Use a bank transfer if possible. See "Others" below for the
- swift code and IBAN number.
- Any other method should work. Ask for information about
- sponsorship.
-
Credit Card: You can use PayPal to send money with a Credit card. This is
the most widely used Internet based payment system. It's
really simple to use. Use this link to find more info:
https://www.paypal.com/en_US/mrb/pal=XAC62PML3GF8Q
The e-mail address for sending the money to is:
- Bram@iccf-holland.org
-
-Others: Transfer to this account if possible:
- ING bank: IBAN: NL95 INGB 0004 5487 74
- Swift code: INGBNL2A
- under the name "stichting ICCF Holland", Amersfoort
- Checks are not accepted.
-
+ info@kuwasha.net
vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt
index e8a0417eed..2726013460 100644
--- a/runtime/doc/undo.txt
+++ b/runtime/doc/undo.txt
@@ -1,4 +1,4 @@
-*undo.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*undo.txt* For Vim version 9.1. Last change: 2025 Nov 09
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/userfunc.txt b/runtime/doc/userfunc.txt
index aa8ed9ec8c..6ecfd26538 100644
--- a/runtime/doc/userfunc.txt
+++ b/runtime/doc/userfunc.txt
@@ -1,4 +1,4 @@
-*userfunc.txt* For Vim version 9.1. Last change: 2025 Oct 28
+*userfunc.txt* For Vim version 9.1. Last change: 2025 Dec 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -80,11 +80,11 @@ See |:verbose-cmd| for more information.
matching |:endfunction|.
*E1267*
The name must be made of alphanumeric characters and
- '_', and must start with a capital or "s:" (see
- above). Note that using "b:" or "g:" is not allowed.
- (since patch 7.4.260 E884 is given if the function
- name has a colon in the name, e.g. for "foo:bar()".
- Before that patch no error was given).
+ '_' and must start with a capital or "s:" (see above).
+ Note that using "b:", "l:", etc. is not allowed (since
+ patch 7.4.260 E884 is given if the function name has a
+ colon, e.g. for "foo:bar()"), while a leading "g:" is
+ skipped and still requires a following capital letter.
{name} can also be a |Dictionary| entry that is a
|Funcref|: >
diff --git a/runtime/doc/usr_01.txt b/runtime/doc/usr_01.txt
index 704c1d4774..3911eba3ca 100644
--- a/runtime/doc/usr_01.txt
+++ b/runtime/doc/usr_01.txt
@@ -1,7 +1,7 @@
-*usr_01.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_01.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
About the manuals
@@ -194,7 +194,7 @@ manual. Not only by providing literal text, but also by setting the tone and
style.
If you make money through selling the manuals, you are strongly encouraged to
-donate part of the profit to help AIDS victims in Uganda. See |iccf|.
+donate part of the profit to help AIDS victims in Uganda. See |Kuwasha|.
==============================================================================
diff --git a/runtime/doc/usr_02.txt b/runtime/doc/usr_02.txt
index 6bb860fbed..b3cdabc9f8 100644
--- a/runtime/doc/usr_02.txt
+++ b/runtime/doc/usr_02.txt
@@ -1,7 +1,7 @@
-*usr_02.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_02.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
The first steps in Vim
@@ -522,8 +522,8 @@ Summary: *help-summary* >
< You can see the user guide topics |03.9| and |usr_27.txt| in the
introduction.
-3) Options are enclosed in single apostrophes. To go to the help topic for the
- list option: >
+3) Options are enclosed in single apostrophes. To go to the help topic for
+ the list option: >
:help 'list'
< If you only know you are looking for a certain option, you can also do: >
:help options.txt
diff --git a/runtime/doc/usr_03.txt b/runtime/doc/usr_03.txt
index c5b5fe95e6..2155e3de4f 100644
--- a/runtime/doc/usr_03.txt
+++ b/runtime/doc/usr_03.txt
@@ -1,7 +1,7 @@
-*usr_03.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_03.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Moving around
diff --git a/runtime/doc/usr_04.txt b/runtime/doc/usr_04.txt
index 60fb09a215..6010979763 100644
--- a/runtime/doc/usr_04.txt
+++ b/runtime/doc/usr_04.txt
@@ -1,7 +1,7 @@
-*usr_04.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_04.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Making small changes
diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt
index 1be470e132..c528c09a85 100644
--- a/runtime/doc/usr_05.txt
+++ b/runtime/doc/usr_05.txt
@@ -1,7 +1,7 @@
-*usr_05.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_05.txt* For Vim version 9.1. Last change: 2025 Dec 15
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Set your settings
@@ -338,8 +338,8 @@ This only works in a Vim script file, not when typing commands at the
command line.
>
- command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
- \ | wincmd p | diffthis
+ command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_
+ \ | diffthis | wincmd p | diffthis
This adds the ":DiffOrig" command. Use this in a modified buffer to see the
differences with the file it was loaded from. See |diff| and |:DiffOrig|.
@@ -399,13 +399,17 @@ The ":map" command (with no arguments) lists your current mappings. At
least the ones for Normal mode. More about mappings in section |40.1|.
==============================================================================
-*05.5* Adding a package *add-package* *matchit-install* *package-matchit*
+*05.5* Adding a package *add-package*
A package is a set of files that you can add to Vim. There are two kinds of
packages: optional and automatically loaded on startup.
The Vim distribution comes with a few packages that you can optionally use.
-For example, the matchit plugin. This plugin makes the "%" command jump to
+
+------------------------------------------------------------------------------
+Adding the matchit package *matchit-install* *package-matchit*
+------------------------------------------------------------------------------
+For example, the matchit package This plugin makes the "%" command jump to
matching HTML tags, if/else/endif in Vim scripts, etc. Very useful, although
it's not backwards compatible (that's why it is not enabled by default).
@@ -434,7 +438,9 @@ an archive or as a repository. For an archive you can follow these steps:
Here "fancytext" is the name of the package, it can be anything
else.
+------------------------------------------------------------------------------
Adding the editorconfig package *editorconfig-install* *package-editorconfig*
+------------------------------------------------------------------------------
Similar to the matchit package, to load the distributed editorconfig plugin
when Vim starts, add the following line to your vimrc file: >
@@ -444,7 +450,9 @@ After restarting your Vim, the plugin is active and you can read about it at: >
:h editorconfig.txt
+------------------------------------------------------------------------------
Adding the comment package *comment-install* *package-comment*
+------------------------------------------------------------------------------
Load the plugin with this command: >
packadd comment
@@ -457,7 +465,9 @@ the package loaded. Once the package is loaded, read about it at: >
:h comment.txt
+------------------------------------------------------------------------------
Adding the nohlsearch package *nohlsearch-install* *package-nohlsearch*
+------------------------------------------------------------------------------
Load the plugin with this command: >
packadd nohlsearch
@@ -471,7 +481,9 @@ 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
@@ -497,6 +509,20 @@ To highlight in visual mode, use: >
To disable the effect of the plugin after it has been loaded: >
au! hlyank
+------------------------------------------------------------------------------
+Adding the osc52 package *osc52-install* *package-osc52*
+------------------------------------------------------------------------------
+
+Load the plugin with this command: >
+ packadd osc52
+<
+The osc52.vim package provides support for the OSC 52 terminal command, which
+allows an application to access the clipboard by communicating directly with
+your terminal.
+
+Once the package is loaded, read about it at: >
+ :h osc52.txt
+
More information about packages can be found here: |packages|.
==============================================================================
@@ -539,7 +565,8 @@ when you use Vim. There are only two steps for adding a global plugin:
GETTING A GLOBAL PLUGIN
Where can you find plugins?
-- Some are always loaded, you can see them in the directory $VIMRUNTIME/plugin.
+- Some are always loaded, you can see them in the directory
+ $VIMRUNTIME/plugin.
- Some come with Vim. You can find them in the directory $VIMRUNTIME/macros
and its sub-directories and under $VIM/vimfiles/pack/dist/opt/.
- Download from the net. There is a large collection on http://www.vim.org.
diff --git a/runtime/doc/usr_06.txt b/runtime/doc/usr_06.txt
index d84444db3f..2d20897f8f 100644
--- a/runtime/doc/usr_06.txt
+++ b/runtime/doc/usr_06.txt
@@ -1,7 +1,7 @@
-*usr_06.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_06.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Using syntax highlighting
diff --git a/runtime/doc/usr_07.txt b/runtime/doc/usr_07.txt
index 2ac30ec26b..d02a4a2f61 100644
--- a/runtime/doc/usr_07.txt
+++ b/runtime/doc/usr_07.txt
@@ -1,7 +1,7 @@
-*usr_07.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_07.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Editing more than one file
diff --git a/runtime/doc/usr_08.txt b/runtime/doc/usr_08.txt
index 1237c363fa..38eb6ec14a 100644
--- a/runtime/doc/usr_08.txt
+++ b/runtime/doc/usr_08.txt
@@ -1,7 +1,7 @@
-*usr_08.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_08.txt* For Vim version 9.1. Last change: 2025 Nov 26
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Splitting windows
@@ -444,7 +444,8 @@ To go the other way use: >
[c
-Prepended a count to jump further away.
+Prepend a count to jump further away. Thus "4]c" jumps to the fourth next
+change, and "3[c" jumps to the third previous change.
REMOVING CHANGES
diff --git a/runtime/doc/usr_09.txt b/runtime/doc/usr_09.txt
index 666dbd4e98..556d81c1a4 100644
--- a/runtime/doc/usr_09.txt
+++ b/runtime/doc/usr_09.txt
@@ -1,7 +1,7 @@
-*usr_09.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_09.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Using the GUI
@@ -132,8 +132,8 @@ select text in a standard manner. The X Window system also has a standard
system for using the mouse. Unfortunately, these two standards are not the
same.
Fortunately, you can customize Vim. You can make the behavior of the mouse
-work like an X Window system mouse or a Microsoft Windows mouse. The following
-command makes the mouse behave like an X Window mouse: >
+work like an X Window system mouse or a Microsoft Windows mouse. The
+following command makes the mouse behave like an X Window mouse: >
:behave xterm
diff --git a/runtime/doc/usr_10.txt b/runtime/doc/usr_10.txt
index ebf4bab40f..d943c97390 100644
--- a/runtime/doc/usr_10.txt
+++ b/runtime/doc/usr_10.txt
@@ -1,7 +1,7 @@
-*usr_10.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_10.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Making big changes
@@ -296,8 +296,8 @@ five lines before the last line in the file.
USING MARKS
-Instead of figuring out the line numbers of certain positions, remembering them
-and typing them in a range, you can use marks.
+Instead of figuring out the line numbers of certain positions, remembering
+them and typing them in a range, you can use marks.
Place the marks as mentioned in chapter 3. For example, use "mt" to mark
the top of an area and "mb" to mark the bottom. Then you can use this range
to specify the lines between the marks (including the lines with the marks): >
@@ -736,9 +736,10 @@ of the program replaces these lines.
line 44 line 55
last line last line
-The "!!" command filters the current line through a filter. In Unix the "date"
-command prints the current time and date. "!!date" replaces the current
-line with the output of "date". This is useful to add a timestamp to a file.
+The "!!" command filters the current line through a filter. In Unix the
+"date" command prints the current time and date. "!!date" replaces the
+current line with the output of "date". This is useful to add a timestamp to
+a file.
Note: There is a difference between "!cmd" (e.g. using it without any file
range) and "{range}!cmd". While the former will simply execute the external
diff --git a/runtime/doc/usr_11.txt b/runtime/doc/usr_11.txt
index f33daf6821..c6081ad60d 100644
--- a/runtime/doc/usr_11.txt
+++ b/runtime/doc/usr_11.txt
@@ -1,7 +1,7 @@
-*usr_11.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_11.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Recovering from a crash
diff --git a/runtime/doc/usr_12.txt b/runtime/doc/usr_12.txt
index 4ca4a8c245..5aa688b8d8 100644
--- a/runtime/doc/usr_12.txt
+++ b/runtime/doc/usr_12.txt
@@ -1,7 +1,7 @@
-*usr_12.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_12.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Clever tricks
diff --git a/runtime/doc/usr_20.txt b/runtime/doc/usr_20.txt
index 7bd2faa3f6..8e999fc814 100644
--- a/runtime/doc/usr_20.txt
+++ b/runtime/doc/usr_20.txt
@@ -1,7 +1,7 @@
-*usr_20.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_20.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Typing command-line commands quickly
diff --git a/runtime/doc/usr_21.txt b/runtime/doc/usr_21.txt
index 8621887a49..7e5d361542 100644
--- a/runtime/doc/usr_21.txt
+++ b/runtime/doc/usr_21.txt
@@ -1,7 +1,7 @@
-*usr_21.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_21.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Go away and come back
diff --git a/runtime/doc/usr_22.txt b/runtime/doc/usr_22.txt
index d03cb53fe2..cb5700ac6a 100644
--- a/runtime/doc/usr_22.txt
+++ b/runtime/doc/usr_22.txt
@@ -1,7 +1,7 @@
-*usr_22.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_22.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Finding the file to edit
@@ -30,15 +30,15 @@ Vim has a plugin that makes it possible to edit a directory. Try this: >
Through the magic of autocommands and Vim scripts, the window will be filled
with the contents of the directory. It looks like this (slightly cleaned up
-so that it fits within 80 chars): >
+so that it fits within 78 chars): >
- " ===========================================================================
- " Netrw Directory Listing (netrw v180)
+ " ==========================================================================
+ " Netrw Directory Listing (netrw v180)
" /path/to/vim/runtime/doc
" Sorted by name
" Sort sequence: [\/]$,*,\(\.bak\|\~\|\.o\|\.h\|\.info\|\.swp\)[*@]\=$
" Quick Help: :help -:go up dir D:delete R:rename s:sort-by x:special
- " ===========================================================================
+ " ==========================================================================
../
./
check/
diff --git a/runtime/doc/usr_23.txt b/runtime/doc/usr_23.txt
index e5ba25aee5..34b8fa0b19 100644
--- a/runtime/doc/usr_23.txt
+++ b/runtime/doc/usr_23.txt
@@ -1,7 +1,7 @@
-*usr_23.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_23.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Editing other files
diff --git a/runtime/doc/usr_24.txt b/runtime/doc/usr_24.txt
index 16a7063531..22b41f790e 100644
--- a/runtime/doc/usr_24.txt
+++ b/runtime/doc/usr_24.txt
@@ -1,7 +1,7 @@
-*usr_24.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_24.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Inserting quickly
@@ -567,8 +567,8 @@ that combination. Thus CTRL-K dP also works. Since there is no digraph for
Note:
The digraphs depend on the character set that Vim assumes you are
- using. Always use ":digraphs" to find out which digraphs are currently
- available.
+ using. Always use ":digraphs" to find out which digraphs are
+ currently available.
You can define your own digraphs by specifying the target character with a
decimal number. Example: >
diff --git a/runtime/doc/usr_25.txt b/runtime/doc/usr_25.txt
index 71e96c7767..62aa55e108 100644
--- a/runtime/doc/usr_25.txt
+++ b/runtime/doc/usr_25.txt
@@ -1,7 +1,7 @@
-*usr_25.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_25.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Editing formatted text
diff --git a/runtime/doc/usr_26.txt b/runtime/doc/usr_26.txt
index 3dc54543aa..cda0a22bf2 100644
--- a/runtime/doc/usr_26.txt
+++ b/runtime/doc/usr_26.txt
@@ -1,7 +1,7 @@
-*usr_26.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_26.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Repeating
diff --git a/runtime/doc/usr_27.txt b/runtime/doc/usr_27.txt
index ab21e00b24..12facf84b2 100644
--- a/runtime/doc/usr_27.txt
+++ b/runtime/doc/usr_27.txt
@@ -1,7 +1,7 @@
-*usr_27.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_27.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Search commands and patterns
diff --git a/runtime/doc/usr_28.txt b/runtime/doc/usr_28.txt
index ad06cc0a69..746e03ee09 100644
--- a/runtime/doc/usr_28.txt
+++ b/runtime/doc/usr_28.txt
@@ -1,7 +1,7 @@
-*usr_28.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_28.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Folding
diff --git a/runtime/doc/usr_29.txt b/runtime/doc/usr_29.txt
index fe1a79f789..cb878ce5a6 100644
--- a/runtime/doc/usr_29.txt
+++ b/runtime/doc/usr_29.txt
@@ -1,7 +1,7 @@
-*usr_29.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_29.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Moving through programs
diff --git a/runtime/doc/usr_30.txt b/runtime/doc/usr_30.txt
index 8a3873c867..fc209041bc 100644
--- a/runtime/doc/usr_30.txt
+++ b/runtime/doc/usr_30.txt
@@ -1,7 +1,7 @@
-*usr_30.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_30.txt* For Vim version 9.1. Last change: 2025 Nov 28
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Editing programs
@@ -37,9 +37,9 @@ you give) and captures the results: >
If errors were generated, they are captured and the editor positions you where
the first error occurred.
- Take a look at an example ":make" session. (Typical :make sessions generate
-far more errors and fewer stupid ones.) After typing ":make" the screen looks
-like this:
+ Take a look at an example ":make" session. (Typical :make sessions
+generate far more errors and fewer stupid ones.) After typing ":make" the
+screen looks like this:
:!make | &tee /tmp/vim215953.err ~
gcc -g -Wall -o prog main.c sub.c ~
@@ -544,7 +544,7 @@ reach the nearest soft tab stop. The following example uses
a ------->a
To maintain global coherence, one can `:set softtabstop=-1` so that
-the value of 'shiftwidth' is use for the number of columns between two soft
+the value of 'shiftwidth' is used for the number of columns between two soft
tab stops.
If you prefer to have different values for 'shiftwidth' and 'softtabstop',
diff --git a/runtime/doc/usr_31.txt b/runtime/doc/usr_31.txt
index 5e65f6827a..077398272f 100644
--- a/runtime/doc/usr_31.txt
+++ b/runtime/doc/usr_31.txt
@@ -1,7 +1,7 @@
-*usr_31.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_31.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Exploiting the GUI
diff --git a/runtime/doc/usr_32.txt b/runtime/doc/usr_32.txt
index ee3ad62a33..0194a9355c 100644
--- a/runtime/doc/usr_32.txt
+++ b/runtime/doc/usr_32.txt
@@ -1,7 +1,7 @@
-*usr_32.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_32.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
The undo tree
diff --git a/runtime/doc/usr_40.txt b/runtime/doc/usr_40.txt
index 6517f851e8..12a6069987 100644
--- a/runtime/doc/usr_40.txt
+++ b/runtime/doc/usr_40.txt
@@ -1,7 +1,7 @@
-*usr_40.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_40.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Make new commands
@@ -385,8 +385,8 @@ Some of the other options and keywords are as follows:
-count={number} The command can take a count whose default is
{number}. The resulting count can be used
through the keyword.
- -bang You can use a !. If present, using will
- result in a !.
+ -bang You can use a !. If present, using
+ will result in a !.
-register You can specify a register. (The default is
the unnamed register.)
The register specification is available as
@@ -563,9 +563,9 @@ for the cprograms group: >
GROUPS
-The {group} item, used when defining an autocommand, groups related autocommands
-together. This can be used to delete all the autocommands in a certain group,
-for example.
+The {group} item, used when defining an autocommand, groups related
+autocommands together. This can be used to delete all the autocommands in a
+certain group, for example.
When defining several autocommands for a certain group, use the ":augroup"
command. For example, let's define autocommands for C programs: >
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index aa4aed192e..1ea2fb3869 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1,7 +1,7 @@
-*usr_41.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_41.txt* For Vim version 9.1. Last change: 2025 Dec 13
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Write a Vim script
@@ -764,7 +764,8 @@ String manipulation: *string-functions*
charclass() class of a character
match() position where a pattern matches in a string
matchbufline() all the matches of a pattern in a buffer
- matchend() position where a pattern match ends in a string
+ matchend() position where a pattern match ends in a
+ string
matchfuzzy() fuzzy matches a string in a list of strings
matchfuzzypos() fuzzy matches a string in a list of strings
matchstr() match of a pattern in a string
@@ -841,7 +842,8 @@ List manipulation: *list-functions*
indexof() index in a List where an expression is true
max() maximum value in a List
min() minimum value in a List
- count() count number of times a value appears in a List
+ count() count number of times a value appears in a
+ List
repeat() repeat a List multiple times
flatten() flatten a List
flattennew() flatten a copy of a List
@@ -1135,8 +1137,6 @@ Insert mode completion: *completion-functions*
complete_add() add to found matches
complete_check() check if completion should be aborted
complete_info() get current completion information
- complete_match() get insert completion start match col and
- trigger text
preinserted() check if text is inserted after cursor
pumvisible() check if the popup menu is displayed
pum_getpos() position and size of popup menu if visible
@@ -1246,7 +1246,8 @@ Mappings and Menus: *mapping-functions*
Testing: *test-functions*
assert_equal() assert that two expressions values are equal
assert_equalfile() assert that two file contents are equal
- assert_notequal() assert that two expressions values are not equal
+ assert_notequal() assert that two expressions values are not
+ equal
assert_inrange() assert that an expression is inside a range
assert_match() assert that a pattern matches the value
assert_notmatch() assert that a pattern does not match the value
@@ -1472,6 +1473,9 @@ Various: *various-functions*
debugbreak() interrupt a program being debugged
+ redraw_listener_add() add callbacks to listen for redraws
+ redraw_listener_remove() remove a redraw listener
+
MacVim-specific functions
showdefinition() look up and show definition of provided string
diff --git a/runtime/doc/usr_42.txt b/runtime/doc/usr_42.txt
index 9086a619f3..c47bc8207b 100644
--- a/runtime/doc/usr_42.txt
+++ b/runtime/doc/usr_42.txt
@@ -1,7 +1,7 @@
-*usr_42.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_42.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Add new menus
diff --git a/runtime/doc/usr_43.txt b/runtime/doc/usr_43.txt
index e7a52392bb..31413c6eba 100644
--- a/runtime/doc/usr_43.txt
+++ b/runtime/doc/usr_43.txt
@@ -1,7 +1,7 @@
-*usr_43.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_43.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Using filetypes
diff --git a/runtime/doc/usr_44.txt b/runtime/doc/usr_44.txt
index 12a32e507a..0dba0b0df3 100644
--- a/runtime/doc/usr_44.txt
+++ b/runtime/doc/usr_44.txt
@@ -1,7 +1,7 @@
-*usr_44.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_44.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Your own syntax highlighted
@@ -629,10 +629,10 @@ be included in the next Vim version!
ADDING TO AN EXISTING SYNTAX FILE
-We were assuming you were adding a completely new syntax file. When an existing
-syntax file works, but is missing some items, you can add items in a separate
-file. That avoids changing the distributed syntax file, which will be lost
-when installing a new version of Vim.
+We were assuming you were adding a completely new syntax file. When an
+existing syntax file works, but is missing some items, you can add items in a
+separate file. That avoids changing the distributed syntax file, which will
+be lost when installing a new version of Vim.
Write syntax commands in your file, possibly using group names from the
existing syntax. For example, to add new variable types to the C syntax file:
>
diff --git a/runtime/doc/usr_45.txt b/runtime/doc/usr_45.txt
index 175d4fc394..cebf259a8c 100644
--- a/runtime/doc/usr_45.txt
+++ b/runtime/doc/usr_45.txt
@@ -1,7 +1,7 @@
-*usr_45.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_45.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Select your language (locale)
diff --git a/runtime/doc/usr_50.txt b/runtime/doc/usr_50.txt
index 6082ce2a0b..e846bc1300 100644
--- a/runtime/doc/usr_50.txt
+++ b/runtime/doc/usr_50.txt
@@ -1,7 +1,7 @@
-*usr_50.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_50.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Advanced Vim script writing
diff --git a/runtime/doc/usr_51.txt b/runtime/doc/usr_51.txt
index 3b43d2731d..293581e011 100644
--- a/runtime/doc/usr_51.txt
+++ b/runtime/doc/usr_51.txt
@@ -1,7 +1,7 @@
-*usr_51.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_51.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Write plugins
diff --git a/runtime/doc/usr_52.txt b/runtime/doc/usr_52.txt
index d013535aee..dc1919bacd 100644
--- a/runtime/doc/usr_52.txt
+++ b/runtime/doc/usr_52.txt
@@ -1,7 +1,7 @@
-*usr_52.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_52.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Write larger plugins
diff --git a/runtime/doc/usr_90.txt b/runtime/doc/usr_90.txt
index 2a9dd952ca..ca1b3c6ab5 100644
--- a/runtime/doc/usr_90.txt
+++ b/runtime/doc/usr_90.txt
@@ -1,7 +1,7 @@
-*usr_90.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_90.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Installing Vim
diff --git a/runtime/doc/usr_toc.txt b/runtime/doc/usr_toc.txt
index de2ec1dc66..61172d60d6 100644
--- a/runtime/doc/usr_toc.txt
+++ b/runtime/doc/usr_toc.txt
@@ -1,7 +1,7 @@
-*usr_toc.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*usr_toc.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM USER MANUAL by Bram Moolenaar
+ VIM USER MANUAL by Bram Moolenaar
Table Of Contents *user-manual* *usr*
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index 299a5ee63c..a11b441088 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -1,7 +1,7 @@
-*various.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*various.txt* For Vim version 9.1. Last change: 2025 Dec 11
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Various commands *various*
@@ -379,6 +379,7 @@ T *+cindent* 'cindent', C indenting; Always enabled
N *+clientserver* Unix and Win32: Remote invocation |clientserver|
*+clipboard* |clipboard| support compiled-in
*+clipboard_working* |clipboard| support compiled-in and working
+ *+clipboard_provider* |clipboard-providers| support compiled-in
T *+cmdline_compl* command line completion |cmdline-completion|
T *+cmdline_hist* command line history |cmdline-history|
T *+cmdline_info* 'showcmd' and 'ruler'; Always enabled since
diff --git a/runtime/doc/version4.txt b/runtime/doc/version4.txt
index d911cce4ee..a54eded96b 100644
--- a/runtime/doc/version4.txt
+++ b/runtime/doc/version4.txt
@@ -1,7 +1,7 @@
-*version4.txt* For Vim version 9.1. Last change: 2025 Aug 06
+*version4.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
This document lists the incompatible differences between Vim 3.0 and Vim 4.0.
diff --git a/runtime/doc/version5.txt b/runtime/doc/version5.txt
index 2f30f8ec9a..d656e2446b 100644
--- a/runtime/doc/version5.txt
+++ b/runtime/doc/version5.txt
@@ -1,7 +1,7 @@
-*version5.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*version5.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Welcome to Vim Version 5.0!
diff --git a/runtime/doc/version6.txt b/runtime/doc/version6.txt
index 5f6f0c0e8f..4b98404d80 100644
--- a/runtime/doc/version6.txt
+++ b/runtime/doc/version6.txt
@@ -1,7 +1,7 @@
-*version6.txt* For Vim version 9.1. Last change: 2025 Jul 22
+*version6.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Welcome to Vim Version 6.0! A large number of features has been added. This
diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt
index 1aadff31d2..e42c679cdf 100644
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -1,7 +1,7 @@
-*version7.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*version7.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
*vim7* *version-7.0* *version7.0*
diff --git a/runtime/doc/version8.txt b/runtime/doc/version8.txt
index cfb6f1e3d7..03d1464504 100644
--- a/runtime/doc/version8.txt
+++ b/runtime/doc/version8.txt
@@ -1,7 +1,7 @@
-*version8.txt* For Vim version 9.1. Last change: 2025 Jul 21
+*version8.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
*vim8* *vim-8* *version-8.0* *version8.0*
diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index f40fe49fca..48200b9024 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -1,7 +1,7 @@
-*version9.txt* For Vim version 9.1. Last change: 2025 Oct 26
+*version9.txt* For Vim version 9.1. Last change: 2026 Jan 07
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
*vim-9.0* *vim-9* *version-9.0* *version9.0*
@@ -52,7 +52,7 @@ remember him!
Vim version 9.1 is dedicated to Bram Moolenaar, who passed away on August 3rd
2023 while still working full-time on Vim. The Vim project would not exist
without his ongoing passion to lead and develop Vim and the community for more
-than 30 years. Bram was also passionate about his |ICCF| foundation to help
+than 30 years. Bram was also passionate about his ICCF foundation to help
children in Uganda. If you enjoy using Vim, please consider donating! We will
miss his guidance, passion and leadership.
@@ -41627,8 +41627,9 @@ Other new features ~
------------------
- Support for Super key mappings in GTK using .
-- The new packages |package-comment|, |package-nohlsearch|, |package-hlyank| and
- |help-TOC| are included.
+- The new optional packages |package-comment|, |package-nohlsearch|,
+ |package-hlyank|, |help-TOC|, |package-helpcurwin| and |package-osc52| are
+ included.
- An interactive tutor plugin has been included |vim-tutor-mode| and can be
started via |:Tutor|.
@@ -41653,6 +41654,8 @@ Other new features ~
- |items()| function now supports Blob.
+- The clipboard provider feature has been added |clipboard-providers|.
+
*changed-9.2*
Changed~
-------
@@ -41692,6 +41695,8 @@ Completion: ~
- 'smartcase' applies to completion filtering
Options: ~
+- 'commentstring' is now available in all builds and no longer requires the
+ |+folding| feature
- the default for 'commentstring' contains whitespace padding to have
automatic comments look nicer |comment-install|
- 'completeopt' is now a |global-local| option.
@@ -41717,7 +41722,12 @@ Options: ~
to ">" by default, indicating text that extends beyond the window width.
- 'guioptions': New value |'go-C'| to style the title/caption bar on Windows 11
(see also the below platform specific change).
+- 'guioptions': Support darkmode on MS-Windows for menu and title bar using
+ |'go-d'| (see also the below platform specific change).
+- 'guioptions': New value |'go-s'| to support fullscreen on MS-Windows GUI
+ (see also the below platform specific change).
- 'completepopup': Add more values to style popup windows.
+- 'fsync' is now a |global-local| option.
Ex commands: ~
- allow to specify a priority when defining a new sign |:sign-define|
@@ -41746,6 +41756,8 @@ Functions: ~
- |sha256()| also accepts a |Blob| as argument.
- |listener_add()| allows to register un-buffered listeners, so that changes
are handled as soon as they happen.
+- |redraw_listener_add()| and |redraw_listener_remove()| add/remove callbacks
+ for redrawing events.
Plugins~
- |zip| plugin works with PowerShell Core.
@@ -41754,7 +41766,13 @@ Platform specific ~
- MS-Winodws: Paths like "\Windows" and "/Windows" are now considered to be
absolute paths (to the current drive) and no longer relative.
- MS-Windows: The title bar follows the |hl-TitleBar| and |hl-TitleBarNC|
- highlighting group |gui-w32-title-bar|.
+ highlighting group |gui-w32-title-bar| with |'go-C'|
+- MS-Windows: Support darkmode for menu and title bar using |'go-d'|
+- MS-Windows: Vim no longer searches the current directory for
+ executables when running external commands; prefix a relative or absolute
+ path if you want the old behavior |$NoDefaultCurrentDirectoryInExePath|.
+- MS-Windows: New value |'go-s'| to support fullscreen on MS-Windows GUI
+
- macOS: increase default scheduler priority to TASK_DEFAULT_APPLICATION.
Others: ~
@@ -41783,6 +41801,11 @@ Others: ~
- Vim triggers the |TermResponseAll| autocommand for any terminal OSC value.
- Support CTRL-B and CTRL-F in the |more-prompt|.
+
+Not Vim related~
+- Updated sponsorship documentation to replace references to ICCF with Kuwasha
+ International Development Society as Vim's designated charity.
+
*added-9.2*
Added ~
-----
@@ -41795,7 +41818,6 @@ Functions: ~
|blob2str()| convert a blob into a List of strings
|bindtextdomain()| set message lookup translation base path
|cmdcomplete_info()| get current cmdline completion info
-|complete_match()| get completion and trigger info
|diff()| diff two Lists of strings
|filecopy()| copy a file {from} to {to}
|foreach()| apply function to List items
@@ -41809,12 +41831,15 @@ Functions: ~
|id()| get unique identifier for a Dict, List, Object,
Channel or Blob variable
|list2tuple()| turn a List of items into a Tuple
+|listener_add()| add a callback to listen to changes
|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
|preinserted()| whether preinserted text has been inserted during
completion (see 'completeopt')
+|redraw_listener_add()| add callbacks to listen for redraws
+|redraw_listener_remove()| remove a redraw listener
|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
@@ -41858,11 +41883,13 @@ Commands: ~
Ex-Commands: ~
+|:clipreset| choose a new method for accessing the clipboard
|:iput| like |:put| but adjust indent
|:pbuffer| Edit buffer [N] from the buffer list in the preview
window
|:redrawtabpanel| Force updating the 'tabpanel'.
|:uniq| Deduplicate text in the current buffer.
+|:wlrestore| reinitialize the wayland compositor connection
Options: ~
@@ -41871,8 +41898,6 @@ Options: ~
'autocompletetimeout' initial decay timeout for autocompletion algorithm
'chistory' Size of the quickfix stack |quickfix-stack|
'clipmethod' How to access the clipboard
-'completefuzzycollect' Enable fuzzy collection of candidates for (some)
- |ins-completion| modes
'completeitemalign' Order of |complete-items| in Insert mode completion
popup
'completetimeout' initial decay timeout for CTRL-N and CTRL-P
@@ -41880,10 +41905,10 @@ Options: ~
'eventignorewin' autocommand events that are ignored in a window
'findfunc' Vim function to obtain the results for a |:find|
command
-'isexpand' defines triggers for completion
'lhistory' Size of the location list stack |quickfix-stack|
'maxsearchcount' Set the maximum number for search-stat |shm-S|
'messagesopt' configure |:messages| and |hit-enter| prompt
+'osctimeoutlen' OSC terminator receive timeout
'pumborder' define popup border and decorations
'pummaxwidth' maximum width for the completion popup menu
'showtabpanel' When to show the |tabpanel|
@@ -41891,23 +41916,26 @@ Options: ~
'tabpanel' Optional vertical panel for displaying tabpages
|tabpanel|
'tabpanelopt' Optional settings for the |tabpanel|
-'t_xo' Terminal uses XON/XOFF handshaking (e.g. vt420)
't_CF' Support for alternate font highlighting terminal code
+'t_xo' Terminal uses XON/XOFF handshaking (e.g. vt420)
'winfixbuf' Keep buffer focused in a window
'wlseat' Specify Wayland seat to use for the |wayland| feature
'wlsteal' Steal focus to access the |wayland| clipboard
-'wltimeout' Specify the connection timeout for the |wayland|
+'wltimeoutlen' Specify the connection timeout for the |wayland|
compositor
Vim Variables: ~
|v:clipmethod| The current 'clipmethod'.
+|v:clipproviders| A dictionary containing clipboard providers
+ configuration |clipboard-providers|.
|v:stacktrace| The most recent caught exception.
-|v:t_enumvalue| Value of |enumvalue|.
|v:t_enum| Value of |enum| type.
+|v:t_enumvalue| Value of |enumvalue|.
|v:t_tuple| Value of |Tuple| type.
|v:termda1| The escape sequence returned for the primary device
attribute query (DA1).
|v:termosc| The most recent received OSC response.
+|v:vim_did_init| Set once Vim finishes startup initialization.
|v:wayland_display| The name of the Wayland display Vim is connected to.
Vim Arguments: ~
diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt
index 83558850eb..eb9a04b6b4 100644
--- a/runtime/doc/vi_diff.txt
+++ b/runtime/doc/vi_diff.txt
@@ -1,7 +1,7 @@
-*vi_diff.txt* For Vim version 9.1. Last change: 2025 Oct 12
+*vi_diff.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Differences between Vim and Vi *vi-differences*
diff --git a/runtime/doc/vietnamese.txt b/runtime/doc/vietnamese.txt
index acd2099bda..df6fbf8b53 100644
--- a/runtime/doc/vietnamese.txt
+++ b/runtime/doc/vietnamese.txt
@@ -1,7 +1,7 @@
-*vietnamese.txt* For Vim version 9.1. Last change: 2025 Aug 06
+*vietnamese.txt* For Vim version 9.1. Last change: 2025 Nov 09
- VIM REFERENCE MANUAL by Phạm Bình An
+ VIM REFERENCE MANUAL by Phạm Bình An
Vietnamese language support in Vim *vietnamese* *Vietnamese*
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index 7941b83abf..57ebec375f 100644
--- a/runtime/doc/vim9.txt
+++ b/runtime/doc/vim9.txt
@@ -1,4 +1,4 @@
-*vim9.txt* For Vim version 9.1. Last change: 2025 Oct 06
+*vim9.txt* For Vim version 9.1. Last change: 2025 Dec 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -24,11 +24,12 @@ features in Vim9 script.
------------------------------------------------------------------------------
NOTE: In this vim9.txt help file, the Vim9 script code blocks beginning
- with `vim9script` are Vim9 script syntax highlighted. Also, they are
- sourceable, meaning you can run them to see what they output. To
- source them, use `:'<,'>source` (see |:source-range|), which is done
- by visually selecting the line(s) with |V| and typing `:so`.
- For example, try it on the following Vim9 script: >vim9
+ with `vim9script` (and individual lines starting with `vim9cmd`) are
+ Vim9 script syntax highlighted. Also, they are sourceable, meaning
+ you can run them to see what they output. To source them, use
+ `:'<,'>source` (see |:source-range|), which is done by visually
+ selecting the line(s) with |V| and typing `:so`. For example, try it
+ on the following Vim9 script: >vim9
vim9script
echowindow "Welcome to Vim9 script!"
@@ -63,7 +64,7 @@ dictionary adds quite a lot of overhead. In a Vim9 function this dictionary
is not available. Other differences are more subtle, such as how errors are
handled.
-The Vim9 script syntax and semantics are used in:
+Vim9 script syntax, semantics, and behavior apply in:
- a function defined with the `:def` command
- a script file where the first command is `vim9script`
- an autocommand defined in the context of the above
@@ -77,18 +78,72 @@ Vim9 script and legacy Vim script can be mixed. There is no requirement to
rewrite old scripts, they keep working as before. You may want to use a few
`:def` functions for code that needs to be fast.
-:vim9[cmd] {cmd} *:vim9* *:vim9cmd* *E1164*
- Evaluate and execute {cmd} using Vim9 script syntax and
- semantics. Useful when typing a command and in a legacy
- script or function.
+:vim9[cmd] {cmd} *:vim9* *:vim9cmd*
+ Evaluate and execute {cmd} using Vim9 script syntax,
+ semantics, and behavior. Useful when typing a command,
+ in a `:function`, or a legacy Vim script.
+
+ The following short example shows how a legacy Vim script
+ command and a :vim9cmd (so Vim9 script context) may appear
+ similar, though may differ not just syntactically, but also
+ semantically and behaviorally. >vim
+
+ call popup_notification('entrée'[5:]
+ \ ->str2list()->string(), #{time: 7000})
+ vim9cmd popup_notification('entrée'[5 :]
+ ->str2list()->string(), {time: 7000})
+<
+ Notes: 1) The reason for the different output is Vim9 script
+ uses character indexing whereas legacy Vim script
+ uses byte indexing - see |vim9-string-index|.
+ 2) Syntax is different too. In Vim9 script:
+ - The space in "[5 :]" is mandatory (see
+ |vim9-white-space|).
+ - Line continuation with "\" is not required.
+ - The "#" (to avoid putting quotes around dictionary
+ keys) is neither required nor allowed - see |#{}|.
+
+ *E1164*
+ `:vim9cmd` cannot stand alone; it must be followed by a command.
+
+:leg[acy] {cmd} *:leg* *:legacy*
+ Evaluate and execute {cmd} using legacy Vim script syntax,
+ semantics, and behavior. It is only applicable in a Vim9
+ script or a `:def` function. Using an equivalent script to
+ the one, above (see its notes for why the output differs): >vim9
+
+ vim9script
+ # Legacy context - so, this creates a popup with [769, 101]
+ legacy call popup_notification('entrée'[5:]
+ \ ->str2list()->string(), #{time: 7000})
+ # Vim9 script context - so, this creates a pop up with [101]
+ popup_notification('entrée'[5 :]
+ ->str2list()->string(), {time: 7000})
+<
+ Vim9 script script-local variables may be used by prefixing
+ "s:", like in legacy Vim script. This example shows the
+ difference in syntax: "k" for the script-local variable in
+ Vim9 script, "s:k" in the legacy Vim script context. >vim9
+
+ vim9script
+ var k: string = "Okay"
+ echo k
+ legacy echo s:k
+< *E1189*
+ Using `:legacy` is not allowed in compiled Vim9 script
+ control flow contexts. For example: >vim9
+
+ vim9script
+ def F_1189()
+ if v:version == 900
+ # E1189: Cannot use :legacy with this command: endif
+ legacy endif
+ enddef
+ F_1189()
+< *E1234*
+ `:legacy` cannot stand alone; it must be followed by a command.
-:leg[acy] {cmd} *:leg* *:legacy* *E1189* *E1234*
- Evaluate and execute {cmd} using legacy script syntax and
- semantics. Only useful in a Vim9 script or a :def function.
- Note that {cmd} cannot use local variables, since it is parsed
- with legacy expression syntax.
-See some examples of Vim9 script at |52.6|.
==============================================================================
2. Differences from legacy Vim script *vim9-differences*
@@ -103,7 +158,8 @@ script and `:def` functions; details are below:
echo "hello "
.. yourName
.. ", how are you?"
-- White space is required in many places to improve readability.
+- White space is required in many places to improve readability,
+ see |vim9-white-space|.
- Assign values without `:let` *E1126* , declare variables with `:var`: >
var count = 0
count += 3
@@ -231,7 +287,7 @@ You can call a legacy dict function though: >
var d = {func: Legacy, value: 'text'}
d.func()
enddef
-< *E1096* *E1174* *E1175*
+
The argument types and return type need to be specified. The "any" type can
be used, type checking will then be done at runtime, like with legacy
functions.
@@ -274,7 +330,7 @@ script "export" needs to be used for those to be used elsewhere. >
def ThisFunction() # script-local
def g:ThatFunction() # global
export def Function() # for import and import autoload
-< *E1058* *E1075*
+< *E1075*
When using `:function` or `:def` to specify a nested function inside a `:def`
function and no namespace was given, this nested function is local to the code
block it is defined in. It cannot be used in `function()` with a string
@@ -841,7 +897,7 @@ Notes:
White space ~
- *E1004* *E1068* *E1069* *E1074* *E1127* *E1202*
+ *vim9-white-space* *E1004* *E1068* *E1069* *E1074* *E1127* *E1202*
Vim9 script enforces proper use of white space. This is no longer allowed: >
var name=234 # Error!
var name= 234 # Error!
@@ -1235,69 +1291,245 @@ subtracting one: >
Using ++var or --var in an expression is not supported yet.
+
==============================================================================
3. New style functions *fast-functions*
- *:def* *E1028*
+ *:def*
:def[!] {name}([arguments])[: {return-type}]
Define a new function by the name {name}. The body of
the function follows in the next lines, until the
- matching `:enddef`. *E1073*
- *E1011*
+ matching `:enddef`.
+ *E1073*
+ The {name} cannot be reused at the script-local level: >vim9
+
+ vim9script
+ def F_1073()
+ enddef
+ def F_1073() # E1073: Name already defined: ...
+ enddef
+< *E1011*
The {name} must be less than 100 bytes long.
- *E1003* *E1027* *E1056* *E1059*
- The type of value used with `:return` must match
- {return-type}. When {return-type} is omitted or is
- "void" the function is not expected to return
- anything.
- *E1077* *E1123*
+
+ *E1077*
{arguments} is a sequence of zero or more argument
declarations. There are three forms:
{name}: {type}
{name} = {value}
{name}: {type} = {value}
- The first form is a mandatory argument, the caller
- must always provide them.
- The second and third form are optional arguments.
- When the caller omits an argument the {value} is used.
+ The first form is a mandatory argument. So, the
+ declaration must provide a type. Example: >vim9
+ vim9script
+ def F_1077(x): void
+ # E1077: Missing argument type for x
+ enddef
+<
+ For the second form, because the declaration does not
+ specify it, Vim infers the type. For both second and
+ third forms, a default {value} applies when the
+ caller omits it. Examples: >vim9
+
+ vim9script
+ def SecondForm(arg = "Hi"): void
+ echo $'2. arg is a "{arg->typename()}" type ' ..
+ $'and the default value of arg is "{arg}"'
+ enddef
+ SecondForm()
+ def ThirdForm(arg2: number = 9): void
+ echo $'3. default value of arg2 is {arg2}'
+ enddef
+ ThirdForm()
+< *E1123*
+ Arguments in a builtin function called in a `:def`
+ function must have commas between arguments: >vim9
+
+ vim9script
+ def F_1123(a: number, b: number): void
+ echo max(a b)
+ # E1123: Missing comma before argument: b)
+ enddef
+ F_1123(1, 2)
+< *E1003* *E1027* *E1096*
+ The type of value used with `:return` must match
+ {return-type}. When {return-type} is omitted or is
+ "void" the function is not allowed to return
+ anything. Examples: >vim9
+
+ vim9script
+ def F_1003(): bool
+ return # E1003: Missing return value
+ enddef
+ F_1003()
+< >vim9
+ vim9script
+ def F_1027(): bool
+ echo false # E1027: Missing return statement
+ enddef
+ F_1027()
+< >vim9
+ vim9script
+ def F_1096(): void
+ return false # E1096: Returning a value ...
+ enddef
+ F_1096()
+< *E1056* *E1059*
+ When ": {return-type}" is specified, {return-type}
+ cannot be omitted (leaving a hanging colon). The ": "
+ also cannot be preceded by white space. Examples: >vim
+
+ def F_1056():
+ # E1056: Expected a type:
+ enddef
+ def F_1059() : bool
+ # E1059: No white space allowed before colon:...
+ enddef
+<
The function will be compiled into instructions when
- called, or when `:disassemble` or `:defcompile` is
- used. Syntax and type errors will be produced at that
- time.
+ called or when either `:defcompile` or `:disassemble` is
+ used. (For an example, see |:disassemble|.) Syntax
+ and type errors will be produced at that time.
+ *E1058*
It is possible to nest `:def` inside another `:def` or
- `:function` up to about 50 levels deep.
+ `:function` only up to 49 levels deep. At 50 or more
+ levels, it is a |E1058| error.
+
*E1117*
- [!] is used as with `:function`. Note that
- script-local functions cannot be deleted or redefined
- later in Vim9 script. They can only be removed by
- reloading the same script.
+ [!] is allowed only in legacy Vim script because it
+ permits function redefinition (as with `:function`!).
+ In Vim9 script, ! is not allowed because script-local
+ functions cannot be deleted or redefined, though they
+ can be removed by reloading the script. Also, nested
+ functions cannot use ! for redefinition. Examples: >vim
+
+ " Legacy Vim script :def! example
+ def! LegacyFunc()
+ echo "def! is allowed in a legacy Vim script"
+ enddef
+ call LegacyFunc()
+< >vim9
+ vim9script
+ def Func()
+ def! InnerFunc()
+ # E1117: Cannot use ! with nested :def
+ enddef
+ enddef
+ Func()
+< >vim9
+ vim9script
+ def! F_477(): void # E477: No ! allowed
+ enddef
+< >vim9
+ vim9script
+ def F_1084(): void
+ enddef
+ delfunction! F_1084
+ # E1084: Cannot delete Vim9 script function F_1084
+<
+ Note: The generic error *E1028* ("Compiling :def
+ function failed") indicates an undeterminable error
+ during compilation. If reproducible, it may be
+ reported at https://github.com/vim/vim/issues as
+ it could represent a gap in Vim's error reporting.
*:enddef* *E1057* *E1152* *E1173*
-:enddef End of a function defined with `:def`. It should be on
- a line by its own.
+:enddef End of a function defined with `:def`. It should be on
+ a line by itself. Examples: >vim9
+ vim9script
+ def MyFunc()
+ echo 'Do Something' | enddef
+ # E1057: Missing :enddef
+< >vim9
+ vim9script
+ def F_1173()
+ enddef echo 'X'
+ # E1173: Text found after enddef: echo 'X'
+< >vim9
+ vim9script
+ def F_1152()
+ function X()
+ enddef # E1152: Mismatched enddef
+ enddef
+<
You may also find this wiki useful. It was written by an early adopter of
Vim9 script: https://github.com/lacygoill/wiki/blob/master/vim/vim9.md
-If the script the function is defined in is Vim9 script, then script-local
-variables can be accessed without the "s:" prefix. They must be defined
-before the function is compiled. If the script the function is defined in is
-legacy script, then script-local variables must be accessed with the "s:"
-prefix if they do not exist at the time of compiling.
- *E1269*
-Script-local variables in a |Vim9| script must be declared at the script
-level. They cannot be created in a function, also not in a legacy function.
+If the script the `:def` function is defined in is Vim9 script, script-local
+variables must be accessed without using the "s:" prefix. They must be
+defined before the function is compiled and there is no way to avoid errors
+(e.g., by using |exists()|) to conditionally skip undeclared variables.
+For example: >vim9
+
+ vim9script
+ def MyVim9def()
+ echo unus # Echoes 1
+ # echo s:unus # This would be E1268 (Cannot use s: in Vim9)
+ if exists('duo')
+ # echo duo # This would be E1001 (Variable not found: duo)
+ endif
+ enddef
+ var unus: number = 1
+ MyVim9def() # MyVim9def is compiled ("duo" does not exist yet)
+ var duo: number = 2
+<
+If the script the `:def` function is defined in is legacy Vim script,
+script-local variables may be accessed with or without the "s:" prefix.
+However, using "s:" may defer variable resolution to runtime, avoiding
+compilation errors for variables that may not exist yet, as this example
+explains: >vim
+
+ " legacy Vim script
+ def! MyLegacyDef(): void
+ echo [unus, s:unus] # Echoes [1, 1]
+ # (If uncommented) First sourcing of 'echo s:duo' is E121 and
+ # causes a compilation error; subsequent sourcing echoes 2:
+ # echo s:duo
+ if exists("s:duo")
+ # First sourcing: skips echo; subsequent sourcing: echoes 2
+ echo s:duo
+ endif
+ if exists("duo")
+ # (If uncommented) First sourcing of 'echo duo' is E1001 and
+ # causes a compilation error; subsequent sourcing echoes 2:
+ # echo duo
+ endif
+ enddef
+ let s:unus = 1
+ call MyLegacyDef() " Calls MyLegacyDef() and compiles if not already
+ let s:duo = 2
+< *E1269*
+Script-local variables in a Vim9 script must be declared at the script
+level. They cannot be created in a `:def` function and may not be declared
+in a legacy function with the "s:" prefix. For example: >vim9
+ vim9script
+ function F_1269()
+ let s:i_wish = v:true
+ endfunction
+ F_1269()
+ # E1269: Cannot create a Vim9 script variable in a function: s:i_wish
+<
*:defc* *:defcompile*
:defc[ompile] Compile functions and classes (|class-compile|)
defined in the current script that were not compiled
yet. This will report any errors found during
compilation.
-:defc[ompile] MyClass Compile all methods in a class. |class-compile|
+ Example: When the three lines (up to and including
+ `enddef`) are sourced, there is no error because the
+ Vim9 `:def` function is not compiled. However, if all
+ four lines are sourced, compilation fails: >vim9
+
+ vim9script
+ def F_1027(): string
+ enddef
+ defcompile F_1027 # E1027: Missing return statement
+
+:defc[ompile] MyClass Compile all methods in a class. (See |:disassemble|
+ for an example.)
:defc[ompile] {func}
:defc[ompile] debug {func}
@@ -1305,16 +1537,35 @@ level. They cannot be created in a function, also not in a legacy function.
Compile function {func}, if needed. Use "debug" and
"profile" to specify the compilation mode.
This will report any errors found during compilation.
- {func} call also be "ClassName.functionName" to
+ {func} can also be "ClassName.functionName" to
compile a function or method in a class.
- {func} call also be "ClassName" to compile all
+ {func} can also be "ClassName" to compile all
functions and methods in a class.
*:disa* *:disassemble*
:disa[ssemble] {func} Show the instructions generated for {func}.
- This is for debugging and testing. *E1061*
- Note that for command line completion of {func} you
- can prepend "s:" to find script-local functions.
+ This is for debugging and testing.
+ If {func} is not found, error *E1061* occurs.
+ {func} can also be "ClassName.functionName" to
+ disassemble a function in a class.
+ The following example demonstrates using `:defcompile`
+ with a |class| and `:disassemble` with a
+ "ClassName.functionName" (positioning the cursor on
+ the last line of the visually sourced script): >vim9
+
+ vim9script
+ class Line
+ var lnum: number
+ def new(this.lnum)
+ enddef
+ def SetLnum()
+ cursor(this.lnum, 52)
+ enddef
+ endclass
+ defcompile Line
+ disassemble Line.SetLnum
+ var vlast: Line = Line.new(line("'>"))
+ vlast.SetLnum() # Cursor is positioned here->_
:disa[ssemble] profile {func}
Like `:disassemble` but with the instructions used for
@@ -1324,192 +1575,304 @@ level. They cannot be created in a function, also not in a legacy function.
Like `:disassemble` but with the instructions used for
debugging.
+ Note: For command line completion of {func}, script-local functions
+ are shown with their . Depending on options, including
+ |wildmenumode()|, completion may work with "s:", "
- def MapList(): list
- var list = ['aa', 'bb', 'cc', 'dd']
- return range(1, 2)->map('list[v:val]')
- enddef
+Variables local to `:def` functions are not visible to string evaluation.
+The following example shows that the script-local constant "SCRIPT_LOCAL" is
+visible whereas the function-local constant "DEF_LOCAL" is not: >vim9
+ vim9script
+ const SCRIPT_LOCAL = ['A', 'script-local', 'list']
+ def MapList(scope: string): list
+ const DEF_LOCAL: list = ['A', 'def-local', 'list']
+ if scope == 'script local'
+ return [1]->map('SCRIPT_LOCAL[v:val]')
+ else
+ return [1]->map('DEF_LOCAL[v:val]')
+ endif
+ enddef
+ echo 'script local'->MapList() # Echoes ['script-local']
+ echo 'def local'->MapList() # E121: Undefined variable: DEF_LOCAL
+<
The map argument is a string expression, which is evaluated without the
-function scope. Instead, use a lambda: >
+function scope. Instead, in Vim9 script, use a lambda: >vim9
+
+ vim9script
def MapList(): list
- var list = ['aa', 'bb', 'cc', 'dd']
- return range(1, 2)->map((_, v) => list[v])
+ const DEF_LOCAL: list = ['A', 'def-local', 'list']
+ return [1]->map((_, v) => DEF_LOCAL[v])
enddef
+ echo MapList() # Echoes ['def-local']
+<
+For commands that are not compiled, such as `:edit`, |backtick-expansion| can
+be used and it can use the local scope. Example: >vim9
-For commands that are not compiled, such as `:edit`, backtick expansion can be
-used and it can use the local scope. Example: >
- def Replace()
- var fname = 'blah.txt'
- edit `=fname`
+ vim9script
+ def EditNewBlah()
+ var fname: string = 'blah.txt'
+ split
+ edit `=fname`
enddef
+ EditNewBlah() # A new split is created as buffer 'blah.txt'
+<
+Closures defined in a loop can either share a variable or each have their own
+copy, depending on where the variable is declared. With a variable declared
+outside the loop, all closures reference the same shared variable.
+The following example demonstrates the consequences, with the "outloop"
+variable existing only once: >vim9
-Closures defined in a loop will share the same context. For example: >
+ vim9script
var flist: list
- for i in range(5)
- var inloop = i
- flist[i] = () => inloop
- endfor
- echo range(5)->map((i, _) => flist[i]())
- # Result: [4, 4, 4, 4, 4]
+ def ClosureEg(n: number): void
+ var outloop: number = 0 # outloop is declared outside the loop!
+ for i in range(n)
+ outloop = i
+ flist[i] = (): number => outloop # Closures ref the same var
+ endfor
+ echo range(n)->map((i, _) => flist[i]())
+ enddef
+ ClosureEg(4) # Echoes [3, 3, 3, 3]
+<
+All closures put in the list refer to the same instance, which, in the end,
+is 3.
+
+However, when the variable is declared inside the loop, each closure gets its
+own copy, as shown in this example: >vim9
+
+ vim9script
+ var flist: list
+ def ClosureEg(n: number): void
+ for i in range(n)
+ var inloop: number = i # inloop is declared inside the loop
+ flist[i] = (): number => inloop # Closures ref each inloop
+ endfor
+ echo range(n)->map((i, _) => flist[i]())
+ enddef
+ ClosureEg(4) # Echoes [0, 1, 2, 3]
+
+Another way to have a separate context for each closure is to call a
+function to define it: >vim9
+
+ vim9script
+ def GetClosure(i: number): func
+ var infunc: number = i
+ return (): number => infunc
+ enddef
+ var flist: list
+ def ClosureEg(n: number): void
+ for i in range(n)
+ flist[i] = GetClosure(i)
+ endfor
+ echo range(n)->map((i, _) => flist[i]())
+ enddef
+ ClosureEg(4) # Echoes [0, 1, 2, 3]
< *E1271*
A closure must be compiled in the context that it is defined in, so that
-variables in that context can be found. This mostly happens correctly, except
-when a function is marked for debugging with `:breakadd` after it was compiled.
-Make sure to define the breakpoint before compiling the outer function.
-
-The "inloop" variable will exist only once, all closures put in the list refer
-to the same instance, which in the end will have the value 4. This is
-efficient, also when looping many times. If you do want a separate context
-for each closure, call a function to define it: >
- def GetClosure(i: number): func
- var infunc = i
- return () => infunc
+variables in that context can be found. This mostly happens correctly,
+except when a function is marked for debugging with `:breakadd` after it was
+compiled. Make sure to define the breakpoint before compiling the outer
+function.
+ *E1248*
+In some situations, such as when a Vim9 closure which captures local variables
+is converted to a string and then executed, an error occurs. This happens
+because the string execution context cannot access the local variables from
+the original context where the closure was defined. For example: >vim9
+
+ vim9script
+ def F_1248(): void
+ var n: number
+ var F: func = () => {
+ n += 1
+ }
+ try
+ execute printf("call %s()", F)
+ catch
+ echo v:exception
+ endtry
enddef
+ F_1248() # Vim(call):E1248: Closure called from invalid context
- var flist: list
- for i in range(5)
- flist[i] = GetClosure(i)
- endfor
- echo range(5)->map((i, _) => flist[i]())
- # Result: [0, 1, 2, 3, 4]
-
-In some situations, especially when calling a Vim9 closure from legacy
-context, the evaluation will fail. *E1248*
-
-Note that at the script level the loop variable will be invalid after the
-loop, also when used in a closure that is called later, e.g. with a timer.
-This will generate error |E1302|: >
- for n in range(4)
- timer_start(500 * n, (_) => {
- echowin n
- })
- endfor
+In Vim9 script, a loop variable is invalid after the loop is closed.
+For example, this timer will echo 0 to 2 on separate lines. However, if
+the variable "n" is used after the `:endfor`, that is an |E121| error: >vim9
-You need to use a block and define a variable there, and use that one in the
-closure: >
- for n in range(4)
- {
- var nr = n
- timer_start(500 * n, (_) => {
- echowin nr
- })
- }
+ vim9script
+ for n in range(3)
+ var nr: number = n
+ timer_start(1000 * n, (_) => {
+ echowindow nr
+ })
endfor
-
-Using `:echowindow` is useful in a timer, the messages go into a popup and will
-not interfere with what the user is doing when it triggers.
+ try
+ echowindow n
+ catch
+ echo v:exception
+ endtry
+<
+ Note: Using `:echowindow` is useful in a timer because messages go
+ into a popup and will not interfere with what the user is
+ doing when it triggers.
-Converting a function from legacy to Vim9 ~
+Converting a :function to a :def~
*convert_legacy_function_to_vim9*
-These are the most changes that need to be made to convert a legacy function
-to a Vim9 function:
+ *convert_:function_to_:def*
+There are many changes that need to be made to convert a `:function` to
+a `:def` function. The following are some of them:
+- Change `let` used to declare variables to one of `var`, `const`, or `final`,
+ and remove the "s:" from each |script-variable|.
- Change `func` or `function` to `def`.
- Change `endfunc` or `endfunction` to `enddef`.
-- Add types to the function arguments.
-- If the function returns something, add the return type.
-- Change comments to start with # instead of ".
+- Add the applicable type (or "any") to each function argument.
+- Remove "a:" from each |function-argument|.
+- Remove inapplicable options such as |:func-range|, |:func-abort|,
+ |:func-dict|, and |:func-closure|.
+- If the function returns something, add the return type. (Ideally, add
+ "void" if it does not return anything.)
+- Remove line continuation backslashes from places they are not required.
+- Remove `let` for assigning values to |g:|, |b:|, |w:|, |t:|, or |l:| variables.
+- Rewrite |lambda| expressions in Vim9 script syntax (see |vim9-lambda|).
+- Change comments to start with # (preceded by white space) instead of ".
+- Insert white space in expressions where required (see |vim9-white-space|).
+- Change "." used for string concatenation to " .. ". (Alternatively, use
+ an |interpolated-string|.)
+
+The following legacy Vim script and Vim9 script examples demonstrate all
+those differences. First, legacy Vim script: >vim
+
+ let s:lnum=0
+ function Leg8(arg) abort
+ let l:pre=['Result',
+ \': ']
+ let b:arg=a:arg
+ let s:lnum+=2
+ let b:arg*=4
+ let l:result={pre->join(pre,'')}(l:pre)
+ return l:result.(b:arg+s:lnum)"no space before comment
+ endfunction
+ call Leg8(10)->popup_notification(#{time: 3000})" Pops up 'Result: 42'
+
+The equivalent in Vim9 script: >vim9
- For example, a legacy function: >
- func MyFunc(text)
- " function body
- endfunc
-< Becomes: >
- def MyFunc(text: string): number
- # function body
+ vim9script
+ var lnum: number
+ def Vim9(arg: number): string
+ final pre = ['Result',
+ ': ']
+ b:arg = arg
+ lnum += 2
+ b:arg *= 4
+ const RESULT: string = ((lpre) => join(lpre, ''))(pre)
+ return RESULT .. (b:arg + lnum) # space required before # comment
enddef
+ Vim9(10)->popup_notification({time: 3000}) # Pops up 'Result: 42'
-- Remove "a:" used for arguments. E.g.: >
- return len(a:text)
-< Becomes: >
- return len(text)
-
-- Change `let` used to declare a variable to `var`.
-- Remove `let` used to assign a value to a variable. This is for local
- variables already declared and b: w: g: and t: variables.
-
- For example, legacy function: >
- let lnum = 1
- let lnum += 3
- let b:result = 42
-< Becomes: >
- var lnum = 1
- lnum += 3
- b:result = 42
-
-- Insert white space in expressions where needed.
-- Change "." used for concatenation to "..".
-
- For example, legacy function: >
- echo line(1).line(2)
-< Becomes: >
- echo line(1) .. line(2)
-
-- line continuation does not always require a backslash: >
- echo ['one',
- \ 'two',
- \ 'three'
- \ ]
-< Becomes: >
- echo ['one',
- 'two',
- 'three'
- ]
+< Note: This example also demonstrates (outside the `:def` function):
+ - Removing "#" from the legacy |#{}| - see |vim9-literal-dict|
+ - Omitting `:call` (allowed, though unnecessary in Vim9 script)
-Calling a function in an expr option ~
+Calling a :def function in an expr option ~
*expr-option-function*
The value of a few options, such as 'foldexpr', is an expression that is
evaluated to get a value. The evaluation can have quite a bit of overhead.
-One way to minimize the overhead, and also to keep the option value very
-simple, is to define a compiled function and set the option to call it
-without arguments. Example: >
+One way to minimize the overhead, and also to keep the option value simple,
+is to define a compiled function and set the option to call it without
+arguments. For example: >vim9
+
vim9script
- def MyFoldFunc(): any
- ... compute fold level for line v:lnum
- return level
+ def MyFoldFunc(): string
+ # This matches start of line (^), followed by a digit, a full stop
+ # a space or tab, an uppercase character, with an empty next line
+ return getline(v:lnum) =~ '^[[:digit:]]\.[[:blank:]][[:upper:]]'
+ && getline(v:lnum + 1)->empty() ? '>1' : '1'
enddef
- set foldexpr=s:MyFoldFunc()
+ set foldexpr=MyFoldFunc()
+ set foldmethod=expr
+ norm! zM
+<
+ Warning: This script creates and applies folds at the "Heading 1" level of
+ this vim9.txt help buffer. (You can use |zR|, in Normal mode, to
+ open all the folds after sourcing the script.)
+
==============================================================================
4. Types *vim9-types*
- *E1008* *E1009* *E1010* *E1012*
- *E1013* *E1029* *E1030*
-The following builtin types are supported:
- bool
- number
- float
- string
- blob
- list<{type}>
- dict<{type}>
- object<{type}>
- job
- channel
- tuple<{type}>
- tuple<{type}, {type}, ...>
- tuple<...list<{type}>>
- tuple<{type}, ...list<{type}>>
- func
- func: {type}
- func({type}, ...)
- func({type}, ...): {type}
+
+The following types, each shown with its corresponding internal |v:t_TYPE|
+variable, are supported:
+
+ number |v:t_number|
+ string |v:t_string|
+ func |v:t_func|
+ func: {type} |v:t_func|
+ func({type}, ...) |v:t_func|
+ func({type}, ...): {type} |v:t_func|
+ list<{type}> |v:t_list|
+ dict<{type}> |v:t_dict|
+ float |v:t_float|
+ bool |v:t_bool|
+ none |v:t_none|
+ job |v:t_job|
+ channel |v:t_channel|
+ blob |v:t_blob|
+ class |v:t_class|
+ object |v:t_object|
+ typealias |v:t_typealias|
+ enum |v:t_enum|
+ enumvalue |v:t_enumvalue|
+ tuple<{type}> |v:t_tuple|
+ tuple<{type}, {type}, ...> |v:t_tuple|
+ tuple<...list<{type}>> |v:t_tuple|
+ tuple<{type}, ...list<{type}>> |v:t_tuple|
void
-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* .
+ *E1031* *E1186*
+These types can be used in declarations, though no simple value can have the
+"void" type. Trying to use a void as a value results in an error. Examples: >vim9
+
+ vim9script
+ def NoReturnValue(): void
+ enddef
+ try
+ const X: any = NoReturnValue()
+ catch
+ echo v:exception # E1031: Cannot use void value
+ try
+ echo NoReturnValue()
+ catch
+ echo v:exception # E1186: Expression does not result in a ...
+ endtry
+ endtry
+< *E1008* *E1009* *E1010* *E1012*
+Ill-formed declarations and mismatching types result in errors. The following
+are examples of errors E1008, E1009, E1010, and E1012: >vim9
+
+ vim9cmd var l: list
+ vim9cmd var l: list
+ vim9cmd var l: list = ['42']
+<
+There is no array type. Instead, use either a list or a tuple. Those types
+may also be literals (constants). In the following example, [5, 6] is a list
+literal and (7, ) a tuple literal. The echoed list is a list literal too: >vim9
-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.
+ vim9script
+ var l: list = [1, 2]
+ var t: tuple<...list> = (3, 4)
+ echo [l, t, [5, 6], (7, )]
+<
*tuple-type*
-A tuple type can be declared in more or less specific ways:
+A tuple type may be declared in the following ways:
tuple a tuple with a single item of type |Number|
tuple a tuple with two items of type |Number| and
|String|
@@ -1535,7 +1898,9 @@ variadic tuple must end with a list type. Examples: >
var myTuple: tuple<...list> = ()
<
*vim9-func-declaration* *E1005* *E1007*
-A partial and function can be declared in more or less specific ways:
+ *vim9-partial-declaration*
+ *vim9-func-type*
+A function (or partial) may be declared in the following ways:
func any kind of function reference, no type
checking for arguments or return value
func: void any number and type of arguments, no return
@@ -1567,352 +1932,891 @@ If the return type is "void" the function does not return a value.
The reference can also be a |Partial|, in which case it stores extra arguments
and/or a dictionary, which are not visible to the caller. Since they are
-called in the same way the declaration is the same.
-
-Custom types can be defined with `:type`: >
- :type MyList list
-Custom types must start with a capital letter, to avoid name clashes with
-builtin types added later, similarly to user functions.
+called in the same way, the declaration is the same. This interactive example
+prompts for a circle's radius and returns its area to two decimal places,
+using a partial: >vim9
-And classes and interfaces can be used as types: >
- :class MyClass
- :var mine: MyClass
+ vim9script
+ def CircleArea(pi: float, radius: float): float
+ return pi * radius->pow(2)
+ enddef
+ const AREA: func(float): float = CircleArea->function([3.14])
+ const RADIUS: float = "Enter a radius value: "->input()->str2float()
+ echo $"\nThe area of a circle with a radius of {RADIUS} is " ..
+ $"{AREA(RADIUS)} (π to two d.p.)"
+<
+ *vim9-typealias-type*
+Custom types (|typealias|) can be defined with `:type`. They must start with
+a capital letter (which avoids name clashes with either current or future
+builtin types) similar to user functions. This example creates a list of
+perfect squares and reports on |type()| (14, a typealias) and the |typename()|: >vim9
- :interface MyInterface
- :var mine: MyInterface
+ vim9script
+ type Ln = list
+ final perfect_squares: Ln = [1, 4, 9, 16, 25]
+ echo "Typename (Ln): " ..
+ $"type() is {Ln->type()} and typename() is {Ln->typename()}"
+<
+ *E1105*
+A typealias itself cannot be converted to a string: >vim9
- :class MyTemplate
- :var mine: MyTemplate
- :var mine: MyTemplate
+ vim9script
+ type Ln = list
+ const FAILS: func = (): string => {
+ echo $"{Ln}" # E1105: Cannot convert typealias to string
+ }
+<
+ *vim9-class-type* *vim9-interface-type*
+ *vim9-object-type*
+A |class|, |object|, and |interface| may all be used as types. The following
+interactive example prompts for a float value and returns the area of two
+different shapes. It also reports on the |type()| and |typename()| of the
+classes, objects, and interface: >vim9
- :class MyInterface
- :var mine: MyInterface
- :var mine: MyInterface
-{not implemented yet}
+ vim9script
+ interface Shape
+ def InfoArea(): tuple
+ endinterface
+ class Circle implements Shape
+ var radius: float
+ def InfoArea(): tuple
+ return ('Circle (π × r²)', 3.141593 * this.radius->pow(2))
+ enddef
+ endclass
+ class Square implements Shape
+ var side: float
+ def InfoArea(): tuple
+ return ('Square (s²)', this.side->pow(2))
+ enddef
+ endclass
+ const INPUT: float = "Enter a float value: "->input()->str2float()
+ echo "\nAreas of shapes:"
+ var myCircle: object = Circle.new(INPUT)
+ var mySquare: object = Square.new(INPUT)
+ final shapes: list = [myCircle, mySquare]
+ for shape in shapes
+ const [N: string, A: float] = shape.InfoArea()
+ echo $"\t- {N} has area of {A}"
+ endfor
+ echo "\n\t\ttype()\ttypename()\n\t\t------\t----------"
+ echo $"Circle\t\t{Circle->type()}\t{Circle->typename()}"
+ echo $"Square\t\t{Square->type()}\t{Square->typename()}"
+ echo $"Shape\t\t{Shape->type()}\t{Shape->typename()}"
+ echo $"MyCircle\t{myCircle->type()}\t{myCircle->typename()}"
+ echo $"MySquare\t{mySquare->type()}\t{mySquare->typename()}"
+ echo $"shapes\t\t{shapes->type()}\t{shapes->typename()}"
+<
+ *vim9-enum-type* *vim9-enumvalue-type*
+An |enum| may be used as a type (|v:t_enum|). Variables holding enum values
+have the enumvalue type (|v:t_enumvalue|) at runtime. The following
+interactive example prompts for a character and returns information about
+either a square or a rhombus. It also reports on the |type()| and |typename()|
+of the enum and enumvalue: >vim9
+ vim9script
+ enum Quad
+ Square('four', 'only'),
+ Rhombus('opposite', 'no')
+ var eq: string
+ var ra: string
+ def string(): string
+ return $"\nA {this.name} has " ..
+ $"{this.eq} equal sides and {this.ra} right angles\n\n"
+ enddef
+ endenum
+ echo "Rhombus (r) or Square (s)?"
+ var myQuad: Quad = getcharstr() =~ '\c^R' ? Quad.Rhombus : Quad.Square
+ echo myQuad.string() .. "\ttype()\ttypename()"
+ echo $"Quad \t{Quad->type()} \t{Quad->typename()}"
+ echo $"myQuad\t{myQuad->type()}\t{myQuad->typename()}"
+<
+ Notes: This script uses builtin method "string()" (|object-string()|).
+ The typename() of Quad and myQuad are the same ("enum")
+ whereas the type() is distinguished (myQuad returns 16,
+ enumvalue, whereas Quad returns 15, enum).
Variable types and type casting ~
*variable-types*
Variables declared in Vim9 script or in a `:def` function have a type, either
specified explicitly or inferred from the initialization.
-Global, buffer, window and tab page variables do not have a specific type, the
-value can be changed at any time, possibly changing the type. Therefore, in
-compiled code the "any" type is assumed.
-
-This can be a problem when the "any" type is undesired and the actual type is
-expected to always be the same. For example, when declaring a list: >
- var l: list = [1, g:two]
-At compile time Vim doesn't know the type of "g:two" and the expression type
-becomes list. An instruction is generated to check the list type before
-doing the assignment, which is a bit inefficient.
- *type-casting* *E1104*
-To avoid this, use a type cast: >
- var l: list = [1, g:two]
-The compiled code will then only check that "g:two" is a number and give an
-error if it isn't. This is called type casting.
-
-The syntax of a type cast is: "<" {type} ">". There cannot be white space
-after the "<" or before the ">" (to avoid them being confused with
-smaller-than and bigger-than operators).
-
-The semantics is that, if needed, a runtime type check is performed. The
-value is not actually changed. If you need to change the type, e.g. to change
-it to a string, use the |string()| function. Or use |str2nr()| to convert a
+Global, buffer, window and tab page variables do not have a specific type.
+Consequently, their values may change at any time, possibly changing the type.
+Therefore, in compiled code, the "any" type is assumed.
+
+This can be a problem when stricter typing is desired, for example, when
+declaring a list: >
+ var l: list = [1, b:two]
+Since Vim doesn't know the type of "b:two", the expression becomes list.
+A runtime check verifies the list matches the declared type before assignment.
+
+ *type-casting*
+To get more specific type checking, use type casting. This checks the
+variable's type before building the list, rather than checking whether
+list items match the declared type. For example: >
+ var l: list = [1, b:two]
+<
+So, here the type cast checks whether "b:two" is a number and gives an error
+if it isn't.
+
+The difference is demonstrated in the following example. With funcref
+variable "NTC", Vim infers the expression type "[1, b:two]" as list, then
+verifies whether it can be assigned to the list return type. With
+funcref variable "TC", the type cast means Vim first checks whether "b:two" is
+a type: >vim9
+
+ vim9script
+ b:two = '2'
+ const NTC: func = (): list => {
+ return [1, b:two]
+ }
+ disassemble NTC # 3 CHECKTYPE list stack [-1]
+ try
+ NTC()
+ catch
+ echo v:exception .. "\n\n" # expected list but...
+ endtry
+ const TC: func = (): list => {
+ return [1, b:two]
+ }
+ disassemble TC # 2 CHECKTYPE number stack [-1]
+ try
+ TC()
+ catch
+ echo v:exception # expected number but got string
+ endtry
+<
+ Note: Notice how the error messages differ, showing when
+ type checking occurs.
+
+ *E1104*
+The syntax of a type cast is "<{type}>". An error occurs if either the
+opening "<" (|E121|) or closing ">" (E1104) is omitted. Also, white space
+is not allowed either after the "<" (|E15|) or before the ">" (|E1068|), which
+avoids ambiguity with smaller-than and greater-than operators.
+
+Although a type casting forces explicit type checking, it neither changes the
+value of, nor the type of, a variable. If you need to alter the type, use a
+function such as |string()| to convert to a string, or |str2nr()| to convert a
string to a number.
-If a type is given where it is not expected you can get *E1272* .
+If type casting is applied to a chained expression, it must be compatible with
+the final result. Examples: >vim9
+
+ vim9script
+ # These type casts work
+ echo >[3, 2, 1]->extend(['Go!'])
+ echo [3, 2, 1]->extend(['Go!'])->string()
+ echo >>[3, 2, 1]->list2tuple()
+ # This type cast fails
+ echo [3, 2, 1]->extend(['Go!'])->string()
+<
+ *E1272*
+If a type is used in a context where types are not expected you can get
+E1272. For example: >
+ :vim9cmd echo islocked('x: string')
+< Note: This must be executed from Vim's command line, not sourced.
+
+ *E1363*
+If a type is incomplete, such as when an object's class is unknown, E1363
+results. For example: >vim9
+
+ vim9script
+ var E1363 = null_class.member # E1363: Incomplete type
+<
+Another null object-related error is |E1360|: >vim9
-If a type is incomplete you get *E1363* , e.g. when you have an object for
-which the class is not known (usually that is a null object).
+ vim9script
+ var obj = null_object
+ var E1360 = obj.MyMethod() # E1360: Using a null object
+<
Type inference ~
*type-inference*
-In general: Whenever the type is clear it can be omitted. For example, when
-declaring a variable and giving it a value: >
- var name = 0 # infers number type
- var name = 'hello' # infers string type
-
-The type of a list and dictionary comes from the common type of the values.
-If the values all have the same type, that type is used for the list or
-dictionary. If there is a mix of types, the "any" type is used. >
- [1, 2, 3] list
- ['a', 'b', 'c'] list
- [1, 'x', 3] list
-
-The common type of function references, if they do not all have the same
-number of arguments, uses "(...)" to indicate the number of arguments is not
-specified. For example: >
- def Foo(x: bool)
+Declaring types explicitly provides many benefits, including targeted type
+checking and clearer error messages. Nonetheless, Vim often can infer types
+automatically when they are omitted. For example, each of these variables'
+types are inferred, with the |type()| and |typename()| echoed showing those
+inferred types: >vim9
+
+ vim9script
+ echo "\t type()\t typename()"
+ var b = true | echo $"{b} \t {b->type()} \t {b->typename()}"
+ var f = 4.2 | echo $"{f} \t {f->type()} \t {f->typename()}"
+ var l = [1, 2] | echo $"{l} \t {l->type()} \t {l->typename()}"
+ var n = 42 | echo $"{n} \t {n->type()} \t {n->typename()}"
+ var s = 'yes' | echo $"{s} \t {s->type()} \t {s->typename()}"
+ var t = (42, ) | echo $"{t} \t {t->type()} \t {t->typename()}"
+<
+The type of a list, tuple, or dictionary is inferred from the common type of
+its values. When the values are all the same type, that type is used.
+If there is a mix of types, the "any" type is used. In the following example,
+the echoed |typename()| for each literal demonstrates these points: >vim9
+
+ vim9script
+ echo [1, 2]->typename() # list
+ echo [1, 'x']->typename() # list
+ echo {ints: [1, 2], bools: [false]}->typename() # dict>
+ echo (true, false)->typename() # tuple
+<
+The common type of function references, when they do not all have the same
+number of arguments, is indicated with "(...)", meaning the number of
+arguments is unequal. This script demonstrates a "list": >vim9
+
+ vim9script
+ def Foo(x: bool): void
enddef
- def Bar(x: bool, y: bool)
+ def Bar(x: bool, y: bool): void
enddef
var funclist = [Foo, Bar]
echo funclist->typename()
-Results in:
- list
+<
+Script-local variables in a Vim9 script are type checked. The type is
+also checked for variables declared in a legacy function. For example: >vim9
-For script-local variables in Vim9 script the type is checked, also when the
-variable was declared in a legacy function.
+ vim9script
+ var my_local = (1, 2)
+ function Legacy()
+ let b:legacy = [1, 2]
+ endfunction
+ Legacy()
+ echo $"{my_local} is type {my_local->type()} ({my_local->typename()})"
+ echo $"{b:legacy} is type {b:legacy->type()} ({b:legacy->typename()})"
+<
+ *E1013*
+When a type is declared for a List, Tuple, or Dictionary, the type is attached
+to it. Similarly, if a type is not declared, the type Vim infers is attached.
+In either case, if an expression attempts to change the type, E1013 results.
+This example has its type inferred and demonstrates E1013: >vim9
-When a type has been declared this is attached to a List or Dictionary. When
-later some expression attempts to change the type an error will be given: >
- var ll: list = [1, 2, 3]
- ll->extend(['x']) # Error, 'x' is not a number
+ vim9script
+ var lb = [true, true] # Two bools, so Vim infers list type
+ echo lb->typename() # Echoes list
+ lb->extend([0]) # E1013 Argument 2: type mismatch, ...
+<
+If you want a permissive list, either explicitly use or declare an
+empty list initially (or both, i.e., `list = []`). Examples: >vim9
-If the type is not declared then it is allowed to change: >
- [1, 2, 3]->extend(['x']) # result: [1, 2, 3, 'x']
+ vim9script
+ final la: list = []
+ echo la->extend(['two', 1])
+ final le = []
+ echo le->extend(la)
+<
+Similarly for a permissive dictionary: >vim9
-For a variable declaration an inferred type matters: >
- var ll = [1, 2, 3]
- ll->extend(['x']) # Error, 'x' is not a number
-That is because the declaration looks like a list of numbers, thus is
-equivalent to: >
- var ll: list = [1, 2, 3]
-If you do want a more permissive list you need to declare the type: >
- var ll: list = [1, 2, 3]
- ll->extend(['x']) # OK
+ vim9script
+ final da: dict = {}
+ echo da->extend({2: 2, 1: 'One'})
+ final de = {}
+ echo de->extend(da)->string()
+<
+And, although tuples themselves are immutable, permissive tuple concatenation
+can be achieved with either "any" or an empty tuple: >vim9
+ vim9script
+ var t_any: tuple<...list> = (3, '2')
+ t_any = t_any + (true, )
+ echo t_any
+ var t_dec_empty = ()
+ t_dec_empty = t_dec_empty + (3, '2', true)
+ echo t_dec_empty
+<
+If a list literal or dictionary literal is not bound to a variable, its type
+may change, as this example shows: >vim9
+
+ vim9script
+ echo [3, 2, 1]->typename() # list
+ echo [3, 2, 1]->extend(['Zero'])->typename() # list
+ echo {1: ['One']}->typename() # dict>
+ echo {1: ['One']}->extend({2: [2]})->typename() # dict>
+<
Stricter type checking ~
- *type-checking*
+ *type-checking*
In legacy Vim script, where a number was expected, a string would be
automatically converted to a number. This was convenient for an actual number
such as "123", but leads to unexpected problems (and no error message) if the
string doesn't start with a number. Quite often this leads to hard-to-find
-bugs. e.g.: >
+bugs. For example, in legacy Vim script this echoes "1": >vim
+
echo 123 == '123'
-< 1 ~
-With an accidental space: >
+<
+However, if an unintended space is included, "0" is echoed: >vim
+
echo 123 == ' 123'
-< 0 ~
- *E1206* *E1210* *E1212*
+<
+ *E1206*
In Vim9 script this has been made stricter. In most places it works just as
-before if the value used matches the expected type. There will sometimes be
-an error, thus breaking backwards compatibility. For example:
-- Using a number other than 0 or 1 where a boolean is expected. *E1023*
-- Using a string value when setting a number option.
-- Using a number where a string is expected. *E1024* *E1105*
+before if the value used matches the expected type. For example, in both
+legacy Vim script and Vim9 script trying to use anything other than a
+dictionary when it is required: >vim
+
+ echo [8, 9]->keys()
+ vim9cmd echo [8, 9]->keys() # E1206: Dictionary required
+<
+ *E1023* *E1024* *E1029* *E1030*
+ *E1174* *E1175* *E1210* *E1212*
+However, sometimes there will be an error in Vim9 script, which breaks
+backwards compatibility. The following examples illustrate various places
+this happens. The legacy Vim script behavior, which does not fail, is shown
+first. It is followed by the error that occurs if the same command is used
+in Vim9 script.
+
+ - Using a number (except 0 or 1) where a bool is expected: >vim
+
+ echo v:version ? v:true : v:false
+ vim9cmd echo v:version ? true : false # E1023: Using a Number as a...
+<
+ - Using a number where a string is expected: >vim
+
+ echo filter([1, 2], 0)
+ vim9cmd echo filter([1, 2], 0) # E1024: Using a Number as a String
+<
+ - Not using a number where a number is expected: >vim
+
+ " In this example, Vim script treats v:false as 0
+ function Not1029()
+ let b:l = [42] | unlet b:l[v:false]
+ endfunction
+ call Not1029() | echo b:l
+< >vim9
+ vim9script
+ def E1029(): void
+ b:l = [42] | unlet b:l[false]
+ enddef
+ E1029() # E1029: Expected number but got bool
+<
+ - Using a string as a number: >vim
+
+ let b:l = [42] | unlet b:l['#'] | echo b:l
+ vim9cmd b:l = [42] | vim9cmd unlet b:l['#'] # E1030: Using a string...
+<
+ - Not using a string where an argument requires a string: >vim9
+
+ echo substitute('Hallo', 'a', 'e', v:true)
+ vim9cmd echo substitute('Hallo', 'a', 'e', true) # E1174: String...
+<
+ - Using an empty string in an argument that requires a non-empty string: >vim9
+
+ echo exepath('')
+ vim9cmd echo exepath('') # E1175: Non-empty string required for arg...
+<
+ - Not using a number when it is required: >vim
+
+ echo gettabinfo('a')
+ vim9cmd echo gettabinfo('a') # E1210: Number required for argument 1
+<
+ - Not using a bool when it is required: >vim
+
+ echo char2nr('¡', 2)
+ vim9cmd echo char2nr('¡', 2) # E1212: Bool required for argument 2
+<
+ - Not using a number when a number is required (|E521|): >vim
+
+ let &laststatus='2'
+ vim9cmd &laststatus = '2'
+<
+ - Not using a string when a string is required (|E928|): >vim
+
+ let &langmenu = 42
+ vim9cmd &langmenu = 42 # E928: String required
+<
+ - Comparing a |Special| with 'is' fails in some instances (|E1037|, |E1072|): >vim
+
+ " 1 is echoed because these are both true
+ echo v:null is v:null && v:none is v:none
+ " 0 is echoed because all these expressions are false
+ echo v:none is v:null || v:none is 8 || v:true is v:none
+ " All these are errors in Vim9 script
+ vim9cmd echo v:null is v:null # E1037: Cannot use 'is' with special
+ vim9cmd echo v:none is v:none # E1037: Cannot use 'is' with special
+ vim9cmd echo v:none is v:null # E1037: Cannot use 'is' with special
+ vim9cmd echo v:none is 8 # E1072: Cannot compare special with numb
+ vim9cmd echo v:true is v:none # E1072: Cannot compare bool with special
+<
+ Note: Although the last two Vim9 script examples above error using
+ `v:none`, they return `false` using `null` (which is the same
+ as `v:null` - see |v:null|): >vim9
+
+ vim9script
+ echo null is 8 # false
+ echo true is null # false
+<
+ - Using a string where a bool is required (|E1135|): >vim
+ echo '42' ? v:true : v:false
+ vim9cmd echo '42' ? true : false # E1135: Using a String as a Bool
+<
+ - Using a bool as a number (|E1138|): >vim
+
+ let &laststatus=v:true
+ vim9cmd &laststatus = true
+<
+ - Not using a string where an argument requires a string (|E1174|) >vim
+
+ echo substitute('Hallo', 'a', 'e', v:true)
+ vim9cmd echo substitute('Hallo', 'a', 'e', true) # E1174: String...
+<
One consequence is that the item type of a list or dict given to |map()| must
-not change, if the type was declared. This will give an error in Vim9
-script: >
- var mylist: list = [1, 2, 3]
- echo map(mylist, (i, v) => 'item ' .. i)
-< E1012: Type mismatch; expected number but got string in map() ~
-
-Instead use |mapnew()|, it creates a new list: >
- var mylist: list = [1, 2, 3]
- echo mapnew(mylist, (i, v) => 'item ' .. i)
-< ['item 0', 'item 1', 'item 2'] ~
-
-If the item type was not declared or determined to be "any" it can change to a
-more specific type. E.g. when a list of mixed types gets changed to a list of
-strings: >
- var mylist = [1, 2.0, '3']
- # typename(mylist) == "list"
- map(mylist, (i, v) => 'item ' .. i)
- # typename(mylist) == "list", no error
-
-There is a subtle difference between using a list constant directly and
-through a variable declaration. Because of type inference, when using a list
-constant to initialize a variable, this also sets the declared type: >
- var mylist = [1, 2, 3]
- # typename(mylist) == "list"
- echo map(mylist, (i, v) => 'item ' .. i) # Error!
-
-When using the list constant directly, the type is not declared and is allowed
-to change: >
- echo map([1, 2, 3], (i, v) => 'item ' .. i) # OK
-
-The reasoning behind this is that when a type is declared and the list is
-passed around and changed, the declaration must always hold. So that you can
-rely on the type to match the declared type. For a constant this is not
-needed.
-
- *E1158*
-Same for |extend()|, use |extendnew()| instead, and for |flatten()|, use
-|flattennew()| instead. Since |flatten()| is intended to always change the
-type, it can not be used in Vim9 script.
+not change when its type is either declared or inferred. For example, this
+gives an error in Vim9 script, whereas in legacy Vim script it is allowed: >vim
+
+ " legacy Vim script changes s:mylist to ['item 0', 'item 1']
+ let s:mylist = [0, 1]
+ call map(s:mylist, {i -> $"item {i}"})
+ echo s:mylist
+< >vim9
+ vim9script
+ var mylist = [0, 1] # Vim infers mylist is list
+ map(mylist, (i, _) => $"item {i}") # E1012: type mismatch...
+<
+The error occurs because `map()` tries to modify the list elements to strings,
+which conflicts with the declared type.
+
+Use |mapnew()| instead. It creates a new list, and Vim infers its type if it
+is not specified. Inferred and declared types are shown in this example: >vim9
+
+ vim9script
+ var mylist = [0, 1]
+ var infer = mylist->mapnew((i, _) => $"item {i}")
+ echo [infer, infer->typename()]
+ var declare: list = mylist->mapnew((i, _) => $"item {i}")
+ echo [declare, declare->typename()]
+<
+The key concept here is, variables with declared or inferred types cannot
+have the types of the elements within their containers change. However, type
+"changes" are allowed for either:
+ - a container literal (not bound to a variable), or
+ - a container where |copy()| or |deepcopy()| is used in method chaining.
+Both are demonstrated in this example: >vim9
+
+ vim9script
+ # list literal
+ echo [1, 2]->map((_, v) => $"#{v}")
+ echo [1, 2]->map((_, v) => $"#{v}")->typename()
+ # deepcopy() in a method chain
+ var mylist = [1, 2]
+ echo mylist->deepcopy()->map((_, v) => $"#{v}")
+ echo mylist->deepcopy()->map((_, v) => $"#{v}")->typename()
+ echo mylist
+<
+The reasoning behind this is, when a type is either declared or inferred
+and the list is passed around and changed, the declaration/inference must
+always hold so that you can rely on the type to match the declared/inferred
+type. For either a list literal or a fully copied list, that type safety is
+not needed because the original list is unchanged (as "echo mylist" shows,
+above).
+
+If the item type was not declared or determined to be "", it will not
+change, even if all items later become the same type. However, when `mapnew()`
+is used, inference means that the new list will reflect the type(s) present.
+For example: >vim9
+
+ vim9script
+ # list
+ var mylist = [1, '2'] # mixed types, i.e., list
+ echo (mylist, mylist->typename()) # ([1, '2'], 'list')
+ mylist->map((_, v) => $"item {v}") # all items are now strings
+ echo (mylist, mylist->typename()) # both strings, but list
+ # mapnew()
+ var newlist = mylist->mapnew((_, v) => v)
+ echo (newlist, newlist->typename()) # newlist is a list
+<
+Using |extend()| and |extendnew()| is similar, i.e., a list literal may use
+the former, so, this is okay: >vim9
+
+ vim9cmd echo [1, 2]->extend(['3']) # [1, 2, 3]
+<
+whereas, this is not: >vim9
+
+ vim9script
+ var mylist: list = [1, 2]
+ echo mylist->extend(['3']) # E1013: Argument 2: type mismatch
+<
+Using |extendnew()| is needed for extending an existing typed list, except
+where the extension matches the list's type (or it is "any"). For example,
+first extending with an element of the same type, then extending with a
+different type: >vim9
+
+ vim9script
+ var mylist: list = [1, 2]
+ mylist->extend([3])
+ echo mylist->extendnew(['4']) # [1, 2, 3, '4']
+
+< *E1158*
+Using |flatten()| is not allowed in Vim9 script, because it is intended
+always to change the type. This even applies to a list literal
+(unlike |map()| and |extend()|). Instead, use |flattennew()|: >vim9
+ vim9cmd [1, [2, 3]]->flatten() # E1158: Cannot use flatten
+ vim9cmd echo [1, [2, 3]]->flattennew() # [1, 2, 3]
+<
Assigning to a funcref with specified arguments (see |vim9-func-declaration|)
-does strict type checking of the arguments. For variable number of arguments
-the type must match: >
- var FuncRef: func(string, number, bool): number
- FuncRef = (v1: string, v2: number, v3: bool) => 777 # OK
- FuncRef = (v1: string, v2: number, v3: number) => 777 # Error!
- # variable number of arguments must have same type
- var FuncVA: func(...list): number
- FuncVA = (...v: list): number => v # Error!
- FuncVA = (...v: list): number => v # OK, `any` runtime check
- FuncVA = (v1: string, v: string2): number => 333 # Error!
- FuncVA = (v: list): number => 3 # Error!
-
-If the destination funcref has no specified arguments, then there is no
-argument type checking: >
- var FuncUnknownArgs: func: number
- FuncUnknownArgs = (v): number => v # OK
- FuncUnknownArgs = (v1: string, v2: string): number => 3 # OK
- FuncUnknownArgs = (...v1: list): number => 333 # OK
-<
- *E1211* *E1217* *E1218* *E1219* *E1220* *E1221*
- *E1222* *E1223* *E1224* *E1225* *E1226* *E1227*
- *E1228* *E1235* *E1238* *E1250* *E1251* *E1252*
- *E1253* *E1256* *E1297* *E1298* *E1301* *E1528*
- *E1529* *E1530* *E1531* *E1534*
+involves strict type checking of the arguments. For example, this works: >vim9
+
+ vim9script
+ var F_name_age: func(string, number): string
+ F_name_age = (n: string, a: number): string => $"Name: {n}, Age: {a}"
+ echo F_name_age('Bob', 42)
+<
+whereas this fails with error |E1012| (type mismatch): >vim9
+
+ vim9script
+ var F_name_age: func(string, number): string
+ F_name_age = (n: string, a: string): string => $"Name: {n}, Age: {a}"
+<
+If there is a variable number of arguments they must have the same type, as in
+this example: >vim9
+
+ vim9script
+ var Fproduct: func(...list): number
+ Fproduct = (...v: list): number => reduce(v, (a, b) => a * b)
+ echo Fproduct(3, 2, 4) # Echoes 24
+<
+And may be used to accommodate mixed types: >vim9
+
+ vim9script
+ var FlatSort: func(...list): any
+ FlatSort = (...v: list) => flattennew(v)->sort('n')
+ echo FlatSort(true, [[[5, 3], 2], 4]) # Echoes [true, 2, 3, 4, 5]
+<
+ Note: Using in a lambda does not avoid type checking of the
+ funcref. It remains constrained by the declared funcref's
+ type and, as these examples show, a runtime or compiling error
+ occurs when the types mismatch: >vim9
+
+ vim9script
+ var FuncSN: func(string): number
+ FuncSN = (v: any): number => v->str2nr()
+ echo FuncSN('162')->nr2char() # Echoes ¢
+ echo FuncSN(162)->nr2char()) # E1013 (runtime error)
+< >vim9
+ vim9script
+ var FuncSN: func(string): number
+ FuncSN = (v: any): number => v->str2nr()
+ def FuncSNfail(): void
+ echo FuncSN('162')->nr2char() # No echo because ...
+ echo FuncSN(162)->nr2char() # Error while compiling
+ enddef
+ FuncSNfail()
+<
+When the funcref has no arguments specified, there is no type checking. This
+example shows FlexArgs has a string argument the first time and a list the
+following time: >vim9
+
+ vim9script
+ var FlexArgs: func: string
+ FlexArgs = (s: string): string => $"It's countdown time {s}..."
+ echo FlexArgs("everyone")
+ FlexArgs = (...values: list): string => join(values, ', ')
+ echo FlexArgs('3', '2', '1', 'GO!')
+<
+ *E1211* *E1217* *E1218* *E1219* *E1220* *E1221* *E1222*
+ *E1223* *E1224* *E1225* *E1226* *E1228* *E1235* *E1238*
+ *E1251* *E1253* *E1256* *E1297* *E1298* *E1301* *E1528*
+ *E1529* *E1530* *E1531* *E1534*
Types are checked for most builtin functions to make it easier to spot
-mistakes.
+mistakes. The following one-line |:vim9| commands, calling builtin functions,
+demonstrate many of those type-checking errors: >vim9
+
+ vim9 9->list2blob() # E1211: List required for argument 1
+ vim9 9->ch_close() # E1217: Channel or Job required for
+ vim9 9->job_info() # E1218: Job required for argument 1
+ vim9 [9]->cos() # E1219: Float or Number required for
+ vim9 {}->remove([]) # E1220: String or Number required
+ vim9 null_channel->ch_evalraw(9) # E1221: String or Blob required for
+ vim9 9->col() # E1222: String or List required for
+ vim9 9->complete_add() # E1223: String or Dictionary require
+ vim9 setbufline(9, 9, {}) # E1224: String, Number or List
+ vim9 9->count(9) # E1225: String, List, Tuple or Dict
+ vim9 9->add(9) # E1226: List or Blob required for
+ vim9 9->remove(9) # E1228: List, Dictionary, or Blob
+ vim9 getcharstr('9') # E1235: Bool or number required for
+ vim9 9->blob2list() # E1238: Blob required for argument 1
+ vim9 9->filter(9) # E1251: List, Tuple, Dictionary, Blo
+ vim9 9->reverse() # E1253: String, List, Tuple or Blob
+ vim9 9->call(9) # E1256: String or Function required
+ vim9 null_dict->winrestview() # E1297: Non-NULL Dictionary required
+ vim9 {}->prop_add_list(null_list) # E1298: Non-NULL List required for
+ vim9 {}->repeat(9) # E1301: String, Number, List, Tuple
+ vim9 9->index(9) # E1528: List or Tuple or Blob
+ vim9 9->join() # E1529: List or Tuple required for
+ vim9 9->max() # E1530: List or Tuple or Dictionary
+ vim9 9->get(9) # E1531: Argument of get() must be a
+ vim9 9->tuple2list() # E1534: Tuple required for argument
+<
+Reserved for future use: *E1227* *E1250* *E1252*
+ E1227: List or Dictionary required for argument %d
+ E1250: Argument of %s must be a List, String, Dictionary or Blob
+ E1252: String, List or Blob required for argument %d
+
Categories of variables, defaults and null handling ~
- *variable-categories* *null-variables*
-There are categories of variables:
+ *variable-categories* *null-variables*
+There are three categories of variables:
primitive number, float, boolean
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
-provided. Each category has different default initialization semantics. Here's
-an example for each category: >
- var num: number # primitives default to a 0 equivalent
- var cont: list # containers default to an empty container
- var spec: job # specialized variables default to null
-<
-Vim does not have a familiar null value; it has various null_ predefined
-values, for example |null_string|, |null_list|, |null_job|. Primitives do not
-have a null_. The typical use cases for null_ are:
-- to clear a variable and release its resources;
-- as a default for a parameter in a function definition, see |null-compare|.
+provided. Each category has different default initialization semantics.
+
+Primitives default to type-specific values. All primitives are empty but do
+not equal `null`: >vim9
+
+ vim9script
+ var n: number | echo [n, n->empty(), n == null] # [0, 1, false]
+ var f: float | echo [f, f->empty(), f == null] # [0.0, 1, false]
+ var b: bool | echo [b, b->empty(), b == null] # [false, 1, false]
+<
+Containers default to an empty container. Only an empty string equals `null`: >vim9
+
+ vim9script
+ var s: string | echo [s, s->empty(), s == null] # ['', 1, true]
+ var z: blob | echo [z, z->empty(), z == null] # [0z, 1, false]
+ var l: list | echo [l, l->empty(), l == null] # [[], 1, false]
+ var t: tuple | echo [t, t->empty(), t == null] # [(), 1, false]
+ var d: dict | echo [d, d->empty(), d == null] # [{}, 1, false]
+<
+Specialized types default to equaling `null`: >vim9
+
+ vim9script
+ var F: func | echo [F, F == null] # [function(''), true]
+ var j: job | echo [j, j == null] # ['no process', true]
+ var c: channel | echo [c, c == null] # ['channel fail', true]
+ class Class
+ endclass
+ var o: Class | echo [o, o == null] # [object of [unknown], true]
+ enum Enum
+ endenum
+ var e: Enum | echo [e, e == null] # [object of [unknown], true]
+<
+ Note: See |empty()| for explanations of empty job, empty channel, and
+ empty object types.
+
+Vim does not have a familiar null value. Instead, it has various null_
+predefined values including |null_string|, |null_list|, and |null_job|.
+Primitives do not have a null_. Typical use cases for null_ are:
+ - to clear a variable and release its resources,
+ - as a default for a parameter in a function definition (for an example,
+ see |null_blob|), or
+ - assigned to a container or specialized variable to set it to null
+ for later comparison (for an example, see |null-compare|).
For a specialized variable, like `job`, null_ is used to clear the
-resources. For a container variable, resources can also be cleared by
-assigning an empty container to the variable. For example: >
- var j: job = job_start(...)
- # ... job does its work
- j = null_job # clear the variable and release the job's resources
-
- var l: list
- # ... add lots of stuff to list
- l = [] # clear the variable and release container resources
-Using the empty container, rather than null_, to clear a container
-variable may avoid null complications as described in |null-anomalies|.
+resources. For example: >vim9
+
+ vim9script
+ var mydate: list
+ def Date(channel: channel, msg: string): void
+ mydate->add(msg)
+ enddef
+ var myjob = job_start([&shell, &shellcmdflag, 'date'], {out_cb: Date})
+ echo [myjob, myjob->job_status()]
+ sleep 2
+ echo $"The date and time is {mydate->join('')}"
+ echo [myjob, myjob->job_status()]
+ myjob = null_job # Clear the variable; release the job's resources.
+ echo myjob
+<
+For a container variable, resources may also be cleared by assigning an
+empty container to the variable. For example: >vim9
+
+ vim9script
+ var perfect: list = [1, 4]
+ perfect->extend([9, 16, 25])
+ perfect = []
+ echo perfect
+
+Using an empty container, rather than null_, to clear a container
+variable may avoid null complications - see |null-anomalies|.
The initialization semantics of container variables and specialized variables
-differ. An uninitialized container defaults to an empty container: >
- var l1: list # empty container
- var l2: list = [] # empty container
- var l3: list = null_list # null container
-"l1" and "l2" are equivalent and indistinguishable initializations; but "l3"
-is a null container. A null container is similar to, but different from, an
-empty container, see |null-anomalies|.
-
-Specialized variables default to null. These job initializations are
-equivalent and indistinguishable: >
+differ. For containers:
+ - An uninitialized container defaults to empty but does not equal `null`
+ (except for a uninitialized string).
+ - A container initialized to [], (), {}, "", or 0z is empty but does not
+ equal `null`.
+ - A container initialized as null_ defaults to empty and equals `null`.
+
+In the following example, the uninitialized list ("lu") and [] initialized
+list ("li") are equivalent and indistinguishable whereas "ln" is a null
+container, which is similar to, but not equivalent to, an empty container
+(see |null-anomalies|). >vim9
+
+ vim9script
+ # uninitialized: empty container, not null
+ var lu: list
+ echo ['lu', $"empty={lu->empty()}", $"null={lu == null}"]
+ # initialized: empty container, not null
+ var li: list = []
+ echo ['li', $"empty={li->empty()}", $"null={li == null}"]
+ # initialized: empty container, null
+ var ln: list