diff --git a/appveyor.yml b/.appveyor.yml similarity index 74% rename from appveyor.yml rename to .appveyor.yml index eb720f47dd75c7..80f8e38f0b02fa 100644 --- a/appveyor.yml +++ b/.appveyor.yml @@ -5,16 +5,17 @@ skip_tags: true environment: matrix: - FEATURE: HUGE - - FEATURE: NORMAL # disabled # - FEATURE: TINY # - FEATURE: SMALL +# - FEATURE: NORMAL # - FEATURE: BIG matrix: fast_finish: true before_build: + # Use Windows SDK 7.1 (= MSVC 2010) - '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /release' - 'set INCLUDE=%INCLUDE%C:\Program Files (x86)\Windows Kits\8.1\Include\um' @@ -25,9 +26,9 @@ test_script: - cd src/testdir # Testing with MSVC gvim - path C:\Python35-x64;%PATH% - - nmake -f Make_dos.mak POSTSCRIPT=yes VIMPROG=..\gvim + - nmake -f Make_dos.mak VIMPROG=..\gvim - nmake -f Make_dos.mak clean - # Testing with MingW console version - - nmake -f Make_dos.mak POSTSCRIPT=yes VIMPROG=..\vim + # Testing with MSVC console version + - nmake -f Make_dos.mak VIMPROG=..\vim # vim: sw=2 sts=2 et ts=8 sr diff --git a/.cirrus.yml b/.cirrus.yml index 97fb0f1f6a559b..4d78085b8d4667 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,6 +3,8 @@ env: FEATURES: huge freebsd_12_task: + only_if: $CIRRUS_TAG == '' + timeout_in: 20m freebsd_instance: image: freebsd-12-1-release-amd64 install_script: @@ -11,6 +13,9 @@ freebsd_12_task: - NPROC=$(getconf _NPROCESSORS_ONLN) - ./configure --with-features=${FEATURES} - make -j${NPROC} - - src/vim --version test_script: - - make test + - src/vim --version + # run tests as user "cirrus" instead of root + - pw useradd cirrus -m + - chown -R cirrus:cirrus . + - sudo -u cirrus make test diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000000000..6140fe9669bb36 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,6 @@ +coverage: + range: "80...100" + status: + project: + default: + threshold: 0.05% diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 00000000000000..1157ff25678377 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1 @@ +service_name: github-actions diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000000000..b95e493ec2f84b --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,204 @@ +# Lines starting with '#' are comments. +# Each line is a file pattern followed by one or more owners. +# You can use github users with @user or email addresses + +# These owners will be the default owners for everything in the repo. +#* @brammool + +# Order is important. The last matching pattern has the most precedence. +# So if a pull request only touches javascript files, only these owners +# will be requested to review. + +src/iscygpty.* @k-takata +src/libvterm/ @leonerd + +runtime/autoload/getscript.vim @cecamp +runtime/autoload/netrw.vim @cecamp +runtime/autoload/netrwFileHandlers.vim @cecamp +runtime/autoload/netrwSettings.vim @cecamp +runtime/autoload/rubycomplete.vim @segfault @dkearns +runtime/autoload/tar.vim @cecamp +runtime/autoload/vimball.vim @cecamp +runtime/autoload/xmlformat.vim @chrisbra +runtime/autoload/zip.vim @cecamp +runtime/compiler/checkstyle.vim @dkearns +runtime/compiler/cucumber.vim @tpope +runtime/compiler/dart.vim @dkearns +runtime/compiler/dart2js.vim @dkearns +runtime/compiler/dart2native.vim @dkearns +runtime/compiler/dartanalyser.vim @dkearns +runtime/compiler/dartdevc.vim @dkearns +runtime/compiler/dartdoc.vim @dkearns +runtime/compiler/dartfmt.vim @dkearns +runtime/compiler/eruby.vim @dkearns +runtime/compiler/fbc.vim @dkearns +runtime/compiler/gawk.vim @dkearns +runtime/compiler/gjs.vim @dkearns +runtime/compiler/haml.vim @tpope +runtime/compiler/javac.vim @dkearns +runtime/compiler/jest.vim @dkearns +runtime/compiler/jjs.vim @dkearns +runtime/compiler/jshint.vim @dkearns +runtime/compiler/jsonlint.vim @dkearns +runtime/compiler/lazbuild.vim @dkearns +runtime/compiler/php.vim @dkearns +runtime/compiler/rake.vim @tpope @dkearns +runtime/compiler/rhino.vim @dkearns +runtime/compiler/rspec.vim @tpope @dkearns +runtime/compiler/rubocop.vim @dkearns +runtime/compiler/ruby.vim @tpope @dkearns +runtime/compiler/rubyunit.vim @dkearns +runtime/compiler/sass.vim @tpope +runtime/compiler/se.vim @dkearns +runtime/compiler/shellcheck.vim @dkearns +runtime/compiler/sml.vim @dkearns +runtime/compiler/stylelint.vim @dkearns +runtime/compiler/tcl.vim @dkearns +runtime/compiler/tidy.vim @dkearns +runtime/compiler/ts-node.vim @dkearns +runtime/compiler/tsc.vim @dkearns +runtime/compiler/typedoc.vim @dkearns +runtime/compiler/xmllint.vim @dkearns +runtime/compiler/xo.vim @dkearns +runtime/compiler/zsh.vim @dkearns +runtime/doc/pi_getscript.txt @cecamp +runtime/doc/pi_logipat.txt @cecamp +runtime/doc/pi_netrw.txt @cecamp +runtime/doc/pi_tar.txt @cecamp +runtime/doc/pi_vimball.txt @cecamp +runtime/doc/pi_zip.txt @cecamp +runtime/ftplugin/awk.vim @dkearns +runtime/ftplugin/basic.vim @dkearns +runtime/ftplugin/bst.vim @tpope +runtime/ftplugin/cfg.vim @chrisbra +runtime/ftplugin/css.vim @dkearns +runtime/ftplugin/cucumber.vim @tpope +runtime/ftplugin/eiffel.vim @dkearns +runtime/ftplugin/eruby.vim @tpope @dkearns +runtime/ftplugin/freebasic.vim @dkearns +runtime/ftplugin/git.vim @tpope +runtime/ftplugin/gitcommit.vim @tpope +runtime/ftplugin/gitconfig.vim @tpope +runtime/ftplugin/gitrebase.vim @tpope +runtime/ftplugin/gitsendemail.vim @tpope +runtime/ftplugin/gprof.vim @dpelle +runtime/ftplugin/haml.vim @tpope +runtime/ftplugin/hgcommit.vim @k-takata +runtime/ftplugin/javascript.vim @dkearns +runtime/ftplugin/javascriptreact.vim @dkearns +runtime/ftplugin/kconfig.vim @chrisbra +runtime/ftplugin/liquid.vim @tpope +runtime/ftplugin/markdown.vim @tpope +runtime/ftplugin/matlab.vim @cecamp +runtime/ftplugin/nroff.vim @a-vrma +runtime/ftplugin/nsis.vim @k-takata +runtime/ftplugin/pdf.vim @tpope +runtime/ftplugin/ruby.vim @tpope @dkearns +runtime/ftplugin/sass.vim @tpope +runtime/ftplugin/scss.vim @tpope +runtime/ftplugin/spec.vim @ignatenkobrain +runtime/ftplugin/tidy.vim @dkearns +runtime/ftplugin/tmux.vim @ericpruitt +runtime/ftplugin/typescript.vim @dkearns +runtime/ftplugin/typescriptreact.vim @dkearns +runtime/ftplugin/xml.vim @chrisbra +runtime/ftplugin/zsh.vim @chrisbra +runtime/indent/bst.vim @tpope +runtime/indent/cucumber.vim @tpope +runtime/indent/dosbatch.vim @k-takata +runtime/indent/eruby.vim @tpope @dkearns +runtime/indent/gitconfig.vim @tpope +runtime/indent/haml.vim @tpope +runtime/indent/liquid.vim @tpope +runtime/indent/nsis.vim @k-takata +runtime/indent/ruby.vim @AndrewRadev @dkearns +runtime/indent/sass.vim @tpope +runtime/indent/scss.vim @tpope +runtime/indent/sh.vim @chrisbra +runtime/indent/teraterm.vim @k-takata +runtime/indent/xml.vim @chrisbra +runtime/indent/zsh.vim @chrisbra +runtime/keymap/tamil_tscii.vim @yegappan +runtime/pack/dist/opt/cfilter/plugin/cfilter.vim @yegappan +runtime/pack/dist/opt/matchit/ @chrisbra +runtime/plugin/getscriptPlugin.vim @cecamp +runtime/plugin/logiPat.vim @cecamp +runtime/plugin/netrwPlugin.vim @cecamp +runtime/plugin/tarPlugin.vim @cecamp +runtime/plugin/vimballPlugin.vim @cecamp +runtime/plugin/zipPlugin.vim @cecamp +runtime/syntax/aidl.vim @dpelle +runtime/syntax/amiga.vim @cecamp +runtime/syntax/asm.vim @dkearns +runtime/syntax/asmh8300.vim @dkearns +runtime/syntax/awk.vim @dkearns +runtime/syntax/basic.vim @dkearns +runtime/syntax/bst.vim @tpope +runtime/syntax/cabal.vim @coot +runtime/syntax/cabalconfig.vim @coot +runtime/syntax/cabalproject.vim @coot +runtime/syntax/cs.vim @nickspoons +runtime/syntax/csh.vim @cecamp +runtime/syntax/cucumber.vim @tpope +runtime/syntax/datascript.vim @dpelle +runtime/syntax/dcl.vim @cecamp +runtime/syntax/doxygen.vim @frogonwheels +runtime/syntax/dtd.vim @chrisbra +runtime/syntax/elmfilt.vim @cecamp +runtime/syntax/eruby.vim @tpope @dkearns +runtime/syntax/exports.vim @cecamp +runtime/syntax/git.vim @tpope +runtime/syntax/gitcommit.vim @tpope +runtime/syntax/gitconfig.vim @tpope +runtime/syntax/gitrebase.vim @tpope +runtime/syntax/gprof.vim @dpelle +runtime/syntax/haml.vim @tpope +runtime/syntax/haskell.vim @coot +runtime/syntax/hgcommit.vim @k-takata +runtime/syntax/kconfig.vim @chrisbra +runtime/syntax/lex.vim @cecamp +runtime/syntax/liquid.vim @tpope +runtime/syntax/lisp.vim @cecamp +runtime/syntax/lynx.vim @dkearns +runtime/syntax/mailcap.vim @dkearns +runtime/syntax/make.vim @rohieb +runtime/syntax/make.vim @rohieb +runtime/syntax/maple.vim @cecamp +runtime/syntax/markdown.vim @tpope +runtime/syntax/netrw.vim @cecamp +runtime/syntax/nsis.vim @k-takata +runtime/syntax/pdf.vim @tpope +runtime/syntax/php.vim @TysonAndre +runtime/syntax/privoxy.vim @dkearns +runtime/syntax/prolog.vim @XVilka +runtime/syntax/rc.vim @chrisbra +runtime/syntax/rpcgen.vim @cecamp +runtime/syntax/ruby.vim @dkearns +runtime/syntax/sass.vim @tpope +runtime/syntax/scss.vim @tpope +runtime/syntax/sh.vim @cecamp +runtime/syntax/sm.vim @cecamp +runtime/syntax/spec.vim @ignatenkobrain +runtime/syntax/sqloracle.vim @chrisbra +runtime/syntax/sshdconfig.vim @Jakuje +runtime/syntax/tags.vim @cecamp +runtime/syntax/teraterm.vim @k-takata +runtime/syntax/tex.vim @cecamp +runtime/syntax/tidy.vim @dkearns +runtime/syntax/tmux.vim @ericpruitt +runtime/syntax/vim.vim @cecamp +runtime/syntax/wget.vim @dkearns +runtime/syntax/xbl.vim @dkearns +runtime/syntax/xmath.vim @cecamp +runtime/syntax/xml.vim @chrisbra +runtime/syntax/xslt.vim @Boobies +runtime/syntax/xxd.vim @cecamp +runtime/syntax/yacc.vim @cecamp +runtime/syntax/zsh.vim @chrisbra +runtime/tutor/tutor.eo @dpelle +runtime/tutor/tutor.eo.utf-8 @dpelle +runtime/tutor/tutor.fr @dpelle +runtime/tutor/tutor.fr.utf-8 @dpelle +src/po/de.po @chrisbra +src/po/eo.po @dpelle +src/po/fr.po @dpelle diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000000..9127455bc1120f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,527 @@ +name: GitHub CI + +on: + push: + branches: ['**'] + pull_request: + +jobs: + linux: + runs-on: ubuntu-18.04 + + env: + CC: ${{ matrix.compiler }} + TEST: test + SRCDIR: ./src + LEAK_CFLAGS: -DEXITFREE + LOG_DIR: ${{ github.workspace }}/logs + TERM: xterm + DISPLAY: ':99' + DEBIAN_FRONTEND: noninteractive + + strategy: + fail-fast: false + matrix: + features: [tiny, small, normal, huge] + compiler: [clang, gcc] + extra: [none] + include: + - features: tiny + compiler: clang + extra: nogui + - features: tiny + compiler: gcc + extra: nogui + - features: normal + shadow: ./src/shadow + - features: huge + coverage: true + - features: huge + compiler: gcc + coverage: true + extra: testgui + - features: huge + compiler: clang + extra: asan + - features: huge + compiler: gcc + coverage: true + extra: unittests + - features: normal + compiler: gcc + extra: vimtags + + steps: + - uses: actions/checkout@v2 + + - name: Install packages + run: | + sudo apt-get install -y \ + autoconf \ + lcov \ + gettext \ + libcanberra-dev \ + libperl-dev \ + python-dev \ + python3-dev \ + liblua5.3-dev \ + lua5.3 \ + ruby-dev \ + tcl-dev \ + cscope \ + libgtk2.0-dev \ + desktop-file-utils \ + libtool-bin + + - name: Install clang-11 + if: matrix.compiler == 'clang' + run: | + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + . /etc/lsb-release + sudo add-apt-repository -y "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-11 main" + sudo apt-get install -y clang-11 + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 100 + sudo update-alternatives --set clang /usr/bin/clang-11 + sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-11 100 + + - name: Set up environment + run: | + mkdir -p "${LOG_DIR}" + mkdir -p "${HOME}/bin" + echo "${HOME}/bin" >> $GITHUB_PATH + ( + echo "LINUX_VERSION=$(uname -r)" + echo "NPROC=$(getconf _NPROCESSORS_ONLN)" + echo "SND_DUMMY_DIR=${HOME}/snd-dummy" + echo "TMPDIR=${{ runner.temp }}" + + case "${{ matrix.features }}" in + tiny|small) + echo "TEST=testtiny" + if ${{ contains(matrix.extra, 'nogui') }}; then + echo "CONFOPT=--disable-gui" + fi + ;; + normal) + ;; + huge) + echo "TEST=scripttests test_libvterm" + echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp" + ;; + esac + + if ${{ matrix.coverage == true }}; then + echo "CFLAGS=--coverage -DUSE_GCOV_FLUSH" + echo "LDFLAGS=--coverage" + fi + if ${{ contains(matrix.extra, 'testgui') }}; then + echo "TEST=-C src testgui" + fi + if ${{ contains(matrix.extra, 'unittests') }}; then + echo "TEST=unittests" + fi + if ${{ contains(matrix.extra, 'asan') }}; then + echo "SANITIZER_CFLAGS=-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer" + echo "ASAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/asan" + echo "UBSAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/ubsan" + echo "LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/src/testdir/lsan-suppress.txt" + fi + if ${{ contains(matrix.extra, 'vimtags') }}; then + echo "TEST=-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim" + fi + ) >> $GITHUB_ENV + + - name: Set up system + run: | + if [[ ${CC} = clang ]]; then + # Use llvm-cov instead of gcov when compiler is clang. + ln -fs /usr/bin/llvm-cov ${HOME}/bin/gcov + fi + # Setup lua5.3 manually since its package doesn't provide alternative. + # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212 + if [[ ${CONFOPT} =~ luainterp ]]; then + sudo update-alternatives --install /usr/bin/lua lua /usr/bin/lua5.3 10 + fi + sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 + sudo usermod -a -G audio "${USER}" + sudo bash ci/setup-xvfb.sh + + - name: Cache snd-dummy + uses: actions/cache@v2 + with: + path: ${{ env.SND_DUMMY_DIR }} + key: linux-${{ env.LINUX_VERSION }}-snd-dummy + + - name: Set up snd-dummy + run: | + if [[ ! -e ${SND_DUMMY_DIR}/snd-dummy.ko ]]; then + bash ci/build-snd-dummy.sh + fi + cd "${SND_DUMMY_DIR}" + sudo insmod soundcore.ko + sudo insmod snd.ko + sudo insmod snd-pcm.ko + sudo insmod snd-dummy.ko + + - name: Check autoconf + if: contains(matrix.extra, 'unittests') + run: | + make -C src autoconf + + - name: Set up shadow dir + if: matrix.shadow + run: | + make -C src shadow + echo "SRCDIR=${{ matrix.shadow }}" >> $GITHUB_ENV + echo "SHADOWOPT=-C ${{ matrix.shadow }}" >> $GITHUB_ENV + + - name: Configure + run: | + ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing + # Append various warning flags to CFLAGS. + sed -i -f ci/config.mk.sed ${SRCDIR}/auto/config.mk + sed -i -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk + + - name: Build + if: (!contains(matrix.extra, 'unittests')) + run: | + make ${SHADOWOPT} -j${NPROC} + + - name: Check version + if: (!contains(matrix.extra, 'unittests')) + run: | + "${SRCDIR}"/vim --version + "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit + "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit + + - name: Test + timeout-minutes: 20 + run: | + do_test() { sg audio "sg $(id -gn) '$*'"; } + do_test make ${SHADOWOPT} ${TEST} + + - name: Coveralls + if: matrix.coverage && success() && github.event_name != 'pull_request' + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + COVERALLS_PARALLEL: true + TRAVIS_JOB_ID: ${{ github.run_id }} + run: | + sudo apt-get install -y python3-setuptools python3-wheel + sudo -H pip3 install pip -U + # needed for https support for coveralls building cffi only works with gcc, not with clang + CC=gcc pip3 install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1 + ~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8 + + - name: Codecov + if: matrix.coverage && success() + run: | + cd "${SRCDIR}" + bash <(curl -s https://codecov.io/bash) -F "${{ matrix.features }}-${{ matrix.compiler }}-${{ matrix.extra }}" + + - name: ASan logs + if: contains(matrix.extra, 'asan') && !cancelled() + run: | + for f in $(grep -lR '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "${LOG_DIR}"); do + asan_symbolize-11 -l "$f" + false # in order to fail a job + done + + coveralls: + runs-on: ubuntu-18.04 + + needs: linux + if: always() && github.event_name != 'pull_request' + + steps: + - name: Parallel finished + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + run: | + curl -k "https://coveralls.io/webhook?repo_token=${COVERALLS_REPO_TOKEN}" -d "payload[build_num]=${GITHUB_RUN_ID}&payload[status]=done" + + macos: + runs-on: macos-latest + + env: + CC: ${{ matrix.compiler }} + TEST: test + SRCDIR: ./src + LEAK_CFLAGS: -DEXITFREE + TERM: xterm + + strategy: + fail-fast: false + matrix: + features: [tiny, huge] + compiler: [clang, gcc] + + steps: + - uses: actions/checkout@v2 + + - name: Install packages + env: + HOMEBREW_NO_AUTO_UPDATE: 1 + run: | + brew install lua + echo "LUA_PREFIX=/usr/local" >> $GITHUB_ENV + + - name: Set up environment + run: | + ( + echo "NPROC=$(getconf _NPROCESSORS_ONLN)" + case "${{ matrix.features }}" in + tiny) + echo "TEST=testtiny" + echo "CONFOPT=--disable-gui" + ;; + huge) + echo "CONFOPT=--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp" + ;; + esac + ) >> $GITHUB_ENV + + - name: Configure + run: | + ./configure --with-features=${{ matrix.features }} ${CONFOPT} --enable-fail-if-missing + # Append various warning flags to CFLAGS. + # BSD sed needs backup extension specified. + sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk + # On macOS, the entity of gcc is clang. + sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk + + - name: Build + env: + LC_ALL: C + run: | + make -j${NPROC} + + - name: Check version + run: | + "${SRCDIR}"/vim --version + "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit + "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit + + - name: Test + timeout-minutes: 20 + run: | + make ${TEST} + + windows: + runs-on: windows-latest + + env: + VCVARSALL: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat + # Interfaces + # Lua + LUA_VER: 54 + LUA_VER_DOT: '5.4' + LUA_RELEASE: 5.4.0 + LUA32_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win32_dllw6_lib.zip + LUA64_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win64_dllw6_lib.zip + LUA_DIR: D:\Lua + # Python 2 + PYTHON_VER: 27 + PYTHON_VER_DOT: '2.7' + # Python 3 + PYTHON3_VER: 38 + PYTHON3_VER_DOT: '3.8' + # Other dependencies + # winpty + WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip + # Escape sequences + COL_RED: "\x1b[31m" + COL_GREEN: "\x1b[32m" + COL_YELLOW: "\x1b[33m" + COL_RESET: "\x1b[m" + + strategy: + fail-fast: false + matrix: + toolchain: [msvc, mingw] + arch: [x64, x86] + features: [HUGE, NORMAL] + include: + - arch: x64 + vcarch: amd64 + warch: x64 + bits: 64 + msystem: MINGW64 + cygreg: registry + pyreg: "" + - arch: x86 + vcarch: x86 + warch: ia32 + bits: 32 + msystem: MINGW32 + cygreg: registry32 + pyreg: "-32" + exclude: + - toolchain: msvc + arch: x64 + features: NORMAL + - toolchain: mingw + arch: x86 + features: NORMAL + + steps: + - name: Initalize + id: init + shell: bash + run: | + git config --global core.autocrlf input + python_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON_VER_DOT}/InstallPath/@") + python3_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}${{ matrix.pyreg }}/InstallPath/@") + echo "PYTHON_DIR=$python_dir" >> $GITHUB_ENV + echo "PYTHON3_DIR=$python3_dir" >> $GITHUB_ENV + + - uses: msys2/setup-msys2@v2 + if: matrix.toolchain == 'mingw' + with: + msystem: ${{ matrix.msystem }} + release: false + + - uses: actions/checkout@v2 + + - name: Create a list of download URLs + shell: cmd + run: | + type NUL > urls.txt + echo %LUA_RELEASE%>> urls.txt + echo %WINPTY_URL%>> urls.txt + + - name: Cache downloaded files + uses: actions/cache@v2 + with: + path: downloads + key: ${{ runner.os }}-${{ matrix.bits }}-${{ hashFiles('urls.txt') }} + + - name: Download dependencies + shell: cmd + run: | + path C:\Program Files\7-Zip;%path% + if not exist downloads mkdir downloads + + echo %COL_GREEN%Download Lua%COL_RESET% + call :downloadfile %LUA${{ matrix.bits }}_URL% downloads\lua.zip + 7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1 + + echo %COL_GREEN%Download winpty%COL_RESET% + call :downloadfile %WINPTY_URL% downloads\winpty.zip + 7z x -y downloads\winpty.zip -oD:\winpty > nul || exit 1 + copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty.dll src\winpty${{ matrix.bits }}.dll + copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty-agent.exe src\ + + goto :eof + + :downloadfile + :: call :downloadfile + if not exist %2 ( + curl -f -L %1 -o %2 + ) + if ERRORLEVEL 1 ( + rem Retry once. + curl -f -L %1 -o %2 || exit 1 + ) + goto :eof + + - name: Copy src directory to src2 + shell: cmd + run: | + xcopy src src2\ /E > nul + + - name: Build (MSVC) + if: matrix.toolchain == 'msvc' + shell: cmd + run: | + call "%VCVARSALL%" ${{ matrix.vcarch }} + cd src + :: Filter out the progress bar from the build log + sed -e "s/@<<$/@<< | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak + if "${{ matrix.features }}"=="HUGE" ( + nmake -nologo -f Make_mvc2.mak ^ + FEATURES=${{ matrix.features }} ^ + GUI=yes IME=yes ICONV=yes VIMDLL=yes ^ + DYNAMIC_LUA=yes LUA=%LUA_DIR% ^ + DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^ + DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR% + ) else ( + nmake -nologo -f Make_mvc2.mak ^ + FEATURES=${{ matrix.features }} ^ + GUI=yes IME=yes ICONV=yes VIMDLL=yes + ) + if not exist vim${{ matrix.bits }}.dll ( + echo %COL_RED%Build failure.%COL_RESET% + exit 1 + ) + + - name: Build (MinGW) + if: matrix.toolchain == 'mingw' + shell: msys2 {0} + run: | + cd src + if [ "${{ matrix.features }}" = "HUGE" ]; then + mingw32-make -f Make_ming.mak -j2 \ + FEATURES=${{ matrix.features }} \ + GUI=yes IME=yes ICONV=yes VIMDLL=yes \ + DYNAMIC_LUA=yes LUA=${LUA_DIR} \ + DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \ + DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \ + STATIC_STDCPLUS=yes + else + mingw32-make -f Make_ming.mak -j2 \ + FEATURES=${{ matrix.features }} \ + GUI=yes IME=yes ICONV=yes VIMDLL=yes \ + STATIC_STDCPLUS=yes + fi + + #- name: Prepare Artifact + # shell: cmd + # run: | + # mkdir artifacts + # copy src\*vim.exe artifacts + # copy src\vim*.dll artifacts + # + #- name: Upload Artifact + # uses: actions/upload-artifact@v1 + # with: + # name: vim${{ matrix.bits }}-${{ matrix.toolchain }} + # path: ./artifacts + + - name: Test + shell: cmd + timeout-minutes: 20 + run: | + PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR% + call "%VCVARSALL%" ${{ matrix.vcarch }} + cd src + echo. + echo %COL_GREEN%vim version:%COL_RESET% + .\vim --version || exit 1 + + echo %COL_GREEN%Start testing vim in background.%COL_RESET% + start cmd /c "cd ..\src2\testdir & nmake -nologo -f Make_dos.mak VIMPROG=..\..\src\vim > nul & echo done>done.txt" + + echo %COL_GREEN%Test gvim:%COL_RESET% + cd testdir + nmake -nologo -f Make_dos.mak VIMPROG=..\gvim || exit 1 + cd .. + + echo %COL_GREEN%Wait for vim tests to finish.%COL_RESET% + cd ..\src2\testdir + :: Wait about 10 minutes. + for /L %%i in (1,1,60) do ( + if exist done.txt goto exitloop + timeout 10 > NUL 2>&1 + if ERRORLEVEL 1 ping -n 11 localhost > NUL + ) + set timeout=1 + :exitloop + + echo %COL_GREEN%Test results of vim:%COL_RESET% + if exist messages type messages + nmake -nologo -f Make_dos.mak report VIMPROG=..\..\src\vim || exit 1 + if "%timeout%"=="1" ( + echo %COL_RED%Timed out.%COL_RESET% + exit 1 + ) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000000000..ef98000f8997e2 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,62 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +name: "CodeQL" + +on: + push: + branches: [master] + pull_request: + # The branches below must be a subset of the branches above + branches: [master] + schedule: + - cron: '0 18 * * 1' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # Override automatic language detection by changing the below list + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['cpp', 'python'] + # Learn more... + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.travis.yml b/.travis.yml index 0f9aeafcd23834..d60037c3e31421 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,32 @@ language: c +env: + global: + - BUILD=yes TEST=test CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no LOG_DIR="$TRAVIS_BUILD_DIR/logs" + _anchors: envs: - &tiny-nogui - BUILD=yes TEST=test FEATURES=tiny CONFOPT="--disable-gui" LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no + FEATURES=tiny TEST=testtiny CONFOPT="--disable-gui" - &tiny - BUILD=yes TEST=test FEATURES=tiny CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no + FEATURES=tiny TEST=testtiny - &small - BUILD=yes TEST=test FEATURES=small CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no + FEATURES=small TEST=testtiny - &normal - BUILD=yes TEST=test FEATURES=normal CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no + FEATURES=normal - &linux-huge - BUILD=yes TEST="scripttests test_libvterm" CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage FEATURES=huge LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no + FEATURES=huge TEST="scripttests test_libvterm" CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp" - &osx-huge # macOS build - BUILD=yes TEST=test FEATURES=huge LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no - CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp" + FEATURES=huge + CONFOPT="--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp" - &unittests - BUILD=no TEST=unittests CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage FEATURES=huge LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes + BUILD=no TEST=unittests FEATURES=huge CHECK_AUTOCONF=yes + - &coverage + CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage - &asan # ASAN build - SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer" - ASAN_OPTIONS="print_stacktrace=1 log_path=asan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt" + SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer" + ASAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/asan" UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt" - &shadowopt SHADOWOPT="-C src/shadow" SRCDIR=./src/shadow @@ -29,7 +35,7 @@ _anchors: dist: bionic addons: apt: - packages: + packages: &apt-packages - autoconf - clang - lcov @@ -63,7 +69,11 @@ _anchors: fi before_script: - sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 - - sudo bash ci/load-snd-dummy.sh || true + # It appears we can load "snd-dummy" on only amd64. + - | + if [[ "${TRAVIS_CPU_ARCH}" = amd64 ]]; then + sudo bash ci/load-snd-dummy.sh || true + fi - sudo usermod -a -G audio $USER - do_test() { sg audio "sg $(id -gn) '$*'"; } @@ -87,7 +97,7 @@ _anchors: # Lua is not installed on macOS - export LUA_PREFIX=/usr/local - coverage: &coverage + coverage: &eval-coverage # needed for https support for coveralls building cffi only works with gcc, # not with clang - CC=gcc pip install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1 @@ -98,13 +108,14 @@ _anchors: # Update pyenv to fix the error "/opt/pyenv/libexec/pyenv: line 43: cd: asan_symbolize-6.0: Not a directory". # https://github.com/pyenv/pyenv/issues/580 - (cd "${PYENV_ROOT}" && git fetch -p origin && git checkout "$(git rev-list --tags -n1)") &>/dev/null || true - - find . -type f -name 'asan.*' -size +0 2>/dev/null | xargs grep -l '^==[[:digit:]]*==ERROR:' | xargs -I{} -n1 -t asan_symbolize -l{} + - for f in $(grep -l '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "$LOG_DIR"/*); do asan_symbolize-11 -l "$f"; done branches: except: - /^v[0-9]/ script: + - mkdir -p "$LOG_DIR" - NPROC=$(getconf _NPROCESSORS_ONLN) - set -o errexit - echo -e "\\033[33;1mConfiguring Vim\\033[0m" && echo -en "travis_fold:start:configure\\r\\033[0K" @@ -125,7 +136,7 @@ script: # Append various warning flags to CFLAGS. # BSD sed needs backup extension specified. sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk - if [[ "${TRAVIS_OS_NAME}" = "osx" ]]; then + if [[ "${TRAVIS_OS_NAME}" = "osx" ]] || [[ "${CC}" = "clang-11" ]]; then # On macOS, the entity of gcc is clang. sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk else @@ -145,6 +156,15 @@ script: - echo -e "\\033[33;1mTesting Vim\\033[0m" && echo -en "travis_fold:start:test\\r\\033[0K" - do_test make ${SHADOWOPT} ${TEST} && FOLD_MARKER=travis_fold - echo -en "${FOLD_MARKER}:end:test\\r\\033[0K" + - | + # Not all sanitizers will cause the tests to fail. This helps since we can + # see all the failures instead of just the first one, but we still want the + # test phase to fail if any sanitizer issues are detected. + if [[ -n "${ASAN_OPTIONS}" ]]; then + if grep -q '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "$LOG_DIR"/*; then + false + fi + fi # Instead of using all environments with both compilers on both systems, # exclude some builds on mac os x and linux. @@ -152,56 +172,56 @@ script: # Linux: 2 compilers on some of the environments + gcc on os390 jobs: include: - - <<: *osx - name: tiny-nogui/clang - compiler: clang - env: *tiny-nogui - - <<: *osx - name: tiny-nogui/gcc - compiler: gcc - env: *tiny-nogui - - <<: *osx - <<: *osx-homebrew - name: huge/clang - compiler: clang - env: *osx-huge - - <<: *osx - <<: *osx-homebrew - name: huge/gcc - compiler: gcc - env: *osx-huge - - <<: *linux - name: tiny-nogui/clang - compiler: clang - env: *tiny-nogui - - <<: *linux - name: tiny-nogui/gcc - compiler: gcc - env: *tiny-nogui - - <<: *linux - name: tiny/clang - compiler: clang - env: *tiny - - <<: *linux - name: tiny/gcc - compiler: gcc - env: *tiny - - <<: *linux - name: small/gcc - compiler: gcc - env: *small - - <<: *linux - name: normal+shadow/clang - compiler: clang - env: - - *normal - - *shadowopt - - <<: *linux - name: normal+shadow/gcc - compiler: gcc - env: - - *normal - - *shadowopt + #- <<: *osx + # name: tiny-nogui/clang + # compiler: clang + # env: *tiny-nogui + #- <<: *osx + # name: tiny-nogui/gcc + # compiler: gcc + # env: *tiny-nogui + #- <<: *osx + # <<: *osx-homebrew + # name: huge/clang + # compiler: clang + # env: *osx-huge + #- <<: *osx + # <<: *osx-homebrew + # name: huge/gcc + # compiler: gcc + # env: *osx-huge + #- <<: *linux + # name: tiny-nogui/clang + # compiler: clang + # env: *tiny-nogui + #- <<: *linux + # name: tiny-nogui/gcc + # compiler: gcc + # env: *tiny-nogui + #- <<: *linux + # name: tiny/clang + # compiler: clang + # env: *tiny + #- <<: *linux + # name: tiny/gcc + # compiler: gcc + # env: *tiny + #- <<: *linux + # name: small/gcc + # compiler: gcc + # env: *small + #- <<: *linux + # name: normal+shadow/clang + # compiler: clang + # env: + # - *normal + # - *shadowopt + #- <<: *linux + # name: normal+shadow/gcc + # compiler: gcc + # env: + # - *normal + # - *shadowopt - <<: *linux arch: s390x name: huge/gcc-s390x @@ -209,42 +229,60 @@ jobs: env: *linux-huge services: [] - <<: *linux - name: huge+coverage/clang - compiler: clang - env: - - *linux-huge - # Clang cannot compile test_libvterm with "--coverage" flag. - - TEST=scripttests - after_success: *coverage - - <<: *linux - name: huge+coverage/gcc + arch: arm64 + name: huge/gcc-arm64 compiler: gcc env: *linux-huge - after_success: *coverage - - <<: *linux # ASAN - name: huge+asan/gcc - compiler: gcc - env: - - *linux-huge - - *asan - after_failure: *asan_symbolize - - <<: *linux - name: huge-testgui+coverage/gcc - compiler: gcc - env: - - *linux-huge - - TEST="-C src testgui" - after_success: *coverage - - <<: *linux - name: unittests+coverage/gcc - compiler: gcc - env: *unittests - after_success: *coverage - - <<: *linux - name: vimtags/gcc - compiler: gcc - env: - - *normal - - TEST="-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim" + services: [] + #- <<: *linux + # name: huge+coverage/clang + # compiler: clang + # env: + # - *linux-huge + # - *coverage + # after_success: *eval-coverage + #- <<: *linux + # name: huge+coverage/gcc + # compiler: gcc + # env: + # - *linux-huge + # - *coverage + # after_success: *eval-coverage + #- <<: *linux # ASAN + # name: huge+asan/clang + # compiler: clang-11 + # addons: + # apt: + # sources: + # - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main' + # key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' + # packages: + # - *apt-packages + # - clang-11 + # env: + # - *linux-huge + # - *asan + # after_failure: *asan_symbolize + #- <<: *linux + # name: huge-testgui+coverage/gcc + # compiler: gcc + # env: + # - *linux-huge + # - *coverage + # - TEST="-C src testgui" + # after_success: *eval-coverage + #- <<: *linux + # name: unittests+coverage/gcc + # compiler: gcc + # env: + # - *unittests + # - *coverage + # after_success: *eval-coverage + #- <<: *linux + # name: vimtags/gcc + # compiler: gcc + # env: + # - *normal + # - TEST="-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim" # vim:set sts=2 sw=2 tw=0 et: diff --git a/Filelist b/Filelist index 1e22554d40aced..82fb376e1edce7 100644 --- a/Filelist +++ b/Filelist @@ -3,17 +3,24 @@ # source files for all source archives SRC_ALL = \ - .gitignore \ + .cirrus.yml \ + .coveralls.yml \ .gitattributes \ + .github/CODEOWNERS \ + .github/workflows/ci.yml \ + .github/workflows/codeql-analysis.yml \ + .gitignore \ .hgignore \ .lgtm.yml \ .travis.yml \ - .cirrus.yml \ - appveyor.yml \ + .appveyor.yml \ + .codecov.yml \ ci/appveyor.bat \ + ci/build-snd-dummy.sh \ + ci/config.mk*.sed \ ci/if_ver*.vim \ ci/load-snd-dummy.sh \ - ci/config.mk*.sed \ + ci/setup-xvfb.sh \ src/Make_all.mak \ src/README.md \ src/alloc.h \ @@ -44,6 +51,7 @@ SRC_ALL = \ src/drawline.c \ src/drawscreen.c \ src/edit.c \ + src/errors.h \ src/eval.c \ src/evalbuffer.c \ src/evalfunc.c \ @@ -72,6 +80,7 @@ SRC_ALL = \ src/highlight.c \ src/indent.c \ src/insexpand.c \ + src/job.c \ src/json.c \ src/json_test.c \ src/kword_test.c \ @@ -148,6 +157,7 @@ SRC_ALL = \ src/vim9compile.c \ src/vim9execute.c \ src/vim9script.c \ + src/vim9type.c \ src/viminfo.c \ src/winclip.c \ src/window.c \ @@ -171,12 +181,12 @@ SRC_ALL = \ src/testdir/setup_gui.vim \ src/testdir/shared.vim \ src/testdir/vim9.vim \ + src/testdir/script_util.vim \ src/testdir/summarize.vim \ src/testdir/term_util.vim \ src/testdir/view_util.vim \ src/testdir/test[0-9]*.ok \ - src/testdir/test[0-9]*a.ok \ - src/testdir/test49.vim \ + src/testdir/test77a.ok \ src/testdir/test83-tags? \ src/testdir/test77a.com \ src/testdir/test_*.vim \ @@ -246,6 +256,7 @@ SRC_ALL = \ src/proto/highlight.pro \ src/proto/indent.pro \ src/proto/insexpand.pro \ + src/proto/job.pro \ src/proto/json.pro \ src/proto/list.pro \ src/proto/locale.pro \ @@ -302,6 +313,7 @@ SRC_ALL = \ src/proto/vim9compile.pro \ src/proto/vim9execute.pro \ src/proto/vim9script.pro \ + src/proto/vim9type.pro \ src/proto/viminfo.pro \ src/proto/winclip.pro \ src/proto/window.pro \ @@ -616,7 +628,7 @@ SRC_AMI = \ README_amisrc.txt.info \ src.info \ src/INSTALLami.txt \ - src/Make_morph.mak \ + src/Make_ami.mak \ src/os_amiga.c \ src/os_amiga.h \ src/proto/os_amiga.pro \ @@ -637,13 +649,11 @@ SRC_HAIKU = \ SRC_MAC = \ src/INSTALLmac.txt \ src/dehqx.py \ - src/gui_mac.c \ src/os_mac_rsrc/*.icns \ src/os_mac.h \ src/os_mac.rsr.hqx \ src/os_mac_conv.c \ src/os_macosx.m \ - src/proto/gui_mac.pro \ src/proto/os_mac_conv.pro \ # source files for VMS (in the extra archive) @@ -1026,6 +1036,8 @@ LANG_SRC = \ src/po/README_mvc.txt \ src/po/check.vim \ src/po/cleanup.vim \ + src/po/tojavascript.vim \ + src/po/fixfilenames.vim \ src/po/Makefile \ src/po/Make_all.mak \ src/po/Make_cyg.mak \ diff --git a/Makefile b/Makefile index 7774b6ed127904..35119ac1f6c645 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ first: # Some make programs use the last target for the $@ default; put the other # targets separately to always let $@ expand to "first" by default. -all install uninstall tools config configure reconfig proto depend lint tags types test scripttests test_libvterm unittests testclean clean distclean: +all install uninstall tools config configure reconfig proto depend lint tags types test scripttests testtiny test_libvterm unittests testclean clean distclean: @if test ! -f src/auto/config.mk; then \ cp src/config.mk.dist src/auto/config.mk; \ fi diff --git a/README.md b/README.md index d42680c6ba6c41..c7491ebd0df12c 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,8 @@ -![Vim Logo](https://github.com/vim/vim/blob/master/runtime/vimlogo.gif) - -[![Travis Build Status](https://travis-ci.org/vim/vim.svg?branch=master)](https://travis-ci.org/vim/vim) -[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim) -[![Cirrus Build Status](https://api.cirrus-ci.com/github/vim/vim.svg)](https://cirrus-ci.com/github/vim/vim) -[![Coverage Status](https://codecov.io/gh/vim/vim/coverage.svg?branch=master)](https://codecov.io/gh/vim/vim?branch=master) -[![Coverity Scan](https://scan.coverity.com/projects/241/badge.svg)](https://scan.coverity.com/projects/vim) -[![Language Grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/vim/vim.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/vim/vim/context:cpp) -[![Debian CI](https://badges.debian.net/badges/debian/testing/vim/version.svg)](https://buildd.debian.org/vim) -[![Packages](https://repology.org/badge/tiny-repos/vim.svg)](https://repology.org/metapackage/vim) -For translations of this README see the end. +[![Vim Logo](https://github.com/vim/vim/raw/master/runtime/vimlogo.gif)](https://www.vim.org) + +[![Github Build status](https://github.com/vim/vim/workflows/GitHub%20CI/badge.svg)](https://github.com/vim/vim/actions?query=workflow%3A%22GitHub+CI%22) [![Travis Build Status](https://travis-ci.com/vim/vim.svg?branch=master)](https://travis-ci.com/github/vim/vim) [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim) [![Cirrus Build Status](https://api.cirrus-ci.com/github/vim/vim.svg)](https://cirrus-ci.com/github/vim/vim) [![Coverage Status](https://codecov.io/gh/vim/vim/coverage.svg?branch=master)](https://codecov.io/gh/vim/vim?branch=master) [![Coverity Scan](https://scan.coverity.com/projects/241/badge.svg)](https://scan.coverity.com/projects/vim) [![Language Grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/vim/vim.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/vim/vim/context:cpp) [![Debian CI](https://badges.debian.net/badges/debian/testing/vim/version.svg)](https://buildd.debian.org/vim) [![Packages](https://repology.org/badge/tiny-repos/vim.svg)](https://repology.org/metapackage/vim) [![Fossies codespell report](https://fossies.org/linux/test/vim-master.tar.gz/codespell.svg)](https://fossies.org/linux/test/vim-master.tar.gz/codespell.html) + +For translations of this README see the end. ## What is Vim? ## diff --git a/README_VIM9.md b/README_VIM9.md index b77d013c05c122..96fab69ed70a9c 100644 --- a/README_VIM9.md +++ b/README_VIM9.md @@ -5,8 +5,8 @@ This is an experimental side of [Vim](https://github.com/vim/vim). It explores ways of making Vim script faster and better. -WARNING: The Vim9 script features are in the early stages of development, -anything can break! +WARNING: The Vim9 script features are still under development, anything can +break! # Why Vim9? @@ -52,7 +52,7 @@ we can gain, and also that Vim script can be faster than builtin interfaces. In practice the script would not do something useless as counting but change -the text. For example, re-indent all the lines: +the text. For example, reindent all the lines: ``` vim let totallen = 0 @@ -70,6 +70,7 @@ the text. For example, re-indent all the lines: | Vim new | 0.190276 | The differences are smaller, but Vim 9 script is clearly the fastest. +Using LuaJIT gives 0.25, only a little bit faster than plain Lua. How does Vim9 script work? The function is first compiled into a sequence of instructions. Each instruction has one or two parameters and a stack is @@ -80,7 +81,7 @@ e.g. each stack item is a typeval_T. And one of the instructions is "execute Ex command", for commands that are not compiled. -## 2. PHASING OUT INTERFACES +## 2. DEPRIORITIZE INTERFACES Attempts have been made to implement functionality with built-in script languages such as Python, Perl, Lua, Tcl and Ruby. This never gained much @@ -91,14 +92,14 @@ Instead of using script language support in Vim: with them. The job and channel support already makes this possible. Really any language can be used, also Java and Go, which are not available built-in. -* Phase out the built-in language interfaces, make maintenance a bit easier - and executables easier to build. They will be kept for backwards - compatibility, no new features. +* No priority for the built-in language interfaces. They will have to be kept + for backwards compatibility, but many users won't need a Vim build with these + interfaces. * Improve the Vim script language, it is used to communicate with the external tool and implements the Vim side of the interface. Also, it can be used when an external tool is undesired. -All together this creates a clear situation: Vim with the +eval feature +Altogether this creates a clear situation: Vim with the +eval feature will be sufficient for most plugins, while some plugins require installing a tool that can be written in any language. No confusion about having Vim but the plugin not working because some specific @@ -140,6 +141,9 @@ Taking this one step further is also dropping "s:" for script-local variables; everything at the script level is script-local by default. Since this is not backwards compatible it requires a new script style: Vim9 script! +To avoid having more variations, the syntax inside a compiled function is the +same as in Vim9 script. Thus you have legacy syntax and Vim9 syntax. + It should be possible to convert code from other languages to Vim script. We can add functionality to make this easier. This still needs to be discussed, but we can consider adding type checking and a simple @@ -156,18 +160,18 @@ thing I have been thinking of is assignments without ":let". I often make that mistake (after writing JavaScript especially). I think it is possible, if we make local variables shadow commands. That should be OK, if you shadow a command you want to use, just rename the variable. -Using "let" and "const" to declare a variable, like in JavaScript and +Using "var" and "const" to declare a variable, like in JavaScript and TypeScript, can work: ``` vim def MyFunction(arg: number): number - let local = 1 - let todo = arg + var local = 1 + var todo = arg const ADD = 88 while todo > 0 local += ADD - --todo + todo -= 1 endwhile return local enddef @@ -189,7 +193,7 @@ function and export it: ``` vim vim9script " Vim9 script syntax used here -let local = 'local variable is not exported, script-local' +var local = 'local variable is not exported, script-local' export def MyFunction() " exported function ... @@ -245,10 +249,10 @@ END return luaeval('sum') endfunc -def VimNew() - let sum = 0 +def VimNew(): number + var sum = 0 for i in range(1, 2999999) - let sum += i + sum += i endfor return sum enddef @@ -274,7 +278,7 @@ echo 'Vim new: ' .. reltimestr(reltime(start)) ``` vim def VimNew(): number - let totallen = 0 + var totallen = 0 for i in range(1, 100000) setline(i, ' ' .. getline(i)) totallen += len(getline(i)) diff --git a/READMEdir/README_extra.txt b/READMEdir/README_extra.txt index c12827e41fd2c0..4f22d1bcc26621 100644 --- a/READMEdir/README_extra.txt +++ b/READMEdir/README_extra.txt @@ -16,7 +16,6 @@ src/os_amiga.* Files for the Amiga port. src/os_msdos.* src/os_dos.* Files for the MS-DOS port. -src/gui_mac.* src/os_mac.* Files for the Mac port. src/os_vms* Files for the VMS port. diff --git a/ci/appveyor.bat b/ci/appveyor.bat index 590c48a7c461b9..164d7bcc2582c6 100644 --- a/ci/appveyor.bat +++ b/ci/appveyor.bat @@ -5,48 +5,32 @@ setlocal ENABLEDELAYEDEXPANSION cd %APPVEYOR_BUILD_FOLDER% cd src -echo "Building MinGW 32bit console version" -set PATH=c:\msys64\mingw32\bin;%PATH% -mingw32-make.exe -f Make_ming.mak GUI=no OPTIMIZE=speed IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1 -.\vim -u NONE -c "redir @a | ver |0put a | wq" ver_ming.txt -:: Save vim.exe before Make clean, moved back below. -copy vim.exe testdir -mingw32-make.exe -f Make_ming.mak clean - -:: Build Mingw huge version with python and channel support, or -:: with specified features without python. -echo "Building MinGW 32bit GUI version" -if "%FEATURE%" == "HUGE" ( - mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed CHANNEL=yes GUI=yes IME=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27 PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35 FEATURES=%FEATURE% || exit 1 -) ELSE ( - mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed GUI=yes IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1 -) -.\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_ming_gui.txt - :: Filter out the progress bar from the build log sed -e "s/@<<$/@<< | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak echo "Building MSVC 64bit console Version" -nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=no IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1 -:: The executable is not used -nmake -f Make_mvc2.mak clean +nmake -f Make_mvc2.mak CPU=AMD64 ^ + OLE=no GUI=no IME=yes ICONV=yes DEBUG=no ^ + FEATURES=%FEATURE% || exit 1 :: build MSVC huge version with python and channel support :: GUI needs to be last, so that testing works echo "Building MSVC 64bit GUI Version" if "%FEATURE%" == "HUGE" ( - nmake -f Make_mvc2.mak DIRECTX=yes CPU=AMD64 CHANNEL=yes OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35-x64 FEATURES=%FEATURE% || exit 1 + nmake -f Make_mvc2.mak CPU=AMD64 ^ + OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no POSTSCRIPT=yes ^ + PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 ^ + PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35-x64 ^ + FEATURES=%FEATURE% || exit 1 ) ELSE ( - nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1 + nmake -f Make_mvc2.mak CPU=AMD64 ^ + OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no ^ + FEATURES=%FEATURE% || exit 1 ) .\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_msvc.txt -:: Restore vim.exe, tests will run with this. -move /Y testdir\vim.exe . -echo "version output MinGW" -type ver_ming.txt -echo "version output MinGW GUI" -type ver_ming_gui.txt -echo "version output MVC" +echo "version output MSVC console" +.\vim --version +echo "version output MSVC GUI" type ver_msvc.txt cd .. diff --git a/ci/build-snd-dummy.sh b/ci/build-snd-dummy.sh new file mode 100644 index 00000000000000..a2380b4b16a270 --- /dev/null +++ b/ci/build-snd-dummy.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -eu + +LINUX_VERSION=$(uname -r | cut -d. -f1-2) +LINUX_ARCHIVE_FILE=v${LINUX_VERSION}.tar.gz +LINUX_SOURCE_DIR=linux-${LINUX_VERSION} + +mkdir -p "${TMPDIR}" +cd "${TMPDIR}" + +wget -q "https://github.com/torvalds/linux/archive/${LINUX_ARCHIVE_FILE}" + +tar -xf "${LINUX_ARCHIVE_FILE}" "${LINUX_SOURCE_DIR}/sound" +cd "${LINUX_SOURCE_DIR}/sound" + +CC=gcc make -C "/lib/modules/$(uname -r)/build" M="${PWD}" CONFIG_SOUND=m CONFIG_SND=m CONFIG_SND_PCM=m CONFIG_SND_DUMMY=m modules + +mkdir -p "${SND_DUMMY_DIR}" +cp soundcore.ko core/snd.ko core/snd-pcm.ko drivers/snd-dummy.ko "${SND_DUMMY_DIR}" diff --git a/ci/load-snd-dummy.sh b/ci/load-snd-dummy.sh index 5ceb7cedff812e..b0101b0f8a1950 100644 --- a/ci/load-snd-dummy.sh +++ b/ci/load-snd-dummy.sh @@ -3,6 +3,6 @@ set -e if ! modprobe snd-dummy; then # snd-dummy is contained in linux-modules-extra (if exists) - apt install -y "linux-modules-extra-$(uname -r)" + apt-get install -yq --no-install-suggests --no-install-recommends "linux-modules-extra-$(uname -r)" modprobe snd-dummy fi diff --git a/ci/setup-xvfb.sh b/ci/setup-xvfb.sh new file mode 100644 index 00000000000000..cfc0f97bba4caf --- /dev/null +++ b/ci/setup-xvfb.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -e + +apt-get install -y xvfb + +cat </etc/systemd/system/xvfb.service +[Unit] +Description=X Virtual Frame Buffer Service +After=network.target +[Service] +ExecStart=/usr/bin/Xvfb :99 -screen 0 1024x768x24 +[Install] +WantedBy=multi-user.target +EOT + +systemctl enable xvfb.service +systemctl start xvfb.service diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi index 65ac8b11f48bc7..498d98dc8485fb 100644 --- a/nsis/gvim.nsi +++ b/nsis/gvim.nsi @@ -174,6 +174,7 @@ Page custom SetCustom ValidateCustom !include "lang\german.nsi" !include "lang\italian.nsi" !include "lang\japanese.nsi" + !include "lang\russian.nsi" !include "lang\simpchinese.nsi" !include "lang\tradchinese.nsi" !include "lang\turkish.nsi" @@ -358,6 +359,8 @@ Section "$(str_section_exe)" id_section_exe SetOutPath $0\colors File ${VIMRT}\colors\*.* + SetOutPath $0\colors\tools + File ${VIMRT}\colors\tools\*.* SetOutPath $0\compiler File ${VIMRT}\compiler\*.* diff --git a/nsis/lang/italian.nsi b/nsis/lang/italian.nsi index 296bb84c6f3b2f..b90e0986cbcc8a 100644 --- a/nsis/lang/italian.nsi +++ b/nsis/lang/italian.nsi @@ -58,10 +58,10 @@ LangString str_desc_console ${LANG_ITALIAN} \ "Versione console di Vim (vim.exe)." LangString str_section_batch ${LANG_ITALIAN} \ - "Crea file di invocazione (MS-DOS) .bat" + "Crea file .bat" LangString str_desc_batch ${LANG_ITALIAN} \ - "Crea file di invocazione .bat per varianti di Vim nella directory \ - di Windows, per utilizzo da linea di comando (MS-DOS)." + "Crea file .bat per varianti di Vim nella directory \ + di Windows, per utilizzo da riga di comando." LangString str_group_icons ${LANG_ITALIAN} \ "Crea icone per Vim" diff --git a/nsis/lang/russian.nsi b/nsis/lang/russian.nsi new file mode 100644 index 00000000000000..23458ce4c83569 --- /dev/null +++ b/nsis/lang/russian.nsi @@ -0,0 +1,287 @@ +# vi:set ts=8 sts=4 sw=4 et fdm=marker: +# +# russian.nsi: Russian language strings for gvim NSIS installer. +# +# Locale ID : 1049 +# Locale name : ru-RU +# fileencoding : UTF-8 +# Author : Restorer + +!insertmacro MUI_LANGUAGE "Russian" + + +# Overwrite the default translation. +# These strings should be always English. Otherwise dosinst.c fails. +LangString ^SetupCaption ${LANG_RUSSIAN} \ + "$(^Name) Setup" +LangString ^UninstallCaption ${LANG_RUSSIAN} \ + "$(^Name) Uninstall" + +############################################################################## +# MUI Configuration Strings {{{1 +############################################################################## + +#LangString str_dest_folder ${LANG_RUSSIAN} \ +# "Маршрут к каталогу установки (должен оканчиваться каталогом $\"vim$\")" + +LangString str_show_readme ${LANG_RUSSIAN} \ + "После окончания установки ознакомиться с кратким описанием" + +# Install types: +LangString str_type_typical ${LANG_RUSSIAN} \ + "Стандартная" + +LangString str_type_minimal ${LANG_RUSSIAN} \ + "Минимальная" + +LangString str_type_full ${LANG_RUSSIAN} \ + "Полная" + + +############################################################################## +# Section Titles & Description {{{1 +############################################################################## + +LangString str_section_old_ver ${LANG_RUSSIAN} \ + "Удаление предыдущих версий" +LangString str_desc_old_ver ${LANG_RUSSIAN} \ + "Будут удалены предыдущие установленные версии программы" + +LangString str_section_exe ${LANG_RUSSIAN} \ + "Графический интерфейс и вспомогательные файлы" +LangString str_desc_exe ${LANG_RUSSIAN} \ + "Графический интерфейс программы Vim и все необходимые для этого файлы. \ + Это обязательный компонент" + +LangString str_section_console ${LANG_RUSSIAN} \ + "Консольная программа Vim" +LangString str_desc_console ${LANG_RUSSIAN} \ + "Вариант редактора Vim (vim.exe), используемый в командной оболочке" + +LangString str_section_batch ${LANG_RUSSIAN} \ + "Создать командные файлы" +LangString str_desc_batch ${LANG_RUSSIAN} \ + "Создание командных bat-файлов позволяющих работать с редактором \ + Vim из командной строки Windows" + +LangString str_group_icons ${LANG_RUSSIAN} \ + "Создать ярлыки для редактора Vim" +LangString str_desc_icons ${LANG_RUSSIAN} \ + "Создание ярлыков редактора Vim для облегчения запуска программы" + +LangString str_section_desktop ${LANG_RUSSIAN} \ + "На Рабочем столе" +LangString str_desc_desktop ${LANG_RUSSIAN} \ + "Создание ярлыков программы Gvim на Рабочем столе" + +LangString str_section_start_menu ${LANG_RUSSIAN} \ + "В меню кнопки Пуск" +LangString str_desc_start_menu ${LANG_RUSSIAN} \ + "Создание ярлыков программы Gvim в меню кнопки Пуск" + +#LangString str_section_quick_launch ${LANG_RUSSIAN} \ +# "На панели быстрого запуска" +#LangString str_desc_quick_launch ${LANG_RUSSIAN} \ +# "Создание ярлыков программы GVim на панели быстрого запуска" + +LangString str_section_edit_with ${LANG_RUSSIAN} \ + "В контекстном меню" +LangString str_desc_edit_with ${LANG_RUSSIAN} \ + "Добавление вызова программы Gvim в пункт $\"Открыть с помощью...$\" контекстного меню" + +#LangString str_section_edit_with32 ${LANG_RUSSIAN} \ +# "32-разрядная версия программы" +#LangString str_desc_edit_with32 ${LANG_RUSSIAN} \ +# "Добавление вызова программы Gvim в пункт $\"Открыть с помощью...$\" контекстного меню \ +# для 32-разрядных приложений" + +#LangString str_section_edit_with64 ${LANG_RUSSIAN} \ +# "64-разрядная версия программы" +#LangString str_desc_edit_with64 ${LANG_RUSSIAN} \ +# "Добавление вызова программы Gvim в пункт $\"Открыть с помощью...$\" контекстного меню \ +# для 64-разрядных приложений" + +LangString str_section_vim_rc ${LANG_RUSSIAN} \ + "Настройки программы по умолчанию" +LangString str_desc_vim_rc ${LANG_RUSSIAN} \ + "Создание файла _vimrc с предустановленными настройками, если нет других \ + файлов настроек" + +LangString str_group_plugin ${LANG_RUSSIAN} \ + "Создать каталог для подключаемых модулей" +LangString str_desc_plugin ${LANG_RUSSIAN} \ + "Создание каталога для размещения подключаемых модулей, которые расширяют \ + возможности редактора Vim" + +LangString str_section_plugin_home ${LANG_RUSSIAN} \ + "Личный каталог" +LangString str_desc_plugin_home ${LANG_RUSSIAN} \ + "Создание каталога для подключаемых модулей в домашнем каталоге пользователя" + +LangString str_section_plugin_vim ${LANG_RUSSIAN} \ + "Общий каталог" +LangString str_desc_plugin_vim ${LANG_RUSSIAN} \ + "Создание каталога для подключаемых модулей в каталоге установки редактора Vim. \ + Модули в этом каталоге будут доступны для любого пользователя \ + зарегистрировавшегося в системе" + +LangString str_section_vis_vim ${LANG_RUSSIAN} \ + "Подключаемый модуль VisVim" +LangString str_desc_vis_vim ${LANG_RUSSIAN} \ + "Подключаемый модуль VisVim используется для интеграции с Microsoft Visual Studio" + +LangString str_section_nls ${LANG_RUSSIAN} \ + "Поддержка региональных языков" +LangString str_desc_nls ${LANG_RUSSIAN} \ + "Установка файлов для поддержки региональных языков операционной системы" + +LangString str_unsection_register ${LANG_RUSSIAN} \ + "Отменить регистрацию компонентов программы Vim" +LangString str_desc_unregister ${LANG_RUSSIAN} \ + "Отмена регистрации компонентов программы Vim в операционной системе" + +LangString str_unsection_exe ${LANG_RUSSIAN} \ + "Удалить файлы редактора Vim" +LangString str_desc_rm_exe ${LANG_RUSSIAN} \ + "Удаление всех исполняемых и вспомогательных файлов редактора Vim" + +LangString str_ungroup_plugin ${LANG_RUSSIAN} \ + "Удалить каталог подключаемых модулей" +LangString str_desc_rm_plugin ${LANG_RUSSIAN} \ + "Удаление каталога подключаемых модулей, если в нём нет файлов" + +LangString str_unsection_plugin_home ${LANG_RUSSIAN} \ + "Личный каталог" +LangString str_desc_rm_plugin_home ${LANG_RUSSIAN} \ + "Удаление каталога подключаемых модулей из домашнего каталога пользователя" + +LangString str_unsection_plugin_vim ${LANG_RUSSIAN} \ + "Общий каталог" +LangString str_desc_rm_plugin_vim ${LANG_RUSSIAN} \ + "Удаление каталога подключаемых модулей из каталога установки редактора Vim" + +LangString str_unsection_rootdir ${LANG_RUSSIAN} \ + "Удалить основной каталог программы Vim" +LangString str_desc_rm_rootdir ${LANG_RUSSIAN} \ + "Удаление основного каталога программы Vim. В этом каталоге находятся файлы \ + настроек!" + + +############################################################################## +# Messages {{{1 +############################################################################## + +#LangString str_msg_too_many_ver ${LANG_RUSSIAN} \ +# "Обнаружено предыдущих версий программы Vim: $vim_old_ver_count.$\r$\n\ +# Данная программа установки может удалить не более ${VIM_MAX_OLD_VER}.$\r$\n\ +# Удалить лишние версии программы Vim и повторите установку" + +#LangString str_msg_invalid_root ${LANG_RUSSIAN} \ +# "Недопустимый каталог установки программы Vim $vim_install_root!$\r$\n\ +# Маршрут установки должен оканчиваться каталогом $\"vim$\"" + +#LangString str_msg_bin_mismatch ${LANG_RUSSIAN} \ +# "Недопустимый маршрут к каталогу с исполняемыми файлами!$\r$\n$\r$\n\ +# Маршрут к каталогу с исполняемыми файлами должен быть $\"$vim_bin_path$\",$\r$\n\ +# но от операционной системы получен как $\"$INSTDIR$\"." + +#LangString str_msg_vim_running ${LANG_RUSSIAN} \ +# "Программа Vim сейчас работает.$\r$\n\ +# Прежде чем продолжить, закройте все работающие редакторы Vim" + +#LangString str_msg_register_ole ${LANG_RUSSIAN} \ +# "Попытка зарегистрировать компоненты программы Vim в пространстве OLE. \ +# Но не получено уведомление об успешности данной операции" + +#LangString str_msg_unreg_ole ${LANG_RUSSIAN} \ +# "Попытка отменить регистрацию компонентов программы Vim в пространстве OLE. \ +# Но не получено уведомление об успешности данной операции" + +#LangString str_msg_rm_start ${LANG_RUSSIAN} \ +# "Выполняется удаление следующих версий программы:" + +#LangString str_msg_rm_fail ${LANG_RUSSIAN} \ +# "Произошёл сбой при выполнении удаления следующих версий программы:" + +#LangString str_msg_no_rm_key ${LANG_RUSSIAN} \ +# "Не удалось найти раздел реестра, содержащий информацию об удалении программы" + +#LangString str_msg_no_rm_reg ${LANG_RUSSIAN} \ +# "Не удалось найти программу выполняющую удаление, указанную в разделе реестра" + +#LangString str_msg_no_rm_exe ${LANG_RUSSIAN} \ +# "Отсутствуют права на доступ к программе, выполняющей удаление" + +#LangString str_msg_rm_copy_fail ${LANG_RUSSIAN} \ +# "Произошла ошибка при копировании программы удаления во временный каталог" + +#LangString str_msg_rm_run_fail ${LANG_RUSSIAN} \ +# "Произошёл сбой при запуске программы, выполняющей удаление" + +#LangString str_msg_abort_install ${LANG_RUSSIAN} \ +# "Установка программы была отменена" + +LangString str_msg_install_fail ${LANG_RUSSIAN} \ + "Произошла ошибка при установке программы. Попробуйте повторить установку \ + немного попозже" +# когда луна будет в другой фазе и ветер должен дуть с юго‐запада + +LangString str_msg_rm_exe_fail ${LANG_RUSSIAN} \ + "Некоторые файлы не были удалены из каталога $0 $\r$\n\ + Необходимо выполнить их удаление самостоятельно" + +#LangString str_msg_rm_root_fail ${LANG_RUSSIAN} \ +# "Внимание! В каталоге $\"$vim_install_root$\" содержатся файлы. Удаление каталога не выполнено" + +LangString str_msg_uninstalling ${LANG_RUSSIAN} \ + "Удаление предыдущих версий программ..." + +LangString str_msg_registering ${LANG_RUSSIAN} \ + "Регистрация компонентов программы в системе..." + +LangString str_msg_unregistering ${LANG_RUSSIAN} \ + "Отмена регистрации компонентов программы в системе..." + + +############################################################################## +# Dialog Box {{{1 +############################################################################## + +LangString str_vimrc_page_title ${LANG_RUSSIAN} \ + "Установка параметров программы" +LangString str_vimrc_page_subtitle ${LANG_RUSSIAN} \ + "Параметры, используемые для клавиатуры, «мыши» и функциональности программы" + +LangString str_msg_compat_title ${LANG_RUSSIAN} \ + " Варианты использования программы " +LangString str_msg_compat_desc ${LANG_RUSSIAN} \ + "Совместимость и функциональность программы" +LangString str_msg_compat_vi ${LANG_RUSSIAN} \ + "Работа в варианте совместимости с редактором Vi" +LangString str_msg_compat_vim ${LANG_RUSSIAN} \ + "Работа в варианте функциональности редактора Vim" +LangString str_msg_compat_defaults ${LANG_RUSSIAN} \ + "Работа редактора Vim с некоторыми улучшениями (файл defaults.vim)" +LangString str_msg_compat_all ${LANG_RUSSIAN} \ + "Работа редактора Vim со всеми улучшениями (файл vimrc_example.vim). \ + Используется по умолчанию" + +LangString str_msg_keymap_title ${LANG_RUSSIAN} \ + " Клавиатурные команды " +LangString str_msg_keymap_desc ${LANG_RUSSIAN} \ + "Клавиатурные команды используемые в ОС Windows (CTRL+V, CTRL+C, CTRL+S, CTRL+F и т. п.)" +LangString str_msg_keymap_default ${LANG_RUSSIAN} \ + "Не изменять клавиатурные команды. Использовать принятые в редакторе Vim" +LangString str_msg_keymap_windows ${LANG_RUSSIAN} \ + "Изменить указанные клавиатурные команды" + +LangString str_msg_mouse_title ${LANG_RUSSIAN} \ + " Манипулятор «мышь» " +LangString str_msg_mouse_desc ${LANG_RUSSIAN} \ + "Действий правой и левой кнопки манипулятора «мышь»" +LangString str_msg_mouse_default ${LANG_RUSSIAN} \ + "Правая кнопка — всплывающее меню, левая кнопка — режим визуальный" +LangString str_msg_mouse_windows ${LANG_RUSSIAN} \ + "Правая кнопка — всплывающее меню, левая кнопка — режим выборки (как в ОС Windows)" +LangString str_msg_mouse_unix ${LANG_RUSSIAN} \ + "Правая кнопка — расширяемый режим выбора, левая кнопка — режим визуальный (как в UNIX‐подобных ОС)" diff --git a/runtime/autoload/ccomplete.vim b/runtime/autoload/ccomplete.vim index 971e7367ce54b5..95a20e16b0507e 100644 --- a/runtime/autoload/ccomplete.vim +++ b/runtime/autoload/ccomplete.vim @@ -1,13 +1,13 @@ " Vim completion script " Language: C " Maintainer: Bram Moolenaar -" Last Change: 2020 Apr 08 +" Last Change: 2020 Nov 14 let s:cpo_save = &cpo set cpo&vim " This function is used for the 'omnifunc' option. -function! ccomplete#Complete(findstart, base) +func ccomplete#Complete(findstart, base) if a:findstart " Locate the start of the item, including ".", "->" and "[...]". let line = getline('.') @@ -244,7 +244,7 @@ function! ccomplete#Complete(findstart, base) return map(res, 's:Tagline2item(v:val, brackets)') endfunc -function! s:GetAddition(line, match, memarg, bracket) +func s:GetAddition(line, match, memarg, bracket) " Guess if the item is an array. if a:bracket && match(a:line, a:match . '\s*\[') > 0 return '[' @@ -260,13 +260,13 @@ function! s:GetAddition(line, match, memarg, bracket) endif endif return '' -endfunction +endfunc " Turn the tag info "val" into an item for completion. " "val" is is an item in the list returned by taglist(). " If it is a variable we may add "." or "->". Don't do it for other types, " such as a typedef, by not including the info that s:GetAddition() uses. -function! s:Tag2item(val) +func s:Tag2item(val) let res = {'match': a:val['name']} let res['extra'] = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename']) @@ -289,10 +289,10 @@ function! s:Tag2item(val) endif return res -endfunction +endfunc " Use all the items in dictionary for the "info" entry. -function! s:Dict2info(dict) +func s:Dict2info(dict) let info = '' for k in sort(keys(a:dict)) let info .= k . repeat(' ', 10 - len(k)) @@ -307,7 +307,7 @@ function! s:Dict2info(dict) endfunc " Parse a tag line and return a dictionary with items like taglist() -function! s:ParseTagline(line) +func s:ParseTagline(line) let l = split(a:line, "\t") let d = {} if len(l) >= 3 @@ -334,12 +334,12 @@ function! s:ParseTagline(line) endif return d -endfunction +endfunc " Turn a match item "val" into an item for completion. " "val['match']" is the matching item. " "val['tagline']" is the tagline in which the last part was found. -function! s:Tagline2item(val, brackets) +func s:Tagline2item(val, brackets) let line = a:val['tagline'] let add = s:GetAddition(line, a:val['match'], [a:val], a:brackets == '') let res = {'word': a:val['match'] . a:brackets . add } @@ -377,10 +377,10 @@ function! s:Tagline2item(val, brackets) let res['menu'] = s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t')) endif return res -endfunction +endfunc " Turn a command from a tag line to something that is useful in the menu -function! s:Tagcmd2extra(cmd, name, fname) +func s:Tagcmd2extra(cmd, name, fname) if a:cmd =~ '^/^' " The command is a search command, useful to see what it is. let x = matchstr(a:cmd, '^/^\s*\zs.*\ze$/') @@ -395,13 +395,13 @@ function! s:Tagcmd2extra(cmd, name, fname) let x = a:cmd . ' - ' . a:fname endif return x -endfunction +endfunc " Find composing type in "lead" and match items[0] with it. " Repeat this recursively for items[1], if it's there. " When resolving typedefs "depth" is used to avoid infinite recursion. " Return the list of matches. -function! s:Nextitem(lead, items, depth, all) +func s:Nextitem(lead, items, depth, all) " Use the text up to the variable name and split it in tokens. let tokens = split(a:lead, '\s\+\|\<') @@ -485,7 +485,7 @@ function! s:Nextitem(lead, items, depth, all) endfor return res -endfunction +endfunc " Search for members of structure "typename" in tags files. @@ -493,7 +493,7 @@ endfunction " Each match is a dictionary with "match" and "tagline" entries. " When "all" is non-zero find all, otherwise just return 1 if there is any " member. -function! s:StructMembers(typename, items, all) +func s:StructMembers(typename, items, all) " Todo: What about local structures? let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")')) if fnames == '' @@ -586,12 +586,12 @@ function! s:StructMembers(typename, items, all) " Failed to find anything. return [] -endfunction +endfunc " For matching members, find matches for following items. " When "all" is non-zero find all, otherwise just return 1 if there is any " member. -function! s:SearchMembers(matches, items, all) +func s:SearchMembers(matches, items, all) let res = [] for i in range(len(a:matches)) let typename = '' diff --git a/runtime/autoload/clojurecomplete.vim b/runtime/autoload/clojurecomplete.vim index 030785e9017d8b..2c0f0eacd46422 100644 --- a/runtime/autoload/clojurecomplete.vim +++ b/runtime/autoload/clojurecomplete.vim @@ -1,14 +1,15 @@ " Vim completion script -" Language: Clojure -" Maintainer: Sung Pae -" URL: https://github.com/guns/vim-clojure-static -" License: Same as Vim -" Last Change: 18 July 2016 +" Language: Clojure +" Maintainer: Alex Vear +" Former Maintainers: Sung Pae +" URL: https://github.com/clojure-vim/clojure.vim +" License: Vim (see :h license) +" Last Change: 2021-02-13 " -*- COMPLETION WORDS -*- -" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-011/clj/src/vim_clojure_static/generate.clj -" Clojure version 1.8.0 -let s:words = ["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-readably*","*read-eval*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods",".","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc!","assoc","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","booleans","bound-fn","bound-fn*","bound?","butlast","byte","byte-array","bytes","case","cast","cat","catch","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj!","conj","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","def","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj!","disj","dissoc!","dissoc","distinct","distinct?","do","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","finally","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","identical?","identity","if","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","init-proxy","instance?","int","int-array","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","monitor-enter","monitor-exit","munge","name","namespace","namespace-munge","neg?","new","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop!","pop","pop-thread-bindings","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","quot","quote","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","recur","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seque","sequence","sequential?","set!","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","throw","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","try","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","use","val","vals","var","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"] +" Generated from https://github.com/clojure-vim/clojure.vim/blob/f8594e7030cdfb0b7990ac92953c77a08a7220f0/clj/src/vim_clojure_static/generate.clj +" Clojure version 1.10.2 +let s:words = ["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods",".","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","PrintWriter-on","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-tap","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc!","assoc","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","case-fallthrough-err-impl","cast","cat","catch","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj!","conj","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","def","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj!","disj","dissoc!","dissoc","distinct","distinct?","do","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-cause","ex-data","ex-info","ex-message","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","finally","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","monitor-enter","monitor-exit","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","new","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop!","pop","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","quote","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read+string","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","recur","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-tap","remove-watch","repeat","repeatedly","replace","replicate","require","requiring-resolve","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seqable?","seque","sequence","sequential?","set!","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","tap>","test","the-ns","thread-bound?","throw","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","try","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","uri?","use","uuid?","val","vals","var","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"] " Simple word completion for special forms and public vars in clojure.core function! clojurecomplete#Complete(findstart, base) diff --git a/runtime/autoload/decada.vim b/runtime/autoload/decada.vim index 7741ff05728459..5124429a75914a 100644 --- a/runtime/autoload/decada.vim +++ b/runtime/autoload/decada.vim @@ -25,7 +25,7 @@ function decada#Unit_Name () dict " {{{1 " Convert filename into acs unit: " 1: remove the file extenstion. " 2: replace all double '_' or '-' with an dot (which denotes a separate) - " 3: remove a trailing '_' (wich denotes a specification) + " 3: remove a trailing '_' (which denotes a specification) return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '') endfunction decada#Unit_Name " }}}1 diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 844a5ad73b3f97..1ac74b57854ec4 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -1,7 +1,7 @@ " Vim functions for file type detection " " Maintainer: Bram Moolenaar -" Last Change: 2020 Mar 30 +" Last Change: 2020 Aug 17 " These functions are moved here from runtime/filetype.vim to make startup " faster. @@ -362,6 +362,10 @@ func dist#ft#FTinc() setf aspvbs elseif lines =~ "' + func dist#ft#FTprogress_pascal() if exists("g:filetype_p") exe "setf " . g:filetype_p @@ -419,8 +426,7 @@ func dist#ft#FTprogress_pascal() let lnum = 1 while lnum <= 10 && lnum < line('$') let line = getline(lnum) - if line =~ '^\s*\(program\|unit\|procedure\|function\|const\|type\|var\)\>' - \ || line =~ '^\s*{' || line =~ '^\s*(\*' + if line =~ s:ft_pascal_comments || line =~? s:ft_pascal_keywords setf pascal return elseif line !~ '^\s*$' || line =~ '^/\*' @@ -433,6 +439,19 @@ func dist#ft#FTprogress_pascal() setf progress endfunc +func dist#ft#FTpp() + if exists("g:filetype_pp") + exe "setf " . g:filetype_pp + else + let line = getline(nextnonblank(1)) + if line =~ s:ft_pascal_comments || line =~? s:ft_pascal_keywords + setf pascal + else + setf puppet + endif + endif +endfunc + func dist#ft#FTr() let max = line("$") > 50 ? 50 : line("$") @@ -575,7 +594,7 @@ endfunc let s:ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*' func dist#ft#FTRules() let path = expand(':p') - if path =~ '^/\(etc/udev/\%(rules\.d/\)\=.*\.rules\|lib/udev/\%(rules\.d/\)\=.*\.rules\)$' + if path =~ '/\(etc/udev/\%(rules\.d/\)\=.*\.rules\|\%(usr/\)\=lib/udev/\%(rules\.d/\)\=.*\.rules\)$' setf udevrules return endif diff --git a/runtime/autoload/javascriptcomplete.vim b/runtime/autoload/javascriptcomplete.vim index 14bc3d7ce397ad..29b6b16254fa3f 100644 --- a/runtime/autoload/javascriptcomplete.vim +++ b/runtime/autoload/javascriptcomplete.vim @@ -1,7 +1,9 @@ " Vim completion script " Language: Java Script -" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2017 Mar 04 +" Maintainer: Jay Sitter (jay@jaysitter.com) +" URL: https://github.com/jsit/javascriptcomplete.vim/ +" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) +" Last Change: 2020 Jul 30 function! javascriptcomplete#CompleteJS(findstart, base) if a:findstart @@ -154,12 +156,30 @@ function! javascriptcomplete#CompleteJS(findstart, base) \ 'text', 'vLink'] let bodys = bodyprop " Document - document. - let docuprop = ['anchors', 'applets', 'childNodes', 'embeds', 'forms', 'images', 'links', 'stylesheets', - \ 'body', 'cookie', 'documentElement', 'domain', 'lastModified', 'referrer', 'title', 'URL'] - let documeth = ['close', 'createAttribute', 'createElement', 'createTextNode', 'focus', 'getElementById', - \ 'getElementsByName', 'getElementsByTagName', 'open', 'write', 'writeln', - \ 'onClick', 'onDblClick', 'onFocus', 'onKeyDown', 'onKeyPress', 'onKeyUp', - \ 'onMouseDown', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onResize'] + let docuprop = ['anchors', 'body', 'characterSet', 'doctype', + \ 'documentElement', 'documentURI', 'embeds', 'fonts', 'forms', + \ 'head', 'hidden', 'images', 'implementation', 'lastStyleSheetSet', + \ 'links', 'plugins', 'preferredStyleSheetSet', 'scripts', + \ 'scrollingElement', 'selectedStyleSheetSet', 'styleSheetSets', + \ 'timeline', 'visibilityState', 'cookie', 'defaultView', + \ 'designMode', 'dir', 'domain', 'lastModified', 'location', + \ 'readyState', 'referrer', 'title', 'URL', 'activeElement', + \ 'fullscreenElement', 'styleSheets'] + let documeth = ['adoptNode', 'close', 'createAttribute', + \ 'createAttributeNS', 'createCDATASection', 'createComment', + \ 'createDocumentFragment', 'createElement', 'createElementNS', + \ 'createEvent', 'createExpression', 'createNSResolver', + \ 'createNodeIterator', 'createProcessingInstruction', 'createRange', + \ 'createTextNode', 'createTouchList', 'createTreeWalker', + \ 'enableStyleSheetsForSet', 'evaluate', 'focus', 'getElementById', + \ 'getElementById', 'getElementsByClassName', 'getElementsByName', + \ 'getElementsByTagName', 'getElementsByTagNameNS', + \ 'hasStorageAccess', 'importNode', 'onClick', 'onDblClick', + \ 'onFocus', 'onKeyDown', 'onKeyPress', 'onKeyUp', 'onMouseDown', + \ 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', + \ 'onResize', 'open', 'querySelector', 'querySelectorAll', + \ 'requestStorageAccess', 'write', 'writeln'] + call map(documeth, 'v:val."("') let docuxprop = ['attributes', 'childNodes', 'doctype', 'documentElement', 'firstChild', \ 'implementation', 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType', @@ -368,9 +388,11 @@ function! javascriptcomplete#CompleteJS(findstart, base) let xdomelemprop = ['attributes', 'childNodes', 'firstChild', 'lastChild', \ 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType', 'nodeValue', \ 'ownerDocument', 'parentNode', 'prefix', 'previousSibling', 'tagName'] - let xdomelemmeth = ['appendChild', 'cloneNode', 'getAttribute', 'getAttributeNode', - \ 'getElementsByTagName', 'hasChildNodes', 'insertBefore', 'normalize', - \ 'removeAttribute', 'removeAttributeNode', 'removeChild', 'replaceChild', + let xdomelemmeth = ['appendChild', 'addEventListener', 'cloneNode', + \ 'dispatchEvent', 'getAttribute', 'getAttributeNode', + \ 'getElementsByTagName', 'hasChildNodes', 'insertBefore', + \ 'normalize', 'removeAttribute', 'removeAttributeNode', + \ 'removeChild', 'removeEventListener', 'replaceChild', \ 'setAttribute', 'setAttributeNode'] call map(xdomelemmeth, 'v:val."("') let xdomelems = xdomelemprop + xdomelemmeth diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index f4cc89e4748e6a..d095f6dd81c924 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,7 +1,7 @@ " netrw.vim: Handles file transfer and remote directory listing across " AUTOLOAD SECTION -" Date: Jan 07, 2020 -" Version: 168 +" Date: Sep 18, 2020 +" Version: 170 " Maintainer: Charles E Campbell " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 2016 Charles E. Campbell {{{1 @@ -43,7 +43,7 @@ if exists("s:needspatches") endfor endif -let g:loaded_netrw = "v168" +let g:loaded_netrw = "v170" if !exists("s:NOTE") let s:NOTE = 0 let s:WARNING = 1 @@ -86,7 +86,16 @@ fun! netrw#ErrorMsg(level,msg,errnum) endif " call Decho("level=".level,'~'.expand("")) - if g:netrw_use_errorwindow + if g:netrw_use_errorwindow == 2 && (v:version > 802 || (v:version == 802 && has("patch486"))) + " use popup window + if type(a:msg) == 3 + let msg = [level]+a:msg + else + let msg= level.a:msg + endif + let s:popuperr_id = popup_beval(msg,{}) + let s:popuperr_text= "" + elseif g:netrw_use_errorwindow " (default) netrw creates a one-line window to show error/warning " messages (reliably displayed) @@ -203,7 +212,11 @@ let g:netrw_localrmdiropt = "" " --------------------------------------------------------------------- " Default values for netrw's global protocol variables {{{2 -call s:NetrwInit("g:netrw_use_errorwindow",1) +if (v:version > 802 || (v:version == 802 && has("patch486"))) && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on") && has("mouse") + call s:NetrwInit("g:netrw_use_errorwindow",2) +else + call s:NetrwInit("g:netrw_use_errorwindow",1) +endif if !exists("g:netrw_dav_cmd") if executable("cadaver") @@ -559,6 +572,7 @@ call s:NetrwInit("s:netrw_posn",'{}') if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on") " call Decho("installed beval events",'~'.expand("")) let &l:bexpr = "netrw#BalloonHelp()" +" call Decho("&l:bexpr<".&l:bexpr."> buf#".bufnr()) au FileType netrw setl beval au WinLeave * if &ft == "netrw" && exists("s:initbeval")|let &beval= s:initbeval|endif au VimEnter * let s:initbeval= &beval @@ -591,7 +605,18 @@ if v:version >= 700 && has("balloon_eval") && has("syntax") && exists("g:syntax_ if &ft != "netrw" return "" endif - if !exists("w:netrw_bannercnt") || v:beval_lnum >= w:netrw_bannercnt || (exists("g:netrw_nobeval") && g:netrw_nobeval) + if exists("s:popuperr_id") && popup_getpos(s:popuperr_id) != {} + " popup error window is still showing + " s:pouperr_id and s:popuperr_text are set up in netrw#ErrorMsg() + if exists("s:popuperr_text") && s:popuperr_text != "" && v:beval_text != s:popuperr_text + " text under mouse hasn't changed; only close window when it changes + call popup_close(s:popuperr_id) + unlet s:popuperr_text + else + let s:popuperr_text= v:beval_text + endif + let mesg= "" + elseif !exists("w:netrw_bannercnt") || v:beval_lnum >= w:netrw_bannercnt || (exists("g:netrw_nobeval") && g:netrw_nobeval) let mesg= "" elseif v:beval_text == "Netrw" || v:beval_text == "Directory" || v:beval_text == "Listing" let mesg = "i: thin-long-wide-tree gh: quick hide/unhide of dot-files qf: quick file info %:open new file" @@ -1247,6 +1272,10 @@ fun! netrw#Lexplore(count,rightside,...) setlocal winfixwidth let g:netrw_altv = keep_altv let t:netrw_lexbufnr = bufnr("%") + " done to prevent build-up of hidden buffers due to quitting and re-invocation of :Lexplore. + " Since the intended use of :Lexplore is to have an always-present explorer window, the extra + " effort to mis-use :Lex is warranted. + set bh=wipe " call Decho("let t:netrw_lexbufnr=".t:netrw_lexbufnr) " call Decho("t:netrw_lexposn".(exists("t:netrw_lexposn")? string(t:netrw_lexposn) : " n/a")) if exists("t:netrw_lexposn") @@ -1908,7 +1937,7 @@ fun! s:NetrwRestoreSetting(keepvar,setting) if type(a:setting) == 0 exe "let ".a:setting."= ".keepvarval elseif type(a:setting) == 1 - exe "let ".a:setting."= '".keepvarval."'" + exe "let ".a:setting."= '".substitute(keepvarval,"'","''","g")."'" else call netrw#ErrorMsg(s:ERROR,"(s:NetrwRestoreSetting) doesn't know how to restore ".a:keepvar." with a setting of type#".type(a:setting),105) endif @@ -3640,6 +3669,8 @@ fun! s:NetrwBookHistSave() let savefile= s:NetrwHome()."/.netrwhist" " call Decho("savefile<".savefile.">",'~'.expand("")) 1split + + " setting up a new buffer which will become .netrwhist call s:NetrwEnew() " call Decho("case g:netrw_use_noswf=".g:netrw_use_noswf.(exists("+acd")? " +acd" : " -acd"),'~'.expand("")) if g:netrw_use_noswf @@ -4722,7 +4753,7 @@ endfun " "new directory name" is actually a file, " NetrwBrowseChgDir() edits the file. fun! s:NetrwBrowseChgDir(islocal,newdir,...) -" call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">") +" call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." win#".winnr()." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">") " call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("")) let ykeep= @@ @@ -4751,13 +4782,14 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) let newdir = a:newdir let dolockout = 0 let dorestore = 1 +" call Decho("win#".winnr(),'~'.expand("")) " call Decho("dirname<".dirname.">",'~'.expand("")) " call Decho("newdir<".newdir.">",'~'.expand("")) " ignore s when done in the banner " call Decho('(s:NetrwBrowseChgDir) ignore [return]s when done in banner (g:netrw_banner='.g:netrw_banner.")",'~'.expand("")) if g:netrw_banner -" call Decho("w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"),'~'.expand("")) +" call Decho("win#".winnr()." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"),'~'.expand("")) if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt && line("$") >= w:netrw_bannercnt if getline(".") =~# 'Quick Help' " call Decho("#1: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) @@ -4794,7 +4826,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " ------------------------------ " NetrwBrowseChgDir: edit a file {{{3 " ------------------------------ -" call Decho('(s:NetrwBrowseChgDir) edit-a-file: case "handling a file": newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("")) +" call Decho('edit-a-file: case "handling a file": win#'.winnr().' newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("")) " save position for benefit of Rexplore let s:rexposn_{bufnr("%")}= winsaveview() @@ -4829,7 +4861,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) NetrwKeepj call s:NetrwOptionsRestore("s:") let curdir= b:netrw_curdir if !exists("s:didsplit") -" call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr(),'~'.expand("")) +" " call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr()." g:netrw_chgwin=".g:netrw_chgwin",'~'.expand("")) if type(g:netrw_browse_split) == 3 " open file in server " Note that g:netrw_browse_split is a List: [servername,tabnr,winnr] @@ -4837,22 +4869,27 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) call s:NetrwServerEdit(a:islocal,dirname) " call Dret("s:NetrwBrowseChgDir") return + elseif g:netrw_browse_split == 1 " horizontally splitting the window first " call Decho("edit-a-file: horizontally splitting window prior to edit",'~'.expand("")) - keepalt new + let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize + exe "keepalt ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s" if !&ea keepalt wincmd _ endif call s:SetRexDir(a:islocal,curdir) + elseif g:netrw_browse_split == 2 " vertically splitting the window first " call Decho("edit-a-file: vertically splitting window prior to edit",'~'.expand("")) - keepalt rightb vert new + let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize + exe "keepalt ".(g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s" if !&ea keepalt wincmd | endif call s:SetRexDir(a:islocal,curdir) + elseif g:netrw_browse_split == 3 " open file in new tab " call Decho("edit-a-file: opening new tab prior to edit",'~'.expand("")) @@ -4861,6 +4898,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) let b:netrw_curdir= getcwd() endif call s:SetRexDir(a:islocal,curdir) + elseif g:netrw_browse_split == 4 " act like "P" (ie. open previous window) " call Decho("edit-a-file: use previous window for edit",'~'.expand("")) @@ -4870,13 +4908,14 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) return endif call s:SetRexDir(a:islocal,curdir) + else " handling a file, didn't split, so remove menu " call Decho("edit-a-file: handling a file+didn't split, so remove menu",'~'.expand("")) call s:NetrwMenu(0) " optional change to window if g:netrw_chgwin >= 1 -" call Decho("edit-a-file: changing window to #".g:netrw_chgwin,'~'.expand("")) +" call Decho("edit-a-file: changing window to #".g:netrw_chgwin.": (due to g:netrw_chgwin)",'~'.expand("")) if winnr("$")+1 == g:netrw_chgwin " if g:netrw_chgwin is set to one more than the last window, then " vertically split the last window to make that window available. @@ -4889,19 +4928,26 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) endif call s:SetRexDir(a:islocal,curdir) endif + endif " the point where netrw actually edits the (local) file " if its local only: LocalBrowseCheck() doesn't edit a file, but NetrwBrowse() will " no keepalt to support :e # to return to a directory listing + if !&mod + " if e the new file would fail due to &mod, then don't change any of the flags + let dolockout= 1 + endif if a:islocal " call Decho("edit-a-file: edit local file: exe e! ".fnameescape(dirname),'~'.expand("")) " some like c-^ to return to the last edited file " others like c-^ to return to the netrw buffer + " Apr 30, 2020: used to have e! here. That can cause loss of a modified file, + " so emit error E37 instead. if exists("g:netrw_altfile") && g:netrw_altfile - exe "NetrwKeepj keepalt e! ".fnameescape(dirname) + exe "NetrwKeepj keepalt e ".fnameescape(dirname) else - exe "NetrwKeepj e! ".fnameescape(dirname) + exe "NetrwKeepj e ".fnameescape(dirname) endif " call Decho("edit-a-file: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod,'~'.expand("")) call s:NetrwCursor() @@ -4912,7 +4958,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) else " call Decho("edit-a-file: remote file: NetrwBrowse will edit it",'~'.expand("")) endif - let dolockout= 1 " handle g:Netrw_funcref -- call external-to-netrw functions " This code will handle g:Netrw_funcref as an individual function reference @@ -5376,16 +5421,6 @@ fun! netrw#BrowseX(fname,remote) endif let ret= v:shell_error - elseif has("unix") && executable("kfmclient") && s:CheckIfKde() -" call Decho("(netrw#BrowseX) unix and kfmclient",'~'.expand("")) - call s:NetrwExe("sil !kfmclient exec ".s:ShellEscape(fname,1)." ".redir) - let ret= v:shell_error - - elseif has("unix") && executable("exo-open") && executable("xdg-open") && executable("setsid") -" call Decho("(netrw#BrowseX) unix, exo-open, xdg-open",'~'.expand("")) - call s:NetrwExe("sil !setsid xdg-open ".s:ShellEscape(fname,1).redir) - let ret= v:shell_error - elseif has("unix") && $DESKTOP_SESSION == "mate" && executable("atril") " call Decho("(netrw#BrowseX) unix and atril",'~'.expand("")) if a:fname =~ '^https\=://' @@ -5400,9 +5435,19 @@ fun! netrw#BrowseX(fname,remote) endif let ret= v:shell_error + elseif has("unix") && executable("kfmclient") && s:CheckIfKde() +" call Decho("(netrw#BrowseX) unix and kfmclient",'~'.expand("")) + call s:NetrwExe("sil !kfmclient exec ".s:ShellEscape(fname,1)." ".redir) + let ret= v:shell_error + + elseif has("unix") && executable("exo-open") && executable("xdg-open") && executable("setsid") +" call Decho("(netrw#BrowseX) unix, exo-open, xdg-open",'~'.expand("")) + call s:NetrwExe("sil !setsid xdg-open ".s:ShellEscape(fname,1).redir.'&') + let ret= v:shell_error + elseif has("unix") && executable("xdg-open") " call Decho("(netrw#BrowseX) unix and xdg-open",'~'.expand("")) - call s:NetrwExe("sil !xdg-open ".s:ShellEscape(fname,1).redir) + call s:NetrwExe("sil !xdg-open ".s:ShellEscape(fname,1).redir.'&') let ret= v:shell_error elseif has("macunix") && executable("open") @@ -6107,10 +6152,10 @@ fun! s:NetrwListHide() " Duplicate characters don't matter. " Remove all such characters from the '/~@#...890' string. " Use the first character left as a separator character. -" call Decho("find a character not in the hide string to use as a separator") +" call Decho("find a character not in the hide string to use as a separator",'~'.expand("")) let listhide= g:netrw_list_hide let sep = strpart(substitute('~@#$%^&*{};:,<.>?|1234567890','['.escape(listhide,'-]^\').']','','ge'),1,1) -" call Decho("sep=".sep," (sep not in hide string)'~'.expand("")) +" call Decho("sep<".sep."> (sep not in hide string)",'~'.expand("")) while listhide != "" if listhide =~ ',' @@ -6120,7 +6165,7 @@ fun! s:NetrwListHide() let hide = listhide let listhide = "" endif -" call Decho("..extracted from listhide: hide<".hide."> g:netrw_sort_by<".g:netrw_sort_by.'>','~'.expand("")) +" call Decho("..extracted pattern from listhide: hide<".hide."> g:netrw_sort_by<".g:netrw_sort_by.'>','~'.expand("")) if g:netrw_sort_by =~ '^[ts]' if hide =~ '^\^' " call Decho("..modify hide to handle a \"^...\" pattern",'~'.expand("")) @@ -6132,7 +6177,7 @@ fun! s:NetrwListHide() endif " Prune the list by hiding any files which match -" call Decho("..prune the list by hiding any files which ",((g:netrw_hide == 1)? "" : "don't")." match hide<".hide.">") +" call Decho("..prune the list by hiding any files which ".((g:netrw_hide == 1)? "" : "don't")."match hide<".hide.">") if g:netrw_hide == 1 " call Decho("..hiding<".hide.">",'~'.expand("")) exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d' @@ -9215,6 +9260,7 @@ endfun " (full path directory with trailing slash returned) fun! s:NetrwTreeDir(islocal) " call Dfunc("s:NetrwTreeDir(islocal=".a:islocal.") getline(".line(".").")"."<".getline('.')."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> ft=".&ft) +" call Decho("Determine tree directory given current cursor position") " call Decho("g:netrw_keepdir =".(exists("g:netrw_keepdir")? g:netrw_keepdir : 'n/a'),'~'.expand("")) " call Decho("w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'),'~'.expand("")) " call Decho("w:netrw_treetop =".(exists("w:netrw_treetop")? w:netrw_treetop : 'n/a'),'~'.expand("")) @@ -9320,7 +9366,6 @@ fun! s:NetrwTreeDisplay(dir,depth) call setline(line("$")+1,a:depth.shortdir.'/') endif " call Decho("setline#".line("$")." shortdir<".a:depth.shortdir.">",'~'.expand("")) - " append a / to dir if its missing one let dir= a:dir @@ -9334,7 +9379,7 @@ fun! s:NetrwTreeDisplay(dir,depth) let listhide= split(g:netrw_list_hide,',') " call Decho("listhide=".string(listhide)) for pat in listhide - call filter(w:netrw_treedict[dir],'v:val !~ "'.pat.'"') + call filter(w:netrw_treedict[dir],'v:val !~ "'.escape(pat,'\\').'"') endfor elseif g:netrw_hide == 2 @@ -9472,6 +9517,7 @@ fun! s:NetrwTreeListing(dirname) " call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("")) " display from treetop on down +" call Decho("(s:NetrwTreeListing) w:netrw_treetop<".w:netrw_treetop.">") NetrwKeepj call s:NetrwTreeDisplay(w:netrw_treetop,"") " call Decho("s:NetrwTreeDisplay) setl noma nomod ro",'~'.expand("")) @@ -9742,7 +9788,7 @@ fun! s:PerformListing(islocal) " Hiding... -or- Showing... {{{3 if g:netrw_banner -" call Decho("--handle hiding/showing (g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">)",'~'.expand("")) +" call Decho("--handle hiding/showing in banner (g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">)",'~'.expand("")) if g:netrw_list_hide != "" && g:netrw_hide if g:netrw_hide == 1 NetrwKeepj put ='\" Hiding: '.g:netrw_list_hide @@ -9795,7 +9841,7 @@ fun! s:PerformListing(islocal) " call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("")) if !g:netrw_banner || line("$") >= w:netrw_bannercnt -" call Decho("manipulate directory listing (hide)",'~'.expand("")) +" call Decho("manipulate directory listing (support hide)",'~'.expand("")) " call Decho("g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("")) if g:netrw_hide && g:netrw_list_hide != "" NetrwKeepj call s:NetrwListHide() @@ -11808,7 +11854,7 @@ endfun " --------------------------------------------------------------------- " s:NetrwEnew: opens a new buffer, passes netrw buffer variables through {{{2 fun! s:NetrwEnew(...) -" call Dfunc("s:NetrwEnew() a:0=".a:0." bufnr($)=".bufnr("$")." expand(%)<".expand("%").">") +" call Dfunc("s:NetrwEnew() a:0=".a:0." win#".winnr()." winnr($)=".winnr("$")." bufnr($)=".bufnr("$")." expand(%)<".expand("%").">") " call Decho("curdir<".((a:0>0)? a:1 : "")."> buf#".bufnr("%")."<".bufname("%").">",'~'.expand("")) " grab a function-local-variable copy of buffer variables @@ -11875,6 +11921,9 @@ fun! s:NetrwEnew(...) endif endif endif + if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on") + let &l:bexpr = "netrw#BalloonHelp()" + endif " call Dret("s:NetrwEnew : buf#".bufnr("%")."<".bufname("%")."> expand(%)<".expand("%")."> expand(#)<".expand("#")."> bh=".&bh." win#".winnr()." winnr($)#".winnr("$")) endfun @@ -11934,6 +11983,7 @@ endfun " -1=failed fun! s:NetrwLcd(newdir) " call Dfunc("s:NetrwLcd(newdir<".a:newdir.">)") +" call Decho("changing local directory",'~'.expand("")) let err472= 0 try @@ -11969,6 +12019,8 @@ fun! s:NetrwLcd(newdir) return -1 endif +" call Decho("getcwd <".getcwd().">") +" call Decho("b:netrw_curdir<".b:netrw_curdir.">") " call Dret("s:NetrwLcd 0") return 0 endfun diff --git a/runtime/autoload/netrwFileHandlers.vim b/runtime/autoload/netrwFileHandlers.vim index ed31e29a665372..d07235c107c827 100644 --- a/runtime/autoload/netrwFileHandlers.vim +++ b/runtime/autoload/netrwFileHandlers.vim @@ -1,8 +1,8 @@ " netrwFileHandlers: contains various extension-based file handlers for " netrw's browsers' x command ("eXecute launcher") " Author: Charles E. Campbell -" Date: May 03, 2013 -" Version: 11b ASTRO-ONLY +" Date: Sep 18, 2020 +" Version: 11 " Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright @@ -20,7 +20,7 @@ if exists("g:loaded_netrwFileHandlers") || &cp finish endif -let g:loaded_netrwFileHandlers= "v11b" +let g:loaded_netrwFileHandlers= "v11" if v:version < 702 echohl WarningMsg echo "***warning*** this version of netrwFileHandlers needs vim 7.2" diff --git a/runtime/autoload/phpcomplete.vim b/runtime/autoload/phpcomplete.vim index 377baa8432823b..4041a80bd81785 100644 --- a/runtime/autoload/phpcomplete.vim +++ b/runtime/autoload/phpcomplete.vim @@ -3,7 +3,7 @@ " Maintainer: Dávid Szabó ( complex857 AT gmail DOT com ) " Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " URL: https://github.com/shawncplus/phpcomplete.vim -" Last Change: 2018 Oct 10 +" Last Change: 2021 Feb 08 " " OPTIONS: " @@ -122,7 +122,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ endif endif - " If exists b:php_menu it means completion was already constructed we " don't need to do anything more if exists("b:php_menu") @@ -148,8 +147,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ try let eventignore = &eventignore let &eventignore = 'all' - let winheight = winheight(0) - let winnr = winnr() let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.'))) @@ -183,7 +180,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ endif if filereadable(classlocation) - let classfile = readfile(classlocation) let classcontent = '' let classcontent .= "\n".phpcomplete#GetClassContents(classlocation, classname) let sccontent = split(classcontent, "\n") @@ -217,7 +213,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ return phpcomplete#CompleteGeneral(a:base, current_namespace, imports) endif finally - silent! exec winnr.'resize '.winheight let &eventignore = eventignore endtry endfunction @@ -1025,7 +1020,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) " let c_var = '$'.c_var endif let c_variables[c_var] = '' - if g:phpcomplete_parse_docblock_comments && len(get(variables, var_index)) > 0 + if g:phpcomplete_parse_docblock_comments && len(get(variables, var_index, '')) > 0 let c_doc[c_var] = phpcomplete#GetDocBlock(a:sccontent, variables[var_index]) endif let var_index += 1 @@ -2082,26 +2077,17 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam " ... " ] " - let full_file_path = fnamemodify(a:file_path, ':p') let class_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*' - let cfile = join(a:file_lines, "\n") + let full_file_path = fnamemodify(a:file_path, ':p') let result = [] - " We use new buffer and (later) normal! because - " this is the most efficient way. The other way - " is to go through the looong string looking for - " matching {} - - " remember the window we started at - let phpcomplete_original_window = winnr() - - silent! below 1new - silent! 0put =cfile - call search('\c\(class\|interface\|trait\)\_s\+'.a:class_name.'\(\>\|$\)') - let cfline = line('.') - call search('{') - let endline = line('.') - - let content = join(getline(cfline, endline), "\n") + let popup_id = popup_create(a:file_lines, {'hidden': v:true}) + + call win_execute(popup_id, 'call search(''\c\(class\|interface\|trait\)\_s\+'.a:class_name.'\(\>\|$\)'')') + call win_execute(popup_id, "let cfline = line('.')") + call win_execute(popup_id, "call search('{')") + call win_execute(popup_id, "let endline = line('.')") + + call win_execute(popup_id, 'let content = join(getline('.cfline.', '.endline.'), "\n")') " Catch extends if content =~? 'extends' let extends_string = matchstr(content, '\(class\|interface\)\_s\+'.a:class_name.'\_.\+extends\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze\(extends\|{\)') @@ -2117,14 +2103,16 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam else let implemented_interfaces = [] endif - call searchpair('{', '', '}', 'W') - let class_closing_bracket_line = line('.') + + call win_execute(popup_id, 'let [class_closing_bracket_line, class_closing_bracket_col] = searchpairpos("{", "", "}", "W")') " Include class docblock let doc_line = cfline - 1 - if getline(doc_line) =~? '^\s*\*/' + call win_execute(popup_id, 'let l = getline('.doc_line.')') + if l =~? '^\s*\*/' while doc_line != 0 - if getline(doc_line) =~? '^\s*/\*\*' + call win_execute(popup_id, 'let l = getline('.doc_line.')') + if l =~? '^\s*/\*\*' let cfline = doc_line break endif @@ -2132,22 +2120,22 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam endwhile endif - let classcontent = join(getline(cfline, class_closing_bracket_line), "\n") + call win_execute(popup_id, 'let classcontent = join(getline('.cfline.', '.class_closing_bracket_line.'), "\n")') let used_traits = [] " move back to the line next to the class's definition - call cursor(endline + 1, 1) + call win_execute(popup_id, 'call cursor('.(endline + 1).', 1)') let keep_searching = 1 while keep_searching != 0 " try to grab "use..." keywords - let [lnum, col] = searchpos('\c^\s\+use\s\+'.class_name_pattern, 'cW', class_closing_bracket_line) - let syn_name = synIDattr(synID(lnum, col, 0), "name") + call win_execute(popup_id, 'let [lnum, col] = searchpos(''\c^\s\+use\s\+'.class_name_pattern.''', "cW", '.class_closing_bracket_line.')') + call win_execute(popup_id, 'let syn_name = synIDattr(synID('.lnum.', '.col.', 0), "name")') if syn_name =~? 'string\|comment' - call cursor(lnum + 1, 1) + call win_execute(popup_id, 'call cursor('.(lnum + 1).', 1)') continue endif - let trait_line = getline(lnum) + call win_execute(popup_id, 'let trait_line = getline('.lnum.')') if trait_line !~? ';' " try to find the next line containing ';' let l = lnum @@ -2157,25 +2145,23 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam while search_line !~? ';' && l > 0 " file lines are reversed so we need to go backwards let l += 1 - let search_line = getline(l) + call win_execute(popup_id, 'let search_line = getline('.l.')') let trait_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g') endwhile endif let use_expression = matchstr(trait_line, '^\s*use\s\+\zs.\{-}\ze;') let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")') let used_traits += map(use_parts, 'substitute(v:val, "\\s", "", "g")') - call cursor(lnum + 1, 1) + call win_execute(popup_id, 'call cursor('.(lnum + 1).', 1)') if [lnum, col] == [0, 0] let keep_searching = 0 endif endwhile - silent! bw! % + call popup_close(popup_id) let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(a:file_lines[0:cfline]) - " go back to original window - exe phpcomplete_original_window.'wincmd w' call add(result, { \ 'class': a:class_name, \ 'content': classcontent, @@ -2532,40 +2518,37 @@ function! phpcomplete#FormatDocBlock(info) " {{{ endif return res -endfunction! +endfunction " }}} function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ - let original_window = winnr() - - silent! below 1new - silent! 0put =a:file_lines - normal! G + let popup_id = popup_create(a:file_lines, {'hidden': v:true}) + call win_execute(popup_id, 'normal! G') " clear out classes, functions and other blocks while 1 - let block_start_pos = searchpos('\c\(class\|trait\|function\|interface\)\s\+\_.\{-}\zs{', 'Web') + call win_execute(popup_id, 'let block_start_pos = searchpos(''\c\(class\|trait\|function\|interface\)\s\+\_.\{-}\zs{'', "Web")') if block_start_pos == [0, 0] break endif - let block_end_pos = searchpairpos('{', '', '}\|\%$', 'W', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"') + call win_execute(popup_id, 'let block_end_pos = searchpairpos("{", "", ''}\|\%$'', "W", ''synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"'')') + let popup_lines = winbufnr(popup_id)->getbufline(1, '$') if block_end_pos != [0, 0] " end of the block found, just delete it - silent! exec block_start_pos[0].','.block_end_pos[0].'d _' + call remove(popup_lines, block_start_pos[0] - 1, block_end_pos[0] - 1) else " block pair not found, use block start as beginning and the end " of the buffer instead - silent! exec block_start_pos[0].',$d _' + call remove(popup_lines, block_start_pos[0] - 1, -1) endif + call popup_settext(popup_id, popup_lines) endwhile - normal! G + call win_execute(popup_id, 'normal! G', 'silent!') " grab the remains - let file_lines = reverse(getline(1, line('.') - 1)) - - silent! bw! % - exe original_window.'wincmd w' + call win_execute(popup_id, "let file_lines = reverse(getline(1, line('.')-1))") + call popup_close(popup_id) let namespace_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*' let i = 0 diff --git a/runtime/autoload/python3complete.vim b/runtime/autoload/python3complete.vim index f0f3aaddb3d03f..6894bd63e107cd 100644 --- a/runtime/autoload/python3complete.vim +++ b/runtime/autoload/python3complete.vim @@ -1,7 +1,8 @@ "python3complete.vim - Omni Completion for python -" Maintainer: Aaron Griffin +" Maintainer: +" Previous Maintainer: Aaron Griffin " Version: 0.9 -" Last Updated: 18 Jun 2009 (small fix 2015 Sep 14 from Debian) +" Last Updated: 2020 Oct 9 " " Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim " @@ -83,7 +84,7 @@ function! python3complete#Complete(findstart, base) break endif endwhile - execute "py3 vimpy3complete('" . cword . "', '" . a:base . "')" + execute "py3 vimpy3complete('" . escape(cword, "'") . "', '" . escape(a:base, "'") . "')" return g:python3complete_completions endif endfunction diff --git a/runtime/autoload/pythoncomplete.vim b/runtime/autoload/pythoncomplete.vim index ecc36646d9d8af..5f6fee58cce988 100644 --- a/runtime/autoload/pythoncomplete.vim +++ b/runtime/autoload/pythoncomplete.vim @@ -1,7 +1,8 @@ "pythoncomplete.vim - Omni Completion for python -" Maintainer: Aaron Griffin +" Maintainer: +" Previous Maintainer: Aaron Griffin " Version: 0.9 -" Last Updated: 18 Jun 2009 +" Last Updated: 2020 Oct 9 " " Changes " TODO: @@ -81,7 +82,7 @@ function! pythoncomplete#Complete(findstart, base) break endif endwhile - execute "python vimcomplete('" . cword . "', '" . a:base . "')" + execute "python vimcomplete('" . escape(cword, "'") . "', '" . escape(a:base, "'") . "')" return g:pythoncomplete_completions endif endfunction diff --git a/runtime/autoload/syntaxcomplete.vim b/runtime/autoload/syntaxcomplete.vim index 98584b407409d6..6ba262b9aa641e 100644 --- a/runtime/autoload/syntaxcomplete.vim +++ b/runtime/autoload/syntaxcomplete.vim @@ -1,12 +1,16 @@ " Vim completion script " Language: All languages, uses existing syntax highlighting rules " Maintainer: David Fishburn -" Version: 13.0 -" Last Change: 2019 Aug 08 +" Version: 14.0 +" Last Change: 2020 Dec 30 " Usage: For detailed help, ":help ft-syntax-omni" " History " +" Version 14.0 +" - Fixed issue with single quotes and is_keyword +" https://github.com/vim/vim/issues/7463 +" " Version 13.0 " - Extended the option omni_syntax_group_include_{filetype} " to accept a comma separated list of regex's rather than @@ -179,7 +183,8 @@ function! syntaxcomplete#Complete(findstart, base) endif " let base = s:prepended . a:base - let base = s:prepended + " let base = s:prepended + let base = substitute(s:prepended, "'", "''", 'g') let filetype = substitute(&filetype, '\.', '_', 'g') let list_idx = index(s:cache_name, filetype, 0, &ignorecase) @@ -548,7 +553,7 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) " let syn_list = substitute( @l, '^.*xxx\s*\%(contained\s*\)\?', "", '' ) " let syn_list = substitute( @l, '^.*xxx\s*', "", '' ) - " We only want the words for the lines begining with + " We only want the words for the lines beginning with " containedin, but there could be other items. " Tried to remove all lines that do not begin with contained diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index 9f9609434feb77..b6c4c660b81d86 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -163,7 +163,7 @@ fun! tar#Browse(tarfile) " call Decho("1: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " - elseif tarfile =~# '\.\(tgz\)$' || tarfile =~# '\.\(tbz\)$' || tarfile =~# '\.\(txz\)$' + elseif tarfile =~# '\.\(tgz\)$' || tarfile =~# '\.\(tbz\)$' || tarfile =~# '\.\(txz\)$' || tarfile =~# '\.\(tzs\)$' if has("unix") && executable("file") let filekind= system("file ".shellescape(tarfile,1)) =~ "bzip2" else @@ -174,6 +174,8 @@ fun! tar#Browse(tarfile) exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " elseif filekind =~ "XZ" exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + elseif filekind =~ "Zstandard" + exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " else exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " endif @@ -190,6 +192,8 @@ fun! tar#Browse(tarfile) elseif tarfile =~# '\.\(xz\|txz\)$' " call Decho("3: exe silent r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") exe "sil! r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + elseif tarfile =~# '\.\(zst\|tzs\)$' + exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " else if tarfile =~ '^\s*-' " A file name starting with a dash is taken as an option. Prepend ./ to avoid that. @@ -302,6 +306,9 @@ fun! tar#Read(fname,mode) elseif fname =~ '\.xz$' && executable("xzcat") let decmp= "|xzcat" let doro = 1 + elseif fname =~ '\.zst$' && executable("zstdcat") + let decmp= "|zstdcat" + let doro = 1 else let decmp="" let doro = 0 @@ -331,6 +338,8 @@ fun! tar#Read(fname,mode) exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif filekind =~ "XZ" exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + elseif filekind =~ "Zstandard" + exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp else exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp endif @@ -452,6 +461,10 @@ fun! tar#Write(fname) let tarfile = substitute(tarfile,'\.xz','','e') let compress= "xz -- ".shellescape(tarfile,0) " call Decho("compress<".compress.">") + elseif tarfile =~# '\.zst' + call system("zstd --decompress -- ".shellescape(tarfile,0)) + let tarfile = substitute(tarfile,'\.zst','','e') + let compress= "zstd -- ".shellescape(tarfile,0) elseif tarfile =~# '\.lzma' call system("lzma -d -- ".shellescape(tarfile,0)) let tarfile = substitute(tarfile,'\.lzma','','e') @@ -676,6 +689,28 @@ fun! tar#Extract() else echo "***note*** successfully extracted ".fname endif + + elseif filereadable(tarbase.".tzs") + let extractcmd= substitute(extractcmd,"-","--zstd","") +" call Decho("system(".extractcmd." ".shellescape(tarbase).".tzs ".shellescape(fname).")") + call system(extractcmd." ".shellescape(tarbase).".txz ".shellescape(fname)) + if v:shell_error != 0 + echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tzs ".fname.": failed!" | echohl NONE +" call Decho("***error*** ".extractcmd." ".tarbase.".tzs ".fname.": failed!") + else + echo "***note*** successfully extracted ".fname + endif + + elseif filereadable(tarbase.".tar.zst") + let extractcmd= substitute(extractcmd,"-","--zstd","") +" call Decho("system(".extractcmd." ".shellescape(tarbase).".tar.zst ".shellescape(fname).")") + call system(extractcmd." ".shellescape(tarbase).".tar.xz ".shellescape(fname)) + if v:shell_error != 0 + echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar.zst ".fname.": failed!" | echohl NONE +" call Decho("***error*** ".extractcmd." ".tarbase.".tar.zst ".fname.": failed!") + else + echo "***note*** successfully extracted ".fname + endif endif " restore option diff --git a/runtime/autoload/zip.vim b/runtime/autoload/zip.vim index d6bde99a7d48a0..f6b876df0584e3 100644 --- a/runtime/autoload/zip.vim +++ b/runtime/autoload/zip.vim @@ -1,7 +1,7 @@ " zip.vim: Handles browsing zipfiles " AUTOLOAD PORTION " Date: Jan 07, 2020 -" Version: 30 +" Version: 31 " Maintainer: Charles E Campbell " License: Vim License (see vim's :help license) " Copyright: Copyright (C) 2005-2019 Charles E. Campbell {{{1 @@ -20,7 +20,7 @@ if &cp || exists("g:loaded_zip") finish endif -let g:loaded_zip= "v30" +let g:loaded_zip= "v31" if v:version < 702 echohl WarningMsg echo "***warning*** this version of zip needs vim 7.2 or later" @@ -65,7 +65,7 @@ endif " zip#Browse: {{{2 fun! zip#Browse(zipfile) " call Dfunc("zip#Browse(zipfile<".a:zipfile.">)") - " sanity check: ensure that the zipfile has "PK" as its first two letters + " sanity check: insure that the zipfile has "PK" as its first two letters " (zipped files have a leading PK as a "magic cookie") if !filereadable(a:zipfile) || readfile(a:zipfile, "", 1)[0] !~ '^PK' exe "noswapfile noautocmd noswapfile e ".fnameescape(a:zipfile) diff --git a/runtime/colors/README.txt b/runtime/colors/README.txt index 057bbec51f7bb6..89501e0517cdc2 100644 --- a/runtime/colors/README.txt +++ b/runtime/colors/README.txt @@ -67,7 +67,7 @@ You can use ":highlight" to find out the current colors. Exception: the ctermfg and ctermbg values are numbers, which are only valid for the current terminal. Use the color names instead. See ":help cterm-colors". -The default color settings can be found in the source file src/syntax.c. +The default color settings can be found in the source file src/highlight.c. Search for "highlight_init". If you think you have a color scheme that is good enough to be used by others, diff --git a/runtime/colors/tools/check_colors.vim b/runtime/colors/tools/check_colors.vim index de77a382b07281..b0146cc6776ed0 100644 --- a/runtime/colors/tools/check_colors.vim +++ b/runtime/colors/tools/check_colors.vim @@ -185,7 +185,7 @@ func! Test_check_colors() " 9) Normal should be defined first, not use reverse, fg or bg call cursor(1,1) - let pat = 'hi\%[light] \+\%(link\|clear\)\@!\w\+\>' + let pat = 'hi\%[ghlight] \+\%(link\|clear\)\@!\w\+\>' call search(pat, 'cW') " Look for the first hi def, skipping `hi link` and `hi clear` if getline('.') !~# '\m\' let err['highlight']['Normal'] = 'Should be defined first' diff --git a/runtime/compiler/checkstyle.vim b/runtime/compiler/checkstyle.vim index eac461bb2d6cd9..4ebd9e15b536f9 100644 --- a/runtime/compiler/checkstyle.vim +++ b/runtime/compiler/checkstyle.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: Checkstyle " Maintainer: Doug Kearns -" Last Change: 2013 Jun 26 +" Last Change: 2020 Aug 2 if exists("current_compiler") finish @@ -12,8 +12,18 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal command -nargs=* CompilerSet setlocal endif -CompilerSet makeprg=java\ com.puppycrawl.tools.checkstyle.Main\ -f\ plain +let s:cpo_save = &cpo +set cpo&vim -" sample error: WebTable.java:282: '+=' is not preceeded with whitespace. -" WebTable.java:201:1: '{' should be on the previous line. -CompilerSet errorformat=%f:%l:%v:\ %m,%f:%l:\ %m,%-G%.%# +" CompilerSet makeprg=java\ com.puppycrawl.tools.checkstyle.Main\ -f\ plain\ -c\ /sun_checks.xml +" CompilerSet makeprg=java\ -jar\ checkstyle-X.XX-all.jar\ -f\ plain\ -c\ /sun_checks.xml + +CompilerSet makeprg=checkstyle\ -f\ plain +CompilerSet errorformat=[%tRROR]\ %f:%l:%v:\ %m, + \[%tARN]\ %f:%l:%v:\ %m, + \[%tRROR]\ %f:%l:\ %m, + \[%tARN]\ %f:%l:\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/dart.vim b/runtime/compiler/dart.vim new file mode 100644 index 00000000000000..f9ebfe1b2757b3 --- /dev/null +++ b/runtime/compiler/dart.vim @@ -0,0 +1,26 @@ +" Vim compiler file +" Compiler: Dart VM +" Maintainer: Doug Kearns +" Last Change: 2019 May 08 + +if exists("current_compiler") + finish +endif +let current_compiler = "dart" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=dart +CompilerSet errorformat=%E%f:%l:%c:\ Error:\ %m, + \%CTry\ %.%#, + \%Z\ %#^%\\+, + \%C%.%#, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/dart2js.vim b/runtime/compiler/dart2js.vim new file mode 100644 index 00000000000000..b6a4e4d530a361 --- /dev/null +++ b/runtime/compiler/dart2js.vim @@ -0,0 +1,28 @@ +" Vim compiler file +" Compiler: Dart to JavaScript Compiler +" Maintainer: Doug Kearns +" Last Change: 2019 May 08 + +if exists("current_compiler") + finish +endif +let current_compiler = "dart2js" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=dart2js +CompilerSet errorformat=%E%f:%l:%c:, + \%-GError:\ Compilation\ failed., + \%CError:\ %m, + \%Z\ %#^%\\+, + \%C%.%#, + \%trror:\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/dart2native.vim b/runtime/compiler/dart2native.vim new file mode 100644 index 00000000000000..51bdab0cc36b04 --- /dev/null +++ b/runtime/compiler/dart2native.vim @@ -0,0 +1,28 @@ +" Vim compiler file +" Compiler: Dart to Native Compiler +" Maintainer: Doug Kearns +" Last Change: 2019 May 08 + +if exists("current_compiler") + finish +endif +let current_compiler = "dart2native" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=dart2native +CompilerSet errorformat=%E%f:%l:%c:\ Error:\ %m, + \%CTry\ %.%#, + \%Z\ %#^%\\+, + \%Z%$, + \%C%.%#, + \%E%f:\ %trror:\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/dartanalyser.vim b/runtime/compiler/dartanalyser.vim new file mode 100644 index 00000000000000..e691d80b61f101 --- /dev/null +++ b/runtime/compiler/dartanalyser.vim @@ -0,0 +1,23 @@ +" Vim compiler file +" Compiler: Dart Analyzer +" Maintainer: Doug Kearns +" Last Change: 2019 May 08 + +if exists("current_compiler") + finish +endif +let current_compiler = "dartanalyzer" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=dartanalyzer\ --format\ machine +CompilerSet errorformat=%t%\\w%\\+\|%\\w%\\+\|%\\w%\\+\|%f\|%l\|%c\|%\\d%\\+\|%m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/dartdevc.vim b/runtime/compiler/dartdevc.vim new file mode 100644 index 00000000000000..e8d1988ed6514e --- /dev/null +++ b/runtime/compiler/dartdevc.vim @@ -0,0 +1,28 @@ +" Vim compiler file +" Compiler: Dart Development Compiler +" Maintainer: Doug Kearns +" Last Change: 2019 May 08 + +if exists("current_compiler") + finish +endif +let current_compiler = "dartdevc" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=dartdevc +CompilerSet errorformat=%E%f:%l:%c:\ Error:\ %m, + \%CTry\ %.%#, + \%Z\ %#^%\\+, + \%Z%$, + \%C%.%#, + \%E%f:\ %trror:\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/dartdoc.vim b/runtime/compiler/dartdoc.vim new file mode 100644 index 00000000000000..26b38d8dd455db --- /dev/null +++ b/runtime/compiler/dartdoc.vim @@ -0,0 +1,26 @@ +" Vim compiler file +" Compiler: Dart Documentation Generator +" Maintainer: Doug Kearns +" Last Change: 2019 May 08 + +if exists("current_compiler") + finish +endif +let current_compiler = "dartdoc" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=dartdoc +CompilerSet errorformat=\ \ %tarning:\ %m, + \\ \ %trror:\ %m, + \%+EGeneration\ failed:\ %m, + \%+ISuccess!\ Docs\ generated\ into\ %f, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/dartfmt.vim b/runtime/compiler/dartfmt.vim new file mode 100644 index 00000000000000..2e4ab02ad3338e --- /dev/null +++ b/runtime/compiler/dartfmt.vim @@ -0,0 +1,25 @@ +" Vim compiler file +" Compiler: Dart Formatter +" Maintainer: Doug Kearns +" Last Change: 2019 May 08 + +if exists("current_compiler") + finish +endif +let current_compiler = "dartfmt" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=dartfmt +CompilerSet errorformat=%Eline\ %l\\,\ column\ %c\ of\ %f:\ %m, + \%Z\ %\\{3}│\ %\\+^%\\+, + \%C%.%#, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/eslint.vim b/runtime/compiler/eslint.vim index 1e7af2b1820793..7d57acbdf4165a 100644 --- a/runtime/compiler/eslint.vim +++ b/runtime/compiler/eslint.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: ESLint for JavaScript " Maintainer: Romain Lafourcade -" Last Change: 2020 May 17 +" Last Change: 2020 August 20 if exists("current_compiler") finish @@ -12,5 +12,5 @@ if exists(":CompilerSet") != 2 command -nargs=* CompilerSet setlocal endif -CompilerSet makeprg=eslint\ --format\ compact +CompilerSet makeprg=npx\ eslint\ --format\ compact CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %m,%-G%.%# diff --git a/runtime/compiler/fbc.vim b/runtime/compiler/fbc.vim new file mode 100644 index 00000000000000..1c29392da889ad --- /dev/null +++ b/runtime/compiler/fbc.vim @@ -0,0 +1,27 @@ +" Vim compiler file +" Compiler: FreeBASIC Compiler +" Maintainer: Doug Kearns +" Last Change: 2015 Jan 10 + +if exists("current_compiler") + finish +endif +let current_compiler = "fbc" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=fbc +CompilerSet errorformat=%-G%.%#Too\ many\ errors\\,\ exiting, + \%f(%l)\ %tarning\ %n(%\\d%\\+):\ %m, + \%E%f(%l)\ error\ %n:\ %m, + \%-Z%p^, + \%-C%.%#, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/gawk.vim b/runtime/compiler/gawk.vim new file mode 100644 index 00000000000000..a109eb8642c3bf --- /dev/null +++ b/runtime/compiler/gawk.vim @@ -0,0 +1,34 @@ +" Vim compiler file +" Compiler: GNU Awk +" Maintainer: Doug Kearns +" Last Change: 2020 Feb 10 + +if exists("current_compiler") + finish +endif +let current_compiler = "gawk" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=gawk +CompilerSet errorformat=%Z%.awk:\ %f:%l:\ %p^\ %m, + \%Eg%\\=awk:\ %f:%l:\ fatal:\ %m, + \%Egawk:\ %f:%l:\ error:\ %m, + \%Wgawk:\ %f:%l:\ warning:\ %m, + \%Egawk:\ %f:%l:\ %.%#, + \gawk:\ %f:%l:\ %tatal:\ %m, + \gawk:\ %f:%l:\ %trror:\ %m, + \gawk:\ %f:%l:\ %tarning:\ %m, + \gawk:\ %tatal:\ %m, + \gawk:\ %trror:\ %m, + \gawk:\ %tarning:\ %m, + \%+C%.%#, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/gjs.vim b/runtime/compiler/gjs.vim new file mode 100644 index 00000000000000..e0337640307c20 --- /dev/null +++ b/runtime/compiler/gjs.vim @@ -0,0 +1,25 @@ +" Vim compiler file +" Compiler: GJS (Gnome JavaScript Bindings) +" Maintainer: Doug Kearns +" Last Change: 2019 Jul 10 + +if exists("current_compiler") + finish +endif +let current_compiler = "gjs" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=gjs +CompilerSet errorformat=%.%#JS\ %tRROR:\ %m\ @\ %f:%c, + \%E%.%#JS\ ERROR:\ %m, + \%Z@%f:%l:%c, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/javac.vim b/runtime/compiler/javac.vim index a50bdca8f262e0..8507efd67c765c 100644 --- a/runtime/compiler/javac.vim +++ b/runtime/compiler/javac.vim @@ -1,7 +1,7 @@ " Vim compiler file -" Compiler: javac +" Compiler: Java Development Kit Compiler " Maintainer: Doug Kearns -" Last Change: 2004 Nov 27 +" Last Change: 2019 Oct 21 if exists("current_compiler") finish @@ -12,6 +12,15 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal command -nargs=* CompilerSet setlocal endif +let s:cpo_save = &cpo +set cpo&vim + CompilerSet makeprg=javac +CompilerSet errorformat=%E%f:%l:\ error:\ %m, + \%W%f:%l:\ warning:\ %m, + \%-Z%p^, + \%-C%.%#, + \%-G%.%# -CompilerSet errorformat=%E%f:%l:\ %m,%-Z%p^,%-C%.%#,%-G%.%# +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/jest.vim b/runtime/compiler/jest.vim new file mode 100644 index 00000000000000..fee70b7c550c3e --- /dev/null +++ b/runtime/compiler/jest.vim @@ -0,0 +1,30 @@ +" Vim compiler file +" Compiler: Jest +" Maintainer: Doug Kearns +" Last Change: 2018 May 15 + +if exists("current_compiler") + finish +endif +let current_compiler = "jest" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +" CompilerSet makeprg=npx\ jest\ --no-colors + +CompilerSet makeprg=jest\ --no-colors +CompilerSet errorformat=%E\ \ ●\ %m, + \%Z\ %\\{4}%.%#Error:\ %f:\ %m\ (%l:%c):%\\=, + \%Z\ %\\{6}at\ %\\S%#\ (%f:%l:%c), + \%+C\ %\\{4}%\\w%.%#, + \%+C\ %\\{4}%[-+]%.%#, + \%-C%.%#, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/jjs.vim b/runtime/compiler/jjs.vim new file mode 100644 index 00000000000000..09a973683a17ee --- /dev/null +++ b/runtime/compiler/jjs.vim @@ -0,0 +1,24 @@ +" Vim compiler file +" Compiler: Nashorn Shell +" Maintainer: Doug Kearns +" Last Change: 2018 Jan 9 + +if exists("current_compiler") + finish +endif +let current_compiler = "jjs" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=jjs +CompilerSet errorformat=%f:%l:%c\ %m, + \%f:%l\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/jshint.vim b/runtime/compiler/jshint.vim new file mode 100644 index 00000000000000..865591cd2bb5f4 --- /dev/null +++ b/runtime/compiler/jshint.vim @@ -0,0 +1,25 @@ +" Vim compiler file +" Compiler: JSHint +" Maintainer: Doug Kearns +" Last Change: 2019 Jul 10 + +if exists("current_compiler") + finish +endif +let current_compiler = "jshint" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +" CompilerSet makeprg=npx\ jshint\ --verbose + +CompilerSet makeprg=jshint\ --verbose +CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %m\ (%t%n), + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/jsonlint.vim b/runtime/compiler/jsonlint.vim new file mode 100644 index 00000000000000..5466dcc7f4421b --- /dev/null +++ b/runtime/compiler/jsonlint.vim @@ -0,0 +1,25 @@ +" Vim compiler file +" Compiler: JSON Lint +" Maintainer: Doug Kearns +" Last Change: 2019 Jul 10 + +if exists("current_compiler") + finish +endif +let current_compiler = "jsonlint" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +" CompilerSet makeprg=npx\ jsonlint\ --compact\ --quiet + +CompilerSet makeprg=jsonlint\ --compact\ --quiet +CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ found:\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/ocaml.vim b/runtime/compiler/ocaml.vim index 7f8a7eab67f488..faa8af1f5f3b38 100644 --- a/runtime/compiler/ocaml.vim +++ b/runtime/compiler/ocaml.vim @@ -1,11 +1,11 @@ " Vim Compiler File " Compiler: ocaml " Maintainer: Markus Mottl -" URL: https://github.com/rgrinberg/vim-ocaml +" URL: https://github.com/ocaml/vim-ocaml " Last Change: +" 2020 Mar 28 - Improved error format (Thomas Leonard) " 2017 Nov 26 - Improved error format (Markus Mottl) " 2013 Aug 27 - Added a new OCaml error format (Markus Mottl) -" 2013 Jun 30 - Initial version (Marc Weber) " " Marc Weber's comments: " Setting makeprg doesn't make sense, because there is ocamlc, ocamlopt, @@ -21,6 +21,7 @@ " " So having it here makes people opt-in + if exists("current_compiler") finish endif @@ -30,6 +31,7 @@ let s:cpo_save = &cpo set cpo&vim CompilerSet errorformat = + \%EFile\ \"%f\"\\,\ lines\ %*\\d-%l\\,\ characters\ %c-%*\\d:, \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:, \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d\ %.%#, \%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m, diff --git a/runtime/compiler/rhino.vim b/runtime/compiler/rhino.vim new file mode 100644 index 00000000000000..30f3dd32529d60 --- /dev/null +++ b/runtime/compiler/rhino.vim @@ -0,0 +1,30 @@ +" Vim compiler file +" Compiler: Rhino Shell (JavaScript in Java) +" Maintainer: Doug Kearns +" Last Change: 2019 Jul 10 + +if exists("current_compiler") + finish +endif +let current_compiler = "rhino" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +" CompilerSet makeprg=java\ -jar\ lib/rhino-X.X.XX.jar\ -w\ -strict + +CompilerSet makeprg=rhino +CompilerSet errorformat=%-Gjs:\ %.%#Compilation\ produced%.%#, + \%Ejs:\ \"%f\"\\,\ line\ %l:\ %m, + \%Ejs:\ uncaught\ JavaScript\ runtime\ exception:\ %m, + \%Wjs:\ warning:\ \"%f\"\\,\ line\ %l:\ %m, + \%Zjs:\ %p^, + \%Cjs:\ %.%#, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/rubocop.vim b/runtime/compiler/rubocop.vim new file mode 100644 index 00000000000000..7764b4ad20a97f --- /dev/null +++ b/runtime/compiler/rubocop.vim @@ -0,0 +1,23 @@ +" Vim compiler file +" Compiler: RuboCop +" Maintainer: Doug Kearns +" Last Change: 2019 Jul 10 + +if exists("current_compiler") + finish +endif +let current_compiler = "rubocop" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=rubocop\ --format\ emacs +CompilerSet errorformat=%f:%l:%c:\ %t:\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/shellcheck.vim b/runtime/compiler/shellcheck.vim new file mode 100644 index 00000000000000..7550439aa2ca86 --- /dev/null +++ b/runtime/compiler/shellcheck.vim @@ -0,0 +1,25 @@ +" Vim compiler file +" Compiler: ShellCheck +" Maintainer: Doug Kearns +" Last Change: 2020 Sep 4 + +if exists("current_compiler") + finish +endif +let current_compiler = "shellcheck" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=shellcheck\ -f\ gcc +CompilerSet errorformat=%f:%l:%c:\ %trror:\ %m\ [SC%n], + \%f:%l:%c:\ %tarning:\ %m\ [SC%n], + \%f:%l:%c:\ %tote:\ %m\ [SC%n], + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/sml.vim b/runtime/compiler/sml.vim new file mode 100644 index 00000000000000..c7e1b1bf160aa3 --- /dev/null +++ b/runtime/compiler/sml.vim @@ -0,0 +1,28 @@ +" Vim compiler file +" Compiler: SML/NJ Compiler +" Maintainer: Doug Kearns +" Last Change: 2020 Feb 10 + +if exists("current_compiler") + finish +endif +let current_compiler = "sml" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=sml +CompilerSet errorformat=%f:%l.%c-%\\d%\\+.%\\d%\\+\ %trror:\ %m, + \%f:%l.%c\ %trror:\ %m, + \%trror:\ %m + \%f:%l.%c-%\\d%\\+.%\\d%\\+\ %tarning:\ %m, + \%f:%l.%c\ %tarning:\ %m, + \%tarning:\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/standard.vim b/runtime/compiler/standard.vim index b6bcf1f6b04af8..50b7c97ca772e9 100644 --- a/runtime/compiler/standard.vim +++ b/runtime/compiler/standard.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: Standard for JavaScript " Maintainer: Romain Lafourcade -" Last Change: 2020 May 17 +" Last Change: 2020 August 20 if exists("current_compiler") finish @@ -12,5 +12,5 @@ if exists(":CompilerSet") != 2 command -nargs=* CompilerSet setlocal endif -CompilerSet makeprg=standard -CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %m,%-G%.%# +CompilerSet makeprg=npx\ standard +CompilerSet errorformat=%f:%l:%c:\ %m,%-G%.%# diff --git a/runtime/compiler/stylelint.vim b/runtime/compiler/stylelint.vim new file mode 100644 index 00000000000000..784a61d46a92c2 --- /dev/null +++ b/runtime/compiler/stylelint.vim @@ -0,0 +1,26 @@ +" Vim compiler file +" Compiler: Stylelint +" Maintainer: Doug Kearns +" Last Change: 2020 Jun 10 + +if exists("current_compiler") + finish +endif +let current_compiler = "stylelint" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +" CompilerSet makeprg=npx\ stylelint\ --formatter\ compact + +CompilerSet makeprg=stylelint\ --formatter\ compact +CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %trror\ -\ %m, + \%f:\ line\ %l\\,\ col\ %c\\,\ %tarning\ -\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/tidy.vim b/runtime/compiler/tidy.vim index 75be8b83d9108b..3f8e68ebf22784 100644 --- a/runtime/compiler/tidy.vim +++ b/runtime/compiler/tidy.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: HTML Tidy " Maintainer: Doug Kearns -" Last Change: 2016 Apr 21 +" Last Change: 2020 Sep 4 if exists("current_compiler") finish @@ -12,8 +12,15 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal command -nargs=* CompilerSet setlocal endif -CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ %:S +let s:cpo_save = &cpo +set cpo&vim -" foo.html:8:1: Warning: inserting missing 'foobar' element -" foo.html:9:2: Error: is not recognized! -CompilerSet errorformat=%f:%l:%c:\ %trror:%m,%f:%l:%c:\ %tarning:%m,%-G%.%# +CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes +CompilerSet errorformat=%f:%l:%c:\ %trror:\ %m, + \%f:%l:%c:\ %tarning:\ %m, + \%f:%l:%c:\ %tnfo:\ %m, + \%f:%l:%c:\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/ts-node.vim b/runtime/compiler/ts-node.vim new file mode 100644 index 00000000000000..14f0ea790c3965 --- /dev/null +++ b/runtime/compiler/ts-node.vim @@ -0,0 +1,29 @@ +" Vim compiler file +" Compiler: TypeScript Runner +" Maintainer: Doug Kearns +" Last Change: 2020 Feb 10 + +if exists("current_compiler") + finish +endif +let current_compiler = "node" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +" CompilerSet makeprg=npx\ ts-node + +CompilerSet makeprg=ts-node +CompilerSet errorformat=%f\ %#(%l\\,%c):\ %trror\ TS%n:\ %m, + \%E%f:%l, + \%+Z%\\w%\\+Error:\ %.%#, + \%C%p^%\\+, + \%C%.%#, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/tsc.vim b/runtime/compiler/tsc.vim new file mode 100644 index 00000000000000..a246fc7751e727 --- /dev/null +++ b/runtime/compiler/tsc.vim @@ -0,0 +1,26 @@ +" Vim compiler file +" Compiler: TypeScript Compiler +" Maintainer: Doug Kearns +" Last Change: 2020 Feb 10 + +if exists("current_compiler") + finish +endif +let current_compiler = "tsc" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +" CompilerSet makeprg=npx\ tsc + +CompilerSet makeprg=tsc +CompilerSet errorformat=%f\ %#(%l\\,%c):\ %trror\ TS%n:\ %m, + \%trror\ TS%n:\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/typedoc.vim b/runtime/compiler/typedoc.vim new file mode 100644 index 00000000000000..3be06f3d4e6761 --- /dev/null +++ b/runtime/compiler/typedoc.vim @@ -0,0 +1,28 @@ +" Vim compiler file +" Compiler: TypeDoc +" Maintainer: Doug Kearns +" Last Change: 2020 Feb 10 + +if exists("current_compiler") + finish +endif +let current_compiler = "typedoc" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +" CompilerSet makeprg=npx\ typedoc + +CompilerSet makeprg=typedoc +CompilerSet errorformat=%EError:\ %f(%l), + \%WWarning:\ %f(%l), + \%+IDocumentation\ generated\ at\ %f, + \%Z\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/xmllint.vim b/runtime/compiler/xmllint.vim index 96cfa55383af9e..79d38b4d141b63 100644 --- a/runtime/compiler/xmllint.vim +++ b/runtime/compiler/xmllint.vim @@ -1,7 +1,7 @@ " Vim compiler file -" Compiler: xmllint +" Compiler: Libxml2 Command-Line Tool " Maintainer: Doug Kearns -" Last Change: 2013 Jul 8 +" Last Change: 2020 Jul 30 if exists("current_compiler") finish @@ -13,14 +13,16 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal endif let s:cpo_save = &cpo -set cpo-=C +set cpo&vim CompilerSet makeprg=xmllint\ --valid\ --noout - -CompilerSet errorformat=%+E%f:%l:\ %.%#\ error\ :\ %m, - \%+W%f:%l:\ %.%#\ warning\ :\ %m, - \%-Z%p^, - \%-G%.%# +CompilerSet errorformat=%E%f:%l:\ %.%#\ error\ :\ %m, + \%W%f:%l:\ %.%#\ warning\ :\ %m, + \%-Z%p^, + \%C%.%#, + \%terror:\ %m, + \%tarning:\ %m, + \%-G%.%# let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/compiler/xo.vim b/runtime/compiler/xo.vim new file mode 100644 index 00000000000000..525657d4bba806 --- /dev/null +++ b/runtime/compiler/xo.vim @@ -0,0 +1,26 @@ +" Vim compiler file +" Compiler: XO +" Maintainer: Doug Kearns +" Last Change: 2019 Jul 10 + +if exists("current_compiler") + finish +endif +let current_compiler = "xo" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +" CompilerSet makeprg=npx\ xo\ --reporter\ compact + +CompilerSet makeprg=xo\ --reporter\ compact +CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %trror\ %m, + \%f:\ line\ %l\\,\ col\ %c\\,\ %tarning\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/zsh.vim b/runtime/compiler/zsh.vim new file mode 100644 index 00000000000000..5703c1fc44a276 --- /dev/null +++ b/runtime/compiler/zsh.vim @@ -0,0 +1,23 @@ +" Vim compiler file +" Compiler: Zsh +" Maintainer: Doug Kearns +" Last Change: 2020 Sep 6 + +if exists("current_compiler") + finish +endif +let current_compiler = "zsh" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=zsh\ -n\ --\ %:S +CompilerSet errorformat=%f:\ line\ %l:\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/defaults.vim b/runtime/defaults.vim index e881604020b536..f3c639bc74d230 100644 --- a/runtime/defaults.vim +++ b/runtime/defaults.vim @@ -1,7 +1,7 @@ " The default vimrc file. " " Maintainer: Bram Moolenaar -" Last change: 2019 Oct 27 +" Last change: 2020 Sep 30 " " This is loaded if no vimrc file was found. " Except when Vim is run with "-u NONE" or "-C". @@ -85,17 +85,6 @@ if has('mouse') endif endif -" Switch syntax highlighting on when the terminal has colors or when using the -" GUI (which always has colors). -if &t_Co > 2 || has("gui_running") - " Revert with ":syntax off". - syntax on - - " I like highlighting strings inside C comments. - " Revert with ":unlet c_comment_strings". - let c_comment_strings=1 -endif - " Only do this part when Vim was compiled with the +eval feature. if 1 @@ -124,6 +113,17 @@ if 1 endif +" Switch syntax highlighting on when the terminal has colors or when using the +" GUI (which always has colors). +if &t_Co > 2 || has("gui_running") + " Revert with ":syntax off". + syntax on + + " I like highlighting strings inside C comments. + " Revert with ":unlet c_comment_strings". + let c_comment_strings=1 +endif + " Convenient command to see the difference between the current buffer and the " file it was loaded from, thus the changes you made. " Only define it when not defined already. diff --git a/runtime/doc/arabic.txt b/runtime/doc/arabic.txt index 97733b5db359f4..d1a92df64936f3 100644 --- a/runtime/doc/arabic.txt +++ b/runtime/doc/arabic.txt @@ -77,7 +77,7 @@ Arabic requires ISO-8859-6 as well as Presentation Form-B fonts (without Form-B, Arabic will _NOT_ be usable). It is highly recommended that users search for so-called 'ISO-10646-1' fonts. Do an Internet search or check www.arabeyes.org for further -info on where to attain the necessary Arabic fonts. +info on where to obtain the necessary Arabic fonts. Font Installation @@ -123,7 +123,7 @@ o Setting the appropriate character Encoding > :set encoding=utf-8 < - to your .vimrc file (entering the command manually into you Vim + to your .vimrc file (entering the command manually into your Vim window is highly discouraged). In short, include ':set encoding=utf-8' to your .vimrc file. diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index b0d791927fad90..20a8f4b49af4c9 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 8.2. Last change: 2020 Jun 10 +*autocmd.txt* For Vim version 8.2. Last change: 2021 Jan 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -54,7 +54,8 @@ effects. Be careful not to destroy your text. :au[tocmd] [group] {event} {pat} [++once] [++nested] {cmd} Add {cmd} to the list of commands that Vim will execute automatically on {event} for a file matching - {pat} |autocmd-patterns|. + {pat} |autocmd-patterns|. + Here {event} cannot be "*". *E1155* Note: A quote character is seen as argument to the :autocmd and won't start a comment. Vim always adds the {cmd} after existing autocommands, @@ -70,6 +71,11 @@ effects. Be careful not to destroy your text. The special pattern or defines a buffer-local autocommand. See |autocmd-buflocal|. +If the `:autocmd` is in Vim9 script (a script that starts with `:vim9script` +and in a `:def` function) then {cmd} will be executed as in Vim9 +script. Thus this depends on where the autocmd is defined, not where it is +triggered. + Note: The ":autocmd" command can only be followed by another command when the '|' appears before {cmd}. This works: > :augroup mine | au! BufRead | augroup END @@ -278,7 +284,7 @@ Name triggered by ~ |BufWinLeave| before a buffer is removed from a window |BufUnload| before unloading a buffer -|BufHidden| just after a buffer has become hidden +|BufHidden| just before a buffer becomes hidden |BufNew| just after creating a new buffer |SwapExists| detected an existing swap file @@ -301,6 +307,9 @@ Name triggered by ~ |VimLeavePre| before exiting Vim, before writing the viminfo file |VimLeave| before exiting Vim, after writing the viminfo file +|VimSuspend| when suspending Vim +|VimResume| when Vim is resumed after being suspended + Terminal |TerminalOpen| after a terminal buffer was created |TerminalWinOpen| after a terminal buffer was created in a new window @@ -551,12 +560,15 @@ CmdlineChanged After a change was made to the text in the *CmdlineEnter* CmdlineEnter After moving the cursor to the command line, where the user can type a command or search - string. + string; including non-interactive use of ":" + in a mapping, but not when using ||. is set to a single character, indicating the type of command-line. |cmdwin-char| *CmdlineLeave* -CmdlineLeave Before leaving the command line. +CmdlineLeave Before leaving the command line; including + non-interactive use of ":" in a mapping, but + not when using ||. Also when abandoning the command line, after typing CTRL-C or . When the commands result in an error the @@ -631,7 +643,7 @@ CompleteDone After Insert mode completion is done. Either *CursorHold* CursorHold When the user doesn't press a key for the time - specified with 'updatetime'. Not re-triggered + specified with 'updatetime'. Not triggered until the user has pressed a key (i.e. doesn't fire every 'updatetime' ms if you leave Vim to make some coffee. :) See |CursorHold-example| @@ -840,6 +852,8 @@ FuncUndefined When a user function is used but it isn't when it's used. The pattern is matched against the function name. Both and are set to the name of the function. + Not triggered when compiling a |Vim9| + function. NOTE: When writing Vim scripts a better alternative is to use an autoloaded function. See |autoload-functions|. @@ -881,9 +895,14 @@ InsertEnter Just before starting Insert mode. Also for The cursor is restored afterwards. If you do not want that set |v:char| to a non-empty string. + *InsertLeavePre* +InsertLeavePre Just before leaving Insert mode. Also when + using CTRL-O |i_CTRL-O|. Be careful not to + change mode or use `:normal`, it will likely + cause trouble. *InsertLeave* -InsertLeave When leaving Insert mode. Also when using - CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|. +InsertLeave Just after leaving Insert mode. Also when + using CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|. *MenuPopup* MenuPopup Just before showing the popup menu (under the right mouse button). Useful for adjusting the @@ -1202,6 +1221,7 @@ VimLeave Before exiting Vim, just after writing the To detect an abnormal exit use |v:dying|. When v:dying is 2 or more this event is not triggered. + To get the exit code use |v:exiting|. *VimLeavePre* VimLeavePre Before exiting Vim, just before writing the .viminfo file. This is executed only once, @@ -1212,10 +1232,22 @@ VimLeavePre Before exiting Vim, just before writing the < To detect an abnormal exit use |v:dying|. When v:dying is 2 or more this event is not triggered. + To get the exit code use |v:exiting|. *VimResized* VimResized After the Vim window was resized, thus 'lines' and/or 'columns' changed. Not when starting up though. + *VimResume* +VimResume When the Vim instance is resumed after being + suspended and |VimSuspend| was triggered. + Useful for triggering |:checktime| and ensure + the buffers content did not change while Vim + was suspended: > + :autocmd VimResume * checktime +< *VimSuspend* +VimSuspend When the Vim instance is suspended. Only when + CTRL-Z was typed inside Vim, not when the + SIGSTOP or SIGTSTP signal was sent to Vim. *WinEnter* WinEnter After entering another window. Not done for the first window, when Vim has just started. @@ -1425,8 +1457,8 @@ name! :aug[roup]! {name} Delete the autocmd group {name}. Don't use this if there is still an autocommand using this group! You will get a warning if doing - it anyway. when the group is the current group - you will get error E936. + it anyway. When the group is the current + group you will get error E936. To enter autocommands for a specific group, use this method: 1. Select the group with ":augroup {name}". diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 96177f35fcce19..d0b50ca9a51a2e 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 8.2. Last change: 2020 Jun 04 +*change.txt* For Vim version 8.2. Last change: 2021 Mar 01 VIM REFERENCE MANUAL by Bram Moolenaar @@ -153,7 +153,7 @@ the 'joinspaces' option is on, these commands insert two spaces after a '.', '!' or '?' (but if 'cpoptions' includes the 'j' flag, they insert two spaces only after a '.'). The 'B' and 'M' flags in 'formatoptions' change the behavior for inserting -spaces before and after a multi-byte character |fo-table|. +spaces before and after a multibyte character |fo-table|. The '[ mark is set at the end of the first line that was joined, '] at the end of the resulting line. @@ -649,6 +649,8 @@ For other systems the tmpnam() library function is used. The space between `:substitute` and the 'c', 'g', 'i', 'I' and 'r' flags isn't required, but in scripts it's a good idea to keep it to avoid confusion. + Also see the two and three letter commands to repeat + :substitute below |:substitute-repeat|. :[range]~[&][flags] [count] *:~* Repeat last substitute with same substitute string @@ -877,20 +879,26 @@ either the first or second pattern in parentheses did not match, so either *:sge* *:sgi* *:sgI* *:sgl* *:sgn* *:sgp* *:sgr* *:sI* *:si* *:sic* *:sIc* *:sie* *:sIe* *:sIg* *:sIl* *:sin* *:sIn* *:sIp* *:sip* *:sIr* *:sir* *:sr* *:src* *:srg* *:sri* *:srI* *:srl* - *:srn* *:srp* + *:srn* *:srp* *:substitute-repeat* 2-letter and 3-letter :substitute commands ~ +These commands repeat the previous `:substitute` command with the given flags. +The first letter is always "s", followed by one or two of the possible flag +characters. For example `:sce` works like `:s///ce`. The table lists the +possible combinations, not all flags are possible, because the command is +short for another command. + List of :substitute commands | c e g i I n p l r - | c :sc :sce :scg :sci :scI :scn :scp :scl --- + | c :sc :sce :scg :sci :scI :scn :scp :scl | e | g :sgc :sge :sg :sgi :sgI :sgn :sgp :sgl :sgr - | i :sic :sie --- :si :siI :sin :sip --- :sir + | i :sic :sie :si :siI :sin :sip :sir | I :sIc :sIe :sIg :sIi :sI :sIn :sIp :sIl :sIr | n | p | l - | r :src --- :srg :sri :srI :srn :srp :srl :sr + | r :src :srg :sri :srI :srn :srp :srl :sr Exceptions: :scr is `:scriptnames` @@ -1631,24 +1639,31 @@ default setting is "tcq". You can separate the option letters with commas for readability. letter meaning when present in 'formatoptions' ~ - + *fo-t* t Auto-wrap text using textwidth + *fo-c* c Auto-wrap comments using textwidth, inserting the current comment leader automatically. + *fo-r* r Automatically insert the current comment leader after hitting in Insert mode. + *fo-o* o Automatically insert the current comment leader after hitting 'o' or 'O' in Normal mode. + *fo-q* q Allow formatting of comments with "gq". Note that formatting will not change blank lines or lines containing only the comment leader. A new paragraph starts after such a line, or when the comment leader changes. + *fo-w* w Trailing white space indicates a paragraph continues in the next line. A line that ends in a non-white character ends a paragraph. + *fo-a* a Automatic formatting of paragraphs. Every time text is inserted or deleted the paragraph will be reformatted. See |auto-format|. When the 'c' flag is present this only happens for recognized comments. + *fo-n* n When formatting text, recognize numbered lists. This actually uses the 'formatlistpat' option, thus any kind of list can be used. The indent of the text after the number is used for the next line. The @@ -1659,6 +1674,7 @@ n When formatting text, recognize numbered lists. This actually uses 1. the first item wraps 2. the second item +< *fo-2* 2 When formatting text, use the indent of the second line of a paragraph for the rest of the paragraph, instead of the indent of the first line. This supports paragraphs in which the first line has a @@ -1668,36 +1684,46 @@ n When formatting text, recognize numbered lists. This actually uses second line of the same paragraph third line. < This also works inside comments, ignoring the comment leader. + *fo-v* v Vi-compatible auto-wrapping in insert mode: Only break a line at a blank that you have entered during the current insert command. (Note: this is not 100% Vi compatible. Vi has some "unexpected features" or bugs in this area. It uses the screen column instead of the line column.) + *fo-b* b Like 'v', but only auto-wrap if you enter a blank at or before the wrap margin. If the line was longer than 'textwidth' when you started the insert, or you do not enter a blank in the insert before reaching 'textwidth', Vim does not perform auto-wrapping. + *fo-l* l Long lines are not broken in insert mode: When a line was longer than 'textwidth' when the insert command started, Vim does not automatically format it. -m Also break at a multi-byte character above 255. This is useful for + *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. -M When joining lines, don't insert a space before or after a multi-byte + *fo-M* +M When joining lines, don't insert a space before or after a multibyte character. Overrules the 'B' flag. -B When joining lines, don't insert a space between two multi-byte + *fo-B* +B When joining lines, don't insert a space between two multibyte characters. Overruled by the 'M' flag. + *fo-1* 1 Don't break a line after a one-letter word. It's broken before it instead (if possible). + *fo-]* ] Respect textwidth rigorously. With this flag set, no line can be longer than textwidth, unless line-break-prohibition rules make this impossible. Mainly for CJK scripts and works only if 'encoding' is "utf-8". + *fo-j* j Where it makes sense, remove a comment leader when joining lines. For example, joining: int i; // the index ~ // in the list ~ Becomes: int i; // the index in the list ~ + *fo-p* p Don't break lines at single spaces that follow periods. This is intended to complement 'joinspaces' and |cpo-J|, for prose with sentences separated by two spaces. For example, with 'textwidth' set @@ -1755,7 +1781,7 @@ Some examples: Automatic formatting *auto-format* *autoformat* When the 'a' flag is present in 'formatoptions' text is formatted -automatically when inserting text or deleting text. This works nice for +automatically when inserting text or deleting text. This works nicely for editing text paragraphs. A few hints on how to use this: - You need to properly define paragraphs. The simplest is paragraphs that are @@ -1801,7 +1827,7 @@ Vim has a sorting function and a sorting command. The sorting function can be found here: |sort()|, |uniq()|. *:sor* *:sort* -:[range]sor[t][!] [b][f][i][n][o][r][u][x] [/{pattern}/] +:[range]sor[t][!] [b][f][i][l][n][o][r][u][x] [/{pattern}/] Sort lines in [range]. When no range is given all lines are sorted. @@ -1809,6 +1835,16 @@ found here: |sort()|, |uniq()|. With [i] case is ignored. + With [l] sort uses the current collation locale. + Implementation details: strcoll() is used to compare + strings. See |:language| to check or set the collation + locale. Example: > + :language collate en_US.UTF-8 + :%sort l +< |v:collate| can also used to check the current locale. + Sorting using the locale typically ignores case. + This does not work properly on Mac. + Options [n][f][x][o][b] are mutually exclusive. With [n] sorting is done on the first decimal number @@ -1842,6 +1878,8 @@ found here: |sort()|, |uniq()|. When /{pattern}/ is specified and there is no [r] flag the text matched with {pattern} is skipped, so that you sort on what comes after the match. + 'ignorecase' applies to the pattern, but 'smartcase' + is not used. Instead of the slash any non-letter can be used. For example, to sort on the second comma-separated field: > @@ -1875,8 +1913,7 @@ found here: |sort()|, |uniq()|. Note that using `:sort` with `:global` doesn't sort the matching lines, it's quite useless. -The details about sorting depend on the library function used. There is no -guarantee that sorting obeys the current locale. You will have to try it out. +`:sort` does not use the current locale unless the l flag is used. Vim does do a "stable" sort. The sorting can be interrupted, but if you interrupt it too late in the diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt index 84a344fa957c06..6e5cfc8356d71b 100644 --- a/runtime/doc/channel.txt +++ b/runtime/doc/channel.txt @@ -1,4 +1,4 @@ -*channel.txt* For Vim version 8.2. Last change: 2020 Jul 10 +*channel.txt* For Vim version 8.2. Last change: 2020 Oct 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -608,6 +608,10 @@ ch_logfile({fname} [, {mode}]) *ch_logfile()* after every message, on Unix you can use "tail -f" to see what is going on in real time. + To enable the log very early, to see what is received from a + terminal during startup, use |--cmd|: > + vim --cmd "call ch_logfile('logfile', 'w')" +< This function is not available in the |sandbox|. NOTE: the channel communication is stored in the file, be aware that this may contain confidential and privacy sensitive @@ -961,6 +965,10 @@ job_status({job}) *job_status()* *E916* "fail", because a fork happens before the failure can be detected. + If in Vim9 script a variable is declared with type "job" but + never assigned to, passing that variable to job_status() + returns "fail". + If an exit callback was set with the "exit_cb" option and the job is now detected to be "dead" the callback will be invoked. @@ -1256,7 +1264,9 @@ After setting 'buftype' to "prompt" Vim does not automatically start Insert mode, use `:startinsert` if you want to enter Insert mode, so that the user can start typing a line. -The text of the prompt can be set with the |prompt_setprompt()| function. +The text of the prompt can be set with the |prompt_setprompt()| function. If +no prompt is set with |prompt_setprompt()|, "% " is used. You can get the +effective prompt text for a buffer, with |prompt_getprompt()|. The user can go to Normal mode and navigate through the buffer. This can be useful to see older output or copy text. @@ -1282,7 +1292,7 @@ prompt. > " Send the text to a shell with Enter appended. call ch_sendraw(g:shell_job, a:text .. "\n") endfunc - + " Function handling output from the shell: Added above the prompt. func GotOutput(channel, msg) call append(line("$") - 1, "- " . a:msg) diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index ecaa73e894974b..92560216ee42b0 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 8.2. Last change: 2020 Apr 23 +*cmdline.txt* For Vim version 8.2. Last change: 2021 Jan 26 VIM REFERENCE MANUAL by Bram Moolenaar @@ -797,7 +797,7 @@ three lines: > < Visual Mode and Range *v_:* - + *:star-visual-range* {Visual}: Starts a command-line with the Visual selected lines as a range. The code `:'<,'>` is used for this range, which makes it possible to select a similar line from the command-line @@ -849,6 +849,16 @@ function |expand()|. file name n. See |:oldfiles| or |v:oldfiles| to get the number. *E809* {only when compiled with the |+eval| and |+viminfo| features} +In |Vim9-script| # is used to start a comment, use %% for the alternate file +name: + % Is replaced with the current file name. + %% Is replaced with the alternate file name. *:_%%* *c_%%* + %%n (where n is a number) is replaced with *:_%%0* *:_%%n* + the file name of buffer n. "%%0" is the same as "%%". *c_%%n* + %%% Is replaced with all names in the argument *:_%%%* *c_%%%#* + list concatenated, separated by spaces. + %% 0) is replaced with old *:_%%<* *c_%%<* + file name n. Note that these, except "#* ** *:* ** - *:* ** *:* ** - *:* ** *:* ** - *:* ** - *:* ** *:* ** - *:* ** *E499* *E500* + *E499* *E500* Note: these are typed literally, they are not special keys! + *:* ** is replaced with the word under the cursor (like |star|) + *:* ** is replaced with the WORD under the cursor (see |WORD|) + *:* ** is replaced with the word under the cursor, including more to form a C expression. E.g., when the cursor is on "arg" of "ptr->arg" then the result is "ptr->arg"; when the cursor is on "]" of "list[idx]" then the result is "list[idx]". This is used for |v:beval_text|. + *:* ** is replaced with the path name under the cursor (like what |gf| uses) + *:* ** When executing autocommands, is replaced with the file name of the buffer being manipulated, or the file for a read or write. *E495* + *:* ** When executing autocommands, is replaced with the currently effective buffer number (for ":r file" and ":so file" it is the current buffer, the file being read/sourced is not in a buffer). *E496* + *:* ** When executing autocommands, is replaced with the match for which this autocommand was executed. *E497* It differs from only when the file name isn't used to match with (for FileType, Syntax and SpellFileMissing events). + *:* ** When executing a ":source" command, is replaced with the file name of the sourced file. *E498* - When executing a function, is replaced with: - "function {function-name}[{lnum}]" - function call nesting is indicated like this: - "function {function-name1}[{lnum}]..{function-name2}[{lnum}]" + When executing a function, is replaced with the call stack, + as with (this is for backwards compatibility, using + is preferred). Note that filename-modifiers are useless when is - used inside a function. + not used inside a script. + *:* ** + is replaced with the call stack, using + "function {function-name}[{lnum}]" for a function line + and "script {file-name}[{lnum}]" for a script line, and + ".." in between items. E.g.: + "function {function-name1}[{lnum}]..{function-name2}[{lnum}]" + *:* ** When executing a ":source" command, is replaced with the line number. *E842* When executing a function it's the line number relative to the start of the function. + *:* ** When executing a script, is replaced with the line number. It differs from in that is replaced with the script line number in any situation. *E961* + *:* ** + is replaced with the {clinetid} of the last received + message in |server2client()| *filename-modifiers* *:_%:* *::8* *::p* *::.* *::~* *::h* *::t* *::r* *::e* *::s* *::gs* *::S* @@ -1073,7 +1096,7 @@ Also see |`=|. In the command-line window the command line can be edited just like editing text in any window. It is a special kind of window, because you cannot leave it in a normal way. -{not available when compiled without the |+cmdline_hist| feature} +{not available when compiled without the |+cmdwin| feature} OPEN *c_CTRL-F* *q:* *q/* *q?* @@ -1126,7 +1149,8 @@ CTRL-C Continue in Command-line mode. The command-line under the in Normal mode. There is no redraw, thus the window will remain visible. :quit Discard the command line and go back to Normal mode. - ":close", ":exit", ":xit" and CTRL-\ CTRL-N also work. + ":close", CTRL-W c, ":exit", ":xit" and CTRL-\ CTRL-N also + work. :qall Quit Vim, unless there are changes in some buffer. :qall! Quit Vim, discarding changes to any buffer. diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index 7ed251a6f65d12..e48983b02d5c1e 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -1,4 +1,4 @@ -*develop.txt* For Vim version 8.2. Last change: 2020 Apr 13 +*develop.txt* For Vim version 8.2. Last change: 2020 Aug 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -34,8 +34,8 @@ balance must be found between them. VIM IS... VI COMPATIBLE *design-compatible* First of all, it should be possible to use Vim as a drop-in replacement for -Vi. When the user wants to, he can use Vim in compatible mode and hardly -notice any difference with the original Vi. +Vi. When the user wants to, Vim can be used in compatible mode and hardly +any differences with the original Vi will be noticed. Exceptions: - We don't reproduce obvious Vi bugs in Vim. @@ -473,7 +473,7 @@ available spell checking libraries and programs. Unfortunately, the result was that none of them provided sufficient capabilities to be used as the spell checking engine in Vim, for various reasons: -- Missing support for multi-byte encodings. At least UTF-8 must be supported, +- Missing support for multibyte encodings. At least UTF-8 must be supported, so that more than one language can be used in the same file. Doing on-the-fly conversion is not always possible (would require iconv support). diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index 0b4edb927671dd..62201d450207ab 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -1,4 +1,4 @@ -*diff.txt* For Vim version 8.2. Last change: 2019 Nov 10 +*diff.txt* For Vim version 8.2. Last change: 2021 Feb 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -59,7 +59,7 @@ In each of the edited files these options are set: 'scrollbind' on 'cursorbind' on 'scrollopt' includes "hor" - 'wrap' off + 'wrap' off, or leave as-is if 'diffopt' includes "followwrap" 'foldmethod' "diff" 'foldcolumn' value from 'diffopt', default is 2 @@ -144,7 +144,7 @@ Otherwise they are set to their default value: 'scrollbind' off 'cursorbind' off 'scrollopt' without "hor" - 'wrap' on + 'wrap' on, or leave as-is if 'diffopt' includes "followwrap" 'foldmethod' "manual" 'foldcolumn' 0 diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt index 191dc7bb113206..79c7cf042d32f4 100644 --- a/runtime/doc/digraph.txt +++ b/runtime/doc/digraph.txt @@ -1,4 +1,4 @@ -*digraph.txt* For Vim version 8.2. Last change: 2019 May 05 +*digraph.txt* For Vim version 8.2. Last change: 2020 Jul 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -33,6 +33,8 @@ An alternative is using the 'keymap' option. it is the Unicode character, see |digraph-encoding|. Example: > :digr e: 235 a: 228 +< You can use `:exe` to enter a hex number: > + :exe 'digr += ' .. 0x2A72 < Avoid defining a digraph with '_' (underscore) as the first character, it has a special meaning in the future. @@ -919,6 +921,7 @@ char digraph hex dec official name ~ ‟ 9" 201F 8223 DOUBLE HIGH-REVERSED-9 QUOTATION MARK † /- 2020 8224 DAGGER ‡ /= 2021 8225 DOUBLE DAGGER +• oo 2022 8226 BULLET ‥ .. 2025 8229 TWO DOT LEADER … ,. 2026 8230 HORIZONTAL ELLIPSIS ‰ %0 2030 8240 PER MILLE SIGN diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 09985447635a53..4c4de79ee3d7c4 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 8.2. Last change: 2020 Jul 05 +*editing.txt* For Vim version 8.2. Last change: 2021 Jan 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -73,10 +73,14 @@ g CTRL-G Prints the current position of the cursor in five ways: Column, Line, Word, Character and Byte. If the number of Characters and Bytes is the same then the Character position is omitted. + If there are characters in the line that take more than one position on the screen ( or special - character), both the "real" column and the screen - column are shown, separated with a dash. + character), or characters using more than one byte per + column (characters above 0x7F when 'encoding' is + utf-8), both the byte column and the screen column are + shown, separated by a dash. + Also see the 'ruler' option and the |wordcount()| function. @@ -652,7 +656,7 @@ list of the current window. :args ## x < This will add the "x" item and sort the new list. -:argd[elete] {pattern} .. *:argd* *:argdelete* *E480* +:argd[elete] {pattern} .. *:argd* *:argdelete* *E480* *E610* Delete files from the argument list that match the {pattern}s. {pattern} is used like a file pattern, see |file-pattern|. "%" can be used to delete the @@ -662,7 +666,7 @@ list of the current window. Example: > :argdel *.obj -:[range]argd[elete] Delete the {range} files from the argument list. +:[range]argd[elete] Delete the [range] files from the argument list. Example: > :10,$argdel < Deletes arguments 10 and further, keeping 1-9. > @@ -1010,7 +1014,7 @@ to write anyway add a '!' to the command. *write-permissions* When writing a new file the permissions are read-write. For unix the mask is -0666 with additionally umask applied. When writing a file that was read Vim +0o666 with additionally umask applied. When writing a file that was read Vim will preserve the permissions, but clear the s-bit. *write-readonly* @@ -1029,7 +1033,7 @@ original file fails, there will be an error message telling you that you lost the original file. *DOS-format-write* -If the 'fileformat' is "dos", is used for . This is default +If the 'fileformat' is "dos", is used for . This is default for Win32. On other systems the message "[dos format]" is shown to remind you that an unusual was used. *Unix-format-write* @@ -1415,8 +1419,8 @@ There are a few things to remember when editing binary files: the file. It is also possible that you get an "out of memory" error when reading the file. - Make sure the 'binary' option is set BEFORE loading the - file. Otherwise both and are considered to end a line - and when the file is written the will be replaced with . + file. Otherwise both and are considered to end a line + and when the file is written the will be replaced with . - characters are shown on the screen as ^@. You can enter them with "CTRL-V CTRL-@" or "CTRL-V 000" - To insert a character in the file split a line. When writing the diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index ed4f8aab0ee01e..86df7b5704c270 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.2. Last change: 2020 Jul 19 +*eval.txt* For Vim version 8.2. Last change: 2021 Mar 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -49,7 +49,7 @@ There are ten types of variables: *Number* *Integer* Number A 32 or 64 bit signed number. |expr-number| The number of bits is available in |v:numbersize|. - Examples: -123 0x10 0177 0b1011 + Examples: -123 0x10 0177 0o177 0b1011 Float A floating point number. |floating-point-format| *Float* {only when compiled with the |+float| feature} @@ -97,9 +97,10 @@ the Number. Examples: Conversion from a String to a Number only happens in legacy Vim script, not in Vim9 script. It is done by converting the first digits to a number. Hexadecimal "0xf9", Octal "017" or "0o17", and Binary "0b10" -numbers are recognized (NOTE: when using |scriptversion-4| octal with a -leading "0" is not recognized). If the String doesn't start with digits, the -result is zero. +numbers are recognized +NOTE: when using |scriptversion-4| octal with a leading "0" is not recognized. +The 0o notation requires patch 8.2.0886. +If the String doesn't start with digits, the result is zero. Examples: String "456" --> Number 456 ~ String "6bar" --> Number 6 ~ @@ -120,8 +121,9 @@ base, use |str2nr()|. *TRUE* *FALSE* *Boolean* For boolean operators Numbers are used. Zero is FALSE, non-zero is TRUE. -You can also use |v:false| and |v:true|. When TRUE is returned from a -function it is the Number one, FALSE is the number zero. +You can also use |v:false| and |v:true|. In Vim9 script |false| and |true|. +When TRUE is returned from a function it is the Number one, FALSE is the +number zero. Note that in the command: > :if "foo" @@ -132,7 +134,27 @@ non-zero number it means TRUE: > :" executed To test for a non-empty string, use empty(): > :if !empty("foo") -< + +< *falsy* *truthy* +An expression can be used as a condition, ignoring the type and only using +whether the value is "sort of true" or "sort of false". Falsy is: + the number zero + empty string, blob, list or dictionary +Other values are truthy. Examples: + 0 falsy + 1 truthy + -1 truthy + 0.0 falsy + 0.1 truthy + '' falsy + 'x' truthy + [] falsy + [0] truthy + {} falsy + #{x: 1} truthy + 0z falsy + 0z00 truthy + *non-zero-arg* Function arguments often behave slightly different from |TRUE|: If the argument is present and it evaluates to a non-zero Number, |v:true| or a @@ -271,13 +293,13 @@ is not available it returns zero or the default value you specify: > List concatenation ~ - + *list-concatenation* Two lists can be concatenated with the "+" operator: > :let longlist = mylist + [5, 6] :let mylist += [7, 8] -To prepend or append an item turn the item into a list by putting [] around -it. To change a list in-place see |list-modification| below. +To prepend or append an item, turn the item into a list by putting [] around +it. To change a list in-place, refer to |list-modification| below. Sublist ~ @@ -292,6 +314,9 @@ similar to -1. > :let shortlist = mylist[2:2] " List with one item: [3] :let otherlist = mylist[:] " make a copy of the List +Notice that the last index is inclusive. If you prefer using an exclusive +index use the |slice()| method. + If the first index is beyond the last item of the List or the second item is before the first item, the result is an empty list. There is no error message. @@ -876,10 +901,13 @@ Example: > All expressions within one level are parsed from left to right. -expr1 *expr1* *E109* +expr1 *expr1* *trinary* *falsy-operator* *??* *E109* ----- -expr2 ? expr1 : expr1 +The trinary operator: expr2 ? expr1 : expr1 +The falsy operator: expr2 ?? expr1 + +Trinary operator ~ The expression before the '?' is evaluated to a number. If it evaluates to |TRUE|, the result is the value of the expression between the '?' and ':', @@ -902,6 +930,23 @@ To keep this readable, using |line-continuation| is suggested: > You should always put a space before the ':', otherwise it can be mistaken for use in a variable such as "a:1". +Falsy operator ~ + +This is also known as the "null coalescing operator", but that's too +complicated, thus we just call it the falsy operator. + +The expression before the '??' is evaluated. If it evaluates to +|truthy|, this is used as the result. Otherwise the expression after the '??' +is evaluated and used as the result. This is most useful to have a default +value for an expression that may result in zero or empty: > + echo theList ?? 'list is empty' + echo GetName() ?? 'unknown' + +These are similar, but not equal: > + expr2 ?? expr1 + expr2 ? expr2 : expr1 +In the second line "expr2" is evaluated twice. + expr2 and expr3 *expr2* *expr3* --------------- @@ -1109,7 +1154,7 @@ expr7 *expr7* For '!' |TRUE| becomes |FALSE|, |FALSE| becomes |TRUE| (one). For '-' the sign of the number is changed. -For '+' the number is unchanged. +For '+' the number is unchanged. Note: "++" has no effect. A String will be converted to a Number first. @@ -1131,19 +1176,27 @@ Evaluation is always from left to right. expr8[expr1] item of String or |List| *expr-[]* *E111* *E909* *subscript* +In legacy Vim script: If expr8 is a Number or String this results in a String that contains the -expr1'th single byte from expr8. expr8 is used as a String, expr1 as a -Number. This doesn't recognize multi-byte encodings, see `byteidx()` for -an alternative, or use `split()` to turn the string into a list of characters. - -Index zero gives the first byte. This is like it works in C. Careful: -text column numbers start with one! Example, to get the byte under the -cursor: > +expr1'th single byte from expr8. expr8 is used as a String (a number is +automatically converted to a String), expr1 as a Number. This doesn't +recognize multibyte encodings, see `byteidx()` for an alternative, or use +`split()` to turn the string into a list of characters. Example, to get the +byte under the cursor: > :let c = getline(".")[col(".") - 1] +In Vim9 script: +If expr8 is a String this results in a String that contains the expr1'th +single character (including any composing characters) from expr8. To use byte +indexes use |strpart()|. + +Index zero gives the first byte or character. Careful: text column numbers +start with one! + If the length of the String is less than the index, the result is an empty String. A negative index always results in an empty string (reason: backward -compatibility). Use [-1:] to get the last byte. +compatibility). Use [-1:] to get the last byte or character. +In Vim9 script a negative index is used like with a list: count from the end. If expr8 is a |List| then it results the item at index expr1. See |list-index| for possible index values. If the index is out of range this results in an @@ -1157,10 +1210,20 @@ error. expr8[expr1a : expr1b] substring or sublist *expr-[:]* -If expr8 is a Number or String this results in the substring with the bytes -from expr1a to and including expr1b. expr8 is used as a String, expr1a and -expr1b are used as a Number. This doesn't recognize multi-byte encodings, see -|byteidx()| for computing the indexes. +If expr8 is a String this results in the substring with the bytes or +characters from expr1a to and including expr1b. expr8 is used as a String, +expr1a and expr1b are used as a Number. + +In legacy Vim script the indexes are byte indexes. This doesn't recognize +multibyte encodings, see |byteidx()| for computing the indexes. If expr8 is +a Number it is first converted to a String. + +In Vim9 script the indexes are character indexes and include composing +characters. To use byte indexes use |strpart()|. To use character indexes +without including composing characters use |strcharpart()|. + +The item at index expr1b is included, it is inclusive. For an exclusive index +use the |slice()| function. If expr1a is omitted zero is used. If expr1b is omitted the length of the string minus one is used. @@ -1173,6 +1236,7 @@ expr1b is smaller than expr1a the result is an empty string. Examples: > :let c = name[-1:] " last byte of a string + :let c = name[0:-1] " the whole string :let c = name[-2:-2] " last but one byte of a string :let s = line(".")[4:] " from the fifth byte to the end :let s = s[:-3] " remove last two bytes @@ -1264,8 +1328,8 @@ When using the lambda form there must be no white space between the } and the number ------ number number constant *expr-number* - *hex-number* *octal-number* *binary-number* + *0x* *hex-number* *0o* *octal-number* *binary-number* Decimal, Hexadecimal (starting with 0x or 0X), Binary (starting with 0b or 0B) and Octal (starting with 0, 0o or 0O). @@ -1518,7 +1582,7 @@ Note how execute() is used to execute an Ex command. That's ugly though. Lambda expressions have internal names like '42'. If you get an error for a lambda expression, you can find what it is with the following command: > - :function {'42'} + :function 42 See also: |numbered-function| ============================================================================== @@ -1796,6 +1860,13 @@ v:dying Normally zero. When a deadly signal is caught it's set to < Note: if another deadly signal is caught when v:dying is one, VimLeave autocommands will not be executed. + *v:exiting* *exiting-variable* +v:exiting Vim exit code. Normally zero, non-zero when something went + wrong. The value is v:null before invoking the |VimLeavePre| + and |VimLeave| autocmds. See |:q|, |:x| and |:cquit|. + Example: > + :au VimLeave * echo "Exit value is " .. v:exiting +< *v:echospace* *echospace-variable* v:echospace Number of screen cells that can be used for an `:echo` message in the last screen line before causing the |hit-enter-prompt|. @@ -1994,6 +2065,8 @@ v:mouse_col Column number for a mouse click obtained with |getchar()|. *v:none* *none-variable* *None* v:none An empty String. Used to put an empty item in JSON. See |json_encode()|. + This can also be used as a function argument to use the + default value, see |none-function_argument|. When used as a number this evaluates to zero. When used as a string this evaluates to "v:none". > echo v:none @@ -2011,6 +2084,12 @@ v:null An empty String. Used to put "null" in JSON. See That is so that eval() can parse the string back to the same value. Read-only. + *v:numbermax* *numbermax-variable* +v:numbermax Maximum value of a number. + + *v:numbermin* *numbermin-variable* +v:numbermin Minimum value of a number (negative) + *v:numbersize* *numbersize-variable* v:numbersize Number of bits in a Number. This is normally 64, but on some systems it may be 32. @@ -2345,7 +2424,7 @@ assert_equalfile({fname-one}, {fname-two} [, {msg}]) Number assert file contents are equal assert_exception({error} [, {msg}]) Number assert {error} is in v:exception -assert_fails({cmd} [, {error} [, {msg}]]) +assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]]) Number assert {cmd} fails assert_false({actual} [, {msg}]) Number assert {actual} is false @@ -2411,10 +2490,14 @@ ch_status({handle} [, {options}]) String status of channel {handle} changenr() Number current change number char2nr({expr} [, {utf8}]) Number ASCII/UTF8 value of first char in {expr} +charclass({string}) Number character class of {string} +charcol({expr}) Number column number of cursor or mark +charidx({string}, {idx} [, {countcc}]) + Number char index of byte {idx} in {string} chdir({dir}) String change current working directory cindent({lnum}) Number C indent for line {lnum} clearmatches([{win}]) none clear all matches -col({expr}) Number column nr of cursor or mark +col({expr}) Number column byte index of cursor or mark complete({startcol}, {matches}) none set Insert mode completion complete_add({expr}) Number add completion match complete_check() Number check for key typed during completion @@ -2455,6 +2538,9 @@ expand({expr} [, {nosuf} [, {list}]]) expandcmd({expr}) String expand {expr} like with `:edit` extend({expr1}, {expr2} [, {expr3}]) List/Dict insert items of {expr2} into {expr1} +extendnew({expr1}, {expr2} [, {expr3}]) + List/Dict like |extend()| but creates a new + List or Dictionary feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer filereadable({file}) Number |TRUE| if {file} is a readable file filewritable({file}) Number |TRUE| if {file} is a writable file @@ -2465,6 +2551,8 @@ finddir({name} [, {path} [, {count}]]) findfile({name} [, {path} [, {count}]]) String find file {name} in {path} flatten({list} [, {maxdepth}]) List flatten {list} up to {maxdepth} levels +flattennew({list} [, {maxdepth}]) + List flatten a copy of {list} float2nr({expr}) Number convert Float {expr} to a Number floor({expr}) Float round {expr} down fmod({expr1}, {expr2}) Float remainder of {expr1} / {expr2} @@ -2476,6 +2564,7 @@ foldlevel({lnum}) Number fold level at {lnum} foldtext() String line displayed for closed fold foldtextresult({lnum}) String text for closed fold at {lnum} foreground() Number bring the Vim window to the foreground +fullcommand({name}) String get full command from {name} funcref({name} [, {arglist}] [, {dict}]) Funcref reference to function {name} function({name} [, {arglist}] [, {dict}]) @@ -2492,6 +2581,7 @@ getbufvar({expr}, {varname} [, {def}]) getchangelist([{expr}]) List list of change list items getchar([expr]) Number get one character from the user getcharmod() Number modifiers for the last typed character +getcharpos({expr}) List position of cursor, mark, etc. getcharsearch() Dict last character search getcmdline() String return the current command-line getcmdpos() Number return cursor position in command-line @@ -2499,7 +2589,8 @@ getcmdtype() String return current command-line type getcmdwintype() String return current command-line window type getcompletion({pat}, {type} [, {filtered}]) List list of cmdline completion matches -getcurpos() List position of the cursor +getcurpos([{winnr}]) List position of the cursor +getcursorcharpos([{winnr}]) List character position of the cursor getcwd([{winnr} [, {tabnr}]]) String get the current working directory getenv({name}) String return environment variable getfontname([{name}]) String name of font being used @@ -2531,6 +2622,7 @@ gettabvar({nr}, {varname} [, {def}]) gettabwinvar({tabnr}, {winnr}, {name} [, {def}]) any {name} in {winnr} in tab page {tabnr} gettagstack([{nr}]) Dict get the tag stack of window {nr} +gettext({text}) String lookup translation of {text} getwininfo([{winid}]) List list of info about each window getwinpos([{timeout}]) List X and Y coord in pixels of the Vim window getwinposx() Number X coord in pixels of the Vim window @@ -2611,8 +2703,9 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) rhs of mapping {name} in mode {mode} mapcheck({name} [, {mode} [, {abbr}]]) String check for mappings matching {name} -mapset({mode}, {abbr}, {dict}) - none restore mapping from |maparg()| result +mapnew({expr1}, {expr2}) List/Dict like |map()| but creates a new List + or Dictionary +mapset({mode}, {abbr}, {dict}) none restore mapping from |maparg()| result match({expr}, {pat} [, {start} [, {count}]]) Number position where {pat} matches in {expr} matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]]) @@ -2623,6 +2716,10 @@ matcharg({nr}) List arguments of |:match| matchdelete({id} [, {win}]) Number delete match identified by {id} matchend({expr}, {pat} [, {start} [, {count}]]) Number position where {pat} ends in {expr} +matchfuzzy({list}, {str} [, {dict}]) + List fuzzy match {str} in {list} +matchfuzzypos({list}, {str} [, {dict}]) + List fuzzy match {str} in {list} matchlist({expr}, {pat} [, {start} [, {count}]]) List match and submatches of {pat} in {expr} matchstr({expr}, {pat} [, {start} [, {count}]]) @@ -2639,7 +2736,7 @@ mzeval({expr}) any evaluate |MzScheme| expression nextnonblank({lnum}) Number line nr of non-blank line >= {lnum} nr2char({expr} [, {utf8}]) String single char with ASCII/UTF8 value {expr} or({expr}, {expr}) Number bitwise OR -pathshorten({expr}) String shorten directory names in a path +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_beval({what}, {options}) Number create popup window for 'ballooneval' @@ -2667,6 +2764,7 @@ popup_show({id}) none unhide popup window {id} pow({x}, {y}) Float {x} to the power of {y} 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_setprompt({buf}, {text}) none set prompt text @@ -2683,7 +2781,7 @@ prop_type_change({name}, {props}) none change an existing property type prop_type_delete({name} [, {props}]) none delete a property type -prop_type_get([{name} [, {props}]]) +prop_type_get({name} [, {props}]) Dict get property type values prop_type_list([{props}]) List get list of property types pum_getpos() Dict position and size of pum if visible @@ -2694,6 +2792,7 @@ pyxeval({expr}) any evaluate |python_x| expression rand([{expr}]) Number get pseudo-random number range({expr} [, {max} [, {stride}]]) List items from {expr} to {max} +readblob({fname}) Blob read a |Blob| from {fname} readdir({dir} [, {expr} [, {dict}]]) List file names in {dir} selected by {expr} readdirex({dir} [, {expr} [, {dict}]]) @@ -2754,8 +2853,11 @@ setbufline({expr}, {lnum}, {text}) {expr} setbufvar({expr}, {varname}, {val}) none set {varname} in buffer {expr} to {val} +setcellwidths({list}) none set character cell width overrides +setcharpos({expr}, {list}) Number set the {expr} position to {list} setcharsearch({dict}) Dict set character search from {dict} setcmdpos({pos}) Number set cursor position in command-line +setcursorcharpos({list}) Number move cursor to position in {list} setenv({name}, {val}) none set environment variable setfperm({fname}, {mode}) Number set {fname} file permissions to {mode} setline({lnum}, {line}) Number set line {lnum} to {line} @@ -2799,6 +2901,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 of a String, List or Blob sort({list} [, {func} [, {dict}]]) List sort {list}, using {func} to compare sound_clear() none stop playing all sounds @@ -2821,9 +2925,11 @@ str2list({expr} [, {utf8}]) List convert each character of {expr} to ASCII/UTF8 value str2nr({expr} [, {base} [, {quoted}]]) Number convert String to Number -strcharpart({str}, {start} [, {len}]) - String {len} characters of {str} at {start} -strchars({expr} [, {skipcc}]) Number character length of the String {expr} +strcharlen({expr}) Number character length of the String {expr} +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} strftime({format} [, {time}]) String format time with a specified format strgetchar({str}, {index}) Number get char {index} from {str} @@ -2831,8 +2937,9 @@ stridx({haystack}, {needle} [, {start}]) Number index of {needle} in {haystack} string({expr}) String String representation of {expr} value strlen({expr}) Number length of the String {expr} -strpart({str}, {start} [, {len}]) - String {len} bytes of {str} at byte {start} +strpart({str}, {start} [, {len} [, {chars}]]) + String {len} bytes/chars of {str} at + byte {start} strptime({format}, {timestring}) Number Convert {timestring} to unix timestamp strridx({haystack}, {needle} [, {start}]) @@ -2930,7 +3037,8 @@ tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr} trim({text} [, {mask} [, {dir}]]) String trim characters in {mask} from {text} trunc({expr}) Float truncate Float {expr} -type({name}) Number type of variable {name} +type({expr}) Number type of value {expr} +typename({expr}) String representation of the type of {expr} undofile({name}) String undo file name for {name} undotree() List undo file tree uniq({list} [, {func} [, {dict}]]) @@ -3031,6 +3139,7 @@ append({lnum}, {text}) *append()* text line below line {lnum} in the current buffer. Otherwise append {text} as one text line below line {lnum} in the current buffer. + Any type of item is accepted and converted to a String. {lnum} can be zero to insert a line before the first one. Returns 1 for failure ({lnum} out of range or out of memory), 0 for success. Example: > @@ -3060,7 +3169,7 @@ appendbufline({expr}, {lnum}, {text}) *appendbufline()* error message is given. Example: > :let failed = appendbufline(13, 0, "# THE START") < -< Can also be used as a |method| after a List, the base is + Can also be used as a |method| after a List, the base is passed as the second argument: > mylist->appendbufline(buf, lnum) @@ -3341,7 +3450,7 @@ bufnr([{expr} [, {create}]]) above. If the buffer doesn't exist, -1 is returned. Or, if the - {create} argument is present and not zero, a new, unlisted, + {create} argument is present and TRUE, a new, unlisted, buffer is created and its number is returned. Example: > let newbuf = bufnr('Scratch001', 1) < Using an empty name uses the current buffer. To create a new @@ -3404,9 +3513,10 @@ byte2line({byte}) *byte2line()* byteidx({expr}, {nr}) *byteidx()* Return byte index of the {nr}'th character in the string - {expr}. Use zero for the first character, it returns zero. - This function is only useful when there are multibyte - characters, otherwise the returned value is equal to {nr}. + {expr}. Use zero for the first character, it then returns + zero. + If there are no multibyte characters the returned value is + equal to {nr}. Composing characters are not counted separately, their byte length is added to the preceding base character. See |byteidxcomp()| below for counting composing characters @@ -3436,8 +3546,8 @@ byteidxcomp({expr}, {nr}) *byteidxcomp()* < The first and third echo result in 3 ('e' plus composing character is 3 bytes), the second echo results in 1 ('e' is one byte). - Only works different from byteidx() when 'encoding' is set to - a Unicode encoding. + Only works differently from byteidx() when 'encoding' is set + to a Unicode encoding. Can also be used as a |method|: > GetName()->byteidxcomp(idx) @@ -3491,7 +3601,7 @@ char2nr({expr} [, {utf8}]) *char2nr()* Example for "utf-8": > char2nr("á") returns 225 char2nr("á"[0]) returns 195 -< With {utf8} set to 1, always treat as utf-8 characters. +< With {utf8} set to TRUE, always treat as utf-8 characters. A combining character is a separate character. |nr2char()| does the opposite. To turn a string into a list of character numbers: > @@ -3502,6 +3612,55 @@ char2nr({expr} [, {utf8}]) *char2nr()* Can also be used as a |method|: > GetChar()->char2nr() + +charclass({string}) *charclass()* + Return the character class of the first character in {string}. + The character class is one of: + 0 blank + 1 punctuation + 2 word character + 3 emoji + other specific Unicode class + The class is used in patterns and word motions. + + *charcol()* +charcol({expr}) Same as |col()| but returns the character index of the column + position given with {expr} instead of the byte position. + + Example: + With the cursor on '세' in line 5 with text "여보세요": > + charcol('.') returns 3 + col('.') returns 7 + +< Can also be used as a |method|: > + GetPos()->col() +< + *charidx()* +charidx({string}, {idx} [, {countcc}]) + Return the character index of the byte at {idx} in {string}. + The index of the first character is zero. + If there are no multibyte characters the returned value is + equal to {idx}. + When {countcc} is omitted or zero, then composing characters + are not counted separately, their byte length is added to the + preceding base character. + When {countcc} is set to 1, then composing characters are + counted as separate characters. + Returns -1 if the arguments are invalid or if {idx} is greater + than the index of the last byte in {string}. An error is + given if the first argument is not a string, the second + argument is not a number or when the third argument is present + and is not zero or one. + See |byteidx()| and |byteidxcomp()| for getting the byte index + from the character index. + Examples: > + echo charidx('áb́ć', 3) returns 1 + echo charidx('áb́ć', 6, 1) returns 4 + echo charidx('áb́ć', 16) returns -1 +< + Can also be used as a |method|: > + GetName()->charidx(idx) + chdir({dir}) *chdir()* Change the current working directory to {dir}. The scope of the directory change depends on the directory of the current @@ -3566,7 +3725,8 @@ col({expr}) The result is a Number, which is the byte index of the column out of range then col() returns zero. To get the line number use |line()|. To get both use |getpos()|. - For the screen column position use |virtcol()|. + For the screen column position use |virtcol()|. For the + character position use |charcol()|. Note that only marks in the current file can be used. Examples: > col(".") column of cursor @@ -3719,7 +3879,7 @@ confirm({msg} [, {choices} [, {default} [, {type}]]]) not need to be the first letter: > confirm("file has been modified", "&Save\nSave &All") < For the console, the first letter of each choice is used as - the default shortcut key. + the default shortcut key. Case is ignored. The optional {default} argument is the number of the choice that is made if the user hits . Use 1 to make the first @@ -3867,6 +4027,9 @@ cursor({list}) This is like the return value of |getpos()| or |getcurpos()|, but without the first item. + To position the cursor using the character count, use + |setcursorcharpos()|. + Does not change the jumplist. If {lnum} is greater than the number of lines in the buffer, the cursor will be positioned at the last line in the buffer. @@ -3934,8 +4097,9 @@ delete({fname} [, {flags}]) *delete()* A symbolic link itself is deleted, not what it points to. - The result is a Number, which is 0 if the delete operation was - successful and -1 when the deletion failed or partly failed. + The result is a Number, which is 0/false if the delete + operation was successful and -1/true when the deletion failed + or partly failed. Use |remove()| to delete an item from a |List|. To delete a line from the buffer use |:delete| or @@ -4266,11 +4430,15 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()* autocmd file name autocmd buffer number (as a String!) autocmd matched name + C expression under the cursor sourced script file or function name sourced script line number or function line number script file line number, also when in a function + "123_" where "123" is the + current script ID || + call stack word under the cursor WORD under the cursor the {clientid} of the last received @@ -4344,10 +4512,10 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()* |Dictionaries|. If they are |Lists|: Append {expr2} to {expr1}. - If {expr3} is given insert the items of {expr2} before item - {expr3} in {expr1}. When {expr3} is zero insert before the - first item. When {expr3} is equal to len({expr1}) then - {expr2} is appended. + If {expr3} is given insert the items of {expr2} before the + item with index {expr3} in {expr1}. When {expr3} is zero + insert before the first item. When {expr3} is equal to + len({expr1}) then {expr2} is appended. Examples: > :echo sort(extend(mylist, [7, 5])) :call extend(mylist, [2, 3], 1) @@ -4379,6 +4547,13 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()* mylist->extend(otherlist) +extendnew({expr1}, {expr2} [, {expr3}]) *extendnew()* + Like |extend()| but instead of adding items to {expr1} a new + List or Dictionary is created and returned. {expr1} remains + unchanged. Items can still be changed by {expr2}, if you + don't want that use |deepcopy()| first. + + feedkeys({string} [, {mode}]) *feedkeys()* Characters in {string} are queued for processing as if they come from a mapping or were typed by the user. @@ -4543,8 +4718,10 @@ flatten({list} [, {maxdepth}]) *flatten()* Flatten {list} up to {maxdepth} levels. Without {maxdepth} the result is a |List| without nesting, as if {maxdepth} is a very large number. - The {list} is changed in place, make a copy first if you do + The {list} is changed in place, use |flattennew()| if you do not want that. + In Vim9 script flatten() cannot be used, you must always use + |flattennew()|. *E900* {maxdepth} means how deep in nested lists changes are made. {list} is not modified when {maxdepth} is 0. @@ -4558,6 +4735,10 @@ flatten({list} [, {maxdepth}]) *flatten()* :echo flatten([1, [2, [3, 4]], 5], 1) < [1, 2, [3, 4], 5] +flattennew({list} [, {maxdepth}]) *flattennew()* + Like |flatten()| but first make a copy of {list}. + + float2nr({expr}) *float2nr()* Convert {expr} to a Number by omitting the part after the decimal point. @@ -4649,7 +4830,8 @@ fnamemodify({fname}, {mods}) *fnamemodify()* :echo fnamemodify("main.c", ":p:h") < results in: > /home/mool/vim/vim/src -< Note: Environment variables don't work in {fname}, use +< If {mods} is empty then {fname} is returned. + Note: Environment variables don't work in {fname}, use |expand()| first then. Can also be used as a |method|: > @@ -4724,6 +4906,21 @@ foreground() Move the Vim window to the foreground. Useful when sent from {only in the Win32, Athena, Motif and GTK GUI versions and the Win32 console version} +fullcommand({name}) *fullcommand()* + Get the full command name from a short abbreviated command + name; see |20.2| for details on command abbreviations. + + {name} may start with a `:` and can include a [range], these + are skipped and not returned. + Returns an empty string if a command doesn't exist or if it's + ambiguous (for user-defined functions). + + For example `fullcommand('s')`, `fullcommand('sub')`, + `fullcommand(':%substitute')` all return "substitute". + + Can also be used as a |method|: > + GetName()->fullcommand() +< *funcref()* funcref({name} [, {arglist}] [, {dict}]) Just like |function()|, but the returned Funcref will lookup @@ -4891,31 +5088,32 @@ getbufinfo([{dict}]) Each returned List item is a dictionary with the following entries: - bufnr buffer number. + bufnr Buffer number. changed TRUE if the buffer is modified. - changedtick number of changes made to the buffer. + changedtick Number of changes made to the buffer. hidden TRUE if the buffer is hidden. - lastused timestamp in seconds, like + lastused Timestamp in seconds, like |localtime()|, when the buffer was last used. {only with the |+viminfo| feature} listed TRUE if the buffer is listed. - lnum current line number in buffer. - linecount number of lines in the buffer (only + lnum Line number used for the buffer when + opened in the current window. + linecount Number of lines in the buffer (only valid when loaded) loaded TRUE if the buffer is loaded. - name full path to the file in the buffer. - signs list of signs placed in the buffer. + name Full path to the file in the buffer. + signs List of signs placed in the buffer. Each list item is a dictionary with the following fields: id sign identifier lnum line number name sign name - variables a reference to the dictionary with + variables A reference to the dictionary with buffer-local variables. - windows list of |window-ID|s that display this + windows List of |window-ID|s that display this buffer - popups list of popup |window-ID|s that + popups List of popup |window-ID|s that display this buffer Examples: > @@ -4967,9 +5165,9 @@ getbufvar({expr}, {varname} [, {def}]) *getbufvar()* The result is the value of option or local buffer variable {varname} in buffer {expr}. Note that the name without "b:" must be used. - When {varname} is empty returns a dictionary with all the + When {varname} is empty returns a |Dictionary| with all the buffer-local variables. - When {varname} is equal to "&" returns a dictionary with all + When {varname} is equal to "&" returns a |Dictionary| with all the buffer-local options. Otherwise, when {varname} starts with "&" returns the value of a buffer-local option. @@ -5051,7 +5249,10 @@ getchar([expr]) *getchar()* |xterm-bracketed-paste|. There is no prompt, you will somehow have to make clear to the - user that a character has to be typed. + user that a character has to be typed. The screen is not + redrawn, e.g. when resizing the window. When using a popup + window it should work better with a |popup-filter|. + There is no mapping for the character. Key codes are replaced, thus when the user presses the key you get the code for the key, not the raw character @@ -5097,6 +5298,23 @@ getcharmod() *getcharmod()* character itself are obtained. Thus Shift-a results in "A" without a modifier. + *getcharpos()* +getcharpos({expr}) + Get the position for {expr}. Same as |getpos()| but the column + number in the returned List is a character index instead of + a byte index. + If |getpos()| returns a very large column number, such as + 2147483647, then getcharpos() will return the character index + of the last character. + + Example: + With the cursor on '세' in line 5 with text "여보세요": > + getcharpos('.') returns [0, 5, 3, 0] + getpos('.') returns [0, 5, 7, 0] +< + Can also be used as a |method|: > + GetMark()->getcharpos() + getcharsearch() *getcharsearch()* Return the current character search information as a {dict} with the following entries: @@ -5217,12 +5435,22 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* GetPattern()->getcompletion('color') < *getcurpos()* -getcurpos() Get the position of the cursor. This is like getpos('.'), but +getcurpos([{winid}]) + Get the position of the cursor. This is like getpos('.'), but includes an extra "curswant" item in the list: [0, lnum, col, off, curswant] ~ The "curswant" number is the preferred column when moving the - cursor vertically. Also see |getpos()|. - The first "bufnum" item is always zero. + cursor vertically. Also see |getcursorcharpos()| and + |getpos()|. + The first "bufnum" item is always zero. The byte position of + the cursor is returned in 'col'. To get the character + position, use |getcursorcharpos()|. + + The optional {winid} argument can specify the window. It can + be the window number or the |window-ID|. The last known + cursor position is returned, this may be invalid for the + current value of the buffer if it is not the current window. + If {winid} is invalid a list with zeroes is returned. This can be used to save and restore the cursor position: > let save_cursor = getcurpos() @@ -5230,7 +5458,24 @@ getcurpos() Get the position of the cursor. This is like getpos('.'), but call setpos('.', save_cursor) < Note that this only works within the window. See |winrestview()| for restoring more state. - *getcwd()* + + Can also be used as a |method|: > + GetWinid()->getcurpos() + +< *getcursorcharpos()* +getcursorcharpos([{winid}]) + Same as |getcurpos()| but the column number in the returned + List is a character index instead of a byte index. + + Example: + With the cursor on '보' in line 3 with text "여보세요": > + getcursorcharpos() returns [0, 3, 2, 0, 3] + getcurpos() returns [0, 3, 4, 0, 3] + +< Can also be used as a |method|: > + GetWinid()->getcursorcharpos() + +< *getcwd()* getcwd([{winnr} [, {tabnr}]]) The result is a String, which is the name of the current working directory. @@ -5434,15 +5679,16 @@ getloclist({nr} [, {what}]) *getloclist()* |location-list-file-window| for more details. - Returns an empty Dictionary if there is no location list for - the window {nr} or the window is not present. + Returns a |Dictionary| with default values if there is no + location list for the window {nr}. + Returns an empty Dictionary if window {nr} does not exist. Examples (See also |getqflist-examples|): > :echo getloclist(3, {'all': 0}) :echo getloclist(5, {'filewinid': 0}) -getmarklist([{expr}] *getmarklist()* +getmarklist([{expr}]) *getmarklist()* Without the {expr} argument returns a |List| with information about all the global marks. |mark| @@ -5450,7 +5696,7 @@ getmarklist([{expr}] *getmarklist()* local marks defined in buffer {expr}. For the use of {expr}, see |bufname()|. - Each item in the retuned List is a |Dict| with the following: + Each item in the returned List is a |Dict| with the following: name - name of the mark prefixed by "'" pos - a |List| with the position of the mark: [bufnum, lnum, col, off] @@ -5536,18 +5782,22 @@ getpos({expr}) Get the position for {expr}. For possible values of {expr} 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. + The column number in the returned List is the byte position + within the line. To get the character position in the line, + use |getcharpos()| + The column number can be very large, e.g. 2147483647, in which + case it means "after the end of the line". This can be used to save and restore the position of a mark: > let save_a_mark = getpos("'a") ... call setpos("'a", save_a_mark) -< Also see |getcurpos()| and |setpos()|. +< Also see |getcharpos()|, |getcurpos()| and |setpos()|. Can also be used as a |method|: > GetMark()->getpos() - getqflist([{what}]) *getqflist()* - Returns a list with all the current quickfix errors. Each + Returns a |List| with all the current quickfix errors. Each list item is a dictionary with these entries: bufnr number of buffer that has the file name, use bufname() to get the name @@ -5661,6 +5911,7 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()* When the register was not set an empty list is returned. If {regname} is not specified, |v:register| is used. + In |Vim9-script| {regname} must be one character. Can also be used as a |method|: > GetRegname()->getreg() @@ -5687,6 +5938,8 @@ getreginfo([{regname}]) *getreginfo()* If {regname} is invalid or not set, an empty Dictionary will be returned. If {regname} is not specified, |v:register| is used. + The returned Dictionary can be passed to |setreg()|. + In |Vim9-script| {regname} must be one character. Can also be used as a |method|: > GetRegname()->getreginfo() @@ -5700,6 +5953,7 @@ getregtype([{regname}]) *getregtype()* "" for an empty or unknown register is one character with value 0x16. If {regname} is not specified, |v:register| is used. + In |Vim9-script| {regname} must be one character. Can also be used as a |method|: > GetRegname()->getregtype() @@ -5793,6 +6047,19 @@ gettagstack([{nr}]) *gettagstack()* Can also be used as a |method|: > GetWinnr()->gettagstack() + +gettext({text}) *gettext()* + Translate {text} if possible. + This is mainly for use in the distributed Vim scripts. When + generating message translations the {text} is extracted by + xgettext, the translator can add the translated message in the + .po file and Vim will lookup the translation when gettext() is + called. + For {text} double quoted strings are preferred, because + xgettext does not understand escaping in single quoted + strings. + + getwininfo([{winid}]) *getwininfo()* Returns information about windows as a |List| with Dictionaries. @@ -5981,7 +6248,7 @@ has({feature} [, {check}]) zero otherwise. This is useful to check for a typo in {feature} and to detect dead code. Keep in mind that an older Vim version will not know about a feature added later and - features that have been abandoned will not be know by the + features that have been abandoned will not be known by the current Vim version. Also see |exists()|. @@ -5998,8 +6265,8 @@ has({feature} [, {check}]) has_key({dict}, {key}) *has_key()* - The result is a Number, which is 1 if |Dictionary| {dict} has - an entry with key {key}. Zero otherwise. + The result is a Number, which is TRUE if |Dictionary| {dict} + has an entry with key {key}. FALSE otherwise. Can also be used as a |method|: > mydict->has_key(key) @@ -6042,16 +6309,16 @@ haslocaldir([{winnr} [, {tabnr}]]) *haslocaldir()* GetWinnr()->haslocaldir() hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()* - The result is a Number, which is 1 if there is a mapping that - contains {what} in somewhere in the rhs (what it is mapped to) - and this mapping exists in one of the modes indicated by - {mode}. + The result is a Number, which is TRUE if there is a mapping + that contains {what} in somewhere in the rhs (what it is + mapped to) and this mapping exists in one of the modes + indicated by {mode}. When {abbr} is there and it is |TRUE| use abbreviations instead of mappings. Don't forget to specify Insert and/or Command-line mode. Both the global mappings and the mappings local to the current buffer are checked for a match. - If no matching mapping is found 0 is returned. + If no matching mapping is found FALSE is returned. The following characters are recognized in {mode}: n Normal mode v Visual and Select mode @@ -6087,8 +6354,8 @@ histadd({history}, {item}) *histadd()* character is sufficient. If {item} does already exist in the history, it will be shifted to become the newest entry. - The result is a Number: 1 if the operation was successful, - otherwise 0 is returned. + The result is a Number: TRUE if the operation was successful, + otherwise FALSE is returned. Example: > :call histadd("input", strftime("%Y %b %d")) @@ -6111,8 +6378,8 @@ histdel({history} [, {item}]) *histdel()* an index, see |:history-indexing|. The respective entry will be removed if it exists. - The result is a Number: 1 for a successful operation, - otherwise 0 is returned. + The result is TRUE for a successful operation, otherwise FALSE + is returned. Examples: Clear expression register history: > @@ -6164,7 +6431,7 @@ histnr({history}) *histnr()* GetHistory()->histnr() < hlexists({name}) *hlexists()* - The result is a Number, which is non-zero if a highlight group + The result is a Number, which is TRUE if a highlight group called {name} exists. This is when the group has been defined in some way. Not necessarily when highlighting has been defined for it, it may also have been used for a syntax @@ -6337,7 +6604,7 @@ inputrestore() *inputrestore()* Restore typeahead that was saved with a previous |inputsave()|. Should be called the same number of times inputsave() is called. Calling it more often is harmless though. - Returns 1 when there is nothing to restore, 0 otherwise. + Returns TRUE when there is nothing to restore, FALSE otherwise. inputsave() *inputsave()* Preserve typeahead (also from mappings) and clear it, so that @@ -6345,7 +6612,7 @@ inputsave() *inputsave()* followed by a matching inputrestore() after the prompt. Can be used several times, in which case there must be just as many inputrestore() calls. - Returns 1 when out of memory, 0 otherwise. + Returns TRUE when out of memory, FALSE otherwise. inputsecret({prompt} [, {text}]) *inputsecret()* This function acts much like the |input()| function with but @@ -6821,7 +7088,7 @@ listener_flush([{buf}]) *listener_flush()* listener_remove({id}) *listener_remove()* Remove a listener previously added with listener_add(). - Returns zero when {id} could not be found, one when {id} was + Returns FALSE when {id} could not be found, TRUE when {id} was removed. Can also be used as a |method|: > @@ -6881,9 +7148,14 @@ luaeval({expr} [, {expr}]) *luaeval()* < {only available when compiled with the |+lua| feature} map({expr1}, {expr2}) *map()* - {expr1} must be a |List| or a |Dictionary|. + {expr1} must be a |List|, |Blob| or |Dictionary|. Replace each item in {expr1} with the result of evaluating - {expr2}. {expr2} must be a |string| or |Funcref|. + {expr2}. For a |Blob| each byte is replaced. + If the item type changes you may want to use |mapnew()| to + create a new List or Dictionary. This is required when using + Vim9 script. + + {expr2} must be a |string| or |Funcref|. If {expr2} is a |string|, inside {expr2} |v:val| has the value of the current item. For a |Dictionary| |v:key| has the key @@ -6918,11 +7190,11 @@ map({expr1}, {expr2}) *map()* |Dictionary| to remain unmodified make a copy first: > :let tlist = map(copy(mylist), ' v:val . "\t"') -< Returns {expr1}, the |List| or |Dictionary| that was filtered. - When an error is encountered while evaluating {expr2} no - further items in {expr1} are processed. When {expr2} is a - Funcref errors inside a function are ignored, unless it was - defined with the "abort" flag. +< Returns {expr1}, the |List|, |Blob| or |Dictionary| that was + filtered. When an error is encountered while evaluating + {expr2} no further items in {expr1} are processed. When + {expr2} is a Funcref errors inside a function are ignored, + unless it was defined with the "abort" flag. Can also be used as a |method|: > mylist->map(expr2) @@ -7031,7 +7303,14 @@ mapcheck({name} [, {mode} [, {abbr}]]) *mapcheck()* GetKey()->mapcheck('n') -mapset({mode}, {abbr}, {dict}) *mapset()* +mapnew({expr1}, {expr2}) *mapnew()* + Like |map()| but instead of replacing items in {expr1} a new + List or Dictionary is created and returned. {expr1} remains + unchanged. Items can still be changed by {expr2}, if you + don't want that use |deepcopy()| first. + + +mapset({mode}, {abbr}, {dict}) *mapset()* Restore a mapping from a dictionary returned by |maparg()|. {mode} and {abbr} should be the same as for the call to |maparg()|. *E460* @@ -7179,7 +7458,8 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]]) to be used when fast match additions and deletions are required, for example to highlight matching parentheses. - The list {pos} can contain one of these items: + {pos} is a list of positions. Each position can be one of + these: - A number. This whole line will be highlighted. The first line has number 1. - A list with one number, e.g., [23]. The whole line with this @@ -7192,7 +7472,7 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]]) - A list with three numbers, e.g., [23, 11, 3]. As above, but the third number gives the length of the highlight in bytes. - The maximum number of positions is 8. + The maximum number of positions in {pos} is 8. Example: > :highlight MyGroup ctermbg=green guibg=green @@ -7201,8 +7481,7 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]]) :call matchdelete(m) < Matches added by |matchaddpos()| are returned by - |getmatches()| with an entry "pos1", "pos2", etc., with the - value a list like the {pos} item. + |getmatches()|. Can also be used as a |method|: > GetGroup()->matchaddpos([23, 11]) @@ -7255,6 +7534,84 @@ matchend({expr}, {pat} [, {start} [, {count}]]) *matchend()* Can also be used as a |method|: > GetText()->matchend('word') + +matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()* + If {list} is a list of strings, then returns a |List| with all + the strings in {list} that fuzzy match {str}. The strings in + the returned list are sorted based on the matching score. + + The optional {dict} argument always supports the following + items: + matchseq When this item is present and {str} contains + multiple words separated by white space, then + returns only matches that contain the words in + the given sequence. + + If {list} is a list of dictionaries, then the optional {dict} + argument supports the following additional items: + key key of the item which is fuzzy matched against + {str}. The value of this item should be a + string. + text_cb |Funcref| that will be called for every item + in {list} to get the text for fuzzy matching. + This should accept a dictionary item as the + argument and return the text for that item to + use for fuzzy matching. + + {str} is treated as a literal string and regular expression + matching is NOT supported. The maximum supported {str} length + is 256. + + When {str} has multiple words each separated by white space, + then the list of strings that have all the words is returned. + + If there are no matching strings or there is an error, then an + empty list is returned. If length of {str} is greater than + 256, then returns an empty list. + + Example: > + :echo matchfuzzy(["clay", "crow"], "cay") +< results in ["clay"]. > + :echo getbufinfo()->map({_, v -> v.name})->matchfuzzy("ndl") +< results in a list of buffer names fuzzy matching "ndl". > + :echo getbufinfo()->matchfuzzy("ndl", {'key' : 'name'}) +< results in a list of buffer information dicts with buffer + names fuzzy matching "ndl". > + :echo getbufinfo()->matchfuzzy("spl", + \ {'text_cb' : {v -> v.name}}) +< results in a list of buffer information dicts with buffer + names fuzzy matching "spl". > + :echo v:oldfiles->matchfuzzy("test") +< results in a list of file names fuzzy matching "test". > + :let l = readfile("buffer.c")->matchfuzzy("str") +< results in a list of lines in "buffer.c" fuzzy matching "str". > + :echo ['one two', 'two one']->matchfuzzy('two one') +< results in ['two one', 'one two']. > + :echo ['one two', 'two one']->matchfuzzy('two one', + \ {'matchseq': 1}) +< results in ['two one']. + +matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()* + Same as |matchfuzzy()|, but returns the list of matched + strings, the list of character positions where characters + in {str} matches and a list of matching scores. You can + use |byteidx()|to convert a character position to a byte + position. + + If {str} matches multiple times in a string, then only the + positions for the best match is returned. + + If there are no matching strings or there is an error, then a + list with three empty list items is returned. + + Example: > + :echo matchfuzzypos(['testing'], 'tsg') +< results in [['testing'], [[0, 2, 6]], [99]] > + :echo matchfuzzypos(['clay', 'lacy'], 'la') +< results in [['lacy', 'clay'], [[0, 1], [1, 2]], [153, 133]] > + :echo [{'text': 'hello', 'id' : 10}]->matchfuzzypos('ll', {'key' : 'text'}) +< results in [[{'id': 10, 'text': 'hello'}], [[2, 3]], [127]] + matchlist({expr}, {pat} [, {start} [, {count}]]) *matchlist()* Same as |match()|, but return a |List|. The first item in the list is the matched string, same as what matchstr() would @@ -7307,8 +7664,10 @@ matchstrpos({expr}, {pat} [, {start} [, {count}]]) *matchstrpos()* < *max()* -max({expr}) Return the maximum value of all items in {expr}. - {expr} can be a |List| or a |Dictionary|. For a Dictionary, +max({expr}) Return the maximum value of all items in {expr}. Example: > + echo max([apples, pears, oranges]) + +< {expr} can be a |List| or a |Dictionary|. For a Dictionary, it returns the maximum of all values in the Dictionary. If {expr} is neither a List nor a Dictionary, or one of the items in {expr} cannot be used as a Number this results in @@ -7378,8 +7737,10 @@ menu_info({name} [, {mode}]) *menu_info()* < *min()* -min({expr}) Return the minimum value of all items in {expr}. - {expr} can be a |List| or a |Dictionary|. For a Dictionary, +min({expr}) Return the minimum value of all items in {expr}. Example: > + echo min([apples, pears, oranges]) + +< {expr} can be a |List| or a |Dictionary|. For a Dictionary, it returns the minimum of all values in the Dictionary. If {expr} is neither a List nor a Dictionary, or one of the items in {expr} cannot be used as a Number this results in @@ -7396,13 +7757,13 @@ mkdir({name} [, {path} [, {prot}]]) necessary. Otherwise it must be "". If {prot} is given it is used to set the protection bits of - the new directory. The default is 0755 (rwxr-xr-x: r/w for - the user readable for others). Use 0700 to make it unreadable - for others. This is only used for the last part of {name}. - Thus if you create /tmp/foo/bar then /tmp/foo will be created - with 0755. + the new directory. The default is 0o755 (rwxr-xr-x: r/w for + the user, readable for others). Use 0o700 to make it + unreadable for others. This is only used for the last part of + {name}. Thus if you create /tmp/foo/bar then /tmp/foo will be + created with 0o755. Example: > - :call mkdir($HOME . "/tmp/foo/bar", "p", 0700) + :call mkdir($HOME . "/tmp/foo/bar", "p", 0o700) < This function is not available in the |sandbox|. @@ -7410,8 +7771,8 @@ mkdir({name} [, {path} [, {prot}]]) flag is passed (since patch 8.0.1708). However, without the "p" option the call will fail. - The function result is a Number, which is 1 if the call was - successful or 0 if the directory creation failed or partly + The function result is a Number, which is TRUE if the call was + successful or FALSE if the directory creation failed or partly failed. Not available on all systems. To check use: > @@ -7529,13 +7890,17 @@ or({expr}, {expr}) *or()* :let bits = bits->or(0x80) -pathshorten({expr}) *pathshorten()* +pathshorten({expr} [, {len}]) *pathshorten()* Shorten directory names in the path {expr} and return the result. The tail, the file name, is kept as-is. The other - components in the path are reduced to single letters. Leading - '~' and '.' characters are kept. Example: > + components in the path are reduced to {len} letters in length. + If {len} is omitted or smaller than 1 then 1 is used (single + letters). Leading '~' and '.' characters are kept. Examples: > :echo pathshorten('~/.vim/autoload/myfile.vim') < ~/.v/a/myfile.vim ~ +> + :echo pathshorten('~/.vim/autoload/myfile.vim', 2) +< ~/.vi/au/myfile.vim ~ It doesn't matter if the path exists or not. Can also be used as a |method|: > @@ -7557,7 +7922,7 @@ perleval({expr}) *perleval()* < {only available when compiled with the |+perl| feature} -popup_ functions are documented here: |popup-functions|. +popup_ functions are documented here: |popup-functions| pow({x}, {y}) *pow()* @@ -7785,6 +8150,17 @@ printf({fmt}, {expr1} ...) *printf()* arguments an error is given. Up to 18 arguments can be used. +prompt_getprompt({buf}) *prompt_getprompt()* + Returns the effective prompt text for buffer {buf}. {buf} can + be a buffer name or number. See |prompt-buffer|. + + If the buffer doesn't exist or isn't a prompt buffer, an empty + string is returned. + + Can also be used as a |method|: > + GetBuffer()->prompt_getprompt() + + prompt_setcallback({buf}, {expr}) *prompt_setcallback()* Set prompt callback for buffer {buf} to {expr}. When {expr} is an empty string the callback is removed. This has only @@ -7840,7 +8216,7 @@ prompt_setprompt({buf}, {text}) *prompt_setprompt()* Can also be used as a |method|: > GetBuffer()->prompt_setprompt('command: ') -prop_ functions are documented here: |text-prop-functions|. +prop_ functions are documented here: |text-prop-functions| pum_getpos() *pum_getpos()* If the popup menu (see |ins-completion-menu|) is not visible, @@ -7941,6 +8317,14 @@ rand([{expr}]) *rand()* *random* :echo rand(seed) :echo rand(seed) % 16 " random number 0 - 15 < + +readblob({fname}) *readblob()* + Read file {fname} in binary mode and return a |Blob|. + When the file can't be opened an error message is given and + the result is an empty |Blob|. + Also see |readfile()| and |writefile()|. + + readdir({directory} [, {expr} [, {dict}]]) *readdir()* Return a list with file and directory names in {directory}. You can also use |glob()| if you don't need to do complicated @@ -8055,6 +8439,7 @@ readdirex({directory} [, {expr} [, {dict}]]) *readdirex()* Can also be used as a |method|: > GetDirName()->readdirex() < + *readfile()* readfile({fname} [, {type} [, {max}]]) Read file {fname} and return a |List|, each line of the file @@ -8066,8 +8451,6 @@ readfile({fname} [, {type} [, {max}]]) - When the last line ends in a NL an extra empty list item is added. - No CR characters are removed. - When {type} contains "B" a |Blob| is returned with the binary - data of the file unmodified. Otherwise: - CR characters that appear before a NL are removed. - Whether the last line ends in a NL or not does not matter. @@ -8085,6 +8468,9 @@ readfile({fname} [, {type} [, {max}]]) Note that without {max} the whole file is read into memory. Also note that there is no recognition of encoding. Read a file into a buffer if you need to. + Deprecated (use |readblob()| instead): When {type} contains + "B" a |Blob| is returned with the binary data of the file + unmodified. When the file can't be opened an error message is given and the result is an empty list. Also see |writefile()|. @@ -8122,15 +8508,18 @@ reg_recording() *reg_recording()* Returns an empty string when not recording. See |q|. reltime([{start} [, {end}]]) *reltime()* - Return an item that represents a time value. The format of - the item depends on the system. It can be passed to - |reltimestr()| to convert it to a string or |reltimefloat()| - to convert to a Float. - Without an argument it returns the current time. + Return an item that represents a time value. The item is a + list with items that depend on the system. In Vim 9 script + list can be used. + The item can be passed to |reltimestr()| to convert it to a + string or |reltimefloat()| to convert to a Float. + + Without an argument reltime() returns the current time. With one argument is returns the time passed since the time specified in the argument. With two arguments it returns the time passed between {start} and {end}. + The {start} and {end} arguments must be values returned by reltime(). @@ -8448,6 +8837,7 @@ screencol() *screencol()* the following mappings: > nnoremap GG ":echom ".screencol()."\n" nnoremap GG :echom screencol() + nnoremap GG echom screencol() < screenpos({winid}, {lnum}, {col}) *screenpos()* The result is a Dict with the screen position of the text @@ -8515,11 +8905,16 @@ search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]]) 'ignorecase', 'smartcase' and 'magic' are used. - When the 'z' flag is not given, searching always starts in - column zero and then matches before the cursor are skipped. - When the 'c' flag is present in 'cpo' the next search starts - after the match. Without the 'c' flag the next search starts - one column further. + When the 'z' flag is not given, forward searching always + starts in column zero and then matches before the cursor are + skipped. When the 'c' flag is present in 'cpo' the next + search starts after the match. Without the 'c' flag the next + search starts one column further. This matters for + overlapping matches. + When searching backwards and the 'z' flag is given then the + search starts in column zero, thus no match in the current + line will be found (unless wrapping around the end of the + file). When the {stopline} argument is given then the search stops after searching this line. This is useful to restrict the @@ -8701,11 +9096,12 @@ searchcount([{options}]) *searchcount()* result. if search exceeded total count, "total" value becomes `maxcount + 1` - (default: 0) + (default: 99) pos |List| `[lnum, col, off]` value when recomputing the result. this changes "current" result - value. see |cursor()|, |getpos() + value. see |cursor()|, + |getpos()| (default: cursor's position) @@ -8852,6 +9248,7 @@ server2client({clientid}, {string}) *server2client()* Send a reply string to {clientid}. The most recent {clientid} that sent a string can be retrieved with expand(""). {only available when compiled with the |+clientserver| feature} + Returns zero for success, -1 for failure. Note: This id has to be stored before the next command can be received. I.e. before returning from the received command and @@ -8916,6 +9313,44 @@ setbufvar({expr}, {varname}, {val}) *setbufvar()* third argument: > GetValue()->setbufvar(buf, varname) + +setcellwidths({list}) *setcellwidths()* + Specify overrides for cell widths of character ranges. This + tells Vim how wide characters are, counted in screen cells. + This overrides 'ambiwidth'. Example: > + setcellwidths([[0xad, 0xad, 1], + \ [0x2194, 0x2199, 2]]) + +< *E1109* *E1110* *E1111* *E1112* *E1113* + The {list} argument is a list of lists with each three + numbers. These three numbers are [low, high, width]. "low" + and "high" can be the same, in which case this refers to one + character. Otherwise it is the range of characters from "low" + to "high" (inclusive). "width" is either 1 or 2, indicating + the character width in screen cells. + An error is given if the argument is invalid, also when a + range overlaps with another. + Only characters with value 0x100 and higher can be used. + + To clear the overrides pass an empty list: > + setcellwidths([]); +< You can use the script $VIMRUNTIME/tools/emoji_list.vim to see + the effect for known emoji characters. + +setcharpos({expr}, {list}) *setcharpos()* + Same as |setpos()| but uses the specified column number as the + character index instead of the byte index in the line. + + Example: + With the text "여보세요" in line 8: > + call setcharpos('.', [0, 8, 4, 0]) +< positions the cursor on the fourth character '요'. > + call setpos('.', [0, 8, 4, 0]) +< positions the cursor on the second character '보'. + + Can also be used as a |method|: > + GetPosition()->setcharpos('.') + setcharsearch({dict}) *setcharsearch()* Set the current character search information to {dict}, which contains one or more of the following entries: @@ -8951,12 +9386,27 @@ setcmdpos({pos}) *setcmdpos()* before inserting the resulting text. When the number is too big the cursor is put at the end of the line. A number smaller than one has undefined results. - Returns 0 when successful, 1 when not editing the command - line. + Returns FALSE when successful, TRUE when not editing the + command line. Can also be used as a |method|: > GetPos()->setcmdpos() +setcursorcharpos({lnum}, {col} [, {off}]) *setcursorcharpos()* +setcursorcharpos({list}) + Same as |cursor()| but uses the specified column number as the + character index instead of the byte index in the line. + + Example: + With the text "여보세요" in line 4: > + call setcursorcharpos(4, 3) +< positions the cursor on the third character '세'. > + call cursor(4, 3) +< positions the cursor on the first character '여'. + + Can also be used as a |method|: > + GetCursorPos()->setcursorcharpos() + setenv({name}, {val}) *setenv()* Set environment variable {name} to {val}. When {val} is |v:null| the environment variable is deleted. @@ -8995,9 +9445,11 @@ setline({lnum}, {text}) *setline()* {lnum} is used like with |getline()|. When {lnum} is just below the last line the {text} will be added below the last line. + {text} can be any type or a List of any type, each item is + converted to a String. - If this succeeds, 0 is returned. If this fails (most likely - because {lnum} is invalid) 1 is returned. + If this succeeds, FALSE is returned. If this fails (most likely + because {lnum} is invalid) TRUE is returned. Example: > :call setline(5, strftime("%c")) @@ -9068,7 +9520,8 @@ setpos({expr}, {list}) "lnum" and "col" are the position in the buffer. The first column is 1. Use a zero "lnum" to delete a mark. If "col" is - smaller than 1 then 1 is used. + smaller than 1 then 1 is used. To use the character count + instead of the byte count, use |setcharpos()|. The "off" number is only used when 'virtualedit' is set. Then it is the offset in screen columns from the start of the @@ -9088,7 +9541,7 @@ setpos({expr}, {list}) Returns 0 when the position could be set, -1 otherwise. An error message is given if {expr} is invalid. - Also see |getpos()| and |getcurpos()|. + Also see |setcharpos()|, |getpos()| and |getcurpos()|. This does not restore the preferred column for moving vertically; if you set the cursor position with this, |j| and @@ -9107,7 +9560,7 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()* argument is ignored. See below for the supported items in {what}. *setqflist-what* - When {what} is not present, the items in {list} or used. Each + When {what} is not present, the items in {list} are used. Each item must be a dictionary. Non-dictionary items in {list} are ignored. Each dictionary item can contain the following entries: @@ -9216,6 +9669,7 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()* setreg({regname}, {value} [, {options}]) Set the register {regname} to {value}. If {regname} is "" or "@", the unnamed register '"' is used. + In |Vim9-script| {regname} must be one character. {value} may be any value returned by |getreg()| or |getreginfo()|, including a |List| or |Dict|. @@ -9328,7 +9782,7 @@ settagstack({nr}, {dict} [, {action}]) *settagstack()* Returns zero for success, -1 for failure. - Examples (for more examples see |tagstack-examples||): + Examples (for more examples see |tagstack-examples|): Empty the tag stack of window 3: > call settagstack(3, {'items' : []}) @@ -9463,6 +9917,18 @@ sinh({expr}) *sinh()* {only available when compiled with the |+float| feature} +slice({expr}, {start} [, {end}]) *slice()* + Similar to using a |slice| "expr[start : end]", but "end" is + used exclusive. And for a string the indexes are used as + character indexes instead of byte indexes, like in + |vim9script|. Also, composing characters are not counted. + When {end} is omitted the slice continues to the last item. + When {end} is -1 the last item is omitted. + + Can also be used as a |method|: > + GetList()->slice(offset) + + sort({list} [, {func} [, {dict}]]) *sort()* *E702* Sort the items in {list} in-place. Returns {list}. @@ -9477,8 +9943,25 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702* When {func} is given and it is '1' or 'i' then case is ignored. + When {func} is given and it is 'l' then the current collation + locale is used for ordering. Implementation details: strcoll() + is used to compare strings. See |:language| check or set the + collation locale. |v:collate| can also be used to check the + current locale. Sorting using the locale typically ignores + case. Example: > + " ö is sorted similarly to o with English locale. + :language collate en_US.UTF8 + :echo sort(['n', 'o', 'O', 'ö', 'p', 'z'], 'l') +< ['n', 'o', 'O', 'ö', 'p', 'z'] ~ +> + " ö is sorted after z with Swedish locale. + :language collate sv_SE.UTF8 + :echo sort(['n', 'o', 'O', 'ö', 'p', 'z'], 'l') +< ['n', 'o', 'O', 'p', 'z', 'ö'] ~ + This does not work properly on Mac. + When {func} is given and it is 'n' then all items will be - sorted numerical (Implementation detail: This uses the + sorted numerical (Implementation detail: this uses the strtod() function to parse numbers, Strings, Lists, Dicts and Funcrefs will be considered as being 0). @@ -9796,23 +10279,44 @@ str2nr({expr} [, {base} [, {quoted}]]) *str2nr()* Can also be used as a |method|: > GetText()->str2nr() -strcharpart({src}, {start} [, {len}]) *strcharpart()* + +strcharlen({expr}) *strcharlen()* + The result is a Number, which is the number of characters + in String {expr}. Composing characters are ignored. + |strchars()| can count the number of characters, counting + composing characters separately. + + Also see |strlen()|, |strdisplaywidth()| and |strwidth()|. + + Can also be used as a |method|: > + GetText()->strcharlen() + + +strcharpart({src}, {start} [, {len} [, {skipcc}]]) *strcharpart()* Like |strpart()| but using character index and length instead of byte index and length. + When {skipcc} is omitted or zero, composing characters are + counted separately. + When {skipcc} set to 1, Composing characters are ignored, + similar to |slice()|. When a character index is used where a character does not - exist it is assumed to be one character. For example: > + exist it is omitted and counted as one character. For + example: > strcharpart('abc', -1, 2) < results in 'a'. Can also be used as a |method|: > GetText()->strcharpart(5) + strchars({expr} [, {skipcc}]) *strchars()* The result is a Number, which is the number of characters in String {expr}. When {skipcc} is omitted or zero, composing characters are counted separately. When {skipcc} set to 1, Composing characters are ignored. + |strcharlen()| always does this. + Also see |strlen()|, |strdisplaywidth()| and |strwidth()|. {skipcc} is only available after 7.4.755. For backward @@ -9930,17 +10434,22 @@ strlen({expr}) The result is a Number, which is the length of the String {expr} in bytes. If the argument is a Number it is first converted to a String. For other types an error is given. - If you want to count the number of multi-byte characters use + If you want to count the number of multibyte characters use |strchars()|. Also see |len()|, |strdisplaywidth()| and |strwidth()|. Can also be used as a |method|: > GetString()->strlen() -strpart({src}, {start} [, {len}]) *strpart()* +strpart({src}, {start} [, {len} [, {chars}]]) *strpart()* The result is a String, which is part of {src}, starting from byte {start}, with the byte length {len}. - To count characters instead of bytes use |strcharpart()|. + When {chars} is present and TRUE then {len} is the number of + characters positions (composing characters are not counted + separately, thus "1" means one base character and any + following composing characters). + To count {start} as characters instead of bytes use + |strcharpart()|. When bytes are selected which do not exist, this doesn't result in an error, the bytes are simply omitted. @@ -9952,8 +10461,8 @@ strpart({src}, {start} [, {len}]) *strpart()* strpart("abcdefg", 3) == "defg" < Note: To get the first character, {start} must be 0. For - example, to get three bytes under and after the cursor: > - strpart(getline("."), col(".") - 1, 3) + example, to get the character under the cursor: > + strpart(getline("."), col(".") - 1, 1, v:true) < Can also be used as a |method|: > GetText()->strpart(5) @@ -10128,7 +10637,7 @@ swapname({expr}) *swapname()* The result is the swap file path of the buffer {expr}. For the use of {expr}, see |bufname()| above. If buffer {expr} is the current buffer, the result is equal to - |:swapname| (unless no swap file). + |:swapname| (unless there is no swap file). If buffer {expr} has no swap file, returns an empty string. Can also be used as a |method|: > @@ -10175,7 +10684,9 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()* "bg" background color (as with "fg") "font" font name (only available in the GUI) |highlight-font| - "sp" special color (as with "fg") |highlight-guisp| + "sp" special color for the GUI (as with "fg") + |highlight-guisp| + "ul" underline color for cterm: number as a string "fg#" like "fg", but for the GUI and the GUI is running the name in "#RRGGBB" form "bg#" like "fg#" for "bg" @@ -10351,8 +10862,13 @@ tabpagebuflist([{arg}]) *tabpagebuflist()* tabpagenr([{arg}]) *tabpagenr()* The result is a Number, which is the number of the current tab page. The first tab page has number 1. - When the optional argument is "$", the number of the last tab - page is returned (the tab page count). + + The optional argument {arg} supports the following values: + $ the number of the last tab page (the tab page + count). + # the number of the last accessed tab page + (where |g| goes to). if there is no + previous tab page 0 is returned. The number can be used with the |:tab| command. @@ -10378,7 +10894,7 @@ tagfiles() Returns a |List| with the file names used to search for tags taglist({expr} [, {filename}]) *taglist()* - Returns a list of tags matching the regular expression {expr}. + Returns a |List| of tags matching the regular expression {expr}. If {filename} is passed it is used to prioritize the results in the same way that |:tselect| does. See |tag-priority|. @@ -10470,12 +10986,12 @@ term_ functions are documented here: |terminal-function-details| terminalprops() *terminalprops()* - Returns a dictionary with properties of the terminal that Vim + Returns a |Dictionary| with properties of the terminal that Vim detected from the response to |t_RV| request. See |v:termresponse| for the response itself. If |v:termresponse| is empty most values here will be 'u' for unknown. - cursor_style wether sending |t_RS| works ** - cursor_blink_mode wether sending |t_RC| works ** + cursor_style whether sending |t_RS| works ** + cursor_blink_mode whether sending |t_RC| works ** underline_rgb whether |t_8u| works ** mouse mouse type supported @@ -10559,6 +11075,8 @@ timer_start({time}, {callback} [, {options}]) function or a |Funcref|. It is called with one argument, which is the timer ID. The callback is only invoked when Vim is waiting for input. + If you want to show a message look at |popup_notification()| + to avoid interfering with what the user is doing. {options} is a dictionary. Supported entries: "repeat" Number of times to repeat calling the @@ -10711,6 +11229,14 @@ type({expr}) The result is a Number representing the type of {expr}. < Can also be used as a |method|: > mylist->type() + +typename({expr}) *typename()* + Return a string representation of the type of {expr}. + Example: > + echo typename([1, 2, 3]) + list + + undofile({name}) *undofile()* Return the name of the undo file that would be used for a file with name {name} when writing. This uses the 'undodir' @@ -10868,16 +11394,18 @@ win_execute({id}, {command} [, {silent}]) *win_execute()* call win_execute(winid, 'set syntax=python') < Doing the same with `setwinvar()` would not trigger autocommands and not actually show syntax highlighting. + *E994* Not all commands are allowed in popup windows. - When window {id} does not exist then no error is given. + When window {id} does not exist then no error is given and + an empty string is returned. Can also be used as a |method|, the base is passed as the second argument: > GetCommand()->win_execute(winid) win_findbuf({bufnr}) *win_findbuf()* - Returns a list with |window-ID|s for windows that contain + Returns a |List| with |window-ID|s for windows that contain buffer {bufnr}. When there is none the list is empty. Can also be used as a |method|: > @@ -10918,7 +11446,7 @@ win_gettype([{nr}]) *win_gettype()* win_gotoid({expr}) *win_gotoid()* Go to window with ID {expr}. This may also change the current tabpage. - Return 1 if successful, 0 if the window cannot be found. + Return TRUE if successful, FALSE if the window cannot be found. Can also be used as a |method|: > GetWinid()->win_gotoid() @@ -10942,7 +11470,8 @@ win_screenpos({nr}) *win_screenpos()* Return the screen position of window {nr} as a list with two numbers: [row, col]. The first window always has position [1, 1], unless there is a tabline, then it is [2, 1]. - {nr} can be the window number or the |window-ID|. + {nr} can be the window number or the |window-ID|. Use zero + for the current window. Return [0, 0] if the window cannot be found in the current tabpage. @@ -11130,7 +11659,8 @@ winsaveview() Returns a |Dictionary| that contains information to restore curswant column for vertical movement topline first line in the window topfill filler lines, only in diff mode - leftcol first column displayed + leftcol first column displayed; only used when + 'wrap' is off skipcol columns skipped Note that no option values are saved. @@ -11349,7 +11879,7 @@ menu Compiled with support for |:menu|. mksession Compiled with support for |:mksession|. modify_fname Compiled with file name modifiers. |filename-modifiers| (always true) -mouse Compiled with support mouse. +mouse Compiled with support for mouse. mouse_dec Compiled with support for Dec terminal mouse. mouse_gpm Compiled with support for gpm (Linux console mouse) mouse_gpm_enabled GPM mouse is working @@ -11361,7 +11891,7 @@ mouse_urxvt Compiled with support for urxvt mouse. mouse_xterm Compiled with support for xterm mouse. mouseshape Compiled with support for 'mouseshape'. multi_byte Compiled with support for 'encoding' (always true) -multi_byte_encoding 'encoding' is set to a multi-byte encoding. +multi_byte_encoding 'encoding' is set to a multibyte encoding. multi_byte_ime Compiled with support for IME input method. multi_lang Compiled with support for multiple languages. mzscheme Compiled with MzScheme interface |mzscheme|. @@ -11710,7 +12240,7 @@ The argument default expressions are evaluated at the time of the function call, not definition. Thus it is possible to use an expression which is invalid the moment the function is defined. The expressions are also only evaluated when arguments are not specified during a call. - + *none-function_argument* You can pass |v:none| to use the default expression. Note that this means you cannot pass v:none as an ordinary value when an argument has a default expression. @@ -11904,8 +12434,9 @@ be used to pass settings to the autoload script before it's loaded: > Note that when you make a mistake and call a function that is supposed to be defined in an autoload script, but the script doesn't actually define the -function, the script will be sourced every time you try to call the function. -And you will get an error message every time. +function, you will get an error message for the missing function. If you fix +the autoload script it won't be automatically loaded again. Either restart +Vim or manually source the script. Also note that if you have two script files, and one calls a function in the other and vice versa, before the used function is defined, it won't work. @@ -12127,7 +12658,8 @@ text... {endmarker} Set internal variable {var-name} to a |List| containing the lines of text bounded by the string - {endmarker}. + {endmarker}. The lines of text is used as a + |literal-string|. {endmarker} must not contain white space. {endmarker} cannot start with a lower case character. The last line should end only with the {endmarker} @@ -12238,10 +12770,20 @@ text... :const x = 1 < is equivalent to: > :let x = 1 - :lockvar 1 x -< This is useful if you want to make sure the variable - is not modified. - *E995* + :lockvar! x +< NOTE: in Vim9 script `:const` works differently, see + |vim9-const| + This is useful if you want to make sure the variable + is not modified. If the value is a List or Dictionary + literal then the items also cannot be changed: > + const ll = [1, 2, 3] + let ll[1] = 5 " Error! +< Nested references are not locked: > + let lvar = ['a'] + const lconst = [0, lvar] + let lconst[0] = 2 " Error! + let lconst[1][0] = 'b' " OK +< *E995* |:const| does not allow to for changing a variable: > :let x = 1 :const x = 2 " Error! @@ -12271,6 +12813,8 @@ text... [depth] is relevant when locking a |List| or |Dictionary|. It specifies how deep the locking goes: + 0 Lock the variable {name} but not its + value. 1 Lock the |List| or |Dictionary| itself, cannot add or remove items, but can still change their values. @@ -12284,7 +12828,14 @@ text... |Dictionary|, one level deeper. The default [depth] is 2, thus when {name} is a |List| or |Dictionary| the values cannot be changed. - *E743* + + Example with [depth] 0: > + let mylist = [1, 2, 3] + lockvar 0 mylist + let mylist[0] = 77 " OK + call add(mylist, 4] " OK + let mylist = [7, 8, 9] " Error! +< *E743* For unlimited depth use [!] and omit [depth]. However, there is a maximum depth of 100 to catch loops. @@ -12590,7 +13141,12 @@ text... < If you just want a highlighted message use |:echohl|. And to get a beep: > :exe "normal \" -< + +:echoc[onsole] {expr1} .. *:echoc* *:echoconsole* + Intended for testing: works like `:echomsg` but when + running in the GUI and started from a terminal write + the text to stdout. + *:eval* :eval {expr} Evaluate {expr} and discard the result. Example: > :eval Getlist()->Filter()->append('$') @@ -12613,14 +13169,14 @@ text... :exe[cute] {expr1} .. Executes the string that results from the evaluation of {expr1} as an Ex command. Multiple arguments are concatenated, with a space in - between. To avoid the extra space use the "." + between. To avoid the extra space use the ".." operator to concatenate strings into one argument. {expr1} is used as the processed command, command line editing keys are not recognized. Cannot be followed by a comment. Examples: > :execute "buffer" nextbuf - :execute "normal" count . "w" + :execute "normal" count .. "w" < ":execute" can be used to append a command to commands that don't accept a '|'. Example: > @@ -12636,8 +13192,8 @@ text... file names. The |fnameescape()| function can be used for Vim commands, |shellescape()| for |:!| commands. Examples: > - :execute "e " . fnameescape(filename) - :execute "!ls " . shellescape(filename, 1) + :execute "e " .. fnameescape(filename) + :execute "!ls " .. shellescape(filename, 1) < Note: The executed string may be any command-line, but starting or ending "if", "while" and "for" does not diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index e0a7d19803ec52..318507c16be524 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -1,4 +1,4 @@ -*filetype.txt* For Vim version 8.2. Last change: 2019 Jul 16 +*filetype.txt* For Vim version 8.2. Last change: 2021 Mar 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -147,6 +147,7 @@ can be used to overrule the filetype used for certain extensions: *.w g:filetype_w |ft-cweb-syntax| *.i g:filetype_i |ft-progress-syntax| *.p g:filetype_p |ft-pascal-syntax| + *.pp g:filetype_pp |ft-pascal-syntax| *.sh g:bash_is_sh |ft-sh-syntax| *.tex g:tex_flavor |ft-tex-plugin| @@ -163,8 +164,8 @@ file. It will be overwritten when installing a new version of Vim. A. If you want to overrule all default file type checks. This works by writing one file for each filetype. The disadvantage is that - means there can be many files. The advantage is that you can simply drop - this file in the right directory to make it work. + there can be many files. The advantage is that you can simply drop this + file in the right directory to make it work. *ftdetect* 1. Create your user runtime directory. You would normally use the first item of the 'runtimepath' option. Then create the directory "ftdetect" @@ -397,6 +398,13 @@ ways to change this: 3. Docs for the default filetype plugins. *ftplugin-docs* +AWK *ft-awk-plugin* + +Support for features specific to GNU Awk, like @include, can be enabled by +setting: > + let g:awk_is_gawk = 1 + + CHANGELOG *ft-changelog-plugin* Allows for easy entrance of Changelog entries in Changelog files. There are @@ -556,16 +564,15 @@ Local mappings: MAN *ft-man-plugin* *:Man* *man.vim* -Displays a manual page in a nice way. Also see the user manual -|find-manpage|. - -To start using the ":Man" command before any manual page was loaded, source -this script from your startup vimrc file: > +This plugin displays a manual page in a nice way. See |find-manpage| in the +user manual for more information. +To start using the |:Man| command before any manual page has been loaded, +source this script from your startup |vimrc| file: > runtime ftplugin/man.vim Options: -'iskeyword' the '.' character is added to be able to use CTRL-] on the +'iskeyword' The '.' character is added to support the use of CTRL-] on the manual page name. Commands: @@ -575,24 +582,25 @@ Man {number} {name} Global mapping: K Displays the manual page for the word under the cursor. -ManPreGetPage idem, allows for using a mapping: > - nmap ManPreGetPage +ManPreGetPage + idem, allows for using a mapping: > + nmap ManPreGetPage Local mappings: CTRL-] Jump to the manual page for the word under the cursor. CTRL-T Jump back to the previous manual page. -q Same as ":quit" +q Same as the |:quit| command. To use a vertical split instead of horizontal: > let g:ft_man_open_mode = 'vert' To use a new tab: > let g:ft_man_open_mode = 'tab' -To enable folding use this: > - let g:ft_man_folding_enable = 1 -If you do not like the default folding, use an autocommand to add your desired +To enable |folding|, use this: > + let g:ft_man_folding_enable = 1 +If you do not like the default folding, use an |autocommand| to add your desired folding style instead. For example: > - autocmd FileType man setlocal foldmethod=indent foldenable + autocmd FileType man setlocal foldmethod=indent foldenable If you would like :Man {number} {name} to behave like man {number} {name} by not running man {name} if no page is found, then use this: > @@ -605,7 +613,7 @@ page in a Vim window: > MANPAGER *manpager.vim* -The :Man command allows you to turn Vim into a manpager (that syntax highlights +The |:Man| command allows you to turn Vim into a manpager (that syntax highlights manpages and follows linked manpages on hitting CTRL-]). For bash,zsh,ksh or dash, add to the config file (.bashrc,.zshrc, ...) @@ -620,6 +628,13 @@ For fish, add to the config file set -x MANPAGER "vim -M +MANPAGER -" + +MARKDOWN *ft-markdown-plugin* + +To enable folding use this: > + let g:markdown_folding = 1 +< + PDF *ft-pdf-plugin* Two maps, and , are provided to simulate a tag stack for navigating diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt index dbafa283447f00..e8490d50fb2e3e 100644 --- a/runtime/doc/ft_sql.txt +++ b/runtime/doc/ft_sql.txt @@ -312,7 +312,7 @@ can create any of the following: > $VIM/vimfiles/indent/sqlite.vim No changes are necessary to the SQLSetType function. It will automatically -pickup the new SQL files and load them when you issue the SQLSetType command. +pick up the new SQL files and load them when you issue the SQLSetType command. ============================================================================== @@ -519,7 +519,7 @@ beginning with those characters. > 4.3.2 Column Completion: *sql-completion-columns* The SQL completion plugin can also display a list of columns for particular -tables. The column completion is trigger via c. +tables. The column completion is triggered via c. NOTE: The following example uses to trigger a column list while the popup window is active. @@ -727,7 +727,7 @@ your platform (often a case on *nix) you define the following variable in your |vimrc|: > let g:omni_sql_no_default_maps = 1 -Do no edit ftplugin/sql.vim directly! If you change this file your changes +Do not edit ftplugin/sql.vim directly! If you change this file your changes will be over written on future updates. Vim has a special directory structure which allows you to make customizations without changing the files that are included with the Vim distribution. If you wish to customize the maps diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index 3bb7fc94540384..ac8febebee3234 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -1,4 +1,4 @@ -*gui.txt* For Vim version 8.2. Last change: 2020 Mar 16 +*gui.txt* For Vim version 8.2. Last change: 2020 Sep 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -547,15 +547,6 @@ floating menus that do not appear on the main menu bar. 5.2 Creating New Menus *creating-menus* *:me* *:menu* *:noreme* *:noremenu* - *:am* *:amenu* *:an* *:anoremenu* - *:nme* *:nmenu* *:nnoreme* *:nnoremenu* - *:ome* *:omenu* *:onoreme* *:onoremenu* - *:vme* *:vmenu* *:vnoreme* *:vnoremenu* - *:xme* *:xmenu* *:xnoreme* *:xnoremenu* - *:sme* *:smenu* *:snoreme* *:snoremenu* - *:ime* *:imenu* *:inoreme* *:inoremenu* - *:cme* *:cmenu* *:cnoreme* *:cnoremenu* - *:tlm* *:tlmenu* *:tln* *:tlnoremenu* *E330* *E327* *E331* *E336* *E333* *E328* *E329* *E337* *E792* To create a new menu item, use the ":menu" commands. They are mostly like @@ -596,6 +587,7 @@ With the shortcut "F" (while keeping the key pressed), and then "O", this menu can be used. The second part is shown as "Open :e". The ":e" is right aligned, and the "O" is underlined, to indicate it is the shortcut. + *:am* *:amenu* *:an* *:anoremenu* The ":amenu" command can be used to define menu entries for all modes at once, except for Terminal mode. To make the command work correctly, a character is automatically inserted for some modes: @@ -634,6 +626,30 @@ included they make the <> form and raw key codes not being recognized). Note that in Cmdline mode executes the command, like in a mapping. This is Vi compatible. Use CTRL-C to quit Cmdline mode. + *:nme* *:nmenu* *:nnoreme* *:nnoremenu* *:nunme* *:nunmenu* +Menu commands starting with "n" work in Normal mode. |mapmode-n| + + *:ome* *:omenu* *:onoreme* *:onoremenu* *:ounme* *:ounmenu* +Menu commands starting with "o" work in Operator-pending mode. |mapmode-o| + + *:vme* *:vmenu* *:vnoreme* *:vnoremenu* *:vunme* *:vunmenu* +Menu commands starting with "v" work in Visual mode. |mapmode-v| + + *:xme* *:xmenu* *:xnoreme* *:xnoremenu* *:xunme* *:xunmenu* +Menu commands starting with "x" work in Visual and Select mode. |mapmode-x| + + *:sme* *:smenu* *:snoreme* *:snoremenu* *:sunme* *:sunmenu* +Menu commands starting with "s" work in Select mode. |mapmode-s| + + *:ime* *:imenu* *:inoreme* *:inoremenu* *:iunme* *:iunmenu* +Menu commands starting with "i" work in Insert mode. |mapmode-i| + + *:cme* *:cmenu* *:cnoreme* *:cnoremenu* *:cunme* *:cunmenu* +Menu commands starting with "c" work in Cmdline mode. |mapmode-c| + + *:tlm* *:tlmenu* *:tln* *:tlnoremenu* *:tlu* *:tlunmenu* +Menu commands starting with "tl" work in Terminal mode. |mapmode-t| + *:menu-* *:menu-silent* To define a menu which will not be echoed on the command line, add "" as the first argument. Example: > @@ -897,14 +913,6 @@ using the last visual selection. *:unme* *:unmenu* *:aun* *:aunmenu* - *:nunme* *:nunmenu* - *:ounme* *:ounmenu* - *:vunme* *:vunmenu* - *:xunme* *:xunmenu* - *:sunme* *:sunmenu* - *:iunme* *:iunmenu* - *:cunme* *:cunmenu* - *:tlu* *:tlunmenu* To delete a menu item or a whole submenu, use the unmenu commands, which are analogous to the unmap commands. Eg: > :unmenu! Edit.Paste @@ -1096,8 +1104,9 @@ That's all. XLFDs are not used. For Chinese this is reported to work well: > For Mac OSX you can use something like this: > :set guifont=Monaco:h10 -Also see 'macatsui', it can help fix display problems. - *E236* + +Mono-spaced fonts *E236* + Note that the fonts must be mono-spaced (all characters have the same width). An exception is GTK: all fonts are accepted, but mono-spaced fonts look best. diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt index 30e2287826a06e..c0f886773904f9 100644 --- a/runtime/doc/gui_w32.txt +++ b/runtime/doc/gui_w32.txt @@ -451,7 +451,7 @@ with the Intellimouse driver 2.2 and when "Universal Scrolling" is turned on. XPM support *w32-xpm-support* -GVim can be build on MS-Windows with support for XPM files. |+xpm_w32| +GVim can be built on MS-Windows with support for XPM files. |+xpm_w32| See the Make_mvc.mak file for instructions, search for XPM. To try out if XPM support works do this: > diff --git a/runtime/doc/hangulin.txt b/runtime/doc/hangulin.txt index 759cf110971dd1..9357bc8793a6e1 100644 --- a/runtime/doc/hangulin.txt +++ b/runtime/doc/hangulin.txt @@ -8,7 +8,7 @@ Vim had built-in support for hangul, the Korean language, for users without XIM (X Input Method). Since it didn't work well and was not maintained it was removed in Vim 8.1.2327. -If you want this hangul input mehod you can go back to Vim 8.1.2326 or +If you want this hangul input method you can go back to Vim 8.1.2326 or earlier. If you think this code is still useful and want to maintain it, make a patch to add it back. However, making it work with UTF-8 encoding would be best. diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index 7de6fb663d03da..1b3839edc9b32e 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -1,4 +1,4 @@ -*help.txt* For Vim version 8.2. Last change: 2020 Apr 05 +*help.txt* For Vim version 8.2. Last change: 2020 Aug 15 VIM - main help file k @@ -158,7 +158,7 @@ Programming language support ~ Language support ~ |digraph.txt| list of available digraphs -|mbyte.txt| multi-byte text support +|mbyte.txt| multibyte text support |mlang.txt| non-English language support |rileft.txt| right-to-left editing mode |arabic.txt| Arabic language support and editing diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index 7771a505ba7b4c..3a06baf66b3ac1 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -1,4 +1,4 @@ -*helphelp.txt* For Vim version 8.2. Last change: 2020 Mar 01 +*helphelp.txt* For Vim version 8.2. Last change: 2020 Dec 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -92,9 +92,9 @@ Help on help files *helphelp* :help k| only < Note that a space before the '|' is seen as part of the ":help" argument. - You can also use or to separate the help + You can also use or to separate the help command from a following command. You need to type - CTRL-V first to insert the or . Example: > + CTRL-V first to insert the or . Example: > :help soonly :h[elp]! [subject] Like ":help", but in non-English help files prefer to @@ -158,9 +158,31 @@ 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). +When the help buffer is created, several local options are set to make sure +the help text is displayed as it was intended: + 'iskeyword' nearly all ASCII chars except ' ', '*', '"' and '|' + 'foldmethod' "manual" + 'tabstop' 8 + 'arabic' off + 'binary' off + 'buflisted' off + 'cursorbind' off + 'diff' off + 'foldenable' off + 'list' off + 'modifiable' off + 'number' off + 'relativenumber' off + 'rightleft' off + 'scrollbind' off + 'spell' off + Jump to specific subjects by using tags. This can be done in two ways: - Use the "CTRL-]" command while standing on the name of a command or option. This only works when the tag is a keyword. "" and @@ -369,14 +391,16 @@ highlighting. So do these: You can find the details in $VIMRUNTIME/syntax/help.vim *inclusion* -Some people make a big deal about using "his" when referring to the user, -thinking it means we assume the user is male. That is of course not the case, -it's just a habit of writing help text, which quite often is many years old. -Also, a lot of the text is written by contributors for who English is not -their first language. We do not make any assumptions about the gender of the -user, no matter how the text is phrased. And we do not want to waste time on -this discussion. The goal is that the reader understands how Vim works, the -exact wording is secondary. +Vim is for everybody, no matter race, gender or anything. Some people make a +big deal about using "he" or "his" when referring to the user, thinking it +means we assume the user is male. That is not the case, it's just a habit of +writing help text, which quite often is many years old. Also, a lot of the +text is written by contributors for whom English is not their first language. +We do not make any assumptions about the gender of the user, no matter how the +text is phrased. Some people have suggested using "they", but that is not +regular English. We do not want to spend much time on this discussion. The +goal is that the reader understands how Vim works, the exact wording is +secondary. vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt index 65a2d60430a392..b5569969859578 100644 --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -199,8 +199,8 @@ Vim evaluation and command execution, and others. returns it. Note that the buffer is not set as current. - vim.call({name} [,{args}]) - Proxy to call Vim function named {name} with + vim.call({name} [, {args}]) + Proxy to call Vim function named {name} with arguments {args}. Example: > :lua print(vim.call('has', 'timers')) < diff --git a/runtime/doc/if_mzsch.txt b/runtime/doc/if_mzsch.txt index 6420856a67b6f3..f0de21a91b36c3 100644 --- a/runtime/doc/if_mzsch.txt +++ b/runtime/doc/if_mzsch.txt @@ -1,4 +1,4 @@ -*if_mzsch.txt* For Vim version 8.2. Last change: 2019 Dec 07 +*if_mzsch.txt* For Vim version 8.2. Last change: 2020 Oct 14 VIM REFERENCE MANUAL by Sergey Khorev @@ -43,7 +43,7 @@ To speed up the process, you might also want to use --disable-gracket and {script} {endmarker} Execute inlined MzScheme script {script}. - Note: This command doesn't work if the MzScheme + Note: This command doesn't work when the MzScheme feature wasn't compiled in. To avoid errors, see |script-here|. diff --git a/runtime/doc/if_tcl.txt b/runtime/doc/if_tcl.txt index 60ac6bcc5e259b..90dec9dba18361 100644 --- a/runtime/doc/if_tcl.txt +++ b/runtime/doc/if_tcl.txt @@ -275,7 +275,7 @@ Options: $win delcmd {cmd} *tcl-window-delcmd* Registers the Tcl command {cmd} as a deletion callback for the window. This command is executed (in the global scope) just before the window - is closed. Complex commands should be build with "list": > + is closed. Complex commands should be built with "list": > $win delcmd [list puts vimerr "window deleted"] < See also |tcl-buffer-delcmd|. @@ -357,7 +357,7 @@ Options: $buf delcmd {cmd} *tcl-buffer-delcmd* Registers the Tcl command {cmd} as a deletion callback for the buffer. This command is executed (in the global scope) just before the buffer - is deleted. Complex commands should be build with "list": > + is deleted. Complex commands should be built with "list": > $buf delcmd [list puts vimerr "buffer [$buf number] gone"] < See also |tcl-window-delcmd|. diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index c4785c4b227204..6a2dd5106bf4af 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -414,11 +414,11 @@ The examples below assume a 'shiftwidth' of 4. < *cino-(* (N When in unclosed parentheses, indent N characters from the line - with the unclosed parentheses. Add a 'shiftwidth' for every + with the unclosed parenthesis. Add a 'shiftwidth' for every extra unclosed parentheses. When N is 0 or the unclosed - parentheses is the first non-white character in its line, line + parenthesis is the first non-white character in its line, line up with the next non-white character after the unclosed - parentheses. (default 'shiftwidth' * 2). + parenthesis. (default 'shiftwidth' * 2). cino= cino=(0 > if (c1 && (c2 || if (c1 && (c2 || @@ -439,7 +439,7 @@ The examples below assume a 'shiftwidth' of 4. < *cino-U* UN When N is non-zero, do not ignore the indenting specified by - ( or u in case that the unclosed parentheses is the first + ( or u in case that the unclosed parenthesis is the first non-white character in its line. (default 0). cino= or cino=(s cino=(s,U1 > @@ -452,8 +452,8 @@ The examples below assume a 'shiftwidth' of 4. *cino-w* wN When in unclosed parentheses and N is non-zero and either using "(0" or "u0", respectively, or using "U0" and the unclosed - parentheses is the first non-white character in its line, line - up with the character immediately after the unclosed parentheses + parenthesis is the first non-white character in its line, line + up with the character immediately after the unclosed parenthesis rather than the first non-white character. (default 0). cino=(0 cino=(0,w1 > @@ -464,11 +464,11 @@ The examples below assume a 'shiftwidth' of 4. < *cino-W* WN When in unclosed parentheses and N is non-zero and either - using "(0" or "u0", respectively and the unclosed parentheses is + using "(0" or "u0", respectively and the unclosed parenthesis is the last non-white character in its line and it is not the - closing parentheses, indent the following line N characters + closing parenthesis, indent the following line N characters relative to the outer context (i.e. start of the line or the - next unclosed parentheses). (default: 0). + next unclosed parenthesis). (default: 0). cino=(0 cino=(0,W4 > a_long_line( a_long_line( @@ -495,8 +495,8 @@ The examples below assume a 'shiftwidth' of 4. < *cino-m* mN When N is non-zero, line up a line starting with a closing - parentheses with the first character of the line with the - matching opening parentheses. (default 0). + parenthesis with the first character of the line with the + matching opening parenthesis. (default 0). cino=(s cino=(s,m1 > c = c1 && ( c = c1 && ( @@ -510,7 +510,7 @@ The examples below assume a 'shiftwidth' of 4. < *cino-M* MN When N is non-zero, line up a line starting with a closing - parentheses with the first character of the previous line. + parenthesis with the first character of the previous line. (default 0). cino= cino=M1 > @@ -569,7 +569,7 @@ The examples below assume a 'shiftwidth' of 4. recognize preprocessor lines; right-shifting lines that start with "#" does not work. - + *cino-P* PN When N is non-zero recognize C pragmas, and indent them like any other code; does not concern other preprocessor directives. When N is zero (default): don't recognize C pragmas, treating @@ -610,14 +610,14 @@ the use of square and curly brackets, and otherwise by community convention. These conventions are not universally followed, so the Clojure indent script offers a few configurable options, listed below. -If the current vim does not include |searchpairpos()|, the indent script falls +If the current vim does not include searchpairpos(), the indent script falls back to normal 'lisp' indenting, and the following options are ignored. *g:clojure_maxlines* -Set maximum scan distance of |searchpairpos()|. Larger values trade -performance for correctness when dealing with very long forms. A value of 0 -will scan without limits. +Set maximum scan distance of searchpairpos(). Larger values trade performance +for correctness when dealing with very long forms. A value of 0 will scan +without limits. > " Default let g:clojure_maxlines = 100 @@ -996,7 +996,7 @@ Indent after a nested paren: > Indent for a continuation line: > let g:pyindent_continue = 'shiftwidth() * 2' -The method uses |searchpair()| to look back for unclosed parenthesis. This +The method uses |searchpair()| to look back for unclosed parentheses. This can sometimes be slow, thus it timeouts after 150 msec. If you notice the indenting isn't correct, you can set a larger timeout in msec: > let g:pyindent_searchpair_timeout = 500 diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 83c6c176c874c8..ea1b137ee62fc7 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1,4 +1,4 @@ -*index.txt* For Vim version 8.2. Last change: 2020 May 31 +*index.txt* For Vim version 8.2. Last change: 2021 Feb 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -440,6 +440,7 @@ tag char note action in Normal mode ~ || ":ta" to the keyword at the mouse click || 1 same as "w" || same as "CTRL-T" +|| same as "g" || ["x] 2 same as "x" |N| {count} remove the last digit from {count} || 1 same as "j" @@ -587,6 +588,8 @@ tag command action in Normal mode ~ following the file name. |CTRL-W_gt| CTRL-W g t same as `gt`: go to next tab page |CTRL-W_gT| CTRL-W g T same as `gT`: go to previous tab page +|CTRL-W_g| CTRL-W g same as |g|: go to last accessed tab + page. |CTRL-W_h| CTRL-W h go to Nth left window (stop at first window) |CTRL-W_i| CTRL-W i split window and jump to declaration of identifier under the cursor @@ -781,10 +784,10 @@ tag char note action in Normal mode ~ lines down |gk| gk 1 like "k", but when 'wrap' on go N screen lines up -|gn| gn 1,2 find the next match with the last used - search pattern and Visually select it |gm| gm 1 go to character at middle of the screenline |gM| gM 1 go to character at middle of the text line +|gn| gn 1,2 find the next match with the last used + search pattern and Visually select it |go| go 1 cursor to byte N in the buffer |gp| ["x]gp 2 put the text [from register x] after the cursor N times, leave the cursor after it @@ -805,6 +808,7 @@ tag char note action in Normal mode ~ |g| g same as g same as |g| g same as +|g| g go to the last accessed tab page. |g| g 1 same as "gk" ============================================================================== @@ -1172,6 +1176,7 @@ tag command action ~ |:bNext| :bN[ext] go to previous buffer in the buffer list |:ball| :ba[ll] open a window for each buffer in the buffer list |:badd| :bad[d] add buffer to the buffer list +|:balt| :balt like ":badd" but also set the alternate file |:bdelete| :bd[elete] remove a buffer from the buffer list |:behave| :be[have] set mouse and selection behavior |:belowright| :bel[owright] make split window appear right or below @@ -1313,6 +1318,7 @@ tag command action ~ |:filetype| :filet[ype] switch file type detection on/off |:filter| :filt[er] filter output of following command |:find| :fin[d] find file in 'path' and edit it +|:final| :final declare an immutable variable in Vim9 |:finally| :fina[lly] part of a :try command |:finish| :fini[sh] quit sourcing a Vim script |:first| :fir[st] go to the first file in the argument list @@ -1585,6 +1591,8 @@ tag command action ~ |:sign| :sig[n] manipulate signs |:silent| :sil[ent] run a command silently |:sleep| :sl[eep] do nothing for a few seconds +|:sleep!| :sl[eep]! do nothing for a few seconds, without the + cursor visible |:slast| :sla[st] split window and go to last file in the argument list |:smagic| :sm[agic] :substitute with 'magic' @@ -1687,10 +1695,12 @@ tag command action ~ |:unsilent| :uns[ilent] run a command not silently |:update| :up[date] write buffer if modified |:vglobal| :v[global] execute commands for not matching lines +|:var| :var variable declaration in Vim9 |:version| :ve[rsion] print version number and other info |:verbose| :verb[ose] execute command with 'verbose' set |:vertical| :vert[ical] make following command split vertically -|:vim9script| :vim9[script] indicates Vim9 script file +|:vim9cmd| :vim9[cmd] make following command use Vim9 script syntax +|:vim9script| :vim9s[cript] indicates Vim9 script file |:vimgrep| :vim[grep] search for pattern in files |:vimgrepadd| :vimgrepa[dd] like :vimgrep, but append to current list |:visual| :vi[sual] same as ":edit", but turns off "Ex" mode diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index fed81e5db4c9af..d70b3e60122981 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 8.2. Last change: 2020 Apr 30 +*insert.txt* For Vim version 8.2. Last change: 2020 Oct 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -312,6 +312,7 @@ If you enter a value of 10, it will end up in the file as a 0. The 10 is a the buffer to a file, the character is translated into . The character is written at the end of each line. Thus if you want to insert a character in a file you will have to make a line break. +Also see 'fileformat'. *i_CTRL-X* *insert_expand* CTRL-X enters a sub-mode where several commands can be used. Most of these @@ -1843,6 +1844,7 @@ a Append text after the cursor [count] times. If the *A* A Append text at the end of the line [count] times. + For using "A" in Visual block mode see |v_b_A|. or *i* *insert* ** i Insert text before the cursor [count] times. @@ -1855,6 +1857,7 @@ I Insert text before the first non-blank in the line When the 'H' flag is present in 'cpoptions' and the line only contains blanks, insert start just before the last blank. + For using "I" in Visual block mode see |v_b_I|. *gI* gI Insert text in column 1 [count] times. diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index 90681c2b31929b..7d68399cb8be9b 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -1,4 +1,4 @@ -*intro.txt* For Vim version 8.2. Last change: 2020 May 30 +*intro.txt* For Vim version 8.2. Last change: 2020 Dec 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -232,8 +232,8 @@ Vim would never have become what it is now, without the help of these people! Flemming Madsen X11 client-server, various features and patches Tony Mechelynck answers many user questions Paul Moore Python interface extensions, many patches - Katsuhito Nagano Work on multi-byte versions - Sung-Hyun Nam Work on multi-byte versions + Katsuhito Nagano Work on multibyte versions + Sung-Hyun Nam Work on multibyte versions Vince Negri Win32 GUI and generic console enhancements Steve Oualline Author of the first Vim book |frombook| Dominique Pelle Valgrind reports and many fixes @@ -434,7 +434,7 @@ notation meaning equivalent decimal value(s) ~ command sequence intro ALT-Esc 155 ** CSI when typed in the GUI ** - end-of-line (can be , or , + end-of-line (can be , or , depends on system and 'fileformat') ** cursor-up *cursor-up* *cursor_up* @@ -510,7 +510,7 @@ the ":map" command. The rules are: Meta- a ('a' with bit 8 set) Meta- A ('A' with bit 8 set) "kd" termcap entry (cursor down key) - Although you can specify with {char} being a multi-byte + Although you can specify with {char} being a multibyte character, Vim may not be able to know what byte sequence that is and then it won't work. @@ -678,8 +678,8 @@ Normal mode from any other mode. This can be used to make sure Vim is in Normal mode, without causing a beep like would. However, this does not work in Ex mode. When used after a command that takes an argument, such as |f| or |m|, the timeout set with 'ttimeoutlen' applies. -When focus is in a terminal window, CTRL-\ CTRL-N goes to Normal mode for only -one command, see |t_CTRL-\_CTRL-N|. +When focus is in a terminal window, CTRL-\ CTRL-N goes to Normal mode until an +edit command is entered, see |t_CTRL-\_CTRL-N|. *CTRL-\_CTRL-G* *i_CTRL-\_CTRL-G* *c_CTRL-\_CTRL-G* *v_CTRL-\_CTRL-G* The command CTRL-\ CTRL-G or can be used to go to Insert mode when diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index c142f231b5c865..873d5d6d7a006f 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1,4 +1,4 @@ -*map.txt* For Vim version 8.2. Last change: 2020 Apr 23 +*map.txt* For Vim version 8.2. Last change: 2020 Dec 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -191,6 +191,12 @@ whether to use the "," mapping or the longer one. To avoid this add the argument. Then the mapping will be used when it matches, Vim does not wait for more characters to be typed. However, if the characters were already typed they are used. +Note that this works when the mapping fully matches and is found +before any partial matches. This works when: +- There is only one matching buffer-local mapping, since these are always + found before global mappings. +- There is another buffer-local mapping that partly matches, but it is + defined earlier (last defined mapping is found first). *:map-* *:map-silent* To define a mapping which will not be echoed on the command line, add @@ -246,6 +252,31 @@ For abbreviations |v:char| is set to the character that was typed to trigger the abbreviation. You can use this to decide how to expand the {lhs}. You should not either insert or change the v:char. +In case you want the mapping to not do anything, you can have the expression +evaluate to an empty string. If something changed that requires Vim to +go through the main loop (e.g. to update the display), return "\". +This is similar to "nothing" but makes Vim return from the loop that waits for +input. Example: > + func s:OpenPopup() + call popup_create(... arguments ...) + return "\" + endfunc + nnoremap OpenPopup() + +Also, keep in mind that the expression may be evaluated when looking for +typeahead, before the previous command has been executed. For example: > + func StoreColumn() + let g:column = col('.') + return 'x' + endfunc + nnoremap x StoreColumn() + nmap ! f!x +You will notice that g:column has the value from before executing "fx", +because "z" is evaluated before "fx" is executed. +This can be solved by inserting before the character that is +expression-mapped: > + nmap ! f!x + Be very careful about side effects! The expression is evaluated while obtaining characters, you may very well make the command dysfunctional. For this reason the following is blocked: @@ -254,7 +285,7 @@ For this reason the following is blocked: - The |:normal| command. - Moving the cursor is allowed, but it is restored afterwards. If you want the mapping to do any of these let the returned characters do -that. +that, or use a || mapping instead. You can use getchar(), it consumes typeahead if there is any. E.g., if you have these mappings: > @@ -283,15 +314,45 @@ Here is an example that inserts a list number that increases: > CTRL-L inserts the next number, CTRL-R resets the count. CTRL-R returns an empty string, so that nothing is inserted. -Note that there are some tricks to make special keys work and escape CSI bytes -in the text. The |:map| command also does this, thus you must avoid that it -is done twice. This does not work: > - :imap "" -Because the . This does work: > - :imap "\u611B" -Using 0x80 as a single byte before other text does not work, it will be seen -as a special key. +Note that using 0x80 as a single byte before other text does not work, it will +be seen as a special key. + + ** *:map-cmd* +The special text begins a "command mapping", it executes the command +directly without changing modes. Where you might use ":..." in the +{rhs} of a mapping, you can instead use "...". +Example: > + noremap x echo mode(1) +< +This is more flexible than `:` in Visual and Operator-pending mode, or +`:` in Insert mode, because the commands are executed directly in the +current mode, instead of always going to Normal mode. Visual mode is +preserved, so tricks with |gv| are not needed. Commands can be invoked +directly in Command-line mode (which would otherwise require timer hacks). +Example of using halfway Insert mode: > + nnoremap aText echo mode(1) Added + +Unlike mappings, there are no special restrictions on the +command: it is executed as if an (unrestricted) |autocommand| was invoked. + +Note: +- Because avoids mode-changes it does not trigger |CmdlineEnter| and + |CmdlineLeave| events, because no user interaction is expected. +- For the same reason, |keycodes| like are interpreted as plain, + unmapped keys. +- The command is not echo'ed, no need for . +- In Visual mode you can use `line('v')` and `col('v')` to get one end of the + Visual area, the cursor is at the other end. +- In Select mode, |:map| and |:vmap| command mappings are executed in + Visual mode. Use |:smap| to handle Select mode differently. + + *E1135* *E1136* + commands must terminate, that is, they must be followed by in the +{rhs} of the mapping definition. |Command-line| mode is never entered. + + *E1137* + commands can have only normal characters and cannot contain special +characters like function keys. 1.3 MAPPING AND MODES *:map-modes* @@ -595,7 +656,7 @@ construct can be used: character 27 character 127 character 114 ('r') shifted ('R') -This is useful to specify a (multi-byte) character in a 'keymap' file. +This is useful to specify a (multibyte) character in a 'keymap' file. Upper and lowercase differences are ignored. *map-comments* @@ -840,14 +901,20 @@ execute a shell command, e.g.: `!ls` Or put the lines in your |vimrc|. When modifyOtherKeys is enabled you can map and : > imap [[[ - imap {{{ -Without modifyOtherKeys and are indistinguishable from Esc. + imap {{{ +Without modifyOtherKeys and are indistinguishable from Esc. +Note that is used and not or . This works on most +keyboards. Similarly, is used instead of or and + instead of or . Note that '|' has a special meaning in a +mapping, see |map-bar|. -A known side effect effect is that in Insert mode the raw escape sequence is -inserted after the CTRL-V key. This can be used to check whether -modifyOtherKeys is enabled: In Insert mode type CTRL-SHIFT-V CTRL-V, if you -get one byte then modifyOtherKeys is off, if you get <1b>27;5;118~ then it is -on. +WARNING: if you map you may very well break any key codes that start +with Esc. Make sure it comes AFTER other mappings. + +A known side effect is that in Insert mode the raw escape sequence is inserted +after the CTRL-V key. This can be used to check whether modifyOtherKeys is +enabled: In Insert mode type CTRL-SHIFT-V CTRL-V, if you get one byte then +modifyOtherKeys is off, if you get <1b>27;5;118~ then it is on. When the 'esckeys' option is off, then modifyOtherKeys will be disabled in Insert mode to avoid every key with a modifier causing Insert mode to end. @@ -856,7 +923,7 @@ Insert mode to avoid every key with a modifier causing Insert mode to end. 1.12 MAPPING AN OPERATOR *:map-operator* An operator is used before a {motion} command. To define your own operator -you must create mapping that first sets the 'operatorfunc' option and then +you must create a mapping that first sets the 'operatorfunc' option and then invoke the |g@| operator. After the user types the {motion} command the specified function will be called. @@ -876,35 +943,47 @@ g@{motion} Call the function set by the 'operatorfunc' option. Here is an example that counts the number of spaces with : > - nmap :set opfunc=CountSpacesg@ - vmap :call CountSpaces(visualmode(), 1) + nnoremap CountSpaces() + xnoremap CountSpaces() + " doubling works on a line + nnoremap CountSpaces() .. '_' - function! CountSpaces(type, ...) - let sel_save = &selection - let &selection = "inclusive" - let reg_save = @@ + function CountSpaces(type = '') abort + if a:type == '' + set opfunc=CountSpaces + return 'g@' + endif - if a:0 " Invoked from Visual mode, use gv command. - silent exe "normal! gvy" - elseif a:type == 'line' - silent exe "normal! '[V']y" - else - silent exe "normal! `[v`]y" - endif - - echomsg strlen(substitute(@@, '[^ ]', '', 'g')) - - let &selection = sel_save - let @@ = reg_save + let sel_save = &selection + let reg_save = getreginfo('"') + let cb_save = &clipboard + let visual_marks_save = [getpos("'<"), getpos("'>")] + + try + set clipboard= selection=inclusive + let commands = #{line: "'[V']y", char: "`[v`]y", block: "`[\`]y"} + silent exe 'noautocmd keepjumps normal! ' .. get(commands, a:type, '') + echom getreg('"')->count(' ') + finally + call setreg('"', reg_save) + call setpos("'<", visual_marks_save[0]) + call setpos("'>", visual_marks_save[1]) + let &clipboard = cb_save + let &selection = sel_save + endtry endfunction +An mapping is used to be able to fetch any prefixed count and register. +This also avoids using a command line, which would trigger CmdlineEnter and +CmdlineLeave autocommands. + Note that the 'selection' option is temporarily set to "inclusive" to be able to yank exactly the right text by using Visual mode from the '[ to the '] mark. -Also note that there is a separate mapping for Visual mode. It removes the -"'<,'>" range that ":" inserts in Visual mode and invokes the function with -visualmode() and an extra argument. +Also note that the 'clipboard' option is temporarily emptied to avoid +clobbering the `"*` or `"+` registers, if its value contains the item `unnamed` +or `unnamedplus`. ============================================================================== 2. Abbreviations *abbreviations* *Abbreviations* @@ -1168,13 +1247,17 @@ When executing an autocommand or a user command, it will run in the context of the script it was defined in. This makes it possible that the command calls a local function or uses a local mapping. +In case the value is used in a context where cannot be correctly +expanded, use the expand() function: > + let &includexpr = expand('') .. 'My_includeexpr()' + Otherwise, using "" outside of a script context is an error. If you need to get the script number to use in a complicated script, you can use this function: > - function s:SID() - return matchstr(expand(''), '\zs\d\+\ze_SID$') - endfun + func s:ScriptNumber() + return matchstr(expand(''), '\zs\d\+\ze_') + endfunc The "" will be shown when listing functions and mappings. This is useful to find out what they are defined to. @@ -1252,15 +1335,15 @@ last defined. Example: > See |:verbose-cmd| for more information. *E174* *E182* -:com[mand][!] [{attr}...] {cmd} {rep} +:com[mand][!] [{attr}...] {cmd} {repl} Define a user command. The name of the command is - {cmd} and its replacement text is {rep}. The command's - attributes (see below) are {attr}. If the command - already exists, an error is reported, unless a ! is - specified, in which case the command is redefined. - There is one exception: When sourcing a script again, - a command that was previously defined in that script - will be silently replaced. + {cmd} and its replacement text is {repl}. The + command's attributes (see below) are {attr}. If the + command already exists, an error is reported, unless a + ! is specified, in which case the command is + redefined. There is one exception: When sourcing a + script again, a command that was previously defined in + that script will be silently replaced. :delc[ommand] {cmd} *:delc* *:delcommand* *E184* @@ -1470,11 +1553,11 @@ feature. Use the full name for new scripts. Replacement text ~ -The replacement text for a user defined command is scanned for special escape -sequences, using <...> notation. Escape sequences are replaced with values -from the entered command line, and all other text is copied unchanged. The -resulting string is executed as an Ex command. To avoid the replacement use - in place of the initial <. Thus to include "" literally use +The replacement text {repl} for a user defined command is scanned for special +escape sequences, using <...> notation. Escape sequences are replaced with +values from the entered command line, and all other text is copied unchanged. +The resulting string is executed as an Ex command. To avoid the replacement +use in place of the initial <. Thus to include "" literally use "bang>". The valid escape sequences are @@ -1492,7 +1575,7 @@ The valid escape sequences are (See the '-bang' attribute) Expands to a ! if the command was executed with a ! modifier, otherwise expands to nothing. - ** *:command-modifiers* + ** ** *:command-modifiers* The command modifiers, if specified. Otherwise, expands to nothing. Supported modifiers are |:aboveleft|, |:belowright|, |:botright|, |:browse|, |:confirm|, |:hide|, |:keepalt|, @@ -1600,6 +1683,11 @@ errors and the "update" command to write modified buffers): > This will invoke: > :call Allargs("%s/foo/bar/ge|update") < +If the command is defined in Vim9 script (a script that starts with +`:vim9script` and in a `:def` function) then {repl} will be executed as in Vim9 +script. Thus this depends on where the command is defined, not where it is +used. + When defining a user command in a script, it will be able to call functions local to the script and use mappings local to the script. When the user invokes the user command, it will run in the context of the script it was diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index 6a973fdc0d8107..41e42a2aecdd78 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -1,4 +1,4 @@ -*mbyte.txt* For Vim version 8.2. Last change: 2019 Jul 04 +*mbyte.txt* For Vim version 8.2. Last change: 2020 Aug 15 VIM REFERENCE MANUAL by Bram Moolenaar et al. @@ -36,7 +36,7 @@ characters or boxes when using another encoding. This is a summary of the multibyte features in Vim. If you are lucky it works as described and you can start using Vim without much trouble. If something doesn't work you will have to read the rest. Don't be surprised if it takes -quite a bit of work and experimenting to make Vim use all the multi-byte +quite a bit of work and experimenting to make Vim use all the multibyte features. Unfortunately, every system has its own way to deal with multibyte languages and it is quite complicated. @@ -123,12 +123,12 @@ You can also set 'guifont' alone, Vim will try to find a matching INPUT -There are several ways to enter multi-byte characters: +There are several ways to enter multibyte characters: - For X11 XIM can be used. See |XIM|. - For MS-Windows IME can be used. See |IME|. - For all systems keymaps can be used. See |mbyte-keymap|. -The options 'iminsert', 'imsearch' and 'imcmdline' can be used to chose +The options 'iminsert', 'imsearch' and 'imcmdline' can be used to choose the different input methods or disable them temporarily. ============================================================================== @@ -141,8 +141,8 @@ in, or just use a certain locale inside Vim. WHAT IS A LOCALE? *locale* -There are many of languages in the world. And there are different cultures -and environments at least as much as the number of languages. A linguistic +There are many languages in the world. And there are different cultures and +environments at least as many as the number of languages. A linguistic environment corresponding to an area is called "locale". This includes information about the used language, the charset, collating order for sorting, date format, currency format and so on. For Vim only the language and charset @@ -237,11 +237,11 @@ encoded with one byte, we call this a single-byte encoding. The most often used one is called "latin1". This limits the number of characters to 256. Some of these are control characters, thus even fewer can be used for text. -When some characters use two or more bytes, we call this a multi-byte +When some characters use two or more bytes, we call this a multibyte encoding. This allows using much more than 256 characters, which is required for most East Asian languages. -Most multi-byte encodings use one byte for the first 127 characters. These +Most multibyte encodings use one byte for the first 127 characters. These are equal to ASCII, which makes it easy to exchange plain-ASCII text, no matter what language is used. Thus you might see the right text even when the encoding was set wrong. @@ -488,11 +488,11 @@ possible. ============================================================================== 4. Using a terminal *mbyte-terminal* -The GUI fully supports multi-byte characters. It is also possible in a +The GUI fully supports multibyte characters. It is also possible in a terminal, if the terminal supports the same encoding that Vim uses. Thus this is less flexible. -For example, you can run Vim in a xterm with added multi-byte support and/or +For example, you can run Vim in a xterm with added multibyte support and/or |XIM|. Examples are kterm (Kanji term) and hanterm (for Korean), Eterm (Enlightened terminal) and rxvt. @@ -544,7 +544,7 @@ For Vim you may need to set 'encoding' to "utf-8". 5. Fonts on X11 *mbyte-fonts-X11* Unfortunately, using fonts in X11 is complicated. The name of a single-byte -font is a long string. For multi-byte fonts we need several of these... +font is a long string. For multibyte fonts we need several of these... Note: Most of this is no longer relevant for GTK+ 2. Selecting a font via its XLFD is not supported; see 'guifont' for an example of how to @@ -610,7 +610,7 @@ written like: X FONTSET *fontset* *xfontset* -A single-byte charset is typically associated with one font. For multi-byte +A single-byte charset is typically associated with one font. For multibyte charsets a combination of fonts is often used. This means that one group of characters are used from one font and another group from another font (which might be double wide). This collection of fonts is called a fontset. @@ -889,7 +889,7 @@ input_server_name is your |IM-server| name (check your |IM-server| your_input_style is one of |OverTheSpot|, |OffTheSpot|, |Root|. See also |xim-input-style|. -*international may not necessary if you use X11R6. +*international may not be necessary if you use X11R6. *.inputMethod and *.preeditType are optional if you use X11R6. For example, when you are using kinput2 as |IM-server|, > @@ -952,7 +952,7 @@ automatically. This works on not only insert-normal mode, but also search-command input and replace mode. -The options 'iminsert', 'imsearch' and 'imcmdline' can be used to chose +The options 'iminsert', 'imsearch' and 'imcmdline' can be used to choose the different input methods or disable them temporarily. WHAT IS IME @@ -1436,7 +1436,7 @@ not everybody is able to type a composing character. ============================================================================== 12. Overview of options *mbyte-options* -These options are relevant for editing multi-byte files. Check the help in +These options are relevant for editing multibyte files. Check the help in options.txt for detailed information. 'encoding' Encoding used for the keyboard and display. It is also the @@ -1456,14 +1456,14 @@ options.txt for detailed information. languages where a sequence of characters can be broken anywhere. -'guifontset' The list of font names used for a multi-byte encoding. When +'guifontset' The list of font names used for a multibyte encoding. When this option is not empty, it replaces 'guifont'. 'keymap' Specify the name of a keyboard mapping. ============================================================================== -Contributions specifically for the multi-byte features by: +Contributions specifically for the multibyte features by: Chi-Deok Hwang SungHyun Nam K.Nagano diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt index b49c6535dce297..fbf4ce24cec83e 100644 --- a/runtime/doc/message.txt +++ b/runtime/doc/message.txt @@ -1,4 +1,4 @@ -*message.txt* For Vim version 8.2. Last change: 2020 Jan 01 +*message.txt* For Vim version 8.2. Last change: 2020 Dec 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -19,13 +19,14 @@ The ":messages" command can be used to view previously given messages. This is especially useful when messages have been overwritten or truncated. This depends on the 'shortmess' option. - :messages Show all messages. + :mes[sages] Show all messages. - :{count}messages Show the {count} most recent messages. + :{count}mes[sages] Show the {count} most recent messages. - :messages clear Clear all messages. + :mes[sages] clear Clear all messages. - :{count}messages clear Clear messages, keeping only the {count} most + :{count}mes[sages] clear + Clear messages, keeping only the {count} most recent ones. The number of remembered messages is fixed at 20 for the tiny version and 200 @@ -74,7 +75,7 @@ See `:messages` above. LIST OF MESSAGES - *E222* *E228* *E232* *E256* *E293* *E298* *E304* *E317* + *E222* *E228* *E232* *E293* *E298* *E304* *E317* *E318* *E356* *E438* *E439* *E440* *E316* *E320* *E322* *E323* *E341* *E473* *E570* *E685* *E292* > Add to read buffer @@ -793,6 +794,9 @@ and the screen is about to be redrawn: -> Press or to redraw the screen and continue, without that key being used otherwise. -> Press ':' or any other Normal mode command character to start that command. + Note that after an external command some special keys, such as the cursor + keys, may not work normally, because the terminal is still set to a state + for executing the external command. -> Press 'k', , 'u', 'b' or 'g' to scroll back in the messages. This works the same way as at the |more-prompt|. Only works when 'compatible' is off and 'more' is on. diff --git a/runtime/doc/mlang.txt b/runtime/doc/mlang.txt index 2871e5eb812660..a79250ad3e4bed 100644 --- a/runtime/doc/mlang.txt +++ b/runtime/doc/mlang.txt @@ -1,4 +1,4 @@ -*mlang.txt* For Vim version 8.2. Last change: 2020 Jun 16 +*mlang.txt* For Vim version 8.2. Last change: 2020 Aug 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -7,7 +7,7 @@ Multi-language features *multilang* *multi-lang* This is about using messages and menus in various languages. For editing -multi-byte text see |multibyte|. +multibyte text see |multibyte|. The basics are explained in the user manual: |usr_45.txt|. diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index fb98403476401b..d6215a4c6163e3 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1,4 +1,4 @@ -*motion.txt* For Vim version 8.2. Last change: 2019 Nov 16 +*motion.txt* For Vim version 8.2. Last change: 2020 Oct 18 VIM REFERENCE MANUAL by Bram Moolenaar @@ -190,11 +190,14 @@ l or *l* *^* ^ To the first non-blank character of the line. - |exclusive| motion. + |exclusive| motion. Any count is ignored. *$* ** ** $ or To the end of the line. When a count is given also go - [count - 1] lines downward. |inclusive| motion. + [count - 1] lines downward, or as far is possible. + |inclusive| motion. If a count of 2 of larger is + given and the cursor is on the last line, that is an + error an the cursor doesn't move. In Visual mode the cursor goes to just after the last character in the line. When 'virtualedit' is active, "$" may move the cursor @@ -495,10 +498,11 @@ a set of section macros, specified by the pairs of characters in the 'sections' option. The default is "SHNHH HUnhsh", which defines a section to start at the nroff macros ".SH", ".NH", ".H", ".HU", ".nh" and ".sh". -The "]" and "[" commands stop at the '{' or '}' in the first column. This is -useful to find the start or end of a function in a C program. Note that the -first character of the command determines the search direction and the -second character the type of brace found. +The "]]" and "[[" commands stop at the '{' in the first column. This is +useful to find the start of a function in a C program. To search for a '}' in +the first column, the end of a C function, use "][" (forward) or "[]" +(backward). Note that the first character of the command determines the +search direction. If your '{' or '}' are not in the first column, and you would like to use "[[" and "]]" anyway, try these mappings: > @@ -1142,7 +1146,7 @@ sequence of small changes in a line, for example "xxxxx", adds many positions to the change list. When 'textwidth' is zero 'wrapmargin' is used. When that also isn't set a fixed number of 79 is used. Detail: For the computations bytes are used, not characters, to avoid a speed penalty (this only matters -for multi-byte encodings). +for multibyte encodings). Note that when text has been inserted or deleted the cursor position might be a bit different from the position of the change. Especially when lines have diff --git a/runtime/doc/netbeans.txt b/runtime/doc/netbeans.txt index 803d388f4d8b38..cc545f145bb7c2 100644 --- a/runtime/doc/netbeans.txt +++ b/runtime/doc/netbeans.txt @@ -1,4 +1,4 @@ -*netbeans.txt* For Vim version 8.2. Last change: 2020 Apr 19 +*netbeans.txt* For Vim version 8.2. Last change: 2020 Nov 02 VIM REFERENCE MANUAL by Gordon Prieur et al. @@ -362,12 +362,12 @@ color Argument with either a decimal number, "none" (without the offset A number argument that indicates a byte position in a buffer. The first byte has offset zero. Line breaks are counted for how they appear in the file (CR/LF counts for two bytes). - Note that a multi-byte character is counted for the number of + Note that a multibyte character is counted for the number of bytes it takes. lnum/col Argument with a line number and column number position. The line number starts with one, the column is the byte position, - starting with zero. Note that a multi-byte character counts + starting with zero. Note that a multibyte character counts for several columns. pathname String argument: file name with full path. @@ -562,9 +562,10 @@ setModtime time saved directly by the Vim Controller. New in version 2.3. -setReadOnly - Set a file as readonly - Implemented in version 2.3. +setReadOnly readonly + When the boolean argument "readonly" is "T" for True, mark the + buffer as readonly, when it is "F" for False, mark it as not + readonly. Implemented in version 2.3. setStyle Not implemented. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 6a9e2ed0e88aa1..7fcdfbe953a1f1 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 8.2. Last change: 2020 Jul 05 +*options.txt* For Vim version 8.2. Last change: 2021 Feb 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -438,7 +438,7 @@ the system, mostly it is something like 256 or 1024 characters. CTRL-? CTRL-H not CTRL-? CTRL-? - (CTRL-? is 0177 octal, 0x7f hex) + (CTRL-? is 0o177 octal, 0x7f hex) If your delete key terminal code is wrong, but the code for backspace is alright, you can put this in @@ -703,6 +703,9 @@ A jump table for the options with a short description can be found at |Q_op|. The value "double" cannot be used if 'listchars' or 'fillchars' contains a character that would be double width. + The values are overruled for characters specified with + |setcellwidths()|. + There are a number of CJK fonts for which the width of glyphs for those characters are solely based on how many octets they take in legacy/traditional CJK encodings. In those encodings, Euro, @@ -727,8 +730,8 @@ A jump table for the options with a short description can be found at |Q_op|. 'antialias' 'anti' boolean (default: off) global {only available when compiled with GUI enabled - on Mac OS X} - This option only has an effect in the GUI version of Vim on Mac OS X + on macOS} + This option only has an effect in the GUI version of Vim on macOS v10.2 or later. When on, Vim will use smooth ("antialiased") fonts, which can be easier to read at certain sizes on certain displays. Setting this option can sometimes cause problems if 'guifont' is set @@ -1565,7 +1568,11 @@ A jump table for the options with a short description can be found at |Q_op|. {only in GUI versions or when the |+xterm_clipboard| feature is included} This option is a list of comma separated names. - These names are recognized: + Note: if one of the items is "exclude:", then you can't add an item + after that. Therefore do append an item with += but use ^= to + prepend, e.g.: > + set clipboard^=unnamed +< These names are recognized: *clipboard-unnamed* unnamed When included, Vim will use the clipboard register '*' @@ -2551,7 +2558,7 @@ A jump table for the options with a short description can be found at |Q_op|. "x" delete each combining character on its own. When it is off (the default) the character along with its combining characters are deleted. - Note: When 'delcombine' is set "xx" may work different from "2x"! + Note: When 'delcombine' is set "xx" may work differently from "2x"! This is useful for Arabic, Hebrew and many other languages where one may have combining characters overtop of base characters, and want @@ -2674,6 +2681,8 @@ A jump table for the options with a short description can be found at |Q_op|. foldcolumn:{n} Set the 'foldcolumn' option to {n} when starting diff mode. Without this 2 is used. + followwrap Follow the 'wrap' option and leave as it is. + internal Use the internal diff library. This is ignored when 'diffexpr' is set. *E960* When running out of memory when writing a @@ -2715,6 +2724,11 @@ A jump table for the options with a short description can be found at |Q_op|. for Unix: ".,~/tmp,/var/tmp,/tmp") global List of directory names for the swap file, separated with commas. + Recommended value: ".,~/vimswap//" - this will put the swap file next + to the edited file if possible, and in your personal swap directory + otherwise. Make sure "~/vimswap//" is only readable for you. + + Possible items: - The swap file will be created in the first directory where this is possible. - Empty means that no swap file will be used (recovery is @@ -2728,8 +2742,9 @@ A jump table for the options with a short description can be found at |Q_op|. is replaced with the path name of the edited file. - For Unix and Win32, if a directory ends in two path separators "//", the swap file name will be built from the complete path to the file - with all path separators substituted to percent '%' signs. This will - ensure file name uniqueness in the preserve directory. + with all path separators replaced by percent '%' signs (including + the colon following the drive letter on Win32). This will ensure + file name uniqueness in the preserve directory. On Win32, it is also possible to end with "\\". However, When a separating comma is following, you must use "//", since "\\" will include the comma in the file name. Therefore it is recommended to @@ -2749,9 +2764,10 @@ A jump table for the options with a short description can be found at |Q_op|. the same file twice will result in a warning. Using "/tmp" on Unix is discouraged: When the system crashes you lose the swap file. "/var/tmp" is often not cleared when rebooting, thus is a better - choice than "/tmp". But it can contain a lot of files, your swap - files get lost in the crowd. That is why a "tmp" directory in your - home directory is tried first. + choice than "/tmp". But others on the computer may be able to see the + files, and it can contain a lot of files, your swap files get lost in + the crowd. That is why a "tmp" directory in your home directory is + tried first. 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. @@ -2791,12 +2807,16 @@ A jump table for the options with a short description can be found at |Q_op|. toggled each time the flag is given. See |complex-change|. See also 'gdefault' option. Switching this option on may break plugins! + This option is not used in |Vim9| script. *'emoji'* *'emo'* *'noemoji'* *'noemo'* 'emoji' 'emo' boolean (default: on) global When on all Unicode emoji characters are considered to be full width. - + This excludes "text emoji" characters, which are normally displayed as + single width. Unfortunately there is no good specification for this + and it has been determined on trial-and-error basis. Use the + |setcellwidths()| function to change the behavior. *'encoding'* *'enc'* *E543* 'encoding' 'enc' string (default: "latin1" or value from $LANG) @@ -2826,7 +2846,7 @@ A jump table for the options with a short description can be found at |Q_op|. This is specified with 'fileencoding'. The conversion is done with iconv() or as specified with 'charconvert'. - If you need to know whether 'encoding' is a multi-byte encoding, you + If you need to know whether 'encoding' is a multibyte encoding, you can use: > if has("multi_byte_encoding") < @@ -3108,7 +3128,7 @@ A jump table for the options with a short description can be found at |Q_op|. local to buffer This gives the of the current buffer, which is used for reading/writing the buffer from/to a file: - dos + dos unix mac When "dos" is used, CTRL-Z at the end of a file is ignored. @@ -3215,7 +3235,7 @@ A jump table for the options with a short description can be found at |Q_op|. Only normal file name characters can be used, "/\*?[|<>" are illegal. *'fillchars'* *'fcs'* -'fillchars' 'fcs' string (default "vert:|,fold:-") +'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~") global {not available when compiled without the |+folding| feature} @@ -3227,7 +3247,11 @@ A jump table for the options with a short description can be found at |Q_op|. stlnc:c ' ' or '=' statusline of the non-current windows vert:c '|' vertical separators |:vsplit| fold:c '-' filling 'foldtext' + foldopen:c '-' mark the beginning of a fold + foldclose:c '+' show a closed fold + foldsep:c '|' open fold middle character diff:c '-' deleted lines of the 'diff' option + eob:c '~' empty lines below the end of a buffer Any one that is omitted will fall back to the default. For "stl" and "stlnc" the space will be used when there is highlighting, '^' or '=' @@ -3238,7 +3262,8 @@ A jump table for the options with a short description can be found at |Q_op|. < This is similar to the default, except that these characters will also be used when there is highlighting. - for "stl" and "stlnc" only single-byte values are supported. + For "stl" and "stlnc" single-byte and multibyte characters are + supported. But double-width characters are not supported. The highlighting used for these items: item highlight group ~ @@ -3247,6 +3272,7 @@ A jump table for the options with a short description can be found at |Q_op|. vert:c VertSplit |hl-VertSplit| fold:c Folded |hl-Folded| diff:c DiffDelete |hl-DiffDelete| + eob:c EndOfBuffer |hl-EndOfBuffer| *'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'* 'fixendofline' 'fixeol' boolean (default on) @@ -3259,7 +3285,7 @@ A jump table for the options with a short description can be found at |Q_op|. See the 'endofline' option. *'fkmap'* *'fk'* *'nofkmap'* *'nofk'* -'fkmap' 'fk' boolean (default off) *E198* +'fkmap' 'fk' boolean (default off) global {only available when compiled with the |+rightleft| feature} @@ -3557,6 +3583,7 @@ A jump table for the options with a short description can be found at |Q_op|. DEPRECATED: Setting this option may break plugins that are not aware of this option. Also, many users get confused that adding the /g flag has the opposite effect of that it normally does. + This option is not used in |Vim9| script. *'grepformat'* *'gfm'* 'grepformat' 'gfm' string (default "%f:%l:%m,%f:%l%m,%f %l%m") @@ -4540,7 +4567,7 @@ A jump table for the options with a short description can be found at |Q_op|. set and to the Vim default value when 'compatible' is reset. *'isprint'* *'isp'* -'isprint' 'isp' string (default for Win32 and Macintosh: +'isprint' 'isp' string (default for Win32 and macOS: "@,~-255"; otherwise: "@,161-255") global The characters given by this option are displayed directly on the @@ -4669,7 +4696,7 @@ A jump table for the options with a short description can be found at |Q_op|. characters. Example: "abc;ABC" Example: "aA,fgh;FGH,cCdDeE" Special characters need to be preceded with a backslash. These are - ";", ',' and backslash itself. + ";", ',', '"', '|' and backslash itself. This will allow you to activate vim actions without having to switch back and forth between the languages. Your language characters will @@ -4831,7 +4858,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'listchars'* *'lcs'* 'listchars' 'lcs' string (default "eol:$") - global + global or local to window |global-local| Strings to use in 'list' mode and for the |:list| command. It is a comma separated list of string settings. *lcs-eol* @@ -4862,7 +4889,13 @@ A jump table for the options with a short description can be found at |Q_op|. *lcs-space* space:c Character to show for a space. When omitted, spaces are left blank. - *lcs-trail* + *lcs-lead* + lead:c Character to show for leading spaces. When omitted, + leading spaces are blank. Overrides the "space" + setting for leading spaces. You can combine it with + "tab:", for example: > + :set listchars+=tab:>-,lead:. +< *lcs-trail* trail:c Character to show for trailing spaces. When omitted, trailing spaces are blank. Overrides the "space" setting for trailing spaces. @@ -4917,18 +4950,8 @@ A jump table for the options with a short description can be found at |Q_op|. *'macatsui'* *'nomacatsui'* 'macatsui' boolean (default on) global - {only available in Mac GUI version} - This is a workaround for when drawing doesn't work properly. When set - and compiled with multi-byte support ATSUI text drawing is used. When - not set ATSUI text drawing is not used. Switch this option off when - you experience drawing problems. In a future version the problems may - be solved and this option becomes obsolete. Therefore use this method - to unset it: > - if exists('&macatsui') - set nomacatsui - endif -< Another option to check if you have drawing problems is - 'termencoding'. + {not supported} + No longer supported, as the Mac OS X GUI code was removed. *'magic'* *'nomagic'* 'magic' boolean (default on) @@ -4940,6 +4963,8 @@ A jump table for the options with a short description can be found at |Q_op|. Only switch it off when working with old Vi scripts. In any other situation write patterns that work when 'magic' is on. Include "\M" when you want to |/\M|. + In |Vim9| script the value of 'magic' is ignored, patterns behave like + it is always set. *'makeef'* *'mef'* 'makeef' 'mef' string (default: "") @@ -5214,7 +5239,7 @@ A jump table for the options with a short description can be found at |Q_op|. NOTE: This option is set to the Vi default value when 'compatible' is set and to the Vim default value when 'compatible' is reset. - *'mouse'* *E538* + *'mouse'* 'mouse' string (default "", "a" for GUI and Win32, set to "a" or "nvi" in |defaults.vim|) global @@ -6191,7 +6216,7 @@ A jump table for the options with a short description can be found at |Q_op|. screen. If the statusline is given by 'statusline' (i.e. not empty), this option takes precedence over 'ruler' and 'rulerformat' If the number of characters displayed is different from the number of - bytes in the text (e.g., for a TAB or a multi-byte character), both + bytes in the text (e.g., for a TAB or a multibyte character), both the text column (byte number) and the screen column are shown, separated with a dash. For an empty line "0-1" is shown. @@ -6219,7 +6244,7 @@ A jump table for the options with a short description can be found at |Q_op|. < *'runtimepath'* *'rtp'* *vimfiles* 'runtimepath' 'rtp' string (default: - Unix: "$HOME/.vim, + Unix: "$HOME/.vim, $VIM/vimfiles, $VIMRUNTIME, $VIM/vimfiles/after, @@ -6229,20 +6254,20 @@ A jump table for the options with a short description can be found at |Q_op|. $VIMRUNTIME, $VIM/vimfiles/after, home:vimfiles/after" - PC: "$HOME/vimfiles, + MS-Windows: "$HOME/vimfiles, $VIM/vimfiles, $VIMRUNTIME, $VIM/vimfiles/after, $HOME/vimfiles/after" - Macintosh: "$VIM:vimfiles, + macOS: "$VIM:vimfiles, $VIMRUNTIME, $VIM:vimfiles:after" Haiku: "$BE_USER_SETTINGS/vim, $VIM/vimfiles, $VIMRUNTIME, $VIM/vimfiles/after, - $BE_USER_SETTINGS/vim/after") - VMS: "sys$login:vimfiles, + $BE_USER_SETTINGS/vim/after" + VMS: "sys$login:vimfiles, $VIM/vimfiles, $VIMRUNTIME, $VIM/vimfiles/after, @@ -6314,7 +6339,9 @@ A jump table for the options with a short description can be found at |Q_op|. local to window Number of lines to scroll with CTRL-U and CTRL-D commands. Will be set to half the number of lines in the window when the window size - changes. If you give a count to the CTRL-U or CTRL-D command it will + changes. This may happen when enabling the |status-line| or + 'tabline' option after setting the 'scroll' option. + If you give a count to the CTRL-U or CTRL-D command it will be used as the new value for 'scroll'. Reset to half the window height with ":set scroll=0". @@ -6564,7 +6591,7 @@ A jump table for the options with a short description can be found at |Q_op|. For the Amiga the default is ">". For MS-Windows the default is ">%s 2>&1". The output is directly saved in a file and not echoed to the screen. - For Unix the default it "| tee". The stdout of the compiler is saved + For Unix the default is "| tee". The stdout of the compiler is saved in a file and echoed to the screen. If the 'shell' option is "csh" or "tcsh" after initializations, the default becomes "|& tee". If the 'shell' option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta", @@ -7222,7 +7249,7 @@ A jump table for the options with a short description can be found at |Q_op|. normal text. Each status line item is of the form: %-0{minwid}.{maxwid}{item} All fields except the {item} are optional. A single percent sign can - be given as "%%". Up to 80 items can be specified. *E541* + be given as "%%". When the option starts with "%!" then it is used as an expression, evaluated and the result is used as the option value. Example: > @@ -7288,8 +7315,8 @@ A jump table for the options with a short description can be found at |Q_op|. N N Printer page number. (Only works in the 'printheader' option.) l N Line number. L N Number of lines in buffer. - c N Column number. - v N Virtual column number. + c N Column number (byte index). + v N Virtual column number (screen column). V N Virtual column number as -{num}. Not displayed if equal to 'c'. p N Percentage through file in lines as in |CTRL-G|. P S Percentage through file of displayed window. This is like the @@ -7711,7 +7738,6 @@ A jump table for the options with a short description can be found at |Q_op|. on Amiga: "amiga" on Haiku: "xterm" on Mac: "mac-ansi" - on MiNT: "vt52" on Unix: "ansi" on VMS: "ansi" on Win 32: "win32") @@ -7739,14 +7765,12 @@ A jump table for the options with a short description can be found at |Q_op|. For further details see |arabic.txt|. *'termencoding'* *'tenc'* -'termencoding' 'tenc' string (default ""; with GTK+ GUI: "utf-8"; with - Macintosh GUI: "macroman") +'termencoding' 'tenc' string (default ""; with GTK+ GUI: "utf-8") global Encoding used for the terminal. This specifies what character encoding the keyboard produces and the display will understand. For the GUI it only applies to the keyboard ('encoding' is used for the - display). Except for the Mac when 'macatsui' is off, then - 'termencoding' should be "macroman". + display). *E617* *E950* Note: This does not apply to the GTK+ GUI. After the GUI has been successfully initialized, 'termencoding' is forcibly set to "utf-8". @@ -7811,8 +7835,8 @@ A jump table for the options with a short description can be found at |Q_op|. *'termwinsize'* *'tws'* 'termwinsize' 'tws' string (default "") local to window - Size of the |terminal| window. Format: {rows}x{columns} or - {rows}*{columns}. + Size used when opening the |terminal| window. Format: + {rows}x{columns} or {rows}*{columns}. - When empty the terminal gets the size from the window. - When set with a "x" (e.g., "24x80") the terminal size is not adjusted to the window size. If the window is smaller only the @@ -7823,6 +7847,8 @@ A jump table for the options with a short description can be found at |Q_op|. - When rows is zero then use the height of the window. - When columns is zero then use the width of the window. - Using "0x0" or "0*0" is the same as empty. + - Can be overruled in the |term_start()| options with "term_rows" and + "term_cols". Examples: "30x0" uses 30 rows and the current window width. @@ -8369,7 +8395,7 @@ A jump table for the options with a short description can be found at |Q_op|. >= 14 Anything pending in a ":finally" clause. >= 15 Every executed Ex command from a script (truncated at 200 characters). - >= 16 Every executed Ex command + >= 16 Every executed Ex command. This option can also be set with the "-V" argument. See |-V|. This option is also set by the |:verbose| command. @@ -8392,7 +8418,7 @@ A jump table for the options with a short description can be found at |Q_op|. 'viewdir' 'vdir' string (default for Amiga and Win32: "$VIM/vimfiles/view", for Unix: "~/.vim/view", - for Macintosh: "$VIM:vimfiles:view" + for macOS: "$VIM:vimfiles:view" for VMS: "sys$login:vimfiles/view") global {not available when compiled without the |+mksession| @@ -8908,7 +8934,7 @@ A jump table for the options with a short description can be found at |Q_op|. {only available when compiled with the |terminal| feature on MS-Windows} Specifies the name of the winpty shared library, used for the - |:terminal| command. The default depends on whether was build as a + |:terminal| command. The default depends on whether Vim was built as a 32-bit or 64-bit executable. If not found, "winpty.dll" is tried as a fallback. Environment variables are expanded |:set_env|. diff --git a/runtime/doc/os_unix.txt b/runtime/doc/os_unix.txt index 68788424f1182e..fa49db87501fed 100644 --- a/runtime/doc/os_unix.txt +++ b/runtime/doc/os_unix.txt @@ -30,8 +30,8 @@ can be changed at compile time. Because terminal updating under Unix is often slow (e.g. serial line terminal, shell window in suntools), the 'showcmd' and 'ruler' options -are default off. If you have a fast terminal, try setting them on. You might -also want to set 'ttyfast'. +are off by default. If you have a fast terminal, try setting them on. You +might also want to set 'ttyfast'. When using Vim in an xterm the mouse clicks can be used by Vim by setting 'mouse' to "a". If there is access to an X-server gui style copy/paste will diff --git a/runtime/doc/os_vms.txt b/runtime/doc/os_vms.txt index 168232783905af..6eb2993bc76b77 100644 --- a/runtime/doc/os_vms.txt +++ b/runtime/doc/os_vms.txt @@ -1,4 +1,4 @@ -*os_vms.txt* For Vim version 8.2. Last change: 2020 Jun 07 +*os_vms.txt* For Vim version 8.2. Last change: 2021 Jan 04 VIM REFERENCE MANUAL @@ -72,7 +72,7 @@ See the file [.SRC]INSTALLVMS.TXT. 4. Problems *vms-problems* The code has been tested under Open VMS 6.2 - 8.2 on Alpha, VAX and IA64 -platforms with the DEC C compiler. It should work without big problems. +platforms with the DEC C compiler. It should work without major problems. If your system does not have some include libraries you can tune up in OS_VMS_CONF.H file. @@ -88,7 +88,7 @@ VAX C compiler is not fully ANSI C compatible in pre-processor directives semantics, therefore you have to use a converter program that will do the lion part of the job. For detailed instructions read file INSTALLvms.txt -MMS_VIM.EXE is build together with VIM.EXE, but for XXD.EXE you should +MMS_VIM.EXE is built together with VIM.EXE, but for XXD.EXE you should change to a subdirectory and build it separately. CTAGS is not part of the Vim source distribution anymore, however the OpenVMS @@ -765,6 +765,15 @@ GNU_TOOLS.ZIP package downloadable from http://www.polarhome.com/vim/ 9. VMS related changes *vms-changes* +Version 8.2 +- make all changes needed for clean compile build of v8.2 on VMS on all platforms +- fix the call mkdir bug (vicente_polo@yahoo.es) +- test on VSI OpenVMS Alpha and Itanium platforms +- added LUA support +- added XPM support - Motif GUI with toolbar on all platforms +- XPM v3.4.11 libraries for IA64, AXP and VAX are added +- start integrating the new test scripts + Version 8.1 - make necessary changes to build v8.1 on VMS diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index b34389a7f16dcd..a5b9099e3e2008 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 8.2. Last change: 2020 Jul 10 +*pattern.txt* For Vim version 8.2. Last change: 2021 Feb 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -229,7 +229,7 @@ This is like executing two search commands after each other, except that: *last-pattern* The last used pattern and offset are remembered. They can be used to repeat the search, possibly in another direction or with another count. Note that -two patterns are remembered: One for 'normal' search commands and one for the +two patterns are remembered: One for "normal" search commands and one for the substitute command ":s". Each time an empty pattern is given, the previously used pattern is used. However, if there is no previous search command, a previous substitute pattern is used, if possible. @@ -361,8 +361,8 @@ For starters, read chapter 27 of the user manual |usr_27.txt|. */atom* 5. An atom can be one of a long list of items. Many atoms match one character in the text. It is often an ordinary character or a character class. - Braces can be used to make a pattern into an atom. The "\z(\)" construct - is only for syntax highlighting. + Parentheses can be used to make a pattern into an atom. The "\z(\)" + construct is only for syntax highlighting. atom ::= ordinary-atom |/ordinary-atom| or \( pattern \) |/\(| @@ -394,15 +394,19 @@ the pattern will not match. This is only useful when debugging Vim. ============================================================================== 3. Magic */magic* -Some characters in the pattern are taken literally. They match with the same -character in the text. When preceded with a backslash however, these -characters get a special meaning. +Some characters in the pattern, such as letters, are taken literally. They +match exactly the same character in the text. When preceded with a backslash +however, these characters may get a special meaning. For example, "a" matches +the letter "a", while "\a" matches any alphabetic character. Other characters have a special meaning without a backslash. They need to be -preceded with a backslash to match literally. +preceded with a backslash to match literally. For example "." matches any +character while "\." matches a dot. If a character is taken literally or not depends on the 'magic' option and the -items mentioned next. +items in the pattern mentioned next. The 'magic' option should always be set, +but it can be switched off for Vi compatibility. We mention the effect of +'nomagic' here for completeness, but we recommend against using that. */\m* */\M* Use of "\m" makes the pattern after it be interpreted as if 'magic' is set, ignoring the actual value of the 'magic' option. @@ -411,30 +415,28 @@ Use of "\M" makes the pattern after it be interpreted as if 'nomagic' is used. Use of "\v" means that after it, all ASCII characters except '0'-'9', 'a'-'z', 'A'-'Z' and '_' have special meaning: "very magic" -Use of "\V" means that after it, only a backslash and terminating character -(usually / or ?) have special meaning: "very nomagic" +Use of "\V" means that after it, only a backslash and the terminating +character (usually / or ?) have special meaning: "very nomagic" Examples: after: \v \m \M \V matches ~ 'magic' 'nomagic' - $ $ $ \$ matches end-of-line - . . \. \. matches any character + a a a a literal 'a' + \a \a \a \a any alphabetic character + . . \. \. any character + \. \. . . literal dot + $ $ $ \$ end-of-line * * \* \* any number of the previous atom ~ ~ \~ \~ latest substitute string - () \(\) \(\) \(\) grouping into an atom - | \| \| \| separating alternatives - \a \a \a \a alphabetic character + () \(\) \(\) \(\) group as an atom + | \| \| \| nothing: separates alternatives \\ \\ \\ \\ literal backslash - \. \. . . literal dot - \{ { { { literal '{' - a a a a literal 'a' + \{ { { { literal curly brace {only Vim supports \m, \M, \v and \V} -It is recommended to always keep the 'magic' option at the default setting, -which is 'magic'. This avoids portability problems. To make a pattern immune -to the 'magic' option being set or not, put "\m" or "\M" at the start of the -pattern. +If you want to you can make a pattern immune to the 'magic' option being set +or not by putting "\m" or "\M" at the start of the pattern. ============================================================================== 4. Overview of pattern items *pattern-overview* @@ -676,7 +678,7 @@ overview. Note that using "\&" works the same as using "\@=": "foo\&.." is the same as "\(foo\)\@=..". But using "\&" is easier, you don't need the - braces. + parentheses. */\@!* @@ -797,11 +799,12 @@ An ordinary atom can be: ^beep( the start of the C function "beep" (probably). */\^* -\^ Matches literal '^'. Can be used at any position in the pattern. +\^ Matches literal '^'. Can be used at any position in the pattern, but + not inside []. */\_^* \_^ Matches start-of-line. |/zero-width| Can be used at any position in - the pattern. + the pattern, but not inside []. Example matches ~ \_s*\_^foo white space and blank lines and then "foo" at start-of-line @@ -812,12 +815,13 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): |/zero-width| */\$* -\$ Matches literal '$'. Can be used at any position in the pattern. +\$ Matches literal '$'. Can be used at any position in the pattern, but + not inside []. */\_$* \_$ Matches end-of-line. |/zero-width| Can be used at any position in the - pattern. Note that "a\_$b" never matches, since "b" cannot match an - end-of-line. Use "a\nb" instead |/\n|. + pattern, but not inside []. Note that "a\_$b" never matches, since + "b" cannot match an end-of-line. Use "a\nb" instead |/\n|. Example matches ~ foo\_$\_s* "foo" at end-of-line and following white space and blank lines @@ -840,8 +844,9 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): |/zero-width| */\zs* -\zs Matches at any position, and sets the start of the match there: The - next char is the first char of the whole match. |/zero-width| +\zs Matches at any position, but not inside [], and sets the start of the + match there: The next char is the first char of the whole match. + |/zero-width| Example: > /^\s*\zsif < matches an "if" at the start of a line, ignoring white space. @@ -852,8 +857,9 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): This cannot be followed by a multi. *E888* {not available when compiled without the |+syntax| feature} */\ze* -\ze Matches at any position, and sets the end of the match there: The - previous char is the last char of the whole match. |/zero-width| +\ze Matches at any position, but not inside [], and sets the end of the + match there: The previous char is the last char of the whole match. + |/zero-width| Can be used multiple times, the last one encountered in a matching branch is used. Example: "end\ze\(if\|for\)" matches the "end" in "endif" and @@ -939,7 +945,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): These three can be used to match specific columns in a buffer or string. The "23" can be any column number. The first column is 1. Actually, the column is the byte number (thus it's not exactly right - for multi-byte characters). + for multibyte characters). WARNING: When inserting or deleting text Vim does not automatically update the matches. This means Syntax highlighting quickly becomes wrong. @@ -994,7 +1000,7 @@ Character classes: \p printable character (see 'isprint' option) */\p* \P like "\p", but excluding digits */\P* -NOTE: the above also work for multi-byte characters. The ones below only +NOTE: the above also work for multibyte characters. The ones below only match ASCII characters, as indicated by the range. *whitespace* *white-space* @@ -1065,8 +1071,8 @@ x A single character, with no special meaning, matches itself [] (with 'nomagic': \[]) */[]* */\[]* */\_[]* */collection* \_[] - A collection. This is a sequence of characters enclosed in brackets. - It matches any single character in the collection. + A collection. This is a sequence of characters enclosed in square + brackets. It matches any single character in the collection. Example matches ~ [xyz] any 'x', 'y' or 'z' [a-zA-Z]$ any alphabetic character at the end of a line @@ -1125,15 +1131,16 @@ x A single character, with no special meaning, matches itself *[:ident:]* [:ident:] identifier character (same as "\i") *[:keyword:]* [:keyword:] keyword character (same as "\k") *[:fname:]* [:fname:] file name character (same as "\f") - The brackets in character class expressions are additional to the - brackets delimiting a collection. For example, the following is a - plausible pattern for a UNIX filename: "[-./[:alnum:]_~]\+" That is, - a list of at least one character, each of which is either '-', '.', - '/', alphabetic, numeric, '_' or '~'. + The square brackets in character class expressions are additional to + the square brackets delimiting a collection. For example, the + following is a plausible pattern for a UNIX filename: + "[-./[:alnum:]_~]\+". That is, a list of at least one character, + each of which is either '-', '.', '/', alphabetic, numeric, '_' or + '~'. These items only work for 8-bit characters, except [:lower:] and - [:upper:] also work for multi-byte characters when using the new + [:upper:] also work for multibyte characters when using the new regexp engine. See |two-engines|. In the future these items may - work for multi-byte characters. For now, to get all "alpha" + work for multibyte characters. For now, to get all "alpha" characters you can use: [[:lower:][:upper:]]. The "Func" column shows what library function is used. The @@ -1172,7 +1179,7 @@ x A single character, with no special meaning, matches itself \b \n line break, see above |/[\n]| \d123 decimal number of character - \o40 octal number of character up to 0377 + \o40 octal number of character up to 0o377 \x20 hexadecimal number of character up to 0xff \u20AC hex. number of multibyte character up to 0xffff \U1234 hex. number of multibyte character up to 0xffffffff @@ -1210,7 +1217,8 @@ x A single character, with no special meaning, matches itself \%d123 Matches the character specified with a decimal number. Must be followed by a non-digit. \%o40 Matches the character specified with an octal number up to 0377. - Numbers below 040 must be followed by a non-octal digit or a non-digit. + Numbers below 0o40 must be followed by a non-octal digit or a + non-digit. \%x2a Matches the character specified with up to two hexadecimal characters. \%u20AC Matches the character specified with up to four hexadecimal characters. @@ -1257,8 +1265,8 @@ When working with expression evaluation, a character in the pattern matches a in the string. The use of "\n" (backslash n) to match a doesn't work there, it only works to match text in the buffer. - *pattern-multi-byte* -Patterns will also work with multi-byte characters, mostly as you would + *pattern-multi-byte* *pattern-multibyte* +Patterns will also work with multibyte characters, mostly as you would expect. But invalid bytes may cause trouble, a pattern with an invalid byte will probably never match. diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 08efbe315d29b0..b293d9b15f1e5a 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt* For Vim version 8.2. Last change: 2020 Jan 14 +*pi_netrw.txt* For Vim version 8.2. Last change: 2020 Sep 19 ------------------------------------------------ NETRW REFERENCE MANUAL by Charles E. Campbell @@ -437,9 +437,13 @@ settings are described below, in |netrw-browser-options|, and in *g:netrw_silent* =0 : transfers done normally =1 : transfers done silently - *g:netrw_use_errorwindow* =1 : messages from netrw will use a separate one + *g:netrw_use_errorwindow* =2: messages from netrw will use a popup window + Move the mouse and pause to remove the popup window. + (default value if popup windows are availble) + =1 : messages from netrw will use a separate one line window. This window provides reliable - delivery of messages. (default) + delivery of messages. + (default value if popup windows are not availble) =0 : messages from netrw will use echoerr ; messages don't always seem to show up this way, but one doesn't have to quit the window. @@ -725,6 +729,8 @@ just as easily as if they were local files! > See |netrw-activate| for more on how to encourage your vim to use plugins such as netrw. +For password-free use of scp:, see |netrw-ssh-hack|. + ============================================================================== 7. Ex Commands *netrw-ex* {{{1 @@ -1063,7 +1069,7 @@ QUICK HELP *netrw-quickhelp* {{{2 Reverse sorting order.........................|netrw-r| - *netrw-quickmap* *netrw-quickmaps* + *netrw-quickmap* *netrw-quickmaps* QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 > --- ----------------- ---- @@ -1080,7 +1086,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 a Cycles between normal display, |netrw-a| hiding (suppress display of files matching g:netrw_list_hide) and showing (display only files which match g:netrw_list_hide) - c Make browsing directory the current directory |netrw-c| + cd Make browsing directory the current directory |netrw-cd| C Setting the editing window |netrw-C| d Make a directory |netrw-d| D Attempt to remove the file(s)/directory(ies) |netrw-D| @@ -2098,7 +2104,7 @@ the two directories the same, use the "cd" map (type cd). That map will set Vim's notion of the current directory to netrw's current browsing directory. -*netrw-c* : This map's name has been changed from "c" to cd (see |netrw-cd|). +|netrw-cd|: This map's name was changed from "c" to cd (see |netrw-cd|). This change was done to allow for |netrw-cb| and |netrw-cB| maps. Associated setting variable: |g:netrw_keepdir| @@ -2753,7 +2759,7 @@ your browsing preferences. (see also: |netrw-settings|) =0 keep the current directory the same as the browsing directory. The current browsing directory is contained in - b:netrw_curdir (also see |netrw-c|) + b:netrw_curdir (also see |netrw-cd|) *g:netrw_keepj* ="keepj" (default) netrw attempts to keep the |:jumps| table unaffected. @@ -3124,7 +3130,8 @@ a file using the local browser (by putting the cursor on it) and pressing Related topics: * To see what the current directory is, use |:pwd| - * To make the currently browsed directory the current directory, see |netrw-c| + * To make the currently browsed directory the current directory, see + |netrw-cd| * To automatically make the currently browsed directory the current directory, see |g:netrw_keepdir|. @@ -3799,9 +3806,15 @@ netrw: or http://vim.sourceforge.net/scripts/script.php?script_id=120 - Decho.vim is provided as a "vimball"; see |vimball-intro|. + Decho.vim is provided as a "vimball"; see |vimball-intro|. You + should edit the Decho.vba.gz file and source it in: > - 2. Edit the file by typing: > + vim Decho.vba.gz + :so % + :q +< + 2. To turn on debug tracing in netrw, then edit the + file by typing: > vim netrw.vim :DechoOn @@ -3823,14 +3836,34 @@ netrw: read/write your file over the network in a separate tab or server vim window. - To save the file, use > + Change the netrw.vimrc file to include the Decho plugin: > + + set nocp + so $HOME/.vim/plugin/Decho.vim + so $HOME/.vim/plugin/netrwPlugin.vim +< + You should continue to run vim with > + + vim -u netrw.vimrc --noplugins -i NONE [some path here] +< + to avoid entanglements with options and other plugins. + + To save the file: under linux, the output will be in a separate + remote server window; in it, just save the file with > + + :w! DBG + +< Under a vim that doesn't support clientserver, your debugging + output will appear in another tab: > :tabnext :set bt= :w! DBG +< + Furthermore, it'd be helpful if you would type > -< Furthermore, it'd be helpful if you would type > :Dsep + < where is the command you're about to type next, thereby making it easier to associate which part of the debugging trace is due to which command. @@ -3838,17 +3871,34 @@ netrw: Please send that information to 's maintainer along with the o/s you're using and the vim version that you're using (see |:version|) (remove the embedded NOSPAM first) > + NcampObell@SdrPchip.AorgM-NOSPAM < ============================================================================== 12. History *netrw-history* {{{1 + v170: Mar 11, 2020 * (reported by Reiner Herrmann) netrw+tree + would not hide with the ^\..* pattern + correctly. + * (Marcin Szamotulski) NetrwOptionRestore + did not restore options correctly that + had a single quote in the option string. + Apr 13, 2020 * implemented error handling via popup + windows (see |popup_beval()|) + Apr 30, 2020 * (reported by Manatsu Takahashi) while + using Lexplore, a modified file could + be overwritten. Sol'n: will not overwrite, + but will emit an |E37| (although one cannot + add an ! to override) + Jun 07, 2020 * (reported by Jo Totland) repeatedly invoking + :Lexplore and quitting it left unused + hidden buffers. Netrw will now set netrw + buffers created by :Lexplore to |bh|=wipe. v169: Dec 20, 2019 * (reported by amkarthik) that netrw's x (|netrw-x|) would throw an error when attempting to open a local directory. v168: Dec 12, 2019 * scp timeout error message not reported, hopefully now fixed (Shane Xb Qian) - v167: Nov 29, 2019 * netrw does a save&restore on @* and @+. That causes problems with the clipboard. Now restores occurs only if @* or @+ have @@ -4306,4 +4356,4 @@ netrw: ============================================================================== Modelines: {{{1 - vim:tw=78:ts=8:noet:ft=help:norl:fdm=marker +vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker diff --git a/runtime/doc/pi_zip.txt b/runtime/doc/pi_zip.txt index d70df81549e749..2f9fe1eff2a850 100644 --- a/runtime/doc/pi_zip.txt +++ b/runtime/doc/pi_zip.txt @@ -154,4 +154,4 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright* v1 Sep 15, 2005 * Initial release, had browsing, reading, and writing ============================================================================== -vim:tw=78:ts=8:noet:ft=help:fdm=marker +vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt index ff99fce9ab3796..de609209365257 100644 --- a/runtime/doc/popup.txt +++ b/runtime/doc/popup.txt @@ -1,4 +1,4 @@ -*popup.txt* For Vim version 8.2. Last change: 2020 May 18 +*popup.txt* For Vim version 8.2. Last change: 2021 Feb 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -74,9 +74,9 @@ wrapping, lines in the buffer. It can be limited with the "maxheight" property. You can use empty lines to increase the height or the "minheight" property. -The width of the window is normally equal to the longest line in the buffer. -It can be limited with the "maxwidth" property. You can use spaces to -increase the width or use the "minwidth" property. +The width of the window is normally equal to the longest visible line in the +buffer. It can be limited with the "maxwidth" property. You can use spaces +to increase the width or use the "minwidth" property. By default the 'wrap' option is set, so that no text disappears. Otherwise, if there is not enough space then the window is shifted left in order to @@ -101,7 +101,7 @@ CLOSING THE POPUP WINDOW *popup-close* Normally the plugin that created the popup window is also in charge of closing it. If somehow a popup hangs around, you can close all of them with: > - call popup_clear() + call popup_clear(1) Some popups, such as notifications, close after a specified time. This can be set with the "time" property on `popup_create()`. Otherwise, a popup can be closed by clicking on the X in the top-right corner @@ -309,11 +309,12 @@ popup_dialog({what}, {options}) *popup_dialog()* popup_filter_menu({id}, {key}) *popup_filter_menu()* Filter that can be used for a popup. These keys can be used: - j select item below - k select item above + j select item below + k select item above accept current selection x Esc CTRL-C cancel the menu Other keys are ignored. + Always returns |v:true|. A match is set on that line to highlight it, see |popup_menu()|. @@ -587,8 +588,6 @@ properties. It is in one of four forms: If you want to create a new buffer yourself use |bufadd()| and pass the buffer number to popup_create(). -It is not possible to use the buffer of a terminal window. *E278* You CAN -create a hidden terminal buffer and use that one in a popup window. The second argument of |popup_create()| is a dictionary with options: line Screen line where to position the popup. Can use a @@ -621,7 +620,8 @@ The second argument of |popup_create()| is a dictionary with options: property moves. Use an empty string to remove. See |popup-textprop-pos|. textpropwin What window to search for the text property. When - omitted or invalid the current window is used. + omitted or invalid the current window is used. Used + when "textprop" is present. textpropid Used to identify the text property when "textprop" is present. Use zero to reset. fixed When FALSE (the default), and: @@ -693,8 +693,8 @@ The second argument of |popup_create()| is a dictionary with options: the left. border List with numbers, defining the border thickness above/right/below/left of the popup (similar to CSS). - Only values of zero and non-zero are recognized. - An empty list uses a border all around. + Only values of zero and non-zero are currently + recognized. An empty list uses a border all around. borderhighlight List of highlight group names to use for the border. When one entry it is used for all borders, otherwise the highlight for the top/right/bottom/left border. @@ -711,7 +711,7 @@ The second argument of |popup_create()| is a dictionary with options: By default a double line is used all around when 'encoding' is "utf-8" and 'ambiwidth' is "single", otherwise ASCII characters are used. - scrollbar non-zero: show a scrollbar when the text doesn't fit. + scrollbar 1 or true: show a scrollbar when the text doesn't fit. zero: do not show a scrollbar. Default is non-zero. Also see |popup-scrollbar|. scrollbarhighlight Highlight group name for the scrollbar. The @@ -742,10 +742,10 @@ The second argument of |popup_create()| is a dictionary with options: line or to another window. mousemoved Like "moved" but referring to the mouse pointer position - cursorline non-zero: Highlight the cursor line. Also scrolls the - text to show this line (only works properly - when 'wrap' is off). - zero: Do not highlight the cursor line. + cursorline TRUE: Highlight the cursor line. Also scrolls the + text to show this line (only works properly + when 'wrap' is off). + zero: Do not highlight the cursor line. Default is zero, except for |popup_menu()|. filter A callback that can filter typed characters, see |popup-filter|. @@ -910,11 +910,22 @@ A mouse click arrives as . The coordinates can be obtained with Vim provides standard filters |popup_filter_menu()| and |popup_filter_yesno()|. +Keys coming from a `:normal` command do not pass through the filter. This can +be used to move the cursor in a popup where the "cursorline" option is set: > + call win_execute(winid, 'normal! 10Gzz') +Keys coming from `feedkeys()` are passed through the filter. + Note that "x" is the normal way to close a popup. You may want to use Esc, but since many keys start with an Esc character, there may be a delay before Vim recognizes the Esc key. If you do use Esc, it is recommended to set the 'ttimeoutlen' option to 100 and set 'timeout' and/or 'ttimeout'. + *popup-filter-errors* +If the filter function can't be called, e.g. because the name is wrong, then +the popup is closed. If the filter causes an error then it is assumed to +return zero. If this happens three times in a row the popup is closed. If +the popup gives errors fewer than 10% of the calls then it won't be closed. + POPUP CALLBACK *popup-callback* diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt index 3f231d0fed04ff..bbbca1d08cb2d3 100644 --- a/runtime/doc/print.txt +++ b/runtime/doc/print.txt @@ -1,4 +1,4 @@ -*print.txt* For Vim version 8.2. Last change: 2019 Dec 17 +*print.txt* For Vim version 8.2. Last change: 2020 Aug 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -114,7 +114,7 @@ If 'printencoding' is empty or Vim cannot find the file then it will use encoding file. If Vim is unable to find a character encoding file then it will use the "latin1" print character encoding file. -When 'encoding' is set to a multi-byte encoding, Vim will try to convert +When 'encoding' is set to a multibyte encoding, Vim will try to convert characters to the printing encoding for printing (if 'printencoding' is empty then the conversion will be to latin1). Conversion to a printing encoding other than latin1 will require Vim to be compiled with the |+iconv| feature. @@ -269,7 +269,7 @@ Japanese text you would do the following; > :set printmbcharset=JIS_X_1983 If 'printmbcharset' is not one of the above values then it is assumed to -specify a custom multi-byte character set and no check will be made that it is +specify a custom multibyte character set and no check will be made that it is compatible with the value for 'printencoding'. Vim will look for a file defining the character set in the "print" directory in 'runtimepath'. @@ -304,7 +304,7 @@ printing of characters in the ASCII code range. a:yes Use ASCII character set for codes in the ASCII a:no (default) code range. -The following is an example of specifying two multi-byte fonts, one for normal +The following is an example of specifying two multibyte fonts, one for normal and italic printing and one for bold and bold-italic printing, and using Courier to print codes in the ASCII code range but using the national character set: > @@ -420,10 +420,10 @@ There are currently a number of limitations with PostScript printing: possible to get all the characters in an encoding to print by installing a new version of the Courier font family. -- Multi-byte support - Currently Vim will try to convert multi-byte characters +- Multi-byte support - Currently Vim will try to convert multibyte characters to the 8-bit encoding specified by 'printencoding' (or latin1 if it is empty). Any characters that are not successfully converted are shown as - unknown characters. Printing will fail if Vim cannot convert the multi-byte + unknown characters. Printing will fail if Vim cannot convert the multibyte to the 8-bit encoding. ============================================================================== @@ -508,7 +508,7 @@ print ASCII text using the national character set you may see some unexpected characters. If you want true ASCII code printing then you need to configure Vim to output ASCII characters for the ASCII code range with 'printmbfont'. -It is possible to define your own multi-byte character set although this +It is possible to define your own multibyte character set although this should not be attempted lightly. A discussion on the process if beyond the scope of these help files. You can find details on CMap (character map) files in the document 'Adobe CMap and CIDFont Files Specification, Version 1.0', diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 48776487309232..2f34f49bf10984 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 8.2. Last change: 2020 May 31 +*quickfix.txt* For Vim version 8.2. Last change: 2021 Feb 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1025,6 +1025,12 @@ commands can be combined to create a NewGrep command: > 'smartcase' is not used. If {pattern} is empty (e.g. // is specified), the last used search pattern is used. |last-pattern| + + |QuickFixCmdPre| and |QuickFixCmdPost| are triggered. + A file that is opened for matching may use a buffer + number, but it is reused if possible to avoid + consuming buffer numbers. + :{count}vim[grep] ... When a number is put before the command this is used as the maximum number of matches to find. Use @@ -1705,7 +1711,7 @@ special problem here is that it doesn't print information on leaving the directory and that it doesn't print the absolute path. To solve the problem with relative paths and missing "leave directory" -messages Vim uses following algorithm: +messages Vim uses the following algorithm: 1) Check if the given directory is a subdirectory of the current directory. If this is true, store it as the current directory. @@ -1938,7 +1944,7 @@ list window is: The values displayed in each line correspond to the "bufnr", "lnum", "col" and "text" fields returned by the |getqflist()| function. -For some quickfix/location lists, the displayed text need to be customized. +For some quickfix/location lists, the displayed text needs to be customized. For example, if only the filename is present for a quickfix entry, then the two "|" field separator characters after the filename are not needed. Another use case is to customize the path displayed for a filename. By default, the diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 488f14292da457..c0a070d2482a84 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1,4 +1,4 @@ -*quickref.txt* For Vim version 8.2. Last change: 2020 Jun 10 +*quickref.txt* For Vim version 8.2. Last change: 2020 Aug 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -696,7 +696,7 @@ Short explanation of each option: *option-list* 'eventignore' 'ei' autocommand events that are ignored 'expandtab' 'et' use spaces when is inserted 'exrc' 'ex' read .vimrc and .exrc in the current directory -'fileencoding' 'fenc' file encoding for multi-byte text +'fileencoding' 'fenc' file encoding for multibyte text 'fileencodings' 'fencs' automatically detected character encodings 'fileformat' 'ff' file format used for file I/O 'fileformats' 'ffs' automatically detected values for 'fileformat' @@ -728,7 +728,7 @@ Short explanation of each option: *option-list* 'grepprg' 'gp' program to use for ":grep" 'guicursor' 'gcr' GUI: settings for cursor shape and blinking 'guifont' 'gfn' GUI: Name(s) of font(s) to be used -'guifontset' 'gfs' GUI: Names of multi-byte fonts to be used +'guifontset' 'gfs' GUI: Names of multibyte fonts to be used 'guifontwide' 'gfw' list of font names for double-wide characters 'guiheadroom' 'ghr' GUI: pixels room for window decorations 'guioptions' 'go' GUI: Which components and options are used diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt index 34f7f18451b366..c8f3d8f4cececb 100644 --- a/runtime/doc/recover.txt +++ b/runtime/doc/recover.txt @@ -1,4 +1,4 @@ -*recover.txt* For Vim version 8.2. Last change: 2020 May 09 +*recover.txt* For Vim version 8.2. Last change: 2020 Aug 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -64,8 +64,8 @@ Disadvantages: directories (although Vim tries to avoid that by comparing the path name). This will result in bogus ATTENTION warning messages. - When you use your home directory, and somebody else tries to edit the same - file, he will not see your swap file and will not get the ATTENTION warning - message. + file, that user will not see your swap file and will not get the ATTENTION + warning message. On the Amiga you can also use a recoverable ram disk, but there is no 100% guarantee that this works. Putting swap files in a normal ram disk (like RAM: on the Amiga) or in a place that is cleared when rebooting (like /tmp on Unix) diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt index 53c98d0e155309..c6dcb980035249 100644 --- a/runtime/doc/remote.txt +++ b/runtime/doc/remote.txt @@ -179,7 +179,7 @@ name on the 'VimRegistry' property on the root window. A non GUI Vim with access to the X11 display (|xterm-clipboard| enabled), can also act as a command server if a server name is explicitly given with the ---servername argument, or when Vim was build with the |+autoservername| +--servername argument, or when Vim was built with the |+autoservername| feature. An empty --servername argument will cause the command server to be disabled. diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 7b0efddbb8b8d6..71b4e10de4619e 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -1,4 +1,4 @@ -*repeat.txt* For Vim version 8.2. Last change: 2020 May 14 +*repeat.txt* For Vim version 8.2. Last change: 2021 Feb 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -271,6 +271,9 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. directories are added to 'runtimepath'. This is useful in your .vimrc. The plugins will then be loaded during initialization, see |load-plugins|. + Note that for ftdetect scripts to be loaded + you will need to write `filetype plugin indent on` + AFTER all `packadd!` commands. Also see |pack-add|. {only available when compiled with |+eval|} @@ -351,6 +354,16 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. Vim version, or update Vim to a newer version. See |vimscript-version| for what changed between versions. +:vim9s[cript] [noclear] *:vim9s* *:vim9script* + Marks a script file as containing |Vim9-script| + commands. Also see |vim9-namespace|. + Must be the first command in the file. + For [noclear] see |vim9-reload|. + Without the |+eval| feature this changes the syntax + for some commands. + See |:vim9cmd| for executing one command with Vim9 + syntax and semantics. + *:scr* *:scriptnames* :scr[iptnames] List all sourced script names, in the order they were first sourced. The number is used for the script ID @@ -642,8 +655,8 @@ disallowed though. This assumes you write one or more plugins that you distribute as a package. If you have two unrelated plugins you would use two packages, so that Vim -users can chose what they include or not. Or you can decide to use one -package with optional plugins, and tell the user to add the ones he wants with +users can choose what they include or not. Or you can decide to use one +package with optional plugins, and tell the user to add the preferred ones with `:packadd`. Decide how you want to distribute the package. You can create an archive or @@ -664,9 +677,9 @@ Your directory layout would be like this: opt/fooextra/doc/tags " help tags This allows for the user to do: > - mkdir ~/.vim/pack/myfoobar - cd ~/.vim/pack/myfoobar - git clone https://github.com/you/foobar.git + mkdir ~/.vim/pack + cd ~/.vim/pack + git clone https://github.com/you/foobar.git myfoobar Here "myfoobar" is a name that the user can choose, the only condition is that it differs from other packages. @@ -679,7 +692,7 @@ You could add this packadd command in one of your plugins, to be executed when the optional plugin is needed. Run the `:helptags` command to generate the doc/tags file. Including this -generated file in the package means that the user can drop the package in his +generated file in the package means that the user can drop the package in the pack directory and the help command works right away. Don't forget to re-run the command after changing the plugin help: > :helptags path/start/foobar/doc @@ -866,7 +879,7 @@ DEFINING BREAKPOINTS valid in the script where it has been defined and if that script is called from several other scripts, this will stop whenever that particular variable will become visible or - unaccessible again. + inaccessible again. The [lnum] is the line number of the breakpoint. Vim will stop at or after this line. When omitted line 1 is used. @@ -888,8 +901,9 @@ matches ".../plugin/explorer.vim", ".../plugin/iexplorer.vim", etc. > matches ".../plugin/explorer.vim" and "explorer.vim" in any other directory. The match for functions is done against the name as it's shown in the output -of ":function". For local functions this means that something like "99_" -is prepended. +of ":function". However, for local functions the script-specific prefix such +as "99_" is ignored to make it easier to match script-local functions +without knowing the ID of the script. Note that functions are first loaded and later executed. When they are loaded the "file" breakpoints are checked, when they are executed the "func" @@ -944,10 +958,10 @@ OBSCURE Profiling means that Vim measures the time that is spent on executing functions and/or scripts. The |+profile| feature is required for this. -It is only included when Vim was compiled with "huge" features. +It is included when Vim was compiled with "huge" features. You can also use the |reltime()| function to measure time. This only requires -the |+reltime| feature, which is present more often. +the |+reltime| feature, which is present in more builds. For profiling syntax highlighting see |:syntime|. @@ -994,7 +1008,12 @@ For example, to profile the one_script.vim script file: > You must always start with a ":profile start fname" command. The resulting -file is written when Vim exits. Here is an example of the output, with line +file is written when Vim exits. For example, to profile one specific +function: > + profile start /tmp/vimprofile + profile func MyFunc + +Here is an example of the output, with line numbers prepended for the explanation: 1 FUNCTION Test2() ~ diff --git a/runtime/doc/rileft.txt b/runtime/doc/rileft.txt index 7a6c8c8608c895..81ced875cdebbb 100644 --- a/runtime/doc/rileft.txt +++ b/runtime/doc/rileft.txt @@ -69,7 +69,7 @@ o Invocations + 'rightleft' ('rl') sets window orientation to right-to-left. + 'delcombine' ('deco'), boolean, if editing UTF-8 encoded languages, allows one to remove a composing character which gets superimposed - on those that proceeded them (some languages require this). + on those that preceded them (some languages require this). + 'rightleftcmd' ('rlc') sets the command-line within certain modes (such as search) to be utilized in right-to-left orientation as well. diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt index a8ce68541424af..66f8cc61bda9cf 100644 --- a/runtime/doc/sign.txt +++ b/runtime/doc/sign.txt @@ -1,4 +1,4 @@ -*sign.txt* For Vim version 8.2. Last change: 2019 Nov 30 +*sign.txt* For Vim version 8.2. Last change: 2021 Mar 07 VIM REFERENCE MANUAL by Gordon Prieur @@ -78,13 +78,21 @@ used by popup windows where 'cursorline' is set. *sign-priority* Each placed sign is assigned a priority value. When multiple signs are placed on the same line, the attributes of the sign with the highest priority is used -independent of the sign group. The default priority for a sign is 10. The +independently of the sign group. The default priority for a sign is 10. The priority is assigned at the time of placing a sign. +When two signs with the same priority are present, and one has an icon or text +in the signcolumn while the other has line highlighting, then both are +displayed. + When the line on which the sign is placed is deleted, the sign is moved to the next line (or the last line of the buffer, if there is no next line). When the delete is undone the sign does not move back. +When a sign with line highlighting and 'cursorline' highlighting are both +present, if the priority is 100 or more then the sign highlighting takes +precedence, otherwise the 'cursorline' highlighting. + ============================================================================== 2. Commands *sign-commands* *:sig* *:sign* @@ -138,6 +146,9 @@ See |sign_define()| for the equivalent Vim script function. texthl={group} Highlighting group used for the text item. + Example: > + :sign define MySign text=>> texthl=Search linehl=DiffText +< DELETING A SIGN *:sign-undefine* *E155* @@ -147,7 +158,9 @@ See |sign_undefine()| for the equivalent Vim script function. Deletes a previously defined sign. If signs with this {name} are still placed this will cause trouble. - + Example: > + :sign undefine MySign +< LISTING SIGNS *:sign-list* *E156* @@ -201,6 +214,10 @@ See |sign_place()| for the equivalent Vim script function. Same, but use buffer {nr}. If the buffer argument is not given, place the sign in the current buffer. + Example: > + :sign place 10 line=99 name=sign3 + :sign place 10 line=99 name=sign3 buffer=3 +< *E885* :sign place {id} name={name} file={fname} Change the placed sign {id} in file {fname} to use the defined @@ -213,10 +230,17 @@ See |sign_place()| for the equivalent Vim script function. "priority={prio}" attribute can be used to change the priority of an existing sign. + Example: > + :sign place 23 name=sign1 file=/path/to/edit.py +< :sign place {id} name={name} [buffer={nr}] Same, but use buffer {nr}. If the buffer argument is not given, use the current buffer. + Example: > + :sign place 23 name=sign1 + :sign place 23 name=sign1 buffer=7 +< REMOVING SIGNS *:sign-unplace* *E159* @@ -454,11 +478,11 @@ sign_getplaced([{expr} [, {dict}]]) *sign_getplaced()* entries The dictionary for each sign contains the following entries: - group sign group. Set to '' for the global group. - id identifier of the sign - lnum line number where the sign is placed - name name of the defined sign - priority sign priority + group sign group. Set to '' for the global group. + id identifier of the sign + lnum line number where the sign is placed + name name of the defined sign + priority sign priority The returned signs in a buffer are ordered by their line number and priority. diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index 1e33916cea0dd7..1504ea91a46409 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -1,4 +1,4 @@ -*spell.txt* For Vim version 8.2. Last change: 2020 Jul 10 +*spell.txt* For Vim version 8.2. Last change: 2020 Aug 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -887,7 +887,7 @@ time ":mkspell" is used. Vim will then convert everything to 'encoding' and generate a spell file for 'encoding'. If some of the used characters to not fit in 'encoding' you will get an error message. *spell-affix-mbyte* -When using a multi-byte encoding it's possible to use more different affix +When using a multibyte encoding it's possible to use more different affix flags. But Myspell doesn't support that, thus you may not want to use it anyway. For compatibility use an 8-bit encoding. @@ -1445,7 +1445,7 @@ are spelling mistakes this may not be quite right. Common words can be specified with the COMMON item. This will give better suggestions when editing a short file. Example: - COMMON the of to and a in is it you that he was for on are ~ + COMMON the of to and a in is it you that he she was for on are ~ The words must be separated by white space, up to 25 per line. When multiple regions are specified in a ":mkspell" command the common words diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index f437c0e0346727..e492c89a4fc6d2 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1,4 +1,4 @@ -*starting.txt* For Vim version 8.2. Last change: 2020 Feb 04 +*starting.txt* For Vim version 8.2. Last change: 2021 Feb 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -513,6 +513,8 @@ a slash. Thus "-R" means recovery and "-/R" readonly. 'nocompatible': use Vim defaults - no |gvimrc| script is loaded - no viminfo file is read or written + Note that a following "-u" argument overrules the effect of + "-u DEFAULTS". *-x* -x Use encryption to read/write files. Will prompt for a key, @@ -994,7 +996,7 @@ version 5.0) are not recognized. MS-Windows line separators ~ -On MS-Windows, Vim assumes that all the vimrc files have pairs as +On MS-Windows, Vim assumes that all the vimrc files have pairs as line separators. This will give problems if you have a file with only s and have a line like ":map xx yy^M". The trailing ^M will be ignored. @@ -1342,7 +1344,11 @@ resulting file, when executed with a ":source" command: "options". Script-local mappings will not be written. 2. Restores global variables that start with an uppercase letter and contain at least one lowercase letter, if 'sessionoptions' contains "globals". -3. Unloads all currently loaded buffers. +3. Closes all windows in the current tab page, except the current one; closes + all tab pages except the current one (this results in currently loaded + buffers to be unloaded, some may become hidden if 'hidden' is set or + otherwise specified); wipes out the current buffer, if it is empty + and unnamed. 4. Restores the current directory if 'sessionoptions' contains "curdir", or sets the current directory to where the Session file is if 'sessionoptions' contains "sesdir". @@ -1638,13 +1644,17 @@ either have to fix the error, or delete the file (while Vim is running, so most of the information will be restored). *:rv* *:rviminfo* *E195* -:rv[iminfo][!] [file] Read from viminfo file [file] (default: see above). +:rv[iminfo][!] [file] Read from viminfo file [file] (default: see + |viminfo-file-name| above). If [!] is given, then any information that is already set (registers, marks, |v:oldfiles|, etc.) will be overwritten *:wv* *:wviminfo* *E137* *E138* *E574* *E886* *E929* -:wv[iminfo][!] [file] Write to viminfo file [file] (default: see above). +:wv[iminfo][!] [file] Write to viminfo file [file] (default: see + |viminfo-file-name| above). + This command has no effect when 'viminfofile' has been + set to "NONE". The information in the file is first read in to make a merge between old and new info. When [!] is used, the old information is not read first, only the diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 2096a34b518732..bef8601313c2c8 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 8.2. Last change: 2020 Jul 08 +*syntax.txt* For Vim version 8.2. Last change: 2021 Mar 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -66,8 +66,8 @@ This command also sources the |menu.vim| script when the GUI is running or will start soon. See |'go-M'| about avoiding that. *:syn-on* *:syntax-on* -The `:syntax enable` command will keep your current color settings. This -allows using `:highlight` commands to set your preferred colors before or +The `:syntax enable` command will keep most of your current color settings. +This allows using `:highlight` commands to set your preferred colors before or after using this command. If you want Vim to overrule your settings with the defaults, use: > :syntax on @@ -1741,8 +1741,8 @@ The coloring scheme for tags in the HTML file works as follows. The <> of opening tags are colored differently than the of a closing tag. This is on purpose! For opening tags the 'Function' color is used, while for -closing tags the 'Type' color is used (See syntax.vim to check how those are -defined for you) +closing tags the 'Identifier' color is used (See syntax.vim to check how those +are defined for you) Known tag names are colored the same way as statements in C. Unknown tag names are colored with the same color as the <> or respectively which @@ -1937,7 +1937,7 @@ new highlightings for the following groups.: Debug, DebugSpecial, DebugString, DebugBoolean, DebugType which are used for the statement itself, special characters used in debug strings, strings, boolean constants and types (this, super) respectively. I -have opted to chose another background for those statements. +have opted to choose another background for those statements. Javadoc is a program that takes special comments out of Java program files and creates HTML pages. The standard configuration will highlight this HTML code @@ -2335,11 +2335,12 @@ http://papp.plan9.de. PASCAL *pascal.vim* *ft-pascal-syntax* -Files matching "*.p" could be Progress or Pascal. If the automatic detection -doesn't work for you, or you don't edit Progress at all, use this in your -startup vimrc: > +Files matching "*.p" could be Progress or Pascal and those matching "*.pp" +could be Puppet or Pascal. If the automatic detection doesn't work for you, +or you only edit Pascal files, use this in your startup vimrc: > - :let filetype_p = "pascal" + :let filetype_p = "pascal" + :let filetype_pp = "pascal" The Pascal syntax file has been extended to take into account some extensions provided by Turbo Pascal, Free Pascal Compiler and GNU Pascal Compiler. @@ -3006,7 +3007,7 @@ vimrc file: > (Adapted from the html.vim help text by Claudio Fleiner ) - *ft-posix-synax* *ft-dash-syntax* + *ft-posix-syntax* *ft-dash-syntax* SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax* This covers syntax highlighting for the older Unix (Bourne) sh, and newer @@ -3183,6 +3184,7 @@ redrawing can become slow. TEX *tex.vim* *ft-tex-syntax* *latex-syntax* + *syntax-tex* *syntax-latex* Tex Contents~ Tex: Want Syntax Folding? |tex-folding| @@ -3199,6 +3201,7 @@ TEX *tex.vim* *ft-tex-syntax* *latex-syntax* Tex: Selective Conceal Mode |g:tex_conceal| Tex: Controlling iskeyword |g:tex_isk| Tex: Fine Subscript and Superscript Control |tex-supersub| + Tex: Match Check Control |tex-matchcheck| *tex-folding* *g:tex_fold_enabled* Tex: Want Syntax Folding? ~ @@ -3422,6 +3425,22 @@ syntax highlighting script handles this with the following logic: < in ~/.vim/ftplugin/tex/tex.vim in order to avoid having inscrutable utf-8 glyphs appear. + *tex-matchcheck* *g:tex_matchcheck* + Tex: Match Check Control~ + + Sometimes one actually wants mismatched parentheses, square braces, + and or curly braces; for example, \text{(1,10] is a range from but + not including 1 to and including 10}. This wish, of course, conflicts + with the desire to provide delimiter mismatch detection. To + accommodate these conflicting goals, syntax/tex.vim provides > + g:tex_matchcheck = '[({[]' +< which is shown along with its default setting. So, if one doesn't + want [] and () to be checked for mismatches, try using > + let g:tex_matchcheck= '[{}]' +< If you don't want matching to occur inside bold and italicized + regions, > + let g:tex_excludematcher= 1 +< will prevent the texMatcher group from being included in those regions. TF *tf.vim* *ft-tf-syntax* @@ -3648,7 +3667,7 @@ DEFINING FOLDLEVEL *:syn-foldlevel* start: Use level of item containing start of line. minimum: Use lowest local-minimum level of items on line. - The default is 'start'. Use 'minimum' to search a line horizontally + The default is "start". Use "minimum" to search a line horizontally for the lowest level contained on the line that is followed by a higher level. This produces more natural folds when syntax items may close and open horizontally within a line. @@ -3795,9 +3814,9 @@ DEFINING REGIONS *:syn-region* *:syn-start* *:syn-skip* *:syn-end* [keepend] [extend] [excludenl] - start={start_pattern} .. - [skip={skip_pattern}] - end={end_pattern} .. + start={start-pattern} .. + [skip={skip-pattern}] + end={end-pattern} .. [{options}] This defines one region. It may span several lines. @@ -3819,12 +3838,12 @@ DEFINING REGIONS *:syn-region* *:syn-start* *:syn-skip* *:syn-end* extend a containing match or item. Only useful for end patterns. Must be given before the patterns it applies to. |:syn-excludenl| - start={start_pattern} The search pattern that defines the start of + start={start-pattern} The search pattern that defines the start of the region. See |:syn-pattern| below. - skip={skip_pattern} The search pattern that defines text inside + skip={skip-pattern} The search pattern that defines text inside the region where not to look for the end pattern. See |:syn-pattern| below. - end={end_pattern} The search pattern that defines the end of + end={end-pattern} The search pattern that defines the end of the region. See |:syn-pattern| below. Example: > @@ -4348,7 +4367,7 @@ Notes: - A negative offset for an end pattern may not always work, because the end pattern may be detected when the highlighting should already have stopped. - Before Vim 7.2 the offsets were counted in bytes instead of characters. - This didn't work well for multi-byte characters, so it was changed with the + This didn't work well for multibyte characters, so it was changed with the Vim 7.2 release. - The start of a match cannot be in a line other than where the pattern matched. This doesn't work: "a\nb"ms=e. You can make the highlighting @@ -4657,7 +4676,7 @@ matches, nextgroup, etc. But there are a few differences: - A line continuation pattern can be given. It is used to decide which group of lines need to be searched like they were one line. This means that the search for a match with the specified items starts in the first of the - consecutive that contain the continuation pattern. + consecutive lines that contain the continuation pattern. - When using "nextgroup" or "contains", this only works within one line (or group of continued lines). - When using a region, it must start and end in the same line (or group of @@ -4809,6 +4828,7 @@ in their own color. highlighting for groups added by the user! Uses the current value of 'background' to decide which default colors to use. + If there was a default link, restore it. |:hi-link| :hi[ghlight] clear {group-name} :hi[ghlight] {group-name} NONE @@ -5304,6 +5324,12 @@ If you like Question highlighting for C comments, put this in your vimrc file: > Without the "default" in the C syntax file, the highlighting would be overruled when the syntax file is loaded. +To have a link survive `:highlight clear`, which is useful if you have +highlighting for a specific filetype and you want to keep it when selecting +another color scheme, put a command like this in the +"after/syntax/{filetype}.vim" file: > + highlight! default link cComment Question + ============================================================================== 15. Cleaning up *:syn-clear* *E391* diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt index 75070b5fe7c19d..7512d0c29d34cd 100644 --- a/runtime/doc/tabpage.txt +++ b/runtime/doc/tabpage.txt @@ -1,4 +1,4 @@ -*tabpage.txt* For Vim version 8.2. Last change: 2020 Feb 06 +*tabpage.txt* For Vim version 8.2. Last change: 2020 Oct 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -142,6 +142,7 @@ something else. :tabclose + " close the next tab page :tabclose 3 " close the third tab page :tabclose $ " close the last tab page + :tabclose # " close the last accessed tab page < *:tabo* *:tabonly* :tabo[nly][!] Close all other tab pages. @@ -170,6 +171,8 @@ something else. " one :tabonly 1 " close all tab pages except the first one :tabonly $ " close all tab pages except the last one + :tabonly # " close all tab pages except the last + " accessed one SWITCHING TO ANOTHER TAB PAGE: @@ -193,6 +196,7 @@ gt *i_CTRL-* *i_* :1tabnext " go to the first tab page :$tabnext " go to the last tab page :tabnext $ " as above + :tabnext # " go to the last accessed tab page :tabnext - " go to the previous tab page :tabnext -1 " as above :tabnext + " go to the next tab page @@ -221,6 +225,8 @@ gT Go to the previous tab page. Wraps around from the first one *:tabl* *:tablast* :tabl[ast] Go to the last tab page. + *g* *CTRL-W_g* ** +g Go to the last accessed tab page. Other commands: *:tabs* @@ -253,6 +259,8 @@ REORDERING TAB PAGES: :tabmove " move the tab page to the last :$tabmove " as above :tabmove $ " as above + :tabmove # " move the tab page after the last accessed + " tab page :tabm[ove] +[N] :tabm[ove] -[N] diff --git a/runtime/doc/tags b/runtime/doc/tags index 96022b70df6802..27e8d754e19128 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -1045,6 +1045,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* 't_da' term.txt /*'t_da'* 't_db' term.txt /*'t_db'* 't_dl' term.txt /*'t_dl'* +'t_fd' term.txt /*'t_fd'* +'t_fe' term.txt /*'t_fe'* 't_fs' term.txt /*'t_fs'* 't_k1' term.txt /*'t_k1'* 't_k2' term.txt /*'t_k2'* @@ -1290,6 +1292,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* +cmdline_compl various.txt /*+cmdline_compl* +cmdline_hist various.txt /*+cmdline_hist* +cmdline_info various.txt /*+cmdline_info* ++cmdwin various.txt /*+cmdwin* +comments various.txt /*+comments* +conceal various.txt /*+conceal* +cryptv various.txt /*+cryptv* @@ -1783,6 +1786,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* 09.2 usr_09.txt /*09.2* 09.3 usr_09.txt /*09.3* 09.4 usr_09.txt /*09.4* +0o eval.txt /*0o* +0x eval.txt /*0x* 10.1 usr_10.txt /*10.1* 10.2 usr_10.txt /*10.2* 10.3 usr_10.txt /*10.3* @@ -1975,10 +1980,12 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* : cmdline.txt /*:* : cmdline.txt /*:* : cmdline.txt /*:* +: cmdline.txt /*:* : cmdline.txt /*:* : cmdline.txt /*:* : cmdline.txt /*:* : cmdline.txt /*:* +: cmdline.txt /*:* := various.txt /*:=* :> change.txt /*:>* :? cmdline.txt /*:?* @@ -1992,6 +1999,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* :AdaTagFile ft_ada.txt /*:AdaTagFile* :AdaTypes ft_ada.txt /*:AdaTypes* :Arguments terminal.txt /*:Arguments* +:Asm terminal.txt /*:Asm* :Break terminal.txt /*:Break* :Cfilter quickfix.txt /*:Cfilter* :Clear terminal.txt /*:Clear* @@ -2070,6 +2078,11 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* :_#< cmdline.txt /*:_#<* :_#n cmdline.txt /*:_#n* :_% cmdline.txt /*:_%* +:_%% cmdline.txt /*:_%%* +:_%%% cmdline.txt /*:_%%%* +:_%%0 cmdline.txt /*:_%%0* +:_%%< cmdline.txt /*:_%%<* +:_%%n cmdline.txt /*:_%%n* :_%: cmdline.txt /*:_%:* :_%< cmdline.txt /*:_%<* :a insert.txt /*:a* @@ -2123,6 +2136,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* :bad windows.txt /*:bad* :badd windows.txt /*:badd* :ball windows.txt /*:ball* +:balt windows.txt /*:balt* :bar cmdline.txt /*:bar* :bd windows.txt /*:bd* :bdel windows.txt /*:bdel* @@ -2445,6 +2459,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* :filter various.txt /*:filter* :fin editing.txt /*:fin* :fina eval.txt /*:fina* +:final vim9.txt /*:final* :finally eval.txt /*:finally* :find editing.txt /*:find* :fini repeat.txt /*:fini* @@ -2721,6 +2736,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* :map- map.txt /*:map-* :map-alt-keys map.txt /*:map-alt-keys* :map-arguments map.txt /*:map-arguments* +:map-cmd map.txt /*:map-cmd* :map-commands map.txt /*:map-commands* :map-expression map.txt /*:map-expression* :map-local map.txt /*:map-local* @@ -3099,9 +3115,11 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* :sip change.txt /*:sip* :sir change.txt /*:sir* :sl various.txt /*:sl* +:sl! various.txt /*:sl!* :sla windows.txt /*:sla* :slast windows.txt /*:slast* :sleep various.txt /*:sleep* +:sleep! various.txt /*:sleep!* :sm change.txt /*:sm* :smagic change.txt /*:smagic* :smap map.txt /*:smap* @@ -3159,6 +3177,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* :sta windows.txt /*:sta* :stag windows.txt /*:stag* :star repeat.txt /*:star* +:star-visual-range cmdline.txt /*:star-visual-range* :start insert.txt /*:start* :startgreplace insert.txt /*:startgreplace* :startinsert insert.txt /*:startinsert* @@ -3172,6 +3191,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* :stselect tagsrch.txt /*:stselect* :su change.txt /*:su* :substitute change.txt /*:substitute* +:substitute-repeat change.txt /*:substitute-repeat* :sun windows.txt /*:sun* :sunhide windows.txt /*:sunhide* :sunm map.txt /*:sunm* @@ -3368,6 +3388,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* :up editing.txt /*:up* :update editing.txt /*:update* :v repeat.txt /*:v* +:var vim9.txt /*:var* :ve various.txt /*:ve* :ver various.txt /*:ver* :verb various.txt /*:verb* @@ -3383,7 +3404,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* :view editing.txt /*:view* :vim quickfix.txt /*:vim* :vim9 vim9.txt /*:vim9* -:vim9script vim9.txt /*:vim9script* +:vim9cmd vim9.txt /*:vim9cmd* +:vim9s repeat.txt /*:vim9s* +:vim9script repeat.txt /*:vim9script* :vimgrep quickfix.txt /*:vimgrep* :vimgrepa quickfix.txt /*:vimgrepa* :vimgrepadd quickfix.txt /*:vimgrepadd* @@ -3496,10 +3519,12 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* scroll.txt /** scroll.txt /** scroll.txt /** + tabpage.txt /** motion.txt /** intro.txt /** map.txt /** map.txt /** + map.txt /** autocmd.txt /** os_mac.txt /** @@ -3612,6 +3637,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* cmdline.txt /** cmdline.txt /** intro.txt /** + cmdline.txt /** map.txt /** cmdline.txt /** map.txt /** @@ -3641,12 +3667,14 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* map.txt /** autocmd.txt /** map.txt /** + map.txt /** map.txt /** map.txt /** map.txt /** cmdline.txt /** cmdline.txt /** cmdline.txt /** + cmdline.txt /** intro.txt /** term.txt /** term.txt /** @@ -3682,6 +3710,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* >where repeat.txt /*>where* ? pattern.txt /*?* ? pattern.txt /*?* +?? eval.txt /*??* @ repeat.txt /*@* @/ change.txt /*@\/* @: repeat.txt /*@:* @@ -3814,6 +3843,7 @@ CTRL-W_bar windows.txt /*CTRL-W_bar* CTRL-W_c windows.txt /*CTRL-W_c* CTRL-W_d tagsrch.txt /*CTRL-W_d* CTRL-W_f windows.txt /*CTRL-W_f* +CTRL-W_g tabpage.txt /*CTRL-W_g* CTRL-W_gF windows.txt /*CTRL-W_gF* CTRL-W_gT windows.txt /*CTRL-W_gT* CTRL-W_g] windows.txt /*CTRL-W_g]* @@ -3890,6 +3920,8 @@ E10 message.txt /*E10* E100 diff.txt /*E100* E101 diff.txt /*E101* E102 diff.txt /*E102* +E1023 vim9.txt /*E1023* +E1024 vim9.txt /*E1024* E103 diff.txt /*E103* E104 digraph.txt /*E104* E1042 vim9.txt /*E1042* @@ -3898,14 +3930,24 @@ E1050 vim9.txt /*E1050* E107 eval.txt /*E107* E108 eval.txt /*E108* E109 eval.txt /*E109* +E1092 vim9.txt /*E1092* E1094 vim9.txt /*E1094* E11 cmdline.txt /*E11* E110 eval.txt /*E110* +E1109 eval.txt /*E1109* E111 eval.txt /*E111* +E1110 eval.txt /*E1110* +E1111 eval.txt /*E1111* +E1112 eval.txt /*E1112* +E1113 eval.txt /*E1113* E112 eval.txt /*E112* E113 eval.txt /*E113* +E1135 map.txt /*E1135* +E1136 map.txt /*E1136* +E1137 map.txt /*E1137* E114 eval.txt /*E114* E115 eval.txt /*E115* +E1155 autocmd.txt /*E1155* E116 eval.txt /*E116* E117 eval.txt /*E117* E118 eval.txt /*E118* @@ -3995,7 +4037,6 @@ E194 message.txt /*E194* E195 starting.txt /*E195* E196 various.txt /*E196* E197 mlang.txt /*E197* -E198 options.txt /*E198* E199 cmdline.txt /*E199* E20 motion.txt /*E20* E200 autocmd.txt /*E200* @@ -4059,7 +4100,6 @@ E252 options.txt /*E252* E253 mbyte.txt /*E253* E254 message.txt /*E254* E255 sign.txt /*E255* -E256 message.txt /*E256* E257 if_cscop.txt /*E257* E258 remote.txt /*E258* E259 if_cscop.txt /*E259* @@ -4082,7 +4122,6 @@ E274 eval.txt /*E274* E275 textprop.txt /*E275* E276 eval.txt /*E276* E277 remote.txt /*E277* -E278 popup.txt /*E278* E279 terminal.txt /*E279* E28 syntax.txt /*E28* E280 if_tcl.txt /*E280* @@ -4148,7 +4187,6 @@ E337 gui.txt /*E337* E338 editing.txt /*E338* E339 message.txt /*E339* E34 various.txt /*E34* -E340 vi_diff.txt /*E340* E341 message.txt /*E341* E342 message.txt /*E342* E343 options.txt /*E343* @@ -4356,11 +4394,9 @@ E534 options.txt /*E534* E535 options.txt /*E535* E536 options.txt /*E536* E537 options.txt /*E537* -E538 options.txt /*E538* E539 options.txt /*E539* E54 pattern.txt /*E54* E540 options.txt /*E540* -E541 options.txt /*E541* E542 options.txt /*E542* E543 options.txt /*E543* E544 options.txt /*E544* @@ -4432,6 +4468,7 @@ E607 eval.txt /*E607* E608 eval.txt /*E608* E609 if_cscop.txt /*E609* E61 pattern.txt /*E61* +E610 editing.txt /*E610* E612 sign.txt /*E612* E613 print.txt /*E613* E614 editing.txt /*E614* @@ -4913,6 +4950,7 @@ InsertChange autocmd.txt /*InsertChange* InsertCharPre autocmd.txt /*InsertCharPre* InsertEnter autocmd.txt /*InsertEnter* InsertLeave autocmd.txt /*InsertLeave* +InsertLeavePre autocmd.txt /*InsertLeavePre* Integer eval.txt /*Integer* J change.txt /*J* Japanese mbyte.txt /*Japanese* @@ -5126,10 +5164,14 @@ VIMINIT starting.txt /*VIMINIT* VMS os_vms.txt /*VMS* Vi intro.txt /*Vi* View starting.txt /*View* +Vim9 vim9.txt /*Vim9* +Vim9-script vim9.txt /*Vim9-script* VimEnter autocmd.txt /*VimEnter* VimLeave autocmd.txt /*VimLeave* VimLeavePre autocmd.txt /*VimLeavePre* VimResized autocmd.txt /*VimResized* +VimResume autocmd.txt /*VimResume* +VimSuspend autocmd.txt /*VimSuspend* Vimball-copyright pi_vimball.txt /*Vimball-copyright* Virtual-Replace-mode insert.txt /*Virtual-Replace-mode* VisVim if_ole.txt /*VisVim* @@ -5535,6 +5577,10 @@ c_## cmdline.txt /*c_##* c_#< cmdline.txt /*c_#<* c_#n cmdline.txt /*c_#n* c_% cmdline.txt /*c_%* +c_%% cmdline.txt /*c_%%* +c_%%%# cmdline.txt /*c_%%%#* +c_%%< cmdline.txt /*c_%%<* +c_%%n cmdline.txt /*c_%%n* c_ cmdline.txt /*c_* c_ cmdline.txt /*c_* c_ cmdline.txt /*c_* @@ -5717,8 +5763,11 @@ char2nr() eval.txt /*char2nr()* characterwise motion.txt /*characterwise* characterwise-register change.txt /*characterwise-register* characterwise-visual visual.txt /*characterwise-visual* +charclass() eval.txt /*charclass()* +charcol() eval.txt /*charcol()* charconvert_from-variable eval.txt /*charconvert_from-variable* charconvert_to-variable eval.txt /*charconvert_to-variable* +charidx() eval.txt /*charidx()* charity uganda.txt /*charity* charset mbyte.txt /*charset* charset-conversion mbyte.txt /*charset-conversion* @@ -5741,6 +5790,7 @@ cino-J indent.txt /*cino-J* cino-L indent.txt /*cino-L* cino-M indent.txt /*cino-M* cino-N indent.txt /*cino-N* +cino-P indent.txt /*cino-P* cino-U indent.txt /*cino-U* cino-W indent.txt /*cino-W* cino-^ indent.txt /*cino-^* @@ -6228,6 +6278,7 @@ exepath() eval.txt /*exepath()* exim starting.txt /*exim* exists() eval.txt /*exists()* exiting starting.txt /*exiting* +exiting-variable eval.txt /*exiting-variable* exp() eval.txt /*exp()* expand() eval.txt /*expand()* expand-env options.txt /*expand-env* @@ -6305,10 +6356,14 @@ expression-commands eval.txt /*expression-commands* expression-syntax eval.txt /*expression-syntax* exrc starting.txt /*exrc* extend() eval.txt /*extend()* +extendnew() eval.txt /*extendnew()* extension-removal cmdline.txt /*extension-removal* extensions-improvements todo.txt /*extensions-improvements* f motion.txt /*f* +false vim9.txt /*false* false-variable eval.txt /*false-variable* +falsy eval.txt /*falsy* +falsy-operator eval.txt /*falsy-operator* faq intro.txt /*faq* farsi farsi.txt /*farsi* farsi.txt farsi.txt /*farsi.txt* @@ -6366,6 +6421,7 @@ fixed-7.2 version7.txt /*fixed-7.2* fixed-7.3 version7.txt /*fixed-7.3* fixed-7.4 version7.txt /*fixed-7.4* flatten() eval.txt /*flatten()* +flattennew() eval.txt /*flattennew()* flexwiki.vim syntax.txt /*flexwiki.vim* float-e eval.txt /*float-e* float-functions usr_41.txt /*float-functions* @@ -6381,7 +6437,26 @@ fname_new-variable eval.txt /*fname_new-variable* fname_out-variable eval.txt /*fname_out-variable* fnameescape() eval.txt /*fnameescape()* fnamemodify() eval.txt /*fnamemodify()* +fo-1 change.txt /*fo-1* +fo-2 change.txt /*fo-2* +fo-B change.txt /*fo-B* +fo-M change.txt /*fo-M* +fo-] change.txt /*fo-]* +fo-a change.txt /*fo-a* +fo-b change.txt /*fo-b* +fo-c change.txt /*fo-c* +fo-j change.txt /*fo-j* +fo-l change.txt /*fo-l* +fo-m change.txt /*fo-m* +fo-n change.txt /*fo-n* +fo-o change.txt /*fo-o* +fo-p change.txt /*fo-p* +fo-q change.txt /*fo-q* +fo-r change.txt /*fo-r* +fo-t change.txt /*fo-t* fo-table change.txt /*fo-table* +fo-v change.txt /*fo-v* +fo-w change.txt /*fo-w* fold-behavior fold.txt /*fold-behavior* fold-colors fold.txt /*fold-colors* fold-commands fold.txt /*fold-commands* @@ -6442,6 +6517,7 @@ ft-asm68k-syntax syntax.txt /*ft-asm68k-syntax* ft-asmh8300-syntax syntax.txt /*ft-asmh8300-syntax* ft-aspperl-syntax syntax.txt /*ft-aspperl-syntax* ft-aspvbs-syntax syntax.txt /*ft-aspvbs-syntax* +ft-awk-plugin filetype.txt /*ft-awk-plugin* ft-bash-syntax syntax.txt /*ft-bash-syntax* ft-basic-syntax syntax.txt /*ft-basic-syntax* ft-c-omni insert.txt /*ft-c-omni* @@ -6503,6 +6579,7 @@ ft-mail.vim syntax.txt /*ft-mail.vim* ft-make-syntax syntax.txt /*ft-make-syntax* ft-man-plugin filetype.txt /*ft-man-plugin* ft-maple-syntax syntax.txt /*ft-maple-syntax* +ft-markdown-plugin filetype.txt /*ft-markdown-plugin* ft-masm-syntax syntax.txt /*ft-masm-syntax* ft-mathematica-syntax syntax.txt /*ft-mathematica-syntax* ft-matlab-indent indent.txt /*ft-matlab-indent* @@ -6524,7 +6601,7 @@ ft-php-syntax syntax.txt /*ft-php-syntax* ft-php3-syntax syntax.txt /*ft-php3-syntax* ft-phtml-syntax syntax.txt /*ft-phtml-syntax* ft-plaintex-syntax syntax.txt /*ft-plaintex-syntax* -ft-posix-synax syntax.txt /*ft-posix-synax* +ft-posix-syntax syntax.txt /*ft-posix-syntax* ft-postscr-syntax syntax.txt /*ft-postscr-syntax* ft-ppwiz-syntax syntax.txt /*ft-ppwiz-syntax* ft-printcap-syntax syntax.txt /*ft-printcap-syntax* @@ -6593,6 +6670,7 @@ ftplugin-name usr_05.txt /*ftplugin-name* ftplugin-overrule filetype.txt /*ftplugin-overrule* ftplugin-special usr_41.txt /*ftplugin-special* ftplugins usr_05.txt /*ftplugins* +fullcommand() eval.txt /*fullcommand()* funcref() eval.txt /*funcref()* function() eval.txt /*function()* function-argument eval.txt /*function-argument* @@ -6831,6 +6909,7 @@ g:tex_fast syntax.txt /*g:tex_fast* g:tex_flavor filetype.txt /*g:tex_flavor* g:tex_fold_enabled syntax.txt /*g:tex_fold_enabled* g:tex_isk syntax.txt /*g:tex_isk* +g:tex_matchcheck syntax.txt /*g:tex_matchcheck* g:tex_no_error syntax.txt /*g:tex_no_error* g:tex_nospell syntax.txt /*g:tex_nospell* g:tex_stylish syntax.txt /*g:tex_stylish* @@ -6859,6 +6938,7 @@ g motion.txt /*g* g motion.txt /*g* g tagsrch.txt /*g* g tagsrch.txt /*g* +g tabpage.txt /*g* g motion.txt /*g* g? change.txt /*g?* g?? change.txt /*g??* @@ -6903,6 +6983,7 @@ getbufvar() eval.txt /*getbufvar()* getchangelist() eval.txt /*getchangelist()* getchar() eval.txt /*getchar()* getcharmod() eval.txt /*getcharmod()* +getcharpos() eval.txt /*getcharpos()* getcharsearch() eval.txt /*getcharsearch()* getcmdline() eval.txt /*getcmdline()* getcmdpos() eval.txt /*getcmdpos()* @@ -6910,6 +6991,7 @@ getcmdtype() eval.txt /*getcmdtype()* getcmdwintype() eval.txt /*getcmdwintype()* getcompletion() eval.txt /*getcompletion()* getcurpos() eval.txt /*getcurpos()* +getcursorcharpos() eval.txt /*getcursorcharpos()* getcwd() eval.txt /*getcwd()* getenv() eval.txt /*getenv()* getfontname() eval.txt /*getfontname()* @@ -6942,6 +7024,7 @@ gettabinfo() eval.txt /*gettabinfo()* gettabvar() eval.txt /*gettabvar()* gettabwinvar() eval.txt /*gettabwinvar()* gettagstack() eval.txt /*gettagstack()* +gettext() eval.txt /*gettext()* getwininfo() eval.txt /*getwininfo()* getwinpos() eval.txt /*getwinpos()* getwinposx() eval.txt /*getwinposx()* @@ -7109,6 +7192,7 @@ hebrew hebrew.txt /*hebrew* hebrew.txt hebrew.txt /*hebrew.txt* help helphelp.txt /*help* help-context help.txt /*help-context* +help-curwin tips.txt /*help-curwin* help-summary usr_02.txt /*help-summary* help-tags tags 1 help-translated helphelp.txt /*help-translated* @@ -7557,6 +7641,7 @@ lc_time-variable eval.txt /*lc_time-variable* lcs-conceal options.txt /*lcs-conceal* lcs-eol options.txt /*lcs-eol* lcs-extends options.txt /*lcs-extends* +lcs-lead options.txt /*lcs-lead* lcs-nbsp options.txt /*lcs-nbsp* lcs-precedes options.txt /*lcs-precedes* lcs-space options.txt /*lcs-space* @@ -7585,6 +7670,7 @@ linewise-visual visual.txt /*linewise-visual* lisp.vim syntax.txt /*lisp.vim* lispindent() eval.txt /*lispindent()* list eval.txt /*list* +list-concatenation eval.txt /*list-concatenation* list-functions usr_41.txt /*list-functions* list-identity eval.txt /*list-identity* list-index eval.txt /*list-index* @@ -7718,6 +7804,7 @@ mapmode-s map.txt /*mapmode-s* mapmode-t map.txt /*mapmode-t* mapmode-v map.txt /*mapmode-v* mapmode-x map.txt /*mapmode-x* +mapnew() eval.txt /*mapnew()* mapping map.txt /*mapping* mapping-functions usr_41.txt /*mapping-functions* mapset() eval.txt /*mapset()* @@ -7734,6 +7821,8 @@ matchaddpos() eval.txt /*matchaddpos()* matcharg() eval.txt /*matcharg()* matchdelete() eval.txt /*matchdelete()* matchend() eval.txt /*matchend()* +matchfuzzy() eval.txt /*matchfuzzy()* +matchfuzzypos() eval.txt /*matchfuzzypos()* matchit-install usr_05.txt /*matchit-install* matchlist() eval.txt /*matchlist()* matchparen pi_paren.txt /*matchparen* @@ -7912,7 +8001,6 @@ netrw-browser-options pi_netrw.txt /*netrw-browser-options* netrw-browser-settings pi_netrw.txt /*netrw-browser-settings* netrw-browser-var pi_netrw.txt /*netrw-browser-var* netrw-browsing pi_netrw.txt /*netrw-browsing* -netrw-c pi_netrw.txt /*netrw-c* netrw-c-tab pi_netrw.txt /*netrw-c-tab* netrw-cB pi_netrw.txt /*netrw-cB* netrw-cadaver pi_netrw.txt /*netrw-cadaver* @@ -8147,6 +8235,7 @@ new-more-highlighting version7.txt /*new-more-highlighting* new-more-unicode version7.txt /*new-more-unicode* new-multi-byte version5.txt /*new-multi-byte* new-multi-lang version6.txt /*new-multi-lang* +new-multibyte version5.txt /*new-multibyte* new-netrw-explore version7.txt /*new-netrw-explore* new-network-files version6.txt /*new-network-files* new-omni-completion version7.txt /*new-omni-completion* @@ -8160,7 +8249,7 @@ new-persistent-undo version7.txt /*new-persistent-undo* new-plugins version6.txt /*new-plugins* new-popup-window version8.txt /*new-popup-window* new-posix version7.txt /*new-posix* -new-print-multi-byte version7.txt /*new-print-multi-byte* +new-print-multibyte version7.txt /*new-print-multibyte* new-printing version6.txt /*new-printing* new-python3 version7.txt /*new-python3* new-regexp-engine version7.txt /*new-regexp-engine* @@ -8198,6 +8287,7 @@ no_plugin_maps filetype.txt /*no_plugin_maps* nocombine syntax.txt /*nocombine* non-greedy pattern.txt /*non-greedy* non-zero-arg eval.txt /*non-zero-arg* +none-function_argument eval.txt /*none-function_argument* none-variable eval.txt /*none-variable* normal-index index.txt /*normal-index* not-compatible usr_01.txt /*not-compatible* @@ -8206,9 +8296,12 @@ notation intro.txt /*notation* notepad gui_w32.txt /*notepad* nr2char() eval.txt /*nr2char()* nroff.vim syntax.txt /*nroff.vim* +null vim9.txt /*null* null-variable eval.txt /*null-variable* number_relativenumber options.txt /*number_relativenumber* numbered-function eval.txt /*numbered-function* +numbermax-variable eval.txt /*numbermax-variable* +numbermin-variable eval.txt /*numbermin-variable* numbersize-variable eval.txt /*numbersize-variable* o insert.txt /*o* o_CTRL-V motion.txt /*o_CTRL-V* @@ -8295,12 +8388,14 @@ pascal.vim syntax.txt /*pascal.vim* patches-8 version8.txt /*patches-8* patches-8.1 version8.txt /*patches-8.1* patches-8.2 version8.txt /*patches-8.2* +patches-after-8.2 version8.txt /*patches-after-8.2* pathshorten() eval.txt /*pathshorten()* pattern pattern.txt /*pattern* pattern-atoms pattern.txt /*pattern-atoms* pattern-delimiter change.txt /*pattern-delimiter* pattern-multi-byte pattern.txt /*pattern-multi-byte* pattern-multi-items pattern.txt /*pattern-multi-items* +pattern-multibyte pattern.txt /*pattern-multibyte* pattern-overview pattern.txt /*pattern-overview* pattern-searches pattern.txt /*pattern-searches* pattern.txt pattern.txt /*pattern.txt* @@ -8371,6 +8466,7 @@ popup-callback popup.txt /*popup-callback* popup-close popup.txt /*popup-close* popup-examples popup.txt /*popup-examples* popup-filter popup.txt /*popup-filter* +popup-filter-errors popup.txt /*popup-filter-errors* popup-filter-mode popup.txt /*popup-filter-mode* popup-function-details popup.txt /*popup-function-details* popup-functions popup.txt /*popup-functions* @@ -8464,6 +8560,7 @@ progname-variable eval.txt /*progname-variable* progpath-variable eval.txt /*progpath-variable* progress.vim syntax.txt /*progress.vim* prompt-buffer channel.txt /*prompt-buffer* +prompt_getprompt() eval.txt /*prompt_getprompt()* prompt_setcallback() eval.txt /*prompt_setcallback()* prompt_setinterrupt() eval.txt /*prompt_setinterrupt()* prompt_setprompt() eval.txt /*prompt_setprompt()* @@ -8615,6 +8712,7 @@ read-in-close-cb channel.txt /*read-in-close-cb* read-messages insert.txt /*read-messages* read-only-share editing.txt /*read-only-share* read-stdin version5.txt /*read-stdin* +readblob() eval.txt /*readblob()* readdir() eval.txt /*readdir()* readdirex() eval.txt /*readdirex()* readfile() eval.txt /*readfile()* @@ -8812,8 +8910,11 @@ set-option options.txt /*set-option* set-spc-auto spell.txt /*set-spc-auto* setbufline() eval.txt /*setbufline()* setbufvar() eval.txt /*setbufvar()* +setcellwidths() eval.txt /*setcellwidths()* +setcharpos() eval.txt /*setcharpos()* setcharsearch() eval.txt /*setcharsearch()* setcmdpos() eval.txt /*setcmdpos()* +setcursorcharpos() eval.txt /*setcursorcharpos()* setenv() eval.txt /*setenv()* setfperm() eval.txt /*setfperm()* setline() eval.txt /*setline()* @@ -8877,6 +8978,7 @@ sinh() eval.txt /*sinh()* skeleton autocmd.txt /*skeleton* skip_defaults_vim starting.txt /*skip_defaults_vim* slice eval.txt /*slice* +slice() eval.txt /*slice()* slow-fast-terminal term.txt /*slow-fast-terminal* slow-start starting.txt /*slow-start* slow-terminal term.txt /*slow-terminal* @@ -9132,8 +9234,10 @@ synstack() eval.txt /*synstack()* syntax syntax.txt /*syntax* syntax-functions usr_41.txt /*syntax-functions* syntax-highlighting syntax.txt /*syntax-highlighting* +syntax-latex syntax.txt /*syntax-latex* syntax-loading syntax.txt /*syntax-loading* syntax-printing usr_06.txt /*syntax-printing* +syntax-tex syntax.txt /*syntax-tex* syntax.txt syntax.txt /*syntax.txt* syntax_cmd syntax.txt /*syntax_cmd* sys-file-list help.txt /*sys-file-list* @@ -9270,6 +9374,8 @@ t_f6 version4.txt /*t_f6* t_f7 version4.txt /*t_f7* t_f8 version4.txt /*t_f8* t_f9 version4.txt /*t_f9* +t_fd term.txt /*t_fd* +t_fe term.txt /*t_fe* t_float-variable eval.txt /*t_float-variable* t_fs term.txt /*t_fs* t_func-variable eval.txt /*t_func-variable* @@ -9492,6 +9598,7 @@ termdebug-prompt terminal.txt /*termdebug-prompt* termdebug-starting terminal.txt /*termdebug-starting* termdebug-stepping terminal.txt /*termdebug-stepping* termdebug-variables terminal.txt /*termdebug-variables* +termdebug_disasm_window terminal.txt /*termdebug_disasm_window* termdebug_map_K terminal.txt /*termdebug_map_K* termdebug_popup terminal.txt /*termdebug_popup* termdebug_shortcuts terminal.txt /*termdebug_shortcuts* @@ -9568,6 +9675,7 @@ tex-cole syntax.txt /*tex-cole* tex-conceal syntax.txt /*tex-conceal* tex-error syntax.txt /*tex-error* tex-folding syntax.txt /*tex-folding* +tex-matchcheck syntax.txt /*tex-matchcheck* tex-math syntax.txt /*tex-math* tex-morecommands syntax.txt /*tex-morecommands* tex-nospell syntax.txt /*tex-nospell* @@ -9621,9 +9729,12 @@ tooltips gui.txt /*tooltips* toupper() eval.txt /*toupper()* tr() eval.txt /*tr()* trim() eval.txt /*trim()* +trinary eval.txt /*trinary* trojan-horse starting.txt /*trojan-horse* +true vim9.txt /*true* true-variable eval.txt /*true-variable* trunc() eval.txt /*trunc()* +truthy eval.txt /*truthy* try-conditionals eval.txt /*try-conditionals* try-echoerr eval.txt /*try-echoerr* try-finally eval.txt /*try-finally* @@ -9633,10 +9744,13 @@ tutor usr_01.txt /*tutor* twice if_cscop.txt /*twice* two-engines pattern.txt /*two-engines* type() eval.txt /*type()* +type-casting vim9.txt /*type-casting* +type-checking vim9.txt /*type-checking* type-inference vim9.txt /*type-inference* type-mistakes tips.txt /*type-mistakes* typecorr-settings usr_41.txt /*typecorr-settings* typecorr.txt usr_41.txt /*typecorr.txt* +typename() eval.txt /*typename()* u undo.txt /*u* uganda uganda.txt /*uganda* uganda.txt uganda.txt /*uganda.txt* @@ -9740,6 +9854,7 @@ v:errmsg eval.txt /*v:errmsg* v:errors eval.txt /*v:errors* v:event eval.txt /*v:event* v:exception eval.txt /*v:exception* +v:exiting eval.txt /*v:exiting* v:false eval.txt /*v:false* v:fcs_choice eval.txt /*v:fcs_choice* v:fcs_reason eval.txt /*v:fcs_reason* @@ -9763,6 +9878,8 @@ v:mouse_win eval.txt /*v:mouse_win* v:mouse_winid eval.txt /*v:mouse_winid* v:none eval.txt /*v:none* v:null eval.txt /*v:null* +v:numbermax eval.txt /*v:numbermax* +v:numbermin eval.txt /*v:numbermin* v:numbersize eval.txt /*v:numbersize* v:oldfiles eval.txt /*v:oldfiles* v:operator eval.txt /*v:operator* @@ -9929,6 +10046,7 @@ valgrind debug.txt /*valgrind* values() eval.txt /*values()* var-functions usr_41.txt /*var-functions* variable-scope eval.txt /*variable-scope* +variable-types vim9.txt /*variable-types* variables eval.txt /*variables* various various.txt /*various* various-cmds various.txt /*various-cmds* @@ -10002,17 +10120,24 @@ vim.vim syntax.txt /*vim.vim* vim7 version7.txt /*vim7* vim8 version8.txt /*vim8* vim9 vim9.txt /*vim9* +vim9-classes vim9.txt /*vim9-classes* +vim9-const vim9.txt /*vim9-const* +vim9-curly vim9.txt /*vim9-curly* vim9-declaration vim9.txt /*vim9-declaration* vim9-declarations usr_46.txt /*vim9-declarations* vim9-differences vim9.txt /*vim9-differences* vim9-export vim9.txt /*vim9-export* +vim9-final vim9.txt /*vim9-final* vim9-gotchas vim9.txt /*vim9-gotchas* vim9-import vim9.txt /*vim9-import* +vim9-mix vim9.txt /*vim9-mix* +vim9-namespace vim9.txt /*vim9-namespace* vim9-rationale vim9.txt /*vim9-rationale* +vim9-reload vim9.txt /*vim9-reload* vim9-scopes vim9.txt /*vim9-scopes* -vim9-script vim9.txt /*vim9-script* vim9-script-intro usr_46.txt /*vim9-script-intro* vim9-types vim9.txt /*vim9-types* +vim9-user-command vim9.txt /*vim9-user-command* vim9.txt vim9.txt /*vim9.txt* vim9script vim9.txt /*vim9script* vim: options.txt /*vim:* @@ -10230,6 +10355,7 @@ xterm-command-server term.txt /*xterm-command-server* xterm-copy-paste term.txt /*xterm-copy-paste* xterm-cursor-keys term.txt /*xterm-cursor-keys* xterm-end-home-keys term.txt /*xterm-end-home-keys* +xterm-focus-event term.txt /*xterm-focus-event* xterm-function-keys term.txt /*xterm-function-keys* xterm-modifier-keys term.txt /*xterm-modifier-keys* xterm-mouse options.txt /*xterm-mouse* diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt index bab1a1c5d77063..69c629c00b2ed1 100644 --- a/runtime/doc/tagsrch.txt +++ b/runtime/doc/tagsrch.txt @@ -1,4 +1,4 @@ -*tagsrch.txt* For Vim version 8.2. Last change: 2020 Apr 19 +*tagsrch.txt* For Vim version 8.2. Last change: 2020 Dec 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -556,7 +556,7 @@ The first format is a normal tag, which is completely compatible with Vi. It is the only format produced by traditional ctags implementations. This is often used for functions that are global, also referenced in other files. -The lines in the tags file can end in or . On the Macintosh +The lines in the tags file can end in or . On the Macintosh also works. The and characters can never appear inside a line. The second format is new. It includes additional information in optional @@ -888,19 +888,25 @@ like |CTRL-]|. The function used for generating the taglist is specified by setting the 'tagfunc' option. The function will be called with three arguments: - a:pattern The tag identifier used during the tag search. - a:flags List of flags to control the function behavior. + a:pattern The tag identifier or pattern used during the tag search. + a:flags String containing flags to control the function behavior. a:info Dict containing the following entries: buf_ffname Full filename which can be used for priority. user_data Custom data String, if stored in the tag stack previously by tagfunc. -Currently two flags may be passed to the tag function: +Currently up to three flags may be passed to the tag function: 'c' The function was invoked by a normal command being processed (mnemonic: the tag function may use the context around the cursor to perform a better job of generating the tag list.) 'i' In Insert mode, the user was completing a tag (with - |i_CTRL-X_CTRL-]|). + |i_CTRL-X_CTRL-]| or 'completeopt' contains `t`). + 'r' The first argument to tagfunc should be interpreted as a + |pattern| (see |tag-regexp|), such as when using: > + :tag /pat +< It is also given when completing in insert mode. + If this flag is not present, the argument is usually taken + literally as the full tag name. Note that when 'tagfunc' is set, the priority of the tags described in |tag-priority| does not apply. Instead, the priority is exactly as the diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 87e56240fb93aa..8eea4a59e7c951 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -1,4 +1,4 @@ -*term.txt* For Vim version 8.2. Last change: 2020 Apr 12 +*term.txt* For Vim version 8.2. Last change: 2021 Jan 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -217,6 +217,10 @@ it's different from Alt). They can be combined. Examples: > Another speciality about these codes is that they are not overwritten by another code. That is to avoid that the codes obtained from xterm directly |t_RV| overwrite them. + +Another special value is a termcap entry ending in "@;*X". This is for cursor +keys, which either use "CSI X" or "CSI 1 ; modifier X". Thus the "@" +stands for either "1" if a modifier follows, or nothing. *xterm-scroll-region* The default termcap entry for xterm on Sun and other platforms does not contain the entry for scroll regions. Add ":cs=\E[%i%d;%dr:" to the xterm @@ -369,6 +373,10 @@ Added by Vim (there are no standard codes for these): t_Ri restore icon text from stack *t_Ri* *'t_Ri'* t_TE end of "raw" mode *t_TE* *'t_TE'* t_TI put terminal into "raw" mode *t_TI* *'t_TI'* + t_fd disable focus-event tracking *t_fd* *'t_fd'* + |xterm-focus-event| + t_fe enable focus-event tracking *t_fe* *'t_fe'* + |xterm-focus-event| Some codes have a start, middle and end part. The start and end are defined by the termcap option, the middle part is text. @@ -542,6 +550,16 @@ And run "xrdb -merge .Xresources" to make it effective. You can check the value with the context menu (right mouse button while CTRL key is pressed), there should be a tick at allow-window-ops. + *xterm-focus-event* +Some terminals including xterm support the focus event tracking feature. +If this feature is enabled by the 't_fe' sequence, special key sequences are +sent from the terminal to Vim every time the terminal gains or loses focus. +Vim fires focus events (|FocusGained|/|FocusLost|) by handling them accordingly. +Focus event tracking is disabled by a 't_fd' sequence when exiting "raw" mode. +If you would like to disable this feature, add the following to your .vimrc: + `set t_fd=` + `set t_fe=` + *termcap-colors* Note about colors: The 't_Co' option tells Vim the number of colors available. When it is non-zero, the 't_AB' and 't_AF' options are used to set the color. diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index ff520785484af2..5aec3a5ae38fd1 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -1,4 +1,4 @@ -*terminal.txt* For Vim version 8.2. Last change: 2020 Jun 06 +*terminal.txt* For Vim version 8.2. Last change: 2021 Feb 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -123,12 +123,31 @@ use |:tlmenu| instead of |:tmenu|. *options-in-terminal* After opening the terminal window and setting 'buftype' to "terminal" the -TerminalOpen autocommand event is triggered. This makes it possible to set -options specifically for the window and buffer. Example: > - au TerminalOpen * if &buftype == 'terminal' | setlocal bufhidden=hide | endif -The is set to the terminal buffer, but if there is no window (hidden -terminal) then setting options will happen in the wrong buffer, therefore the -check for &buftype in the example. +|TerminalWinOpen| autocommand event is triggered. This makes it possible to set +options specifically for the terminal window and buffer. Example: > + au TerminalWinOpen * setlocal bufhidden=hide +This only works properly if the terminal is not hidden. + +For both hidden and non-hidden terminals this works, both for buffer-local and +window-local options: > + au TerminalWinOpen,BufWinEnter * if &buftype == 'terminal' + \ | setlocal bufhidden=hide colorcolumn=123 + \ | endif +Note that for a hidden terminal the options are not set until the terminal is +no longer hidden. + +There is also the |TerminalOpen| event. Keep in mind this may be triggered +for a hidden terminal, then the current window and buffer are not that of the +new terminal. +You need to use , which is set to the terminal buffer. Example: > + au TerminalOpen * call setbufvar(expand('')->str2nr(), + \ '&termwinscroll', 1000) +For a window-local option, you need to delay setting the option until the +terminal window has been created (this only works for a hidden terminal): > + au TerminalOpen * exe printf( + \ 'au BufWinEnter ++once setlocal colorcolumn=%d', + \ expand('')->str2nr(), 123) +For a non-hidden terminal use |TerminalWinOpen|. Mouse events (click and drag) are passed to the terminal. Mouse move events are only passed when Vim itself is receiving them. For a terminal that is @@ -476,9 +495,11 @@ term_dumpdiff({filename}, {filename} [, {options}]) "term_name" name to use for the buffer name, instead of the first file name. "term_rows" vertical size to use for the terminal, - instead of using 'termwinsize' + instead of using 'termwinsize', but + respecting the minimal size "term_cols" horizontal size to use for the terminal, - instead of using 'termwinsize' + instead of using 'termwinsize', but + respecting the minimal size "vertical" split the window vertically "curwin" use the current window, do not split the window; fails if the current buffer @@ -501,6 +522,8 @@ term_dumpdiff({filename}, {filename} [, {options}]) a different attribute + missing position in first file - missing position in second file + > cursor position in first file, not in second + < cursor position in second file, not in first Using the "s" key the top and bottom parts are swapped. This makes it easy to spot a difference. @@ -711,6 +734,8 @@ term_scrape({buf}, {row}) *term_scrape()* "attr" attributes of the cell, use |term_getattr()| to get the individual flags "width" cell width: 1 or 2 + For a double-width cell there is one item, thus the list can + be shorter than the width of the terminal. Can also be used as a |method|: > GetBufnr()->term_scrape(row) @@ -736,6 +761,9 @@ term_setapi({buf}, {expr}) *term_setapi()* The default is "Tapi_". When {expr} is an empty string then no |terminal-api| function can be used for {buf}. + When used as a method the base is used for {buf}: > + GetBufnr()->term_setapi({expr}) + term_setansicolors({buf}, {colors}) *term_setansicolors()* Set the ANSI color palette used by terminal {buf}. {colors} must be a List of 16 valid color names or hexadecimal @@ -1321,6 +1349,8 @@ Other commands ~ *:Program* jump to the window with the running program *:Source* jump to the window with the source code, create it if there isn't one + *:Asm* jump to the window with the disassembly, create it if there + isn't one Prompt mode ~ @@ -1343,6 +1373,12 @@ Prompt mode can be used even when the |+terminal| feature is present with: > The K key is normally mapped to :Evaluate. If you do not want this use: > let g:termdebug_map_K = 0 +< + *termdebug_disasm_window* +If you want the Asm window shown by default, set this to 1. Setting to +any value greater than 1 will set the Asm window height to that value: > + let g:termdebug_disasm_window = 15 +< Communication ~ *termdebug-communication* @@ -1409,16 +1445,18 @@ If you don't want this then disable it with: > Vim window width *termdebug_wide* -To change the width of the Vim window when debugging starts, and use a -vertical split: > - let g:termdebug_wide = 163 -This will set &columns to 163 when `:Termdebug` is used. The value is restored -when quitting the debugger. -If g:termdebug_wide is set and &columns is already larger than -g:termdebug_wide then a vertical split will be used without changing &columns. -Set it to 1 to get a vertical split without every changing &columns (useful -for when the terminal can't be resized by Vim). +To change the width of the Vim window when debugging starts and use a vertical +split: > + let g:termdebug_wide = 163 + +This will set 'columns' to 163 when `:Termdebug` is used. The value is +restored when quitting the debugger. + +If g:termdebug_wide is set and 'columns' is already a greater value, then a +vertical split will be used without modifying 'columns'. +Set g:termdebug_wide to 1 to use a vertical split without ever changing +'columns'. This is useful when the terminal can't be resized by Vim. vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt index 53ed0818e47cbf..4e4cff0c27ca40 100644 --- a/runtime/doc/testing.txt +++ b/runtime/doc/testing.txt @@ -1,4 +1,4 @@ -*testing.txt* For Vim version 8.2. Last change: 2020 Jul 09 +*testing.txt* For Vim version 8.2. Last change: 2021 Mar 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -20,18 +20,17 @@ and for testing plugins. Vim can be tested after building it, usually with "make test". The tests are located in the directory "src/testdir". -There are several types of tests added over time: - test33.in oldest, don't add any of these - test_something.in old style tests +There are two types of tests added over time: + test20.in oldest, only for tiny and small builds test_something.vim new style tests *new-style-testing* -New tests should be added as new style tests. These use functions such as -|assert_equal()| to keep the test commands and the expected result in one -place. +New tests should be added as new style tests. The test scripts are named +test_.vim (replace with the feature under test). These use +functions such as |assert_equal()| to keep the test commands and the expected +result in one place. *old-style-testing* -In some cases an old style test needs to be used. E.g. when testing Vim -without the |+eval| feature. +These tests are used only for testing Vim without the |+eval| feature. Find more information in the file src/testdir/README.txt. @@ -169,6 +168,7 @@ test_override({name}, {val}) *test_override()* wait time of up to 3 seconds for messages term_props reset all terminal properties when the version string is detected + uptime overrules sysinfo.uptime ALL clear all overrides ({val} is not used) "starting" is to be used when a test should behave like @@ -292,8 +292,9 @@ assert_exception({error} [, {msg}]) *assert_exception()* catch call assert_exception('E492:') endtry - -assert_fails({cmd} [, {error} [, {msg}]]) *assert_fails()* +< + *assert_fails()* +assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]]) Run {cmd} and add an error message to |v:errors| if it does NOT produce an error or when {error} is not found in the error message. Also see |assert-return|. @@ -308,17 +309,32 @@ assert_fails({cmd} [, {error} [, {msg}]]) *assert_fails()* first reported error: > assert_fails('cmd', ['E987:.*expected bool']) < The second pattern, if present, is matched against the last - reported error. To only match the last error use an empty - string for the first error: > + reported error. + If there is only one error then both patterns must match. This + can be used to check that there is only one error. + To only match the last error use an empty string for the first + error: > assert_fails('cmd', ['', 'E987:']) < + If {msg} is empty then it is not used. Do this to get the + default message when passing the {lnum} argument. + + When {lnum} is present and not negative, and the {error} + argument is present and matches, then this is compared with + the line number at which the error was reported. That can be + the line number in a function or in a script. + + When {context} is present it is used as a pattern and matched + against the context (script name or function name) where + {lnum} is located in. + Note that beeping is not considered an error, and some failing commands only beep. Use |assert_beeps()| for those. Can also be used as a |method|: > GetCmd()->assert_fails('E99:') -assert_false({actual} [, {msg}]) *assert_false()* +assert_false({actual} [, {msg}]) *assert_false()* When {actual} is not false an error message is added to |v:errors|, like with |assert_equal()|. Also see |assert-return|. diff --git a/runtime/doc/textprop.txt b/runtime/doc/textprop.txt index ac6d12a699cc09..169520cfd70f4e 100644 --- a/runtime/doc/textprop.txt +++ b/runtime/doc/textprop.txt @@ -1,4 +1,4 @@ -*textprop.txt* For Vim version 8.2. Last change: 2020 Mar 05 +*textprop.txt* For Vim version 8.2. Last change: 2020 Oct 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -101,7 +101,7 @@ Manipulating text property types: prop_type_add({name}, {props}) define a new property type prop_type_change({name}, {props}) change an existing property type prop_type_delete({name} [, {props}]) delete a property type -prop_type_get([{name} [, {props}]]) get property type values +prop_type_get({name} [, {props}]) get property type values prop_type_list([{props}]) get list of property types @@ -291,7 +291,7 @@ prop_type_delete({name} [, {props}]) *prop_type_delete()* Can also be used as a |method|: > GetPropName()->prop_type_delete() -prop_type_get([{name} [, {props}]]) *prop_type_get()* +prop_type_get({name} [, {props}]) *prop_type_get()* Returns the properties of property type {name}. This is a dictionary with the same fields as was given to prop_type_add(). diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt index a66de919ad5460..af78965e96309c 100644 --- a/runtime/doc/tips.txt +++ b/runtime/doc/tips.txt @@ -1,4 +1,4 @@ -*tips.txt* For Vim version 8.2. Last change: 2009 Nov 07 +*tips.txt* For Vim version 8.2. Last change: 2020 Dec 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -30,6 +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| ============================================================================== Editing C programs *C-editing* @@ -530,4 +531,28 @@ A slightly more advanced version is used in the |matchparen| plugin. autocmd InsertEnter * match none < +============================================================================== +Opening help in the current window *help-curwin* + +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 + endif + return 'help ' .. a:subject + endfunction +< + + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index a04a5112b411c3..2486d9d50f0f9f 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 8.2. Last change: 2020 Jul 10 +*todo.txt* For Vim version 8.2. Last change: 2021 Mar 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -38,112 +38,147 @@ browser use: https://github.com/vim/vim/issues/1234 *known-bugs* -------------------- Known bugs and current work ----------------------- -Making everything work: -- in Vim9 script expressions are evaluated differently, not using a type. - e.g. "'' == 0" does not give an error and evaluates to true. -- cannot put # comment after assert() in :def function -- more return types depending on the first argument, like sort(). -- Check that when sourcing a Vim9 script, only the global items can be used. -- :put with a "=" register argument doesn't work, need to find the expression - and compile it. (#6397) -- should "'text'->method()" work? 't is a range, but 'text isn't. -- Slice of list: [1, 2, 3][1:2]. -- Give runtime error if function argument is wrong. - def Increment(nr: number) - range(3)->Increment() -- Expand `=expr` in :next, :argedit, :argadd, :argdelete, :drop -- Expand `=expr` in :vimgrep, :vimgrepadd, :lvimgrep, :lvimgrepadd -- Expand `=expr` in :mkspell -- Make "true" and "false" work in vim9script -- Test that a function defined inside a :def function is local to that - function, g: functions can be defined and script-local functions cannot be - defined. +Vim9 - Make everything work: +- Does this work now: Implement using imported items at script level from + "import * as X" in +- import of item that isn't exported: error should mention missing "export"? +- no error for using :import in legacy script? +- Disallow :open ? +- Check: what if 'cpo' is intentionally changed in Vim9 script, does it get + restored at the end? +- ISN_CHECKTYPE could use check_argtype() +- Using a script variable inside a :def function doesn't work if the variable + is inside a block, see Test_nested_function(). Should it work? +- give error for variable name: + var p = function('NoSuchFunc') +- When indexing a string, should we include composing characters? #6563 + string[0] - first character including its composing characters. + string[0 : 0] - same + If you don't want that use strcharpart(). + Also, add optional arg to strcharpart() to include composing chars, to + make it consistent with strchars(). + Add strcharlen(), like strchars() but like skipcc is always set +- Make closures work better: + - Create closure in a loop. Need to make a list of them. +- If a :def function is called with a function reference, compile it to get + the function type. + def Filter(x: string, Cond: func(string): bool) + Filter(x, (v) => v =~ '^b') +- Make inline function work, to be used as a funcref: + var Ref = (arg: type): type => { + statement + return expr + } + var Ref = (arg: type) => { + statement + statement + } +- For builtin functions using tv_get_string*() use check_for_string() to be + more strict about the argument type. +- Implement :lockvar and :unlockvar. How about local variables? Perhaps only + allow this for global variables. Use :final or :const otherwise. +- Allow function names that will be script-local to start with lower case + letter? Or also require names with s: prefix to use upper case? + Also apply this function references "var ref = SomeFunc" +- Support passing v:none to use the default argument value. (#6504) +- Run the same tests in :def and Vim9 script, like in Test_expr7_not() +- Check many more builtin function arguments at compile time. - make 0 == 'string' fail on the script level, like inside :def. - Check that when using a user function name without prefix, it does not find a global function. Prefixing g: is required. -- Compile: for [key, value] in items(map) -- Assignment to dict doesn't work: - let ret: dict = #{} - ret[i] = string(i) -- Appending to dict item doesn't work: - let d[i] ..= value +- Appending to dict item doesn't work in a :def function: + var d: dict = {a: 'x'} + d['a'] ..= 'y' + d.a ..= 'y' + Test to be extended: Test_assign_dict_with_op() +- Using ".." at script level doesn't convert arguments to a string. - Compile replacement of :s command: s/pat/\=expr/ - Compile redir to local variable: var_redir_start(). +- Implement type cast at the script level. - Compile builtin functions that access local variables: islocked() -- possible memory leak in test_vim9_func through compile_nested_function. -- memory leaks in test_vim9_expr -- memory leaks in test_vim9_script -- memory leaks in test_vim9_cmd - When evaluating constants for script variables, some functions could work: has('asdf'), len('string') -- Support type for ":let"/":const" at script level for Vim9 script. - (Ben Jackson, #5671) - Can we share the code from ex_let_const() between direct execution and - compiling? -- Implement "as Name" in "import Item as Name from ..." -- Disallow unlet for local/script/imported vars -- Make "++nr" work. -- Make closures work: - - Create closure in a loop. Need to make a list of them. + eval_variable(). Should pass the ".xxx" that follows and return that. +- Make "++nr" work. "++g:count" doesn't work, thinks it is a range. +- Reload: How to make sure type of script function hasn't changed? - expandcmd() with `=expr` in filename uses legacy expression. - eval_expr() in ex_cexpr() - eval_expr() call in dbg_parsearg() and debuggy_find() -- has() is compiled as a constant, but some checks are dynamic. - Check for dynamic values, such as "gui_running". -New syntax and functionality: -Improve error checking: -- "echo Func()" is an error if Func() does not return anything. -Test: -- Using a Vim9 autoload script (functions must be global). -Also: -- For range: make table of first ASCII character with flag to quickly check if - it can be a Vim9 command. E.g. "+" can, but "." can't. +- compile "skip" argument of searchpair() +- compile "expr" and "call" expression of a channel in channel_exe_cmd()? +- give an error for "echo Func()" if Func() does not return anything. +- Using "windo echo expr" does not accept a line break inside "expr" (in a + :def function and at script level in a not executed block). #7681 +- "assert_fails()" cannot access local variables. Perhaps add this: + assertfails + ... cmd ... + endassertfails /E99:.*cmd/ + Similar to try/catch/endtry but without the boilerplate. + +Once Vim9 is stable: +- Change the help to prefer Vim9 syntax where appropriate +- Add all the error numbers in a good place in documentation. +- In the generic eval docs, point out the Vim9 syntax where it differs. +- Add the "vim9script" feature, can use has('vim9script') +- Use Vim9 for runtime files. + PR #7497 for autoload/ccomplete.vim + +Also for Vim9: - better implementation for partial and tests for that. - Make "g:imported = Export.exported" work in Vim9 script. - Make Foo.Bar() work to call the dict function. (#5676) - Error in any command in "vim9script" aborts sourcing. - Find a way to test expressions in legacy and Vim9 script without duplication -- Fix memory leaks for test_vim9_disassemble, test_vim9_expr, test_vim9_script -- Test each level of expressions properly, with type checking - Test try/catch and throw better, also nested. - Test return inside try/finally jumps to finally and then returns. -- call autoload function. -- Implement more expressions, e.g. [a:b] -- can use func as reference: - def SomeFunc() ... - map(list, SomeFunc) -- Test: Function declared inside a :def function is local, disappears at the - end of the function. Unless g: is used, just like with variables. -- implement :type -- import type declaration? -- implement class -- implement interface -- predefined class: Promise -- implement enum -- Make accessing varargs faster: arg[expr] - EVAL expr - LOADVARARG (varags idx) -Further improvements: + Test that return inside try/finally jumps to finally and then returns. +- Test that a function defined inside a :def function is local to that + function, g: functions can be defined and script-local functions cannot be + defined. - compile options that are an expression, e.g. "expr:" in 'spellsuggest', 'foldexpr', 'foldtext', 'printexpr', 'diffexpr', 'patchexpr', 'charconvert', 'balloonexpr', 'includeexpr', 'indentexpr', 'formatexpr'. -- Make inline function work, to be used as a funcref: - let ref = def(arg: type): rettype - body - enddef + Give an error if compilation fails. (#7625) + Use the location where the option was set for deciding whether it's to be + evaluated in Vim9 script context. +- implement :type; import type declaration. +- implement enum; import enum. +- Future work: See |vim9-classes| + Define the keywords and commands to make sure it will be backwards + compatible. +- Make debugging work - at least per function. Need to recompile a function + to step through it line-by-line? Evaluate the stack and variables on the + stack? +- List commands when 'verbose' is set or :verbose is used. + +Further Vim9 improvements, possibly after launch: +- For range: make table of first ASCII character with flag to quickly check if + it can be a Vim9 command. E.g. "+" can, but "." can't. - compile get_lambda_tv() in popup_add_timeout() - inline call to map() and filter() -- compile "skip" argument of searchpair() -- compile "expr" and "call" expression of a channel in channel_exe_cmd()? +- Make accessing varargs faster: arg[expr] + EVAL expr + LOADVARARG (varargs idx) + Popup windows: -- Cursor not updated before a redraw, making it jump. (#5943) +- Add a flag to make a popup window focusable? + CTRL-W P cycle over any preview window or focusable popup, end up back in + current window. + ? - switch between current window and all popup windows + Esc in popup window goes back to previous current window +- Add a termcap entry for changing the cursor when it goes under the popup and + back. like t_SI and t_EI (t_SU and t_EU, where "U" means under?) - With terminal in popup, allow for popup_hide() to temporarily hide it.? - Fire some autocommand event after a new popup window was created and 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. +- Width is not computed correctly when minwidth and maxwidth are &columns + and padding and a scrollbar are used. (#6676) +- 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) - Use popup (or popup menu) for command line completion - 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) @@ -157,20 +192,22 @@ Popup windows: - Figure out the size and position better if wrapping inserts indent Text properties: -- :goto does not go to the right place when test properties are present. - (#5930) +- Popup attached to text property stays visible when text is no longer + visible. (#7736) +- Popup attached to text property stays visible when text is deleted with + "cc". (#7737) "C" works OK. "dd" also files in a buffer with a single + line. +- Auto-indenting may cause highlighting to shift. (#7719) - "cc" does not call inserted_bytes(). (Axel Forsman, #5763) -- Get E685 with a sequence of commands. (#5674) - Combining text property with 'cursorline' does not always work (Billie Cleek, #5533) -- Text properties spanning more than one line. #5683 +- Should we let the textprop highlight overrule other (e.g. diff) highlight if + the priority is above a certain value? (#7392) - See remarks at top of src/textprop.c 'incsearch' with :s: - :s/foo using CTRL-G moves to another line, should not happen, or use the correct line (it uses the last but one line) (Lifepillar, Aug 18, #3345) -- :s@pat/tern@ doesn't include "/" in the pattern. (Takahiro Yoshihara, #3637) - pass delim to do_search() ? - Also support range: :/foo/,/bar/delete - Also support for user command, e.g. Cfilter - :%s/foo should take the first match below the cursor line, unless there @@ -188,7 +225,7 @@ Terminal debugger: an already running program. (M. Kelly) - When only gdb window exists, on "quit" edit another buffer. - Use a sign group -- Termdebug does not work when Vim was build with mzscheme: gdb hangs just +- Termdebug does not work when Vim was built with mzscheme: gdb hangs just after "run". Everything else works, including communication channel. Not initializing mzscheme avoid the problem, thus it's not some #ifdef. - Add support for lldb? issue #3565 @@ -198,7 +235,11 @@ Terminal debugger: with another Vim instance. Terminal emulator window: +- Can escape a terminal popup with win_gotoid(), should be an error - No support for underline color, t_8u. +- When in terminal-Normal mode when the job finishes, the cursor jumps to the + end but the window is not updated. This only happens when typing "a". + :term bash -c "for V in {0..5}; do echo $V; sleep 1; done" - When started with ":terminal ++close" and the shell exits but there is a background process, the window remains open, because the channel still exists (and output still shows). Perhaps close the window when an explicit @@ -215,7 +256,6 @@ Terminal emulator window: be redrawn. - GUI: When using ":set go+=!" a system() call causes the hit-enter prompt. (#3327) -- GUI: hang until key typed. (#3530) - Allow for specifying the directory, with ++cwd={dir}. - With a vertical split only one window is updated. (Linwei, 2018 Jun 2, #2977) @@ -237,18 +277,70 @@ Terminal emulator window: - When 'encoding' is not utf-8, or the job is using another encoding, setup conversions. -Error numbers available: -E489, E610, E611, E653, E856 +Include patch #6290: recognize shell directory change. + +Valgrind reports memory leaks in test_options. + +test_arglist func Test_all_not_allowed_from_cmdwin() hangs on MS-Windows. + +Mapping with partial match not executed properly in GTK. (Ingo Karkat, #7082) + +Patch for Template string: #4634 +Have another look at the implementation. + +Patch to implement the vimtutor with a plugin: #6414 +Was originally written by Felipe Morales. + +Adding "10" to 'spellsuggest' causes spell suggestions to become very slow. +(#4087) Did patch 8.2.2379 help? +Also, z= in German on a long word can take a very long time, but CTRL-C to +interrupt does not work. Where to add ui_breakcheck()? Remove SPACE_IN_FILENAME ? It is only used for completion. -Patch to use collaction based sorting. (Christian Brabandt, #6229) +Making breakat support multibyte characters (Yasuhiro Matsumoto, #6598) +Scroll doesn't work correctly, why? + +Add 'termguiattr' option, use "gui=" attributes in the terminal? Would work +with 'termguicolors'. #1740 + +Patch for blockwise paste reporting changes: #6660. + +Patch to make fillchars global-local. (#5206) + +Missing filetype test for bashrc, PKGBUILD, etc. + +Add an option to not fetch terminal codes in xterm, to avoid flicker when t_Co +changes. + +Add an option to start_timer() to return from the input loop with K_IGNORE. +This is useful e.g. when a popup was created that disables mappings, we need +to return from vgetc() to make this happen. #7011 + +Expanding should put the tab number from cmdmod.tab before "tab". +Any way to convert "$" back by using a special value? (#6901) Can we detect true color support? https://gist.github.com/XVilka/8346728 Try setting a color then request the current color, like using t_u7. +Regexp to search for duplicate lines does not work correctly: +/\(^.*\n\)\1 (Chris Morgan, #6239) + +MS-Windows: when writing undo file the infostreams are copied in +mch_copy_file_attribute(), that seems unnecessary. (#7925) +Add a flag to only copy attributes? + +Changing a capturing group to non-capturing changes the result: #7607 + :echo matchstr('aaa bbb', '\(.\{-1,}\>\)\|.*') + aaa + :echo matchstr('aaa bbb', '\%(.\{-1,}\>\)\|.*') + aaa bbb +Should also work without any group: + :echo matchstr('aaa bbb', '.\{-1,}\>\|.*') + aaa bbb (should be aaa) + Check out PR #543 (Roland Puntaier). -Patch for multi-byte characters in langmap and applying a mapping on them. +Patch for multibyte characters in langmap and applying a mapping on them. (Christian Brabandt, 2015 Jun 12, update July 25) Is this the right solution? Need to cleanup langmap behavior: - in vgetorpeek() apply langmap to the typeahead buffer and put the result in @@ -269,8 +361,19 @@ autocommands for the buffer lifecycle: BufIsRenamed (after buffer ID gets another name) The buffer list and windows are locked, no changes possible -How about removing Atari MiNT support? - src/Make_mint.mak, src/os_mint.h, matches with __MINT__ +Add a ModeChanged autocommand that has an argument indicating the old and new +mode, as what's returned from mode(). Also used for switching Terminal mode. + +Matchparen doesn't remove highlight after undo. (#7054) +Is OK when syntax HL is active. + +Currently Del can be used to delete the last character of a typed count. +Can it also be used to delete an incomplete Normal mode command? (#7096) +After an operator: should work. After "a" or "i" for text objects: should +work. + +Using "au!" after "filetype on" is a bit slow. Can the matching of +autocommands be made faster? (#7056) Add the <=> (spaceship) operator and "cond ?< expr ?= expr ?> expr" replace this: @@ -281,9 +384,16 @@ Add the <=> (spaceship) operator and "cond ?< expr ?= expr ?> expr" let res = GetLeftFunc() <=> GetRightFunc() ?< lower ?= equal ?> upper Patch to make :q work with local arglist. (Christian Brabandt, #6286) -Patch to fix drawing error with DirectX. (James Grant, #5688) -Causes flicker on resizing. Workaround from Ken Takata. -How about only setting the attribute when part of the Vim window is offscreen? +Why does Test_invalid_sid() not work in the GUI? + +":pedit" ignores the local working directory when 'pvp' is set (#7267) + +Lua: updating wrong buffer when using newly created, unloaded buffer. +(#6539) + +When "+ register is set then "" points to it. If another Vim grabs the "+ +register, then "" doesn't contain anything. Make it still follow "+. +(#6435) File marks merging has duplicates since 7.4.1925. (Ingo Karkat, #5733) @@ -296,6 +406,10 @@ manager. Problem with Motif? Patch to add :argdedupe. (Nir Lichtman, #6235) +When editing a file with ":edit" the output of :swapname is relative, while +editing it with "vim file" it is absolute. (#355) +Which one should it be? + :map output does not clear the reset of the command line. (#5623, also see #5962) @@ -304,12 +418,12 @@ character. (#6154) undo result wrong: Masato Nishihata, #4798 +After recovering from a swap file the undofile should not be used, it causes +corruption. (#6631) + When 'lazyredraw' is set sometimes the title is not updated. (Jason Franklin, 2020 Feb 3) Looks like a race condition. -Regexp to search for duplicate lines does not work correctly: -/\(^.*\n\)\1 (Chris Morgan, #6239) - With bash ":make" does not set v:shell_error. Possible solution: set 'shellpipe' to "2>&1| tee %s; exit ${PIPESTATUS[0]}" #5994 @@ -321,13 +435,13 @@ When 'fileignorecase' is set ":e testfile.c" works to edit TestFile.c, but ":find testfile.c" does not ignore case. Might be related to #6088. +Error for reverse range when using :vimgrep in file "[id-01] file.txt". +(#6919) + When changing the crypt key the buffer should be considered modified. Like when changing 'fileformat'. Save the old key in save_file_ff(). (Ninu-Ciprian Marginean) -Patch to implement the vimtutor with a plugin: #6414 -Was originally writtten by Felipe Morales. - Strange sequence of BufWipeout and BufNew events while doing omni-complete. (Paul Jolly, #5656) Get BufDelete without preceding BufNew. (Paul Jolly, #5694) @@ -340,13 +454,15 @@ Another spurious BufDelete. (Dani Dickstein, #5701) Wrong error when using local arglist. (Harm te Hennepe, #6133) -Request to support in mappings, similar to how Neovim does this. -(Daniel Hahler, #4784) - Test loose_clipboard() by selecting text before suspending. Undo puts cursor in wrong line after "cG" undo. +Implement completion for "breakadd". Should expand the second argument, e.g. +"func", and then function names after ":breakadd func". Including +script-local functions. +Also for ":profile". + :unmap gives error but does remove the mapping. (Antony Scriven, 2019 Dec 19) @@ -357,7 +473,6 @@ Patch to fix session file when using multiple tab pages. (Jason Franklin, 2019 May 20) Also put :argadd commands at the start for all buffers, so that their order remains equal? Then %argdel to clean it up. Do try this with 'hidden' set. -Also #4994: window-local options not always restored, related to using :badd. Also #5326: netrw buffers are not restored. When 'backupdir' has a path ending in double slash (meaning: use full path of @@ -371,25 +486,16 @@ Should do current file first and not split it up when more results are found. Undo history wrong when ":next file" re-uses a buffer. (#5426) ex_next() should pass flag to do_argfile(), then to do_ecmd(). +Is there a test for this? Help for ":argadd fname" says that if "fname" is already in the argument list that entry is used. But instead it's always added. (#6210) Add flag AL_FIND_ADD, if there is one argument find it in the list. -Adding "10" to 'spellsuggest' causes spell suggestions to become very slow. -(#4087) - -behavior of i_CTRl-R_CTRL-R differs from documentation. (Paul Desmond Parker, -#5771) - ":bnext" in a help buffer is supposed to go to the next help buffer, but it goes to any buffer, and then :bnext skips help buffers, since they are unlisted. (#4478) -Patch for Template string: #4634 -Copies the text twice, not very efficient. Requires a separate implementation -for Vim9 script, compiling the string parts and expressions. - Statusline highlighting error, off by one. (#5599) ":find" with 'path' set to "data*" does not find files, while completion does @@ -397,9 +503,6 @@ find them. (Max Kukartsev, #6218) Enable 'termbidi' if $VTE_VERSION >= 5703 ? -Universal solution to detect if t_RS is working, using cursor position. -Koichi Iwamoto, #2126 - Sound: support on Mac? Or does libcanberra work there? Python 3.8 doesn't work. (Antonios Hadjigeorgalis, #5509) @@ -412,15 +515,8 @@ support combining characters. (Charles Campbell) Also #4687 Output from assert_equalfile() doesn't give a hint about what's different. Assuming the files are text, print the line with the difference. -Add "t" action to settagstack(): truncate and add new entries. (#5405) - -When 'relativenumber' is set the line just below a diff change doesn't get -updated. (#6138) - Result of synID() sometimes wrong in help files. (#5252) -Status line is nut updated when splitting windows. (Marcin Szamotulski, #5496) - Problem showing a line if the number column width changes when using "o". (Mateusz Morusiewicz, #4245) @@ -433,10 +529,7 @@ with packages under "start". (xtal8, #1994) Patch to add new motion ]( and ]{. (Yasuhiro Matsumoto, #5320) Better: use the "z" prefix. or ]t) and [t(. -Modeless selection doesn't work in gvim. (#4783) -Caused by patch 8.1.1534. - -Visual highlight not removed when 'dipslay' is "lastline" and line doesn't +Visual highlight not removed when 'display' is "lastline" and line doesn't fit. (Kevin Lawler, #4457) Current position in the changelist should be local to the buffer. (#2173) @@ -446,24 +539,14 @@ Does not build with MinGW out of the box: - WINVER conflict, should use 0x0600 by default? - INT_MAX not defined: need to include in vim.h -Crash when mixing matchadd and substitute()? (Max Christian Pohle, 2018 May -13, #2910) Can't reproduce? - Display messed up with matchparen, wrapping and scrolling. (#5638) +Screen update bug related to matchparen. (Chris Heath, 2017 Mar 4, #1532) When getting a focus event halfway a mapping this aborts the mapping. E.g. when "qq" is mapped and after the first "q" the mouse is moved outside of the gvim window (with focus follows mouse), then the K_FOCUSLOST key is put in the input buffer. (#5302) -xterm should be able to pass focus changes to Vim, so that Vim can check for -buffers that changed. Perhaps in misc.c, function selectwindow(). -Xterm 224 supports it! -Patch to make FocusGained and FocusLost work in modern terminals. (Hayaki -Saito, 2013 Apr 24) Update 2016 Aug 12. -Also see issue #609. -We could add the enable/disable sequences to t_ti/t_te or t_ks/t_ke. - :buffer completion does not escape "+" properly and results in a regexp error. (#5467) @@ -482,24 +565,14 @@ Patch to add the :bvimgrep command. (Christian Brabandt, 2014 Nov 12) Updated 2016 Jun 10, #858 Update 2017 Mar 28: use . Better use ":bufgrep" ? -Errors found with random data: - heap-buffer-overflow in alist_add (#2472) - Improve fallback for menu translations, to avoid having to create lots of files that source the actual file. E.g. menu_da_de -> menu_da Include part of #3242? -When a terminal exit_cb closes the window, a following typed key is lost, if -it's in a mapping. (2018 Oct 6, #2302, #3522) - Patch to have text objects defined by arbitrary single characters. (Daniel Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31) Added tests (James McCoy, 2016 Aug 3, #958). Still needs more work. -":2resize +10" uses size of the current window, adds 10 and applies it to -window 2. User expects 10 to be added to size of window 2. (Daniel Steinberg, -#5443) - Would be nice to set tab-local values for 'diffexpr' and 'diffopt'. Use t:diffexpr_option t:diffopt_option? (#4782) @@ -508,11 +581,6 @@ Williams, 2018 Oct 30) '[ mark in wrong column after put. (#4776) -"exepath('bin/cmd')" does not work while ":!bin/cmd" does work. -(Daniel Hahler, #4710) and executable('bin/cmd') returns 1 - -Error drawing the number column when 'cursorline' is set. (#3893) - Problem with :tlmenu: Detach item added with all modes? Issue #3563. Add an argument to expandcmd() to expand like ":next" does. @@ -582,13 +650,42 @@ Should we include some part of pull request #4505, not increment changedtick in some cases? E.g. for ":write" when the changed flag was already off, the buffer didn't change at all. -Line numbers in profile are off when function was defined with ":execute". -(Daniel Hahler, #4511) - Session file contains absolute paths when "curdir" is removed form 'sessionoptions', making it impossible to have a session with a relative path. (#4450) +Session file only contains local option values for buffers that are in a +window, not other buffers. (#7532) + +Script generated by :mksession does not work well if there are windows with +modified buffers + change "silent only" into "silent only!" + change "edit fname" of first buffer to "hide edit fname" + skip "badd fname" if "fname" is already in the buffer list + remove remark about unloading buffers from documentation + +When session file has name in argument list but the buffer was deleted, the +buffer is not deleted when using the session file. (#1393) +Should add the buffer in hidden state. + +When a session file is created and there are "nofile" buffers, these are not +filled. Need to trigger BufReadCmd autocommands. Also handle deleting the +initial empty buffer better. (ZyX, 2015 March 8) + +Setting the spell file in a session only reads the local additions, not the +normal spell file. (Enno Nagel, 2014 Mar 29) + +Directory wrong in session file, caused by ":lcd" in BufEnter autocommand. +(Felix Kater, 2009 Mar 3) + +Something wrong with session that has "cd" commands and "badd", in such a way +that Vim doesn't find the edited file in the buffer list, causing the +ATTENTION message? (Tony Mechelynck, 2008 Dec 1) +Also: swap files are in ~/tmp/ One has relative file name ".mozilla/...". + +'foldcolumn' in modeline applied to wrong window when using a session. (Teemu +Likonen, March 19) + When using a timer callback vgetc_busy is reset, allowing for using input(). But in a channel callback this does not happen. We need to do something similar to check_due_timer(). Also see #3809. @@ -615,9 +712,6 @@ a hint about how to fix it. (#4300) Make balloon_show() work outside of 'balloonexpr'? Users expect it to work: #2948. (related to #1512?) -On Win32 it stops showing, because showState is already ShS_SHOWING. -balloon_show() does not work properly in the terminal. (Ben Jackson, 2017 Dec -20, #2481) Also see #2352, want better control over balloon, perhaps set the position. Should also be possible to add highlighting, like in the status line? balloonexpr() on MS-Windows GUI doesn't handle accented chars? (nivaemail, @@ -643,12 +737,6 @@ Redo only remembers the last change. Could use "{count}g." to redo an older change. How does the user know which change? At least have a way to list them: ":repeats". Add to history, like search history and command line history. -Incsearch test fails when locale is "C". (Dominique Pelle, #3986) -Also run all tests with C locale? - -"vat" doesn't work well on XML when the closing > is on another line. -#3927 - Pasting foo} causes Vim to behave weird. (John Little, 2018 Jun 17) Related to bracketed paste. I cannot reproduce it. @@ -667,8 +755,6 @@ Some xterm responses are not properly handled: (Markus Gömmel, 2019 Apr 1) Using CTRL-L to add a character to the search string that contains \v, punctuation is repeated. (Smylers, 2018 Nov 17, #3621) -ml_get error: (Israel Chauca Fuentes, 2018 Oct 17, #3550). - Using single wide base character with double wide composing character gives drawing errors. Fill up the base character? (Dominique, #4328) @@ -695,6 +781,7 @@ Make ":interactive !cmd" stop termcap mode, also when used in an autocommand. Add buffer argument to undotree(). (#4001) +Memory leak in test_debugger Using uninitialized value in test_crypt (can't explain why). Memory leak in test_terminal_fail TODO: be able to run all parts of test_alot with valgrind separately @@ -702,19 +789,13 @@ Memory leak in test_alot with pyeval() (allocating partial) Memory leak in test_alot with expand() Memory leaks in test_channel? (or is it because of fork()) -gethostbyname() is old, use getaddrinfo() if available. (#3227) - matchaddpos() gets slow with many matches. Proposal by Rick Howe, 2018 Jul 19. -Should make 'listchars' global-local. Local to window or to buffer? -Probably window. #5206 Add something like 'fillchars' local to window, but allow for specifying a highlight name. Esp. for the statusline. And "extends" and "precedes" are also useful without 'list' set. Also in 'fillchars' or another option? -Related: #3820 - Support setting the character displayed below the last line? -Neovim uses "eob:X" in 'fillchars'. Sourceforge Vim pages still have content, redirect from empty page. Check for PHP errors. (Wayne Davison, 2018 Oct 26) @@ -723,22 +804,15 @@ Problem with Visual yank when 'linebreak' and 'showbreak' are set. Patch with tests, but it's not clear how it is supposed to work. (tommm, 2018 Nov 17) Asked about this, Dec 22. Christian will have a look. -Patch to fix that using "5gj" starting inside a closed fold does not work on -screen lines but on text lines. (Julius Hulsmann, #4095) Lacks a test. - home_replace() uses $HOME instead of "homedir". (Cesar Martins, 2018 Aug 9) When the status line uses term_gettitle(), it does not get updated when the terminal title changes. (Josh Triplett, 2018 Sep 9, #3418) How would we know that the status line needs to be updated? -Adjust windows installer explanation of behavior. (scootergrisen, #3310) - Update for xim-input-style help (Tony Mechelynck, 2019 Jan 10). Feedback from someone who uses this? -ml_get error. (Dominique Pelle, 2018 Sep 14, #3434) - Only output t_Cs when t_Ce is also set. do not use Cs and Ce termcap entries. (Daniel Hahler, 2018 Sep 25) Add t_cS and t_cR for cursor color select and reset. Use Cs and Cr terminfo values. @@ -761,48 +835,22 @@ includes the first screen line. (2018 Aug 23, #3368) Refactored HTML indent file. (Michael Lee, #1821) Asked to write a test. -MS-Windows: .lnk file not resolved properly when 'encoding' is set. -(lkintact, 2018 Sep 22, #3473) - Merge checking for 'cursorline' and 'concealcursor', see neovim #9492. -Display error when a conceal match uses '\%>1l'. (#4854) - Add a windowID argument to placing a sign, so that it only shows up in one window for the buffer. -Request to add sign_setlist() to make it faster to add a lot of signs, e.g. -when adding a sign for every quickfix entry. (#4557) - Win32 key codes are messy. Mike Williams tried to fix that, but now old mappings no longer work. Create a new terminal for the better solution? -Script generated by :mksession does not work well if there are windows with -modified buffers - change "silent only" into "silent only!" - change "edit fname" of first buffer to "hide edit fname" - skip "badd fname" if "fname" is already in the buffer list - remove remark about unloading buffers from documentation - Compiler warnings (geeknik, 2017 Oct 26): - signed integer overflow in do_sub() (#2249) - signed integer overflow in get_address() (#2248) -- signed integer overflow in getdecchrs() (#2254) - undefined left shift in get_string_tv() (#2250) -Win32 console: and typed in Insert mode don't result in normal -characters. (#3246) - -'foldtext' is evaluated too often. (Daniel Hahler, #2773) - Add Native language protocol server (LSP) support. (Yegappan Lakshmanan, 2018 Oct 28) -ml_get error when using a Python script. (Yggdroot, 2017 Jun 1, #1737) -Lemonboy can reproduce (2017 Jun 5) -Also reproduced by Benjamin Doherty, 2018 Oct 4. -Simpler way: Ken Takata, Oct 6. - Add more testing of the GTK GUI. - gtk_test_widget_click() can be used to simulate a click in a widget. @@ -825,9 +873,6 @@ Try out background make plugin: or asyncmake: https://github.com/yegappan/asyncmake -Add a ModeChanged autocommand that has an argument indicating the old and new -mode, as what's returned from mode(). Also used for switching Terminal mode. - Add an option with file patterns, to be used when unloading a buffer: If there is a match, remove entries for the buffer from marks, jumplist, etc. To be used for git temp files. @@ -864,8 +909,6 @@ missing: --nofork, -A , -b, -h, etc. ":au * * command" should not be allowed, only use * for event when listing or deleting autocmds, not when adding them. -Alternative manpager.vim. (Enno, 2018 Jan 5, #2529) - With 'foldmethod' "indent" and appending an empty line, what follows isn't included in the existing fold. Deleting the empty line and undo fixes it. (Oleg Koshovetc, 2018 Jul 15, #3214) @@ -887,9 +930,6 @@ Python indenting: alternative way to indent arguments: http://orchistro.tistory.com/236 Should be supported with a flag. -Starting job with cwd option, when the directory does not exist, gives a -confusing error message. (Wang Shidong, 2018 Jan 2, #2519) - Add the debug command line history to viminfo. Add Makefiles to the runtime/spell directory tree, since nobody uses Aap. @@ -910,9 +950,6 @@ With foldmethod=syntax and nofoldenable comment highlighting isn't removed. Using 'wildignore' also applies to literally entered file name. Also with :drop (remote commands). -Inserting a line in a CompleteDone autocommand may confuse undo. (micbou, -2018 Jun 18, #3027) - Implement option_save() and option_restore(): option_restore({list}) *option_restore()* Restore options previously saved by option_save(). @@ -948,8 +985,6 @@ Also see #1689. When 'virtualedit' is "all" and 'cursorcolumn' is set, the wrong column may be highlighted. (van-de-bugger, 2018 Jan 23, #2576) -":file" does not show anything when 'shortmess' contains 'F'. (#3070) - No profile information for function that executes ":quit". (Daniel Hahler, 2017 Dec 26, #2501) @@ -960,9 +995,6 @@ Add script number to profile? (#3330 breaks tests). A function defined locally and lambda's are not easily recognized. Mention where they were defined somewhere. -Invalid range error when using BufWinLeave for closing terminal. -(Gabriel Barta, 2017 Nov 15, #2339) - ml_get errors with buggy script. (Dominique, 2017 Apr 30) Error in emsg with buggy script. (Dominique, 2017 Apr 30) @@ -989,7 +1021,7 @@ neovim #7431) Patch for improving detecting Ruby on Mac in configure. (Ilya Mikhaltsou, 2017 Nov 21) -When t_Co is changed from termresponse, the OptionSet autocmmand event isn't +When t_Co is changed from termresponse, the OptionSet autocommand event isn't triggered. Use the code from the end of set_num_option() in set_color_count(). @@ -1028,10 +1060,6 @@ line breaks. (Ken Takata, 2017 Aug 22) The ":move" command does not honor closed folds. (Ryan Lue, #2351) -Patch to fix increment/decrement not working properly when 'virtualedit' is -set. (Hirohito Higashi, 2016 Aug 1, #923) -Was this fixed? - Cannot copy modeless selection when cursor is inside it. (lkintact, #2300) Test_writefile_fails_conversion failure on Solaris because if different iconv @@ -1048,7 +1076,7 @@ Overlong utf-8 sequence is displayed wrong. (Harm te Hennepe, 2017 Sep 14, #2089) Patch with possible solution by Björn Linse. The change list index is local to a buffer, but it doesn't make sense using it -for another buffer. (lacygoll) Copy w_changelistidx to wininfo_S and back. +for another buffer. (lacygoill) Copy w_changelistidx to wininfo_S and back. X11: Putting more than about 262040 characters of text on the clipboard and pasting it in another Vim doesn't work. (Dominique Pelle, 2008 Aug 21-23) @@ -1071,9 +1099,6 @@ Patch from Christian Brabandt to preserve upper case marks when wiping out a buffer. (2013 Dec 9) Also fixes #2166? -Python: After "import vim" error messages only show the first line of the -stack trace. (Yggdroot, 2017 Jul 28, #1887) - Profile of a dict function is lost when the dict is deleted. Would it be possible to collect this? (Daniel Hahler, #2350) @@ -1084,8 +1109,6 @@ Patch to skip writing a temp file for diffing if the buffer is equal to the existing file. (Akria Sheng, 2017 Jul 22) Could also skip writing lines that are the same. -Patch with Files for Latvian language. (Vitolins, 2017 May 3, #1675) - MS-Windows: Opening same file in a second gvim hangs. (Sven Bruggemann, 2017 Jul 4) @@ -1108,19 +1131,9 @@ Use gvimext.dll from the nightly build? (Issue #249) Problem with using :cd when remotely editing a file. (Gerd Wachsmuth, 2017 May 8, #1690) -Bogus characters inserted when triggering indent while changing text. -(Vitor Antunes, 2016 Nov 22, #1269) - Using "wviminfo /tmp/viminfo" does not store file marks that Vim knows about, it only works when merging with an existing file. (Shougo, 2017 Jun 19, #1781) -Segmentation fault with complete(). (Lifepillar, 2017 Apr 29, #1668) -Check for "pat" to be NULL in search_for_exact_line()? -How did it get NULL? Comment by Christian, Apr 30. - -Is it possible to keep the complete menu open when calling complete()? -(Prabir Shrestha, 2017 May 19, #1713) - Memory leak in test97? The string is actually freed. Weird. assert_fails() can only check for the first error. Make it possible to have @@ -1155,36 +1168,22 @@ Json string with trailing \u should be an error. (Lcd) import can't be used in define option when include matches too. (Romain Lafourcade, 2017 Jun 18, #1519) -When session file has name in argument list but the buffer was deleted, the -buffer is not deleted when using the session file. (#1393) -Should add the buffer in hidden state. - Wrong diff highlighting with three files. (2016 Oct 20, #1186) Also get E749 on exit. Another example in #1309 -When deleting a mark or register, leave a tombstone, so that it's also deleted -when writing viminfo (and the delete was the most recent action). #1339 - Suggestion to improve pt-br spell checking. (Marcelo D Montu, 2016 Dec 15, #1330) Error in test_startup_utf8 on Solaris. (Danek Duvall, 2016 Aug 17) -Completion for :!cmd shows each match twice. #1435 - GTK: When adding a timer from 'balloonexpr' it won't fire, because g_main_context_iteration() doesn't return. Need to trigger an event when the timer expires. -Screen update bug related to matchparen. (Chris Heath, 2017 Mar 4, #1532) - Rule to use "^" for statusline does not work if a space is defined with highlighting for both stl and stlnc. Patch by Ken Hamada (itchyny, 2016 Dec 11) -8 "stl" and "stlnc" in 'fillchars' don't work for multi-byte characters. - Patch by Christian Wellenbrock, 2013 Jul 5. - Using CTRL-G_U in InsertCharPre causes trouble for redo. (Israel Chauca Fuentes, 2017 Feb 12, #1470) @@ -1198,9 +1197,6 @@ Check for errors E704 and E705 only does VAR_FUNC, should also do VAR_PARTIAL. (Nikolai Pavlov, 2017 Mar 13, #1557) Make a function to check for function-like type? -Screen updated delayed when using CTRL-O u in Insert mode. -(Barlik, #1191) Perhaps because status message? - Implement named arguments for functions with optional arguments: func Foo(start, count = 1, all = 1) call Foo(12, all = 0) @@ -1218,9 +1214,6 @@ Once .exe with updated installer is available: Add remark to download page about /S and /D options (Ken Takata, 2016 Apr 13) Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases -Problem passing non-UTF-8 strings to Python 3. (Björn Linse, 2016 Sep 11, -#1053) With patch, does it work? - ":sbr" docs state it respects 'switchbuf', but "vsplit" does not cause a vertical split. (Haldean Brown, 2017 Mar 1) @@ -1239,16 +1232,9 @@ Useful to restore it. Is there another solution? Patch for wrong cursor position on wrapped line, involving breakindent. (Ozaki Kiichi, 2016 Nov 25) -Does this also fix #1408 ? - -'cursorline' and match interfere. (Ozaki Kiichi, 2017 Jun 23, #1792) Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30) -When 'completeopt' has "noselect" does not insert a newline. (Lifepillar, 2017 -Apr 23, #1653) -Can 'completeopt' be made buffer-local? (#5487) - Window resizing with 'winfixheight': With a vertical split the height changes anyway. (Tommy allen, 2017 Feb 21, #1502) @@ -1263,9 +1249,6 @@ Patch to add Zstandard compressed file support. (Nick Terrell, 2016 Oct 24) On Windows buffer completion sees backslash as escape char instead of path separator. (Toffanim, 2016 Nov 24, #1274) -min() and max() spawn lots of error messages if sorted list/dictionary -contains invalid data (Nikolay Pavlov, 2016 Sep 4, #1039) - Should :vmap in matchit.vim be :xmap? (Tony Mechelynck) Problem with whitespace in errorformat. (Gerd Wachsmuth, 2016 May 15, #807) @@ -1275,9 +1258,14 @@ Undo problem: "g-" doesn't go back, gets stuck. (Björn Linse, 2016 Jul 18) Add "unicode true" to NSIS installer. Doesn't work with Windows 95, which we no longer support. +Suppoert sort(l, 'F'), convert strings to float. (#7857) + sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep 4#1038) +sort() does not use 'smartcase' for the skip pattern, even though 'ignorecase' +is used. (Filipe Brandenburger, #7322) + +channel: - Add a in_cb, invoked when the write buffer has become empty. (Matteo Landi) - Add ch_readlines(): for a channel in NL mode, reads as many lines as are @@ -1287,7 +1275,6 @@ sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep gets redrawn in redraw_after_callback(). #6120 - Add a separate timeout for opening a socket. Currently it's fixed at 50 msec, which is too small for a remote connection. (tverniquet, #2130) -- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026) - Writing raw mode to a buffer should still handle NL characters as line breaks. (Dmitry Zotikov, 2017 Aug 16) - When out_cb executes :sleep, the close_cb may be invoked. (Daniel Hahler, @@ -1333,7 +1320,7 @@ Regexp problems: - Bug with pattern: '\vblock (\d+)\.\n.*\d+%(\1)@ and \?. (Brett Stahlman, 2013 Dec 21) Remark from Marcin Szamotulski; Remark from Brett 2014 Jan 6 and 7. @@ -1364,16 +1351,10 @@ Regexp problems: Another one: echom matchstr(" sdfsfsf\n sfdsdfsdf",'[^\n]*') (2017 May 15, #1252) -Feature request: Complete members of a dictionary. (Luc Hermitte, 2017 Jan 4, -#1350) - Undo message is not always properly displayed. Patch by Ken Takata, 2013 oct 3. Doesn't work properly according to Yukihiro Nakadaira. Also see #1635. -When 'keywordprg' starts with ":" the argument is still escaped as a shell -command argument. (Romain Lafourcade, 2016 Oct 16, #1175) - Idea from Sven: record sequence of keys. Useful to show others what they are doing (look over the shoulder), and also to see what happened. Probably list of keystrokes, with some annotations for mode changes. @@ -1406,16 +1387,9 @@ the system encoding (usually utf-8). MS-Windows: use WS_HIDE instead of SW_SHOWMINNOACTIVE in os_win32.c? Otherwise task flickers in taskbar. -Repeating 'opfunc' in a function only works once. (Tarmean, 2016 Jul 15, #925) - -Have a way to get the call stack, in a function and from an exception. -#1125 - Second problem in #966: ins_compl_add_tv() uses get_dict_string() multiple times, overwrites the one buffer. (Nikolay Pavlov, 2016 Aug 5) -Filetype plugin for awk. (Doug Kearns, 2016 Sep 5) - Patch to improve map documentation. Issue #799. We can use '. to go to the last change in the current buffer, but how about @@ -1442,7 +1416,7 @@ Zero-out krypt key information when no longer in use. (Ben Fritz, 2017 May 15) Add stronger encryption. Could use libsodium (NaCl). https://github.com/jedisct1/libsodium/ -Possibly include the needed code so that it can be build everywhere. +Possibly include the needed code so that it can be built everywhere. Add a way to restart a timer. It's similar to timer_stop() and timer_start(), but the reference remains valid. @@ -1472,10 +1446,6 @@ Mechelynck) Perhaps use exists("::tearoff") to check? Use vim.vim syntax highlighting for help file examples, but without ":" in 'iskeyword' for syntax. -When command names are very long :command output is difficult to read. Use a -maximum for the column width? (#871) -Patcy by varmanishant, 2016 Jun 18, #876 - Installation of .desktop files does not work everywhere. It's now fixed, but the target directory probably isn't right. Add configure check? @@ -1492,12 +1462,6 @@ Especially useful when using 'linebreak' ":cd C:\Windows\System32\drivers\etc*" does not work, even though the directory exists. (Sergio Gallelli, 2013 Dec 29) -In debug mode one can inspect variables, but not the function parameters -(starting with a:). (Luc Hermitte, 2017 Jan 4, #1352) - -If ":bd" also closes a Tab page then the " mark is not set. (Harm te Hennepe, -2016 Apr 25, #780) - Patch to avoid redrawing tabline when the popup menu is visible. (Christian Brabandt, 2016 Jan 28) @@ -1548,9 +1512,6 @@ Patch to add :mapgroup, put mappings in a group like augroup. Value returned by virtcol() changes depending on how lines wrap. This is inconsistent with the documentation. -Value of virtcol() for '[ and '] depend on multi-byte character. -(Luchr, #277) - Can we cache the syntax attributes, so that updates for 'relativenumber' and 'cursorline'/'cursorcolumn' are a lot faster? Thus store the attributes before combining them. @@ -1565,9 +1526,6 @@ Build with Python on Mac does not always use the right library. To support Thai (and other languages) word boundaries, include the ICU library: http://userguide.icu-project.org/boundaryanalysis -When complete() first argument is before where insert started and 'backspace' -is Vi compatible, the completion fails. (Hirohito Higashi, 2015 Feb 19) - Patch to use two highlight groups for relative numbers. (Shaun Brady, 2016 Jan 30) @@ -1626,17 +1584,11 @@ Doesn't work completely (Dominique Orban) Patch to add a "literal" argument to bufnr(). (Olaf Dabrunz, 2015 Aug 4) -When a session file is created and there are "nofile" buffers, these are not -filled. Need to trigger BufReadCmd autocommands. Also handle deleting the -initial empty buffer better. (ZyX, 2015 March 8) - Extended file attributes lost on write (backupcopy=no). Issue 306. Patch to add :lockjumps. (Carlo Baldassi, 2015 May 25) OK to not block marks? -Mixup of highlighting when there is a match and SpellBad. (ZyX, 2015 Jan 1) - Patch on Issue 72: 'autochdir' causes problems for :vimgrep. When two SIGWINCH arrive very quickly, the second one may be lost. @@ -1703,14 +1655,6 @@ arguments. Problem with transparent and matchgroup. Issue #475 -Spell files use a latin single quote. Unicode also has another single quote: -0x2019. (Ron Aaron, 2014 Apr 4) -New OpenOffice spell files support this with ICONV. But they are not -compatible with Vim spell files. The old files can no longer be downloaded. - -Spell checking: Add a feature to only consider two spaces after a dot to start -a new sentence. Don't give the capitalization error when there is one space. - Idea: For a window in the middle (has window above and below it), use right-mouse-drag on the status line to move a window up/down without changing its height? It's like dragging the status bar above it at the same time. @@ -1768,9 +1712,6 @@ Out of scope: - Development work on plugins (although diff with distributed version would be useful). -Setting the spell file in a session only reads the local additions, not the -normal spell file. (Enno Nagel, 2014 Mar 29) - When typing the first character of a command, e.g. "f", then using a menu, the menu item doesn't work. Clear typeahead when using a menu? @@ -1790,9 +1731,6 @@ Patch for XDG base directory support. (Jean François Bignolles, 2014 Mar 4) Remark on the docs. Should not be a compile time feature. But then what? Also see #2034. -Completion of ":e" is ":earlier", should be ":edit". Complete to the matching -command instead of doing this alphabetically. (Mikel Jorgensen) - Patch to define macros for hardcoded values. (Elias Diem, 2013 Dec 14) Several syntax file match "^\s*" which may get underlined if that's in the @@ -1837,10 +1775,6 @@ The BufUnload event is triggered when re-using the empty buffer. (Pokey Rule, 2013 Jul 22) Patch by Marcin Szamotulski, 2013 Jul 22. -The CompleteDone autocommand needs some info passed to it: -- The word that was selected (empty if abandoned complete) -- Type of completion: tag, omnifunc, user func. - Patch to allow more types in remote_expr(). (Lech Lorens, 2014 Jan 5) Doesn't work for string in list. Other way to pass all types of variables reliably? @@ -1928,13 +1862,6 @@ Szamotulski, 2012 Nov 8) Session file creation: 'autochdir' causes trouble. Keep it off until after loading all files. -MS-Windows resizing problems: -- Windows window on screen positioning: Patch by Yukihiro Nakadaira, 2012 Jun - 20. Uses getWindowRect() instead of GetWindowPlacement() -- Win32: When the taskbar is at the top of the screen creating the tabbar - causes the window to move unnecessarily. (William E. Skeith III, 2012 Jan - 12) Patch: 2012 Jan 13 Needs more work (2012 Feb 2) - 'iminsert' global value set when using ":setlocal iminsert"? (Wu, 2012 Jun 23) Patch to append regexp to tag commands to make it possible to select one out @@ -2087,7 +2014,7 @@ Also for another example (ZyX, 2011 Jan 24) Build problem with small features on Mac OS X 10.6. (Rainer, 2011 Jan 24) -"0g@$" puts '] on last byte of multi-byte. (ZyX, 2011 Jan 22) +"0g@$" puts '] on last byte of multibyte. (ZyX, 2011 Jan 22) Patch for :tabrecently. (Hirokazu Yoshida, 2012 Jan 30) @@ -2245,7 +2172,7 @@ Additional info by Dominique Pelle. (also on 2010 Apr 10) CreateFile and CreateFileW are used without sharing, filewritable() fails when the file was already open (e.g. script is being sourced). Add FILE_SHARE_READ| -FILE_SHARE_WRITE in mch_access()? (Phillippe Vaucher, 2010 Nov 2) +FILE_SHARE_WRITE in mch_access()? (Philippe Vaucher, 2010 Nov 2) Is ~/bin (literally) in $PATH supposed to work? (Paul, 2010 March 29) Looks like only bash can do it. (Yakov Lerner) @@ -2308,10 +2235,6 @@ Syntax priority problem. (Charles Campbell, 2011 Sep 15) When completion inserts the first match, it may trigger the line to be folded. Disable updating folds while completion is active? (Peter Odding, 2010 Jun 9) -When a:base in 'completefunc' starts with a number it's passed as a number, -not a string. (Sean Ma) Need to add flag to call_func_retlist() to force a -string value. - For running gvim on a USB stick: avoid the OLE registration. Use a command line argument -noregister. @@ -2392,9 +2315,6 @@ Don't load macmap.vim on startup, turn it into a plugin. (Ron Aaron, Add "no_hlsearch" to winsaveview(). -Cursorline highlighting combines with Search ('hlsearch') but not with -SpellBad. (Jim Karsten, 2009 Mar 18) - When 'foldmethod' is "indent", adding an empty line below a fold and then indented text, creates a new fold instead of joining it with the previous one. (Evan Laforge, 2009 Oct 17) @@ -2429,9 +2349,6 @@ opening/closing window causes other window with 'winfixheight' to change height. Also happens when there is another window in the frame, if it's not very high. (Yegappan Lakshmanan, 2010 Jul 22, Michael Peeters, 2010 Jul 22) -Directory wrong in session file, caused by ":lcd" in BufEnter autocommand. -(Felix Kater, 2009 Mar 3) - Session file generates error upon loading, cause by --remote-silent-tab. (7tommm (ytommm) 2010 Nov 24) @@ -2463,6 +2380,7 @@ part of standard Vim. The "1 to "9 registers are not sufficient. 6 When yanking into the unnamed registers several times, somehow make the previous contents also available (like it's done for deleting). What register names to use? g"1, g"2, etc.? +Also do this for the small delete register "-. After doing "su" $HOME can be the old user's home, thus ~root/file is not correct. Don't use it in the swap file. @@ -2491,11 +2409,6 @@ still delete them. Also convert all buffer file names? "gqip" in Insert mode has an off-by-one error, causing it to reflow text. (Raul Coronado, 2009 Nov 2) -Something wrong with session that has "cd" commands and "badd", in such a way -that Vim doesn't find the edited file in the buffer list, causing the -ATTENTION message? (Tony Mechelynck, 2008 Dec 1) -Also: swap files are in ~/tmp/ One has relative file name ".mozilla/...". - MS-Windows: editing the first, empty buffer, 'ffs' set to "unix,dos", ":enew" doesn't set 'ff' to "unix". (Ben Fritz, 2008 Dec 5) Reusing the old buffer probably causes this. @@ -2594,7 +2507,7 @@ work, the backslash is removed, assuming that it escapes the (. (Valery Kondakoff, 2009 May 13) Win32: Using "gvim --remote-tab-silent elŝuti.txt" doesn't work, the -multi-byte character isn't passed and edits elsuti.txt. +multibyte character isn't passed and edits elsuti.txt. (Raúl Núñez de Arenas Coronado, 2015 Dec 18) Problem with 'langmap' being used on the rhs of a mapping. (Nikolai Weibull, @@ -2692,9 +2605,6 @@ New PHP syntax file, use it? (Peter Hodge) ":echoe" in catch block stops processing, while this doesn't happen outside of a catch block. (ZyX, 2011 Jun 2) -'foldcolumn' in modeline applied to wrong window when using a session. (Teemu -Likonen, March 19) - Test 54 uses shell commands, that doesn't work on non-Unix systems. Use some other way to test buffer-local autocommands. @@ -2715,10 +2625,6 @@ More AmigaOS4 patches. (Peter Bengtsson, Nov 9) Amiga patches with vbcc. (Adrien Destugues, 2010 Aug 30) http://pulkomandy.ath.cx/drop/vim73_vbcc_amiga.diff -Insert mode completion: When editing the text and pressing CTRL-N again goes -back to originally completed text, edited text is gone. (Peng Yu, 2008 Jul 24) -Suggestion by Ben Schmidt, 2008 Aug 6. - Problem with compound words? (Bert, 2008 May 6) No warning for when flags are defined after they are used in an affix. @@ -2832,9 +2738,6 @@ Jun 18) If the variable "g:x#y#z" exists completion after ":echo g:x#" doesn't work. -Feature request: Command to go to previous tab, like what CTRL-W p does for -windows. (Adam George) - In debug mode, using CTRL-R = to evaluate a function causes stepping through the function. (Hari Krishna Dara, 2006 Jun 28) @@ -2904,12 +2807,6 @@ the Visual area. Can this be fixed? (James Vega, 2006 Sept 15) GUI: When combining fg en bg make sure they are not equal. -Spell checking: Add a way to specify punctuation characters. Add the -superscript numbers by default: 0x2070, 0xb9, 0xb2, 0xb3, 0x2074 - 0x2079. - -Spell checking in popup menu: If the only problem is the case of the first -character, don't offer "ignore" and "add to word list". - Use different pt_br dictionary for spell checking. (Jackson A. Aquino, 2006 Jun 5) @@ -2923,10 +2820,6 @@ Jul 22) There should be something about spell checking in the user manual. -Spell menu: When using the Popup menu to select a replacement word, -":spellrepeat" doesn't work. SpellReplace() uses setline(). Can it use "z=" -somehow? Or use a new function. - Mac: Using gvim: netrw window disappears. (Nick Lo, 2006 Jun 21) Add an option to specify the character to use when a double-width character is @@ -3158,7 +3051,7 @@ Awaiting updated patches: 7 ATTENTION dialog choices are more logical when "Delete it" appears before "Quit". Patch by Robert Webb, 2004 May 3. - Include flipcase patch: ~/vim/patches/wall.flipcase2 ? Make it work - for multi-byte characters. + for multibyte characters. - Win32: add options to print dialog. Patch from Vipin Aravind. - Patch to add highlighting for whitespace. (Tom Schumm, 2003 Jul 5) use the patch that keeps using HLF_8 if HLF_WS has not @@ -3210,6 +3103,29 @@ Better 'rightleft' or BIDI support: - Minimal Vi with bidi support: https://github.com/aligrudi/neatvi By Ali Gholami Rudi, also worked on arabic.c + +Spell checking: +- When 'cursorline' is set and the first word should have SpellCap + highlighting, redrawing the line removes it when moving the cursor away + from the line. (#7085) Would need to inspect the end of the previous line + and update "capcol_lnum" and "cap_col". +- Mixup of highlighting when there is a match and SpellBad. (ZyX, 2015 Jan 1) +- Spell files use a latin single quote. Unicode also has another single + quote: 0x2019. (Ron Aaron, 2014 Apr 4) + New OpenOffice spell files support this with ICONV. But they are not + compatible with Vim spell files. The old files can no longer be + downloaded. +- Add a feature to only consider two spaces after a dot to start a new + sentence. Don't give the capitalization error when there is one space. +- Add a way to specify punctuation characters. Add the superscript numbers + by default: 0x2070, 0xb9, 0xb2, 0xb3, 0x2074 - 0x2079. +- In popup menu: If the only problem is the case of the first character, + don't offer "ignore" and "add to word list". +- Spell menu: When using the Popup menu to select a replacement word, + ":spellrepeat" doesn't work. SpellReplace() uses setline(). Can it use + "z=" somehow? Or use a new function. + + Quickfix/Location List: - Window size is wrong when using quickfix window. (Lifepillar, 2018 Aug 24, #2999) @@ -3217,15 +3133,11 @@ Quickfix/Location List: window is cleared, to avoid going back to the list of errors buffer (would have two windows with it). Can we just remove the jump list entries for the quickfix buffer? -- Quickfix window height is not kept with a vertical split. (Lifepillar, - 2018 Jun 10, #2998) - When an item in the quickfix list has a file name that does not exist, behave like the item was not a match for :cnext. - When adding an item to a new quickfix list make ":cnext" jump to that item. Make a difference being at the first item and not having used :cnext at all. (Afanasiy Fet, 2017 Jan 3) -- This does not work: :set cscopequickfix=a- - (Linewi, 2015 Jul 12, #914) - When opening quickfix window, disable spell checking? - Patch for supporting count before CR in quickfix window. (AOYAMA Shotaro, 2007 Jan 1) @@ -3654,8 +3566,8 @@ Macintosh: 8 'hkmap' should probably be global-local. 8 Using ":s" in a function changes the previous replacement string. Save "old_sub" in save_search_patterns()? -8 Should allow multi-byte characters for the delimiter: ":s+a+b+" where "+" - is a multi-byte character. +8 Should allow multibyte characters for the delimiter: ":s+a+b+" where "+" + is a multibyte character. 8 When appending to a file and 'patchmode' isn't empty, a backup file is always written, even when the original file already exists. 9 When getting focus while writing a large file, could warn for this file @@ -3778,10 +3690,6 @@ Macintosh: on the status line (caused by 'winheight'). Select window on button up, instead of on button down. 8 Dragging the status line doesn't scroll but redraw. -9 Evaluating 'statusline' in build_stl_str_hl() does not properly check for - reaching the end of the available buffer. - Patch to dynamically allocate the buffer for % items. (Eric Arnold, 2006 - May 14) 8 When performing incremental search, should abort searching as soon as a character is typed. 8 When the value of $MAKE contains a path, configure can't handle this. @@ -3810,9 +3718,7 @@ Macintosh: two lines at a time. "k" doesn't do this. (Cory T. Echols) 8 When write_viminfo() is used while there are many orphaned viminfo tempfiles writing the viminfo file fails. Give a clear error message so - that the user knows he has to delete the files. -7 It's possible to redefine a script-local function with ":func - 123_Test()". (Krishna) Disallow this. + that the user knows the files have to be deleted. I can't reproduce these (if you can, let me know how!): @@ -3960,9 +3866,7 @@ Documentation: - change to cursor position and curswant - if it can be undone (u/CTRL-R) and redone (.) - how it works for folded lines - - how it works with multi-byte characters -9 In change.txt, remark about Javadoc isn't right. Right alignment would - work too. + - how it works with multibyte characters 8 Spread the windows commands over the other files. For example, ":stag" should be with ":tag". Cross-link with tags to avoid too much double text. @@ -3983,7 +3887,7 @@ Help: - Support a way to view (and edit) .info files. - Implement a "sticky" help window, some help text lines that are always displayed in a window with fixed height. (Guckes) Use "~/.vimhelp" file, - user can edit it to insert his favorite commands, new account can contain a + user can edit it to insert favorite commands, new account can contain a default contents. - Make 'winminheight' a local option, so that the user can set a minimal height for the help window (and other windows). @@ -4196,8 +4100,8 @@ Multi-byte characters: 8 Add configure option to be able to disable using the iconv library. (Udo Schweigert) 9 'aleph' should be set to 1488 for Unicode. (Zvi Har'El) -8 Should add test for using various commands with multi-byte characters. -8 'infercase' doesn't work with multi-byte characters. +8 Should add test for using various commands with multibyte characters. +8 'infercase' doesn't work with multibyte characters. 8 toupper() function doesn't handle byte count changes. 7 Searching and composing characters: When searching, should order of composing characters be ignored? @@ -4205,7 +4109,7 @@ Multi-byte characters: characters can be manipulated. 8 Should implement 'delcombine' for command line editing. 8 Detect overlong UTF-8 sequences and handle them like illegal bytes. -8 ":s/x/\u\1/" doesn't work, making uppercase isn't done for multi-byte +8 ":s/x/\u\1/" doesn't work, making uppercase isn't done for multibyte characters. 8 UTF-8: "r" in Visual mode doesn't take composing characters. 8 UTF-8: When there is a precomposed character in the font, use it instead @@ -4229,14 +4133,14 @@ Multi-byte characters: convert_input() for Mac GUI. - Add mnemonics from RFC1345 longer than two characters. Support CTRL-K _{mnemonic}_ -- Make 'breakat' accept multi-byte characters. Problem: can't use a lookup +- Make 'breakat' accept multibyte characters. Problem: can't use a lookup table anymore (breakat_flags[]). Simplistic solution: when 'formatoptions' contains "m" also break a line - at a multi-byte character >= 0x100. + at a multibyte character >= 0x100. - Add the possibility to enter mappings which are used whenever normal text could be entered. E.g., for "f" command. But not in Normal mode. Sort of opposite of 'langmap'. Use ":amap" command? -- When breaking a line, take properties of multi-byte characters into +- When breaking a line, take properties of multibyte characters into account. The "linebreak" program from Bruno Haible can do it: ftp://ftp.ilog.fr/pub/Users/haible/gnu/linebreak-0.1.tar.gz But it's very complicated... @@ -5015,6 +4919,23 @@ Omni completion: Insert mode completion/expansion: +- Is it possible to keep the complete menu open when calling complete()? + (Prabir Shrestha, 2017 May 19, #1713) +- When 'completeopt' has "noselect" does not insert a newline. + (Lifepillar, 2017 Apr 23, #1653) +- Can 'completeopt' be made buffer-local? (#5487) +- When complete() first argument is before where insert started and + 'backspace' is Vi compatible, the completion fails. + (Hirohito Higashi, 2015 Feb 19) +- The CompleteDone autocommand needs some info passed to it: + - The word that was selected (empty if abandoned complete) + - Type of completion: tag, omnifunc, user func. +- When a:base in 'completefunc' starts with a number it's passed as a + number, not a string. (Sean Ma) Need to add flag to call_func_retlist() + to force a string value. +- When editing the text and pressing CTRL-N again goes back to originally + completed text, edited text is gone. (Peng Yu, 2008 Jul 24) + Suggestion by Ben Schmidt, 2008 Aug 6. - GUI implementation of the popup menu. 7 When searching in other files the name flash by, too fast to read. Only display a name every second or so, like with ":vimgrep". @@ -5112,6 +5033,10 @@ Command line editing: Command line completion: +- Feature request: Complete members of a dictionary. + (Luc Hermitte, 2017 Jan 4, #1350) +- Completion of ":e" is ":earlier", should be ":edit". Complete to the + matching command instead of doing this alphabetically. (Mikel Jorgensen) 8 Change expand_interactively into a flag that is passed as an argument. 8 With command line completion after '%' and '#', expand current/alternate file name, so it can be edited. Also with modifiers, such as "%:h". @@ -5301,11 +5226,11 @@ Text objects: 8 Add test script for text object commands "aw", "iW", etc. 8 Add text object for part of a CamelHumpedWord and under_scored_word. (Scott Graham) "ac" and "au"? -8 Add a text object for any kind of quoting, also with multi-byte +8 Add a text object for any kind of quoting, also with multibyte characters. Option to specify what quotes are recognized (default: all) use "aq" and "iq". Use 'quotepairs' to define pairs of quotes, like 'matchpairs'? -8 Add text object for any kind of parens, also multi-byte ones. +8 Add text object for any kind of parens, also multibyte ones. 8 Add a way to make an ":omap" for a user-defined text object. Requires changing the starting position in oap->start. 8 Add "gp" and "gP" commands: insert text and make sure there is a single @@ -5419,7 +5344,7 @@ Mappings and Abbreviations: not the . 8 Give a warning when using CTRL-C in the lhs of a mapping. It will never (?) work. -7 Add <0x8f> (hex), <033> (octal) and <123> (decimal) to <> notation? +7 Add <0x8f> (hex), <0o33> (octal) and <123> (decimal) to <> notation? 7 When someone tries to unmap with a trailing space, and it fails, try unmapping without the trailing space. Helps for ":unmap xx | unmap yy". 6 Context-sensitive abbreviations: Specify syntax group(s) in which the @@ -5651,7 +5576,7 @@ Buffer list: Also for other windows: ":inwin {winnr} {cmd}". How to make sure that this works properly for all commands, and still be able to return to the current buffer/window? E.g.: ":inbuf xxx only". -8 Add File.{recent_files} menu entries: Recently edited files. +8 Add File.{recent-files} menu entries: Recently edited files. Ron Aaron has a plugin for this: mru.vim. 8 Unix: Check all uses of fnamecmp() and fnamencmp() if they should check inode too. @@ -5750,7 +5675,7 @@ Modelines: .cpp files. - Support the "abbreviate" command in modelines (Kearns). Careful for characters after , that is a security leak. -- Add option setting to ask user if he wants to have the modelines executed +- Add an option setting to ask the user if the modelines are to be executed or not. Same for .exrc in local dir. @@ -5880,7 +5805,7 @@ Writing files: losing the original when writing twice. (Slootman) 7 On non-Unix machines, also overwrite the original file in some situations (file system full, it's a link on an NFS partition). -7 When editing a file, check that it has been change outside of Vim more +7 When editing a file, check that it has been changed outside of Vim more often, not only when writing over it. E.g., at the time the swap file is flushed. Or every ten seconds or so (use the time of day, check it before waiting for a character to be typed). @@ -6081,7 +6006,7 @@ Various improvements: regexp which triggers auto-formatting (for one line). ":set autoformat=\\s$". - Be able to redefine where a sentence stops. Use a regexp pattern? -- Support multi-byte characters for sentences. Example from Ben Peterson. +- Support multibyte characters for sentences. Example from Ben Peterson. 7 Add command "g)" to go to the end of a sentence, "g(" to go back to the end of a sentence. (Servatius Brandt) - Be able to redefine where a paragraph starts. For "[[" where the '{' is diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt index 542b101a2f8334..fabee453d8c511 100644 --- a/runtime/doc/undo.txt +++ b/runtime/doc/undo.txt @@ -1,4 +1,4 @@ -*undo.txt* For Vim version 8.2. Last change: 2019 Dec 07 +*undo.txt* For Vim version 8.2. Last change: 2020 Nov 30 VIM REFERENCE MANUAL by Bram Moolenaar @@ -65,9 +65,9 @@ with the redo command. If you make a new change after the undo command, the redo will not be possible anymore. 'u' included, the Vi-compatible way: -The undo command undoes the previous change, and also the previous undo command. -The redo command repeats the previous undo command. It does NOT repeat a -change command, use "." for that. +The undo command undoes the previous change, and also the previous undo +command. The redo command repeats the previous undo command. It does NOT +repeat a change command, use "." for that. Examples Vim way Vi-compatible way ~ "uu" two times undo no-op @@ -103,7 +103,7 @@ change again. But you can do something like this: > :undojoin | delete -After this an "u" command will undo the delete command and the previous +After this a "u" command will undo the delete command and the previous change. To do the opposite, break a change into two undo blocks, in Insert mode use @@ -392,7 +392,7 @@ back the text of three deletes ago with '"3P'. *redo-register* If you want to get back more than one part of deleted text, you can use a special feature of the repeat command ".". It will increase the number of the -register used. So if you first do ""1P", the following "." will result in a +register used. So if you first do '"1P', the following "." will result in a '"2P'. Repeating this will result in all numbered registers being inserted. Example: If you deleted text with 'dd....' it can be restored with diff --git a/runtime/doc/usr_03.txt b/runtime/doc/usr_03.txt index 38b36dde17dd7d..d30bddfc622bef 100644 --- a/runtime/doc/usr_03.txt +++ b/runtime/doc/usr_03.txt @@ -1,4 +1,4 @@ -*usr_03.txt* For Vim version 8.2. Last change: 2020 Feb 29 +*usr_03.txt* For Vim version 8.2. Last change: 2020 Sep 03 VIM USER MANUAL - by Bram Moolenaar @@ -30,10 +30,11 @@ Table of contents: |usr_toc.txt| To move the cursor forward one word, use the "w" command. Like most Vim commands, you can use a numeric prefix to move past multiple words. For -example, "3w" moves three words. This figure shows how it works: +example, "3w" moves three words. This figure shows how it works (starting at +the position marked with "x"): This is a line with example text ~ - --->-->->-----------------> + x-->-->->-----------------> w w w 3w Notice that "w" moves to the start of the next word if it already is at the @@ -41,15 +42,15 @@ start of a word. The "b" command moves backward to the start of the previous word: This is a line with example text ~ - <----<--<-<---------<--- + <----<--<-<---------<--x b b b 2b b There is also the "e" command that moves to the next end of a word and "ge", which moves to the previous end of a word: This is a line with example text ~ - <- <--- -----> ----> - ge ge e e + <----<----x---->------------> + 2ge ge e 2e If you are at the last word of a line, the "w" command will take you to the first word in the next line. Thus you can use this to move through a @@ -82,12 +83,12 @@ an key it will do the same thing. The "^" command moves to the first non-blank character of the line. The "0" command (zero) moves to the very first character of the line, and the -key does the same thing. In a picture: +key does the same thing. In a picture ("." indicates a space): ^ - <------------ + <-----------x .....This is a line with example text ~ - <----------------- ---------------> + <----------------x x--------------> 0 $ (the "....." indicates blanks here) diff --git a/runtime/doc/usr_04.txt b/runtime/doc/usr_04.txt index 6a6cbcafad1039..ac629a5982fca7 100644 --- a/runtime/doc/usr_04.txt +++ b/runtime/doc/usr_04.txt @@ -1,4 +1,4 @@ -*usr_04.txt* For Vim version 8.2. Last change: 2019 Nov 21 +*usr_04.txt* For Vim version 8.2. Last change: 2021 Feb 22 VIM USER MANUAL - by Bram Moolenaar @@ -161,7 +161,7 @@ line break. ============================================================================== *04.3* Repeating a change -The "." command is one of the most simple yet powerful commands in Vim. It +The "." command is one of the simplest yet powerful commands in Vim. It repeats the last change. For instance, suppose you are editing an HTML file and want to delete all the tags. You position the cursor on the first < and delete the with the command "df>". You then go to the < of the next @@ -464,9 +464,9 @@ of characters to replace. It will not continue on the next line. You can switch between Insert mode and Replace mode with the key. -When you use (backspace) to make correction, you will notice that the -old text is put back. Thus it works like an undo command for the last typed -character. +When you use (backspace) to make a correction, you will notice that the +old text is put back. Thus it works like an undo command for the previously +typed character. ============================================================================== *04.10* Conclusion diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index 2cfff2449e5d02..3a7438df4cae49 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -58,8 +58,8 @@ This initializes Vim for new users (as opposed to traditional Vi users). See |defaults.vim| for the details. The vimrc file can contain all the commands that you type after a colon. The -most simple ones are for setting options. For example, if you want Vim to -always start with the 'incsearch' option on, add this line your vimrc file: > +simplest ones are for setting options. For example, if you want Vim to always +start with the 'incsearch' option on, add this line your vimrc file: > set incsearch diff --git a/runtime/doc/usr_11.txt b/runtime/doc/usr_11.txt index 430c365cc3b4cb..d26763107d52c3 100644 --- a/runtime/doc/usr_11.txt +++ b/runtime/doc/usr_11.txt @@ -1,4 +1,4 @@ -*usr_11.txt* For Vim version 8.2. Last change: 2020 Jul 08 +*usr_11.txt* For Vim version 8.2. Last change: 2020 Oct 25 VIM USER MANUAL - by Bram Moolenaar @@ -294,7 +294,7 @@ If you really don't want to see this message, you can add the 'A' flag to the 'shortmess' option. But it's very unusual that you need this. For remarks about encryption and the swap file, see |:recover-crypt|. -For programatic access to the swap file, see |swapinfo()|. +For programmatic access to the swap file, see |swapinfo()|. ============================================================================== *11.4* Further reading diff --git a/runtime/doc/usr_20.txt b/runtime/doc/usr_20.txt index f99ffb51c88db4..ebad3c517ffa4e 100644 --- a/runtime/doc/usr_20.txt +++ b/runtime/doc/usr_20.txt @@ -327,10 +327,10 @@ for next. ============================================================================== *20.5* Command line window -Typing the text in the command line works different from typing text in Insert -mode. It doesn't allow many commands to change the text. For most commands -that's OK, but sometimes you have to type a complicated command. That's where -the command line window is useful. +Typing the text in the command line works differently from typing text in +Insert mode. It doesn't allow many commands to change the text. For most +commands that's OK, but sometimes you have to type a complicated command. +That's where the command line window is useful. Open the command line window with this command: > diff --git a/runtime/doc/usr_23.txt b/runtime/doc/usr_23.txt index b124b349de969f..def737c0bf0c1e 100644 --- a/runtime/doc/usr_23.txt +++ b/runtime/doc/usr_23.txt @@ -1,4 +1,4 @@ -*usr_23.txt* For Vim version 8.2. Last change: 2006 Apr 24 +*usr_23.txt* For Vim version 8.2. Last change: 2020 Dec 19 VIM USER MANUAL - by Bram Moolenaar @@ -28,9 +28,9 @@ start a new line. One to move the carriage back to the first position (carriage return, ), another to move the paper up (line feed, ). When computers came out, storage was expensive. Some people decided that they did not need two characters for end-of-line. The UNIX people decided -they could use only for end-of-line. The Apple people -standardized on . The Microsoft Windows folks decided to keep -the old . +they could use or only for end-of-line. The Apple people +standardized on . The Microsoft Windows folks decided to keep the old + (we use for line feed in the help text). This means that if you try to move a file from one system to another, you have line-break problems. The Vim editor automatically recognizes the different file formats and handles things properly behind your back. @@ -55,20 +55,20 @@ which format you have, execute the following command: > The three names that Vim uses are: - unix - dos + unix + dos mac USING THE MAC FORMAT -On Unix, is used to break a line. It's not unusual to have a +On Unix, is used to break a line. It's not unusual to have a character halfway a line. Incidentally, this happens quite often in Vi (and Vim) scripts. On the Macintosh, where is the line break character, it's possible to -have a character halfway a line. +have a character halfway a line. The result is that it's not possible to be 100% sure whether a file -containing both and characters is a Mac or a Unix file. Therefore, +containing both and characters is a Mac or a Unix file. Therefore, Vim assumes that on Unix you probably won't edit a Mac file, and doesn't check for this type of file. To check for this format anyway, add "mac" to 'fileformats': > diff --git a/runtime/doc/usr_27.txt b/runtime/doc/usr_27.txt index 47368441a34f07..fa8fdb6e1145a1 100644 --- a/runtime/doc/usr_27.txt +++ b/runtime/doc/usr_27.txt @@ -434,7 +434,7 @@ redefined without changing the search pattern. /\f\+ -The "\f" items stands for file name characters. Thus this matches a sequence +The "\f" item stands for file name characters. Thus this matches a sequence of characters that can be a file name. Which characters can be part of a file name depends on the system you are using. On MS-Windows, the backslash is included, on Unix it is not. This is diff --git a/runtime/doc/usr_30.txt b/runtime/doc/usr_30.txt index 736323665ed579..bcb7b59e746a02 100644 --- a/runtime/doc/usr_30.txt +++ b/runtime/doc/usr_30.txt @@ -336,7 +336,7 @@ How to do that is explained here: |indent-expression|. ============================================================================== *30.4* Other indenting -The most simple form of automatic indenting is with the 'autoindent' option. +The simplest form of automatic indenting is with the 'autoindent' option. It uses the indent from the previous line. A bit smarter is the 'smartindent' option. This is useful for languages where no indent file is available. 'smartindent' is not as smart as 'cindent', but smarter than 'autoindent'. diff --git a/runtime/doc/usr_31.txt b/runtime/doc/usr_31.txt index 0794b3aa809d25..afbc91877c28d0 100644 --- a/runtime/doc/usr_31.txt +++ b/runtime/doc/usr_31.txt @@ -1,4 +1,4 @@ -*usr_31.txt* For Vim version 8.2. Last change: 2007 May 08 +*usr_31.txt* For Vim version 8.2. Last change: 2020 Jul 28 VIM USER MANUAL - by Bram Moolenaar @@ -198,9 +198,9 @@ is not possible in most terminals. You can start the X-Windows version of gvim with an argument to specify the size and position of the window: > - gvim -geometry {width}x{height}+{x_offset}+{y_offset} + gvim -geometry {width}x{height}+{x-offset}+{y-offset} -{width} and {height} are in characters, {x_offset} and {y_offset} are in +{width} and {height} are in characters, {x-offset} and {y-offset} are in pixels. Example: > gvim -geometry 80x25+100+300 diff --git a/runtime/doc/usr_40.txt b/runtime/doc/usr_40.txt index 85014c27533bfc..21c09b43f881de 100644 --- a/runtime/doc/usr_40.txt +++ b/runtime/doc/usr_40.txt @@ -1,4 +1,4 @@ -*usr_40.txt* For Vim version 8.2. Last change: 2013 Aug 05 +*usr_40.txt* For Vim version 8.2. Last change: 2020 Sep 02 VIM USER MANUAL - by Bram Moolenaar @@ -453,15 +453,15 @@ matching BufWritePre autocommands and executes them, and then it performs the ":write". The general form of the :autocmd command is as follows: > - :autocmd [group] {events} {file_pattern} [nested] {command} + :autocmd [group] {events} {file-pattern} [++nested] {command} The [group] name is optional. It is used in managing and calling the commands (more on this later). The {events} parameter is a list of events (comma separated) that trigger the command. - {file_pattern} is a filename, usually with wildcards. For example, using + {file-pattern} is a filename, usually with wildcards. For example, using "*.txt" makes the autocommand be used for all files whose name end in ".txt". -The optional [nested] flag allows for nesting of autocommands (see below), and -finally, {command} is the command to be executed. +The optional [++nested] flag allows for nesting of autocommands (see below), +and finally, {command} is the command to be executed. EVENTS @@ -489,7 +489,7 @@ See |autocmd-events| for a complete list of events. PATTERNS -The {file_pattern} argument can actually be a comma-separated list of file +The {file-pattern} argument can actually be a comma-separated list of file patterns. For example: "*.c,*.h" matches files ending in ".c" and ".h". The usual file wildcards can be used. Here is a summary of the most often used ones: @@ -578,7 +578,7 @@ trigger any new events. If you read a file in response to a FileChangedShell event, it will not trigger the autocommands that would set the syntax, for example. To make the events triggered, add the "nested" argument: > - :autocmd FileChangedShell * nested edit + :autocmd FileChangedShell * ++nested edit EXECUTING AUTOCOMMANDS diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index bde1dd1ddab2a3..0d17298fb03494 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1,4 +1,4 @@ -*usr_41.txt* For Vim version 8.2. Last change: 2020 Jun 13 +*usr_41.txt* For Vim version 8.2. Last change: 2021 Feb 01 VIM USER MANUAL - by Bram Moolenaar @@ -44,7 +44,7 @@ script file. You can think of other uses yourself. If you are familiar with Python, you can find a comparison between Python and Vim script here, with pointers to other documents: https://gist.github.com/yegappan/16d964a37ead0979b05e655aa036cad0 - And if you are familiar with Javascript: + And if you are familiar with JavaScript: https://w0rp.com/blog/post/vim-script-for-the-javascripter/ Let's start with a simple example: > @@ -122,14 +122,14 @@ starts with a zero. "017" is decimal 15. A binary number starts with "0b" or decimal number, it will be interpreted as an octal number! The ":echo" command always prints decimal numbers. Example: > - :echo 0x7f 036 + :echo 0x7f 0o36 < 127 30 ~ A number is made negative with a minus sign. This also works for hexadecimal, octal and binary numbers. A minus sign is also used for subtraction. Compare this with the previous example: > - :echo 0x7f -036 + :echo 0x7f -0o36 < 97 ~ White space in an expression is ignored. However, it's recommended to use it @@ -137,7 +137,7 @@ for separating items, to make the expression easier to read. For example, to avoid the confusion with a negative number above, put a space between the minus sign and the following number: > - :echo 0x7f - 036 + :echo 0x7f - 0o36 ============================================================================== *41.2* Variables @@ -327,9 +327,9 @@ Grouping is done with parentheses. No surprises here. Example: > :echo (10 + 5) * 2 < 30 ~ -Strings can be concatenated with ".". Example: > +Strings can be concatenated with ".." (see |expr6|). Example: > - :echo "foo" . "bar" + :echo "foo" .. "bar" < foobar ~ When the ":echo" command gets multiple arguments, it separates them with a @@ -496,9 +496,9 @@ So far the commands in the script were executed by Vim directly. The very powerful way to build commands and execute them. An example is to jump to a tag, which is contained in a variable: > - :execute "tag " . tag_name + :execute "tag " .. tag_name -The "." is used to concatenate the string "tag " with the value of variable +The ".." is used to concatenate the string "tag " with the value of variable "tag_name". Suppose "tag_name" has the value "get_cmd", then the command that will be executed is: > @@ -514,7 +514,7 @@ This jumps to the first line and formats all lines with the "=" operator. To make ":normal" work with an expression, combine ":execute" with it. Example: > - :execute "normal " . normal_commands + :execute "normal " .. normal_commands The variable "normal_commands" must contain the Normal mode commands. Make sure that the argument for ":normal" is a complete command. Otherwise @@ -531,12 +531,12 @@ If you don't want to execute a string but evaluate it to get its expression value, you can use the eval() function: > :let optname = "path" - :let optval = eval('&' . optname) + :let optval = eval('&' .. optname) A "&" character is prepended to "path", thus the argument to eval() is "&path". The result will then be the value of the 'path' option. The same thing can be done with: > - :exe 'let optval = &' . optname + :exe 'let optval = &' .. optname ============================================================================== *41.6* Using functions @@ -600,32 +600,41 @@ String manipulation: *string-functions* strtrans() translate a string to make it printable tolower() turn a string to lowercase toupper() turn a string to uppercase + charclass() class of a character match() position where a pattern matches 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 matchstrpos() match and positions of a pattern in a string matchlist() like matchstr() and also return submatches stridx() first index of a short string in a long string strridx() last index of a short string in a long string strlen() length of a string in bytes - strchars() length of a string in characters + strcharlen() length of a string in characters + strchars() number of characters in a string strwidth() size of string when displayed strdisplaywidth() size of string when displayed, deals with tabs + setcellwidths() set character cell width overrides substitute() substitute a pattern match with a string submatch() get a specific match in ":s" and substitute() strpart() get part of a string using byte index strcharpart() get part of a string using char index + slice() take a slice of a string, using char index in + Vim9 script strgetchar() get character from a string using char index expand() expand special keywords expandcmd() expand a command like done for `:edit` iconv() convert text from one encoding to another byteidx() byte index of a character in a string byteidxcomp() like byteidx() but count composing characters + charidx() character index of a byte in a string repeat() repeat a string multiple times eval() evaluate a string expression execute() execute an Ex command and get the output win_execute() like execute() but in a specified window trim() trim characters from a string + gettext() lookup message translation List manipulation: *list-functions* get() get an item without error for wrong index @@ -634,12 +643,15 @@ List manipulation: *list-functions* insert() insert an item somewhere in a List add() append an item to a List extend() append a List to a List + extendnew() make a new List and append items remove() remove one or more items from a List copy() make a shallow copy of a List deepcopy() make a full copy of a List filter() remove selected items from a List map() change each List item + mapnew() make a new List with changed items reduce() reduce a List to a value + slice() take a slice of a List sort() sort a List reverse() reverse the order of a List uniq() remove copies of repeated adjacent items @@ -654,6 +666,7 @@ List manipulation: *list-functions* 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 Dictionary manipulation: *dict-functions* get() get an entry without an error for a wrong key @@ -662,8 +675,10 @@ Dictionary manipulation: *dict-functions* empty() check if Dictionary is empty remove() remove an entry from a Dictionary extend() add entries from one Dictionary to another + extendnew() make a new Dictionary and append items filter() remove selected entries from a Dictionary map() change each Dictionary entry + mapnew() make a new Dictionary with changed items keys() get List of Dictionary keys values() get List of Dictionary values items() get List of Dictionary key-value pairs @@ -710,7 +725,8 @@ Other computation: *bitwise-function* srand() initialize seed used by rand() Variables: *var-functions* - type() type of a variable + type() type of a variable as a number + typename() type of a variable as text islocked() check if a variable is locked funcref() get a Funcref for a function reference function() get a Funcref for a function name @@ -745,6 +761,11 @@ Cursor and mark position: *cursor-functions* *mark-functions* screenchar() get character code at a screen line/row screenchars() get character codes at a screen line/row screenstring() get string of characters at a screen line/row + charcol() character number of the cursor or a mark + getcharpos() get character position of cursor, mark, etc. + setcharpos() set character position of cursor, mark, etc. + getcursorcharpos() get character position of the cursor + setcursorcharpos() set character position of the cursor Working with text in the current buffer: *text-functions* getline() get a line or list of lines from the buffer @@ -804,6 +825,7 @@ System functions and manipulation of files: setenv() set an environment variable hostname() name of the system readfile() read a file into a List of lines + readblob() read a file into a Blob readdir() get a List of file names in a directory readdirex() get a List of file information in a directory writefile() write a List of lines or Blob into a file @@ -862,6 +884,7 @@ Command line: *command-line-functions* getcmdtype() return the current command-line type getcmdwintype() return the current command-line window type getcompletion() list of command-line completion matches + fullcommand() get full command name Quickfix and location lists: *quickfix-functions* getqflist() list of quickfix errors @@ -1115,6 +1138,7 @@ Tags: *tag-functions* settagstack() modify the tag stack of a window Prompt Buffer: *promptbuffer-functions* + prompt_getprompt() get the effective prompt text for a buffer prompt_setcallback() set prompt callback for a buffer prompt_setinterrupt() set interrupt callback for a buffer prompt_setprompt() set the prompt text for a buffer @@ -1284,7 +1308,7 @@ Example: > : let n = n + len(split(getline(lnum))) : let lnum = lnum + 1 : endwhile - : echo "found " . n . " words" + : echo "found " .. n .. " words" :endfunction You can call this function with: > @@ -1297,7 +1321,7 @@ It will be executed once and echo the number of words. range, with the cursor in that line. Example: > :function Number() - : echo "line " . line(".") . " contains: " . getline(".") + : echo "line " .. line(".") .. " contains: " .. getline(".") :endfunction If you call this function with: > @@ -1321,11 +1345,11 @@ so on. The variable "a:0" contains the number of extra arguments. :function Show(start, ...) : echohl Title - : echo "start is " . a:start + : echo "start is " .. a:start : echohl None : let index = 1 : while index <= a:0 - : echo " Arg " . index . " is " . a:{index} + : echo " Arg " .. index .. " is " .. a:{index} : let index = index + 1 : endwhile : echo "" @@ -1733,10 +1757,10 @@ Another useful mechanism is the ":finally" command: > :let tmp = tempname() :try - : exe ".,$write " . tmp - : exe "!filter " . tmp + : exe ".,$write " .. tmp + : exe "!filter " .. tmp : .,$delete - : exe "$read " . tmp + : exe "$read " .. tmp :finally : call delete(tmp) :endtry @@ -1757,7 +1781,7 @@ Here is a summary of items that apply to Vim scripts. They are also mentioned elsewhere, but form a nice checklist. The end-of-line character depends on the system. For Unix a single -character is used. For MS-Windows and the like, is used. This is +character is used. For MS-Windows and the like, is used. This is important when using mappings that end in a . See |:source_crnl|. @@ -2044,9 +2068,9 @@ for this mapping, but the user might already use it for something else. To allow the user to define which keys a mapping in a plugin uses, the item can be used: > - 22 map a TypecorrAdd + 22 map a TypecorrAdd; -The "TypecorrAdd" thing will do the work, more about that further on. +The "TypecorrAdd;" thing will do the work, more about that further on. The user can set the "mapleader" variable to the key sequence that he wants this mapping to start with. Thus if the user has done: > @@ -2062,15 +2086,15 @@ already happened to exist. |:map-| But what if the user wants to define his own key sequence? We can allow that with this mechanism: > - 21 if !hasmapto('TypecorrAdd') - 22 map a TypecorrAdd + 21 if !hasmapto('TypecorrAdd;') + 22 map a TypecorrAdd; 23 endif -This checks if a mapping to "TypecorrAdd" already exists, and only +This checks if a mapping to "TypecorrAdd;" already exists, and only defines the mapping from "a" if it doesn't. The user then has a chance of putting this in his vimrc file: > - map ,c TypecorrAdd + map ,c TypecorrAdd; Then the mapped key sequence will be ",c" instead of "_a" or "\a". @@ -2087,8 +2111,8 @@ prepending it with "s:". We will define a function that adds a new typing correction: > 30 function s:Add(from, correct) - 31 let to = input("type the correction for " . a:from . ": ") - 32 exe ":iabbrev " . a:from . " " . to + 31 let to = input("type the correction for " .. a:from .. ": ") + 32 exe ":iabbrev " .. a:from .. " " .. to .. 36 endfunction @@ -2100,15 +2124,15 @@ function (without the "s:"), which is again another function. can be used with mappings. It generates a script ID, which identifies the current script. In our typing correction plugin we use it like this: > - 24 noremap