mirror of
https://github.com/zoriya/vim.git
synced 2025-12-18 13:15:21 +00:00
Compare commits
307 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b19e5b919 | ||
|
|
899f20deae | ||
|
|
ec572ad6a6 | ||
|
|
6cc7e21412 | ||
|
|
c2f5054be9 | ||
|
|
28fc247f8d | ||
|
|
3940ec6d41 | ||
|
|
4f5b0e5355 | ||
|
|
437a746b4c | ||
|
|
b4d9b893d3 | ||
|
|
981d9dc8f3 | ||
|
|
b7ed839976 | ||
|
|
48ac671fe5 | ||
|
|
4e038571aa | ||
|
|
e809a4ed30 | ||
|
|
790c18bfa5 | ||
|
|
6bf2c6264b | ||
|
|
931a277145 | ||
|
|
6cb39f924a | ||
|
|
5ca1ac373a | ||
|
|
bc2cfe4672 | ||
|
|
0d702028fe | ||
|
|
e4b407f536 | ||
|
|
e296e3177b | ||
|
|
80edda1cf5 | ||
|
|
ba45f1f4fb | ||
|
|
435f9f06ca | ||
|
|
9ee3d161f7 | ||
|
|
d529ba58dc | ||
|
|
8531dc66e8 | ||
|
|
7866b87958 | ||
|
|
f8a0712655 | ||
|
|
a83e70000f | ||
|
|
5b8cfedfbd | ||
|
|
892ae723ab | ||
|
|
15e248e37f | ||
|
|
2e62b568e9 | ||
|
|
b60d8514b8 | ||
|
|
f9c85f580b | ||
|
|
548be7f126 | ||
|
|
4340fc95d5 | ||
|
|
13b47c37a6 | ||
|
|
d74af4227b | ||
|
|
711d02c96d | ||
|
|
8da4181631 | ||
|
|
4cd583c6da | ||
|
|
6efd76ae4a | ||
|
|
53a95d6584 | ||
|
|
68acb41f99 | ||
|
|
c2a4316500 | ||
|
|
88c47aa692 | ||
|
|
2eed9bafa0 | ||
|
|
6a7af8e2db | ||
|
|
5c381eb9e7 | ||
|
|
7d491c4253 | ||
|
|
6c6a603cd2 | ||
|
|
75fb0854e9 | ||
|
|
e96a2498f9 | ||
|
|
2b044ffb5a | ||
|
|
b2cda0dd1d | ||
|
|
e7eb92708e | ||
|
|
0a1f56fcfe | ||
|
|
7be3ab2589 | ||
|
|
0fcf26ba4f | ||
|
|
7a39dd7f00 | ||
|
|
c662ec9978 | ||
|
|
6c1e1570b1 | ||
|
|
adc6714aac | ||
|
|
dfc1455728 | ||
|
|
693f7dc818 | ||
|
|
405bb42734 | ||
|
|
75a1a9415b | ||
|
|
a3fce62c91 | ||
|
|
37e66cf0f6 | ||
|
|
e9726e31fe | ||
|
|
a956bf6ca3 | ||
|
|
4dff4aed09 | ||
|
|
bf8c3adef2 | ||
|
|
87652a7e3b | ||
|
|
db51730df1 | ||
|
|
517f71ab17 | ||
|
|
9b283523f2 | ||
|
|
394c5d8870 | ||
|
|
6e5000d493 | ||
|
|
ad24a71e22 | ||
|
|
ae943150d3 | ||
|
|
6313c4f41d | ||
|
|
eb2310d47d | ||
|
|
a730e55cc2 | ||
|
|
983f2f1403 | ||
|
|
8a5c7ef9bb | ||
|
|
8cdbd5b3c4 | ||
|
|
1c196e7b17 | ||
|
|
dc2ce58b5a | ||
|
|
f85e40afc2 | ||
|
|
6c17543b56 | ||
|
|
51c3131040 | ||
|
|
61eeeea8e6 | ||
|
|
a42d945efc | ||
|
|
26910de8b0 | ||
|
|
0331faf712 | ||
|
|
45aa07d3c1 | ||
|
|
b46fecd345 | ||
|
|
b6e3b88ec8 | ||
|
|
d7c9687947 | ||
|
|
bffc50494d | ||
|
|
0abb4273f6 | ||
|
|
9937a05543 | ||
|
|
dfa97f2aed | ||
|
|
fc06cbbf86 | ||
|
|
1755ec4278 | ||
|
|
650a63748c | ||
|
|
bd75b5333d | ||
|
|
2fc39aeeb5 | ||
|
|
d2cea96f6c | ||
|
|
0554fa478d | ||
|
|
f42397c395 | ||
|
|
21606676d9 | ||
|
|
b4086ffa32 | ||
|
|
a540f8aa3b | ||
|
|
37df9a4401 | ||
|
|
b53fb31a1e | ||
|
|
b0f94c1ff3 | ||
|
|
8d24104031 | ||
|
|
68d48f40a4 | ||
|
|
7c7f01e2b2 | ||
|
|
451d4b5b7c | ||
|
|
06e2c81f6d | ||
|
|
202d982b36 | ||
|
|
12ee7ff00b | ||
|
|
4c063a0dab | ||
|
|
640d4f0c97 | ||
|
|
82febc16e4 | ||
|
|
01257a7a8e | ||
|
|
3ff5f0f05d | ||
|
|
38ea784fec | ||
|
|
ac2450a9a8 | ||
|
|
80dad48c50 | ||
|
|
954bb06363 | ||
|
|
541faf7a73 | ||
|
|
a90998d93a | ||
|
|
b29cfb8c28 | ||
|
|
8ed75cb0b4 | ||
|
|
ef23c527bd | ||
|
|
ffa60dda0a | ||
|
|
427f5b66ce | ||
|
|
260addf795 | ||
|
|
21f8d93c71 | ||
|
|
24a5ac5d4d | ||
|
|
c024b46678 | ||
|
|
aef5c62a6f | ||
|
|
acc682bd7c | ||
|
|
1748c7f77e | ||
|
|
6c009a3974 | ||
|
|
33796b39b9 | ||
|
|
7c348bb5ad | ||
|
|
6064073841 | ||
|
|
4e0bf84627 | ||
|
|
64416127fc | ||
|
|
150f0550f4 | ||
|
|
62a88f498a | ||
|
|
1253704591 | ||
|
|
773a97c254 | ||
|
|
c07f67ad0e | ||
|
|
75ee544f99 | ||
|
|
5d30ff1964 | ||
|
|
f6d50f1da8 | ||
|
|
12e71eb8a8 | ||
|
|
8e228e21cc | ||
|
|
133c737357 | ||
|
|
18250e291a | ||
|
|
c7500f9cb5 | ||
|
|
9c0cec65f8 | ||
|
|
db294adc65 | ||
|
|
9aeb33639f | ||
|
|
4a792c87b9 | ||
|
|
61da1bfa6c | ||
|
|
de6dbb452a | ||
|
|
32e1977012 | ||
|
|
6d718c4c38 | ||
|
|
66761db11d | ||
|
|
d0380dc782 | ||
|
|
d6ec1730ba | ||
|
|
58a7f87c86 | ||
|
|
a37833dbd7 | ||
|
|
cea254f5a7 | ||
|
|
277e79adc4 | ||
|
|
c974022c31 | ||
|
|
ddd3308782 | ||
|
|
02e15072be | ||
|
|
3f6aeba18b | ||
|
|
0b4c9eddb5 | ||
|
|
87abab92f5 | ||
|
|
98fb65cb05 | ||
|
|
1762731f20 | ||
|
|
6116b6abb1 | ||
|
|
3397f74ac2 | ||
|
|
b0ebbda06c | ||
|
|
ca2f7037c1 | ||
|
|
399d898ac1 | ||
|
|
042fb4b449 | ||
|
|
988c43310a | ||
|
|
7b29dd8507 | ||
|
|
9eaac89650 | ||
|
|
790498b509 | ||
|
|
3bfd04e672 | ||
|
|
2fd8e35e16 | ||
|
|
8caaf82569 | ||
|
|
bf0eff0b72 | ||
|
|
2d247849ce | ||
|
|
c47ed44be7 | ||
|
|
815b76bff6 | ||
|
|
3a97bb3f0f | ||
|
|
7dd64a3e57 | ||
|
|
c28cb5b16d | ||
|
|
5d508dd39e | ||
|
|
1ab74a5af3 | ||
|
|
eea1699836 | ||
|
|
ccd6e3471d | ||
|
|
c6896e20f8 | ||
|
|
402502d0e4 | ||
|
|
ac1f1bc222 | ||
|
|
cc31ad9f9b | ||
|
|
54fabd4b5e | ||
|
|
b42301247d | ||
|
|
89adc3a137 | ||
|
|
5c3fb04623 | ||
|
|
cacc6a5c98 | ||
|
|
8c2a600f72 | ||
|
|
1714696600 | ||
|
|
88c4e1f069 | ||
|
|
68a4b04a8d | ||
|
|
868b7b6712 | ||
|
|
1bbebab525 | ||
|
|
bc133543b8 | ||
|
|
59edb00e22 | ||
|
|
c799fe206e | ||
|
|
b58a4b938c | ||
|
|
72fcf07b06 | ||
|
|
7833dab73c | ||
|
|
60cdb3004a | ||
|
|
b43683729b | ||
|
|
bf0ecb2cb6 | ||
|
|
7a8d0278bd | ||
|
|
2cd0dce898 | ||
|
|
68e6560b84 | ||
|
|
20c023aee0 | ||
|
|
9d591525a5 | ||
|
|
35d5af6c0b | ||
|
|
51fe3b14f6 | ||
|
|
076073950c | ||
|
|
9c27b1c6d1 | ||
|
|
ec58384afa | ||
|
|
a8c99fb78e | ||
|
|
80f95425cf | ||
|
|
193ffd1d9f | ||
|
|
adfde115d5 | ||
|
|
a5e44600eb | ||
|
|
51e14387f1 | ||
|
|
682725c141 | ||
|
|
4d784b21d1 | ||
|
|
8f46e4c4bd | ||
|
|
7b31a181c8 | ||
|
|
f0884c5f3f | ||
|
|
d79eef2eb1 | ||
|
|
18a4ba29ae | ||
|
|
71de720c2c | ||
|
|
964b3746b9 | ||
|
|
d33a764123 | ||
|
|
3020a87cb1 | ||
|
|
d22a6f8aaf | ||
|
|
fa8f861957 | ||
|
|
8239c62067 | ||
|
|
701ff0a3e5 | ||
|
|
fcc4d921d6 | ||
|
|
e2ad826f43 | ||
|
|
984f031fb0 | ||
|
|
c97582b029 | ||
|
|
0ab190c057 | ||
|
|
1c6fd1e100 | ||
|
|
99499b1c05 | ||
|
|
05b8b07e27 | ||
|
|
294d9bf966 | ||
|
|
e09244ee35 | ||
|
|
7e800c6047 | ||
|
|
110289e781 | ||
|
|
5357552140 | ||
|
|
5c017b2de2 | ||
|
|
e0b5949a3b | ||
|
|
c79745a82f | ||
|
|
0b0ad35c33 | ||
|
|
80341bcd89 | ||
|
|
f3333b02f3 | ||
|
|
386b43e594 | ||
|
|
999dc14644 | ||
|
|
8471e57026 | ||
|
|
16e9b85113 | ||
|
|
f5842c5a53 | ||
|
|
2b39d806f0 | ||
|
|
e9ebc9a91c | ||
|
|
338dfdad38 | ||
|
|
dc6855af97 | ||
|
|
cf0bfd9ade | ||
|
|
f8191c5f07 | ||
|
|
bd2d68c2f4 | ||
|
|
7f3a28490a | ||
|
|
6349e9411f |
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
custom: https://www.vim.org/sponsor/index.php
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -35,7 +35,9 @@ src/auto/pathdef.c
|
||||
*.RES
|
||||
vim*.dll
|
||||
vim*.lib
|
||||
src/pathdef.c
|
||||
src/dobj*/pathdef.c
|
||||
src/gobj*/pathdef.c
|
||||
src/obj*/pathdef.c
|
||||
src/Obj*/pathdef.c
|
||||
gvimext.dll
|
||||
gvimext.lib
|
||||
|
||||
@@ -37,7 +37,9 @@ src/auto/pathdef.c
|
||||
*.RES
|
||||
vim*.dll
|
||||
vim*.lib
|
||||
src/pathdef.c
|
||||
src/dobj*/pathdef.c
|
||||
src/gobj*/pathdef.c
|
||||
src/obj*/pathdef.c
|
||||
src/Obj*/pathdef.c
|
||||
gvimext.dll
|
||||
gvimext.lib
|
||||
|
||||
318
.travis.yml
318
.travis.yml
@@ -1,133 +1,116 @@
|
||||
language: c
|
||||
dist: trusty
|
||||
|
||||
os:
|
||||
- osx
|
||||
- linux
|
||||
anchors:
|
||||
envs:
|
||||
- &tiny-nogui
|
||||
BUILD=yes TEST=test COVERAGE=no FEATURES=tiny "CONFOPT='--disable-gui'" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||
- &tiny
|
||||
BUILD=yes TEST=test COVERAGE=no FEATURES=tiny CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||
- &small
|
||||
BUILD=yes TEST=test COVERAGE=no FEATURES=small CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||
- &normal
|
||||
BUILD=yes TEST=test COVERAGE=no FEATURES=normal CONFOPT= SHADOWOPT="-C src/shadow" SRCDIR=./src/shadow CHECK_AUTOCONF=no
|
||||
- &linux-huge
|
||||
BUILD=yes TEST="scripttests test_libvterm" COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp'"
|
||||
- &osx-huge # macOS build
|
||||
BUILD=yes TEST=test COVERAGE=no FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp'"
|
||||
- &unittests
|
||||
BUILD=no TEST=unittests COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes
|
||||
- &asan # ASAN build
|
||||
SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer"
|
||||
ASAN_OPTIONS="print_stacktrace=1 log_path=asan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt"
|
||||
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
linux: &linux
|
||||
os: linux
|
||||
dist: trusty
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
# Need msgfmt 0.19.8 to be able to generate .desktop files
|
||||
- sourceline: 'ppa:ricotz/toolchain'
|
||||
packages:
|
||||
- autoconf
|
||||
- clang
|
||||
- lcov
|
||||
- gettext
|
||||
- libcanberra-dev
|
||||
- libperl-dev
|
||||
- python-dev
|
||||
- python3-dev
|
||||
- liblua5.2-dev
|
||||
- lua5.2
|
||||
- ruby-dev
|
||||
- tcl-dev
|
||||
- cscope
|
||||
- libgtk2.0-dev
|
||||
- desktop-file-utils
|
||||
before_install:
|
||||
- rvm reset
|
||||
# Remove /opt/python/3.x.x/bin from $PATH for using system python3.
|
||||
# ("pyenv global system" doesn't seem to work.)
|
||||
- |
|
||||
if [[ "$(which python3)" =~ ^/opt/python/ ]]; then
|
||||
export PATH=$(py3=$(which python3); echo ${PATH//${py3%/python3}:/})
|
||||
fi
|
||||
- |
|
||||
if [[ "${COVERAGE}" = "yes" ]]; then
|
||||
pip install --user cpp-coveralls
|
||||
fi
|
||||
# needed for https support for coveralls
|
||||
# building cffi only works with gcc, not with clang
|
||||
- |
|
||||
if [[ "${COVERAGE}" = "yes" ]]; then
|
||||
CC=gcc pip install --user pyopenssl ndg-httpsclient pyasn1
|
||||
fi
|
||||
# Use llvm-cov instead of gcov when compiler is clang.
|
||||
- |
|
||||
if [[ "${CC}" = "clang" ]]; then
|
||||
ln -sf "$(which llvm-cov)" /home/travis/bin/gcov
|
||||
fi
|
||||
before_script:
|
||||
# Start virtual framebuffer to be able to test the GUI. Does not work on OS X.
|
||||
- export DISPLAY=:99.0
|
||||
- sh -e /etc/init.d/xvfb start && sleep 3
|
||||
- sudo modprobe snd-dummy
|
||||
- sudo usermod -a -G audio $USER
|
||||
- do_test() { sg audio "sg $(id -gn) '$*'"; }
|
||||
|
||||
env:
|
||||
- &tiny-nogui
|
||||
BUILD=yes TEST=test COVERAGE=no FEATURES=tiny "CONFOPT='--disable-gui'" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||
- &tiny
|
||||
BUILD=yes TEST=test COVERAGE=no FEATURES=tiny CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||
- &asan # ASAN build
|
||||
BUILD=yes TEST=test SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer"
|
||||
FEATURES=huge SRCDIR=./src CHECK_AUTOCONF=no ASAN_OPTIONS="print_stacktrace=1 log_path=asan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt"
|
||||
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp'"
|
||||
- &linux-huge
|
||||
BUILD=yes TEST="scripttests test_libvterm" COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp'"
|
||||
- &unittests
|
||||
BUILD=no TEST=unittests COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes
|
||||
- &normal
|
||||
BUILD=yes TEST=test COVERAGE=no FEATURES=normal CONFOPT= SHADOWOPT="-C src/shadow" SRCDIR=./src/shadow CHECK_AUTOCONF=no
|
||||
- &small
|
||||
BUILD=yes TEST=test COVERAGE=no FEATURES=small CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||
- &osx-huge # Mac OSX build
|
||||
BUILD=yes TEST=test COVERAGE=no FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
||||
"CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp'"
|
||||
osx: &osx
|
||||
os: osx
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- lua
|
||||
update: true
|
||||
cache:
|
||||
directories:
|
||||
- /usr/local/Homebrew/Library/Homebrew/vendor/
|
||||
- /usr/local/Homebrew/Library/Taps/
|
||||
before_install:
|
||||
- rvm reset
|
||||
# Lua is not installed on Travis OSX
|
||||
- export LUA_PREFIX=/usr/local
|
||||
before_script:
|
||||
- do_test() { "$@"; }
|
||||
|
||||
coverage: &coverage
|
||||
- ~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8 latin-1 EUC-KR
|
||||
- (cd "${SRCDIR}" && bash <(curl -s https://codecov.io/bash))
|
||||
|
||||
asan_symbolize: &asan_symbolize
|
||||
- |
|
||||
while read log; do
|
||||
asan_symbolize < "${log}"
|
||||
done < <(find . -type f -name 'asan.*' -size +0)
|
||||
|
||||
sudo: false
|
||||
|
||||
# instead of a 2*2*8 matrix (2*os + 2*compiler + 8*env),
|
||||
# exclude some builds on mac os x and linux
|
||||
# on mac os x "tiny" is always without GUI
|
||||
# linux: 2*compiler + 5*env + mac: 2*compiler + 2*env
|
||||
matrix:
|
||||
exclude:
|
||||
- os: osx
|
||||
env: *tiny
|
||||
- os: osx
|
||||
env: *normal
|
||||
- os: osx
|
||||
env: *unittests
|
||||
- os: osx
|
||||
env: *small
|
||||
- os: osx
|
||||
env: *linux-huge
|
||||
- os: osx
|
||||
env: *asan
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: *asan
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: *unittests
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: *small
|
||||
- os: linux
|
||||
env: *osx-huge
|
||||
|
||||
branches:
|
||||
except:
|
||||
- /^v[0-9]/
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
# Need msgfmt 0.19.8 to be able to generate .desktop files
|
||||
- sourceline: 'ppa:ricotz/toolchain'
|
||||
packages:
|
||||
- autoconf
|
||||
- clang
|
||||
- lcov
|
||||
- gettext
|
||||
- libperl-dev
|
||||
- python-dev
|
||||
- python3-dev
|
||||
- liblua5.2-dev
|
||||
- lua5.2
|
||||
- ruby-dev
|
||||
- tcl-dev
|
||||
- cscope
|
||||
- libgtk2.0-dev
|
||||
homebrew:
|
||||
packages:
|
||||
- lua
|
||||
update: true
|
||||
|
||||
before_install:
|
||||
- rvm reset
|
||||
# Remove /opt/python/3.x.x/bin from $PATH for using system python3.
|
||||
# ("pyenv global system" doesn't seem to work.)
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" = "linux" ]] && [[ "$(which python3)" =~ ^/opt/python/ ]]; then
|
||||
export PATH=$(py3=$(which python3); echo ${PATH//${py3%/python3}:/})
|
||||
fi
|
||||
- |
|
||||
if [[ "${COVERAGE}" = "yes" ]]; then
|
||||
pip install --user cpp-coveralls
|
||||
fi
|
||||
# needed for https support for coveralls
|
||||
# building cffi only works with gcc, not with clang
|
||||
- |
|
||||
if [[ "${COVERAGE}" = "yes" ]]; then
|
||||
CC=gcc pip install --user pyopenssl ndg-httpsclient pyasn1
|
||||
fi
|
||||
# Lua is not installed on Travis OSX
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" = "osx" ]]; then
|
||||
export LUA_PREFIX=/usr/local
|
||||
fi
|
||||
# Use llvm-cov instead of gcov when compiler is clang.
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" = "linux" ]] && [[ "${CC}" = "clang" ]]; then
|
||||
ln -sf "$(which llvm-cov)" /home/travis/bin/gcov
|
||||
fi
|
||||
|
||||
before_script:
|
||||
# Start virtual framebuffer to be able to test the GUI. Does not work on OS X.
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" = "linux" ]]; then
|
||||
export DISPLAY=:99.0
|
||||
sh -e /etc/init.d/xvfb start && sleep 3
|
||||
fi
|
||||
|
||||
script:
|
||||
- NPROC=$(getconf _NPROCESSORS_ONLN)
|
||||
- set -o errexit
|
||||
@@ -159,24 +142,87 @@ script:
|
||||
"${SRCDIR}"/vim --not-a-term -u NONE -S "${SRCDIR}"/testdir/if_ver-2.vim -c quit > /dev/null
|
||||
cat if_ver.txt
|
||||
fi
|
||||
- make ${SHADOWOPT} ${TEST}
|
||||
- do_test make ${SHADOWOPT} ${TEST}
|
||||
- echo -en "travis_fold:end:test\\r\\033[0K"
|
||||
- |
|
||||
if [[ -n "${ASAN_OPTIONS}" ]]; then
|
||||
while read log; do
|
||||
asan_symbolize < "${log}"
|
||||
false # exit 1 if there are ASAN logs
|
||||
done < <(find . -type f -name 'asan.*' -size +0)
|
||||
fi
|
||||
|
||||
after_success:
|
||||
- |
|
||||
if [[ "${COVERAGE}" = "yes" ]]; then
|
||||
~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8 latin-1 EUC-KR
|
||||
fi
|
||||
- |
|
||||
if [[ "${COVERAGE}" = "yes" ]]; then
|
||||
(cd "${SRCDIR}" && bash <(curl -s https://codecov.io/bash))
|
||||
fi
|
||||
# instead of a 2*2*8 matrix (2*os + 2*compiler + 8*env),
|
||||
# exclude some builds on mac os x and linux
|
||||
# on mac os x "tiny" is always without GUI
|
||||
# linux: 2*compiler + 5*env + mac: 2*compiler + 2*env
|
||||
matrix:
|
||||
include:
|
||||
- <<: *osx
|
||||
name: tiny-nogui/clang
|
||||
compiler: clang
|
||||
env: *tiny-nogui
|
||||
- <<: *osx
|
||||
name: tiny-nogui/gcc
|
||||
compiler: gcc
|
||||
env: *tiny-nogui
|
||||
- <<: *osx
|
||||
name: huge/clang
|
||||
compiler: clang
|
||||
env: *osx-huge
|
||||
- <<: *osx
|
||||
name: huge/gcc
|
||||
compiler: gcc
|
||||
env: *osx-huge
|
||||
- <<: *linux
|
||||
name: tiny-nogui/clang
|
||||
compiler: clang
|
||||
env: *tiny-nogui
|
||||
- <<: *linux
|
||||
name: tiny-nogui/gcc
|
||||
compiler: gcc
|
||||
env: *tiny-nogui
|
||||
- <<: *linux
|
||||
name: tiny/clang
|
||||
compiler: clang
|
||||
env: *tiny
|
||||
- <<: *linux
|
||||
name: tiny/gcc
|
||||
compiler: gcc
|
||||
env: *tiny
|
||||
- <<: *linux
|
||||
name: small/gcc
|
||||
compiler: gcc
|
||||
env: *small
|
||||
- <<: *linux
|
||||
name: normal/clang
|
||||
compiler: clang
|
||||
env: *normal
|
||||
- <<: *linux
|
||||
name: normal/gcc
|
||||
compiler: gcc
|
||||
env: *normal
|
||||
- <<: *linux
|
||||
name: huge+coverage/clang
|
||||
compiler: clang
|
||||
env: *linux-huge
|
||||
after_success: *coverage
|
||||
- <<: *linux
|
||||
name: huge+coverage/gcc
|
||||
compiler: gcc
|
||||
env: *linux-huge
|
||||
after_success: *coverage
|
||||
- <<: *linux
|
||||
name: unittests+coverage/gcc
|
||||
compiler: gcc
|
||||
env: *unittests
|
||||
after_success: *coverage
|
||||
- <<: *linux # ASAN
|
||||
name: huge+asan/gcc
|
||||
compiler: gcc
|
||||
env:
|
||||
- *linux-huge
|
||||
- *asan
|
||||
after_failure: *asan_symbolize
|
||||
- <<: *linux
|
||||
name: huge-testgui+coverage/gcc
|
||||
compiler: gcc
|
||||
env:
|
||||
- *linux-huge
|
||||
- TEST="-C src testgui"
|
||||
after_success: *coverage
|
||||
|
||||
# vim:set sts=2 sw=2 tw=0 et:
|
||||
|
||||
9
Filelist
9
Filelist
@@ -79,6 +79,7 @@ SRC_ALL = \
|
||||
src/option.c \
|
||||
src/option.h \
|
||||
src/popupmnu.c \
|
||||
src/popupwin.c \
|
||||
src/quickfix.c \
|
||||
src/regexp.c \
|
||||
src/regexp_nfa.c \
|
||||
@@ -87,6 +88,7 @@ SRC_ALL = \
|
||||
src/search.c \
|
||||
src/sha256.c \
|
||||
src/sign.c \
|
||||
src/sound.c \
|
||||
src/spell.c \
|
||||
src/spell.h \
|
||||
src/spellfile.c \
|
||||
@@ -117,9 +119,12 @@ SRC_ALL = \
|
||||
src/testdir/lsan-suppress.txt \
|
||||
src/testdir/sautest/autoload/*.vim \
|
||||
src/testdir/runtest.vim \
|
||||
src/testdir/summarize.vim \
|
||||
src/testdir/check.vim \
|
||||
src/testdir/shared.vim \
|
||||
src/testdir/screendump.vim \
|
||||
src/testdir/view_util.vim \
|
||||
src/testdir/term_util.vim \
|
||||
src/testdir/setup.vim \
|
||||
src/testdir/gui_init.vim \
|
||||
src/testdir/setup_gui.vim \
|
||||
@@ -148,6 +153,8 @@ SRC_ALL = \
|
||||
src/testdir/samples/test000 \
|
||||
src/testdir/if_ver*.vim \
|
||||
src/testdir/color_ramp.vim \
|
||||
src/testdir/silent.wav \
|
||||
src/testdir/popupbounce.vim \
|
||||
src/proto.h \
|
||||
src/protodef.h \
|
||||
src/proto/arabic.pro \
|
||||
@@ -200,12 +207,14 @@ SRC_ALL = \
|
||||
src/proto/ops.pro \
|
||||
src/proto/option.pro \
|
||||
src/proto/popupmnu.pro \
|
||||
src/proto/popupwin.pro \
|
||||
src/proto/quickfix.pro \
|
||||
src/proto/regexp.pro \
|
||||
src/proto/screen.pro \
|
||||
src/proto/search.pro \
|
||||
src/proto/sha256.pro \
|
||||
src/proto/sign.pro \
|
||||
src/proto/sound.pro \
|
||||
src/proto/spell.pro \
|
||||
src/proto/spellfile.pro \
|
||||
src/proto/syntax.pro \
|
||||
|
||||
@@ -47,6 +47,11 @@ Unicode true
|
||||
|
||||
!include gvim_version.nsh # for version number
|
||||
|
||||
# Definition of Patch for Vim
|
||||
!ifndef PATCHLEVEL
|
||||
!define PATCHLEVEL 0
|
||||
!endif
|
||||
|
||||
# ----------- No configurable settings below this line -----------
|
||||
|
||||
!include "Library.nsh" # For DLL install
|
||||
@@ -181,8 +186,8 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Vim Developers"
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Vim"
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (C) 1996"
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Vi Improved - A Text Editor"
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VER_MAJOR}.${VER_MINOR}.0.0"
|
||||
VIProductVersion "${VER_MAJOR}.${VER_MINOR}.0.0"
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
|
||||
VIProductVersion "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
|
||||
|
||||
# Global variables
|
||||
Var vim_dialog
|
||||
|
||||
@@ -45,37 +45,37 @@ LangString str_type_full ${LANG_SIMPCHINESE} \
|
||||
LangString str_section_old_ver ${LANG_SIMPCHINESE} \
|
||||
"卸载旧版本"
|
||||
LangString str_desc_old_ver ${LANG_SIMPCHINESE} \
|
||||
"卸载系统上旧版本的 Vim。"
|
||||
"卸载系统上已存在的 Vim 版本"
|
||||
|
||||
LangString str_section_exe ${LANG_SIMPCHINESE} \
|
||||
"安装 Vim 图形界面"
|
||||
LangString str_desc_exe ${LANG_SIMPCHINESE} \
|
||||
"安装 Vim 图形界面及脚本。此为必选安装。"
|
||||
"安装 Vim 图形界面及运行时文件。此项为必选。"
|
||||
|
||||
LangString str_section_console ${LANG_SIMPCHINESE} \
|
||||
"安装 Vim 命令行程序"
|
||||
"安装 Vim 控制台版本"
|
||||
LangString str_desc_console ${LANG_SIMPCHINESE} \
|
||||
"安装 Vim 命令行程序 (vim.exe)。该程序在命令行窗口中运行。"
|
||||
"安装 Vim 的控制台版本(vim.exe)。"
|
||||
|
||||
LangString str_section_batch ${LANG_SIMPCHINESE} \
|
||||
"安装批处理文件"
|
||||
LangString str_desc_batch ${LANG_SIMPCHINESE} \
|
||||
"为 Vim 的各种变体创建批处理程序,以便在命令行下运行 Vim。"
|
||||
"为 Vim 的各种变体创建批处理文件,以便在命令行下运行 Vim。"
|
||||
|
||||
LangString str_group_icons ${LANG_SIMPCHINESE} \
|
||||
"创建 Vim 图标"
|
||||
"创建图标"
|
||||
LangString str_desc_icons ${LANG_SIMPCHINESE} \
|
||||
"为 Vim 创建若干图标,以方便使用 Vim。"
|
||||
|
||||
LangString str_section_desktop ${LANG_SIMPCHINESE} \
|
||||
"在桌面上"
|
||||
"桌面图标"
|
||||
LangString str_desc_desktop ${LANG_SIMPCHINESE} \
|
||||
"在桌面上为 Vim 创建若干图标,以方便启动 Vim。"
|
||||
"创建 Vim 的桌面快捷方式图标。"
|
||||
|
||||
LangString str_section_start_menu ${LANG_SIMPCHINESE} \
|
||||
"在启动菜单的程序菜单下"
|
||||
"「开始」菜单程序组"
|
||||
LangString str_desc_start_menu ${LANG_SIMPCHINESE} \
|
||||
"在启动菜单的程序菜单下添加 Vim 组。适用于 Windows 95 及以上版本。"
|
||||
"在开始菜单中添加 Vim 程序组(适用于 Windows 95 及以上版本)"
|
||||
|
||||
#LangString str_section_quick_launch ${LANG_SIMPCHINESE} \
|
||||
# "在快速启动启动栏中"
|
||||
@@ -83,9 +83,9 @@ LangString str_desc_start_menu ${LANG_SIMPCHINESE} \
|
||||
# "在快速启动栏中添加 Vim 图标。"
|
||||
|
||||
LangString str_section_edit_with ${LANG_SIMPCHINESE} \
|
||||
"安装快捷菜单"
|
||||
"添加到快捷菜单"
|
||||
LangString str_desc_edit_with ${LANG_SIMPCHINESE} \
|
||||
"将 Vim 添加到“打开方式”快捷菜单中。"
|
||||
"将“用 Vim 编辑”添加到快捷菜单中。"
|
||||
|
||||
#LangString str_section_edit_with32 ${LANG_SIMPCHINESE} \
|
||||
# "32 位版本"
|
||||
@@ -98,10 +98,10 @@ LangString str_desc_edit_with ${LANG_SIMPCHINESE} \
|
||||
# "将 Vim 添加到 64 位程序的“打开方式”快捷菜单中。"
|
||||
|
||||
LangString str_section_vim_rc ${LANG_SIMPCHINESE} \
|
||||
"创建缺省配置文件"
|
||||
"创建默认配置文件"
|
||||
LangString str_desc_vim_rc ${LANG_SIMPCHINESE} \
|
||||
"在安装目录下生成缺省的 Vim 配置文件(_vimrc)。\
|
||||
如果该文件已经存在,则略过此项。"
|
||||
"在安装目录下生成默认的 Vim 配置文件(_vimrc)。\
|
||||
如果该文件已经存在,则跳过该项。"
|
||||
|
||||
LangString str_group_plugin ${LANG_SIMPCHINESE} \
|
||||
"创建插件目录"
|
||||
@@ -121,9 +121,9 @@ LangString str_desc_plugin_vim ${LANG_SIMPCHINESE} \
|
||||
该目录下的扩展插件。"
|
||||
|
||||
LangString str_section_vis_vim ${LANG_SIMPCHINESE} \
|
||||
"安装 VisVim 插件"
|
||||
"VisVim 插件"
|
||||
LangString str_desc_vis_vim ${LANG_SIMPCHINESE} \
|
||||
"安装用于与微软 Microsoft Visual Studio 进行集成的 VisVim 插件。"
|
||||
"安装与 Visual Studio 集成的 VisVim 插件。"
|
||||
|
||||
LangString str_section_nls ${LANG_SIMPCHINESE} \
|
||||
"安装多语言支持"
|
||||
@@ -153,12 +153,12 @@ LangString str_desc_rm_plugin_home ${LANG_SIMPCHINESE} \
|
||||
LangString str_unsection_plugin_vim ${LANG_SIMPCHINESE} \
|
||||
"公共插件目录"
|
||||
LangString str_desc_rm_plugin_vim ${LANG_SIMPCHINESE} \
|
||||
"Remove the plugin directories from Vim install directory."
|
||||
"从 Vim 安装目录下移除插件目录。"
|
||||
|
||||
LangString str_unsection_rootdir ${LANG_SIMPCHINESE} \
|
||||
"Remove the Vim root directory"
|
||||
"移除 Vim 主目录"
|
||||
LangString str_desc_rm_rootdir ${LANG_SIMPCHINESE} \
|
||||
"Remove the Vim root directory. It contains your Vim configuration files!"
|
||||
"移除 Vim 的主目录,该目录包含您的配置文件!"
|
||||
|
||||
|
||||
##############################################################################
|
||||
@@ -225,13 +225,13 @@ LangString str_msg_rm_exe_fail ${LANG_SIMPCHINESE} \
|
||||
# 该目录下仍有其他文件。"
|
||||
|
||||
LangString str_msg_uninstalling ${LANG_SIMPCHINESE} \
|
||||
"Uninstalling the old version..."
|
||||
"正在卸载旧版本..."
|
||||
|
||||
LangString str_msg_registering ${LANG_SIMPCHINESE} \
|
||||
"Registering..."
|
||||
"正在注册..."
|
||||
|
||||
LangString str_msg_unregistering ${LANG_SIMPCHINESE} \
|
||||
"Unregistering..."
|
||||
"正在取消注册..."
|
||||
|
||||
|
||||
##############################################################################
|
||||
@@ -239,12 +239,12 @@ LangString str_msg_unregistering ${LANG_SIMPCHINESE} \
|
||||
##############################################################################
|
||||
|
||||
LangString str_vimrc_page_title ${LANG_SIMPCHINESE} \
|
||||
"Choose _vimrc settings"
|
||||
"设置 _vimrc"
|
||||
LangString str_vimrc_page_subtitle ${LANG_SIMPCHINESE} \
|
||||
"Choose the settings for enhancement, keyboard and mouse."
|
||||
"选择键盘、鼠标和增强选项。"
|
||||
|
||||
LangString str_msg_compat_title ${LANG_SIMPCHINESE} \
|
||||
" Vi / Vim behavior "
|
||||
"Vi / Vim 行为"
|
||||
LangString str_msg_compat_desc ${LANG_SIMPCHINESE} \
|
||||
"&Compatibility and enhancements"
|
||||
LangString str_msg_compat_vi ${LANG_SIMPCHINESE} \
|
||||
@@ -257,7 +257,7 @@ LangString str_msg_compat_all ${LANG_SIMPCHINESE} \
|
||||
"Vim with all enhancements (load vimrc_example.vim) (Default)"
|
||||
|
||||
LangString str_msg_keymap_title ${LANG_SIMPCHINESE} \
|
||||
" Mappings "
|
||||
"键盘映射"
|
||||
LangString str_msg_keymap_desc ${LANG_SIMPCHINESE} \
|
||||
"&Remap a few keys for Windows (Ctrl-V, Ctrl-C, Ctrl-A, Ctrl-S, Ctrl-F, etc)"
|
||||
LangString str_msg_keymap_default ${LANG_SIMPCHINESE} \
|
||||
@@ -266,7 +266,7 @@ LangString str_msg_keymap_windows ${LANG_SIMPCHINESE} \
|
||||
"Remap a few keys"
|
||||
|
||||
LangString str_msg_mouse_title ${LANG_SIMPCHINESE} \
|
||||
" Mouse "
|
||||
"鼠标"
|
||||
LangString str_msg_mouse_desc ${LANG_SIMPCHINESE} \
|
||||
"&Behavior of right and left buttons"
|
||||
LangString str_msg_mouse_default ${LANG_SIMPCHINESE} \
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
" This script tests a color scheme for some errors. Load the scheme and source
|
||||
" this script. e.g. :e colors/desert.vim | :so check_colors.vim
|
||||
" Will output possible errors.
|
||||
" This script tests a color scheme for some errors and lists potential errors.
|
||||
" Load the scheme and source this script, like this:
|
||||
" :edit colors/desert.vim | :so colors/tools/check_colors.vim
|
||||
|
||||
let s:save_cpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
func! Test_check_colors()
|
||||
let l:savedview = winsaveview()
|
||||
call cursor(1,1)
|
||||
let err={}
|
||||
|
||||
@@ -17,11 +18,69 @@ func! Test_check_colors()
|
||||
endif
|
||||
|
||||
" 2) Check for some well-defined highlighting groups
|
||||
" Some items, check several groups, e.g. Diff, Spell
|
||||
let hi_groups = ['ColorColumn', 'Diff', 'ErrorMsg', 'Folded',
|
||||
\ 'FoldColumn', 'IncSearch', 'LineNr', 'ModeMsg', 'MoreMsg', 'NonText',
|
||||
\ 'Normal', 'Pmenu', 'Todo', 'Search', 'Spell', 'StatusLine', 'TabLine',
|
||||
\ 'Title', 'Visual', 'WarningMsg', 'WildMenu']
|
||||
let hi_groups = [
|
||||
\ 'ColorColumn',
|
||||
\ 'Comment',
|
||||
\ 'Conceal',
|
||||
\ 'Constant',
|
||||
\ 'Cursor',
|
||||
\ 'CursorColumn',
|
||||
\ 'CursorLine',
|
||||
\ 'CursorLineNr',
|
||||
\ 'DiffAdd',
|
||||
\ 'DiffChange',
|
||||
\ 'DiffDelete',
|
||||
\ 'DiffText',
|
||||
\ 'Directory',
|
||||
\ 'EndOfBuffer',
|
||||
\ 'Error',
|
||||
\ 'ErrorMsg',
|
||||
\ 'FoldColumn',
|
||||
\ 'Folded',
|
||||
\ 'Identifier',
|
||||
\ 'Ignore',
|
||||
\ 'IncSearch',
|
||||
\ 'LineNr',
|
||||
\ 'MatchParen',
|
||||
\ 'ModeMsg',
|
||||
\ 'MoreMsg',
|
||||
\ 'NonText',
|
||||
\ 'Normal',
|
||||
\ 'Pmenu',
|
||||
\ 'PmenuSbar',
|
||||
\ 'PmenuSel',
|
||||
\ 'PmenuThumb',
|
||||
\ 'PreProc',
|
||||
\ 'Question',
|
||||
\ 'QuickFixLine',
|
||||
\ 'Search',
|
||||
\ 'SignColumn',
|
||||
\ 'Special',
|
||||
\ 'SpecialKey',
|
||||
\ 'SpellBad',
|
||||
\ 'SpellCap',
|
||||
\ 'SpellLocal',
|
||||
\ 'SpellRare',
|
||||
\ 'Statement',
|
||||
\ 'StatusLine',
|
||||
\ 'StatusLineNC',
|
||||
\ 'StatusLineTerm',
|
||||
\ 'StatusLineTermNC',
|
||||
\ 'TabLine',
|
||||
\ 'TabLineFill',
|
||||
\ 'TabLineSel',
|
||||
\ 'Title',
|
||||
\ 'Todo',
|
||||
\ 'ToolbarButton',
|
||||
\ 'ToolbarLine',
|
||||
\ 'Type',
|
||||
\ 'Underlined',
|
||||
\ 'VertSplit',
|
||||
\ 'Visual',
|
||||
\ 'VisualNOS',
|
||||
\ 'WarningMsg',
|
||||
\ 'WildMenu',
|
||||
\ ]
|
||||
let groups={}
|
||||
for group in hi_groups
|
||||
if search('\c@suppress\s\+'.group, 'cnW')
|
||||
@@ -30,6 +89,9 @@ func! Test_check_colors()
|
||||
let groups[group] = 'Ignoring '.group
|
||||
continue
|
||||
endif
|
||||
if search('hi\%[ghlight]!\= \+link \+'.group, 'cnW') " Linked group
|
||||
continue
|
||||
endif
|
||||
if !search('hi\%[ghlight] \+'.group, 'cnW')
|
||||
let groups[group] = 'No highlight definition for '.group
|
||||
continue
|
||||
@@ -43,12 +105,15 @@ func! Test_check_colors()
|
||||
let groups[group] = 'Missing bg terminal color for '.group
|
||||
continue
|
||||
endif
|
||||
call search('hi\%[ghlight] \+'.group, 'cW')
|
||||
" only check in the current line
|
||||
if !search('guifg', 'cnW', line('.')) || !search('ctermfg', 'cnW', line('.'))
|
||||
" do not check for background colors, they could be intentionally left out
|
||||
let groups[group] = 'Missing fg definition for '.group
|
||||
if !search('hi\%[ghlight] \+'.group. '.*guifg=', 'cnW')
|
||||
let groups[group] = 'Missing guifg definition for '.group
|
||||
continue
|
||||
endif
|
||||
if !search('hi\%[ghlight] \+'.group. '.*ctermfg=', 'cnW')
|
||||
let groups[group] = 'Missing ctermfg definition for '.group
|
||||
continue
|
||||
endif
|
||||
" do not check for background colors, they could be intentionally left out
|
||||
call cursor(1,1)
|
||||
endfor
|
||||
let err['highlight'] = groups
|
||||
@@ -91,15 +156,43 @@ func! Test_check_colors()
|
||||
endif
|
||||
|
||||
" 7) Does not define filetype specific groups like vimCommand, htmlTag,
|
||||
let hi_groups = ['vim', 'html', 'python', 'sh', 'ruby']
|
||||
let hi_groups = filter(getcompletion('', 'filetype'), { _,v -> v !~# '\%[no]syn\%(color\|load\|tax\)' })
|
||||
let ft_groups = []
|
||||
" let group = '\%('.join(hi_groups, '\|').'\)' " More efficient than a for loop, but less informative
|
||||
for group in hi_groups
|
||||
let pat='\Chi\%[ghlight]\s*\zs'.group.'\w\+\>'
|
||||
let pat='\Chi\%[ghlight]!\= *\%[link] \+\zs'.group.'\w\+\>\ze \+.' " Skips `hi clear`
|
||||
if search(pat, 'cW')
|
||||
call add(ft_groups, matchstr(getline('.'), pat))
|
||||
endif
|
||||
call cursor(1,1)
|
||||
endfor
|
||||
if !empty(ft_groups)
|
||||
let err['filetype'] = get(err, 'filetype', 'Should not define: ') . join(uniq(sort(ft_groups)))
|
||||
endif
|
||||
|
||||
" 8) Were debugPC and debugBreakpoint defined?
|
||||
for group in ['debugPC', 'debugBreakpoint']
|
||||
let pat='\Chi\%[ghlight]!\= *\%[link] \+\zs'.group.'\>'
|
||||
if search(pat, 'cnW')
|
||||
let line = search(pat, 'cW')
|
||||
let err['filetype'] = get(err, 'filetype', 'Should not define: ') . matchstr(getline('.'), pat). ' '
|
||||
endif
|
||||
call cursor(1,1)
|
||||
endfor
|
||||
|
||||
" 9) Normal should be defined first, not use reverse, fg or bg
|
||||
call cursor(1,1)
|
||||
let pat = 'hi\%[light] \+\%(link\|clear\)\@!\w\+\>'
|
||||
call search(pat, 'cW') " Look for the first hi def, skipping `hi link` and `hi clear`
|
||||
if getline('.') !~# '\m\<Normal\>'
|
||||
let err['highlight']['Normal'] = 'Should be defined first'
|
||||
elseif getline('.') =~# '\m\%(=\%(fg\|bg\)\)'
|
||||
let err['highlight']['Normal'] = "Should not use 'fg' or 'bg'"
|
||||
elseif getline('.') =~# '\m=\%(inv\|rev\)erse'
|
||||
let err['highlight']['Normal'] = 'Should not use reverse mode'
|
||||
endif
|
||||
|
||||
call winrestview(l:savedview)
|
||||
let g:err = err
|
||||
|
||||
" print Result
|
||||
@@ -107,11 +200,11 @@ func! Test_check_colors()
|
||||
endfu
|
||||
|
||||
fu! Result(err)
|
||||
let do_roups = 0
|
||||
let do_groups = 0
|
||||
echohl Title|echomsg "---------------"|echohl Normal
|
||||
for key in sort(keys(a:err))
|
||||
if key is# 'highlight'
|
||||
let do_groups = 1
|
||||
let do_groups = !empty(a:err[key])
|
||||
continue
|
||||
else
|
||||
if a:err[key] !~ 'OK'
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
" Vim Compiler File
|
||||
" Compiler: ocaml
|
||||
" Maintainer: See ftplugin/ocaml.vim (?)
|
||||
" Last Change: June 2013 by Marc Weber
|
||||
" Compiler: ocaml
|
||||
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
||||
" URL: https://github.com/rgrinberg/vim-ocaml
|
||||
" Last Change:
|
||||
" 2017 Nov 26 - Improved error format (Markus Mottl)
|
||||
" 2013 Aug 27 - Added a new OCaml error format (Markus Mottl)
|
||||
" 2013 Jun 30 - Initial version (Marc Weber)
|
||||
"
|
||||
" Marc Weber's comments:
|
||||
" Setting makeprg doesn't make sense, because there is ocamlc, ocamlopt,
|
||||
@@ -17,7 +21,6 @@
|
||||
"
|
||||
" So having it here makes people opt-in
|
||||
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
@@ -28,6 +31,7 @@ set cpo&vim
|
||||
|
||||
CompilerSet errorformat =
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d\ %.%#,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
|
||||
\%+EReference\ to\ unbound\ regexp\ name\ %m,
|
||||
\%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
|
||||
@@ -38,6 +42,12 @@ CompilerSet errorformat =
|
||||
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
|
||||
\%D%*\\a:\ Entering\ directory\ `%f',
|
||||
\%X%*\\a:\ Leaving\ directory\ `%f',
|
||||
\%D%*\\a[%*\\d]:\ Entering\ directory\ '%f',
|
||||
\%X%*\\a[%*\\d]:\ Leaving\ directory\ '%f',
|
||||
\%D%*\\a:\ Entering\ directory\ '%f',
|
||||
\%X%*\\a:\ Leaving\ directory\ '%f',
|
||||
\%DEntering\ directory\ '%f',
|
||||
\%XLeaving\ directory\ '%f',
|
||||
\%DMaking\ %*\\a\ in\ %f
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.1. Last change: 2019 May 05
|
||||
*autocmd.txt* For Vim version 8.1. Last change: 2019 Jun 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -407,8 +407,8 @@ BufFilePost After changing the name of the current buffer
|
||||
BufFilePre Before changing the name of the current buffer
|
||||
with the ":file" or ":saveas" command.
|
||||
*BufHidden*
|
||||
BufHidden Just after a buffer has become hidden. That
|
||||
is, when there are no longer windows that show
|
||||
BufHidden Just before a buffer becomes hidden. That is,
|
||||
when there are no longer windows that show
|
||||
the buffer, but the buffer is not unloaded or
|
||||
deleted. Not used for ":qa" or ":q" when
|
||||
exiting Vim.
|
||||
@@ -873,15 +873,32 @@ MenuPopup Just before showing the popup menu (under the
|
||||
*OptionSet*
|
||||
OptionSet After setting an option. The pattern is
|
||||
matched against the long option name.
|
||||
The |v:option_old| variable indicates the
|
||||
old option value, |v:option_new| variable
|
||||
indicates the newly set value, the
|
||||
|v:option_type| variable indicates whether
|
||||
it's global or local scoped and |<amatch>|
|
||||
indicates what option has been set.
|
||||
|<amatch>| indicates what option has been set.
|
||||
|
||||
Is not triggered on startup and for the 'key'
|
||||
option for obvious reasons.
|
||||
|v:option_type| indicates whether it's global
|
||||
or local scoped.
|
||||
|v:option_command| indicates what type of
|
||||
set/let command was used (follow the tag to
|
||||
see the table).
|
||||
|v:option_new| indicates the newly set value.
|
||||
|v:option_oldlocal| has the old local value.
|
||||
|v:option_oldglobal| has the old global value.
|
||||
|v:option_old| indicates the old option value.
|
||||
|
||||
|v:option_oldlocal| is only set when |:set|
|
||||
or |:setlocal| or a |modeline| was used to set
|
||||
the option. Similarly |v:option_oldglobal| is
|
||||
only set when |:set| or |:setglobal| was used.
|
||||
|
||||
Note that when setting a |global-local| string
|
||||
option with |:set|, then |v:option_old| is the
|
||||
old global value. However, for all other kinds
|
||||
of options (local string options, global-local
|
||||
number options, ...) it is the old local
|
||||
value.
|
||||
|
||||
OptionSet is not triggered on startup and for
|
||||
the 'key' option for obvious reasons.
|
||||
|
||||
Usage example: Check for the existence of the
|
||||
directory in the 'backupdir' and 'undodir'
|
||||
@@ -1365,7 +1382,7 @@ have changed autocommands, or when Vim has executed the wrong autocommands
|
||||
Note that the 'eventignore' option applies here too. Events listed in this
|
||||
option will not cause any commands to be executed.
|
||||
|
||||
*:do* *:doau* *:doautocmd* *E217*
|
||||
*:do* *:doau* *:doaut* *:doautocmd* *E217*
|
||||
:do[autocmd] [<nomodeline>] [group] {event} [fname]
|
||||
Apply the autocommands matching [fname] (default:
|
||||
current file name) for {event} to the current buffer.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*channel.txt* For Vim version 8.1. Last change: 2019 May 05
|
||||
*channel.txt* For Vim version 8.1. Last change: 2019 May 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -155,7 +155,10 @@ Use |ch_status()| to see if the channel could be opened.
|
||||
func MyCloseHandler(channel)
|
||||
< Vim will invoke callbacks that handle data before invoking
|
||||
close_cb, thus when this function is called no more data will
|
||||
be passed to the callbacks.
|
||||
be passed to the callbacks. However, if a callback causes Vim
|
||||
to check for messages, the close_cb may be invoked while still
|
||||
in the callback. The plugin must handle this somehow, it can
|
||||
be useful to know that no more data is coming.
|
||||
*channel-drop*
|
||||
"drop" Specifies when to drop messages:
|
||||
"auto" When there is no callback to handle a message.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*debugger.txt* For Vim version 8.1. Last change: 2019 May 05
|
||||
*debugger.txt* For Vim version 8.1. Last change: 2019 May 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Gordon Prieur
|
||||
@@ -87,7 +87,8 @@ This feature allows a debugger, or other external tool, to display dynamic
|
||||
information based on where the mouse is pointing. The purpose of this feature
|
||||
was to allow Sun's Visual WorkShop debugger to display expression evaluations.
|
||||
However, the feature was implemented in as general a manner as possible and
|
||||
could be used for displaying other information as well.
|
||||
could be used for displaying other information as well. The functionality is
|
||||
limited though, for advanced popups see |popup-window|.
|
||||
|
||||
The Balloon Evaluation has some settable parameters too. For Motif the font
|
||||
list and colors can be set via X resources (XmNballoonEvalFontList,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*diff.txt* For Vim version 8.1. Last change: 2019 May 04
|
||||
*diff.txt* For Vim version 8.1. Last change: 2019 Jun 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -185,7 +185,7 @@ hidden buffers. You can use ":hide" to close a window without unloading the
|
||||
buffer. If you don't want a buffer to remain used for the diff do ":set
|
||||
nodiff" before hiding it.
|
||||
|
||||
*:dif* *:diffupdate*
|
||||
*:dif* *:diff* *:diffupdate*
|
||||
:dif[fupdate][!] Update the diff highlighting and folds.
|
||||
|
||||
Vim attempts to keep the differences updated when you make changes to the
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/* vim:set ts=4 sw=4:
|
||||
* this program makes a tags file for vim_ref.txt
|
||||
*
|
||||
* Usage: doctags vim_ref.txt vim_win.txt ... >tags
|
||||
* This program makes a tags file for help text.
|
||||
*
|
||||
* Usage: doctags *.txt ... >tags
|
||||
*
|
||||
* A tag in this context is an identifier between stars, e.g. *c_files*
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.1. Last change: 2019 May 07
|
||||
*editing.txt* For Vim version 8.1. Last change: 2019 Jun 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -593,7 +593,7 @@ You can use the argument list with the following commands, and with the
|
||||
expression functions |argc()| and |argv()|. These all work on the argument
|
||||
list of the current window.
|
||||
|
||||
*:ar* *:args*
|
||||
*:ar* *:arg* *:args*
|
||||
:ar[gs] Print the argument list, with the current file in
|
||||
square brackets.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.1. Last change: 2019 May 09
|
||||
*eval.txt* For Vim version 8.1. Last change: 2019 Jul 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1190,8 +1190,9 @@ There must not be white space before or after the dot.
|
||||
|
||||
Examples: >
|
||||
:let dict = {"one": 1, 2: "two"}
|
||||
:echo dict.one
|
||||
:echo dict .2
|
||||
:echo dict.one " shows "1"
|
||||
:echo dict.2 " shows "two"
|
||||
:echo dict .2 " error because of space before the dot
|
||||
|
||||
Note that the dot is also used for String concatenation. To avoid confusion
|
||||
always put spaces around the dot for String concatenation.
|
||||
@@ -1503,8 +1504,10 @@ One local buffer variable is predefined:
|
||||
*b:changedtick* *changetick*
|
||||
b:changedtick The total number of changes to the current buffer. It is
|
||||
incremented for each change. An undo command is also a change
|
||||
in this case. This can be used to perform an action only when
|
||||
the buffer has changed. Example: >
|
||||
in this case. Resetting 'modified' when writing the buffer is
|
||||
also counted.
|
||||
This can be used to perform an action only when the buffer has
|
||||
changed. Example: >
|
||||
:if my_changedtick != b:changedtick
|
||||
: let my_changedtick = b:changedtick
|
||||
: call My_Update()
|
||||
@@ -1940,10 +1943,29 @@ v:option_new New value of the option. Valid while executing an |OptionSet|
|
||||
autocommand.
|
||||
*v:option_old*
|
||||
v:option_old Old value of the option. Valid while executing an |OptionSet|
|
||||
autocommand.
|
||||
autocommand. Depending on the command used for setting and the
|
||||
kind of option this is either the local old value or the
|
||||
global old value.
|
||||
*v:option_oldlocal*
|
||||
v:option_oldlocal
|
||||
Old local value of the option. Valid while executing an
|
||||
|OptionSet| autocommand.
|
||||
*v:option_oldglobal*
|
||||
v:option_oldglobal
|
||||
Old global value of the option. Valid while executing an
|
||||
|OptionSet| autocommand.
|
||||
*v:option_type*
|
||||
v:option_type Scope of the set command. Valid while executing an
|
||||
|OptionSet| autocommand. Can be either "global" or "local"
|
||||
*v:option_command*
|
||||
v:option_command
|
||||
Command used to set the option. Valid while executing an
|
||||
|OptionSet| autocommand.
|
||||
value option was set via ~
|
||||
"setlocal" |:setlocal| or ":let l:xxx"
|
||||
"setglobal" |:setglobal| or ":let g:xxx"
|
||||
"set" |:set| or |:let|
|
||||
"modeline" |modeline|
|
||||
*v:operator* *operator-variable*
|
||||
v:operator The last operator given in Normal mode. This is a single
|
||||
character except for commands starting with <g> or <z>,
|
||||
@@ -2086,12 +2108,12 @@ v:t_blob Value of |Blob| type. Read-only. See: |type()|
|
||||
*v:termresponse* *termresponse-variable*
|
||||
v:termresponse The escape sequence returned by the terminal for the |t_RV|
|
||||
termcap entry. It is set when Vim receives an escape sequence
|
||||
that starts with ESC [ or CSI and ends in a 'c', with only
|
||||
digits, ';' and '.' in between.
|
||||
that starts with ESC [ or CSI, then '>' or '?' and ends in a
|
||||
'c', with only digits and ';' in between.
|
||||
When this option is set, the TermResponse autocommand event is
|
||||
fired, so that you can react to the response from the
|
||||
terminal.
|
||||
The response from a new xterm is: "<Esc>[ Pp ; Pv ; Pc c". Pp
|
||||
The response from a new xterm is: "<Esc>[> Pp ; Pv ; Pc c". Pp
|
||||
is the terminal type: 0 for vt100 and 1 for vt220. Pv is the
|
||||
patch level (since this was introduced in patch 95, it's
|
||||
always 95 or bigger). Pc is always zero.
|
||||
@@ -2161,7 +2183,7 @@ v:val Value of the current item of a |List| or |Dictionary|. Only
|
||||
|
||||
*v:version* *version-variable*
|
||||
v:version Version number of Vim: Major version number times 100 plus
|
||||
minor version number. Version 5.0 is 500. Version 5.1 (5.01)
|
||||
minor version number. Version 5.0 is 500. Version 5.1
|
||||
is 501. Read-only. "version" also works, for backwards
|
||||
compatibility, unless |scriptversion| is 3 or higher.
|
||||
Use |has()| to check if a certain patch was included, e.g.: >
|
||||
@@ -2170,6 +2192,17 @@ v:version Version number of Vim: Major version number times 100 plus
|
||||
version 5.0 and 5.1 may have a patch 123, but these are
|
||||
completely different.
|
||||
|
||||
*v:versionlong* *versionlong-variable*
|
||||
v:versionlong Like v:version, but also including the patchlevel in the last
|
||||
four digits. Version 8.1 with patch 123 has value 8010123.
|
||||
This can be used like this: >
|
||||
if v:versionlong >= 8010123
|
||||
< However, if there are gaps in the list of patches included
|
||||
this will not work well. This can happen if a recent patch
|
||||
was included into an older version, e.g. for a security fix.
|
||||
Use the has() function to make sure the patch is actually
|
||||
included.
|
||||
|
||||
*v:vim_did_enter* *vim_did_enter-variable*
|
||||
v:vim_did_enter Zero until most of startup is done. It is set to one just
|
||||
before |VimEnter| autocommands are triggered.
|
||||
@@ -2239,8 +2272,10 @@ balloon_split({msg}) List split {msg} as used for a balloon
|
||||
browse({save}, {title}, {initdir}, {default})
|
||||
String put up a file requester
|
||||
browsedir({title}, {initdir}) String put up a directory requester
|
||||
bufadd({name}) Number add a buffer to the buffer list
|
||||
bufexists({expr}) Number |TRUE| if buffer {expr} exists
|
||||
buflisted({expr}) Number |TRUE| if buffer {expr} is listed
|
||||
bufload({expr}) Number load buffer {expr} if not loaded yet
|
||||
bufloaded({expr}) Number |TRUE| if buffer {expr} is loaded
|
||||
bufname({expr}) String Name of the buffer {expr}
|
||||
bufnr({expr} [, {create}]) Number Number of the buffer {expr}
|
||||
@@ -2323,6 +2358,7 @@ extend({expr1}, {expr2} [, {expr3}])
|
||||
exp({expr}) Float exponential of {expr}
|
||||
expand({expr} [, {nosuf} [, {list}]])
|
||||
any expand special keywords in {expr}
|
||||
expandcmd({expr}) String expand {expr} like with `:edit`
|
||||
feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer
|
||||
filereadable({file}) Number |TRUE| if {file} is a readable file
|
||||
filewritable({file}) Number |TRUE| if {file} is a writable file
|
||||
@@ -2498,6 +2534,24 @@ nr2char({expr} [, {utf8}]) String single char with ASCII/UTF8 value {expr}
|
||||
or({expr}, {expr}) Number bitwise OR
|
||||
pathshorten({expr}) String shorten directory names in a path
|
||||
perleval({expr}) any evaluate |Perl| expression
|
||||
popup_atcursor({what}, {options}) Number create popup window near the cursor
|
||||
popup_clear() none close all popup windows
|
||||
popup_close({id} [, {result}]) none close popup window {id}
|
||||
popup_create({what}, {options}) Number create a popup window
|
||||
popup_dialog({what}, {options}) Number create a popup window used as a dialog
|
||||
popup_filter_menu({id}, {key}) Number filter for a menu popup window
|
||||
popup_filter_yesno({id}, {key}) Number filter for a dialog popup window
|
||||
popup_getoptions({id}) Dict get options of popup window {id}
|
||||
popup_getpos({id}) Dict get position of popup window {id}
|
||||
popup_hide({id}) none hide popup menu {id}
|
||||
popup_menu({what}, {options}) Number create a popup window used as a menu
|
||||
popup_move({id}, {options}) none set position of popup window {id}
|
||||
popup_notification({what}, {options})
|
||||
Number create a notification popup window
|
||||
popup_show({id}) none unhide popup window {id}
|
||||
popup_setoptions({id}, {options})
|
||||
none set options for popup window {id}
|
||||
popup_settext({id}, {text}) none set the text of popup window {id}
|
||||
pow({x}, {y}) Float {x} to the power of {y}
|
||||
prevnonblank({lnum}) Number line nr of non-blank line <= {lnum}
|
||||
printf({fmt}, {expr1}...) String format text
|
||||
@@ -2619,6 +2673,12 @@ sin({expr}) Float sine of {expr}
|
||||
sinh({expr}) Float hyperbolic sine of {expr}
|
||||
sort({list} [, {func} [, {dict}]])
|
||||
List sort {list}, using {func} to compare
|
||||
sound_clear() none stop playing all sounds
|
||||
sound_playevent({name} [, {callback}])
|
||||
Number play an event sound
|
||||
sound_playfile({path} [, {callback}])
|
||||
Number play sound file {path}
|
||||
sound_stop({id}) none stop playing sound {id}
|
||||
soundfold({word}) String sound-fold {word}
|
||||
spellbadword() String badly spelled word at cursor
|
||||
spellsuggest({word} [, {max} [, {capital}]])
|
||||
@@ -2701,6 +2761,7 @@ test_alloc_fail({id}, {countdown}, {repeat})
|
||||
test_autochdir() none enable 'autochdir' during startup
|
||||
test_feedinput({string}) none add key sequence to input buffer
|
||||
test_garbagecollect_now() none free memory right now for testing
|
||||
test_garbagecollect_soon() none free memory soon for testing
|
||||
test_getvalue({string}) any get value of an internal variable
|
||||
test_ignore_error({expr}) none ignore a specific error
|
||||
test_null_blob() Blob null value for testing
|
||||
@@ -2738,6 +2799,8 @@ values({dict}) List values in {dict}
|
||||
virtcol({expr}) Number screen column of cursor or mark
|
||||
visualmode([expr]) String last visual mode used
|
||||
wildmenumode() Number whether 'wildmenu' mode is active
|
||||
win_execute({id}, {command} [, {silent}])
|
||||
String execute {command} in window {id}
|
||||
win_findbuf({bufnr}) List find windows containing {bufnr}
|
||||
win_getid([{win} [, {tab}]]) Number get window ID for {win} in {tab}
|
||||
win_gotoid({expr}) Number go to window with ID {expr}
|
||||
@@ -3089,6 +3152,18 @@ browsedir({title}, {initdir})
|
||||
When the "Cancel" button is hit, something went wrong, or
|
||||
browsing is not possible, an empty string is returned.
|
||||
|
||||
bufadd({name}) *bufadd()*
|
||||
Add a buffer to the buffer list with {name}.
|
||||
If a buffer for file {name} already exists, return that buffer
|
||||
number. Otherwise return the buffer number of the newly
|
||||
created buffer. When {name} is an empty string then a new
|
||||
buffer is always created.
|
||||
The buffer will not have' 'buflisted' set and not be loaded
|
||||
yet. To add some text to the buffer use this: >
|
||||
let bufnr = bufadd('someName')
|
||||
call bufload(bufnr)
|
||||
call setbufline(bufnr, 1, ['some', 'text'])
|
||||
|
||||
bufexists({expr}) *bufexists()*
|
||||
The result is a Number, which is |TRUE| if a buffer called
|
||||
{expr} exists.
|
||||
@@ -3118,6 +3193,15 @@ buflisted({expr}) *buflisted()*
|
||||
{expr} exists and is listed (has the 'buflisted' option set).
|
||||
The {expr} argument is used like with |bufexists()|.
|
||||
|
||||
bufload({expr}) *bufload()*
|
||||
Ensure the buffer {expr} is loaded. When the buffer name
|
||||
refers to an existing file then the file is read. Otherwise
|
||||
the buffer will be empty. If the buffer was already loaded
|
||||
then there is no change.
|
||||
If there is an existing swap file for the file of the buffer,
|
||||
there will be no dialog, the buffer will be loaded anyway.
|
||||
The {expr} argument is used like with |bufexists()|.
|
||||
|
||||
bufloaded({expr}) *bufloaded()*
|
||||
The result is a Number, which is |TRUE| if a buffer called
|
||||
{expr} exists and is loaded (shown in a window or hidden).
|
||||
@@ -3507,7 +3591,7 @@ chdir({dir}) *chdir()*
|
||||
|
||||
Example: >
|
||||
let save_dir = chdir(newdir)
|
||||
if save_dir
|
||||
if save_dir != ""
|
||||
" ... do some work
|
||||
call chdir(save_dir)
|
||||
endif
|
||||
@@ -4011,7 +4095,10 @@ execute({command} [, {silent}]) *execute()*
|
||||
To get a list of lines use |split()| on the result: >
|
||||
split(execute('args'), "\n")
|
||||
|
||||
< When used recursively the output of the recursive call is not
|
||||
< To execute a command in another window than the current one
|
||||
use `win_execute()`.
|
||||
|
||||
When used recursively the output of the recursive call is not
|
||||
included in the output of the higher level call.
|
||||
|
||||
exepath({expr}) *exepath()*
|
||||
@@ -4204,6 +4291,14 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()*
|
||||
See |glob()| for finding existing files. See |system()| for
|
||||
getting the raw output of an external command.
|
||||
|
||||
expandcmd({expr}) *expandcmd()*
|
||||
Expand special items in {expr} like what is done for an Ex
|
||||
command such as `:edit`. This expands special keywords, like
|
||||
with |expand()|, and environment variables, anywhere in
|
||||
{expr}. Returns the expanded string.
|
||||
Example: >
|
||||
:echo expandcmd('make %<.o')
|
||||
<
|
||||
extend({expr1}, {expr2} [, {expr3}]) *extend()*
|
||||
{expr1} and {expr2} must be both |Lists| or both
|
||||
|Dictionaries|.
|
||||
@@ -4671,6 +4766,8 @@ getbufinfo([{dict}])
|
||||
buffer-local variables.
|
||||
windows list of |window-ID|s that display this
|
||||
buffer
|
||||
popups list of popup |window-ID|s that
|
||||
display this buffer
|
||||
|
||||
Examples: >
|
||||
for buf in getbufinfo()
|
||||
@@ -5126,7 +5223,7 @@ getloclist({nr} [, {what}]) *getloclist()*
|
||||
In addition to the items supported by |getqflist()| in {what},
|
||||
the following item is supported by |getloclist()|:
|
||||
|
||||
filewinid id of the window used to display files
|
||||
filewinid id of the window used to display files
|
||||
from the location list. This field is
|
||||
applicable only when called from a
|
||||
location list window. See
|
||||
@@ -6349,7 +6446,7 @@ listener_add({callback} [, {buf}]) *listener_add()*
|
||||
was affected; this is a byte index, first
|
||||
character has a value of one.
|
||||
When lines are inserted the values are:
|
||||
lnum line below which the new line is added
|
||||
lnum line above which the new line is added
|
||||
end equal to "lnum"
|
||||
added number of lines inserted
|
||||
col 1
|
||||
@@ -6956,6 +7053,10 @@ perleval({expr}) *perleval()*
|
||||
< [1, 2, 3, 4]
|
||||
{only available when compiled with the |+perl| feature}
|
||||
|
||||
|
||||
popup_ functions are documented here: |popup-functions|.
|
||||
|
||||
|
||||
pow({x}, {y}) *pow()*
|
||||
Return the power of {x} to the exponent {y} as a |Float|.
|
||||
{x} and {y} must evaluate to a |Float| or a |Number|.
|
||||
@@ -7336,6 +7437,8 @@ prop_remove({props} [, {lnum} [, {lnum-end}]])
|
||||
all when TRUE remove all matching text properties,
|
||||
not just the first one
|
||||
A property matches when either "id" or "type" matches.
|
||||
If buffer "bufnr" does not exist you get an error message.
|
||||
If buffer "bufnr" is not loaded then nothing happens.
|
||||
|
||||
Returns the number of properties that were removed.
|
||||
|
||||
@@ -8068,10 +8171,10 @@ setbufline({expr}, {lnum}, {text}) *setbufline()*
|
||||
|
||||
{lnum} is used like with |setline()|.
|
||||
This works like |setline()| for the specified buffer.
|
||||
On success 0 is returned, on failure 1 is returned.
|
||||
|
||||
If {expr} is not a valid buffer or {lnum} is not valid, an
|
||||
error message is given.
|
||||
When {expr} is not a valid buffer, the buffer is not loaded or
|
||||
{lnum} is not valid then 1 is returned. On success 0 is
|
||||
returned.
|
||||
|
||||
setbufvar({expr}, {varname}, {val}) *setbufvar()*
|
||||
Set option or local variable {varname} in buffer {expr} to
|
||||
@@ -8392,6 +8495,8 @@ setreg({regname}, {value} [, {options}])
|
||||
settabvar({tabnr}, {varname}, {val}) *settabvar()*
|
||||
Set tab-local variable {varname} to {val} in tab page {tabnr}.
|
||||
|t:var|
|
||||
Note that autocommands are blocked, side effects may not be
|
||||
triggered, e.g. when setting 'filetype'.
|
||||
Note that the variable name without "t:" must be used.
|
||||
Tabs are numbered starting with one.
|
||||
This function is not available in the |sandbox|.
|
||||
@@ -8403,6 +8508,8 @@ settabwinvar({tabnr}, {winnr}, {varname}, {val}) *settabwinvar()*
|
||||
use |setwinvar()|.
|
||||
{winnr} can be the window number or the |window-ID|.
|
||||
When {winnr} is zero the current window is used.
|
||||
Note that autocommands are blocked, side effects may not be
|
||||
triggered, e.g. when setting 'filetype' or 'syntax'.
|
||||
This also works for a global or local buffer option, but it
|
||||
doesn't work for a global or local buffer variable.
|
||||
For a local buffer option the global value is unchanged.
|
||||
@@ -8585,7 +8692,7 @@ sign_getplaced([{expr} [, {dict}]]) *sign_getplaced()*
|
||||
priority sign priority
|
||||
|
||||
The returned signs in a buffer are ordered by their line
|
||||
number.
|
||||
number and priority.
|
||||
|
||||
Returns an empty list on failure or if there are no placed
|
||||
signs.
|
||||
@@ -8628,9 +8735,9 @@ sign_jump({id}, {group}, {expr})
|
||||
<
|
||||
*sign_place()*
|
||||
sign_place({id}, {group}, {name}, {expr} [, {dict}])
|
||||
Place the sign defined as {name} at line {lnum} in file {expr}
|
||||
and assign {id} and {group} to sign. This is similar to the
|
||||
|:sign-place| command.
|
||||
Place the sign defined as {name} at line {lnum} in file or
|
||||
buffer {expr} and assign {id} and {group} to sign. This is
|
||||
similar to the |:sign-place| command.
|
||||
|
||||
If the sign identifier {id} is zero, then a new identifier is
|
||||
allocated. Otherwise the specified number is used. {group} is
|
||||
@@ -8644,9 +8751,9 @@ sign_place({id}, {group}, {name}, {expr} [, {dict}])
|
||||
values, see |bufname()|.
|
||||
|
||||
The optional {dict} argument supports the following entries:
|
||||
lnum line number in the buffer {expr} where
|
||||
the sign is to be placed. For the
|
||||
accepted values, see |line()|.
|
||||
lnum line number in the file or buffer
|
||||
{expr} where the sign is to be placed.
|
||||
For the accepted values, see |line()|.
|
||||
priority priority of the sign. See
|
||||
|sign-priority| for more information.
|
||||
|
||||
@@ -8823,6 +8930,57 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
|
||||
return a:i1 - a:i2
|
||||
endfunc
|
||||
<
|
||||
sound_clear() *sound_clear()*
|
||||
Stop playing all sounds.
|
||||
{only available when compiled with the |+sound| feature}
|
||||
|
||||
*sound_playevent()*
|
||||
sound_playevent({name} [, {callback}])
|
||||
Play a sound identified by {name}. Which event names are
|
||||
supported depends on the system. Often the XDG sound names
|
||||
are used. On Ubuntu they may be found in
|
||||
/usr/share/sounds/freedesktop/stereo. Example: >
|
||||
call sound_playevent('bell')
|
||||
< On MS-Windows, {name} can be SystemAsterisk, SystemDefault,
|
||||
SystemExclamation, SystemExit, SystemHand, SystemQuestion,
|
||||
SystemStart, SystemWelcome, etc.
|
||||
|
||||
When {callback} is specified it is invoked when the sound is
|
||||
finished. The first argument is the sound ID, the second
|
||||
argument is the status:
|
||||
0 sound was played to the end
|
||||
1 sound was interrupted
|
||||
2 error occurred after sound started
|
||||
Example: >
|
||||
func Callback(id, status)
|
||||
echomsg "sound " .. a:id .. " finished with " .. a:status
|
||||
endfunc
|
||||
call sound_playevent('bell', 'Callback')
|
||||
|
||||
< MS-Windows: {callback} doesn't work for this function.
|
||||
|
||||
Returns the sound ID, which can be passed to `sound_stop()`.
|
||||
Returns zero if the sound could not be played.
|
||||
{only available when compiled with the |+sound| feature}
|
||||
|
||||
*sound_playfile()*
|
||||
sound_playfile({path} [, {callback}])
|
||||
Like `sound_playevent()` but play sound file {path}. {path}
|
||||
must be a full path. On Ubuntu you may find files to play
|
||||
with this command: >
|
||||
:!find /usr/share/sounds -type f | grep -v index.theme
|
||||
< {only available when compiled with the |+sound| feature}
|
||||
|
||||
|
||||
sound_stop({id}) *sound_stop()*
|
||||
Stop playing sound {id}. {id} must be previously returned by
|
||||
`sound_playevent()` or `sound_playfile()`.
|
||||
|
||||
On MS-Windows, this does not work for event sound started by
|
||||
`sound_playevent()`. To stop event sounds, use `sound_clear()`.
|
||||
|
||||
{only available when compiled with the |+sound| feature}
|
||||
|
||||
*soundfold()*
|
||||
soundfold({word})
|
||||
Return the sound-folded equivalent of {word}. Uses the first
|
||||
@@ -9520,359 +9678,7 @@ tempname() *tempname()* *temp-file-name*
|
||||
For MS-Windows forward slashes are used when the 'shellslash'
|
||||
option is set or when 'shellcmdflag' starts with '-'.
|
||||
|
||||
*term_dumpdiff()*
|
||||
term_dumpdiff({filename}, {filename} [, {options}])
|
||||
Open a new window displaying the difference between the two
|
||||
files. The files must have been created with
|
||||
|term_dumpwrite()|.
|
||||
Returns the buffer number or zero when the diff fails.
|
||||
Also see |terminal-diff|.
|
||||
NOTE: this does not work with double-width characters yet.
|
||||
|
||||
The top part of the buffer contains the contents of the first
|
||||
file, the bottom part of the buffer contains the contents of
|
||||
the second file. The middle part shows the differences.
|
||||
The parts are separated by a line of equals.
|
||||
|
||||
If the {options} argument is present, it must be a Dict with
|
||||
these possible members:
|
||||
"term_name" name to use for the buffer name, instead
|
||||
of the first file name.
|
||||
"term_rows" vertical size to use for the terminal,
|
||||
instead of using 'termwinsize'
|
||||
"term_cols" horizontal size to use for the terminal,
|
||||
instead of using 'termwinsize'
|
||||
"vertical" split the window vertically
|
||||
"curwin" use the current window, do not split the
|
||||
window; fails if the current buffer
|
||||
cannot be |abandon|ed
|
||||
"norestore" do not add the terminal window to a
|
||||
session file
|
||||
|
||||
Each character in the middle part indicates a difference. If
|
||||
there are multiple differences only the first in this list is
|
||||
used:
|
||||
X different character
|
||||
w different width
|
||||
f different foreground color
|
||||
b different background color
|
||||
a different attribute
|
||||
+ missing position in first file
|
||||
- missing position in second file
|
||||
|
||||
Using the "s" key the top and bottom parts are swapped. This
|
||||
makes it easy to spot a difference.
|
||||
|
||||
*term_dumpload()*
|
||||
term_dumpload({filename} [, {options}])
|
||||
Open a new window displaying the contents of {filename}
|
||||
The file must have been created with |term_dumpwrite()|.
|
||||
Returns the buffer number or zero when it fails.
|
||||
Also see |terminal-diff|.
|
||||
|
||||
For {options} see |term_dumpdiff()|.
|
||||
|
||||
*term_dumpwrite()*
|
||||
term_dumpwrite({buf}, {filename} [, {options}])
|
||||
Dump the contents of the terminal screen of {buf} in the file
|
||||
{filename}. This uses a format that can be used with
|
||||
|term_dumpload()| and |term_dumpdiff()|.
|
||||
If the job in the terminal already finished an error is given:
|
||||
*E958*
|
||||
If {filename} already exists an error is given: *E953*
|
||||
Also see |terminal-diff|.
|
||||
|
||||
{options} is a dictionary with these optional entries:
|
||||
"rows" maximum number of rows to dump
|
||||
"columns" maximum number of columns to dump
|
||||
|
||||
term_getaltscreen({buf}) *term_getaltscreen()*
|
||||
Returns 1 if the terminal of {buf} is using the alternate
|
||||
screen.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getansicolors({buf}) *term_getansicolors()*
|
||||
Get the ANSI color palette in use by terminal {buf}.
|
||||
Returns a List of length 16 where each element is a String
|
||||
representing a color in hexadecimal "#rrggbb" format.
|
||||
Also see |term_setansicolors()| and |g:terminal_ansi_colors|.
|
||||
If neither was used returns the default colors.
|
||||
|
||||
{buf} is used as with |term_getsize()|. If the buffer does not
|
||||
exist or is not a terminal window, an empty list is returned.
|
||||
{only available when compiled with the |+terminal| feature and
|
||||
with GUI enabled and/or the |+termguicolors| feature}
|
||||
|
||||
term_getattr({attr}, {what}) *term_getattr()*
|
||||
Given {attr}, a value returned by term_scrape() in the "attr"
|
||||
item, return whether {what} is on. {what} can be one of:
|
||||
bold
|
||||
italic
|
||||
underline
|
||||
strike
|
||||
reverse
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getcursor({buf}) *term_getcursor()*
|
||||
Get the cursor position of terminal {buf}. Returns a list with
|
||||
two numbers and a dictionary: [row, col, dict].
|
||||
|
||||
"row" and "col" are one based, the first screen cell is row
|
||||
1, column 1. This is the cursor position of the terminal
|
||||
itself, not of the Vim window.
|
||||
|
||||
"dict" can have these members:
|
||||
"visible" one when the cursor is visible, zero when it
|
||||
is hidden.
|
||||
"blink" one when the cursor is blinking, zero when it
|
||||
is not blinking.
|
||||
"shape" 1 for a block cursor, 2 for underline and 3
|
||||
for a vertical bar.
|
||||
"color" color of the cursor, e.g. "green"
|
||||
|
||||
{buf} must be the buffer number of a terminal window. If the
|
||||
buffer does not exist or is not a terminal window, an empty
|
||||
list is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getjob({buf}) *term_getjob()*
|
||||
Get the Job associated with terminal window {buf}.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
Returns |v:null| when there is no job.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getline({buf}, {row}) *term_getline()*
|
||||
Get a line of text from the terminal window of {buf}.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
|
||||
The first line has {row} one. When {row} is "." the cursor
|
||||
line is used. When {row} is invalid an empty string is
|
||||
returned.
|
||||
|
||||
To get attributes of each character use |term_scrape()|.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getscrolled({buf}) *term_getscrolled()*
|
||||
Return the number of lines that scrolled to above the top of
|
||||
terminal {buf}. This is the offset between the row number
|
||||
used for |term_getline()| and |getline()|, so that: >
|
||||
term_getline(buf, N)
|
||||
< is equal to: >
|
||||
getline(N + term_getscrolled(buf))
|
||||
< (if that line exists).
|
||||
|
||||
{buf} is used as with |term_getsize()|.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getsize({buf}) *term_getsize()*
|
||||
Get the size of terminal {buf}. Returns a list with two
|
||||
numbers: [rows, cols]. This is the size of the terminal, not
|
||||
the window containing the terminal.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. Use an
|
||||
empty string for the current buffer. If the buffer does not
|
||||
exist or is not a terminal window, an empty list is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getstatus({buf}) *term_getstatus()*
|
||||
Get the status of terminal {buf}. This returns a comma
|
||||
separated list of these items:
|
||||
running job is running
|
||||
finished job has finished
|
||||
normal in Terminal-Normal mode
|
||||
One of "running" or "finished" is always present.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. If the
|
||||
buffer does not exist or is not a terminal window, an empty
|
||||
string is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_gettitle({buf}) *term_gettitle()*
|
||||
Get the title of terminal {buf}. This is the title that the
|
||||
job in the terminal has set.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. If the
|
||||
buffer does not exist or is not a terminal window, an empty
|
||||
string is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_gettty({buf} [, {input}]) *term_gettty()*
|
||||
Get the name of the controlling terminal associated with
|
||||
terminal window {buf}. {buf} is used as with |term_getsize()|.
|
||||
|
||||
When {input} is omitted or 0, return the name for writing
|
||||
(stdout). When {input} is 1 return the name for reading
|
||||
(stdin). On UNIX, both return same name.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_list() *term_list()*
|
||||
Return a list with the buffer numbers of all buffers for
|
||||
terminal windows.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_scrape({buf}, {row}) *term_scrape()*
|
||||
Get the contents of {row} of terminal screen of {buf}.
|
||||
For {buf} see |term_getsize()|.
|
||||
|
||||
The first line has {row} one. When {row} is "." the cursor
|
||||
line is used. When {row} is invalid an empty string is
|
||||
returned.
|
||||
|
||||
Return a List containing a Dict for each screen cell:
|
||||
"chars" character(s) at the cell
|
||||
"fg" foreground color as #rrggbb
|
||||
"bg" background color as #rrggbb
|
||||
"attr" attributes of the cell, use |term_getattr()|
|
||||
to get the individual flags
|
||||
"width" cell width: 1 or 2
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_sendkeys({buf}, {keys}) *term_sendkeys()*
|
||||
Send keystrokes {keys} to terminal {buf}.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
|
||||
{keys} are translated as key sequences. For example, "\<c-x>"
|
||||
means the character CTRL-X.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_setansicolors({buf}, {colors}) *term_setansicolors()*
|
||||
Set the ANSI color palette used by terminal {buf}.
|
||||
{colors} must be a List of 16 valid color names or hexadecimal
|
||||
color codes, like those accepted by |highlight-guifg|.
|
||||
Also see |term_getansicolors()| and |g:terminal_ansi_colors|.
|
||||
|
||||
The colors normally are:
|
||||
0 black
|
||||
1 dark red
|
||||
2 dark green
|
||||
3 brown
|
||||
4 dark blue
|
||||
5 dark magenta
|
||||
6 dark cyan
|
||||
7 light grey
|
||||
8 dark grey
|
||||
9 red
|
||||
10 green
|
||||
11 yellow
|
||||
12 blue
|
||||
13 magenta
|
||||
14 cyan
|
||||
15 white
|
||||
|
||||
These colors are used in the GUI and in the terminal when
|
||||
'termguicolors' is set. When not using GUI colors (GUI mode
|
||||
or 'termguicolors'), the terminal window always uses the 16
|
||||
ANSI colors of the underlying terminal.
|
||||
{only available when compiled with the |+terminal| feature and
|
||||
with GUI enabled and/or the |+termguicolors| feature}
|
||||
|
||||
term_setkill({buf}, {how}) *term_setkill()*
|
||||
When exiting Vim or trying to close the terminal window in
|
||||
another way, {how} defines whether the job in the terminal can
|
||||
be stopped.
|
||||
When {how} is empty (the default), the job will not be
|
||||
stopped, trying to exit will result in |E947|.
|
||||
Otherwise, {how} specifies what signal to send to the job.
|
||||
See |job_stop()| for the values.
|
||||
|
||||
After sending the signal Vim will wait for up to a second to
|
||||
check that the job actually stopped.
|
||||
|
||||
term_setrestore({buf}, {command}) *term_setrestore()*
|
||||
Set the command to write in a session file to restore the job
|
||||
in this terminal. The line written in the session file is: >
|
||||
terminal ++curwin ++cols=%d ++rows=%d {command}
|
||||
< Make sure to escape the command properly.
|
||||
|
||||
Use an empty {command} to run 'shell'.
|
||||
Use "NONE" to not restore this window.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_setsize({buf}, {rows}, {cols}) *term_setsize()* *E955*
|
||||
Set the size of terminal {buf}. The size of the window
|
||||
containing the terminal will also be adjusted, if possible.
|
||||
If {rows} or {cols} is zero or negative, that dimension is not
|
||||
changed.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. Use an
|
||||
empty string for the current buffer. If the buffer does not
|
||||
exist or is not a terminal window, an error is given.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_start({cmd} [, {options}]) *term_start()*
|
||||
Open a terminal window and run {cmd} in it.
|
||||
|
||||
{cmd} can be a string or a List, like with |job_start()|. The
|
||||
string "NONE" can be used to open a terminal window without
|
||||
starting a job, the pty of the terminal can be used by a
|
||||
command like gdb.
|
||||
|
||||
Returns the buffer number of the terminal window. If {cmd}
|
||||
cannot be executed the window does open and shows an error
|
||||
message.
|
||||
If opening the window fails zero is returned.
|
||||
|
||||
{options} are similar to what is used for |job_start()|, see
|
||||
|job-options|. However, not all options can be used. These
|
||||
are supported:
|
||||
all timeout options
|
||||
"stoponexit", "cwd", "env"
|
||||
"callback", "out_cb", "err_cb", "exit_cb", "close_cb"
|
||||
"in_io", "in_top", "in_bot", "in_name", "in_buf"
|
||||
"out_io", "out_name", "out_buf", "out_modifiable", "out_msg"
|
||||
"err_io", "err_name", "err_buf", "err_modifiable", "err_msg"
|
||||
However, at least one of stdin, stdout or stderr must be
|
||||
connected to the terminal. When I/O is connected to the
|
||||
terminal then the callback function for that part is not used.
|
||||
|
||||
There are extra options:
|
||||
"term_name" name to use for the buffer name, instead
|
||||
of the command name.
|
||||
"term_rows" vertical size to use for the terminal,
|
||||
instead of using 'termwinsize'
|
||||
"term_cols" horizontal size to use for the terminal,
|
||||
instead of using 'termwinsize'
|
||||
"vertical" split the window vertically; note that
|
||||
other window position can be defined with
|
||||
command modifiers, such as |:belowright|.
|
||||
"curwin" use the current window, do not split the
|
||||
window; fails if the current buffer
|
||||
cannot be |abandon|ed
|
||||
"hidden" do not open a window
|
||||
"norestore" do not add the terminal window to a
|
||||
session file
|
||||
"term_kill" what to do when trying to close the
|
||||
terminal window, see |term_setkill()|
|
||||
"term_finish" What to do when the job is finished:
|
||||
"close": close any windows
|
||||
"open": open window if needed
|
||||
Note that "open" can be interruptive.
|
||||
See |term++close| and |term++open|.
|
||||
"term_opencmd" command to use for opening the window when
|
||||
"open" is used for "term_finish"; must
|
||||
have "%d" where the buffer number goes,
|
||||
e.g. "10split|buffer %d"; when not
|
||||
specified "botright sbuf %d" is used
|
||||
"eof_chars" Text to send after all buffer lines were
|
||||
written to the terminal. When not set
|
||||
CTRL-D is used on MS-Windows. For Python
|
||||
use CTRL-Z or "exit()". For a shell use
|
||||
"exit". A CR is always added.
|
||||
"ansi_colors" A list of 16 color names or hex codes
|
||||
defining the ANSI palette used in GUI
|
||||
color modes. See |g:terminal_ansi_colors|.
|
||||
"tty_type" (MS-Windows only): Specify which pty to
|
||||
use. See 'termwintype' for the values.
|
||||
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_wait({buf} [, {time}]) *term_wait()*
|
||||
Wait for pending updates of {buf} to be handled.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
{time} is how long to wait for updates to arrive in msec. If
|
||||
not set then 10 msec will be used.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
term_ functions are documented here: |terminal-function-details|
|
||||
|
||||
test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()*
|
||||
This is for testing: If the memory allocation with {id} is
|
||||
@@ -9895,6 +9701,10 @@ test_garbagecollect_now() *test_garbagecollect_now()*
|
||||
internally, and |v:testing| must have been set before calling
|
||||
any function.
|
||||
|
||||
test_garbagecollect_soon() *test_garbagecollect_soon()*
|
||||
Set the flag to call the garbagecollector as if in the main
|
||||
loop. Only to be used in tests.
|
||||
|
||||
test_getvalue({name}) *test_getvalue()*
|
||||
Get the value of an internal variable. These values for
|
||||
{name} are supported:
|
||||
@@ -9958,6 +9768,8 @@ test_override({name}, {val}) *test_override()*
|
||||
fallback to the old engine
|
||||
no_query_mouse do not query the mouse position for "dec"
|
||||
terminals
|
||||
no_wait_return set the "no_wait_return" flag. Not restored
|
||||
with "ALL".
|
||||
ALL clear all overrides ({val} is not used)
|
||||
|
||||
"starting" is to be used when a test should behave like
|
||||
@@ -10074,6 +9886,7 @@ timer_start({time}, {callback} [, {options}])
|
||||
< This will invoke MyHandler() three times at 500 msec
|
||||
intervals.
|
||||
|
||||
Not available in the |sandbox|.
|
||||
{only available when compiled with the |+timers| feature}
|
||||
|
||||
timer_stop({timer}) *timer_stop()*
|
||||
@@ -10306,6 +10119,18 @@ wildmenumode() *wildmenumode()*
|
||||
<
|
||||
(Note, this needs the 'wildcharm' option set appropriately).
|
||||
|
||||
win_execute({id}, {command} [, {silent}]) *win_execute()*
|
||||
Like `execute()` but in the context of window {id}.
|
||||
The window will temporarily be made the current window,
|
||||
without triggering autocommands. When executing {command}
|
||||
autocommands will be triggered, this may have unexpected side
|
||||
effects. Use |:noautocmd| if needed.
|
||||
Example: >
|
||||
call win_execute(winid, 'set syntax=python')
|
||||
< Doing the same with `setwinvar()` would not trigger
|
||||
autocommands and not actually show syntax highlighting.
|
||||
*E994*
|
||||
Not all commands are allowed in popup windows.
|
||||
|
||||
win_findbuf({bufnr}) *win_findbuf()*
|
||||
Returns a list with |window-ID|s for windows that contain
|
||||
@@ -10724,6 +10549,7 @@ scrollbind Compiled with 'scrollbind' support. (always true)
|
||||
showcmd Compiled with 'showcmd' support.
|
||||
signs Compiled with |:sign| support.
|
||||
smartindent Compiled with 'smartindent' support.
|
||||
sound Compiled with sound support, e.g. `sound_playevent()`
|
||||
spell Compiled with spell checking support |spell|.
|
||||
startuptime Compiled with |--startuptime| support.
|
||||
statusline Compiled with support for 'statusline', 'rulerformat'
|
||||
@@ -11019,7 +10845,7 @@ It is allowed to define another function inside a function body.
|
||||
You can provide default values for positional named arguments. This makes
|
||||
them optional for function calls. When a positional argument is not
|
||||
specified at a call, the default expression is used to initialize it.
|
||||
This only works for functions declared with |function|, not for lambda
|
||||
This only works for functions declared with `:function`, not for lambda
|
||||
expressions |expr-lambda|.
|
||||
|
||||
Example: >
|
||||
@@ -11031,7 +10857,7 @@ Example: >
|
||||
|
||||
The argument default expressions are evaluated at the time of the function
|
||||
call, not definition. Thus it is possible to use an expression which is
|
||||
invalid the moment the function is defined. The expressions are are also only
|
||||
invalid the moment the function is defined. The expressions are also only
|
||||
evaluated when arguments are not specified during a call.
|
||||
|
||||
You can pass |v:none| to use the default expression. Note that this means you
|
||||
@@ -11098,7 +10924,7 @@ This function can then be called with: >
|
||||
*:cal* *:call* *E107* *E117*
|
||||
:[range]cal[l] {name}([arguments])
|
||||
Call a function. The name of the function and its arguments
|
||||
are as specified with |:function|. Up to 20 arguments can be
|
||||
are as specified with `:function`. Up to 20 arguments can be
|
||||
used. The returned value is discarded.
|
||||
Without a range and for functions that accept a range, the
|
||||
function is called once. When a range is given the cursor is
|
||||
@@ -11152,9 +10978,9 @@ Using an autocommand ~
|
||||
This is introduced in the user manual, section |41.14|.
|
||||
|
||||
The autocommand is useful if you have a plugin that is a long Vim script file.
|
||||
You can define the autocommand and quickly quit the script with |:finish|.
|
||||
You can define the autocommand and quickly quit the script with `:finish`.
|
||||
That makes Vim startup faster. The autocommand should then load the same file
|
||||
again, setting a variable to skip the |:finish| command.
|
||||
again, setting a variable to skip the `:finish` command.
|
||||
|
||||
Use the FuncUndefined autocommand event with a pattern that matches the
|
||||
function(s) to be defined. Example: >
|
||||
@@ -11416,6 +11242,55 @@ This does NOT work: >
|
||||
Like above, but append/add/subtract the value for each
|
||||
|List| item.
|
||||
|
||||
*:let=<<* *:let-heredoc* *E990* *E991*
|
||||
:let {var-name} =<< [trim] {marker}
|
||||
text...
|
||||
text...
|
||||
{marker}
|
||||
Set internal variable {var-name} to a List containing
|
||||
the lines of text bounded by the string {marker}.
|
||||
{marker} must not contain white space.
|
||||
The last line should end only with the {marker} string
|
||||
without any other character. Watch out for white
|
||||
space after {marker}!
|
||||
If {marker} is not supplied, then "." is used as the
|
||||
default marker.
|
||||
|
||||
Without "trim" any white space characters in the lines
|
||||
of text are preserved. If "trim" is specified before
|
||||
{marker}, then indentation is stripped so you can do: >
|
||||
let text =<< trim END
|
||||
if ok
|
||||
echo 'done'
|
||||
endif
|
||||
END
|
||||
< Results in: ["if ok", " echo 'done'", "endif"]
|
||||
The marker must line up with "let" and the indentation
|
||||
of the first line is removed from all the text lines.
|
||||
Specifically: all the leading indentation exactly
|
||||
matching the leading indentation of the first
|
||||
non-empty text line is stripped from the input lines.
|
||||
All leading indentation exactly matching the leading
|
||||
indentation before `let` is stripped from the line
|
||||
containing {marker}. Note that the difference between
|
||||
space and tab matters here.
|
||||
|
||||
If {var-name} didn't exist yet, it is created.
|
||||
Cannot be followed by another command, but can be
|
||||
followed by a comment.
|
||||
|
||||
Examples: >
|
||||
let var1 =<< END
|
||||
Sample text 1
|
||||
Sample text 2
|
||||
Sample text 3
|
||||
END
|
||||
|
||||
let data =<< trim DATA
|
||||
1 2 3 4
|
||||
5 6 7 8
|
||||
DATA
|
||||
<
|
||||
*E121*
|
||||
:let {var-name} .. List the value of variable {var-name}. Multiple
|
||||
variable names may be given. Special names recognized
|
||||
@@ -11434,7 +11309,6 @@ This does NOT work: >
|
||||
# Number
|
||||
* Funcref
|
||||
|
||||
|
||||
:unl[et][!] {name} ... *:unlet* *:unl* *E108* *E795*
|
||||
Remove the internal variable {name}. Several variable
|
||||
names can be given, they are all removed. The name
|
||||
@@ -11459,7 +11333,33 @@ This does NOT work: >
|
||||
No error message is given for a non-existing
|
||||
variable, also without !.
|
||||
If the system does not support deleting an environment
|
||||
variable, it is made emtpy.
|
||||
variable, it is made empty.
|
||||
|
||||
*:cons* *:const*
|
||||
:cons[t] {var-name} = {expr1}
|
||||
:cons[t] [{name1}, {name2}, ...] = {expr1}
|
||||
:cons[t] [{name}, ..., ; {lastname}] = {expr1}
|
||||
:cons[t] {var-name} =<< [trim] {marker}
|
||||
text...
|
||||
text...
|
||||
{marker}
|
||||
Similar to |:let|, but additionally lock the variable
|
||||
after setting the value. This is the same as locking
|
||||
the variable with |:lockvar| just after |:let|, thus: >
|
||||
:const x = 1
|
||||
< is equivalent to: >
|
||||
:let x = 1
|
||||
:lockvar 1 x
|
||||
< This is useful if you want to make sure the variable
|
||||
is not modified.
|
||||
*E995*
|
||||
|:const| does not allow to for changing a variable: >
|
||||
:let x = 1
|
||||
:const x = 2 " Error!
|
||||
< *E996*
|
||||
Note that environment variables, option values and
|
||||
register values cannot be used here, since they cannot
|
||||
be locked.
|
||||
|
||||
:lockv[ar][!] [depth] {name} ... *:lockvar* *:lockv*
|
||||
Lock the internal variable {name}. Locking means that
|
||||
@@ -11512,7 +11412,7 @@ This does NOT work: >
|
||||
opposite of |:lockvar|.
|
||||
|
||||
|
||||
:if {expr1} *:if* *:endif* *:en* *E171* *E579* *E580*
|
||||
:if {expr1} *:if* *:end* *:endif* *:en* *E171* *E579* *E580*
|
||||
:en[dif] Execute the commands until the next matching ":else"
|
||||
or ":endif" if {expr1} evaluates to non-zero.
|
||||
|
||||
@@ -12954,19 +12854,22 @@ Sometimes old syntax of functionality gets in the way of making Vim better.
|
||||
When support is taken away this will break older Vim scripts. To make this
|
||||
explicit the |:scriptversion| command can be used. When a Vim script is not
|
||||
compatible with older versions of Vim this will give an explicit error,
|
||||
instead of failing in mysterious ways. >
|
||||
instead of failing in mysterious ways.
|
||||
|
||||
*scriptversion-1* >
|
||||
:scriptversion 1
|
||||
< This is the original Vim script, same as not using a |:scriptversion|
|
||||
command. Can be used to go back to old syntax for a range of lines.
|
||||
Test for support with: >
|
||||
has('vimscript-1')
|
||||
|
||||
< *scriptversion-2* >
|
||||
:scriptversion 2
|
||||
< String concatenation with "." is not supported, use ".." instead.
|
||||
< String concatenation with "." is not supported, use ".." instead.
|
||||
This avoids the ambiguity using "." for Dict member access and
|
||||
floating point numbers. Now ".5" means the number 0.5.
|
||||
>
|
||||
|
||||
*scriptversion-3* >
|
||||
:scriptversion 3
|
||||
< All |vim-variable|s must be prefixed by "v:". E.g. "version" doesn't
|
||||
work as |v:version| anymore, it can be used as a normal variable.
|
||||
@@ -12995,8 +12898,16 @@ missing: >
|
||||
: echo "You will _never_ see this message"
|
||||
:endif
|
||||
|
||||
To execute a command only when the |+eval| feature is disabled requires a trick,
|
||||
as this example shows: >
|
||||
To execute a command only when the |+eval| feature is disabled can be done in
|
||||
two ways. The simplest is to exit the script (or Vim) prematurely: >
|
||||
if 1
|
||||
echo "commands executed with +eval"
|
||||
finish
|
||||
endif
|
||||
args " command executed without +eval
|
||||
|
||||
If you do not want to abort loading the script you can use a trick, as this
|
||||
example shows: >
|
||||
|
||||
silent! while 0
|
||||
set history=111
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*fold.txt* For Vim version 8.1. Last change: 2019 May 05
|
||||
*fold.txt* For Vim version 8.1. Last change: 2019 Jun 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -441,7 +441,7 @@ zk Move upwards to the end of the previous fold. A closed fold
|
||||
|
||||
EXECUTING COMMANDS ON FOLDS ~
|
||||
|
||||
:[range]foldd[oopen] {cmd} *:foldd* *:folddoopen*
|
||||
:[range]foldd[oopen] {cmd} *:foldd* *:folddo* *:folddoopen*
|
||||
Execute {cmd} on all lines that are not in a closed fold.
|
||||
When [range] is given, only these lines are used.
|
||||
Each time {cmd} is executed the cursor is positioned on the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*gui.txt* For Vim version 8.1. Last change: 2019 May 05
|
||||
*gui.txt* For Vim version 8.1. Last change: 2019 May 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1046,7 +1046,7 @@ GUIFONT *gui-font*
|
||||
'guifont' is the option that tells Vim what font to use. In its simplest form
|
||||
the value is just one font name. It can also be a list of font names
|
||||
separated with commas. The first valid font is used. When no valid font can
|
||||
be found you will get an error message.
|
||||
be found you will get an error message.
|
||||
|
||||
On systems where 'guifontset' is supported (X11) and 'guifontset' is not
|
||||
empty, then 'guifont' is not used. See |xfontset|.
|
||||
@@ -1112,10 +1112,9 @@ For the Win32 GUI *E244* *E245*
|
||||
cXX - character set XX. Valid charsets are: ANSI, ARABIC, BALTIC,
|
||||
CHINESEBIG5, DEFAULT, EASTEUROPE, GB2312, GREEK, HANGEUL,
|
||||
HEBREW, JOHAB, MAC, OEM, RUSSIAN, SHIFTJIS, SYMBOL, THAI,
|
||||
TURKISH, VIETNAMESE ANSI and BALTIC. Normally you would use
|
||||
"cDEFAULT".
|
||||
TURKISH and VIETNAMESE. Normally you would use "cDEFAULT".
|
||||
qXX - quality XX. Valid quality names are: PROOF, DRAFT, ANTIALIASED,
|
||||
NONANTIALIASED, CLEARTYPE, DEFAULT. Normally you would use
|
||||
NONANTIALIASED, CLEARTYPE and DEFAULT. Normally you would use
|
||||
"qDEFAULT".
|
||||
Some quality values are not supported in legacy OSs.
|
||||
- A '_' can be used in the place of a space, so you don't need to use
|
||||
@@ -1139,30 +1138,28 @@ substitution.
|
||||
GUIFONTWIDE *gui-fontwide*
|
||||
|
||||
When not empty, 'guifontwide' specifies a comma-separated list of fonts to be
|
||||
used for double-width characters. The first font that can be loaded is
|
||||
used.
|
||||
used for double-width characters. The first font that can be loaded is used.
|
||||
|
||||
Note: The size of these fonts must be exactly twice as wide as the one
|
||||
specified with 'guifont' and the same height. If there is a mismatch then
|
||||
the text will not be drawn correctly.
|
||||
specified with 'guifont' and the same height. If there is a mismatch then the
|
||||
text will not be drawn correctly.
|
||||
|
||||
All GUI versions but GTK+:
|
||||
|
||||
'guifontwide' is only used when 'encoding' is set to "utf-8" and
|
||||
'guifontset' is empty or invalid.
|
||||
When 'guifont' is set and a valid font is found in it and
|
||||
'guifontwide' is empty Vim will attempt to find a matching
|
||||
double-width font and set 'guifontwide' to it.
|
||||
'guifontwide' is only used when 'encoding' is set to "utf-8" and 'guifontset'
|
||||
is empty or invalid.
|
||||
When 'guifont' is set and a valid font is found in it and 'guifontwide' is
|
||||
empty Vim will attempt to find a matching double-width font and set
|
||||
'guifontwide' to it.
|
||||
|
||||
GTK+ GUI only: *guifontwide_gtk*
|
||||
|
||||
If set and valid, 'guifontwide' is always used for double width
|
||||
characters, even if 'encoding' is not set to "utf-8".
|
||||
If set and valid, 'guifontwide' is always used for double width characters,
|
||||
even if 'encoding' is not set to "utf-8".
|
||||
Vim does not attempt to find an appropriate value for 'guifontwide'
|
||||
automatically. If 'guifontwide' is empty Pango/Xft will choose the
|
||||
font for characters not available in 'guifont'. Thus you do not need
|
||||
to set 'guifontwide' at all unless you want to override the choice
|
||||
made by Pango/Xft.
|
||||
automatically. If 'guifontwide' is empty Pango/Xft will choose the font for
|
||||
characters not available in 'guifont'. Thus you do not need to set
|
||||
'guifontwide' at all unless you want to override the choice made by Pango/Xft.
|
||||
|
||||
Windows +multibyte only: *guifontwide_win_mbyte*
|
||||
|
||||
@@ -1181,7 +1178,8 @@ This section describes other features which are related to the GUI.
|
||||
get "<Modifiers-Key>".
|
||||
|
||||
- In the GUI, the modifiers SHIFT, CTRL, and ALT (or META) may be used within
|
||||
mappings of special keys and mouse events. E.g.: :map <M-LeftDrag> <LeftDrag>
|
||||
mappings of special keys and mouse events.
|
||||
E.g.: :map <M-LeftDrag> <LeftDrag>
|
||||
|
||||
- In the GUI, several normal keys may have modifiers in mappings etc, these
|
||||
are <Space>, <Tab>, <NL>, <CR>, <Esc>.
|
||||
@@ -1218,8 +1216,8 @@ http://www.lexikan.com/mincho.htm
|
||||
For the X11 GUI the external commands are executed inside the gvim window.
|
||||
See |gui-pty|.
|
||||
|
||||
WARNING: Executing an external command from the X11 GUI will not always
|
||||
work. "normal" commands like "ls", "grep" and "make" mostly work fine.
|
||||
WARNING: Executing an external command from the X11 GUI will not always work.
|
||||
"normal" commands like "ls", "grep" and "make" mostly work fine.
|
||||
Commands that require an intelligent terminal like "less" and "ispell" won't
|
||||
work. Some may even hang and need to be killed from another terminal. So be
|
||||
careful!
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*help.txt* For Vim version 8.1. Last change: 2019 Jan 17
|
||||
*help.txt* For Vim version 8.1. Last change: 2019 May 12
|
||||
|
||||
VIM - main help file
|
||||
k
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.1. Last change: 2019 May 09
|
||||
*index.txt* For Vim version 8.1. Last change: 2019 Jun 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1241,6 +1241,7 @@ tag command action ~
|
||||
|:compiler| :comp[iler] do settings for a specific compiler
|
||||
|:continue| :con[tinue] go back to :while
|
||||
|:confirm| :conf[irm] prompt user when confirmation required
|
||||
|:const| :cons[t] create a variable as a constant
|
||||
|:copen| :cope[n] open quickfix window
|
||||
|:cprevious| :cp[revious] go to previous error
|
||||
|:cpfile| :cpf[ile] go to last error in previous file
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*intro.txt* For Vim version 8.1. Last change: 2019 May 07
|
||||
*intro.txt* For Vim version 8.1. Last change: 2019 Jun 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -65,14 +65,21 @@ contain links to the most recent version of Vim. The FAQ is a list of
|
||||
Frequently Asked Questions. Read this if you have problems.
|
||||
|
||||
Vim home page: https://www.vim.org/
|
||||
Vim FAQ: https://vimhelp.appspot.com/vim_faq.txt.html
|
||||
Vim FAQ: https://vimhelp.org/vim_faq.txt.html
|
||||
Downloading: https://www.vim.org/download.php
|
||||
|
||||
|
||||
Asking questions, finding answers: https://vi.stackexchange.com/
|
||||
"Vi and Vim Stack Exchange is a question and answer site for people using the
|
||||
vi and Vim families of text editors"
|
||||
|
||||
|
||||
Usenet News group where Vim is discussed: *news* *usenet*
|
||||
comp.editors
|
||||
This group is also for other editors. If you write about Vim, don't forget to
|
||||
mention that.
|
||||
You can access it here:
|
||||
https://groups.google.com/forum/#!topic/comp.editors
|
||||
|
||||
*mail-list* *maillist*
|
||||
There are several mailing lists for Vim:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 8.1. Last change: 2019 May 05
|
||||
*map.txt* For Vim version 8.1. Last change: 2019 Jun 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -53,7 +53,7 @@ modes.
|
||||
:om[ap] {lhs} {rhs} |mapmode-o| *:om* *:omap*
|
||||
:map! {lhs} {rhs} |mapmode-ic| *:map!*
|
||||
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
|
||||
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lmap*
|
||||
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lma* *:lmap*
|
||||
:cm[ap] {lhs} {rhs} |mapmode-c| *:cm* *:cmap*
|
||||
:tma[p] {lhs} {rhs} |mapmode-t| *:tma* *:tmap*
|
||||
Map the key sequence {lhs} to {rhs} for the modes
|
||||
@@ -66,12 +66,12 @@ modes.
|
||||
:nn[oremap] {lhs} {rhs} |mapmode-n| *:nn* *:nnoremap*
|
||||
:vn[oremap] {lhs} {rhs} |mapmode-v| *:vn* *:vnoremap*
|
||||
:xn[oremap] {lhs} {rhs} |mapmode-x| *:xn* *:xnoremap*
|
||||
:snor[emap] {lhs} {rhs} |mapmode-s| *:snor* *:snoremap*
|
||||
:snor[emap] {lhs} {rhs} |mapmode-s| *:snor* *:snore* *:snoremap*
|
||||
:ono[remap] {lhs} {rhs} |mapmode-o| *:ono* *:onoremap*
|
||||
:no[remap]! {lhs} {rhs} |mapmode-ic| *:no!* *:noremap!*
|
||||
:ino[remap] {lhs} {rhs} |mapmode-i| *:ino* *:inoremap*
|
||||
:ino[remap] {lhs} {rhs} |mapmode-i| *:ino* *:inor* *:inoremap*
|
||||
:ln[oremap] {lhs} {rhs} |mapmode-l| *:ln* *:lnoremap*
|
||||
:cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap*
|
||||
:cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnor* *:cnoremap*
|
||||
:tno[remap] {lhs} {rhs} |mapmode-t| *:tno* *:tnoremap*
|
||||
Map the key sequence {lhs} to {rhs} for the modes
|
||||
where the map command applies. Disallow mapping of
|
||||
@@ -88,7 +88,7 @@ modes.
|
||||
:unm[ap]! {lhs} |mapmode-ic| *:unm!* *:unmap!*
|
||||
:iu[nmap] {lhs} |mapmode-i| *:iu* *:iunmap*
|
||||
:lu[nmap] {lhs} |mapmode-l| *:lu* *:lunmap*
|
||||
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cunmap*
|
||||
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cun* *:cunmap*
|
||||
:tunma[p] {lhs} |mapmode-t| *:tunma* *:tunmap*
|
||||
Remove the mapping of {lhs} for the modes where the
|
||||
map command applies. The mapping may remain defined
|
||||
@@ -1016,7 +1016,7 @@ See |:verbose-cmd| for more information.
|
||||
:norea[bbrev] [<expr>] [<buffer>] [lhs] [rhs]
|
||||
Same as ":ab", but no remapping for this {rhs}.
|
||||
|
||||
*:ca* *:cabbrev*
|
||||
*:ca* *:cab* *:cabbrev*
|
||||
:ca[bbrev] [<expr>] [<buffer>] [lhs] [rhs]
|
||||
Same as ":ab", but for Command-line mode only.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*message.txt* For Vim version 8.1. Last change: 2019 May 07
|
||||
*message.txt* For Vim version 8.1. Last change: 2019 May 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -247,6 +247,9 @@ format of the file. The file will not be marked unmodified. If you care
|
||||
about the loss of information, set the 'fileencoding' option to another value
|
||||
that can handle the characters in the buffer and write again. If you don't
|
||||
care, you can abandon the buffer or reset the 'modified' option.
|
||||
If there is a backup file, when 'writebackup' or 'backup' is set, it will not
|
||||
be deleted, so you can move it back into place if you want to discard the
|
||||
changes.
|
||||
|
||||
*E302* >
|
||||
Could not rename swap file
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*motion.txt* For Vim version 8.1. Last change: 2019 May 07
|
||||
*motion.txt* For Vim version 8.1. Last change: 2019 Jun 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -53,6 +53,7 @@ or change text. The following operators are available:
|
||||
|!| ! filter through an external program
|
||||
|=| = filter through 'equalprg' or C-indenting if empty
|
||||
|gq| gq text formatting
|
||||
|gw| gw text formatting with no cursor movement
|
||||
|g?| g? ROT13 encoding
|
||||
|>| > shift right
|
||||
|<| < shift left
|
||||
@@ -943,7 +944,7 @@ These commands are not marks themselves, but jump to a mark:
|
||||
[` [count] times to lowercase mark before the cursor.
|
||||
|
||||
|
||||
:loc[kmarks] {command} *:loc* *:lockmarks*
|
||||
:loc[kmarks] {command} *:loc* *:lock* *:lockmarks*
|
||||
Execute {command} without adjusting marks. This is
|
||||
useful when changing text in a way that the line count
|
||||
will be the same when the change has completed.
|
||||
@@ -969,7 +970,7 @@ These commands are not marks themselves, but jump to a mark:
|
||||
- folds
|
||||
- diffs
|
||||
|
||||
:kee[pmarks] {command} *:kee* *:keepmarks*
|
||||
:kee[pmarks] {command} *:kee* *:keep* *:keepmarks*
|
||||
Currently only has effect for the filter command
|
||||
|:range!|:
|
||||
- When the number of lines after filtering is equal to
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.1. Last change: 2019 May 08
|
||||
*options.txt* For Vim version 8.1. Last change: 2019 Jun 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -578,14 +578,17 @@ backslash in front of the ':' will be removed. Example:
|
||||
/* vi:set dir=c\:\tmp: */ ~
|
||||
This sets the 'dir' option to "c:\tmp". Only a single backslash before the
|
||||
':' is removed. Thus to include "\:" you have to specify "\\:".
|
||||
|
||||
*E992*
|
||||
No other commands than "set" are supported, for security reasons (somebody
|
||||
might create a Trojan horse text file with modelines). And not all options
|
||||
can be set. For some options a flag is set, so that when it's used the
|
||||
|sandbox| is effective. Still, there is always a small risk that a modeline
|
||||
causes trouble. E.g., when some joker sets 'textwidth' to 5 all your lines
|
||||
are wrapped unexpectedly. So disable modelines before editing untrusted text.
|
||||
The mail ftplugin does this, for example.
|
||||
can be set. For some options a flag is set, so that when the value is used
|
||||
the |sandbox| is effective. Some options can only be set from the modeline
|
||||
when 'modelineexpr' is set (the default is off).
|
||||
|
||||
Still, there is always a small risk that a modeline causes trouble. E.g.,
|
||||
when some joker sets 'textwidth' to 5 all your lines are wrapped unexpectedly.
|
||||
So disable modelines before editing untrusted text. The mail ftplugin does
|
||||
this, for example.
|
||||
|
||||
Hint: If you would like to do something else than setting an option, you could
|
||||
define an autocommand that checks the file for a specific string. For
|
||||
@@ -1149,6 +1152,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
The expression will be evaluated in the |sandbox| when set from a
|
||||
modeline, see |sandbox-option|.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
|
||||
It is not allowed to change text or jump to another window while
|
||||
evaluating 'balloonexpr' |textlock|.
|
||||
@@ -1357,6 +1361,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
prompt buffer where only the last line can be edited, meant
|
||||
to be used by a plugin, see |prompt-buffer|
|
||||
{only when compiled with the |+channel| feature}
|
||||
popup buffer used in a popup window, see |popup|.
|
||||
{only when compiled with the |+textprop| feature}
|
||||
|
||||
This option is used together with 'bufhidden' and 'swapfile' to
|
||||
specify special kinds of buffers. See |special-buffers|.
|
||||
@@ -3226,7 +3232,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The expression will be evaluated in the |sandbox| if set from a
|
||||
modeline, see |sandbox-option|.
|
||||
This option can't be set from a |modeline| when the 'diff' option is
|
||||
on.
|
||||
on or the 'modelineexpr' option is off.
|
||||
|
||||
It is not allowed to change text or jump to another window while
|
||||
evaluating 'foldexpr' |textlock|.
|
||||
@@ -3359,6 +3365,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
The expression will be evaluated in the |sandbox| if set from a
|
||||
modeline, see |sandbox-option|.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
|
||||
It is not allowed to change text or jump to another window while
|
||||
evaluating 'foldtext' |textlock|.
|
||||
@@ -3396,6 +3403,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The expression will be evaluated in the |sandbox| when set from a
|
||||
modeline, see |sandbox-option|. That stops the option from working,
|
||||
since changing the buffer text is not allowed.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
NOTE: This option is set to "" when 'compatible' is set.
|
||||
|
||||
*'formatlistpat'* *'flp'*
|
||||
@@ -3452,6 +3460,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Also see 'swapsync' for controlling fsync() on swap files.
|
||||
'fsync' also applies to |writefile()|, unless a flag is used to
|
||||
overrule it.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'gdefault'* *'gd'* *'nogdefault'* *'nogd'*
|
||||
'gdefault' 'gd' boolean (default off)
|
||||
@@ -3619,7 +3629,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'guiheadroom'* *'ghr'*
|
||||
'guiheadroom' 'ghr' number (default 50)
|
||||
global
|
||||
- {only for GTK and X11 GUI}
|
||||
{only for GTK and X11 GUI}
|
||||
The number of pixels subtracted from the screen height when fitting
|
||||
the GUI window on the screen. Set this before the GUI is started,
|
||||
e.g., in your |gvimrc| file. When zero, the whole screen height will
|
||||
@@ -3777,6 +3787,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'guitabtooltip' is used for the tooltip, see below.
|
||||
The expression will be evaluated in the |sandbox| when set from a
|
||||
modeline, see |sandbox-option|.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
|
||||
Only used when the GUI tab pages line is displayed. 'e' must be
|
||||
present in 'guioptions'. For the non-GUI tab pages line 'tabline' is
|
||||
@@ -4027,6 +4038,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When this option contains printf-style '%' items, they will be
|
||||
expanded according to the rules used for 'statusline'. See
|
||||
'titlestring' for example settings.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
{not available when compiled without the |+statusline| feature}
|
||||
|
||||
*'ignorecase'* *'ic'* *'noignorecase'* *'noic'*
|
||||
@@ -4044,6 +4056,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
This option specifies a function that will be called to
|
||||
activate or deactivate the Input Method.
|
||||
It is not used in the GUI.
|
||||
The expression will be evaluated in the |sandbox| when set from a
|
||||
modeline, see |sandbox-option|.
|
||||
|
||||
Example: >
|
||||
function ImActivateFunc(active)
|
||||
@@ -4160,6 +4174,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
set imstatusfunc=ImStatusFunc
|
||||
<
|
||||
NOTE: This function is invoked very often. Keep it fast.
|
||||
The expression will be evaluated in the |sandbox| when set from a
|
||||
modeline, see |sandbox-option|.
|
||||
|
||||
*'imstyle'* *'imst'*
|
||||
'imstyle' 'imst' number (default 1)
|
||||
@@ -4176,6 +4192,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|single-repeat|, etc. Therefore over-the-spot style becomes the
|
||||
default now. This should work fine for most people, however if you
|
||||
have any problem with it, try using on-the-spot style.
|
||||
The expression will be evaluated in the |sandbox| when set from a
|
||||
modeline, see |sandbox-option|.
|
||||
|
||||
*'include'* *'inc'*
|
||||
'include' 'inc' string (default "^\s*#\s*include")
|
||||
@@ -4210,6 +4228,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
The expression will be evaluated in the |sandbox| when set from a
|
||||
modeline, see |sandbox-option|.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
|
||||
It is not allowed to change text or jump to another window while
|
||||
evaluating 'includeexpr' |textlock|.
|
||||
@@ -4297,6 +4316,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
The expression will be evaluated in the |sandbox| when set from a
|
||||
modeline, see |sandbox-option|.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
|
||||
It is not allowed to change text or jump to another window while
|
||||
evaluating 'indentexpr' |textlock|.
|
||||
@@ -4915,7 +4935,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'matchtime'* *'mat'*
|
||||
'matchtime' 'mat' number (default 5)
|
||||
global
|
||||
{in Nvi}
|
||||
Tenths of a second to show the matching paren, when 'showmatch' is
|
||||
set. Note that this is not in milliseconds, like other options that
|
||||
set a time. This is to be compatible with Nvi.
|
||||
@@ -5045,10 +5064,25 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
< If you have less than 512 Mbyte |:mkspell| may fail for some
|
||||
languages, no matter what you set 'mkspellmem' to.
|
||||
|
||||
This option cannot be set from a |modeline| or in the |sandbox|.
|
||||
|
||||
*'modeline'* *'ml'* *'nomodeline'* *'noml'*
|
||||
'modeline' 'ml' boolean (Vim default: on (off for root),
|
||||
Vi default: off)
|
||||
local to buffer
|
||||
If 'modeline' is on 'modelines' gives the number of lines that is
|
||||
checked for set commands. If 'modeline' is off or 'modelines' is zero
|
||||
no lines are checked. See |modeline|.
|
||||
|
||||
*'modelineexpr'* *'mle'* *'nomodelineexpr'* *'nomle'*
|
||||
'modelineexpr' 'mle' boolean (default: off)
|
||||
global
|
||||
When on allow some options that are an expression to be set in the
|
||||
modeline. Check the option for whether it is affected by
|
||||
'modelineexpr'. Also see |modeline|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'modelines'* *'mls'*
|
||||
'modelines' 'mls' number (default 5)
|
||||
global
|
||||
@@ -5059,9 +5093,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
set and to the Vim default value when 'compatible' is reset.
|
||||
|
||||
*'modifiable'* *'ma'* *'nomodifiable'* *'noma'*
|
||||
*E21*
|
||||
'modifiable' 'ma' boolean (default on)
|
||||
local to buffer
|
||||
*E21*
|
||||
When off the buffer contents cannot be changed. The 'fileformat' and
|
||||
'fileencoding' options also can't be changed.
|
||||
Can be reset on startup with the |-M| command line argument.
|
||||
@@ -5351,7 +5385,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
rows in the window, depending on whether 'number' or 'relativenumber'
|
||||
is set. Thus with the Vim default of 4 there is room for a line number
|
||||
up to 999. When the buffer has 1000 lines five columns will be used.
|
||||
The minimum value is 1, the maximum value is 10.
|
||||
The minimum value is 1, the maximum value is 20.
|
||||
NOTE: This option is set to the Vi default value when 'compatible' is
|
||||
set and to the Vim default value when 'compatible' is reset.
|
||||
|
||||
@@ -6058,6 +6092,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When this option is not empty, it determines the content of the ruler
|
||||
string, as displayed for the 'ruler' option.
|
||||
The format of this option is like that of 'statusline'.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
|
||||
The default ruler width is 17 characters. To make the ruler 15
|
||||
characters wide, put "%15(" at the start and "%)" at the end.
|
||||
Example: >
|
||||
@@ -6598,7 +6634,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
"Pattern not found", "Back at original", etc.
|
||||
q use "recording" instead of "recording @a"
|
||||
F don't give the file info when editing a file, like `:silent`
|
||||
was used for the command
|
||||
was used for the command; note that this also affects messages
|
||||
from autocommands
|
||||
S do not show search count message when searching, e.g.
|
||||
"[1/5]"
|
||||
|
||||
@@ -6766,6 +6803,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
"auto" only when there is a sign to display
|
||||
"no" never
|
||||
"yes" always
|
||||
"number" display signs in the 'number' column. If the number
|
||||
column is not present, then behaves like "auto".
|
||||
|
||||
|
||||
*'smartcase'* *'scs'* *'nosmartcase'* *'noscs'*
|
||||
@@ -7052,7 +7091,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When the option starts with "%!" then it is used as an expression,
|
||||
evaluated and the result is used as the option value. Example: >
|
||||
:set statusline=%!MyStatusLine()
|
||||
< The result can contain %{} items that will be evaluated too.
|
||||
< The *g:statusline_winid* variable will be set to the |window-ID| of the
|
||||
window that the status line belongs to.
|
||||
The result can contain %{} items that will be evaluated too.
|
||||
Note that the "%!" expression is evaluated in the context of the
|
||||
current window and buffer, while %{} items are evaluated in the
|
||||
context of the window that the statusline belongs to.
|
||||
@@ -7155,16 +7196,19 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
become empty. This will make a group like the following disappear
|
||||
completely from the statusline when none of the flags are set. >
|
||||
:set statusline=...%(\ [%M%R%H]%)...
|
||||
< *g:actual_curbuf*
|
||||
Beware that an expression is evaluated each and every time the status
|
||||
line is displayed. The current buffer and current window will be set
|
||||
temporarily to that of the window (and buffer) whose statusline is
|
||||
currently being drawn. The expression will evaluate in this context.
|
||||
The variable "g:actual_curbuf" is set to the `bufnr()` number of the
|
||||
real current buffer.
|
||||
< Beware that an expression is evaluated each and every time the status
|
||||
line is displayed.
|
||||
*g:actual_curbuf* *g:actual_curwin*
|
||||
The current buffer and current window will be set temporarily to that
|
||||
of the window (and buffer) whose statusline is currently being drawn.
|
||||
The expression will evaluate in this context. The variable
|
||||
"g:actual_curbuf" is set to the `bufnr()` number of the real current
|
||||
buffer and "g:actual_curwin" to the |window-ID| of the real current
|
||||
window. These values are strings.
|
||||
|
||||
The 'statusline' option will be evaluated in the |sandbox| if set from
|
||||
a modeline, see |sandbox-option|.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
|
||||
It is not allowed to change text or jump to another window while
|
||||
evaluating 'statusline' |textlock|.
|
||||
@@ -7345,6 +7389,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
When changing something that is used in 'tabline' that does not
|
||||
trigger it to be updated, use |:redrawtabline|.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
|
||||
Keep in mind that only one of the tab pages is the current one, others
|
||||
are invisible and you can't jump to their windows.
|
||||
@@ -7873,8 +7918,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
non-empty 't_ts' option).
|
||||
When Vim was compiled with HAVE_X11 defined, the original title will
|
||||
be restored if possible, see |X11|.
|
||||
|
||||
When this option contains printf-style '%' items, they will be
|
||||
expanded according to the rules used for 'statusline'.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
|
||||
Example: >
|
||||
:auto BufEnter * let &titlestring = hostname() . "/" . expand("%:p")
|
||||
:set title titlestring=%<%F%=%l/%L-%P titlelen=70
|
||||
@@ -8022,7 +8070,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
already.
|
||||
Additionally, if vim is compiled with the |+termresponse| feature and
|
||||
|t_RV| is set to the escape sequence to request the xterm version
|
||||
number, more intelligent detection process runs.
|
||||
number, more intelligent detection is done.
|
||||
The "xterm2" value will be set if the xterm version is reported to be
|
||||
from 95 to 276. The "sgr" value will be set if Vim detects Mac
|
||||
Terminal.app, iTerm2 or mintty, and when the xterm version is 277 or
|
||||
@@ -8060,6 +8108,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
undo file that exists is used. When it cannot be read an error is
|
||||
given, no further entry is used.
|
||||
See |undo-persistence|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'undofile'* *'noundofile'* *'udf'* *'noudf'*
|
||||
'undofile' 'udf' boolean (default off)
|
||||
@@ -8369,6 +8419,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When equal to "NONE" no viminfo file will be read or written.
|
||||
This option can be set with the |-i| command line flag. The |--clean|
|
||||
command line flag sets it to "NONE".
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'virtualedit'* *'ve'*
|
||||
'virtualedit' 've' string (default "")
|
||||
@@ -8635,6 +8687,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
This option is not used for <F10>; on Win32 and with GTK <F10> will
|
||||
select the menu, unless it has been mapped.
|
||||
|
||||
*'wincolor'* *'wcr'*
|
||||
'wincolor' 'wcr' string (default empty)
|
||||
local to window
|
||||
Highlight group name to use for this window instead of the Normal
|
||||
color |hl-Normal|.
|
||||
|
||||
*'window'* *'wi'*
|
||||
'window' 'wi' number (default screen height - 1)
|
||||
global
|
||||
|
||||
@@ -61,11 +61,11 @@ explanations are in chapter 27 |usr_27.txt|.
|
||||
n Repeat the latest "/" or "?" [count] times.
|
||||
If the cursor doesn't move the search is repeated with
|
||||
count + 1.
|
||||
|last-pattern| {Vi: no count}
|
||||
|last-pattern|
|
||||
|
||||
*N*
|
||||
N Repeat the latest "/" or "?" [count] times in
|
||||
opposite direction. |last-pattern| {Vi: no count}
|
||||
opposite direction. |last-pattern|
|
||||
|
||||
*star* *E348* *E349*
|
||||
* Search forward for the [count]'th occurrence of the
|
||||
|
||||
@@ -1,203 +1,579 @@
|
||||
*popup.txt* For Vim version 8.1. Last change: 2019 May 12
|
||||
*popup.txt* For Vim version 8.1. Last change: 2019 Jul 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Displaying text with properties attached. *popup* *popup-window*
|
||||
Displaying text in a floating window. *popup* *popup-window*
|
||||
|
||||
THIS IS UNDER DESIGN - ANYTHING MAY STILL CHANGE
|
||||
|
||||
1. Introduction |popup-intro|
|
||||
Window position and size |popup-position|
|
||||
Closing the popup window |popup-close|
|
||||
Popup buffer and window |popup-buffer|
|
||||
2. Functions |popup-functions|
|
||||
3. Examples |popup-examples|
|
||||
Details |popup-function-details|
|
||||
3. Usage |popup-usage|
|
||||
popup_create() arguments |popup_create-arguments|
|
||||
Popup text properties |popup-props|
|
||||
Popup filter |popup-filter|
|
||||
Popup callback |popup-callback|
|
||||
Popup scrollbar |popup-scrollbar|
|
||||
Popup mask |popup-mask|
|
||||
4. Examples |popup-examples|
|
||||
|
||||
|
||||
{not able to use text properties when the |+textprop| feature was
|
||||
disabled at compile time}
|
||||
{not available if the |+textprop| feature was disabled at compile time}
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *popup-intro*
|
||||
|
||||
We are talking about popup windows here, text that goes on top of the buffer
|
||||
text and is under control of a plugin. Other popup functionality:
|
||||
We are talking about popup windows here, text that goes on top of the regular
|
||||
windows and is under control of a plugin. You cannot edit the text in the
|
||||
popup window like with regular windows.
|
||||
|
||||
A popup window can be used for such things as:
|
||||
- briefly show a message without overwriting the command line
|
||||
- prompt the user with a dialog
|
||||
- display contextual information while typing
|
||||
- give extra information for auto-completion
|
||||
|
||||
The text in the popup window can be colored with |text-properties|. It is
|
||||
also possible to use syntax highlighting.
|
||||
|
||||
The default color used is "Pmenu". If you prefer something else use the
|
||||
"highlight" argument or the 'wincolor' option, e.g.: >
|
||||
hi MyPopupColor ctermbg=lightblue guibg=lightblue
|
||||
call setwinvar(winid, '&wincolor', 'MyPopupColor')
|
||||
|
||||
'hlsearch' highlighting is not displayed in a popup window.
|
||||
|
||||
A popup window has a window-ID like other windows, but behaves differently.
|
||||
The size can be up to the whole Vim window and it overlaps other windows.
|
||||
Popup windows can also overlap each other. The "zindex" property specifies
|
||||
what goes on top of what.
|
||||
|
||||
The popup window contains a buffer, and that buffer is always associated with
|
||||
the popup window. The window cannot be in Normal, Visual or Insert mode, it
|
||||
does not get keyboard focus. You can use functions like `setbufline()` to
|
||||
change the text in the buffer. There are more differences from how this
|
||||
window and buffer behave compared to regular windows and buffers, see
|
||||
|popup-buffer|.
|
||||
|
||||
If this is not what you are looking for, check out other popup functionality:
|
||||
- popup menu, see |popup-menu|
|
||||
- balloon, see |balloon-eval|
|
||||
|
||||
TODO
|
||||
|
||||
WINDOW POSITION AND SIZE *popup-position*
|
||||
|
||||
The height of the window is normally equal to the number of, possibly
|
||||
wrapping, lines in the buffer. It can be limited with the "maxheight"
|
||||
property. You can use empty lines to increase the height or the "minheight"
|
||||
property.
|
||||
|
||||
The width of the window is normally equal to the longest line in the buffer.
|
||||
It can be limited with the "maxwidth" property. You can use spaces to
|
||||
increase the width or use the "minwidth" property.
|
||||
|
||||
By default the 'wrap' option is set, so that no text disappears. Otherwise,
|
||||
if there is not enough space then the window is shifted left in order to
|
||||
display more text. When right-aligned the window is shifted right to display
|
||||
more text. The shifting can be disabled with the "fixed" property.
|
||||
|
||||
Vim tries to show the popup in the location you specify. In some cases, e.g.
|
||||
when the popup would go outside of the Vim window, it will show it somewhere
|
||||
nearby. E.g. if you use `popup_atcursor()` the popup normally shows just above
|
||||
the current cursor position, but if the cursor is close to the top of the Vim
|
||||
window it will be placed below the cursor position.
|
||||
|
||||
When the screen scrolls up for output of an Ex command, popups move too, so
|
||||
that they will not cover the output.
|
||||
|
||||
The current cursor position is displayed even when it is under a popup window.
|
||||
That way you can still see where it is, even though you cannot see the text
|
||||
that it is in.
|
||||
|
||||
|
||||
CLOSING THE POPUP WINDOW *popup-close*
|
||||
|
||||
Normally the plugin that created the popup window is also in charge of closing
|
||||
it. If somehow a popup hangs around, you can close all of them with: >
|
||||
call popup_clear()
|
||||
Some popups, such as notifications, close after a specified time. This can be
|
||||
set with the "time" property on `popup_create()`.
|
||||
Otherwise, a popup can be closed by clicking on the X in the top-right corner
|
||||
or by clicking anywhere inside the popup. This must be enabled with the
|
||||
"close" property. It is set by default for notifications.
|
||||
|
||||
|
||||
POPUP BUFFER AND WINDOW *popup-buffer*
|
||||
|
||||
If a popup function is called to create a popup from text, a new buffer is
|
||||
created to hold the text and text properties of the popup window. The buffer
|
||||
is always associated with the popup window and manipulation is restricted:
|
||||
- the buffer has no name
|
||||
- 'buftype' is "popup"
|
||||
- 'swapfile' is off
|
||||
- 'bufhidden' is "hide"
|
||||
- 'buflisted' is off
|
||||
- 'undolevels' is -1: no undo at all
|
||||
- all other buffer-local and window-local options are set to their Vim default
|
||||
value.
|
||||
|
||||
It is possible to change the specifically mentioned options, but anything
|
||||
might break then, so better leave them alone.
|
||||
|
||||
The window does have a cursor position, but the cursor is not displayed.
|
||||
|
||||
To execute a command in the context of the popup window and buffer use
|
||||
`win_execute()`. Example: >
|
||||
call win_execute(winid, 'syntax enable')
|
||||
|
||||
Options can be set on the window with `setwinvar()`, e.g.: >
|
||||
call setwinvar(winid, '&wrap', 0)
|
||||
And options can be set on the buffer with `setbufvar()`, e.g.: >
|
||||
call setbufvar(winbufnr(winid), '&filetype', 'java')
|
||||
Note that this does not trigger autocommands. Use `win_execute()` if you do
|
||||
need them.
|
||||
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. Functions *popup-functions*
|
||||
|
||||
THIS IS UNDER DESIGN - ANYTHING MAY STILL CHANGE
|
||||
Creating a popup window:
|
||||
|popup_create()| centered in the screen
|
||||
|popup_atcursor()| just above the cursor position, closes when
|
||||
the cursor moves away
|
||||
|popup_notification()| show a notification for three seconds
|
||||
|popup_dialog()| centered with padding and border
|
||||
|popup_menu()| prompt for selecting an item from a list
|
||||
|
||||
Proposal and discussion on issue #4063: https://github.com/vim/vim/issues/4063
|
||||
Manipulating a popup window:
|
||||
|popup_hide()| hide a popup temporarily
|
||||
|popup_show()| show a previously hidden popup
|
||||
|popup_move()| change the position and size of a popup
|
||||
|popup_setoptions()| override options of a popup
|
||||
|popup_settext()| replace the popup buffer contents
|
||||
|
||||
[to be moved to eval.txt later]
|
||||
Closing popup windows:
|
||||
|popup_close()| close one popup
|
||||
|popup_clear()| close all popups
|
||||
|
||||
popup_show({lines}, {options}) *popup_show()*
|
||||
Open a popup window showing {lines}, which is a list of lines,
|
||||
where each line has text and text properties.
|
||||
Filter functions:
|
||||
|popup_filter_menu()| select from a list of items
|
||||
|popup_filter_yesno()| blocks until 'y' or 'n' is pressed
|
||||
|
||||
{options} is a dictionary with many possible entries.
|
||||
|
||||
Returns a unique ID to be used with |popup_close()|.
|
||||
|
||||
See |popup_show-usage| for details.
|
||||
Other:
|
||||
|popup_getoptions()| get current options for a popup
|
||||
|popup_getpos()| get actual position and size of a popup
|
||||
|
||||
|
||||
popup_dialog({lines}, {options}) *popup_dialog()*
|
||||
Just like |popup_show()| but with different default options:
|
||||
pos "center"
|
||||
zindex 200
|
||||
border []
|
||||
DETAILS *popup-function-details*
|
||||
|
||||
|
||||
popup_notification({text}, {options}) *popup_notification()*
|
||||
Show the string {text} for 3 seconds at the top of the Vim
|
||||
window. This works like: >
|
||||
call popup_show([{'text': {text}}], {
|
||||
\ 'line': 1,
|
||||
\ 'col': 10,
|
||||
\ 'time': 3000,
|
||||
\ 'zindex': 200,
|
||||
\ 'highlight': 'WarningMsg',
|
||||
\ 'border: [],
|
||||
\ })
|
||||
< Use {options} to change the properties.
|
||||
|
||||
popup_atcursor({text}, {options}) *popup_atcursor()*
|
||||
Show the string {text} above the cursor, and close it when the
|
||||
cursor moves. This works like: >
|
||||
call popup_show([{'text': {text}}], {
|
||||
popup_atcursor({what}, {options}) *popup_atcursor()*
|
||||
Show the {what} above the cursor, and close it when the cursor
|
||||
moves. This works like: >
|
||||
call popup_create({what}, {
|
||||
\ 'pos': 'botleft',
|
||||
\ 'line': 'cursor-1',
|
||||
\ 'col': 'cursor',
|
||||
\ 'zindex': 50,
|
||||
\ 'moved': 'WORD',
|
||||
\ })
|
||||
< Use {options} to change the properties.
|
||||
|
||||
|
||||
popup_menu({lines}, {options}) *popup_atcursor()*
|
||||
Show the {lines} near the cursor, handle selecting one of the
|
||||
items with cursorkeys, and close it an item is selected with
|
||||
Space or Enter. This works like: >
|
||||
call popup_show({lines}, {
|
||||
*popup_clear()*
|
||||
popup_clear() Emergency solution to a misbehaving plugin: close all popup
|
||||
windows for the current tab and global popups.
|
||||
|
||||
|
||||
popup_close({id} [, {result}]) *popup_close()*
|
||||
Close popup {id}. The window and the associated buffer will
|
||||
be deleted.
|
||||
|
||||
If the popup has a callback it will be called just before the
|
||||
popup window is deleted. If the optional {result} is present
|
||||
it will be passed as the second argument of the callback.
|
||||
Otherwise zero is passed to the callback.
|
||||
|
||||
|
||||
popup_create({what}, {options}) *popup_create()*
|
||||
Open a popup window showing {what}, which is either:
|
||||
- a buffer number
|
||||
- a string
|
||||
- a list of strings
|
||||
- a list of text lines with text properties
|
||||
When {what} is not a buffer number, a buffer is created with
|
||||
'buftype' set to "popup". That buffer will be wiped out once
|
||||
the popup closes.
|
||||
|
||||
{options} is a dictionary with many possible entries.
|
||||
See |popup_create-arguments| for details.
|
||||
|
||||
Returns a window-ID, which can be used with other popup
|
||||
functions. Use `winbufnr()` to get the number of the buffer
|
||||
in the window: >
|
||||
let winid = popup_create('hello', {})
|
||||
let bufnr = winbufnr(winid)
|
||||
call setbufline(bufnr, 2, 'second line')
|
||||
< In case of failure zero is returned.
|
||||
|
||||
|
||||
popup_dialog({what}, {options}) *popup_dialog()*
|
||||
Just like |popup_create()| but with these default options: >
|
||||
call popup_create({what}, {
|
||||
\ 'pos': 'center',
|
||||
\ 'zindex': 200,
|
||||
\ 'wrap': 0,
|
||||
\ 'drag': 1,
|
||||
\ 'border': [],
|
||||
\ 'filter': 'popup_filter_menu',
|
||||
\ 'padding': [],
|
||||
\})
|
||||
< Use {options} to change the properties. E.g. add a 'filter'
|
||||
option with value 'popup_filter_yesno'. Example: >
|
||||
call popup_create('do you want to quit (Yes/no)?', {
|
||||
\ 'filter': 'popup_filter_yesno',
|
||||
\ 'callback': 'QuitCallback',
|
||||
\ })
|
||||
< Use {options} to change the properties. Should at least set
|
||||
"callback" to a function that handles the selected item.
|
||||
|
||||
|
||||
popup_move({id}, {options}) *popup_move()*
|
||||
Move popup {id} to the position speficied with {options}.
|
||||
{options} may contain the items from |popup_show()| that
|
||||
specify the popup position: "line", "col", "pos", "maxheight",
|
||||
"minheight", "maxwidth" and "minwidth".
|
||||
< By default the dialog can be dragged, so that text below it
|
||||
can be read if needed.
|
||||
|
||||
|
||||
popup_filter_menu({id}, {key}) *popup_filter_menu()*
|
||||
Filter that can be used for a popup. It handles the cursor
|
||||
keys to move the selected index in the popup. Space and Enter
|
||||
can be used to select an item. Invokes the "callback" of the
|
||||
popup menu with the index of the selected line as the second
|
||||
argument.
|
||||
Filter that can be used for a popup. These keys can be used:
|
||||
j <Down> select item below
|
||||
k <Up> select item above
|
||||
<Space> <Enter> accept current selection
|
||||
x Esc CTRL-C cancel the menu
|
||||
Other keys are ignored.
|
||||
|
||||
A match is set on that line to highlight it, see
|
||||
|popup_menu()|.
|
||||
|
||||
When the current selection is accepted the "callback" of the
|
||||
popup menu is invoked with the index of the selected line as
|
||||
the second argument. The first entry has index one.
|
||||
Cancelling the menu invokes the callback with -1.
|
||||
|
||||
To add shortcut keys, see the example here:
|
||||
|popup_menu-shortcut-example|
|
||||
|
||||
|
||||
popup_filter_yesno({id}, {key}) *popup_filter_yesno()*
|
||||
Filter that can be used for a popup. It handles only the keys
|
||||
'y', 'Y' and 'n' or 'N'. Invokes the "callback" of the
|
||||
popup menu with the 1 for 'y' or 'Y' and zero for 'n' or 'N'
|
||||
as the second argument. Pressing Esc and CTRL-C works like
|
||||
pressing 'n'.
|
||||
as the second argument. Pressing Esc and 'x' works like
|
||||
pressing 'n'. CTRL-C invokes the callback with -1. Other
|
||||
keys are ignored.
|
||||
See the example here: |popup_dialog-example|
|
||||
|
||||
|
||||
popup_setlines({id}, {lnum}, {lines}) *popup_setlines()*
|
||||
In popup {id} set line {lnum} and following to {lines}.
|
||||
popup_getoptions({id}) *popup_getoptions()*
|
||||
Return the {options} for popup {id} in a Dict.
|
||||
A zero value means the option was not set. For "zindex" the
|
||||
default value is returned, not zero.
|
||||
|
||||
{lnum} is one-based and must be either an existing line or
|
||||
just one below the last line, in which case the line gets
|
||||
appended.
|
||||
The "moved" entry is a list with minimum and maximum column,
|
||||
[0, 0] when not set.
|
||||
|
||||
{lines} has the same format as one item in {lines} of
|
||||
|popup_show()|. Existing lines are replaced. When {lines}
|
||||
extends below the last line of the popup lines are appended.
|
||||
"border" and "padding" are not included when all values are
|
||||
zero. When all values are one then an empty list is included.
|
||||
|
||||
popup_getlines({id}) *popup_getlines()*
|
||||
Return the {lines} for popup {id}.
|
||||
"borderhighlight" is not included when all values are empty.
|
||||
"scrollbarhighlight" and "thumbhighlight" are onlu included
|
||||
when set.
|
||||
|
||||
"tabpage" will be -1 for a global popup, zero for a popup on
|
||||
the current tabpage and a positive number for a popup on
|
||||
another tabpage.
|
||||
|
||||
If popup window {id} is not found an empty Dict is returned.
|
||||
|
||||
|
||||
popup_getpos({id}) *popup_getpos()*
|
||||
Return the position and size of popup {id}. Returns a Dict
|
||||
with these entries:
|
||||
col screen column of the popup, one-based
|
||||
line screen line of the popup, one-based
|
||||
width width of the whole popup in screen cells
|
||||
height height of the whole popup in screen cells
|
||||
core_col screen column of the text box
|
||||
core_line screen line of the text box
|
||||
core_width width of the text box in screen cells
|
||||
core_height height of the text box in screen cells
|
||||
firstline line of the buffer at top (1 unless scrolled)
|
||||
scrollbar non-zero if a scrollbar is displayed
|
||||
visible one if the popup is displayed, zero if hidden
|
||||
Note that these are the actual screen positions. They differ
|
||||
from the values in `popup_getoptions()` for the sizing and
|
||||
positioning mechanism applied.
|
||||
|
||||
The "core_" values exclude the padding and border.
|
||||
|
||||
If popup window {id} is not found an empty Dict is returned.
|
||||
|
||||
|
||||
popup_hide({id}) *popup_hide()*
|
||||
If {id} is a displayed popup, hide it now. If the popup has a
|
||||
filter it will not be invoked for so long as the popup is
|
||||
hidden.
|
||||
If window {id} does not exist nothing happens. If window {id}
|
||||
exists but is not a popup window an error is given. *E993*
|
||||
|
||||
|
||||
popup_menu({what}, {options}) *popup_menu()*
|
||||
Show the {what} near the cursor, handle selecting one of the
|
||||
items with cursorkeys, and close it an item is selected with
|
||||
Space or Enter. {what} should have multiple lines to make this
|
||||
useful. This works like: >
|
||||
call popup_create({what}, {
|
||||
\ 'pos': 'center',
|
||||
\ 'zindex': 200,
|
||||
\ 'drag': 1,
|
||||
\ 'wrap': 0,
|
||||
\ 'border': [],
|
||||
\ 'padding': [],
|
||||
\ 'filter': 'popup_filter_menu',
|
||||
\ })
|
||||
< The current line is highlighted with a match using
|
||||
"PopupSelected", or "PmenuSel" if that is not defined.
|
||||
|
||||
Use {options} to change the properties. Should at least set
|
||||
"callback" to a function that handles the selected item.
|
||||
|
||||
|
||||
popup_move({id}, {options}) *popup_move()*
|
||||
Move popup {id} to the position specified with {options}.
|
||||
{options} may contain the items from |popup_create()| that
|
||||
specify the popup position:
|
||||
line
|
||||
col
|
||||
pos
|
||||
maxheight
|
||||
minheight
|
||||
maxwidth
|
||||
minwidth
|
||||
fixed
|
||||
For {id} see `popup_hide()`.
|
||||
For other options see |popup_setoptions()|.
|
||||
|
||||
|
||||
popup_notification({what}, {options}) *popup_notification()*
|
||||
Show the {what} for 3 seconds at the top of the Vim window.
|
||||
This works like: >
|
||||
call popup_create({what}, {
|
||||
\ 'line': 1,
|
||||
\ 'col': 10,
|
||||
\ 'minwidth': 20,
|
||||
\ 'time': 3000,
|
||||
\ 'tabpage': -1,
|
||||
\ 'zindex': 300,
|
||||
\ 'drag': 1,
|
||||
\ 'highlight': 'WarningMsg',
|
||||
\ 'border': [],
|
||||
\ 'close': 'click',
|
||||
\ 'padding': [0,1,0,1],
|
||||
\ })
|
||||
< The PopupNotification highlight group is used instead of
|
||||
WarningMsg if it is defined.
|
||||
|
||||
Without the |+timers| feature the poup will not disappear
|
||||
automatically, the user has to click in it.
|
||||
|
||||
The position will be adjusted to avoid overlap with other
|
||||
notifications.
|
||||
Use {options} to change the properties.
|
||||
|
||||
|
||||
popup_show({id}) *popup_show()*
|
||||
If {id} is a hidden popup, show it now.
|
||||
For {id} see `popup_hide()`.
|
||||
|
||||
|
||||
popup_setoptions({id}, {options}) *popup_setoptions()*
|
||||
Override options in popup {id} with entries in {options}.
|
||||
These options can be set:
|
||||
border
|
||||
borderchars
|
||||
borderhighlight
|
||||
callback
|
||||
close
|
||||
drag
|
||||
filter
|
||||
firstline
|
||||
flip
|
||||
highlight
|
||||
mask
|
||||
moved
|
||||
padding
|
||||
scrollbar
|
||||
scrollbarhighlight
|
||||
thumbhighlight
|
||||
time
|
||||
title
|
||||
wrap
|
||||
zindex
|
||||
The options from |popup_move()| can also be used.
|
||||
For "hidden" use |popup_hide()| and |popup_show()|.
|
||||
"tabpage" cannot be changed.
|
||||
|
||||
popup_settext({id}, {text}) *popup_settext()*
|
||||
Set the text of the buffer in poup win {id}. {text} is the
|
||||
same as supplied to |popup_create()|, except that a buffer
|
||||
number is not allowed.
|
||||
Does not change the window size or position, other than caused
|
||||
by the different text.
|
||||
|
||||
|
||||
popup_getoptions({id}) *popup_getoptions()*
|
||||
Return the {options} for popup {id}.
|
||||
==============================================================================
|
||||
3. Usage *popup-usage*
|
||||
|
||||
POPUP_CREATE() ARGUMENTS *popup_create-arguments*
|
||||
|
||||
popup_close({id}) *popup_close()*
|
||||
Close popup {id}.
|
||||
|
||||
|
||||
POPUP_SHOW() ARGUMENTS *popup_show-usage*
|
||||
|
||||
The first argument of |popup_show()| is a list of text lines. Each item in
|
||||
the list is a dictionary with these entries:
|
||||
text The text to display.
|
||||
The first argument of |popup_create()| (and the second argument to
|
||||
|popup_settext()|) specifies the text to be displayed, and optionally text
|
||||
properties. It is in one of four forms:
|
||||
- a buffer number
|
||||
- a string
|
||||
- a list of strings
|
||||
- a list of dictionaries, where each dictionary has these entries:
|
||||
text String with the text to display.
|
||||
props A list of text properties. Optional.
|
||||
Each entry is a dictionary, like the third argument of
|
||||
|prop_add()|, but specifying the column in the
|
||||
dictionary with a "col" entry, see below:
|
||||
|popup-props|.
|
||||
|
||||
The second argument of |popup_show()| is a dictionary with options:
|
||||
line screen line where to position the popup; can use
|
||||
"cursor", "cursor+1" or "cursor-1" to use the line of
|
||||
the cursor and add or subtract a number of lines;
|
||||
default is "cursor-1".
|
||||
col screen column where to position the popup; can use
|
||||
"cursor" to use the column of the cursor, "cursor+99"
|
||||
and "cursor-99" to add or subtract a number of
|
||||
columns; default is "cursor"
|
||||
The second argument of |popup_create()| is a dictionary with options:
|
||||
line Screen line where to position the popup. Can use a
|
||||
number or "cursor", "cursor+1" or "cursor-1" to use
|
||||
the line of the cursor and add or subtract a number of
|
||||
lines. If omitted the popup is vertically centered.
|
||||
The first line is 1.
|
||||
col Screen column where to position the popup. Can use a
|
||||
number or "cursor" to use the column of the cursor,
|
||||
"cursor+9" or "cursor-9" to add or subtract a number
|
||||
of columns. If omitted the popup is horizontally
|
||||
centered. The first column is 1.
|
||||
pos "topleft", "topright", "botleft" or "botright":
|
||||
defines what corner of the popup "line" and "col" are
|
||||
used for. Default is "botleft". Alternatively
|
||||
"center" can be used to position the popup somewhere
|
||||
near the cursor.
|
||||
maxheight maximum height
|
||||
minheight minimum height
|
||||
maxwidth maximum width
|
||||
minwidth minimum width
|
||||
title text to be displayed above the first item in the
|
||||
popup, on top of any border
|
||||
wrap TRUE to make the lines wrap (default TRUE)
|
||||
highlight highlight group name to use for the text, defines the
|
||||
background and foreground color
|
||||
border list with numbers, defining the border thickness
|
||||
above/right/below/left of the popup; an empty list
|
||||
uses a border of 1 all around
|
||||
borderhighlight highlight group name to use for the border
|
||||
borderchars list with characters, defining the character to use
|
||||
for the top/right/bottom/left border; optionally
|
||||
used for. When not set "topleft" is used.
|
||||
Alternatively "center" can be used to position the
|
||||
popup in the center of the Vim window, in which case
|
||||
"line" and "col" are ignored.
|
||||
fixed When FALSE (the default), and:
|
||||
- "pos" is "botleft" or "topleft", and
|
||||
- "wrap" is off, and
|
||||
- the popup would be truncated at the right edge of
|
||||
the screen, then
|
||||
the popup is moved to the left so as to fit the
|
||||
contents on the screen. Set to TRUE to disable this.
|
||||
flip When TRUE (the default) and the position is relative
|
||||
to the cursor, flip to below or above the cursor to
|
||||
avoid overlap with the |popupmenu-completion| or
|
||||
another popup with a higher "zindex". When there is
|
||||
no space above/below the cursor then show the popup to
|
||||
the side of the popup or popup menu.
|
||||
{not implemented yet}
|
||||
maxheight Maximum height of the contents, excluding border and
|
||||
padding.
|
||||
minheight Minimum height of the contents, excluding border and
|
||||
padding.
|
||||
maxwidth Maximum width of the contents, excluding border and
|
||||
padding.
|
||||
minwidth Minimum width of the contents, excluding border and
|
||||
padding.
|
||||
firstline First buffer line to display. When larger than one it
|
||||
looks like the text scrolled up. When out of range
|
||||
the last buffer line will at the top of the window.
|
||||
Also see "scrollbar".
|
||||
hidden When TRUE the popup exists but is not displayed; use
|
||||
`popup_show()` to unhide it.
|
||||
tabpage When -1: display the popup on all tab pages.
|
||||
When 0 (the default): display the popup on the current
|
||||
tab page.
|
||||
Otherwise the number of the tab page the popup is
|
||||
displayed on; when invalid the popup is not created
|
||||
and an error is given. *E997*
|
||||
title Text to be displayed above the first item in the
|
||||
popup, on top of any border. If there is no top
|
||||
border one line of padding is added to put the title
|
||||
on. You might want to add one or more spaces at the
|
||||
start and end as padding.
|
||||
wrap TRUE to make the lines wrap (default TRUE).
|
||||
drag TRUE to allow the popup to be dragged with the mouse
|
||||
by grabbing at at the border. Has no effect if the
|
||||
popup does not have a border. As soon as dragging
|
||||
starts and "pos" is "center" it is changed to
|
||||
"topleft".
|
||||
close When "button" an X is displayed in the top-right, on
|
||||
top of any border, padding or text. When clicked on
|
||||
the X the popup will close. Any callback is invoked
|
||||
with the value -2.
|
||||
When "click" any mouse click in the popup will close
|
||||
it.
|
||||
When "none" (the default) mouse clicks do not close
|
||||
the popup window.
|
||||
highlight Highlight group name to use for the text, stored in
|
||||
the 'wincolor' option.
|
||||
padding List with numbers, defining the padding
|
||||
above/right/below/left of the popup (similar to CSS).
|
||||
An empty list uses a padding of 1 all around. The
|
||||
padding goes around the text, inside any border.
|
||||
Padding uses the 'wincolor' highlight.
|
||||
Example: [1, 2, 1, 3] has 1 line of padding above, 2
|
||||
columns on the right, 1 line below and 3 columns on
|
||||
the left.
|
||||
border List with numbers, defining the border thickness
|
||||
above/right/below/left of the popup (similar to CSS).
|
||||
Only values of zero and non-zero are recognized.
|
||||
An empty list uses a border all around.
|
||||
borderhighlight List of highlight group names to use for the border.
|
||||
When one entry it is used for all borders, otherwise
|
||||
the highlight for the top/right/bottom/left border.
|
||||
Example: ['TopColor', 'RightColor', 'BottomColor,
|
||||
'LeftColor']
|
||||
borderchars List with characters, defining the character to use
|
||||
for the top/right/bottom/left border. Optionally
|
||||
followed by the character to use for the
|
||||
topright/botright/botleft/topleft corner; an empty
|
||||
list can be used to show a double line all around
|
||||
zindex priority for the popup, default 50
|
||||
time time in milliseconds after which the popup will close;
|
||||
when omitted |popup_close()| must be used.
|
||||
moved "cell": close the popup if the cursor moved at least
|
||||
one screen cell; "word" allows for moving within
|
||||
|<cword>|, "WORD" allows for moving within |<cWORD>|,
|
||||
a list with two numbers specifies the start and end
|
||||
column
|
||||
filter a callback that can filter typed characters, see
|
||||
|popup-filter|
|
||||
callback a callback to be used when the popup closes, e.g. when
|
||||
using |popup_filter_menu()|, see |popup-callback|.
|
||||
topleft/topright/botright/botleft corner.
|
||||
Example: ['-', '|', '-', '|', '┌', '┐', '┘', '└']
|
||||
When the list has one character it is used for all.
|
||||
When the list has two characters the first is used for
|
||||
the border lines, the second for the corners.
|
||||
By default a double line is used all around when
|
||||
'encoding' is "utf-8" and 'ambiwidth' is "single",
|
||||
otherwise ASCII characters are used.
|
||||
scrollbar non-zero: show a scrollbar when the text doesn't fit.
|
||||
zero: do not show a scrollbar. Default is non-zero.
|
||||
Also see |popup-scrollbar|.
|
||||
scrollbarhighlight Highlight group name for the scrollbar. The
|
||||
background color is what matters. When not given then
|
||||
PmenuSbar is used.
|
||||
thumbhighlight Highlight group name for the scrollbar thumb. The
|
||||
background color is what matters. When not given then
|
||||
PmenuThumb is used.
|
||||
zindex Priority for the popup, default 50. Minimum value is
|
||||
1, maximum value is 32000.
|
||||
mask A list of lists with coordinates, defining parts of
|
||||
the popup that are transparent. See |popup-mask|.
|
||||
time Time in milliseconds after which the popup will close.
|
||||
When omitted |popup_close()| must be used.
|
||||
moved Specifies to close the popup if the cursor moved:
|
||||
- "any": if the cursor moved at all
|
||||
- "word": if the cursor moved outside |<cword>|
|
||||
- "WORD": if the cursor moved outside |<cWORD>|
|
||||
- [{start}, {end}]: if the cursor moved before column
|
||||
{start} or after {end}
|
||||
The popup also closes if the cursor moves to another
|
||||
line or to another window.
|
||||
filter A callback that can filter typed characters, see
|
||||
|popup-filter|.
|
||||
callback A callback that is called when the popup closes, e.g.
|
||||
when using |popup_filter_menu()|, see |popup-callback|.
|
||||
|
||||
Depending on the "zindex" the popup goes under or above other popups. The
|
||||
completion menu (|popup-menu|) has zindex 100. For messages that occur for a
|
||||
@@ -210,11 +586,15 @@ outside of the Vim window will not be displayed, thus truncated.
|
||||
|
||||
POPUP TEXT PROPERTIES *popup-props*
|
||||
|
||||
These are similar to the third argument of |prop_add()|, but not exactly the
|
||||
same, since they only apply to one line.
|
||||
These are similar to the third argument of |prop_add()| except:
|
||||
- "lnum" is always the current line in the list
|
||||
- "bufnr" is always the buffer of the popup
|
||||
- "col" is in the Dict instead of a separate argument
|
||||
So we get:
|
||||
col starting column, counted in bytes, use one for the
|
||||
first column.
|
||||
length length of text in bytes; can be zero
|
||||
end_lnum line number for the end of the text
|
||||
end_col column just after the text; not used when "length" is
|
||||
present; when {col} and "end_col" are equal, this is a
|
||||
zero-width text property
|
||||
@@ -222,41 +602,100 @@ same, since they only apply to one line.
|
||||
used
|
||||
type name of the text property type, as added with
|
||||
|prop_type_add()|
|
||||
transparent do not show these characters, show the text under it;
|
||||
if there is an border character to the right or below
|
||||
it will be made transparent as well
|
||||
|
||||
|
||||
POPUP FILTER *popup-filter*
|
||||
|
||||
A callback that gets any typed keys while a popup is displayed. It can return
|
||||
TRUE to indicate the key has been handled and is to be discarded, or FALSE to
|
||||
let Vim handle the key as usual in the current state.
|
||||
A callback that gets any typed keys while a popup is displayed. The filter is
|
||||
not invoked when the popup is hidden.
|
||||
|
||||
The filter can return TRUE to indicate the key has been handled and is to be
|
||||
discarded, or FALSE to let Vim handle the key as usual in the current state.
|
||||
In case it returns FALSE and there is another popup window visible, that
|
||||
filter is also called. The filter of the popup window with the highest zindex
|
||||
is called first.
|
||||
|
||||
The filter function is called with two arguments: the ID of the popup and the
|
||||
key.
|
||||
key as a string, e.g.: >
|
||||
func MyFilter(winid, key)
|
||||
if a:key == "\<F2>"
|
||||
" do something
|
||||
return 1
|
||||
endif
|
||||
if a:key == 'x'
|
||||
call popup_close(a:winid)
|
||||
return 1
|
||||
endif
|
||||
return 0
|
||||
endfunc
|
||||
|
||||
Currently the key is what results after any mapping. This may change...
|
||||
|
||||
Some common key actions:
|
||||
Esc close the popup
|
||||
x close the popup (see note below)
|
||||
cursor keys select another entry
|
||||
Tab accept current suggestion
|
||||
|
||||
A mouse click arrives as <LeftMouse>. The coordinates are in
|
||||
v:mouse_popup_col and v:mouse_popup_row. The top-left screen cell of the
|
||||
popup is col 1, row 1 (not counting the border).
|
||||
|
||||
Vim provides standard filters |popup_filter_menu()| and
|
||||
|popup_filter_yesno()|.
|
||||
|
||||
Note that "x" is the normal way to close a popup. You may want to use Esc,
|
||||
but since many keys start with an Esc character, there may be a delay before
|
||||
Vim recognizes the Esc key. If you do use Esc, it is recommended to set the
|
||||
'ttimeoutlen' option to 100 and set 'timeout' and/or 'ttimeout'.
|
||||
|
||||
|
||||
POPUP CALLBACK *popup-callback*
|
||||
|
||||
A callback that is invoked when the popup closes. Used by
|
||||
|popup_filter_menu()|. Invoked with two arguments: the ID of the popup and
|
||||
the result, which would usually be an index in the popup lines, or whatever
|
||||
the filter wants to pass.
|
||||
A callback that is invoked when the popup closes.
|
||||
|
||||
The callback is invoked with two arguments: the ID of the popup window and the
|
||||
result, which could be an index in the popup lines, or whatever was passed as
|
||||
the second argument of `popup_close()`.
|
||||
|
||||
If the popup is force-closed, e.g. because the cursor moved or CTRL-C was
|
||||
pressed, the number -1 is passed to the callback.
|
||||
|
||||
|
||||
POPUP SCROLLBAR *popup-scrollbar*
|
||||
|
||||
If the text does not fit in the popup a scrollbar is displayed on the right of
|
||||
the window. This can be disabled by setting the "scrollbar" option to zero.
|
||||
When the scrollbar is displayed mouse scroll events, while the mouse pointer
|
||||
is on the popup, will cause the text to scroll up or down as you would expect.
|
||||
A click in the upper halve of the scrollbar will scroll the text one line
|
||||
down. A click in the lower halve wil scroll the text one line up. However,
|
||||
this is limited so that the popup does not get smaller.
|
||||
|
||||
|
||||
POPUP MASK *popup-mask*
|
||||
|
||||
To minimize the text that the popup covers, parts of it can be made
|
||||
transparent. This is defined by a "mask" which is a list of lists, where each
|
||||
list has four numbers:
|
||||
col start column, positive for counting from the left, 1 for
|
||||
leftmost, negative for counting from the right, -1 for
|
||||
rightmost
|
||||
endcol last column, like "col"
|
||||
line start line, positive for conting from the top, 1 for top,
|
||||
negative for counting from the bottom, -1 for bottom
|
||||
endline end line, like "line"
|
||||
|
||||
For example, to make the last 10 columns of the last line transparent:
|
||||
[[-10, -1, -1, -1]]
|
||||
|
||||
To make the four corners transparent:
|
||||
[[1, 1, 1, 1], [-1, -1, 1, 1], [1, 1, -1, -1], [-1, -1, -1, -1]]
|
||||
|
||||
==============================================================================
|
||||
3. Examples *popup-examples*
|
||||
|
||||
TODO
|
||||
4. Examples *popup-examples*
|
||||
|
||||
TODO: more interesting examples
|
||||
*popup_dialog-example*
|
||||
Prompt the user to press y/Y or n/N: >
|
||||
|
||||
func MyDialogHandler(id, result)
|
||||
@@ -265,10 +704,37 @@ Prompt the user to press y/Y or n/N: >
|
||||
endif
|
||||
endfunc
|
||||
|
||||
call popup_show([{'text': 'Continue? y/n'}], {
|
||||
call popup_dialog('Continue? y/n', {
|
||||
\ 'filter': 'popup_filter_yesno',
|
||||
\ 'callback': 'MyDialogHandler',
|
||||
\ })
|
||||
<
|
||||
*popup_menu-shortcut-example*
|
||||
Extend popup_filter_menu() with shortcut keys: >
|
||||
|
||||
call popup_menu(['Save', 'Cancel', 'Discard'], {
|
||||
\ 'filter': 'MyMenuFilter',
|
||||
\ 'callback': 'MyMenuHandler',
|
||||
\ })
|
||||
|
||||
func MyMenuFilter(id, key)
|
||||
" Handle shortcuts
|
||||
if a:key == 'S'
|
||||
call popup_close(a:id, 1)
|
||||
return 1
|
||||
endif
|
||||
if a:key == 'C'
|
||||
call popup_close(a:id, 2)
|
||||
return 1
|
||||
endif
|
||||
if a:key == 'D'
|
||||
call popup_close(a:id, 3)
|
||||
return 1
|
||||
endif
|
||||
|
||||
" No shortcut, pass to generic filter
|
||||
return popup_filter_menu(a:id, a:key)
|
||||
endfunc
|
||||
<
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 8.1. Last change: 2019 May 05
|
||||
*quickfix.txt* For Vim version 8.1. Last change: 2019 Jun 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -102,7 +102,7 @@ processing a quickfix or location list command, it will be aborted.
|
||||
:ll[!] [nr] Same as ":cc", except the location list for the
|
||||
:[nr]ll[!] current window is used instead of the quickfix list.
|
||||
|
||||
*:cn* *:cnext* *E553*
|
||||
*:cn* *:cne* *:cnext* *E553*
|
||||
:[count]cn[ext][!] Display the [count] next error in the list that
|
||||
includes a file name. If there are no file names at
|
||||
all, go to the [count] next error. See |:cc| for
|
||||
@@ -246,7 +246,7 @@ processing a quickfix or location list command, it will be aborted.
|
||||
'encoding' option, you can use the 'makeencoding'
|
||||
option to specify the encoding.
|
||||
|
||||
*:lf* *:lfile*
|
||||
*:lf* *:lfi* *:lfile*
|
||||
:lf[ile][!] [errorfile] Same as ":cfile", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
You can not use the -q command-line option to set
|
||||
@@ -261,7 +261,7 @@ processing a quickfix or location list command, it will be aborted.
|
||||
option to specify the encoding.
|
||||
|
||||
|
||||
:lg[etfile] [errorfile] *:lg* *:lgetfile*
|
||||
:lg[etfile] [errorfile] *:lg* *:lge* *:lgetfile*
|
||||
Same as ":cgetfile", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
@@ -299,7 +299,7 @@ processing a quickfix or location list command, it will be aborted.
|
||||
the current window is used instead of the quickfix
|
||||
list.
|
||||
|
||||
*:cad* *:caddbuffer*
|
||||
*:cad* *:cadd* *:caddbuffer*
|
||||
:cad[dbuffer] [bufnr] Read the error list from the current buffer and add
|
||||
the errors to the current quickfix list. If a
|
||||
quickfix list is not present, then a new list is
|
||||
@@ -346,7 +346,7 @@ processing a quickfix or location list command, it will be aborted.
|
||||
Example: >
|
||||
:g/mypattern/caddexpr expand("%") . ":" . line(".") . ":" . getline(".")
|
||||
<
|
||||
*:lad* *:laddexpr*
|
||||
*:lad* *:addd* *:laddexpr*
|
||||
:lad[dexpr] {expr} Same as ":caddexpr", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 8.1. Last change: 2019 Apr 28
|
||||
*quickref.txt* For Vim version 8.1. Last change: 2019 May 31
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -798,6 +798,7 @@ Short explanation of each option: *option-list*
|
||||
'menuitems' 'mis' maximum number of items in a menu
|
||||
'mkspellmem' 'msm' memory used before |:mkspell| compresses the tree
|
||||
'modeline' 'ml' recognize modelines at start or end of file
|
||||
'modelineexpr' 'mle' allow setting expression options from a modeline
|
||||
'modelines' 'mls' number of lines checked for modelines
|
||||
'modifiable' 'ma' changes to the text are not possible
|
||||
'modified' 'mod' buffer has been modified
|
||||
@@ -981,6 +982,7 @@ Short explanation of each option: *option-list*
|
||||
'wildmode' 'wim' mode for 'wildchar' command-line expansion
|
||||
'wildoptions' 'wop' specifies how command line completion is done
|
||||
'winaltkeys' 'wak' when the windows system handles ALT keys
|
||||
'wincolor' 'wcr' window-local highlighting
|
||||
'window' 'wi' nr of lines to scroll for CTRL-F and CTRL-B
|
||||
'winheight' 'wh' minimum number of lines for the current window
|
||||
'winfixheight' 'wfh' keep window height when opening/closing windows
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 8.1. Last change: 2019 May 07
|
||||
*repeat.txt* For Vim version 8.1. Last change: 2019 Jun 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -178,7 +178,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
:so[urce] {file} Read Ex commands from {file}. These are commands that
|
||||
start with a ":".
|
||||
Triggers the |SourcePre| autocommand.
|
||||
|
||||
*:source!*
|
||||
:so[urce]! {file} Read Vim commands from {file}. These are commands
|
||||
that are executed from Normal mode, like you type
|
||||
them.
|
||||
@@ -186,6 +186,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
|:bufdo|, in a loop or when another command follows
|
||||
the display won't be updated while executing the
|
||||
commands.
|
||||
Cannot be used in the |sandbox|.
|
||||
|
||||
*:ru* *:runtime*
|
||||
:ru[ntime][!] [where] {file} ..
|
||||
@@ -279,9 +280,16 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
after loading your .vimrc file. With this command it
|
||||
can be done earlier.
|
||||
|
||||
Packages will be loaded only once. After this command
|
||||
it won't happen again. When the optional ! is added
|
||||
this command will load packages even when done before.
|
||||
Packages will be loaded only once. Using
|
||||
`:packloadall` a second time will have no effect.
|
||||
When the optional ! is added this command will load
|
||||
packages even when done before.
|
||||
|
||||
Note that when using `:packloadall` in the |vimrc|
|
||||
file, the 'runtimepath' option is updated, and later
|
||||
all plugins in 'runtimepath' will be loaded, which
|
||||
means they are loaded again. Plugins are expected to
|
||||
handle that.
|
||||
|
||||
An error only causes sourcing the script where it
|
||||
happens to be aborted, further plugins will be loaded.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*scroll.txt* For Vim version 8.1. Last change: 2019 May 05
|
||||
*scroll.txt* For Vim version 8.1. Last change: 2019 May 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -82,9 +82,6 @@ CTRL-U Scroll window Upwards in the buffer. The number of
|
||||
may be a difference). When the cursor is on the first
|
||||
line of the buffer nothing happens and a beep is
|
||||
produced. See also 'startofline' option.
|
||||
{difference from vi: Vim scrolls 'scroll' screen
|
||||
lines, instead of file lines; makes a difference when
|
||||
lines wrap}
|
||||
|
||||
<S-Up> or *<S-Up>* *<kPageUp>*
|
||||
<PageUp> or *<PageUp>* *CTRL-B*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*sign.txt* For Vim version 8.1. Last change: 2019 May 05
|
||||
*sign.txt* For Vim version 8.1. Last change: 2019 Jun 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Gordon Prieur
|
||||
@@ -182,9 +182,9 @@ See |sign_place()| for the equivalent Vim script function.
|
||||
|
||||
By default, the sign is assigned a default priority of 10. To
|
||||
assign a different priority value, use "priority={prio}" to
|
||||
specify a value. The priority is used to determine the
|
||||
highlight group used when multiple signs are placed on the
|
||||
same line.
|
||||
specify a value. The priority is used to determine the sign
|
||||
that is displayed when multiple signs are placed on the same
|
||||
line.
|
||||
|
||||
Examples: >
|
||||
:sign place 5 line=3 name=sign1 file=a.py
|
||||
@@ -204,7 +204,9 @@ See |sign_place()| for the equivalent Vim script function.
|
||||
it (e.g., when the debugger has stopped at a breakpoint).
|
||||
|
||||
The optional "group={group}" attribute can be used before
|
||||
"file=" to select a sign in a particular group.
|
||||
"file=" to select a sign in a particular group. The optional
|
||||
"priority={prio}" attribute can be used to change the priority
|
||||
of an existing sign.
|
||||
|
||||
:sign place {id} name={name} [buffer={nr}]
|
||||
Same, but use buffer {nr}. If the buffer argument is not
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*starting.txt* For Vim version 8.1. Last change: 2019 May 05
|
||||
*starting.txt* For Vim version 8.1. Last change: 2019 Jun 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1252,7 +1252,7 @@ vimrc file.
|
||||
options to [file] (default ".exrc" in the current
|
||||
directory).
|
||||
|
||||
*:mkv* *:mkvimrc*
|
||||
*:mkv* *:mkvi* *:mkvimrc*
|
||||
:mkv[imrc][!] [file] Like ":mkexrc", but the default is ".vimrc" in the
|
||||
current directory. The ":version" command is also
|
||||
written to the file.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 8.1. Last change: 2019 Mar 29
|
||||
*syntax.txt* For Vim version 8.1. Last change: 2019 Jun 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -3140,7 +3140,7 @@ in your <.vimrc>, and :set fdm=syntax. I suggest doing the latter via a
|
||||
modeline at the end of your LaTeX file: >
|
||||
% vim: fdm=syntax
|
||||
If your system becomes too slow, then you might wish to look into >
|
||||
https://vimhelp.appspot.com/vim_faq.txt.html#faq-29.7
|
||||
https://vimhelp.org/vim_faq.txt.html#faq-29.7
|
||||
<
|
||||
*g:tex_nospell*
|
||||
Tex: No Spell Checking Wanted~
|
||||
@@ -4827,8 +4827,9 @@ cterm={attr-list} *highlight-cterm*
|
||||
The "cterm" argument is likely to be different from "term", when
|
||||
colors are used. For example, in a normal terminal comments could
|
||||
be underlined, in a color terminal they can be made Blue.
|
||||
Note: Many terminals (e.g., DOS console) can't mix these attributes
|
||||
with coloring. Use only one of "cterm=" OR "ctermfg=" OR "ctermbg=".
|
||||
Note: Some terminals (e.g., DOS console) can't mix these attributes
|
||||
with coloring. To be portable, use only one of "cterm=" OR "ctermfg="
|
||||
OR "ctermbg=".
|
||||
|
||||
ctermfg={color-nr} *highlight-ctermfg* *E421*
|
||||
ctermbg={color-nr} *highlight-ctermbg*
|
||||
@@ -5209,6 +5210,15 @@ load the syntax file.
|
||||
The command also deletes the "b:current_syntax" variable, since no syntax is
|
||||
loaded after this command.
|
||||
|
||||
To clean up specific syntax groups for the current buffer: >
|
||||
:syntax clear {group-name} ..
|
||||
This removes all patterns and keywords for {group-name}.
|
||||
|
||||
To clean up specific syntax group lists for the current buffer: >
|
||||
:syntax clear @{grouplist-name} ..
|
||||
This sets {grouplist-name}'s contents to an empty list.
|
||||
|
||||
*:syntax-off* *:syn-off*
|
||||
If you want to disable syntax highlighting for all buffers, you need to remove
|
||||
the autocommands that load the syntax files: >
|
||||
:syntax off
|
||||
@@ -5218,14 +5228,6 @@ What this command actually does, is executing the command >
|
||||
See the "nosyntax.vim" file for details. Note that for this to work
|
||||
$VIMRUNTIME must be valid. See |$VIMRUNTIME|.
|
||||
|
||||
To clean up specific syntax groups for the current buffer: >
|
||||
:syntax clear {group-name} ..
|
||||
This removes all patterns and keywords for {group-name}.
|
||||
|
||||
To clean up specific syntax group lists for the current buffer: >
|
||||
:syntax clear @{grouplist-name} ..
|
||||
This sets {grouplist-name}'s contents to an empty list.
|
||||
|
||||
*:syntax-reset* *:syn-reset*
|
||||
If you have changed the colors and messed them up, use this command to get the
|
||||
defaults back: >
|
||||
|
||||
163
runtime/doc/tags
163
runtime/doc/tags
@@ -455,6 +455,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'mis' options.txt /*'mis'*
|
||||
'mkspellmem' options.txt /*'mkspellmem'*
|
||||
'ml' options.txt /*'ml'*
|
||||
'mle' options.txt /*'mle'*
|
||||
'mls' options.txt /*'mls'*
|
||||
'mm' options.txt /*'mm'*
|
||||
'mmd' options.txt /*'mmd'*
|
||||
@@ -462,6 +463,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'mmt' options.txt /*'mmt'*
|
||||
'mod' options.txt /*'mod'*
|
||||
'modeline' options.txt /*'modeline'*
|
||||
'modelineexpr' options.txt /*'modelineexpr'*
|
||||
'modelines' options.txt /*'modelines'*
|
||||
'modifiable' options.txt /*'modifiable'*
|
||||
'modified' options.txt /*'modified'*
|
||||
@@ -617,8 +619,10 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'nomagic' options.txt /*'nomagic'*
|
||||
'nomh' options.txt /*'nomh'*
|
||||
'noml' options.txt /*'noml'*
|
||||
'nomle' options.txt /*'nomle'*
|
||||
'nomod' options.txt /*'nomod'*
|
||||
'nomodeline' options.txt /*'nomodeline'*
|
||||
'nomodelineexpr' options.txt /*'nomodelineexpr'*
|
||||
'nomodifiable' options.txt /*'nomodifiable'*
|
||||
'nomodified' options.txt /*'nomodified'*
|
||||
'nomore' options.txt /*'nomore'*
|
||||
@@ -1181,6 +1185,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'wb' options.txt /*'wb'*
|
||||
'wc' options.txt /*'wc'*
|
||||
'wcm' options.txt /*'wcm'*
|
||||
'wcr' options.txt /*'wcr'*
|
||||
'wd' options.txt /*'wd'*
|
||||
'weirdinvert' options.txt /*'weirdinvert'*
|
||||
'wfh' options.txt /*'wfh'*
|
||||
@@ -1199,6 +1204,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'wildoptions' options.txt /*'wildoptions'*
|
||||
'wim' options.txt /*'wim'*
|
||||
'winaltkeys' options.txt /*'winaltkeys'*
|
||||
'wincolor' options.txt /*'wincolor'*
|
||||
'window' options.txt /*'window'*
|
||||
'winfixheight' options.txt /*'winfixheight'*
|
||||
'winfixwidth' options.txt /*'winfixwidth'*
|
||||
@@ -1345,6 +1351,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
+scrollbind various.txt /*+scrollbind*
|
||||
+signs various.txt /*+signs*
|
||||
+smartindent various.txt /*+smartindent*
|
||||
+sound various.txt /*+sound*
|
||||
+spell various.txt /*+spell*
|
||||
+startuptime various.txt /*+startuptime*
|
||||
+statusline various.txt /*+statusline*
|
||||
+sun_workshop various.txt /*+sun_workshop*
|
||||
@@ -2043,6 +2051,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:abclear map.txt /*:abclear*
|
||||
:abo windows.txt /*:abo*
|
||||
:aboveleft windows.txt /*:aboveleft*
|
||||
:addd quickfix.txt /*:addd*
|
||||
:al windows.txt /*:al*
|
||||
:all windows.txt /*:all*
|
||||
:am gui.txt /*:am*
|
||||
@@ -2051,6 +2060,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:anoremenu gui.txt /*:anoremenu*
|
||||
:append insert.txt /*:append*
|
||||
:ar editing.txt /*:ar*
|
||||
:arg editing.txt /*:arg*
|
||||
:arga editing.txt /*:arga*
|
||||
:argadd editing.txt /*:argadd*
|
||||
:argd editing.txt /*:argd*
|
||||
@@ -2103,6 +2113,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:bp windows.txt /*:bp*
|
||||
:bprevious windows.txt /*:bprevious*
|
||||
:br windows.txt /*:br*
|
||||
:bre windows.txt /*:bre*
|
||||
:brea eval.txt /*:brea*
|
||||
:break eval.txt /*:break*
|
||||
:breaka repeat.txt /*:breaka*
|
||||
@@ -2132,12 +2143,14 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:cNf quickfix.txt /*:cNf*
|
||||
:cNfile quickfix.txt /*:cNfile*
|
||||
:ca map.txt /*:ca*
|
||||
:cab map.txt /*:cab*
|
||||
:cabbrev map.txt /*:cabbrev*
|
||||
:cabc map.txt /*:cabc*
|
||||
:cabclear map.txt /*:cabclear*
|
||||
:cabo quickfix.txt /*:cabo*
|
||||
:cabove quickfix.txt /*:cabove*
|
||||
:cad quickfix.txt /*:cad*
|
||||
:cadd quickfix.txt /*:cadd*
|
||||
:caddbuffer quickfix.txt /*:caddbuffer*
|
||||
:cadde quickfix.txt /*:cadde*
|
||||
:caddexpr quickfix.txt /*:caddexpr*
|
||||
@@ -2184,6 +2197,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:chd editing.txt /*:chd*
|
||||
:chdir editing.txt /*:chdir*
|
||||
:che tagsrch.txt /*:che*
|
||||
:chec tagsrch.txt /*:chec*
|
||||
:check tagsrch.txt /*:check*
|
||||
:checkpath tagsrch.txt /*:checkpath*
|
||||
:checkt editing.txt /*:checkt*
|
||||
:checktime editing.txt /*:checktime*
|
||||
@@ -2205,12 +2220,14 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:cme gui.txt /*:cme*
|
||||
:cmenu gui.txt /*:cmenu*
|
||||
:cn quickfix.txt /*:cn*
|
||||
:cne quickfix.txt /*:cne*
|
||||
:cnew quickfix.txt /*:cnew*
|
||||
:cnewer quickfix.txt /*:cnewer*
|
||||
:cnext quickfix.txt /*:cnext*
|
||||
:cnf quickfix.txt /*:cnf*
|
||||
:cnfile quickfix.txt /*:cnfile*
|
||||
:cno map.txt /*:cno*
|
||||
:cnor map.txt /*:cnor*
|
||||
:cnorea map.txt /*:cnorea*
|
||||
:cnoreabbrev map.txt /*:cnoreabbrev*
|
||||
:cnoremap map.txt /*:cnoremap*
|
||||
@@ -2244,6 +2261,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:con eval.txt /*:con*
|
||||
:conf editing.txt /*:conf*
|
||||
:confirm editing.txt /*:confirm*
|
||||
:cons eval.txt /*:cons*
|
||||
:const eval.txt /*:const*
|
||||
:continue eval.txt /*:continue*
|
||||
:cope quickfix.txt /*:cope*
|
||||
:copen quickfix.txt /*:copen*
|
||||
@@ -2261,6 +2280,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:cscope if_cscop.txt /*:cscope*
|
||||
:cstag if_cscop.txt /*:cstag*
|
||||
:cu map.txt /*:cu*
|
||||
:cun map.txt /*:cun*
|
||||
:cuna map.txt /*:cuna*
|
||||
:cunabbrev map.txt /*:cunabbrev*
|
||||
:cunmap map.txt /*:cunmap*
|
||||
@@ -2285,6 +2305,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:delmarks motion.txt /*:delmarks*
|
||||
:di change.txt /*:di*
|
||||
:dif diff.txt /*:dif*
|
||||
:diff diff.txt /*:diff*
|
||||
:diffg diff.txt /*:diffg*
|
||||
:diffget diff.txt /*:diffget*
|
||||
:diffo diff.txt /*:diffo*
|
||||
@@ -2308,6 +2329,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:dlist tagsrch.txt /*:dlist*
|
||||
:do autocmd.txt /*:do*
|
||||
:doau autocmd.txt /*:doau*
|
||||
:doaut autocmd.txt /*:doaut*
|
||||
:doautoa autocmd.txt /*:doautoa*
|
||||
:doautoall autocmd.txt /*:doautoall*
|
||||
:doautocmd autocmd.txt /*:doautocmd*
|
||||
@@ -2342,6 +2364,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:em gui.txt /*:em*
|
||||
:emenu gui.txt /*:emenu*
|
||||
:en eval.txt /*:en*
|
||||
:end eval.txt /*:end*
|
||||
:endf eval.txt /*:endf*
|
||||
:endfo eval.txt /*:endfo*
|
||||
:endfor eval.txt /*:endfor*
|
||||
@@ -2394,6 +2417,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:foldc fold.txt /*:foldc*
|
||||
:foldclose fold.txt /*:foldclose*
|
||||
:foldd fold.txt /*:foldd*
|
||||
:folddo fold.txt /*:folddo*
|
||||
:folddoc fold.txt /*:folddoc*
|
||||
:folddoclosed fold.txt /*:folddoclosed*
|
||||
:folddoopen fold.txt /*:folddoopen*
|
||||
@@ -2465,6 +2489,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:in insert.txt /*:in*
|
||||
:index index.txt /*:index*
|
||||
:ino map.txt /*:ino*
|
||||
:inor map.txt /*:inor*
|
||||
:inorea map.txt /*:inorea*
|
||||
:inoreabbrev map.txt /*:inoreabbrev*
|
||||
:inoremap map.txt /*:inoremap*
|
||||
@@ -2488,6 +2513,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:jumps motion.txt /*:jumps*
|
||||
:k motion.txt /*:k*
|
||||
:kee motion.txt /*:kee*
|
||||
:keep motion.txt /*:keep*
|
||||
:keepa editing.txt /*:keepa*
|
||||
:keepalt editing.txt /*:keepalt*
|
||||
:keepj motion.txt /*:keepj*
|
||||
@@ -2546,21 +2572,25 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:let-= eval.txt /*:let-=*
|
||||
:let-@ eval.txt /*:let-@*
|
||||
:let-environment eval.txt /*:let-environment*
|
||||
:let-heredoc eval.txt /*:let-heredoc*
|
||||
:let-option eval.txt /*:let-option*
|
||||
:let-register eval.txt /*:let-register*
|
||||
:let-unpack eval.txt /*:let-unpack*
|
||||
:let..= eval.txt /*:let..=*
|
||||
:let.= eval.txt /*:let.=*
|
||||
:let/= eval.txt /*:let\/=*
|
||||
:let=<< eval.txt /*:let=<<*
|
||||
:letstar= eval.txt /*:letstar=*
|
||||
:lex quickfix.txt /*:lex*
|
||||
:lexpr quickfix.txt /*:lexpr*
|
||||
:lf quickfix.txt /*:lf*
|
||||
:lfdo quickfix.txt /*:lfdo*
|
||||
:lfi quickfix.txt /*:lfi*
|
||||
:lfile quickfix.txt /*:lfile*
|
||||
:lfir quickfix.txt /*:lfir*
|
||||
:lfirst quickfix.txt /*:lfirst*
|
||||
:lg quickfix.txt /*:lg*
|
||||
:lge quickfix.txt /*:lge*
|
||||
:lgetb quickfix.txt /*:lgetb*
|
||||
:lgetbuffer quickfix.txt /*:lgetbuffer*
|
||||
:lgete quickfix.txt /*:lgete*
|
||||
@@ -2581,6 +2611,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:lli quickfix.txt /*:lli*
|
||||
:llist quickfix.txt /*:llist*
|
||||
:lm map.txt /*:lm*
|
||||
:lma map.txt /*:lma*
|
||||
:lmak quickfix.txt /*:lmak*
|
||||
:lmake quickfix.txt /*:lmake*
|
||||
:lmap map.txt /*:lmap*
|
||||
@@ -2600,6 +2631,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:loadkeymap mbyte.txt /*:loadkeymap*
|
||||
:loadview starting.txt /*:loadview*
|
||||
:loc motion.txt /*:loc*
|
||||
:lock motion.txt /*:lock*
|
||||
:lockmarks motion.txt /*:lockmarks*
|
||||
:lockv eval.txt /*:lockv*
|
||||
:lockvar eval.txt /*:lockvar*
|
||||
@@ -2689,6 +2721,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:mksp spell.txt /*:mksp*
|
||||
:mkspell spell.txt /*:mkspell*
|
||||
:mkv starting.txt /*:mkv*
|
||||
:mkvi starting.txt /*:mkvi*
|
||||
:mkvie starting.txt /*:mkvie*
|
||||
:mkview starting.txt /*:mkview*
|
||||
:mkvimrc starting.txt /*:mkvimrc*
|
||||
@@ -2983,6 +3016,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:setl options.txt /*:setl*
|
||||
:setlocal options.txt /*:setlocal*
|
||||
:sf windows.txt /*:sf*
|
||||
:sfi windows.txt /*:sfi*
|
||||
:sfind windows.txt /*:sfind*
|
||||
:sfir windows.txt /*:sfir*
|
||||
:sfirst windows.txt /*:sfirst*
|
||||
@@ -3036,6 +3070,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:sno change.txt /*:sno*
|
||||
:snomagic change.txt /*:snomagic*
|
||||
:snor map.txt /*:snor*
|
||||
:snore map.txt /*:snore*
|
||||
:snoremap map.txt /*:snoremap*
|
||||
:snoreme gui.txt /*:snoreme*
|
||||
:snoremenu gui.txt /*:snoremenu*
|
||||
@@ -3043,6 +3078,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:sor change.txt /*:sor*
|
||||
:sort change.txt /*:sort*
|
||||
:source repeat.txt /*:source*
|
||||
:source! repeat.txt /*:source!*
|
||||
:source_crnl repeat.txt /*:source_crnl*
|
||||
:sp windows.txt /*:sp*
|
||||
:spe spell.txt /*:spe*
|
||||
@@ -3137,7 +3173,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:syn-matchgroup syntax.txt /*:syn-matchgroup*
|
||||
:syn-multi-line syntax.txt /*:syn-multi-line*
|
||||
:syn-nextgroup syntax.txt /*:syn-nextgroup*
|
||||
:syn-off usr_06.txt /*:syn-off*
|
||||
:syn-off syntax.txt /*:syn-off*
|
||||
:syn-on syntax.txt /*:syn-on*
|
||||
:syn-oneline syntax.txt /*:syn-oneline*
|
||||
:syn-pattern syntax.txt /*:syn-pattern*
|
||||
@@ -3166,6 +3202,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:syncbind scroll.txt /*:syncbind*
|
||||
:syntax syntax.txt /*:syntax*
|
||||
:syntax-enable syntax.txt /*:syntax-enable*
|
||||
:syntax-off syntax.txt /*:syntax-off*
|
||||
:syntax-on syntax.txt /*:syntax-on*
|
||||
:syntax-reset syntax.txt /*:syntax-reset*
|
||||
:syntime syntax.txt /*:syntime*
|
||||
@@ -3282,6 +3319,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:update editing.txt /*:update*
|
||||
:v repeat.txt /*:v*
|
||||
:ve various.txt /*:ve*
|
||||
:ver various.txt /*:ver*
|
||||
:verb various.txt /*:verb*
|
||||
:verbose various.txt /*:verbose*
|
||||
:verbose-cmd various.txt /*:verbose-cmd*
|
||||
@@ -4688,12 +4726,12 @@ E95 message.txt /*E95*
|
||||
E950 message.txt /*E950*
|
||||
E951 pattern.txt /*E951*
|
||||
E952 autocmd.txt /*E952*
|
||||
E953 eval.txt /*E953*
|
||||
E953 terminal.txt /*E953*
|
||||
E954 options.txt /*E954*
|
||||
E955 eval.txt /*E955*
|
||||
E955 terminal.txt /*E955*
|
||||
E956 pattern.txt /*E956*
|
||||
E957 eval.txt /*E957*
|
||||
E958 eval.txt /*E958*
|
||||
E958 terminal.txt /*E958*
|
||||
E96 diff.txt /*E96*
|
||||
E960 options.txt /*E960*
|
||||
E961 cmdline.txt /*E961*
|
||||
@@ -4726,7 +4764,16 @@ E985 eval.txt /*E985*
|
||||
E986 tagsrch.txt /*E986*
|
||||
E987 tagsrch.txt /*E987*
|
||||
E988 gui_w32.txt /*E988*
|
||||
E989 eval.txt /*E989*
|
||||
E99 diff.txt /*E99*
|
||||
E990 eval.txt /*E990*
|
||||
E991 eval.txt /*E991*
|
||||
E992 options.txt /*E992*
|
||||
E993 popup.txt /*E993*
|
||||
E994 eval.txt /*E994*
|
||||
E995 eval.txt /*E995*
|
||||
E996 eval.txt /*E996*
|
||||
E997 popup.txt /*E997*
|
||||
E999 repeat.txt /*E999*
|
||||
EX intro.txt /*EX*
|
||||
EXINIT starting.txt /*EXINIT*
|
||||
@@ -5371,6 +5418,7 @@ break-finally eval.txt /*break-finally*
|
||||
browse() eval.txt /*browse()*
|
||||
browsedir() eval.txt /*browsedir()*
|
||||
browsefilter editing.txt /*browsefilter*
|
||||
bufadd() eval.txt /*bufadd()*
|
||||
bufexists() eval.txt /*bufexists()*
|
||||
buffer-functions usr_41.txt /*buffer-functions*
|
||||
buffer-hidden windows.txt /*buffer-hidden*
|
||||
@@ -5383,6 +5431,7 @@ buffer_number() eval.txt /*buffer_number()*
|
||||
buffers windows.txt /*buffers*
|
||||
buffers-menu gui.txt /*buffers-menu*
|
||||
buflisted() eval.txt /*buflisted()*
|
||||
bufload() eval.txt /*bufload()*
|
||||
bufloaded() eval.txt /*bufloaded()*
|
||||
bufname() eval.txt /*bufname()*
|
||||
bufnr() eval.txt /*bufnr()*
|
||||
@@ -6096,6 +6145,7 @@ exp() eval.txt /*exp()*
|
||||
expand() eval.txt /*expand()*
|
||||
expand-env options.txt /*expand-env*
|
||||
expand-environment-var options.txt /*expand-environment-var*
|
||||
expandcmd() eval.txt /*expandcmd()*
|
||||
expr eval.txt /*expr*
|
||||
expr-! eval.txt /*expr-!*
|
||||
expr-!= eval.txt /*expr-!=*
|
||||
@@ -6477,6 +6527,7 @@ g:Netrw_UserMaps pi_netrw.txt /*g:Netrw_UserMaps*
|
||||
g:Netrw_corehandler pi_netrw.txt /*g:Netrw_corehandler*
|
||||
g:Netrw_funcref pi_netrw.txt /*g:Netrw_funcref*
|
||||
g:actual_curbuf options.txt /*g:actual_curbuf*
|
||||
g:actual_curwin options.txt /*g:actual_curwin*
|
||||
g:ada#Comment ft_ada.txt /*g:ada#Comment*
|
||||
g:ada#Ctags_Kinds ft_ada.txt /*g:ada#Ctags_Kinds*
|
||||
g:ada#DotWordRegex ft_ada.txt /*g:ada#DotWordRegex*
|
||||
@@ -6667,6 +6718,7 @@ g:rustfmt_autosave ft_rust.txt /*g:rustfmt_autosave*
|
||||
g:rustfmt_command ft_rust.txt /*g:rustfmt_command*
|
||||
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*
|
||||
g:syntax_on syntax.txt /*g:syntax_on*
|
||||
g:tar_browseoptions pi_tar.txt /*g:tar_browseoptions*
|
||||
g:tar_cmd pi_tar.txt /*g:tar_cmd*
|
||||
@@ -7412,6 +7464,9 @@ list-index eval.txt /*list-index*
|
||||
list-modification eval.txt /*list-modification*
|
||||
list-repeat windows.txt /*list-repeat*
|
||||
list2str() eval.txt /*list2str()*
|
||||
listener_add() eval.txt /*listener_add()*
|
||||
listener_flush() eval.txt /*listener_flush()*
|
||||
listener_remove() eval.txt /*listener_remove()*
|
||||
lite.vim syntax.txt /*lite.vim*
|
||||
literal-string eval.txt /*literal-string*
|
||||
lnum-variable eval.txt /*lnum-variable*
|
||||
@@ -8049,6 +8104,7 @@ option-summary options.txt /*option-summary*
|
||||
option-window options.txt /*option-window*
|
||||
option_restore() todo.txt /*option_restore()*
|
||||
option_save() todo.txt /*option_save()*
|
||||
optional-function-argument eval.txt /*optional-function-argument*
|
||||
options options.txt /*options*
|
||||
options-changed version5.txt /*options-changed*
|
||||
options-in-terminal terminal.txt /*options-in-terminal*
|
||||
@@ -8095,6 +8151,7 @@ paragraph motion.txt /*paragraph*
|
||||
pascal.vim syntax.txt /*pascal.vim*
|
||||
patches-8 version8.txt /*patches-8*
|
||||
patches-8.1 version8.txt /*patches-8.1*
|
||||
patches-8.2 version8.txt /*patches-8.2*
|
||||
pathshorten() eval.txt /*pathshorten()*
|
||||
pattern pattern.txt /*pattern*
|
||||
pattern-atoms pattern.txt /*pattern-atoms*
|
||||
@@ -8164,8 +8221,44 @@ plugin-special usr_41.txt /*plugin-special*
|
||||
pmbcs-option print.txt /*pmbcs-option*
|
||||
pmbfn-option print.txt /*pmbfn-option*
|
||||
popt-option print.txt /*popt-option*
|
||||
popup popup.txt /*popup*
|
||||
popup-buffer popup.txt /*popup-buffer*
|
||||
popup-callback popup.txt /*popup-callback*
|
||||
popup-close popup.txt /*popup-close*
|
||||
popup-examples popup.txt /*popup-examples*
|
||||
popup-filter popup.txt /*popup-filter*
|
||||
popup-function-details popup.txt /*popup-function-details*
|
||||
popup-functions popup.txt /*popup-functions*
|
||||
popup-intro popup.txt /*popup-intro*
|
||||
popup-mask popup.txt /*popup-mask*
|
||||
popup-menu gui.txt /*popup-menu*
|
||||
popup-menu-added version5.txt /*popup-menu-added*
|
||||
popup-position popup.txt /*popup-position*
|
||||
popup-props popup.txt /*popup-props*
|
||||
popup-scrollbar popup.txt /*popup-scrollbar*
|
||||
popup-usage popup.txt /*popup-usage*
|
||||
popup-window popup.txt /*popup-window*
|
||||
popup-window-functions usr_41.txt /*popup-window-functions*
|
||||
popup.txt popup.txt /*popup.txt*
|
||||
popup_atcursor() popup.txt /*popup_atcursor()*
|
||||
popup_clear() popup.txt /*popup_clear()*
|
||||
popup_close() popup.txt /*popup_close()*
|
||||
popup_create() popup.txt /*popup_create()*
|
||||
popup_create-arguments popup.txt /*popup_create-arguments*
|
||||
popup_dialog() popup.txt /*popup_dialog()*
|
||||
popup_dialog-example popup.txt /*popup_dialog-example*
|
||||
popup_filter_menu() popup.txt /*popup_filter_menu()*
|
||||
popup_filter_yesno() popup.txt /*popup_filter_yesno()*
|
||||
popup_getoptions() popup.txt /*popup_getoptions()*
|
||||
popup_getpos() popup.txt /*popup_getpos()*
|
||||
popup_hide() popup.txt /*popup_hide()*
|
||||
popup_menu() popup.txt /*popup_menu()*
|
||||
popup_menu-shortcut-example popup.txt /*popup_menu-shortcut-example*
|
||||
popup_move() popup.txt /*popup_move()*
|
||||
popup_notification() popup.txt /*popup_notification()*
|
||||
popup_setoptions() popup.txt /*popup_setoptions()*
|
||||
popup_settext() popup.txt /*popup_settext()*
|
||||
popup_show() popup.txt /*popup_show()*
|
||||
popupmenu-completion insert.txt /*popupmenu-completion*
|
||||
popupmenu-keys insert.txt /*popupmenu-keys*
|
||||
ports-5.2 version5.txt /*ports-5.2*
|
||||
@@ -8506,6 +8599,9 @@ script-variable eval.txt /*script-variable*
|
||||
scriptnames-dictionary eval.txt /*scriptnames-dictionary*
|
||||
scriptout-changed version4.txt /*scriptout-changed*
|
||||
scriptversion eval.txt /*scriptversion*
|
||||
scriptversion-1 eval.txt /*scriptversion-1*
|
||||
scriptversion-2 eval.txt /*scriptversion-2*
|
||||
scriptversion-3 eval.txt /*scriptversion-3*
|
||||
scroll-binding scroll.txt /*scroll-binding*
|
||||
scroll-cursor scroll.txt /*scroll-cursor*
|
||||
scroll-down scroll.txt /*scroll-down*
|
||||
@@ -8615,6 +8711,10 @@ slow-terminal term.txt /*slow-terminal*
|
||||
socket-interface channel.txt /*socket-interface*
|
||||
sort() eval.txt /*sort()*
|
||||
sorting change.txt /*sorting*
|
||||
sound_clear() eval.txt /*sound_clear()*
|
||||
sound_playevent() eval.txt /*sound_playevent()*
|
||||
sound_playfile() eval.txt /*sound_playfile()*
|
||||
sound_stop() eval.txt /*sound_stop()*
|
||||
soundfold() eval.txt /*soundfold()*
|
||||
space intro.txt /*space*
|
||||
spec-customizing pi_spec.txt /*spec-customizing*
|
||||
@@ -9170,29 +9270,29 @@ term++open terminal.txt /*term++open*
|
||||
term-dependent-settings term.txt /*term-dependent-settings*
|
||||
term-list syntax.txt /*term-list*
|
||||
term.txt term.txt /*term.txt*
|
||||
term_dumpdiff() eval.txt /*term_dumpdiff()*
|
||||
term_dumpload() eval.txt /*term_dumpload()*
|
||||
term_dumpwrite() eval.txt /*term_dumpwrite()*
|
||||
term_getaltscreen() eval.txt /*term_getaltscreen()*
|
||||
term_getansicolors() eval.txt /*term_getansicolors()*
|
||||
term_getattr() eval.txt /*term_getattr()*
|
||||
term_getcursor() eval.txt /*term_getcursor()*
|
||||
term_getjob() eval.txt /*term_getjob()*
|
||||
term_getline() eval.txt /*term_getline()*
|
||||
term_getscrolled() eval.txt /*term_getscrolled()*
|
||||
term_getsize() eval.txt /*term_getsize()*
|
||||
term_getstatus() eval.txt /*term_getstatus()*
|
||||
term_gettitle() eval.txt /*term_gettitle()*
|
||||
term_gettty() eval.txt /*term_gettty()*
|
||||
term_list() eval.txt /*term_list()*
|
||||
term_scrape() eval.txt /*term_scrape()*
|
||||
term_sendkeys() eval.txt /*term_sendkeys()*
|
||||
term_setansicolors() eval.txt /*term_setansicolors()*
|
||||
term_setkill() eval.txt /*term_setkill()*
|
||||
term_setrestore() eval.txt /*term_setrestore()*
|
||||
term_setsize() eval.txt /*term_setsize()*
|
||||
term_start() eval.txt /*term_start()*
|
||||
term_wait() eval.txt /*term_wait()*
|
||||
term_dumpdiff() terminal.txt /*term_dumpdiff()*
|
||||
term_dumpload() terminal.txt /*term_dumpload()*
|
||||
term_dumpwrite() terminal.txt /*term_dumpwrite()*
|
||||
term_getaltscreen() terminal.txt /*term_getaltscreen()*
|
||||
term_getansicolors() terminal.txt /*term_getansicolors()*
|
||||
term_getattr() terminal.txt /*term_getattr()*
|
||||
term_getcursor() terminal.txt /*term_getcursor()*
|
||||
term_getjob() terminal.txt /*term_getjob()*
|
||||
term_getline() terminal.txt /*term_getline()*
|
||||
term_getscrolled() terminal.txt /*term_getscrolled()*
|
||||
term_getsize() terminal.txt /*term_getsize()*
|
||||
term_getstatus() terminal.txt /*term_getstatus()*
|
||||
term_gettitle() terminal.txt /*term_gettitle()*
|
||||
term_gettty() terminal.txt /*term_gettty()*
|
||||
term_list() terminal.txt /*term_list()*
|
||||
term_scrape() terminal.txt /*term_scrape()*
|
||||
term_sendkeys() terminal.txt /*term_sendkeys()*
|
||||
term_setansicolors() terminal.txt /*term_setansicolors()*
|
||||
term_setkill() terminal.txt /*term_setkill()*
|
||||
term_setrestore() terminal.txt /*term_setrestore()*
|
||||
term_setsize() terminal.txt /*term_setsize()*
|
||||
term_start() terminal.txt /*term_start()*
|
||||
term_wait() terminal.txt /*term_wait()*
|
||||
termcap term.txt /*termcap*
|
||||
termcap-changed version4.txt /*termcap-changed*
|
||||
termcap-colors term.txt /*termcap-colors*
|
||||
@@ -9223,6 +9323,7 @@ terminal-debugger terminal.txt /*terminal-debugger*
|
||||
terminal-diff terminal.txt /*terminal-diff*
|
||||
terminal-diffscreendump terminal.txt /*terminal-diffscreendump*
|
||||
terminal-dumptest terminal.txt /*terminal-dumptest*
|
||||
terminal-function-details terminal.txt /*terminal-function-details*
|
||||
terminal-functions usr_41.txt /*terminal-functions*
|
||||
terminal-info term.txt /*terminal-info*
|
||||
terminal-job-index index.txt /*terminal-job-index*
|
||||
@@ -9249,6 +9350,8 @@ test_alloc_fail() eval.txt /*test_alloc_fail()*
|
||||
test_autochdir() eval.txt /*test_autochdir()*
|
||||
test_feedinput() eval.txt /*test_feedinput()*
|
||||
test_garbagecollect_now() eval.txt /*test_garbagecollect_now()*
|
||||
test_garbagecollect_soon() eval.txt /*test_garbagecollect_soon()*
|
||||
test_getvalue() eval.txt /*test_getvalue()*
|
||||
test_ignore_error() eval.txt /*test_ignore_error()*
|
||||
test_null_blob() eval.txt /*test_null_blob()*
|
||||
test_null_channel() eval.txt /*test_null_channel()*
|
||||
@@ -9460,8 +9563,11 @@ v:none eval.txt /*v:none*
|
||||
v:null eval.txt /*v:null*
|
||||
v:oldfiles eval.txt /*v:oldfiles*
|
||||
v:operator eval.txt /*v:operator*
|
||||
v:option_command eval.txt /*v:option_command*
|
||||
v:option_new eval.txt /*v:option_new*
|
||||
v:option_old eval.txt /*v:option_old*
|
||||
v:option_oldglobal eval.txt /*v:option_oldglobal*
|
||||
v:option_oldlocal eval.txt /*v:option_oldlocal*
|
||||
v:option_type eval.txt /*v:option_type*
|
||||
v:prevcount eval.txt /*v:prevcount*
|
||||
v:profiling eval.txt /*v:profiling*
|
||||
@@ -9501,6 +9607,7 @@ v:true eval.txt /*v:true*
|
||||
v:val eval.txt /*v:val*
|
||||
v:var eval.txt /*v:var*
|
||||
v:version eval.txt /*v:version*
|
||||
v:versionlong eval.txt /*v:versionlong*
|
||||
v:vim_did_enter eval.txt /*v:vim_did_enter*
|
||||
v:warningmsg eval.txt /*v:warningmsg*
|
||||
v:windowid eval.txt /*v:windowid*
|
||||
@@ -9659,6 +9766,7 @@ version7.txt version7.txt /*version7.txt*
|
||||
version8.0 version8.txt /*version8.0*
|
||||
version8.1 version8.txt /*version8.1*
|
||||
version8.txt version8.txt /*version8.txt*
|
||||
versionlong-variable eval.txt /*versionlong-variable*
|
||||
vi intro.txt /*vi*
|
||||
vi-differences vi_diff.txt /*vi-differences*
|
||||
vi-features vi_diff.txt /*vi-features*
|
||||
@@ -9804,6 +9912,7 @@ win32-vimrun gui_w32.txt /*win32-vimrun*
|
||||
win32-win3.1 os_win32.txt /*win32-win3.1*
|
||||
win32-win95 os_win32.txt /*win32-win95*
|
||||
win32s os_win32.txt /*win32s*
|
||||
win_execute() eval.txt /*win_execute()*
|
||||
win_findbuf() eval.txt /*win_findbuf()*
|
||||
win_getid() eval.txt /*win_getid()*
|
||||
win_gotoid() eval.txt /*win_gotoid()*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*tagsrch.txt* For Vim version 8.1. Last change: 2019 May 07
|
||||
*tagsrch.txt* For Vim version 8.1. Last change: 2019 Jun 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -85,18 +85,21 @@ changed, to avoid confusion when using ":tnext". It is changed when using
|
||||
":tag {name}".
|
||||
|
||||
The ignore-case matches are not found for a ":tag" command when:
|
||||
- the 'ignorecase' option is off and 'tagcase' is "followic"
|
||||
- 'tagcase' is "followic" and the 'ignorecase' option is off
|
||||
- 'tagcase' is "followscs" and the 'ignorecase' option is off and the
|
||||
'smartcase' option is off or the pattern contains an upper case character.
|
||||
- 'tagcase' is "match"
|
||||
- 'tagcase' is "smart" and the pattern contains an upper case character.
|
||||
- 'tagcase' is "followscs" and 'smartcase' option is on and the pattern
|
||||
contains an upper case character.
|
||||
|
||||
The ignore-case matches are found when:
|
||||
- a pattern is used (starting with a "/")
|
||||
- for ":tselect"
|
||||
- when 'tagcase' is "followic" and 'ignorecase' is off
|
||||
- when 'tagcase' is "match"
|
||||
- when 'tagcase' is "followscs" and the 'smartcase' option is off
|
||||
- when 'tagcase' is "followic" and 'ignorecase' is on
|
||||
- when 'tagcase' is "followscs" and 'ignorecase' is on or the 'smartcase'
|
||||
option is on and the pattern does not contain an upper case character
|
||||
- when 'tagcase' is "ignore"
|
||||
- when 'tagcase' is "smart" and the patter does not contain an upper case
|
||||
character
|
||||
|
||||
Note that using ignore-case tag searching disables binary searching in the
|
||||
tags file, which causes a slowdown. This can be avoided by fold-case sorting
|
||||
@@ -503,7 +506,7 @@ Some programs that generate tags files:
|
||||
ctags As found on most Unix systems. Only supports C. Only
|
||||
does the basic work.
|
||||
*Exuberant_ctags*
|
||||
exuberant ctags This a very good one. It works for C, C++, Java,
|
||||
exuberant ctags This is a very good one. It works for C, C++, Java,
|
||||
Fortran, Eiffel and others. It can generate tags for
|
||||
many items. See http://ctags.sourceforge.net.
|
||||
etags Connected to Emacs. Supports many languages.
|
||||
@@ -824,7 +827,7 @@ CTRL-W d Open a new window, with the cursor on the first
|
||||
(default: whole file).
|
||||
See |:search-args| for [/] and [!].
|
||||
|
||||
*:che* *:checkpath*
|
||||
*:che* *:chec* *:check* *:checkpath*
|
||||
:che[ckpath] List all the included files that could not be found.
|
||||
|
||||
:che[ckpath]! List all the included files.
|
||||
@@ -895,7 +898,7 @@ The following fields are optional:
|
||||
If the function returns |v:null| instead of a List, a standard tag lookup will
|
||||
be performed instead.
|
||||
|
||||
It is not allowed to change the tagstack from inside 'tagfunc'. *E986*
|
||||
It is not allowed to change the tagstack from inside 'tagfunc'. *E986*
|
||||
|
||||
The following is a hypothetical example of a function used for 'tagfunc'. It
|
||||
uses the output of |taglist()| to generate the result: a list of tags in the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*terminal.txt* For Vim version 8.1. Last change: 2019 May 05
|
||||
*terminal.txt* For Vim version 8.1. Last change: 2019 Jul 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -12,35 +12,36 @@ The terminal feature is optional, use this to check if your Vim has it: >
|
||||
If the result is "1" you have it.
|
||||
|
||||
|
||||
1. Basic use |terminal-use|
|
||||
Typing |terminal-typing|
|
||||
Size and color |terminal-size-color|
|
||||
Syntax |:terminal|
|
||||
Resizing |terminal-resizing|
|
||||
Terminal Modes |Terminal-mode|
|
||||
Cursor style |terminal-cursor-style|
|
||||
Session |terminal-session|
|
||||
Special keys |terminal-special-keys|
|
||||
Unix |terminal-unix|
|
||||
MS-Windows |terminal-ms-windows|
|
||||
2. Terminal communication |terminal-communication|
|
||||
Vim to job: term_sendkeys() |terminal-to-job|
|
||||
Job to Vim: JSON API |terminal-api|
|
||||
Using the client-server feature |terminal-client-server|
|
||||
3. Remote testing |terminal-testing|
|
||||
4. Diffing screen dumps |terminal-diff|
|
||||
Writing a screen dump test for Vim |terminal-dumptest|
|
||||
Creating a screen dump |terminal-screendump|
|
||||
Comparing screen dumps |terminal-diffscreendump|
|
||||
5. Debugging |terminal-debug|
|
||||
Starting |termdebug-starting|
|
||||
Example session |termdebug-example|
|
||||
Stepping through code |termdebug-stepping|
|
||||
Inspecting variables |termdebug-variables|
|
||||
Other commands |termdebug-commands|
|
||||
Prompt mode |termdebug-prompt|
|
||||
Communication |termdebug-communication|
|
||||
Customizing |termdebug-customizing|
|
||||
1. Basic use |terminal-use|
|
||||
Typing |terminal-typing|
|
||||
Size and color |terminal-size-color|
|
||||
Command syntax |:terminal|
|
||||
Resizing |terminal-resizing|
|
||||
Terminal Modes |Terminal-mode|
|
||||
Cursor style |terminal-cursor-style|
|
||||
Session |terminal-session|
|
||||
Special keys |terminal-special-keys|
|
||||
Unix |terminal-unix|
|
||||
MS-Windows |terminal-ms-windows|
|
||||
2. Terminal functions |terminal-function-details|
|
||||
3. Terminal communication |terminal-communication|
|
||||
Vim to job: term_sendkeys() |terminal-to-job|
|
||||
Job to Vim: JSON API |terminal-api|
|
||||
Using the client-server feature |terminal-client-server|
|
||||
4. Remote testing |terminal-testing|
|
||||
5. Diffing screen dumps |terminal-diff|
|
||||
Writing a screen dump test for Vim |terminal-dumptest|
|
||||
Creating a screen dump |terminal-screendump|
|
||||
Comparing screen dumps |terminal-diffscreendump|
|
||||
6. Debugging |terminal-debug|
|
||||
Starting |termdebug-starting|
|
||||
Example session |termdebug-example|
|
||||
Stepping through code |termdebug-stepping|
|
||||
Inspecting variables |termdebug-variables|
|
||||
Other commands |termdebug-commands|
|
||||
Prompt mode |termdebug-prompt|
|
||||
Communication |termdebug-communication|
|
||||
Customizing |termdebug-customizing|
|
||||
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
The terminal feature requires the |+job| and |+channel| features.
|
||||
@@ -159,7 +160,7 @@ The |term_setansicolors()| function can be used to change the colors, and
|
||||
|term_getansicolors()| to get the currently used colors.
|
||||
|
||||
|
||||
Syntax ~
|
||||
Command syntax ~
|
||||
|
||||
:[range]ter[minal] [options] [command] *:ter* *:terminal*
|
||||
Open a new terminal window.
|
||||
@@ -426,8 +427,371 @@ ConPTY problems have been fixed "winpty" will be preferred.
|
||||
Environment variables are used to pass information to the running job:
|
||||
VIM_SERVERNAME v:servername
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. Terminal communication *terminal-communication*
|
||||
2. Terminal functions *terminal-function-details*
|
||||
|
||||
*term_dumpdiff()*
|
||||
term_dumpdiff({filename}, {filename} [, {options}])
|
||||
Open a new window displaying the difference between the two
|
||||
files. The files must have been created with
|
||||
|term_dumpwrite()|.
|
||||
Returns the buffer number or zero when the diff fails.
|
||||
Also see |terminal-diff|.
|
||||
NOTE: this does not work with double-width characters yet.
|
||||
|
||||
The top part of the buffer contains the contents of the first
|
||||
file, the bottom part of the buffer contains the contents of
|
||||
the second file. The middle part shows the differences.
|
||||
The parts are separated by a line of equals.
|
||||
|
||||
If the {options} argument is present, it must be a Dict with
|
||||
these possible members:
|
||||
"term_name" name to use for the buffer name, instead
|
||||
of the first file name.
|
||||
"term_rows" vertical size to use for the terminal,
|
||||
instead of using 'termwinsize'
|
||||
"term_cols" horizontal size to use for the terminal,
|
||||
instead of using 'termwinsize'
|
||||
"vertical" split the window vertically
|
||||
"curwin" use the current window, do not split the
|
||||
window; fails if the current buffer
|
||||
cannot be |abandon|ed
|
||||
"bufnr" do not create a new buffer, use the
|
||||
existing buffer "bufnr". This buffer
|
||||
must have been previously created with
|
||||
term_dumpdiff() or term_dumpload() and
|
||||
visible in a window.
|
||||
"norestore" do not add the terminal window to a
|
||||
session file
|
||||
|
||||
Each character in the middle part indicates a difference. If
|
||||
there are multiple differences only the first in this list is
|
||||
used:
|
||||
X different character
|
||||
w different width
|
||||
f different foreground color
|
||||
b different background color
|
||||
a different attribute
|
||||
+ missing position in first file
|
||||
- missing position in second file
|
||||
|
||||
Using the "s" key the top and bottom parts are swapped. This
|
||||
makes it easy to spot a difference.
|
||||
|
||||
*term_dumpload()*
|
||||
term_dumpload({filename} [, {options}])
|
||||
Open a new window displaying the contents of {filename}
|
||||
The file must have been created with |term_dumpwrite()|.
|
||||
Returns the buffer number or zero when it fails.
|
||||
Also see |terminal-diff|.
|
||||
|
||||
For {options} see |term_dumpdiff()|.
|
||||
|
||||
*term_dumpwrite()*
|
||||
term_dumpwrite({buf}, {filename} [, {options}])
|
||||
Dump the contents of the terminal screen of {buf} in the file
|
||||
{filename}. This uses a format that can be used with
|
||||
|term_dumpload()| and |term_dumpdiff()|.
|
||||
If the job in the terminal already finished an error is given:
|
||||
*E958*
|
||||
If {filename} already exists an error is given: *E953*
|
||||
Also see |terminal-diff|.
|
||||
|
||||
{options} is a dictionary with these optional entries:
|
||||
"rows" maximum number of rows to dump
|
||||
"columns" maximum number of columns to dump
|
||||
|
||||
term_getaltscreen({buf}) *term_getaltscreen()*
|
||||
Returns 1 if the terminal of {buf} is using the alternate
|
||||
screen.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getansicolors({buf}) *term_getansicolors()*
|
||||
Get the ANSI color palette in use by terminal {buf}.
|
||||
Returns a List of length 16 where each element is a String
|
||||
representing a color in hexadecimal "#rrggbb" format.
|
||||
Also see |term_setansicolors()| and |g:terminal_ansi_colors|.
|
||||
If neither was used returns the default colors.
|
||||
|
||||
{buf} is used as with |term_getsize()|. If the buffer does not
|
||||
exist or is not a terminal window, an empty list is returned.
|
||||
{only available when compiled with the |+terminal| feature and
|
||||
with GUI enabled and/or the |+termguicolors| feature}
|
||||
|
||||
term_getattr({attr}, {what}) *term_getattr()*
|
||||
Given {attr}, a value returned by term_scrape() in the "attr"
|
||||
item, return whether {what} is on. {what} can be one of:
|
||||
bold
|
||||
italic
|
||||
underline
|
||||
strike
|
||||
reverse
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getcursor({buf}) *term_getcursor()*
|
||||
Get the cursor position of terminal {buf}. Returns a list with
|
||||
two numbers and a dictionary: [row, col, dict].
|
||||
|
||||
"row" and "col" are one based, the first screen cell is row
|
||||
1, column 1. This is the cursor position of the terminal
|
||||
itself, not of the Vim window.
|
||||
|
||||
"dict" can have these members:
|
||||
"visible" one when the cursor is visible, zero when it
|
||||
is hidden.
|
||||
"blink" one when the cursor is blinking, zero when it
|
||||
is not blinking.
|
||||
"shape" 1 for a block cursor, 2 for underline and 3
|
||||
for a vertical bar.
|
||||
"color" color of the cursor, e.g. "green"
|
||||
|
||||
{buf} must be the buffer number of a terminal window. If the
|
||||
buffer does not exist or is not a terminal window, an empty
|
||||
list is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getjob({buf}) *term_getjob()*
|
||||
Get the Job associated with terminal window {buf}.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
Returns |v:null| when there is no job.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getline({buf}, {row}) *term_getline()*
|
||||
Get a line of text from the terminal window of {buf}.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
|
||||
The first line has {row} one. When {row} is "." the cursor
|
||||
line is used. When {row} is invalid an empty string is
|
||||
returned.
|
||||
|
||||
To get attributes of each character use |term_scrape()|.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getscrolled({buf}) *term_getscrolled()*
|
||||
Return the number of lines that scrolled to above the top of
|
||||
terminal {buf}. This is the offset between the row number
|
||||
used for |term_getline()| and |getline()|, so that: >
|
||||
term_getline(buf, N)
|
||||
< is equal to: >
|
||||
getline(N + term_getscrolled(buf))
|
||||
< (if that line exists).
|
||||
|
||||
{buf} is used as with |term_getsize()|.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getsize({buf}) *term_getsize()*
|
||||
Get the size of terminal {buf}. Returns a list with two
|
||||
numbers: [rows, cols]. This is the size of the terminal, not
|
||||
the window containing the terminal.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. Use an
|
||||
empty string for the current buffer. If the buffer does not
|
||||
exist or is not a terminal window, an empty list is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_getstatus({buf}) *term_getstatus()*
|
||||
Get the status of terminal {buf}. This returns a comma
|
||||
separated list of these items:
|
||||
running job is running
|
||||
finished job has finished
|
||||
normal in Terminal-Normal mode
|
||||
One of "running" or "finished" is always present.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. If the
|
||||
buffer does not exist or is not a terminal window, an empty
|
||||
string is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_gettitle({buf}) *term_gettitle()*
|
||||
Get the title of terminal {buf}. This is the title that the
|
||||
job in the terminal has set.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. If the
|
||||
buffer does not exist or is not a terminal window, an empty
|
||||
string is returned.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_gettty({buf} [, {input}]) *term_gettty()*
|
||||
Get the name of the controlling terminal associated with
|
||||
terminal window {buf}. {buf} is used as with |term_getsize()|.
|
||||
|
||||
When {input} is omitted or 0, return the name for writing
|
||||
(stdout). When {input} is 1 return the name for reading
|
||||
(stdin). On UNIX, both return same name.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_list() *term_list()*
|
||||
Return a list with the buffer numbers of all buffers for
|
||||
terminal windows.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_scrape({buf}, {row}) *term_scrape()*
|
||||
Get the contents of {row} of terminal screen of {buf}.
|
||||
For {buf} see |term_getsize()|.
|
||||
|
||||
The first line has {row} one. When {row} is "." the cursor
|
||||
line is used. When {row} is invalid an empty string is
|
||||
returned.
|
||||
|
||||
Return a List containing a Dict for each screen cell:
|
||||
"chars" character(s) at the cell
|
||||
"fg" foreground color as #rrggbb
|
||||
"bg" background color as #rrggbb
|
||||
"attr" attributes of the cell, use |term_getattr()|
|
||||
to get the individual flags
|
||||
"width" cell width: 1 or 2
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_sendkeys({buf}, {keys}) *term_sendkeys()*
|
||||
Send keystrokes {keys} to terminal {buf}.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
|
||||
{keys} are translated as key sequences. For example, "\<c-x>"
|
||||
means the character CTRL-X.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_setansicolors({buf}, {colors}) *term_setansicolors()*
|
||||
Set the ANSI color palette used by terminal {buf}.
|
||||
{colors} must be a List of 16 valid color names or hexadecimal
|
||||
color codes, like those accepted by |highlight-guifg|.
|
||||
Also see |term_getansicolors()| and |g:terminal_ansi_colors|.
|
||||
|
||||
The colors normally are:
|
||||
0 black
|
||||
1 dark red
|
||||
2 dark green
|
||||
3 brown
|
||||
4 dark blue
|
||||
5 dark magenta
|
||||
6 dark cyan
|
||||
7 light grey
|
||||
8 dark grey
|
||||
9 red
|
||||
10 green
|
||||
11 yellow
|
||||
12 blue
|
||||
13 magenta
|
||||
14 cyan
|
||||
15 white
|
||||
|
||||
These colors are used in the GUI and in the terminal when
|
||||
'termguicolors' is set. When not using GUI colors (GUI mode
|
||||
or 'termguicolors'), the terminal window always uses the 16
|
||||
ANSI colors of the underlying terminal.
|
||||
{only available when compiled with the |+terminal| feature and
|
||||
with GUI enabled and/or the |+termguicolors| feature}
|
||||
|
||||
term_setkill({buf}, {how}) *term_setkill()*
|
||||
When exiting Vim or trying to close the terminal window in
|
||||
another way, {how} defines whether the job in the terminal can
|
||||
be stopped.
|
||||
When {how} is empty (the default), the job will not be
|
||||
stopped, trying to exit will result in |E947|.
|
||||
Otherwise, {how} specifies what signal to send to the job.
|
||||
See |job_stop()| for the values.
|
||||
|
||||
After sending the signal Vim will wait for up to a second to
|
||||
check that the job actually stopped.
|
||||
|
||||
term_setrestore({buf}, {command}) *term_setrestore()*
|
||||
Set the command to write in a session file to restore the job
|
||||
in this terminal. The line written in the session file is: >
|
||||
terminal ++curwin ++cols=%d ++rows=%d {command}
|
||||
< Make sure to escape the command properly.
|
||||
|
||||
Use an empty {command} to run 'shell'.
|
||||
Use "NONE" to not restore this window.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_setsize({buf}, {rows}, {cols}) *term_setsize()* *E955*
|
||||
Set the size of terminal {buf}. The size of the window
|
||||
containing the terminal will also be adjusted, if possible.
|
||||
If {rows} or {cols} is zero or negative, that dimension is not
|
||||
changed.
|
||||
|
||||
{buf} must be the buffer number of a terminal window. Use an
|
||||
empty string for the current buffer. If the buffer does not
|
||||
exist or is not a terminal window, an error is given.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_start({cmd} [, {options}]) *term_start()*
|
||||
Open a terminal window and run {cmd} in it.
|
||||
|
||||
{cmd} can be a string or a List, like with |job_start()|. The
|
||||
string "NONE" can be used to open a terminal window without
|
||||
starting a job, the pty of the terminal can be used by a
|
||||
command like gdb.
|
||||
|
||||
Returns the buffer number of the terminal window. If {cmd}
|
||||
cannot be executed the window does open and shows an error
|
||||
message.
|
||||
If opening the window fails zero is returned.
|
||||
|
||||
{options} are similar to what is used for |job_start()|, see
|
||||
|job-options|. However, not all options can be used. These
|
||||
are supported:
|
||||
all timeout options
|
||||
"stoponexit", "cwd", "env"
|
||||
"callback", "out_cb", "err_cb", "exit_cb", "close_cb"
|
||||
"in_io", "in_top", "in_bot", "in_name", "in_buf"
|
||||
"out_io", "out_name", "out_buf", "out_modifiable", "out_msg"
|
||||
"err_io", "err_name", "err_buf", "err_modifiable", "err_msg"
|
||||
However, at least one of stdin, stdout or stderr must be
|
||||
connected to the terminal. When I/O is connected to the
|
||||
terminal then the callback function for that part is not used.
|
||||
|
||||
There are extra options:
|
||||
"term_name" name to use for the buffer name, instead
|
||||
of the command name.
|
||||
"term_rows" vertical size to use for the terminal,
|
||||
instead of using 'termwinsize'
|
||||
"term_cols" horizontal size to use for the terminal,
|
||||
instead of using 'termwinsize'
|
||||
"vertical" split the window vertically; note that
|
||||
other window position can be defined with
|
||||
command modifiers, such as |:belowright|.
|
||||
"curwin" use the current window, do not split the
|
||||
window; fails if the current buffer
|
||||
cannot be |abandon|ed
|
||||
"hidden" do not open a window
|
||||
"norestore" do not add the terminal window to a
|
||||
session file
|
||||
"term_kill" what to do when trying to close the
|
||||
terminal window, see |term_setkill()|
|
||||
"term_finish" What to do when the job is finished:
|
||||
"close": close any windows
|
||||
"open": open window if needed
|
||||
Note that "open" can be interruptive.
|
||||
See |term++close| and |term++open|.
|
||||
"term_opencmd" command to use for opening the window when
|
||||
"open" is used for "term_finish"; must
|
||||
have "%d" where the buffer number goes,
|
||||
e.g. "10split|buffer %d"; when not
|
||||
specified "botright sbuf %d" is used
|
||||
"eof_chars" Text to send after all buffer lines were
|
||||
written to the terminal. When not set
|
||||
CTRL-D is used on MS-Windows. For Python
|
||||
use CTRL-Z or "exit()". For a shell use
|
||||
"exit". A CR is always added.
|
||||
"ansi_colors" A list of 16 color names or hex codes
|
||||
defining the ANSI palette used in GUI
|
||||
color modes. See |g:terminal_ansi_colors|.
|
||||
"tty_type" (MS-Windows only): Specify which pty to
|
||||
use. See 'termwintype' for the values.
|
||||
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
term_wait({buf} [, {time}]) *term_wait()*
|
||||
Wait for pending updates of {buf} to be handled.
|
||||
{buf} is used as with |term_getsize()|.
|
||||
{time} is how long to wait for updates to arrive in msec. If
|
||||
not set then 10 msec will be used.
|
||||
{only available when compiled with the |+terminal| feature}
|
||||
|
||||
==============================================================================
|
||||
3. Terminal communication *terminal-communication*
|
||||
|
||||
There are several ways to communicate with the job running in a terminal:
|
||||
- Use |term_sendkeys()| to send text and escape sequences from Vim to the job.
|
||||
@@ -495,7 +859,8 @@ Currently supported commands:
|
||||
directory, thus it's best to use the full path.
|
||||
|
||||
[options] is only used when opening a new window. If present,
|
||||
it must be a Dict. Similarly to |++opt|, These entries are recognized:
|
||||
it must be a Dict. Similarly to |++opt|, These entries are
|
||||
recognized:
|
||||
"ff" file format: "dos", "mac" or "unix"
|
||||
"fileformat" idem
|
||||
"enc" overrides 'fileencoding'
|
||||
@@ -533,7 +898,7 @@ In the job you can then do something like: >
|
||||
This will open the file "some_file.c" and put the cursor on line 123.
|
||||
|
||||
==============================================================================
|
||||
3. Remote testing *terminal-testing*
|
||||
4. Remote testing *terminal-testing*
|
||||
|
||||
Most Vim tests execute a script inside Vim. For some tests this does not
|
||||
work, running the test interferes with the code being tested. To avoid this
|
||||
@@ -548,7 +913,7 @@ Functions ~
|
||||
|
||||
|
||||
==============================================================================
|
||||
4. Diffing screen dumps *terminal-diff*
|
||||
5. Diffing screen dumps *terminal-diff*
|
||||
|
||||
In some cases it can be bothersome to test that Vim displays the right
|
||||
characters on the screen. E.g. with syntax highlighting. To make this
|
||||
@@ -649,7 +1014,7 @@ Alternatively, press "s" to swap the first and second dump. Do this several
|
||||
times so that you can spot the difference in the context of the text.
|
||||
|
||||
==============================================================================
|
||||
5. Debugging *terminal-debug* *terminal-debugger*
|
||||
6. Debugging *terminal-debug* *terminal-debugger*
|
||||
|
||||
The Terminal debugging plugin can be used to debug a program with gdb and view
|
||||
the source code in a Vim window. Since this is completely contained inside
|
||||
@@ -906,7 +1271,7 @@ When 'background' is "dark":
|
||||
hi debugBreakpoint term=reverse ctermbg=red guibg=red
|
||||
|
||||
|
||||
Shorcuts *termdebug_shortcuts*
|
||||
Shortcuts *termdebug_shortcuts*
|
||||
|
||||
You can define your own shortcuts (mappings) to control gdb, that can work in
|
||||
any window, using the TermDebugSendCommand() function. Example: >
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*textprop.txt* For Vim version 8.1. Last change: 2019 May 06
|
||||
*textprop.txt* For Vim version 8.1. Last change: 2019 Jun 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -12,7 +12,6 @@ What is not working yet:
|
||||
- Adjusting column/length when inserting text
|
||||
- Text properties spanning more than one line
|
||||
- prop_find()
|
||||
- callbacks when text properties are outdated
|
||||
|
||||
|
||||
1. Introduction |text-prop-intro|
|
||||
@@ -57,7 +56,7 @@ A text property normally has the name of a property type, which defines
|
||||
how to highlight the text. The property type can have these entries:
|
||||
"highlight" name of the highlight group to use
|
||||
"combine" when TRUE the text property highlighting is combined
|
||||
with any syntax highligting, when omitted or FALSE the
|
||||
with any syntax highlighting, when omitted or FALSE the
|
||||
text property highlighting replaces the syntax
|
||||
highlighting
|
||||
"priority" when properties overlap, the one with the highest
|
||||
@@ -131,6 +130,12 @@ unless the whole line is deleted.
|
||||
When using replace mode, the text properties stay on the same character
|
||||
positions, even though the characters themselves change.
|
||||
|
||||
To update text properties after the text was changed, install a callback with
|
||||
`listener_add()`. E.g, if your plugin does spell checking, you can have the
|
||||
callback update spelling mistakes in the changed text. Vim will move the
|
||||
properties below the changed text, so that they still highlight the same text,
|
||||
thus you don't need to update these.
|
||||
|
||||
|
||||
Text property columns are not updated: ~
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.1. Last change: 2019 May 09
|
||||
*todo.txt* For Vim version 8.1. Last change: 2019 Jul 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -38,6 +38,50 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Ongoing work on text properties, see src/textprop.c
|
||||
|
||||
Popup windows are being implemented, see |popup-window|.
|
||||
|
||||
Patch to fix session file when using multiple tabs. (Jason Franklin, 2019 May
|
||||
20)
|
||||
Also put :argadd commands at the start for all buffers, so that their order
|
||||
remains equal? Then %argdel to clean it up. Do try this with 'hidden' set.
|
||||
|
||||
Listener causes extra } to be inserted. (Paul Jolly, #4455)
|
||||
|
||||
Refactor: Move common things out of evalfunc.c, it's too big.
|
||||
|
||||
Template string: review #4491
|
||||
|
||||
Terminal test fails when vim is configured with some features. (Dominique,
|
||||
#4597)
|
||||
|
||||
Popup windows:
|
||||
- Implement flip option
|
||||
- Have a way to scroll to the bottom? (#4577)
|
||||
- Why does 'nrformats' leak from the popup window buffer???
|
||||
- Disable commands, feedkeys(), CTRL-W, etc. in a popup window.
|
||||
Use ERROR_IF_POPUP_WINDOW for more commands.
|
||||
- Add 'balloonpopup': instead of showing text, let the callback open a popup
|
||||
window and return the window ID. The popup will then be closed when the
|
||||
mouse moves, except when it moves inside the popup.
|
||||
- For the "moved" property also include mouse movement?
|
||||
- Can the buffer be re-used if it was the last one, to avoid using up lots of
|
||||
buffer numbers?
|
||||
- Have an option to attach the popup to a text position, like text properties
|
||||
do. (#4560)
|
||||
- Make redrawing more efficient and avoid flicker:
|
||||
- put popup menu also put in popup_mask?
|
||||
- Invoke filter with character before mapping?
|
||||
- Figure out the size and position better.
|
||||
if wrapping splits a double-wide character
|
||||
if wrapping inserts indent
|
||||
- When drawing on top half a double-wide character, display ">" or "<" in the
|
||||
incomplete cell.
|
||||
- Use a popup window for the "info" item of completion instead of using a
|
||||
preview window. Ideas in issue #4544.
|
||||
How to add highlighting?
|
||||
|
||||
'incsearch' with :s: (#3321)
|
||||
- Get E20 when using command history to get "'<,'>s/a/b" and no Visual area
|
||||
was set. (#3837)
|
||||
@@ -72,6 +116,8 @@ Terminal debugger:
|
||||
with another Vim instance.
|
||||
|
||||
Terminal emulator window:
|
||||
- When typing "exit" in a terminal window with a shell and it's the only
|
||||
window, should exit Vim instead of editing another buffer. (#4539)
|
||||
- When the job in the terminal doesn't use mouse events, let the scroll wheel
|
||||
scroll the scrollback, like a terminal does at the shell prompt. #2490
|
||||
And use modeless selection. #2962
|
||||
@@ -104,19 +150,40 @@ Terminal emulator window:
|
||||
- When 'encoding' is not utf-8, or the job is using another encoding, setup
|
||||
conversions.
|
||||
|
||||
Support for popup widows:
|
||||
- Use text properties to define highlighting.
|
||||
- Proposal on issue #4063
|
||||
Sound: support on Mac? Or does libcanberra work there?
|
||||
|
||||
Notifications for text changes, could be used for LSP.
|
||||
- New event, similar to TextChanged, but guaranteed to provide sequential
|
||||
information of all text changes.
|
||||
Possibly build on undo info (but undo itself is also a change).
|
||||
How to deal with ":%s/this/that" ?
|
||||
Patch to use forward slash for completion even when 'shellslash' is set.
|
||||
Adds 'completepathslash'. (Yasuhiro Matsumoto, 2018 Nov 15, #3612)
|
||||
|
||||
Patch to add win_splitmove() function. (Andy Massimino, #4561)
|
||||
|
||||
Completion mixes results from the current buffer with tags and other files.
|
||||
Happens when typing CTRL-N while still search for results. E.g., type "b_" in
|
||||
terminal.c and then CTRL-N twice.
|
||||
Should do current file first and not split it up when more results are found.
|
||||
(Also #1890)
|
||||
|
||||
Patch to use timers in matchparen. (Daniel Hahler, #1338)
|
||||
Ready to include now?
|
||||
|
||||
Adding "10" to 'spellsuggest' causes spell suggestions to become very slow.
|
||||
(#4087)
|
||||
|
||||
Patch to the code to get sign information. (Yegappan Lakshmanan, #4586)
|
||||
|
||||
":bnext" in a help buffer is supposed to go to the next help buffer, but it
|
||||
goes to any buffer, and then :bnext skips help buffers, since they are
|
||||
unlisted. (#4478)
|
||||
|
||||
Problem with German spell file. Hint for solution by Klaus-Peter Schreiner in
|
||||
#4314, solves the Rasenmäher problem.
|
||||
|
||||
Problem showing a line if the number column width changes when using "o".
|
||||
(Mateusz Morusiewicz, #4245)
|
||||
|
||||
Visual highlight not removed when 'dipslay' is "lastline" and line doesn't
|
||||
fit. (Kevin Lawler, #4457)
|
||||
|
||||
Does not build with MinGW out of the box:
|
||||
- _stat64 is not defined, need to use "struct stat" in vim.h
|
||||
- WINVER conflict, should use 0x0600 by default?
|
||||
@@ -124,6 +191,8 @@ Does not build with MinGW out of the box:
|
||||
Crash when mixing matchadd and substitute()? (Max Christian Pohle, 2018 May
|
||||
13, #2910) Can't reproduce?
|
||||
|
||||
Columns and Rows are long, they should be int.
|
||||
|
||||
Errors found with random data:
|
||||
heap-buffer-overflow in alist_add (#2472)
|
||||
|
||||
@@ -134,11 +203,7 @@ Include part of #3242?
|
||||
When a terminal exit_cb closes the window, a following typed key is lost, if
|
||||
it's in a mapping. (2018 Oct 6, #2302, #3522)
|
||||
|
||||
Completion mixes results from the current buffer with tags and other files.
|
||||
Happens when typing CTRL-N while still search for results. E.g., type "b_" in
|
||||
terminal.c and then CTRL-N twice.
|
||||
Should do current file first and not split it up when more results are found.
|
||||
(Also #1890)
|
||||
Patch for Inno Setup: #2739
|
||||
|
||||
Internal diff doesn't handle binary file like external diff does. (Mike
|
||||
Williams, 2018 Oct 30)
|
||||
@@ -148,16 +213,44 @@ Problem with :tlmenu: Detach item added with all modes? Issue #3563.
|
||||
The quoting of the [command] argument of :terminal is not clearly documented.
|
||||
Give a few examples. (#4288)
|
||||
|
||||
Opening a file with --remote-tab-silent that matches 'wildignore' does not
|
||||
work, results in (E479: No match". (#4610)
|
||||
|
||||
Bug: script written with "-W scriptout" contains Key codes, while the script
|
||||
read with "-s scriptin" expects escape codes. Probably "scriptout" needs to
|
||||
be adjusted. (Daniel Steinberg, 2019 Feb 24, #4041)
|
||||
|
||||
":registers" should indicate char/block/linewise. (Ayberk Aydin, #4546)
|
||||
|
||||
Patch for ambiguous width characters in libvterm on MS-Windows 10.
|
||||
(Nobuhiro Takasaki, #4411)
|
||||
|
||||
Problem with colors in terminal window. (Jason Franklin, 2019 May 12)
|
||||
|
||||
Bug: "vipgw" does not put cursor back where it belongs. (Jason Franklin, 2019
|
||||
Mar 5)
|
||||
|
||||
Some composing characters actually add a cell width to the character they are
|
||||
on top off, making the whole thing two characters wide. (#4526)
|
||||
|
||||
Should we include some part of pull request #4505, not increment changedtick
|
||||
in some cases? E.g. for ":write" when the changed flag was already off, the
|
||||
buffer didn't change at all.
|
||||
|
||||
Patch to add getreginfo() and setreg() with an option to set the unnamed
|
||||
register "", So that registers can be saved and fully restored.
|
||||
(Andy Massimino, 2018 Aug 24, #3370)
|
||||
|
||||
Line numbers in profile are off when function was defined with ":execute".
|
||||
(Daniel Hahler, #4511)
|
||||
|
||||
Add a way to create an empty, hidden buffer. Like doing ":new|hide".
|
||||
":let buf = bufcreate('name')
|
||||
|
||||
Session file contains absolute paths when "curdir" is removed form
|
||||
'sessionoptions', making it impossible to have a session with a relative path.
|
||||
(#4450)
|
||||
|
||||
When using a timer callback vgetc_busy is reset, allowing for using input().
|
||||
But in a channel callback this does not happen. We need to do something
|
||||
similar to check_due_timer(). Also see #3809.
|
||||
@@ -201,6 +294,8 @@ https://lgtm.com/projects/g/vim/vim/alerts/?mode=list
|
||||
|
||||
Still a E315 error when using terminal. (Masato Nishihata, #3959)
|
||||
|
||||
Not existing directory in CDPATH leads to two shell calls. (#4525)
|
||||
|
||||
Use dict_iterate_start() / dict_iterate_next() instead of relying on the
|
||||
internals of the dict structure.
|
||||
|
||||
@@ -243,6 +338,11 @@ punctuation is repeated. (Smylers, 2018 Nov 17, #3621)
|
||||
|
||||
ml_get error: (Israel Chauca Fuentes, 2018 Oct 17, #3550).
|
||||
|
||||
Patch to add more info to OptionSet. Should mention what triggered the change
|
||||
":set", ":setlocal", ":setglobal", "modeline"; and the old global value.
|
||||
#4118. Proposed implementation: 2019 Mar 27.
|
||||
Updated 2019 May 25.
|
||||
|
||||
Using single wide base character with double wide composing character gives
|
||||
drawing errors. Fill up the base character? (Dominique, #4328)
|
||||
|
||||
@@ -269,35 +369,9 @@ Make ":interactive !cmd" stop termcap mode, also when used in an autocommand.
|
||||
|
||||
Add buffer argument to undotree(). (#4001)
|
||||
|
||||
Patch to fix that Normal is not defined when not compiled with GUI.
|
||||
(Christian Brabandt, 2019 May 7, on issue #4072)
|
||||
|
||||
Patch to add optional arguments with default values.
|
||||
(Andy Massimino, #3952) Needs to be reviewed.
|
||||
|
||||
Patch to add more info to OptionSet. Should mention what triggered the change
|
||||
":set", ":setlocal", ":setglobal", "modeline"; and the old global value.
|
||||
#4118. Proposed implementation: 2019 Mar 27.
|
||||
Updated 2019 Apr 9: ASAN fails.
|
||||
|
||||
Problem with Visual yank when 'linebreak' and 'showbreak' are set.
|
||||
Patch with tests, but it's not clear how it is supposed to work. (tommm, 2018
|
||||
Nov 17) Asked about this, Dec 22. Christian will have a look.
|
||||
|
||||
Patch for larger icons in installer. (#978) Still not good.
|
||||
|
||||
Patch to add commands to jump to quickfix entry above/below the cursor.
|
||||
(Yegappan Lakshmanan, #4316) Also do :cbefore and :cafter.
|
||||
|
||||
Patch to fix that using "5gj" starting inside a closed fold does not work on
|
||||
screen lines but on text lines. (Julius Hulsmann, #4095) Lacks a test.
|
||||
|
||||
Patch to implement 'diffref' option. (#3535)
|
||||
Easier to use a 'diffmaster' option, is the extra complexity needed?
|
||||
Not ready to include.
|
||||
|
||||
Memory leaks in test_channel? (or is it because of fork())
|
||||
Using uninitialized value in test_gn
|
||||
Using uninitialized value in test_crypt.
|
||||
memory leak in test_paste
|
||||
Memory leak in test_terminal:
|
||||
==23530== by 0x2640D7: alloc (misc2.c:874)
|
||||
==23530== by 0x2646D6: vim_strsave (misc2.c:1315)
|
||||
@@ -308,26 +382,22 @@ Memory leak in test_terminal:
|
||||
==23530== by 0x35C923: term_start (terminal.c:421)
|
||||
==23530== by 0x2AFF30: mch_call_shell_terminal (os_unix.c:4377)
|
||||
==23530== by 0x2B16BE: mch_call_shell (os_unix.c:5383)
|
||||
TODO: be able to run all parts of test_alot with valgrind separately
|
||||
Memory leak in test_alot with pyeval() (allocating partial)
|
||||
Memory leak in test_alot with expand()
|
||||
Memory leaks in test_channel? (or is it because of fork())
|
||||
|
||||
gethostbyname() is old, use getaddrinfo() if available. (#3227)
|
||||
|
||||
matchaddpos() gets slow with many matches. Proposal by Rick Howe, 2018 Jul
|
||||
19.
|
||||
|
||||
Patch to specify color for cterm=underline and cterm=undercurl, like "guisp".
|
||||
Does #2405 do this?
|
||||
|
||||
Patch to add an interrupt() function: sets got_int. Useful in an autocommand
|
||||
such as BufWritePre that checks the file name or contents.
|
||||
|
||||
More patches to check:
|
||||
- #4098 improve Travis config
|
||||
|
||||
Should make 'listchars' global-local. Local to window or to buffer?
|
||||
Probably window.
|
||||
Add something like 'fillchars' local to window, but allow for specifying a
|
||||
highlight name. Esp. for the statusline.
|
||||
And "extends" and "precedes" are also useful without 'list' set. Also in
|
||||
'fillchars' or another option?
|
||||
|
||||
Sourceforge Vim pages still have content, redirect from empty page.
|
||||
Check for PHP errors. (Wayne Davison, 2018 Oct 26)
|
||||
@@ -336,6 +406,22 @@ Patch to support ":tag <tagkind> <tagname>". (emmrk, 2018 May 7, #2871)
|
||||
Use something like ":tag {kind}/{tagname}".
|
||||
Not ready to include.
|
||||
|
||||
Problem with Visual yank when 'linebreak' and 'showbreak' are set.
|
||||
Patch with tests, but it's not clear how it is supposed to work. (tommm, 2018
|
||||
Nov 17) Asked about this, Dec 22. Christian will have a look.
|
||||
|
||||
Patch for larger icons in installer. (#978) Still not good.
|
||||
|
||||
Patch to fix that using "5gj" starting inside a closed fold does not work on
|
||||
screen lines but on text lines. (Julius Hulsmann, #4095) Lacks a test.
|
||||
|
||||
Patch to implement 'diffref' option. (#3535)
|
||||
Easier to use a 'diffmaster' option, is the extra complexity needed?
|
||||
Not ready to include.
|
||||
|
||||
Patch to specify color for cterm=underline and cterm=undercurl, like "guisp".
|
||||
Patch #2405 does something like this, but in the wrong way.
|
||||
|
||||
:pedit resets the 'buflisted' option unexpectedly. (Wang Shidong, 2018 Oct 12,
|
||||
#3536)
|
||||
|
||||
@@ -355,9 +441,6 @@ Feedback from someone who uses this?
|
||||
|
||||
ml_get error. (Dominique Pelle, 2018 Sep 14, #3434)
|
||||
|
||||
Patch to use forward slash for completion even when 'shellslash' is set.
|
||||
Adds 'completepathslash'. (Yasuhiro Matsumoto, 2018 Nov 15, #3612)
|
||||
|
||||
Only output t_Cs when t_Ce is also set. do not use Cs and Ce termcap entries. (Daniel Hahler, 2018 Sep 25)
|
||||
Add t_cS and t_cR for cursor color select and reset. Use Cs and Cr terminfo
|
||||
values.
|
||||
@@ -383,15 +466,14 @@ includes the first screen line. (2018 Aug 23, #3368)
|
||||
Refactored HTML indent file. (Michael Lee, #1821)
|
||||
Ask to write a test first.
|
||||
|
||||
Patch to add getregpoint() and setreg() with an option to set "".
|
||||
(Andy Massimino, 2018 Aug 24, #3370)
|
||||
Better name?
|
||||
|
||||
MS-Windows: .lnk file not resolved properly when 'encoding' is set.
|
||||
(lkintact, 2018 Sep 22, #3473)
|
||||
|
||||
Merge checking for 'cursorline' and 'concealcursor', see neovim #9492.
|
||||
|
||||
Request to add sign_setlist() to make it faster to add a lot of signs, e.g.
|
||||
when adding a sign for every quickfix entry. (#4557)
|
||||
|
||||
Win32 key codes are messy. Mike Williams tried to fix that, but now old
|
||||
mappings no longer work. Create a new terminal for the better solution?
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_05.txt* For Vim version 8.1. Last change: 2019 Feb 27
|
||||
*usr_05.txt* For Vim version 8.1. Last change: 2019 May 23
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -234,7 +234,7 @@ remote connection, increase the number. See 'ttimeout'.
|
||||
set display=truncate
|
||||
|
||||
Show @@@ in the last line if it is truncated, instead of hiding the whole
|
||||
like. See 'display'.
|
||||
line. See 'display'.
|
||||
|
||||
>
|
||||
set incsearch
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_06.txt* For Vim version 8.1. Last change: 2009 Oct 28
|
||||
*usr_06.txt* For Vim version 8.1. Last change: 2019 Jun 01
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -196,13 +196,12 @@ too slow, you might want to disable syntax highlighting for a moment: >
|
||||
|
||||
When editing another file (or the same one) the colors will come back.
|
||||
|
||||
*:syn-off*
|
||||
If you want to stop highlighting completely use: >
|
||||
|
||||
:syntax off
|
||||
|
||||
This will completely disable syntax highlighting and remove it immediately for
|
||||
all buffers.
|
||||
all buffers. See |:syntax-off| for more details.
|
||||
|
||||
*:syn-manual*
|
||||
If you want syntax highlighting only for specific files, use this: >
|
||||
|
||||
@@ -220,7 +220,7 @@ a tab page share this directory except for windows with a window-local
|
||||
directory. Any new windows opened in this tab page will use this directory as
|
||||
the current working directory. Using a `:cd` command in a tab page will not
|
||||
change the working directory of tab pages which have a tab local directory.
|
||||
When the global working directory is changed using the ":cd" command in a tab
|
||||
When the global working directory is changed using the `:cd` command in a tab
|
||||
page, it will also change the current tab page working directory.
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 8.1. Last change: 2019 May 09
|
||||
*usr_41.txt* For Vim version 8.1. Last change: 2019 Jul 04
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -105,20 +105,21 @@ We won't explain how |:for| and |range()| work until later. Follow the links
|
||||
if you are impatient.
|
||||
|
||||
|
||||
THREE KINDS OF NUMBERS
|
||||
FOUR KINDS OF NUMBERS
|
||||
|
||||
Numbers can be decimal, hexadecimal or octal. A hexadecimal number starts
|
||||
with "0x" or "0X". For example "0x1f" is decimal 31. An octal number starts
|
||||
with a zero. "017" is decimal 15. Careful: don't put a zero before a decimal
|
||||
number, it will be interpreted as an octal number!
|
||||
Numbers can be decimal, hexadecimal, octal or binary. A hexadecimal number
|
||||
starts with "0x" or "0X". For example "0x1f" is decimal 31. An octal number
|
||||
starts with a zero. "017" is decimal 15. A binary number starts with "0b" or
|
||||
"0B". For example "0b101" is decimal 5. Careful: don't put a zero before a
|
||||
decimal number, it will be interpreted as an octal number!
|
||||
The ":echo" command always prints decimal numbers. Example: >
|
||||
|
||||
:echo 0x7f 036
|
||||
< 127 30 ~
|
||||
|
||||
A number is made negative with a minus sign. This also works for hexadecimal
|
||||
and octal numbers. A minus sign is also used for subtraction. Compare this
|
||||
with the previous example: >
|
||||
A number is made negative with a minus sign. This also works for hexadecimal,
|
||||
octal and binary numbers. A minus sign is also used for subtraction. Compare
|
||||
this with the previous example: >
|
||||
|
||||
:echo 0x7f -036
|
||||
< 97 ~
|
||||
@@ -608,12 +609,14 @@ String manipulation: *string-functions*
|
||||
strcharpart() get part of a string using char index
|
||||
strgetchar() get character from a string using char index
|
||||
expand() expand special keywords
|
||||
expandcmd() expand a command like done for `:edit`
|
||||
iconv() convert text from one encoding to another
|
||||
byteidx() byte index of a character in a string
|
||||
byteidxcomp() like byteidx() but count composing characters
|
||||
repeat() repeat a string multiple times
|
||||
eval() evaluate a string expression
|
||||
execute() execute an Ex command and get the output
|
||||
win_execute() like execute() but in a specified window
|
||||
trim() trim characters from a string
|
||||
|
||||
List manipulation: *list-functions*
|
||||
@@ -745,6 +748,12 @@ Working with text in the current buffer: *text-functions*
|
||||
getcharsearch() return character search information
|
||||
setcharsearch() set character search information
|
||||
|
||||
Working with text in another buffer:
|
||||
getbufline() get a list of lines from the specified buffer
|
||||
setbufline() replace a line in the specified buffer
|
||||
appendbufline() append a list of lines in the specified buffer
|
||||
deletebufline() delete lines from a specified buffer
|
||||
|
||||
*system-functions* *file-functions*
|
||||
System functions and manipulation of files:
|
||||
glob() expand wildcards
|
||||
@@ -796,8 +805,10 @@ Buffers, windows and the argument list:
|
||||
argidx() current position in the argument list
|
||||
arglistid() get id of the argument list
|
||||
argv() get one entry from the argument list
|
||||
bufadd() add a file to the list of buffers
|
||||
bufexists() check if a buffer exists
|
||||
buflisted() check if a buffer exists and is listed
|
||||
bufload() ensure a buffer is loaded
|
||||
bufloaded() check if a buffer exists and is loaded
|
||||
bufname() get the name of a specific buffer
|
||||
bufnr() get the buffer number of a specific buffer
|
||||
@@ -808,11 +819,8 @@ Buffers, windows and the argument list:
|
||||
bufwinid() get the window ID of a specific buffer
|
||||
bufwinnr() get the window number of a specific buffer
|
||||
winbufnr() get the buffer number of a specific window
|
||||
getbufline() get a list of lines from the specified buffer
|
||||
setbufline() replace a line in the specified buffer
|
||||
appendbufline() append a list of lines in the specified buffer
|
||||
deletebufline() delete lines from a specified buffer
|
||||
listener_add() add a callback to listen to changes
|
||||
listener_flush() invoke listener callbacks
|
||||
listener_remove() remove a listener callback
|
||||
win_findbuf() find windows containing a buffer
|
||||
win_getid() get window ID of a window
|
||||
@@ -953,6 +961,7 @@ Testing: *test-functions*
|
||||
test_autochdir() enable 'autochdir' during startup
|
||||
test_override() test with Vim internal overrides
|
||||
test_garbagecollect_now() free memory right now
|
||||
test_getvalue() get value of an internal variable
|
||||
test_ignore_error() ignore a specific error message
|
||||
test_null_blob() return a null Blob
|
||||
test_null_channel() return a null Channel
|
||||
@@ -1033,6 +1042,25 @@ Terminal window: *terminal-functions*
|
||||
term_setrestore() set command to restore a terminal
|
||||
term_setsize() set the size of a terminal
|
||||
|
||||
Popup window: *popup-window-functions*
|
||||
popup_create() create popup centered in the screen
|
||||
popup_atcursor() create popup just above the cursor position,
|
||||
closes when the cursor moves away
|
||||
popup_notification() show a notification for three seconds
|
||||
popup_dialog() create popup centered with padding and border
|
||||
popup_menu() prompt for selecting an item from a list
|
||||
popup_hide() hide a popup temporarily
|
||||
popup_show() show a previously hidden popup
|
||||
popup_move() change the position and size of a popup
|
||||
popup_setoptions() override options of a popup
|
||||
popup_settext() replace the popup buffer contents
|
||||
popup_close() close one popup
|
||||
popup_clear() close all popups
|
||||
popup_filter_menu() select from a list of items
|
||||
popup_filter_yesno() blocks until 'y' or 'n' is pressed
|
||||
popup_getoptions() get current options for a popup
|
||||
popup_getpos() get actual position and size of a popup
|
||||
|
||||
Timers: *timer-functions*
|
||||
timer_start() create a timer
|
||||
timer_pause() pause or unpause a timer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_toc.txt* For Vim version 8.1. Last change: 2016 Mar 25
|
||||
*usr_toc.txt* For Vim version 8.1. Last change: 2019 May 24
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -103,12 +103,13 @@ Read this from start to end to learn the essential commands.
|
||||
|usr_05.txt| Set your settings
|
||||
|05.1| The vimrc file
|
||||
|05.2| The example vimrc file explained
|
||||
|05.3| Simple mappings
|
||||
|05.4| Adding a package
|
||||
|05.5| Adding a plugin
|
||||
|05.6| Adding a help file
|
||||
|05.7| The option window
|
||||
|05.8| Often used options
|
||||
|05.3| The defaults.vim file explained
|
||||
|05.4| Simple mappings
|
||||
|05.5| Adding a package
|
||||
|05.6| Adding a plugin
|
||||
|05.7| Adding a help file
|
||||
|05.8| The option window
|
||||
|05.9| Often used options
|
||||
|
||||
|usr_06.txt| Using syntax highlighting
|
||||
|06.1| Switching it on
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 8.1. Last change: 2019 May 09
|
||||
*various.txt* For Vim version 8.1. Last change: 2019 Jun 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -288,7 +288,7 @@ g8 Print the hex values of the bytes used in the
|
||||
*:!!*
|
||||
:!! Repeat last ":!{cmd}".
|
||||
|
||||
*:ve* *:version*
|
||||
*:ve* *:ver* *:version*
|
||||
:ve[rsion] Print the version number of the editor. If the
|
||||
compiler used understands "__DATE__" the compilation
|
||||
date is mentioned. Otherwise a fixed release-date is
|
||||
@@ -428,6 +428,8 @@ m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn|
|
||||
T *+scrollbind* |'scrollbind'|
|
||||
B *+signs* |:sign|
|
||||
N *+smartindent* |'smartindent'|
|
||||
B *+sound* |sound_playevent()|, |sound_playfile()| functions, etc.
|
||||
N *+spell* spell checking support, see |spell|
|
||||
N *+startuptime* |--startuptime| argument
|
||||
N *+statusline* Options 'statusline', 'rulerformat' and special
|
||||
formats of 'titlestring' and 'iconstring'
|
||||
@@ -708,7 +710,7 @@ K Run a program to lookup the keyword under the
|
||||
:xr[estore] [display] Reinitializes the connection to the X11 server. Useful
|
||||
after the X server restarts, e.g. when running Vim for
|
||||
long time inside screen/tmux and connecting from
|
||||
different machines).
|
||||
different machines.
|
||||
[display] should be in the format of the $DISPLAY
|
||||
environment variable (e.g. "localhost:10.0")
|
||||
If [display] is omitted, then it reinitializes the
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
*vi_diff.txt* For Vim version 8.1. Last change: 2019 May 07
|
||||
*vi_diff.txt* For Vim version 8.1. Last change: 2019 May 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -199,7 +199,7 @@ Syntax highlighting. |:syntax|
|
||||
|
||||
Text properties |textprop.txt|
|
||||
Vim supports highlighting text by a plugin. Property types can be
|
||||
specificed with |prop_type_add()| and properties can be placed with
|
||||
specified with |prop_type_add()| and properties can be placed with
|
||||
|prop_add()|.
|
||||
|
||||
Spell checking. |spell|
|
||||
@@ -866,7 +866,7 @@ The following Ex commands are supported by Vi: ~
|
||||
`:set all&`, `:set option+=value`, `:set option^=value`
|
||||
`:set option-=value` `:set option<`
|
||||
`:shell` escape to a shell
|
||||
`:source` read Vim or Ex commands from a file
|
||||
`:source` read Vi or Ex commands from a file
|
||||
`:stop` suspend the editor or escape to a shell
|
||||
`:substitute` find and replace text; Vi: no '&', 'i', 's', 'r' or 'I' flag,
|
||||
confirm prompt only supports 'y' and 'n', no highlighting
|
||||
@@ -901,6 +901,9 @@ Common for these commands is that Vi doesn't support the ++opt argument on
|
||||
|
||||
The following Normal mode commands are supported by Vi: ~
|
||||
|
||||
note: See the beginning of |normal-index| for the meaning of WORD, N, Nmove
|
||||
and etc in the description text.
|
||||
|
||||
|CTRL-B| scroll N screens Backwards
|
||||
|CTRL-C| interrupt current (search) command
|
||||
|CTRL-D| scroll Down N lines (default: half a screen); Vim scrolls
|
||||
@@ -920,7 +923,9 @@ The following Normal mode commands are supported by Vi: ~
|
||||
|CTRL-P| same as "k"
|
||||
|CTRL-R| in some Vi versions: same as CTRL-L
|
||||
|CTRL-T| jump to N older Tag in tag list
|
||||
|CTRL-U| N lines Upwards (default: half a screen)
|
||||
|CTRL-U| N lines Upwards (default: half a screen) {Vi used file lines
|
||||
while Vim scrolls 'scroll' screen lines; makes a difference
|
||||
when lines wrap}
|
||||
|CTRL-Y| scroll N lines downwards
|
||||
|CTRL-Z| suspend program (or start new shell)
|
||||
|CTRL-]| :ta to ident under cursor {Vi: identifier after the cursor}
|
||||
@@ -1055,7 +1060,7 @@ CTRL-T insert one shiftwidth of indent in current line {Vi: only when
|
||||
in indent}
|
||||
CTRL-V {char} insert next non-digit literally {Vi: no decimal byte entry}
|
||||
CTRL-W delete word before the cursor
|
||||
CTRL-Z when 'insertmode' set: suspend Vim
|
||||
CTRL-Z when 'insertmode' set: suspend Vi
|
||||
<Esc> end insert mode (unless 'insertmode' set)
|
||||
CTRL-[ same as <Esc>
|
||||
0 CTRL-D delete all indent in the current line
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 8.1. Last change: 2019 May 05
|
||||
*windows.txt* For Vim version 8.1. Last change: 2019 Jun 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -216,7 +216,7 @@ CTRL-W CTRL_N *CTRL-W_CTRL-N*
|
||||
:[N]sv[iew] [++opt] [+cmd] {file} *:sv* *:sview* *splitview*
|
||||
Same as ":split", but set 'readonly' option for this buffer.
|
||||
|
||||
:[N]sf[ind] [++opt] [+cmd] {file} *:sf* *:sfind* *splitfind*
|
||||
:[N]sf[ind] [++opt] [+cmd] {file} *:sf* *:sfi* *:sfind* *splitfind*
|
||||
Same as ":split", but search for {file} in 'path' like in
|
||||
|:find|. Doesn't split if {file} is not found.
|
||||
|
||||
@@ -1030,6 +1030,13 @@ list of buffers. |unlisted-buffer|
|
||||
thus you can always go to a specific buffer with ":buffer N"
|
||||
or "N CTRL-^", where N is the buffer number.
|
||||
|
||||
For the file name these special values are used:
|
||||
[Prompt] |prompt-buffer|
|
||||
[Popup] buffer of a |popup-window|
|
||||
[Scratch] 'buftype' is "nofile"
|
||||
[No Name] no file name specified
|
||||
For a |terminal-window| buffer the status is used.
|
||||
|
||||
Indicators (chars in the same column are mutually exclusive):
|
||||
u an unlisted buffer (only displayed when [!] is used)
|
||||
|unlisted-buffer|
|
||||
@@ -1192,7 +1199,6 @@ list of buffers. |unlisted-buffer|
|
||||
the way when you're browsing code/text buffers. The next three
|
||||
commands also work like this.
|
||||
|
||||
|
||||
*:sbn* *:sbnext*
|
||||
:[N]sbn[ext] [+cmd] [N]
|
||||
Split window and go to [N]th next buffer in buffer list.
|
||||
@@ -1213,7 +1219,7 @@ list of buffers. |unlisted-buffer|
|
||||
Uses 'switchbuf'.
|
||||
Also see |+cmd|.
|
||||
|
||||
:br[ewind][!] [+cmd] *:br* *:brewind*
|
||||
:br[ewind][!] [+cmd] *:br* *:bre* *:brewind*
|
||||
Go to first buffer in buffer list. If the buffer list is
|
||||
empty, go to the first unlisted buffer.
|
||||
See |:buffer-!| for [!].
|
||||
|
||||
20
runtime/ftplugin/dune.vim
Normal file
20
runtime/ftplugin/dune.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
" Language: Dune buildsystem
|
||||
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
||||
" Anton Kochkov <anton.kochkov@gmail.com>
|
||||
" URL: https://github.com/rgrinberg/vim-ocaml
|
||||
" Last Change:
|
||||
" 2018 Nov 3 - Added commentstring (Markus Mottl)
|
||||
" 2017 Sep 6 - Initial version (Etienne Millon)
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin=1
|
||||
|
||||
set lisp
|
||||
|
||||
" Comment string
|
||||
setl commentstring=;\ %s
|
||||
setl comments=:;
|
||||
|
||||
setl iskeyword+=#,?,.,/
|
||||
@@ -5,12 +5,12 @@
|
||||
" Pierre Vittet <pierre-vittet@pvittet.com>
|
||||
" Stefano Zacchiroli <zack@bononia.it>
|
||||
" Vincent Aravantinos <firstname.name@imag.fr>
|
||||
" URL: http://www.ocaml.info/vim/ftplugin/ocaml.vim
|
||||
" URL: https://github.com/rgrinberg/vim-ocaml
|
||||
" Last Change:
|
||||
" 2013 Oct 27 - Added commentstring (MM)
|
||||
" 2013 Jul 26 - load default compiler settings (MM)
|
||||
" 2013 Jul 24 - removed superfluous efm-setting (MM)
|
||||
" 2013 Jul 22 - applied fixes supplied by Hirotaka Hamada (MM)
|
||||
" 2013 Mar 15 - Improved error format (MM)
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -37,6 +37,10 @@ endif
|
||||
let s:cposet=&cpoptions
|
||||
set cpo&vim
|
||||
|
||||
" Comment string
|
||||
setlocal comments=
|
||||
setlocal commentstring=(*%s*)
|
||||
|
||||
" Add mappings, unless the user didn't want this.
|
||||
if !exists("no_plugin_maps") && !exists("no_ocaml_maps")
|
||||
" (un)commenting
|
||||
@@ -60,16 +64,39 @@ if !exists("no_plugin_maps") && !exists("no_ocaml_maps")
|
||||
endif
|
||||
|
||||
" Let % jump between structure elements (due to Issac Trotts)
|
||||
let b:mw = ''
|
||||
let b:mw = b:mw . ',\<let\>:\<and\>:\(\<in\>\|;;\)'
|
||||
let b:mw = '\<let\>:\<and\>:\(\<in\>\|;;\)'
|
||||
let b:mw = b:mw . ',\<if\>:\<then\>:\<else\>'
|
||||
let b:mw = b:mw . ',\<\(for\|while\)\>:\<do\>:\<done\>,'
|
||||
let b:mw = b:mw . ',\<\(for\|while\)\>:\<do\>:\<done\>'
|
||||
let b:mw = b:mw . ',\<\(object\|sig\|struct\|begin\)\>:\<end\>'
|
||||
let b:mw = b:mw . ',\<\(match\|try\)\>:\<with\>'
|
||||
let b:match_words = b:mw
|
||||
|
||||
let b:match_ignorecase=0
|
||||
|
||||
function! s:OcpGrep(bang,args) abort
|
||||
let grepprg = &l:grepprg
|
||||
let grepformat = &l:grepformat
|
||||
let shellpipe = &shellpipe
|
||||
try
|
||||
let &l:grepprg = "ocp-grep -c never"
|
||||
setlocal grepformat=%f:%l:%m
|
||||
if &shellpipe ==# '2>&1| tee' || &shellpipe ==# '|& tee'
|
||||
let &shellpipe = "| tee"
|
||||
endif
|
||||
execute 'grep! '.a:args
|
||||
if empty(a:bang) && !empty(getqflist())
|
||||
return 'cfirst'
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
finally
|
||||
let &l:grepprg = grepprg
|
||||
let &l:grepformat = grepformat
|
||||
let &shellpipe = shellpipe
|
||||
endtry
|
||||
endfunction
|
||||
command! -bar -bang -complete=file -nargs=+ Ocpgrep exe s:OcpGrep(<q-bang>, <q-args>)
|
||||
|
||||
" switching between interfaces (.mli) and implementations (.ml)
|
||||
if !exists("g:did_ocaml_switch")
|
||||
let g:did_ocaml_switch = 1
|
||||
@@ -97,15 +124,8 @@ endif
|
||||
" Folding support
|
||||
|
||||
" Get the modeline because folding depends on indentation
|
||||
let s:s = line2byte(line('.'))+col('.')-1
|
||||
if search('^\s*(\*:o\?caml:')
|
||||
let s:modeline = getline(".")
|
||||
else
|
||||
let s:modeline = ""
|
||||
endif
|
||||
if s:s > 0
|
||||
exe 'goto' s:s
|
||||
endif
|
||||
let lnum = search('^\s*(\*:o\?caml:', 'n')
|
||||
let s:modeline = lnum? getline(lnum): ""
|
||||
|
||||
" Get the indentation params
|
||||
let s:m = matchstr(s:modeline,'default\s*=\s*\d\+')
|
||||
@@ -372,8 +392,8 @@ endfunction
|
||||
endfun
|
||||
|
||||
" This variable contain a dictionnary of list. Each element of the dictionnary
|
||||
" represent an annotation system. An annotation system is a list with:
|
||||
" - annotation file name as its key
|
||||
" represent an annotation system. An annotation system is a list with :
|
||||
" - annotation file name as it's key
|
||||
" - annotation file path as first element of the contained list
|
||||
" - build path as second element of the contained list
|
||||
" - annot_file_last_mod (contain the date of .annot file) as third element
|
||||
|
||||
@@ -3,19 +3,21 @@
|
||||
[Desktop Entry]
|
||||
# Translators: This is the Application Name used in the GVim desktop file
|
||||
Name[de]=GVim
|
||||
Name[eo]=GVim
|
||||
Name=GVim
|
||||
# Translators: This is the Generic Application Name used in the Vim desktop file
|
||||
GenericName[de]=Texteditor
|
||||
GenericName[eo]=Tekstoredaktilo
|
||||
GenericName[ja]=テキストエディタ
|
||||
GenericName=Text Editor
|
||||
# Translators: This is the comment used in the Vim desktop file
|
||||
Comment[de]=Textdateien bearbeiten
|
||||
Comment[eo]=Redakti tekstajn dosierojn
|
||||
Comment[ja]=テキストファイルを編集します
|
||||
Comment=Edit text files
|
||||
# The translations should come from the po file. Leave them here for now, they will
|
||||
# be overwritten by the po file when generating the desktop.file!
|
||||
GenericName[da]=Teksteditor
|
||||
GenericName[eo]=Tekstoredaktilo
|
||||
GenericName[fr]=Éditeur de texte
|
||||
GenericName[pl]=Edytor tekstu
|
||||
GenericName[is]=Ritvinnsluforrit
|
||||
@@ -34,7 +36,6 @@ Comment[da]=Rediger tekstfiler
|
||||
Comment[el]=Επεξεργασία αρχείων κειμένου
|
||||
Comment[en_CA]=Edit text files
|
||||
Comment[en_GB]=Edit text files
|
||||
Comment[eo]=Redakti tekstajn dosierojn
|
||||
Comment[es]=Edita archivos de texto
|
||||
Comment[et]=Redigeeri tekstifaile
|
||||
Comment[eu]=Editatu testu-fitxategiak
|
||||
@@ -92,10 +93,12 @@ Terminal=false
|
||||
Type=Application
|
||||
# Translators: Search terms to find this application. Do NOT change the semicolons! The list MUST also end with a semicolon!
|
||||
Keywords[de]=Text;Editor;
|
||||
Keywords[eo]=Teksto;redaktilo;
|
||||
Keywords[ja]=テキスト;エディタ;
|
||||
Keywords=Text;editor;
|
||||
# Translators: This is the Icon file name. Do NOT translate
|
||||
Icon[de]=gvim
|
||||
Icon[eo]=gvim
|
||||
Icon=gvim
|
||||
Categories=Utility;TextEditor;
|
||||
StartupNotify=true
|
||||
|
||||
503
runtime/indent/typescript.vim
Normal file
503
runtime/indent/typescript.vim
Normal file
@@ -0,0 +1,503 @@
|
||||
" Vim indent file
|
||||
" Language: TypeScript
|
||||
" Maintainer: See https://github.com/HerringtonDarkholme/yats.vim
|
||||
" Last Change: 2019 Jun 06
|
||||
" Acknowledgement: Based off of vim-ruby maintained by Nikolai Weibull http://vim-ruby.rubyforge.org
|
||||
|
||||
" 0. Initialization {{{1
|
||||
" =================
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal nosmartindent
|
||||
|
||||
" Now, set up our indentation expression and keys that trigger it.
|
||||
setlocal indentexpr=GetTypescriptIndent()
|
||||
setlocal formatexpr=Fixedgq(v:lnum,v:count)
|
||||
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetTypescriptIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" 1. Variables {{{1
|
||||
" ============
|
||||
|
||||
let s:js_keywords = '^\s*\(break\|case\|catch\|continue\|debugger\|default\|delete\|do\|else\|finally\|for\|function\|if\|in\|instanceof\|new\|return\|switch\|this\|throw\|try\|typeof\|var\|void\|while\|with\)'
|
||||
|
||||
" Regex of syntax group names that are or delimit string or are comments.
|
||||
let s:syng_strcom = 'string\|regex\|comment\c'
|
||||
|
||||
" Regex of syntax group names that are strings.
|
||||
let s:syng_string = 'regex\c'
|
||||
|
||||
" Regex of syntax group names that are strings or documentation.
|
||||
let s:syng_multiline = 'comment\c'
|
||||
|
||||
" Regex of syntax group names that are line comment.
|
||||
let s:syng_linecom = 'linecomment\c'
|
||||
|
||||
" Expression used to check whether we should skip a match with searchpair().
|
||||
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'"
|
||||
|
||||
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
||||
|
||||
" Regex that defines continuation lines, not including (, {, or [.
|
||||
let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\|[^=]=[^=].*,\)' . s:line_term
|
||||
|
||||
" Regex that defines continuation lines.
|
||||
" TODO: this needs to deal with if ...: and so on
|
||||
let s:msl_regex = s:continuation_regex
|
||||
|
||||
let s:one_line_scope_regex = '\<\%(if\|else\|for\|while\)\>[^{;]*' . s:line_term
|
||||
|
||||
" Regex that defines blocks.
|
||||
let s:block_regex = '\%([{[]\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term
|
||||
|
||||
let s:var_stmt = '^\s*var'
|
||||
|
||||
let s:comma_first = '^\s*,'
|
||||
let s:comma_last = ',\s*$'
|
||||
|
||||
let s:ternary = '^\s\+[?|:]'
|
||||
let s:ternary_q = '^\s\+?'
|
||||
|
||||
" 2. Auxiliary Functions {{{1
|
||||
" ======================
|
||||
|
||||
" Check if the character at lnum:col is inside a string, comment, or is ascii.
|
||||
function s:IsInStringOrComment(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_strcom
|
||||
endfunction
|
||||
|
||||
" Check if the character at lnum:col is inside a string.
|
||||
function s:IsInString(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_string
|
||||
endfunction
|
||||
|
||||
" Check if the character at lnum:col is inside a multi-line comment.
|
||||
function s:IsInMultilineComment(lnum, col)
|
||||
return !s:IsLineComment(a:lnum, a:col) && synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_multiline
|
||||
endfunction
|
||||
|
||||
" Check if the character at lnum:col is a line comment.
|
||||
function s:IsLineComment(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_linecom
|
||||
endfunction
|
||||
|
||||
" Find line above 'lnum' that isn't empty, in a comment, or in a string.
|
||||
function s:PrevNonBlankNonString(lnum)
|
||||
let in_block = 0
|
||||
let lnum = prevnonblank(a:lnum)
|
||||
while lnum > 0
|
||||
" Go in and out of blocks comments as necessary.
|
||||
" If the line isn't empty (with opt. comment) or in a string, end search.
|
||||
let line = getline(lnum)
|
||||
if line =~ '/\*'
|
||||
if in_block
|
||||
let in_block = 0
|
||||
else
|
||||
break
|
||||
endif
|
||||
elseif !in_block && line =~ '\*/'
|
||||
let in_block = 1
|
||||
elseif !in_block && line !~ '^\s*\%(//\).*$' && !(s:IsInStringOrComment(lnum, 1) && s:IsInStringOrComment(lnum, strlen(line)))
|
||||
break
|
||||
endif
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
endwhile
|
||||
return lnum
|
||||
endfunction
|
||||
|
||||
" Find line above 'lnum' that started the continuation 'lnum' may be part of.
|
||||
function s:GetMSL(lnum, in_one_line_scope)
|
||||
" Start on the line we're at and use its indent.
|
||||
let msl = a:lnum
|
||||
let lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
||||
while lnum > 0
|
||||
" If we have a continuation line, or we're in a string, use line as MSL.
|
||||
" Otherwise, terminate search as we have found our MSL already.
|
||||
let line = getline(lnum)
|
||||
let col = match(line, s:msl_regex) + 1
|
||||
if (col > 0 && !s:IsInStringOrComment(lnum, col)) || s:IsInString(lnum, strlen(line))
|
||||
let msl = lnum
|
||||
else
|
||||
" Don't use lines that are part of a one line scope as msl unless the
|
||||
" flag in_one_line_scope is set to 1
|
||||
"
|
||||
if a:in_one_line_scope
|
||||
break
|
||||
end
|
||||
let msl_one_line = s:Match(lnum, s:one_line_scope_regex)
|
||||
if msl_one_line == 0
|
||||
break
|
||||
endif
|
||||
endif
|
||||
let lnum = s:PrevNonBlankNonString(lnum - 1)
|
||||
endwhile
|
||||
return msl
|
||||
endfunction
|
||||
|
||||
function s:RemoveTrailingComments(content)
|
||||
let single = '\/\/\(.*\)\s*$'
|
||||
let multi = '\/\*\(.*\)\*\/\s*$'
|
||||
return substitute(substitute(a:content, single, '', ''), multi, '', '')
|
||||
endfunction
|
||||
|
||||
" Find if the string is inside var statement (but not the first string)
|
||||
function s:InMultiVarStatement(lnum)
|
||||
let lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
||||
|
||||
" let type = synIDattr(synID(lnum, indent(lnum) + 1, 0), 'name')
|
||||
|
||||
" loop through previous expressions to find a var statement
|
||||
while lnum > 0
|
||||
let line = getline(lnum)
|
||||
|
||||
" if the line is a js keyword
|
||||
if (line =~ s:js_keywords)
|
||||
" check if the line is a var stmt
|
||||
" if the line has a comma first or comma last then we can assume that we
|
||||
" are in a multiple var statement
|
||||
if (line =~ s:var_stmt)
|
||||
return lnum
|
||||
endif
|
||||
|
||||
" other js keywords, not a var
|
||||
return 0
|
||||
endif
|
||||
|
||||
let lnum = s:PrevNonBlankNonString(lnum - 1)
|
||||
endwhile
|
||||
|
||||
" beginning of program, not a var
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" Find line above with beginning of the var statement or returns 0 if it's not
|
||||
" this statement
|
||||
function s:GetVarIndent(lnum)
|
||||
let lvar = s:InMultiVarStatement(a:lnum)
|
||||
let prev_lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
||||
|
||||
if lvar
|
||||
let line = s:RemoveTrailingComments(getline(prev_lnum))
|
||||
|
||||
" if the previous line doesn't end in a comma, return to regular indent
|
||||
if (line !~ s:comma_last)
|
||||
return indent(prev_lnum) - shiftwidth()
|
||||
else
|
||||
return indent(lvar) + shiftwidth()
|
||||
endif
|
||||
endif
|
||||
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
|
||||
" Check if line 'lnum' has more opening brackets than closing ones.
|
||||
function s:LineHasOpeningBrackets(lnum)
|
||||
let open_0 = 0
|
||||
let open_2 = 0
|
||||
let open_4 = 0
|
||||
let line = getline(a:lnum)
|
||||
let pos = match(line, '[][(){}]', 0)
|
||||
while pos != -1
|
||||
if !s:IsInStringOrComment(a:lnum, pos + 1)
|
||||
let idx = stridx('(){}[]', line[pos])
|
||||
if idx % 2 == 0
|
||||
let open_{idx} = open_{idx} + 1
|
||||
else
|
||||
let open_{idx - 1} = open_{idx - 1} - 1
|
||||
endif
|
||||
endif
|
||||
let pos = match(line, '[][(){}]', pos + 1)
|
||||
endwhile
|
||||
return (open_0 > 0) . (open_2 > 0) . (open_4 > 0)
|
||||
endfunction
|
||||
|
||||
function s:Match(lnum, regex)
|
||||
let col = match(getline(a:lnum), a:regex) + 1
|
||||
return col > 0 && !s:IsInStringOrComment(a:lnum, col) ? col : 0
|
||||
endfunction
|
||||
|
||||
function s:IndentWithContinuation(lnum, ind, width)
|
||||
" Set up variables to use and search for MSL to the previous line.
|
||||
let p_lnum = a:lnum
|
||||
let lnum = s:GetMSL(a:lnum, 1)
|
||||
let line = getline(lnum)
|
||||
|
||||
" If the previous line wasn't a MSL and is continuation return its indent.
|
||||
" TODO: the || s:IsInString() thing worries me a bit.
|
||||
if p_lnum != lnum
|
||||
if s:Match(p_lnum,s:continuation_regex)||s:IsInString(p_lnum,strlen(line))
|
||||
return a:ind
|
||||
endif
|
||||
endif
|
||||
|
||||
" Set up more variables now that we know we aren't continuation bound.
|
||||
let msl_ind = indent(lnum)
|
||||
|
||||
" If the previous line ended with [*+/.-=], start a continuation that
|
||||
" indents an extra level.
|
||||
if s:Match(lnum, s:continuation_regex)
|
||||
if lnum == p_lnum
|
||||
return msl_ind + a:width
|
||||
else
|
||||
return msl_ind
|
||||
endif
|
||||
endif
|
||||
|
||||
return a:ind
|
||||
endfunction
|
||||
|
||||
function s:InOneLineScope(lnum)
|
||||
let msl = s:GetMSL(a:lnum, 1)
|
||||
if msl > 0 && s:Match(msl, s:one_line_scope_regex)
|
||||
return msl
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function s:ExitingOneLineScope(lnum)
|
||||
let msl = s:GetMSL(a:lnum, 1)
|
||||
if msl > 0
|
||||
" if the current line is in a one line scope ..
|
||||
if s:Match(msl, s:one_line_scope_regex)
|
||||
return 0
|
||||
else
|
||||
let prev_msl = s:GetMSL(msl - 1, 1)
|
||||
if s:Match(prev_msl, s:one_line_scope_regex)
|
||||
return prev_msl
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" 3. GetTypescriptIndent Function {{{1
|
||||
" =========================
|
||||
|
||||
function GetTypescriptIndent()
|
||||
" 3.1. Setup {{{2
|
||||
" ----------
|
||||
|
||||
" Set up variables for restoring position in file. Could use v:lnum here.
|
||||
let vcol = col('.')
|
||||
|
||||
" 3.2. Work on the current line {{{2
|
||||
" -----------------------------
|
||||
|
||||
let ind = -1
|
||||
" Get the current line.
|
||||
let line = getline(v:lnum)
|
||||
" previous nonblank line number
|
||||
let prevline = prevnonblank(v:lnum - 1)
|
||||
|
||||
" If we got a closing bracket on an empty line, find its match and indent
|
||||
" according to it. For parentheses we indent to its column - 1, for the
|
||||
" others we indent to the containing line's MSL's level. Return -1 if fail.
|
||||
let col = matchend(line, '^\s*[],})]')
|
||||
if col > 0 && !s:IsInStringOrComment(v:lnum, col)
|
||||
call cursor(v:lnum, col)
|
||||
|
||||
let lvar = s:InMultiVarStatement(v:lnum)
|
||||
if lvar
|
||||
let prevline_contents = s:RemoveTrailingComments(getline(prevline))
|
||||
|
||||
" check for comma first
|
||||
if (line[col - 1] =~ ',')
|
||||
" if the previous line ends in comma or semicolon don't indent
|
||||
if (prevline_contents =~ '[;,]\s*$')
|
||||
return indent(s:GetMSL(line('.'), 0))
|
||||
" get previous line indent, if it's comma first return prevline indent
|
||||
elseif (prevline_contents =~ s:comma_first)
|
||||
return indent(prevline)
|
||||
" otherwise we indent 1 level
|
||||
else
|
||||
return indent(lvar) + shiftwidth()
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
let bs = strpart('(){}[]', stridx(')}]', line[col - 1]) * 2, 2)
|
||||
if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0
|
||||
if line[col-1]==')' && col('.') != col('$') - 1
|
||||
let ind = virtcol('.')-1
|
||||
else
|
||||
let ind = indent(s:GetMSL(line('.'), 0))
|
||||
endif
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
|
||||
" If the line is comma first, dedent 1 level
|
||||
if (getline(prevline) =~ s:comma_first)
|
||||
return indent(prevline) - shiftwidth()
|
||||
endif
|
||||
|
||||
if (line =~ s:ternary)
|
||||
if (getline(prevline) =~ s:ternary_q)
|
||||
return indent(prevline)
|
||||
else
|
||||
return indent(prevline) + shiftwidth()
|
||||
endif
|
||||
endif
|
||||
|
||||
" If we are in a multi-line comment, cindent does the right thing.
|
||||
if s:IsInMultilineComment(v:lnum, 1) && !s:IsLineComment(v:lnum, 1)
|
||||
return cindent(v:lnum)
|
||||
endif
|
||||
|
||||
" Check for multiple var assignments
|
||||
" let var_indent = s:GetVarIndent(v:lnum)
|
||||
" if var_indent >= 0
|
||||
" return var_indent
|
||||
" endif
|
||||
|
||||
" 3.3. Work on the previous line. {{{2
|
||||
" -------------------------------
|
||||
|
||||
" If the line is empty and the previous nonblank line was a multi-line
|
||||
" comment, use that comment's indent. Deduct one char to account for the
|
||||
" space in ' */'.
|
||||
if line =~ '^\s*$' && s:IsInMultilineComment(prevline, 1)
|
||||
return indent(prevline) - 1
|
||||
endif
|
||||
|
||||
" Find a non-blank, non-multi-line string line above the current line.
|
||||
let lnum = s:PrevNonBlankNonString(v:lnum - 1)
|
||||
|
||||
" If the line is empty and inside a string, use the previous line.
|
||||
if line =~ '^\s*$' && lnum != prevline
|
||||
return indent(prevnonblank(v:lnum))
|
||||
endif
|
||||
|
||||
" At the start of the file use zero indent.
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
" Set up variables for current line.
|
||||
let line = getline(lnum)
|
||||
let ind = indent(lnum)
|
||||
|
||||
" If the previous line ended with a block opening, add a level of indent.
|
||||
if s:Match(lnum, s:block_regex)
|
||||
return indent(s:GetMSL(lnum, 0)) + shiftwidth()
|
||||
endif
|
||||
|
||||
" If the previous line contained an opening bracket, and we are still in it,
|
||||
" add indent depending on the bracket type.
|
||||
if line =~ '[[({]'
|
||||
let counts = s:LineHasOpeningBrackets(lnum)
|
||||
if counts[0] == '1' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
||||
if col('.') + 1 == col('$')
|
||||
return ind + shiftwidth()
|
||||
else
|
||||
return virtcol('.')
|
||||
endif
|
||||
elseif counts[1] == '1' || counts[2] == '1'
|
||||
return ind + shiftwidth()
|
||||
else
|
||||
call cursor(v:lnum, vcol)
|
||||
end
|
||||
endif
|
||||
|
||||
" 3.4. Work on the MSL line. {{{2
|
||||
" --------------------------
|
||||
|
||||
let ind_con = ind
|
||||
let ind = s:IndentWithContinuation(lnum, ind_con, shiftwidth())
|
||||
|
||||
" }}}2
|
||||
"
|
||||
"
|
||||
let ols = s:InOneLineScope(lnum)
|
||||
if ols > 0
|
||||
let ind = ind + shiftwidth()
|
||||
else
|
||||
let ols = s:ExitingOneLineScope(lnum)
|
||||
while ols > 0 && ind > 0
|
||||
let ind = ind - shiftwidth()
|
||||
let ols = s:InOneLineScope(ols - 1)
|
||||
endwhile
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
function! Fixedgq(lnum, count)
|
||||
let l:tw = &tw ? &tw : 80;
|
||||
|
||||
let l:count = a:count
|
||||
let l:first_char = indent(a:lnum) + 1
|
||||
|
||||
if mode() == 'i' " gq was not pressed, but tw was set
|
||||
return 1
|
||||
endif
|
||||
|
||||
" This gq is only meant to do code with strings, not comments
|
||||
if s:IsLineComment(a:lnum, l:first_char) || s:IsInMultilineComment(a:lnum, l:first_char)
|
||||
return 1
|
||||
endif
|
||||
|
||||
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Put all the lines on one line and do normal spliting after that
|
||||
if l:count > 1
|
||||
while l:count > 1
|
||||
let l:count -= 1
|
||||
normal J
|
||||
endwhile
|
||||
endif
|
||||
|
||||
let l:winview = winsaveview()
|
||||
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let orig_breakpoint = searchpairpos(' ', '', '\.', 'bcW', '', a:lnum)
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let breakpoint = searchpairpos(' ', '', '\.', 'bcW', s:skip_expr, a:lnum)
|
||||
|
||||
" No need for special treatment, normal gq handles edgecases better
|
||||
if breakpoint[1] == orig_breakpoint[1]
|
||||
call winrestview(l:winview)
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Try breaking after string
|
||||
if breakpoint[1] <= indent(a:lnum)
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
|
||||
endif
|
||||
|
||||
|
||||
if breakpoint[1] != 0
|
||||
call feedkeys("r\<CR>")
|
||||
else
|
||||
let l:count = l:count - 1
|
||||
endif
|
||||
|
||||
" run gq on new lines
|
||||
if l:count == 1
|
||||
call feedkeys("gqq")
|
||||
endif
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
@@ -1,7 +1,7 @@
|
||||
" These commands create the option window.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2019 Feb 08
|
||||
" Last Change: 2019 May 25
|
||||
|
||||
" If there already is an option window, jump to that one.
|
||||
let buf = bufnr('option-window')
|
||||
@@ -415,6 +415,9 @@ call append("$", "highlight\twhich highlighting to use for various occasions")
|
||||
call <SID>OptionG("hl", &hl)
|
||||
call append("$", "hlsearch\thighlight all matches for the last used search pattern")
|
||||
call <SID>BinOptionG("hls", &hls)
|
||||
call append("$", "wincolor\thighlight group to use for the window")
|
||||
call append("$", "\t(local to window)")
|
||||
call <SID>OptionL("wcr")
|
||||
if has("termguicolors")
|
||||
call append("$", "termguicolors\tuse GUI colors for the terminal")
|
||||
call <SID>BinOptionG("tgc", &tgc)
|
||||
@@ -988,6 +991,8 @@ call <SID>Header("reading and writing files")
|
||||
call append("$", "modeline\tenable using settings from modelines when reading a file")
|
||||
call append("$", "\t(local to buffer)")
|
||||
call <SID>BinOptionL("ml")
|
||||
call append("$", "modelineexpr\tallow setting expression options from a modeline")
|
||||
call <SID>BinOptionG("mle", &mle)
|
||||
call append("$", "modelines\tnumber of lines to check for modelines")
|
||||
call append("$", " \tset mls=" . &mls)
|
||||
call append("$", "binary\tbinary file editing")
|
||||
|
||||
@@ -117,10 +117,14 @@ func s:StartDebug_internal(dict)
|
||||
let s:startsigncolumn = &signcolumn
|
||||
|
||||
let s:save_columns = 0
|
||||
let s:allleft = 0
|
||||
if exists('g:termdebug_wide')
|
||||
if &columns < g:termdebug_wide
|
||||
let s:save_columns = &columns
|
||||
let &columns = g:termdebug_wide
|
||||
" If we make the Vim window wider, use the whole left halve for the debug
|
||||
" windows.
|
||||
let s:allleft = 1
|
||||
endif
|
||||
let s:vertical = 1
|
||||
else
|
||||
@@ -165,6 +169,10 @@ func s:StartDebug_term(dict)
|
||||
" Assuming the source code window will get a signcolumn, use two more
|
||||
" columns for that, thus one less for the terminal window.
|
||||
exe (&columns / 2 - 1) . "wincmd |"
|
||||
if s:allleft
|
||||
" use the whole left column
|
||||
wincmd H
|
||||
endif
|
||||
endif
|
||||
|
||||
" Create a hidden terminal window to communicate with gdb
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types in scripts
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last change: 2018 Feb 03
|
||||
" Last change: 2019 Jun 25
|
||||
|
||||
" This file is called by an autocommand for every file that has just been
|
||||
" loaded into a buffer. It checks if the type of file can be recognized by
|
||||
@@ -195,7 +195,7 @@ else
|
||||
if s:line1 =~# '^:$'
|
||||
call dist#ft#SetFileTypeSH(s:line1) " defined in filetype.vim
|
||||
|
||||
" Z shell scripts
|
||||
" Z shell scripts
|
||||
elseif s:line1 =~# '^#compdef\>' || s:line1 =~# '^#autoload\>' ||
|
||||
\ "\n".s:line1."\n".s:line2."\n".s:line3."\n".s:line4."\n".s:line5 =~# '\n\s*emulate\s\+\%(-[LR]\s\+\)\=[ckz]\=sh\>'
|
||||
set ft=zsh
|
||||
@@ -204,15 +204,20 @@ else
|
||||
elseif s:line1 =~# '^From \([a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\=\|-\) .* \(19\|20\)\d\d$'
|
||||
set ft=mail
|
||||
|
||||
" Mason
|
||||
" Mason
|
||||
elseif s:line1 =~# '^<[%&].*>'
|
||||
set ft=mason
|
||||
|
||||
" Vim scripts (must have '" vim' as the first line to trigger this)
|
||||
" Vim scripts (must have '" vim' as the first line to trigger this)
|
||||
elseif s:line1 =~# '^" *[vV]im$'
|
||||
set ft=vim
|
||||
|
||||
" MOO
|
||||
" libcxx and libstdc++ standard library headers like "iostream" do not have
|
||||
" an extension, recognize the Emacs file mode.
|
||||
elseif s:line1 =~? '-\*-.*C++.*-\*-'
|
||||
set ft=cpp
|
||||
|
||||
" MOO
|
||||
elseif s:line1 =~# '^\*\* LambdaMOO Database, Format Version \%([1-3]\>\)\@!\d\+ \*\*$'
|
||||
set ft=moo
|
||||
|
||||
|
||||
46
runtime/syntax/dune.vim
Normal file
46
runtime/syntax/dune.vim
Normal file
@@ -0,0 +1,46 @@
|
||||
" Language: Dune buildsystem
|
||||
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
||||
" Anton Kochkov <anton.kochkov@gmail.com>
|
||||
" URL: https://github.com/rgrinberg/vim-ocaml
|
||||
" Last Change:
|
||||
" 2019 Feb 27 - Add newer keywords to the syntax (Simon Cruanes)
|
||||
" 2018 May 8 - Check current_syntax (Kawahara Satoru)
|
||||
" 2018 Mar 29 - Extend jbuild syntax with more keywords (Petter A. Urkedal)
|
||||
" 2017 Sep 6 - Initial version (Etienne Millon)
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
set syntax=lisp
|
||||
syn case match
|
||||
|
||||
" The syn-iskeyword setting lacks #,? from the iskeyword setting here.
|
||||
" Clearing it avoids maintaining keyword characters in multiple places.
|
||||
syn iskeyword clear
|
||||
|
||||
syn keyword lispDecl jbuild_version library executable executables rule ocamllex ocamlyacc menhir alias install
|
||||
|
||||
syn keyword lispKey name public_name synopsis modules libraries wrapped
|
||||
syn keyword lispKey preprocess preprocessor_deps optional c_names cxx_names
|
||||
syn keyword lispKey install_c_headers modes no_dynlink self_build_stubs_archive
|
||||
syn keyword lispKey ppx_runtime_libraries virtual_deps js_of_ocaml link_flags
|
||||
syn keyword lispKey javascript_files flags ocamlc_flags ocamlopt_flags pps staged_pps
|
||||
syn keyword lispKey library_flags c_flags c_library_flags kind package action
|
||||
syn keyword lispKey deps targets locks fallback
|
||||
syn keyword lispKey inline_tests tests names
|
||||
|
||||
syn keyword lispAtom true false
|
||||
|
||||
syn keyword lispFunc cat chdir copy# diff? echo run setenv
|
||||
syn keyword lispFunc ignore-stdout ignore-stderr ignore-outputs
|
||||
syn keyword lispFunc with-stdout-to with-stderr-to with-outputs-to
|
||||
syn keyword lispFunc write-file system bash
|
||||
|
||||
syn cluster lispBaseListCluster add=duneVar
|
||||
syn match duneVar '\${[@<^]}' containedin=lispSymbol
|
||||
syn match duneVar '\${\k\+\(:\k\+\)\?}' containedin=lispSymbol
|
||||
|
||||
hi def link duneVar Identifier
|
||||
|
||||
let b:current_syntax = "dune"
|
||||
@@ -2,8 +2,8 @@
|
||||
" Language: fstab file
|
||||
" Maintainer: Radu Dineiu <radu.dineiu@gmail.com>
|
||||
" URL: https://raw.github.com/rid9/vim-fstab/master/fstab.vim
|
||||
" Last Change: 2017 Nov 09
|
||||
" Version: 1.2
|
||||
" Last Change: 2019 Jun 06
|
||||
" Version: 1.3
|
||||
"
|
||||
" Credits:
|
||||
" David Necas (Yeti) <yeti@physics.muni.cz>
|
||||
@@ -68,7 +68,7 @@ syn match fsOptionsString /[a-zA-Z0-9_-]\+/
|
||||
syn keyword fsOptionsYesNo yes no
|
||||
syn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatCheck
|
||||
syn keyword fsOptionsSize 512 1024 2048
|
||||
syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand norelatime nosuid nosymfollow nouser owner rbind rdonly relatime remount ro rq rw suid suiddir supermount sw sync union update user users wxallowed xx
|
||||
syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand norelatime nosuid nosymfollow nouser owner rbind rdonly relatime remount ro rq rw suid suiddir supermount sw sync union update user users wxallowed xx nofail
|
||||
syn match fsOptionsGeneral /_netdev/
|
||||
|
||||
" Options: adfs
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim help file
|
||||
" Maintainer: Bram Moolenaar (Bram@vim.org)
|
||||
" Last Change: 2017 Oct 19
|
||||
" Last Change: 2019 May 12
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -11,7 +11,7 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn match helpHeadline "^[-A-Z .][-A-Z0-9 .()]*[ \t]\+\*"me=e-1
|
||||
syn match helpHeadline "^[-A-Z .][-A-Z0-9 .()_]*[ \t]\+\*"me=e-1
|
||||
syn match helpSectionDelim "^===.*===$"
|
||||
syn match helpSectionDelim "^---.*--$"
|
||||
if has("conceal")
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
" Vim syntax file
|
||||
" Language: none; used to see highlighting
|
||||
" Maintainer: Ronald Schild <rs@scutum.de>
|
||||
" Last Change: 2017 Jul 28
|
||||
" Last Change: 2019 Jun 06
|
||||
" Version: 5.4n.1
|
||||
" Additional Changes By: Lifepillar, Bram
|
||||
|
||||
" To see your current highlight settings, do
|
||||
" :so $VIMRUNTIME/syntax/hitest.vim
|
||||
@@ -12,6 +13,7 @@ let s:hidden = &hidden
|
||||
let s:lazyredraw = &lazyredraw
|
||||
let s:more = &more
|
||||
let s:report = &report
|
||||
let s:whichwrap = &whichwrap
|
||||
let s:shortmess = &shortmess
|
||||
let s:wrapscan = &wrapscan
|
||||
let s:register_a = @a
|
||||
@@ -19,10 +21,11 @@ let s:register_se = @/
|
||||
|
||||
" set global options
|
||||
set hidden lazyredraw nomore report=99999 shortmess=aoOstTW wrapscan
|
||||
set whichwrap&
|
||||
|
||||
" print current highlight settings into register a
|
||||
redir @a
|
||||
highlight
|
||||
silent highlight
|
||||
redir END
|
||||
|
||||
" Open a new window if the current one isn't empty
|
||||
@@ -34,25 +37,32 @@ endif
|
||||
edit Highlight\ test
|
||||
|
||||
" set local options
|
||||
setlocal autoindent noexpandtab formatoptions=t shiftwidth=16 noswapfile tabstop=16
|
||||
setlocal autoindent noexpandtab formatoptions=t shiftwidth=18 noswapfile tabstop=18
|
||||
let &textwidth=&columns
|
||||
|
||||
" insert highlight settings
|
||||
% delete
|
||||
put a
|
||||
|
||||
" remove cleared groups
|
||||
silent! g/ cleared$/d
|
||||
|
||||
" remove the colored xxx items
|
||||
g/xxx /s///e
|
||||
|
||||
" remove color settings (not needed here)
|
||||
global! /links to/ substitute /\s.*$//e
|
||||
|
||||
" Move split 'links to' lines to the same line
|
||||
% substitute /^\(\w\+\)\n\s*\(links to.*\)/\1\t\2/e
|
||||
|
||||
" move linked groups to the end of file
|
||||
global /links to/ move $
|
||||
|
||||
" move linked group names to the matching preferred groups
|
||||
" TODO: this fails if the group linked to isn't defined
|
||||
% substitute /^\(\w\+\)\s*\(links to\)\s*\(\w\+\)$/\3\t\2 \1/e
|
||||
global /links to/ normal mz3ElD0#$p'zdd
|
||||
silent! global /links to/ normal mz3ElD0#$p'zdd
|
||||
|
||||
" delete empty lines
|
||||
global /^ *$/ delete
|
||||
@@ -124,6 +134,7 @@ let &lazyredraw = s:lazyredraw
|
||||
let &more = s:more
|
||||
let &report = s:report
|
||||
let &shortmess = s:shortmess
|
||||
let &whichwrap = s:whichwrap
|
||||
let &wrapscan = s:wrapscan
|
||||
let @a = s:register_a
|
||||
|
||||
@@ -133,6 +144,6 @@ let @/ = s:register_se
|
||||
|
||||
" remove variables
|
||||
unlet s:hidden s:lazyredraw s:more s:report s:shortmess
|
||||
unlet s:wrapscan s:register_a s:register_se
|
||||
unlet s:whichwrap s:wrapscan s:register_a s:register_se
|
||||
|
||||
" vim: ts=8
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
" Credits: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
|
||||
" Maurizio Tranchero - maurizio(.)tranchero(@)gmail(.)com
|
||||
" Original author: Mario Eusebio
|
||||
" Last Change: Mon Jan 23 2017
|
||||
" added support for cell mode
|
||||
" Last Change: June 10 2019
|
||||
" added highlight rule for double-quoted string literals
|
||||
" Change History:
|
||||
" - double-quoted string literals added
|
||||
" - now highlights cell-mode separator comments
|
||||
" - 'global' and 'persistent' keyword are now recognized
|
||||
|
||||
@@ -40,6 +41,7 @@ syn match matlabLineContinuation "\.\{3}"
|
||||
" String
|
||||
" MT_ADDON - added 'skip' in order to deal with 'tic' escaping sequence
|
||||
syn region matlabString start=+'+ end=+'+ oneline skip=+''+
|
||||
syn region matlabStringArray start=+"+ end=+"+ oneline skip=+""+
|
||||
|
||||
" If you don't like tabs
|
||||
syn match matlabTab "\t"
|
||||
@@ -87,6 +89,7 @@ hi def link matlabExceptions Conditional
|
||||
hi def link matlabRepeat Repeat
|
||||
hi def link matlabTodo Todo
|
||||
hi def link matlabString String
|
||||
hi def link matlabStringArray String
|
||||
hi def link matlabDelimiter Identifier
|
||||
hi def link matlabTransposeOther Identifier
|
||||
hi def link matlabNumber Number
|
||||
|
||||
@@ -4,10 +4,15 @@
|
||||
" Maintainers: Markus Mottl <markus.mottl@gmail.com>
|
||||
" Karl-Heinz Sylla <Karl-Heinz.Sylla@gmd.de>
|
||||
" Issac Trotts <ijtrotts@ucdavis.edu>
|
||||
" URL: http://www.ocaml.info/vim/syntax/ocaml.vim
|
||||
" Last Change: 2012 May 12 - Added Dominique Pellé's spell checking patch (MM)
|
||||
" 2012 Feb 01 - Improved module path highlighting (MM)
|
||||
" 2010 Oct 11 - Added highlighting of lnot (MM, thanks to Erick Matsen)
|
||||
" URL: https://github.com/rgrinberg/vim-ocaml
|
||||
" Last Change:
|
||||
" 2018 Nov 08 - Improved highlighting of operators (Maëlan)
|
||||
" 2018 Apr 22 - Improved support for PPX (Andrey Popp)
|
||||
" 2018 Mar 16 - Remove raise, lnot and not from keywords (Étienne Millon, "copy")
|
||||
" 2017 Apr 11 - Improved matching of negative numbers (MM)
|
||||
" 2016 Mar 11 - Improved support for quoted strings (Glen Mével)
|
||||
" 2015 Aug 13 - Allow apostrophes in identifiers (Jonathan Chan, Einar Lielmanis)
|
||||
" 2015 Jun 17 - Added new "nonrec" keyword (MM)
|
||||
|
||||
" A minor patch was applied to the official version so that object/end
|
||||
" can be distinguished from begin/end, which is used for indentation,
|
||||
@@ -18,6 +23,9 @@ if exists("b:current_syntax") && b:current_syntax == "ocaml"
|
||||
finish
|
||||
endif
|
||||
|
||||
" ' can be used in OCaml identifiers
|
||||
setlocal iskeyword+='
|
||||
|
||||
" OCaml is case sensitive.
|
||||
syn case match
|
||||
|
||||
@@ -28,7 +36,7 @@ syn match ocamlMethod "#"
|
||||
syn match ocamlComment "^#!.*" contains=@Spell
|
||||
|
||||
" Scripting directives
|
||||
syn match ocamlScript "^#\<\(quit\|labels\|warnings\|directory\|cd\|load\|use\|install_printer\|remove_printer\|require\|thread\|trace\|untrace\|untrace_all\|print_depth\|print_length\|camlp4o\)\>"
|
||||
syn match ocamlScript "^#\<\(quit\|labels\|warnings\|warn_error\|directory\|remove_directory\|cd\|load\|load_rec\|use\|mod_use\|install_printer\|remove_printer\|require\|list\|ppx\|principal\|predicates\|rectypes\|thread\|trace\|untrace\|untrace_all\|print_depth\|print_length\|camlp4o\|camlp4r\|topfind_log\|topfind_verbose\)\>"
|
||||
|
||||
" lowercase identifier - the standard way to match
|
||||
syn match ocamlLCIdentifier /\<\(\l\|_\)\(\w\|'\)*\>/
|
||||
@@ -66,7 +74,7 @@ syn cluster ocamlAllErrs contains=ocamlBraceErr,ocamlBrackErr,ocamlParenErr,oca
|
||||
|
||||
syn cluster ocamlAENoParen contains=ocamlBraceErr,ocamlBrackErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr
|
||||
|
||||
syn cluster ocamlContained contains=ocamlTodo,ocamlPreDef,ocamlModParam,ocamlModParam1,ocamlPreMPRestr,ocamlMPRestr,ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3,ocamlModRHS,ocamlFuncWith,ocamlFuncStruct,ocamlModTypeRestr,ocamlModTRWith,ocamlWith,ocamlWithRest,ocamlModType,ocamlFullMod,ocamlVal
|
||||
syn cluster ocamlContained contains=ocamlTodo,ocamlPreDef,ocamlModParam,ocamlModParam1,ocamlMPRestr,ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3,ocamlModRHS,ocamlFuncWith,ocamlFuncStruct,ocamlModTypeRestr,ocamlModTRWith,ocamlWith,ocamlWithRest,ocamlModType,ocamlFullMod,ocamlVal
|
||||
|
||||
|
||||
" Enclosing delimiters
|
||||
@@ -103,11 +111,15 @@ endif
|
||||
" "if"
|
||||
syn region ocamlNone matchgroup=ocamlKeyword start="\<if\>" matchgroup=ocamlKeyword end="\<then\>" contains=ALLBUT,@ocamlContained,ocamlThenErr
|
||||
|
||||
"" PPX nodes
|
||||
|
||||
syn match ocamlPpxIdentifier /\(\[@\{1,3\}\)\@<=\w\+\(\.\w\+\)*/
|
||||
syn region ocamlPpx matchgroup=ocamlPpxEncl start="\[@\{1,3\}" contains=TOP end="\]"
|
||||
|
||||
"" Modules
|
||||
|
||||
" "sig"
|
||||
syn region ocamlSig matchgroup=ocamlModule start="\<sig\>" matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule
|
||||
syn region ocamlSig matchgroup=ocamlSigEncl start="\<sig\>" matchgroup=ocamlSigEncl end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule
|
||||
syn region ocamlModSpec matchgroup=ocamlKeyword start="\<module\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contained contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlModTRWith,ocamlMPRestr
|
||||
|
||||
" "open"
|
||||
@@ -118,15 +130,14 @@ syn match ocamlKeyword "\<include\>" skipwhite skipempty nextgroup=ocamlModPa
|
||||
|
||||
" "module" - somewhat complicated stuff ;-)
|
||||
syn region ocamlModule matchgroup=ocamlKeyword start="\<module\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlPreDef
|
||||
syn region ocamlPreDef start="."me=e-1 matchgroup=ocamlKeyword end="\l\|=\|)"me=e-1 contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam,ocamlModTypeRestr,ocamlModTRWith nextgroup=ocamlModPreRHS
|
||||
syn region ocamlModParam start="([^*]" end=")" contained contains=@ocamlAENoParen,ocamlModParam1,ocamlVal
|
||||
syn match ocamlModParam1 "\<\u\(\w\|'\)*\>" contained skipwhite skipempty nextgroup=ocamlPreMPRestr
|
||||
|
||||
syn region ocamlPreMPRestr start="."me=e-1 end=")"me=e-1 contained contains=@ocamlAllErrs,ocamlComment,ocamlMPRestr,ocamlModTypeRestr
|
||||
syn region ocamlPreDef start="."me=e-1 matchgroup=ocamlKeyword end="\l\|=\|)"me=e-1 contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam,ocamlGenMod,ocamlModTypeRestr,ocamlModTRWith nextgroup=ocamlModPreRHS
|
||||
syn region ocamlModParam start="([^*]" end=")" contained contains=ocamlGenMod,ocamlModParam1,ocamlSig,ocamlVal
|
||||
syn match ocamlModParam1 "\<\u\(\w\|'\)*\>" contained skipwhite skipempty
|
||||
syn match ocamlGenMod "()" contained skipwhite skipempty
|
||||
|
||||
syn region ocamlMPRestr start=":" end="."me=e-1 contained contains=@ocamlComment skipwhite skipempty nextgroup=ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3
|
||||
syn region ocamlMPRestr1 matchgroup=ocamlModule start="\ssig\s\=" matchgroup=ocamlModule end="\<end\>" contained contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule
|
||||
syn region ocamlMPRestr2 start="\sfunctor\(\s\|(\)\="me=e-1 matchgroup=ocamlKeyword end="->" contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam skipwhite skipempty nextgroup=ocamlFuncWith,ocamlMPRestr2
|
||||
syn region ocamlMPRestr1 matchgroup=ocamlSigEncl start="\ssig\s\=" matchgroup=ocamlSigEncl end="\<end\>" contained contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule
|
||||
syn region ocamlMPRestr2 start="\sfunctor\(\s\|(\)\="me=e-1 matchgroup=ocamlKeyword end="->" contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam,ocamlGenMod skipwhite skipempty nextgroup=ocamlFuncWith,ocamlMPRestr2
|
||||
syn match ocamlMPRestr3 "\w\(\w\|'\)*\( *\. *\w\(\w\|'\)*\)*" contained
|
||||
syn match ocamlModPreRHS "=" contained skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
|
||||
syn keyword ocamlKeyword val
|
||||
@@ -134,8 +145,8 @@ syn region ocamlVal matchgroup=ocamlKeyword start="\<val\>" matchgroup=ocamlLC
|
||||
syn region ocamlModRHS start="." end=". *\w\|([^*]"me=e-2 contained contains=ocamlComment skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
|
||||
syn match ocamlFullMod "\<\u\(\w\|'\)*\( *\. *\u\(\w\|'\)*\)*" contained skipwhite skipempty nextgroup=ocamlFuncWith
|
||||
|
||||
syn region ocamlFuncWith start="([^*]"me=e-1 end=")" contained contains=ocamlComment,ocamlWith,ocamlFuncStruct skipwhite skipempty nextgroup=ocamlFuncWith
|
||||
syn region ocamlFuncStruct matchgroup=ocamlModule start="[^a-zA-Z]struct\>"hs=s+1 matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
|
||||
syn region ocamlFuncWith start="([^*)]"me=e-1 end=")" contained contains=ocamlComment,ocamlWith,ocamlFuncStruct skipwhite skipempty nextgroup=ocamlFuncWith
|
||||
syn region ocamlFuncStruct matchgroup=ocamlStructEncl start="[^a-zA-Z]struct\>"hs=s+1 matchgroup=ocamlStructEncl end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
|
||||
|
||||
syn match ocamlModTypeRestr "\<\w\(\w\|'\)*\( *\. *\w\(\w\|'\)*\)*\>" contained
|
||||
syn region ocamlModTRWith start=":\s*("hs=s+1 end=")" contained contains=@ocamlAENoParen,ocamlWith
|
||||
@@ -143,20 +154,23 @@ syn match ocamlWith "\<\(\u\(\w\|'\)* *\. *\)*\w\(\w\|'\)*\>" contained skipw
|
||||
syn region ocamlWithRest start="[^)]" end=")"me=e-1 contained contains=ALLBUT,@ocamlContained
|
||||
|
||||
" "struct"
|
||||
syn region ocamlStruct matchgroup=ocamlModule start="\<\(module\s\+\)\=struct\>" matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
|
||||
syn region ocamlStruct matchgroup=ocamlStructEncl start="\<\(module\s\+\)\=struct\>" matchgroup=ocamlStructEncl end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
|
||||
|
||||
" "module type"
|
||||
syn region ocamlKeyword start="\<module\>\s*\<type\>\(\s*\<of\>\)\=" matchgroup=ocamlModule end="\<\w\(\w\|'\)*\>" contains=ocamlComment skipwhite skipempty nextgroup=ocamlMTDef
|
||||
syn match ocamlMTDef "=\s*\w\(\w\|'\)*\>"hs=s+1,me=s+1 skipwhite skipempty nextgroup=ocamlFullMod
|
||||
|
||||
" Quoted strings
|
||||
syn region ocamlString matchgroup=ocamlQuotedStringDelim start="{\z\([a-z_]*\)|" end="|\z1}" contains=@Spell
|
||||
|
||||
syn keyword ocamlKeyword and as assert class
|
||||
syn keyword ocamlKeyword constraint else
|
||||
syn keyword ocamlKeyword exception external fun
|
||||
|
||||
syn keyword ocamlKeyword in inherit initializer
|
||||
syn keyword ocamlKeyword land lazy let match
|
||||
syn keyword ocamlKeyword method mutable new of
|
||||
syn keyword ocamlKeyword parser private raise rec
|
||||
syn keyword ocamlKeyword lazy let match
|
||||
syn keyword ocamlKeyword method mutable new nonrec of
|
||||
syn keyword ocamlKeyword parser private rec
|
||||
syn keyword ocamlKeyword try type
|
||||
syn keyword ocamlKeyword virtual when while with
|
||||
|
||||
@@ -166,14 +180,11 @@ if exists("ocaml_revised")
|
||||
else
|
||||
syn keyword ocamlKeyword function
|
||||
syn keyword ocamlBoolean true false
|
||||
syn match ocamlKeyChar "!"
|
||||
endif
|
||||
|
||||
syn keyword ocamlType array bool char exn float format format4
|
||||
syn keyword ocamlType int int32 int64 lazy_t list nativeint option
|
||||
syn keyword ocamlType string unit
|
||||
|
||||
syn keyword ocamlOperator asr lnot lor lsl lsr lxor mod not
|
||||
syn keyword ocamlType bytes string unit
|
||||
|
||||
syn match ocamlConstructor "(\s*)"
|
||||
syn match ocamlConstructor "\[\s*\]"
|
||||
@@ -193,39 +204,61 @@ syn match ocamlCharErr "'\\\d\d'\|'\\\d'"
|
||||
syn match ocamlCharErr "'\\[^\'ntbr]'"
|
||||
syn region ocamlString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
|
||||
|
||||
syn match ocamlFunDef "->"
|
||||
syn match ocamlRefAssign ":="
|
||||
syn match ocamlTopStop ";;"
|
||||
syn match ocamlOperator "\^"
|
||||
syn match ocamlOperator "::"
|
||||
|
||||
syn match ocamlOperator "&&"
|
||||
syn match ocamlOperator "<"
|
||||
syn match ocamlOperator ">"
|
||||
syn match ocamlAnyVar "\<_\>"
|
||||
syn match ocamlKeyChar "|[^\]]"me=e-1
|
||||
syn match ocamlKeyChar ";"
|
||||
syn match ocamlKeyChar "\~"
|
||||
syn match ocamlKeyChar "?"
|
||||
syn match ocamlKeyChar "\*"
|
||||
syn match ocamlKeyChar "="
|
||||
|
||||
"" Operators
|
||||
|
||||
" The grammar of operators is found there:
|
||||
" https://caml.inria.fr/pub/docs/manual-ocaml/names.html#operator-name
|
||||
" https://caml.inria.fr/pub/docs/manual-ocaml/extn.html#s:ext-ops
|
||||
" https://caml.inria.fr/pub/docs/manual-ocaml/extn.html#s:index-operators
|
||||
" =, *, < and > are both operator names and keywords, we let the user choose how
|
||||
" to display them (has to be declared before regular infix operators):
|
||||
syn match ocamlEqual "="
|
||||
syn match ocamlStar "*"
|
||||
syn match ocamlAngle "<"
|
||||
syn match ocamlAngle ">"
|
||||
" Custom indexing operators:
|
||||
syn match ocamlIndexingOp "\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\(()\|\[]\|{}\)\(<-\)\?"
|
||||
" Extension operators (has to be declared before regular infix operators):
|
||||
syn match ocamlExtensionOp "#[#~?!.:|&$%<=>@^*/+-]\+"
|
||||
" Infix and prefix operators:
|
||||
syn match ocamlPrefixOp "![~?!.:|&$%<=>@^*/+-]*"
|
||||
syn match ocamlPrefixOp "[~?][~?!.:|&$%<=>@^*/+-]\+"
|
||||
syn match ocamlInfixOp "[&$%@^/+-][~?!.:|&$%<=>@^*/+-]*"
|
||||
syn match ocamlInfixOp "[|<=>*][~?!.:|&$%<=>@^*/+-]\+"
|
||||
syn match ocamlInfixOp "#[~?!.:|&$%<=>@^*/+-]\+#\@!"
|
||||
syn match ocamlInfixOp "!=[~?!.:|&$%<=>@^*/+-]\@!"
|
||||
syn keyword ocamlInfixOpKeyword asr land lor lsl lsr lxor mod or
|
||||
" := is technically an infix operator, but we may want to show it as a keyword
|
||||
" (somewhat analogously to = for let‐bindings and <- for assignations):
|
||||
syn match ocamlRefAssign ":="
|
||||
" :: is technically not an operator, but we may want to show it as such:
|
||||
syn match ocamlCons "::"
|
||||
" -> and <- are keywords, not operators (but can appear in longer operators):
|
||||
syn match ocamlArrow "->[~?!.:|&$%<=>@^*/+-]\@!"
|
||||
if exists("ocaml_revised")
|
||||
syn match ocamlErr "<-"
|
||||
syn match ocamlErr "<-[~?!.:|&$%<=>@^*/+-]\@!"
|
||||
else
|
||||
syn match ocamlOperator "<-"
|
||||
syn match ocamlKeyChar "<-[~?!.:|&$%<=>@^*/+-]\@!"
|
||||
endif
|
||||
|
||||
syn match ocamlNumber "\<-\=\d\(_\|\d\)*[l|L|n]\?\>"
|
||||
syn match ocamlNumber "\<-\=0[x|X]\(\x\|_\)\+[l|L|n]\?\>"
|
||||
syn match ocamlNumber "\<-\=0[o|O]\(\o\|_\)\+[l|L|n]\?\>"
|
||||
syn match ocamlNumber "\<-\=0[b|B]\([01]\|_\)\+[l|L|n]\?\>"
|
||||
syn match ocamlFloat "\<-\=\d\(_\|\d\)*\.\?\(_\|\d\)*\([eE][-+]\=\d\(_\|\d\)*\)\=\>"
|
||||
syn match ocamlNumber "-\=\<\d\(_\|\d\)*[l|L|n]\?\>"
|
||||
syn match ocamlNumber "-\=\<0[x|X]\(\x\|_\)\+[l|L|n]\?\>"
|
||||
syn match ocamlNumber "-\=\<0[o|O]\(\o\|_\)\+[l|L|n]\?\>"
|
||||
syn match ocamlNumber "-\=\<0[b|B]\([01]\|_\)\+[l|L|n]\?\>"
|
||||
syn match ocamlFloat "-\=\<\d\(_\|\d\)*\.\?\(_\|\d\)*\([eE][-+]\=\d\(_\|\d\)*\)\=\>"
|
||||
|
||||
" Labels
|
||||
syn match ocamlLabel "\~\(\l\|_\)\(\w\|'\)*"lc=1
|
||||
syn match ocamlLabel "?\(\l\|_\)\(\w\|'\)*"lc=1
|
||||
syn region ocamlLabel transparent matchgroup=ocamlLabel start="?(\(\l\|_\)\(\w\|'\)*"lc=2 end=")"me=e-1 contains=ALLBUT,@ocamlContained,ocamlParenErr
|
||||
syn region ocamlLabel transparent matchgroup=ocamlLabel start="[~?](\(\l\|_\)\(\w\|'\)*"lc=2 end=")"me=e-1 contains=ALLBUT,@ocamlContained,ocamlParenErr
|
||||
|
||||
|
||||
" Synchronization
|
||||
@@ -281,6 +314,8 @@ hi def link ocamlFullMod Include
|
||||
hi def link ocamlModTypeRestr Include
|
||||
hi def link ocamlWith Include
|
||||
hi def link ocamlMTDef Include
|
||||
hi def link ocamlSigEncl ocamlModule
|
||||
hi def link ocamlStructEncl ocamlModule
|
||||
|
||||
hi def link ocamlScript Include
|
||||
|
||||
@@ -291,18 +326,34 @@ hi def link ocamlModPreRHS Keyword
|
||||
hi def link ocamlMPRestr2 Keyword
|
||||
hi def link ocamlKeyword Keyword
|
||||
hi def link ocamlMethod Include
|
||||
hi def link ocamlFunDef Keyword
|
||||
hi def link ocamlRefAssign Keyword
|
||||
hi def link ocamlKeyChar Keyword
|
||||
hi def link ocamlAnyVar Keyword
|
||||
hi def link ocamlTopStop Keyword
|
||||
hi def link ocamlOperator Keyword
|
||||
|
||||
hi def link ocamlRefAssign ocamlKeyChar
|
||||
hi def link ocamlEqual ocamlKeyChar
|
||||
hi def link ocamlStar ocamlInfixOp
|
||||
hi def link ocamlAngle ocamlInfixOp
|
||||
hi def link ocamlCons ocamlInfixOp
|
||||
|
||||
hi def link ocamlPrefixOp ocamlOperator
|
||||
hi def link ocamlInfixOp ocamlOperator
|
||||
hi def link ocamlExtensionOp ocamlOperator
|
||||
hi def link ocamlIndexingOp ocamlOperator
|
||||
|
||||
if exists("ocaml_highlight_operators")
|
||||
hi def link ocamlInfixOpKeyword ocamlOperator
|
||||
hi def link ocamlOperator Operator
|
||||
else
|
||||
hi def link ocamlInfixOpKeyword Keyword
|
||||
endif
|
||||
|
||||
hi def link ocamlBoolean Boolean
|
||||
hi def link ocamlCharacter Character
|
||||
hi def link ocamlNumber Number
|
||||
hi def link ocamlFloat Float
|
||||
hi def link ocamlString String
|
||||
hi def link ocamlQuotedStringDelim Identifier
|
||||
|
||||
hi def link ocamlLabel Identifier
|
||||
|
||||
@@ -312,6 +363,7 @@ hi def link ocamlTodo Todo
|
||||
|
||||
hi def link ocamlEncl Keyword
|
||||
|
||||
hi def link ocamlPpxEncl ocamlEncl
|
||||
|
||||
let b:current_syntax = "ocaml"
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
" Language: shell (sh) Korn shell (ksh) bash (sh)
|
||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
|
||||
" Last Change: Mar 26, 2019
|
||||
" Version: 186
|
||||
" Last Change: Jun 16, 2019
|
||||
" Version: 188
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
|
||||
" For options and settings, please use: :help ft-sh-syntax
|
||||
" This file includes many ideas from Eric Brunet (eric.brunet@ens.fr)
|
||||
@@ -381,22 +381,23 @@ syn match shBQComment contained "#.\{-}\ze`" contains=@shCommentGroup
|
||||
|
||||
" Here Documents: {{{1
|
||||
" =========================================
|
||||
" Note : shHereDoc0[137] only had shDblQuoteList contained
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\\\=\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc02 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\s*\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc04 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^']\+\)'" matchgroup=shHereDoc05 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc06 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^ \t|>]\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t'"|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^\t|>]\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^\t|>]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$" contains=@shDblQuoteList
|
||||
|
||||
" Here Strings: {{{1
|
||||
" =============
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
" Contributor: Leonard Ehrenfried <leonard.ehrenfried@web.de>
|
||||
" Contributor: Karsten Hopp <karsten@redhat.com>
|
||||
" Originally: 2009-07-09
|
||||
" Last Change: 2017 Oct 25
|
||||
" SSH Version: 7.6p1
|
||||
" Last Change: 2019-05-31
|
||||
" SSH Version: 7.9p1
|
||||
"
|
||||
|
||||
" Setup
|
||||
@@ -137,7 +137,8 @@ syn case ignore
|
||||
|
||||
|
||||
" Keywords
|
||||
syn keyword sshdconfigMatch Host User Group Address
|
||||
" Also includes RDomain, but that is a keyword.
|
||||
syn keyword sshdconfigMatch Host User Group Address LocalAddress LocalPort
|
||||
|
||||
syn keyword sshdconfigKeyword AcceptEnv
|
||||
syn keyword sshdconfigKeyword AddressFamily
|
||||
@@ -150,8 +151,11 @@ syn keyword sshdconfigKeyword AuthenticationMethods
|
||||
syn keyword sshdconfigKeyword AuthorizedKeysFile
|
||||
syn keyword sshdconfigKeyword AuthorizedKeysCommand
|
||||
syn keyword sshdconfigKeyword AuthorizedKeysCommandUser
|
||||
syn keyword sshdconfigKeyword AuthorizedPrincipalsCommand
|
||||
syn keyword sshdconfigKeyword AuthorizedPrincipalsCommandUser
|
||||
syn keyword sshdconfigKeyword AuthorizedPrincipalsFile
|
||||
syn keyword sshdconfigKeyword Banner
|
||||
syn keyword sshdconfigKeyword CASignatureAlgorithms
|
||||
syn keyword sshdconfigKeyword ChallengeResponseAuthentication
|
||||
syn keyword sshdconfigKeyword ChrootDirectory
|
||||
syn keyword sshdconfigKeyword Ciphers
|
||||
@@ -162,13 +166,17 @@ syn keyword sshdconfigKeyword DebianBanner
|
||||
syn keyword sshdconfigKeyword DenyGroups
|
||||
syn keyword sshdconfigKeyword DenyUsers
|
||||
syn keyword sshdconfigKeyword DisableForwarding
|
||||
syn keyword sshdconfigKeyword ExposeAuthInfo
|
||||
syn keyword sshdconfigKeyword FingerprintHash
|
||||
syn keyword sshdconfigKeyword ForceCommand
|
||||
syn keyword sshdconfigKeyword GatewayPorts
|
||||
syn keyword sshdconfigKeyword GSSAPIAuthentication
|
||||
syn keyword sshdconfigKeyword GSSAPICleanupCredentials
|
||||
syn keyword sshdconfigKeyword GSSAPIEnablek5users
|
||||
syn keyword sshdconfigKeyword GSSAPIKeyExchange
|
||||
syn keyword sshdconfigKeyword GSSAPIKexAlgorithms
|
||||
syn keyword sshdconfigKeyword GSSAPIStoreCredentialsOnRekey
|
||||
syn keyword sshdconfigKeyword GSSAPIStrictAcceptorCheck
|
||||
syn keyword sshdconfigKeyword GatewayPorts
|
||||
syn keyword sshdconfigKeyword HostCertificate
|
||||
syn keyword sshdconfigKeyword HostKey
|
||||
syn keyword sshdconfigKeyword HostKeyAgent
|
||||
@@ -184,6 +192,8 @@ syn keyword sshdconfigKeyword KerberosAuthentication
|
||||
syn keyword sshdconfigKeyword KerberosGetAFSToken
|
||||
syn keyword sshdconfigKeyword KerberosOrLocalPasswd
|
||||
syn keyword sshdconfigKeyword KerberosTicketCleanup
|
||||
syn keyword sshdconfigKeyword KerberosUniqueCCache
|
||||
syn keyword sshdconfigKeyword KerberosUseKuserok
|
||||
syn keyword sshdconfigKeyword KexAlgorithms
|
||||
syn keyword sshdconfigKeyword KeyRegenerationInterval
|
||||
syn keyword sshdconfigKeyword ListenAddress
|
||||
@@ -197,6 +207,7 @@ syn keyword sshdconfigKeyword MaxStartups
|
||||
syn keyword sshdconfigKeyword PasswordAuthentication
|
||||
syn keyword sshdconfigKeyword PermitBlacklistedKeys
|
||||
syn keyword sshdconfigKeyword PermitEmptyPasswords
|
||||
syn keyword sshdconfigKeyword PermitListen
|
||||
syn keyword sshdconfigKeyword PermitOpen
|
||||
syn keyword sshdconfigKeyword PermitRootLogin
|
||||
syn keyword sshdconfigKeyword PermitTTY
|
||||
@@ -213,10 +224,14 @@ syn keyword sshdconfigKeyword PubkeyAuthentication
|
||||
syn keyword sshdconfigKeyword RSAAuthentication
|
||||
syn keyword sshdconfigKeyword RekeyLimit
|
||||
syn keyword sshdconfigKeyword RevokedKeys
|
||||
syn keyword sshdconfigKeyword RDomain
|
||||
syn keyword sshdconfigKeyword RhostsRSAAuthentication
|
||||
syn keyword sshdconfigKeyword ServerKeyBits
|
||||
syn keyword sshdconfigKeyword SetEnv
|
||||
syn keyword sshdconfigKeyword ShowPatchLevel
|
||||
syn keyword sshdconfigKeyword StrictModes
|
||||
syn keyword sshdconfigKeyword StreamLocalBindMask
|
||||
syn keyword sshdconfigKeyword StreamLocalBindUnlink
|
||||
syn keyword sshdconfigKeyword Subsystem
|
||||
syn keyword sshdconfigKeyword SyslogFacility
|
||||
syn keyword sshdconfigKeyword TCPKeepAlive
|
||||
@@ -227,6 +242,7 @@ syn keyword sshdconfigKeyword UsePAM
|
||||
syn keyword sshdconfigKeyword VersionAddendum
|
||||
syn keyword sshdconfigKeyword X11DisplayOffset
|
||||
syn keyword sshdconfigKeyword X11Forwarding
|
||||
syn keyword sshdconfigKeyword X11MaxDisplays
|
||||
syn keyword sshdconfigKeyword X11UseLocalhost
|
||||
syn keyword sshdconfigKeyword XAuthLocation
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: TeX
|
||||
" Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
|
||||
" Last Change: Apr 01, 2019
|
||||
" Version: 113
|
||||
" Last Change: May 14, 2019
|
||||
" Version: 114
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
|
||||
"
|
||||
" Notes: {{{1
|
||||
@@ -947,6 +947,7 @@ if has("conceal") && &enc == 'utf-8'
|
||||
call s:Greek('texGreek','\\eta\>' ,'η')
|
||||
call s:Greek('texGreek','\\theta\>' ,'θ')
|
||||
call s:Greek('texGreek','\\vartheta\>' ,'ϑ')
|
||||
call s:Greek('texGreek','\\iota\>' ,'ι')
|
||||
call s:Greek('texGreek','\\kappa\>' ,'κ')
|
||||
call s:Greek('texGreek','\\lambda\>' ,'λ')
|
||||
call s:Greek('texGreek','\\mu\>' ,'μ')
|
||||
@@ -969,11 +970,12 @@ if has("conceal") && &enc == 'utf-8'
|
||||
call s:Greek('texGreek','\\Delta\>' ,'Δ')
|
||||
call s:Greek('texGreek','\\Theta\>' ,'Θ')
|
||||
call s:Greek('texGreek','\\Lambda\>' ,'Λ')
|
||||
call s:Greek('texGreek','\\Xi\>' ,'Χ')
|
||||
call s:Greek('texGreek','\\Xi\>' ,'Ξ')
|
||||
call s:Greek('texGreek','\\Pi\>' ,'Π')
|
||||
call s:Greek('texGreek','\\Sigma\>' ,'Σ')
|
||||
call s:Greek('texGreek','\\Upsilon\>' ,'Υ')
|
||||
call s:Greek('texGreek','\\Phi\>' ,'Φ')
|
||||
call s:Greek('texGreek','\\Chi\>' ,'Χ')
|
||||
call s:Greek('texGreek','\\Psi\>' ,'Ψ')
|
||||
call s:Greek('texGreek','\\Omega\>' ,'Ω')
|
||||
delfun s:Greek
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
" Language: tmux(1) configuration file
|
||||
" Version: 2.7 (git-e4e060f2)
|
||||
" Version: 2.9a (git-0d64531f)
|
||||
" URL: https://github.com/ericpruitt/tmux.vim/
|
||||
" Maintainer: Eric Pruitt <eric.pruitt@gmail.com>
|
||||
" License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause)
|
||||
@@ -64,60 +64,51 @@ endfor
|
||||
syn keyword tmuxOptions
|
||||
\ buffer-limit command-alias default-terminal escape-time exit-empty
|
||||
\ activity-action assume-paste-time base-index bell-action default-command
|
||||
\ default-shell destroy-unattached detach-on-destroy
|
||||
\ default-shell default-size destroy-unattached detach-on-destroy
|
||||
\ display-panes-active-colour display-panes-colour display-panes-time
|
||||
\ display-time exit-unattached focus-events history-file history-limit
|
||||
\ key-table lock-after-time lock-command message-attr message-bg
|
||||
\ message-command-attr message-command-bg message-command-fg
|
||||
\ message-command-style message-fg message-limit message-style mouse
|
||||
\ aggressive-resize allow-rename alternate-screen automatic-rename
|
||||
\ automatic-rename-format clock-mode-colour clock-mode-style force-height
|
||||
\ force-width main-pane-height main-pane-width mode-attr mode-bg mode-fg
|
||||
\ mode-keys mode-style monitor-activity monitor-bell monitor-silence
|
||||
\ other-pane-height other-pane-width pane-active-border-bg
|
||||
\ pane-active-border-fg pane-active-border-style pane-base-index
|
||||
\ pane-border-bg pane-border-fg pane-border-format pane-border-status
|
||||
\ pane-border-style prefix prefix2 remain-on-exit renumber-windows
|
||||
\ repeat-time set-clipboard set-titles set-titles-string silence-action
|
||||
\ status status-attr status-bg status-fg status-interval status-justify
|
||||
\ status-keys status-left status-left-attr status-left-bg status-left-fg
|
||||
\ status-left-length status-left-style status-position status-right
|
||||
\ status-right-attr status-right-bg status-right-fg status-right-length
|
||||
\ key-table lock-after-time lock-command message-command-style message-limit
|
||||
\ message-style mouse aggressive-resize allow-rename alternate-screen
|
||||
\ automatic-rename automatic-rename-format clock-mode-colour
|
||||
\ clock-mode-style main-pane-height main-pane-width mode-keys mode-style
|
||||
\ monitor-activity monitor-bell monitor-silence other-pane-height
|
||||
\ other-pane-width pane-active-border-style pane-base-index
|
||||
\ pane-border-format pane-border-status pane-border-style prefix prefix2
|
||||
\ remain-on-exit renumber-windows repeat-time set-clipboard set-titles
|
||||
\ set-titles-string silence-action status status-bg status-fg status-format
|
||||
\ status-interval status-justify status-keys status-left status-left-length
|
||||
\ status-left-style status-position status-right status-right-length
|
||||
\ status-right-style status-style synchronize-panes terminal-overrides
|
||||
\ update-environment user-keys visual-activity visual-bell visual-silence
|
||||
\ window-active-style window-status-activity-attr window-status-activity-bg
|
||||
\ window-status-activity-fg window-status-activity-style window-status-attr
|
||||
\ window-status-bell-attr window-status-bell-bg window-status-bell-fg
|
||||
\ window-status-bell-style window-status-bg window-status-current-attr
|
||||
\ window-status-current-bg window-status-current-fg
|
||||
\ window-status-current-format window-status-current-style window-status-fg
|
||||
\ window-status-format window-status-last-attr window-status-last-bg
|
||||
\ window-status-last-fg window-status-last-style window-status-separator
|
||||
\ window-status-style window-style word-separators wrap-search xterm-keys
|
||||
\ window-active-style window-size window-status-activity-style
|
||||
\ window-status-bell-style window-status-current-format
|
||||
\ window-status-current-style window-status-format window-status-last-style
|
||||
\ window-status-separator window-status-style window-style word-separators
|
||||
\ wrap-search xterm-keys
|
||||
|
||||
syn keyword tmuxCommands
|
||||
\ attach attach-session bind bind-key break-pane breakp capture-pane
|
||||
\ capturep choose-buffer choose-client choose-tree clear-history clearhist
|
||||
\ clock-mode command-prompt confirm confirm-before copy-mode detach
|
||||
\ detach-client display display-message display-panes displayp find-window
|
||||
\ findw if if-shell join-pane joinp kill-pane kill-server kill-session
|
||||
\ kill-window killp has-session has killw link-window linkw list-buffers
|
||||
\ list-clients list-commands list-keys list-panes list-sessions list-windows
|
||||
\ load-buffer loadb lock lock-client lock-server lock-session last-pane
|
||||
\ lastp lockc locks last-window last ls lsb delete-buffer deleteb lsc lscm
|
||||
\ lsk lsp lsw move-pane move-window movep movew new new-session new-window
|
||||
\ neww next next-layout next-window nextl paste-buffer pasteb pipe-pane
|
||||
\ pipep prev previous-layout previous-window prevl refresh refresh-client
|
||||
\ rename rename-session rename-window renamew resize-pane resizep
|
||||
\ respawn-pane respawn-window respawnp respawnw rotate-window rotatew run
|
||||
\ run-shell save-buffer saveb select-layout select-pane select-window
|
||||
\ selectl selectp selectw send send-keys send-prefix set set-buffer
|
||||
\ set-environment set-hook set-option set-window-option setb setenv setw
|
||||
\ show show-buffer show-environment show-hooks show-messages show-options
|
||||
\ show-window-options showb showenv showmsgs showw source source-file
|
||||
\ split-window splitw start start-server suspend-client suspendc swap-pane
|
||||
\ swap-window swapp swapw switch-client switchc unbind unbind-key
|
||||
\ unlink-window unlinkw wait wait-for
|
||||
\ detach-client display display-menu display-message display-panes displayp
|
||||
\ find-window findw if if-shell join-pane joinp kill-pane kill-server
|
||||
\ kill-session kill-window killp has-session has killw link-window linkw
|
||||
\ list-buffers list-clients list-commands list-keys list-panes list-sessions
|
||||
\ list-windows load-buffer loadb lock lock-client lock-server lock-session
|
||||
\ lockc last-pane lastp locks ls last-window last lsb lsc delete-buffer
|
||||
\ deleteb lscm lsk lsp lsw menu move-pane move-window movep movew new
|
||||
\ new-session new-window neww next next-layout next-window nextl
|
||||
\ paste-buffer pasteb pipe-pane pipep prev previous-layout previous-window
|
||||
\ prevl refresh refresh-client rename rename-session rename-window renamew
|
||||
\ resize-pane resize-window resizep resizew respawn-pane respawn-window
|
||||
\ respawnp respawnw rotate-window rotatew run run-shell save-buffer saveb
|
||||
\ select-layout select-pane select-window selectl selectp selectw send
|
||||
\ send-keys send-prefix set set-buffer set-environment set-hook set-option
|
||||
\ set-window-option setb setenv setw show show-buffer show-environment
|
||||
\ show-hooks show-messages show-options show-window-options showb showenv
|
||||
\ showmsgs showw source source-file split-window splitw start start-server
|
||||
\ suspend-client suspendc swap-pane swap-window swapp swapw switch-client
|
||||
\ switchc unbind unbind-key unlink-window unlinkw wait wait-for
|
||||
|
||||
let &cpo = s:original_cpo
|
||||
unlet! s:original_cpo s:bg s:i
|
||||
|
||||
2077
runtime/syntax/typescript.vim
Normal file
2077
runtime/syntax/typescript.vim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim 8.0 script
|
||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Last Change: Mar 08, 2019
|
||||
" Version: 8.0-21
|
||||
" Last Change: Jun 16, 2019
|
||||
" Version: 8.0-22
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
||||
" Automatically generated keyword lists: {{{1
|
||||
|
||||
@@ -23,8 +23,8 @@ syn keyword vimCommand contained a arga[dd] argu[ment] bad[d] bn[ext] breakd[el]
|
||||
syn keyword vimCommand contained ab argd[elete] as[cii] bd[elete] bo[tright] breakl[ist] cN[ext] caddf[ile] ccl[ose] cfdo chd[ir] cle[arjumps] co[py] con[tinue] cr[ewind] d[elete] deletel delm[arks] diffo[ff] dir dp earlier elsei[f] endw[hile] files fini[sh] folddoc[losed] gr[ep] helpc[lose] his[tory] il[ist] iuna[bbrev] keepalt la[st] later lcs lf[ile] lgr[ep] lli[st] lo[adview] lop[en] lua m[ove] mes mkvie[w] nbc[lose] noautocmd nu[mber] opt[ions] pc[lose] popu[p] prof[ile] ptN[ext] ptn[ext] pw[d] pyf[ile] pyxfile rec[over] reg[isters] ri[ght] rubyf[ile] sIe sIr sav[eas] sbl[ast] sc scl scscope sf[ind] sge sgr sig sip sm[ap] sno[magic] sp[lit] spellu[ndo] src srn startg[replace] sun[hide] sw[apname] syntime tabN[ext] tabfir[st] tabo[nly] tc[l] tf[irst] tma[p] tp[revious] tunma[p] unh[ide] v vie[w] vne[w] wh[ile] wn[ext] wundo xme xunme
|
||||
syn keyword vimCommand contained abc[lear] argdo au bel[owright] bp[revious] bro[wse] cNf[ile] cal[l] cd cfir[st] che[ckpath] clo[se] col[der] conf[irm] cs debug deletep delp diffp[atch] dj[ump] dr[op] ec em[enu] ene[w] filet fir[st] foldo[pen] grepa[dd] helpf[ind] i imapc[lear] j[oin] keepj[umps] lad[dexpr] lb[uffer] lcscope lfdo lgrepa[dd] lmak[e] loadk lp[revious] luado ma[rk] messages mod[e] nbs[tart] noh[lsearch] o[pen] ownsyntax pe[rl] pp[op] profd[el] pta[g] ptp[revious] py3 python3 q[uit] red[o] res[ize] rightb[elow] rundo sIg sN[ext] sbN[ext] sbm[odified] scI scp se[t] sfir[st] sgi sh[ell] sign sir sme snoreme spe[llgood] spellw[rong] sre[wind] srp startr[eplace] sunme sy t tabc[lose] tabl[ast] tabp[revious] tcld[o] th[row] tmapc[lear] tr[ewind] u[ndo] unl ve[rsion] vim[grep] vs[plit] win[size] wp[revious] wv[iminfo] xmenu xunmenu
|
||||
syn keyword vimCommand contained abo[veleft] arge[dit] bN[ext] bf[irst] br[ewind] bufdo c[hange] cat[ch] cdo cg[etfile] checkt[ime] cmapc[lear] colo[rscheme] cope[n] cscope debugg[reedy] deletl dep diffpu[t] dl ds[earch] echoe[rr] en[dif] ex filetype fix[del] for gui helpg[rep] ia in ju[mps] keepp[atterns] laddb[uffer] lbo[ttom] ld[o] lfir[st] lh[elpgrep] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mk[exrc] mz[scheme] new nor ol[dfiles] p[rint] ped[it] pre[serve] promptf[ind] ptf[irst] ptr[ewind] py3do pythonx qa[ll] redi[r] ret[ab] ru[ntime] rv[iminfo] sIl sa[rgument] sb[uffer] sbn[ext] sce scr[iptnames] setf[iletype] sg sgl si sil[ent] sl[eep] smenu snoremenu spelld[ump] spr[evious] srg st[op] stj[ump] sunmenu syn tN[ext] tabd[o] tabm[ove] tabr[ewind] tclf[ile] tj[ump] tn[ext] try una[bbreviate] unlo[ckvar] verb[ose] vimgrepa[dd] wN[ext] winc[md] wq x[it] xnoreme xwininfo
|
||||
syn keyword vimCommand contained al[l] argg[lobal] b[uffer] bl[ast] brea[k] buffers cabc[lear] cb[uffer] ce[nter] cgetb[uffer] chi[story] cn[ext] com cp[revious] cstag delc[ommand] deletp di[splay] diffs[plit] dli[st] dsp[lit] echom[sg] endf[unction] exi[t] filt[er] fo[ld] fu[nction] gvim helpt[ags] iabc[lear] intro k lN[ext] laddf[ile] lc[d] le[ft] lg[etfile] lhi[story] lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mks[ession] mzf[ile] nmapc[lear] nore omapc[lear] pa[ckadd] perld[o] prev[ious] promptr[epl] ptj[ump] pts[elect] py[thon] pyx quita[ll] redr[aw] retu[rn] rub[y] sI sIn sal[l] sba[ll] sbp[revious] scg scripte[ncoding] setg[lobal] sgI sgn sic sim[alt] sla[st] smile so[urce] spelli[nfo] sr sri sta[g] stopi[nsert] sus[pend] sync ta[g] tabe[dit] tabn[ext] tabs tcd te[aroff] tl[ast] tno[remap] ts[elect] undoj[oin] uns[ilent] vert[ical] viu[sage] w[rite] windo wqa[ll] xa[ll] xnoremenu y[ank]
|
||||
syn keyword vimCommand contained ar[gs] argl[ocal] ba[ll] bm[odified] breaka[dd] bun[load] cad[dbuffer] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cnew[er] comc[lear] cpf[ile] cuna[bbrev] delel delf[unction] dif[fupdate] difft[his] do e[dit] echon endfo[r] exu[sage] fin[d] foldc[lose] g h[elp] hi if is[earch] kee[pmarks] lNf[ile] lan[guage] lch[dir] lefta[bove] lgetb[uffer] ll lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mksp[ell] n[ext] tch[dir]
|
||||
syn keyword vimCommand contained al[l] argg[lobal] b[uffer] bl[ast] brea[k] buffers cabc[lear] cb[uffer] ce[nter] cgetb[uffer] chi[story] cn[ext] com cp[revious] cstag delc[ommand] deletp di[splay] diffs[plit] dli[st] dsp[lit] echom[sg] endf[unction] exi[t] filt[er] fo[ld] fu[nction] gvim helpt[ags] iabc[lear] intro k lN[ext] laddf[ile] lc[d] le[ft] lg[etfile] lhi[story] lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mks[ession] mzf[ile] nmapc[lear] nore omapc[lear] pa[ckadd] perld[o] prev[ious] promptr[epl] ptj[ump] pts[elect] py[thon] pyx quita[ll] redr[aw] retu[rn] rub[y] sI sIn sal[l] sba[ll] sbp[revious] scg scripte[ncoding] setg[lobal] sgI sgn sic sim[alt] sla[st] smile so[urce] spelli[nfo] sr sri sta[g] stopi[nsert] sus[pend] sync ta[g] tabe[dit] tabn[ext] tabs te[aroff] tl[ast] tno[remap] ts[elect] undoj[oin] uns[ilent] vert[ical] viu[sage] w[rite] windo wqa[ll] xa[ll] xnoremenu y[ank]
|
||||
syn keyword vimCommand contained ar[gs] argl[ocal] ba[ll] bm[odified] breaka[dd] bun[load] cad[dbuffer] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cnew[er] comc[lear] cpf[ile] cuna[bbrev] delel delf[unction] dif[fupdate] difft[his] do e[dit] echon endfo[r] exu[sage] fin[d] foldc[lose] g h[elp] hi if is[earch] kee[pmarks] lNf[ile] lan[guage] lch[dir] lefta[bove] lgetb[uffer] ll lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mksp[ell] n[ext]
|
||||
syn match vimCommand contained "\<z[-+^.=]\=\>"
|
||||
syn keyword vimStdPlugin contained Arguments Break Clear Continue DiffOrig Evaluate Finish Gdb Man N[ext] Over P[rint] Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Winbar XMLent XMLns
|
||||
|
||||
@@ -166,7 +166,7 @@ syn match vimNumber "-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgro
|
||||
syn match vimNumber "\<0[xX]\x\+" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment
|
||||
syn match vimNumber "\%(^\|\A\)\zs#\x\{6}" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment
|
||||
|
||||
" All vimCommands are contained by vimIsCommands. {{{2
|
||||
" All vimCommands are contained by vimIsCommand. {{{2
|
||||
syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimEcho,vimIsCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd
|
||||
syn match vimIsCommand "\<\h\w*\>" contains=vimCommand
|
||||
syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>"
|
||||
@@ -201,7 +201,7 @@ syn keyword vimFTOption contained detect indent off on plugin
|
||||
|
||||
" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2
|
||||
" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
|
||||
syn cluster vimAugroupList contains=vimAugroup,vimIsCommand,vimCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimMap,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue,vimSetEqual,vimOption
|
||||
syn cluster vimAugroupList contains=vimAugroup,vimIsCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimNotFunc,vimMap,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue,vimSetEqual,vimOption
|
||||
if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a'
|
||||
syn region vimAugroup fold matchgroup=vimAugroupKey start="\<aug\%[roup]\>\ze\s\+\K\k*" end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList
|
||||
else
|
||||
@@ -217,8 +217,8 @@ syn keyword vimAugroupKey contained aug[roup]
|
||||
" =========
|
||||
syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue
|
||||
syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
|
||||
syn match vimOper "\(\<is\|\<isnot\)[?#]\{0,2}\>" skipwhite nextgroup=vimString,vimSpecFile
|
||||
syn match vimOper "||\|&&\|[-+.]" skipwhite nextgroup=vimString,vimSpecFile
|
||||
syn match vimOper "\(\<is\|\<isnot\)[?#]\{0,2}\>" skipwhite nextgroup=vimString,vimSpecFile
|
||||
syn match vimOper "||\|&&\|[-+.!]" skipwhite nextgroup=vimString,vimSpecFile
|
||||
syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup
|
||||
syn region vimOperParen matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
|
||||
if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
|
||||
@@ -255,7 +255,7 @@ syn match vimSpecFileMod "\(:[phtre]\)\+" contained
|
||||
|
||||
" User-Specified Commands: {{{2
|
||||
" =======================
|
||||
syn cluster vimUserCmdList contains=vimAddress,vimSyntax,vimHighlight,vimAutoCmd,vimCmplxRepeat,vimComment,vimCtrlChar,vimEscapeBrace,vimFilter,vimFunc,vimFuncName,vimFunction,vimFunctionError,vimIsCommand,vimMark,vimNotation,vimNumber,vimOper,vimRegion,vimRegister,vimLet,vimSet,vimSetEqual,vimSetString,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange,vimSynLine
|
||||
syn cluster vimUserCmdList contains=vimAddress,vimSyntax,vimHighlight,vimAutoCmd,vimCmplxRepeat,vimComment,vimCtrlChar,vimEscapeBrace,vimFunc,vimFuncName,vimFunction,vimFunctionError,vimIsCommand,vimMark,vimNotation,vimNumber,vimOper,vimRegion,vimRegister,vimLet,vimSet,vimSetEqual,vimSetString,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange,vimSynLine
|
||||
syn keyword vimUserCommand contained com[mand]
|
||||
syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList
|
||||
syn match vimUserAttrbError contained "-\a\+\ze\s"
|
||||
@@ -334,13 +334,14 @@ syn match vimSubstFlags contained "[&cegiIpr]\+"
|
||||
syn match vimString "[^(,]'[^']\{-}\zs'"
|
||||
|
||||
" Marks, Registers, Addresses, Filters: {{{2
|
||||
syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimOper,vimMarkNumber,vimSubst
|
||||
syn match vimMark "'[<>]\ze[-+,!]" nextgroup=vimOper,vimMarkNumber,vimSubst
|
||||
syn match vimMark ",\zs'[<>]\ze" nextgroup=vimOper,vimMarkNumber,vimSubst
|
||||
syn match vimMark "[!,:]\zs'[a-zA-Z0-9]" nextgroup=vimOper,vimMarkNumber,vimSubst
|
||||
syn match vimMark "\<norm\%[al]\s\zs'[a-zA-Z0-9]" nextgroup=vimOper,vimMarkNumber,vimSubst
|
||||
syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst
|
||||
syn match vimMark "'[<>]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst
|
||||
syn match vimMark ",\zs'[<>]\ze" nextgroup=vimFilter,vimMarkNumber,vimSubst
|
||||
syn match vimMark "[!,:]\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst
|
||||
syn match vimMark "\<norm\%[al]\s\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst
|
||||
syn match vimMarkNumber "[-+]\d\+" contained contains=vimOper nextgroup=vimSubst2
|
||||
syn match vimPlainMark contained "'[a-zA-Z0-9]"
|
||||
syn match vimRange "[`'][a-zA-Z0-9],[`'][a-zA-Z0-9]" contains=vimMark skipwhite nextgroup=vimFilter
|
||||
|
||||
syn match vimRegister '[^,;[{: \t]\zs"[a-zA-Z0-9.%#:_\-/]\ze[^a-zA-Z_":0-9]'
|
||||
syn match vimRegister '\<norm\s\+\zs"[a-zA-Z0-9]'
|
||||
@@ -351,8 +352,8 @@ syn match vimPlainRegister contained '"[a-zA-Z0-9\-:.%#*+=]'
|
||||
syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst1
|
||||
syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst1
|
||||
|
||||
syn match vimFilter contained "^!.\{-}\(|\|$\)" contains=vimSpecFile
|
||||
syn match vimFilter contained "\A!.\{-}\(|\|$\)"ms=s+1 contains=vimSpecFile,vimFunction,vimFuncName,vimOperParen
|
||||
syn match vimFilter "^!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
|
||||
syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
|
||||
|
||||
" Complex repeats (:h complex-repeat) {{{2
|
||||
syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1
|
||||
@@ -433,17 +434,18 @@ syn case match
|
||||
" ==========================
|
||||
syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute
|
||||
syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimNotation
|
||||
syn match vimNotFunc "\<if\>\|\<el\%[seif]\>\|\<return\>\|\<while\>"
|
||||
|
||||
" Errors And Warnings: {{{2
|
||||
" ====================
|
||||
if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")
|
||||
syn match vimFunctionError "\s\zs[a-z0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank
|
||||
" syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\d\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank
|
||||
syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\d\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank
|
||||
syn match vimElseIfErr "\<else\s\+if\>"
|
||||
syn match vimBufnrWarn /\<bufnr\s*(\s*["']\.['"]\s*)/
|
||||
endif
|
||||
|
||||
syn match vimNotFunc "\<if\>\|\<el\%[seif]\>\|\<return\>\|\<while\>" skipwhite nextgroup=vimOper,vimOperParen,vimVar,vimFunc,vimNotation
|
||||
|
||||
" Norm {{{2
|
||||
" ====
|
||||
syn match vimNorm "\<norm\%[al]!\=" skipwhite nextgroup=vimNormCmds
|
||||
@@ -653,7 +655,7 @@ if (g:vimsyn_embed =~# 'l' && has("lua")) && filereadable(s:luapath)
|
||||
syn cluster vimFuncBodyList add=vimLuaRegion
|
||||
exe "syn include @vimLuaScript ".s:luapath
|
||||
VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimLuaScript
|
||||
VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*$+ end=+\.$+ contains=@vimLuaScript
|
||||
VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*$+ end=+\.$+ contains=@vimLuaScript
|
||||
syn cluster vimFuncBodyList add=vimLuaRegion
|
||||
else
|
||||
syn region vimEmbedError start=+lua\s*<<\s*\z(.*\)$+ end=+^\z1$+
|
||||
|
||||
968
runtime/tutor/tutor.ko
Normal file
968
runtime/tutor/tutor.ko
Normal file
@@ -0,0 +1,968 @@
|
||||
===============================================================================
|
||||
= 빔 길잡이 (VIM Tutor) 에 오신 것을 환영합니다 - Version 1.7 =
|
||||
===============================================================================
|
||||
|
||||
빔(Vim)은 이 길잡이에서 다 설명할 수 없을 만큼 많은 명령을 가진
|
||||
매우 강력한 편집기입니다. 이 길잡이는 빔을 쉽게 전천후 편집기로 사용할
|
||||
수 있도록 충분한 명령에 대해 설명하고 있습니다.
|
||||
|
||||
이 길잡이를 떼는 데에는 실습하는 데에 얼마나 시간을 쓰는 가에 따라서
|
||||
25-30 분 정도가 걸립니다.
|
||||
|
||||
이 연습에 포함된 명령은 내용을 고칩니다. 이 파일의 복사본을 만들어서
|
||||
연습하세요. (vimtutor 를 통해 시작했다면, 이미 복사본을 사용하는
|
||||
중입니다.)
|
||||
|
||||
중요한 것은, 이 길잡이가 직접 써보면서 배우도록 고려되어 있다는 것입니다.
|
||||
명령을 제대로 익히려면, 직접 실행해보는 것이 필요합니다. 내용을 읽는
|
||||
것만으로는, 명령을 잊어버리게 될 것입니다.
|
||||
|
||||
자 이제, Caps Lock(Shift-Lock) 키가 눌려있지 않은지 확인해보시고, j 키를
|
||||
충분히 눌러서 Lesson 1.1이 화면에 가득 차도록 움직여봅시다.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.1: 커서 움직이기
|
||||
|
||||
** 커서를 움직이려면, 표시된 대로 h,j,k,l 키를 누르십시오. **
|
||||
^
|
||||
k 힌트: h 키는 왼쪽에 있으며, 왼쪽으로 움직입니다.
|
||||
< h l > l 키는 오른쪽에 있으며, 오른쪽으로
|
||||
j 움직입니다.
|
||||
v j 키는 아래방향 화살표처럼 생겼습니다.
|
||||
|
||||
1. 익숙해질 때까지 커서를 스크린 상에서 움직여 보십시오.
|
||||
|
||||
2. 아래 방향키 (j)를 반복입력이 될 때까지 누르고 계십시오.
|
||||
이제 다음 lesson으로 가는 방법을 알게 되었습니다.
|
||||
|
||||
3. 아래 방향키를 이용하여, Lesson 1.2 로 가십시오.
|
||||
|
||||
참고: 원하지 않는 무언가가 입력이 되었다면, <ESC>를 눌러서, 명령 모드로
|
||||
돌아가십시오. 그 후에 원하는 명령을 다시 입력하십시오.
|
||||
|
||||
참고: 커서키 또한 작동할 것입니다. 하지만 hjkl에 익숙해지면, 커서키보다
|
||||
훨씬 빠르게 이동할 수 있을 것입니다. 정말요!
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.2: 빔을 시작하고 끝내기
|
||||
|
||||
|
||||
!! 주의: 아래 있는 단계를 실행하기 전에, 이 lesson 전체를 읽으십시오!!
|
||||
|
||||
1. <ESC> 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다.
|
||||
|
||||
2. 다음과 같이 입력합니다: :q! <ENTER>
|
||||
이렇게 하면, 바뀐 내용을 *저장하지 않고* 편집기를 빠져나갑니다.
|
||||
|
||||
3. 쉘 프롬프트가 보인다면, 다시 길잡이로 돌아오기 위해 다음과 같이
|
||||
입력합니다.
|
||||
vimtutor <ENTER>
|
||||
또는 다음과 같을 수도 있습니다.
|
||||
vim tutor.ko <ENTER>
|
||||
|
||||
---> 'vim' 은 빔 편집기로 들어가는 것을 뜻하며, 'tutor.ko'는 편집하려는
|
||||
파일을 뜻합니다.
|
||||
|
||||
4. 위에서 이야기한 단계를 기억하였으며, 확신이 서면, 1에서 3까지를
|
||||
수행하여 편집기를 나갔다가 다시 들어와 보십시오.
|
||||
|
||||
주의: :q! <ENTER> 는 바뀐 내용을 저장하지 않습니다. 이 후 lesson에서
|
||||
어떻게 편집 내용을 저장하는지 배울 수 있습니다.
|
||||
|
||||
5. 그 후 커서를 아래로 움직여 Lesson 1.3 으로 가십시오.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.3: 텍스트 편집 - 지우기
|
||||
|
||||
|
||||
** 명령 모드에서 x 를 누르면 커서가 위치한 곳의 글자를 지울 수 있습니다. **
|
||||
|
||||
1. ----> 로 표시된 곳으로 커서를 옮겨보십시오.
|
||||
|
||||
2. 오타를 수정하기 위해, 커서를 지울 글자 위로 움직여 보십시오.
|
||||
|
||||
3. x 키를 눌러서 지워야할 글자를 지우십시오.
|
||||
|
||||
4. 2에서 4까지를 반복하여 문장이 올바르게 되도록 하여 보십시오.
|
||||
|
||||
---> The ccow jumpedd ovverr thhe mooon.
|
||||
|
||||
5. 문장이 정확해졌다면, Lesson 1.4로 가십시오.
|
||||
|
||||
주의: 이 길잡이를 보면서 외우려고 하지말고, 직접 사용해보면서 익히길
|
||||
바랍니다.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.4: 텍스트 편집 - 삽입 (INSERTION)
|
||||
|
||||
|
||||
** 명령 모드에서 i 를 누르면 텍스트를 입력할 수 있습니다. **
|
||||
|
||||
1. 커서를 첫번째 ---> 로 표시된 줄로 움직입니다.
|
||||
|
||||
2. 첫번째 줄을 두번째 줄과 똑같이 만들것입니다. 텍스트가 들어가야할
|
||||
곳 다음부터 첫번째 글자 위에 커서를 옮겨 놓습니다.
|
||||
|
||||
3. i 키를 누른 후, 필요한 내용을 입력합니다.
|
||||
|
||||
4. 수정한 후에는 <ESC> 를 눌러서 명령 모드로 돌아갑니다.
|
||||
문장을 올바르게 만들기 위해 2에서 4의 과정을 반복합니다.
|
||||
|
||||
---> There is text misng this .
|
||||
---> There is some text missing from this line.
|
||||
|
||||
5. 텍스트를 삽입하는 데에 익숙해졌다면, Lesson 1.5로 가십시오.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.5: 택스트 편집 - 추가 (APPENDING)
|
||||
|
||||
|
||||
** A 를 입력해 텍스트를 추가할 수 있습니다. **
|
||||
|
||||
1. 커서를 첫번째 ---> 로 표시된 줄로 움직입니다.
|
||||
커서가 문장 내 어디에 있던 상관없습니다.
|
||||
|
||||
2. A 키를 눌러 필요한 내용을 입력합니다.
|
||||
|
||||
3. 내용을 모두 입력한 후 <ESC>를 눌러 명령 모드로 돌아갑니다.
|
||||
|
||||
4. 커서를 두번째 ---> 로 표시된 줄로 움직입니다.
|
||||
문장을 올바르게 만들기 위해 2에서 3의 과정을 반복합니다.
|
||||
|
||||
---> There is some text missing from th
|
||||
There is some text missing from this line.
|
||||
---> There is also some text miss
|
||||
There is also some text missing here.
|
||||
|
||||
5. 텍스트를 추가하는 데 익숙해졌다면, Lesson 1.6으로 가십시오.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.6: 파일 편집
|
||||
|
||||
** :wq 를 이용하여 파일을 저장하고 빠져나갈 수 있습니다. **
|
||||
|
||||
!! 주의: 아래 있는 단계를 실행하기 전에, 이 lesson 전체를 읽으십시오!!
|
||||
|
||||
1. lesson 1.2에서 배웠던 것처럼 :q!로 편집기를 나갈 수 있습니다.
|
||||
만약, 다른 터미널에 접근 가능하다면, 아래의 단계를 다른 터미널에서 해봅니다.
|
||||
|
||||
2. 쉘 프롬프트에 다음과 같이 입력합니다: vim tutor <ENTER>
|
||||
'vim' 은 빔 에디터 시작을 위한 명령어, 'tutor'는 수정하고자 하는
|
||||
파일의 이름 입니다.
|
||||
|
||||
3. 앞에서 배웠던 것처럼 텍스트를 삽입하고 지워보세요.
|
||||
|
||||
4. 다음 명령어를 이용해 파일 수정 부분을 저장하고 빠져나갑니다: :wq <ENTER>
|
||||
|
||||
5. 만약 1에서 vimtutor를 빠져나갔다가 다시 들어왔다면, 아래로 움직여 요약으로 넘어가도록 합시다.
|
||||
|
||||
6. 위 모든 단계를 다 읽고 이해한 후에 직접 해보세요.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 1 요약
|
||||
|
||||
|
||||
1. 커서를 움직일 때에는 화살표 키나 hjkl 키를 이용합니다.
|
||||
h (왼쪽) j (아래) k (위) l (오른쪽)
|
||||
|
||||
2. 쉘 프롬프트에서 빔을 시작하려면 vim FILENAME <ENTER>
|
||||
|
||||
3. 수정한 내용을 무시한 채로 빔에서 빠져나가려면 <ESC> :q! <ENTER>
|
||||
저장한 후 빔에서 빠져나가려면 <ESC> :wq <ENTER>
|
||||
|
||||
4. 명령 모드에서 커서가 위치한 곳의 글자를 지우려면 x 를 입력합니다.
|
||||
|
||||
5. 명령 모드에서 커서가 위치한 곳에 텍스트를 삽입하려면
|
||||
i 를 누른 후 텍스트를 입력하고 <ESC> 커서 앞에 삽입합니다.
|
||||
A 를 누른 후 텍스트를 입력하고 <ESC> 문장 뒤에 추가 합니다.
|
||||
|
||||
참고: <ESC>는 명령 모드로 돌아가는 데 쓰며, 원치 않는 명령이나 완전히 입력되지
|
||||
않은 명령을 취소하는 데에도 씁니다.
|
||||
|
||||
그럼 Lesson 2를 시작합시다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.1: 삭제(DELETION) 명령
|
||||
|
||||
|
||||
** 한 단어를 끝까지 지우려면 dw 라고 치면 됩니다. **
|
||||
|
||||
1. <ESC> 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다.
|
||||
|
||||
2. 아래에 ---> 로 표시된 줄 까지 커서를 옮깁니다.
|
||||
|
||||
3. 지워야할 단어의 처음으로 커서를 옮깁니다.
|
||||
|
||||
4. dw 라고 쳐서 그 단어를 지웁니다.
|
||||
|
||||
주의: 위에서 말한대로 하면 화면의 마지막 줄에 dw 라는 글자가 표시됩니다.
|
||||
잘못 쳤다면, <ESC> 를 눌러서 다시 시작하십시오.
|
||||
|
||||
---> There are a some words fun that don't belong paper in this sentence.
|
||||
|
||||
5. 3, 4번 과정을 다시 하여 문장을 정확하게 만든 뒤 Lesson 2.2로 가십시오.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.2: 다른 삭제 명령
|
||||
|
||||
** d$ 라고 치면 그 줄 끝까지 지워집니다. **
|
||||
|
||||
1. <ESC> 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다.
|
||||
|
||||
2. 아래에 ---> 로 표시된 줄 까지 커서를 옮깁니다.
|
||||
|
||||
3. 올바른 줄의 끝으로 커서를 옮깁니다. (첫번째로 나오는 . 다음입니다.)
|
||||
|
||||
4. d$ 라고 쳐서 줄 끝까지 지웁니다.
|
||||
|
||||
---> Somebody typed the end of this line twice. end of this line twice.
|
||||
|
||||
|
||||
5. 어떤 일이 일어났는지 이해하기 위해 Lesson 2.3 으로 가십시오.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.3: 명령과 적용 대상에 대해
|
||||
|
||||
|
||||
삭제 명령 d의 형식은 다음과 같습니다.
|
||||
|
||||
d 대상
|
||||
|
||||
여기서:
|
||||
d - 지우는 명령
|
||||
대상 - 아래에 제시된 대상에 대해 명령을 수행
|
||||
|
||||
적용 가능한 대상의 종류:
|
||||
w - 커서에서 그 단어의 끝까지 (공백 포함.)
|
||||
e - 커서에서 그 단어의 끝까지 (공백을 포함하지 않음.)
|
||||
$ - 커서에서 그 줄의 끝까지
|
||||
|
||||
예를 들어, de 는 커서의 위치부터 해당 단어의 끝까지 지웁니다.
|
||||
|
||||
참고: 호기심이 있다면, 명령 모드에서 명령 없이 대상을 입력해보십시오.
|
||||
위에서 이야기한 대상의 목록에 따라 커서가 움직이게 됩니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.4: 대상에 반복 적용하기
|
||||
|
||||
|
||||
** 대상 이전에 숫자를 넣어주면 그 만큼 반복 됩니다. **
|
||||
|
||||
1. 아래에 ---> 로 표시된 줄 까지 커서를 옮깁니다.
|
||||
|
||||
2. 2w 입력하여 커서를 단어 두 개 뒤로 옮깁니다.
|
||||
|
||||
3. 3e 입력하여 커서를 뒤로 세 번째 단어의 끝으로 옮깁니다.
|
||||
|
||||
4. 0 (zero) 를 입력하여 문장의 시작부분으로 움직입니다.
|
||||
|
||||
5. 2에서 3까지를 다른 숫자로 반복해 봅니다.
|
||||
|
||||
---> This is just a line with words you can move around in.
|
||||
|
||||
6. Lesson 2.5로 가십시오.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.5: 삭제에 반복 적용하기
|
||||
|
||||
|
||||
** 명령과 숫자를 함께 사용하면 그만큼 반복 수행 됩니다. **
|
||||
|
||||
위에서 삭제 명령과 대상의 조합과 같이, 대상 이전에 횟수를 넣어 더 많이 삭제 할 수 있습니다:
|
||||
d 횟수 대상
|
||||
|
||||
1. 아래 ---> 표시된 줄에서 커서를 첫번째 대문자 단어로 옮깁니다.
|
||||
|
||||
2. d2w를 입력하여 두 대문자 단어를 지웁니다.
|
||||
|
||||
3. 이어지는 대문자 단어들을 1에서 2까지의 단계를 이용해 횟수를 바꾸어 삭제해 봅니다.
|
||||
|
||||
---> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.6: 줄 전체 조작하기
|
||||
|
||||
|
||||
|
||||
** dd 라고 치면 줄 전체를 지웁니다. **
|
||||
|
||||
줄 전체를 지우는 일이 잦기 때문에, Vi를 디자인 한 사람들은, 간단히 d를
|
||||
두번 연달아 치면 한 줄을 지울 수 있도록 하였습니다.
|
||||
|
||||
1. 커서를 아래 나온 단락의 두번째 줄로 가져가십시오.
|
||||
2. dd 를 입력하여 그 줄을 지우십시오.
|
||||
3. 그런 다음 네번째 줄로 가십시오.
|
||||
4. 2dd 라고 입력하여 두줄을 지웁니다. ( 횟수-명령-대상을 기억하세요. )
|
||||
|
||||
---> 1) Roses are red,
|
||||
---> 2) Mud is fun,
|
||||
---> 3) Violets are blue,
|
||||
---> 4) I have a car,
|
||||
---> 5) Clocks tell time,
|
||||
---> 6) Sugar is sweet
|
||||
---> 7) And so are you.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.7: 취소(UNDO) 명령
|
||||
|
||||
|
||||
** u 를 누르면 마지막 명령이 취소되며, U 는 줄 전체를 수정합니다. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 줄로 이동한 후 첫번째 잘못된 부분 위로 옮깁니다.
|
||||
2. x 를 입력하여 첫번째 잘못된 글자를 지웁니다.
|
||||
3. 그럼 이제 u 를 입력하여 마지막으로 수행된 명령을 취소합니다.
|
||||
4. 이번에는 x 명령을 이용하여 그 줄의 모든 에러를 수정해봅시다.
|
||||
5. 대문자 U 를 눌러서 그 줄을 원래 상태로 돌려놓아 보십시오.
|
||||
6. 이번에는 u 를 몇 번 눌러서 U 와 이전 명령을 취소해봅시다.
|
||||
7. CTRL-R (CTRL 키를 누른 상태에서 R을 누르는 것) 을 몇 번 눌러서
|
||||
명령을 다시 실행해봅시다. (취소한 것을 취소함.)
|
||||
|
||||
---> Fiix the errors oon thhis line and reeplace them witth undo.
|
||||
|
||||
8. 이 명령은 매우 유용합니다. 그럼 Lesson 2 요약으로 넘어가도록 합시다.
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 2 요약
|
||||
|
||||
|
||||
1. 커서가 위치한 곳부터 단어의 끝까지 지우려면: dw
|
||||
2. 커서가 위치한 곳부터 줄 끝까지 지우려면: d$
|
||||
3. 줄 전체를 지우려면: dd
|
||||
|
||||
4. 횟수와 함께 대상을 반복 시키려면: 2w
|
||||
5. 명령 모드에서 내리는 명령의 형식은 다음과 같습니다:
|
||||
|
||||
[횟수] 명령 대상 또는 명령 [횟수] 대상
|
||||
|
||||
여기서:
|
||||
횟수 - 그 명령을 몇 번 반복할 것인가
|
||||
명령 - 어떤 명령을 내릴 것인가 ( 예를 들어, 삭제인 경우는 d )
|
||||
대상 - 명령이 동작할 대상, 예를 들어 w (단어), $ (줄의 끝) 등.
|
||||
|
||||
6. 커서를 문장 맨 앞으로 옮기려면: 0
|
||||
|
||||
7. 이전 행동을 취소하려면: u (소문자 u)
|
||||
한 줄에서 수정한 것을 모두 취소하려면: U (대문자 U)
|
||||
취소한 것을 다시 실행하려면: CTRL-R
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 3.1: 붙이기(PUT) 명령
|
||||
|
||||
|
||||
** p 를 입력하여 마지막으로 지운 내용을 커서 뒤에 붙입니다. **
|
||||
|
||||
1. 아래에 있는 문단의 첫 줄로 커서를 움직이십시오.
|
||||
|
||||
2. dd 를 입력하여 그 줄을 지워서 빔의 버퍼에 저장합니다.
|
||||
|
||||
3. 아까 지운 줄이 가야할 위치의 *윗줄로* 커서를 옮깁니다.
|
||||
|
||||
4. 명령 모드에서, p 를 입력하여 그 줄을 제대로 된 자리로 옮깁니다.
|
||||
|
||||
5. 2에서 4를 반복하여 모든 줄의 순서를 바로 잡으십시오.
|
||||
|
||||
d) Can you learn too?
|
||||
b) Violets are blue,
|
||||
c) Intelligence is learned,
|
||||
a) Roses are red,
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 3.2: 치환(REPLACE) 명령
|
||||
|
||||
|
||||
** 커서 아래의 글자 하나를 바꾸려면, r 을 누른 후 바꿀 글자를 입력합니다. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 첫 줄로 옮깁니다.
|
||||
|
||||
2. 커서를 잘못된 첫 부분으로 옮깁니다.
|
||||
|
||||
3. r 을 누른 후, 잘못된 부분을 고쳐 쓸 글자를 입력합니다.
|
||||
|
||||
4. 2에서 3의 과정을 반복하여, 첫 줄의 오류를 수정하십시오.
|
||||
|
||||
---> Whan this lime was tuoed in, someone presswd some wrojg keys!
|
||||
---> When this line was typed in, someone pressed some wrong keys!
|
||||
|
||||
5. Lesson 3.2 로 이동합시다.
|
||||
|
||||
주의: 외우지 말고, 직접 해보면서 익혀야 한다는 것을 잊지 마십시오.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 3.3: 변환(CHANGE) 명령
|
||||
|
||||
|
||||
** 한 단어의 전체를 바꾸려면, ce 를 치십시오. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 첫줄로 옮깁니다.
|
||||
|
||||
2. 커서를 lubw 에서 u 위에 올려놓습니다.
|
||||
|
||||
3. ce 라고 명령한 후 단어를 정확하게 수정합니다. (이 경우, 'ine' 를 칩니다.)
|
||||
|
||||
4. <ESC> 를 누른 후 다음 에러로 갑니다 (수정되어야할 첫 글자로 갑니다.)
|
||||
|
||||
5. 3에서 4의 과정을 반복하여 첫번째 문장을 두번째 문장과 같도록 만듭니다.
|
||||
|
||||
---> This lubw has a few wptfd that mrrf changing usf the change command.
|
||||
---> This line has a few words that need changing using the change command.
|
||||
|
||||
ce 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있도록 한다는 것에
|
||||
유의합시다.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 3.4: c 를 이용한 다른 변환 명령
|
||||
|
||||
|
||||
** 변환 명령은 삭제할 때 이용한 대상에 대해 적용할 수 있습니다. **
|
||||
|
||||
1. 변환 명령은 삭제와 동일한 방식으로 동작합니다. 형식은 다음과 같습니다:
|
||||
|
||||
[횟수] c 대상 또는 c [횟수] 대상
|
||||
|
||||
2. 적용 가능한 대상 역시 같습니다. w (단어), $ (줄의 끝) 등이 있습니다.
|
||||
|
||||
3. ---> 로 표시된 첫줄로 이동합니다.
|
||||
|
||||
4. 첫 에러 위로 커서를 옮깁니다.
|
||||
|
||||
5. c$ 를 입력하여, 그 줄의 나머지가 두번째 줄처럼 되도록 수정한 후 <ESC> 를
|
||||
누르십시오.
|
||||
|
||||
---> The end of this line needs some help to make it like the second.
|
||||
---> The end of this line needs to be corrected using the c$ command.
|
||||
|
||||
참고: 입력하는 동안은 백스페이스를 이용할 수 있습니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 3 요약
|
||||
|
||||
|
||||
1. 이미 지운 내용을 되돌리려면, p 를 누르십시오. 이 명령은 커서 *다음에*
|
||||
지워진 내용을 붙입니다(PUT). (한 줄을 지운 경우에는 커서 다음 줄에
|
||||
지워진 내용이 붙습니다.)
|
||||
|
||||
2. 커서 아래의 글자를 치환하려면(REPLACE), r 을 누른 후 원래 글자 대신
|
||||
바꾸어 넣을 글자를 입력합니다.
|
||||
|
||||
3. 변환 명령(CHANGE)은 커서에서 부터 지정한 대상의 끝까지 바꿀 수 있는
|
||||
명령입니다. 예를 들어, 커서 위치에서 단어의 끝까지 바꾸려면 ce 를
|
||||
입력하면 되며, c$ 는 줄 끝까지 바꾸는 데 쓰입니다.
|
||||
|
||||
4. 변환 명령의 형식은 다음과 같습니다:
|
||||
|
||||
[횟수] c 대상 또는 c [횟수] 대상
|
||||
|
||||
계속해서 다음 Lesson 을 진행합시다.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 4.1: 위치와 파일의 상태
|
||||
|
||||
|
||||
** CTRL-G 를 누르면 파일 내에서의 현재 위치와 파일의 상태를 볼 수 있습니다.
|
||||
G 를 누르면 파일 내의 마지막 줄로 이동합니다. **
|
||||
|
||||
주의: 아래의 단계를 따라하기 전에, 이 Lesson 전체를 먼저 읽으십시오.
|
||||
|
||||
1. CTRL 키를 누른 상태에서 g 를 누릅니다. 파일 이름과 현재 위치한 줄이
|
||||
표시된 상태줄이 화면 아래에 표시될 것입니다. 3번째 단계를 위해 그
|
||||
줄 번호를 기억하고 계십시오.
|
||||
|
||||
참고: 커서가 화면 오른쪽 하단으로 옮겨진 것을 보인다면,
|
||||
이는 'ruler' 옵션을 세팅된 경우 입니다. (:help 'ruler' 를 참고 하세요.)
|
||||
|
||||
2. G 를 누르면 파일의 마지막으로 이동합니다.
|
||||
gg 를 누르면 파일의 시작 부분으로 이동합니다.
|
||||
|
||||
3. 아까 기억했던 줄 번호를 입력한 후 G 를 누르십시오. 이렇게 하면
|
||||
처음에 CTRL-G 를 눌렀던 장소로 되돌아가게 될 것입니다.
|
||||
(번호를 입력할 때, 이것은 화면에 표시되지 않습니다.)
|
||||
|
||||
4. 자신이 생겼다면, 1에서 3까지를 실행해보십시오.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 4.2: 찾기 명령
|
||||
|
||||
|
||||
** / 를 누른 후 검색할 문구를 입력하십시오. **
|
||||
|
||||
1. 명령 모드에서 / 를 입력하십시오. : 명령에서와 마찬가지로, 화면 아래에
|
||||
/ 와 커서가 표시될 것입니다.
|
||||
|
||||
2. 'errroor' 라고 친 후 <ENTER> 를 치십시오. 이 단어를 찾으려고 합니다.
|
||||
|
||||
3. 같은 문구를 다시 찾으려면, 간단히 n 을 입력하십시오.
|
||||
같은 문구를 반대 방향으로 찾으려면, Shift-N 을 입력하십시오.
|
||||
|
||||
4. 문구를 역방향으로 찾으려면, / 대신 ? 를 이용하면 됩니다.
|
||||
|
||||
5. 원래 있던 곳으로 돌아가기 위해서는 CTRL-O 를 이용하면 됩니다. 반복하면 더 이전으로도
|
||||
갈 수 있습니다. CTRL-I 로 다시 뒤로 갈 수도 있습니다.
|
||||
|
||||
---> "errroor" is not the way to spell error; errroor is an error.
|
||||
|
||||
참고: 찾는 중에 파일의 끝에 다다르게 되면, 파일의 처음부터 다시 찾게 됩니다.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 4.3: 괄호의 짝 찾기
|
||||
|
||||
|
||||
** % 를 눌러서 ), ], } 의 짝을 찾습니다. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 줄의 (, [, { 중 하나에 가져다 놓습니다.
|
||||
|
||||
2. % 를 입력해 봅시다.
|
||||
|
||||
3. 커서가 짝이 맞는 괄호로 이동할 것입니다.
|
||||
|
||||
4. % 를 입력하여, 이전 괄호로 되돌아 옵시다.
|
||||
|
||||
5. 커서를 다른 (,),[,],{ 혹은 } 로 움직여 % 를 입력해 봅니다.
|
||||
|
||||
---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
|
||||
|
||||
참고: 짝이 맞지 않는 괄호가 있는 프로그램을 디버깅할 때에 매우 유용합니다!
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 4.4: 치환(SUBTITUTE) 명령
|
||||
|
||||
|
||||
** :s/old/new/g 하면 'old' 를 'new' 로 치환(SUBTITUTE)합니다. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 줄에 가져다 놓습니다.
|
||||
|
||||
2. :s/thee/the 를 입력한 후 <ENTER> 를 칩니다. 이 명령은 그 줄에서
|
||||
처음으로 발견된 것만 바꾼다는 것에 주의하십시오.
|
||||
|
||||
3. 이번에는 :s/thee/the/g 를 입력합니다. 이는 그 줄 전체(globally)를
|
||||
치환한다는 것을 의미합니다.
|
||||
|
||||
---> thee best time to see thee flowers is in thee spring.
|
||||
|
||||
4. 두 줄 사이의 모든 문자열에 대해 치환하려면 다음과 같이 합니다,
|
||||
:#,#s/old/new/g #,# 는 두 줄의 줄번호를 뜻합니다.
|
||||
:%s/old/new/g 파일 전체에서 발견된 모든 것을 치환하는 경우입니다.
|
||||
:%s/old/new/gc 파일 전체에서 발견된 모든 것을 찾고, 치환할지 안
|
||||
할지 프롬프트로 명령합니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 4 요약
|
||||
|
||||
1. CTRL-G 파일의 상태와 파일 내에서의 현재 위치를 표시합니다.
|
||||
G 파일의 끝으로 이동합니다.
|
||||
숫자 G 해당 줄로 이동합니다.
|
||||
gg 첫 번째 라인으로 이동합니다.
|
||||
|
||||
2. / 를 입력한 후 문구를 입력하면 그 문구를 아랫방향으로 찾습니다.
|
||||
? 를 입력한 후 문구를 입력하면 윗방향으로 찾습니다.
|
||||
검색 후, n 을 입력하면 같은 방향으로 다음 문구를 찾으며,
|
||||
Shift-N 을 입력하면 반대 방향으로 찾습니다.
|
||||
CTRL-O 는 과거의 위치로, CTRL-I는 새로운 위치로 옮겨줍니다.
|
||||
|
||||
3. 커서가 (,),[,],{,} 위에 있을 때에 % 를 입력하면 상응하는 짝을
|
||||
찾아갑니다.
|
||||
|
||||
4. 어떤 줄에 처음 등장하는 old를 new로 바꾸려면 :s/old/new
|
||||
한 줄에 등장하는 모든 old를 new로 바꾸려면 :s/old/new/g
|
||||
두 줄 #,# 사이에서 치환을 하려면 :#,#s/old/new/g
|
||||
파일 내의 모든 문구를 치환하려면 :%s/old/new/g
|
||||
바꿀 때마다 확인을 거치려면 'c'를 붙여서 :%s/old/new/gc
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 5.1: 외부 명령 실행하는 방법
|
||||
|
||||
|
||||
** :! 을 입력한 후 실행하려는 명령을 입력하십시오. **
|
||||
|
||||
1. 친숙한 명령인 : 를 입력하면 커서가 화면 아래로 이동합니다. 명령을
|
||||
입력할 수 있게 됩니다.
|
||||
|
||||
2. 이제 ! (느낌표) 를 입력하십시오. 이렇게 하면 외부 쉘 명령을 실행할
|
||||
수 있습니다.
|
||||
|
||||
3. 시험삼아 ! 다음에 ls 를 입력한 후 <ENTER> 를 쳐보십시오. 쉘 프롬프트
|
||||
에서처럼 디렉토리의 목록이 출력될 것입니다. ls 가 동작하지 않는다면
|
||||
:!dir 을 시도해 보십시오.
|
||||
|
||||
참고: 어떤 외부 명령도 이 방법으로 실행할 수 있습니다.
|
||||
|
||||
참고: 모든 : 명령은 <ENTER> 를 쳐야 마무리 됩니다.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 5.2: 보다 자세한 파일 저장
|
||||
|
||||
|
||||
** 수정된 내용을 파일로 저장하려면, :w FILENAME 하십시오. **
|
||||
|
||||
1. :!dir 또는 :!ls 를 입력하여 디렉토리의 리스트를 얻어옵니다.
|
||||
위의 명령 후 <ENTER>를 쳐야한다는 것은 이미 알고 있을 것입니다.
|
||||
|
||||
2. TEST 처럼 존재하지 않는 파일 이름을 하나 고르십시오.
|
||||
|
||||
3. 이제 :w TEST 라고 입력하십시오. (TEST는 당신이 선택한 파일 이름입니다.)
|
||||
|
||||
4. 이렇게 하면 빔 길잡이 파일 전체를 TEST라는 이름으로 저장합니다.
|
||||
확인하려면, :!dir 을 다시 입력하여, 디렉토리를 살펴보십시오.
|
||||
|
||||
참고: 빔을 종료한 후, 빔을 다시 실행하여 TEST라는 파일을 열면, 그 파일은
|
||||
저장했을 때와 완벽히 같은 복사본일 것입니다.
|
||||
|
||||
5. 이제 그 파일을 지웁시다.
|
||||
(MS-DOS에서): !del TEST
|
||||
(Unix에서): !rm TEST
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 5.3: 선택적으로 저장하는 명령
|
||||
|
||||
** 파일의 일부를 저장하려면, v 대상 :w FILENAME 을 입력합니다. **
|
||||
|
||||
1. 이 줄로 커서를 가져옵니다.
|
||||
|
||||
2. v 를 누르고 커서를 아래 다섯번째로 옮깁니다. 이 때, 문자열들이 하이라이트 됨을 주목합니다.
|
||||
|
||||
3. : 를 누릅니다. 화면 하단에 :'<,'> 가 나타납니다.
|
||||
|
||||
4. w TEST 를 입력합니다. 여기서 TEST는 파일 이름이며 아직 생성되어 있지 않습니다. <ENTER>를
|
||||
누르기 전, :'<,'>w TEST 로 입력되었는지 확인 합니다.
|
||||
|
||||
5. 빔은 선택된 문장들을 TEST 파일에 입력합니다. :!dir 혹은 :!ls를 이용하여 파일이 만들어졌는지
|
||||
확인하십시오. 아직 삭제하지 마십시오! 다음 레슨에서 이 파일을 사용합니다.
|
||||
|
||||
참고 : v 를 눌러 비주얼(Visual) 선택을 시작합니다. 커서를 주변으로 움직여 선택 부분을 조절할 수
|
||||
있습니다. 그리고 명령어를 이용해 해당 문자열을 조작할 수 있습니다. 예를 들어, d 를 이용해
|
||||
삭제할 수도 있습니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 5.4: 파일 읽어들이기, 합치기
|
||||
|
||||
|
||||
** 어떤 파일의 내용을 삽입하려면, :r FILENAME 하십시오 **
|
||||
|
||||
1. 커서를 이 라인 바로 위로 옮기십시오.
|
||||
|
||||
주의: 3번째 단계를 실행하면, Lesson 5.3 을 보게 될 것입니다. 그렇게 되면
|
||||
이 lesson으로 다시 내려오십시오.
|
||||
|
||||
2. 이제 TEST 파일을 읽어들입시다. :r TEST 명령을 사용하십시오. TEST 는
|
||||
파일의 이름입니다. 읽어들인 파일은 커서가 위치한 문장 아래부터 놓이게 됩니다.
|
||||
|
||||
3. 파일이 읽어들여진 것을 확인하기 위해, 뒤로 이동해서 기존 버전과 파일에서
|
||||
읽어들인 버전, 이렇게 Lesson 5.3 이 두번 반복되었음을 확인하십시오.
|
||||
|
||||
참고: 외부 명령어의 결과값도 읽을 수 있습니다. 예를 들어, :r !ls 는 ls 명령어에 대한 결과값을
|
||||
읽어 커서 바로 아래에 합칩니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 5 요약
|
||||
|
||||
|
||||
1. :!command 를 이용하여 외부 명령을 실행합니다.
|
||||
|
||||
유용한 예:
|
||||
(MS-DOS) (Unix)
|
||||
:!dir :!ls - 디렉토리의 목록을 보여준다.
|
||||
:!del FILENAME :!rm FILENAME - FILENAME이라는 파일을 지운다.
|
||||
|
||||
2. :w FILENAME 하면 현재 빔에서 사용하는 파일을 FILENAME이라는 이름으로
|
||||
디스크에 저장합니다.
|
||||
|
||||
3. v 명령 :w FILENAME 은 비주얼 모드에서 선택된 문장들을 파일 FILENAME에 저장합니다.
|
||||
|
||||
4. :r FILENAME 은 디스크에서 FILENAME이라는 파일을 불러들여서 커서 위치
|
||||
뒤에 현재 파일을 집어넣습니다.
|
||||
|
||||
5. :r !dir 는 dir 명령어의 결과값을 현재 커서의 위치 아래에 붙힙니다.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.1: 새 줄 열기(OPEN) 명령
|
||||
|
||||
|
||||
** o 를 누르면 커서 아래에 줄을 만들고 편집 모드가 됩니다. **
|
||||
|
||||
1. 아래에 ---> 로 표시된 줄로 커서를 옮기십시오.
|
||||
|
||||
2. o (소문자)를 쳐서 커서 *아래에* 줄을 하나 여십시오. 편집 모드가 됩니다.
|
||||
|
||||
3. ---> 로 표시된 줄을 복사한 후 <ESC> 를 눌러서 편집 모드에서 나오십시오.
|
||||
|
||||
---> After typing o the cursor is placed on the open line in Insert mode.
|
||||
|
||||
4. 커서 *위에* 줄을 하나 만드려면, 소문자 o 대신 대문자 O 를 치면 됩니다.
|
||||
아래 있는 줄에 대해 이 명령을 내려보십시오.
|
||||
|
||||
---> Open up a line above this by typing O while the cursor is on this line.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.2: 추가(APPEND) 명령
|
||||
|
||||
|
||||
** a 를 누르면 커서 *다음에* 글을 입력할 수 있습니다. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 첫번째 줄의 끝으로 옮깁니다.
|
||||
|
||||
2. e 를 눌러 li 의 끝으로 커서를 옮깁니다.
|
||||
|
||||
3. 소문자 a 를 커서 아래 글자 *다음*에 글을 추가할 수 있습니다.
|
||||
|
||||
4. 아랫줄과 같이 문장을 완성해 봅니다. <ESC>를 이용해 편집(Insert) 모드를 나갑니다.
|
||||
|
||||
5. e 를 이용해 다음 고칠 단어로 움직여 3에서 4까지를 반복합니다.
|
||||
|
||||
참고: 그렇게 하시면 고작 줄의 끝에 추가를 하기 위해 i를 누르고, 커서 아래에
|
||||
있던 글자를 반복하고, 글을 끼워넣고, <ESC>를 눌러 명령 모드로 돌아와서,
|
||||
커서를 오른쪽으로 옮기고 마지막으로 x까지 눌러야 하는 번거로움을 피하실
|
||||
수 있습니다.
|
||||
|
||||
3. 이제 첫 줄을 완성하십시오. 추가 명령은 텍스트가 입력되는 위치 외에는
|
||||
편집 모드와 완전히 같다는 것을 유념하십시오.
|
||||
|
||||
---> This li will allow you to pract appendi text to a line.
|
||||
---> This line will allow you to practice appending text to a line.
|
||||
|
||||
참고: a, i 그리고 A 는 텍스트가 입력되는 위치 외에는 편집 모드와 완전히 같다는 것을 유념하십시오.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.3: 치환(REPLACE) 의 다른 버전
|
||||
|
||||
|
||||
** 대문자 R 을 입력하면 하나 이상의 글자를 바꿀 수 있습니다. **
|
||||
|
||||
1. ---> 로 표시된 첫번째 줄로 움직여 커서를 xxx의 앞으로 옮깁니다.
|
||||
|
||||
2. R 을 입력한 후, 두번째 줄과 같은 숫자를 입력해 xxx를 치환합니다.
|
||||
|
||||
3. <ESC> 를 눌러 치환 모드를 빠져나갑니다. 나머지 문장은 그대로 남아 있는지 확인합니다.
|
||||
|
||||
4. 위 단계들 반복하여 남은 모든 xxx를 치환합니다.
|
||||
|
||||
---> Adding 123 to xxx gives you xxx.
|
||||
---> Adding 123 to 456 gives you 579.
|
||||
|
||||
주의: 치환 모드는 편집 모드와 비슷합니다. 하지만 입력된 문자들이 원래 문자들을 삭제하는 점이 다릅니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.4: 문자 복사 붙여넣기(COPY AND PASTE)
|
||||
|
||||
|
||||
** y 를 이용해 복사하고 p 로 붙여 넣습니다. **
|
||||
|
||||
1. ---> 로 표시된 줄로 움직여 커서를 "a)" 뒤로 옮깁니다.
|
||||
|
||||
2. v 를 눌러 비주얼 모드를 시작하고 "first" 바로 앞까지 커서를 움직입니다.
|
||||
|
||||
3. y 를 눌러 하이라이트 된 부분을 복사(yank (copy))합니다.
|
||||
|
||||
4. 커서를 다음 문장의 끝으로 옮깁니다: j$
|
||||
|
||||
5. p 를 눌러 문자열을 붙여 넣습니다.(paste) 그리고 second <ESC> 를 입력합니다.
|
||||
|
||||
6. 비주얼 모드를 이용해 " item."을 선택, y 로 복사, j$ 으로 다음 문장 끝으로 움직여
|
||||
p 로 단어를 붙여 넣습니다.
|
||||
|
||||
---> a) this is the first item.
|
||||
b)
|
||||
|
||||
참고: y 역시 명령어로 사용 가능합니다. 예를 들어, yw 는 한 단어를 복사합니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.5: 옵션 설정(SET)
|
||||
|
||||
** 찾기나 바꾸기에서 대소문자 구분을 없애기 위해 옵션을 설정합니다 **
|
||||
|
||||
1. 다음을 입력하여 'ignore' 를 찾으십시오: /ignore <ENTER>
|
||||
n 키를 이용하여 여러번 반복하십시오.
|
||||
|
||||
2. 'ic' (대소문자 구별 안함, Ignore case) 옵션을 설정하십시오:
|
||||
:set ic
|
||||
|
||||
3. n 키를 눌러서 'ignore' 를 다시 찾아보십시오.
|
||||
이제 ignore과 IGNORE 모두 검색되는 점을 주목합니다.
|
||||
|
||||
4. 'hlsearch' 와 'incsearch' 옵션을 설정합시다.
|
||||
:set hls is
|
||||
|
||||
5. 찾기 명령을 다시 입력하여, 어떤 일이 일어나는지 확인해 보십시오:
|
||||
/ignore
|
||||
|
||||
6. 대소문자 구별을 끄기 위해서는, 다음과 같이 입력합니다:
|
||||
:set noic
|
||||
|
||||
참고: 찾은 내용이 강조(HIGHLIGHT)된 것을 없애려면: :nohlsearch
|
||||
참고: 만약, 검색 한번에 대해서만 대소문자 구별 세팅을 끄고 싶다면 \c 를 이용할 수 있습니다.
|
||||
: /ignore\c <ENTER>
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 6 요약
|
||||
|
||||
|
||||
1. o 를 입력하면 커서 *아래에* 한 줄이 열리며, 커서는 편집 모드로
|
||||
열린 줄 위에 위치하게 됩니다.
|
||||
대문자 O 를 입력하면 커서가 있는 줄의 *위로* 새 줄을 열게 됩니다.
|
||||
|
||||
2. a 를 입력하면 커서 *다음에* 글을 입력할 수 있습니다.
|
||||
대문자 A 를 입력하면 자동으로 그 줄의 끝에 글자를 추가하게 됩니다.
|
||||
|
||||
3. e 를 입력하면 단어의 끝으로 움직입니다.
|
||||
|
||||
4. y 를 입력하면 복사(yank (copy))를, p 를 입력하면 붙여 넣기가 됩니다.
|
||||
|
||||
5. 대문자 R 을 입력하면 <ESC> 를 눌러서 나가기 전까지 바꾸기 모드가 됩니다.
|
||||
|
||||
6. ":set xxx" 를 하면 "xxx" 옵션이 설정됩니다.:
|
||||
'ic' 'ignorecase' 검색시 대소문자 구별을 하지 않습니다.
|
||||
'is' 'incsearch' 검색어에서 부분 검색 결과를 보여줍니다.
|
||||
'hls' 'hlsearch' 검색 결과값을 하이라이트해줍니다.
|
||||
옵션은 전체 이름 혹은 줄인 이름 모두 사용 가능합니다.
|
||||
|
||||
7. 앞에 "no"를 붙여 옵션을 끌 수 있습니다: :set noic
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 7.1: 온라인 도움말 명령
|
||||
|
||||
|
||||
** 온라인 도움말 시스템 사용하기 **
|
||||
|
||||
빔은 폭 넓은 온라인 도움말 시스템을 제공합니다. 도움말을 보려면,
|
||||
다음 세가지 중 하나를 시도해보십시오:
|
||||
- <HELP> 키를 누른다. (키가 있는 경우)
|
||||
- <F1> 키를 누른다. (키가 있는 경우)
|
||||
- :help <ENTER> 라고 입력한다.
|
||||
|
||||
도움말 창을 닫으려면 :q <ENTER> 라고 입력하십시오.
|
||||
CTRL-W CTRL-W 다른쪽 윈도우로 넘어갑니다.
|
||||
:q <ENTER> 도움말 윈도우를 닫습니다.
|
||||
|
||||
":help" 라는 명령에 인자를 주면 어떤 주제에 관한 도움말을 찾을 수 있습니다.
|
||||
다음 명령을 내려 보십시오. ( <ENTER> 키를 누르는 것을 잊지 마십시오.)
|
||||
|
||||
:help w
|
||||
:help c_CTRL-D
|
||||
:help insert-index
|
||||
:help user-manual
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 7.2: 시작 스크립트 만들기
|
||||
|
||||
** 빔의 기능 켜기 **
|
||||
|
||||
빔은 Vi 보다 훨씬 많은 기능을 가지고 있지만, 대부분은 기본적으로 작동하지
|
||||
않습니다. 더 많은 기능을 써보려면, "vimrc" 라는 파일을 만들어야 합니다.
|
||||
|
||||
1. "vimrc" 파일을 수정합시다. 이 파일은 사용하는 시스템에 따라 다릅니다:
|
||||
:e ~/.vimrc Unix의 경우
|
||||
:e $VIM/_vimrc MS-Windows의 경우
|
||||
|
||||
2. 이제 "vimrc"의 예제를 읽어들입니다:
|
||||
:r $VIMRUNTIME/vimrc_example.vim
|
||||
|
||||
3. 다음과 같이 하여 파일을 저장합니다:
|
||||
:w
|
||||
|
||||
다음 번에 빔을 시작하면, 구문 강조(syntax highlighting)이 사용될 것입니다.
|
||||
모든 원하는 설정을 이 "vimrc" 파일에 넣어둘 수 있습니다.
|
||||
더 자세한 내용은 :help vimrc-intro를 참고 하세요.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 7.3: 명령어 완성하기
|
||||
|
||||
|
||||
** CTRL-D 와 <TAB> 이용하여 명령어를 완성할 수 있습니다.**
|
||||
|
||||
1. 먼저 vim이 호환 모드가 아닌지를 확인합니다: :set nocp
|
||||
|
||||
2. 디렉토리에 파일이 존재하는지 먼저 확인 합니다.: :!ls 혹은 :!dir
|
||||
|
||||
3. 다음과 같이 명령어를 입력합니다: :e
|
||||
|
||||
4. CTRL-D 를 누르면 "e"로 시작하는 모든 명령어들을 볼 수 있습니다.
|
||||
|
||||
5. <TAB> 을 눌러 ":edit" 명령어를 완성해 봅니다.
|
||||
|
||||
6. 이제 빈칸 하나를 추가한 뒤, 존재 파일 이름을 앞 부분을 입력합니다: :edit FIL
|
||||
|
||||
7. <TAB> 을 눌러 파일 이름을 완성 시킵니다.
|
||||
|
||||
참고: 완성하기는 많은 명령어에서 사용할 수 있습니다. CTRL-D와 <TAB> 만 누르세요!
|
||||
특히, :help 에서 유용할 것입니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 7 요약
|
||||
|
||||
|
||||
1. 도움말을 열기 위해 :help 혹은 <F1> 혹은 <Help> 를 누릅니다.
|
||||
|
||||
2. cmd 에 대한 도움말을 보기 위해서는 :help cmd 를 입력합니다.
|
||||
|
||||
3. CTRL-W CTRL-W 를 이용해 다른 윈도우로 넘어갑니다.
|
||||
|
||||
4. :q 로 도움말 윈도우를 빠져나옵니다.
|
||||
|
||||
5. vimrc 시작 스크립트를 이용해 선호하는 세팅을 유지할 수 있습니다.
|
||||
|
||||
6. : 명령어를 입력할때, CTRL-D 를 눌러 가능한 명령어들을 볼수 있습니다.
|
||||
<TAB> 을 눌러 완성 가능합니다.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
이것으로 빔 길잡이를 마칩니다. 이 길잡이는 빔 편집기에 대한 간략한 개요를
|
||||
보여주기 위한 의도로 제작되었으며, 이 편집기를 정말 간단히 사용하기에
|
||||
충분할 뿐입니다. 빔에는 이 길잡이와는 비교할 수 없을 만큼 훨씬 많은 명령이
|
||||
있습니다. 다음 사용자 매뉴얼을 읽으십시오: ":help user-manual"
|
||||
|
||||
보다 자세히 읽고 공부하려면, 다음 책을 추천해 드립니다:
|
||||
Vim - Vi Improved - by Steve Oualline
|
||||
출판사: New Riders
|
||||
이 책은 완전히 빔에 대해서만 다루고 있습니다. 특히 초보자들에게 유용합니다.
|
||||
많은 예제와 그림이 있습니다.
|
||||
다음을 참고하십시오: http://iccf-holland.org/click5.html
|
||||
|
||||
다음 책은 좀 오래된 책으로 빔보다는 Vi에 대해 다루고 있지만, 역시 추천할 만
|
||||
합니다:
|
||||
Learning the Vi Editor - by Linda Lamb
|
||||
출판사: O'Reilly & Associates Inc.
|
||||
Vi로 하고 싶은 거의 모든 것에 대해 알 수 있는 좋은 책입니다.
|
||||
여섯번째 개정판은 빔에 관한 내용을 포함하고 있습니다.
|
||||
|
||||
이 길잡이는 Colorado School of Mines의 Michael C. Pierce 와
|
||||
Robert K. Ware 가 Colorado State University의 Charles Smith 의 아이디어에
|
||||
착안하여 썼습니다.
|
||||
. E-mail: bware@mines.colorado.edu.
|
||||
|
||||
Modified for Vim by Bram Moolenaar.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -1,5 +1,5 @@
|
||||
===============================================================================
|
||||
= 빔 길잡이 (VIM Tutor) 에 오신 것을 환영합니다 - Version 1.5 =
|
||||
= 빔 길잡이 (VIM Tutor) 에 오신 것을 환영합니다 - Version 1.7 =
|
||||
===============================================================================
|
||||
|
||||
빔(Vim)은 이 길잡이에서 다 설명할 수 없을 만큼 많은 명령을 가진
|
||||
@@ -32,15 +32,15 @@
|
||||
1. 익숙해질 때까지 커서를 스크린 상에서 움직여 보십시오.
|
||||
|
||||
2. 아래 방향키 (j)를 반복입력이 될 때까지 누르고 계십시오.
|
||||
---> 이제 다음 lesson으로 가는 방법을 알게 되었습니다.
|
||||
이제 다음 lesson으로 가는 방법을 알게 되었습니다.
|
||||
|
||||
3. 아래 방향키를 이용하여, Lesson 1.2 로 가십시오.
|
||||
|
||||
참고: 원하지 않는 무언가가 입력이 되었다면, <ESC>를 눌러서, 명령 모드로
|
||||
돌아가십시오. 그 후에 원하는 명령을 다시 입력하십시오.
|
||||
돌아가십시오. 그 후에 원하는 명령을 다시 입력하십시오.
|
||||
|
||||
참고: 커서키 또한 작동할 것입니다. 하지만 hjkl에 익숙해지면, 커서키보다
|
||||
훨씬 빠르게 이동할 수 있을 것입니다.
|
||||
훨씬 빠르게 이동할 수 있을 것입니다. 정말요!
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.2: 빔을 시작하고 끝내기
|
||||
@@ -51,10 +51,7 @@
|
||||
1. <ESC> 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다.
|
||||
|
||||
2. 다음과 같이 입력합니다: :q! <ENTER>
|
||||
|
||||
---> 이렇게 하면, 바뀐 내용을 *저장하지 않고* 편집기를 빠져나갑니다.
|
||||
저장한 후 빠져나가려면 다음과 같이 입력합니다:
|
||||
:wq <ENTER>
|
||||
이렇게 하면, 바뀐 내용을 *저장하지 않고* 편집기를 빠져나갑니다.
|
||||
|
||||
3. 쉘 프롬프트가 보인다면, 다시 길잡이로 돌아오기 위해 다음과 같이
|
||||
입력합니다.
|
||||
@@ -66,8 +63,12 @@
|
||||
파일을 뜻합니다.
|
||||
|
||||
4. 위에서 이야기한 단계를 기억하였으며, 확신이 서면, 1에서 3까지를
|
||||
수행하여 편집기를 나갔다가 다시 들어와보십시오. 그 후 커서를 아래로
|
||||
움직여 Lesson 1.3 으로 가십시오.
|
||||
수행하여 편집기를 나갔다가 다시 들어와 보십시오.
|
||||
|
||||
주의: :q! <ENTER> 는 바뀐 내용을 저장하지 않습니다. 이 후 lesson에서
|
||||
어떻게 편집 내용을 저장하는지 배울 수 있습니다.
|
||||
|
||||
5. 그 후 커서를 아래로 움직여 Lesson 1.3 으로 가십시오.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.3: 텍스트 편집 - 지우기
|
||||
|
||||
@@ -110,10 +111,55 @@
|
||||
---> There is text misng this .
|
||||
---> There is some text missing from this line.
|
||||
|
||||
5. 텍스트를 삽입하는 데에 익숙해졌다면, 요약을 봐주십시오.
|
||||
5. 텍스트를 삽입하는 데에 익숙해졌다면, Lesson 1.5로 가십시오.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.5: 택스트 편집 - 추가 (APPENDING)
|
||||
|
||||
|
||||
** A 를 입력해 텍스트를 추가할 수 있습니다. **
|
||||
|
||||
1. 커서를 첫번째 ---> 로 표시된 줄로 움직입니다.
|
||||
커서가 문장 내 어디에 있던 상관없습니다.
|
||||
|
||||
2. A 키를 눌러 필요한 내용을 입력합니다.
|
||||
|
||||
3. 내용을 모두 입력한 후 <ESC>를 눌러 명령 모드로 돌아갑니다.
|
||||
|
||||
4. 커서를 두번째 ---> 로 표시된 줄로 움직입니다.
|
||||
문장을 올바르게 만들기 위해 2에서 3의 과정을 반복합니다.
|
||||
|
||||
---> There is some text missing from th
|
||||
There is some text missing from this line.
|
||||
---> There is also some text miss
|
||||
There is also some text missing here.
|
||||
|
||||
5. 텍스트를 추가하는 데 익숙해졌다면, Lesson 1.6으로 가십시오.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.6: 파일 편집
|
||||
|
||||
** :wq 를 이용하여 파일을 저장하고 빠져나갈 수 있습니다. **
|
||||
|
||||
!! 주의: 아래 있는 단계를 실행하기 전에, 이 lesson 전체를 읽으십시오!!
|
||||
|
||||
1. lesson 1.2에서 배웠던 것처럼 :q!로 편집기를 나갈 수 있습니다.
|
||||
만약, 다른 터미널에 접근 가능하다면, 아래의 단계를 다른 터미널에서 해봅니다.
|
||||
|
||||
2. 쉘 프롬프트에 다음과 같이 입력합니다: vim tutor <ENTER>
|
||||
'vim' 은 빔 에디터 시작을 위한 명령어, 'tutor'는 수정하고자 하는
|
||||
파일의 이름 입니다.
|
||||
|
||||
3. 앞에서 배웠던 것처럼 텍스트를 삽입하고 지워보세요.
|
||||
|
||||
4. 다음 명령어를 이용해 파일 수정 부분을 저장하고 빠져나갑니다: :wq <ENTER>
|
||||
|
||||
5. 만약 1에서 vimtutor를 빠져나갔다가 다시 들어왔다면, 아래로 움직여 요약으로 넘어가도록 합시다.
|
||||
|
||||
6. 위 모든 단계를 다 읽고 이해한 후에 직접 해보세요.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 1 요약
|
||||
|
||||
@@ -129,14 +175,14 @@
|
||||
4. 명령 모드에서 커서가 위치한 곳의 글자를 지우려면 x 를 입력합니다.
|
||||
|
||||
5. 명령 모드에서 커서가 위치한 곳에 텍스트를 삽입하려면
|
||||
i 를 누른 후 텍스트를 입력하고 <ESC> 를 누릅니다.
|
||||
i 를 누른 후 텍스트를 입력하고 <ESC> 커서 앞에 삽입합니다.
|
||||
A 를 누른 후 텍스트를 입력하고 <ESC> 문장 뒤에 추가 합니다.
|
||||
|
||||
참고: <ESC>는 명령 모드로 돌아가는 데 쓰며, 원치 않는 명령이나 완전히 입력되지
|
||||
않은 명령을 취소하는 데에도 씁니다.
|
||||
|
||||
그럼 Lesson 2를 시작합시다.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.1: 삭제(DELETION) 명령
|
||||
|
||||
@@ -180,15 +226,16 @@
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.3: 명령과 적용 대상에 대해
|
||||
|
||||
|
||||
|
||||
삭제 명령 d의 형식은 다음과 같습니다.
|
||||
|
||||
[횟수] d 대상 또는 d [횟수] 대상
|
||||
여기서
|
||||
횟수 - 명령을 몇 번 수행할 지 (옵션, 기본값=1).
|
||||
d 대상
|
||||
|
||||
여기서:
|
||||
d - 지우는 명령
|
||||
대상 - 아래에 제시된 대상에 대해 명령을 수행
|
||||
|
||||
@@ -197,13 +244,51 @@
|
||||
e - 커서에서 그 단어의 끝까지 (공백을 포함하지 않음.)
|
||||
$ - 커서에서 그 줄의 끝까지
|
||||
|
||||
예를 들어, de 는 커서의 위치부터 해당 단어의 끝까지 지웁니다.
|
||||
|
||||
참고: 호기심이 있다면, 명령 모드에서 명령 없이 대상을 입력해보십시오.
|
||||
위에서 이야기한 대상의 목록에 따라 커서가 움직이게 됩니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.4: 대상에 반복 적용하기
|
||||
|
||||
|
||||
** 대상 이전에 숫자를 넣어주면 그 만큼 반복 됩니다. **
|
||||
|
||||
1. 아래에 ---> 로 표시된 줄 까지 커서를 옮깁니다.
|
||||
|
||||
2. 2w 입력하여 커서를 단어 두 개 뒤로 옮깁니다.
|
||||
|
||||
3. 3e 입력하여 커서를 뒤로 세 번째 단어의 끝으로 옮깁니다.
|
||||
|
||||
4. 0 (zero) 를 입력하여 문장의 시작부분으로 움직입니다.
|
||||
|
||||
5. 2에서 3까지를 다른 숫자로 반복해 봅니다.
|
||||
|
||||
---> This is just a line with words you can move around in.
|
||||
|
||||
6. Lesson 2.5로 가십시오.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.4: '명령-대상' 에 대한 예외
|
||||
Lesson 2.5: 삭제에 반복 적용하기
|
||||
|
||||
|
||||
** 명령과 숫자를 함께 사용하면 그만큼 반복 수행 됩니다. **
|
||||
|
||||
위에서 삭제 명령과 대상의 조합과 같이, 대상 이전에 횟수를 넣어 더 많이 삭제 할 수 있습니다:
|
||||
d 횟수 대상
|
||||
|
||||
1. 아래 ---> 표시된 줄에서 커서를 첫번째 대문자 단어로 옮깁니다.
|
||||
|
||||
2. d2w를 입력하여 두 대문자 단어를 지웁니다.
|
||||
|
||||
3. 이어지는 대문자 단어들을 1에서 2까지의 단계를 이용해 횟수를 바꾸어 삭제해 봅니다.
|
||||
|
||||
---> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.6: 줄 전체 조작하기
|
||||
|
||||
|
||||
|
||||
** dd 라고 치면 줄 전체를 지웁니다. **
|
||||
@@ -216,17 +301,17 @@
|
||||
3. 그런 다음 네번째 줄로 가십시오.
|
||||
4. 2dd 라고 입력하여 두줄을 지웁니다. ( 횟수-명령-대상을 기억하세요. )
|
||||
|
||||
1) Roses are red,
|
||||
2) Mud is fun,
|
||||
3) Violets are blue,
|
||||
4) I have a car,
|
||||
5) Clocks tell time,
|
||||
6) Sugar is sweet
|
||||
7) And so are you.
|
||||
---> 1) Roses are red,
|
||||
---> 2) Mud is fun,
|
||||
---> 3) Violets are blue,
|
||||
---> 4) I have a car,
|
||||
---> 5) Clocks tell time,
|
||||
---> 6) Sugar is sweet
|
||||
---> 7) And so are you.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.5: 취소(UNDO) 명령
|
||||
Lesson 2.7: 취소(UNDO) 명령
|
||||
|
||||
|
||||
** u 를 누르면 마지막 명령이 취소되며, U 는 줄 전체를 수정합니다. **
|
||||
@@ -252,20 +337,22 @@
|
||||
|
||||
|
||||
1. 커서가 위치한 곳부터 단어의 끝까지 지우려면: dw
|
||||
|
||||
2. 커서가 위치한 곳부터 줄 끝까지 지우려면: d$
|
||||
|
||||
3. 줄 전체를 지우려면: dd
|
||||
|
||||
4. 명령 모드에서 내리는 명령의 형식은 다음과 같습니다:
|
||||
4. 횟수와 함께 대상을 반복 시키려면: 2w
|
||||
5. 명령 모드에서 내리는 명령의 형식은 다음과 같습니다:
|
||||
|
||||
[횟수] 명령 대상 또는 명령 [횟수] 대상
|
||||
|
||||
여기서:
|
||||
횟수 - 그 명령을 몇 번 반복할 것인가
|
||||
명령 - 어떤 명령을 내릴 것인가 ( 예를 들어, 삭제인 경우는 d )
|
||||
대상 - 명령이 동작할 대상, 예를 들어 w (단어), $ (줄의 끝) 등.
|
||||
|
||||
5. 이전 행동을 취소하려면: u (소문자 u)
|
||||
6. 커서를 문장 맨 앞으로 옮기려면: 0
|
||||
|
||||
7. 이전 행동을 취소하려면: u (소문자 u)
|
||||
한 줄에서 수정한 것을 모두 취소하려면: U (대문자 U)
|
||||
취소한 것을 다시 실행하려면: CTRL-R
|
||||
|
||||
@@ -319,13 +406,13 @@
|
||||
Lesson 3.3: 변환(CHANGE) 명령
|
||||
|
||||
|
||||
** 한 단어의 일부나 전체를 바꾸려면, cw 를 치십시오. **
|
||||
** 한 단어의 전체를 바꾸려면, ce 를 치십시오. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 첫줄로 옮깁니다.
|
||||
|
||||
2. 커서를 lubw 에서 u 위에 올려놓습니다.
|
||||
|
||||
3. cw 라고 명령한 후 단어를 정확하게 수정합니다. (이 경우, 'ine' 를 칩니다.)
|
||||
3. ce 라고 명령한 후 단어를 정확하게 수정합니다. (이 경우, 'ine' 를 칩니다.)
|
||||
|
||||
4. <ESC> 를 누른 후 다음 에러로 갑니다 (수정되어야할 첫 글자로 갑니다.)
|
||||
|
||||
@@ -334,8 +421,8 @@
|
||||
---> This lubw has a few wptfd that mrrf changing usf the change command.
|
||||
---> This line has a few words that need changing using the change command.
|
||||
|
||||
cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있도록 한다는 것에
|
||||
주의합시다.
|
||||
ce 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있도록 한다는 것에
|
||||
유의합시다.
|
||||
|
||||
|
||||
|
||||
@@ -361,7 +448,7 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
---> The end of this line needs some help to make it like the second.
|
||||
---> The end of this line needs to be corrected using the c$ command.
|
||||
|
||||
|
||||
참고: 입력하는 동안은 백스페이스를 이용할 수 있습니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 3 요약
|
||||
@@ -375,7 +462,7 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
바꾸어 넣을 글자를 입력합니다.
|
||||
|
||||
3. 변환 명령(CHANGE)은 커서에서 부터 지정한 대상의 끝까지 바꿀 수 있는
|
||||
명령입니다. 예를 들어, 커서 위치에서 단어의 끝까지 바꾸려면, cw 를
|
||||
명령입니다. 예를 들어, 커서 위치에서 단어의 끝까지 바꾸려면 ce 를
|
||||
입력하면 되며, c$ 는 줄 끝까지 바꾸는 데 쓰입니다.
|
||||
|
||||
4. 변환 명령의 형식은 다음과 같습니다:
|
||||
@@ -390,8 +477,8 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
Lesson 4.1: 위치와 파일의 상태
|
||||
|
||||
|
||||
** CTRL-g 를 누르면 파일 내에서의 현재 위치와 파일의 상태를 볼 수 있습니다.
|
||||
SHIFT-G 를 누르면 파일 내의 줄로 이동합니다. **
|
||||
** CTRL-G 를 누르면 파일 내에서의 현재 위치와 파일의 상태를 볼 수 있습니다.
|
||||
G 를 누르면 파일 내의 마지막 줄로 이동합니다. **
|
||||
|
||||
주의: 아래의 단계를 따라하기 전에, 이 Lesson 전체를 먼저 읽으십시오.
|
||||
|
||||
@@ -399,10 +486,14 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
표시된 상태줄이 화면 아래에 표시될 것입니다. 3번째 단계를 위해 그
|
||||
줄 번호를 기억하고 계십시오.
|
||||
|
||||
2. SHIFT-G 를 누르면 파일의 마지막으로 이동합니다.
|
||||
참고: 커서가 화면 오른쪽 하단으로 옮겨진 것을 보인다면,
|
||||
이는 'ruler' 옵션을 세팅된 경우 입니다. (:help 'ruler' 를 참고 하세요.)
|
||||
|
||||
3. 아까 기억했던 줄 번호를 입력한 후 SHIFT-G 를 누르십시오. 이렇게 하면
|
||||
처음에 CTRL-g 를 눌렀던 장소로 되돌아가게 될 것입니다.
|
||||
2. G 를 누르면 파일의 마지막으로 이동합니다.
|
||||
gg 를 누르면 파일의 시작 부분으로 이동합니다.
|
||||
|
||||
3. 아까 기억했던 줄 번호를 입력한 후 G 를 누르십시오. 이렇게 하면
|
||||
처음에 CTRL-G 를 눌렀던 장소로 되돌아가게 될 것입니다.
|
||||
(번호를 입력할 때, 이것은 화면에 표시되지 않습니다.)
|
||||
|
||||
4. 자신이 생겼다면, 1에서 3까지를 실행해보십시오.
|
||||
@@ -425,6 +516,9 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
|
||||
4. 문구를 역방향으로 찾으려면, / 대신 ? 를 이용하면 됩니다.
|
||||
|
||||
5. 원래 있던 곳으로 돌아가기 위해서는 CTRL-O 를 이용하면 됩니다. 반복하면 더 이전으로도
|
||||
갈 수 있습니다. CTRL-I 로 다시 뒤로 갈 수도 있습니다.
|
||||
|
||||
---> "errroor" is not the way to spell error; errroor is an error.
|
||||
|
||||
참고: 찾는 중에 파일의 끝에 다다르게 되면, 파일의 처음부터 다시 찾게 됩니다.
|
||||
@@ -444,17 +538,16 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
|
||||
4. % 를 입력하여, 이전 괄호로 되돌아 옵시다.
|
||||
|
||||
5. 커서를 다른 (,),[,],{ 혹은 } 로 움직여 % 를 입력해 봅니다.
|
||||
|
||||
---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
|
||||
|
||||
참고: 짝이 맞지 않는 괄호가 있는 프로그램을 디버깅할 때에 매우 유용합니다!
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 4.4: 에러를 수정하는 방법
|
||||
Lesson 4.4: 치환(SUBTITUTE) 명령
|
||||
|
||||
|
||||
** :s/old/new/g 하면 'old' 를 'new' 로 치환(SUBTITUTE)합니다. **
|
||||
@@ -472,22 +565,22 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
4. 두 줄 사이의 모든 문자열에 대해 치환하려면 다음과 같이 합니다,
|
||||
:#,#s/old/new/g #,# 는 두 줄의 줄번호를 뜻합니다.
|
||||
:%s/old/new/g 파일 전체에서 발견된 모든 것을 치환하는 경우입니다.
|
||||
|
||||
|
||||
|
||||
:%s/old/new/gc 파일 전체에서 발견된 모든 것을 찾고, 치환할지 안
|
||||
할지 프롬프트로 명령합니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 4 요약
|
||||
|
||||
|
||||
1. CTRL-g 는 파일의 상태와 파일 내에서의 현재 위치를 표시합니다.
|
||||
SHIFT-G 는 파일의 끝으로 이동합니다. 줄번호를 입력한 후 SHIFT-G를
|
||||
입력하면, 그 줄로 이동합니다.
|
||||
|
||||
1. CTRL-G 파일의 상태와 파일 내에서의 현재 위치를 표시합니다.
|
||||
G 파일의 끝으로 이동합니다.
|
||||
숫자 G 해당 줄로 이동합니다.
|
||||
gg 첫 번째 라인으로 이동합니다.
|
||||
|
||||
2. / 를 입력한 후 문구를 입력하면 그 문구를 아랫방향으로 찾습니다.
|
||||
? 를 입력한 후 문구를 입력하면 윗방향으로 찾습니다.
|
||||
검색 후, n 을 입력하면 같은 방향으로 다음 문구를 찾으며,
|
||||
Shift-N 을 입력하면 반대 방향으로 찾습니다.
|
||||
CTRL-O 는 과거의 위치로, CTRL-I는 새로운 위치로 옮겨줍니다.
|
||||
|
||||
3. 커서가 (,),[,],{,} 위에 있을 때에 % 를 입력하면 상응하는 짝을
|
||||
찾아갑니다.
|
||||
@@ -548,25 +641,23 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 5.3: 선택적으로 저장하는 명령
|
||||
|
||||
** 파일의 일부를 저장하려면, v 대상 :w FILENAME 을 입력합니다. **
|
||||
|
||||
** 파일의 일부를 저장하려면, :#,# w FILENAME 하십시오. **
|
||||
|
||||
1. 다시 한번, :!dir 이나 :!ls 를 입력하여 디렉토리의 목록을 받아온 후
|
||||
TEST 같은 적합한 이름을 선택합니다.
|
||||
|
||||
2. 커서를 이 페이지의 처음으로 옮긴 후, Ctrl-g 를 입력하여 그 줄의 줄번호를
|
||||
알아냅니다. 이 번호를 기억하십시오!
|
||||
|
||||
3. 이제 이 페이지의 마지막으로 가서 Ctrl-g 를 다시 입력하십시오. 이 줄의
|
||||
줄번호 또한 기억하십시오!
|
||||
|
||||
4. 어떤 섹션만 파일로 저장하려면, :#,# w TEST 를 입력하면 됩니다. 이 때
|
||||
#,# 는 아까 기억했던 시작과 끝 줄번호 입니다. TEST는 파일 이름입니다.
|
||||
|
||||
5. :!dir 을 이용하여 파일이 만들어졌는지 확인하십시오. 지우지는 마십시오.
|
||||
1. 이 줄로 커서를 가져옵니다.
|
||||
|
||||
2. v 를 누르고 커서를 아래 다섯번째로 옮깁니다. 이 때, 문자열들이 하이라이트 됨을 주목합니다.
|
||||
|
||||
3. : 를 누릅니다. 화면 하단에 :'<,'> 가 나타납니다.
|
||||
|
||||
4. w TEST 를 입력합니다. 여기서 TEST는 파일 이름이며 아직 생성되어 있지 않습니다. <ENTER>를
|
||||
누르기 전, :'<,'>w TEST 로 입력되었는지 확인 합니다.
|
||||
|
||||
5. 빔은 선택된 문장들을 TEST 파일에 입력합니다. :!dir 혹은 :!ls를 이용하여 파일이 만들어졌는지
|
||||
확인하십시오. 아직 삭제하지 마십시오! 다음 레슨에서 이 파일을 사용합니다.
|
||||
|
||||
참고 : v 를 눌러 비주얼(Visual) 선택을 시작합니다. 커서를 주변으로 움직여 선택 부분을 조절할 수
|
||||
있습니다. 그리고 명령어를 이용해 해당 문자열을 조작할 수 있습니다. 예를 들어, d 를 이용해
|
||||
삭제할 수도 있습니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 5.4: 파일 읽어들이기, 합치기
|
||||
@@ -574,22 +665,19 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
|
||||
** 어떤 파일의 내용을 삽입하려면, :r FILENAME 하십시오 **
|
||||
|
||||
1. :!dir 을 입력하여 아까 만든 TEST 파일이 그대로 있는지 확인하십시오.
|
||||
|
||||
2. 커서를 이 페이지의 처음으로 움직이십시오.
|
||||
|
||||
주의: 3번째 단계를 실행하면, Lesson 5.3 을 보게 될 것입니다. 그렇게 되면
|
||||
1. 커서를 이 라인 바로 위로 옮기십시오.
|
||||
|
||||
주의: 3번째 단계를 실행하면, Lesson 5.3 을 보게 될 것입니다. 그렇게 되면
|
||||
이 lesson으로 다시 내려오십시오.
|
||||
|
||||
2. 이제 TEST 파일을 읽어들입시다. :r TEST 명령을 사용하십시오. TEST 는
|
||||
파일의 이름입니다. 읽어들인 파일은 커서가 위치한 문장 아래부터 놓이게 됩니다.
|
||||
|
||||
3. 이제 TEST 파일을 읽어들입시다. :r TEST 명령을 사용하십시오. TEST 는
|
||||
파일의 이름입니다.
|
||||
|
||||
참고: 읽어들인 파일은 커서가 위치한 지점에서부터 놓이게 됩니다.
|
||||
|
||||
4. 파일이 읽어들여진 것을 확인하기 위해, 뒤로 이동해서 기존 버전과 파일에서
|
||||
3. 파일이 읽어들여진 것을 확인하기 위해, 뒤로 이동해서 기존 버전과 파일에서
|
||||
읽어들인 버전, 이렇게 Lesson 5.3 이 두번 반복되었음을 확인하십시오.
|
||||
|
||||
|
||||
참고: 외부 명령어의 결과값도 읽을 수 있습니다. 예를 들어, :r !ls 는 ls 명령어에 대한 결과값을
|
||||
읽어 커서 바로 아래에 합칩니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 5 요약
|
||||
@@ -605,14 +693,12 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
2. :w FILENAME 하면 현재 빔에서 사용하는 파일을 FILENAME이라는 이름으로
|
||||
디스크에 저장합니다.
|
||||
|
||||
3. :#,#w FILENAME 하면 #부터 #까지의 줄을 FILENAME이라는 파일로 저장합니다.
|
||||
3. v 명령 :w FILENAME 은 비주얼 모드에서 선택된 문장들을 파일 FILENAME에 저장합니다.
|
||||
|
||||
4. :r FILENAME 은 디스크에서 FILENAME이라는 파일을 불러들여서 커서 위치
|
||||
뒤에 현재 파일을 집어넣습니다.
|
||||
|
||||
|
||||
|
||||
|
||||
5. :r !dir 는 dir 명령어의 결과값을 현재 커서의 위치 아래에 붙힙니다.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -624,7 +710,6 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
1. 아래에 ---> 로 표시된 줄로 커서를 옮기십시오.
|
||||
|
||||
2. o (소문자)를 쳐서 커서 *아래에* 줄을 하나 여십시오. 편집 모드가 됩니다.
|
||||
Insert mode.
|
||||
|
||||
3. ---> 로 표시된 줄을 복사한 후 <ESC> 를 눌러서 편집 모드에서 나오십시오.
|
||||
|
||||
@@ -632,10 +717,8 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
|
||||
4. 커서 *위에* 줄을 하나 만드려면, 소문자 o 대신 대문자 O 를 치면 됩니다.
|
||||
아래 있는 줄에 대해 이 명령을 내려보십시오.
|
||||
Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
|
||||
|
||||
|
||||
---> Open up a line above this by typing O while the cursor is on this line.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -644,11 +727,15 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
|
||||
** a 를 누르면 커서 *다음에* 글을 입력할 수 있습니다. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 첫번째 줄의 끝으로 옮깁니다. 명령 모드에서
|
||||
$ 를 이용하십시오.
|
||||
1. 커서를 ---> 로 표시된 첫번째 줄의 끝으로 옮깁니다.
|
||||
|
||||
2. e 를 눌러 li 의 끝으로 커서를 옮깁니다.
|
||||
|
||||
2. 소문자 a 를 커서 아래 글자 *다음*에 글을 추가할 수 있습니다.
|
||||
(대문자 A는 그 줄의 끝에 추가합니다.)
|
||||
3. 소문자 a 를 커서 아래 글자 *다음*에 글을 추가할 수 있습니다.
|
||||
|
||||
4. 아랫줄과 같이 문장을 완성해 봅니다. <ESC>를 이용해 편집(Insert) 모드를 나갑니다.
|
||||
|
||||
5. e 를 이용해 다음 고칠 단어로 움직여 3에서 4까지를 반복합니다.
|
||||
|
||||
참고: 그렇게 하시면 고작 줄의 끝에 추가를 하기 위해 i를 누르고, 커서 아래에
|
||||
있던 글자를 반복하고, 글을 끼워넣고, <ESC>를 눌러 명령 모드로 돌아와서,
|
||||
@@ -658,10 +745,10 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
3. 이제 첫 줄을 완성하십시오. 추가 명령은 텍스트가 입력되는 위치 외에는
|
||||
편집 모드와 완전히 같다는 것을 유념하십시오.
|
||||
|
||||
---> This line will allow you to practice
|
||||
---> This line will allow you to practice appending text to the end of a line.
|
||||
|
||||
---> This li will allow you to pract appendi text to a line.
|
||||
---> This line will allow you to practice appending text to a line.
|
||||
|
||||
참고: a, i 그리고 A 는 텍스트가 입력되는 위치 외에는 편집 모드와 완전히 같다는 것을 유념하십시오.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.3: 치환(REPLACE) 의 다른 버전
|
||||
@@ -669,37 +756,56 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
|
||||
** 대문자 R 을 입력하면 하나 이상의 글자를 바꿀 수 있습니다. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 첫번째 줄로 옮기십시오.
|
||||
1. ---> 로 표시된 첫번째 줄로 움직여 커서를 xxx의 앞으로 옮깁니다.
|
||||
|
||||
2. 커서를 ---> 로 표시된 두번째 줄과 다른 첫번째 단어 위로 옮기십시오.
|
||||
('last' 입니다.)
|
||||
|
||||
3. R 을 입력한 후 첫번째 줄의 예전 텍스트 위에 새로운 글을 입력하여
|
||||
나머지 내용이 두번째 줄과 같아지도록 바꿉시다.
|
||||
|
||||
---> To make the first line the same as the last on this page use the keys.
|
||||
---> To make the first line the same as the second, type R and the new text.
|
||||
|
||||
4. <ESC> 를 눌러서 나가면, 바뀌지 않은 텍스트는 그대로 남게 됩니다.
|
||||
2. R 을 입력한 후, 두번째 줄과 같은 숫자를 입력해 xxx를 치환합니다.
|
||||
|
||||
3. <ESC> 를 눌러 치환 모드를 빠져나갑니다. 나머지 문장은 그대로 남아 있는지 확인합니다.
|
||||
|
||||
4. 위 단계들 반복하여 남은 모든 xxx를 치환합니다.
|
||||
|
||||
---> Adding 123 to xxx gives you xxx.
|
||||
---> Adding 123 to 456 gives you 579.
|
||||
|
||||
주의: 치환 모드는 편집 모드와 비슷합니다. 하지만 입력된 문자들이 원래 문자들을 삭제하는 점이 다릅니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.4: 옵션 설정(SET)
|
||||
Lesson 6.4: 문자 복사 붙여넣기(COPY AND PASTE)
|
||||
|
||||
|
||||
** y 를 이용해 복사하고 p 로 붙여 넣습니다. **
|
||||
|
||||
1. ---> 로 표시된 줄로 움직여 커서를 "a)" 뒤로 옮깁니다.
|
||||
|
||||
2. v 를 눌러 비주얼 모드를 시작하고 "first" 바로 앞까지 커서를 움직입니다.
|
||||
|
||||
3. y 를 눌러 하이라이트 된 부분을 복사(yank (copy))합니다.
|
||||
|
||||
4. 커서를 다음 문장의 끝으로 옮깁니다: j$
|
||||
|
||||
5. p 를 눌러 문자열을 붙여 넣습니다.(paste) 그리고 second <ESC> 를 입력합니다.
|
||||
|
||||
6. 비주얼 모드를 이용해 " item."을 선택, y 로 복사, j$ 으로 다음 문장 끝으로 움직여
|
||||
p 로 단어를 붙여 넣습니다.
|
||||
|
||||
---> a) this is the first item.
|
||||
b)
|
||||
|
||||
참고: y 역시 명령어로 사용 가능합니다. 예를 들어, yw 는 한 단어를 복사합니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.5: 옵션 설정(SET)
|
||||
|
||||
** 찾기나 바꾸기에서 대소문자 구분을 없애기 위해 옵션을 설정합니다 **
|
||||
|
||||
1. 다음을 입력하여 'ignore' 를 찾으십시오:
|
||||
/ignore
|
||||
n 키를 이용하여 여러번 반복하십시오.
|
||||
1. 다음을 입력하여 'ignore' 를 찾으십시오: /ignore <ENTER>
|
||||
n 키를 이용하여 여러번 반복하십시오.
|
||||
|
||||
2. 'ic' (대소문자 구별 안함, Ignore case) 옵션을 설정하십시오:
|
||||
:set ic
|
||||
|
||||
3. n 키를 눌러서 'ignore' 를 다시 찾아보십시오.
|
||||
n 키를 계속 눌러서 여러번 찾으십시오.
|
||||
3. n 키를 눌러서 'ignore' 를 다시 찾아보십시오.
|
||||
이제 ignore과 IGNORE 모두 검색되는 점을 주목합니다.
|
||||
|
||||
4. 'hlsearch' 와 'incsearch' 옵션을 설정합시다.
|
||||
:set hls is
|
||||
@@ -707,8 +813,13 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
5. 찾기 명령을 다시 입력하여, 어떤 일이 일어나는지 확인해 보십시오:
|
||||
/ignore
|
||||
|
||||
6. 찾은 내용이 강조(HIGHLIGHT)된 것을 없애려면, 다음과 같이 입력합니다:
|
||||
:nohlsearch
|
||||
6. 대소문자 구별을 끄기 위해서는, 다음과 같이 입력합니다:
|
||||
:set noic
|
||||
|
||||
참고: 찾은 내용이 강조(HIGHLIGHT)된 것을 없애려면: :nohlsearch
|
||||
참고: 만약, 검색 한번에 대해서만 대소문자 구별 세팅을 끄고 싶다면 \c 를 이용할 수 있습니다.
|
||||
: /ignore\c <ENTER>
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 6 요약
|
||||
|
||||
@@ -720,20 +831,22 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
2. a 를 입력하면 커서 *다음에* 글을 입력할 수 있습니다.
|
||||
대문자 A 를 입력하면 자동으로 그 줄의 끝에 글자를 추가하게 됩니다.
|
||||
|
||||
3. 대문자 R 을 입력하면 <ESC> 를 눌러서 나가기 전까지 바꾸기 모드가 됩니다.
|
||||
|
||||
4. ":set xxx" 를 하면 "xxx" 옵션이 설정됩니다.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
3. e 를 입력하면 단어의 끝으로 움직입니다.
|
||||
|
||||
4. y 를 입력하면 복사(yank (copy))를, p 를 입력하면 붙여 넣기가 됩니다.
|
||||
|
||||
5. 대문자 R 을 입력하면 <ESC> 를 눌러서 나가기 전까지 바꾸기 모드가 됩니다.
|
||||
|
||||
6. ":set xxx" 를 하면 "xxx" 옵션이 설정됩니다.:
|
||||
'ic' 'ignorecase' 검색시 대소문자 구별을 하지 않습니다.
|
||||
'is' 'incsearch' 검색어에서 부분 검색 결과를 보여줍니다.
|
||||
'hls' 'hlsearch' 검색 결과값을 하이라이트해줍니다.
|
||||
옵션은 전체 이름 혹은 줄인 이름 모두 사용 가능합니다.
|
||||
|
||||
7. 앞에 "no"를 붙여 옵션을 끌 수 있습니다: :set noic
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 7: 온라인 도움말 명령
|
||||
LESSON 7.1: 온라인 도움말 명령
|
||||
|
||||
|
||||
** 온라인 도움말 시스템 사용하기 **
|
||||
@@ -745,18 +858,19 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
- :help <ENTER> 라고 입력한다.
|
||||
|
||||
도움말 창을 닫으려면 :q <ENTER> 라고 입력하십시오.
|
||||
CTRL-W CTRL-W 다른쪽 윈도우로 넘어갑니다.
|
||||
:q <ENTER> 도움말 윈도우를 닫습니다.
|
||||
|
||||
":help" 라는 명령에 인자를 주면 어떤 주제에 관한 도움말을 찾을 수 있습니다.
|
||||
다음 명령을 내려 보십시오. ( <ENTER> 키를 누르는 것을 잊지 마십시오.)
|
||||
|
||||
:help w
|
||||
:help c_<T
|
||||
:help c_CTRL-D
|
||||
:help insert-index
|
||||
:help user-manual
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 8: 시작 스크립트 만들기
|
||||
LESSON 7.2: 시작 스크립트 만들기
|
||||
|
||||
** 빔의 기능 켜기 **
|
||||
|
||||
@@ -764,20 +878,64 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
않습니다. 더 많은 기능을 써보려면, "vimrc" 라는 파일을 만들어야 합니다.
|
||||
|
||||
1. "vimrc" 파일을 수정합시다. 이 파일은 사용하는 시스템에 따라 다릅니다:
|
||||
1. Start editing the "vimrc" file, this depends on your system:
|
||||
:edit ~/.vimrc Unix의 경우
|
||||
:edit $VIM/_vimrc MS-Windows의 경우
|
||||
:e ~/.vimrc Unix의 경우
|
||||
:e $VIM/_vimrc MS-Windows의 경우
|
||||
|
||||
2. 이제 "vimrc"의 예제를 읽어들입니다:
|
||||
|
||||
:read $VIMRUNTIME/vimrc_example.vim
|
||||
:r $VIMRUNTIME/vimrc_example.vim
|
||||
|
||||
3. 다음과 같이 하여 파일을 저장합니다:
|
||||
|
||||
:write
|
||||
:w
|
||||
|
||||
다음 번에 빔을 시작하면, 구문 강조(syntax highlighting)이 사용될 것입니다.
|
||||
모든 원하는 설정을 이 "vimrc" 파일에 넣어둘 수 있습니다.
|
||||
더 자세한 내용은 :help vimrc-intro를 참고 하세요.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 7.3: 명령어 완성하기
|
||||
|
||||
|
||||
** CTRL-D 와 <TAB> 이용하여 명령어를 완성할 수 있습니다.**
|
||||
|
||||
1. 먼저 vim이 호환 모드가 아닌지를 확인합니다: :set nocp
|
||||
|
||||
2. 디렉토리에 파일이 존재하는지 먼저 확인 합니다.: :!ls 혹은 :!dir
|
||||
|
||||
3. 다음과 같이 명령어를 입력합니다: :e
|
||||
|
||||
4. CTRL-D 를 누르면 "e"로 시작하는 모든 명령어들을 볼 수 있습니다.
|
||||
|
||||
5. <TAB> 을 눌러 ":edit" 명령어를 완성해 봅니다.
|
||||
|
||||
6. 이제 빈칸 하나를 추가한 뒤, 존재 파일 이름을 앞 부분을 입력합니다: :edit FIL
|
||||
|
||||
7. <TAB> 을 눌러 파일 이름을 완성 시킵니다.
|
||||
|
||||
참고: 완성하기는 많은 명령어에서 사용할 수 있습니다. CTRL-D와 <TAB> 만 누르세요!
|
||||
특히, :help 에서 유용할 것입니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 7 요약
|
||||
|
||||
|
||||
1. 도움말을 열기 위해 :help 혹은 <F1> 혹은 <Help> 를 누릅니다.
|
||||
|
||||
2. cmd 에 대한 도움말을 보기 위해서는 :help cmd 를 입력합니다.
|
||||
|
||||
3. CTRL-W CTRL-W 를 이용해 다른 윈도우로 넘어갑니다.
|
||||
|
||||
4. :q 로 도움말 윈도우를 빠져나옵니다.
|
||||
|
||||
5. vimrc 시작 스크립트를 이용해 선호하는 세팅을 유지할 수 있습니다.
|
||||
|
||||
6. : 명령어를 입력할때, CTRL-D 를 눌러 가능한 명령어들을 볼수 있습니다.
|
||||
<TAB> 을 눌러 완성 가능합니다.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -807,6 +965,4 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
|
||||
Modified for Vim by Bram Moolenaar.
|
||||
|
||||
이 문서의 한국어 버전에 관한 문의는 다음 사이트로 해주십시오.
|
||||
http://wiki.kldp.org/wiki.php/VimTutorKo
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -3,13 +3,16 @@
|
||||
[Desktop Entry]
|
||||
# Translators: This is the Application Name used in the Vim desktop file
|
||||
Name[de]=Vim
|
||||
Name[eo]=Vim
|
||||
Name=Vim
|
||||
# Translators: This is the Generic Application Name used in the Vim desktop file
|
||||
GenericName[de]=Texteditor
|
||||
GenericName[eo]=Tekstoredaktilo
|
||||
GenericName[ja]=テキストエディタ
|
||||
GenericName=Text Editor
|
||||
# Translators: This is the comment used in the Vim desktop file
|
||||
Comment[de]=Textdateien bearbeiten
|
||||
Comment[eo]=Redakti tekstajn dosierojn
|
||||
Comment[ja]=テキストファイルを編集します
|
||||
Comment=Edit text files
|
||||
# The translations should come from the po file. Leave them here for now, they will
|
||||
@@ -89,10 +92,12 @@ Terminal=true
|
||||
Type=Application
|
||||
# Translators: Search terms to find this application. Do NOT change the semicolons! The list MUST also end with a semicolon!
|
||||
Keywords[de]=Text;Editor;
|
||||
Keywords[eo]=Teksto;redaktilo;
|
||||
Keywords[ja]=テキスト;エディタ;
|
||||
Keywords=Text;editor;
|
||||
# Translators: This is the Icon file name. Do NOT translate
|
||||
Icon[de]=gvim
|
||||
Icon[eo]=gvim
|
||||
Icon=gvim
|
||||
Categories=Utility;TextEditor;
|
||||
StartupNotify=false
|
||||
|
||||
@@ -106,6 +106,13 @@ else
|
||||
TERMINAL=no
|
||||
endif
|
||||
|
||||
# Set to yes to enable sound support.
|
||||
ifneq ($(findstring $(FEATURES),BIG HUGE),)
|
||||
SOUND=yes
|
||||
else
|
||||
SOUND=no
|
||||
endif
|
||||
|
||||
ifndef CTAGS
|
||||
# this assumes ctags is Exuberant ctags
|
||||
CTAGS = ctags -I INIT+ --fields=+S
|
||||
@@ -633,6 +640,10 @@ TERM_DEPS = \
|
||||
libvterm/src/vterm_internal.h
|
||||
endif
|
||||
|
||||
ifeq ($(SOUND),yes)
|
||||
DEFINES += -DFEAT_SOUND
|
||||
endif
|
||||
|
||||
# DirectWrite (DirectX)
|
||||
ifeq ($(DIRECTX),yes)
|
||||
# Only allow DirectWrite for a GUI build.
|
||||
@@ -740,6 +751,7 @@ OBJ = \
|
||||
$(OUTDIR)/os_win32.o \
|
||||
$(OUTDIR)/pathdef.o \
|
||||
$(OUTDIR)/popupmnu.o \
|
||||
$(OUTDIR)/popupwin.o \
|
||||
$(OUTDIR)/quickfix.o \
|
||||
$(OUTDIR)/regexp.o \
|
||||
$(OUTDIR)/screen.o \
|
||||
@@ -848,6 +860,10 @@ OBJ += $(OUTDIR)/terminal.o \
|
||||
$(OUTDIR)/vterm.o
|
||||
endif
|
||||
|
||||
ifeq ($(SOUND),yes)
|
||||
OBJ += $(OUTDIR)/sound.o
|
||||
endif
|
||||
|
||||
# Include xdiff
|
||||
OBJ += $(OUTDIR)/xdiffi.o \
|
||||
$(OUTDIR)/xemit.o \
|
||||
@@ -956,6 +972,10 @@ CFLAGS += -I$(ICONV)
|
||||
DEFINES+=-DDYNAMIC_ICONV
|
||||
endif
|
||||
|
||||
ifeq (yes, $(SOUND))
|
||||
LIB += -lwinmm
|
||||
endif
|
||||
|
||||
ifeq (yes, $(USE_STDCPLUS))
|
||||
LINK = $(CXX)
|
||||
ifeq (yes, $(STATIC_STDCPLUS))
|
||||
@@ -1028,9 +1048,9 @@ notags:
|
||||
clean:
|
||||
-$(DEL) $(OUTDIR)$(DIRSLASH)*.o
|
||||
-$(DEL) $(OUTDIR)$(DIRSLASH)*.res
|
||||
-$(DEL) $(OUTDIR)$(DIRSLASH)pathdef.c
|
||||
-rmdir $(OUTDIR)
|
||||
-$(DEL) $(MAIN_TARGET) vimrun.exe install.exe uninstal.exe
|
||||
-$(DEL) pathdef.c
|
||||
ifdef PERL
|
||||
-$(DEL) if_perl.c
|
||||
-$(DEL) auto$(DIRSLASH)if_perl.c
|
||||
@@ -1047,8 +1067,13 @@ INCL = vim.h alloc.h ascii.h ex_cmds.h feature.h globals.h \
|
||||
keymap.h macros.h option.h os_dos.h os_win32.h proto.h regexp.h \
|
||||
spell.h structs.h term.h beval.h $(NBDEBUG_INCL)
|
||||
GUI_INCL = gui.h
|
||||
ifeq ($(DIRECTX),yes)
|
||||
GUI_INCL += gui_dwrite.h
|
||||
endif
|
||||
CUI_INCL = iscygpty.h
|
||||
|
||||
PATHDEF_SRC = $(OUTDIR)/pathdef.c
|
||||
|
||||
$(OUTDIR)/if_python.o: if_python.c if_py_both.h $(INCL)
|
||||
$(CC) -c $(CFLAGS) $(PYTHONINC) $(PYTHON_HOME_DEF) $< -o $@
|
||||
|
||||
@@ -1083,7 +1108,7 @@ endif
|
||||
$(OUTDIR):
|
||||
$(MKDIR) $(OUTDIR)
|
||||
|
||||
$(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp $(INCL) gui_dwrite.h
|
||||
$(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp gui_dwrite.h
|
||||
$(CC) -c $(CFLAGS) $(CXXFLAGS) gui_dwrite.cpp -o $@
|
||||
|
||||
$(OUTDIR)/gui.o: gui.c $(INCL) $(GUI_INCL)
|
||||
@@ -1148,6 +1173,9 @@ $(OUTDIR)/regexp.o: regexp.c regexp_nfa.c $(INCL)
|
||||
$(OUTDIR)/terminal.o: terminal.c $(INCL) $(TERM_DEPS)
|
||||
$(CC) -c $(CFLAGS) terminal.c -o $@
|
||||
|
||||
$(OUTDIR)/pathdef.o: $(PATHDEF_SRC) $(INCL)
|
||||
$(CC) -c $(CFLAGS) $(PATHDEF_SRC) -o $@
|
||||
|
||||
|
||||
CCCTERM = $(CC) -c $(CFLAGS) -Ilibvterm/include -DINLINE="" \
|
||||
-DVSNPRINTF=vim_vsnprintf \
|
||||
@@ -1162,27 +1190,27 @@ $(OUTDIR)/%.o : xdiff/%.c $(XDIFF_DEPS)
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
|
||||
pathdef.c: $(INCL)
|
||||
$(PATHDEF_SRC): Make_cyg_ming.mak Make_cyg.mak Make_ming.mak
|
||||
ifneq (sh.exe, $(SHELL))
|
||||
@echo creating pathdef.c
|
||||
@echo '/* pathdef.c */' > pathdef.c
|
||||
@echo '#include "vim.h"' >> pathdef.c
|
||||
@echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c
|
||||
@echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c
|
||||
@echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c
|
||||
@echo 'char_u *all_lflags = (char_u *)"$(LINK) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)";' >> pathdef.c
|
||||
@echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c
|
||||
@echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c
|
||||
@echo creating $(PATHDEF_SRC)
|
||||
@echo '/* pathdef.c */' > $(PATHDEF_SRC)
|
||||
@echo '#include "vim.h"' >> $(PATHDEF_SRC)
|
||||
@echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> $(PATHDEF_SRC)
|
||||
@echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> $(PATHDEF_SRC)
|
||||
@echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> $(PATHDEF_SRC)
|
||||
@echo 'char_u *all_lflags = (char_u *)"$(LINK) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)";' >> $(PATHDEF_SRC)
|
||||
@echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> $(PATHDEF_SRC)
|
||||
@echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> $(PATHDEF_SRC)
|
||||
else
|
||||
@echo creating pathdef.c
|
||||
@echo /* pathdef.c */ > pathdef.c
|
||||
@echo #include "vim.h" >> pathdef.c
|
||||
@echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c
|
||||
@echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c
|
||||
@echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c
|
||||
@echo char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)"; >> pathdef.c
|
||||
@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
|
||||
@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
|
||||
@echo creating $(PATHDEF_SRC)
|
||||
@echo /* pathdef.c */ > $(PATHDEF_SRC)
|
||||
@echo #include "vim.h" >> $(PATHDEF_SRC)
|
||||
@echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> $(PATHDEF_SRC)
|
||||
@echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> $(PATHDEF_SRC)
|
||||
@echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> $(PATHDEF_SRC)
|
||||
@echo char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)"; >> $(PATHDEF_SRC)
|
||||
@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
|
||||
@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
|
||||
endif
|
||||
|
||||
# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0:
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
# is yes)
|
||||
# Global IME support: GIME=yes (requires GUI=yes)
|
||||
#
|
||||
# Terminal support: TERMINAL=yes (default is yes)
|
||||
# Terminal support: TERMINAL=yes (default is yes)
|
||||
#
|
||||
# Sound support: SOUND=yes (default is yes)
|
||||
#
|
||||
# DLL support (EXPERIMENTAL): VIMDLL=yes (default is no)
|
||||
# Creates vim{32,64}.dll, and stub gvim.exe and vim.exe.
|
||||
@@ -381,6 +383,14 @@ TERM_DEPS = \
|
||||
libvterm/src/vterm_internal.h
|
||||
!endif
|
||||
|
||||
!ifndef SOUND
|
||||
! if "$(FEATURES)"=="HUGE" || "$(FEATURES)"=="BIG"
|
||||
SOUND = yes
|
||||
! else
|
||||
SOUND = no
|
||||
! endif
|
||||
!endif
|
||||
|
||||
!ifndef NETBEANS
|
||||
NETBEANS = $(GUI)
|
||||
!endif
|
||||
@@ -454,6 +464,13 @@ XPM_INC = -I $(XPM)\include -I $(XPM)\..\include
|
||||
! endif
|
||||
!endif # GUI
|
||||
|
||||
!if "$(SOUND)" == "yes"
|
||||
SOUND_PRO = proto/sound.pro
|
||||
SOUND_OBJ = $(OBJDIR)/sound.obj
|
||||
SOUND_DEFS = -DFEAT_SOUND
|
||||
SOUND_LIB = winmm.lib
|
||||
!endif
|
||||
|
||||
!if "$(CHANNEL)" == "yes"
|
||||
CHANNEL_PRO = proto/channel.pro
|
||||
CHANNEL_OBJ = $(OBJDIR)/channel.obj
|
||||
@@ -494,7 +511,7 @@ WINVER = 0x0501
|
||||
#VIMRUNTIMEDIR = somewhere
|
||||
|
||||
CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
|
||||
$(CSCOPE_DEFS) $(TERM_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \
|
||||
$(CSCOPE_DEFS) $(TERM_DEFS) $(SOUND_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \
|
||||
$(NBDEBUG_DEFS) $(XPM_DEFS) \
|
||||
$(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
|
||||
|
||||
@@ -743,6 +760,7 @@ OBJ = \
|
||||
$(OUTDIR)\os_win32.obj \
|
||||
$(OUTDIR)\pathdef.obj \
|
||||
$(OUTDIR)\popupmnu.obj \
|
||||
$(OUTDIR)\popupwin.obj \
|
||||
$(OUTDIR)\quickfix.obj \
|
||||
$(OUTDIR)\regexp.obj \
|
||||
$(OUTDIR)\screen.obj \
|
||||
@@ -847,7 +865,7 @@ XDIFF_DEPS = \
|
||||
!if "$(SUBSYSTEM_VER)" != ""
|
||||
SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER)
|
||||
SUBSYSTEM_TOOLS = $(SUBSYSTEM_TOOLS),$(SUBSYSTEM_VER)
|
||||
! if "$(VIMDLL)" != "yes"
|
||||
! if "$(VIMDLL)" == "yes"
|
||||
SUBSYSTEM_CON = $(SUBSYSTEM_CON),$(SUBSYSTEM_VER)
|
||||
! endif
|
||||
# Pass SUBSYSTEM_VER to GvimExt and other tools
|
||||
@@ -1216,7 +1234,7 @@ conflags = $(conflags) /map /mapinfo:lines
|
||||
LINKARGS1 = $(linkdebug) $(conflags)
|
||||
LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) user32.lib \
|
||||
$(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
|
||||
$(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
|
||||
$(TCL_LIB) $(SOUND_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
|
||||
|
||||
# Report link time code generation progress if used.
|
||||
!ifdef NODEBUG
|
||||
@@ -1252,12 +1270,12 @@ all: $(MAIN_TARGET) \
|
||||
|
||||
$(VIMDLLBASE).dll: $(OUTDIR) $(OBJ) $(XDIFF_OBJ) $(GUI_OBJ) $(CUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
|
||||
$(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \
|
||||
$(CSCOPE_OBJ) $(TERM_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) $(XPM_OBJ) \
|
||||
$(CSCOPE_OBJ) $(TERM_OBJ) $(SOUND_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) $(XPM_OBJ) \
|
||||
version.c version.h
|
||||
$(CC) $(CFLAGS_OUTDIR) version.c
|
||||
$(link) $(LINKARGS1) /dll -out:$(VIMDLLBASE).dll $(OBJ) $(XDIFF_OBJ) $(GUI_OBJ) $(CUI_OBJ) $(OLE_OBJ) \
|
||||
$(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \
|
||||
$(TCL_OBJ) $(CSCOPE_OBJ) $(TERM_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) \
|
||||
$(TCL_OBJ) $(CSCOPE_OBJ) $(TERM_OBJ) $(SOUND_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) \
|
||||
$(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
|
||||
|
||||
$(GVIM).exe: $(OUTDIR) $(EXEOBJG) $(VIMDLLBASE).dll
|
||||
@@ -1272,12 +1290,12 @@ $(VIM).exe: $(OUTDIR) $(EXEOBJC) $(VIMDLLBASE).dll
|
||||
|
||||
$(VIM).exe: $(OUTDIR) $(OBJ) $(XDIFF_OBJ) $(GUI_OBJ) $(CUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
|
||||
$(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \
|
||||
$(CSCOPE_OBJ) $(TERM_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) $(XPM_OBJ) \
|
||||
$(CSCOPE_OBJ) $(TERM_OBJ) $(SOUND_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) $(XPM_OBJ) \
|
||||
version.c version.h
|
||||
$(CC) $(CFLAGS_OUTDIR) version.c
|
||||
$(link) $(LINKARGS1) /subsystem:$(SUBSYSTEM) -out:$(VIM).exe $(OBJ) $(XDIFF_OBJ) $(GUI_OBJ) $(CUI_OBJ) $(OLE_OBJ) \
|
||||
$(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \
|
||||
$(TCL_OBJ) $(CSCOPE_OBJ) $(TERM_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) \
|
||||
$(TCL_OBJ) $(CSCOPE_OBJ) $(TERM_OBJ) $(SOUND_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) \
|
||||
$(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
|
||||
if exist $(VIM).exe.manifest mt.exe -nologo -manifest $(VIM).exe.manifest -updateresource:$(VIM).exe;1
|
||||
|
||||
@@ -1477,7 +1495,7 @@ $(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
|
||||
|
||||
$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c $(INCL) $(GUI_INCL)
|
||||
|
||||
$(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL)
|
||||
$(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp gui_dwrite.h
|
||||
|
||||
$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL) if_cscope.h
|
||||
|
||||
@@ -1575,6 +1593,8 @@ $(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
|
||||
|
||||
$(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
|
||||
|
||||
$(OUTDIR)/popupwin.obj: $(OUTDIR) popupwin.c $(INCL)
|
||||
|
||||
$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
|
||||
|
||||
$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c regexp_nfa.c $(INCL)
|
||||
@@ -1682,7 +1702,7 @@ E0_LINKARGS2 = $(LINKARGS2:\=\\)
|
||||
E_LINKARGS2 = $(E0_LINKARGS2:"=\")
|
||||
# ") stop the string
|
||||
|
||||
$(PATHDEF_SRC): auto
|
||||
$(PATHDEF_SRC): Make_mvc.mak
|
||||
@echo creating $(PATHDEF_SRC)
|
||||
@echo /* pathdef.c */ > $(PATHDEF_SRC)
|
||||
@echo #include "vim.h" >> $(PATHDEF_SRC)
|
||||
@@ -1693,9 +1713,6 @@ $(PATHDEF_SRC): auto
|
||||
@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
|
||||
@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
|
||||
|
||||
auto:
|
||||
if not exist auto/nul mkdir auto
|
||||
|
||||
# End Custom Build
|
||||
proto.h: \
|
||||
proto/arabic.pro \
|
||||
@@ -1745,6 +1762,7 @@ proto.h: \
|
||||
proto/winclip.pro \
|
||||
proto/os_win32.pro \
|
||||
proto/popupmnu.pro \
|
||||
proto/popupwin.pro \
|
||||
proto/quickfix.pro \
|
||||
proto/regexp.pro \
|
||||
proto/screen.pro \
|
||||
@@ -1762,6 +1780,7 @@ proto.h: \
|
||||
proto/usercmd.pro \
|
||||
proto/userfunc.pro \
|
||||
proto/window.pro \
|
||||
$(SOUND_PRO) \
|
||||
$(NETBEANS_PRO) \
|
||||
$(CHANNEL_PRO)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Makefile for Vim on OpenVMS
|
||||
#
|
||||
# Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com>
|
||||
# Last change: 2019 May 11
|
||||
# Last change: 2019 May 24
|
||||
#
|
||||
# This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
|
||||
# with MMS and MMK
|
||||
@@ -313,7 +313,7 @@ SRC = arabic.c autocmd.c beval.c blob.c blowfish.c buffer.c change.c charset.c \
|
||||
if_cscope.c if_xcmdsrv.c fileio.c findfile.c fold.c getchar.c \
|
||||
hardcopy.c hashtab.c indent.c insexpand.c json.c list.c main.c mark.c \
|
||||
menu.c mbyte.c memfile.c memline.c message.c misc1.c misc2.c move.c \
|
||||
normal.c ops.c option.c popupmnu.c quickfix.c regexp.c search.c \
|
||||
normal.c ops.c option.c popupmnu.c popupwin.c, quickfix.c regexp.c search.c \
|
||||
sha256.c sign.c spell.c spellfile.c syntax.c tag.c term.c termlib.c \
|
||||
textprop.c ui.c undo.c usercmd.c userfunc.c version.c screen.c \
|
||||
window.c os_unix.c os_vms.c pathdef.c \
|
||||
@@ -327,7 +327,7 @@ OBJ = arabic.obj autocmd.obj beval.obj blob.obj blowfish.obj buffer.obj change.
|
||||
fileio.obj findfile.obj fold.obj getchar.obj hardcopy.obj hashtab.obj \
|
||||
indent.obj insexpand.obj json.obj list.obj main.obj mark.obj \
|
||||
menu.obj memfile.obj memline.obj message.obj misc1.obj misc2.obj \
|
||||
move.obj mbyte.obj normal.obj ops.obj option.obj popupmnu.obj \
|
||||
move.obj mbyte.obj normal.obj ops.obj option.obj popupmnu.obj popupwin.obj\
|
||||
quickfix.obj regexp.obj search.obj sha256.obj sign.obj spell.obj \
|
||||
spellfile.obj syntax.obj tag.obj term.obj termlib.obj textprop.obj \
|
||||
ui.obj undo.obj usercmd.obj userfunc.obj screen.obj version.obj \
|
||||
@@ -688,6 +688,10 @@ popupmnu.obj : popupmnu.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h term.h macros.h structs.h regexp.h \
|
||||
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
globals.h
|
||||
popupwin.obj : popupwin.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h term.h macros.h structs.h regexp.h \
|
||||
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
globals.h
|
||||
quickfix.obj : quickfix.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h term.h macros.h structs.h regexp.h \
|
||||
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
|
||||
33
src/Makefile
33
src/Makefile
@@ -528,6 +528,11 @@ CClink = $(CC)
|
||||
# though you have /dev/sysmouse and includes.
|
||||
#CONF_OPT_SYSMOUSE = --disable-sysmouse
|
||||
|
||||
# libcanberra - For sound support. Default is on for big features.
|
||||
# Uncomment one of the two to chose otherwise.
|
||||
# CONF_OPT_CANBERRA = --enable-canberra
|
||||
# CONF_OPT_CANBERRA = --disable-canberra
|
||||
|
||||
# FEATURES - For creating Vim with more or less features
|
||||
# Uncomment one of these lines when you want to include few to many features.
|
||||
# The default is "huge" for most systems.
|
||||
@@ -1620,6 +1625,7 @@ BASIC_SRC = \
|
||||
os_unix.c \
|
||||
auto/pathdef.c \
|
||||
popupmnu.c \
|
||||
popupwin.c \
|
||||
pty.c \
|
||||
quickfix.c \
|
||||
regexp.c \
|
||||
@@ -1627,6 +1633,7 @@ BASIC_SRC = \
|
||||
search.c \
|
||||
sha256.c \
|
||||
sign.c \
|
||||
sound.c \
|
||||
spell.c \
|
||||
spellfile.c \
|
||||
syntax.c \
|
||||
@@ -1734,6 +1741,7 @@ OBJ_COMMON = \
|
||||
objects/os_unix.o \
|
||||
objects/pathdef.o \
|
||||
objects/popupmnu.o \
|
||||
objects/popupwin.o \
|
||||
objects/pty.o \
|
||||
objects/quickfix.o \
|
||||
objects/regexp.o \
|
||||
@@ -1741,6 +1749,7 @@ OBJ_COMMON = \
|
||||
objects/search.o \
|
||||
objects/sha256.o \
|
||||
objects/sign.o \
|
||||
objects/sound.o \
|
||||
objects/spell.o \
|
||||
objects/spellfile.o \
|
||||
objects/syntax.o \
|
||||
@@ -1873,6 +1882,7 @@ PRO_AUTO = \
|
||||
os_mac_conv.pro \
|
||||
os_unix.pro \
|
||||
popupmnu.pro \
|
||||
popupwin.pro \
|
||||
pty.pro \
|
||||
quickfix.pro \
|
||||
regexp.pro \
|
||||
@@ -1880,6 +1890,7 @@ PRO_AUTO = \
|
||||
search.pro \
|
||||
sha256.pro \
|
||||
sign.pro \
|
||||
sound.pro \
|
||||
spell.pro \
|
||||
spellfile.pro \
|
||||
syntax.pro \
|
||||
@@ -1946,7 +1957,7 @@ config auto/config.mk: auto/configure config.mk.in config.h.in
|
||||
$(CONF_ARGS4) $(CONF_ARGS5) $(CONF_ARGS6) \
|
||||
$(CONF_OPT_MZSCHEME) $(CONF_OPT_PLTHOME) \
|
||||
$(CONF_OPT_LUA) $(CONF_OPT_LUA_PREFIX) \
|
||||
$(CONF_OPT_SYSMOUSE); \
|
||||
$(CONF_OPT_SYSMOUSE) $(CONF_OPT_CANBERRA); \
|
||||
fi
|
||||
|
||||
# Use "make reconfig" to rerun configure without cached values.
|
||||
@@ -2114,7 +2125,8 @@ types.vim: $(TAGS_FILES)
|
||||
# TESTING
|
||||
#
|
||||
# Execute the test scripts and the unittests.
|
||||
test check: scripttests unittests test_libvterm
|
||||
# Do the scripttests first, so that the summary shows last.
|
||||
test check: unittests test_libvterm scripttests
|
||||
|
||||
# Execute the test scripts. Run these after compiling Vim, before installing.
|
||||
# This doesn't depend on $(VIMTARGET), because that won't work when configure
|
||||
@@ -2178,8 +2190,7 @@ test_libvterm:
|
||||
# These do not depend on the executable, compile it when needed.
|
||||
test1 \
|
||||
test_eval \
|
||||
test3 \
|
||||
test30 test37 test39 \
|
||||
test39 \
|
||||
test42 test44 test48 test49 \
|
||||
test52 test59 \
|
||||
test64 test69 \
|
||||
@@ -3208,6 +3219,9 @@ objects/pathdef.o: auto/pathdef.c
|
||||
objects/popupmnu.o: popupmnu.c
|
||||
$(CCC) -o $@ popupmnu.c
|
||||
|
||||
objects/popupwin.o: popupwin.c
|
||||
$(CCC) -o $@ popupwin.c
|
||||
|
||||
objects/pty.o: pty.c
|
||||
$(CCC) -o $@ pty.c
|
||||
|
||||
@@ -3229,6 +3243,9 @@ objects/sha256.o: sha256.c
|
||||
objects/sign.o: sign.c
|
||||
$(CCC) -o $@ sign.c
|
||||
|
||||
objects/sound.o: sound.c
|
||||
$(CCC) -o $@ sound.c
|
||||
|
||||
objects/spell.o: spell.c
|
||||
$(CCC) -o $@ spell.c
|
||||
|
||||
@@ -3612,6 +3629,10 @@ objects/popupmnu.o: popupmnu.c vim.h protodef.h auto/config.h feature.h os_unix.
|
||||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
proto.h globals.h
|
||||
objects/popupwin.o: popupwin.c vim.h protodef.h auto/config.h feature.h os_unix.h \
|
||||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
proto.h globals.h
|
||||
objects/pty.o: pty.c vim.h protodef.h auto/config.h feature.h os_unix.h \
|
||||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
@@ -3640,6 +3661,10 @@ objects/sign.o: sign.c vim.h protodef.h auto/config.h feature.h os_unix.h \
|
||||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
proto.h globals.h
|
||||
objects/sound.o: spell.c vim.h protodef.h auto/config.h feature.h os_unix.h \
|
||||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
proto.h globals.h
|
||||
objects/spell.o: spell.c vim.h protodef.h auto/config.h feature.h os_unix.h \
|
||||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
|
||||
225
src/auto/configure
vendored
225
src/auto/configure
vendored
@@ -840,6 +840,7 @@ enable_desktop_database_update
|
||||
with_motif_lib
|
||||
with_tlib
|
||||
enable_largefile
|
||||
enable_canberra
|
||||
enable_acl
|
||||
enable_gpm
|
||||
enable_sysmouse
|
||||
@@ -1515,6 +1516,7 @@ Optional Features:
|
||||
--disable-icon-cache-update update disabled
|
||||
--disable-desktop-database-update update disabled
|
||||
--disable-largefile omit support for large files
|
||||
--disable-canberra Do not use libcanberra.
|
||||
--disable-acl No check for ACL support.
|
||||
--disable-gpm Don't use gpm (Linux mouse daemon).
|
||||
--disable-sysmouse Don't use sysmouse (mouse in *BSD console).
|
||||
@@ -9303,28 +9305,8 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
if test -z "$SKIP_GTK2"; then
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-gtktest argument" >&5
|
||||
$as_echo_n "checking --disable-gtktest argument... " >&6; }
|
||||
# Check whether --enable-gtktest was given.
|
||||
if test "${enable_gtktest+set}" = set; then :
|
||||
enableval=$enable_gtktest;
|
||||
else
|
||||
enable_gtktest=yes
|
||||
fi
|
||||
|
||||
if test "x$enable_gtktest" = "xyes" ; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: gtk test enabled" >&5
|
||||
$as_echo "gtk test enabled" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: gtk test disabled" >&5
|
||||
$as_echo "gtk test disabled" >&6; }
|
||||
fi
|
||||
|
||||
if test "X$PKG_CONFIG" = "X"; then
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
if test "X$PKG_CONFIG" = "X"; then
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
@@ -9422,6 +9404,26 @@ else
|
||||
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
if test -z "$SKIP_GTK2"; then
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-gtktest argument" >&5
|
||||
$as_echo_n "checking --disable-gtktest argument... " >&6; }
|
||||
# Check whether --enable-gtktest was given.
|
||||
if test "${enable_gtktest+set}" = set; then :
|
||||
enableval=$enable_gtktest;
|
||||
else
|
||||
enable_gtktest=yes
|
||||
fi
|
||||
|
||||
if test "x$enable_gtktest" = "xyes" ; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: gtk test enabled" >&5
|
||||
$as_echo "gtk test enabled" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: gtk test disabled" >&5
|
||||
$as_echo "gtk test disabled" >&6; }
|
||||
fi
|
||||
|
||||
if test "x$PKG_CONFIG" != "xno"; then
|
||||
@@ -9677,107 +9679,6 @@ $as_echo "gtk test enabled" >&6; }
|
||||
$as_echo "gtk test disabled" >&6; }
|
||||
fi
|
||||
|
||||
if test "X$PKG_CONFIG" = "X"; then
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_PKG_CONFIG+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $PKG_CONFIG in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
|
||||
$as_echo "$PKG_CONFIG" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
if test -z "$ac_cv_path_PKG_CONFIG"; then
|
||||
ac_pt_PKG_CONFIG=$PKG_CONFIG
|
||||
# Extract the first word of "pkg-config", so it can be a program name with args.
|
||||
set dummy pkg-config; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $ac_pt_PKG_CONFIG in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
|
||||
if test -n "$ac_pt_PKG_CONFIG"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
|
||||
$as_echo "$ac_pt_PKG_CONFIG" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
if test "x$ac_pt_PKG_CONFIG" = x; then
|
||||
PKG_CONFIG="no"
|
||||
else
|
||||
case $cross_compiling:$ac_tool_warned in
|
||||
yes:)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
|
||||
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
|
||||
ac_tool_warned=yes ;;
|
||||
esac
|
||||
PKG_CONFIG=$ac_pt_PKG_CONFIG
|
||||
fi
|
||||
else
|
||||
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test "x$PKG_CONFIG" != "xno"; then
|
||||
|
||||
if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
|
||||
@@ -12668,7 +12569,7 @@ for ac_func in fchdir fchown fchmod fsync getcwd getpseudotty \
|
||||
memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
|
||||
getpgid setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
|
||||
sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
|
||||
strnicmp strpbrk strtol tgetent towlower towupper iswupper tzset \
|
||||
usleep utime utimes mblen ftruncate unsetenv posix_openpt
|
||||
do :
|
||||
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
@@ -13026,6 +12927,73 @@ rm -rf conftest*
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-canberra argument" >&5
|
||||
$as_echo_n "checking --enable-canberra argument... " >&6; }
|
||||
# Check whether --enable-canberra was given.
|
||||
if test "${enable_canberra+set}" = set; then :
|
||||
enableval=$enable_canberra;
|
||||
else
|
||||
enable_canberra="maybe"
|
||||
fi
|
||||
|
||||
|
||||
if test "$enable_canberra" = "maybe"; then
|
||||
if test "$features" = "big" -o "$features" = "huge"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to yes" >&5
|
||||
$as_echo "Defaulting to yes" >&6; }
|
||||
enable_canberra="yes"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to no" >&5
|
||||
$as_echo "Defaulting to no" >&6; }
|
||||
enable_canberra="no"
|
||||
fi
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_canberra" >&5
|
||||
$as_echo "$enable_canberra" >&6; }
|
||||
fi
|
||||
if test "$enable_canberra" = "yes"; then
|
||||
if test "x$PKG_CONFIG" != "xno"; then
|
||||
canberra_lib=`$PKG_CONFIG --libs libcanberra 2>/dev/null`
|
||||
canberra_cflags=`$PKG_CONFIG --cflags libcanberra 2>/dev/null`
|
||||
fi
|
||||
if test "x$canberra_lib" = "x"; then
|
||||
canberra_lib=-lcanberra
|
||||
canberra_cflags=-D_REENTRANT
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcanberra" >&5
|
||||
$as_echo_n "checking for libcanberra... " >&6; }
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $canberra_cflags"
|
||||
LIBS="$LIBS $canberra_lib"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
# include <canberra.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
ca_context *hello;
|
||||
ca_context_create(&hello);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }; $as_echo "#define HAVE_CANBERRA 1" >>confdefs.h
|
||||
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_blksize" >&5
|
||||
$as_echo_n "checking for st_blksize... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
@@ -14549,9 +14517,14 @@ rm -f core conftest.err conftest.$ac_objext \
|
||||
$as_echo_n "checking if msgfmt supports --desktop... " >&6; }
|
||||
MSGFMT_DESKTOP=
|
||||
if "$MSGFMT" --help | grep -e '--desktop' >/dev/null; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
if "$MSGFMT" --version | grep '0.19.[3-7]$' >/dev/null; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: broken" >&5
|
||||
$as_echo "broken" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
MSGFMT_DESKTOP="gvim.desktop vim.desktop"
|
||||
MSGFMT_DESKTOP="gvim.desktop vim.desktop"
|
||||
fi
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
|
||||
@@ -1193,7 +1193,7 @@ do_autocmd_event(
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
ap = (AutoPat *)alloc((unsigned)sizeof(AutoPat));
|
||||
ap = ALLOC_ONE(AutoPat);
|
||||
if (ap == NULL)
|
||||
return FAIL;
|
||||
ap->pat = vim_strnsave(pat, patlen);
|
||||
@@ -1242,7 +1242,7 @@ do_autocmd_event(
|
||||
prev_ac = &(ap->cmds);
|
||||
while ((ac = *prev_ac) != NULL)
|
||||
prev_ac = &ac->next;
|
||||
ac = (AutoCmd *)alloc((unsigned)sizeof(AutoCmd));
|
||||
ac = ALLOC_ONE(AutoCmd);
|
||||
if (ac == NULL)
|
||||
return FAIL;
|
||||
ac->cmd = vim_strsave(cmd);
|
||||
@@ -1423,7 +1423,7 @@ aucmd_prepbuf(
|
||||
// back to using the current window.
|
||||
if (win == NULL && aucmd_win == NULL)
|
||||
{
|
||||
win_alloc_aucmd_win();
|
||||
aucmd_win = win_alloc_popup_win();
|
||||
if (aucmd_win == NULL)
|
||||
win = curwin;
|
||||
}
|
||||
@@ -1451,20 +1451,12 @@ aucmd_prepbuf(
|
||||
// unexpected results.
|
||||
aco->use_aucmd_win = TRUE;
|
||||
aucmd_win_used = TRUE;
|
||||
aucmd_win->w_buffer = buf;
|
||||
#if defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
|
||||
aucmd_win->w_s = &buf->b_s;
|
||||
#endif
|
||||
++buf->b_nwindows;
|
||||
win_init_empty(aucmd_win); // set cursor and topline to safe values
|
||||
|
||||
// Make sure w_localdir and globaldir are NULL to avoid a chdir() in
|
||||
// win_enter_ext().
|
||||
VIM_CLEAR(aucmd_win->w_localdir);
|
||||
win_init_popup_win(aucmd_win, buf);
|
||||
|
||||
aco->globaldir = globaldir;
|
||||
globaldir = NULL;
|
||||
|
||||
|
||||
// Split the current window, put the aucmd_win in the upper half.
|
||||
// We don't want the BufEnter or WinEnter autocommands.
|
||||
block_autocmds();
|
||||
@@ -1717,7 +1709,6 @@ has_cursormoved(void)
|
||||
return (first_autopat[(int)EVENT_CURSORMOVED] != NULL);
|
||||
}
|
||||
|
||||
#if defined(FEAT_CONCEAL) || defined(PROTO)
|
||||
/*
|
||||
* Return TRUE when there is a CursorMovedI autocommand defined.
|
||||
*/
|
||||
@@ -1726,7 +1717,6 @@ has_cursormovedI(void)
|
||||
{
|
||||
return (first_autopat[(int)EVENT_CURSORMOVEDI] != NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Return TRUE when there is a TextChanged autocommand defined.
|
||||
@@ -2303,8 +2293,8 @@ auto_next_pat(
|
||||
{
|
||||
name = event_nr2name(apc->event);
|
||||
s = _("%s Autocommands for \"%s\"");
|
||||
sourcing_name = alloc((unsigned)(STRLEN(s)
|
||||
+ STRLEN(name) + ap->patlen + 1));
|
||||
sourcing_name = alloc(STRLEN(s)
|
||||
+ STRLEN(name) + ap->patlen + 1);
|
||||
if (sourcing_name != NULL)
|
||||
{
|
||||
sprintf((char *)sourcing_name, s,
|
||||
@@ -2339,7 +2329,7 @@ auto_next_pat(
|
||||
* Returns allocated string, or NULL for end of autocommands.
|
||||
*/
|
||||
char_u *
|
||||
getnextac(int c UNUSED, void *cookie, int indent UNUSED)
|
||||
getnextac(int c UNUSED, void *cookie, int indent UNUSED, int do_concat UNUSED)
|
||||
{
|
||||
AutoPatCmd *acp = (AutoPatCmd *)cookie;
|
||||
char_u *retval;
|
||||
|
||||
@@ -49,7 +49,7 @@ get_beval_info(
|
||||
col = X_2_COL(beval->x);
|
||||
}
|
||||
#endif
|
||||
wp = mouse_find_win(&row, &col);
|
||||
wp = mouse_find_win(&row, &col, FAIL_POPUP);
|
||||
if (wp != NULL && row >= 0 && row < wp->w_height && col < wp->w_width)
|
||||
{
|
||||
/* Found a window and the cursor is in the text. Now find the line
|
||||
@@ -141,6 +141,7 @@ get_beval_info(
|
||||
|
||||
/*
|
||||
* Show a balloon with "mesg" or "list".
|
||||
* Hide the balloon when both are NULL.
|
||||
*/
|
||||
void
|
||||
post_balloon(BalloonEval *beval UNUSED, char_u *mesg, list_T *list UNUSED)
|
||||
@@ -153,7 +154,7 @@ post_balloon(BalloonEval *beval UNUSED, char_u *mesg, list_T *list UNUSED)
|
||||
# endif
|
||||
# ifdef FEAT_BEVAL_GUI
|
||||
if (gui.in_use)
|
||||
/* GUI can't handle a list */
|
||||
// GUI can't handle a list
|
||||
gui_mch_post_balloon(beval, mesg);
|
||||
# endif
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
blob_T *
|
||||
blob_alloc(void)
|
||||
{
|
||||
blob_T *blob = (blob_T *)alloc_clear(sizeof(blob_T));
|
||||
blob_T *blob = ALLOC_CLEAR_ONE(blob_T);
|
||||
|
||||
if (blob != NULL)
|
||||
ga_init2(&blob->bv_ga, 1, 100);
|
||||
|
||||
@@ -645,7 +645,7 @@ crypt_blowfish_init(
|
||||
char_u* seed,
|
||||
int seed_len)
|
||||
{
|
||||
bf_state_T *bfs = (bf_state_T *)alloc_clear(sizeof(bf_state_T));
|
||||
bf_state_T *bfs = ALLOC_CLEAR_ONE(bf_state_T);
|
||||
|
||||
if (bfs == NULL)
|
||||
return FAIL;
|
||||
|
||||
164
src/buffer.c
164
src/buffer.c
@@ -60,7 +60,9 @@ static char *e_auabort = N_("E855: Autocommands caused command to abort");
|
||||
/* Number of times free_buffer() was called. */
|
||||
static int buf_free_count = 0;
|
||||
|
||||
/* Read data from buffer for retrying. */
|
||||
/*
|
||||
* Read data from buffer for retrying.
|
||||
*/
|
||||
static int
|
||||
read_buffer(
|
||||
int read_stdin, /* read file from stdin, otherwise fifo */
|
||||
@@ -104,7 +106,7 @@ read_buffer(
|
||||
if (!readonlymode && !BUFEMPTY())
|
||||
changed();
|
||||
else if (retval == OK)
|
||||
unchanged(curbuf, FALSE);
|
||||
unchanged(curbuf, FALSE, TRUE);
|
||||
|
||||
if (retval == OK)
|
||||
{
|
||||
@@ -119,6 +121,23 @@ read_buffer(
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ensure buffer "buf" is loaded. Does not trigger the swap-exists action.
|
||||
*/
|
||||
void
|
||||
buffer_ensure_loaded(buf_T *buf)
|
||||
{
|
||||
if (buf->b_ml.ml_mfp == NULL)
|
||||
{
|
||||
aco_save_T aco;
|
||||
|
||||
aucmd_prepbuf(&aco, buf);
|
||||
swap_exists_action = SEA_NONE;
|
||||
open_buffer(FALSE, NULL, 0);
|
||||
aucmd_restbuf(&aco);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Open current buffer, that is: open the memfile and read the file into
|
||||
* memory.
|
||||
@@ -275,7 +294,7 @@ open_buffer(
|
||||
)
|
||||
changed();
|
||||
else if (retval == OK && !read_stdin && !read_fifo)
|
||||
unchanged(curbuf, FALSE);
|
||||
unchanged(curbuf, FALSE, TRUE);
|
||||
save_file_ff(curbuf); /* keep this fileformat */
|
||||
|
||||
/* Set last_changedtick to avoid triggering a TextChanged autocommand right
|
||||
@@ -456,7 +475,7 @@ close_buffer(
|
||||
win_T *win, /* if not NULL, set b_last_cursor */
|
||||
buf_T *buf,
|
||||
int action,
|
||||
int abort_if_last UNUSED)
|
||||
int abort_if_last)
|
||||
{
|
||||
int is_curbuf;
|
||||
int nwindows;
|
||||
@@ -700,7 +719,7 @@ aucmd_abort:
|
||||
buf_clear_file(buf_T *buf)
|
||||
{
|
||||
buf->b_ml.ml_line_count = 1;
|
||||
unchanged(buf, TRUE);
|
||||
unchanged(buf, TRUE, TRUE);
|
||||
buf->b_shortname = FALSE;
|
||||
buf->b_p_eol = TRUE;
|
||||
buf->b_start_eol = TRUE;
|
||||
@@ -862,7 +881,7 @@ free_buffer(buf_T *buf)
|
||||
#endif
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
vim_free(buf->b_prompt_text);
|
||||
free_callback(buf->b_prompt_callback, buf->b_prompt_partial);
|
||||
free_callback(&buf->b_prompt_callback);
|
||||
#endif
|
||||
|
||||
buf_hashtab_remove(buf);
|
||||
@@ -1071,7 +1090,7 @@ handle_swap_exists(bufref_T *old_curbuf)
|
||||
|
||||
/* User selected Recover at ATTENTION prompt. */
|
||||
msg_scroll = TRUE;
|
||||
ml_recover();
|
||||
ml_recover(FALSE);
|
||||
msg_puts("\n"); /* don't overwrite the last message */
|
||||
cmdline_row = msg_row;
|
||||
do_modelines(0);
|
||||
@@ -1958,7 +1977,7 @@ buflist_new(
|
||||
}
|
||||
if (buf != curbuf || curbuf == NULL)
|
||||
{
|
||||
buf = (buf_T *)alloc_clear((unsigned)sizeof(buf_T));
|
||||
buf = ALLOC_CLEAR_ONE(buf_T);
|
||||
if (buf == NULL)
|
||||
{
|
||||
vim_free(ffname);
|
||||
@@ -1985,7 +2004,7 @@ buflist_new(
|
||||
}
|
||||
|
||||
clear_wininfo(buf);
|
||||
buf->b_wininfo = (wininfo_T *)alloc_clear((unsigned)sizeof(wininfo_T));
|
||||
buf->b_wininfo = ALLOC_CLEAR_ONE(wininfo_T);
|
||||
|
||||
if ((ffname != NULL && (buf->b_ffname == NULL || buf->b_sfname == NULL))
|
||||
|| buf->b_wininfo == NULL)
|
||||
@@ -2577,7 +2596,7 @@ ExpandBufnames(
|
||||
/* Make a copy of "pat" and change "^" to "\(^\|[\/]\)". */
|
||||
if (*pat == '^')
|
||||
{
|
||||
patc = alloc((unsigned)STRLEN(pat) + 11);
|
||||
patc = alloc(STRLEN(pat) + 11);
|
||||
if (patc == NULL)
|
||||
return FAIL;
|
||||
STRCPY(patc, "\\(^\\|[\\/]\\)");
|
||||
@@ -2634,7 +2653,7 @@ ExpandBufnames(
|
||||
break;
|
||||
if (round == 1)
|
||||
{
|
||||
*file = (char_u **)alloc((unsigned)(count * sizeof(char_u *)));
|
||||
*file = ALLOC_MULT(char_u *, count);
|
||||
if (*file == NULL)
|
||||
{
|
||||
vim_regfree(regmatch.regprog);
|
||||
@@ -2771,7 +2790,7 @@ buflist_setfpos(
|
||||
if (wip == NULL)
|
||||
{
|
||||
/* allocate a new entry */
|
||||
wip = (wininfo_T *)alloc_clear((unsigned)sizeof(wininfo_T));
|
||||
wip = ALLOC_CLEAR_ONE(wininfo_T);
|
||||
if (wip == NULL)
|
||||
return;
|
||||
wip->wi_win = win;
|
||||
@@ -3430,7 +3449,7 @@ fileinfo(
|
||||
char *buffer;
|
||||
size_t len;
|
||||
|
||||
buffer = (char *)alloc(IOSIZE);
|
||||
buffer = alloc(IOSIZE);
|
||||
if (buffer == NULL)
|
||||
return;
|
||||
|
||||
@@ -3893,7 +3912,8 @@ build_stl_str_hl(
|
||||
char_u base;
|
||||
char_u opt;
|
||||
#define TMPLEN 70
|
||||
char_u tmp[TMPLEN];
|
||||
char_u buf_tmp[TMPLEN];
|
||||
char_u win_tmp[TMPLEN];
|
||||
char_u *usefmt = fmt;
|
||||
struct stl_hlrec *sp;
|
||||
int save_must_redraw = must_redraw;
|
||||
@@ -3906,9 +3926,17 @@ build_stl_str_hl(
|
||||
*/
|
||||
if (fmt[0] == '%' && fmt[1] == '!')
|
||||
{
|
||||
typval_T tv;
|
||||
|
||||
tv.v_type = VAR_NUMBER;
|
||||
tv.vval.v_number = wp->w_id;
|
||||
set_var((char_u *)"g:statusline_winid", &tv, FALSE);
|
||||
|
||||
usefmt = eval_to_string_safe(fmt + 2, NULL, use_sandbox);
|
||||
if (usefmt == NULL)
|
||||
usefmt = fmt;
|
||||
|
||||
do_unlet((char_u *)"g:statusline_winid", TRUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -4225,8 +4253,11 @@ build_stl_str_hl(
|
||||
p = t;
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
vim_snprintf((char *)tmp, sizeof(tmp), "%d", curbuf->b_fnum);
|
||||
set_internal_string_var((char_u *)"g:actual_curbuf", tmp);
|
||||
vim_snprintf((char *)buf_tmp, sizeof(buf_tmp),
|
||||
"%d", curbuf->b_fnum);
|
||||
set_internal_string_var((char_u *)"g:actual_curbuf", buf_tmp);
|
||||
vim_snprintf((char *)win_tmp, sizeof(win_tmp), "%d", curwin->w_id);
|
||||
set_internal_string_var((char_u *)"g:actual_curwin", win_tmp);
|
||||
|
||||
save_curbuf = curbuf;
|
||||
save_curwin = curwin;
|
||||
@@ -4238,6 +4269,7 @@ build_stl_str_hl(
|
||||
curwin = save_curwin;
|
||||
curbuf = save_curbuf;
|
||||
do_unlet((char_u *)"g:actual_curbuf", TRUE);
|
||||
do_unlet((char_u *)"g:actual_curwin", TRUE);
|
||||
|
||||
if (str != NULL && *str != 0)
|
||||
{
|
||||
@@ -4290,21 +4322,21 @@ build_stl_str_hl(
|
||||
break;
|
||||
|
||||
case STL_ALTPERCENT:
|
||||
str = tmp;
|
||||
str = buf_tmp;
|
||||
get_rel_pos(wp, str, TMPLEN);
|
||||
break;
|
||||
|
||||
case STL_ARGLISTSTAT:
|
||||
fillable = FALSE;
|
||||
tmp[0] = 0;
|
||||
if (append_arg_number(wp, tmp, (int)sizeof(tmp), FALSE))
|
||||
str = tmp;
|
||||
buf_tmp[0] = 0;
|
||||
if (append_arg_number(wp, buf_tmp, (int)sizeof(buf_tmp), FALSE))
|
||||
str = buf_tmp;
|
||||
break;
|
||||
|
||||
case STL_KEYMAP:
|
||||
fillable = FALSE;
|
||||
if (get_keymap_str(wp, (char_u *)"<%s>", tmp, TMPLEN))
|
||||
str = tmp;
|
||||
if (get_keymap_str(wp, (char_u *)"<%s>", buf_tmp, TMPLEN))
|
||||
str = buf_tmp;
|
||||
break;
|
||||
case STL_PAGENUM:
|
||||
#if defined(FEAT_PRINTER) || defined(FEAT_GUI_TABLINE)
|
||||
@@ -4360,9 +4392,9 @@ build_stl_str_hl(
|
||||
if (*wp->w_buffer->b_p_ft != NUL
|
||||
&& STRLEN(wp->w_buffer->b_p_ft) < TMPLEN - 3)
|
||||
{
|
||||
vim_snprintf((char *)tmp, sizeof(tmp), "[%s]",
|
||||
vim_snprintf((char *)buf_tmp, sizeof(buf_tmp), "[%s]",
|
||||
wp->w_buffer->b_p_ft);
|
||||
str = tmp;
|
||||
str = buf_tmp;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -4371,11 +4403,11 @@ build_stl_str_hl(
|
||||
if (*wp->w_buffer->b_p_ft != NUL
|
||||
&& STRLEN(wp->w_buffer->b_p_ft) < TMPLEN - 2)
|
||||
{
|
||||
vim_snprintf((char *)tmp, sizeof(tmp), ",%s",
|
||||
vim_snprintf((char *)buf_tmp, sizeof(buf_tmp), ",%s",
|
||||
wp->w_buffer->b_p_ft);
|
||||
for (t = tmp; *t != 0; t++)
|
||||
for (t = buf_tmp; *t != 0; t++)
|
||||
*t = TOUPPER_LOC(*t);
|
||||
str = tmp;
|
||||
str = buf_tmp;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -4898,7 +4930,7 @@ do_arg_all(
|
||||
setpcmark();
|
||||
|
||||
opened_len = ARGCOUNT;
|
||||
opened = alloc_clear((unsigned)opened_len);
|
||||
opened = alloc_clear(opened_len);
|
||||
if (opened == NULL)
|
||||
return;
|
||||
|
||||
@@ -4943,7 +4975,7 @@ do_arg_all(
|
||||
if (i < alist->al_ga.ga_len
|
||||
&& (AARGLIST(alist)[i].ae_fnum == buf->b_fnum
|
||||
|| fullpathcmp(alist_name(&AARGLIST(alist)[i]),
|
||||
buf->b_ffname, TRUE) & FPC_SAME))
|
||||
buf->b_ffname, TRUE, TRUE) & FPC_SAME))
|
||||
{
|
||||
int weight = 1;
|
||||
|
||||
@@ -5665,7 +5697,17 @@ bt_help(buf_T *buf)
|
||||
int
|
||||
bt_prompt(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && buf->b_p_bt[0] == 'p';
|
||||
return buf != NULL && buf->b_p_bt[0] == 'p' && buf->b_p_bt[1] == 'r';
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" is a buffer for a popup window.
|
||||
*/
|
||||
int
|
||||
bt_popup(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && buf->b_p_bt != NULL
|
||||
&& buf->b_p_bt[0] == 'p' && buf->b_p_bt[1] == 'o';
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5673,7 +5715,7 @@ bt_prompt(buf_T *buf)
|
||||
* buffer. This means the buffer name is not a file name.
|
||||
*/
|
||||
int
|
||||
bt_nofile(buf_T *buf)
|
||||
bt_nofilename(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
|
||||
|| buf->b_p_bt[0] == 'a'
|
||||
@@ -5681,6 +5723,15 @@ bt_nofile(buf_T *buf)
|
||||
|| buf->b_p_bt[0] == 'p');
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" has 'buftype' set to "nofile".
|
||||
*/
|
||||
int
|
||||
bt_nofile(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f';
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" is a "nowrite", "nofile", "terminal" or "prompt"
|
||||
* buffer.
|
||||
@@ -5747,7 +5798,7 @@ buf_spname(buf_T *buf)
|
||||
|
||||
/* There is no _file_ when 'buftype' is "nofile", b_sfname
|
||||
* contains the name as specified by the user. */
|
||||
if (bt_nofile(buf))
|
||||
if (bt_nofilename(buf))
|
||||
{
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (buf->b_term != NULL)
|
||||
@@ -5758,6 +5809,10 @@ buf_spname(buf_T *buf)
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
if (bt_prompt(buf))
|
||||
return (char_u *)_("[Prompt]");
|
||||
#endif
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
if (bt_popup(buf))
|
||||
return (char_u *)_("[Popup]");
|
||||
#endif
|
||||
return (char_u *)_("[Scratch]");
|
||||
}
|
||||
@@ -5924,3 +5979,48 @@ wipe_buffer(
|
||||
if (!aucmd)
|
||||
unblock_autocmds();
|
||||
}
|
||||
|
||||
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||
/*
|
||||
* Mark references in functions of buffers.
|
||||
*/
|
||||
int
|
||||
set_ref_in_buffers(int copyID)
|
||||
{
|
||||
int abort = FALSE;
|
||||
buf_T *bp;
|
||||
|
||||
FOR_ALL_BUFFERS(bp)
|
||||
{
|
||||
listener_T *lnr;
|
||||
typval_T tv;
|
||||
|
||||
for (lnr = bp->b_listener; !abort && lnr != NULL; lnr = lnr->lr_next)
|
||||
{
|
||||
if (lnr->lr_callback.cb_partial != NULL)
|
||||
{
|
||||
tv.v_type = VAR_PARTIAL;
|
||||
tv.vval.v_partial = lnr->lr_callback.cb_partial;
|
||||
abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL);
|
||||
}
|
||||
}
|
||||
# ifdef FEAT_JOB_CHANNEL
|
||||
if (!abort && bp->b_prompt_callback.cb_partial != NULL)
|
||||
{
|
||||
tv.v_type = VAR_PARTIAL;
|
||||
tv.vval.v_partial = bp->b_prompt_callback.cb_partial;
|
||||
abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL);
|
||||
}
|
||||
if (!abort && bp->b_prompt_interrupt.cb_partial != NULL)
|
||||
{
|
||||
tv.v_type = VAR_PARTIAL;
|
||||
tv.vval.v_partial = bp->b_prompt_interrupt.cb_partial;
|
||||
abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL);
|
||||
}
|
||||
# endif
|
||||
if (abort)
|
||||
break;
|
||||
}
|
||||
return abort;
|
||||
}
|
||||
#endif
|
||||
|
||||
75
src/change.c
75
src/change.c
@@ -172,16 +172,21 @@ check_recorded_changes(
|
||||
if (buf->b_recorded_changes != NULL && xtra != 0)
|
||||
{
|
||||
listitem_T *li;
|
||||
linenr_T nr;
|
||||
linenr_T prev_lnum;
|
||||
linenr_T prev_lnume;
|
||||
|
||||
for (li = buf->b_recorded_changes->lv_first; li != NULL;
|
||||
li = li->li_next)
|
||||
{
|
||||
nr = (linenr_T)dict_get_number(
|
||||
prev_lnum = (linenr_T)dict_get_number(
|
||||
li->li_tv.vval.v_dict, (char_u *)"lnum");
|
||||
if (nr >= lnum || nr > lnume)
|
||||
prev_lnume = (linenr_T)dict_get_number(
|
||||
li->li_tv.vval.v_dict, (char_u *)"end");
|
||||
if (prev_lnum >= lnum || prev_lnum > lnume
|
||||
|| (prev_lnume >= lnum && xtra != 0))
|
||||
{
|
||||
if (li->li_next == NULL && lnum == nr
|
||||
if (li->li_next == NULL && lnum == prev_lnum
|
||||
&& xtra == 0
|
||||
&& col + 1 == (colnr_T)dict_get_number(
|
||||
li->li_tv.vval.v_dict, (char_u *)"col"))
|
||||
{
|
||||
@@ -195,8 +200,8 @@ check_recorded_changes(
|
||||
(char_u *)"end", -1);
|
||||
if (di != NULL)
|
||||
{
|
||||
nr = tv_get_number(&di->di_tv);
|
||||
if (lnume > nr)
|
||||
prev_lnum = tv_get_number(&di->di_tv);
|
||||
if (lnume > prev_lnum)
|
||||
di->di_tv.vval.v_number = lnume;
|
||||
}
|
||||
di = dict_find(li->li_tv.vval.v_dict,
|
||||
@@ -266,36 +271,34 @@ may_record_change(
|
||||
void
|
||||
f_listener_add(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
char_u *callback;
|
||||
partial_T *partial;
|
||||
callback_T callback;
|
||||
listener_T *lnr;
|
||||
buf_T *buf = curbuf;
|
||||
|
||||
callback = get_callback(&argvars[0], &partial);
|
||||
if (callback == NULL)
|
||||
callback = get_callback(&argvars[0]);
|
||||
if (callback.cb_name == NULL)
|
||||
return;
|
||||
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
buf = get_buf_arg(&argvars[1]);
|
||||
if (buf == NULL)
|
||||
{
|
||||
free_callback(&callback);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
lnr = (listener_T *)alloc_clear((sizeof(listener_T)));
|
||||
lnr = ALLOC_CLEAR_ONE(listener_T);
|
||||
if (lnr == NULL)
|
||||
{
|
||||
free_callback(callback, partial);
|
||||
free_callback(&callback);
|
||||
return;
|
||||
}
|
||||
lnr->lr_next = buf->b_listener;
|
||||
buf->b_listener = lnr;
|
||||
|
||||
if (partial == NULL)
|
||||
lnr->lr_callback = vim_strsave(callback);
|
||||
else
|
||||
lnr->lr_callback = callback; // pointer into the partial
|
||||
lnr->lr_partial = partial;
|
||||
set_callback(&lnr->lr_callback, &callback);
|
||||
|
||||
lnr->lr_id = ++next_listener_id;
|
||||
rettv->vval.v_number = lnr->lr_id;
|
||||
@@ -340,7 +343,7 @@ f_listener_remove(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
prev->lr_next = lnr->lr_next;
|
||||
else
|
||||
buf->b_listener = lnr->lr_next;
|
||||
free_callback(lnr->lr_callback, lnr->lr_partial);
|
||||
free_callback(&lnr->lr_callback);
|
||||
vim_free(lnr);
|
||||
}
|
||||
prev = lnr;
|
||||
@@ -372,10 +375,18 @@ invoke_listeners(buf_T *buf)
|
||||
linenr_T start = MAXLNUM;
|
||||
linenr_T end = 0;
|
||||
linenr_T added = 0;
|
||||
int save_updating_screen = updating_screen;
|
||||
static int recursive = FALSE;
|
||||
|
||||
if (buf->b_recorded_changes == NULL // nothing changed
|
||||
|| buf->b_listener == NULL) // no listeners
|
||||
|| buf->b_listener == NULL // no listeners
|
||||
|| recursive) // already busy
|
||||
return;
|
||||
recursive = TRUE;
|
||||
|
||||
// Block messages on channels from being handled, so that they don't make
|
||||
// text changes here.
|
||||
++updating_screen;
|
||||
|
||||
argv[0].v_type = VAR_NUMBER;
|
||||
argv[0].vval.v_number = buf->b_fnum; // a:bufnr
|
||||
@@ -406,14 +417,20 @@ invoke_listeners(buf_T *buf)
|
||||
|
||||
for (lnr = buf->b_listener; lnr != NULL; lnr = lnr->lr_next)
|
||||
{
|
||||
call_func(lnr->lr_callback, -1, &rettv,
|
||||
5, argv, NULL, 0L, 0L, &dummy, TRUE, lnr->lr_partial, NULL);
|
||||
call_callback(&lnr->lr_callback, -1, &rettv,
|
||||
5, argv, NULL, 0L, 0L, &dummy, TRUE, NULL);
|
||||
clear_tv(&rettv);
|
||||
}
|
||||
|
||||
--textlock;
|
||||
list_unref(buf->b_recorded_changes);
|
||||
buf->b_recorded_changes = NULL;
|
||||
|
||||
if (save_updating_screen)
|
||||
updating_screen = TRUE;
|
||||
else
|
||||
after_updating_screen(TRUE);
|
||||
recursive = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -684,7 +701,7 @@ inserted_bytes(linenr_T lnum, colnr_T col, int added UNUSED)
|
||||
{
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
if (curbuf->b_has_textprop && added != 0)
|
||||
adjust_prop_columns(lnum, col, added);
|
||||
adjust_prop_columns(lnum, col, added, 0);
|
||||
#endif
|
||||
|
||||
changed_bytes(lnum, col);
|
||||
@@ -825,9 +842,11 @@ changed_lines(
|
||||
/*
|
||||
* Called when the changed flag must be reset for buffer "buf".
|
||||
* When "ff" is TRUE also reset 'fileformat'.
|
||||
* When "always_inc_changedtick" is TRUE b:changedtick is incremented also when
|
||||
* the changed flag was off.
|
||||
*/
|
||||
void
|
||||
unchanged(buf_T *buf, int ff)
|
||||
unchanged(buf_T *buf, int ff, int always_inc_changedtick)
|
||||
{
|
||||
if (buf->b_changed || (ff && file_ff_differs(buf, FALSE)))
|
||||
{
|
||||
@@ -840,8 +859,10 @@ unchanged(buf_T *buf, int ff)
|
||||
#ifdef FEAT_TITLE
|
||||
need_maketitle = TRUE; // set window title later
|
||||
#endif
|
||||
++CHANGEDTICK(buf);
|
||||
}
|
||||
++CHANGEDTICK(buf);
|
||||
else if (always_inc_changedtick)
|
||||
++CHANGEDTICK(buf);
|
||||
#ifdef FEAT_NETBEANS_INTG
|
||||
netbeans_unmodified(buf);
|
||||
#endif
|
||||
@@ -985,7 +1006,7 @@ ins_char_bytes(char_u *buf, int charlen)
|
||||
}
|
||||
}
|
||||
|
||||
newp = alloc_check((unsigned)(linelen + newlen - oldlen));
|
||||
newp = alloc(linelen + newlen - oldlen);
|
||||
if (newp == NULL)
|
||||
return;
|
||||
|
||||
@@ -1060,7 +1081,7 @@ ins_str(char_u *s)
|
||||
oldp = ml_get(lnum);
|
||||
oldlen = (int)STRLEN(oldp);
|
||||
|
||||
newp = alloc_check((unsigned)(oldlen + newlen + 1));
|
||||
newp = alloc(oldlen + newlen + 1);
|
||||
if (newp == NULL)
|
||||
return;
|
||||
if (col > 0)
|
||||
@@ -1213,7 +1234,7 @@ del_bytes(
|
||||
newp = oldp; // use same allocated memory
|
||||
else
|
||||
{ // need to allocate a new line
|
||||
newp = alloc((unsigned)(newlen + 1));
|
||||
newp = alloc(newlen + 1);
|
||||
if (newp == NULL)
|
||||
return FAIL;
|
||||
mch_memmove(newp, oldp, (size_t)col);
|
||||
|
||||
1449
src/channel.c
1449
src/channel.c
File diff suppressed because it is too large
Load Diff
@@ -355,10 +355,10 @@ transstr(char_u *s)
|
||||
len += 4; /* illegal byte sequence */
|
||||
}
|
||||
}
|
||||
res = alloc((unsigned)(len + 1));
|
||||
res = alloc(len + 1);
|
||||
}
|
||||
else
|
||||
res = alloc((unsigned)(vim_strsize(s) + 1));
|
||||
res = alloc(vim_strsize(s) + 1);
|
||||
if (res != NULL)
|
||||
{
|
||||
*res = NUL;
|
||||
@@ -1105,15 +1105,16 @@ win_lbr_chartabsize(
|
||||
{
|
||||
if (size + sbrlen + numberwidth > (colnr_T)wp->w_width)
|
||||
{
|
||||
/* calculate effective window width */
|
||||
// calculate effective window width
|
||||
int width = (colnr_T)wp->w_width - sbrlen - numberwidth;
|
||||
int prev_width = col
|
||||
? ((colnr_T)wp->w_width - (sbrlen + col)) : 0;
|
||||
if (width == 0)
|
||||
width = (colnr_T)wp->w_width;
|
||||
|
||||
if (width <= 0)
|
||||
width = (colnr_T)1;
|
||||
added += ((size - prev_width) / width) * vim_strsize(p_sbr);
|
||||
if ((size - prev_width) % width)
|
||||
/* wrapped, add another length of 'sbr' */
|
||||
// wrapped, add another length of 'sbr'
|
||||
added += vim_strsize(p_sbr);
|
||||
}
|
||||
else
|
||||
@@ -1776,25 +1777,30 @@ vim_isblankline(char_u *lbuf)
|
||||
* If "what" contains STR2NR_HEX recognize hex numbers
|
||||
* If "what" contains STR2NR_FORCE always assume bin/oct/hex.
|
||||
* If maxlen > 0, check at a maximum maxlen chars.
|
||||
* If strict is TRUE, check the number strictly. return *len = 0 if fail.
|
||||
*/
|
||||
void
|
||||
vim_str2nr(
|
||||
char_u *start,
|
||||
int *prep, /* return: type of number 0 = decimal, 'x'
|
||||
or 'X' is hex, '0' = octal, 'b' or 'B'
|
||||
is bin */
|
||||
int *len, /* return: detected length of number */
|
||||
int what, /* what numbers to recognize */
|
||||
varnumber_T *nptr, /* return: signed result */
|
||||
uvarnumber_T *unptr, /* return: unsigned result */
|
||||
int maxlen) /* max length of string to check */
|
||||
int *prep, // return: type of number 0 = decimal, 'x'
|
||||
// or 'X' is hex, '0' = octal, 'b' or 'B'
|
||||
// is bin
|
||||
int *len, // return: detected length of number
|
||||
int what, // what numbers to recognize
|
||||
varnumber_T *nptr, // return: signed result
|
||||
uvarnumber_T *unptr, // return: unsigned result
|
||||
int maxlen, // max length of string to check
|
||||
int strict) // check strictly
|
||||
{
|
||||
char_u *ptr = start;
|
||||
int pre = 0; /* default is decimal */
|
||||
int pre = 0; // default is decimal
|
||||
int negative = FALSE;
|
||||
uvarnumber_T un = 0;
|
||||
int n;
|
||||
|
||||
if (len != NULL)
|
||||
*len = 0;
|
||||
|
||||
if (ptr[0] == '-')
|
||||
{
|
||||
negative = TRUE;
|
||||
@@ -1836,9 +1842,7 @@ vim_str2nr(
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Do the string-to-numeric conversion "manually" to avoid sscanf quirks.
|
||||
*/
|
||||
// Do the conversion manually to avoid sscanf() quirks.
|
||||
n = 1;
|
||||
if (pre == 'B' || pre == 'b' || what == STR2NR_BIN + STR2NR_FORCE)
|
||||
{
|
||||
@@ -1907,6 +1911,10 @@ vim_str2nr(
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Check for an alpha-numeric character immediately following, that is
|
||||
// most likely a typo.
|
||||
if (strict && n - 1 != maxlen && ASCII_ISALNUM(*ptr))
|
||||
return;
|
||||
|
||||
if (prep != NULL)
|
||||
*prep = pre;
|
||||
|
||||
@@ -207,6 +207,7 @@
|
||||
#undef HAVE_STRNICMP
|
||||
#undef HAVE_STRPBRK
|
||||
#undef HAVE_STRTOL
|
||||
#undef HAVE_CANBERRA
|
||||
#undef HAVE_ST_BLKSIZE
|
||||
#undef HAVE_SYSCONF
|
||||
#undef HAVE_SYSCTL
|
||||
@@ -216,6 +217,7 @@
|
||||
#undef HAVE_TOWLOWER
|
||||
#undef HAVE_TOWUPPER
|
||||
#undef HAVE_ISWUPPER
|
||||
#undef HAVE_TZSET
|
||||
#undef HAVE_UNSETENV
|
||||
#undef HAVE_USLEEP
|
||||
#undef HAVE_UTIME
|
||||
|
||||
@@ -2702,6 +2702,10 @@ AC_DEFUN([GNOME_INIT],[
|
||||
GNOME_INIT_HOOK([],fail)
|
||||
])
|
||||
|
||||
if test "X$PKG_CONFIG" = "X"; then
|
||||
AC_PATH_TOOL(PKG_CONFIG, pkg-config, no)
|
||||
fi
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Check for GTK2. If it fails, then continue on for Motif as before...
|
||||
@@ -2717,10 +2721,6 @@ if test -z "$SKIP_GTK2"; then
|
||||
AC_MSG_RESULT(gtk test disabled)
|
||||
fi
|
||||
|
||||
if test "X$PKG_CONFIG" = "X"; then
|
||||
AC_PATH_TOOL(PKG_CONFIG, pkg-config, no)
|
||||
fi
|
||||
|
||||
if test "x$PKG_CONFIG" != "xno"; then
|
||||
dnl First try finding version 2.2.0 or later. The 2.0.x series has
|
||||
dnl problems (bold fonts, --remote doesn't work).
|
||||
@@ -2769,10 +2769,6 @@ if test -z "$SKIP_GTK3"; then
|
||||
AC_MSG_RESULT(gtk test disabled)
|
||||
fi
|
||||
|
||||
if test "X$PKG_CONFIG" = "X"; then
|
||||
AC_PATH_TOOL(PKG_CONFIG, pkg-config, no)
|
||||
fi
|
||||
|
||||
if test "x$PKG_CONFIG" != "xno"; then
|
||||
AM_PATH_GTK(3.0.0,
|
||||
[GUI_LIB_LOC="$GTK_LIBDIR"
|
||||
@@ -3746,7 +3742,7 @@ AC_CHECK_FUNCS(fchdir fchown fchmod fsync getcwd getpseudotty \
|
||||
memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
|
||||
getpgid setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
|
||||
sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
|
||||
strnicmp strpbrk strtol tgetent towlower towupper iswupper tzset \
|
||||
usleep utime utimes mblen ftruncate unsetenv posix_openpt)
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
AC_FUNC_FSEEKO
|
||||
@@ -3755,6 +3751,46 @@ dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when
|
||||
dnl appropriate, so that off_t is 64 bits when needed.
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
AC_MSG_CHECKING(--enable-canberra argument)
|
||||
AC_ARG_ENABLE(canberra,
|
||||
[ --disable-canberra Do not use libcanberra.],
|
||||
, [enable_canberra="maybe"])
|
||||
|
||||
if test "$enable_canberra" = "maybe"; then
|
||||
if test "$features" = "big" -o "$features" = "huge"; then
|
||||
AC_MSG_RESULT(Defaulting to yes)
|
||||
enable_canberra="yes"
|
||||
else
|
||||
AC_MSG_RESULT(Defaulting to no)
|
||||
enable_canberra="no"
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT($enable_canberra)
|
||||
fi
|
||||
if test "$enable_canberra" = "yes"; then
|
||||
if test "x$PKG_CONFIG" != "xno"; then
|
||||
canberra_lib=`$PKG_CONFIG --libs libcanberra 2>/dev/null`
|
||||
canberra_cflags=`$PKG_CONFIG --cflags libcanberra 2>/dev/null`
|
||||
fi
|
||||
if test "x$canberra_lib" = "x"; then
|
||||
canberra_lib=-lcanberra
|
||||
canberra_cflags=-D_REENTRANT
|
||||
fi
|
||||
AC_MSG_CHECKING(for libcanberra)
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $canberra_cflags"
|
||||
LIBS="$LIBS $canberra_lib"
|
||||
AC_TRY_LINK([
|
||||
# include <canberra.h>
|
||||
], [
|
||||
ca_context *hello;
|
||||
ca_context_create(&hello);],
|
||||
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_CANBERRA),
|
||||
AC_MSG_RESULT(no); CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS")
|
||||
fi
|
||||
|
||||
|
||||
dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
|
||||
AC_MSG_CHECKING(for st_blksize)
|
||||
AC_TRY_COMPILE(
|
||||
@@ -4302,8 +4338,14 @@ if test "$enable_nls" = "yes"; then
|
||||
AC_MSG_CHECKING([if msgfmt supports --desktop])
|
||||
MSGFMT_DESKTOP=
|
||||
if "$MSGFMT" --help | grep -e '--desktop' >/dev/null; then
|
||||
AC_MSG_RESULT([yes])
|
||||
MSGFMT_DESKTOP="gvim.desktop vim.desktop"
|
||||
if "$MSGFMT" --version | grep '0.19.[[3-7]]$' >/dev/null; then
|
||||
dnl GNU gettext 0.19.7's --desktop is broken. We assume back to
|
||||
dnl 0.19.3 is also broken.
|
||||
AC_MSG_RESULT([broken])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
MSGFMT_DESKTOP="gvim.desktop vim.desktop"
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
@@ -254,7 +254,7 @@ crypt_create(
|
||||
char_u *seed,
|
||||
int seed_len)
|
||||
{
|
||||
cryptstate_T *state = (cryptstate_T *)alloc((int)sizeof(cryptstate_T));
|
||||
cryptstate_T *state = ALLOC_ONE(cryptstate_T);
|
||||
|
||||
if (state == NULL)
|
||||
return state;
|
||||
@@ -407,7 +407,7 @@ crypt_encode_alloc(
|
||||
/* Not buffering, just return EOF. */
|
||||
return (long)len;
|
||||
|
||||
*newptr = alloc((long)len);
|
||||
*newptr = alloc(len);
|
||||
if (*newptr == NULL)
|
||||
return -1;
|
||||
method->encode_fn(state, from, len, *newptr);
|
||||
|
||||
@@ -90,7 +90,7 @@ crypt_zip_init(
|
||||
char_u *p;
|
||||
zip_state_T *zs;
|
||||
|
||||
zs = (zip_state_T *)alloc(sizeof(zip_state_T));
|
||||
zs = ALLOC_ONE(zip_state_T);
|
||||
if (zs == NULL)
|
||||
return FAIL;
|
||||
state->method_state = zs;
|
||||
|
||||
@@ -873,7 +873,7 @@ debuggy_find(
|
||||
// Replace K_SNR in function name with "<SNR>".
|
||||
if (!file && fname[0] == K_SPECIAL)
|
||||
{
|
||||
name = alloc((unsigned)STRLEN(fname) + 3);
|
||||
name = alloc(STRLEN(fname) + 3);
|
||||
if (name == NULL)
|
||||
name = fname;
|
||||
else
|
||||
|
||||
53
src/dict.c
53
src/dict.c
@@ -28,7 +28,7 @@ dict_alloc(void)
|
||||
{
|
||||
dict_T *d;
|
||||
|
||||
d = (dict_T *)alloc(sizeof(dict_T));
|
||||
d = ALLOC_CLEAR_ONE(dict_T);
|
||||
if (d != NULL)
|
||||
{
|
||||
/* Add the dict to the list of dicts for garbage collection. */
|
||||
@@ -54,7 +54,7 @@ dict_alloc(void)
|
||||
dict_alloc_id(alloc_id_T id UNUSED)
|
||||
{
|
||||
#ifdef FEAT_EVAL
|
||||
if (alloc_fail_id == id && alloc_does_fail((long_u)sizeof(list_T)))
|
||||
if (alloc_fail_id == id && alloc_does_fail(sizeof(list_T)))
|
||||
return NULL;
|
||||
#endif
|
||||
return (dict_alloc());
|
||||
@@ -210,7 +210,7 @@ dictitem_alloc(char_u *key)
|
||||
{
|
||||
dictitem_T *di;
|
||||
|
||||
di = (dictitem_T *)alloc((unsigned)(sizeof(dictitem_T) + STRLEN(key)));
|
||||
di = alloc(sizeof(dictitem_T) + STRLEN(key));
|
||||
if (di != NULL)
|
||||
{
|
||||
STRCPY(di->di_key, key);
|
||||
@@ -228,8 +228,7 @@ dictitem_copy(dictitem_T *org)
|
||||
{
|
||||
dictitem_T *di;
|
||||
|
||||
di = (dictitem_T *)alloc((unsigned)(sizeof(dictitem_T)
|
||||
+ STRLEN(org->di_key)));
|
||||
di = alloc(sizeof(dictitem_T) + STRLEN(org->di_key));
|
||||
if (di != NULL)
|
||||
{
|
||||
STRCPY(di->di_key, org->di_key);
|
||||
@@ -448,6 +447,27 @@ dict_add_list(dict_T *d, char *key, list_T *list)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add a callback to dictionary "d".
|
||||
* Returns FAIL when out of memory and when key already exists.
|
||||
*/
|
||||
int
|
||||
dict_add_callback(dict_T *d, char *key, callback_T *cb)
|
||||
{
|
||||
dictitem_T *item;
|
||||
|
||||
item = dictitem_alloc((char_u *)key);
|
||||
if (item == NULL)
|
||||
return FAIL;
|
||||
put_callback(cb, &item->di_tv);
|
||||
if (dict_add(d, item) == FAIL)
|
||||
{
|
||||
dictitem_free(item);
|
||||
return FAIL;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes "iter" for iterating over dictionary items with
|
||||
* dict_iterate_next().
|
||||
@@ -605,6 +625,27 @@ dict_get_number(dict_T *d, char_u *key)
|
||||
return tv_get_number(&di->di_tv);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get a number item from a dictionary.
|
||||
* Returns 0 if the entry doesn't exist.
|
||||
* Give an error if the entry is not a number.
|
||||
*/
|
||||
varnumber_T
|
||||
dict_get_number_check(dict_T *d, char_u *key)
|
||||
{
|
||||
dictitem_T *di;
|
||||
|
||||
di = dict_find(d, key, -1);
|
||||
if (di == NULL)
|
||||
return 0;
|
||||
if (di->di_tv.v_type != VAR_NUMBER)
|
||||
{
|
||||
semsg(_(e_invarg2), tv_get_string(&di->di_tv));
|
||||
return 0;
|
||||
}
|
||||
return tv_get_number(&di->di_tv);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return an allocated string with the string representation of a Dictionary.
|
||||
* May return NULL.
|
||||
@@ -770,7 +811,7 @@ dict_get_tv(char_u **arg, typval_T *rettv, int evaluate)
|
||||
{
|
||||
semsg(_("E723: Missing end of Dictionary '}': %s"), *arg);
|
||||
failret:
|
||||
if (evaluate)
|
||||
if (d != NULL)
|
||||
dict_free(d);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
14
src/diff.c
14
src/diff.c
@@ -537,7 +537,7 @@ diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp)
|
||||
{
|
||||
diff_T *dnew;
|
||||
|
||||
dnew = (diff_T *)alloc((unsigned)sizeof(diff_T));
|
||||
dnew = ALLOC_ONE(diff_T);
|
||||
if (dnew != NULL)
|
||||
{
|
||||
dnew->df_next = dp;
|
||||
@@ -710,7 +710,7 @@ diff_write_buffer(buf_T *buf, diffin_T *din)
|
||||
// xdiff requires one big block of memory with all the text.
|
||||
for (lnum = 1; lnum <= buf->b_ml.ml_line_count; ++lnum)
|
||||
len += (long)STRLEN(ml_get_buf(buf, lnum, FALSE)) + 1;
|
||||
ptr = lalloc(len, TRUE);
|
||||
ptr = alloc(len);
|
||||
if (ptr == NULL)
|
||||
{
|
||||
// Allocating memory failed. This can happen, because we try to read
|
||||
@@ -1123,7 +1123,7 @@ diff_file(diffio_T *dio)
|
||||
{
|
||||
len = STRLEN(tmp_orig) + STRLEN(tmp_new)
|
||||
+ STRLEN(tmp_diff) + STRLEN(p_srr) + 27;
|
||||
cmd = alloc((unsigned)len);
|
||||
cmd = alloc(len);
|
||||
if (cmd == NULL)
|
||||
return FAIL;
|
||||
|
||||
@@ -1218,7 +1218,7 @@ ex_diffpatch(exarg_T *eap)
|
||||
if (esc_name == NULL)
|
||||
goto theend;
|
||||
buflen = STRLEN(tmp_orig) + STRLEN(esc_name) + STRLEN(tmp_new) + 16;
|
||||
buf = alloc((unsigned)buflen);
|
||||
buf = alloc(buflen);
|
||||
if (buf == NULL)
|
||||
goto theend;
|
||||
|
||||
@@ -1447,18 +1447,14 @@ diff_win_options(
|
||||
wp->w_p_wrap_save = wp->w_p_wrap;
|
||||
wp->w_p_wrap = FALSE;
|
||||
# ifdef FEAT_FOLDING
|
||||
curwin = wp;
|
||||
curbuf = curwin->w_buffer;
|
||||
if (!wp->w_p_diff)
|
||||
{
|
||||
if (wp->w_p_diff_saved)
|
||||
free_string_option(wp->w_p_fdm_save);
|
||||
wp->w_p_fdm_save = vim_strsave(wp->w_p_fdm);
|
||||
}
|
||||
set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff",
|
||||
set_string_option_direct_in_win(wp, (char_u *)"fdm", -1, (char_u *)"diff",
|
||||
OPT_LOCAL|OPT_FREE, 0);
|
||||
curwin = old_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
if (!wp->w_p_diff)
|
||||
{
|
||||
wp->w_p_fdc_save = wp->w_p_fdc;
|
||||
|
||||
@@ -2317,7 +2317,7 @@ keymap_init(void)
|
||||
/* Source the keymap file. It will contain a ":loadkeymap" command
|
||||
* which will call ex_loadkeymap() below. */
|
||||
buflen = STRLEN(curbuf->b_p_keymap) + STRLEN(p_enc) + 14;
|
||||
buf = alloc((unsigned)buflen);
|
||||
buf = alloc(buflen);
|
||||
if (buf == NULL)
|
||||
return e_outofmem;
|
||||
|
||||
@@ -2378,7 +2378,7 @@ ex_loadkeymap(exarg_T *eap)
|
||||
*/
|
||||
for (;;)
|
||||
{
|
||||
line = eap->getline(0, eap->cookie, 0);
|
||||
line = eap->getline(0, eap->cookie, 0, TRUE);
|
||||
if (line == NULL)
|
||||
break;
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ findoldfile(char **destination)
|
||||
|| strchr(cp, '/') != NULL)
|
||||
return;
|
||||
|
||||
tmpname = alloc((int)strlen(cp) + 1);
|
||||
tmpname = alloc(strlen(cp) + 1);
|
||||
strcpy(tmpname, cp);
|
||||
tmpname[strlen(tmpname) - 1] = 'x'; /* .exe -> .exx */
|
||||
|
||||
@@ -962,7 +962,7 @@ alloc_text(int idx, char *fmt, char *arg)
|
||||
if (choices[idx].text != NULL)
|
||||
free(choices[idx].text);
|
||||
|
||||
choices[idx].text = alloc((int)(strlen(fmt) + strlen(arg)) - 1);
|
||||
choices[idx].text = alloc(strlen(fmt) + strlen(arg) - 1);
|
||||
sprintf(choices[idx].text, fmt, arg);
|
||||
}
|
||||
|
||||
@@ -1040,7 +1040,7 @@ change_bat_choice(int idx)
|
||||
s = p + strlen(p);
|
||||
if (names != NULL)
|
||||
{
|
||||
names[count] = alloc((int)(s - p) + 1);
|
||||
names[count] = alloc(s - p + 1);
|
||||
strncpy(names[count], p, s - p);
|
||||
names[count][s - p] = NUL;
|
||||
}
|
||||
@@ -1051,7 +1051,7 @@ change_bat_choice(int idx)
|
||||
}
|
||||
if (names != NULL)
|
||||
break;
|
||||
names = alloc((int)(count + 1) * sizeof(char *));
|
||||
names = alloc((count + 1) * sizeof(char *));
|
||||
}
|
||||
names[0] = alloc(50);
|
||||
sprintf(names[0], "Select directory to create %s in:", name);
|
||||
|
||||
20
src/edit.c
20
src/edit.c
@@ -1456,8 +1456,7 @@ ins_need_undo_get(void)
|
||||
* inserting sequences of characters (e.g., for CTRL-R).
|
||||
*/
|
||||
void
|
||||
ins_redraw(
|
||||
int ready UNUSED) /* not busy with something */
|
||||
ins_redraw(int ready) // not busy with something
|
||||
{
|
||||
#ifdef FEAT_CONCEAL
|
||||
linenr_T conceal_old_cursor_line = 0;
|
||||
@@ -1468,10 +1467,12 @@ ins_redraw(
|
||||
if (char_avail())
|
||||
return;
|
||||
|
||||
#if defined(FEAT_CONCEAL)
|
||||
/* Trigger CursorMoved if the cursor moved. Not when the popup menu is
|
||||
* visible, the command might delete it. */
|
||||
if (ready && (has_cursormovedI()
|
||||
# ifdef FEAT_TEXT_PROP
|
||||
|| popup_visible
|
||||
# endif
|
||||
# if defined(FEAT_CONCEAL)
|
||||
|| curwin->w_p_cole > 0
|
||||
# endif
|
||||
@@ -1497,6 +1498,10 @@ ins_redraw(
|
||||
update_curswant();
|
||||
ins_apply_autocmds(EVENT_CURSORMOVEDI);
|
||||
}
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
if (popup_visible)
|
||||
popup_check_cursor_pos();
|
||||
#endif
|
||||
# ifdef FEAT_CONCEAL
|
||||
if (curwin->w_p_cole > 0)
|
||||
{
|
||||
@@ -1507,7 +1512,6 @@ ins_redraw(
|
||||
# endif
|
||||
last_cursormoved = curwin->w_cursor;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Trigger TextChangedI if b_changedtick differs. */
|
||||
if (ready && has_textchangedI()
|
||||
@@ -1943,7 +1947,7 @@ change_indent(
|
||||
{
|
||||
curwin->w_cursor.col = (colnr_T)new_cursor_col;
|
||||
i = (int)curwin->w_virtcol - vcol;
|
||||
ptr = alloc((unsigned)(i + 1));
|
||||
ptr = alloc(i + 1);
|
||||
if (ptr != NULL)
|
||||
{
|
||||
new_cursor_col += i;
|
||||
@@ -3859,7 +3863,7 @@ replace_push(
|
||||
if (replace_stack_len <= replace_stack_nr)
|
||||
{
|
||||
replace_stack_len += 50;
|
||||
p = lalloc(sizeof(char_u) * replace_stack_len, TRUE);
|
||||
p = ALLOC_MULT(char_u, replace_stack_len);
|
||||
if (p == NULL) /* out of memory */
|
||||
{
|
||||
replace_stack_len -= 50;
|
||||
@@ -4104,7 +4108,7 @@ replace_do_bs(int limit_col)
|
||||
|
||||
--text_prop_frozen;
|
||||
adjust_prop_columns(curwin->w_cursor.lnum, curwin->w_cursor.col,
|
||||
(int)(len_now - len_before));
|
||||
(int)(len_now - len_before), 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -5263,7 +5267,7 @@ ins_mousescroll(int dir)
|
||||
col = mouse_col;
|
||||
|
||||
/* find the window at the pointer coordinates */
|
||||
wp = mouse_find_win(&row, &col);
|
||||
wp = mouse_find_win(&row, &col, FAIL_POPUP);
|
||||
if (wp == NULL)
|
||||
return;
|
||||
curwin = wp;
|
||||
|
||||
426
src/eval.c
426
src/eval.c
@@ -28,6 +28,7 @@ static char *e_missbrac = N_("E111: Missing ']'");
|
||||
static char *e_dictrange = N_("E719: Cannot use [:] with a Dictionary");
|
||||
static char *e_letwrong = N_("E734: Wrong variable type for %s=");
|
||||
static char *e_illvar = N_("E461: Illegal variable name: %s");
|
||||
static char *e_cannot_mod = N_("E995: Cannot modify existing variable");
|
||||
#ifdef FEAT_FLOAT
|
||||
static char *e_float_as_string = N_("E806: using Float as a String");
|
||||
#endif
|
||||
@@ -171,6 +172,9 @@ static struct vimvar
|
||||
{VV_NAME("completed_item", VAR_DICT), VV_RO},
|
||||
{VV_NAME("option_new", VAR_STRING), VV_RO},
|
||||
{VV_NAME("option_old", VAR_STRING), VV_RO},
|
||||
{VV_NAME("option_oldlocal", VAR_STRING), VV_RO},
|
||||
{VV_NAME("option_oldglobal", VAR_STRING), VV_RO},
|
||||
{VV_NAME("option_command", VAR_STRING), VV_RO},
|
||||
{VV_NAME("option_type", VAR_STRING), VV_RO},
|
||||
{VV_NAME("errors", VAR_LIST), 0},
|
||||
{VV_NAME("false", VAR_SPECIAL), VV_RO},
|
||||
@@ -193,9 +197,10 @@ static struct vimvar
|
||||
{VV_NAME("termrfgresp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termrbgresp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termu7resp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termstyleresp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termblinkresp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("event", VAR_DICT), VV_RO},
|
||||
{VV_NAME("termstyleresp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termblinkresp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("event", VAR_DICT), VV_RO},
|
||||
{VV_NAME("versionlong", VAR_NUMBER), VV_RO},
|
||||
};
|
||||
|
||||
/* shorthand */
|
||||
@@ -211,7 +216,8 @@ static struct vimvar
|
||||
static dictitem_T vimvars_var; /* variable used for v: */
|
||||
#define vimvarht vimvardict.dv_hashtab
|
||||
|
||||
static int ex_let_vars(char_u *arg, typval_T *tv, int copy, int semicolon, int var_count, char_u *nextchars);
|
||||
static void ex_let_const(exarg_T *eap, int is_const);
|
||||
static int ex_let_vars(char_u *arg, typval_T *tv, int copy, int semicolon, int var_count, int is_const, char_u *nextchars);
|
||||
static char_u *skip_var_list(char_u *arg, int *var_count, int *semicolon);
|
||||
static char_u *skip_var_one(char_u *arg);
|
||||
static void list_glob_vars(int *first);
|
||||
@@ -221,8 +227,8 @@ static void list_tab_vars(int *first);
|
||||
static void list_vim_vars(int *first);
|
||||
static void list_script_vars(int *first);
|
||||
static char_u *list_arg_vars(exarg_T *eap, char_u *arg, int *first);
|
||||
static char_u *ex_let_one(char_u *arg, typval_T *tv, int copy, char_u *endchars, char_u *op);
|
||||
static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, int copy, char_u *op);
|
||||
static char_u *ex_let_one(char_u *arg, typval_T *tv, int copy, int is_const, char_u *endchars, char_u *op);
|
||||
static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, int copy, int is_const, char_u *op);
|
||||
static int tv_op(typval_T *tv1, typval_T *tv2, char_u *op);
|
||||
static void ex_unletlock(exarg_T *eap, char_u *argstart, int deep);
|
||||
static int do_unlet_var(lval_T *lp, char_u *name_end, int forceit);
|
||||
@@ -247,6 +253,7 @@ static typval_T *alloc_string_tv(char_u *string);
|
||||
static void delete_var(hashtab_T *ht, hashitem_T *hi);
|
||||
static void list_one_var(dictitem_T *v, char *prefix, int *first);
|
||||
static void list_one_var_a(char *prefix, char_u *name, int type, char_u *string, int *first);
|
||||
static void set_var_const(char_u *name, typval_T *tv, int copy, int is_const);
|
||||
static int tv_check_lock(typval_T *tv, char_u *name, int use_gettext);
|
||||
static char_u *find_option_end(char_u **arg, int *opt_flags);
|
||||
|
||||
@@ -333,7 +340,7 @@ eval_init(void)
|
||||
for (i = 0; i < VV_LEN; ++i)
|
||||
{
|
||||
p = &vimvars[i];
|
||||
if (STRLEN(p->vv_name) > 16)
|
||||
if (STRLEN(p->vv_name) > DICTITEM16_KEY_LEN)
|
||||
{
|
||||
iemsg("INTERNAL: name too long, increase size of dictitem16_T");
|
||||
getout(1);
|
||||
@@ -354,6 +361,7 @@ eval_init(void)
|
||||
hash_add(&compat_hashtab, p->vv_di.di_key);
|
||||
}
|
||||
vimvars[VV_VERSION].vv_nr = VIM_VERSION_100;
|
||||
vimvars[VV_VERSIONLONG].vv_nr = VIM_VERSION_100 * 10000 + highest_patch();
|
||||
|
||||
set_vim_var_nr(VV_SEARCHFORWARD, 1L);
|
||||
set_vim_var_nr(VV_HLSEARCH, 1L);
|
||||
@@ -430,10 +438,10 @@ eval_clear(void)
|
||||
vim_free(SCRIPT_SV(i));
|
||||
ga_clear(&ga_scripts);
|
||||
|
||||
/* unreferenced lists and dicts */
|
||||
// unreferenced lists and dicts
|
||||
(void)garbage_collect(FALSE);
|
||||
|
||||
/* functions */
|
||||
// functions not garbage collected
|
||||
free_all_functions();
|
||||
}
|
||||
#endif
|
||||
@@ -491,7 +499,7 @@ var_redir_start(char_u *name, int append)
|
||||
if (redir_varname == NULL)
|
||||
return FAIL;
|
||||
|
||||
redir_lval = (lval_T *)alloc_clear((unsigned)sizeof(lval_T));
|
||||
redir_lval = ALLOC_CLEAR_ONE(lval_T);
|
||||
if (redir_lval == NULL)
|
||||
{
|
||||
var_redir_stop();
|
||||
@@ -524,9 +532,9 @@ var_redir_start(char_u *name, int append)
|
||||
tv.v_type = VAR_STRING;
|
||||
tv.vval.v_string = (char_u *)"";
|
||||
if (append)
|
||||
set_var_lval(redir_lval, redir_endp, &tv, TRUE, (char_u *)".");
|
||||
set_var_lval(redir_lval, redir_endp, &tv, TRUE, FALSE, (char_u *)".");
|
||||
else
|
||||
set_var_lval(redir_lval, redir_endp, &tv, TRUE, (char_u *)"=");
|
||||
set_var_lval(redir_lval, redir_endp, &tv, TRUE, FALSE, (char_u *)"=");
|
||||
clear_lval(redir_lval);
|
||||
err = did_emsg;
|
||||
did_emsg |= save_emsg;
|
||||
@@ -599,7 +607,8 @@ var_redir_stop(void)
|
||||
redir_endp = get_lval(redir_varname, NULL, redir_lval,
|
||||
FALSE, FALSE, 0, FNE_CHECK_START);
|
||||
if (redir_endp != NULL && redir_lval->ll_name != NULL)
|
||||
set_var_lval(redir_lval, redir_endp, &tv, FALSE, (char_u *)".");
|
||||
set_var_lval(redir_lval, redir_endp, &tv, FALSE, FALSE,
|
||||
(char_u *)".");
|
||||
clear_lval(redir_lval);
|
||||
}
|
||||
|
||||
@@ -1063,7 +1072,7 @@ eval_expr(char_u *arg, char_u **nextcmd)
|
||||
{
|
||||
typval_T *tv;
|
||||
|
||||
tv = (typval_T *)alloc(sizeof(typval_T));
|
||||
tv = ALLOC_ONE(typval_T);
|
||||
if (tv != NULL && eval0(arg, tv, nextcmd, TRUE) == FAIL)
|
||||
VIM_CLEAR(tv);
|
||||
|
||||
@@ -1224,6 +1233,125 @@ eval_foldexpr(char_u *arg, int *cp)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Get a list of lines from a HERE document. The here document is a list of
|
||||
* lines surrounded by a marker.
|
||||
* cmd << {marker}
|
||||
* {line1}
|
||||
* {line2}
|
||||
* ....
|
||||
* {marker}
|
||||
*
|
||||
* The {marker} is a string. If the optional 'trim' word is supplied before the
|
||||
* marker, then the leading indentation before the lines (matching the
|
||||
* indentation in the 'cmd' line) is stripped.
|
||||
* Returns a List with {lines} or NULL.
|
||||
*/
|
||||
static list_T *
|
||||
heredoc_get(exarg_T *eap, char_u *cmd)
|
||||
{
|
||||
char_u *theline;
|
||||
char_u *marker;
|
||||
list_T *l;
|
||||
char_u *p;
|
||||
int marker_indent_len = 0;
|
||||
int text_indent_len = 0;
|
||||
char_u *text_indent = NULL;
|
||||
|
||||
if (eap->getline == NULL)
|
||||
{
|
||||
emsg(_("E991: cannot use =<< here"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Check for the optional 'trim' word before the marker
|
||||
cmd = skipwhite(cmd);
|
||||
if (STRNCMP(cmd, "trim", 4) == 0 && (cmd[4] == NUL || VIM_ISWHITE(cmd[4])))
|
||||
{
|
||||
cmd = skipwhite(cmd + 4);
|
||||
|
||||
// Trim the indentation from all the lines in the here document.
|
||||
// The amount of indentation trimmed is the same as the indentation of
|
||||
// the first line after the :let command line. To find the end marker
|
||||
// the indent of the :let command line is trimmed.
|
||||
p = *eap->cmdlinep;
|
||||
while (VIM_ISWHITE(*p))
|
||||
{
|
||||
p++;
|
||||
marker_indent_len++;
|
||||
}
|
||||
text_indent_len = -1;
|
||||
}
|
||||
|
||||
// The marker is the next word. Default marker is "."
|
||||
if (*cmd != NUL && *cmd != '"')
|
||||
{
|
||||
marker = skipwhite(cmd);
|
||||
p = skiptowhite(marker);
|
||||
if (*skipwhite(p) != NUL && *skipwhite(p) != '"')
|
||||
{
|
||||
emsg(_(e_trailing));
|
||||
return NULL;
|
||||
}
|
||||
*p = NUL;
|
||||
}
|
||||
else
|
||||
marker = (char_u *)".";
|
||||
|
||||
l = list_alloc();
|
||||
if (l == NULL)
|
||||
return NULL;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int mi = 0;
|
||||
int ti = 0;
|
||||
|
||||
theline = eap->getline(NUL, eap->cookie, 0, FALSE);
|
||||
if (theline == NULL)
|
||||
{
|
||||
semsg(_("E990: Missing end marker '%s'"), marker);
|
||||
break;
|
||||
}
|
||||
|
||||
// with "trim": skip the indent matching the :let line to find the
|
||||
// marker
|
||||
if (marker_indent_len > 0
|
||||
&& STRNCMP(theline, *eap->cmdlinep, marker_indent_len) == 0)
|
||||
mi = marker_indent_len;
|
||||
if (STRCMP(marker, theline + mi) == 0)
|
||||
{
|
||||
vim_free(theline);
|
||||
break;
|
||||
}
|
||||
|
||||
if (text_indent_len == -1 && *theline != NUL)
|
||||
{
|
||||
// set the text indent from the first line.
|
||||
p = theline;
|
||||
text_indent_len = 0;
|
||||
while (VIM_ISWHITE(*p))
|
||||
{
|
||||
p++;
|
||||
text_indent_len++;
|
||||
}
|
||||
text_indent = vim_strnsave(theline, text_indent_len);
|
||||
}
|
||||
// with "trim": skip the indent matching the first line
|
||||
if (text_indent != NULL)
|
||||
for (ti = 0; ti < text_indent_len; ++ti)
|
||||
if (theline[ti] != text_indent[ti])
|
||||
break;
|
||||
|
||||
if (list_append_string(l, theline + ti, -1) == FAIL)
|
||||
break;
|
||||
vim_free(theline);
|
||||
}
|
||||
vim_free(text_indent);
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
/*
|
||||
* ":let" list all variable values
|
||||
* ":let var1 var2" list variable values
|
||||
@@ -1239,6 +1367,24 @@ eval_foldexpr(char_u *arg, int *cp)
|
||||
*/
|
||||
void
|
||||
ex_let(exarg_T *eap)
|
||||
{
|
||||
ex_let_const(eap, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* ":const" list all variable values
|
||||
* ":const var1 var2" list variable values
|
||||
* ":const var = expr" assignment command.
|
||||
* ":const [var1, var2] = expr" unpack list.
|
||||
*/
|
||||
void
|
||||
ex_const(exarg_T *eap)
|
||||
{
|
||||
ex_let_const(eap, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
ex_let_const(exarg_T *eap, int is_const)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *expr = NULL;
|
||||
@@ -1286,6 +1432,22 @@ ex_let(exarg_T *eap)
|
||||
}
|
||||
eap->nextcmd = check_nextcmd(arg);
|
||||
}
|
||||
else if (expr[0] == '=' && expr[1] == '<' && expr[2] == '<')
|
||||
{
|
||||
list_T *l;
|
||||
|
||||
// HERE document
|
||||
l = heredoc_get(eap, expr + 3);
|
||||
if (l != NULL)
|
||||
{
|
||||
rettv_list_set(&rettv, l);
|
||||
op[0] = '=';
|
||||
op[1] = NUL;
|
||||
(void)ex_let_vars(eap->arg, &rettv, FALSE, semicolon, var_count,
|
||||
is_const, op);
|
||||
clear_tv(&rettv);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
op[0] = '=';
|
||||
@@ -1315,7 +1477,7 @@ ex_let(exarg_T *eap)
|
||||
else if (i != FAIL)
|
||||
{
|
||||
(void)ex_let_vars(eap->arg, &rettv, FALSE, semicolon, var_count,
|
||||
op);
|
||||
is_const, op);
|
||||
clear_tv(&rettv);
|
||||
}
|
||||
}
|
||||
@@ -1333,9 +1495,10 @@ ex_let(exarg_T *eap)
|
||||
ex_let_vars(
|
||||
char_u *arg_start,
|
||||
typval_T *tv,
|
||||
int copy, /* copy values from "tv", don't move */
|
||||
int semicolon, /* from skip_var_list() */
|
||||
int var_count, /* from skip_var_list() */
|
||||
int copy, // copy values from "tv", don't move
|
||||
int semicolon, // from skip_var_list()
|
||||
int var_count, // from skip_var_list()
|
||||
int is_const, // lock variables for const
|
||||
char_u *nextchars)
|
||||
{
|
||||
char_u *arg = arg_start;
|
||||
@@ -1349,7 +1512,7 @@ ex_let_vars(
|
||||
/*
|
||||
* ":let var = expr" or ":for var in list"
|
||||
*/
|
||||
if (ex_let_one(arg, tv, copy, nextchars, nextchars) == NULL)
|
||||
if (ex_let_one(arg, tv, copy, is_const, nextchars, nextchars) == NULL)
|
||||
return FAIL;
|
||||
return OK;
|
||||
}
|
||||
@@ -1379,7 +1542,8 @@ ex_let_vars(
|
||||
while (*arg != ']')
|
||||
{
|
||||
arg = skipwhite(arg + 1);
|
||||
arg = ex_let_one(arg, &item->li_tv, TRUE, (char_u *)",;]", nextchars);
|
||||
arg = ex_let_one(arg, &item->li_tv, TRUE, is_const,
|
||||
(char_u *)",;]", nextchars);
|
||||
item = item->li_next;
|
||||
if (arg == NULL)
|
||||
return FAIL;
|
||||
@@ -1403,8 +1567,8 @@ ex_let_vars(
|
||||
ltv.vval.v_list = l;
|
||||
l->lv_refcount = 1;
|
||||
|
||||
arg = ex_let_one(skipwhite(arg + 1), <v, FALSE,
|
||||
(char_u *)"]", nextchars);
|
||||
arg = ex_let_one(skipwhite(arg + 1), <v, FALSE, is_const,
|
||||
(char_u *)"]", nextchars);
|
||||
clear_tv(<v);
|
||||
if (arg == NULL)
|
||||
return FAIL;
|
||||
@@ -1691,11 +1855,12 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first)
|
||||
*/
|
||||
static char_u *
|
||||
ex_let_one(
|
||||
char_u *arg, /* points to variable name */
|
||||
typval_T *tv, /* value to assign to variable */
|
||||
int copy, /* copy value from "tv" */
|
||||
char_u *endchars, /* valid chars after variable name or NULL */
|
||||
char_u *op) /* "+", "-", "." or NULL*/
|
||||
char_u *arg, // points to variable name
|
||||
typval_T *tv, // value to assign to variable
|
||||
int copy, // copy value from "tv"
|
||||
int is_const, // lock variable for const
|
||||
char_u *endchars, // valid chars after variable name or NULL
|
||||
char_u *op) // "+", "-", "." or NULL
|
||||
{
|
||||
int c1;
|
||||
char_u *name;
|
||||
@@ -1710,6 +1875,11 @@ ex_let_one(
|
||||
*/
|
||||
if (*arg == '$')
|
||||
{
|
||||
if (is_const)
|
||||
{
|
||||
emsg(_("E996: Cannot lock an environment variable"));
|
||||
return NULL;
|
||||
}
|
||||
/* Find the end of the name. */
|
||||
++arg;
|
||||
name = arg;
|
||||
@@ -1765,6 +1935,11 @@ ex_let_one(
|
||||
*/
|
||||
else if (*arg == '&')
|
||||
{
|
||||
if (is_const)
|
||||
{
|
||||
emsg(_("E996: Cannot lock an option"));
|
||||
return NULL;
|
||||
}
|
||||
/* Find the end of the name. */
|
||||
p = find_option_end(&arg, &opt_flags);
|
||||
if (p == NULL || (endchars != NULL
|
||||
@@ -1829,6 +2004,11 @@ ex_let_one(
|
||||
*/
|
||||
else if (*arg == '@')
|
||||
{
|
||||
if (is_const)
|
||||
{
|
||||
emsg(_("E996: Cannot lock a register"));
|
||||
return NULL;
|
||||
}
|
||||
++arg;
|
||||
if (op != NULL && vim_strchr((char_u *)"+-*/%", *op) != NULL)
|
||||
semsg(_(e_letwrong), op);
|
||||
@@ -1874,7 +2054,7 @@ ex_let_one(
|
||||
emsg(_(e_letunexp));
|
||||
else
|
||||
{
|
||||
set_var_lval(&lv, p, tv, copy, op);
|
||||
set_var_lval(&lv, p, tv, copy, is_const, op);
|
||||
arg_end = p;
|
||||
}
|
||||
}
|
||||
@@ -2316,6 +2496,7 @@ set_var_lval(
|
||||
char_u *endp,
|
||||
typval_T *rettv,
|
||||
int copy,
|
||||
int is_const, // Disallow to modify existing variable for :const
|
||||
char_u *op)
|
||||
{
|
||||
int cc;
|
||||
@@ -2381,6 +2562,13 @@ set_var_lval(
|
||||
{
|
||||
typval_T tv;
|
||||
|
||||
if (is_const)
|
||||
{
|
||||
emsg(_(e_cannot_mod));
|
||||
*endp = cc;
|
||||
return;
|
||||
}
|
||||
|
||||
// handle +=, -=, *=, /=, %= and .=
|
||||
di = NULL;
|
||||
if (get_var_tv(lp->ll_name, (int)STRLEN(lp->ll_name),
|
||||
@@ -2395,7 +2583,7 @@ set_var_lval(
|
||||
}
|
||||
}
|
||||
else
|
||||
set_var(lp->ll_name, rettv, copy);
|
||||
set_var_const(lp->ll_name, rettv, copy, is_const);
|
||||
*endp = cc;
|
||||
}
|
||||
else if (var_check_lock(lp->ll_newkey == NULL
|
||||
@@ -2407,6 +2595,12 @@ set_var_lval(
|
||||
listitem_T *ll_li = lp->ll_li;
|
||||
int ll_n1 = lp->ll_n1;
|
||||
|
||||
if (is_const)
|
||||
{
|
||||
emsg(_("E996: Cannot lock a range"));
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check whether any of the list items is locked
|
||||
*/
|
||||
@@ -2460,6 +2654,11 @@ set_var_lval(
|
||||
/*
|
||||
* Assign to a List or Dictionary item.
|
||||
*/
|
||||
if (is_const)
|
||||
{
|
||||
emsg(_("E996: Cannot lock a list or dict"));
|
||||
return;
|
||||
}
|
||||
if (lp->ll_newkey != NULL)
|
||||
{
|
||||
if (op != NULL && *op != '=')
|
||||
@@ -2657,7 +2856,7 @@ eval_for_line(
|
||||
|
||||
*errp = TRUE; /* default: there is an error */
|
||||
|
||||
fi = (forinfo_T *)alloc_clear(sizeof(forinfo_T));
|
||||
fi = ALLOC_CLEAR_ONE(forinfo_T);
|
||||
if (fi == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -2746,8 +2945,8 @@ next_for_item(void *fi_void, char_u *arg)
|
||||
tv.v_lock = VAR_FIXED;
|
||||
tv.vval.v_number = blob_get(fi->fi_blob, fi->fi_bi);
|
||||
++fi->fi_bi;
|
||||
return ex_let_vars(arg, &tv, TRUE,
|
||||
fi->fi_semicolon, fi->fi_varcount, NULL) == OK;
|
||||
return ex_let_vars(arg, &tv, TRUE, fi->fi_semicolon,
|
||||
fi->fi_varcount, FALSE, NULL) == OK;
|
||||
}
|
||||
|
||||
item = fi->fi_lw.lw_item;
|
||||
@@ -2756,8 +2955,8 @@ next_for_item(void *fi_void, char_u *arg)
|
||||
else
|
||||
{
|
||||
fi->fi_lw.lw_item = item->li_next;
|
||||
result = (ex_let_vars(arg, &item->li_tv, TRUE,
|
||||
fi->fi_semicolon, fi->fi_varcount, NULL) == OK);
|
||||
result = (ex_let_vars(arg, &item->li_tv, TRUE, fi->fi_semicolon,
|
||||
fi->fi_varcount, FALSE, NULL) == OK);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -4341,7 +4540,13 @@ eval7(
|
||||
else
|
||||
{
|
||||
// decimal, hex or octal number
|
||||
vim_str2nr(*arg, NULL, &len, STR2NR_ALL, &n, NULL, 0);
|
||||
vim_str2nr(*arg, NULL, &len, STR2NR_ALL, &n, NULL, 0, TRUE);
|
||||
if (len == 0)
|
||||
{
|
||||
semsg(_(e_invexpr2), *arg);
|
||||
ret = FAIL;
|
||||
break;
|
||||
}
|
||||
*arg += len;
|
||||
if (evaluate)
|
||||
{
|
||||
@@ -4474,7 +4679,7 @@ eval7(
|
||||
/* Stop the expression evaluation when immediately
|
||||
* aborting on error, or when an interrupt occurred or
|
||||
* an exception was thrown but not caught. */
|
||||
if (aborting())
|
||||
if (evaluate && aborting())
|
||||
{
|
||||
if (ret == OK)
|
||||
clear_tv(rettv);
|
||||
@@ -5033,7 +5238,7 @@ get_string_tv(char_u **arg, typval_T *rettv, int evaluate)
|
||||
* Copy the string into allocated memory, handling backslashed
|
||||
* characters.
|
||||
*/
|
||||
name = alloc((unsigned)(p - *arg + extra));
|
||||
name = alloc(p - *arg + extra);
|
||||
if (name == NULL)
|
||||
return FAIL;
|
||||
rettv->v_type = VAR_STRING;
|
||||
@@ -5167,7 +5372,7 @@ get_lit_string_tv(char_u **arg, typval_T *rettv, int evaluate)
|
||||
/*
|
||||
* Copy the string into allocated memory, handling '' to ' reduction.
|
||||
*/
|
||||
str = alloc((unsigned)((p - *arg) - reduce));
|
||||
str = alloc((p - *arg) - reduce);
|
||||
if (str == NULL)
|
||||
return FAIL;
|
||||
rettv->v_type = VAR_STRING;
|
||||
@@ -5467,6 +5672,15 @@ garbage_collect(int testing)
|
||||
if (aucmd_win != NULL)
|
||||
abort = abort || set_ref_in_item(&aucmd_win->w_winvar.di_tv, copyID,
|
||||
NULL, NULL);
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
|
||||
abort = abort || set_ref_in_item(&wp->w_winvar.di_tv, copyID,
|
||||
NULL, NULL);
|
||||
FOR_ALL_TABPAGES(tp)
|
||||
for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next)
|
||||
abort = abort || set_ref_in_item(&wp->w_winvar.di_tv, copyID,
|
||||
NULL, NULL);
|
||||
#endif
|
||||
|
||||
/* tabpage-local variables */
|
||||
FOR_ALL_TABPAGES(tp)
|
||||
@@ -5487,6 +5701,9 @@ garbage_collect(int testing)
|
||||
/* v: vars */
|
||||
abort = abort || set_ref_in_ht(&vimvarht, copyID, NULL);
|
||||
|
||||
// callbacks in buffers
|
||||
abort = abort || set_ref_in_buffers(copyID);
|
||||
|
||||
#ifdef FEAT_LUA
|
||||
abort = abort || set_ref_in_lua(copyID);
|
||||
#endif
|
||||
@@ -5519,6 +5736,10 @@ garbage_collect(int testing)
|
||||
abort = abort || set_ref_in_term(copyID);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
abort = abort || set_ref_in_popups(copyID);
|
||||
#endif
|
||||
|
||||
if (!abort)
|
||||
{
|
||||
/*
|
||||
@@ -5642,6 +5863,36 @@ set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack)
|
||||
return abort;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark a dict and its items with "copyID".
|
||||
* Returns TRUE if setting references failed somehow.
|
||||
*/
|
||||
int
|
||||
set_ref_in_dict(dict_T *d, int copyID)
|
||||
{
|
||||
if (d != NULL && d->dv_copyID != copyID)
|
||||
{
|
||||
d->dv_copyID = copyID;
|
||||
return set_ref_in_ht(&d->dv_hashtab, copyID, NULL);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark a list and its items with "copyID".
|
||||
* Returns TRUE if setting references failed somehow.
|
||||
*/
|
||||
int
|
||||
set_ref_in_list(list_T *ll, int copyID)
|
||||
{
|
||||
if (ll != NULL && ll->lv_copyID != copyID)
|
||||
{
|
||||
ll->lv_copyID = copyID;
|
||||
return set_ref_in_list_items(ll, copyID, NULL);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark all lists and dicts referenced through list "l" with "copyID".
|
||||
* "ht_stack" is used to add hashtabs to be marked. Can be NULL.
|
||||
@@ -5649,7 +5900,7 @@ set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack)
|
||||
* Returns TRUE if setting references failed somehow.
|
||||
*/
|
||||
int
|
||||
set_ref_in_list(list_T *l, int copyID, ht_stack_T **ht_stack)
|
||||
set_ref_in_list_items(list_T *l, int copyID, ht_stack_T **ht_stack)
|
||||
{
|
||||
listitem_T *li;
|
||||
int abort = FALSE;
|
||||
@@ -5732,7 +5983,7 @@ set_ref_in_item(
|
||||
ll->lv_copyID = copyID;
|
||||
if (list_stack == NULL)
|
||||
{
|
||||
abort = set_ref_in_list(ll, copyID, ht_stack);
|
||||
abort = set_ref_in_list_items(ll, copyID, ht_stack);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5793,10 +6044,10 @@ set_ref_in_item(
|
||||
dtv.vval.v_channel = job->jv_channel;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
if (job->jv_exit_partial != NULL)
|
||||
if (job->jv_exit_cb.cb_partial != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_PARTIAL;
|
||||
dtv.vval.v_partial = job->jv_exit_partial;
|
||||
dtv.vval.v_partial = job->jv_exit_cb.cb_partial;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
}
|
||||
@@ -5819,29 +6070,30 @@ set_ref_in_item(
|
||||
set_ref_in_item(jq->jq_value, copyID, ht_stack, list_stack);
|
||||
for (cq = ch->ch_part[part].ch_cb_head.cq_next; cq != NULL;
|
||||
cq = cq->cq_next)
|
||||
if (cq->cq_partial != NULL)
|
||||
if (cq->cq_callback.cb_partial != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_PARTIAL;
|
||||
dtv.vval.v_partial = cq->cq_partial;
|
||||
dtv.vval.v_partial = cq->cq_callback.cb_partial;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
if (ch->ch_part[part].ch_partial != NULL)
|
||||
if (ch->ch_part[part].ch_callback.cb_partial != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_PARTIAL;
|
||||
dtv.vval.v_partial = ch->ch_part[part].ch_partial;
|
||||
dtv.vval.v_partial =
|
||||
ch->ch_part[part].ch_callback.cb_partial;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
}
|
||||
if (ch->ch_partial != NULL)
|
||||
if (ch->ch_callback.cb_partial != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_PARTIAL;
|
||||
dtv.vval.v_partial = ch->ch_partial;
|
||||
dtv.vval.v_partial = ch->ch_callback.cb_partial;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
if (ch->ch_close_partial != NULL)
|
||||
if (ch->ch_close_cb.cb_partial != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_PARTIAL;
|
||||
dtv.vval.v_partial = ch->ch_close_partial;
|
||||
dtv.vval.v_partial = ch->ch_close_cb.cb_partial;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
}
|
||||
@@ -6664,8 +6916,8 @@ make_expanded_name(
|
||||
temp_result = eval_to_string(expr_start + 1, &nextcmd, FALSE);
|
||||
if (temp_result != NULL && nextcmd == NULL)
|
||||
{
|
||||
retval = alloc((unsigned)(STRLEN(temp_result) + (expr_start - in_start)
|
||||
+ (in_end - expr_end) + 1));
|
||||
retval = alloc(STRLEN(temp_result) + (expr_start - in_start)
|
||||
+ (in_end - expr_end) + 1);
|
||||
if (retval != NULL)
|
||||
{
|
||||
STRCPY(retval, in_start);
|
||||
@@ -7170,7 +7422,7 @@ handle_subscript(
|
||||
typval_T *
|
||||
alloc_tv(void)
|
||||
{
|
||||
return (typval_T *)alloc_clear((unsigned)sizeof(typval_T));
|
||||
return ALLOC_CLEAR_ONE(typval_T);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -7348,7 +7600,7 @@ tv_get_number_chk(typval_T *varp, int *denote)
|
||||
case VAR_STRING:
|
||||
if (varp->vval.v_string != NULL)
|
||||
vim_str2nr(varp->vval.v_string, NULL, NULL,
|
||||
STR2NR_ALL, &n, NULL, 0);
|
||||
STR2NR_ALL, &n, NULL, 0, FALSE);
|
||||
return n;
|
||||
case VAR_LIST:
|
||||
emsg(_("E745: Using a List as a Number"));
|
||||
@@ -7756,7 +8008,7 @@ new_script_vars(scid_T id)
|
||||
while (ga_scripts.ga_len < id)
|
||||
{
|
||||
sv = SCRIPT_SV(ga_scripts.ga_len + 1) =
|
||||
(scriptvar_T *)alloc_clear(sizeof(scriptvar_T));
|
||||
ALLOC_CLEAR_ONE(scriptvar_T);
|
||||
init_var_dict(&sv->sv_dict, &sv->sv_var, VAR_SCOPE);
|
||||
++ga_scripts.ga_len;
|
||||
}
|
||||
@@ -7921,7 +8173,22 @@ list_one_var_a(
|
||||
set_var(
|
||||
char_u *name,
|
||||
typval_T *tv,
|
||||
int copy) /* make copy of value in "tv" */
|
||||
int copy) // make copy of value in "tv"
|
||||
{
|
||||
set_var_const(name, tv, copy, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set variable "name" to value in "tv".
|
||||
* If the variable already exists and "is_const" is FALSE the value is updated.
|
||||
* Otherwise the variable is created.
|
||||
*/
|
||||
static void
|
||||
set_var_const(
|
||||
char_u *name,
|
||||
typval_T *tv,
|
||||
int copy, // make copy of value in "tv"
|
||||
int is_const) // disallow to modify existing variable
|
||||
{
|
||||
dictitem_T *v;
|
||||
char_u *varname;
|
||||
@@ -7945,6 +8212,12 @@ set_var(
|
||||
|
||||
if (v != NULL)
|
||||
{
|
||||
if (is_const)
|
||||
{
|
||||
emsg(_(e_cannot_mod));
|
||||
return;
|
||||
}
|
||||
|
||||
/* existing variable, need to clear the value */
|
||||
if (var_check_ro(v->di_flags, name, FALSE)
|
||||
|| var_check_lock(v->di_tv.v_lock, name, FALSE))
|
||||
@@ -8012,8 +8285,7 @@ set_var(
|
||||
if (!valid_varname(varname))
|
||||
return;
|
||||
|
||||
v = (dictitem_T *)alloc((unsigned)(sizeof(dictitem_T)
|
||||
+ STRLEN(varname)));
|
||||
v = alloc(sizeof(dictitem_T) + STRLEN(varname));
|
||||
if (v == NULL)
|
||||
return;
|
||||
STRCPY(v->di_key, varname);
|
||||
@@ -8023,6 +8295,8 @@ set_var(
|
||||
return;
|
||||
}
|
||||
v->di_flags = DI_FLAGS_ALLOC;
|
||||
if (is_const)
|
||||
v->di_flags |= DI_FLAGS_LOCK;
|
||||
}
|
||||
|
||||
if (copy || tv->v_type == VAR_NUMBER || tv->v_type == VAR_FLOAT)
|
||||
@@ -8033,6 +8307,9 @@ set_var(
|
||||
v->di_tv.v_lock = 0;
|
||||
init_tv(tv);
|
||||
}
|
||||
|
||||
if (is_const)
|
||||
v->di_tv.v_lock |= VAR_LOCKED;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8684,7 +8961,19 @@ find_win_by_nr(
|
||||
break;
|
||||
}
|
||||
if (nr >= LOWEST_WIN_ID)
|
||||
{
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
// check tab-local popup windows
|
||||
for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next)
|
||||
if (wp->w_id == nr)
|
||||
return wp;
|
||||
// check global popup windows
|
||||
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
|
||||
if (wp->w_id == nr)
|
||||
return wp;
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
return wp;
|
||||
}
|
||||
|
||||
@@ -8875,7 +9164,7 @@ setwinvar(typval_T *argvars, typval_T *rettv UNUSED, int off)
|
||||
}
|
||||
else
|
||||
{
|
||||
winvarname = alloc((unsigned)STRLEN(varname) + 3);
|
||||
winvarname = alloc(STRLEN(varname) + 3);
|
||||
if (winvarname != NULL)
|
||||
{
|
||||
STRCPY(winvarname, "w:");
|
||||
@@ -8930,23 +9219,24 @@ find_option_end(char_u **arg, int *opt_flags)
|
||||
/*
|
||||
* Return the autoload script name for a function or variable name.
|
||||
* Returns NULL when out of memory.
|
||||
* Caller must make sure that "name" contains AUTOLOAD_CHAR.
|
||||
*/
|
||||
char_u *
|
||||
autoload_name(char_u *name)
|
||||
{
|
||||
char_u *p;
|
||||
char_u *p, *q = NULL;
|
||||
char_u *scriptname;
|
||||
|
||||
/* Get the script file name: replace '#' with '/', append ".vim". */
|
||||
scriptname = alloc((unsigned)(STRLEN(name) + 14));
|
||||
// Get the script file name: replace '#' with '/', append ".vim".
|
||||
scriptname = alloc(STRLEN(name) + 14);
|
||||
if (scriptname == NULL)
|
||||
return FALSE;
|
||||
STRCPY(scriptname, "autoload/");
|
||||
STRCAT(scriptname, name);
|
||||
*vim_strrchr(scriptname, AUTOLOAD_CHAR) = NUL;
|
||||
STRCAT(scriptname, ".vim");
|
||||
while ((p = vim_strchr(scriptname, AUTOLOAD_CHAR)) != NULL)
|
||||
for (p = scriptname + 9; (p = vim_strchr(p, AUTOLOAD_CHAR)) != NULL;
|
||||
q = p, ++p)
|
||||
*p = '/';
|
||||
STRCPY(q, ".vim");
|
||||
return scriptname;
|
||||
}
|
||||
|
||||
@@ -9274,14 +9564,18 @@ last_set_msg(sctx_T script_ctx)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reset v:option_new, v:option_old and v:option_type.
|
||||
* reset v:option_new, v:option_old, v:option_oldlocal, v:option_oldglobal,
|
||||
* v:option_type, and v:option_command.
|
||||
*/
|
||||
void
|
||||
reset_v_option_vars(void)
|
||||
{
|
||||
set_vim_var_string(VV_OPTION_NEW, NULL, -1);
|
||||
set_vim_var_string(VV_OPTION_OLD, NULL, -1);
|
||||
set_vim_var_string(VV_OPTION_OLDLOCAL, NULL, -1);
|
||||
set_vim_var_string(VV_OPTION_OLDGLOBAL, NULL, -1);
|
||||
set_vim_var_string(VV_OPTION_TYPE, NULL, -1);
|
||||
set_vim_var_string(VV_OPTION_COMMAND, NULL, -1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
1333
src/evalfunc.c
1333
src/evalfunc.c
File diff suppressed because it is too large
Load Diff
@@ -8,29 +8,29 @@ static const unsigned short cmdidxs1[26] =
|
||||
/* a */ 0,
|
||||
/* b */ 19,
|
||||
/* c */ 42,
|
||||
/* d */ 107,
|
||||
/* e */ 129,
|
||||
/* f */ 149,
|
||||
/* g */ 165,
|
||||
/* h */ 171,
|
||||
/* i */ 180,
|
||||
/* j */ 198,
|
||||
/* k */ 200,
|
||||
/* l */ 205,
|
||||
/* m */ 267,
|
||||
/* n */ 285,
|
||||
/* o */ 305,
|
||||
/* p */ 317,
|
||||
/* q */ 356,
|
||||
/* r */ 359,
|
||||
/* s */ 379,
|
||||
/* t */ 447,
|
||||
/* u */ 492,
|
||||
/* v */ 503,
|
||||
/* w */ 521,
|
||||
/* x */ 535,
|
||||
/* y */ 545,
|
||||
/* z */ 546
|
||||
/* d */ 108,
|
||||
/* e */ 130,
|
||||
/* f */ 150,
|
||||
/* g */ 166,
|
||||
/* h */ 172,
|
||||
/* i */ 181,
|
||||
/* j */ 199,
|
||||
/* k */ 201,
|
||||
/* l */ 206,
|
||||
/* m */ 268,
|
||||
/* n */ 286,
|
||||
/* o */ 306,
|
||||
/* p */ 318,
|
||||
/* q */ 357,
|
||||
/* r */ 360,
|
||||
/* s */ 380,
|
||||
/* t */ 448,
|
||||
/* u */ 493,
|
||||
/* v */ 504,
|
||||
/* w */ 522,
|
||||
/* x */ 536,
|
||||
/* y */ 546,
|
||||
/* z */ 547
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -43,7 +43,7 @@ static const unsigned char cmdidxs2[26][26] =
|
||||
{ /* a b c d e f g h i j k l m n o p q r s t u v w x y z */
|
||||
/* a */ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 7, 15, 0, 16, 0, 0, 0, 0, 0 },
|
||||
/* b */ { 2, 0, 0, 4, 5, 7, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 0, 13, 0, 0, 0, 0, 22, 0, 0, 0 },
|
||||
/* c */ { 3, 12, 16, 18, 20, 22, 25, 0, 0, 0, 0, 33, 37, 40, 46, 55, 57, 58, 59, 0, 61, 0, 64, 0, 0, 0 },
|
||||
/* c */ { 3, 12, 16, 18, 20, 22, 25, 0, 0, 0, 0, 33, 37, 40, 46, 56, 58, 59, 60, 0, 62, 0, 65, 0, 0, 0 },
|
||||
/* d */ { 0, 0, 0, 0, 0, 0, 0, 0, 6, 15, 0, 16, 0, 0, 17, 0, 0, 19, 20, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* e */ { 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0 },
|
||||
/* f */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0 },
|
||||
@@ -69,4 +69,4 @@ static const unsigned char cmdidxs2[26][26] =
|
||||
/* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const int command_count = 559;
|
||||
static const int command_count = 560;
|
||||
|
||||
@@ -397,7 +397,7 @@ ex_sort(exarg_T *eap)
|
||||
sortbuf1 = NULL;
|
||||
sortbuf2 = NULL;
|
||||
regmatch.regprog = NULL;
|
||||
nrs = (sorti_T *)lalloc((long_u)(count * sizeof(sorti_T)), TRUE);
|
||||
nrs = ALLOC_MULT(sorti_T, count);
|
||||
if (nrs == NULL)
|
||||
goto sortend;
|
||||
|
||||
@@ -558,7 +558,8 @@ ex_sort(exarg_T *eap)
|
||||
{
|
||||
nrs[lnum - eap->line1].st_u.num.is_number = TRUE;
|
||||
vim_str2nr(s, NULL, NULL, sort_what,
|
||||
&nrs[lnum - eap->line1].st_u.num.value, NULL, 0);
|
||||
&nrs[lnum - eap->line1].st_u.num.value,
|
||||
NULL, 0, FALSE);
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_FLOAT
|
||||
@@ -594,10 +595,10 @@ ex_sort(exarg_T *eap)
|
||||
}
|
||||
|
||||
/* Allocate a buffer that can hold the longest line. */
|
||||
sortbuf1 = alloc((unsigned)maxlen + 1);
|
||||
sortbuf1 = alloc(maxlen + 1);
|
||||
if (sortbuf1 == NULL)
|
||||
goto sortend;
|
||||
sortbuf2 = alloc((unsigned)maxlen + 1);
|
||||
sortbuf2 = alloc(maxlen + 1);
|
||||
if (sortbuf2 == NULL)
|
||||
goto sortend;
|
||||
|
||||
@@ -792,8 +793,7 @@ ex_retab(exarg_T *eap)
|
||||
/* len is actual number of white characters used */
|
||||
len = num_spaces + num_tabs;
|
||||
old_len = (long)STRLEN(ptr);
|
||||
new_line = lalloc(old_len - col + start_col + len + 1,
|
||||
TRUE);
|
||||
new_line = alloc(old_len - col + start_col + len + 1);
|
||||
if (new_line == NULL)
|
||||
break;
|
||||
if (start_col > 0)
|
||||
@@ -1145,7 +1145,7 @@ do_bang(
|
||||
}
|
||||
len += (int)STRLEN(prevcmd);
|
||||
}
|
||||
if ((t = alloc((unsigned)len)) == NULL)
|
||||
if ((t = alloc(len)) == NULL)
|
||||
{
|
||||
vim_free(newcmd);
|
||||
return;
|
||||
@@ -1208,7 +1208,7 @@ do_bang(
|
||||
*/
|
||||
if (*p_shq != NUL)
|
||||
{
|
||||
newcmd = alloc((unsigned)(STRLEN(prevcmd) + 2 * STRLEN(p_shq) + 1));
|
||||
newcmd = alloc(STRLEN(prevcmd) + 2 * STRLEN(p_shq) + 1);
|
||||
if (newcmd == NULL)
|
||||
return;
|
||||
STRCPY(newcmd, p_shq);
|
||||
@@ -1744,7 +1744,7 @@ make_filter_cmd(
|
||||
len += (long_u)STRLEN(itmp) + 9; /* " { < " + " } " */
|
||||
if (otmp != NULL)
|
||||
len += (long_u)STRLEN(otmp) + (long_u)STRLEN(p_srr) + 2; /* " " */
|
||||
buf = lalloc(len, TRUE);
|
||||
buf = alloc(len);
|
||||
if (buf == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -2535,7 +2535,7 @@ viminfo_readstring(
|
||||
if (virp->vir_line[off] == Ctrl_V && vim_isdigit(virp->vir_line[off + 1]))
|
||||
{
|
||||
len = atol((char *)virp->vir_line + off + 1);
|
||||
retval = lalloc(len, TRUE);
|
||||
retval = alloc(len);
|
||||
if (retval == NULL)
|
||||
{
|
||||
/* Line too long? File messed up? Skip next line. */
|
||||
@@ -2746,7 +2746,7 @@ barline_parse(vir_T *virp, char_u *text, garray_T *values)
|
||||
*/
|
||||
++p;
|
||||
len = getdigits(&p);
|
||||
buf = alloc((int)(len + 1));
|
||||
buf = alloc(len + 1);
|
||||
if (buf == NULL)
|
||||
return TRUE;
|
||||
p = buf;
|
||||
@@ -3186,7 +3186,7 @@ do_write(exarg_T *eap)
|
||||
|
||||
ffname = eap->arg;
|
||||
#ifdef FEAT_BROWSE
|
||||
if (cmdmod.browse)
|
||||
if (cmdmod.browse && !exiting)
|
||||
{
|
||||
browse_file = do_browse(BROWSE_SAVE, (char_u *)_("Save As"), ffname,
|
||||
NULL, NULL, NULL, curbuf);
|
||||
@@ -3399,7 +3399,7 @@ check_overwrite(
|
||||
|| (buf->b_flags & BF_READERR))
|
||||
&& !p_wa
|
||||
#ifdef FEAT_QUICKFIX
|
||||
&& !bt_nofile(buf)
|
||||
&& !bt_nofilename(buf)
|
||||
#endif
|
||||
&& vim_fexists(ffname))
|
||||
{
|
||||
@@ -3818,7 +3818,7 @@ do_ecmd(
|
||||
else
|
||||
{
|
||||
#ifdef FEAT_BROWSE
|
||||
if (cmdmod.browse)
|
||||
if (cmdmod.browse && !exiting)
|
||||
{
|
||||
if (
|
||||
# ifdef FEAT_GUI
|
||||
@@ -3907,7 +3907,7 @@ do_ecmd(
|
||||
len = (int)STRLEN(command) + 3;
|
||||
else
|
||||
len = 30;
|
||||
p = alloc((unsigned)len);
|
||||
p = alloc(len);
|
||||
if (p != NULL)
|
||||
{
|
||||
if (command != NULL)
|
||||
@@ -4540,7 +4540,7 @@ ex_append(exarg_T *eap)
|
||||
#ifdef FEAT_EVAL
|
||||
eap->cstack->cs_looplevel > 0 ? -1 :
|
||||
#endif
|
||||
NUL, eap->cookie, indent);
|
||||
NUL, eap->cookie, indent, TRUE);
|
||||
State = save_State;
|
||||
}
|
||||
lines_left = Rows - 1;
|
||||
@@ -5187,6 +5187,9 @@ do_sub(exarg_T *eap)
|
||||
int do_again; /* do it again after joining lines */
|
||||
int skip_match = FALSE;
|
||||
linenr_T sub_firstlnum; /* nr of first sub line */
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
int apc_flags = APC_SAVE_FOR_UNDO | APC_SUBSTITUTE;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The new text is build up step by step, to avoid too much
|
||||
@@ -5385,7 +5388,7 @@ do_sub(exarg_T *eap)
|
||||
for ( ; i <= (long)ec; ++i)
|
||||
msg_putchar('^');
|
||||
|
||||
resp = getexmodeline('?', NULL, 0);
|
||||
resp = getexmodeline('?', NULL, 0, TRUE);
|
||||
if (resp != NULL)
|
||||
{
|
||||
typed = *resp;
|
||||
@@ -5553,30 +5556,27 @@ do_sub(exarg_T *eap)
|
||||
* 3. substitute the string.
|
||||
*/
|
||||
#ifdef FEAT_EVAL
|
||||
save_ma = curbuf->b_p_ma;
|
||||
if (subflags.do_count)
|
||||
{
|
||||
/* prevent accidentally changing the buffer by a function */
|
||||
save_ma = curbuf->b_p_ma;
|
||||
// prevent accidentally changing the buffer by a function
|
||||
curbuf->b_p_ma = FALSE;
|
||||
sandbox++;
|
||||
}
|
||||
/* Save flags for recursion. They can change for e.g.
|
||||
* :s/^/\=execute("s#^##gn") */
|
||||
// Save flags for recursion. They can change for e.g.
|
||||
// :s/^/\=execute("s#^##gn")
|
||||
subflags_save = subflags;
|
||||
#endif
|
||||
/* get length of substitution part */
|
||||
// get length of substitution part
|
||||
sublen = vim_regsub_multi(®match,
|
||||
sub_firstlnum - regmatch.startpos[0].lnum,
|
||||
sub, sub_firstline, FALSE, p_magic, TRUE);
|
||||
#ifdef FEAT_EVAL
|
||||
// If getting the substitute string caused an error, don't do
|
||||
// the replacement.
|
||||
if (aborting())
|
||||
goto skip;
|
||||
|
||||
// Don't keep flags set by a recursive call.
|
||||
subflags = subflags_save;
|
||||
if (subflags.do_count)
|
||||
if (aborting() || subflags.do_count)
|
||||
{
|
||||
curbuf->b_p_ma = save_ma;
|
||||
if (sandbox > 0)
|
||||
@@ -5606,9 +5606,15 @@ do_sub(exarg_T *eap)
|
||||
p1 = sub_firstline;
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
if (curbuf->b_has_textprop)
|
||||
adjust_prop_columns(lnum, regmatch.startpos[0].col,
|
||||
{
|
||||
// When text properties are changed, need to save for
|
||||
// undo first, unless done already.
|
||||
if (adjust_prop_columns(lnum, regmatch.startpos[0].col,
|
||||
sublen - 1 - (regmatch.endpos[0].col
|
||||
- regmatch.startpos[0].col));
|
||||
- regmatch.startpos[0].col),
|
||||
apc_flags))
|
||||
apc_flags &= ~APC_SAVE_FOR_UNDO;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -5627,7 +5633,7 @@ do_sub(exarg_T *eap)
|
||||
* too many calls to alloc()/free()).
|
||||
*/
|
||||
new_start_len = needed_len + 50;
|
||||
if ((new_start = alloc_check(new_start_len)) == NULL)
|
||||
if ((new_start = alloc(new_start_len)) == NULL)
|
||||
goto outofmem;
|
||||
*new_start = NUL;
|
||||
new_end = new_start;
|
||||
@@ -5644,7 +5650,7 @@ do_sub(exarg_T *eap)
|
||||
if (needed_len > (int)new_start_len)
|
||||
{
|
||||
new_start_len = needed_len + 50;
|
||||
if ((p1 = alloc_check(new_start_len)) == NULL)
|
||||
if ((p1 = alloc(new_start_len)) == NULL)
|
||||
{
|
||||
vim_free(new_start);
|
||||
goto outofmem;
|
||||
@@ -5709,7 +5715,20 @@ do_sub(exarg_T *eap)
|
||||
for (p1 = new_end; *p1; ++p1)
|
||||
{
|
||||
if (p1[0] == '\\' && p1[1] != NUL) /* remove backslash */
|
||||
{
|
||||
STRMOVE(p1, p1 + 1);
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
if (curbuf->b_has_textprop)
|
||||
{
|
||||
// When text properties are changed, need to save
|
||||
// for undo first, unless done already.
|
||||
if (adjust_prop_columns(lnum,
|
||||
(colnr_T)(p1 - new_start), -1,
|
||||
apc_flags))
|
||||
apc_flags &= ~APC_SAVE_FOR_UNDO;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (*p1 == CAR)
|
||||
{
|
||||
if (u_inssub(lnum) == OK) // prepare for undo
|
||||
@@ -6982,7 +7001,8 @@ fix_help_buffer(void)
|
||||
copy_option_part(&p, NameBuff, MAXPATHL, ",");
|
||||
mustfree = FALSE;
|
||||
rt = vim_getenv((char_u *)"VIMRUNTIME", &mustfree);
|
||||
if (rt != NULL && fullpathcmp(rt, NameBuff, FALSE) != FPC_SAME)
|
||||
if (rt != NULL &&
|
||||
fullpathcmp(rt, NameBuff, FALSE, TRUE) != FPC_SAME)
|
||||
{
|
||||
int fcount;
|
||||
char_u **fnames;
|
||||
@@ -7204,7 +7224,7 @@ helptags_one(
|
||||
*/
|
||||
ga_init2(&ga, (int)sizeof(char_u *), 100);
|
||||
if (add_help_tags || fullpathcmp((char_u *)"$VIMRUNTIME/doc",
|
||||
dir, FALSE) == FPC_SAME)
|
||||
dir, FALSE, TRUE) == FPC_SAME)
|
||||
{
|
||||
if (ga_grow(&ga, 1) == FAIL)
|
||||
got_int = TRUE;
|
||||
@@ -7299,7 +7319,7 @@ helptags_one(
|
||||
got_int = TRUE;
|
||||
break;
|
||||
}
|
||||
s = alloc((unsigned)(p2 - p1 + STRLEN(fname) + 2));
|
||||
s = alloc(p2 - p1 + STRLEN(fname) + 2);
|
||||
if (s == NULL)
|
||||
{
|
||||
got_int = TRUE;
|
||||
|
||||
@@ -401,6 +401,9 @@ EX(CMD_continue, "continue", ex_continue,
|
||||
EX(CMD_confirm, "confirm", ex_wrongmodifier,
|
||||
NEEDARG|EXTRA|NOTRLCOM|CMDWIN,
|
||||
ADDR_NONE),
|
||||
EX(CMD_const, "const", ex_const,
|
||||
EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
|
||||
ADDR_NONE),
|
||||
EX(CMD_copen, "copen", ex_copen,
|
||||
RANGE|COUNT|TRLBAR,
|
||||
ADDR_OTHER),
|
||||
@@ -1834,7 +1837,7 @@ struct exarg
|
||||
int bad_char; /* BAD_KEEP, BAD_DROP or replacement byte */
|
||||
int useridx; /* user command index */
|
||||
char *errmsg; /* returned error message */
|
||||
char_u *(*getline)(int, void *, int);
|
||||
char_u *(*getline)(int, void *, int, int);
|
||||
void *cookie; /* argument for getline() */
|
||||
#ifdef FEAT_EVAL
|
||||
struct condstack *cstack; /* condition stack for ":if" etc. */
|
||||
|
||||
113
src/ex_cmds2.c
113
src/ex_cmds2.c
@@ -282,7 +282,7 @@ remove_timer(timer_T *timer)
|
||||
static void
|
||||
free_timer(timer_T *timer)
|
||||
{
|
||||
free_callback(timer->tr_callback, timer->tr_partial);
|
||||
free_callback(&timer->tr_callback);
|
||||
vim_free(timer);
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ free_timer(timer_T *timer)
|
||||
timer_T *
|
||||
create_timer(long msec, int repeat)
|
||||
{
|
||||
timer_T *timer = (timer_T *)alloc_clear(sizeof(timer_T));
|
||||
timer_T *timer = ALLOC_CLEAR_ONE(timer_T);
|
||||
long prev_id = last_timer_id;
|
||||
|
||||
if (timer == NULL)
|
||||
@@ -325,9 +325,8 @@ timer_callback(timer_T *timer)
|
||||
argv[0].vval.v_number = (varnumber_T)timer->tr_id;
|
||||
argv[1].v_type = VAR_UNKNOWN;
|
||||
|
||||
call_func(timer->tr_callback, -1,
|
||||
&rettv, 1, argv, NULL, 0L, 0L, &dummy, TRUE,
|
||||
timer->tr_partial, NULL);
|
||||
call_callback(&timer->tr_callback, -1,
|
||||
&rettv, 1, argv, NULL, 0L, 0L, &dummy, TRUE, NULL);
|
||||
clear_tv(&rettv);
|
||||
}
|
||||
|
||||
@@ -368,10 +367,11 @@ check_due_timer(void)
|
||||
int save_vgetc_busy = vgetc_busy;
|
||||
int save_did_emsg = did_emsg;
|
||||
int save_called_emsg = called_emsg;
|
||||
int save_must_redraw = must_redraw;
|
||||
int save_trylevel = trylevel;
|
||||
int save_must_redraw = must_redraw;
|
||||
int save_trylevel = trylevel;
|
||||
int save_did_throw = did_throw;
|
||||
int save_ex_pressedreturn = get_pressedreturn();
|
||||
int save_may_garbage_collect = may_garbage_collect;
|
||||
except_T *save_current_exception = current_exception;
|
||||
vimvars_save_T vvsave;
|
||||
|
||||
@@ -386,7 +386,9 @@ check_due_timer(void)
|
||||
trylevel = 0;
|
||||
did_throw = FALSE;
|
||||
current_exception = NULL;
|
||||
may_garbage_collect = FALSE;
|
||||
save_vimvars(&vvsave);
|
||||
|
||||
timer->tr_firing = TRUE;
|
||||
timer_callback(timer);
|
||||
timer->tr_firing = FALSE;
|
||||
@@ -408,6 +410,7 @@ check_due_timer(void)
|
||||
must_redraw = must_redraw > save_must_redraw
|
||||
? must_redraw : save_must_redraw;
|
||||
set_pressedreturn(save_ex_pressedreturn);
|
||||
may_garbage_collect = save_may_garbage_collect;
|
||||
|
||||
/* Only fire the timer again if it repeats and stop_timer() wasn't
|
||||
* called while inside the callback (tr_id == -1). */
|
||||
@@ -444,7 +447,7 @@ check_due_timer(void)
|
||||
bevalexpr_due_set = FALSE;
|
||||
if (balloonEval == NULL)
|
||||
{
|
||||
balloonEval = (BalloonEval *)alloc_clear(sizeof(BalloonEval));
|
||||
balloonEval = ALLOC_CLEAR_ONE(BalloonEval);
|
||||
balloonEvalForTerm = TRUE;
|
||||
}
|
||||
if (balloonEval != NULL)
|
||||
@@ -542,17 +545,8 @@ add_timer_info(typval_T *rettv, timer_T *timer)
|
||||
{
|
||||
if (dict_add(dict, di) == FAIL)
|
||||
vim_free(di);
|
||||
else if (timer->tr_partial != NULL)
|
||||
{
|
||||
di->di_tv.v_type = VAR_PARTIAL;
|
||||
di->di_tv.vval.v_partial = timer->tr_partial;
|
||||
++timer->tr_partial->pt_refcount;
|
||||
}
|
||||
else
|
||||
{
|
||||
di->di_tv.v_type = VAR_FUNC;
|
||||
di->di_tv.vval.v_string = vim_strsave(timer->tr_callback);
|
||||
}
|
||||
put_callback(&timer->tr_callback, &di->di_tv);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -576,17 +570,17 @@ set_ref_in_timer(int copyID)
|
||||
timer_T *timer;
|
||||
typval_T tv;
|
||||
|
||||
for (timer = first_timer; timer != NULL; timer = timer->tr_next)
|
||||
for (timer = first_timer; !abort && timer != NULL; timer = timer->tr_next)
|
||||
{
|
||||
if (timer->tr_partial != NULL)
|
||||
if (timer->tr_callback.cb_partial != NULL)
|
||||
{
|
||||
tv.v_type = VAR_PARTIAL;
|
||||
tv.vval.v_partial = timer->tr_partial;
|
||||
tv.vval.v_partial = timer->tr_callback.cb_partial;
|
||||
}
|
||||
else
|
||||
{
|
||||
tv.v_type = VAR_FUNC;
|
||||
tv.vval.v_string = timer->tr_callback;
|
||||
tv.vval.v_string = timer->tr_callback.cb_name;
|
||||
}
|
||||
abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL);
|
||||
}
|
||||
@@ -1207,7 +1201,7 @@ dialog_changed(
|
||||
}
|
||||
else if (ret == VIM_NO)
|
||||
{
|
||||
unchanged(buf, TRUE);
|
||||
unchanged(buf, TRUE, FALSE);
|
||||
}
|
||||
else if (ret == VIM_ALL)
|
||||
{
|
||||
@@ -1250,7 +1244,7 @@ dialog_changed(
|
||||
* mark all buffers as unchanged
|
||||
*/
|
||||
FOR_ALL_BUFFERS(buf2)
|
||||
unchanged(buf2, TRUE);
|
||||
unchanged(buf2, TRUE, FALSE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1312,7 +1306,7 @@ check_changed_any(
|
||||
if (bufcount == 0)
|
||||
return FALSE;
|
||||
|
||||
bufnrs = (int *)alloc(sizeof(int) * bufcount);
|
||||
bufnrs = ALLOC_MULT(int, bufcount);
|
||||
if (bufnrs == NULL)
|
||||
return FALSE;
|
||||
|
||||
@@ -1715,7 +1709,7 @@ editing_arg_idx(win_T *win)
|
||||
&& (win->w_buffer->b_ffname == NULL
|
||||
|| !(fullpathcmp(
|
||||
alist_name(&WARGLIST(win)[win->w_arg_idx]),
|
||||
win->w_buffer->b_ffname, TRUE) & FPC_SAME))));
|
||||
win->w_buffer->b_ffname, TRUE, TRUE) & FPC_SAME))));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1737,7 +1731,7 @@ check_arg_idx(win_T *win)
|
||||
&& (win->w_buffer->b_fnum == GARGLIST[GARGCOUNT - 1].ae_fnum
|
||||
|| (win->w_buffer->b_ffname != NULL
|
||||
&& (fullpathcmp(alist_name(&GARGLIST[GARGCOUNT - 1]),
|
||||
win->w_buffer->b_ffname, TRUE) & FPC_SAME))))
|
||||
win->w_buffer->b_ffname, TRUE, TRUE) & FPC_SAME))))
|
||||
arg_had_last = TRUE;
|
||||
}
|
||||
else
|
||||
@@ -1783,7 +1777,7 @@ ex_args(exarg_T *eap)
|
||||
*/
|
||||
if (ARGCOUNT > 0)
|
||||
{
|
||||
char_u **items = (char_u **)alloc(sizeof(char_u *) * ARGCOUNT);
|
||||
char_u **items = ALLOC_MULT(char_u *, ARGCOUNT);
|
||||
|
||||
if (items != NULL)
|
||||
{
|
||||
@@ -1874,6 +1868,8 @@ do_argfile(exarg_T *eap, int argn)
|
||||
char_u *p;
|
||||
int old_arg_idx = curwin->w_arg_idx;
|
||||
|
||||
if (ERROR_IF_POPUP_WINDOW)
|
||||
return;
|
||||
if (argn < 0 || argn >= ARGCOUNT)
|
||||
{
|
||||
if (ARGCOUNT <= 1)
|
||||
@@ -2366,7 +2362,7 @@ ex_compiler(exarg_T *eap)
|
||||
}
|
||||
else
|
||||
{
|
||||
buf = alloc((unsigned)(STRLEN(eap->arg) + 14));
|
||||
buf = alloc(STRLEN(eap->arg) + 14);
|
||||
if (buf != NULL)
|
||||
{
|
||||
if (eap->forceit)
|
||||
@@ -2800,7 +2796,7 @@ add_pack_dir_to_rtp(char_u *fname)
|
||||
|
||||
oldlen = STRLEN(p_rtp);
|
||||
addlen = STRLEN(fname) + 1; // add one for comma
|
||||
new_rtp = alloc((int)(oldlen + addlen + afterlen + 1)); // add one for NUL
|
||||
new_rtp = alloc(oldlen + addlen + afterlen + 1); // add one for NUL
|
||||
if (new_rtp == NULL)
|
||||
goto theend;
|
||||
|
||||
@@ -2994,7 +2990,7 @@ ex_packadd(exarg_T *eap)
|
||||
continue;
|
||||
|
||||
len = (int)STRLEN(plugpat) + (int)STRLEN(eap->arg) + 5;
|
||||
pat = (char *)alloc(len);
|
||||
pat = alloc(len);
|
||||
if (pat == NULL)
|
||||
return;
|
||||
vim_snprintf(pat, len, plugpat, round == 1 ? "start" : "opt", eap->arg);
|
||||
@@ -3016,7 +3012,9 @@ ex_packadd(exarg_T *eap)
|
||||
ex_options(
|
||||
exarg_T *eap UNUSED)
|
||||
{
|
||||
vim_setenv((char_u *)"OPTWIN_CMD", (char_u *)(cmdmod.tab ? "tab" : ""));
|
||||
vim_setenv((char_u *)"OPTWIN_CMD",
|
||||
(char_u *)(cmdmod.tab ? "tab"
|
||||
: (cmdmod.split & WSP_VERT) ? "vert" : ""));
|
||||
cmd_source((char_u *)SYS_OPTWIN_FILE, NULL);
|
||||
}
|
||||
#endif
|
||||
@@ -3271,20 +3269,21 @@ cmd_source(char_u *fname, exarg_T *eap)
|
||||
*/
|
||||
struct source_cookie
|
||||
{
|
||||
FILE *fp; /* opened file for sourcing */
|
||||
char_u *nextline; /* if not NULL: line that was read ahead */
|
||||
int finished; /* ":finish" used */
|
||||
FILE *fp; // opened file for sourcing
|
||||
char_u *nextline; // if not NULL: line that was read ahead
|
||||
linenr_T sourcing_lnum; // line number of the source file
|
||||
int finished; // ":finish" used
|
||||
#ifdef USE_CRNL
|
||||
int fileformat; /* EOL_UNKNOWN, EOL_UNIX or EOL_DOS */
|
||||
int error; /* TRUE if LF found after CR-LF */
|
||||
int fileformat; // EOL_UNKNOWN, EOL_UNIX or EOL_DOS
|
||||
int error; // TRUE if LF found after CR-LF
|
||||
#endif
|
||||
#ifdef FEAT_EVAL
|
||||
linenr_T breakpoint; /* next line with breakpoint or zero */
|
||||
char_u *fname; /* name of sourced file */
|
||||
int dbg_tick; /* debug_tick when breakpoint was set */
|
||||
int level; /* top nesting level of sourced file */
|
||||
linenr_T breakpoint; // next line with breakpoint or zero
|
||||
char_u *fname; // name of sourced file
|
||||
int dbg_tick; // debug_tick when breakpoint was set
|
||||
int level; // top nesting level of sourced file
|
||||
#endif
|
||||
vimconv_T conv; /* type of conversion */
|
||||
vimconv_T conv; // type of conversion
|
||||
};
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
@@ -3348,7 +3347,6 @@ fopen_noinh_readbin(char *filename)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* do_source: Read the file "fname" and execute its lines as EX commands.
|
||||
*
|
||||
@@ -3497,6 +3495,7 @@ do_source(
|
||||
#endif
|
||||
|
||||
cookie.nextline = NULL;
|
||||
cookie.sourcing_lnum = 0;
|
||||
cookie.finished = FALSE;
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
@@ -3617,7 +3616,7 @@ do_source(
|
||||
cookie.conv.vc_type = CONV_NONE; /* no conversion */
|
||||
|
||||
/* Read the first line so we can check for a UTF-8 BOM. */
|
||||
firstline = getsourceline(0, (void *)&cookie, 0);
|
||||
firstline = getsourceline(0, (void *)&cookie, 0, TRUE);
|
||||
if (firstline != NULL && STRLEN(firstline) >= 3 && firstline[0] == 0xef
|
||||
&& firstline[1] == 0xbb && firstline[2] == 0xbf)
|
||||
{
|
||||
@@ -3792,6 +3791,14 @@ free_scriptnames(void)
|
||||
|
||||
#endif
|
||||
|
||||
linenr_T
|
||||
get_sourced_lnum(char_u *(*fgetline)(int, void *, int, int), void *cookie)
|
||||
{
|
||||
return fgetline == getsourceline
|
||||
? ((struct source_cookie *)cookie)->sourcing_lnum
|
||||
: sourcing_lnum;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get one full line from a sourced file.
|
||||
* Called by do_cmdline() when it's called from do_source().
|
||||
@@ -3800,7 +3807,7 @@ free_scriptnames(void)
|
||||
* Return NULL for end-of-file or some error.
|
||||
*/
|
||||
char_u *
|
||||
getsourceline(int c UNUSED, void *cookie, int indent UNUSED)
|
||||
getsourceline(int c UNUSED, void *cookie, int indent UNUSED, int do_concat)
|
||||
{
|
||||
struct source_cookie *sp = (struct source_cookie *)cookie;
|
||||
char_u *line;
|
||||
@@ -3818,6 +3825,10 @@ getsourceline(int c UNUSED, void *cookie, int indent UNUSED)
|
||||
script_line_end();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Set the current sourcing line number.
|
||||
sourcing_lnum = sp->sourcing_lnum + 1;
|
||||
|
||||
/*
|
||||
* Get current line. If there is a read-ahead line, use it, otherwise get
|
||||
* one now.
|
||||
@@ -3830,7 +3841,7 @@ getsourceline(int c UNUSED, void *cookie, int indent UNUSED)
|
||||
{
|
||||
line = sp->nextline;
|
||||
sp->nextline = NULL;
|
||||
++sourcing_lnum;
|
||||
++sp->sourcing_lnum;
|
||||
}
|
||||
#ifdef FEAT_PROFILE
|
||||
if (line != NULL && do_profiling == PROF_YES)
|
||||
@@ -3839,10 +3850,10 @@ getsourceline(int c UNUSED, void *cookie, int indent UNUSED)
|
||||
|
||||
/* Only concatenate lines starting with a \ when 'cpoptions' doesn't
|
||||
* contain the 'C' flag. */
|
||||
if (line != NULL && (vim_strchr(p_cpo, CPO_CONCAT) == NULL))
|
||||
if (line != NULL && do_concat && vim_strchr(p_cpo, CPO_CONCAT) == NULL)
|
||||
{
|
||||
/* compensate for the one line read-ahead */
|
||||
--sourcing_lnum;
|
||||
--sp->sourcing_lnum;
|
||||
|
||||
// Get the next line and concatenate it when it starts with a
|
||||
// backslash. We always need to read the next line, keep it in
|
||||
@@ -3933,7 +3944,7 @@ get_one_sourceline(struct source_cookie *sp)
|
||||
/*
|
||||
* Loop until there is a finished line (or end-of-file).
|
||||
*/
|
||||
sourcing_lnum++;
|
||||
++sp->sourcing_lnum;
|
||||
for (;;)
|
||||
{
|
||||
/* make room to read at least 120 (more) characters */
|
||||
@@ -4003,7 +4014,7 @@ get_one_sourceline(struct source_cookie *sp)
|
||||
;
|
||||
if ((len & 1) != (c & 1)) /* escaped NL, read more */
|
||||
{
|
||||
sourcing_lnum++;
|
||||
++sp->sourcing_lnum;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -4218,7 +4229,7 @@ do_finish(exarg_T *eap, int reanimate)
|
||||
*/
|
||||
int
|
||||
source_finished(
|
||||
char_u *(*fgetline)(int, void *, int),
|
||||
char_u *(*fgetline)(int, void *, int, int),
|
||||
void *cookie)
|
||||
{
|
||||
return (getline_equal(fgetline, cookie, getsourceline)
|
||||
|
||||
@@ -20,9 +20,9 @@ static int ex_pressedreturn = FALSE;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
static char_u *do_one_cmd(char_u **, int, struct condstack *, char_u *(*fgetline)(int, void *, int), void *cookie);
|
||||
static char_u *do_one_cmd(char_u **, int, struct condstack *, char_u *(*fgetline)(int, void *, int, int), void *cookie);
|
||||
#else
|
||||
static char_u *do_one_cmd(char_u **, int, char_u *(*fgetline)(int, void *, int), void *cookie);
|
||||
static char_u *do_one_cmd(char_u **, int, char_u *(*fgetline)(int, void *, int, int), void *cookie);
|
||||
static int if_level = 0; /* depth in :if */
|
||||
#endif
|
||||
static void free_cmdmod(void);
|
||||
@@ -296,6 +296,7 @@ static void ex_tag_cmd(exarg_T *eap, char_u *name);
|
||||
# define ex_endtry ex_ni
|
||||
# define ex_endfunction ex_ni
|
||||
# define ex_let ex_ni
|
||||
# define ex_const ex_ni
|
||||
# define ex_unlet ex_ni
|
||||
# define ex_lockvar ex_ni
|
||||
# define ex_unlockvar ex_ni
|
||||
@@ -397,6 +398,9 @@ static void ex_folddo(exarg_T *eap);
|
||||
#if !defined(FEAT_X11) || !defined(FEAT_XCLIPBOARD)
|
||||
# define ex_xrestore ex_ni
|
||||
#endif
|
||||
#if !defined(FEAT_TEXT_PROP)
|
||||
# define ex_popupclear ex_ni
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Declare cmdnames[].
|
||||
@@ -427,11 +431,11 @@ struct loop_cookie
|
||||
int current_line; /* last read line from growarray */
|
||||
int repeating; /* TRUE when looping a second time */
|
||||
/* When "repeating" is FALSE use "getline" and "cookie" to get lines */
|
||||
char_u *(*getline)(int, void *, int);
|
||||
char_u *(*getline)(int, void *, int, int);
|
||||
void *cookie;
|
||||
};
|
||||
|
||||
static char_u *get_loop_line(int c, void *cookie, int indent);
|
||||
static char_u *get_loop_line(int c, void *cookie, int indent, int do_concat);
|
||||
static int store_loop_line(garray_T *gap, char_u *line);
|
||||
static void free_cmdlines(garray_T *gap);
|
||||
|
||||
@@ -615,7 +619,7 @@ do_cmdline_cmd(char_u *cmd)
|
||||
int
|
||||
do_cmdline(
|
||||
char_u *cmdline,
|
||||
char_u *(*fgetline)(int, void *, int),
|
||||
char_u *(*fgetline)(int, void *, int, int),
|
||||
void *cookie, /* argument for fgetline() */
|
||||
int flags)
|
||||
{
|
||||
@@ -640,7 +644,7 @@ do_cmdline(
|
||||
struct msglist *private_msg_list;
|
||||
|
||||
/* "fgetline" and "cookie" passed to do_one_cmd() */
|
||||
char_u *(*cmd_getline)(int, void *, int);
|
||||
char_u *(*cmd_getline)(int, void *, int, int);
|
||||
void *cmd_cookie;
|
||||
struct loop_cookie cmd_loop_cookie;
|
||||
void *real_cookie;
|
||||
@@ -890,7 +894,7 @@ do_cmdline(
|
||||
#else
|
||||
0
|
||||
#endif
|
||||
)) == NULL)
|
||||
, TRUE)) == NULL)
|
||||
{
|
||||
/* Don't call wait_return for aborted command line. The NULL
|
||||
* returned for the end of a sourced file or executed function
|
||||
@@ -1420,7 +1424,7 @@ do_cmdline(
|
||||
* Obtain a line when inside a ":while" or ":for" loop.
|
||||
*/
|
||||
static char_u *
|
||||
get_loop_line(int c, void *cookie, int indent)
|
||||
get_loop_line(int c, void *cookie, int indent, int do_concat)
|
||||
{
|
||||
struct loop_cookie *cp = (struct loop_cookie *)cookie;
|
||||
wcmd_T *wp;
|
||||
@@ -1433,9 +1437,9 @@ get_loop_line(int c, void *cookie, int indent)
|
||||
|
||||
/* First time inside the ":while"/":for": get line normally. */
|
||||
if (cp->getline == NULL)
|
||||
line = getcmdline(c, 0L, indent);
|
||||
line = getcmdline(c, 0L, indent, do_concat);
|
||||
else
|
||||
line = cp->getline(c, cp->cookie, indent);
|
||||
line = cp->getline(c, cp->cookie, indent, do_concat);
|
||||
if (line != NULL && store_loop_line(cp->lines_gap, line) == OK)
|
||||
++cp->current_line;
|
||||
|
||||
@@ -1483,12 +1487,12 @@ free_cmdlines(garray_T *gap)
|
||||
*/
|
||||
int
|
||||
getline_equal(
|
||||
char_u *(*fgetline)(int, void *, int),
|
||||
char_u *(*fgetline)(int, void *, int, int),
|
||||
void *cookie UNUSED, /* argument for fgetline() */
|
||||
char_u *(*func)(int, void *, int))
|
||||
char_u *(*func)(int, void *, int, int))
|
||||
{
|
||||
#ifdef FEAT_EVAL
|
||||
char_u *(*gp)(int, void *, int);
|
||||
char_u *(*gp)(int, void *, int, int);
|
||||
struct loop_cookie *cp;
|
||||
|
||||
/* When "fgetline" is "get_loop_line()" use the "cookie" to find the
|
||||
@@ -1513,11 +1517,11 @@ getline_equal(
|
||||
*/
|
||||
void *
|
||||
getline_cookie(
|
||||
char_u *(*fgetline)(int, void *, int) UNUSED,
|
||||
char_u *(*fgetline)(int, void *, int, int) UNUSED,
|
||||
void *cookie) /* argument for fgetline() */
|
||||
{
|
||||
#ifdef FEAT_EVAL
|
||||
char_u *(*gp)(int, void *, int);
|
||||
char_u *(*gp)(int, void *, int, int);
|
||||
struct loop_cookie *cp;
|
||||
|
||||
/* When "fgetline" is "get_loop_line()" use the "cookie" to find the
|
||||
@@ -1650,7 +1654,7 @@ do_one_cmd(
|
||||
#ifdef FEAT_EVAL
|
||||
struct condstack *cstack,
|
||||
#endif
|
||||
char_u *(*fgetline)(int, void *, int),
|
||||
char_u *(*fgetline)(int, void *, int, int),
|
||||
void *cookie) /* argument for fgetline() */
|
||||
{
|
||||
char_u *p;
|
||||
@@ -4813,7 +4817,7 @@ replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep)
|
||||
while ((pos = (char_u *)strstr((char *)pos + 2, "$*")) != NULL)
|
||||
++i;
|
||||
len = (int)STRLEN(p);
|
||||
new_cmdline = alloc((int)(STRLEN(program) + i * (len - 2) + 1));
|
||||
new_cmdline = alloc(STRLEN(program) + i * (len - 2) + 1);
|
||||
if (new_cmdline == NULL)
|
||||
return NULL; /* out of memory */
|
||||
ptr = new_cmdline;
|
||||
@@ -4829,7 +4833,7 @@ replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep)
|
||||
}
|
||||
else
|
||||
{
|
||||
new_cmdline = alloc((int)(STRLEN(program) + STRLEN(p) + 2));
|
||||
new_cmdline = alloc(STRLEN(program) + STRLEN(p) + 2);
|
||||
if (new_cmdline == NULL)
|
||||
return NULL; /* out of memory */
|
||||
STRCPY(new_cmdline, program);
|
||||
@@ -4849,6 +4853,7 @@ replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep)
|
||||
|
||||
/*
|
||||
* Expand file name in Ex command argument.
|
||||
* When an error is detected, "errormsgp" is set to a non-NULL pointer.
|
||||
* Return FAIL for failure, OK otherwise.
|
||||
*/
|
||||
int
|
||||
@@ -5094,7 +5099,7 @@ repl_cmdline(
|
||||
i = (int)(src - *cmdlinep) + (int)STRLEN(src + srclen) + len + 3;
|
||||
if (eap->nextcmd != NULL)
|
||||
i += (int)STRLEN(eap->nextcmd);/* add space for next command */
|
||||
if ((new_cmdline = alloc((unsigned)i)) == NULL)
|
||||
if ((new_cmdline = alloc(i)) == NULL)
|
||||
return NULL; /* out of memory! */
|
||||
|
||||
/*
|
||||
@@ -5449,6 +5454,8 @@ ex_doautocmd(exarg_T *eap)
|
||||
static void
|
||||
ex_bunload(exarg_T *eap)
|
||||
{
|
||||
if (ERROR_IF_POPUP_WINDOW)
|
||||
return;
|
||||
eap->errmsg = do_bufdel(
|
||||
eap->cmdidx == CMD_bdelete ? DOBUF_DEL
|
||||
: eap->cmdidx == CMD_bwipeout ? DOBUF_WIPE
|
||||
@@ -5463,6 +5470,8 @@ ex_bunload(exarg_T *eap)
|
||||
static void
|
||||
ex_buffer(exarg_T *eap)
|
||||
{
|
||||
if (ERROR_IF_POPUP_WINDOW)
|
||||
return;
|
||||
if (*eap->arg)
|
||||
eap->errmsg = e_trailing;
|
||||
else
|
||||
@@ -6547,7 +6556,7 @@ alist_unlink(alist_T *al)
|
||||
void
|
||||
alist_new(void)
|
||||
{
|
||||
curwin->w_alist = (alist_T *)alloc((unsigned)sizeof(alist_T));
|
||||
curwin->w_alist = ALLOC_ONE(alist_T);
|
||||
if (curwin->w_alist == NULL)
|
||||
{
|
||||
curwin->w_alist = &global_alist;
|
||||
@@ -6581,7 +6590,7 @@ alist_expand(int *fnum_list, int fnum_len)
|
||||
* expansion. Also, the vimrc file isn't read yet, thus the user
|
||||
* can't set the options. */
|
||||
p_su = empty_option;
|
||||
old_arg_files = (char_u **)alloc((unsigned)(sizeof(char_u *) * GARGCOUNT));
|
||||
old_arg_files = ALLOC_MULT(char_u *, GARGCOUNT);
|
||||
if (old_arg_files != NULL)
|
||||
{
|
||||
for (i = 0; i < GARGCOUNT; ++i)
|
||||
@@ -6725,7 +6734,7 @@ ex_recover(exarg_T *eap)
|
||||
|
||||
&& (*eap->arg == NUL
|
||||
|| setfname(curbuf, eap->arg, NULL, TRUE) == OK))
|
||||
ml_recover();
|
||||
ml_recover(TRUE);
|
||||
recoverymode = FALSE;
|
||||
}
|
||||
|
||||
@@ -6765,6 +6774,9 @@ ex_splitview(exarg_T *eap)
|
||||
|| eap->cmdidx == CMD_tabfind
|
||||
|| eap->cmdidx == CMD_tabnew;
|
||||
|
||||
if (ERROR_IF_POPUP_WINDOW)
|
||||
return;
|
||||
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
#endif
|
||||
@@ -6892,6 +6904,8 @@ ex_tabnext(exarg_T *eap)
|
||||
{
|
||||
int tab_number;
|
||||
|
||||
if (ERROR_IF_POPUP_WINDOW)
|
||||
return;
|
||||
switch (eap->cmdidx)
|
||||
{
|
||||
case CMD_tabfirst:
|
||||
@@ -7143,6 +7157,8 @@ do_exedit(
|
||||
int need_hide;
|
||||
int exmode_was = exmode_active;
|
||||
|
||||
if (ERROR_IF_POPUP_WINDOW)
|
||||
return;
|
||||
/*
|
||||
* ":vi" command ends Ex mode.
|
||||
*/
|
||||
@@ -8839,7 +8855,7 @@ ex_normal(exarg_T *eap)
|
||||
}
|
||||
if (len > 0)
|
||||
{
|
||||
arg = alloc((unsigned)(STRLEN(eap->arg) + len + 1));
|
||||
arg = alloc(STRLEN(eap->arg) + len + 1);
|
||||
if (arg != NULL)
|
||||
{
|
||||
len = 0;
|
||||
@@ -9628,7 +9644,7 @@ arg_all(void)
|
||||
}
|
||||
|
||||
/* allocate memory */
|
||||
retval = alloc((unsigned)len + 1);
|
||||
retval = alloc(len + 1);
|
||||
if (retval == NULL)
|
||||
break;
|
||||
}
|
||||
@@ -9893,7 +9909,7 @@ makeopens(
|
||||
&& wp->w_buffer->b_ffname != NULL
|
||||
&& !bt_help(wp->w_buffer)
|
||||
#ifdef FEAT_QUICKFIX
|
||||
&& !bt_nofile(wp->w_buffer)
|
||||
&& !bt_nofilename(wp->w_buffer)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
@@ -10220,7 +10236,7 @@ ses_do_win(win_T *wp)
|
||||
if (wp->w_buffer->b_fname == NULL
|
||||
#ifdef FEAT_QUICKFIX
|
||||
/* When 'buftype' is "nofile" can't restore the window contents. */
|
||||
|| bt_nofile(wp->w_buffer)
|
||||
|| bt_nofilename(wp->w_buffer)
|
||||
#endif
|
||||
)
|
||||
return (ssop_flags & SSOP_BLANK);
|
||||
@@ -10307,7 +10323,7 @@ put_view(
|
||||
*/
|
||||
if (wp->w_buffer->b_ffname != NULL
|
||||
# ifdef FEAT_QUICKFIX
|
||||
&& !bt_nofile(wp->w_buffer)
|
||||
&& !bt_nofilename(wp->w_buffer)
|
||||
# endif
|
||||
)
|
||||
{
|
||||
@@ -10622,7 +10638,7 @@ get_view_file(int c)
|
||||
for (p = sname; *p; ++p)
|
||||
if (*p == '=' || vim_ispathsep(*p))
|
||||
++len;
|
||||
retval = alloc((unsigned)(STRLEN(sname) + len + STRLEN(p_vdir) + 9));
|
||||
retval = alloc(STRLEN(sname) + len + STRLEN(p_vdir) + 9);
|
||||
if (retval != NULL)
|
||||
{
|
||||
STRCPY(retval, p_vdir);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user