mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
235 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bb85affbcb | |||
| 39b2417ca7 | |||
| 4c5bd966f4 | |||
| b200f56497 | |||
| af215e42ec | |||
| 8aa089ee36 | |||
| 3d73af4401 | |||
| 784b26c931 | |||
| ecb41ac7e3 | |||
| 1adcde6f68 | |||
| e910841ee7 | |||
| 96952b2e98 | |||
| c290009e99 | |||
| 8079917447 | |||
| c368ebbf35 | |||
| 5a33ce2a66 | |||
| 6e6386716f | |||
| 2e3cd52fa0 | |||
| f3eac695bf | |||
| 209ec90b9b | |||
| 396058acd0 | |||
| 8f4fb007e4 | |||
| aff7a2f6dd | |||
| 5a679b2263 | |||
| 215c3261a2 | |||
| dbf749bd5a | |||
| 35f8af5126 | |||
| f5a94d5165 | |||
| 3c81f47a05 | |||
| d7ae263af8 | |||
| 47510f3d65 | |||
| 1ace49fb98 | |||
| 5d03525cde | |||
| de3295dd0c | |||
| 8406cbcfea | |||
| 95277c3842 | |||
| ae3cfa47d3 | |||
| 989426be6e | |||
| bd734c3bea | |||
| ba9aed4497 | |||
| b583eda703 | |||
| cd6ee69358 | |||
| 5ae6f9985e | |||
| 7687238e1b | |||
| 0f058d1320 | |||
| 2bbd0d30ee | |||
| 29bb67f1be | |||
| bc51f5edc0 | |||
| 881463f0d4 | |||
| 76cc4e261b | |||
| e9167c29db | |||
| 0621cddc85 | |||
| 30afcb74cd | |||
| 69fb5afb3b | |||
| dd75fcfbdf | |||
| 1ea428883f | |||
| 4c8da025ef | |||
| c97b3febc8 | |||
| a634b92b96 | |||
| f8da324619 | |||
| 4a82bdfaa8 | |||
| 41e6f7d6ba | |||
| 3803c15896 | |||
| e8e3946077 | |||
| 57b0bab104 | |||
| 5f0509afa1 | |||
| 54844857fd | |||
| b07b9dc4da | |||
| e467189022 | |||
| f4ee1cb74b | |||
| b56cef0be0 | |||
| d4afbdd071 | |||
| 7879bc5c13 | |||
| 1e33cd72b6 | |||
| b852305dbf | |||
| 75b277d35c | |||
| 9771b2a67f | |||
| 1087b8c29a | |||
| 2a281ccca0 | |||
| e6c9aa5e6a | |||
| 85f4521808 | |||
| 580c1fcb4a | |||
| 27e12c7669 | |||
| fa145f2009 | |||
| 26e8f7b0ab | |||
| a991ce9c08 | |||
| 5098093a67 | |||
| 772df7adc1 | |||
| 42f62db3e7 | |||
| ac9c6d5c78 | |||
| 9960ebcace | |||
| 20d161ace3 | |||
| 290b887e8c | |||
| ea746f9e86 | |||
| 0e95841004 | |||
| f449825ae2 | |||
| 9b259f520e | |||
| d615a3122a | |||
| d2f4800099 | |||
| da5da654de | |||
| c661e11e9c | |||
| b5a0719cb7 | |||
| b6d01f131c | |||
| 9a00e7c7cf | |||
| efd97fddd3 | |||
| 930933f90d | |||
| 85ff0c1912 | |||
| 8e5f26ec6a | |||
| 4dbb2669e9 | |||
| 64885645e7 | |||
| 0583491277 | |||
| 119fdd9293 | |||
| 317468aace | |||
| 3d90f71b76 | |||
| fe7b20a1a3 | |||
| b9a974df9e | |||
| b74ebfc6bf | |||
| b043ff34c1 | |||
| c88f768482 | |||
| 2dfc22908e | |||
| 3f168ec8ae | |||
| 993b17569b | |||
| 12a0d999b1 | |||
| cd39b69b02 | |||
| 20f48d5b2d | |||
| ba77bbb5c7 | |||
| b32064fedb | |||
| 6d11347260 | |||
| 4a1ad55564 | |||
| f59cbefd0a | |||
| 7086b3e76a | |||
| 3bd7fa12e1 | |||
| 6ee7b521fa | |||
| 7ece036d72 | |||
| e379e21ddc | |||
| 8c358e024f | |||
| a4dfbfed89 | |||
| 6de4e58cf2 | |||
| e085dfda5d | |||
| 1f025b01e2 | |||
| f7f746b167 | |||
| 9084c14c89 | |||
| d3c1eb5e40 | |||
| d41f3454e3 | |||
| c83901abdf | |||
| f3b68d4759 | |||
| 900894b09a | |||
| 3695d0e41b | |||
| 28a23602e8 | |||
| ee865f37ac | |||
| 112431f217 | |||
| 789b8854d2 | |||
| 5a05d374d3 | |||
| 02902b547b | |||
| b90e3bc491 | |||
| 413f83990f | |||
| f057aca1cc | |||
| db38552dcd | |||
| 03ca4002c1 | |||
| e845b38dab | |||
| 9eb1ce5315 | |||
| 2dede3dbfa | |||
| 5277cfaf8a | |||
| 54f70cf078 | |||
| 02774f99ce | |||
| 3474594239 | |||
| a76fbe6e00 | |||
| 91adcbdcc1 | |||
| f109bf93c9 | |||
| c1946267f2 | |||
| 54e1f56cf2 | |||
| 4c7c622e73 | |||
| 3aa114463f | |||
| e1b95f5252 | |||
| ec8deb092c | |||
| b80ae6cec3 | |||
| ceffca683b | |||
| c3b315f496 | |||
| abc808112e | |||
| 46a0582ffa | |||
| e6fca0e822 | |||
| 7fe8f43f49 | |||
| 46bdae036a | |||
| edcba96c00 | |||
| 7398f367d5 | |||
| 960822a11f | |||
| 7c948644fb | |||
| 790f9a890c | |||
| ca0ffc0d63 | |||
| 8ffcb47a43 | |||
| 4927bc7d27 | |||
| 99c3849a92 | |||
| b895b0fabc | |||
| ceee7a808c | |||
| 696270bcae | |||
| 02c51b1dd8 | |||
| 1926ae4184 | |||
| db54e989b5 | |||
| a7aba6ca50 | |||
| 78c5a5abc6 | |||
| 87018255e3 | |||
| 98e68c07ce | |||
| 03cd697d63 | |||
| 5790a54166 | |||
| d606fccf6f | |||
| aa64ba1587 | |||
| 476733f3d0 | |||
| 1db1514365 | |||
| 2ce070c27a | |||
| 6f00d17e8d | |||
| 3da696db6a | |||
| 346ac1429c | |||
| 063c562a37 | |||
| 00cd18222e | |||
| d25021cf03 | |||
| d8b86c937a | |||
| e30d8e4ce0 | |||
| 6b5efcdd8e | |||
| 92d9ee5f4c | |||
| 0483e49f90 | |||
| e6059c321b | |||
| 177437cc6f | |||
| a66feb5fb5 | |||
| 249a208803 | |||
| e2deb7e598 | |||
| ad29f6af0a | |||
| e7d79eb98a | |||
| ffb13674d1 | |||
| c30a90d9b2 | |||
| 35928ee8f8 | |||
| c1f8bb37c6 | |||
| 6ffcc58be3 | |||
| 8b2457a381 | |||
| fc93594d56 | |||
| f5356bf675 |
@@ -29,7 +29,6 @@ environment:
|
||||
# disabled
|
||||
# - FEATURE: TINY
|
||||
# - FEATURE: NORMAL
|
||||
# - FEATURE: BIG
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
-22
@@ -8,9 +8,6 @@ freebsd_task:
|
||||
- name: FreeBSD 14.0
|
||||
freebsd_instance:
|
||||
image_family: freebsd-14-0
|
||||
- name: FreeBSD 13.1
|
||||
freebsd_instance:
|
||||
image_family: freebsd-13-1
|
||||
timeout_in: 20m
|
||||
install_script:
|
||||
- pkg install -y gettext
|
||||
@@ -24,22 +21,3 @@ freebsd_task:
|
||||
- pw useradd cirrus -m
|
||||
- chown -R cirrus:cirrus .
|
||||
- sudo -u cirrus make test
|
||||
|
||||
macos_task:
|
||||
name: macOS m1
|
||||
macos_instance:
|
||||
image: ghcr.io/cirruslabs/macos-ventura-xcode:latest
|
||||
env:
|
||||
# only run with clang, gcc is not real, it is a link to clang
|
||||
CC: clang
|
||||
timeout_in: 20m
|
||||
install_script:
|
||||
- brew update
|
||||
- brew install gettext libtool diffutils
|
||||
build_script:
|
||||
- NPROC=$(getconf _NPROCESSORS_ONLN)
|
||||
- ./configure --with-features=${FEATURES}
|
||||
- make -j${NPROC}
|
||||
test_script:
|
||||
- src/vim --version
|
||||
- make test
|
||||
|
||||
@@ -5,6 +5,8 @@ coverage:
|
||||
default:
|
||||
threshold: 0.05%
|
||||
|
||||
comment: false
|
||||
|
||||
# Files not run by tests
|
||||
ignore:
|
||||
- "src/dosinst.c"
|
||||
|
||||
@@ -166,6 +166,7 @@ runtime/ftplugin/javascriptreact.vim @dkearns
|
||||
runtime/ftplugin/jsonc.vim @izhakjakov
|
||||
runtime/ftplugin/julia.vim @carlobaldassi
|
||||
runtime/ftplugin/kconfig.vim @chrisbra
|
||||
runtime/ftplugin/kotlin.vim @udalov
|
||||
runtime/ftplugin/less.vim @genoma
|
||||
runtime/ftplugin/liquid.vim @tpope
|
||||
runtime/ftplugin/lua.vim @dkearns
|
||||
@@ -194,7 +195,7 @@ runtime/ftplugin/ps1xml.vim @heaths
|
||||
runtime/ftplugin/pymanifest.vim @ObserverOfTime
|
||||
runtime/ftplugin/python.vim @tpict
|
||||
runtime/ftplugin/qb64.vim @dkearns
|
||||
runtime/ftplugin/qml.vim @ChaseKnowlden
|
||||
runtime/ftplugin/qml.vim @ChaseKnowlden
|
||||
runtime/ftplugin/r.vim @jalvesaq
|
||||
runtime/ftplugin/racket.vim @benknoble
|
||||
runtime/ftplugin/readline.vim @dkearns
|
||||
@@ -271,6 +272,7 @@ runtime/indent/javascript.vim @bounceme
|
||||
runtime/indent/json.vim @elzr
|
||||
runtime/indent/jsonc.vim @izhakjakov
|
||||
runtime/indent/julia.vim @carlobaldassi
|
||||
runtime/indent/kotlin.vim @udalov
|
||||
runtime/indent/krl.vim @KnoP-01
|
||||
runtime/indent/ld.vim @dkearns
|
||||
runtime/indent/less.vim @genoma
|
||||
@@ -288,7 +290,7 @@ runtime/indent/postscr.vim @mrdubya
|
||||
runtime/indent/prolog.vim @dkearns
|
||||
runtime/indent/ps1.vim @heaths
|
||||
runtime/indent/qb64.vim @dkearns
|
||||
runtime/indent/qml.vim @ChaseKnowlden
|
||||
runtime/indent/qml.vim @ChaseKnowlden
|
||||
runtime/indent/r.vim @jalvesaq
|
||||
runtime/indent/racket.vim @benknoble
|
||||
runtime/indent/rapid.vim @KnoP-01
|
||||
@@ -325,7 +327,7 @@ runtime/plugin/tarPlugin.vim @cecamp
|
||||
runtime/plugin/vimballPlugin.vim @cecamp
|
||||
runtime/plugin/zipPlugin.vim @cecamp
|
||||
runtime/plugin/manpager.vim @Konfekt
|
||||
runtime/syntax/shared/hgcommitDiff.vim @vegerot
|
||||
runtime/syntax/shared/hgcommitDiff.vim @vegerot
|
||||
runtime/syntax/abaqus.vim @costerwi
|
||||
runtime/syntax/aidl.vim @dpelle
|
||||
runtime/syntax/amiga.vim @cecamp
|
||||
@@ -408,6 +410,7 @@ runtime/syntax/javascript.vim @fleiner
|
||||
runtime/syntax/jsonc.vim @izhakjakov
|
||||
runtime/syntax/julia.vim @carlobaldassi
|
||||
runtime/syntax/kconfig.vim @chrisbra
|
||||
runtime/syntax/kotlin.vim @udalov
|
||||
runtime/syntax/krl.vim @KnoP-01
|
||||
runtime/syntax/less.vim @genoma
|
||||
runtime/syntax/lex.vim @cecamp
|
||||
@@ -450,7 +453,7 @@ runtime/syntax/ps1xml.vim @heaths
|
||||
runtime/syntax/psl.vim @danielkho
|
||||
runtime/syntax/pymanifest.vim @ObserverOfTime
|
||||
runtime/syntax/qb64.vim @dkearns
|
||||
runtime/syntax/qml.vim @ChaseKnowlden
|
||||
runtime/syntax/qml.vim @ChaseKnowlden
|
||||
runtime/syntax/r.vim @jalvesaq
|
||||
runtime/syntax/racket.vim @benknoble
|
||||
runtime/syntax/raml.vim @in3d
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
name: Universal package
|
||||
description: Create universal Homebrew package which contains x86_64 and arm64
|
||||
|
||||
# Instead of using the default binary installed by Homebrew, we need to build our own because third-party libraries are
|
||||
# statically linked in MacVim, and need to be built against MACOSX_DEPLOYMENT_TARGET to ensure the built binary will
|
||||
# work on supported macOS versions. Another reason for building our own custom package is to build a unviersal binary
|
||||
# that has both x86_64 and arm64 arch, as Homebrew's distributed bottles are thin binaries with only one arch.
|
||||
#
|
||||
# We still use Homebrew to manage the library because their formulas are up to date and have correct build instructions
|
||||
# that will work. This way we don't have to manually configuring and building and updating the package info.
|
||||
|
||||
inputs:
|
||||
formula:
|
||||
description: Formura name
|
||||
@@ -18,9 +27,18 @@ runs:
|
||||
set -o pipefail
|
||||
formula=${{ inputs.formula }}
|
||||
|
||||
# Patch the official Homebrew formula to explicitly build for min deployment target
|
||||
# Need to make sure we get the latest before patching. Otherwise Homebrew may later try to get the latest
|
||||
# version and stomp what we have here.
|
||||
brew update
|
||||
|
||||
# Patch the official Homebrew formula to explicitly build for min deployment target and a universal binary. We
|
||||
# also need to explicitly use system Clang because Homebrew's bundled clang script tries to inject -march
|
||||
# compiler flags that will cause universal builds to fail as Clang does not like that.
|
||||
brew cat ${formula} | \
|
||||
sed '/^[[:blank:]]*def install$/a\'$'\n ENV["MACOSX_DEPLOYMENT_TARGET"] = "'${MACOSX_DEPLOYMENT_TARGET}$'"\n' >${formula}.rb
|
||||
sed '/^[[:blank:]]*def install$/a\'$'\n ENV["MACOSX_DEPLOYMENT_TARGET"] = "'${MACOSX_DEPLOYMENT_TARGET}$'"\n' | \
|
||||
sed '/^[[:blank:]]*def install$/a\'$'\n ENV["CC"] = "/usr/bin/clang"\n' | \
|
||||
sed '/^[[:blank:]]*def install$/a\'$'\n ENV["CFLAGS"] = "-arch x86_64 -arch arm64"\n' | \
|
||||
sed '/^[[:blank:]]*def install$/a\'$'\n ENV["LDFLAGS"] = "-arch x86_64 -arch arm64"\n' >${formula}.rb
|
||||
|
||||
# Uninstall the already installed formula because we want to build our own
|
||||
brew uninstall --ignore-dependencies ${formula} || true
|
||||
@@ -36,7 +54,7 @@ runs:
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /usr/local/Cellar/${{ inputs.formula }}
|
||||
key: ${{ inputs.formula }}-homebrew-cache-patched-unified-xcode${{ steps.setup-formula.outputs.xcode_version }}-${{ hashFiles(format('{0}.rb', inputs.formula)) }}
|
||||
key: ${{ inputs.formula }}-homebrew-cache-custom-unified-xcode${{ steps.setup-formula.outputs.xcode_version }}-${{ hashFiles(format('{0}.rb', inputs.formula)) }}
|
||||
|
||||
- name: Install formula
|
||||
shell: bash
|
||||
@@ -51,38 +69,16 @@ runs:
|
||||
brew unlink ${formula} && brew link ${formula}
|
||||
echo '::endgroup::'
|
||||
|
||||
- name: Create universal binaries with arm64 bottle
|
||||
if: steps.cache-keg.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
echo '::group::Create universal binaries with arm64 bottle'
|
||||
set -o verbose
|
||||
formula=${{ inputs.formula }}
|
||||
echo '::group::Verify built version'
|
||||
contents=($(IFS=,; for x in ${{ inputs.contents }}; do echo ${x}; done))
|
||||
|
||||
# Manually download and extract a bottle for arm64
|
||||
source /dev/stdin <<<"$(brew info --json ${formula} | \
|
||||
jq -r '.[0] | "bottle_url=\(.bottle.stable.files.arm64_big_sur.url)", "formula_ver=\(.versions.stable)", "formula_rev=\(.revision)"')"
|
||||
if [[ ${formula_rev} -ne 0 ]]; then
|
||||
formula_ver=${formula_ver}_${formula_rev}
|
||||
fi
|
||||
|
||||
workdir=${formula}_download
|
||||
mkdir ${workdir}
|
||||
cd ${workdir}
|
||||
wget --no-verbose --header 'Authorization: Bearer QQ==' -O ${formula}.tar.gz ${bottle_url}
|
||||
tar xf ${formula}.tar.gz
|
||||
|
||||
for content in "${contents[@]}"; do
|
||||
# Just for diagnostics, print out the old archs. This should be a thin binary (x86_64)
|
||||
lipo -info /usr/local/${content}
|
||||
|
||||
# Create a universal binary by patching the custom built x86_64 one with the downloaded arm64 one.
|
||||
# Modify the actual binaries in /usr/local/Cellar instead of the symlinks to allow caching to work.
|
||||
lipo -create -output /usr/local/Cellar/${formula}/${formula_ver}/${content} \
|
||||
/usr/local/Cellar/${formula}/${formula_ver}/${content} ./${formula}/${formula_ver}/${content}
|
||||
|
||||
# Print out the new archs and verify they are universal with 2 archs.
|
||||
# Print out the archs and verify they are universal fat binary.
|
||||
lipo -info /usr/local/${content} | grep 'x86_64 arm64'
|
||||
|
||||
# Make sure deployment target is correct. Later macOS versions have a different binary format (just search for
|
||||
# "minos") but for 10.13 we need to look for LC_VERSION_MIN_MACOSX.
|
||||
otool -l /usr/local/${content} | grep -A 2 LC_VERSION_MIN_MACOSX | tail -1 | grep "${MACOSX_DEPLOYMENT_TARGET}"
|
||||
done
|
||||
|
||||
echo '::endgroup::'
|
||||
|
||||
+1
-1
@@ -55,6 +55,6 @@ runtime:
|
||||
|
||||
termdebug: runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
|
||||
|
||||
netrw:
|
||||
plugin-netrw:
|
||||
- any: ['runtime/plugin/netrwPlugin.vim']
|
||||
- any: ['runtime/autoload/netrw*']
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# Customize GitHub release notes generation. This is only used for pre-release builds for now as
|
||||
# main releases have hand-written release notes.
|
||||
changelog:
|
||||
exclude:
|
||||
labels:
|
||||
- dependencies
|
||||
- Non User Facing
|
||||
@@ -20,18 +20,21 @@ env:
|
||||
|
||||
CC: clang
|
||||
|
||||
MAKE_BUILD_ARGS: LINK_AS_NEEDED=yes # In macOS we never over-specify link dependencies and we already check against external deps in smoketest. With LTO, linking takes a while, so we want to avoid using link.sh.
|
||||
|
||||
VERSIONER_PERL_VERSION: '5.30' # macOS default Perl installation uses this to determine which one to use
|
||||
|
||||
vi_cv_path_python: /usr/local/bin/python
|
||||
vi_cv_path_python: /Library/Frameworks/Python.framework/Versions/2.7/bin/python
|
||||
vi_cv_path_python3: /usr/local/bin/python3
|
||||
vi_cv_path_plain_lua: /usr/local/bin/lua
|
||||
vi_cv_path_ruby: /usr/local/opt/ruby/bin/ruby
|
||||
vi_cv_dll_name_perl: /System/Library/Perl/%s/darwin-thread-multi-2level/CORE/libperl.dylib
|
||||
vi_cv_dll_name_python: /usr/local/Frameworks/Python.framework/Versions/2.7/Python
|
||||
vi_cv_dll_name_python: /Library/Frameworks/Python.framework/Versions/2.7/Python
|
||||
vi_cv_dll_name_python3: /usr/local/Frameworks/Python.framework/Versions/Current/Python
|
||||
vi_cv_dll_name_python3_arm64: /opt/homebrew/Frameworks/Python.framework/Versions/Current/Python
|
||||
vi_cv_dll_name_ruby: /usr/local/opt/ruby/lib/libruby.dylib
|
||||
vi_cv_dll_name_ruby_arm64: /opt/homebrew/opt/ruby/lib/libruby.dylib
|
||||
vi_cv_dll_name_lua: /usr/local/lib/liblua.dylib
|
||||
vi_cv_dll_name_lua_arm64: /opt/homebrew/lib/liblua.dylib
|
||||
|
||||
MACVIM_APP: src/MacVim/build/Release/MacVim.app
|
||||
@@ -63,8 +66,8 @@ jobs:
|
||||
publish_postfix: '_10.9'
|
||||
|
||||
# Most up to date OS and Xcode. Used to publish release for the main build.
|
||||
- os: macos-12
|
||||
xcode: '14.2'
|
||||
- os: macos-13
|
||||
xcode: '15.0'
|
||||
publish: true
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
@@ -93,17 +96,6 @@ jobs:
|
||||
|
||||
# Set up, install, and cache gettext library for localization.
|
||||
#
|
||||
# Instead of using the default binary installed by Homebrew, need to build our own because gettext is statically
|
||||
# linked in MacVim, and need to be built against MACOSX_DEPLOYMENT_TARGET to ensure the built binary will work on
|
||||
# supported macOS versions.
|
||||
#
|
||||
# In addition, to support building a universal MacVim, we need an arm64 version of gettext as well in order to
|
||||
# create a universal gettext binary to link against (Homebrew only distributes thin binaries and therefore this
|
||||
# has to be done manually). To do that, we will just pull the bottle directly from Homebrew and patch it in using
|
||||
# lipo. We can't use normal brew commands to get the bottle because brew doesn't natively support cross-compiling
|
||||
# and we are running CI on x86_64 Macs. We also don't need to worry about the min deployment target fix on arm64
|
||||
# because all Apple Silicon Macs have to run on macOS 11+.
|
||||
|
||||
- name: Set up gettext
|
||||
if: matrix.publish
|
||||
uses: ./.github/actions/universal-package
|
||||
@@ -125,16 +117,13 @@ jobs:
|
||||
- name: Install packages
|
||||
if: matrix.publish
|
||||
run: |
|
||||
brew install python3
|
||||
# We no longer need to install/update Python 3, as it's guaranteed to
|
||||
# be installed on runners. Since we use stable ABI, the exact version
|
||||
# on CI does not matter.
|
||||
|
||||
brew install ruby
|
||||
brew install lua
|
||||
|
||||
# CI sometimes have custom installed Python instead of using Homebrew. Forcefully re-
|
||||
# link Python, and then check that we are using the Homebrew version. This avoids us
|
||||
# using a mystery Python installation that we don't control.
|
||||
brew unlink python3 && brew link --overwrite python3
|
||||
readlink -f $vi_cv_path_python3 | grep "^$(brew --cellar python3)"
|
||||
|
||||
if [[ -d /usr/local/Cellar/perl ]]; then
|
||||
# We just use system perl to reduce dependencies
|
||||
brew unlink perl
|
||||
@@ -143,6 +132,17 @@ jobs:
|
||||
# With Perl, we need to manually specify the version number because the dylib path depends on it.
|
||||
echo "vi_cv_dll_name_perl=$(printf $vi_cv_dll_name_perl $VERSIONER_PERL_VERSION)" >> $GITHUB_ENV
|
||||
|
||||
# New runner images (macos-13) no longer have Python2 installed. We
|
||||
# need to install Python2 manually. Installing from the official
|
||||
# installer is the easiest way as Homebrew no longer ships python@2
|
||||
# and this way does not invole manual building from source. We
|
||||
# mostly only need the headers to build a dynamic build anyway.
|
||||
#
|
||||
# This will be removed in the future as Python2 has been completely
|
||||
# unsupported for years.
|
||||
curl https://www.python.org/ftp/python/2.7.18/python-2.7.18-macosx10.9.pkg -o ~/Downloads/python-2.7.18-macosx10.9.pkg
|
||||
sudo installer -pkg ~/Downloads/python-2.7.18-macosx10.9.pkg -target /
|
||||
|
||||
# All set up steps are done. Build and test MacVim below.
|
||||
|
||||
- name: Configure
|
||||
@@ -188,6 +188,13 @@ jobs:
|
||||
sed -i.bak -f ci/config.mk.clang-12.sed src/auto/config.mk
|
||||
fi
|
||||
|
||||
if ${{ matrix.publish == true && ! matrix.legacy }}; then
|
||||
# Only do O3/link-time optimizations for publish builds, so the other ones can still finish quickly to give
|
||||
# quick feedbacks. Only do this for non-legacy builds now as it seems the older toolchain doesn't work as
|
||||
# well for this.
|
||||
sed -i.bak -f ci/config.mk.optimized.sed src/auto/config.mk
|
||||
fi
|
||||
|
||||
- name: Modify configure result
|
||||
if: matrix.publish
|
||||
run: |
|
||||
@@ -213,12 +220,11 @@ jobs:
|
||||
env:
|
||||
LC_ALL: C
|
||||
run: |
|
||||
set -o verbose
|
||||
|
||||
NPROC=$(getconf _NPROCESSORS_ONLN)
|
||||
echo "Building MacVim with ${NPROC} cores"
|
||||
|
||||
make -j${NPROC}
|
||||
set -o verbose
|
||||
make ${MAKE_BUILD_ARGS} -j${NPROC}
|
||||
|
||||
- name: Check version
|
||||
run: |
|
||||
@@ -273,7 +279,7 @@ jobs:
|
||||
macvim_excmd -c 'lang es_ES' -c 'version' | grep Enlazado
|
||||
|
||||
# Check that libsodium is working
|
||||
macvim_excmd -c 'set cryptmethod=xchacha20'
|
||||
macvim_excmd -c 'set cryptmethod=xchacha20v2'
|
||||
|
||||
# Make sure we are building universal x86_64 / arm64 builds and didn't accidentally create a thin app.
|
||||
check_arch() {
|
||||
@@ -294,15 +300,25 @@ jobs:
|
||||
make -C runtime/doc vimtags VIMEXE=../../${VIM_BIN}
|
||||
git diff --exit-code -- runtime/doc/tags
|
||||
|
||||
- name: Build test binaries
|
||||
run: |
|
||||
# Build the unit test binaries first. With link-time-optimization they take some time to link. Running them
|
||||
# separately de-couples them from the timeout in tests, and allow us to build in parallel jobs (since tests
|
||||
# can't run in parallel).
|
||||
NPROC=$(getconf _NPROCESSORS_ONLN)
|
||||
|
||||
set -o verbose
|
||||
make ${MAKE_BUILD_ARGS} -j${NPROC} -C src unittesttargets
|
||||
|
||||
- name: Test
|
||||
timeout-minutes: 20
|
||||
run: make test
|
||||
run: make ${MAKE_BUILD_ARGS} test
|
||||
|
||||
- name: Test GUI
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
make -C src/testdir clean
|
||||
make -C src testgui
|
||||
make ${MAKE_BUILD_ARGS} -C src/testdir clean
|
||||
make ${MAKE_BUILD_ARGS} -C src testgui
|
||||
|
||||
# Creates a DMG package of MacVim. Note that this doesn't create a GitHub release for us, because we would prefer to
|
||||
# do it manually, for two reasons: 1) signing / notarization are currently done out of CI, 2) we want to manually
|
||||
|
||||
@@ -123,6 +123,7 @@ src/MacVim/qlstephen/QuickLookStephen.xcodeproj/*.pbxuser
|
||||
src/MacVim/qlstephen/QuickLookStephen.xcodeproj/xcuserdata
|
||||
src/MacVim/qlstephen/build
|
||||
src/MacVim/build
|
||||
src/MacVim/auto
|
||||
src/MacVim/DerivedData
|
||||
src/TAGS
|
||||
src/Vim
|
||||
|
||||
@@ -40,7 +40,7 @@ all install uninstall tools config configure reconfig proto depend lint tags typ
|
||||
@echo "If there are problems, cd to the src directory and run make there"
|
||||
cd src && $(MAKE) $@
|
||||
@# When the target is "test" also run the indent and syntax tests.
|
||||
@if test "$@" = "test"; then \
|
||||
@if test "$@" = "test" -o "$@" = "testtiny"; then \
|
||||
$(MAKE) indenttest; \
|
||||
$(MAKE) syntaxtest; \
|
||||
fi
|
||||
|
||||
@@ -7,7 +7,7 @@ Vim - the text editor - for macOS
|
||||
|
||||
- Vim README: [README_vim.md](README_vim.md)
|
||||
|
||||
- [](https://github.com/macvim-dev/macvim/actions?query=workflow%3A%22MacVim+GitHub+CI%22)
|
||||
- [](https://github.com/macvim-dev/macvim/actions/workflows/ci-macvim.yaml)
|
||||
|
||||
- Packaged in [](https://repology.org/metapackage/macvim/versions) [](https://repology.org/metapackage/macvim/versions)
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ Change to the vim directory and do:
|
||||
|
||||
$ export CC=cc
|
||||
$ export _CC_CCMODE=1
|
||||
$./configure --with-features=big --without-x --enable-gui=no
|
||||
$./configure --with-features=normal --without-x --enable-gui=no
|
||||
$ cd src
|
||||
$ make
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# Clang 12 (or Apple clang 13) and later makes a warning '-Wcompound-token-split-by-macro' enable by default.
|
||||
/^PERL_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=compound-token-split-by-macro/
|
||||
/^PERL_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=compound-token-split-by-macro -Wno-compound-token-split-by-macro/
|
||||
/^RUBY_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=compound-token-split-by-macro/
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Add link-time optimization for even better performance
|
||||
/^CFLAGS[[:blank:]]*=/s/-O2/-O3 -flto/
|
||||
/^LDFLAGS[[:blank:]]*=/s/$/ -flto/
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
/^CFLAGS[[:blank:]]*=/s/$/ -Wall -Wextra -Wshadow -Werror -Wno-deprecated-declarations/
|
||||
/^CFLAGS[[:blank:]]*=/s/$/ -Wall -Wextra -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Werror -Wno-deprecated-declarations/
|
||||
/^PERL_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unused-function -Wno-shadow/
|
||||
/^RUBY_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unused-parameter/
|
||||
/^RUBY_CFLAGS_EXTRA[[:blank:]]*=/s/$/ -Wno-error=unused-parameter -Wno-strict-prototypes/
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
" Last Modified: 2023-09-11
|
||||
|
||||
function! cargo#Load()
|
||||
" Utility call to get this script loaded, for debugging
|
||||
endfunction
|
||||
|
||||
function! cargo#cmd(args) abort
|
||||
" Trim trailing spaces. This is necessary since :terminal command parses
|
||||
" trailing spaces as an empty argument.
|
||||
let args = substitute(a:args, '\s\+$', '', '')
|
||||
if exists('g:cargo_shell_command_runner')
|
||||
let cmd = g:cargo_shell_command_runner
|
||||
elseif has('terminal')
|
||||
let cmd = 'terminal'
|
||||
elseif has('nvim')
|
||||
let cmd = 'noautocmd new | terminal'
|
||||
else
|
||||
let cmd = '!'
|
||||
endif
|
||||
execute cmd 'cargo' args
|
||||
endfunction
|
||||
|
||||
function! s:nearest_cargo(...) abort
|
||||
" If the second argument is not specified, the first argument determines
|
||||
" whether we will start from the current directory or the directory of the
|
||||
" current buffer, otherwise, we start with the provided path on the
|
||||
" second argument.
|
||||
|
||||
let l:is_getcwd = get(a:, 1, 0)
|
||||
if l:is_getcwd
|
||||
let l:starting_path = get(a:, 2, getcwd())
|
||||
else
|
||||
let l:starting_path = get(a:, 2, expand('%:p:h'))
|
||||
endif
|
||||
|
||||
return findfile('Cargo.toml', l:starting_path . ';')
|
||||
endfunction
|
||||
|
||||
function! cargo#nearestCargo(is_getcwd) abort
|
||||
return s:nearest_cargo(a:is_getcwd)
|
||||
endfunction
|
||||
|
||||
function! cargo#nearestWorkspaceCargo(is_getcwd) abort
|
||||
let l:nearest = s:nearest_cargo(a:is_getcwd)
|
||||
while l:nearest !=# ''
|
||||
for l:line in readfile(l:nearest, '', 0x100)
|
||||
if l:line =~# '\V[workspace]'
|
||||
return l:nearest
|
||||
endif
|
||||
endfor
|
||||
let l:next = fnamemodify(l:nearest, ':p:h:h')
|
||||
let l:nearest = s:nearest_cargo(0, l:next)
|
||||
endwhile
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! cargo#nearestRootCargo(is_getcwd) abort
|
||||
" Try to find a workspace Cargo.toml, and if not found, take the nearest
|
||||
" regular Cargo.toml
|
||||
let l:workspace_cargo = cargo#nearestWorkspaceCargo(a:is_getcwd)
|
||||
if l:workspace_cargo !=# ''
|
||||
return l:workspace_cargo
|
||||
endif
|
||||
return s:nearest_cargo(a:is_getcwd)
|
||||
endfunction
|
||||
|
||||
|
||||
function! cargo#build(args)
|
||||
call cargo#cmd("build " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#check(args)
|
||||
call cargo#cmd("check " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#clean(args)
|
||||
call cargo#cmd("clean " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#doc(args)
|
||||
call cargo#cmd("doc " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#new(args)
|
||||
call cargo#cmd("new " . a:args)
|
||||
cd `=a:args`
|
||||
endfunction
|
||||
|
||||
function! cargo#init(args)
|
||||
call cargo#cmd("init " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#run(args)
|
||||
call cargo#cmd("run " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#test(args)
|
||||
call cargo#cmd("test " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#bench(args)
|
||||
call cargo#cmd("bench " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#update(args)
|
||||
call cargo#cmd("update " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#search(args)
|
||||
call cargo#cmd("search " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#publish(args)
|
||||
call cargo#cmd("publish " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#install(args)
|
||||
call cargo#cmd("install " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#runtarget(args)
|
||||
let l:filename = expand('%:p')
|
||||
let l:read_manifest = system('cargo read-manifest')
|
||||
let l:metadata = json_decode(l:read_manifest)
|
||||
let l:targets = get(l:metadata, 'targets', [])
|
||||
let l:did_run = 0
|
||||
for l:target in l:targets
|
||||
let l:src_path = get(l:target, 'src_path', '')
|
||||
let l:kinds = get(l:target, 'kind', [])
|
||||
let l:name = get(l:target, 'name', '')
|
||||
if l:src_path == l:filename
|
||||
if index(l:kinds, 'example') != -1
|
||||
let l:did_run = 1
|
||||
call cargo#run("--example " . shellescape(l:name) . " " . a:args)
|
||||
return
|
||||
elseif index(l:kinds, 'bin') != -1
|
||||
let l:did_run = 1
|
||||
call cargo#run("--bin " . shellescape(l:name) . " " . a:args)
|
||||
return
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
if l:did_run != 1
|
||||
call cargo#run(a:args)
|
||||
return
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
@@ -0,0 +1,29 @@
|
||||
" Last Modified: 2023-09-11
|
||||
|
||||
function! cargo#quickfix#CmdPre() abort
|
||||
if &filetype ==# 'rust' && get(b:, 'current_compiler', '') ==# 'cargo' &&
|
||||
\ &makeprg =~ '\V\^cargo\ \.\*'
|
||||
" Preserve the current directory, and 'lcd' to the nearest Cargo file.
|
||||
let b:rust_compiler_cargo_qf_has_lcd = haslocaldir()
|
||||
let b:rust_compiler_cargo_qf_prev_cd = getcwd()
|
||||
let b:rust_compiler_cargo_qf_prev_cd_saved = 1
|
||||
let l:nearest = fnamemodify(cargo#nearestRootCargo(0), ':h')
|
||||
execute 'lchdir! '.l:nearest
|
||||
else
|
||||
let b:rust_compiler_cargo_qf_prev_cd_saved = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! cargo#quickfix#CmdPost() abort
|
||||
if exists("b:rust_compiler_cargo_qf_prev_cd_saved") && b:rust_compiler_cargo_qf_prev_cd_saved
|
||||
" Restore the current directory.
|
||||
if b:rust_compiler_cargo_qf_has_lcd
|
||||
execute 'lchdir! '.b:rust_compiler_cargo_qf_prev_cd
|
||||
else
|
||||
execute 'chdir! '.b:rust_compiler_cargo_qf_prev_cd
|
||||
endif
|
||||
let b:rust_compiler_cargo_qf_prev_cd_saved = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
Vendored
+1
-1
@@ -196,7 +196,7 @@ func dist#man#GetPage(cmdmods, ...)
|
||||
|
||||
" Emulate piping the buffer through the "col -b" command.
|
||||
" Ref: https://github.com/vim/vim/issues/12301
|
||||
silent! keepjumps keeppatterns %s/\v(.)\b\ze\1?//ge
|
||||
exe 'silent! keepjumps keeppatterns %s/\v(.)\b\ze\1?//e' .. (&gdefault ? '' : 'g')
|
||||
|
||||
if unsetwidth
|
||||
let $MANWIDTH = ''
|
||||
|
||||
@@ -1961,7 +1961,7 @@ endfun
|
||||
" Doing this means that netrw will not come up as having changed a
|
||||
" setting last when it really didn't actually change it.
|
||||
"
|
||||
" Used by s:NetrwOptionsRestore() to restore each netrw-senstive setting
|
||||
" Used by s:NetrwOptionsRestore() to restore each netrw-sensitive setting
|
||||
" keepvars are set up by s:NetrwOptionsSave
|
||||
fun! s:NetrwRestoreSetting(keepvar,setting)
|
||||
""" call Dfunc("s:NetrwRestoreSetting(a:keepvar<".a:keepvar."> a:setting<".a:setting.">)")
|
||||
@@ -2998,7 +2998,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
|
||||
" to process this detection correctly.
|
||||
" call Decho("detect filetype of local version of remote file<".rfile.">",'~'.expand("<slnum>"))
|
||||
" call Decho("..did_filetype()=".did_filetype())
|
||||
setl ft=
|
||||
" setl ft=
|
||||
" call Decho("..initial filetype<".&ft."> for buf#".bufnr()."<".bufname().">")
|
||||
let iskkeep= &isk
|
||||
setl isk-=/
|
||||
@@ -3516,6 +3516,11 @@ fun! s:NetrwBookHistHandler(chg,curdir)
|
||||
echo "bookmarked the current directory"
|
||||
endif
|
||||
|
||||
try
|
||||
call s:NetrwBookHistSave()
|
||||
catch
|
||||
endtry
|
||||
|
||||
elseif a:chg == 1
|
||||
" change to the bookmarked directory
|
||||
" call Decho("(user: <".v:count."gb>) change to the bookmarked directory",'~'.expand("<slnum>"))
|
||||
@@ -3660,6 +3665,11 @@ fun! s:NetrwBookHistHandler(chg,curdir)
|
||||
" call Decho("g:netrw_bookmarklist=".string(g:netrw_bookmarklist),'~'.expand("<slnum>"))
|
||||
endif
|
||||
" call Decho("resulting g:netrw_bookmarklist=".string(g:netrw_bookmarklist),'~'.expand("<slnum>"))
|
||||
|
||||
try
|
||||
call s:NetrwBookHistSave()
|
||||
catch
|
||||
endtry
|
||||
endif
|
||||
call s:NetrwBookmarkMenu()
|
||||
call s:NetrwTgtMenu()
|
||||
@@ -5552,7 +5562,7 @@ fun! netrw#BrowseX(fname,remote)
|
||||
" cleanup: remove temporary file,
|
||||
" delete current buffer if success with handler,
|
||||
" return to prior buffer (directory listing)
|
||||
" Feb 12, 2008: had to de-activiate removal of
|
||||
" Feb 12, 2008: had to de-activate removal of
|
||||
" temporary file because it wasn't getting seen.
|
||||
" if remote == 1 && fname != a:fname
|
||||
"" call Decho("deleting temporary file<".fname.">",'~'.expand("<slnum>"))
|
||||
@@ -7382,8 +7392,7 @@ fun! s:NetrwMarkFileDiff(islocal)
|
||||
exe "NetrwKeepj e ".fnameescape(fname)
|
||||
diffthis
|
||||
elseif cnt == 2 || cnt == 3
|
||||
vsplit
|
||||
wincmd l
|
||||
below vsplit
|
||||
" call Decho("diffthis: ".fname,'~'.expand("<slnum>"))
|
||||
exe "NetrwKeepj e ".fnameescape(fname)
|
||||
diffthis
|
||||
@@ -12044,9 +12053,9 @@ fun! s:NetrwBufRemover(bufid)
|
||||
" call Decho("buf#".a:bufid." has name <".bufname(a:bufid).">","~".expand("<slnum>"))
|
||||
" call Decho("buf#".a:bufid." has winid#".bufwinid(a:bufid),"~".expand("<slnum>"))
|
||||
|
||||
if a:bufid > 1 && !buflisted(a:bufid) && bufname(a:bufid) == "" && bufwinid(a:bufid) == -1
|
||||
if a:bufid > 1 && !buflisted(a:bufid) && bufloaded(a:bufid) && bufname(a:bufid) == "" && bufwinid(a:bufid) == -1
|
||||
" call Decho("(s:NetrwBufRemover) removing buffer#".a:bufid,"~".expand("<slnum>"))
|
||||
exe "bd! ".a:bufid
|
||||
exe "sil! bd! ".a:bufid
|
||||
endif
|
||||
|
||||
" call Dret("s:NetrwBufRemover")
|
||||
|
||||
@@ -2907,7 +2907,7 @@ endfor
|
||||
" builtin class information
|
||||
let g:php_builtin_object_functions = {}
|
||||
|
||||
" When completing for 'everyting imaginable' (no class context, not a
|
||||
" When completing for 'everything imaginable' (no class context, not a
|
||||
" variable) we need a list of built-in classes in a format of {'classname':''}
|
||||
" for performance reasons we precompile this too
|
||||
let g:php_builtin_classnames = {}
|
||||
|
||||
+450
-295
@@ -1,207 +1,258 @@
|
||||
" Author: Lily Ballard
|
||||
" Description: Helper functions for Rust commands/mappings
|
||||
" Last Modified: May 27, 2014
|
||||
" Last Modified: 2023-09-11
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
function! rust#Load()
|
||||
" Utility call to get this script loaded, for debugging
|
||||
endfunction
|
||||
|
||||
function! rust#GetConfigVar(name, default)
|
||||
" Local buffer variable with same name takes predeence over global
|
||||
if has_key(b:, a:name)
|
||||
return get(b:, a:name)
|
||||
endif
|
||||
if has_key(g:, a:name)
|
||||
return get(g:, a:name)
|
||||
endif
|
||||
return a:default
|
||||
endfunction
|
||||
|
||||
" Include expression {{{1
|
||||
|
||||
function! rust#IncludeExpr(fname) abort
|
||||
" Remove leading 'crate::' to deal with 2018 edition style 'use'
|
||||
" statements
|
||||
let l:fname = substitute(a:fname, '^crate::', '', '')
|
||||
|
||||
" Remove trailing colons arising from lines like
|
||||
"
|
||||
" use foo::{Bar, Baz};
|
||||
let l:fname = substitute(l:fname, ':\+$', '', '')
|
||||
|
||||
" Replace '::' with '/'
|
||||
let l:fname = substitute(l:fname, '::', '/', 'g')
|
||||
|
||||
" When we have
|
||||
"
|
||||
" use foo::bar::baz;
|
||||
"
|
||||
" we can't tell whether baz is a module or a function; and we can't tell
|
||||
" which modules correspond to files.
|
||||
"
|
||||
" So we work our way up, trying
|
||||
"
|
||||
" foo/bar/baz.rs
|
||||
" foo/bar.rs
|
||||
" foo.rs
|
||||
while l:fname !=# '.'
|
||||
let l:path = findfile(l:fname)
|
||||
if !empty(l:path)
|
||||
return l:fname
|
||||
endif
|
||||
let l:fname = fnamemodify(l:fname, ':h')
|
||||
endwhile
|
||||
return l:fname
|
||||
endfunction
|
||||
|
||||
" Jump {{{1
|
||||
|
||||
function! rust#Jump(mode, function) range
|
||||
let cnt = v:count1
|
||||
normal! m'
|
||||
if a:mode ==# 'v'
|
||||
norm! gv
|
||||
endif
|
||||
let foldenable = &foldenable
|
||||
set nofoldenable
|
||||
while cnt > 0
|
||||
execute "call <SID>Jump_" . a:function . "()"
|
||||
let cnt = cnt - 1
|
||||
endwhile
|
||||
let &foldenable = foldenable
|
||||
let cnt = v:count1
|
||||
normal! m'
|
||||
if a:mode ==# 'v'
|
||||
norm! gv
|
||||
endif
|
||||
let foldenable = &foldenable
|
||||
set nofoldenable
|
||||
while cnt > 0
|
||||
execute "call <SID>Jump_" . a:function . "()"
|
||||
let cnt = cnt - 1
|
||||
endwhile
|
||||
let &foldenable = foldenable
|
||||
endfunction
|
||||
|
||||
function! s:Jump_Back()
|
||||
call search('{', 'b')
|
||||
keepjumps normal! w99[{
|
||||
call search('{', 'b')
|
||||
keepjumps normal! w99[{
|
||||
endfunction
|
||||
|
||||
function! s:Jump_Forward()
|
||||
normal! j0
|
||||
call search('{', 'b')
|
||||
keepjumps normal! w99[{%
|
||||
call search('{')
|
||||
normal! j0
|
||||
call search('{', 'b')
|
||||
keepjumps normal! w99[{%
|
||||
call search('{')
|
||||
endfunction
|
||||
|
||||
" Run {{{1
|
||||
|
||||
function! rust#Run(bang, args)
|
||||
let args = s:ShellTokenize(a:args)
|
||||
if a:bang
|
||||
let idx = index(l:args, '--')
|
||||
if idx != -1
|
||||
let rustc_args = idx == 0 ? [] : l:args[:idx-1]
|
||||
let args = l:args[idx+1:]
|
||||
else
|
||||
let rustc_args = l:args
|
||||
let args = []
|
||||
endif
|
||||
else
|
||||
let rustc_args = []
|
||||
endif
|
||||
let args = s:ShellTokenize(a:args)
|
||||
if a:bang
|
||||
let idx = index(l:args, '--')
|
||||
if idx != -1
|
||||
let rustc_args = idx == 0 ? [] : l:args[:idx-1]
|
||||
let args = l:args[idx+1:]
|
||||
else
|
||||
let rustc_args = l:args
|
||||
let args = []
|
||||
endif
|
||||
else
|
||||
let rustc_args = []
|
||||
endif
|
||||
|
||||
let b:rust_last_rustc_args = l:rustc_args
|
||||
let b:rust_last_args = l:args
|
||||
let b:rust_last_rustc_args = l:rustc_args
|
||||
let b:rust_last_args = l:args
|
||||
|
||||
call s:WithPath(function("s:Run"), rustc_args, args)
|
||||
call s:WithPath(function("s:Run"), rustc_args, args)
|
||||
endfunction
|
||||
|
||||
function! s:Run(dict, rustc_args, args)
|
||||
let exepath = a:dict.tmpdir.'/'.fnamemodify(a:dict.path, ':t:r')
|
||||
if has('win32')
|
||||
let exepath .= '.exe'
|
||||
endif
|
||||
let exepath = a:dict.tmpdir.'/'.fnamemodify(a:dict.path, ':t:r')
|
||||
if has('win32')
|
||||
let exepath .= '.exe'
|
||||
endif
|
||||
|
||||
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||
let rustc_args = [relpath, '-o', exepath] + a:rustc_args
|
||||
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||
let rustc_args = [relpath, '-o', exepath] + a:rustc_args
|
||||
|
||||
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||
|
||||
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||
let output = s:system(pwd, shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)')))
|
||||
if output != ''
|
||||
echohl WarningMsg
|
||||
echo output
|
||||
echohl None
|
||||
endif
|
||||
if !v:shell_error
|
||||
exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)'))
|
||||
endif
|
||||
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||
let output = s:system(pwd, shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)')))
|
||||
if output !=# ''
|
||||
echohl WarningMsg
|
||||
echo output
|
||||
echohl None
|
||||
endif
|
||||
if !v:shell_error
|
||||
exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)'))
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Expand {{{1
|
||||
|
||||
function! rust#Expand(bang, args)
|
||||
let args = s:ShellTokenize(a:args)
|
||||
if a:bang && !empty(l:args)
|
||||
let pretty = remove(l:args, 0)
|
||||
else
|
||||
let pretty = "expanded"
|
||||
endif
|
||||
call s:WithPath(function("s:Expand"), pretty, args)
|
||||
let args = s:ShellTokenize(a:args)
|
||||
if a:bang && !empty(l:args)
|
||||
let pretty = remove(l:args, 0)
|
||||
else
|
||||
let pretty = "expanded"
|
||||
endif
|
||||
call s:WithPath(function("s:Expand"), pretty, args)
|
||||
endfunction
|
||||
|
||||
function! s:Expand(dict, pretty, args)
|
||||
try
|
||||
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||
try
|
||||
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||
|
||||
if a:pretty =~? '^\%(everybody_loops$\|flowgraph=\)'
|
||||
let flag = '--xpretty'
|
||||
else
|
||||
let flag = '--pretty'
|
||||
endif
|
||||
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||
let args = [relpath, '-Z', 'unstable-options', l:flag, a:pretty] + a:args
|
||||
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
|
||||
if v:shell_error
|
||||
echohl WarningMsg
|
||||
echo output
|
||||
echohl None
|
||||
else
|
||||
new
|
||||
silent put =output
|
||||
1
|
||||
d
|
||||
setl filetype=rust
|
||||
setl buftype=nofile
|
||||
setl bufhidden=hide
|
||||
setl noswapfile
|
||||
" give the buffer a nice name
|
||||
let suffix = 1
|
||||
let basename = fnamemodify(a:dict.path, ':t:r')
|
||||
while 1
|
||||
let bufname = basename
|
||||
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
|
||||
let bufname .= '.pretty.rs'
|
||||
if bufexists(bufname)
|
||||
let suffix += 1
|
||||
continue
|
||||
endif
|
||||
exe 'silent noautocmd keepalt file' fnameescape(bufname)
|
||||
break
|
||||
endwhile
|
||||
endif
|
||||
endtry
|
||||
if a:pretty =~? '^\%(everybody_loops$\|flowgraph=\)'
|
||||
let flag = '--xpretty'
|
||||
else
|
||||
let flag = '--pretty'
|
||||
endif
|
||||
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||
let args = [relpath, '-Z', 'unstable-options', l:flag, a:pretty] + a:args
|
||||
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
|
||||
if v:shell_error
|
||||
echohl WarningMsg
|
||||
echo output
|
||||
echohl None
|
||||
else
|
||||
new
|
||||
silent put =output
|
||||
1
|
||||
d
|
||||
setl filetype=rust
|
||||
setl buftype=nofile
|
||||
setl bufhidden=hide
|
||||
setl noswapfile
|
||||
" give the buffer a nice name
|
||||
let suffix = 1
|
||||
let basename = fnamemodify(a:dict.path, ':t:r')
|
||||
while 1
|
||||
let bufname = basename
|
||||
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
|
||||
let bufname .= '.pretty.rs'
|
||||
if bufexists(bufname)
|
||||
let suffix += 1
|
||||
continue
|
||||
endif
|
||||
exe 'silent noautocmd keepalt file' fnameescape(bufname)
|
||||
break
|
||||
endwhile
|
||||
endif
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! rust#CompleteExpand(lead, line, pos)
|
||||
if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$'
|
||||
" first argument and it has a !
|
||||
let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph=", "everybody_loops"]
|
||||
if !empty(a:lead)
|
||||
call filter(list, "v:val[:len(a:lead)-1] == a:lead")
|
||||
endif
|
||||
return list
|
||||
endif
|
||||
if a:line[: a:pos-1] =~# '^RustExpand!\s*\S*$'
|
||||
" first argument and it has a !
|
||||
let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph=", "everybody_loops"]
|
||||
if !empty(a:lead)
|
||||
call filter(list, "v:val[:len(a:lead)-1] == a:lead")
|
||||
endif
|
||||
return list
|
||||
endif
|
||||
|
||||
return glob(escape(a:lead, "*?[") . '*', 0, 1)
|
||||
return glob(escape(a:lead, "*?[") . '*', 0, 1)
|
||||
endfunction
|
||||
|
||||
" Emit {{{1
|
||||
|
||||
function! rust#Emit(type, args)
|
||||
let args = s:ShellTokenize(a:args)
|
||||
call s:WithPath(function("s:Emit"), a:type, args)
|
||||
let args = s:ShellTokenize(a:args)
|
||||
call s:WithPath(function("s:Emit"), a:type, args)
|
||||
endfunction
|
||||
|
||||
function! s:Emit(dict, type, args)
|
||||
try
|
||||
let output_path = a:dict.tmpdir.'/output'
|
||||
try
|
||||
let output_path = a:dict.tmpdir.'/output'
|
||||
|
||||
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||
|
||||
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||
let args = [relpath, '--emit', a:type, '-o', output_path] + a:args
|
||||
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
|
||||
if output != ''
|
||||
echohl WarningMsg
|
||||
echo output
|
||||
echohl None
|
||||
endif
|
||||
if !v:shell_error
|
||||
new
|
||||
exe 'silent keepalt read' fnameescape(output_path)
|
||||
1
|
||||
d
|
||||
if a:type == "llvm-ir"
|
||||
setl filetype=llvm
|
||||
let extension = 'll'
|
||||
elseif a:type == "asm"
|
||||
setl filetype=asm
|
||||
let extension = 's'
|
||||
endif
|
||||
setl buftype=nofile
|
||||
setl bufhidden=hide
|
||||
setl noswapfile
|
||||
if exists('l:extension')
|
||||
" give the buffer a nice name
|
||||
let suffix = 1
|
||||
let basename = fnamemodify(a:dict.path, ':t:r')
|
||||
while 1
|
||||
let bufname = basename
|
||||
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
|
||||
let bufname .= '.'.extension
|
||||
if bufexists(bufname)
|
||||
let suffix += 1
|
||||
continue
|
||||
endif
|
||||
exe 'silent noautocmd keepalt file' fnameescape(bufname)
|
||||
break
|
||||
endwhile
|
||||
endif
|
||||
endif
|
||||
endtry
|
||||
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||
let args = [relpath, '--emit', a:type, '-o', output_path] + a:args
|
||||
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
|
||||
if output !=# ''
|
||||
echohl WarningMsg
|
||||
echo output
|
||||
echohl None
|
||||
endif
|
||||
if !v:shell_error
|
||||
new
|
||||
exe 'silent keepalt read' fnameescape(output_path)
|
||||
1
|
||||
d
|
||||
if a:type ==# "llvm-ir"
|
||||
setl filetype=llvm
|
||||
let extension = 'll'
|
||||
elseif a:type ==# "asm"
|
||||
setl filetype=asm
|
||||
let extension = 's'
|
||||
endif
|
||||
setl buftype=nofile
|
||||
setl bufhidden=hide
|
||||
setl noswapfile
|
||||
if exists('l:extension')
|
||||
" give the buffer a nice name
|
||||
let suffix = 1
|
||||
let basename = fnamemodify(a:dict.path, ':t:r')
|
||||
while 1
|
||||
let bufname = basename
|
||||
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
|
||||
let bufname .= '.'.extension
|
||||
if bufexists(bufname)
|
||||
let suffix += 1
|
||||
continue
|
||||
endif
|
||||
exe 'silent noautocmd keepalt file' fnameescape(bufname)
|
||||
break
|
||||
endwhile
|
||||
endif
|
||||
endif
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" Utility functions {{{1
|
||||
@@ -219,145 +270,154 @@ endfunction
|
||||
" existing path of the current buffer. If the path is inside of {dict.tmpdir}
|
||||
" then it is guaranteed to have a '.rs' extension.
|
||||
function! s:WithPath(func, ...)
|
||||
let buf = bufnr('')
|
||||
let saved = {}
|
||||
let dict = {}
|
||||
try
|
||||
let saved.write = &write
|
||||
set write
|
||||
let dict.path = expand('%')
|
||||
let pathisempty = empty(dict.path)
|
||||
let buf = bufnr('')
|
||||
let saved = {}
|
||||
let dict = {}
|
||||
try
|
||||
let saved.write = &write
|
||||
set write
|
||||
let dict.path = expand('%')
|
||||
let pathisempty = empty(dict.path)
|
||||
|
||||
" Always create a tmpdir in case the wrapped command wants it
|
||||
let dict.tmpdir = tempname()
|
||||
call mkdir(dict.tmpdir)
|
||||
" Always create a tmpdir in case the wrapped command wants it
|
||||
let dict.tmpdir = tempname()
|
||||
call mkdir(dict.tmpdir)
|
||||
|
||||
if pathisempty || !saved.write
|
||||
let dict.istemp = 1
|
||||
" if we're doing this because of nowrite, preserve the filename
|
||||
if !pathisempty
|
||||
let filename = expand('%:t:r').".rs"
|
||||
else
|
||||
let filename = 'unnamed.rs'
|
||||
endif
|
||||
let dict.tmpdir_relpath = filename
|
||||
let dict.path = dict.tmpdir.'/'.filename
|
||||
if pathisempty || !saved.write
|
||||
let dict.istemp = 1
|
||||
" if we're doing this because of nowrite, preserve the filename
|
||||
if !pathisempty
|
||||
let filename = expand('%:t:r').".rs"
|
||||
else
|
||||
let filename = 'unnamed.rs'
|
||||
endif
|
||||
let dict.tmpdir_relpath = filename
|
||||
let dict.path = dict.tmpdir.'/'.filename
|
||||
|
||||
let saved.mod = &mod
|
||||
set nomod
|
||||
let saved.mod = &modified
|
||||
set nomodified
|
||||
|
||||
silent exe 'keepalt write! ' . fnameescape(dict.path)
|
||||
if pathisempty
|
||||
silent keepalt 0file
|
||||
endif
|
||||
else
|
||||
let dict.istemp = 0
|
||||
update
|
||||
endif
|
||||
silent exe 'keepalt write! ' . fnameescape(dict.path)
|
||||
if pathisempty
|
||||
silent keepalt 0file
|
||||
endif
|
||||
else
|
||||
let dict.istemp = 0
|
||||
update
|
||||
endif
|
||||
|
||||
call call(a:func, [dict] + a:000)
|
||||
finally
|
||||
if bufexists(buf)
|
||||
for [opt, value] in items(saved)
|
||||
silent call setbufvar(buf, '&'.opt, value)
|
||||
unlet value " avoid variable type mismatches
|
||||
endfor
|
||||
endif
|
||||
if has_key(dict, 'tmpdir') | silent call s:RmDir(dict.tmpdir) | endif
|
||||
endtry
|
||||
call call(a:func, [dict] + a:000)
|
||||
finally
|
||||
if bufexists(buf)
|
||||
for [opt, value] in items(saved)
|
||||
silent call setbufvar(buf, '&'.opt, value)
|
||||
unlet value " avoid variable type mismatches
|
||||
endfor
|
||||
endif
|
||||
if has_key(dict, 'tmpdir') | silent call s:RmDir(dict.tmpdir) | endif
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! rust#AppendCmdLine(text)
|
||||
call setcmdpos(getcmdpos())
|
||||
let cmd = getcmdline() . a:text
|
||||
return cmd
|
||||
call setcmdpos(getcmdpos())
|
||||
let cmd = getcmdline() . a:text
|
||||
return cmd
|
||||
endfunction
|
||||
|
||||
" Tokenize the string according to sh parsing rules
|
||||
function! s:ShellTokenize(text)
|
||||
" states:
|
||||
" 0: start of word
|
||||
" 1: unquoted
|
||||
" 2: unquoted backslash
|
||||
" 3: double-quote
|
||||
" 4: double-quoted backslash
|
||||
" 5: single-quote
|
||||
let l:state = 0
|
||||
let l:current = ''
|
||||
let l:args = []
|
||||
for c in split(a:text, '\zs')
|
||||
if l:state == 0 || l:state == 1 " unquoted
|
||||
if l:c ==# ' '
|
||||
if l:state == 0 | continue | endif
|
||||
call add(l:args, l:current)
|
||||
let l:current = ''
|
||||
let l:state = 0
|
||||
elseif l:c ==# '\'
|
||||
let l:state = 2
|
||||
elseif l:c ==# '"'
|
||||
let l:state = 3
|
||||
elseif l:c ==# "'"
|
||||
let l:state = 5
|
||||
else
|
||||
let l:current .= l:c
|
||||
let l:state = 1
|
||||
endif
|
||||
elseif l:state == 2 " unquoted backslash
|
||||
if l:c !=# "\n" " can it even be \n?
|
||||
let l:current .= l:c
|
||||
endif
|
||||
let l:state = 1
|
||||
elseif l:state == 3 " double-quote
|
||||
if l:c ==# '\'
|
||||
let l:state = 4
|
||||
elseif l:c ==# '"'
|
||||
let l:state = 1
|
||||
else
|
||||
let l:current .= l:c
|
||||
endif
|
||||
elseif l:state == 4 " double-quoted backslash
|
||||
if stridx('$`"\', l:c) >= 0
|
||||
let l:current .= l:c
|
||||
elseif l:c ==# "\n" " is this even possible?
|
||||
" skip it
|
||||
else
|
||||
let l:current .= '\'.l:c
|
||||
endif
|
||||
let l:state = 3
|
||||
elseif l:state == 5 " single-quoted
|
||||
if l:c == "'"
|
||||
let l:state = 1
|
||||
else
|
||||
let l:current .= l:c
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
if l:state != 0
|
||||
call add(l:args, l:current)
|
||||
endif
|
||||
return l:args
|
||||
" states:
|
||||
" 0: start of word
|
||||
" 1: unquoted
|
||||
" 2: unquoted backslash
|
||||
" 3: double-quote
|
||||
" 4: double-quoted backslash
|
||||
" 5: single-quote
|
||||
let l:state = 0
|
||||
let l:current = ''
|
||||
let l:args = []
|
||||
for c in split(a:text, '\zs')
|
||||
if l:state == 0 || l:state == 1 " unquoted
|
||||
if l:c ==# ' '
|
||||
if l:state == 0 | continue | endif
|
||||
call add(l:args, l:current)
|
||||
let l:current = ''
|
||||
let l:state = 0
|
||||
elseif l:c ==# '\'
|
||||
let l:state = 2
|
||||
elseif l:c ==# '"'
|
||||
let l:state = 3
|
||||
elseif l:c ==# "'"
|
||||
let l:state = 5
|
||||
else
|
||||
let l:current .= l:c
|
||||
let l:state = 1
|
||||
endif
|
||||
elseif l:state == 2 " unquoted backslash
|
||||
if l:c !=# "\n" " can it even be \n?
|
||||
let l:current .= l:c
|
||||
endif
|
||||
let l:state = 1
|
||||
elseif l:state == 3 " double-quote
|
||||
if l:c ==# '\'
|
||||
let l:state = 4
|
||||
elseif l:c ==# '"'
|
||||
let l:state = 1
|
||||
else
|
||||
let l:current .= l:c
|
||||
endif
|
||||
elseif l:state == 4 " double-quoted backslash
|
||||
if stridx('$`"\', l:c) >= 0
|
||||
let l:current .= l:c
|
||||
elseif l:c ==# "\n" " is this even possible?
|
||||
" skip it
|
||||
else
|
||||
let l:current .= '\'.l:c
|
||||
endif
|
||||
let l:state = 3
|
||||
elseif l:state == 5 " single-quoted
|
||||
if l:c ==# "'"
|
||||
let l:state = 1
|
||||
else
|
||||
let l:current .= l:c
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
if l:state != 0
|
||||
call add(l:args, l:current)
|
||||
endif
|
||||
return l:args
|
||||
endfunction
|
||||
|
||||
function! s:RmDir(path)
|
||||
" sanity check; make sure it's not empty, /, or $HOME
|
||||
if empty(a:path)
|
||||
echoerr 'Attempted to delete empty path'
|
||||
return 0
|
||||
elseif a:path == '/' || a:path == $HOME
|
||||
echoerr 'Attempted to delete protected path: ' . a:path
|
||||
return 0
|
||||
endif
|
||||
return system("rm -rf " . shellescape(a:path))
|
||||
" sanity check; make sure it's not empty, /, or $HOME
|
||||
if empty(a:path)
|
||||
echoerr 'Attempted to delete empty path'
|
||||
return 0
|
||||
elseif a:path ==# '/' || a:path ==# $HOME
|
||||
let l:path = expand(a:path)
|
||||
if l:path ==# '/' || l:path ==# $HOME
|
||||
echoerr 'Attempted to delete protected path: ' . a:path
|
||||
return 0
|
||||
endif
|
||||
endif
|
||||
|
||||
if !isdirectory(a:path)
|
||||
return 0
|
||||
endif
|
||||
|
||||
" delete() returns 0 when removing file successfully
|
||||
return delete(a:path, 'rf') == 0
|
||||
endfunction
|
||||
|
||||
" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd.
|
||||
" If {pwd} is the empty string then it doesn't change the cwd.
|
||||
function! s:system(pwd, cmd)
|
||||
let cmd = a:cmd
|
||||
if !empty(a:pwd)
|
||||
let cmd = 'cd ' . shellescape(a:pwd) . ' && ' . cmd
|
||||
endif
|
||||
return system(cmd)
|
||||
let cmd = a:cmd
|
||||
if !empty(a:pwd)
|
||||
let cmd = 'cd ' . shellescape(a:pwd) . ' && ' . cmd
|
||||
endif
|
||||
return system(cmd)
|
||||
endfunction
|
||||
|
||||
" Playpen Support {{{1
|
||||
@@ -366,10 +426,10 @@ endfunction
|
||||
" http://github.com/mattn/gist-vim
|
||||
function! s:has_webapi()
|
||||
if !exists("*webapi#http#post")
|
||||
try
|
||||
call webapi#http#post()
|
||||
catch
|
||||
endtry
|
||||
try
|
||||
call webapi#http#post()
|
||||
catch
|
||||
endtry
|
||||
endif
|
||||
return exists("*webapi#http#post")
|
||||
endfunction
|
||||
@@ -381,35 +441,130 @@ function! rust#Play(count, line1, line2, ...) abort
|
||||
let l:rust_shortener_url = get(g:, 'rust_shortener_url', 'https://is.gd/')
|
||||
|
||||
if !s:has_webapi()
|
||||
echohl ErrorMsg | echomsg ':RustPlay depends on webapi.vim (https://github.com/mattn/webapi-vim)' | echohl None
|
||||
return
|
||||
echohl ErrorMsg | echomsg ':RustPlay depends on webapi.vim (https://github.com/mattn/webapi-vim)' | echohl None
|
||||
return
|
||||
endif
|
||||
|
||||
let bufname = bufname('%')
|
||||
if a:count < 1
|
||||
let content = join(getline(a:line1, a:line2), "\n")
|
||||
let content = join(getline(a:line1, a:line2), "\n")
|
||||
else
|
||||
let save_regcont = @"
|
||||
let save_regtype = getregtype('"')
|
||||
silent! normal! gvy
|
||||
let content = @"
|
||||
call setreg('"', save_regcont, save_regtype)
|
||||
let save_regcont = @"
|
||||
let save_regtype = getregtype('"')
|
||||
silent! normal! gvy
|
||||
let content = @"
|
||||
call setreg('"', save_regcont, save_regtype)
|
||||
endif
|
||||
|
||||
let body = l:rust_playpen_url."?code=".webapi#http#encodeURI(content)
|
||||
let url = l:rust_playpen_url."?code=".webapi#http#encodeURI(content)
|
||||
|
||||
if strlen(body) > 5000
|
||||
echohl ErrorMsg | echomsg 'Buffer too large, max 5000 encoded characters ('.strlen(body).')' | echohl None
|
||||
return
|
||||
if strlen(url) > 5000
|
||||
echohl ErrorMsg | echomsg 'Buffer too large, max 5000 encoded characters ('.strlen(url).')' | echohl None
|
||||
return
|
||||
endif
|
||||
|
||||
let payload = "format=simple&url=".webapi#http#encodeURI(body)
|
||||
let payload = "format=simple&url=".webapi#http#encodeURI(url)
|
||||
let res = webapi#http#post(l:rust_shortener_url.'create.php', payload, {})
|
||||
let url = res.content
|
||||
if res.status[0] ==# '2'
|
||||
let url = res.content
|
||||
endif
|
||||
|
||||
redraw | echomsg 'Done: '.url
|
||||
let footer = ''
|
||||
if exists('g:rust_clip_command')
|
||||
call system(g:rust_clip_command, url)
|
||||
if !v:shell_error
|
||||
let footer = ' (copied to clipboard)'
|
||||
endif
|
||||
endif
|
||||
redraw | echomsg 'Done: '.url.footer
|
||||
endfunction
|
||||
|
||||
" Run a test under the cursor or all tests {{{1
|
||||
|
||||
" Finds a test function name under the cursor. Returns empty string when a
|
||||
" test function is not found.
|
||||
function! s:SearchTestFunctionNameUnderCursor() abort
|
||||
let cursor_line = line('.')
|
||||
|
||||
" Find #[test] attribute
|
||||
if search('\m\C#\[test\]', 'bcW') is 0
|
||||
return ''
|
||||
endif
|
||||
|
||||
" Move to an opening brace of the test function
|
||||
let test_func_line = search('\m\C^\s*fn\s\+\h\w*\s*(.\+{$', 'eW')
|
||||
if test_func_line is 0
|
||||
return ''
|
||||
endif
|
||||
|
||||
" Search the end of test function (closing brace) to ensure that the
|
||||
" cursor position is within function definition
|
||||
if maparg('<Plug>(MatchitNormalForward)') ==# ''
|
||||
keepjumps normal! %
|
||||
else
|
||||
" Prefer matchit.vim official plugin to native % since the plugin
|
||||
" provides better behavior than original % (#391)
|
||||
" To load the plugin, run:
|
||||
" :packadd matchit
|
||||
execute 'keepjumps' 'normal' "\<Plug>(MatchitNormalForward)"
|
||||
endif
|
||||
if line('.') < cursor_line
|
||||
return ''
|
||||
endif
|
||||
|
||||
return matchstr(getline(test_func_line), '\m\C^\s*fn\s\+\zs\h\w*')
|
||||
endfunction
|
||||
|
||||
function! rust#Test(mods, winsize, all, options) abort
|
||||
let manifest = findfile('Cargo.toml', expand('%:p:h') . ';')
|
||||
if manifest ==# ''
|
||||
return rust#Run(1, '--test ' . a:options)
|
||||
endif
|
||||
|
||||
" <count> defaults to 0, but we prefer an empty string
|
||||
let winsize = a:winsize ? a:winsize : ''
|
||||
|
||||
if has('terminal')
|
||||
if has('patch-8.0.910')
|
||||
let cmd = printf('%s noautocmd %snew | terminal ++curwin ', a:mods, winsize)
|
||||
else
|
||||
let cmd = printf('%s terminal ', a:mods)
|
||||
endif
|
||||
elseif has('nvim')
|
||||
let cmd = printf('%s noautocmd %snew | terminal ', a:mods, winsize)
|
||||
else
|
||||
let cmd = '!'
|
||||
let manifest = shellescape(manifest)
|
||||
endif
|
||||
|
||||
if a:all
|
||||
if a:options ==# ''
|
||||
execute cmd . 'cargo test --manifest-path' manifest
|
||||
else
|
||||
execute cmd . 'cargo test --manifest-path' manifest a:options
|
||||
endif
|
||||
return
|
||||
endif
|
||||
|
||||
let saved = getpos('.')
|
||||
try
|
||||
let func_name = s:SearchTestFunctionNameUnderCursor()
|
||||
finally
|
||||
call setpos('.', saved)
|
||||
endtry
|
||||
if func_name ==# ''
|
||||
echohl ErrorMsg
|
||||
echomsg 'No test function was found under the cursor. Please add ! to command if you want to run all tests'
|
||||
echohl None
|
||||
return
|
||||
endif
|
||||
if a:options ==# ''
|
||||
execute cmd . 'cargo test --manifest-path' manifest func_name
|
||||
else
|
||||
execute cmd . 'cargo test --manifest-path' manifest func_name a:options
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
" vim: set noet sw=8 ts=8:
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
" Last Modified: 2023-09-11
|
||||
|
||||
" For debugging, inspired by https://github.com/w0rp/rust/blob/master/autoload/rust/debugging.vim
|
||||
|
||||
let s:global_variable_list = [
|
||||
\ '_rustfmt_autosave_because_of_config',
|
||||
\ 'ftplugin_rust_source_path',
|
||||
\ 'loaded_syntastic_rust_cargo_checker',
|
||||
\ 'loaded_syntastic_rust_filetype',
|
||||
\ 'loaded_syntastic_rust_rustc_checker',
|
||||
\ 'rust_bang_comment_leader',
|
||||
\ 'rust_cargo_avoid_whole_workspace',
|
||||
\ 'rust_clip_command',
|
||||
\ 'rust_conceal',
|
||||
\ 'rust_conceal_mod_path',
|
||||
\ 'rust_conceal_pub',
|
||||
\ 'rust_fold',
|
||||
\ 'rust_last_args',
|
||||
\ 'rust_last_rustc_args',
|
||||
\ 'rust_original_delimitMate_excluded_regions',
|
||||
\ 'rust_playpen_url',
|
||||
\ 'rust_prev_delimitMate_quotes',
|
||||
\ 'rust_recent_nearest_cargo_tol',
|
||||
\ 'rust_recent_root_cargo_toml',
|
||||
\ 'rust_recommended_style',
|
||||
\ 'rust_set_conceallevel',
|
||||
\ 'rust_set_conceallevel=1',
|
||||
\ 'rust_set_foldmethod',
|
||||
\ 'rust_set_foldmethod=1',
|
||||
\ 'rust_shortener_url',
|
||||
\ 'rustc_makeprg_no_percent',
|
||||
\ 'rustc_path',
|
||||
\ 'rustfmt_autosave',
|
||||
\ 'rustfmt_autosave_if_config_present',
|
||||
\ 'rustfmt_command',
|
||||
\ 'rustfmt_emit_files',
|
||||
\ 'rustfmt_fail_silently',
|
||||
\ 'rustfmt_options',
|
||||
\ 'syntastic_extra_filetypes',
|
||||
\ 'syntastic_rust_cargo_fname',
|
||||
\]
|
||||
|
||||
function! s:Echo(message) abort
|
||||
execute 'echo a:message'
|
||||
endfunction
|
||||
|
||||
function! s:EchoGlobalVariables() abort
|
||||
for l:key in s:global_variable_list
|
||||
if l:key !~# '^_'
|
||||
call s:Echo('let g:' . l:key . ' = ' . string(get(g:, l:key, v:null)))
|
||||
endif
|
||||
|
||||
if has_key(b:, l:key)
|
||||
call s:Echo('let b:' . l:key . ' = ' . string(b:[l:key]))
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! rust#debugging#Info() abort
|
||||
call cargo#Load()
|
||||
call rust#Load()
|
||||
call rustfmt#Load()
|
||||
call s:Echo('rust.vim Global Variables:')
|
||||
call s:Echo('')
|
||||
call s:EchoGlobalVariables()
|
||||
|
||||
silent let l:output = system(g:rustfmt_command . ' --version')
|
||||
echo l:output
|
||||
|
||||
let l:rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||
silent let l:output = system(l:rustc . ' --version')
|
||||
echo l:output
|
||||
|
||||
silent let l:output = system('cargo --version')
|
||||
echo l:output
|
||||
|
||||
version
|
||||
|
||||
if exists(":SyntasticInfo")
|
||||
echo "----"
|
||||
echo "Info from Syntastic:"
|
||||
execute "SyntasticInfo"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! rust#debugging#InfoToClipboard() abort
|
||||
redir @"
|
||||
silent call rust#debugging#Info()
|
||||
redir END
|
||||
|
||||
call s:Echo('RustInfo copied to your clipboard')
|
||||
endfunction
|
||||
|
||||
function! rust#debugging#InfoToFile(filename) abort
|
||||
let l:expanded_filename = expand(a:filename)
|
||||
|
||||
redir => l:output
|
||||
silent call rust#debugging#Info()
|
||||
redir END
|
||||
|
||||
call writefile(split(l:output, "\n"), l:expanded_filename)
|
||||
call s:Echo('RustInfo written to ' . l:expanded_filename)
|
||||
endfunction
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
+222
-68
@@ -1,107 +1,261 @@
|
||||
" Author: Stephen Sugden <stephen@stephensugden.com>
|
||||
" Last Modified: 2023-09-11
|
||||
"
|
||||
" Adapted from https://github.com/fatih/vim-go
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
if !exists("g:rustfmt_autosave")
|
||||
let g:rustfmt_autosave = 0
|
||||
let g:rustfmt_autosave = 0
|
||||
endif
|
||||
|
||||
if !exists("g:rustfmt_command")
|
||||
let g:rustfmt_command = "rustfmt"
|
||||
let g:rustfmt_command = "rustfmt"
|
||||
endif
|
||||
|
||||
if !exists("g:rustfmt_options")
|
||||
let g:rustfmt_options = ""
|
||||
let g:rustfmt_options = ""
|
||||
endif
|
||||
|
||||
if !exists("g:rustfmt_fail_silently")
|
||||
let g:rustfmt_fail_silently = 0
|
||||
let g:rustfmt_fail_silently = 0
|
||||
endif
|
||||
|
||||
function! rustfmt#DetectVersion()
|
||||
" Save rustfmt '--help' for feature inspection
|
||||
silent let s:rustfmt_help = system(g:rustfmt_command . " --help")
|
||||
let s:rustfmt_unstable_features = s:rustfmt_help =~# "--unstable-features"
|
||||
|
||||
" Build a comparable rustfmt version variable out of its `--version` output:
|
||||
silent let l:rustfmt_version_full = system(g:rustfmt_command . " --version")
|
||||
let l:rustfmt_version_list = matchlist(l:rustfmt_version_full,
|
||||
\ '\vrustfmt ([0-9]+[.][0-9]+[.][0-9]+)')
|
||||
if len(l:rustfmt_version_list) < 3
|
||||
let s:rustfmt_version = "0"
|
||||
else
|
||||
let s:rustfmt_version = l:rustfmt_version_list[1]
|
||||
endif
|
||||
return s:rustfmt_version
|
||||
endfunction
|
||||
|
||||
call rustfmt#DetectVersion()
|
||||
|
||||
if !exists("g:rustfmt_emit_files")
|
||||
let g:rustfmt_emit_files = s:rustfmt_version >= "0.8.2"
|
||||
endif
|
||||
|
||||
if !exists("g:rustfmt_file_lines")
|
||||
let g:rustfmt_file_lines = s:rustfmt_help =~# "--file-lines JSON"
|
||||
endif
|
||||
|
||||
let s:got_fmt_error = 0
|
||||
|
||||
function! rustfmt#Load()
|
||||
" Utility call to get this script loaded, for debugging
|
||||
endfunction
|
||||
|
||||
function! s:RustfmtWriteMode()
|
||||
if g:rustfmt_emit_files
|
||||
return "--emit=files"
|
||||
else
|
||||
return "--write-mode=overwrite"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:RustfmtConfigOptions()
|
||||
let l:rustfmt_toml = findfile('rustfmt.toml', expand('%:p:h') . ';')
|
||||
if l:rustfmt_toml !=# ''
|
||||
return '--config-path '.shellescape(fnamemodify(l:rustfmt_toml, ":p"))
|
||||
endif
|
||||
|
||||
let l:_rustfmt_toml = findfile('.rustfmt.toml', expand('%:p:h') . ';')
|
||||
if l:_rustfmt_toml !=# ''
|
||||
return '--config-path '.shellescape(fnamemodify(l:_rustfmt_toml, ":p"))
|
||||
endif
|
||||
|
||||
" Default to edition 2018 in case no rustfmt.toml was found.
|
||||
return '--edition 2018'
|
||||
endfunction
|
||||
|
||||
function! s:RustfmtCommandRange(filename, line1, line2)
|
||||
let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]}
|
||||
return printf("%s %s --write-mode=overwrite --file-lines '[%s]'", g:rustfmt_command, g:rustfmt_options, json_encode(l:arg))
|
||||
if g:rustfmt_file_lines == 0
|
||||
echo "--file-lines is not supported in the installed `rustfmt` executable"
|
||||
return
|
||||
endif
|
||||
|
||||
let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]}
|
||||
let l:write_mode = s:RustfmtWriteMode()
|
||||
let l:rustfmt_config = s:RustfmtConfigOptions()
|
||||
|
||||
" FIXME: When --file-lines gets to be stable, add version range checking
|
||||
" accordingly.
|
||||
let l:unstable_features = s:rustfmt_unstable_features ? '--unstable-features' : ''
|
||||
|
||||
let l:cmd = printf("%s %s %s %s %s --file-lines '[%s]' %s", g:rustfmt_command,
|
||||
\ l:write_mode, g:rustfmt_options,
|
||||
\ l:unstable_features, l:rustfmt_config,
|
||||
\ json_encode(l:arg), shellescape(a:filename))
|
||||
return l:cmd
|
||||
endfunction
|
||||
|
||||
function! s:RustfmtCommand(filename)
|
||||
return g:rustfmt_command . " --write-mode=overwrite " . g:rustfmt_options . " " . shellescape(a:filename)
|
||||
function! s:RustfmtCommand()
|
||||
let write_mode = g:rustfmt_emit_files ? '--emit=stdout' : '--write-mode=display'
|
||||
let config = s:RustfmtConfigOptions()
|
||||
return join([g:rustfmt_command, write_mode, config, g:rustfmt_options])
|
||||
endfunction
|
||||
|
||||
function! s:RunRustfmt(command, curw, tmpname)
|
||||
if exists("*systemlist")
|
||||
let out = systemlist(a:command)
|
||||
else
|
||||
let out = split(system(a:command), '\r\?\n')
|
||||
endif
|
||||
function! s:DeleteLines(start, end) abort
|
||||
silent! execute a:start . ',' . a:end . 'delete _'
|
||||
endfunction
|
||||
|
||||
if v:shell_error == 0 || v:shell_error == 3
|
||||
" remove undo point caused via BufWritePre
|
||||
try | silent undojoin | catch | endtry
|
||||
function! s:RunRustfmt(command, tmpname, from_writepre)
|
||||
let l:view = winsaveview()
|
||||
|
||||
" Replace current file with temp file, then reload buffer
|
||||
call rename(a:tmpname, expand('%'))
|
||||
silent edit!
|
||||
let &syntax = &syntax
|
||||
let l:stderr_tmpname = tempname()
|
||||
call writefile([], l:stderr_tmpname)
|
||||
|
||||
" only clear location list if it was previously filled to prevent
|
||||
" clobbering other additions
|
||||
if s:got_fmt_error
|
||||
let s:got_fmt_error = 0
|
||||
call setloclist(0, [])
|
||||
lwindow
|
||||
endif
|
||||
elseif g:rustfmt_fail_silently == 0
|
||||
" otherwise get the errors and put them in the location list
|
||||
let errors = []
|
||||
let l:command = a:command . ' 2> ' . l:stderr_tmpname
|
||||
|
||||
for line in out
|
||||
" src/lib.rs:13:5: 13:10 error: expected `,`, or `}`, found `value`
|
||||
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\):\s*\(\d\+:\d\+\s*\)\?\s*error: \(.*\)')
|
||||
if !empty(tokens)
|
||||
call add(errors, {"filename": @%,
|
||||
\"lnum": tokens[2],
|
||||
\"col": tokens[3],
|
||||
\"text": tokens[5]})
|
||||
endif
|
||||
endfor
|
||||
if a:tmpname ==# ''
|
||||
" Rustfmt in stdin/stdout mode
|
||||
|
||||
if empty(errors)
|
||||
% | " Couldn't detect rustfmt error format, output errors
|
||||
endif
|
||||
" chdir to the directory of the file
|
||||
let l:has_lcd = haslocaldir()
|
||||
let l:prev_cd = getcwd()
|
||||
execute 'lchdir! '.expand('%:h')
|
||||
|
||||
if !empty(errors)
|
||||
call setloclist(0, errors, 'r')
|
||||
echohl Error | echomsg "rustfmt returned error" | echohl None
|
||||
endif
|
||||
let l:buffer = getline(1, '$')
|
||||
if exists("*systemlist")
|
||||
silent let out = systemlist(l:command, l:buffer)
|
||||
else
|
||||
silent let out = split(system(l:command,
|
||||
\ join(l:buffer, "\n")), '\r\?\n')
|
||||
endif
|
||||
else
|
||||
if exists("*systemlist")
|
||||
silent let out = systemlist(l:command)
|
||||
else
|
||||
silent let out = split(system(l:command), '\r\?\n')
|
||||
endif
|
||||
endif
|
||||
|
||||
let s:got_fmt_error = 1
|
||||
lwindow
|
||||
" We didn't use the temp file, so clean up
|
||||
call delete(a:tmpname)
|
||||
endif
|
||||
let l:stderr = readfile(l:stderr_tmpname)
|
||||
|
||||
call winrestview(a:curw)
|
||||
call delete(l:stderr_tmpname)
|
||||
|
||||
let l:open_lwindow = 0
|
||||
if v:shell_error == 0
|
||||
if a:from_writepre
|
||||
" remove undo point caused via BufWritePre
|
||||
try | silent undojoin | catch | endtry
|
||||
endif
|
||||
|
||||
if a:tmpname ==# ''
|
||||
let l:content = l:out
|
||||
else
|
||||
" take the tmpfile's content, this is better than rename
|
||||
" because it preserves file modes.
|
||||
let l:content = readfile(a:tmpname)
|
||||
endif
|
||||
|
||||
call s:DeleteLines(len(l:content), line('$'))
|
||||
call setline(1, l:content)
|
||||
|
||||
" only clear location list if it was previously filled to prevent
|
||||
" clobbering other additions
|
||||
if s:got_fmt_error
|
||||
let s:got_fmt_error = 0
|
||||
call setloclist(0, [])
|
||||
let l:open_lwindow = 1
|
||||
endif
|
||||
elseif g:rustfmt_fail_silently == 0 && !a:from_writepre
|
||||
" otherwise get the errors and put them in the location list
|
||||
let l:errors = []
|
||||
|
||||
let l:prev_line = ""
|
||||
for l:line in l:stderr
|
||||
" error: expected one of `;` or `as`, found `extern`
|
||||
" --> src/main.rs:2:1
|
||||
let tokens = matchlist(l:line, '^\s\+-->\s\(.\{-}\):\(\d\+\):\(\d\+\)$')
|
||||
if !empty(tokens)
|
||||
call add(l:errors, {"filename": @%,
|
||||
\"lnum": tokens[2],
|
||||
\"col": tokens[3],
|
||||
\"text": l:prev_line})
|
||||
endif
|
||||
let l:prev_line = l:line
|
||||
endfor
|
||||
|
||||
if !empty(l:errors)
|
||||
call setloclist(0, l:errors, 'r')
|
||||
echohl Error | echomsg "rustfmt returned error" | echohl None
|
||||
else
|
||||
echo "rust.vim: was not able to parse rustfmt messages. Here is the raw output:"
|
||||
echo "\n"
|
||||
for l:line in l:stderr
|
||||
echo l:line
|
||||
endfor
|
||||
endif
|
||||
|
||||
let s:got_fmt_error = 1
|
||||
let l:open_lwindow = 1
|
||||
endif
|
||||
|
||||
" Restore the current directory if needed
|
||||
if a:tmpname ==# ''
|
||||
if l:has_lcd
|
||||
execute 'lchdir! '.l:prev_cd
|
||||
else
|
||||
execute 'chdir! '.l:prev_cd
|
||||
endif
|
||||
endif
|
||||
|
||||
" Open lwindow after we have changed back to the previous directory
|
||||
if l:open_lwindow == 1
|
||||
lwindow
|
||||
endif
|
||||
|
||||
call winrestview(l:view)
|
||||
endfunction
|
||||
|
||||
function! rustfmt#FormatRange(line1, line2)
|
||||
let l:curw = winsaveview()
|
||||
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
|
||||
call writefile(getline(1, '$'), l:tmpname)
|
||||
|
||||
let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2)
|
||||
|
||||
call s:RunRustfmt(command, l:curw, l:tmpname)
|
||||
let l:tmpname = tempname()
|
||||
call writefile(getline(1, '$'), l:tmpname)
|
||||
let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2)
|
||||
call s:RunRustfmt(command, l:tmpname, v:false)
|
||||
call delete(l:tmpname)
|
||||
endfunction
|
||||
|
||||
function! rustfmt#Format()
|
||||
let l:curw = winsaveview()
|
||||
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
|
||||
call writefile(getline(1, '$'), l:tmpname)
|
||||
|
||||
let command = s:RustfmtCommand(l:tmpname)
|
||||
|
||||
call s:RunRustfmt(command, l:curw, l:tmpname)
|
||||
call s:RunRustfmt(s:RustfmtCommand(), '', v:false)
|
||||
endfunction
|
||||
|
||||
function! rustfmt#Cmd()
|
||||
" Mainly for debugging
|
||||
return s:RustfmtCommand()
|
||||
endfunction
|
||||
|
||||
function! rustfmt#PreWrite()
|
||||
if !filereadable(expand("%@"))
|
||||
return
|
||||
endif
|
||||
if rust#GetConfigVar('rustfmt_autosave_if_config_present', 0)
|
||||
if findfile('rustfmt.toml', '.;') !=# '' || findfile('.rustfmt.toml', '.;') !=# ''
|
||||
let b:rustfmt_autosave = 1
|
||||
let b:_rustfmt_autosave_because_of_config = 1
|
||||
endif
|
||||
else
|
||||
if has_key(b:, '_rustfmt_autosave_because_of_config')
|
||||
unlet b:_rustfmt_autosave_because_of_config
|
||||
unlet b:rustfmt_autosave
|
||||
endif
|
||||
endif
|
||||
|
||||
if !rust#GetConfigVar("rustfmt_autosave", 0)
|
||||
return
|
||||
endif
|
||||
|
||||
call s:RunRustfmt(s:RustfmtCommand(), '', v:true)
|
||||
endfunction
|
||||
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
@@ -97,7 +97,7 @@ enddef
|
||||
|
||||
# Public interface {{{
|
||||
# When a TeX document is split into several source files, each source file
|
||||
# may contain a "magic line" specifiying the "root" file, e.g.:
|
||||
# may contain a "magic line" specifying the "root" file, e.g.:
|
||||
#
|
||||
# % !TEX root = main.tex
|
||||
#
|
||||
|
||||
@@ -111,11 +111,11 @@ please check the following items:
|
||||
- Do not use hard coded escape sequences, these will not work in other
|
||||
terminals. Always use #RRGGBB for the GUI.
|
||||
|
||||
- When targetting 8-16 colors terminals, don't count on "darkblue" to be blue
|
||||
- When targeting 8-16 colors terminals, don't count on "darkblue" to be blue
|
||||
and dark, or on "2" to be even vaguely reddish. Names are more portable
|
||||
than numbers, though.
|
||||
|
||||
- When targetting 256 colors terminals, prefer colors 16-255 to colors 0-15
|
||||
- When targeting 256 colors terminals, prefer colors 16-255 to colors 0-15
|
||||
for the same reason.
|
||||
|
||||
- Typographic attributes (bold, italic, underline, reverse, etc.) are not
|
||||
|
||||
+26
-10
@@ -1,35 +1,51 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Cargo Compiler
|
||||
" Maintainer: Damien Radtke <damienradtke@gmail.com>
|
||||
" Latest Revision: 2014 Sep 24
|
||||
" Latest Revision: 2023-09-11
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
if exists('current_compiler')
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
runtime compiler/rustc.vim
|
||||
let current_compiler = "cargo"
|
||||
|
||||
" vint: -ProhibitAbbreviationOption
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
" vint: +ProhibitAbbreviationOption
|
||||
|
||||
if exists(':CompilerSet') != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
if exists('g:cargo_makeprg_params')
|
||||
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
|
||||
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
|
||||
else
|
||||
CompilerSet makeprg=cargo\ $*
|
||||
CompilerSet makeprg=cargo\ $*
|
||||
endif
|
||||
|
||||
augroup RustCargoQuickFixHooks
|
||||
autocmd!
|
||||
autocmd QuickFixCmdPre make call cargo#quickfix#CmdPre()
|
||||
autocmd QuickFixCmdPost make call cargo#quickfix#CmdPost()
|
||||
augroup END
|
||||
|
||||
" Ignore general cargo progress messages
|
||||
CompilerSet errorformat+=
|
||||
\%-G%\\s%#Downloading%.%#,
|
||||
\%-G%\\s%#Compiling%.%#,
|
||||
\%-G%\\s%#Finished%.%#,
|
||||
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
|
||||
\%-G%\\s%#To\ learn\ more\\,%.%#
|
||||
\%-G%\\s%#Downloading%.%#,
|
||||
\%-G%\\s%#Checking%.%#,
|
||||
\%-G%\\s%#Compiling%.%#,
|
||||
\%-G%\\s%#Finished%.%#,
|
||||
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
|
||||
\%-G%\\s%#To\ learn\ more\\,%.%#,
|
||||
\%-G%\\s%#For\ more\ information\ about\ this\ error\\,%.%#,
|
||||
\%-Gnote:\ Run\ with\ \`RUST_BACKTRACE=%.%#,
|
||||
\%.%#panicked\ at\ \\'%m\\'\\,\ %f:%l:%c
|
||||
|
||||
" vint: -ProhibitAbbreviationOption
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vint: +ProhibitAbbreviationOption
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
+38
-27
@@ -1,46 +1,57 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Rust Compiler
|
||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||
" Latest Revision: 2013 Jul 12
|
||||
" Latest Revision: 2023-09-11
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "rustc"
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
" vint: -ProhibitAbbreviationOption
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
" vint: +ProhibitAbbreviationOption
|
||||
|
||||
if exists(":CompilerSet") != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0
|
||||
CompilerSet makeprg=rustc
|
||||
if get(g:, 'rustc_makeprg_no_percent', 0)
|
||||
CompilerSet makeprg=rustc
|
||||
else
|
||||
CompilerSet makeprg=rustc\ \%:S
|
||||
if has('patch-7.4.191')
|
||||
CompilerSet makeprg=rustc\ \%:S
|
||||
else
|
||||
CompilerSet makeprg=rustc\ \"%\"
|
||||
endif
|
||||
endif
|
||||
|
||||
" Old errorformat (before nightly 2016/08/10)
|
||||
CompilerSet errorformat=
|
||||
\%f:%l:%c:\ %t%*[^:]:\ %m,
|
||||
\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
|
||||
\%-G%f:%l\ %s,
|
||||
\%-G%*[\ ]^,
|
||||
\%-G%*[\ ]^%*[~],
|
||||
\%-G%*[\ ]...
|
||||
|
||||
" New errorformat (after nightly 2016/08/10)
|
||||
CompilerSet errorformat+=
|
||||
\%-G,
|
||||
\%-Gerror:\ aborting\ %.%#,
|
||||
\%-Gerror:\ Could\ not\ compile\ %.%#,
|
||||
\%Eerror:\ %m,
|
||||
\%Eerror[E%n]:\ %m,
|
||||
\%Wwarning:\ %m,
|
||||
\%Inote:\ %m,
|
||||
\%C\ %#-->\ %f:%l:%c
|
||||
CompilerSet errorformat=
|
||||
\%-G,
|
||||
\%-Gerror:\ aborting\ %.%#,
|
||||
\%-Gerror:\ Could\ not\ compile\ %.%#,
|
||||
\%Eerror:\ %m,
|
||||
\%Eerror[E%n]:\ %m,
|
||||
\%Wwarning:\ %m,
|
||||
\%Inote:\ %m,
|
||||
\%C\ %#-->\ %f:%l:%c,
|
||||
\%E\ \ left:%m,%C\ right:%m\ %f:%l:%c,%Z
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
" Old errorformat (before nightly 2016/08/10)
|
||||
CompilerSet errorformat+=
|
||||
\%f:%l:%c:\ %t%*[^:]:\ %m,
|
||||
\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
|
||||
\%-G%f:%l\ %s,
|
||||
\%-G%*[\ ]^,
|
||||
\%-G%*[\ ]^%*[~],
|
||||
\%-G%*[\ ]...
|
||||
|
||||
" vint: -ProhibitAbbreviationOption
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vint: +ProhibitAbbreviationOption
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
+41
-26
@@ -1,4 +1,4 @@
|
||||
*builtin.txt* For Vim version 9.0. Last change: 2023 Aug 09
|
||||
*builtin.txt* For Vim version 9.0. Last change: 2023 Sep 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1857,7 +1857,7 @@ cosh({expr}) *cosh()*
|
||||
Compute()->cosh()
|
||||
|
||||
|
||||
count({comp}, {expr} [, {ic} [, {start}]]) *count()*
|
||||
count({comp}, {expr} [, {ic} [, {start}]]) *count()* *E706*
|
||||
Return the number of times an item with value {expr} appears
|
||||
in |String|, |List| or |Dictionary| {comp}.
|
||||
|
||||
@@ -3930,6 +3930,8 @@ getmousepos() *getmousepos()*
|
||||
wincol column inside "winid"
|
||||
line text line inside "winid"
|
||||
column text column inside "winid"
|
||||
coladd offset (in screen columns) from the
|
||||
start of the clicked char
|
||||
All numbers are 1-based.
|
||||
|
||||
If not over a window, e.g. when in the command line, then only
|
||||
@@ -5054,12 +5056,14 @@ insert({object}, {item} [, {idx}]) *insert()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
mylist->insert(item)
|
||||
|
||||
instanceof({object}, {class}) *instanceof()*
|
||||
The result is a Number, which is |TRUE| when the {object} argument is a
|
||||
direct or indirect instance of a |Class| specified by {class}.
|
||||
When {class} is a |List| the function returns |TRUE| when {object} is an
|
||||
instance of any of the specified classes.
|
||||
<
|
||||
*instanceof()* *E614* *E616* *E693*
|
||||
instanceof({object}, {class})
|
||||
The result is a Number, which is |TRUE| when the {object}
|
||||
argument is a direct or indirect instance of a |Class|
|
||||
specified by {class}.
|
||||
When {class} is a |List| the function returns |TRUE| when
|
||||
{object} is an instance of any of the specified classes.
|
||||
Example: >
|
||||
instanceof(animal, [Dog, Cat])
|
||||
|
||||
@@ -6690,7 +6694,6 @@ printf({fmt}, {expr1} ...) *printf()*
|
||||
precision, the argument(s) to be used must also be specified
|
||||
using a {n$} positional argument specifier. See |printf-$|.
|
||||
|
||||
|
||||
The conversion specifiers and their meanings are:
|
||||
|
||||
*printf-d* *printf-b* *printf-B* *printf-o*
|
||||
@@ -6832,57 +6835,65 @@ printf({fmt}, {expr1} ...) *printf()*
|
||||
echo printf("%1$*2$.*3$f", 1.4142135, 6, 2)
|
||||
< 1.41
|
||||
|
||||
*E1400*
|
||||
*E1500*
|
||||
You cannot mix positional and non-positional arguments: >
|
||||
echo printf("%s%1$s", "One", "Two")
|
||||
< E1400: Cannot mix positional and non-positional
|
||||
< E1500: Cannot mix positional and non-positional
|
||||
arguments: %s%1$s
|
||||
|
||||
*E1401*
|
||||
*E1501*
|
||||
You cannot skip a positional argument in a format string: >
|
||||
echo printf("%3$s%1$s", "One", "Two", "Three")
|
||||
< E1401: format argument 2 unused in $-style
|
||||
< E1501: format argument 2 unused in $-style
|
||||
format: %3$s%1$s
|
||||
|
||||
*E1402*
|
||||
*E1502*
|
||||
You can re-use a [field-width] (or [precision]) argument: >
|
||||
echo printf("%1$d at width %2$d is: %01$*2$d", 1, 2)
|
||||
< 1 at width 2 is: 01
|
||||
|
||||
However, you can't use it as a different type: >
|
||||
echo printf("%1$d at width %2$ld is: %01$*2$d", 1, 2)
|
||||
< E1402: Positional argument 2 used as field
|
||||
< E1502: Positional argument 2 used as field
|
||||
width reused as different type: long int/int
|
||||
|
||||
*E1403*
|
||||
*E1503*
|
||||
When a positional argument is used, but not the correct number
|
||||
or arguments is given, an error is raised: >
|
||||
echo printf("%1$d at width %2$d is: %01$*2$.*3$d", 1, 2)
|
||||
< E1403: Positional argument 3 out of bounds:
|
||||
< E1503: Positional argument 3 out of bounds:
|
||||
%1$d at width %2$d is: %01$*2$.*3$d
|
||||
|
||||
Only the first error is reported: >
|
||||
echo printf("%01$*2$.*3$d %4$d", 1, 2)
|
||||
< E1403: Positional argument 3 out of bounds:
|
||||
< E1503: Positional argument 3 out of bounds:
|
||||
%01$*2$.*3$d %4$d
|
||||
|
||||
*E1404*
|
||||
*E1504*
|
||||
A positional argument can be used more than once: >
|
||||
echo printf("%1$s %2$s %1$s", "One", "Two")
|
||||
< One Two One
|
||||
|
||||
However, you can't use a different type the second time: >
|
||||
echo printf("%1$s %2$s %1$d", "One", "Two")
|
||||
< E1404: Positional argument 1 type used
|
||||
< E1504: Positional argument 1 type used
|
||||
inconsistently: int/string
|
||||
|
||||
*E1405*
|
||||
*E1505*
|
||||
Various other errors that lead to a format string being
|
||||
wrongly formatted lead to: >
|
||||
echo printf("%1$d at width %2$d is: %01$*2$.3$d", 1, 2)
|
||||
< E1405: Invalid format specifier:
|
||||
< E1505: Invalid format specifier:
|
||||
%1$d at width %2$d is: %01$*2$.3$d
|
||||
|
||||
*E1507*
|
||||
This internal error indicates that the logic to parse a
|
||||
positional format argument ran into a problem that couldn't be
|
||||
otherwise reported. Please file a bug against Vim if you run
|
||||
into this, copying the exact format string and parameters that
|
||||
were 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|.
|
||||
@@ -9467,7 +9478,7 @@ strutf16len({string} [, {countcc}]) *strutf16len()*
|
||||
echo strutf16len('😊') returns 2
|
||||
echo strutf16len('ą́') returns 1
|
||||
echo strutf16len('ą́', v:true) returns 3
|
||||
|
||||
<
|
||||
Can also be used as a |method|: >
|
||||
GetText()->strutf16len()
|
||||
<
|
||||
@@ -10132,9 +10143,9 @@ trim({text} [, {mask} [, {dir}]]) *trim()*
|
||||
Return {text} as a String where any character in {mask} is
|
||||
removed from the beginning and/or end of {text}.
|
||||
|
||||
If {mask} is not given, {mask} is all characters up to 0x20,
|
||||
which includes Tab, space, NL and CR, plus the non-breaking
|
||||
space character 0xa0.
|
||||
If {mask} is not given, or is an empty string, {mask} is all
|
||||
characters up to 0x20, which includes Tab, space, NL and CR,
|
||||
plus the non-breaking space character 0xa0.
|
||||
|
||||
The optional {dir} argument specifies where to remove the
|
||||
characters:
|
||||
@@ -10391,6 +10402,8 @@ virtcol2col({winid}, {lnum}, {col}) *virtcol2col()*
|
||||
character in window {winid} at buffer line {lnum} and virtual
|
||||
column {col}.
|
||||
|
||||
If buffer line {lnum} is an empty line, 0 is returned.
|
||||
|
||||
If {col} is greater than the last virtual column in line
|
||||
{lnum}, then the byte index of the character at the last
|
||||
virtual column is returned.
|
||||
@@ -11106,6 +11119,8 @@ winaltkeys Compiled with 'winaltkeys' option.
|
||||
windows Compiled with support for more than one window.
|
||||
(always true)
|
||||
writebackup Compiled with 'writebackup' default on.
|
||||
xattr Compiled with extended attributes support |xattr|
|
||||
(currently only supported on Linux).
|
||||
xfontset Compiled with X fontset support |xfontset|.
|
||||
xim Compiled with X input method support |xim|.
|
||||
xpm Compiled with pixmap support.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 9.0. Last change: 2023 Mar 07
|
||||
*change.txt* For Vim version 9.0. Last change: 2023 Sep 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -210,6 +210,7 @@ gR Enter Virtual Replace mode: Each character you type
|
||||
|
||||
*v_r*
|
||||
{Visual}r{char} Replace all selected characters by {char}.
|
||||
CTRL-C will be inserted literally.
|
||||
|
||||
*v_C*
|
||||
{Visual}["x]C Delete the highlighted lines [into register x] and
|
||||
|
||||
+35
-13
@@ -90,9 +90,11 @@ CTRL-SHIFT-Q Works just like CTRL-V, unless |modifyOtherKeys| is active,
|
||||
In the GUI the |key-notation| is inserted without simplifying.
|
||||
|
||||
*c_<Left>* *c_Left*
|
||||
<Left> cursor left
|
||||
<Left> cursor left. See 'wildmenu' for behavior during wildmenu
|
||||
completion mode.
|
||||
*c_<Right>* *c_Right*
|
||||
<Right> cursor right
|
||||
<Right> cursor right. See 'wildmenu' for behavior during wildmenu
|
||||
completion mode.
|
||||
*c_<S-Left>*
|
||||
<S-Left> or <C-Left> *c_<C-Left>*
|
||||
cursor one WORD left
|
||||
@@ -102,7 +104,8 @@ CTRL-SHIFT-Q Works just like CTRL-V, unless |modifyOtherKeys| is active,
|
||||
CTRL-B or <Home> *c_CTRL-B* *c_<Home>* *c_Home*
|
||||
cursor to beginning of command-line
|
||||
CTRL-E or <End> *c_CTRL-E* *c_<End>* *c_End*
|
||||
cursor to end of command-line
|
||||
cursor to end of command-line. See 'wildmenu' for behavior
|
||||
during wildmenu completion mode.
|
||||
|
||||
*c_<LeftMouse>*
|
||||
<LeftMouse> Move the cursor to the position of the mouse click.
|
||||
@@ -237,6 +240,7 @@ CTRL-\ e {expr} *c_CTRL-\_e*
|
||||
CTRL-Y When there is a modeless selection, copy the selection into
|
||||
the clipboard. |modeless-selection|
|
||||
If there is no selection CTRL-Y is inserted as a character.
|
||||
See 'wildmenu' for behavior during wildmenu completion mode.
|
||||
|
||||
CTRL-M or CTRL-J *c_CTRL-M* *c_CTRL-J* *c_<NL>* *c_<CR>* *c_CR*
|
||||
<CR> or <NL> start entered command
|
||||
@@ -252,12 +256,14 @@ CTRL-C quit command-line without executing
|
||||
|
||||
*c_<Up>* *c_Up*
|
||||
<Up> recall older command-line from history, whose beginning
|
||||
matches the current command-line (see below).
|
||||
matches the current command-line (see below). See 'wildmenu'
|
||||
for behavior during wildmenu completion mode.
|
||||
{not available when compiled without the |+cmdline_hist|
|
||||
feature}
|
||||
*c_<Down>* *c_Down*
|
||||
<Down> recall more recent command-line from history, whose beginning
|
||||
matches the current command-line (see below).
|
||||
matches the current command-line (see below). See 'wildmenu'
|
||||
for behavior during wildmenu completion mode.
|
||||
{not available when compiled without the |+cmdline_hist|
|
||||
feature}
|
||||
|
||||
@@ -381,6 +387,7 @@ When editing the command-line, a few commands can be used to complete the
|
||||
word before the cursor. This is available for:
|
||||
|
||||
- Command names: At the start of the command-line.
|
||||
- |++opt| values.
|
||||
- Tags: Only after the ":tag" command.
|
||||
- File names: Only after a command that accepts a file name or a setting for
|
||||
an option that can be set to a file name. This is called file name
|
||||
@@ -463,11 +470,16 @@ When repeating 'wildchar' or CTRL-N you cycle through the matches, eventually
|
||||
ending up back to what was typed. If the first match is not what you wanted,
|
||||
you can use <S-Tab> or CTRL-P to go straight back to what you typed.
|
||||
|
||||
The 'wildignorecase' option can be set to ignore case in filenames.
|
||||
|
||||
The 'wildmenu' option can be set to show the matches just above the command
|
||||
line.
|
||||
|
||||
The 'wildoptions' option provides additional configuration to use a popup menu
|
||||
for 'wildmenu', and to use fuzzy matching.
|
||||
|
||||
The 'wildignorecase' option can be set to ignore case in filenames. For
|
||||
completing other texts (e.g. command names), the 'ignorecase' option is used
|
||||
instead (fuzzy matching always ignores case, however).
|
||||
|
||||
If you like tcsh's autolist completion, you can use this mapping:
|
||||
:cnoremap X <C-L><C-D>
|
||||
(Where X is the command key to use, <C-L> is CTRL-L and <C-D> is CTRL-D)
|
||||
@@ -517,16 +529,26 @@ example, to match only files that end in ".c": >
|
||||
:e *.c$
|
||||
This will not match a file ending in ".cpp". Without the "$" it does match.
|
||||
|
||||
The old value of an option can be obtained by hitting 'wildchar' just after
|
||||
the '='. For example, typing 'wildchar' after ":set dir=" will insert the
|
||||
current value of 'dir'. This overrules file name completion for the options
|
||||
that take a file name.
|
||||
|
||||
If you would like using <S-Tab> for CTRL-P in an xterm, put this command in
|
||||
your .cshrc: >
|
||||
xmodmap -e "keysym Tab = Tab Find"
|
||||
And this in your .vimrc: >
|
||||
:cmap <Esc>[1~ <C-P>
|
||||
< *complete-set-option*
|
||||
When setting an option using |:set=|, the old value of an option can be
|
||||
obtained by hitting 'wildchar' just after the '='. For example, typing
|
||||
'wildchar' after ":set dir=" will insert the current value of 'dir'. This
|
||||
overrules file name completion for the options that take a file name.
|
||||
|
||||
When using |:set=|, |:set+=|, or |:set^=|, string options that have
|
||||
pre-defined names or syntax (e.g. 'diffopt', 'listchars') or are a list of
|
||||
single-character flags (e.g. 'shortmess') will also present a list of possible
|
||||
values for completion when using 'wildchar'.
|
||||
|
||||
When using |:set-=|, comma-separated options like 'diffopt' or 'backupdir'
|
||||
will show each item separately. Flag list options like 'shortmess' will show
|
||||
both the entire old value and the individual flags. Otherwise completion will
|
||||
just fill in with the entire old value.
|
||||
|
||||
==============================================================================
|
||||
3. Ex command-lines *cmdline-lines*
|
||||
@@ -778,7 +800,7 @@ An example for subtracting (which isn't very useful): >
|
||||
On this text:
|
||||
1 one ~
|
||||
2 two ~
|
||||
3 three FOLDED~
|
||||
3 three FOLDED ~
|
||||
4 four FOLDED ~
|
||||
5 five FOLDED ~
|
||||
6 six FOLDED ~
|
||||
|
||||
+11
-2
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 9.0. Last change: 2023 Apr 23
|
||||
*editing.txt* For Vim version 9.0. Last change: 2023 Sep 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -385,7 +385,9 @@ as a wildcard when "[" is in the 'isfname' option. A simple way to avoid this
|
||||
is to use "path\[[]abc]", this matches the file "path\[abc]".
|
||||
|
||||
*starstar-wildcard*
|
||||
Expanding "**" is possible on Unix, Win32, macOS and a few other systems.
|
||||
Expanding "**" is possible on Unix, Win32, macOS and a few other systems (but
|
||||
it may depend on your 'shell' setting on Unix and macOS. It's known to work
|
||||
correctly for zsh; for bash this requires at least bash version >= 4.X).
|
||||
This allows searching a directory tree. This goes up to 100 directories deep.
|
||||
Note there are some commands where this works slightly differently, see
|
||||
|file-searching|.
|
||||
@@ -1095,6 +1097,13 @@ will get the ACL info of the original file.
|
||||
The ACL info is also used to check if a file is read-only (when opening the
|
||||
file).
|
||||
|
||||
*xattr* *E1506* *E1508* *E1509*
|
||||
xattr stands for Extended Attributes. It is an advanced way to save metadata
|
||||
alongside the file in the filesystem. It depends on the actual filesystem
|
||||
being used and Vim supports it only on a Linux system.
|
||||
Vim attempts to preserve the extended attribute info when writing a file.
|
||||
The backup file will get the extended attribute of the original file.
|
||||
|
||||
*read-only-share*
|
||||
When MS-Windows shares a drive on the network it can be marked as read-only.
|
||||
This means that even if the file read-only attribute is absent, and the ACL
|
||||
|
||||
@@ -2436,7 +2436,7 @@ v:progpath Contains the command with which Vim was invoked, in a form
|
||||
".exe" is not added to v:progpath.
|
||||
Read-only.
|
||||
|
||||
*v:python3_version* *python3-version-variable*
|
||||
*v:python3_version* *python3-version-variable*
|
||||
v:python3_version
|
||||
Version of Python 3 that Vim was built against. When
|
||||
Python is loaded dynamically (|python-dynamic|), this version
|
||||
@@ -3140,6 +3140,10 @@ text...
|
||||
< You may want to make a copy of a list to avoid this.
|
||||
See |deepcopy()|.
|
||||
|
||||
*E1391* *E1392*
|
||||
Locking and unlocking object and class variables is
|
||||
currently NOT supported.
|
||||
|
||||
|
||||
:unlo[ckvar][!] [depth] {name} ... *:unlockvar* *:unlo* *E1246*
|
||||
Unlock the internal variable {name}. Does the
|
||||
|
||||
@@ -433,7 +433,7 @@ So to enable this only for ruby, set the following variable: >
|
||||
:let g:ruby_exec = 1
|
||||
|
||||
If both, the global `plugin_exec` and the `<filetype>_exec` specific variable
|
||||
are set, the filetpe specific variable should have precedent.
|
||||
are set, the filetype specific variable should have precedent.
|
||||
|
||||
AWK *ft-awk-plugin*
|
||||
|
||||
|
||||
+320
-73
@@ -1,70 +1,72 @@
|
||||
*ft_rust.txt* For Vim version 9.0. Last change: 2022 Oct 17
|
||||
|
||||
This is documentation for the Rust filetype plugin.
|
||||
*ft_rust.txt* Filetype plugin for Rust
|
||||
|
||||
==============================================================================
|
||||
CONTENTS *rust*
|
||||
CONTENTS *rust*
|
||||
|
||||
1. Introduction |rust-intro|
|
||||
2. Settings |rust-settings|
|
||||
3. Commands |rust-commands|
|
||||
4. Mappings |rust-mappings|
|
||||
1. Introduction |rust-intro|
|
||||
2. Settings |rust-settings|
|
||||
3. Commands |rust-commands|
|
||||
4. Mappings |rust-mappings|
|
||||
|
||||
==============================================================================
|
||||
INTRODUCTION *rust-intro*
|
||||
INTRODUCTION *rust-intro*
|
||||
|
||||
This plugin provides syntax and supporting functionality for the Rust
|
||||
filetype.
|
||||
filetype. It requires Vim 8 or higher for full functionality. Some commands
|
||||
will not work on earlier versions.
|
||||
|
||||
==============================================================================
|
||||
SETTINGS *rust-settings*
|
||||
SETTINGS *rust-settings*
|
||||
|
||||
This plugin has a few variables you can define in your vimrc that change the
|
||||
behavior of the plugin.
|
||||
|
||||
*g:rustc_path*
|
||||
Some variables can be set buffer local (`:b` prefix), and the buffer local
|
||||
will take precedence over the global `g:` counterpart.
|
||||
|
||||
*g:rustc_path*
|
||||
g:rustc_path~
|
||||
Set this option to the path to rustc for use in the |:RustRun| and
|
||||
|:RustExpand| commands. If unset, "rustc" will be located in $PATH: >
|
||||
let g:rustc_path = $HOME .. "/bin/rustc"
|
||||
let g:rustc_path = $HOME."/bin/rustc"
|
||||
<
|
||||
|
||||
*g:rustc_makeprg_no_percent*
|
||||
*g:rustc_makeprg_no_percent*
|
||||
g:rustc_makeprg_no_percent~
|
||||
Set this option to 1 to have 'makeprg' default to "rustc" instead of
|
||||
"rustc %": >
|
||||
let g:rustc_makeprg_no_percent = 1
|
||||
<
|
||||
|
||||
*g:rust_conceal*
|
||||
*g:rust_conceal*
|
||||
g:rust_conceal~
|
||||
Set this option to turn on the basic |conceal| support: >
|
||||
let g:rust_conceal = 1
|
||||
<
|
||||
|
||||
*g:rust_conceal_mod_path*
|
||||
*g:rust_conceal_mod_path*
|
||||
g:rust_conceal_mod_path~
|
||||
Set this option to turn on |conceal| for the path connecting token
|
||||
"::": >
|
||||
let g:rust_conceal_mod_path = 1
|
||||
<
|
||||
|
||||
*g:rust_conceal_pub*
|
||||
*g:rust_conceal_pub*
|
||||
g:rust_conceal_pub~
|
||||
Set this option to turn on |conceal| for the "pub" token: >
|
||||
let g:rust_conceal_pub = 1
|
||||
<
|
||||
|
||||
*g:rust_recommended_style*
|
||||
*g:rust_recommended_style*
|
||||
g:rust_recommended_style~
|
||||
Set this option to enable vim indentation and textwidth settings to
|
||||
conform to style conventions of the rust standard library (i.e. use 4
|
||||
spaces for indents and sets 'textwidth' to 99). This option is enabled
|
||||
Set this option to enable vim indentation and textwidth settings to
|
||||
conform to style conventions of the rust standard library (i.e. use 4
|
||||
spaces for indents and sets 'textwidth' to 99). This option is enabled
|
||||
by default. To disable it: >
|
||||
let g:rust_recommended_style = 0
|
||||
<
|
||||
|
||||
*g:rust_fold*
|
||||
*g:rust_fold*
|
||||
g:rust_fold~
|
||||
Set this option to turn on |folding|: >
|
||||
let g:rust_fold = 1
|
||||
@@ -76,63 +78,303 @@ g:rust_fold~
|
||||
2 Braced blocks are folded. 'foldlevel' is left at the
|
||||
global value (all folds are closed by default).
|
||||
|
||||
*g:rust_bang_comment_leader*
|
||||
*g:rust_bang_comment_leader*
|
||||
g:rust_bang_comment_leader~
|
||||
Set this option to 1 to preserve the leader on multi-line doc comments
|
||||
using the /*! syntax: >
|
||||
let g:rust_bang_comment_leader = 1
|
||||
<
|
||||
|
||||
*g:ftplugin_rust_source_path*
|
||||
*g:rust_use_custom_ctags_defs*
|
||||
g:rust_use_custom_ctags_defs~
|
||||
Set this option to 1 if you have customized ctags definitions for Rust
|
||||
and do not wish for those included with rust.vim to be used: >
|
||||
let g:rust_use_custom_ctags_defs = 1
|
||||
<
|
||||
|
||||
NOTE: rust.vim's built-in definitions are only used for the Tagbar Vim
|
||||
plugin, if you have it installed, AND if Universal Ctags is not
|
||||
detected. This is because Universal Ctags already has built-in
|
||||
support for Rust when used with Tagbar.
|
||||
|
||||
Also, note that when using ctags other than Universal Ctags, it is not
|
||||
automatically used when generating |tags| files that Vim can use to
|
||||
navigate to definitions across different source files. Feel free to
|
||||
copy `rust.vim/ctags/rust.ctags` into your own `~/.ctags` if you wish
|
||||
to generate |tags| files.
|
||||
|
||||
|
||||
*g:ftplugin_rust_source_path*
|
||||
g:ftplugin_rust_source_path~
|
||||
Set this option to a path that should be prepended to 'path' for Rust
|
||||
source files: >
|
||||
let g:ftplugin_rust_source_path = $HOME .. '/dev/rust'
|
||||
let g:ftplugin_rust_source_path = $HOME.'/dev/rust'
|
||||
<
|
||||
|
||||
*g:rustfmt_command*
|
||||
*g:rustfmt_command*
|
||||
g:rustfmt_command~
|
||||
Set this option to the name of the 'rustfmt' executable in your $PATH. If
|
||||
not specified it defaults to 'rustfmt' : >
|
||||
let g:rustfmt_command = 'rustfmt'
|
||||
<
|
||||
*g:rustfmt_autosave*
|
||||
*g:rustfmt_autosave*
|
||||
g:rustfmt_autosave~
|
||||
Set this option to 1 to run |:RustFmt| automatically when saving a
|
||||
buffer. If not specified it defaults to 0 : >
|
||||
let g:rustfmt_autosave = 0
|
||||
<
|
||||
*g:rustfmt_fail_silently*
|
||||
There is also a buffer-local b:rustfmt_autosave that can be set for
|
||||
the same purpose, and can override the global setting.
|
||||
|
||||
*g:rustfmt_autosave_if_config_present*
|
||||
g:rustfmt_autosave_if_config_present~
|
||||
Set this option to 1 to have *b:rustfmt_autosave* be set automatically
|
||||
if a `rustfmt.toml` file is present in any parent directly leading to
|
||||
the file being edited. If not set, default to 0: >
|
||||
let g:rustfmt_autosave_if_config_present = 0
|
||||
<
|
||||
This is useful to have `rustfmt` only execute on save, on projects
|
||||
that have `rustfmt.toml` configuration.
|
||||
|
||||
There is also a buffer-local b:rustfmt_autosave_if_config_present
|
||||
that can be set for the same purpose, which can overrides the global
|
||||
setting.
|
||||
*g:rustfmt_fail_silently*
|
||||
g:rustfmt_fail_silently~
|
||||
Set this option to 1 to prevent 'rustfmt' from populating the
|
||||
|location-list| with errors. If not specified it defaults to 0: >
|
||||
let g:rustfmt_fail_silently = 0
|
||||
<
|
||||
*g:rustfmt_options*
|
||||
*g:rustfmt_options*
|
||||
g:rustfmt_options~
|
||||
Set this option to a string of options to pass to 'rustfmt'. The
|
||||
write-mode is already set to 'overwrite'. If not specified it
|
||||
defaults to '' : >
|
||||
let g:rustfmt_options = ''
|
||||
<
|
||||
*g:rustfmt_emit_files*
|
||||
g:rustfmt_emit_files~
|
||||
If not specified rust.vim tries to detect the right parameter to
|
||||
pass to rustfmt based on its reported version. Otherwise, it
|
||||
determines whether to run rustfmt with '--emit=files' (when 1 is
|
||||
provided) instead of '--write-mode=overwrite'. >
|
||||
let g:rustfmt_emit_files = 0
|
||||
|
||||
*g:rust_playpen_url*
|
||||
|
||||
*g:rust_playpen_url*
|
||||
g:rust_playpen_url~
|
||||
Set this option to override the URL for the playpen to use: >
|
||||
Set this option to override the url for the playpen to use: >
|
||||
let g:rust_playpen_url = 'https://play.rust-lang.org/'
|
||||
<
|
||||
|
||||
*g:rust_shortener_url*
|
||||
*g:rust_shortener_url*
|
||||
g:rust_shortener_url~
|
||||
Set this option to override the URL for the URL shortener: >
|
||||
Set this option to override the url for the url shortener: >
|
||||
let g:rust_shortener_url = 'https://is.gd/'
|
||||
<
|
||||
|
||||
*g:rust_clip_command*
|
||||
g:rust_clip_command~
|
||||
Set this option to the command used in your OS to copy the Rust Play
|
||||
url to the clipboard: >
|
||||
let g:rust_clip_command = 'xclip -selection clipboard'
|
||||
<
|
||||
|
||||
*g:cargo_makeprg_params*
|
||||
g:cargo_makeprg_params~
|
||||
Set this option to the string of parameters to pass to cargo. If not
|
||||
specified it defaults to '$*' : >
|
||||
let g:cargo_makeprg_params = 'build'
|
||||
<
|
||||
|
||||
*g:cargo_shell_command_runner*
|
||||
g:cargo_shell_command_runner~
|
||||
Set this option to change how to run shell commands for cargo commands
|
||||
|:Cargo|, |:Cbuild|, |:Crun|, ...
|
||||
By default, |:terminal| is used to run shell command in terminal window
|
||||
asynchronously. But if you prefer |:!| for running the commands, it can
|
||||
be specified: >
|
||||
let g:cargo_shell_command_runner = '!'
|
||||
<
|
||||
|
||||
|
||||
Integration with Syntastic *rust-syntastic*
|
||||
--------------------------
|
||||
|
||||
This plugin automatically integrates with the Syntastic checker. There are two
|
||||
checkers provided: 'rustc', and 'cargo'. The latter invokes 'Cargo' in order to
|
||||
build code, and the former delivers a single edited '.rs' file as a compilation
|
||||
target directly to the Rust compiler, `rustc`.
|
||||
|
||||
Because Cargo is almost exclusively being used for building Rust code these
|
||||
days, 'cargo' is the default checker. >
|
||||
|
||||
let g:syntastic_rust_checkers = ['cargo']
|
||||
<
|
||||
If you would like to change it, you can set `g:syntastic_rust_checkers` to a
|
||||
different value.
|
||||
*g:rust_cargo_avoid_whole_workspace*
|
||||
*b:rust_cargo_avoid_whole_workspace*
|
||||
g:rust_cargo_avoid_whole_workspace~
|
||||
When editing a crate that is part of a Cargo workspace, and this
|
||||
option is set to 1 (the default), then 'cargo' will be executed
|
||||
directly in that crate directory instead of in the workspace
|
||||
directory. Setting 0 prevents this behavior - however be aware that if
|
||||
you are working in large workspace, Cargo commands may take more time,
|
||||
plus the Syntastic error list may include all the crates in the
|
||||
workspace. >
|
||||
let g:rust_cargo_avoid_whole_workspace = 0
|
||||
<
|
||||
*g:rust_cargo_check_all_targets*
|
||||
*b:rust_cargo_check_all_targets*
|
||||
g:rust_cargo_check_all_targets~
|
||||
When set to 1, the `--all-targets` option will be passed to cargo when
|
||||
Syntastic executes it, allowing the linting of all targets under the
|
||||
package.
|
||||
The default is 0.
|
||||
|
||||
*g:rust_cargo_check_all_features*
|
||||
*b:rust_cargo_check_all_features*
|
||||
g:rust_cargo_check_all_features~
|
||||
When set to 1, the `--all-features` option will be passed to cargo when
|
||||
Syntastic executes it, allowing the linting of all features of the
|
||||
package.
|
||||
The default is 0.
|
||||
|
||||
*g:rust_cargo_check_examples*
|
||||
*b:rust_cargo_check_examples*
|
||||
g:rust_cargo_check_examples~
|
||||
When set to 1, the `--examples` option will be passed to cargo when
|
||||
Syntastic executes it, to prevent the exclusion of examples from
|
||||
linting. The examples are normally under the `examples/` directory of
|
||||
the crate.
|
||||
The default is 0.
|
||||
|
||||
*g:rust_cargo_check_tests*
|
||||
*b:rust_cargo_check_tests*
|
||||
g:rust_cargo_check_tests~
|
||||
When set to 1, the `--tests` option will be passed to cargo when
|
||||
Syntastic executes it, to prevent the exclusion of tests from linting.
|
||||
The tests are normally under the `tests/` directory of the crate.
|
||||
The default is 0.
|
||||
|
||||
*g:rust_cargo_check_benches*
|
||||
*b:rust_cargo_check_benches*
|
||||
g:rust_cargo_check_benches~
|
||||
When set to 1, the `--benches` option will be passed to cargo when
|
||||
Syntastic executes it. The benches are normally under the `benches/`
|
||||
directory of the crate.
|
||||
The default is 0.
|
||||
|
||||
Integration with auto-pairs *rust-auto-pairs*
|
||||
---------------------------
|
||||
|
||||
This plugin automatically configures the auto-pairs plugin not to duplicate
|
||||
single quotes, which are used more often for lifetime annotations than for
|
||||
single character literals.
|
||||
|
||||
*g:rust_keep_autopairs_default*
|
||||
g:rust_keep_autopairs_default~
|
||||
|
||||
Don't override auto-pairs default for the Rust filetype. The default
|
||||
is 0.
|
||||
|
||||
==============================================================================
|
||||
COMMANDS *rust-commands*
|
||||
COMMANDS *rust-commands*
|
||||
|
||||
:RustRun [args] *:RustRun*
|
||||
Invoking Cargo
|
||||
--------------
|
||||
|
||||
This plug defines very simple shortcuts for invoking Cargo from with Vim.
|
||||
|
||||
:Cargo <args> *:Cargo*
|
||||
Runs 'cargo' with the provided arguments.
|
||||
|
||||
:Cbuild <args> *:Cbuild*
|
||||
Shortcut for 'cargo build`.
|
||||
|
||||
:Cclean <args> *:Cclean*
|
||||
Shortcut for 'cargo clean`.
|
||||
|
||||
:Cdoc <args> *:Cdoc*
|
||||
Shortcut for 'cargo doc`.
|
||||
|
||||
:Cinit <args> *:Cinit*
|
||||
Shortcut for 'cargo init`.
|
||||
|
||||
:Crun <args> *:Crun*
|
||||
Shortcut for 'cargo run`.
|
||||
|
||||
:Ctest <args> *:Ctest*
|
||||
Shortcut for 'cargo test`.
|
||||
|
||||
:Cupdate <args> *:Cupdate*
|
||||
Shortcut for 'cargo update`.
|
||||
|
||||
:Cbench <args> *:Cbench*
|
||||
Shortcut for 'cargo bench`.
|
||||
|
||||
:Csearch <args> *:Csearch*
|
||||
Shortcut for 'cargo search`.
|
||||
|
||||
:Cpublish <args> *:Cpublish*
|
||||
Shortcut for 'cargo publish`.
|
||||
|
||||
:Cinstall <args> *:Cinstall*
|
||||
Shortcut for 'cargo install`.
|
||||
|
||||
:Cruntarget <args> *:Cruntarget*
|
||||
Shortcut for 'cargo run --bin' or 'cargo run --example',
|
||||
depending on the currently open buffer.
|
||||
|
||||
Formatting
|
||||
----------
|
||||
|
||||
:RustFmt *:RustFmt*
|
||||
Runs |g:rustfmt_command| on the current buffer. If
|
||||
|g:rustfmt_options| is set then those will be passed to the
|
||||
executable.
|
||||
|
||||
If |g:rustfmt_fail_silently| is 0 (the default) then it
|
||||
will populate the |location-list| with the errors from
|
||||
|g:rustfmt_command|. If |g:rustfmt_fail_silently| is set to 1
|
||||
then it will not populate the |location-list|.
|
||||
|
||||
:RustFmtRange *:RustFmtRange*
|
||||
Runs |g:rustfmt_command| with selected range. See
|
||||
|:RustFmt| for any other information.
|
||||
|
||||
|
||||
Playpen integration
|
||||
-------------------
|
||||
|
||||
:RustPlay *:RustPlay*
|
||||
This command will only work if you have web-api.vim installed
|
||||
(available at https://github.com/mattn/webapi-vim). It sends the
|
||||
current selection, or if nothing is selected, the entirety of the
|
||||
current buffer to the Rust playpen, and emits a message with the
|
||||
shortened URL to the playpen.
|
||||
|
||||
|g:rust_playpen_url| is the base URL to the playpen, by default
|
||||
"https://play.rust-lang.org/".
|
||||
|
||||
|g:rust_shortener_url| is the base url for the shorterner, by
|
||||
default "https://is.gd/"
|
||||
|
||||
|g:rust_clip_command| is the command to run to copy the
|
||||
playpen url to the clipboard of your system.
|
||||
|
||||
|
||||
Evaluation of a single Rust file
|
||||
--------------------------------
|
||||
|
||||
NOTE: These commands are useful only when working with standalone Rust files,
|
||||
which is usually not the case for common Rust development. If you wish to
|
||||
building Rust crates from with Vim can should use Vim's make, Syntastic, or
|
||||
functionality from other plugins.
|
||||
|
||||
|
||||
:RustRun [args] *:RustRun*
|
||||
:RustRun! [rustc-args] [--] [args]
|
||||
Compiles and runs the current file. If it has unsaved changes,
|
||||
it will be saved first using |:update|. If the current file is
|
||||
@@ -150,7 +392,7 @@ COMMANDS *rust-commands*
|
||||
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||
Otherwise it is assumed rustc can be found in $PATH.
|
||||
|
||||
:RustExpand [args] *:RustExpand*
|
||||
:RustExpand [args] *:RustExpand*
|
||||
:RustExpand! [TYPE] [args]
|
||||
Expands the current file using --pretty and displays the
|
||||
results in a new split. If the current file has unsaved
|
||||
@@ -169,7 +411,7 @@ COMMANDS *rust-commands*
|
||||
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||
Otherwise it is assumed rustc can be found in $PATH.
|
||||
|
||||
:RustEmitIr [args] *:RustEmitIr*
|
||||
:RustEmitIr [args] *:RustEmitIr*
|
||||
Compiles the current file to LLVM IR and displays the results
|
||||
in a new split. If the current file has unsaved changes, it
|
||||
will be saved first using |:update|. If the current file is an
|
||||
@@ -180,7 +422,7 @@ COMMANDS *rust-commands*
|
||||
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||
Otherwise it is assumed rustc can be found in $PATH.
|
||||
|
||||
:RustEmitAsm [args] *:RustEmitAsm*
|
||||
:RustEmitAsm [args] *:RustEmitAsm*
|
||||
Compiles the current file to assembly and displays the results
|
||||
in a new split. If the current file has unsaved changes, it
|
||||
will be saved first using |:update|. If the current file is an
|
||||
@@ -191,49 +433,54 @@ COMMANDS *rust-commands*
|
||||
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||
Otherwise it is assumed rustc can be found in $PATH.
|
||||
|
||||
:RustPlay *:RustPlay*
|
||||
This command will only work if you have web-api.vim installed
|
||||
(available at https://github.com/mattn/webapi-vim). It sends the
|
||||
current selection, or if nothing is selected, the entirety of the
|
||||
current buffer to the Rust playpen, and emits a message with the
|
||||
shortened URL to the playpen.
|
||||
|
||||
|g:rust_playpen_url| is the base URL to the playpen, by default
|
||||
"https://play.rust-lang.org/".
|
||||
Running test(s)
|
||||
---------------
|
||||
|
||||
|g:rust_shortener_url| is the base URL for the shortener, by
|
||||
default "https://is.gd/"
|
||||
:[N]RustTest[!] [options] *:RustTest*
|
||||
Runs a test under the cursor when the current buffer is in a
|
||||
cargo project with "cargo test" command. If the command did
|
||||
not find any test function under the cursor, it stops with an
|
||||
error message.
|
||||
|
||||
:RustFmt *:RustFmt*
|
||||
Runs |g:rustfmt_command| on the current buffer. If
|
||||
|g:rustfmt_options| is set then those will be passed to the
|
||||
executable.
|
||||
When N is given, adjust the size of the new window to N lines
|
||||
or columns.
|
||||
|
||||
If |g:rustfmt_fail_silently| is 0 (the default) then it
|
||||
will populate the |location-list| with the errors from
|
||||
|g:rustfmt_command|. If |g:rustfmt_fail_silently| is set to 1
|
||||
then it will not populate the |location-list|.
|
||||
When ! is given, runs all tests regardless of current cursor
|
||||
position.
|
||||
|
||||
:RustFmtRange *:RustFmtRange*
|
||||
Runs |g:rustfmt_command| with selected range. See
|
||||
|:RustFmt| for any other information.
|
||||
When [options] is given, it is passed to "cargo" command
|
||||
arguments.
|
||||
|
||||
When the current buffer is outside cargo project, the command
|
||||
runs "rustc --test" command instead of "cargo test" as
|
||||
fallback. All tests are run regardless of adding ! since there
|
||||
is no way to run specific test function with rustc. [options]
|
||||
is passed to "rustc" command arguments in the case.
|
||||
|
||||
Takes optional modifiers (see |<mods>|): >
|
||||
:tab RustTest
|
||||
:belowright 16RustTest
|
||||
:leftabove vert 80RustTest
|
||||
<
|
||||
rust.vim Debugging
|
||||
------------------
|
||||
|
||||
:RustInfo *:RustInfo*
|
||||
Emits debugging info of the Vim Rust plugin.
|
||||
|
||||
:RustInfoToClipboard *:RustInfoClipboard*
|
||||
Saves debugging info of the Vim Rust plugin to the default
|
||||
register.
|
||||
|
||||
:RustInfoToFile [filename] *:RustInfoToFile*
|
||||
Saves debugging info of the Vim Rust plugin to the given file,
|
||||
overwriting it.
|
||||
|
||||
==============================================================================
|
||||
MAPPINGS *rust-mappings*
|
||||
MAPPINGS *rust-mappings*
|
||||
|
||||
This plugin defines mappings for |[[| and |]]| to support hanging indents.
|
||||
|
||||
It also has a few other mappings:
|
||||
|
||||
*rust_<D-r>*
|
||||
<D-r> Executes |:RustRun| with no arguments.
|
||||
Note: This binding is only available in MacVim.
|
||||
|
||||
*rust_<D-R>*
|
||||
<D-R> Populates the command line with |:RustRun|! using the
|
||||
arguments given to the last invocation, but does not
|
||||
execute it.
|
||||
Note: This binding is only available in MacVim.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
|
||||
vim:tw=78:sw=4:noet:ts=8:ft=help:norl:
|
||||
|
||||
+12
-8
@@ -260,9 +260,9 @@ The ODB editor protocol is documented at:
|
||||
3. Settings *macvim-prefs* *macvim-preferences* *macvim-settings*
|
||||
|
||||
Some settings are global to the MacVim application and would not make sense as
|
||||
Vim options. These settings are stored in the user defaults database and can
|
||||
be accessed via the "MacVim.Settings…" ("MacVim.Preferences…" in macOS 12
|
||||
Monterey and older) menu item.
|
||||
Vim options (see |macvim-options|). These settings are stored in the user
|
||||
defaults database and can be accessed via the "MacVim.Settings…"
|
||||
("MacVim.Preferences…" in macOS 12 Monterey and older) menu item.
|
||||
|
||||
*macvim-user-defaults*
|
||||
Not all entries in the user defaults database are exposed via the settings
|
||||
@@ -299,6 +299,7 @@ KEY VALUE ~
|
||||
*MMTitlebarAppearsTransparent* enable a transparent titlebar [bool]
|
||||
*MMAppearanceModeSelection* dark mode selection (|macvim-dark-mode|)[bool]
|
||||
*MMRendererClipToRow* clip tall characters to the row they are on [bool]
|
||||
*MMScrollOneDirectionOnly* scroll along one axis only when using trackpad [bool]
|
||||
*MMSmoothResize* allow smooth resizing of MacVim window [bool]
|
||||
*MMShareFindPboard* share search text to Find Pasteboard [bool]
|
||||
*MMShowAddTabButton* enable "add tab" button on tabline [bool]
|
||||
@@ -369,11 +370,14 @@ MacVim can be used in full screen mode, see 'fullscreen'.
|
||||
|
||||
There are two types of full screen modes. By default, MacVim uses macOS'
|
||||
native full screen functionality, which creates a separate space in Mission
|
||||
Control. MacVim also provides a non-native full screen mode, which can be set
|
||||
by disabling native full screen in the settings panel, or by setting
|
||||
|MMNativeFullScreen| to `NO` manually. If you have a MacBook with a "notch"
|
||||
at the top of the screen, you can set |MMNonNativeFullScreenShowMenu| to `NO`
|
||||
and |MMNonNativeFullScreenSafeAreaBehavior| to 1 to utilitize the whole screen
|
||||
Control.
|
||||
|
||||
MacVim also provides a non-native full screen mode, which can be set by
|
||||
disabling native full screen in the settings panel (see |MMNativeFullScreen|).
|
||||
Use 'fuoptions' to configure the background color and whether to maximize the
|
||||
rows/columns. If you have a MacBook with a camera housing ("notch") at the
|
||||
top of the screen, you can set |MMNonNativeFullScreenShowMenu| to `NO` and
|
||||
|MMNonNativeFullScreenSafeAreaBehavior| to 1 to utilitize the whole screen
|
||||
(this will cause some of the content to be obscured by the notch).
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -754,8 +754,10 @@ you can use Vim without this file.
|
||||
MS-Windows ~
|
||||
|
||||
To use the Python interface the Python DLL must be in your search path. In a
|
||||
console window type "path" to see what directories are used. The 'pythondll'
|
||||
or 'pythonthreedll' option can be also used to specify the Python DLL.
|
||||
console window type "path" to see what directories are used. If the DLL is
|
||||
not found in your search path, Vim will check the registry to find the path
|
||||
where Python is installed. The 'pythondll' or 'pythonthreedll' option can be
|
||||
also used to specify the Python DLL.
|
||||
|
||||
The name of the DLL should match the Python version Vim was compiled with.
|
||||
Currently the name for Python 2 is "python27.dll", that is for Python 2.7.
|
||||
@@ -782,6 +784,8 @@ and failures. With Stable ABI, this restriction is relaxed, and any Python 3
|
||||
library with version of at least |v:python3_version| will work. See
|
||||
|has-python| for how to check if Stable ABI is supported, or see if version
|
||||
output includes |+python3/dyn-stable|.
|
||||
On MS-Windows, 'pythonthreedll' will be set to "python3.dll". When searching
|
||||
the DLL from the registry, Vim will search the latest version of Python.
|
||||
|
||||
==============================================================================
|
||||
10. Python 3 *python3*
|
||||
|
||||
@@ -1112,6 +1112,22 @@ tag command action in Command-line editing mode ~
|
||||
|c_<Insert>| <Insert> toggle insert/overstrike mode
|
||||
|c_<LeftMouse>| <LeftMouse> cursor at mouse click
|
||||
|
||||
commands in wildmenu mode (see 'wildmenu')
|
||||
|
||||
<Up> move up to parent / select the previous match
|
||||
<Down> move down to submenu / select the next match
|
||||
<Left> select the previous match / move up to parent
|
||||
<Right> select the next match / move down to submenu
|
||||
<CR> move into submenu when doing menu completion
|
||||
CTRL-E stop completion and go back to original text
|
||||
CTRL-Y accept selected match and stop completion
|
||||
other stop completion and insert the typed character
|
||||
|
||||
commands in wildmenu mode with 'wildoptions' set to "pum"
|
||||
|
||||
<PageUp> select a match several entries back
|
||||
<PageDown> select a match several entries forward
|
||||
|
||||
==============================================================================
|
||||
5. Terminal-Job mode *terminal-job-index*
|
||||
|
||||
|
||||
+79
-31
@@ -1,4 +1,4 @@
|
||||
*motion.txt* For Vim version 9.0. Last change: 2022 Sep 26
|
||||
*motion.txt* For Vim version 9.0. Last change: 2023 Sep 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -592,14 +592,16 @@ a] *v_a]* *v_a[* *a]* *a[*
|
||||
a[ "a [] block", select [count] '[' ']' blocks. This
|
||||
goes backwards to the [count] unclosed '[', and finds
|
||||
the matching ']'. The enclosed text is selected,
|
||||
including the '[' and ']'.
|
||||
including the '[' and ']'. The |cpo-M| option flag
|
||||
is used to handle escaped brackets.
|
||||
When used in Visual mode it is made characterwise.
|
||||
|
||||
i] *v_i]* *v_i[* *i]* *i[*
|
||||
i[ "inner [] block", select [count] '[' ']' blocks. This
|
||||
goes backwards to the [count] unclosed '[', and finds
|
||||
the matching ']'. The enclosed text is selected,
|
||||
excluding the '[' and ']'.
|
||||
excluding the '[' and ']'. The |cpo-M| option flag
|
||||
is used to handle escaped brackets.
|
||||
When used in Visual mode it is made characterwise.
|
||||
|
||||
a) *v_a)* *a)* *a(*
|
||||
@@ -607,7 +609,8 @@ a( *vab* *v_ab* *v_a(* *ab*
|
||||
ab "a block", select [count] blocks, from "[count] [(" to
|
||||
the matching ')', including the '(' and ')' (see
|
||||
|[(|). Does not include white space outside of the
|
||||
parenthesis.
|
||||
parenthesis. The |cpo-M| option flag is used to
|
||||
handle escaped parenthesis.
|
||||
When used in Visual mode it is made characterwise.
|
||||
|
||||
i) *v_i)* *i)* *i(*
|
||||
@@ -615,19 +618,22 @@ i( *vib* *v_ib* *v_i(* *ib*
|
||||
ib "inner block", select [count] blocks, from "[count] [("
|
||||
to the matching ')', excluding the '(' and ')' (see
|
||||
|[(|). If the cursor is not inside a () block, then
|
||||
find the next "(".
|
||||
find the next "(". The |cpo-M| option flag
|
||||
is used to handle escaped parenthesis.
|
||||
When used in Visual mode it is made characterwise.
|
||||
|
||||
a> *v_a>* *v_a<* *a>* *a<*
|
||||
a< "a <> block", select [count] <> blocks, from the
|
||||
[count]'th unmatched '<' backwards to the matching
|
||||
'>', including the '<' and '>'.
|
||||
'>', including the '<' and '>'. The |cpo-M| option flag
|
||||
is used to handle escaped '<' and '>'.
|
||||
When used in Visual mode it is made characterwise.
|
||||
|
||||
i> *v_i>* *v_i<* *i>* *i<*
|
||||
i< "inner <> block", select [count] <> blocks, from
|
||||
the [count]'th unmatched '<' backwards to the matching
|
||||
'>', excluding the '<' and '>'.
|
||||
'>', excluding the '<' and '>'. The |cpo-M| option flag
|
||||
is used to handle escaped '<' and '>'.
|
||||
When used in Visual mode it is made characterwise.
|
||||
|
||||
*v_at* *at*
|
||||
@@ -649,14 +655,16 @@ a} *v_a}* *a}* *a{*
|
||||
a{ *v_aB* *v_a{* *aB*
|
||||
aB "a Block", select [count] Blocks, from "[count] [{" to
|
||||
the matching '}', including the '{' and '}' (see
|
||||
|[{|).
|
||||
|[{|). The |cpo-M| option flag is used to handle
|
||||
escaped braces.
|
||||
When used in Visual mode it is made characterwise.
|
||||
|
||||
i} *v_i}* *i}* *i{*
|
||||
i{ *v_iB* *v_i{* *iB*
|
||||
iB "inner Block", select [count] Blocks, from "[count] [{"
|
||||
to the matching '}', excluding the '{' and '}' (see
|
||||
|[{|).
|
||||
|[{|). The |cpo-M| option flag is used to handle
|
||||
escaped braces.
|
||||
When used in Visual mode it is made characterwise.
|
||||
|
||||
a" *v_aquote* *aquote*
|
||||
@@ -683,6 +691,7 @@ i` *v_i`* *i`*
|
||||
Special case: With a count of 2 the quotes are
|
||||
included, but no extra white space as with a"/a'/a`.
|
||||
|
||||
*o_object-select*
|
||||
When used after an operator:
|
||||
For non-block objects:
|
||||
For the "a" commands: The operator applies to the object and the white
|
||||
@@ -698,6 +707,7 @@ For a block object:
|
||||
the surrounding braces are excluded. For the "a" commands, the braces
|
||||
are included.
|
||||
|
||||
*v_object-select*
|
||||
When used in Visual mode:
|
||||
When start and end of the Visual area are the same (just after typing "v"):
|
||||
One object is selected, the same as for using an operator.
|
||||
@@ -1069,14 +1079,14 @@ can go to cursor positions before older jumps, and back again. Thus you can
|
||||
move up and down the list. There is a separate jump list for each window.
|
||||
The maximum number of entries is fixed at 100.
|
||||
|
||||
For example, after three jump commands you have this jump list:
|
||||
|
||||
jump line col file/text ~
|
||||
3 1 0 some text ~
|
||||
2 70 0 another line ~
|
||||
1 1154 23 end. ~
|
||||
> ~
|
||||
For example, after three jump commands you have this jump list: >
|
||||
|
||||
jump line col file/text
|
||||
3 1 0 some text
|
||||
2 70 0 another line
|
||||
1 1154 23 end.
|
||||
>
|
||||
<
|
||||
The "file/text" column shows the file name, or the text at the jump if it is
|
||||
in the current file (an indent is removed and a long line is truncated to fit
|
||||
in the window).
|
||||
@@ -1085,14 +1095,14 @@ The marker ">" indicates the current position in the jumplist. It may not be
|
||||
shown when filtering the |:jumps| command using |:filter|
|
||||
|
||||
You are currently in line 1167. If you then use the CTRL-O command, the
|
||||
cursor is put in line 1154. This results in:
|
||||
|
||||
jump line col file/text ~
|
||||
2 1 0 some text ~
|
||||
1 70 0 another line ~
|
||||
> 0 1154 23 end. ~
|
||||
1 1167 0 foo bar ~
|
||||
cursor is put in line 1154. This results in: >
|
||||
|
||||
jump line col file/text
|
||||
2 1 0 some text
|
||||
1 70 0 another line
|
||||
> 0 1154 23 end.
|
||||
1 1167 0 foo bar
|
||||
<
|
||||
The pointer will be set at the last used jump position. The next CTRL-O
|
||||
command will use the entry above it, the next CTRL-I command will use the
|
||||
entry below it. If the pointer is below the last entry, this indicates that
|
||||
@@ -1116,15 +1126,15 @@ command. You can explicitly add a jump by setting the ' mark with "m'". Note
|
||||
that calling setpos() does not do this.
|
||||
|
||||
After the CTRL-O command that got you into line 1154 you could give another
|
||||
jump command (e.g., "G"). The jump list would then become:
|
||||
|
||||
jump line col file/text ~
|
||||
4 1 0 some text ~
|
||||
3 70 0 another line ~
|
||||
2 1167 0 foo bar ~
|
||||
1 1154 23 end. ~
|
||||
> ~
|
||||
jump command (e.g., "G"). The jump list would then become: >
|
||||
|
||||
jump line col file/text
|
||||
4 1 0 some text
|
||||
3 70 0 another line
|
||||
2 1167 0 foo bar
|
||||
1 1154 23 end.
|
||||
>
|
||||
<
|
||||
The line numbers will be adjusted for deleted and inserted lines. This fails
|
||||
if you stop editing a file without writing, like with ":n!".
|
||||
|
||||
@@ -1133,7 +1143,45 @@ When you split a window, the jumplist will be copied to the new window.
|
||||
If you have included the ' item in the 'viminfo' option the jumplist will be
|
||||
stored in the viminfo file and restored when starting Vim.
|
||||
|
||||
*jumplist-stack*
|
||||
When 'jumpoptions' option includes "stack", the jumplist behaves like the tag
|
||||
stack. When jumping to a new location from the middle of the jumplist, the
|
||||
locations after the current position will be discarded. With this option set
|
||||
you can move through a tree of jump locations. When going back up a branch and
|
||||
then down another branch, CTRL-O still takes you further up the tree.
|
||||
|
||||
Given a jumplist like the following in which CTRL-O has been used to move back
|
||||
three times to location X: >
|
||||
|
||||
jump line col file/text
|
||||
2 1260 8 mark.c <-- location X-2
|
||||
1 685 0 eval.c <-- location X-1
|
||||
> 0 462 36 eval.c <-- location X
|
||||
1 479 39 eval.c
|
||||
2 213 2 mark.c
|
||||
3 181 0 mark.c
|
||||
<
|
||||
jumping to (new) location Y results in the locations after the current
|
||||
locations being removed: >
|
||||
|
||||
jump line col file/text
|
||||
3 1260 8 mark.c <-- location X-2
|
||||
2 685 0 eval.c <-- location X-1
|
||||
1 462 36 eval.c <-- location X
|
||||
>
|
||||
<
|
||||
Then, when yet another location Z is jumped to, the new location Y appears
|
||||
directly after location X in the jumplist and location X remains in the same
|
||||
position relative to the locations (X-1, X-2, etc., ...) that had been before
|
||||
it prior to the original jump from X to Y: >
|
||||
|
||||
jump line col file/text
|
||||
4 1260 8 mark.c <-- location X-2
|
||||
3 685 0 eval.c <-- location X-1
|
||||
2 462 36 eval.c <-- location X
|
||||
1 100 0 buffer.c <-- location Y
|
||||
>
|
||||
<
|
||||
CHANGE LIST JUMPS *changelist* *change-list-jumps* *E664*
|
||||
|
||||
When making a change the cursor position is remembered. One position is
|
||||
|
||||
+73
-30
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 9.0. Last change: 2023 Aug 15
|
||||
*options.txt* For Vim version 9.0. Last change: 2023 Oct 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -71,7 +71,7 @@ achieve special effects. These options come in three forms:
|
||||
'ttytype'
|
||||
Warning: This may have a lot of side effects.
|
||||
|
||||
*:set-args* *E487* *E521*
|
||||
*:set-args* *:set=* *E487* *E521*
|
||||
:se[t] {option}={value} or
|
||||
:se[t] {option}:{value}
|
||||
Set string or number option to {value}.
|
||||
@@ -79,7 +79,9 @@ achieve special effects. These options come in three forms:
|
||||
hex (preceded with 0x) or octal (preceded with '0').
|
||||
The old value can be inserted by typing 'wildchar' (by
|
||||
default this is a <Tab> or CTRL-E if 'compatible' is
|
||||
set). See |cmdline-completion|.
|
||||
set). Many string options with fixed syntax and names
|
||||
also support completing known values. See
|
||||
|cmdline-completion| and |complete-set-option|.
|
||||
White space between {option} and '=' is allowed and
|
||||
will be ignored. White space between '=' and {value}
|
||||
is not allowed.
|
||||
@@ -113,6 +115,9 @@ achieve special effects. These options come in three forms:
|
||||
When the option is a list of flags, {value} must be
|
||||
exactly as they appear in the option. Remove flags
|
||||
one by one to avoid problems.
|
||||
The individual values from a comma separated list or
|
||||
list of flags can be inserted by typing 'wildchar'.
|
||||
See |complete-set-option|.
|
||||
Also see |:set-args| above.
|
||||
|
||||
The {option} arguments to ":set" may be repeated. For example: >
|
||||
@@ -187,10 +192,27 @@ To include white space in a string option value it has to be preceded with a
|
||||
backslash. To include a backslash you have to use two. Effectively this
|
||||
means that the number of backslashes in an option value is halved (rounded
|
||||
down).
|
||||
In options 'path', 'cdpath', and 'tags', spaces have to be preceded with three
|
||||
backslashes instead for compatibility with version 3.0 where the options can
|
||||
be separated by either commas or spaces.
|
||||
Comma-separated options like 'backupdir' and 'tags' will also require commas
|
||||
to be escaped with two backslashes, whereas this is not needed for
|
||||
non-comma-separated ones like 'makeprg'.
|
||||
When setting options using |:let| and |literal-string|, you need to use one
|
||||
fewer layer of backslash.
|
||||
A few examples: >
|
||||
:set tags=tags\ /usr/tags results in "tags /usr/tags"
|
||||
:set tags=tags\\,file results in "tags\,file"
|
||||
:set tags=tags\\\ file results in "tags\ file"
|
||||
:set makeprg=make\ file results in "make file"
|
||||
:let &makeprg='make file' (same as above)
|
||||
:set makeprg=make\\\ file results in "make\ file"
|
||||
:set tags=tags\ /usr/tags results in "tags" and "/usr/tags"
|
||||
:set tags=tags\\\ file results in "tags file"
|
||||
:let &tags='tags\ file' (same as above)
|
||||
|
||||
:set makeprg=make,file results in "make,file"
|
||||
:set makeprg=make\\,file results in "make\,file"
|
||||
:set tags=tags,file results in "tags" and "file"
|
||||
:set tags=tags\\,file results in "tags,file"
|
||||
:let &tags='tags\,file' (same as above)
|
||||
|
||||
The "|" character separates a ":set" command from a following command. To
|
||||
include the "|" in the option value, use "\|" instead. This example sets the
|
||||
@@ -430,7 +452,7 @@ Set using a variable with lambda expression: >
|
||||
let &tagfunc = L
|
||||
|
||||
In Vim9 script, in a compiled function, you can use a lambda, but a
|
||||
closured does not work, because the function will be called without the
|
||||
closure does not work, because the function will be called without the
|
||||
context of where it was defined.
|
||||
|
||||
|
||||
@@ -2849,7 +2871,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When omitted a context of six lines is used.
|
||||
When using zero the context is actually one,
|
||||
since folds require a line in between, also
|
||||
for a deleted line.
|
||||
for a deleted line. Set it to a very large
|
||||
value (999999) to disable folding completely.
|
||||
See |fold-diff|.
|
||||
|
||||
iblank Ignore changes where lines are all blank. Adds
|
||||
@@ -3867,7 +3890,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
In non-native fullscreen mode, MacVim can be configured to either show
|
||||
all the content filling up the whole screen, or only use part of the
|
||||
screen to show the content, centered. This option controls the size
|
||||
of the Vim control as well as the color of the unused screen area.
|
||||
of the Vim control as well as the color of the unused screen area. It
|
||||
is a comma-separated list of values as follows:
|
||||
|
||||
value effect ~
|
||||
maxvert When entering fullscreen, 'lines' is set to the maximum number
|
||||
of lines fitting on the screen in fullscreen mode. If unset,
|
||||
@@ -4509,8 +4534,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'ignorecase'* *'ic'* *'noignorecase'* *'noic'*
|
||||
'ignorecase' 'ic' boolean (default off)
|
||||
global
|
||||
Ignore case in search patterns. Also used when searching in the tags
|
||||
file.
|
||||
Ignore case in search patterns, |cmdline-completion|, when
|
||||
searching in the tags file, and non-|Vim9| |expr-==|.
|
||||
Also see 'smartcase' and 'tagcase'.
|
||||
Can be overruled by using "\c" or "\C" in the pattern, see
|
||||
|/ignorecase|.
|
||||
@@ -4991,6 +5016,16 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Otherwise only one space is inserted.
|
||||
NOTE: This option is set when 'compatible' is set.
|
||||
|
||||
*'jumpoptions'* *'jop'*
|
||||
'jumpoptions' 'jop' string (default "")
|
||||
global
|
||||
List of words that change the behavior of the |jumplist|.
|
||||
stack Make the jumplist behave like the tagstack.
|
||||
Relative location of entries in the jumplist is
|
||||
preserved at the cost of discarding subsequent entries
|
||||
when navigating backwards in the jumplist and then
|
||||
jumping to a location. |jumplist-stack|
|
||||
|
||||
*'key'*
|
||||
'key' string (default "")
|
||||
local to buffer
|
||||
@@ -5005,6 +5040,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
"echo &key". This is to avoid showing it to someone who shouldn't
|
||||
know. It also means you cannot see it yourself once you have set it,
|
||||
be careful not to make a typing error!
|
||||
You also cannot use |:set-=|, |:set+=|, |:set^=| on this option to
|
||||
prevent an attacker from guessing substrings in your key.
|
||||
You can use "&key" in an expression to detect whether encryption is
|
||||
enabled. When 'key' is set it returns "*****" (five stars).
|
||||
|
||||
@@ -5579,6 +5616,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Increasing this limit above 200 also changes the maximum for Ex
|
||||
command recursion, see |E169|.
|
||||
See also |:function|.
|
||||
Also used for maximum depth of callback functions.
|
||||
|
||||
*'maxmapdepth'* *'mmd'* *E223*
|
||||
'maxmapdepth' 'mmd' number (default 1000)
|
||||
@@ -6876,9 +6914,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'scrollbind'* *'scb'* *'noscrollbind'* *'noscb'*
|
||||
'scrollbind' 'scb' boolean (default off)
|
||||
local to window
|
||||
See also |scroll-binding|. When this option is set, the current
|
||||
window scrolls as other scrollbind windows (windows that also have
|
||||
this option set) scroll. This option is useful for viewing the
|
||||
See also |scroll-binding|. When this option is set, scrolling the
|
||||
current window also scrolls other scrollbind windows (windows that
|
||||
also have this option set). This option is useful for viewing the
|
||||
differences between two versions of a file, see 'diff'.
|
||||
See |'scrollopt'| for options that determine how this option should be
|
||||
interpreted.
|
||||
@@ -8324,8 +8362,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|+emacs_tags|: "./tags,./TAGS,tags,TAGS")
|
||||
global or local to buffer |global-local|
|
||||
Filenames for the tag command, separated by spaces or commas. To
|
||||
include a space or comma in a file name, precede it with a backslash
|
||||
(see |option-backslash| about including spaces and backslashes).
|
||||
include a space or comma in a file name, precede it with backslashes
|
||||
(see |option-backslash| about including spaces/commas and backslashes).
|
||||
When a file name starts with "./", the '.' is replaced with the path
|
||||
of the current file. But only when the 'd' flag is not included in
|
||||
'cpoptions'. Environment variables are expanded |:set_env|. Also see
|
||||
@@ -9359,6 +9397,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The character is not recognized when used inside a macro. See
|
||||
'wildcharm' for that.
|
||||
Some keys will not work, such as CTRL-C, <CR> and Enter.
|
||||
<Esc> can be used, but hitting it twice in a row will still exit
|
||||
command-line as a failsafe measure.
|
||||
Although 'wc' is a number option, you can set it to a special key: >
|
||||
:set wc=<Tab>
|
||||
< NOTE: This option is set to the Vi default value when 'compatible' is
|
||||
@@ -9421,31 +9461,34 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
as needed.
|
||||
The "wildmenu" mode is abandoned when a key is hit that is not used
|
||||
for selecting a completion.
|
||||
While the "wildmenu" is active, not using the popup menu, the
|
||||
following keys have special meanings:
|
||||
|
||||
<Left> <Right> - select previous/next match (like CTRL-P/CTRL-N)
|
||||
<Down> - in filename/menu name completion: move into a
|
||||
subdirectory or submenu.
|
||||
While the "wildmenu" is active, the following keys have special
|
||||
meanings:
|
||||
CTRL-P - go to the previous entry
|
||||
CTRL-N - go to the next entry
|
||||
<CR> - in menu completion, when the cursor is just after a
|
||||
dot: move into a submenu.
|
||||
CTRL-E - end completion, go back to what was there before
|
||||
selecting a match.
|
||||
CTRL-Y - accept the currently selected match and stop
|
||||
completion.
|
||||
|
||||
When not using the popup menu for command line completion, the
|
||||
following keys have special meanings:
|
||||
<Left> <Right> - select previous/next match (like CTRL-P/CTRL-N)
|
||||
<Up> - in filename/menu name completion: move up into
|
||||
parent directory or parent menu.
|
||||
<Down> - in filename/menu name completion: move into a
|
||||
subdirectory or submenu.
|
||||
|
||||
When using the popup menu for command line completion, the following
|
||||
keys have special meanings:
|
||||
<Down> - select next match (like CTRL-N)
|
||||
<Up> <Down> - select previous/next match (like CTRL-P/CTRL-N)
|
||||
<PageUp> - select a match several entries back
|
||||
<PageDown> - select a match several entries further
|
||||
<Left> - in filename/menu name completion: move up into
|
||||
parent directory or parent menu.
|
||||
<Right> - in filename/menu name completion: move into a
|
||||
subdirectory or submenu.
|
||||
<Up> - select previous match (like CTRL-P)
|
||||
CTRL-E - end completion, go back to what was there before
|
||||
selecting a match.
|
||||
CTRL-N - go to the next entry
|
||||
CTRL-P - go to the previous entry
|
||||
CTRL-Y - accept the currently selected match and stop
|
||||
completion.
|
||||
|
||||
This makes the menus accessible from the console |console-menus|.
|
||||
|
||||
|
||||
@@ -1080,7 +1080,7 @@ match ASCII characters, as indicated by the range.
|
||||
|
||||
\(\) A pattern enclosed by escaped parentheses. */\(* */\(\)* */\)*
|
||||
E.g., "\(^a\)" matches 'a' at the start of a line.
|
||||
There can only be ten of these. You can use "\%(" to add more, but
|
||||
There can only be nine of these. You can use "\%(" to add more, but
|
||||
not counting it as a sub-expression.
|
||||
*E51* *E54* *E55* *E872* *E873*
|
||||
|
||||
|
||||
@@ -776,6 +776,7 @@ Short explanation of each option: *option-list*
|
||||
'iskeyword' 'isk' characters included in keywords
|
||||
'isprint' 'isp' printable characters
|
||||
'joinspaces' 'js' two spaces after a period with a join command
|
||||
'jumpoptions' 'jop' specifies how jumping is done
|
||||
'key' encryption key
|
||||
'keymap' 'kmp' name of a keyboard mapping
|
||||
'keymodel' 'km' enable starting/stopping selection with keys
|
||||
|
||||
@@ -1149,8 +1149,8 @@ Profiling should give a good indication of where time is spent, but keep in
|
||||
mind there are various things that may clobber the results:
|
||||
|
||||
- The accuracy of the time measured depends on the gettimeofday(), or
|
||||
clock_gettime if available, system function. The accuracy ranges from 1/100
|
||||
second to nanoseconds. With clock_gettime the times are displayed in
|
||||
clock_gettime() if available, system function. The accuracy ranges from
|
||||
1/100 second to nanoseconds. With clock_gettime() the times are displayed in
|
||||
nanoseconds, otherwise microseconds. You can use `has("prof_nsec")`.
|
||||
|
||||
- Real elapsed time is measured, if other processes are busy they may cause
|
||||
|
||||
@@ -191,16 +191,16 @@ windows can be given this behavior by setting the (window-specific)
|
||||
other 'scrollbind' windows are scrolled the same amount, if possible. The
|
||||
behavior of 'scrollbind' can be modified by the 'scrollopt' option.
|
||||
|
||||
When using the scrollbars, the binding only happens when scrolling the window
|
||||
with focus (where the cursor is). You can use this to avoid scroll-binding
|
||||
for a moment without resetting options.
|
||||
When using the scrollbars or the mouse wheel, the binding only happens when
|
||||
scrolling the window with focus (where the cursor is). You can use this to
|
||||
avoid scroll-binding for a moment without resetting options.
|
||||
|
||||
When a window also has the 'diff' option set, the scroll-binding uses the
|
||||
differences between the two buffers to synchronize the position precisely.
|
||||
Otherwise the following method is used.
|
||||
|
||||
*scrollbind-relative*
|
||||
Each 'scrollbind' window keeps track of its "relative offset," which can be
|
||||
Each 'scrollbind' window keeps track of its "relative offset", which can be
|
||||
thought of as the difference between the current window's vertical scroll
|
||||
position and the other window's vertical scroll position. When one of the
|
||||
'scrollbind' windows is asked to vertically scroll past the beginning or end
|
||||
@@ -224,9 +224,10 @@ option.
|
||||
|
||||
*scrollbind-quickadj*
|
||||
The 'scrollbind' flag is meaningful when using keyboard commands to vertically
|
||||
scroll a window, and also meaningful when using the vertical scrollbar of the
|
||||
window which has the cursor focus. However, when using the vertical scrollbar
|
||||
of a window which doesn't have the cursor focus, 'scrollbind' is ignored.
|
||||
scroll a window, and is also meaningful when using the vertical scrollbar or
|
||||
the mouse wheel in the window which has the cursor focus. However, when using
|
||||
the vertical scrollbar or the mouse wheel in a window which doesn't have the
|
||||
cursor focus, 'scrollbind' is ignored.
|
||||
This allows quick adjustment of the relative offset of 'scrollbind' windows.
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*starting.txt* For Vim version 9.0. Last change: 2023 May 30
|
||||
*starting.txt* For Vim version 9.0. Last change: 2023 Oct 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -348,7 +348,7 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
|
||||
Start logging and write entries to {filename}.
|
||||
This works like calling `ch_logfile({filename}, 'ao')` very
|
||||
early during startup.
|
||||
{only available with the |+eval| feature}
|
||||
{only available with the |+eval| and |+channel| feature}
|
||||
|
||||
*-D*
|
||||
-D Debugging. Go to debugging mode when executing the first
|
||||
@@ -1705,6 +1705,6 @@ most of the information will be restored).
|
||||
If you get the |press-enter| prompt you can press "q"
|
||||
and still get the prompt to enter a file number.
|
||||
Use ! to abandon a modified buffer. |abandon|
|
||||
{not when compiled with tiny or small features}
|
||||
{not when compiled with tiny features}
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
||||
+106
-13
@@ -441,7 +441,9 @@ $quote eval.txt /*$quote*
|
||||
'isp' options.txt /*'isp'*
|
||||
'isprint' options.txt /*'isprint'*
|
||||
'joinspaces' options.txt /*'joinspaces'*
|
||||
'jop' options.txt /*'jop'*
|
||||
'js' options.txt /*'js'*
|
||||
'jumpoptions' options.txt /*'jumpoptions'*
|
||||
'key' options.txt /*'key'*
|
||||
'keymap' options.txt /*'keymap'*
|
||||
'keymodel' options.txt /*'keymodel'*
|
||||
@@ -1504,6 +1506,7 @@ $quote eval.txt /*$quote*
|
||||
+wildmenu various.txt /*+wildmenu*
|
||||
+windows various.txt /*+windows*
|
||||
+writebackup various.txt /*+writebackup*
|
||||
+xattr various.txt /*+xattr*
|
||||
+xfontset various.txt /*+xfontset*
|
||||
+xim various.txt /*+xim*
|
||||
+xpm various.txt /*+xpm*
|
||||
@@ -2098,7 +2101,14 @@ $quote eval.txt /*$quote*
|
||||
:Arguments terminal.txt /*:Arguments*
|
||||
:Asm terminal.txt /*:Asm*
|
||||
:Break terminal.txt /*:Break*
|
||||
:Cargo ft_rust.txt /*:Cargo*
|
||||
:Cbench ft_rust.txt /*:Cbench*
|
||||
:Cbuild ft_rust.txt /*:Cbuild*
|
||||
:Cclean ft_rust.txt /*:Cclean*
|
||||
:Cdoc ft_rust.txt /*:Cdoc*
|
||||
:Cfilter quickfix.txt /*:Cfilter*
|
||||
:Cinit ft_rust.txt /*:Cinit*
|
||||
:Cinstall ft_rust.txt /*:Cinstall*
|
||||
:Clear terminal.txt /*:Clear*
|
||||
:CompilerSet usr_51.txt /*:CompilerSet*
|
||||
:ConTeXt ft_context.txt /*:ConTeXt*
|
||||
@@ -2106,6 +2116,12 @@ $quote eval.txt /*$quote*
|
||||
:ConTeXtLog ft_context.txt /*:ConTeXtLog*
|
||||
:ConTeXtStopJobs ft_context.txt /*:ConTeXtStopJobs*
|
||||
:Continue terminal.txt /*:Continue*
|
||||
:Cpublish ft_rust.txt /*:Cpublish*
|
||||
:Crun ft_rust.txt /*:Crun*
|
||||
:Cruntarget ft_rust.txt /*:Cruntarget*
|
||||
:Csearch ft_rust.txt /*:Csearch*
|
||||
:Ctest ft_rust.txt /*:Ctest*
|
||||
:Cupdate ft_rust.txt /*:Cupdate*
|
||||
:DiffOrig diff.txt /*:DiffOrig*
|
||||
:DoMatchParen pi_paren.txt /*:DoMatchParen*
|
||||
:Down terminal.txt /*:Down*
|
||||
@@ -2154,8 +2170,12 @@ $quote eval.txt /*$quote*
|
||||
:RustExpand ft_rust.txt /*:RustExpand*
|
||||
:RustFmt ft_rust.txt /*:RustFmt*
|
||||
:RustFmtRange ft_rust.txt /*:RustFmtRange*
|
||||
:RustInfo ft_rust.txt /*:RustInfo*
|
||||
:RustInfoClipboard ft_rust.txt /*:RustInfoClipboard*
|
||||
:RustInfoToFile ft_rust.txt /*:RustInfoToFile*
|
||||
:RustPlay ft_rust.txt /*:RustPlay*
|
||||
:RustRun ft_rust.txt /*:RustRun*
|
||||
:RustTest ft_rust.txt /*:RustTest*
|
||||
:Sexplore pi_netrw.txt /*:Sexplore*
|
||||
:Source terminal.txt /*:Source*
|
||||
:Step terminal.txt /*:Step*
|
||||
@@ -3216,6 +3236,7 @@ $quote eval.txt /*$quote*
|
||||
:set-inv options.txt /*:set-inv*
|
||||
:set-termcap options.txt /*:set-termcap*
|
||||
:set-verbose options.txt /*:set-verbose*
|
||||
:set= options.txt /*:set=*
|
||||
:set^= options.txt /*:set^=*
|
||||
:set_env options.txt /*:set_env*
|
||||
:setf options.txt /*:setf*
|
||||
@@ -4455,13 +4476,11 @@ E1325 vim9class.txt /*E1325*
|
||||
E1326 vim9class.txt /*E1326*
|
||||
E1327 vim9class.txt /*E1327*
|
||||
E1328 vim9class.txt /*E1328*
|
||||
E1329 vim9class.txt /*E1329*
|
||||
E133 userfunc.txt /*E133*
|
||||
E1330 vim9class.txt /*E1330*
|
||||
E1331 vim9class.txt /*E1331*
|
||||
E1332 vim9class.txt /*E1332*
|
||||
E1333 vim9class.txt /*E1333*
|
||||
E1334 vim9class.txt /*E1334*
|
||||
E1335 vim9class.txt /*E1335*
|
||||
E1336 options.txt /*E1336*
|
||||
E1337 vim9class.txt /*E1337*
|
||||
@@ -4493,19 +4512,40 @@ E136 starting.txt /*E136*
|
||||
E1360 vim9class.txt /*E1360*
|
||||
E1361 syntax.txt /*E1361*
|
||||
E1362 vim9class.txt /*E1362*
|
||||
E1363 vim9class.txt /*E1363*
|
||||
E1363 vim9.txt /*E1363*
|
||||
E1364 recover.txt /*E1364*
|
||||
E1365 vim9class.txt /*E1365*
|
||||
E1366 vim9class.txt /*E1366*
|
||||
E1367 vim9class.txt /*E1367*
|
||||
E1368 vim9class.txt /*E1368*
|
||||
E1369 vim9class.txt /*E1369*
|
||||
E137 starting.txt /*E137*
|
||||
E1370 vim9class.txt /*E1370*
|
||||
E1371 vim9class.txt /*E1371*
|
||||
E1372 vim9class.txt /*E1372*
|
||||
E1373 vim9class.txt /*E1373*
|
||||
E1374 vim9class.txt /*E1374*
|
||||
E1375 vim9class.txt /*E1375*
|
||||
E1376 vim9class.txt /*E1376*
|
||||
E1377 vim9class.txt /*E1377*
|
||||
E1378 vim9class.txt /*E1378*
|
||||
E1379 vim9class.txt /*E1379*
|
||||
E138 starting.txt /*E138*
|
||||
E1380 vim9class.txt /*E1380*
|
||||
E1381 vim9class.txt /*E1381*
|
||||
E1382 vim9class.txt /*E1382*
|
||||
E1383 vim9class.txt /*E1383*
|
||||
E1384 vim9class.txt /*E1384*
|
||||
E1385 vim9class.txt /*E1385*
|
||||
E1386 vim9class.txt /*E1386*
|
||||
E1387 vim9class.txt /*E1387*
|
||||
E1388 vim9class.txt /*E1388*
|
||||
E1389 vim9class.txt /*E1389*
|
||||
E139 message.txt /*E139*
|
||||
E1390 vim9class.txt /*E1390*
|
||||
E1391 eval.txt /*E1391*
|
||||
E1392 eval.txt /*E1392*
|
||||
E140 message.txt /*E140*
|
||||
E1400 builtin.txt /*E1400*
|
||||
E1401 builtin.txt /*E1401*
|
||||
E1402 builtin.txt /*E1402*
|
||||
E1403 builtin.txt /*E1403*
|
||||
E1404 builtin.txt /*E1404*
|
||||
E1405 builtin.txt /*E1405*
|
||||
E141 message.txt /*E141*
|
||||
E142 message.txt /*E142*
|
||||
E143 autocmd.txt /*E143*
|
||||
@@ -4517,6 +4557,16 @@ E148 repeat.txt /*E148*
|
||||
E149 helphelp.txt /*E149*
|
||||
E15 eval.txt /*E15*
|
||||
E150 helphelp.txt /*E150*
|
||||
E1500 builtin.txt /*E1500*
|
||||
E1501 builtin.txt /*E1501*
|
||||
E1502 builtin.txt /*E1502*
|
||||
E1503 builtin.txt /*E1503*
|
||||
E1504 builtin.txt /*E1504*
|
||||
E1505 builtin.txt /*E1505*
|
||||
E1506 editing.txt /*E1506*
|
||||
E1507 builtin.txt /*E1507*
|
||||
E1508 editing.txt /*E1508*
|
||||
E1509 editing.txt /*E1509*
|
||||
E151 helphelp.txt /*E151*
|
||||
E152 helphelp.txt /*E152*
|
||||
E153 helphelp.txt /*E153*
|
||||
@@ -5013,6 +5063,8 @@ E610 editing.txt /*E610*
|
||||
E611 eval.txt /*E611*
|
||||
E612 sign.txt /*E612*
|
||||
E613 print.txt /*E613*
|
||||
E614 builtin.txt /*E614*
|
||||
E616 builtin.txt /*E616*
|
||||
E617 options.txt /*E617*
|
||||
E618 print.txt /*E618*
|
||||
E619 print.txt /*E619*
|
||||
@@ -5096,6 +5148,7 @@ E69 pattern.txt /*E69*
|
||||
E690 eval.txt /*E690*
|
||||
E691 eval.txt /*E691*
|
||||
E692 eval.txt /*E692*
|
||||
E693 builtin.txt /*E693*
|
||||
E694 eval.txt /*E694*
|
||||
E695 eval.txt /*E695*
|
||||
E696 eval.txt /*E696*
|
||||
@@ -5109,6 +5162,7 @@ E702 builtin.txt /*E702*
|
||||
E703 eval.txt /*E703*
|
||||
E704 eval.txt /*E704*
|
||||
E705 eval.txt /*E705*
|
||||
E706 builtin.txt /*E706*
|
||||
E707 eval.txt /*E707*
|
||||
E708 eval.txt /*E708*
|
||||
E709 eval.txt /*E709*
|
||||
@@ -5531,6 +5585,7 @@ MMNoTitleBarWindow gui_mac.txt /*MMNoTitleBarWindow*
|
||||
MMNonNativeFullScreenSafeAreaBehavior gui_mac.txt /*MMNonNativeFullScreenSafeAreaBehavior*
|
||||
MMNonNativeFullScreenShowMenu gui_mac.txt /*MMNonNativeFullScreenShowMenu*
|
||||
MMRendererClipToRow gui_mac.txt /*MMRendererClipToRow*
|
||||
MMScrollOneDirectionOnly gui_mac.txt /*MMScrollOneDirectionOnly*
|
||||
MMShareFindPboard gui_mac.txt /*MMShareFindPboard*
|
||||
MMShowAddTabButton gui_mac.txt /*MMShowAddTabButton*
|
||||
MMShowWhatsNewOnStartup gui_mac.txt /*MMShowWhatsNewOnStartup*
|
||||
@@ -5982,6 +6037,7 @@ added-7.3 version7.txt /*added-7.3*
|
||||
added-7.4 version7.txt /*added-7.4*
|
||||
added-8.1 version8.txt /*added-8.1*
|
||||
added-8.2 version8.txt /*added-8.2*
|
||||
added-9.1 version9.txt /*added-9.1*
|
||||
added-BeOS version5.txt /*added-BeOS*
|
||||
added-Mac version5.txt /*added-Mac*
|
||||
added-VMS version5.txt /*added-VMS*
|
||||
@@ -6093,6 +6149,13 @@ b:clojure_syntax_keywords syntax.txt /*b:clojure_syntax_keywords*
|
||||
b:clojure_syntax_without_core_keywords syntax.txt /*b:clojure_syntax_without_core_keywords*
|
||||
b:current_syntax-variable syntax.txt /*b:current_syntax-variable*
|
||||
b:netrw_lastfile pi_netrw.txt /*b:netrw_lastfile*
|
||||
b:rust_cargo_avoid_whole_workspace ft_rust.txt /*b:rust_cargo_avoid_whole_workspace*
|
||||
b:rust_cargo_check_all_features ft_rust.txt /*b:rust_cargo_check_all_features*
|
||||
b:rust_cargo_check_all_targets ft_rust.txt /*b:rust_cargo_check_all_targets*
|
||||
b:rust_cargo_check_benches ft_rust.txt /*b:rust_cargo_check_benches*
|
||||
b:rust_cargo_check_examples ft_rust.txt /*b:rust_cargo_check_examples*
|
||||
b:rust_cargo_check_tests ft_rust.txt /*b:rust_cargo_check_tests*
|
||||
b:rustfmt_autosave ft_rust.txt /*b:rustfmt_autosave*
|
||||
b:tex_stylish syntax.txt /*b:tex_stylish*
|
||||
b:var eval.txt /*b:var*
|
||||
b:yaml_schema syntax.txt /*b:yaml_schema*
|
||||
@@ -6356,6 +6419,7 @@ changed-7.3 version7.txt /*changed-7.3*
|
||||
changed-7.4 version7.txt /*changed-7.4*
|
||||
changed-8.1 version8.txt /*changed-8.1*
|
||||
changed-8.2 version8.txt /*changed-8.2*
|
||||
changed-9.1 version9.txt /*changed-9.1*
|
||||
changelist motion.txt /*changelist*
|
||||
changelog.vim syntax.txt /*changelog.vim*
|
||||
changenr() builtin.txt /*changenr()*
|
||||
@@ -6438,7 +6502,7 @@ cino-{ indent.txt /*cino-{*
|
||||
cino-} indent.txt /*cino-}*
|
||||
cinoptions-values indent.txt /*cinoptions-values*
|
||||
class vim9class.txt /*class*
|
||||
class-function vim9class.txt /*class-function*
|
||||
class-method vim9class.txt /*class-method*
|
||||
clear-undo undo.txt /*clear-undo*
|
||||
clearmatches() builtin.txt /*clearmatches()*
|
||||
client-server remote.txt /*client-server*
|
||||
@@ -6531,6 +6595,7 @@ complete-items insert.txt /*complete-items*
|
||||
complete-popup insert.txt /*complete-popup*
|
||||
complete-popuphidden insert.txt /*complete-popuphidden*
|
||||
complete-script-local-functions cmdline.txt /*complete-script-local-functions*
|
||||
complete-set-option cmdline.txt /*complete-set-option*
|
||||
complete_CTRL-E insert.txt /*complete_CTRL-E*
|
||||
complete_CTRL-Y insert.txt /*complete_CTRL-Y*
|
||||
complete_add() builtin.txt /*complete_add()*
|
||||
@@ -6546,6 +6611,7 @@ conceal syntax.txt /*conceal*
|
||||
confirm() builtin.txt /*confirm()*
|
||||
connection-refused message.txt /*connection-refused*
|
||||
console-menus gui.txt /*console-menus*
|
||||
constructor vim9class.txt /*constructor*
|
||||
context.vim ft_context.txt /*context.vim*
|
||||
control intro.txt /*control*
|
||||
conversion-server mbyte.txt /*conversion-server*
|
||||
@@ -6719,6 +6785,7 @@ debugger.txt debugger.txt /*debugger.txt*
|
||||
dec-mouse options.txt /*dec-mouse*
|
||||
decada_members ft_ada.txt /*decada_members*
|
||||
deepcopy() builtin.txt /*deepcopy()*
|
||||
default-constructor vim9class.txt /*default-constructor*
|
||||
defaults.vim starting.txt /*defaults.vim*
|
||||
defaults.vim-explained usr_05.txt /*defaults.vim-explained*
|
||||
define-function userfunc.txt /*define-function*
|
||||
@@ -6791,6 +6858,7 @@ dis motion.txt /*dis*
|
||||
disable-menus gui.txt /*disable-menus*
|
||||
discard editing.txt /*discard*
|
||||
distribute-script usr_51.txt /*distribute-script*
|
||||
distributed-plugins usr_05.txt /*distributed-plugins*
|
||||
distribution intro.txt /*distribution*
|
||||
diw motion.txt /*diw*
|
||||
dl change.txt /*dl*
|
||||
@@ -6840,6 +6908,7 @@ edit-no-break usr_25.txt /*edit-no-break*
|
||||
edit-paragraph-join usr_25.txt /*edit-paragraph-join*
|
||||
edit-window windows.txt /*edit-window*
|
||||
editing.txt editing.txt /*editing.txt*
|
||||
editorconfig-install usr_05.txt /*editorconfig-install*
|
||||
efm-%> quickfix.txt /*efm-%>*
|
||||
efm-entries quickfix.txt /*efm-entries*
|
||||
efm-ignore quickfix.txt /*efm-ignore*
|
||||
@@ -7420,6 +7489,8 @@ g:ada_space_errors ft_ada.txt /*g:ada_space_errors*
|
||||
g:ada_standard_types ft_ada.txt /*g:ada_standard_types*
|
||||
g:ada_with_gnat_project_files ft_ada.txt /*g:ada_with_gnat_project_files*
|
||||
g:ada_withuse_ordinary ft_ada.txt /*g:ada_withuse_ordinary*
|
||||
g:cargo_makeprg_params ft_rust.txt /*g:cargo_makeprg_params*
|
||||
g:cargo_shell_command_runner ft_rust.txt /*g:cargo_shell_command_runner*
|
||||
g:clojure_align_multiline_strings indent.txt /*g:clojure_align_multiline_strings*
|
||||
g:clojure_align_subforms indent.txt /*g:clojure_align_subforms*
|
||||
g:clojure_discard_macro syntax.txt /*g:clojure_discard_macro*
|
||||
@@ -7586,17 +7657,27 @@ g:no_mail_maps filetype.txt /*g:no_mail_maps*
|
||||
g:no_plugin_maps filetype.txt /*g:no_plugin_maps*
|
||||
g:plugin_exec filetype.txt /*g:plugin_exec*
|
||||
g:rust_bang_comment_leader ft_rust.txt /*g:rust_bang_comment_leader*
|
||||
g:rust_cargo_avoid_whole_workspace ft_rust.txt /*g:rust_cargo_avoid_whole_workspace*
|
||||
g:rust_cargo_check_all_features ft_rust.txt /*g:rust_cargo_check_all_features*
|
||||
g:rust_cargo_check_all_targets ft_rust.txt /*g:rust_cargo_check_all_targets*
|
||||
g:rust_cargo_check_benches ft_rust.txt /*g:rust_cargo_check_benches*
|
||||
g:rust_cargo_check_examples ft_rust.txt /*g:rust_cargo_check_examples*
|
||||
g:rust_cargo_check_tests ft_rust.txt /*g:rust_cargo_check_tests*
|
||||
g:rust_clip_command ft_rust.txt /*g:rust_clip_command*
|
||||
g:rust_conceal ft_rust.txt /*g:rust_conceal*
|
||||
g:rust_conceal_mod_path ft_rust.txt /*g:rust_conceal_mod_path*
|
||||
g:rust_conceal_pub ft_rust.txt /*g:rust_conceal_pub*
|
||||
g:rust_fold ft_rust.txt /*g:rust_fold*
|
||||
g:rust_playpen_url ft_rust.txt /*g:rust_playpen_url*
|
||||
g:rust_keep_autopairs_default ft_rust.txt /*g:rust_keep_autopairs_default*
|
||||
g:rust_recommended_style ft_rust.txt /*g:rust_recommended_style*
|
||||
g:rust_shortener_url ft_rust.txt /*g:rust_shortener_url*
|
||||
g:rust_use_custom_ctags_defs ft_rust.txt /*g:rust_use_custom_ctags_defs*
|
||||
g:rustc_makeprg_no_percent ft_rust.txt /*g:rustc_makeprg_no_percent*
|
||||
g:rustc_path ft_rust.txt /*g:rustc_path*
|
||||
g:rustfmt_autosave ft_rust.txt /*g:rustfmt_autosave*
|
||||
g:rustfmt_autosave_if_config_present ft_rust.txt /*g:rustfmt_autosave_if_config_present*
|
||||
g:rustfmt_command ft_rust.txt /*g:rustfmt_command*
|
||||
g:rustfmt_emit_files ft_rust.txt /*g:rustfmt_emit_files*
|
||||
g:rustfmt_fail_silently ft_rust.txt /*g:rustfmt_fail_silently*
|
||||
g:rustfmt_options ft_rust.txt /*g:rustfmt_options*
|
||||
g:statusline_winid options.txt /*g:statusline_winid*
|
||||
@@ -8350,6 +8431,7 @@ json_encode() builtin.txt /*json_encode()*
|
||||
jtags tagsrch.txt /*jtags*
|
||||
jump-motions motion.txt /*jump-motions*
|
||||
jumplist motion.txt /*jumplist*
|
||||
jumplist-stack motion.txt /*jumplist-stack*
|
||||
jumpto-diffs diff.txt /*jumpto-diffs*
|
||||
k motion.txt /*k*
|
||||
kcc uganda.txt /*kcc*
|
||||
@@ -9019,6 +9101,7 @@ netrw.vim pi_netrw.txt /*netrw.vim*
|
||||
netrw_filehandler pi_netrw.txt /*netrw_filehandler*
|
||||
netterm-mouse options.txt /*netterm-mouse*
|
||||
network pi_netrw.txt /*network*
|
||||
new() vim9class.txt /*new()*
|
||||
new-5 version5.txt /*new-5*
|
||||
new-6 version6.txt /*new-6*
|
||||
new-7 version7.txt /*new-7*
|
||||
@@ -9079,6 +9162,7 @@ new-operator-mod version6.txt /*new-operator-mod*
|
||||
new-options-5.2 version5.txt /*new-options-5.2*
|
||||
new-options-5.4 version5.txt /*new-options-5.4*
|
||||
new-other-8.2 version8.txt /*new-other-8.2*
|
||||
new-other-9.1 version9.txt /*new-other-9.1*
|
||||
new-perl-python version5.txt /*new-perl-python*
|
||||
new-persistent-undo version7.txt /*new-persistent-undo*
|
||||
new-plugins version6.txt /*new-plugins*
|
||||
@@ -9151,6 +9235,7 @@ numbersize-variable eval.txt /*numbersize-variable*
|
||||
o insert.txt /*o*
|
||||
o_CTRL-V motion.txt /*o_CTRL-V*
|
||||
o_V motion.txt /*o_V*
|
||||
o_object-select motion.txt /*o_object-select*
|
||||
o_v motion.txt /*o_v*
|
||||
object vim9class.txt /*object*
|
||||
object-motions motion.txt /*object-motions*
|
||||
@@ -9240,6 +9325,7 @@ patches-8 version8.txt /*patches-8*
|
||||
patches-8.1 version8.txt /*patches-8.1*
|
||||
patches-8.2 version8.txt /*patches-8.2*
|
||||
patches-9 version9.txt /*patches-9*
|
||||
patches-9.1 version9.txt /*patches-9.1*
|
||||
patches-after-8.2 version9.txt /*patches-after-8.2*
|
||||
pathshorten() builtin.txt /*pathshorten()*
|
||||
pattern pattern.txt /*pattern*
|
||||
@@ -9409,6 +9495,8 @@ printf-s builtin.txt /*printf-s*
|
||||
printf-x builtin.txt /*printf-x*
|
||||
printing print.txt /*printing*
|
||||
printing-formfeed print.txt /*printing-formfeed*
|
||||
private-method vim9class.txt /*private-method*
|
||||
private-variable vim9class.txt /*private-variable*
|
||||
profile repeat.txt /*profile*
|
||||
profiling repeat.txt /*profiling*
|
||||
profiling-variable eval.txt /*profiling-variable*
|
||||
@@ -9679,12 +9767,12 @@ russian-keymap russian.txt /*russian-keymap*
|
||||
russian-l18n russian.txt /*russian-l18n*
|
||||
russian.txt russian.txt /*russian.txt*
|
||||
rust ft_rust.txt /*rust*
|
||||
rust-auto-pairs ft_rust.txt /*rust-auto-pairs*
|
||||
rust-commands ft_rust.txt /*rust-commands*
|
||||
rust-intro ft_rust.txt /*rust-intro*
|
||||
rust-mappings ft_rust.txt /*rust-mappings*
|
||||
rust-settings ft_rust.txt /*rust-settings*
|
||||
rust_<D-R> ft_rust.txt /*rust_<D-R>*
|
||||
rust_<D-r> ft_rust.txt /*rust_<D-r>*
|
||||
rust-syntastic ft_rust.txt /*rust-syntastic*
|
||||
rview starting.txt /*rview*
|
||||
rvim starting.txt /*rvim*
|
||||
rxvt syntax.txt /*rxvt*
|
||||
@@ -10972,6 +11060,7 @@ v_iw motion.txt /*v_iw*
|
||||
v_i{ motion.txt /*v_i{*
|
||||
v_i} motion.txt /*v_i}*
|
||||
v_o visual.txt /*v_o*
|
||||
v_object-select motion.txt /*v_object-select*
|
||||
v_p change.txt /*v_p*
|
||||
v_r change.txt /*v_r*
|
||||
v_s change.txt /*v_s*
|
||||
@@ -11018,6 +11107,7 @@ version-8.0 version8.txt /*version-8.0*
|
||||
version-8.1 version8.txt /*version-8.1*
|
||||
version-8.2 version8.txt /*version-8.2*
|
||||
version-9.0 version9.txt /*version-9.0*
|
||||
version-9.1 version9.txt /*version-9.1*
|
||||
version-variable eval.txt /*version-variable*
|
||||
version4.txt version4.txt /*version4.txt*
|
||||
version5.txt version5.txt /*version5.txt*
|
||||
@@ -11033,6 +11123,7 @@ version8.1 version8.txt /*version8.1*
|
||||
version8.2 version8.txt /*version8.2*
|
||||
version8.txt version8.txt /*version8.txt*
|
||||
version9.0 version9.txt /*version9.0*
|
||||
version9.1 version9.txt /*version9.1*
|
||||
version9.txt version9.txt /*version9.txt*
|
||||
versionlong-variable eval.txt /*versionlong-variable*
|
||||
vi intro.txt /*vi*
|
||||
@@ -11051,6 +11142,7 @@ vim-8.1 version8.txt /*vim-8.1*
|
||||
vim-8.2 version8.txt /*vim-8.2*
|
||||
vim-9 version9.txt /*vim-9*
|
||||
vim-9.0 version9.txt /*vim-9.0*
|
||||
vim-9.1 version9.txt /*vim-9.1*
|
||||
vim-additions vi_diff.txt /*vim-additions*
|
||||
vim-announce intro.txt /*vim-announce*
|
||||
vim-arguments starting.txt /*vim-arguments*
|
||||
@@ -11311,6 +11403,7 @@ x-resources version5.txt /*x-resources*
|
||||
x11-clientserver remote.txt /*x11-clientserver*
|
||||
x11-cut-buffer gui_x11.txt /*x11-cut-buffer*
|
||||
x11-selection gui_x11.txt /*x11-selection*
|
||||
xattr editing.txt /*xattr*
|
||||
xf86conf.vim syntax.txt /*xf86conf.vim*
|
||||
xfontset mbyte.txt /*xfontset*
|
||||
xfree-xterm syntax.txt /*xfree-xterm*
|
||||
|
||||
@@ -1532,7 +1532,7 @@ The function will be called with the list of arguments so far, and a second
|
||||
argument that is the name of the pty.
|
||||
*gdb-version*
|
||||
Only debuggers fully compatible with gdb will work. Vim uses the GDB/MI
|
||||
interface. The "new-ui" command requires gdb version 7.12 or later. if you
|
||||
interface. The "new-ui" command requires gdb version 7.12 or later. If you
|
||||
get this error:
|
||||
Undefined command: "new-ui". Try "help".~
|
||||
Then your gdb is too old.
|
||||
|
||||
@@ -21,7 +21,7 @@ Vim can be tested after building it, usually with "make test".
|
||||
The tests are located in the directory "src/testdir".
|
||||
|
||||
There are two types of tests added over time:
|
||||
test20.in oldest, only for tiny and small builds
|
||||
test20.in oldest, only for tiny builds
|
||||
test_something.vim new style tests
|
||||
|
||||
*new-style-testing*
|
||||
|
||||
+8
-19
@@ -120,16 +120,9 @@ Upcoming larger works:
|
||||
- example plugin: https://github.com/uga-rosa/dps-vsctm.vim
|
||||
|
||||
|
||||
Further Vim9 improvements, possibly after launch:
|
||||
Further Vim9 improvements:
|
||||
- Classes and Interfaces. See |vim9-classes|
|
||||
- Change access: public by default, private by prefixing "_".
|
||||
Check for error: can't have same name twice (ignoring "_" prefix).
|
||||
- Private methods?
|
||||
either: private def Func()
|
||||
or: def _Func()
|
||||
Perhaps use "private" keyword instead of "_" prefix?
|
||||
- "final" object members - can only be set in the constructor.
|
||||
- Support export/import of classes and interfaces.
|
||||
- Cannot use class type of itself in the method (Issue #12369)
|
||||
- Cannot use an object method in a lambda #12417
|
||||
Define all methods before compiling them?
|
||||
@@ -137,13 +130,6 @@ Further Vim9 improvements, possibly after launch:
|
||||
Also #12081 first case.
|
||||
- Using list of functions does not work #12081 (repro in later message).
|
||||
- First argument of call() cannot be "obj.Func". (#11865)
|
||||
- null_object - constant type 17 not supported (Issue #12043)
|
||||
- problem compiling object method call as function call argument (Issue
|
||||
#12081)
|
||||
- Make ":defcompile ClassName" compile all functions and methods in the
|
||||
class.
|
||||
- Forward declaration of a class? E.g. for Clone() function.
|
||||
email lifepillar 2023 Mar 26
|
||||
- Getting member of variable with "any" type should be handled at runtime.
|
||||
Remove temporary solution from #12096 / patch 9.0.1375.
|
||||
- "obj.Method()" does not always work in a compiled function, assumes "obj"
|
||||
@@ -151,18 +137,21 @@ Further Vim9 improvements, possibly after launch:
|
||||
Issue #11822: any.Func() can be a dict or an object call, need to handle
|
||||
this at runtime. Also see #12198 for an example.
|
||||
Possibly issue #11981 can be fixed at the same time (has two examples).
|
||||
- accept line breaks in member initialization. #11957
|
||||
- Support export/import of classes and interfaces.
|
||||
- Make ":defcompile ClassName" compile all functions and methods in the
|
||||
class.
|
||||
- Forward declaration of a class? E.g. for Clone() function.
|
||||
Email lifepillar 2023 Mar 26
|
||||
- object empty(), len() - can class define a method to be used for them?
|
||||
- add to help: when using a default new() method then reordering object
|
||||
members may cause trouble. Can define new() without arguments to avoid.
|
||||
- TODO items: check types for "implements" - members and methods
|
||||
- When "Meta" is a class, is "const MetaAlias = Meta" allowed? It should
|
||||
either work or given an error. possibly give an error now and implement it
|
||||
either work or given an error. Possibly give an error now and implement it
|
||||
later (using a typedef). #12006
|
||||
- how about lock/unlock?
|
||||
- When checking "implements" also check types of members and function args.
|
||||
- For chaining, allow using the class name as type for function return
|
||||
value.
|
||||
- Implement "specifies" interface
|
||||
- Implement generics
|
||||
- Add "assignable" (class or child)?
|
||||
- More efficient way for interface member index than iterating over list?
|
||||
|
||||
+17
-3
@@ -1,4 +1,4 @@
|
||||
*usr_05.txt* For Vim version 9.0. Last change: 2023 Aug 10
|
||||
*usr_05.txt* For Vim version 9.0. Last change: 2023 Sep 12
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -427,6 +427,15 @@ an archive or as a repository. For an archive you can follow these steps:
|
||||
Here "fancytext" is the name of the package, it can be anything
|
||||
else.
|
||||
|
||||
Adding the editorconfig package *editorconfig-install*
|
||||
|
||||
Similar to the matchit package, to load the distributed editorconfig plugin
|
||||
when Vim starts, add the following line to your vimrc file: >
|
||||
packadd! editorconfig
|
||||
|
||||
After restarting your Vim, the plugin is active and you can read about it at: >
|
||||
:h editorconfig.txt
|
||||
|
||||
More information about packages can be found here: |packages|.
|
||||
|
||||
==============================================================================
|
||||
@@ -446,13 +455,18 @@ The global plugins will be discussed first, then the filetype ones
|
||||
|add-filetype-plugin|.
|
||||
|
||||
|
||||
GLOBAL PLUGINS *standard-plugin*
|
||||
GLOBAL PLUGINS *standard-plugin* *distributed-plugins*
|
||||
|
||||
When you start Vim, it will automatically load a number of global plugins.
|
||||
You don't have to do anything for this. They add functionality that most
|
||||
people will want to use, but which was implemented as a Vim script instead of
|
||||
being compiled into Vim. You can find them listed in the help index
|
||||
|standard-plugin-list|. Also see |load-plugins|.
|
||||
|standard-plugin-list|.
|
||||
|
||||
For locally installed plugins and packages (which come with a separated help
|
||||
file) a similar list can be found in the help section |local-additions|.
|
||||
|
||||
Also see |load-plugins|.
|
||||
|
||||
*add-global-plugin*
|
||||
You can add a global plugin to add functionality that will always be present
|
||||
|
||||
@@ -173,9 +173,8 @@ enabled from the Makefile.
|
||||
|
||||
--prefix={directory} Top directory where to install Vim.
|
||||
|
||||
--with-features=tiny Compile with many features disabled.
|
||||
--with-features=small Compile with some features disabled.
|
||||
--with-features=big Compile with more features enabled.
|
||||
--with-features=tiny Compile with some features disabled.
|
||||
--with-features=normal Compile with more features enabled.
|
||||
--with-features=huge Compile with most features enabled.
|
||||
See |+feature-list| for which feature
|
||||
is enabled in which case.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 9.0. Last change: 2022 Dec 13
|
||||
*various.txt* For Vim version 9.0. Last change: 2023 Sep 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -320,15 +320,13 @@ g8 Print the hex values of the bytes used in the
|
||||
The first column shows the smallest version in which
|
||||
they are included:
|
||||
T tiny (always)
|
||||
S small
|
||||
N normal
|
||||
B big
|
||||
H huge
|
||||
m manually enabled or depends on other features
|
||||
- never, feature was removed
|
||||
(none) system dependent
|
||||
Thus if a feature is marked with "N", it is included
|
||||
in the normal, big and huge versions of Vim.
|
||||
in the normal and huge versions of Vim.
|
||||
|
||||
*+feature-list*
|
||||
*+acl* |ACL| support included
|
||||
@@ -506,6 +504,7 @@ T *+windows* more than one window; Always enabled since 8.0.1118.
|
||||
m *+writebackup* |'writebackup'| is default on
|
||||
m *+xim* X input method |xim|
|
||||
*+xfontset* X fontset support |xfontset|
|
||||
N *+xattr* compiled with extended attribute support (Linux only)
|
||||
*+xpm* pixmap support
|
||||
m *+xpm_w32* Win32 GUI only: pixmap support |w32-xpm-support|
|
||||
*+xsmp* XSMP (X session management) support
|
||||
|
||||
@@ -1198,7 +1198,7 @@ Solution: Use "curtab" if "tp" is NULL. (closes #5475)
|
||||
Files: src/evalwindow.c, src/testdir/test_getvar.vim
|
||||
|
||||
Patch 8.2.0118
|
||||
Problem: Crash when cycling to buffers involving popup window .
|
||||
Problem: Crash when cycling to buffers involving popup window.
|
||||
Solution: Do not decrement buffer reference count.
|
||||
Files: src/popupwin.c, src/testdir/test_popupwin.vim,
|
||||
src/testdir/dumps/Test_popupwin_infopopup_7.dump
|
||||
@@ -31679,4 +31679,85 @@ Solution: make menu generation script use Vim9 script, fix errors.
|
||||
Files: runtime/makemenu.vim
|
||||
|
||||
|
||||
==============================================================================
|
||||
VERSION 9.1 *version-9.1* *version9.1* *vim-9.1*
|
||||
|
||||
This section is about improvements made between version 9.0 and 9.1.
|
||||
|
||||
This release has hundreds of bug fixes, there are a few new features and there
|
||||
are many minor improvements.
|
||||
|
||||
Vim9 classes
|
||||
------------
|
||||
|
||||
Virtual text
|
||||
------------
|
||||
|
||||
Smooth Scroll
|
||||
-------------
|
||||
|
||||
Other improvements *new-other-9.1*
|
||||
------------------
|
||||
|
||||
Changed *changed-9.1*
|
||||
-------
|
||||
|
||||
Added *added-9.1*
|
||||
-----
|
||||
|
||||
Various syntax, indent and other plugins were added.
|
||||
|
||||
Functions: ~
|
||||
|
||||
|err_teapot()| produce error 418 or 503
|
||||
|getbufoneline()| get a one line from the specified buffer
|
||||
|getcellwidths()| get character cell width overrides
|
||||
|getmouseshape()| get name of the current mouse shape
|
||||
|getscriptinfo()| get list of sourced vim scripts
|
||||
|indexof()| index in a List or Blob of a true expression
|
||||
|instanceof()| check if a variable is an instance of a given class
|
||||
|keytrans()| translate internal key codes to be usable with |:map|
|
||||
|popup_findecho()| get window ID for popup used for |:echowindow|
|
||||
|setcmdline()| set the current command line
|
||||
|strutf16len()| number of UTF-16 code units in a string
|
||||
|swapfilelist()| list of existing swap files in 'directory'
|
||||
|test_mswin_event()| generate an MS-Windows event for testing
|
||||
|utf16idx()| UTF-16 index of a byte in a string
|
||||
|
||||
|
||||
Autocommands: ~
|
||||
|
||||
|TextChangedT| after a change was made to the text in Terminal mode
|
||||
|WinResized| after a window in the current tab page is resized
|
||||
|
||||
|
||||
Commands: ~
|
||||
|
||||
|:abstract| define an Vim9 abstract class
|
||||
|:class| start of a class specification
|
||||
|:defer| call function when current function is done
|
||||
|:echowindow| same as :echomsg, but use a popup window
|
||||
|:endinterface| end of an interface specification
|
||||
|:endclass| end of a class specification
|
||||
|:horizontal| following window command work horizontally
|
||||
|:interface| start of an interface specification
|
||||
|:public| prefix for a class or object member
|
||||
|:static| prefix for a class member or function
|
||||
|:this| prefix for an object member
|
||||
|
||||
|
||||
Options: ~
|
||||
|
||||
'jumpoptions' specifies how jumping is done
|
||||
'keyprotocol' what keyboard protocol to use for what terminal
|
||||
'lispoptions' changes how Lisp indenting is done
|
||||
'showcmdloc' where to show (partial) command
|
||||
'smoothscroll' scroll by screen lines when 'wrap' is set
|
||||
'splitkeep' determines scroll behavior for split windows
|
||||
|
||||
|
||||
Patches *patches-9.1*
|
||||
-------
|
||||
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
||||
@@ -1557,7 +1557,7 @@ string to a number.
|
||||
|
||||
If a type is given where it is not expected you can get *E1272* .
|
||||
|
||||
If a type is incomplete you get *E1363*, e.g. when you have an object for
|
||||
If a type is incomplete you get *E1363* , e.g. when you have an object for
|
||||
which the class is not known (usually that is a null object).
|
||||
|
||||
Type inference ~
|
||||
@@ -1756,7 +1756,7 @@ Exporting an item can be written as: >
|
||||
export interface MyClass ...
|
||||
< *E1043* *E1044*
|
||||
As this suggests, only constants, variables, `:def` functions and classes can
|
||||
be exported. {not implemented yet: class, interface}
|
||||
be exported.
|
||||
|
||||
*E1042*
|
||||
`:export` can only be used in Vim9 script, at the script level.
|
||||
@@ -1789,7 +1789,7 @@ filename. For example: >
|
||||
Then you can use "that.item", etc. You are free to choose the name "that".
|
||||
Use something that will be recognized as referring to the imported script.
|
||||
Avoid command names, command modifiers and builtin function names, because the
|
||||
name will shadow them. Better not start the name starts with a capital
|
||||
name will shadow them. It's better not to start the name with a capital
|
||||
letter, since it can then also shadow global user commands and functions.
|
||||
Also, you cannot use the name for something else in the script, such as a
|
||||
function or variable name.
|
||||
@@ -1862,9 +1862,9 @@ However, the namespace cannot be resolved on its own: >
|
||||
<
|
||||
This also affects the use of |<SID>| in the legacy mapping context. Since
|
||||
|<SID>| is only a valid prefix for a function and NOT for a namespace, you
|
||||
cannot use it
|
||||
to scope a function in a script local namespace. Instead of prefixing the
|
||||
function with |<SID>| you should use|<ScriptCmd>|. For example: >
|
||||
cannot use it to scope a function in a script local namespace. Instead of
|
||||
prefixing the function with |<SID>| you should use|<ScriptCmd>|. For example:
|
||||
>
|
||||
noremap ,a <ScriptCmd>:call s:that.OtherFunc()<CR>
|
||||
<
|
||||
*:import-cycle*
|
||||
|
||||
+215
-135
@@ -1,4 +1,4 @@
|
||||
*vim9class.txt* For Vim version 9.0. Last change: 2023 Mar 22
|
||||
*vim9class.txt* For Vim version 9.0. Last change: 2023 Sep 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -11,7 +11,7 @@ Vim9 classes, objects, interfaces, types and enums.
|
||||
|
||||
1. Overview |Vim9-class-overview|
|
||||
2. A simple class |Vim9-simple-class|
|
||||
3. Class members and functions |Vim9-class-member|
|
||||
3. Class variables and methods |Vim9-class-member|
|
||||
4. Using an abstract class |Vim9-abstract-class|
|
||||
5. Using an interface |Vim9-using-interface|
|
||||
6. More class details |Vim9-class|
|
||||
@@ -37,7 +37,7 @@ The basic item is an object:
|
||||
functions are invoked "on the object", which is what sets it apart from the
|
||||
traditional separation of data and code that manipulates the data.
|
||||
- An object has a well defined interface, with typed member variables and
|
||||
member functions.
|
||||
methods.
|
||||
- Objects are created from a class and all objects have the same interface.
|
||||
This does not change at runtime, it is not dynamic.
|
||||
|
||||
@@ -103,7 +103,7 @@ You can create an object from this class with the new() method: >
|
||||
|
||||
var pos = TextPosition.new(1, 1)
|
||||
|
||||
The object members "lnum" and "col" can be accessed directly: >
|
||||
The object variables "lnum" and "col" can be accessed directly: >
|
||||
|
||||
echo $'The text position is ({pos.lnum}, {pos.col})'
|
||||
< *E1317* *E1327*
|
||||
@@ -111,50 +111,54 @@ If you have been using other object-oriented languages you will notice that
|
||||
in Vim the object members are consistently referred to with the "this."
|
||||
prefix. This is different from languages like Java and TypeScript. The
|
||||
naming convention makes the object members easy to spot. Also, when a
|
||||
variable does not have the "this." prefix you know it is not an object member.
|
||||
variable does not have the "this." prefix you know it is not an object
|
||||
variable.
|
||||
|
||||
|
||||
Member write access ~
|
||||
Object variable write access ~
|
||||
|
||||
Now try to change an object member directly: >
|
||||
Now try to change an object variable directly: >
|
||||
|
||||
pos.lnum = 9
|
||||
< *E1335*
|
||||
This will give you an error! That is because by default object members can be
|
||||
read but not set. That's why the TextPosition class provides a method for it: >
|
||||
This will give you an error! That is because by default object variables can
|
||||
be read but not set. That's why the TextPosition class provides a method for
|
||||
it: >
|
||||
|
||||
pos.SetLnum(9)
|
||||
|
||||
Allowing to read but not set an object member is the most common and safest
|
||||
Allowing to read but not set an object variable is the most common and safest
|
||||
way. Most often there is no problem using a value, while setting a value may
|
||||
have side effects that need to be taken care of. In this case, the SetLnum()
|
||||
method could check if the line number is valid and either give an error or use
|
||||
the closest valid value.
|
||||
*:public* *E1331*
|
||||
If you don't care about side effects and want to allow the object member to be
|
||||
changed at any time, you can make it public: >
|
||||
If you don't care about side effects and want to allow the object variable to
|
||||
be changed at any time, you can make it public: >
|
||||
|
||||
public this.lnum: number
|
||||
public this.col: number
|
||||
|
||||
Now you don't need the SetLnum(), SetCol() and SetPosition() methods, setting
|
||||
"pos.lnum" directly above will no longer give an error.
|
||||
*E1334*
|
||||
If you try to set an object member that doesn't exist you get an error: >
|
||||
*E1326*
|
||||
If you try to set an object variable that doesn't exist you get an error: >
|
||||
pos.other = 9
|
||||
< E1334: Object member not found: other ~
|
||||
< E1326: Member not found on object "TextPosition": other ~
|
||||
|
||||
*E1376*
|
||||
A object variable cannot be accessed using the class name.
|
||||
|
||||
Private members ~
|
||||
*E1332* *E1333*
|
||||
On the other hand, if you do not want the object members to be read directly,
|
||||
Private variables ~
|
||||
*private-variable* *E1332* *E1333*
|
||||
On the other hand, if you do not want the object variables to be read directly,
|
||||
you can make them private. This is done by prefixing an underscore to the
|
||||
name: >
|
||||
|
||||
this._lnum: number
|
||||
this._col number
|
||||
|
||||
Now you need to provide methods to get the value of the private members.
|
||||
Now you need to provide methods to get the value of the private variables.
|
||||
These are commonly called getters. We recommend using a name that starts with
|
||||
"Get": >
|
||||
|
||||
@@ -166,7 +170,7 @@ These are commonly called getters. We recommend using a name that starts with
|
||||
return this._col
|
||||
enddef
|
||||
|
||||
This example isn't very useful, the members might as well have been public.
|
||||
This example isn't very useful, the variables might as well have been public.
|
||||
It does become useful if you check the value. For example, restrict the line
|
||||
number to the total number of lines: >
|
||||
|
||||
@@ -176,9 +180,9 @@ number to the total number of lines: >
|
||||
endif
|
||||
return this._lnum
|
||||
enddef
|
||||
|
||||
|
||||
<
|
||||
Private methods ~
|
||||
*private-method* *E1366*
|
||||
If you want object methods to be accessible only from other methods of the
|
||||
same class and not used from outside the class, then you can make them
|
||||
private. This is done by prefixing the method name with an underscore: >
|
||||
@@ -199,9 +203,9 @@ the above class): >
|
||||
a._Foo()
|
||||
<
|
||||
Simplifying the new() method ~
|
||||
|
||||
Many constructors take values for the object members. Thus you very often see
|
||||
this pattern: >
|
||||
*new()* *constructor*
|
||||
Many constructors take values for the object variables. Thus you very often
|
||||
see this pattern: >
|
||||
|
||||
class SomeClass
|
||||
this.lnum: number
|
||||
@@ -212,20 +216,22 @@ this pattern: >
|
||||
this.col = col
|
||||
enddef
|
||||
endclass
|
||||
|
||||
Not only is this text you need to write, it also has the type of each member
|
||||
twice. Since this is so common a shorter way to write new() is provided: >
|
||||
<
|
||||
*E1390*
|
||||
Not only is this text you need to write, it also has the type of each
|
||||
variables twice. Since this is so common a shorter way to write new() is
|
||||
provided: >
|
||||
|
||||
def new(this.lnum, this.col)
|
||||
enddef
|
||||
|
||||
The semantics are easy to understand: Providing the object member name,
|
||||
The semantics are easy to understand: Providing the object variable name,
|
||||
including "this.", as the argument to new() means the value provided in the
|
||||
new() call is assigned to that object member. This mechanism comes from the
|
||||
new() call is assigned to that object variable. This mechanism comes from the
|
||||
Dart language.
|
||||
|
||||
Putting together this way of using new() and making the members public results
|
||||
in a much shorter class definition than what we started with: >
|
||||
Putting together this way of using new() and making the variables public
|
||||
results in a much shorter class definition than what we started with: >
|
||||
|
||||
class TextPosition
|
||||
public this.lnum: number
|
||||
@@ -242,26 +248,32 @@ in a much shorter class definition than what we started with: >
|
||||
|
||||
The sequence of constructing a new object is:
|
||||
1. Memory is allocated and cleared. All values are zero/false/empty.
|
||||
2. For each declared member that has an initializer, the expression is
|
||||
evaluated and assigned to the member. This happens in the sequence the
|
||||
members are declared in the class.
|
||||
2. For each declared object variable that has an initializer, the expression
|
||||
is evaluated and assigned to the variable. This happens in the sequence
|
||||
the variables are declared in the class.
|
||||
3. Arguments in the new() method in the "this.name" form are assigned.
|
||||
4. The body of the new() method is executed.
|
||||
|
||||
If the class extends a parent class, the same thing happens. In the second
|
||||
step the members of the parent class are done first. There is no need to call
|
||||
"super()" or "new()" on the parent.
|
||||
step the object variables of the parent class are initialized first. There is
|
||||
no need to call "super()" or "new()" on the parent.
|
||||
|
||||
*E1365*
|
||||
When defining the new() method the return type should not be specified. It
|
||||
always returns an object of the class.
|
||||
|
||||
*E1386*
|
||||
When invoking an object method, the method name should be preceded by the
|
||||
object variable name. A object method cannot be invoked using the class
|
||||
name.
|
||||
|
||||
==============================================================================
|
||||
|
||||
3. class members and functions *Vim9-class-member*
|
||||
3. Class Variables and Methods *Vim9-class-member*
|
||||
|
||||
*:static* *E1337* *E1338*
|
||||
*:static* *E1337* *E1338* *E1368*
|
||||
Class members are declared with "static". They are used by the name without a
|
||||
prefix: >
|
||||
prefix in the class where they are defined: >
|
||||
|
||||
class OtherThing
|
||||
this.size: number
|
||||
@@ -272,9 +284,13 @@ prefix: >
|
||||
enddef
|
||||
endclass
|
||||
< *E1340* *E1341*
|
||||
Since the name is used as-is, shadowing the name by a function argument name
|
||||
Since the name is used as-is, shadowing the name by a method argument name
|
||||
or local variable name is not allowed.
|
||||
|
||||
*E1374* *E1375* *E1384* *E1385*
|
||||
To access a class member outside of the class where it is defined, the class
|
||||
name prefix must be used. A class member cannot be accessed using an object.
|
||||
|
||||
Just like object members the access can be made private by using an underscore
|
||||
as the first character in the name, and it can be made public by prefixing
|
||||
"public": >
|
||||
@@ -285,10 +301,11 @@ as the first character in the name, and it can be made public by prefixing
|
||||
public static result: number # anybody can read and write
|
||||
endclass
|
||||
<
|
||||
*class-function*
|
||||
Class functions are also declared with "static". They have no access to
|
||||
object members, they cannot use the "this" keyword. >
|
||||
|
||||
*class-method*
|
||||
Class methods are also declared with "static". They can use the class
|
||||
variables but they have no access to the object variables, they cannot use the
|
||||
"this" keyword:
|
||||
>
|
||||
class OtherThing
|
||||
this.size: number
|
||||
static totalSize: number
|
||||
@@ -301,8 +318,9 @@ object members, they cannot use the "this" keyword. >
|
||||
enddef
|
||||
endclass
|
||||
|
||||
Inside the class the function can be called by name directly, outside the
|
||||
class the class name must be prefixed: `OtherThing.ClearTotalSize()`.
|
||||
Inside the class the class method can be called by name directly, outside the
|
||||
class the class name must be prefixed: `OtherThing.ClearTotalSize()`. To use
|
||||
a super class method in a child class, the class name must be prefixed.
|
||||
|
||||
Just like object methods the access can be made private by using an underscore
|
||||
as the first character in the method name: >
|
||||
@@ -312,7 +330,7 @@ as the first character in the method name: >
|
||||
echo "Foo"
|
||||
enddef
|
||||
def Bar()
|
||||
OtherThing._Foo()
|
||||
_Foo()
|
||||
enddef
|
||||
endclass
|
||||
<
|
||||
@@ -320,6 +338,31 @@ as the first character in the method name: >
|
||||
Note that constructors cannot be declared as "static", because they always
|
||||
are.
|
||||
|
||||
To access the class methods and class variables of a super class in an
|
||||
extended class, the class name prefix should be used just as from anywhere
|
||||
outside of the defining class: >
|
||||
|
||||
vim9script
|
||||
class Vehicle
|
||||
static nextID: number = 1000
|
||||
static def GetID(): number
|
||||
nextID += 1
|
||||
return nextID
|
||||
enddef
|
||||
endclass
|
||||
class Car extends Vehicle
|
||||
this.myID: number
|
||||
def new()
|
||||
this.myID = Vehicle.GetID()
|
||||
enddef
|
||||
endclass
|
||||
<
|
||||
Class variables and methods are not inherited by a child class. A child class
|
||||
can declare a static variable or a method with the same name as the one in the
|
||||
super class. Depending on the class where the member is used the
|
||||
corresponding class member will be used. The type of the class member in a
|
||||
child class can be different from that in the super class.
|
||||
|
||||
==============================================================================
|
||||
|
||||
4. Using an abstract class *Vim9-abstract-class*
|
||||
@@ -358,16 +401,21 @@ class, for which objects can be created. Example: >
|
||||
An abstract class is defined the same way as a normal class, except that it
|
||||
does not have any new() method. *E1359*
|
||||
|
||||
*abstract-method*
|
||||
*abstract-method* *E1371* *E1372*
|
||||
An abstract method can be defined in an abstract class by using the "abstract"
|
||||
prefix when defining the function: >
|
||||
prefix when defining the method: >
|
||||
|
||||
abstract class Shape
|
||||
abstract def Draw()
|
||||
abstract static def SetColor()
|
||||
endclass
|
||||
|
||||
<
|
||||
*E1373*
|
||||
A class extending the abstract class must implement all the abstract methods.
|
||||
Class methods in an abstract class can also be abstract methods.
|
||||
The signature (arguments, argument types and return type) must be exactly the
|
||||
same. If the return type of a method is a class, then that class or one of
|
||||
its subclasses can be used in the extended method. Class methods in an
|
||||
abstract class can also be abstract methods.
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -409,9 +457,10 @@ a number. This example extends the one above: >
|
||||
return this.base * this.height / 2
|
||||
enddef
|
||||
endclass
|
||||
|
||||
<
|
||||
*E1348* *E1349* *E1367* *E1382* *E1383*
|
||||
If a class declares to implement an interface, all the items specified in the
|
||||
interface must appear in the class, with the same types. *E1348* *E1349*
|
||||
interface must appear in the class, with the same types.
|
||||
|
||||
The interface name can be used as a type: >
|
||||
|
||||
@@ -422,7 +471,14 @@ The interface name can be used as a type: >
|
||||
for shape in shapes
|
||||
echo $'the surface is {shape.Surface()}'
|
||||
endfor
|
||||
<
|
||||
*E1378* *E1379* *E1380* *E1387*
|
||||
An interface can contain only object methods and read-only object variables.
|
||||
An interface cannot contain read-write and private object variables, private
|
||||
object methods, class variables and class methods.
|
||||
|
||||
An interface can extend another interface using "extends". The sub-interface
|
||||
inherits all the instance variables and methods from the super interface.
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -464,16 +520,22 @@ once. They can appear in any order, although this order is recommended: >
|
||||
extends ClassName
|
||||
implements InterfaceName, OtherInterface
|
||||
specifies SomeInterface
|
||||
< *E1355*
|
||||
Each member and function name can be used only once. It is not possible to
|
||||
define a function with the same name and different type of arguments.
|
||||
< *E1355* *E1369*
|
||||
Each variable and method name can be used only once. It is not possible to
|
||||
define a method with the same name and different type of arguments. It is not
|
||||
possible to use a public and private member variable with the same name. A
|
||||
object variable name used in a super class cannot be reused in a child class.
|
||||
|
||||
|
||||
Member Initialization ~
|
||||
If the type of a member is not explicitly specified in a class, then it is set
|
||||
to "any" during class definition. When an object is instantiated from the
|
||||
class, then the type of the member is set.
|
||||
Object Variable Initialization ~
|
||||
If the type of a variable is not explicitly specified in a class, then it is
|
||||
set to "any" during class definition. When an object is instantiated from the
|
||||
class, then the type of the variable is set.
|
||||
|
||||
The following reserved keyword names cannot be used as an object or class
|
||||
variable name: "super", "this", "true", "false", "null", "null_blob",
|
||||
"null_dict", "null_function", "null_list", "null_partial", "null_string",
|
||||
"null_channel" and "null_job".
|
||||
|
||||
Extending a class ~
|
||||
*extends*
|
||||
@@ -483,33 +545,39 @@ The basic idea is to build on top of an existing class, add properties to it.
|
||||
The extended class is called the "base class" or "super class". The new class
|
||||
is called the "child class".
|
||||
|
||||
Object members from the base class are all taken over by the child class. It
|
||||
Object variables from the base class are all taken over by the child class. It
|
||||
is not possible to override them (unlike some other languages).
|
||||
|
||||
*E1356* *E1357* *E1358*
|
||||
Object methods of the base class can be overruled. The signature (arguments,
|
||||
argument types and return type) must be exactly the same. The method of the
|
||||
base class can be called by prefixing "super.".
|
||||
argument types and return type) must be exactly the same. If the return type
|
||||
of a method is a class, then that class or one of its subclasses can be used
|
||||
in the extended method. The method of the base class can be called by
|
||||
prefixing "super.".
|
||||
|
||||
*E1377*
|
||||
The access level of a method (public or private) in a child class should be
|
||||
the same as the super class.
|
||||
|
||||
Other object methods of the base class are taken over by the child class.
|
||||
|
||||
Class functions, including functions starting with "new", can be overruled,
|
||||
like with object methods. The function on the base class can be called by
|
||||
prefixing the name of the class (for class functions) or "super.".
|
||||
Class methods, including methods starting with "new", can be overruled, like
|
||||
with object methods. The method on the base class can be called by prefixing
|
||||
the name of the class (for class methods) or "super.".
|
||||
|
||||
Unlike other languages, the constructor of the base class does not need to be
|
||||
invoked. In fact, it cannot be invoked. If some initialization from the base
|
||||
class also needs to be done in a child class, put it in an object method and
|
||||
call that method from every constructor().
|
||||
|
||||
If the base class did not specify a new() function then one was automatically
|
||||
created. This function will not be taken over by the child class. The child
|
||||
class can define its own new() function, or, if there isn't one, a new()
|
||||
function will be added automatically.
|
||||
If the base class did not specify a new() method then one was automatically
|
||||
created. This method will not be taken over by the child class. The child
|
||||
class can define its own new() method, or, if there isn't one, a new() method
|
||||
will be added automatically.
|
||||
|
||||
|
||||
A class implementing an interface ~
|
||||
*implements* *E1346* *E1347*
|
||||
*implements* *E1346* *E1347* *E1389*
|
||||
A class can implement one or more interfaces. The "implements" keyword can
|
||||
only appear once *E1350* . Multiple interfaces can be specified, separated by
|
||||
commas. Each interface name can appear only once. *E1351*
|
||||
@@ -517,28 +585,37 @@ commas. Each interface name can appear only once. *E1351*
|
||||
|
||||
A class defining an interface ~
|
||||
*specifies*
|
||||
A class can declare its interface, the object members and methods, with a
|
||||
A class can declare its interface, the object variables and methods, with a
|
||||
named interface. This avoids the need for separately specifying the
|
||||
interface, which is often done in many languages, especially Java.
|
||||
|
||||
|
||||
Items in a class ~
|
||||
*E1318* *E1325* *E1326*
|
||||
*E1318* *E1325* *E1388*
|
||||
Inside a class, in between `:class` and `:endclass`, these items can appear:
|
||||
- An object member declaration: >
|
||||
this._memberName: memberType
|
||||
this.memberName: memberType
|
||||
public this.memberName: memberType
|
||||
- An object variable declaration: >
|
||||
this._privateVariableName: memberType
|
||||
this.readonlyVariableName: memberType
|
||||
public this.readwriteVariableName: memberType
|
||||
- A class variable declaration: >
|
||||
static _privateClassVariableName: memberType
|
||||
static readonlyClassVariableName: memberType
|
||||
static public readwriteClassVariableName: memberType
|
||||
- A constructor method: >
|
||||
def new(arguments)
|
||||
def newName(arguments)
|
||||
- A class method: >
|
||||
static def SomeMethod(arguments)
|
||||
static def _PrivateMethod(arguments)
|
||||
- An object method: >
|
||||
def SomeMethod(arguments)
|
||||
< *E1329*
|
||||
For the object member the type must be specified. The best way is to do this
|
||||
explicitly with ": {type}". For simple types you can also use an initializer,
|
||||
such as "= 123", and Vim will see that the type is a number. Avoid doing this
|
||||
for more complex types and when the type will be incomplete. For example: >
|
||||
def _PrivateMethod(arguments)
|
||||
|
||||
For the object variable the type must be specified. The best way is to do
|
||||
this explicitly with ": {type}". For simple types you can also use an
|
||||
initializer, such as "= 123", and Vim will see that the type is a number.
|
||||
Avoid doing this for more complex types and when the type will be incomplete.
|
||||
For example: >
|
||||
this.nameList = []
|
||||
This specifies a list, but the item type is unknown. Better use: >
|
||||
this.nameList: list<string>
|
||||
@@ -558,8 +635,8 @@ prefixed with `:export`: >
|
||||
export interface InterfaceName
|
||||
endinterface
|
||||
< *E1344*
|
||||
An interface can declare object members, just like in a class but without any
|
||||
initializer.
|
||||
An interface can declare object variables, just like in a class but without
|
||||
any initializer.
|
||||
*E1345*
|
||||
An interface can declare methods with `:def`, including the arguments and
|
||||
return type, but without the body and without `:enddef`. Example: >
|
||||
@@ -573,6 +650,8 @@ An interface name must start with an uppercase letter. *E1343*
|
||||
The "Has" prefix can be used to make it easier to guess this is an interface
|
||||
name, with a hint about what it provides.
|
||||
An interface can only be defined in a |Vim9| script file. *E1342*
|
||||
An interface cannot "implement" another interface but it can "extend" another
|
||||
interface. *E1381*
|
||||
|
||||
|
||||
null object ~
|
||||
@@ -580,15 +659,15 @@ null object ~
|
||||
When a variable is declared to have the type of an object, but it is not
|
||||
initialized, the value is null. When trying to use this null object Vim often
|
||||
does not know what class was supposed to be used. Vim then cannot check if
|
||||
a member name is correct and you will get an "Using a null object" error,
|
||||
even when the member name is invalid. *E1360* *E1362* *E1363*
|
||||
a variable name is correct and you will get an "Using a null object" error,
|
||||
even when the variable name is invalid. *E1360* *E1362*
|
||||
|
||||
|
||||
Default constructor ~
|
||||
|
||||
*default-constructor*
|
||||
In case you define a class without a new() method, one will be automatically
|
||||
defined. This default constructor will have arguments for all the object
|
||||
members, in the order they were specified. Thus if your class looks like: >
|
||||
variables, in the order they were specified. Thus if your class looks like: >
|
||||
|
||||
class AutoNew
|
||||
this.name: string
|
||||
@@ -596,14 +675,14 @@ members, in the order they were specified. Thus if your class looks like: >
|
||||
this.gender: Gender
|
||||
endclass
|
||||
|
||||
Then The default constructor will be: >
|
||||
Then the default constructor will be: >
|
||||
|
||||
def new(this.name = v:none, this.age = v:none, this.gender = v:none)
|
||||
enddef
|
||||
|
||||
The "= v:none" default values make the arguments optional. Thus you can also
|
||||
call `new()` without any arguments. No assignment will happen and the default
|
||||
value for the object members will be used. This is a more useful example,
|
||||
value for the object variables will be used. This is a more useful example,
|
||||
with default values: >
|
||||
|
||||
class TextPosition
|
||||
@@ -619,13 +698,13 @@ the name, you can define the constructor like this: >
|
||||
enddef
|
||||
< *E1328*
|
||||
Note that you cannot use another default value than "v:none" here. If you
|
||||
want to initialize the object members, do it where they are declared. This
|
||||
want to initialize the object variables, do it where they are declared. This
|
||||
way you only need to look in one place for the default values.
|
||||
|
||||
All object members will be used in the default constructor, also private
|
||||
All object variables will be used in the default constructor, also private
|
||||
access ones.
|
||||
|
||||
If the class extends another one, the object members of that class will come
|
||||
If the class extends another one, the object variables of that class will come
|
||||
first.
|
||||
|
||||
|
||||
@@ -663,17 +742,19 @@ constructor methods.
|
||||
|
||||
7. Type definition *Vim9-type* *:type*
|
||||
|
||||
{not implemented yet}
|
||||
|
||||
A type definition is giving a name to a type specification. For Example: >
|
||||
|
||||
:type ListOfStrings list<string>
|
||||
|
||||
TODO: more explanation
|
||||
|
||||
|
||||
==============================================================================
|
||||
|
||||
8. Enum *Vim9-enum* *:enum* *:endenum*
|
||||
|
||||
{not implemented yet}
|
||||
|
||||
An enum is a type that can have one of a list of values. Example: >
|
||||
|
||||
:enum Color
|
||||
@@ -684,8 +765,6 @@ An enum is a type that can have one of a list of values. Example: >
|
||||
Black
|
||||
:endenum
|
||||
|
||||
TODO: more explanation
|
||||
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -739,7 +818,7 @@ the method being called is obvious.
|
||||
No overloading of the constructor ~
|
||||
|
||||
In Vim script, both legacy and |Vim9| script, there is no overloading of
|
||||
functions. That means it is not possible to use the same function name with
|
||||
methods. That means it is not possible to use the same method name with
|
||||
different types of arguments. Therefore there also is only one new()
|
||||
constructor.
|
||||
|
||||
@@ -782,39 +861,40 @@ class implements an interface just because the methods happen to match is
|
||||
brittle and leads to obscure problems, let's not do that.
|
||||
|
||||
|
||||
Using "this.member" everywhere ~
|
||||
Using "this.variable" everywhere ~
|
||||
|
||||
The object members in various programming languages can often be accessed in
|
||||
The object variables in various programming languages can often be accessed in
|
||||
different ways, depending on the location. Sometimes "this." has to be
|
||||
prepended to avoid ambiguity. They are usually declared without "this.".
|
||||
That is quite inconsistent and sometimes confusing.
|
||||
|
||||
A very common issue is that in the constructor the arguments use the same name
|
||||
as the object member. Then for these members "this." needs to be prefixed in
|
||||
the body, while for other members this is not needed and often omitted. This
|
||||
leads to a mix of members with and without "this.", which is inconsistent.
|
||||
as the object variable. Then for these variables "this." needs to be prefixed
|
||||
in the body, while for other variables this is not needed and often omitted.
|
||||
This leads to a mix of variables with and without "this.", which is
|
||||
inconsistent.
|
||||
|
||||
For |Vim9| classes the "this." prefix is always used. Also for declaring the
|
||||
members. Simple and consistent. When looking at the code inside a class it's
|
||||
also directly clear which variable references are object members and which
|
||||
aren't.
|
||||
variables. Simple and consistent. When looking at the code inside a class
|
||||
it's also directly clear which variable references are object variables and
|
||||
which aren't.
|
||||
|
||||
|
||||
Using class members ~
|
||||
Using class variables ~
|
||||
|
||||
Using "static member" to declare a class member is very common, nothing new
|
||||
here. In |Vim9| script these can be accessed directly by their name. Very
|
||||
much like how a script-local variable can be used in a function. Since object
|
||||
members are always accessed with "this." prepended, it's also quickly clear
|
||||
what kind of member it is.
|
||||
Using "static variable" to declare a class variable is very common, nothing
|
||||
new here. In |Vim9| script these can be accessed directly by their name.
|
||||
Very much like how a script-local variable can be used in a method. Since
|
||||
object variables are always accessed with "this." prepended, it's also quickly
|
||||
clear what kind of variable it is.
|
||||
|
||||
TypeScript prepends the class name before the class member, also inside the
|
||||
class. This has two problems: The class name can be rather long, taking up
|
||||
quite a bit of space, and when the class is renamed all these places need to
|
||||
be changed too.
|
||||
TypeScript prepends the class name before the class variable name, also inside
|
||||
the class. This has two problems: The class name can be rather long, taking
|
||||
up quite a bit of space, and when the class is renamed all these places need
|
||||
to be changed too.
|
||||
|
||||
|
||||
Declaring object and class members ~
|
||||
Declaring object and class variables ~
|
||||
|
||||
The main choice is whether to use "var" as with variable declarations.
|
||||
TypeScript does not use it: >
|
||||
@@ -823,7 +903,7 @@ TypeScript does not use it: >
|
||||
y = 0;
|
||||
}
|
||||
|
||||
Following that Vim object members could be declared like this: >
|
||||
Following that Vim object variables could be declared like this: >
|
||||
class Point
|
||||
this.x: number
|
||||
this.y = 0
|
||||
@@ -836,7 +916,7 @@ declaration. Adding "var" changes that: >
|
||||
var this.y = 0
|
||||
endclass
|
||||
|
||||
We also need to be able to declare class members using the "static" keyword.
|
||||
We also need to be able to declare class variables using the "static" keyword.
|
||||
There we can also choose to leave out "var": >
|
||||
class Point
|
||||
var this.x: number
|
||||
@@ -876,50 +956,50 @@ while there is no ClassName() method, it's a method by another name in the
|
||||
class called ClassName. Quite confusing.
|
||||
|
||||
|
||||
Default read access to object members ~
|
||||
Default read access to object variables ~
|
||||
|
||||
Some users will remark that the access rules for object members are
|
||||
Some users will remark that the access rules for object variables are
|
||||
asymmetric. Well, that is intentional. Changing a value is a very different
|
||||
action than reading a value. The read operation has no side effects, it can
|
||||
be done any number of times without affecting the object. Changing the value
|
||||
can have many side effects, and even have a ripple effect, affecting other
|
||||
objects.
|
||||
|
||||
When adding object members one usually doesn't think much about this, just get
|
||||
the type right. And normally the values are set in the new() method.
|
||||
When adding object variables one usually doesn't think much about this, just
|
||||
get the type right. And normally the values are set in the new() method.
|
||||
Therefore defaulting to read access only "just works" in most cases. And when
|
||||
directly writing you get an error, which makes you wonder if you actually want
|
||||
to allow that. This helps writing code with fewer mistakes.
|
||||
|
||||
|
||||
Making object members private with an underscore ~
|
||||
Making object variables private with an underscore ~
|
||||
|
||||
When an object member is private, it can only be read and changed inside the
|
||||
When an object variable is private, it can only be read and changed inside the
|
||||
class (and in sub-classes), then it cannot be used outside of the class.
|
||||
Prepending an underscore is a simple way to make that visible. Various
|
||||
programming languages have this as a recommendation.
|
||||
|
||||
In case you change your mind and want to make the object member accessible
|
||||
In case you change your mind and want to make the object variable accessible
|
||||
outside of the class, you will have to remove the underscore everywhere.
|
||||
Since the name only appears in the class (and sub-classes) they will be easy
|
||||
to find and change.
|
||||
|
||||
The other way around is much harder: you can easily prepend an underscore to
|
||||
the object member inside the class to make it private, but any usage elsewhere
|
||||
you will have to track down and change. You may have to make it a "set"
|
||||
method call. This reflects the real world problem that taking away access
|
||||
requires work to be done for all places where that access exists.
|
||||
the object variable inside the class to make it private, but any usage
|
||||
elsewhere you will have to track down and change. You may have to make it a
|
||||
"set" method call. This reflects the real world problem that taking away
|
||||
access requires work to be done for all places where that access exists.
|
||||
|
||||
An alternative would have been using the "private" keyword, just like "public"
|
||||
changes the access in the other direction. Well, that's just to reduce the
|
||||
number of keywords.
|
||||
|
||||
|
||||
No protected object members ~
|
||||
No protected object variables ~
|
||||
|
||||
Some languages provide several ways to control access to object members. The
|
||||
most known is "protected", and the meaning varies from language to language.
|
||||
Others are "shared", "private" and even "friend".
|
||||
Some languages provide several ways to control access to object variables.
|
||||
The most known is "protected", and the meaning varies from language to
|
||||
language. Others are "shared", "private" and even "friend".
|
||||
|
||||
These rules make life more difficult. That can be justified in projects where
|
||||
many people work on the same, complex code where it is easy to make mistakes.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*visual.txt* For Vim version 9.0. Last change: 2022 Dec 04
|
||||
*visual.txt* For Vim version 9.0. Last change: 2023 Sep 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -183,6 +183,8 @@ If you want to highlight exactly the same area as the last time, you can use
|
||||
CTRL-C In Visual mode: Stop Visual mode. When insert mode is
|
||||
pending (the mode message shows
|
||||
"-- (insert) VISUAL --"), it is also stopped.
|
||||
On MS-Windows, you may need to press CTRL-Break
|
||||
|dos-CTRL-Break|.
|
||||
|
||||
==============================================================================
|
||||
3. Changing the Visual area *visual-change*
|
||||
|
||||
@@ -70,7 +70,7 @@ Convertit en binaires plut
|
||||
Cette option écrit les octets comme une séquence de "1" et de "0" au lieu
|
||||
d'une conversion en hexadécimal traditionnel. Chaque ligne est précédée par un
|
||||
numéro de ligne en hexadécimal et suivie de la représentation ASCII (ou
|
||||
EBCDIC) correspondante. Les options \-r, \-p, \-i ne fonctionnent pas dans ce
|
||||
EBCDIC) correspondante. Les options \-p, \-i ne fonctionnent pas dans ce
|
||||
mode.
|
||||
.TP
|
||||
.IR "\-c cols " | " \-cols cols"
|
||||
|
||||
@@ -70,7 +70,7 @@ Convertit en binaires plutôt qu'en hexadécimal.
|
||||
Cette option écrit les octets comme une séquence de "1" et de "0" au lieu
|
||||
d'une conversion en hexadécimal traditionnel. Chaque ligne est précédée par un
|
||||
numéro de ligne en hexadécimal et suivie de la représentation ASCII (ou
|
||||
EBCDIC) correspondante. Les options \-r, \-p, \-i ne fonctionnent pas dans ce
|
||||
EBCDIC) correspondante. Les options \-p, \-i ne fonctionnent pas dans ce
|
||||
mode.
|
||||
.TP
|
||||
.IR "\-c cols " | " \-cols cols"
|
||||
|
||||
+18
-11
@@ -53,18 +53,18 @@ Pertanto
|
||||
.B \-c 010
|
||||
e
|
||||
.B \-cols 8
|
||||
sono notazioni equivalenti fra loro.
|
||||
sono tutte notazioni equivalenti fra loro.
|
||||
.PP
|
||||
.TP
|
||||
.IR \-a " | " \-autoskip
|
||||
Richiesta di omissione: Un singolo '*' rimpiazza righe a zeri binari. Default: off.
|
||||
.TP
|
||||
.IR \-b " | " \-bits
|
||||
Richiesta di una immagine binaria (cifre binarie), invece che esadecimale.
|
||||
Richiesta di un'immagine binaria (cifre binarie), invece che esadecimale.
|
||||
Quest'opzione scrive un byte come otto cifre "1" e "0" invece di usare i
|
||||
numeri esadecimali. Ogni riga è preceduta da un indirizzo in esadecimale e
|
||||
seguita da una decodifica ASCII (o EBCDIC). Le opzioni specificabili dalla
|
||||
riga comando \-r, \-p, \-i non funzionano in questo modo.
|
||||
seguita da una decodifica ASCII (o EBCDIC). Le opzioni \-p, \-i,
|
||||
specificabili dalla riga comando, non funzionano in questo modo.
|
||||
.TP
|
||||
.IR "\-c colonne " | " \-cols colonne"
|
||||
In ogni riga sono formattate
|
||||
@@ -123,22 +123,30 @@ Aggiunge
|
||||
alla posizione visualizzata dei byte del file.
|
||||
.TP
|
||||
.IR \-p " | " \-ps " | " \-postscript " | " \-plain
|
||||
L'output è nello stile di un dump esadecimale continuo sotto postscript. Noto anche come stile esadecimale semplice.
|
||||
L'output è nello stile di un dump esadecimale continuo sotto postscript.
|
||||
Noto anche come stile esadecimale semplice.
|
||||
.TP
|
||||
.IR \-r " | " \-revert
|
||||
Ricostruisce: converte (o mette una patch) da immagine esadecimale, a file binario.
|
||||
Se non scrive sullo `standard output', xxd scrive nel file di output in maniera
|
||||
continua, senza interruzioni. Usare la combinazione
|
||||
.I \-r \-p
|
||||
per leggere dump in stile esadecimale semplice, senza l'informazione del numero
|
||||
di riga e senza un particolare tracciato di colonna. Spazi o righe vuote possono
|
||||
essere presenti [e vengono ignorati].
|
||||
per leggere un dump in stile esadecimale semplice, senza l'informazione del numero
|
||||
di riga e senza un particolare tracciato di colonna. Spazi o righe vuote
|
||||
possono essere presenti dappertutto [e vengono ignorati]. Usare la combinazione
|
||||
.I \-r \-b
|
||||
per leggere un dump binario, invece che un dump esadecimale.
|
||||
.TP
|
||||
.IR \-R " "[quando]
|
||||
Nell'output i valori esadecimali e i caratteri corrispondenti hanno entrambi lo stesso colore, a seconda del valore esadecimale. Utile soprattutto a distinguere i caratteri stampabili da quello non stampabili.
|
||||
Nell'output i valori esadecimali e i caratteri corrispondenti hanno entrambi
|
||||
lo stesso colore, a seconda del valore esadecimale. Utile soprattutto a
|
||||
distinguere i caratteri stampabili da quelli non stampabili.
|
||||
.I quando
|
||||
può assumere i valori
|
||||
.BR never ", " always ", o " auto .
|
||||
Quando la variabile d'ambiente
|
||||
.BR $NO_COLOR
|
||||
è impostata, la colorazione viene disabilitata.
|
||||
.TP
|
||||
.I \-seek distanza
|
||||
Usato con l'opzione
|
||||
@@ -218,8 +226,7 @@ L'autore preferisce monitorare il comportamento di xxd con strace(1) o truss(1),
|
||||
.PP
|
||||
.br
|
||||
Stampa tutto tranne le prime tre righe (0x30 byte in esadecimale) di
|
||||
.BR file
|
||||
\.
|
||||
.BR file .
|
||||
.br
|
||||
\fI% xxd \-s 0x30 file\fR
|
||||
.PP
|
||||
|
||||
+18
-11
@@ -53,18 +53,18 @@ Pertanto
|
||||
.B \-c 010
|
||||
e
|
||||
.B \-cols 8
|
||||
sono notazioni equivalenti fra loro.
|
||||
sono tutte notazioni equivalenti fra loro.
|
||||
.PP
|
||||
.TP
|
||||
.IR \-a " | " \-autoskip
|
||||
Richiesta di omissione: Un singolo '*' rimpiazza righe a zeri binari. Default: off.
|
||||
.TP
|
||||
.IR \-b " | " \-bits
|
||||
Richiesta di una immagine binaria (cifre binarie), invece che esadecimale.
|
||||
Richiesta di un'immagine binaria (cifre binarie), invece che esadecimale.
|
||||
Quest'opzione scrive un byte come otto cifre "1" e "0" invece di usare i
|
||||
numeri esadecimali. Ogni riga è preceduta da un indirizzo in esadecimale e
|
||||
seguita da una decodifica ASCII (o EBCDIC). Le opzioni specificabili dalla
|
||||
riga comando \-r, \-p, \-i non funzionano in questo modo.
|
||||
seguita da una decodifica ASCII (o EBCDIC). Le opzioni \-p, \-i,
|
||||
specificabili dalla riga comando, non funzionano in questo modo.
|
||||
.TP
|
||||
.IR "\-c colonne " | " \-cols colonne"
|
||||
In ogni riga sono formattate
|
||||
@@ -123,22 +123,30 @@ Aggiunge
|
||||
alla posizione visualizzata dei byte del file.
|
||||
.TP
|
||||
.IR \-p " | " \-ps " | " \-postscript " | " \-plain
|
||||
L'output è nello stile di un dump esadecimale continuo sotto postscript. Noto anche come stile esadecimale semplice.
|
||||
L'output è nello stile di un dump esadecimale continuo sotto postscript.
|
||||
Noto anche come stile esadecimale semplice.
|
||||
.TP
|
||||
.IR \-r " | " \-revert
|
||||
Ricostruisce: converte (o mette una patch) da immagine esadecimale, a file binario.
|
||||
Se non scrive sullo `standard output', xxd scrive nel file di output in maniera
|
||||
continua, senza interruzioni. Usare la combinazione
|
||||
.I \-r \-p
|
||||
per leggere dump in stile esadecimale semplice, senza l'informazione del numero
|
||||
di riga e senza un particolare tracciato di colonna. Spazi o righe vuote possono
|
||||
essere presenti [e vengono ignorati].
|
||||
per leggere un dump in stile esadecimale semplice, senza l'informazione del numero
|
||||
di riga e senza un particolare tracciato di colonna. Spazi o righe vuote
|
||||
possono essere presenti dappertutto [e vengono ignorati]. Usare la combinazione
|
||||
.I \-r \-b
|
||||
per leggere un dump binario, invece che un dump esadecimale.
|
||||
.TP
|
||||
.IR \-R " "[quando]
|
||||
Nell'output i valori esadecimali e i caratteri corrispondenti hanno entrambi lo stesso colore, a seconda del valore esadecimale. Utile soprattutto a distinguere i caratteri stampabili da quello non stampabili.
|
||||
Nell'output i valori esadecimali e i caratteri corrispondenti hanno entrambi
|
||||
lo stesso colore, a seconda del valore esadecimale. Utile soprattutto a
|
||||
distinguere i caratteri stampabili da quelli non stampabili.
|
||||
.I quando
|
||||
può assumere i valori
|
||||
.BR never ", " always ", o " auto .
|
||||
Quando la variabile d'ambiente
|
||||
.BR $NO_COLOR
|
||||
è impostata, la colorazione viene disabilitata.
|
||||
.TP
|
||||
.I \-seek distanza
|
||||
Usato con l'opzione
|
||||
@@ -218,8 +226,7 @@ L'autore preferisce monitorare il comportamento di xxd con strace(1) o truss(1),
|
||||
.PP
|
||||
.br
|
||||
Stampa tutto tranne le prime tre righe (0x30 byte in esadecimale) di
|
||||
.BR file
|
||||
\.
|
||||
.BR file .
|
||||
.br
|
||||
\fI% xxd \-s 0x30 file\fR
|
||||
.PP
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
1 オクテットが "1" と "0" の 8 文字で出力されます。
|
||||
各行の行頭には 16 進数の行番号が表示されます。
|
||||
行末には ascii (または ebcdic) で表した場合の文字が表示されます。
|
||||
このモードでは \-r、\-p、\-i は機能しません。
|
||||
このモードでは \-p、\-i は機能しません。
|
||||
.TP
|
||||
.IR \-e
|
||||
リトルエンディアンの 16 進ダンプに切り替える。
|
||||
|
||||
@@ -66,7 +66,7 @@ Prze
|
||||
Opcja ta zapisuje oktety jako osiem cyfr 1 lub 0 zamiast normalnego
|
||||
zrzutu heksowego. Każda linia jest poprzedzona przez
|
||||
heksadecymalny numer linii a po nim jego reprezentacją w ascii (lub
|
||||
ebcdic). Opcje linii poleceń \-r, \-p, \-i nie działają w tym
|
||||
ebcdic). Opcje linii poleceń \-p, \-i nie działają w tym
|
||||
trybie.
|
||||
.TP
|
||||
.IR "\-c cols " | " \-cols cols"
|
||||
|
||||
@@ -66,7 +66,7 @@ Przełącza do zrzutu bitowego (cyfr binarnych) zamiast heksowego.
|
||||
Opcja ta zapisuje oktety jako osiem cyfr 1 lub 0 zamiast normalnego
|
||||
zrzutu heksowego. Każda linia jest poprzedzona przez
|
||||
heksadecymalny numer linii a po nim jego reprezentacją w ascii (lub
|
||||
ebcdic). Opcje linii poleceń \-r, \-p, \-i nie działają w tym
|
||||
ebcdic). Opcje linii poleceń \-p, \-i nie działają w tym
|
||||
trybie.
|
||||
.TP
|
||||
.IR "\-c cols " | " \-cols cols"
|
||||
|
||||
@@ -70,7 +70,7 @@ xxd
|
||||
При использовании этого ключа вместо обычного шестнадцатеричного представления
|
||||
октетов используются наборы из восьми символов "1" и "0". Каждая строка
|
||||
предваряется номером строки в шестнадцатеричном виде, а завершается символьным
|
||||
представлением (в виде ascii или ebcdic). Ключи \-r, \-p, \-i в этом режиме
|
||||
представлением (в виде ascii или ebcdic). Ключи \-p, \-i в этом режиме
|
||||
не работают.
|
||||
.TP
|
||||
.IR "\-c кол " | " \-cols кол"
|
||||
|
||||
@@ -70,7 +70,7 @@ xxd позволяет выполнять декодирование в пото
|
||||
При использовании этого ключа вместо обычного шестнадцатеричного представления
|
||||
октетов используются наборы из восьми символов "1" и "0". Каждая строка
|
||||
предваряется номером строки в шестнадцатеричном виде, а завершается символьным
|
||||
представлением (в виде ascii или ebcdic). Ключи \-r, \-p, \-i в этом режиме
|
||||
представлением (в виде ascii или ebcdic). Ключи \-p, \-i в этом режиме
|
||||
не работают.
|
||||
.TP
|
||||
.IR "\-c кол " | " \-cols кол"
|
||||
|
||||
+10
-3
@@ -64,7 +64,7 @@ Switch to bits (binary digits) dump, rather than hex dump.
|
||||
This option writes octets as eight digits "1"s and "0"s instead of a normal
|
||||
hexadecimal dump. Each line is preceded by a line number in hexadecimal and
|
||||
followed by an ASCII (or EBCDIC) representation. The command line switches
|
||||
\-r, \-p, \-i do not work with this mode.
|
||||
\-p, \-i do not work with this mode.
|
||||
.TP
|
||||
.IR "\-c cols " | " \-cols cols"
|
||||
Format
|
||||
@@ -133,13 +133,20 @@ it. Use the combination
|
||||
.I \-r \-p
|
||||
to read plain hexadecimal dumps without line number information and without a
|
||||
particular column layout. Additional whitespace and line breaks are allowed
|
||||
anywhere.
|
||||
anywhere. Use the combination
|
||||
.I \-r \-b
|
||||
to read a bits dump instead of a hex dump.
|
||||
.TP
|
||||
.IR \-R " " when
|
||||
In output the hex-value and the value are both colored with the same color depending on the hex-value. Mostly helping to differentiate printable and non-printable characters.
|
||||
In output the hex-value and the value are both colored with the same color
|
||||
depending on the hex-value. Mostly helping to differentiate printable and
|
||||
non-printable characters.
|
||||
.I \fIwhen\fP
|
||||
is
|
||||
.BR never ", " always ", or " auto .
|
||||
When the
|
||||
.BR $NO_COLOR
|
||||
environment variable is set, colorization will be disabled.
|
||||
.TP
|
||||
.I \-seek offset
|
||||
When used after
|
||||
|
||||
+62
-54
@@ -3,7 +3,7 @@ XXD(1) General Commands Manual XXD(1)
|
||||
|
||||
|
||||
NAME
|
||||
xxd - make a hexdump or do the reverse.
|
||||
xxd - make a hex dump or do the reverse.
|
||||
|
||||
SYNOPSIS
|
||||
xxd -h[elp]
|
||||
@@ -30,19 +30,19 @@ OPTIONS
|
||||
notation. Thus -c8, -c 8, -c 010 and -cols 8 are all equivalent.
|
||||
|
||||
-a | -autoskip
|
||||
Toggle autoskip: A single '*' replaces nul-lines. Default off.
|
||||
Toggle autoskip: A single '*' replaces NUL-lines. Default off.
|
||||
|
||||
-b | -bits
|
||||
Switch to bits (binary digits) dump, rather than hexdump. This
|
||||
Switch to bits (binary digits) dump, rather than hex dump. This
|
||||
option writes octets as eight digits "1"s and "0"s instead of a
|
||||
normal hexadecimal dump. Each line is preceded by a line number
|
||||
in hexadecimal and followed by an ascii (or ebcdic) representa‐
|
||||
tion. The command line switches -r, -p, -i do not work with this
|
||||
in hexadecimal and followed by an ASCII (or EBCDIC) representa‐
|
||||
tion. The command line switches -p, -i do not work with this
|
||||
mode.
|
||||
|
||||
-c cols | -cols cols
|
||||
Format <cols> octets per line. Default 16 (-i: 12, -ps: 30, -b:
|
||||
6). Max 256. No maxmimum for -ps. With -ps, 0 results in one
|
||||
6). Max 256. No maximum for -ps. With -ps, 0 results in one
|
||||
long line of output.
|
||||
|
||||
-C | -capitalize
|
||||
@@ -54,84 +54,92 @@ OPTIONS
|
||||
to EBCDIC. This does not change the hexadecimal representation.
|
||||
The option is meaningless in combinations with -r, -p or -i.
|
||||
|
||||
-e Switch to little-endian hexdump. This option treats byte groups
|
||||
as words in little-endian byte order. The default grouping of 4
|
||||
bytes may be changed using -g. This option only applies to hex‐
|
||||
dump, leaving the ASCII (or EBCDIC) representation unchanged.
|
||||
The command line switches -r, -p, -i do not work with this mode.
|
||||
-e Switch to little-endian hex dump. This option treats byte
|
||||
groups as words in little-endian byte order. The default group‐
|
||||
ing of 4 bytes may be changed using -g. This option only ap‐
|
||||
plies to the hex dump, leaving the ASCII (or EBCDIC) representa‐
|
||||
tion unchanged. The command line switches -r, -p, -i do not
|
||||
work with this mode.
|
||||
|
||||
-g bytes | -groupsize bytes
|
||||
Separate the output of every <bytes> bytes (two hex characters
|
||||
or eight bit-digits each) by a whitespace. Specify -g 0 to sup‐
|
||||
Separate the output of every <bytes> bytes (two hex characters
|
||||
or eight bit digits each) by a whitespace. Specify -g 0 to sup‐
|
||||
press grouping. <Bytes> defaults to 2 in normal mode, 4 in lit‐
|
||||
tle-endian mode and 1 in bits mode. Grouping does not apply to
|
||||
postscript or include style.
|
||||
tle-endian mode and 1 in bits mode. Grouping does not apply to
|
||||
PostScript or include style.
|
||||
|
||||
-h | -help
|
||||
Print a summary of available commands and exit. No hex dumping
|
||||
Print a summary of available commands and exit. No hex dumping
|
||||
is performed.
|
||||
|
||||
-i | -include
|
||||
Output in C include file style. A complete static array defini‐
|
||||
tion is written (named after the input file), unless xxd reads
|
||||
Output in C include file style. A complete static array defini‐
|
||||
tion is written (named after the input file), unless xxd reads
|
||||
from stdin.
|
||||
|
||||
-l len | -len len
|
||||
Stop after writing <len> octets.
|
||||
|
||||
-n name | -name name
|
||||
Override the variable name output when -i is used. The array is
|
||||
Override the variable name output when -i is used. The array is
|
||||
named name and the length is named name_len.
|
||||
|
||||
-o offset
|
||||
Add <offset> to the displayed file position.
|
||||
|
||||
-p | -ps | -postscript | -plain
|
||||
Output in postscript continuous hexdump style. Also known as
|
||||
plain hexdump style.
|
||||
Output in PostScript continuous hex dump style. Also known as
|
||||
plain hex dump style.
|
||||
|
||||
-r | -revert
|
||||
Reverse operation: convert (or patch) hexdump into binary. If
|
||||
not writing to stdout, xxd writes into its output file without
|
||||
Reverse operation: convert (or patch) hex dump into binary. If
|
||||
not writing to stdout, xxd writes into its output file without
|
||||
truncating it. Use the combination -r -p to read plain hexadeci‐
|
||||
mal dumps without line number information and without a particu‐
|
||||
lar column layout. Additional Whitespace and line-breaks are al‐
|
||||
lowed anywhere.
|
||||
lar column layout. Additional whitespace and line breaks are al‐
|
||||
lowed anywhere. Use the combination -r -b to read a bits dump
|
||||
instead of a hex dump.
|
||||
|
||||
-R when
|
||||
In output the hex-value and the value are both colored with the
|
||||
same color depending on the hex-value. Mostly helping to differ‐
|
||||
entiate printable and non-printable characters. when is never,
|
||||
always, or auto. When the $NO_COLOR environment variable is
|
||||
set, colorization will be disabled.
|
||||
|
||||
-seek offset
|
||||
When used after -r: revert with <offset> added to file positions
|
||||
found in hexdump.
|
||||
found in hex dump.
|
||||
|
||||
-s [+][-]seek
|
||||
Start at <seek> bytes abs. (or rel.) infile offset. + indicates
|
||||
that the seek is relative to the current stdin file position
|
||||
that the seek is relative to the current stdin file position
|
||||
(meaningless when not reading from stdin). - indicates that the
|
||||
seek should be that many characters from the end of the input
|
||||
seek should be that many characters from the end of the input
|
||||
(or if combined with +: before the current stdin file position).
|
||||
Without -s option, xxd starts at the current file position.
|
||||
|
||||
-u Use upper case hex letters. Default is lower case.
|
||||
-u Use upper-case hex letters. Default is lower-case.
|
||||
|
||||
-v | -version
|
||||
Show version string.
|
||||
|
||||
CAVEATS
|
||||
xxd -r has some builtin magic while evaluating line number information.
|
||||
If the output file is seekable, then the linenumbers at the start of
|
||||
each hexdump line may be out of order, lines may be missing, or over‐
|
||||
lapping. In these cases xxd will lseek(2) to the next position. If the
|
||||
output file is not seekable, only gaps are allowed, which will be
|
||||
filled by null-bytes.
|
||||
xxd -r has some built-in magic while evaluating line number informa‐
|
||||
tion. If the output file is seekable, then the line numbers at the
|
||||
start of each hex dump line may be out of order, lines may be missing,
|
||||
or overlapping. In these cases xxd will lseek(2) to the next position.
|
||||
If the output file is not seekable, only gaps are allowed, which will
|
||||
be filled by null-bytes.
|
||||
|
||||
xxd -r never generates parse errors. Garbage is silently skipped.
|
||||
|
||||
When editing hexdumps, please note that xxd -r skips everything on the
|
||||
When editing hex dumps, please note that xxd -r skips everything on the
|
||||
input line after reading enough columns of hexadecimal data (see option
|
||||
-c). This also means, that changes to the printable ascii (or ebcdic)
|
||||
columns are always ignored. Reverting a plain (or postscript) style
|
||||
hexdump with xxd -r -p does not depend on the correct number of col‐
|
||||
umns. Here anything that looks like a pair of hex-digits is inter‐
|
||||
preted.
|
||||
-c). This also means that changes to the printable ASCII (or EBCDIC)
|
||||
columns are always ignored. Reverting a plain (or PostScript) style hex
|
||||
dump with xxd -r -p does not depend on the correct number of columns.
|
||||
Here, anything that looks like a pair of hex digits is interpreted.
|
||||
|
||||
Note the difference between
|
||||
% xxd -i file
|
||||
@@ -142,19 +150,19 @@ CAVEATS
|
||||
"rewind" input. A '+' makes a difference if the input source is stdin,
|
||||
and if stdin's file position is not at the start of the file by the
|
||||
time xxd is started and given its input. The following examples may
|
||||
help to clarify (or further confuse!)...
|
||||
help to clarify (or further confuse!):
|
||||
|
||||
Rewind stdin before reading; needed because the `cat' has already read
|
||||
to the end of stdin.
|
||||
% sh -c "cat > plain_copy; xxd -s 0 > hex_copy" < file
|
||||
|
||||
Hexdump from file position 0x480 (=1024+128) onwards. The `+' sign
|
||||
Hex dump from file position 0x480 (=1024+128) onwards. The `+' sign
|
||||
means "relative to the current position", thus the `128' adds to the 1k
|
||||
where dd left off.
|
||||
% sh -c "dd of=plain_snippet bs=1k count=1; xxd -s +128 > hex_snippet"
|
||||
< file
|
||||
|
||||
Hexdump from file position 0x100 ( = 1024-768) on.
|
||||
Hex dump from file position 0x100 (=1024-768) onwards.
|
||||
% sh -c "dd of=plain_snippet bs=1k count=1; xxd -s +-768 > hex_snippet"
|
||||
< file
|
||||
|
||||
@@ -169,7 +177,7 @@ EXAMPLES
|
||||
Print 3 lines (hex 0x30 bytes) from the end of file.
|
||||
% xxd -s -0x30 file
|
||||
|
||||
Print 120 bytes as continuous hexdump with 20 octets per line.
|
||||
Print 120 bytes as a continuous hex dump with 20 octets per line.
|
||||
% xxd -l 120 -ps -c 20 xxd.1
|
||||
2e54482058584420312022417567757374203139
|
||||
39362220224d616e75616c207061676520666f72
|
||||
@@ -178,7 +186,7 @@ EXAMPLES
|
||||
20617574686f723a0a2e5c2220202020546f6e79
|
||||
204e7567656e74203c746f6e79407363746e7567
|
||||
|
||||
Hexdump the first 120 bytes of this man page with 12 octets per line.
|
||||
Hex dump the first 120 bytes of this man page with 12 octets per line.
|
||||
% xxd -l 120 -c 12 xxd.1
|
||||
0000000: 2e54 4820 5858 4420 3120 2241 .TH XXD 1 "A
|
||||
000000c: 7567 7573 7420 3139 3936 2220 ugust 1996"
|
||||
@@ -207,27 +215,27 @@ EXAMPLES
|
||||
which is 'A' (hex 0x41).
|
||||
% echo "010000: 41" | xxd -r > file
|
||||
|
||||
Hexdump this file with autoskip.
|
||||
Hex dump this file with autoskip.
|
||||
% xxd -a -c 12 file
|
||||
0000000: 0000 0000 0000 0000 0000 0000 ............
|
||||
*
|
||||
000fffc: 0000 0000 40 ....A
|
||||
|
||||
Create a 1 byte file containing a single 'A' character. The number af‐
|
||||
ter '-r -s' adds to the linenumbers found in the file; in effect, the
|
||||
ter '-r -s' adds to the line numbers found in the file; in effect, the
|
||||
leading bytes are suppressed.
|
||||
% echo "010000: 41" | xxd -r -s -0x10000 > file
|
||||
|
||||
Use xxd as a filter within an editor such as vim(1) to hexdump a region
|
||||
marked between `a' and `z'.
|
||||
Use xxd as a filter within an editor such as vim(1) to hex dump a re‐
|
||||
gion marked between `a' and `z'.
|
||||
:'a,'z!xxd
|
||||
|
||||
Use xxd as a filter within an editor such as vim(1) to recover a binary
|
||||
hexdump marked between `a' and `z'.
|
||||
hex dump marked between `a' and `z'.
|
||||
:'a,'z!xxd -r
|
||||
|
||||
Use xxd as a filter within an editor such as vim(1) to recover one line
|
||||
of a hexdump. Move the cursor over the line and type:
|
||||
of a hex dump. Move the cursor over the line and type:
|
||||
!!xxd -r
|
||||
|
||||
Read single characters from a serial line
|
||||
@@ -240,7 +248,7 @@ RETURN VALUES
|
||||
|
||||
0 no errors encountered.
|
||||
|
||||
-1 operation not supported ( xxd -r -i still impossible).
|
||||
-1 operation not supported (xxd -r -i still impossible).
|
||||
|
||||
1 error while parsing options.
|
||||
|
||||
@@ -254,7 +262,7 @@ SEE ALSO
|
||||
uuencode(1), uudecode(1), patch(1)
|
||||
|
||||
WARNINGS
|
||||
The tools weirdness matches its creators brain. Use entirely at your
|
||||
The tool's weirdness matches its creator's brain. Use entirely at your
|
||||
own risk. Copy files. Trace it. Become a wizard.
|
||||
|
||||
VERSION
|
||||
|
||||
+11
-1
@@ -184,6 +184,9 @@ au BufNewFile,BufRead *.atl,*.as setf atlas
|
||||
" Atom is based on XML
|
||||
au BufNewFile,BufRead *.atom setf xml
|
||||
|
||||
" Authzed
|
||||
au BufNewFile,BufRead *.zed setf authzed
|
||||
|
||||
" Autoit v3
|
||||
au BufNewFile,BufRead *.au3 setf autoit
|
||||
|
||||
@@ -541,6 +544,7 @@ au BufNewFile,BufRead copyright
|
||||
" Debian Sources.list
|
||||
au BufNewFile,BufRead */etc/apt/sources.list setf debsources
|
||||
au BufNewFile,BufRead */etc/apt/sources.list.d/*.list setf debsources
|
||||
au BufNewFile,BufRead */etc/apt/sources.list.d/*.sources setf deb822sources
|
||||
|
||||
" Deny hosts
|
||||
au BufNewFile,BufRead denyhosts.conf setf denyhosts
|
||||
@@ -1010,7 +1014,7 @@ au BufNewFile,BufRead ipf.conf,ipf6.conf,ipf.rules setf ipfilter
|
||||
au BufNewFile,BufRead *.4gl,*.4gh,*.m4gl setf fgl
|
||||
|
||||
" .INI file for MSDOS
|
||||
au BufNewFile,BufRead *.ini setf dosini
|
||||
au BufNewFile,BufRead *.ini,*.INI setf dosini
|
||||
|
||||
" SysV Inittab
|
||||
au BufNewFile,BufRead inittab setf inittab
|
||||
@@ -1090,6 +1094,9 @@ au BufNewFile,BufRead *.jsonnet,*.libsonnet setf jsonnet
|
||||
" Julia
|
||||
au BufNewFile,BufRead *.jl setf julia
|
||||
|
||||
" Just
|
||||
au BufNewFile,BufRead [jJ]ustfile,.justfile,*.just setf just
|
||||
|
||||
" KDL
|
||||
au BufNewFile,BufRead *.kdl setf kdl
|
||||
|
||||
@@ -1181,6 +1188,9 @@ endif
|
||||
" SBCL implementation of Common Lisp
|
||||
au BufNewFile,BufRead sbclrc,.sbclrc setf lisp
|
||||
|
||||
" Liquidsoap
|
||||
au BufNewFile,BufRead *.liq setf liquidsoap
|
||||
|
||||
" Liquid
|
||||
au BufNewFile,BufRead *.liquid setf liquid
|
||||
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Dan Sharp
|
||||
" Contributor: Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: 2021 Oct 15
|
||||
" Last Change: 2023 Oct 09
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
@@ -18,7 +20,7 @@ setlocal formatoptions+=crql
|
||||
|
||||
let b:undo_ftplugin = "setlocal com< cms< fo<"
|
||||
|
||||
" Csh: thanks to Johannes Zellner
|
||||
" Csh: thanks to Johannes Zellner
|
||||
" - Both foreach and end must appear alone on separate lines.
|
||||
" - The words else and endif must appear at the beginning of input lines;
|
||||
" the if must appear alone on its input line or after an else.
|
||||
@@ -38,13 +40,14 @@ if exists("loaded_matchit") && !exists("b:match_words")
|
||||
\ s:line_start .. 'case\s\+:' .. s:line_start .. 'default\>:\<breaksw\>:' ..
|
||||
\ s:line_start .. 'endsw\>'
|
||||
unlet s:line_start
|
||||
let b:undo_ftplugin ..= " | unlet b:match_words"
|
||||
let b:undo_ftplugin ..= " | unlet! b:match_words"
|
||||
endif
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter="csh Scripts (*.csh)\t*.csh\n" ..
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
let b:undo_ftplugin ..= " | unlet b:browsefilter"
|
||||
let b:browsefilter = "csh Scripts (*.csh)\t*.csh\n" ..
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
let b:csh_set_browsefilter = 1
|
||||
let b:undo_ftplugin ..= " | unlet! b:browsefilter b:csh_set_browsefilter"
|
||||
endif
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Forth
|
||||
" Maintainer: Johan Kotlinski <kotlinski@gmail.com>
|
||||
" Last Change: 2023 Aug 08
|
||||
" Last Change: 2023 Sep 15
|
||||
" URL: https://github.com/jkotlinski/forth.vim
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -58,6 +58,7 @@ if exists("loaded_matchit") && !exists("b:match_words")
|
||||
let b:match_ignorecase = 1
|
||||
let b:match_words = s:matchit_patterns[1:]->join(',')
|
||||
let b:undo_ftplugin ..= "| unlet! b:match_ignorecase b:match_words"
|
||||
unlet s:matchit_patterns
|
||||
endif
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
@@ -68,4 +69,4 @@ endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
unlet s:define_patterns s:include_patterns s:matchit_patterns
|
||||
unlet s:define_patterns s:include_patterns
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: gpg(1) configuration file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
" Latest Revision: 2023-10-07
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -17,17 +17,17 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
|
||||
if has('unix') && executable('less')
|
||||
if !has('gui_running')
|
||||
command -buffer -nargs=1 Sman
|
||||
command -buffer -nargs=1 GpgKeywordPrg
|
||||
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+--' . <q-args> . '\b'' --hilite-search" man ' . 'gpg' |
|
||||
\ redraw!
|
||||
elseif has('terminal')
|
||||
command -buffer -nargs=1 Sman
|
||||
command -buffer -nargs=1 GpgKeywordPrg
|
||||
\ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+--' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'gpg'
|
||||
endif
|
||||
if exists(':Sman') == 2
|
||||
if exists(':GpgKeywordPrg') == 2
|
||||
setlocal iskeyword+=-
|
||||
setlocal keywordprg=:Sman
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman'
|
||||
setlocal keywordprg=:GpgKeywordPrg
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer GpgKeywordPrg'
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Kotlin
|
||||
" Maintainer: Alexander Udalov
|
||||
" URL: https://github.com/udalov/kotlin-vim
|
||||
" Last Change: 7 November 2021
|
||||
" 2023 Sep 17 by Vim Project (browsefilter)
|
||||
|
||||
if exists('b:did_ftplugin') | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
||||
setlocal commentstring=//\ %s
|
||||
|
||||
setlocal formatoptions-=t formatoptions+=croqnl
|
||||
silent! setlocal formatoptions+=j
|
||||
|
||||
setlocal includeexpr=substitute(v:fname,'\\.','/','g')
|
||||
setlocal suffixesadd=.kt
|
||||
|
||||
let b:undo_ftplugin = "setlocal comments< commentstring< ".
|
||||
\ "formatoptions< includeexpr< suffixesadd<"
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Kotlin Source Files (*.kt, *kts)\t*.kt;*.kts\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
let b:undo_ftplugin .= " | unlet! b:browsefilter"
|
||||
endif
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: modules.conf(5) configuration file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
" Latest Revision: 2023-10-07
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -18,17 +18,17 @@ setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
if has('unix') && executable('less')
|
||||
if !has('gui_running')
|
||||
command -buffer -nargs=1 Sman
|
||||
command -buffer -nargs=1 ModconfKeywordPrg
|
||||
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . <q-args> . '\b'' --hilite-search" man ' . 'modprobe.d' |
|
||||
\ redraw!
|
||||
elseif has('terminal')
|
||||
command -buffer -nargs=1 Sman
|
||||
command -buffer -nargs=1 ModconfKeywordPrg
|
||||
\ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'modprobe.d'
|
||||
endif
|
||||
if exists(':Sman') == 2
|
||||
if exists(':ModconfKeywordPrg') == 2
|
||||
setlocal iskeyword+=-
|
||||
setlocal keywordprg=:Sman
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman'
|
||||
setlocal keywordprg=:ModconfKeywordPrg
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ModconfKeywordPrg'
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: mutt RC File
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2006-04-19
|
||||
" Latest Revision: 2023-10-07
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -20,17 +20,17 @@ let &l:include = '^\s*source\>'
|
||||
|
||||
if has('unix') && executable('less')
|
||||
if !has('gui_running')
|
||||
command -buffer -nargs=1 Sman
|
||||
command -buffer -nargs=1 MuttrcKeywordPrg
|
||||
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . 'muttrc' |
|
||||
\ redraw!
|
||||
elseif has('terminal')
|
||||
command -buffer -nargs=1 Sman
|
||||
command -buffer -nargs=1 MuttrcKeywordPrg
|
||||
\ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'muttrc'
|
||||
endif
|
||||
if exists(':Sman') == 2
|
||||
if exists(':MuttrcKeywordPrg') == 2
|
||||
setlocal iskeyword+=-
|
||||
setlocal keywordprg=:Sman
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman'
|
||||
setlocal keywordprg=:MuttrcKeywordPrg
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer MuttrcKeywordPrg'
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -32,17 +32,17 @@ endif
|
||||
|
||||
if has('unix') && executable('less')
|
||||
if !has('gui_running')
|
||||
command -buffer -nargs=1 Sman
|
||||
command -buffer -nargs=1 ReadlineKeywordPrg
|
||||
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . '3 readline' |
|
||||
\ redraw!
|
||||
elseif has('terminal')
|
||||
command -buffer -nargs=1 Sman
|
||||
command -buffer -nargs=1 ReadlineKeywordPrg
|
||||
\ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline'
|
||||
endif
|
||||
if exists(':Sman') == 2
|
||||
if exists(':ReadlineKeywordPrg') == 2
|
||||
setlocal iskeyword+=-
|
||||
setlocal keywordprg=:Sman
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman'
|
||||
setlocal keywordprg=:ReadlineKeywordPrg
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ReadlineKeywordPrg'
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: R Markdown file
|
||||
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
|
||||
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
|
||||
" Last Change: Mon Feb 27, 2023 07:15PM
|
||||
" Last Change: Mon May 29, 2023 06:31AM
|
||||
" Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann)
|
||||
|
||||
" Only do this when not yet done for this buffer
|
||||
@@ -32,12 +32,18 @@ function FormatRmd()
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
let s:last_line = 0
|
||||
function SetRmdCommentStr()
|
||||
if (search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")) || ((search('^---$', 'Wn') || search('^\.\.\.$', 'Wn')) && search('^---$', 'bnW'))
|
||||
set commentstring=#\ %s
|
||||
else
|
||||
set commentstring=<!--\ %s\ -->
|
||||
endif
|
||||
if line('.') == s:last_line
|
||||
return
|
||||
endif
|
||||
let s:last_line = line('.')
|
||||
|
||||
if (search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")) || ((search('^---$', 'Wn') || search('^\.\.\.$', 'Wn')) && search('^---$', 'bnW'))
|
||||
set commentstring=#\ %s
|
||||
else
|
||||
set commentstring=<!--\ %s\ -->
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" If you do not want both 'comments' and 'commentstring' dynamically defined,
|
||||
|
||||
+144
-102
@@ -1,20 +1,26 @@
|
||||
" Language: Rust
|
||||
" Description: Vim ftplugin for Rust
|
||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||
" Maintainer: Lily Ballard <lily@ballards.net>
|
||||
" Last Change: June 08, 2016
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
" Last Change: 2023-09-11
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" vint: -ProhibitAbbreviationOption
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
" vint: +ProhibitAbbreviationOption
|
||||
|
||||
augroup rust.vim
|
||||
autocmd!
|
||||
if get(b:, 'current_compiler', '') ==# ''
|
||||
if strlen(findfile('Cargo.toml', '.;')) > 0
|
||||
compiler cargo
|
||||
else
|
||||
compiler rustc
|
||||
endif
|
||||
endif
|
||||
|
||||
" Variables {{{1
|
||||
|
||||
@@ -22,13 +28,13 @@ autocmd!
|
||||
" comments, so we'll use that as our default, but make it easy to switch.
|
||||
" This does not affect indentation at all (I tested it with and without
|
||||
" leader), merely whether a leader is inserted by default or not.
|
||||
if exists("g:rust_bang_comment_leader") && g:rust_bang_comment_leader != 0
|
||||
" Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why,
|
||||
" but without it, */ gets indented one space even if there were no
|
||||
" leaders. I'm fairly sure that's a Vim bug.
|
||||
setlocal comments=s1:/*,mb:*,ex:*/,s0:/*,mb:\ ,ex:*/,:///,://!,://
|
||||
if get(g:, 'rust_bang_comment_leader', 0)
|
||||
" Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why,
|
||||
" but without it, */ gets indented one space even if there were no
|
||||
" leaders. I'm fairly sure that's a Vim bug.
|
||||
setlocal comments=s1:/*,mb:*,ex:*/,s0:/*,mb:\ ,ex:*/,:///,://!,://
|
||||
else
|
||||
setlocal comments=s0:/*!,m:\ ,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,://
|
||||
setlocal comments=s0:/*!,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,://
|
||||
endif
|
||||
setlocal commentstring=//%s
|
||||
setlocal formatoptions-=t formatoptions+=croqnl
|
||||
@@ -39,13 +45,14 @@ silent! setlocal formatoptions+=j
|
||||
" otherwise it's better than nothing.
|
||||
setlocal smartindent nocindent
|
||||
|
||||
if !exists("g:rust_recommended_style") || g:rust_recommended_style != 0
|
||||
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
|
||||
setlocal textwidth=99
|
||||
if get(g:, 'rust_recommended_style', 1)
|
||||
let b:rust_set_style = 1
|
||||
setlocal shiftwidth=4 softtabstop=4 expandtab
|
||||
setlocal textwidth=99
|
||||
endif
|
||||
|
||||
" This includeexpr isn't perfect, but it's a good start
|
||||
setlocal includeexpr=substitute(v:fname,'::','/','g')
|
||||
setlocal include=\\v^\\s*(pub\\s+)?use\\s+\\zs(\\f\|:)+
|
||||
setlocal includeexpr=rust#IncludeExpr(v:fname)
|
||||
|
||||
setlocal suffixesadd=.rs
|
||||
|
||||
@@ -54,51 +61,36 @@ if exists("g:ftplugin_rust_source_path")
|
||||
endif
|
||||
|
||||
if exists("g:loaded_delimitMate")
|
||||
if exists("b:delimitMate_excluded_regions")
|
||||
let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
|
||||
endif
|
||||
if exists("b:delimitMate_excluded_regions")
|
||||
let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
|
||||
endif
|
||||
|
||||
let s:delimitMate_extra_excluded_regions = ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
|
||||
augroup rust.vim.DelimitMate
|
||||
autocmd!
|
||||
|
||||
" For this buffer, when delimitMate issues the `User delimitMate_map`
|
||||
" event in the autocommand system, add the above-defined extra excluded
|
||||
" regions to delimitMate's state, if they have not already been added.
|
||||
autocmd User <buffer>
|
||||
\ if expand('<afile>') ==# 'delimitMate_map' && match(
|
||||
\ delimitMate#Get("excluded_regions"),
|
||||
\ s:delimitMate_extra_excluded_regions) == -1
|
||||
\| let b:delimitMate_excluded_regions =
|
||||
\ delimitMate#Get("excluded_regions")
|
||||
\ . s:delimitMate_extra_excluded_regions
|
||||
\|endif
|
||||
|
||||
" For this buffer, when delimitMate issues the `User delimitMate_unmap`
|
||||
" event in the autocommand system, delete the above-defined extra excluded
|
||||
" regions from delimitMate's state (the deletion being idempotent and
|
||||
" having no effect if the extra excluded regions are not present in the
|
||||
" targeted part of delimitMate's state).
|
||||
autocmd User <buffer>
|
||||
\ if expand('<afile>') ==# 'delimitMate_unmap'
|
||||
\| let b:delimitMate_excluded_regions = substitute(
|
||||
\ delimitMate#Get("excluded_regions"),
|
||||
\ '\C\V' . s:delimitMate_extra_excluded_regions,
|
||||
\ '', 'g')
|
||||
\|endif
|
||||
autocmd User delimitMate_map :call rust#delimitmate#onMap()
|
||||
autocmd User delimitMate_unmap :call rust#delimitmate#onUnmap()
|
||||
augroup END
|
||||
endif
|
||||
|
||||
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
|
||||
let b:rust_set_foldmethod=1
|
||||
setlocal foldmethod=syntax
|
||||
if g:rust_fold == 2
|
||||
setlocal foldlevel<
|
||||
else
|
||||
setlocal foldlevel=99
|
||||
endif
|
||||
" Integration with auto-pairs (https://github.com/jiangmiao/auto-pairs)
|
||||
if exists("g:AutoPairsLoaded") && !get(g:, 'rust_keep_autopairs_default', 0)
|
||||
let b:AutoPairs = {'(':')', '[':']', '{':'}','"':'"', '`':'`'}
|
||||
endif
|
||||
|
||||
if has('conceal') && exists('g:rust_conceal') && g:rust_conceal != 0
|
||||
let b:rust_set_conceallevel=1
|
||||
setlocal conceallevel=2
|
||||
if has("folding") && get(g:, 'rust_fold', 0)
|
||||
let b:rust_set_foldmethod=1
|
||||
setlocal foldmethod=syntax
|
||||
if g:rust_fold == 2
|
||||
setlocal foldlevel<
|
||||
else
|
||||
setlocal foldlevel=99
|
||||
endif
|
||||
endif
|
||||
|
||||
if has('conceal') && get(g:, 'rust_conceal', 0)
|
||||
let b:rust_set_conceallevel=1
|
||||
setlocal conceallevel=2
|
||||
endif
|
||||
|
||||
" Motion Commands {{{1
|
||||
@@ -126,72 +118,122 @@ command! -nargs=* -buffer RustEmitIr call rust#Emit("llvm-ir", <q-args>)
|
||||
command! -nargs=* -buffer RustEmitAsm call rust#Emit("asm", <q-args>)
|
||||
|
||||
" See |:RustPlay| for docs
|
||||
command! -range=% RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)
|
||||
command! -range=% -buffer RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)
|
||||
|
||||
" See |:RustFmt| for docs
|
||||
command! -buffer RustFmt call rustfmt#Format()
|
||||
command! -bar -buffer RustFmt call rustfmt#Format()
|
||||
|
||||
" See |:RustFmtRange| for docs
|
||||
command! -range -buffer RustFmtRange call rustfmt#FormatRange(<line1>, <line2>)
|
||||
|
||||
" Mappings {{{1
|
||||
" See |:RustInfo| for docs
|
||||
command! -bar -buffer RustInfo call rust#debugging#Info()
|
||||
|
||||
" Bind ⌘R in MacVim to :RustRun
|
||||
nnoremap <silent> <buffer> <D-r> :RustRun<CR>
|
||||
" Bind ⌘⇧R in MacVim to :RustRun! pre-filled with the last args
|
||||
nnoremap <buffer> <D-R> :RustRun! <C-r>=join(b:rust_last_rustc_args)<CR><C-\>erust#AppendCmdLine(' -- ' . join(b:rust_last_args))<CR>
|
||||
" See |:RustInfoToClipboard| for docs
|
||||
command! -bar -buffer RustInfoToClipboard call rust#debugging#InfoToClipboard()
|
||||
|
||||
" See |:RustInfoToFile| for docs
|
||||
command! -bar -nargs=1 -buffer RustInfoToFile call rust#debugging#InfoToFile(<f-args>)
|
||||
|
||||
" See |:RustTest| for docs
|
||||
command! -buffer -nargs=* -count -bang RustTest call rust#Test(<q-mods>, <count>, <bang>0, <q-args>)
|
||||
|
||||
if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args")
|
||||
let b:rust_last_rustc_args = []
|
||||
let b:rust_last_args = []
|
||||
let b:rust_last_rustc_args = []
|
||||
let b:rust_last_args = []
|
||||
endif
|
||||
|
||||
" Cleanup {{{1
|
||||
|
||||
let b:undo_ftplugin = "
|
||||
\ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<
|
||||
\|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
|
||||
\|if exists('b:rust_original_delimitMate_excluded_regions')
|
||||
\|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions
|
||||
\|unlet b:rust_original_delimitMate_excluded_regions
|
||||
\|else
|
||||
\|unlet! b:delimitMate_excluded_regions
|
||||
\|endif
|
||||
\|if exists('b:rust_set_foldmethod')
|
||||
\|setlocal foldmethod< foldlevel<
|
||||
\|unlet b:rust_set_foldmethod
|
||||
\|endif
|
||||
\|if exists('b:rust_set_conceallevel')
|
||||
\|setlocal conceallevel<
|
||||
\|unlet b:rust_set_conceallevel
|
||||
\|endif
|
||||
\|unlet! b:rust_last_rustc_args b:rust_last_args
|
||||
\|delcommand RustRun
|
||||
\|delcommand RustExpand
|
||||
\|delcommand RustEmitIr
|
||||
\|delcommand RustEmitAsm
|
||||
\|delcommand RustPlay
|
||||
\|nunmap <buffer> <D-r>
|
||||
\|nunmap <buffer> <D-R>
|
||||
\|nunmap <buffer> [[
|
||||
\|nunmap <buffer> ]]
|
||||
\|xunmap <buffer> [[
|
||||
\|xunmap <buffer> ]]
|
||||
\|ounmap <buffer> [[
|
||||
\|ounmap <buffer> ]]
|
||||
\|set matchpairs-=<:>
|
||||
\"
|
||||
\ setlocal formatoptions< comments< commentstring< include< includeexpr< suffixesadd<
|
||||
\|if exists('b:rust_set_style')
|
||||
\|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
|
||||
\|endif
|
||||
\|if exists('b:rust_original_delimitMate_excluded_regions')
|
||||
\|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions
|
||||
\|unlet b:rust_original_delimitMate_excluded_regions
|
||||
\|else
|
||||
\|unlet! b:delimitMate_excluded_regions
|
||||
\|endif
|
||||
\|if exists('b:rust_set_foldmethod')
|
||||
\|setlocal foldmethod< foldlevel<
|
||||
\|unlet b:rust_set_foldmethod
|
||||
\|endif
|
||||
\|if exists('b:rust_set_conceallevel')
|
||||
\|setlocal conceallevel<
|
||||
\|unlet b:rust_set_conceallevel
|
||||
\|endif
|
||||
\|unlet! b:rust_last_rustc_args b:rust_last_args
|
||||
\|delcommand -buffer RustRun
|
||||
\|delcommand -buffer RustExpand
|
||||
\|delcommand -buffer RustEmitIr
|
||||
\|delcommand -buffer RustEmitAsm
|
||||
\|delcommand -buffer RustPlay
|
||||
\|delcommand -buffer RustFmt
|
||||
\|delcommand -buffer RustFmtRange
|
||||
\|delcommand -buffer RustInfo
|
||||
\|delcommand -buffer RustInfoToClipboard
|
||||
\|delcommand -buffer RustInfoToFile
|
||||
\|delcommand -buffer RustTest
|
||||
\|nunmap <buffer> [[
|
||||
\|nunmap <buffer> ]]
|
||||
\|xunmap <buffer> [[
|
||||
\|xunmap <buffer> ]]
|
||||
\|ounmap <buffer> [[
|
||||
\|ounmap <buffer> ]]
|
||||
\|setlocal matchpairs-=<:>
|
||||
\|unlet b:match_skip
|
||||
\"
|
||||
|
||||
" }}}1
|
||||
|
||||
" Code formatting on save
|
||||
if get(g:, "rustfmt_autosave", 0)
|
||||
autocmd BufWritePre *.rs silent! call rustfmt#Format()
|
||||
endif
|
||||
|
||||
augroup rust.vim.PreWrite
|
||||
autocmd!
|
||||
autocmd BufWritePre *.rs silent! call rustfmt#PreWrite()
|
||||
augroup END
|
||||
|
||||
setlocal matchpairs+=<:>
|
||||
" For matchit.vim (rustArrow stops `Fn() -> X` messing things up)
|
||||
let b:match_skip = 's:comment\|string\|rustCharacter\|rustArrow'
|
||||
|
||||
command! -buffer -nargs=+ Cargo call cargo#cmd(<q-args>)
|
||||
command! -buffer -nargs=* Cbuild call cargo#build(<q-args>)
|
||||
command! -buffer -nargs=* Ccheck call cargo#check(<q-args>)
|
||||
command! -buffer -nargs=* Cclean call cargo#clean(<q-args>)
|
||||
command! -buffer -nargs=* Cdoc call cargo#doc(<q-args>)
|
||||
command! -buffer -nargs=+ Cnew call cargo#new(<q-args>)
|
||||
command! -buffer -nargs=* Cinit call cargo#init(<q-args>)
|
||||
command! -buffer -nargs=* Crun call cargo#run(<q-args>)
|
||||
command! -buffer -nargs=* Ctest call cargo#test(<q-args>)
|
||||
command! -buffer -nargs=* Cbench call cargo#bench(<q-args>)
|
||||
command! -buffer -nargs=* Cupdate call cargo#update(<q-args>)
|
||||
command! -buffer -nargs=* Csearch call cargo#search(<q-args>)
|
||||
command! -buffer -nargs=* Cpublish call cargo#publish(<q-args>)
|
||||
command! -buffer -nargs=* Cinstall call cargo#install(<q-args>)
|
||||
command! -buffer -nargs=* Cruntarget call cargo#runtarget(<q-args>)
|
||||
|
||||
let b:undo_ftplugin .= '
|
||||
\|delcommand -buffer Cargo
|
||||
\|delcommand -buffer Cbuild
|
||||
\|delcommand -buffer Ccheck
|
||||
\|delcommand -buffer Cclean
|
||||
\|delcommand -buffer Cdoc
|
||||
\|delcommand -buffer Cnew
|
||||
\|delcommand -buffer Cinit
|
||||
\|delcommand -buffer Crun
|
||||
\|delcommand -buffer Ctest
|
||||
\|delcommand -buffer Cbench
|
||||
\|delcommand -buffer Cupdate
|
||||
\|delcommand -buffer Csearch
|
||||
\|delcommand -buffer Cpublish
|
||||
\|delcommand -buffer Cinstall
|
||||
\|delcommand -buffer Cruntarget'
|
||||
|
||||
" vint: -ProhibitAbbreviationOption
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vint: +ProhibitAbbreviationOption
|
||||
|
||||
" vim: set noet sw=8 ts=8:
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Dan Sharp
|
||||
" Contributor: Enno Nagel <ennonagel+vim@gmail.com>
|
||||
" Last Change: 2023 Aug 29
|
||||
" Eisuke Kawashima
|
||||
" Last Change: 2023 Sep 28
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -39,17 +40,16 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
|
||||
endif
|
||||
|
||||
if (exists("b:is_bash") && (b:is_bash == 1)) ||
|
||||
\ (exists("b:is_sh") && (b:is_sh == 1))
|
||||
if get(b:, "is_bash", 0)
|
||||
if !has("gui_running") && executable("less")
|
||||
command! -buffer -nargs=1 Help silent exe '!bash -c "{ help "<args>" 2>/dev/null || man "<args>"; } | LESS= less"' | redraw!
|
||||
elseif has('terminal')
|
||||
command! -buffer -nargs=1 Help silent exe ':term bash -c "help "<args>" 2>/dev/null || man "<args>""'
|
||||
command! -buffer -nargs=1 ShKeywordPrg silent exe '!bash -c "{ help "<args>" 2>/dev/null || man "<args>"; } | LESS= less"' | redraw!
|
||||
elseif has("terminal")
|
||||
command! -buffer -nargs=1 ShKeywordPrg silent exe ':term bash -c "help "<args>" 2>/dev/null || man "<args>""'
|
||||
else
|
||||
command! -buffer -nargs=1 Help echo system('bash -c "help <args>" 2>/dev/null || man "<args>"')
|
||||
command! -buffer -nargs=1 ShKeywordPrg echo system('bash -c "help <args>" 2>/dev/null || man "<args>"')
|
||||
endif
|
||||
setlocal keywordprg=:Help
|
||||
let b:undo_ftplugin ..= " | setl kp< | sil! delc -buffer Help"
|
||||
setlocal keywordprg=:ShKeywordPrg
|
||||
let b:undo_ftplugin ..= " | setl kp< | sil! delc -buffer ShKeywordPrg"
|
||||
endif
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: OpenSSH client configuration file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
" Latest Revision: 2023-10-07
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -16,17 +16,17 @@ let b:undo_ftplugin = 'setlocal com< cms< fo<'
|
||||
|
||||
if has('unix') && executable('less')
|
||||
if !has('gui_running')
|
||||
command -buffer -nargs=1 Sman
|
||||
command -buffer -nargs=1 SshconfigKeywordPrg
|
||||
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '$'' --hilite-search" man ' . 'ssh_config' |
|
||||
\ redraw!
|
||||
elseif has('terminal')
|
||||
command -buffer -nargs=1 Sman
|
||||
command -buffer -nargs=1 SshconfigKeywordPrg
|
||||
\ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config'
|
||||
endif
|
||||
if exists(':Sman') == 2
|
||||
if exists(':SshconfigKeywordPrg') == 2
|
||||
setlocal iskeyword+=-
|
||||
setlocal keywordprg=:Sman
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman'
|
||||
setlocal keywordprg=:SshconfigKeywordPrg
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SshconfigKeywordPrg'
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: sudoers(5) configuration files
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
" Latest Revision: 2023-10-07
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -17,17 +17,17 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
|
||||
if has('unix') && executable('less')
|
||||
if !has('gui_running')
|
||||
command -buffer -nargs=1 Sman
|
||||
command -buffer -nargs=1 SudoersKeywordPrg
|
||||
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''\b' . <q-args> . '\b'' --hilite-search" man ' . 'sudoers' |
|
||||
\ redraw!
|
||||
elseif has('terminal')
|
||||
command -buffer -nargs=1 Sman
|
||||
command -buffer -nargs=1 SudoersKeywordPrg
|
||||
\ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('\b' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'sudoers'
|
||||
endif
|
||||
if exists(':Sman') == 2
|
||||
if exists(':SudoersKeywordPrg') == 2
|
||||
setlocal iskeyword+=-
|
||||
setlocal keywordprg=:Sman
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman'
|
||||
setlocal keywordprg=:SudoersKeywordPrg
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SudoersKeywordPrg'
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: systemd.unit(5)
|
||||
" Keyword Lookup Support: Enno Nagel <enno.nagel+vim@gmail.com>
|
||||
" Latest Revision: 2023-10-07
|
||||
|
||||
if !exists('b:did_ftplugin')
|
||||
" Looks a lot like dosini files.
|
||||
@@ -9,11 +10,11 @@ endif
|
||||
|
||||
if has('unix') && executable('less')
|
||||
if !has('gui_running')
|
||||
command -buffer -nargs=1 Sman silent exe '!' . KeywordLookup_systemd(<q-args>) | redraw!
|
||||
command -buffer -nargs=1 SystemdKeywordPrg silent exe '!' . KeywordLookup_systemd(<q-args>) | redraw!
|
||||
elseif has('terminal')
|
||||
command -buffer -nargs=1 Sman silent exe 'term ' . KeywordLookup_systemd(<q-args>)
|
||||
command -buffer -nargs=1 SystemdKeywordPrg silent exe 'term ' . KeywordLookup_systemd(<q-args>)
|
||||
endif
|
||||
if exists(':Sman') == 2
|
||||
if exists(':SystemdKeywordPrg') == 2
|
||||
if !exists('*KeywordLookup_systemd')
|
||||
function KeywordLookup_systemd(keyword) abort
|
||||
let matches = matchlist(getline(search('\v^\s*\[\s*.+\s*\]\s*$', 'nbWz')), '\v^\s*\[\s*(\k+).*\]\s*$')
|
||||
@@ -26,11 +27,11 @@ if has('unix') && executable('less')
|
||||
endfunction
|
||||
endif
|
||||
setlocal iskeyword+=-
|
||||
setlocal keywordprg=:Sman
|
||||
setlocal keywordprg=:SystemdKeywordPrg
|
||||
if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin)
|
||||
let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<'
|
||||
else
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman'
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SystemdKeywordPrg'
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
" Language: tcsh
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Dan Sharp
|
||||
" Last Change: 2021 Oct 15
|
||||
" Last Change: 2023 Oct 09
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo-=C
|
||||
@@ -12,24 +14,26 @@ set cpo-=C
|
||||
" Define some defaults in case the included ftplugins don't set them.
|
||||
let s:undo_ftplugin = ""
|
||||
let s:browsefilter = "csh Files (*.csh)\t*.csh\n" ..
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
|
||||
runtime! ftplugin/csh.vim ftplugin/csh_*.vim ftplugin/csh/*.vim
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Override our defaults if these were set by an included ftplugin.
|
||||
if exists("b:undo_ftplugin")
|
||||
let s:undo_ftplugin = b:undo_ftplugin
|
||||
let s:undo_ftplugin = b:undo_ftplugin
|
||||
endif
|
||||
if exists("b:browsefilter")
|
||||
let s:browsefilter = b:browsefilter
|
||||
let s:browsefilter = b:browsefilter
|
||||
endif
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk"))
|
||||
let b:browsefilter="tcsh Scripts (*.tcsh)\t*.tcsh\n" .. s:browsefilter
|
||||
if (has("gui_win32") || has("gui_gtk")) &&
|
||||
\ (!exists("b:browsefilter") || exists("b:csh_set_browsefilter"))
|
||||
let b:browsefilter = "tcsh Scripts (*.tcsh)\t*.tcsh\n" .. s:browsefilter
|
||||
let s:undo_ftplugin = "unlet! b:browsefilter | " .. s:undo_ftplugin
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "unlet! b:browsefilter | " .. s:undo_ftplugin
|
||||
let b:undo_ftplugin = s:undo_ftplugin
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: udev(8) rules file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
" Latest Revision: 2023-10-07
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -17,17 +17,17 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
|
||||
if has('unix') && executable('less')
|
||||
if !has('gui_running')
|
||||
command -buffer -nargs=1 Sman
|
||||
command -buffer -nargs=1 UdevrulesKeywordPrg
|
||||
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . <q-args> . '\b'' --hilite-search" man ' . 'udev' |
|
||||
\ redraw!
|
||||
elseif has('terminal')
|
||||
command -buffer -nargs=1 Sman
|
||||
command -buffer -nargs=1 UdevrulesKeywordPrg
|
||||
\ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'udev'
|
||||
endif
|
||||
if exists(':Sman') == 2
|
||||
if exists(':UdevrulesKeywordPrg') == 2
|
||||
setlocal iskeyword+=-
|
||||
setlocal keywordprg=:Sman
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman'
|
||||
setlocal keywordprg=:UdevrulesKeywordPrg
|
||||
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer UdevrulesKeywordPrg'
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: Zsh shell script
|
||||
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2021-04-03
|
||||
" Latest Revision: 2023-10-07
|
||||
" License: Vim (see :h license)
|
||||
" Repository: https://github.com/chrisbra/vim-zsh
|
||||
|
||||
@@ -20,17 +20,17 @@ let b:undo_ftplugin = "setl com< cms< fo< "
|
||||
|
||||
if executable('zsh') && &shell !~# '/\%(nologin\|false\)$'
|
||||
if !has('gui_running') && executable('less')
|
||||
command! -buffer -nargs=1 RunHelp silent exe '!MANPAGER= zsh -c "autoload -Uz run-help; run-help <args> 2>/dev/null | LESS= less"' | redraw!
|
||||
command! -buffer -nargs=1 ZshKeywordPrg silent exe '!MANPAGER= zsh -c "autoload -Uz run-help; run-help <args> 2>/dev/null | LESS= less"' | redraw!
|
||||
elseif has('terminal')
|
||||
command! -buffer -nargs=1 RunHelp silent exe ':term zsh -c "autoload -Uz run-help; run-help <args>"'
|
||||
command! -buffer -nargs=1 ZshKeywordPrg silent exe ':term zsh -c "autoload -Uz run-help; run-help <args>"'
|
||||
else
|
||||
command! -buffer -nargs=1 RunHelp echo system('zsh -c "autoload -Uz run-help; run-help <args> 2>/dev/null"')
|
||||
command! -buffer -nargs=1 ZshKeywordPrg echo system('zsh -c "autoload -Uz run-help; run-help <args> 2>/dev/null"')
|
||||
endif
|
||||
if !exists('current_compiler')
|
||||
compiler zsh
|
||||
endif
|
||||
setlocal keywordprg=:RunHelp
|
||||
let b:undo_ftplugin .= 'keywordprg< | sil! delc -buffer RunHelp'
|
||||
setlocal keywordprg=:ZshKeywordPrg
|
||||
let b:undo_ftplugin .= 'keywordprg< | sil! delc -buffer ZshKeywordPrg'
|
||||
endif
|
||||
|
||||
let b:match_words = '\<if\>:\<elif\>:\<else\>:\<fi\>'
|
||||
|
||||
@@ -21,7 +21,7 @@ endif
|
||||
|
||||
" find out if an "...=..." expression is an assignment (or a conditional)
|
||||
" it scans 'line' first, and then the previous lines
|
||||
fun! CdlAsignment(lnum, line)
|
||||
fun! CdlAssignment(lnum, line)
|
||||
let f = -1
|
||||
let lnum = a:lnum
|
||||
let line = a:line
|
||||
@@ -90,7 +90,7 @@ fun! CdlGetIndent(lnum)
|
||||
end
|
||||
end
|
||||
|
||||
" remove members [a] of [b]:[c]... (inicio remainds valid)
|
||||
" remove members [a] of [b]:[c]... (inicio remains valid)
|
||||
let line = substitute(line, '\c\(\[[^]]*]\(\s*of\s*\|:\)*\)\+', ' ', 'g')
|
||||
while 1
|
||||
" search for the next interesting element
|
||||
@@ -111,7 +111,7 @@ fun! CdlGetIndent(lnum)
|
||||
else " c == '='
|
||||
" if it is an assignment increase indent
|
||||
if f == -1 " we don't know yet, find out
|
||||
let f = CdlAsignment(lnum, strpart(line, 0, inicio))
|
||||
let f = CdlAssignment(lnum, strpart(line, 0, inicio))
|
||||
end
|
||||
if f == 1 " formula increase it
|
||||
let ind = ind + shiftwidth()
|
||||
@@ -125,7 +125,7 @@ fun! CdlGetIndent(lnum)
|
||||
let ind = ind - shiftwidth()
|
||||
elseif match(thisline, '^\s*=') >= 0
|
||||
if f == -1 " we don't know yet if is an assignment, find out
|
||||
let f = CdlAsignment(lnum, "")
|
||||
let f = CdlAssignment(lnum, "")
|
||||
end
|
||||
if f == 1 " formula increase it
|
||||
let ind = ind + shiftwidth()
|
||||
|
||||
@@ -1324,7 +1324,7 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" maybe A else
|
||||
" LTI
|
||||
"
|
||||
" Note about Emacs compabitility {{{
|
||||
" Note about Emacs compatibility {{{
|
||||
"
|
||||
" It would be fine to indent the examples above the following way:
|
||||
"
|
||||
|
||||
@@ -310,7 +310,7 @@ function IsFunctionArgPar(lnum, c)
|
||||
endfunction
|
||||
|
||||
function JumpToMatch(lnum, last_closed_bracket)
|
||||
" we use the % command to skip back (tries to ues matchit if possible,
|
||||
" we use the % command to skip back (tries to use matchit if possible,
|
||||
" otherwise resorts to vim's default, which is buggy but better than
|
||||
" nothing)
|
||||
call cursor(a:lnum, a:last_closed_bracket)
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
" Vim indent file
|
||||
" Language: Kotlin
|
||||
" Maintainer: Alexander Udalov
|
||||
" URL: https://github.com/udalov/kotlin-vim
|
||||
" Last Change: 7 November 2021
|
||||
" 2023 Sep 17 by Vim Project (undo_indent)
|
||||
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal cinoptions& cinoptions+=j1,L0
|
||||
setlocal indentexpr=GetKotlinIndent()
|
||||
setlocal indentkeys=0},0),!^F,o,O,e,<CR>
|
||||
setlocal autoindent " TODO ?
|
||||
|
||||
let b:undo_indent = "setlocal autoindent< cinoptions< indentexpr< indentkeys<"
|
||||
|
||||
" TODO teach it to count bracket balance, etc.
|
||||
function! GetKotlinIndent()
|
||||
if v:lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let prev_num = prevnonblank(v:lnum - 1)
|
||||
let prev = getline(prev_num)
|
||||
let prev_indent = indent(prev_num)
|
||||
let cur = getline(v:lnum)
|
||||
|
||||
if cur =~ '^\s*\*'
|
||||
return cindent(v:lnum)
|
||||
endif
|
||||
|
||||
if prev =~ '^\s*\*/'
|
||||
let st = prev
|
||||
while st > 1
|
||||
if getline(st) =~ '^\s*/\*'
|
||||
break
|
||||
endif
|
||||
let st = st - 1
|
||||
endwhile
|
||||
return indent(st)
|
||||
endif
|
||||
|
||||
let prev_open_paren = prev =~ '^.*(\s*$'
|
||||
let cur_close_paren = cur =~ '^\s*).*$'
|
||||
let prev_open_brace = prev =~ '^.*\({\|->\)\s*$'
|
||||
let cur_close_brace = cur =~ '^\s*}.*$'
|
||||
|
||||
if prev_open_paren && !cur_close_paren || prev_open_brace && !cur_close_brace
|
||||
return prev_indent + shiftwidth()
|
||||
endif
|
||||
|
||||
if cur_close_paren && !prev_open_paren || cur_close_brace && !prev_open_brace
|
||||
return prev_indent - shiftwidth()
|
||||
endif
|
||||
|
||||
return prev_indent
|
||||
endfunction
|
||||
@@ -41,7 +41,7 @@ function GetKrlIndent() abort
|
||||
let currentLine = getline(v:lnum)
|
||||
if currentLine =~? '\v^;(\s*(end)?fold>)@!' && !get(g:, 'krlCommentIndent', 0)
|
||||
" If current line has a ; in column 1 and is no fold, keep zero indent.
|
||||
" This may be usefull if code is commented out at the first column.
|
||||
" This may be useful if code is commented out at the first column.
|
||||
return 0
|
||||
endif
|
||||
|
||||
@@ -117,7 +117,7 @@ function s:KrlPreNoneBlank(lnum) abort
|
||||
let nPreNoneBlank = prevnonblank(a:lnum)
|
||||
|
||||
while nPreNoneBlank > 0 && getline(nPreNoneBlank) =~? '\v^\s*(\&\w\+|;|continue>)'
|
||||
" Previouse none blank line irrelevant. Look further aback.
|
||||
" Previous none blank line irrelevant. Look further aback.
|
||||
let nPreNoneBlank = prevnonblank(nPreNoneBlank - 1)
|
||||
endwhile
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ function s:GetRapidIndentIntern() abort
|
||||
|
||||
if l:currentLine =~ '^!' && !get(g:,'rapidCommentIndent',0)
|
||||
" If current line is ! line comment, do not change indent
|
||||
" This may be usefull if code is commented out at the first column.
|
||||
" This may be useful if code is commented out at the first column.
|
||||
return 0
|
||||
endif
|
||||
|
||||
|
||||
+230
-176
@@ -1,27 +1,26 @@
|
||||
" Vim indent file
|
||||
" Language: Rust
|
||||
" Author: Chris Morgan <me@chrismorgan.info>
|
||||
" Last Change: 2017 Jun 13
|
||||
" 2023 Aug 28 by Vim Project (undo_indent)
|
||||
" Last Change: 2023-09-11
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal cindent
|
||||
setlocal cinoptions=L0,(0,Ws,J1,j1
|
||||
setlocal cinkeys=0{,0},!^F,o,O,0[,0]
|
||||
setlocal cinoptions=L0,(s,Ws,J1,j1,m1
|
||||
setlocal cinkeys=0{,0},!^F,o,O,0[,0],0(,0)
|
||||
" Don't think cinwords will actually do anything at all... never mind
|
||||
setlocal cinwords=for,if,else,while,loop,impl,mod,unsafe,trait,struct,enum,fn,extern
|
||||
setlocal cinwords=for,if,else,while,loop,impl,mod,unsafe,trait,struct,enum,fn,extern,macro
|
||||
|
||||
" Some preliminary settings
|
||||
setlocal nolisp " Make sure lisp indenting doesn't supersede us
|
||||
setlocal autoindent " indentexpr isn't much help otherwise
|
||||
" Also do indentkeys, otherwise # gets shoved to column 0 :-/
|
||||
setlocal indentkeys=0{,0},!^F,o,O,0[,0]
|
||||
setlocal indentkeys=0{,0},!^F,o,O,0[,0],0(,0)
|
||||
|
||||
setlocal indentexpr=GetRustIndent(v:lnum)
|
||||
|
||||
@@ -29,204 +28,259 @@ let b:undo_indent = "setlocal cindent< cinoptions< cinkeys< cinwords< lisp< auto
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetRustIndent")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
|
||||
" vint: -ProhibitAbbreviationOption
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
" vint: +ProhibitAbbreviationOption
|
||||
|
||||
" Come here when loading the script the first time.
|
||||
|
||||
function! s:get_line_trimmed(lnum)
|
||||
" Get the line and remove a trailing comment.
|
||||
" Use syntax highlighting attributes when possible.
|
||||
" NOTE: this is not accurate; /* */ or a line continuation could trick it
|
||||
let line = getline(a:lnum)
|
||||
let line_len = strlen(line)
|
||||
if has('syntax_items')
|
||||
" If the last character in the line is a comment, do a binary search for
|
||||
" the start of the comment. synID() is slow, a linear search would take
|
||||
" too long on a long line.
|
||||
if synIDattr(synID(a:lnum, line_len, 1), "name") =~ 'Comment\|Todo'
|
||||
let min = 1
|
||||
let max = line_len
|
||||
while min < max
|
||||
let col = (min + max) / 2
|
||||
if synIDattr(synID(a:lnum, col, 1), "name") =~ 'Comment\|Todo'
|
||||
let max = col
|
||||
else
|
||||
let min = col + 1
|
||||
endif
|
||||
endwhile
|
||||
let line = strpart(line, 0, min - 1)
|
||||
endif
|
||||
return substitute(line, "\s*$", "", "")
|
||||
else
|
||||
" Sorry, this is not complete, nor fully correct (e.g. string "//").
|
||||
" Such is life.
|
||||
return substitute(line, "\s*//.*$", "", "")
|
||||
endif
|
||||
" Get the line and remove a trailing comment.
|
||||
" Use syntax highlighting attributes when possible.
|
||||
" NOTE: this is not accurate; /* */ or a line continuation could trick it
|
||||
let line = getline(a:lnum)
|
||||
let line_len = strlen(line)
|
||||
if has('syntax_items')
|
||||
" If the last character in the line is a comment, do a binary search for
|
||||
" the start of the comment. synID() is slow, a linear search would take
|
||||
" too long on a long line.
|
||||
if synIDattr(synID(a:lnum, line_len, 1), "name") =~? 'Comment\|Todo'
|
||||
let min = 1
|
||||
let max = line_len
|
||||
while min < max
|
||||
let col = (min + max) / 2
|
||||
if synIDattr(synID(a:lnum, col, 1), "name") =~? 'Comment\|Todo'
|
||||
let max = col
|
||||
else
|
||||
let min = col + 1
|
||||
endif
|
||||
endwhile
|
||||
let line = strpart(line, 0, min - 1)
|
||||
endif
|
||||
return substitute(line, "\s*$", "", "")
|
||||
else
|
||||
" Sorry, this is not complete, nor fully correct (e.g. string "//").
|
||||
" Such is life.
|
||||
return substitute(line, "\s*//.*$", "", "")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:is_string_comment(lnum, col)
|
||||
if has('syntax_items')
|
||||
for id in synstack(a:lnum, a:col)
|
||||
let synname = synIDattr(id, "name")
|
||||
if synname == "rustString" || synname =~ "^rustComment"
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
" without syntax, let's not even try
|
||||
return 0
|
||||
endif
|
||||
if has('syntax_items')
|
||||
for id in synstack(a:lnum, a:col)
|
||||
let synname = synIDattr(id, "name")
|
||||
if synname ==# "rustString" || synname =~# "^rustComment"
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
" without syntax, let's not even try
|
||||
return 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
if exists('*shiftwidth')
|
||||
function! s:shiftwidth()
|
||||
return shiftwidth()
|
||||
endfunc
|
||||
else
|
||||
function! s:shiftwidth()
|
||||
return &shiftwidth
|
||||
endfunc
|
||||
endif
|
||||
|
||||
function GetRustIndent(lnum)
|
||||
" Starting assumption: cindent (called at the end) will do it right
|
||||
" normally. We just want to fix up a few cases.
|
||||
|
||||
" Starting assumption: cindent (called at the end) will do it right
|
||||
" normally. We just want to fix up a few cases.
|
||||
let line = getline(a:lnum)
|
||||
|
||||
let line = getline(a:lnum)
|
||||
if has('syntax_items')
|
||||
let synname = synIDattr(synID(a:lnum, 1, 1), "name")
|
||||
if synname ==# "rustString"
|
||||
" If the start of the line is in a string, don't change the indent
|
||||
return -1
|
||||
elseif synname =~? '\(Comment\|Todo\)'
|
||||
\ && line !~# '^\s*/\*' " not /* opening line
|
||||
if synname =~? "CommentML" " multi-line
|
||||
if line !~# '^\s*\*' && getline(a:lnum - 1) =~# '^\s*/\*'
|
||||
" This is (hopefully) the line after a /*, and it has no
|
||||
" leader, so the correct indentation is that of the
|
||||
" previous line.
|
||||
return GetRustIndent(a:lnum - 1)
|
||||
endif
|
||||
endif
|
||||
" If it's in a comment, let cindent take care of it now. This is
|
||||
" for cases like "/*" where the next line should start " * ", not
|
||||
" "* " as the code below would otherwise cause for module scope
|
||||
" Fun fact: " /*\n*\n*/" takes two calls to get right!
|
||||
return cindent(a:lnum)
|
||||
endif
|
||||
endif
|
||||
|
||||
if has('syntax_items')
|
||||
let synname = synIDattr(synID(a:lnum, 1, 1), "name")
|
||||
if synname == "rustString"
|
||||
" If the start of the line is in a string, don't change the indent
|
||||
return -1
|
||||
elseif synname =~ '\(Comment\|Todo\)'
|
||||
\ && line !~ '^\s*/\*' " not /* opening line
|
||||
if synname =~ "CommentML" " multi-line
|
||||
if line !~ '^\s*\*' && getline(a:lnum - 1) =~ '^\s*/\*'
|
||||
" This is (hopefully) the line after a /*, and it has no
|
||||
" leader, so the correct indentation is that of the
|
||||
" previous line.
|
||||
return GetRustIndent(a:lnum - 1)
|
||||
endif
|
||||
endif
|
||||
" If it's in a comment, let cindent take care of it now. This is
|
||||
" for cases like "/*" where the next line should start " * ", not
|
||||
" "* " as the code below would otherwise cause for module scope
|
||||
" Fun fact: " /*\n*\n*/" takes two calls to get right!
|
||||
return cindent(a:lnum)
|
||||
endif
|
||||
endif
|
||||
" cindent gets second and subsequent match patterns/struct members wrong,
|
||||
" as it treats the comma as indicating an unfinished statement::
|
||||
"
|
||||
" match a {
|
||||
" b => c,
|
||||
" d => e,
|
||||
" f => g,
|
||||
" };
|
||||
|
||||
" cindent gets second and subsequent match patterns/struct members wrong,
|
||||
" as it treats the comma as indicating an unfinished statement::
|
||||
"
|
||||
" match a {
|
||||
" b => c,
|
||||
" d => e,
|
||||
" f => g,
|
||||
" };
|
||||
" Search backwards for the previous non-empty line.
|
||||
let prevlinenum = prevnonblank(a:lnum - 1)
|
||||
let prevline = s:get_line_trimmed(prevlinenum)
|
||||
while prevlinenum > 1 && prevline !~# '[^[:blank:]]'
|
||||
let prevlinenum = prevnonblank(prevlinenum - 1)
|
||||
let prevline = s:get_line_trimmed(prevlinenum)
|
||||
endwhile
|
||||
|
||||
" Search backwards for the previous non-empty line.
|
||||
let prevlinenum = prevnonblank(a:lnum - 1)
|
||||
let prevline = s:get_line_trimmed(prevlinenum)
|
||||
while prevlinenum > 1 && prevline !~ '[^[:blank:]]'
|
||||
let prevlinenum = prevnonblank(prevlinenum - 1)
|
||||
let prevline = s:get_line_trimmed(prevlinenum)
|
||||
endwhile
|
||||
" A standalone '{', '}', or 'where'
|
||||
let l:standalone_open = line =~# '\V\^\s\*{\s\*\$'
|
||||
let l:standalone_close = line =~# '\V\^\s\*}\s\*\$'
|
||||
let l:standalone_where = line =~# '\V\^\s\*where\s\*\$'
|
||||
if l:standalone_open || l:standalone_close || l:standalone_where
|
||||
" ToDo: we can search for more items than 'fn' and 'if'.
|
||||
let [l:found_line, l:col, l:submatch] =
|
||||
\ searchpos('\<\(fn\)\|\(if\)\>', 'bnWp')
|
||||
if l:found_line !=# 0
|
||||
" Now we count the number of '{' and '}' in between the match
|
||||
" locations and the current line (there is probably a better
|
||||
" way to compute this).
|
||||
let l:i = l:found_line
|
||||
let l:search_line = strpart(getline(l:i), l:col - 1)
|
||||
let l:opens = 0
|
||||
let l:closes = 0
|
||||
while l:i < a:lnum
|
||||
let l:search_line2 = substitute(l:search_line, '\V{', '', 'g')
|
||||
let l:opens += strlen(l:search_line) - strlen(l:search_line2)
|
||||
let l:search_line3 = substitute(l:search_line2, '\V}', '', 'g')
|
||||
let l:closes += strlen(l:search_line2) - strlen(l:search_line3)
|
||||
let l:i += 1
|
||||
let l:search_line = getline(l:i)
|
||||
endwhile
|
||||
if l:standalone_open || l:standalone_where
|
||||
if l:opens ==# l:closes
|
||||
return indent(l:found_line)
|
||||
endif
|
||||
else
|
||||
" Expect to find just one more close than an open
|
||||
if l:opens ==# l:closes + 1
|
||||
return indent(l:found_line)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
" Handle where clauses nicely: subsequent values should line up nicely.
|
||||
if prevline[len(prevline) - 1] == ","
|
||||
\ && prevline =~# '^\s*where\s'
|
||||
return indent(prevlinenum) + 6
|
||||
endif
|
||||
" A standalone 'where' adds a shift.
|
||||
let l:standalone_prevline_where = prevline =~# '\V\^\s\*where\s\*\$'
|
||||
if l:standalone_prevline_where
|
||||
return indent(prevlinenum) + 4
|
||||
endif
|
||||
|
||||
"match newline after struct with generic bound like
|
||||
"struct SomeThing<T>
|
||||
"| <-- newline indent should same as prevline
|
||||
if prevline[len(prevline) - 1] == ">"
|
||||
\ && prevline =~# "\s*struct.*>$"
|
||||
return indent(prevlinenum)
|
||||
endif
|
||||
" Handle where clauses nicely: subsequent values should line up nicely.
|
||||
if prevline[len(prevline) - 1] ==# ","
|
||||
\ && prevline =~# '^\s*where\s'
|
||||
return indent(prevlinenum) + 6
|
||||
endif
|
||||
|
||||
"match newline after where like:
|
||||
"struct SomeThing<T>
|
||||
"where
|
||||
" T: Display,
|
||||
if prevline =~# '^\s*where$'
|
||||
return indent(prevlinenum) + 4
|
||||
endif
|
||||
let l:last_prevline_character = prevline[len(prevline) - 1]
|
||||
|
||||
if prevline[len(prevline) - 1] == ","
|
||||
\ && s:get_line_trimmed(a:lnum) !~ '^\s*[\[\]{}]'
|
||||
\ && prevline !~ '^\s*fn\s'
|
||||
\ && prevline !~ '([^()]\+,$'
|
||||
\ && s:get_line_trimmed(a:lnum) !~ '^\s*\S\+\s*=>'
|
||||
" Oh ho! The previous line ended in a comma! I bet cindent will try to
|
||||
" take this too far... For now, let's normally use the previous line's
|
||||
" indent.
|
||||
" A line that ends with '.<expr>;' is probably an end of a long list
|
||||
" of method operations.
|
||||
if prevline =~# '\V\^\s\*.' && l:last_prevline_character ==# ';'
|
||||
call cursor(a:lnum - 1, 1)
|
||||
let l:scope_start = searchpair('{\|(', '', '}\|)', 'nbW',
|
||||
\ 's:is_string_comment(line("."), col("."))')
|
||||
if l:scope_start != 0 && l:scope_start < a:lnum
|
||||
return indent(l:scope_start) + 4
|
||||
endif
|
||||
endif
|
||||
|
||||
" One case where this doesn't work out is where *this* line contains
|
||||
" square or curly brackets; then we normally *do* want to be indenting
|
||||
" further.
|
||||
"
|
||||
" Another case where we don't want to is one like a function
|
||||
" definition with arguments spread over multiple lines:
|
||||
"
|
||||
" fn foo(baz: Baz,
|
||||
" baz: Baz) // <-- cindent gets this right by itself
|
||||
"
|
||||
" Another case is similar to the previous, except calling a function
|
||||
" instead of defining it, or any conditional expression that leaves
|
||||
" an open paren:
|
||||
"
|
||||
" foo(baz,
|
||||
" baz);
|
||||
"
|
||||
" if baz && (foo ||
|
||||
" bar) {
|
||||
"
|
||||
" Another case is when the current line is a new match arm.
|
||||
"
|
||||
" There are probably other cases where we don't want to do this as
|
||||
" well. Add them as needed.
|
||||
return indent(prevlinenum)
|
||||
endif
|
||||
if l:last_prevline_character ==# ","
|
||||
\ && s:get_line_trimmed(a:lnum) !~# '^\s*[\[\]{})]'
|
||||
\ && prevline !~# '^\s*fn\s'
|
||||
\ && prevline !~# '([^()]\+,$'
|
||||
\ && s:get_line_trimmed(a:lnum) !~# '^\s*\S\+\s*=>'
|
||||
" Oh ho! The previous line ended in a comma! I bet cindent will try to
|
||||
" take this too far... For now, let's normally use the previous line's
|
||||
" indent.
|
||||
|
||||
if !has("patch-7.4.355")
|
||||
" cindent before 7.4.355 doesn't do the module scope well at all; e.g.::
|
||||
"
|
||||
" static FOO : &'static [bool] = [
|
||||
" true,
|
||||
" false,
|
||||
" false,
|
||||
" true,
|
||||
" ];
|
||||
"
|
||||
" uh oh, next statement is indented further!
|
||||
" One case where this doesn't work out is where *this* line contains
|
||||
" square or curly brackets; then we normally *do* want to be indenting
|
||||
" further.
|
||||
"
|
||||
" Another case where we don't want to is one like a function
|
||||
" definition with arguments spread over multiple lines:
|
||||
"
|
||||
" fn foo(baz: Baz,
|
||||
" baz: Baz) // <-- cindent gets this right by itself
|
||||
"
|
||||
" Another case is similar to the previous, except calling a function
|
||||
" instead of defining it, or any conditional expression that leaves
|
||||
" an open paren:
|
||||
"
|
||||
" foo(baz,
|
||||
" baz);
|
||||
"
|
||||
" if baz && (foo ||
|
||||
" bar) {
|
||||
"
|
||||
" Another case is when the current line is a new match arm.
|
||||
"
|
||||
" There are probably other cases where we don't want to do this as
|
||||
" well. Add them as needed.
|
||||
return indent(prevlinenum)
|
||||
endif
|
||||
|
||||
" Note that this does *not* apply the line continuation pattern properly;
|
||||
" that's too hard to do correctly for my liking at present, so I'll just
|
||||
" start with these two main cases (square brackets and not returning to
|
||||
" column zero)
|
||||
if !has("patch-7.4.355")
|
||||
" cindent before 7.4.355 doesn't do the module scope well at all; e.g.::
|
||||
"
|
||||
" static FOO : &'static [bool] = [
|
||||
" true,
|
||||
" false,
|
||||
" false,
|
||||
" true,
|
||||
" ];
|
||||
"
|
||||
" uh oh, next statement is indented further!
|
||||
|
||||
call cursor(a:lnum, 1)
|
||||
if searchpair('{\|(', '', '}\|)', 'nbW',
|
||||
\ 's:is_string_comment(line("."), col("."))') == 0
|
||||
if searchpair('\[', '', '\]', 'nbW',
|
||||
\ 's:is_string_comment(line("."), col("."))') == 0
|
||||
" Global scope, should be zero
|
||||
return 0
|
||||
else
|
||||
" At the module scope, inside square brackets only
|
||||
"if getline(a:lnum)[0] == ']' || search('\[', '', '\]', 'nW') == a:lnum
|
||||
if line =~ "^\\s*]"
|
||||
" It's the closing line, dedent it
|
||||
return 0
|
||||
else
|
||||
return shiftwidth()
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
" Note that this does *not* apply the line continuation pattern properly;
|
||||
" that's too hard to do correctly for my liking at present, so I'll just
|
||||
" start with these two main cases (square brackets and not returning to
|
||||
" column zero)
|
||||
|
||||
" Fall back on cindent, which does it mostly right
|
||||
return cindent(a:lnum)
|
||||
call cursor(a:lnum, 1)
|
||||
if searchpair('{\|(', '', '}\|)', 'nbW',
|
||||
\ 's:is_string_comment(line("."), col("."))') == 0
|
||||
if searchpair('\[', '', '\]', 'nbW',
|
||||
\ 's:is_string_comment(line("."), col("."))') == 0
|
||||
" Global scope, should be zero
|
||||
return 0
|
||||
else
|
||||
" At the module scope, inside square brackets only
|
||||
"if getline(a:lnum)[0] == ']' || search('\[', '', '\]', 'nW') == a:lnum
|
||||
if line =~# "^\\s*]"
|
||||
" It's the closing line, dedent it
|
||||
return 0
|
||||
else
|
||||
return &shiftwidth
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
" Fall back on cindent, which does it mostly right
|
||||
return cindent(a:lnum)
|
||||
endfunction
|
||||
|
||||
" vint: -ProhibitAbbreviationOption
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vint: +ProhibitAbbreviationOption
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
@@ -78,10 +78,10 @@ function SystemVerilogIndent()
|
||||
" Multiple-line comment count
|
||||
if curr_line =~ '^\s*/\*' && curr_line !~ '/\*.\{-}\*/'
|
||||
let s:multiple_comment += 1
|
||||
if vverb | echom vverb_str "Start of multiple-line commnt" | endif
|
||||
if vverb | echom vverb_str "Start of multiple-line comment" | endif
|
||||
elseif curr_line =~ '\*/\s*$' && curr_line !~ '/\*.\{-}\*/'
|
||||
let s:multiple_comment -= 1
|
||||
if vverb | echom vverb_str "End of multiple-line commnt" | endif
|
||||
if vverb | echom vverb_str "End of multiple-line comment" | endif
|
||||
return ind
|
||||
endif
|
||||
" Maintain indentation during commenting.
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
" without having to combine them with letters (usufull for grammarians
|
||||
" in particular) (especially for dasia and psiln we use ' for psili
|
||||
" (that is apostrophe) and ;' for dasia. This is done in order to
|
||||
" preserve the posibility to write a plain < or >.
|
||||
" preserve the possibility to write a plain < or >.
|
||||
|
||||
" Ypogegrammeni is | following the character (the originally proposed
|
||||
" i after the character is problematic: can't write easily ai or vi) :
|
||||
|
||||
@@ -190,7 +190,7 @@ map I G$?.
^GYKeDP0S2Gl
|
||||
" into the Macro register
|
||||
" GVJ - on bottom line, create a command to restore the current character
|
||||
" 0H - and save the command into the second Macro register
|
||||
" `a@r - go back to the current position and exectute the macro to restore
|
||||
" `a@r - go back to the current position and execute the macro to restore
|
||||
" the current character
|
||||
" @m - execute the action associated with this state
|
||||
" U - and repeat
|
||||
|
||||
@@ -10,7 +10,7 @@ in vim: :so urm.vim<RETURN>
|
||||
in vim: * (to load the registers and boot the URM-machine :-)
|
||||
in vim: g (for 'go') and watch the fun. Per default, 3 and 4
|
||||
are multiplied. Watch the Program counter, it is
|
||||
visible as a komma moving around.
|
||||
visible as a comma moving around.
|
||||
|
||||
This is a "standard URM" (Universal register machine) interpreter. The URM
|
||||
concept is used in theoretical computer science to aid in theorem proving.
|
||||
|
||||
@@ -89,7 +89,7 @@ SynMenu AB.Assembly.PIC:pic
|
||||
SynMenu AB.Assembly.Turbo:tasm
|
||||
SynMenu AB.Assembly.VAX\ Macro\ Assembly:vmasm
|
||||
SynMenu AB.Assembly.Z-80:z8a
|
||||
SynMenu AB.Assembly.xa\ 6502\ cross\ assember:a65
|
||||
SynMenu AB.Assembly.xa\ 6502\ cross\ assembler:a65
|
||||
SynMenu AB.ASN\.1:asn
|
||||
SynMenu AB.Asterisk\ config:asterisk
|
||||
SynMenu AB.Asterisk\ voicemail\ config:asteriskvm
|
||||
@@ -327,7 +327,7 @@ SynMenu HIJK.Kivy:kivy
|
||||
SynMenu HIJK.KixTart:kix
|
||||
|
||||
SynMenu L.Lace:lace
|
||||
SynMenu L.LamdaProlog:lprolog
|
||||
SynMenu L.LambdaProlog:lprolog
|
||||
SynMenu L.Latte:latte
|
||||
SynMenu L.Ld\ script:ld
|
||||
SynMenu L.LDAP.LDIF:ldif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" autoload/editorconfig_core/ini.vim: Config-file parser for
|
||||
" editorconfig-core-vimscript and editorconfig-vim.
|
||||
" Modifed from the Python core's ini.py.
|
||||
" Modified from the Python core's ini.py.
|
||||
|
||||
" Copyright (c) 2012-2019 EditorConfig Team {{{2
|
||||
" All rights reserved.
|
||||
|
||||
+33
-28
@@ -1,36 +1,10 @@
|
||||
*editorconfig.txt* EditorConfig plugin for Vim
|
||||
*editorconfig.txt* EditorConfig plugin for vim.
|
||||
|
||||
File: editorconfig.txt
|
||||
Version: 1.1.1
|
||||
Maintainer: EditorConfig Team <http://editorconfig.org>
|
||||
Description: EditorConfig vim plugin
|
||||
|
||||
License:
|
||||
Copyright (c) 2011-2019 EditorConfig Team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
CONTENTS~
|
||||
*editorconfig-contents*
|
||||
----------------------------------------------------------------------------
|
||||
@@ -39,6 +13,7 @@ CONTENTS~
|
||||
3. Commands |editorconfig-commands|
|
||||
4. Settings |editorconfig-settings|
|
||||
5. Advanced |editorconfig-advanced|
|
||||
6. License |editorconfig-license|
|
||||
|
||||
|
||||
OVERVIEW~
|
||||
@@ -230,4 +205,34 @@ And add the following code to your .editorconfig file:
|
||||
Then try to open an Objective-C file, you will find the |filetype| is set to
|
||||
"objc".
|
||||
|
||||
vim:ft=help:tw=78
|
||||
License~
|
||||
*editorconfig-license*
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
License:
|
||||
Copyright (c) 2011-2019 EditorConfig Team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
vim:ft=help:tw=78:cc=
|
||||
|
||||
+1
@@ -6,6 +6,7 @@ editorconfig-commands editorconfig.txt /*editorconfig-commands*
|
||||
editorconfig-contents editorconfig.txt /*editorconfig-contents*
|
||||
editorconfig-hook editorconfig.txt /*editorconfig-hook*
|
||||
editorconfig-installation editorconfig.txt /*editorconfig-installation*
|
||||
editorconfig-license editorconfig.txt /*editorconfig-license*
|
||||
editorconfig-overview editorconfig.txt /*editorconfig-overview*
|
||||
editorconfig-settings editorconfig.txt /*editorconfig-settings*
|
||||
editorconfig.txt editorconfig.txt /*editorconfig.txt*
|
||||
|
||||
+1
-1
@@ -1219,7 +1219,7 @@ func s:Run(args)
|
||||
call s:SendResumingCommand('-exec-run')
|
||||
endfunc
|
||||
|
||||
" :Frame - go to a specfic frame in the stack
|
||||
" :Frame - go to a specific frame in the stack
|
||||
func s:Frame(arg)
|
||||
" Note: we explicit do not use mi's command
|
||||
" call s:SendCommand('-stack-select-frame "' . a:arg .'"')
|
||||
|
||||
+2
-2
@@ -73,7 +73,7 @@ an 50.10.440 &Syntax.AB.Assembly.PIC :cal SetSyn("pic")<CR>
|
||||
an 50.10.450 &Syntax.AB.Assembly.Turbo :cal SetSyn("tasm")<CR>
|
||||
an 50.10.460 &Syntax.AB.Assembly.VAX\ Macro\ Assembly :cal SetSyn("vmasm")<CR>
|
||||
an 50.10.470 &Syntax.AB.Assembly.Z-80 :cal SetSyn("z8a")<CR>
|
||||
an 50.10.480 &Syntax.AB.Assembly.xa\ 6502\ cross\ assember :cal SetSyn("a65")<CR>
|
||||
an 50.10.480 &Syntax.AB.Assembly.xa\ 6502\ cross\ assembler :cal SetSyn("a65")<CR>
|
||||
an 50.10.490 &Syntax.AB.ASN\.1 :cal SetSyn("asn")<CR>
|
||||
an 50.10.500 &Syntax.AB.Asterisk\ config :cal SetSyn("asterisk")<CR>
|
||||
an 50.10.510 &Syntax.AB.Asterisk\ voicemail\ config :cal SetSyn("asteriskvm")<CR>
|
||||
@@ -303,7 +303,7 @@ an 50.50.710 &Syntax.HIJK.Kimwitu++ :cal SetSyn("kwt")<CR>
|
||||
an 50.50.720 &Syntax.HIJK.Kivy :cal SetSyn("kivy")<CR>
|
||||
an 50.50.730 &Syntax.HIJK.KixTart :cal SetSyn("kix")<CR>
|
||||
an 50.60.100 &Syntax.L.Lace :cal SetSyn("lace")<CR>
|
||||
an 50.60.110 &Syntax.L.LamdaProlog :cal SetSyn("lprolog")<CR>
|
||||
an 50.60.110 &Syntax.L.LambdaProlog :cal SetSyn("lprolog")<CR>
|
||||
an 50.60.120 &Syntax.L.Latte :cal SetSyn("latte")<CR>
|
||||
an 50.60.130 &Syntax.L.Ld\ script :cal SetSyn("ld")<CR>
|
||||
an 50.60.140 &Syntax.L.LDAP.LDIF :cal SetSyn("ldif")<CR>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user