mirror of
https://github.com/neovim/neovim
synced 2025-07-22 14:21:58 +00:00
Compare commits
590 Commits
Author | SHA1 | Date | |
---|---|---|---|
4dcd19d9bc | |||
4f5a18237b | |||
ab63f5d934 | |||
a9f97226ae | |||
1cc869ffb9 | |||
3c4544c532 | |||
3098b18a2b | |||
3d7a6e4d54 | |||
c4de9c7cc9 | |||
5ebffaae4e | |||
cef624ee9e | |||
ce17d03180 | |||
89e6973fe2 | |||
ec71d87b81 | |||
9e1cacecbe | |||
5734e21873 | |||
2dfc8de1cf | |||
425fcdb5b4 | |||
29b737e92b | |||
a252fca38e | |||
9e385404b3 | |||
88a735166b | |||
50a7517a6d | |||
a7a0bf54e3 | |||
cd10cdd1b4 | |||
7029dec0ae | |||
02fa6b18d6 | |||
5c6592fdab | |||
ba9bdb3e70 | |||
1cb8afed78 | |||
43fe335eda | |||
0ba12c6691 | |||
0d264abdd0 | |||
f3d6c443d9 | |||
bf63510228 | |||
ef92cca7cc | |||
376ba4e734 | |||
49dde999c0 | |||
2ebc58d25a | |||
ba97f73560 | |||
1b1b920ba8 | |||
a347b29aa3 | |||
c4117d4b2f | |||
4a200ceafa | |||
d835c030f2 | |||
8d12e28d94 | |||
05baf936c0 | |||
8a14750dd3 | |||
28b9a2864a | |||
e5147ce6a0 | |||
40cc5ba0e2 | |||
946807898b | |||
ca280c28b4 | |||
007d573147 | |||
896f548eee | |||
a3dfd1627e | |||
a64114eba0 | |||
28275fe5c3 | |||
45304b482c | |||
bda0165514 | |||
c4f1b5a938 | |||
3e435df42c | |||
fd92e648ac | |||
494b1c9bee | |||
9af400f979 | |||
af7ff808c7 | |||
9709cf2cdb | |||
25bb08dad9 | |||
4f8b686435 | |||
c129f6cfaf | |||
d06c2a1b18 | |||
2b0d46195b | |||
0c598774d8 | |||
515fea1ef0 | |||
69ce17878e | |||
1bada1fde0 | |||
82f249f829 | |||
9a56fcb2e8 | |||
9c543f2e24 | |||
032ac502ff | |||
eb806c9620 | |||
52c6cc2189 | |||
224d7df630 | |||
394830631f | |||
b725f6b428 | |||
4eb5d05f01 | |||
4a29995fe7 | |||
1fc84ae2cd | |||
4ff5d6e41c | |||
54cc6d8025 | |||
6a35f2ac8b | |||
942e0b338c | |||
406562ac6d | |||
7cdd01983a | |||
2f67786796 | |||
f1ced96c28 | |||
af6603a6b4 | |||
4913a25dec | |||
209427e972 | |||
f0bd4a1494 | |||
77776b09c6 | |||
c27395ddc8 | |||
fa26eee85b | |||
569e404622 | |||
7124329bd9 | |||
d4106f6df3 | |||
0aa3e7b7ce | |||
b7cb8f0597 | |||
c91c0171dd | |||
6cdf45e298 | |||
f4ea114c67 | |||
33778c36cc | |||
6167ce6df2 | |||
a3b87fc19b | |||
e303ea8a19 | |||
2c378fdfaf | |||
634e51d12b | |||
57700def79 | |||
5814e29cdb | |||
ea82270d30 | |||
cddd7d47c3 | |||
ed6756563c | |||
700b32a2b3 | |||
3c39219550 | |||
85244e68e3 | |||
41b44d114c | |||
704accfbfa | |||
e213ba1506 | |||
0f0e2bdfd4 | |||
f5c35ba109 | |||
6e5498c3e3 | |||
d70a322c40 | |||
18903bd9b8 | |||
256a5d2522 | |||
68e58444b4 | |||
c3efad5398 | |||
f21cb425fb | |||
44cbf45d26 | |||
83c683f5e1 | |||
aae7e8b7dd | |||
cc1beecf81 | |||
164bcaf5c9 | |||
4043725991 | |||
e90f52f7ac | |||
cd00aa6ae4 | |||
a8fec15899 | |||
4b097c85d8 | |||
2eb5d73438 | |||
2895883154 | |||
b50afb4651 | |||
a7a3605c0f | |||
e6e843ebc0 | |||
cfe4352897 | |||
2c827cea12 | |||
1b1960ab90 | |||
f09f6ba2e4 | |||
8a2cf943f7 | |||
e34cdf6e79 | |||
a0fec5d3db | |||
622164d403 | |||
824a6877ea | |||
11e8ec0cac | |||
4eb58273cd | |||
523ff9c55c | |||
54188cddde | |||
cf7d6a7a0b | |||
01eafc0c17 | |||
69d74f588a | |||
982198143d | |||
c18d5917e3 | |||
4a6328a8eb | |||
0cb2c39ec4 | |||
10a8bb02ac | |||
4ae7acd152 | |||
584b8eddb4 | |||
f5f11b9e2f | |||
3f698b8106 | |||
704f3dd855 | |||
906271b53d | |||
f47a20a266 | |||
cf32ca5137 | |||
fe4d814c0f | |||
b25b6048ca | |||
c56aceff88 | |||
80471df208 | |||
91c5005da8 | |||
8d37201ed2 | |||
3462f46cb8 | |||
1bf1ffc734 | |||
bf2c2b34cf | |||
d227c843bf | |||
5330aa104b | |||
2df8f88b3c | |||
d44b2c9483 | |||
e605faaa2f | |||
7cdbf3f97a | |||
f4f80a238b | |||
90e8bdc898 | |||
666714f74f | |||
52a830fec6 | |||
47d44e00a2 | |||
c54ccfbb52 | |||
55844eee10 | |||
c8d830e896 | |||
1a9be28c75 | |||
28d3def5b0 | |||
6eda7c0e5f | |||
8eb8ebf905 | |||
f3645e422f | |||
51c7818d42 | |||
b8643f69c1 | |||
4b8f27338f | |||
14c9b30f2e | |||
6e8757255e | |||
7558f42f7d | |||
62c0d99474 | |||
e4d1bf7177 | |||
5f0c76b243 | |||
a9e0d734d7 | |||
beccc3e3a1 | |||
15b5bb038b | |||
ce832238c8 | |||
06b40d31c1 | |||
ae686092f8 | |||
2e2b5759cf | |||
075f84cbea | |||
5730ad9376 | |||
cfcc6be73e | |||
d61b576940 | |||
df15f97889 | |||
5aa0159f01 | |||
6b22a742c7 | |||
d7511f5cde | |||
5a9d3be54c | |||
77a7ca458b | |||
3e85aee48c | |||
f3ac99b72d | |||
c94575fded | |||
89bb5a8ab8 | |||
e7a9c006e1 | |||
b030c90506 | |||
ffaaf5df31 | |||
66a75fb835 | |||
26d189e9a1 | |||
6c4d3362c5 | |||
1c066e671d | |||
3cb9970acf | |||
662eea8287 | |||
bb020df0f5 | |||
e7485ab1c9 | |||
316d38d98c | |||
925c020a1b | |||
87c208a43f | |||
d9ecd06627 | |||
de33c9f005 | |||
0b468fd0cf | |||
a40a4e2431 | |||
7bd570cd9a | |||
890ce792af | |||
0e15d1cefa | |||
37b3a4c607 | |||
6674930d7c | |||
646ab30858 | |||
96af115c71 | |||
34a1bc1a46 | |||
c6ec148f2d | |||
35d8d10a6a | |||
bd81239f2f | |||
1895f6ffab | |||
2ea02ff635 | |||
3d9e9a92cf | |||
43456e43de | |||
091ef2fbe4 | |||
42e710eacb | |||
9fb9d2929f | |||
0e9f7a7b36 | |||
4e39eee13c | |||
8991b4b095 | |||
c2c180fbb3 | |||
03fe4ad9b1 | |||
ed1925e0d1 | |||
c3b6cd300f | |||
fb4655beb1 | |||
4bfac00aa3 | |||
75fbc23ead | |||
c6df1b387c | |||
32238018e4 | |||
67eeb8a798 | |||
53aa569918 | |||
5ef3e40b37 | |||
9d1e076056 | |||
a528d56ba0 | |||
d9e631f1b5 | |||
55c0621ff3 | |||
576c5f7b74 | |||
badf227e6f | |||
56bfdd7934 | |||
36cb847d09 | |||
be7d6ba6c1 | |||
c00da817c4 | |||
6bfd88dec1 | |||
e76bc505e9 | |||
2ee37cc285 | |||
888b8abeb0 | |||
1dd986562f | |||
e17e5547d7 | |||
c1487b9685 | |||
2359f6f144 | |||
7ab9ff88e6 | |||
88da85a3cd | |||
f2ae5a9cc0 | |||
9c4b34be28 | |||
0c5f74ae4d | |||
0c2ba7554f | |||
8ade191b7a | |||
9d41060c32 | |||
de7165d351 | |||
0409cfded5 | |||
a16d4a2b62 | |||
712f057ed9 | |||
92d4dfdca5 | |||
c6eeefa339 | |||
b32396170f | |||
a1493215a2 | |||
b01db02de4 | |||
62321e5132 | |||
ba1348edc5 | |||
0f604e1da2 | |||
2af36df86d | |||
8d5e60d8af | |||
2ab9e96742 | |||
a6d0e3696c | |||
11cf3680e4 | |||
3e0fab6b7c | |||
b6170db1a1 | |||
23f8696317 | |||
bb56564900 | |||
1abad9978f | |||
79d30bab54 | |||
3402d07abe | |||
97324c96a4 | |||
39c3842621 | |||
281a9b2cea | |||
5c1597cad1 | |||
8160e875a0 | |||
78ded07954 | |||
9a3b7fa906 | |||
72d9d5e917 | |||
b10c9b4f5b | |||
2a4ea9a546 | |||
3b1800be94 | |||
06b9d2a6f2 | |||
44b2cef83a | |||
18605d6785 | |||
b25dfecb18 | |||
5993a38ba3 | |||
7feef42e8a | |||
564f57d1e5 | |||
f57b9c57df | |||
47b5294b0f | |||
ac1f941edb | |||
5c09d5c3de | |||
6f833c7881 | |||
1a15cf84c2 | |||
62cf44b8ab | |||
9b99cf4a6e | |||
37d6004251 | |||
63606bb409 | |||
c8b574f749 | |||
faf828b476 | |||
f0add77de5 | |||
94b1403ad5 | |||
e71de26aba | |||
99d4c8c29c | |||
9403ce82bc | |||
bfe9ebcbe1 | |||
95230ec702 | |||
44179d7444 | |||
73676ad37b | |||
2eb09c826d | |||
2f98888db6 | |||
f08fd41282 | |||
9e00724c38 | |||
609dad3799 | |||
d9291954b9 | |||
6395dd64a4 | |||
dd4b661dbd | |||
d92db14241 | |||
d4778104b5 | |||
44166a150c | |||
81b68b0af3 | |||
4bd848f24f | |||
90cbd70d1a | |||
09e4c244ee | |||
1132b67b5b | |||
693bf1dafb | |||
d6c894efaf | |||
6bbd149e98 | |||
6ea1047585 | |||
c8561ecf26 | |||
82293b94c3 | |||
29b393e43a | |||
fc51f86b72 | |||
6732f0193a | |||
fe8b2fabe7 | |||
51055c14a6 | |||
5b263ac6ad | |||
44024f2c65 | |||
1b8caf3d75 | |||
4a02dc0828 | |||
76c9bd00d0 | |||
3e3db580fd | |||
af67f022ca | |||
e87c7fcb39 | |||
00347ec781 | |||
87a49405b0 | |||
12938b82fb | |||
156df2c81b | |||
06e53aa487 | |||
91254bd9d8 | |||
a6a6f70128 | |||
f887037a8f | |||
0d6cd2b808 | |||
5b63488c25 | |||
0b67bb8c25 | |||
4612821946 | |||
498eb02049 | |||
bd7de9dac9 | |||
e4e5815242 | |||
b2b3768bb4 | |||
af1745a763 | |||
9198b06ea6 | |||
560a346d57 | |||
5f54519b4f | |||
6dc39d84cf | |||
e65fce8ed3 | |||
cc6299ecbc | |||
775a16b0b7 | |||
07eabc062e | |||
b768d8a09c | |||
db20edef69 | |||
c9f4f828d5 | |||
9036f1644f | |||
9648bf795a | |||
30b452b470 | |||
3b34c992bc | |||
5af9ae9e60 | |||
089368c15f | |||
b3bdf9f356 | |||
4f3ea0379e | |||
3680332325 | |||
d4bb84367f | |||
4a4c3fdfcd | |||
ade2298735 | |||
72d5a88af5 | |||
1eeadd7098 | |||
9bd8fcde1e | |||
b535df1554 | |||
de23395fa7 | |||
2d5cba630c | |||
7609a96a35 | |||
ec6fcf3b1c | |||
baee9fe286 | |||
ceccaf7a5e | |||
109d53b7b9 | |||
0581ec396c | |||
291715286b | |||
e0727ced13 | |||
5b1a536d50 | |||
1e995ea2fd | |||
69234f4a76 | |||
e0ca30553b | |||
02612a3fc9 | |||
e3bf1385e6 | |||
cc2dce45d0 | |||
6c9c08c370 | |||
da6299445a | |||
9c2c24ec48 | |||
cae0904160 | |||
50e129f5a7 | |||
75f6817a51 | |||
8d7ab23b49 | |||
d19af41db4 | |||
41794f6b58 | |||
0b21956edb | |||
364d764889 | |||
7567afbbe5 | |||
6c99667b6e | |||
b6fdc3eb47 | |||
f03ab69a35 | |||
d12460123e | |||
a21becf7ee | |||
edbc97225d | |||
8ba32e219f | |||
d115b58cdc | |||
adb73b6025 | |||
63d750f310 | |||
eab6ed778d | |||
8eb0d43c12 | |||
66571f64a4 | |||
bfab33ef79 | |||
51c3e0aa80 | |||
663e1ed158 | |||
4a0e10fb2c | |||
b137ebdd17 | |||
133ef7e465 | |||
162d4bb3c6 | |||
14c543231c | |||
84281bf675 | |||
953e140a18 | |||
11f43360d1 | |||
9b9695ab8e | |||
c74dc9dd6c | |||
81f54f909e | |||
222a1655f5 | |||
c2384597ef | |||
c5c53ed8b4 | |||
0690c3358d | |||
6d57b48a53 | |||
e7615ddc22 | |||
313c24a31b | |||
37288e522a | |||
b86553c7ad | |||
c9898e0ec3 | |||
ab8a771dbd | |||
e8dd996703 | |||
586daa6b4c | |||
cdd2bdabee | |||
35d50ab5b9 | |||
dcdb50b64b | |||
f19e4dd1df | |||
3be74ac634 | |||
35b6a020b9 | |||
8b5cc1230a | |||
25a70469f4 | |||
6fbb9ceb5e | |||
7c2b2ea9c9 | |||
b9701c2a2b | |||
17ae27190d | |||
18be6e0b30 | |||
0429b7714f | |||
b0cfb6905a | |||
a9a25fda42 | |||
31aa060bca | |||
39e5d9287e | |||
81ccfc576f | |||
32e33aabdf | |||
69e5427be1 | |||
c90c47072f | |||
cb5ee26540 | |||
d402841b54 | |||
bf6c5bc225 | |||
ba8ec7e963 | |||
8b2b9b83b7 | |||
70ab198221 | |||
fef753fa6d | |||
ec663d8069 | |||
ad83cd82e1 | |||
c1b0c45bee | |||
153fe65c01 | |||
52692d3cd3 | |||
8d5cfe4ffc | |||
5feff1c415 | |||
3c0a082894 | |||
105f98fbf8 | |||
ce2ff1ac01 | |||
f20818de31 | |||
2b2f9ccf8c | |||
cfce719c66 | |||
cdc7250cd8 | |||
ffd143be82 | |||
18d1ba3422 | |||
610b48c5b0 | |||
b2ea083eeb | |||
2873a17c55 | |||
815ba27f75 | |||
63a12e1e2d | |||
696adeb0f6 | |||
cabf079ae4 | |||
02cf813eff | |||
7d2d4b1918 | |||
fd14f64e26 | |||
edb5fb88aa | |||
b55726b350 | |||
b5f6f43095 | |||
15cd8916df | |||
dd0b358af5 | |||
a649299e76 | |||
f2558890f5 | |||
7a8e41e8ee |
@ -5,6 +5,9 @@ build_deps() {
|
||||
if [[ "${BUILD_MINGW}" == ON ]]; then
|
||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_MINGW}"
|
||||
fi
|
||||
if [[ "${FUNCTIONALTEST}" == "functionaltest-lua" ]]; then
|
||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
|
||||
fi
|
||||
|
||||
rm -rf "${DEPS_BUILD_DIR}"
|
||||
|
||||
|
@ -53,7 +53,7 @@ run_unittests() {
|
||||
}
|
||||
|
||||
run_functionaltests() {
|
||||
if ! ${MAKE_CMD} -C "${BUILD_DIR}" functionaltest; then
|
||||
if ! ${MAKE_CMD} -C "${BUILD_DIR}" ${FUNCTIONALTEST}; then
|
||||
asan_check "${LOG_DIR}"
|
||||
valgrind_check "${LOG_DIR}"
|
||||
exit 1
|
||||
|
12
.editorconfig
Normal file
12
.editorconfig
Normal file
@ -0,0 +1,12 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
charset = utf_8
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
tab_width = 4
|
@ -53,6 +53,8 @@ env:
|
||||
# if the tests were successful, but don't have this information
|
||||
# available in before_cache (which is run before after_success).
|
||||
- SUCCESS_MARKER="$BUILD_DIR/.tests_successful"
|
||||
# default target name for functional tests
|
||||
- FUNCTIONALTEST=functionaltest
|
||||
|
||||
matrix:
|
||||
include:
|
||||
@ -60,6 +62,9 @@ matrix:
|
||||
env: CI_TARGET=lint
|
||||
- os: linux
|
||||
compiler: gcc-5
|
||||
- os: linux
|
||||
compiler: gcc-5
|
||||
env: FUNCTIONALTEST=functionaltest-lua
|
||||
- os: linux
|
||||
# Travis creates a cache per compiler.
|
||||
# Set a different value here to store 32-bit
|
||||
|
@ -1,5 +1,9 @@
|
||||
cmake_minimum_required(VERSION 2.8.7)
|
||||
project(NEOVIM)
|
||||
project(nvim)
|
||||
|
||||
if(POLICY CMP0059)
|
||||
cmake_policy(SET CMP0059 OLD) # Needed until cmake 2.8.12. #4389
|
||||
endif()
|
||||
|
||||
# Point CMake at any custom modules we may ship
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
@ -55,7 +59,7 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||
# version string, else it is combined with the result of `git describe`.
|
||||
set(NVIM_VERSION_MAJOR 0)
|
||||
set(NVIM_VERSION_MINOR 1)
|
||||
set(NVIM_VERSION_PATCH 2)
|
||||
set(NVIM_VERSION_PATCH 4)
|
||||
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||
|
||||
file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR)
|
||||
@ -153,7 +157,11 @@ if(${INIT_FLAGS_NAME})
|
||||
set(CMAKE_REQUIRED_FLAGS "${${INIT_FLAGS_NAME}}")
|
||||
endif()
|
||||
|
||||
# Include <string.h> because some toolchains define _FORTIFY_SOURCE=2 in
|
||||
# internal header files, which should in turn be #included by <string.h>.
|
||||
check_c_source_compiles("
|
||||
#include <string.h>
|
||||
|
||||
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 1
|
||||
#error \"_FORTIFY_SOURCE > 1\"
|
||||
#endif
|
||||
@ -202,6 +210,12 @@ if(MSVC)
|
||||
else()
|
||||
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
|
||||
-Wstrict-prototypes -std=gnu99)
|
||||
|
||||
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
|
||||
# 3.4.1 used there.
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||
add_definitions(-Wno-c11-extensions)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
@ -254,6 +268,10 @@ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
|
||||
|
||||
# For O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW flags on older systems
|
||||
# (pre POSIX.1-2008: glibc 2.11 and earlier). #4042
|
||||
add_definitions(-D_GNU_SOURCE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||
@ -349,7 +367,7 @@ endforeach()
|
||||
|
||||
# Find Lua interpreter
|
||||
include(LuaHelpers)
|
||||
set(LUA_DEPENDENCIES lpeg MessagePack bit)
|
||||
set(LUA_DEPENDENCIES lpeg mpack bit)
|
||||
if(NOT LUA_PRG)
|
||||
foreach(CURRENT_LUA_PRG luajit lua)
|
||||
# If LUA_PRG is set find_program() will not search
|
||||
@ -376,6 +394,7 @@ message(STATUS "Using the Lua interpreter ${LUA_PRG}.")
|
||||
|
||||
# Setup busted.
|
||||
find_program(BUSTED_PRG busted)
|
||||
find_program(BUSTED_LUA_PRG busted-lua)
|
||||
if(NOT BUSTED_OUTPUT_TYPE)
|
||||
set(BUSTED_OUTPUT_TYPE "utfTerminal")
|
||||
endif()
|
||||
@ -487,6 +506,20 @@ if(BUSTED_PRG)
|
||||
DEPENDS ${BENCHMARK_PREREQS})
|
||||
endif()
|
||||
|
||||
if(BUSTED_LUA_PRG)
|
||||
add_custom_target(functionaltest-lua
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DBUSTED_PRG=${BUSTED_LUA_PRG}
|
||||
-DNVIM_PRG=$<TARGET_FILE:nvim>
|
||||
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
||||
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||
-DTEST_TYPE=functional
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||
DEPENDS ${FUNCTIONALTEST_PREREQS})
|
||||
endif()
|
||||
|
||||
if(LUACHECK_PRG)
|
||||
add_custom_target(testlint
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
|
16
ISSUE_TEMPLATE.md
Normal file
16
ISSUE_TEMPLATE.md
Normal file
@ -0,0 +1,16 @@
|
||||
- Neovim version:
|
||||
- [ ] Vim behaves differently? Vim version:
|
||||
- Operating system/version:
|
||||
- Terminal name/version:
|
||||
- `$TERM`:
|
||||
|
||||
### Actual behaviour
|
||||
|
||||
### Expected behaviour
|
||||
|
||||
### Steps to reproduce using `nvim -u NORC`
|
||||
|
||||
```
|
||||
nvim -u NORC
|
||||
|
||||
```
|
10
Makefile
10
Makefile
@ -45,6 +45,11 @@ ifneq (,$(USE_BUNDLED_DEPS))
|
||||
BUNDLED_CMAKE_FLAG := -DUSE_BUNDLED=$(USE_BUNDLED_DEPS)
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring functionaltest-lua,$(MAKECMDGOALS)))
|
||||
BUNDLED_LUA_CMAKE_FLAG := -DUSE_BUNDLED_LUA=ON
|
||||
$(shell [ -x .deps/usr/bin/lua ] || rm build/.ran-*)
|
||||
endif
|
||||
|
||||
# For use where we want to make sure only a single job is run. This does issue
|
||||
# a warning, but we need to keep SCRIPTS argument.
|
||||
SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE)
|
||||
@ -74,7 +79,7 @@ build/.ran-third-party-cmake:
|
||||
ifeq ($(call filter-true,$(USE_BUNDLED_DEPS)),)
|
||||
mkdir -p .deps
|
||||
cd .deps && \
|
||||
cmake -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) \
|
||||
cmake -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
|
||||
$(DEPS_CMAKE_FLAGS) ../third-party
|
||||
endif
|
||||
mkdir -p build
|
||||
@ -86,6 +91,9 @@ oldtest: | nvim
|
||||
functionaltest: | nvim
|
||||
+$(BUILD_CMD) -C build functionaltest
|
||||
|
||||
functionaltest-lua: | nvim
|
||||
+$(BUILD_CMD) -C build functionaltest-lua
|
||||
|
||||
testlint: | nvim
|
||||
$(BUILD_CMD) -C build testlint
|
||||
|
||||
|
26
clint.py
26
clint.py
@ -191,6 +191,7 @@ _ERROR_CATEGORIES = [
|
||||
'readability/nul',
|
||||
'readability/todo',
|
||||
'readability/utf8',
|
||||
'readability/increment',
|
||||
'runtime/arrays',
|
||||
'runtime/int',
|
||||
'runtime/invalid_increment',
|
||||
@ -2291,6 +2292,11 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
|
||||
# there's too little whitespace, we get concerned. It's hard to tell,
|
||||
# though, so we punt on this one for now. TODO.
|
||||
|
||||
match = Search(r'(?:[^ (*/![])+(?<!\+\+|--)\*', line)
|
||||
if match:
|
||||
error(filename, linenum, 'whitespace/operators', 2,
|
||||
'Missing space before asterisk in %s' % match.group(0))
|
||||
|
||||
# You should always have whitespace around binary operators.
|
||||
#
|
||||
# Check <= and >= first to avoid false positives with < and >, then
|
||||
@ -2552,7 +2558,7 @@ def CheckBraces(filename, clean_lines, linenum, error):
|
||||
|
||||
# If should always have a brace
|
||||
for blockstart in ('if', 'while', 'for'):
|
||||
if Match(r'\s*{0}[^{{]*$'.format(blockstart), line):
|
||||
if Match(r'\s*{0}(?!\w)[^{{]*$'.format(blockstart), line):
|
||||
pos = line.find(blockstart)
|
||||
pos = line.find('(', pos)
|
||||
if pos > 0:
|
||||
@ -3194,6 +3200,23 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension,
|
||||
error(filename, linenum, 'readability/bool', 4,
|
||||
'Use %s instead of %s.' % (token.lower(), token))
|
||||
|
||||
# Detect preincrement/predecrement
|
||||
match = Match(r'^\s*(?:\+\+|--)', line)
|
||||
if match:
|
||||
error(filename, linenum, 'readability/increment', 5,
|
||||
'Do not use preincrement in statements, '
|
||||
'use postincrement instead')
|
||||
# Detect preincrement/predecrement in for(;; preincrement)
|
||||
match = Search(r';\s*(\+\+|--)', line)
|
||||
if match:
|
||||
end_pos, end_depth = FindEndOfExpressionInLine(line, match.start(1), 1,
|
||||
'(', ')')
|
||||
expr = line[match.start(1):end_pos]
|
||||
if end_depth == 0 and ';' not in expr and ' = ' not in expr:
|
||||
error(filename, linenum, 'readability/increment', 4,
|
||||
'Do not use preincrement in statements, including '
|
||||
'for(;; action)')
|
||||
|
||||
|
||||
def ProcessLine(filename, file_extension, clean_lines, line,
|
||||
include_state, function_state, nesting_state, error,
|
||||
@ -3484,6 +3507,7 @@ def main():
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
# vim: ts=4 sts=4 sw=4
|
||||
|
||||
# Ignore "too complex" warnings when using pymode.
|
||||
# pylama:ignore=C901
|
||||
|
@ -2,7 +2,11 @@ get_filename_component(LINT_DIR ${LINT_DIR} ABSOLUTE)
|
||||
get_filename_component(LINT_PREFIX ${LINT_DIR} PATH)
|
||||
set(LINT_SUPPRESS_FILE "${LINT_PREFIX}/errors.json")
|
||||
|
||||
file(GLOB_RECURSE LINT_FILES ${LINT_DIR}/*.c ${LINT_DIR}/*.h)
|
||||
if(DEFINED ENV{LINT_FILE})
|
||||
file(GLOB_RECURSE LINT_FILES "$ENV{LINT_FILE}")
|
||||
else()
|
||||
file(GLOB_RECURSE LINT_FILES ${LINT_DIR}/*.c ${LINT_DIR}/*.h)
|
||||
endif()
|
||||
|
||||
set(LINT_ARGS)
|
||||
|
||||
|
@ -12,6 +12,9 @@
|
||||
#define ARCH_32
|
||||
#endif
|
||||
|
||||
#define PROJECT_NAME "@PROJECT_NAME@"
|
||||
#define LOCALE_INSTALL_DIR "@CMAKE_INSTALL_FULL_LOCALEDIR@"
|
||||
|
||||
#cmakedefine HAVE__NSGETENVIRON
|
||||
#cmakedefine HAVE_FD_CLOEXEC
|
||||
#cmakedefine HAVE_FSEEKO
|
||||
|
@ -35,7 +35,7 @@ add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
|
||||
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
|
||||
-u NONE
|
||||
-i NONE
|
||||
-es
|
||||
-e
|
||||
--headless
|
||||
-c "helptags ++t ."
|
||||
-c quit
|
||||
|
@ -11,6 +11,8 @@ catch /E145:/
|
||||
" Ignore the error in restricted mode
|
||||
endtry
|
||||
|
||||
" Load man page {page} from {section}
|
||||
" call man#get_page([{section}, ]{page})
|
||||
function man#get_page(...) abort
|
||||
let invoked_from_man = (&filetype ==# 'man')
|
||||
|
||||
@ -20,21 +22,14 @@ function man#get_page(...) abort
|
||||
elseif a:0 > 2
|
||||
echoerr 'too many arguments'
|
||||
return
|
||||
elseif a:0 == 2
|
||||
let [page, sect] = [a:2, 0 + a:1]
|
||||
elseif type(1) == type(a:1)
|
||||
let [page, sect] = ['<cword>', a:1]
|
||||
else
|
||||
let [page, sect] = [a:1, '']
|
||||
endif
|
||||
|
||||
if page == '<cword>'
|
||||
let page = expand('<cword>')
|
||||
endif
|
||||
let sect = get(a:000, 0)
|
||||
let page = get(a:000, 1, sect)
|
||||
|
||||
let [page, sect] = s:parse_page_and_section(sect, page)
|
||||
|
||||
if 0 + sect > 0 && s:find_page(sect, page) == 0
|
||||
if !empty(sect) && s:find_page(sect, page) == 0
|
||||
let sect = ''
|
||||
endif
|
||||
|
||||
@ -54,9 +49,9 @@ function man#get_page(...) abort
|
||||
let thiswin = winnr()
|
||||
wincmd b
|
||||
if winnr() > 1
|
||||
exe "norm! " . thiswin . "\<C-W>w"
|
||||
exec thiswin . 'wincmd w'
|
||||
while 1
|
||||
if &filetype == 'man'
|
||||
if &filetype ==# 'man'
|
||||
break
|
||||
endif
|
||||
wincmd w
|
||||
@ -80,11 +75,11 @@ function man#get_page(...) abort
|
||||
endif
|
||||
silent exec 'r!/usr/bin/man '.s:cmd(sect, page).' | col -b'
|
||||
" Remove blank lines from top and bottom.
|
||||
while getline(1) =~ '^\s*$'
|
||||
silent keepjumps norm! gg"_dd
|
||||
while getline(1) =~# '^\s*$'
|
||||
silent keepjumps 1delete _
|
||||
endwhile
|
||||
while getline('$') =~ '^\s*$'
|
||||
silent keepjumps norm! G"_dd
|
||||
while getline('$') =~# '^\s*$'
|
||||
silent keepjumps $delete _
|
||||
endwhile
|
||||
setlocal nomodified
|
||||
setlocal filetype=man
|
||||
@ -118,15 +113,11 @@ endfunction
|
||||
" Expects a string like 'access' or 'access(2)'.
|
||||
function s:parse_page_and_section(sect, str) abort
|
||||
try
|
||||
let save_isk = &iskeyword
|
||||
setlocal iskeyword-=(,)
|
||||
let page = substitute(a:str, '(*\(\k\+\).*', '\1', '')
|
||||
let sect = substitute(a:str, '\(\k\+\)(\([^()]*\)).*', '\2', '')
|
||||
if sect == page || -1 == match(sect, '^[0-9 ]\+$')
|
||||
let [page, sect] = matchlist(a:str, '\v\C([-.[:alnum:]_]+)%(\(([-.[:alnum:]_]+)\))?')[1:2]
|
||||
if empty(sect)
|
||||
let sect = a:sect
|
||||
endif
|
||||
catch
|
||||
let &l:iskeyword = save_isk
|
||||
echoerr 'man.vim: failed to parse: "'.a:str.'"'
|
||||
endtry
|
||||
|
||||
@ -134,7 +125,7 @@ function s:parse_page_and_section(sect, str) abort
|
||||
endfunction
|
||||
|
||||
function s:cmd(sect, page) abort
|
||||
if 0 + a:sect > 0
|
||||
if !empty(a:sect)
|
||||
return s:man_sect_arg.' '.a:sect.' '.a:page
|
||||
endif
|
||||
return a:page
|
||||
@ -142,10 +133,5 @@ endfunction
|
||||
|
||||
function s:find_page(sect, page) abort
|
||||
let where = system('/usr/bin/man '.s:man_find_arg.' '.s:cmd(a:sect, a:page))
|
||||
if where !~ "^/"
|
||||
if matchstr(where, " [^ ]*$") !~ "^ /"
|
||||
return 0
|
||||
endif
|
||||
endif
|
||||
return 1
|
||||
return (where =~# '^ */')
|
||||
endfunction
|
||||
|
@ -356,6 +356,8 @@ let s:MSGPACK_STANDARD_TYPES = {
|
||||
\type(''): 'binary',
|
||||
\type([]): 'array',
|
||||
\type({}): 'map',
|
||||
\type(v:true): 'boolean',
|
||||
\type(v:null): 'nil',
|
||||
\}
|
||||
|
||||
""
|
||||
@ -379,7 +381,7 @@ endfunction
|
||||
""
|
||||
" Dump boolean value.
|
||||
function s:msgpack_dump_boolean(v) abort
|
||||
return a:v._VAL ? 'TRUE' : 'FALSE'
|
||||
return (a:v is v:true || (a:v isnot v:false && a:v._VAL)) ? 'TRUE' : 'FALSE'
|
||||
endfunction
|
||||
|
||||
""
|
||||
@ -395,7 +397,8 @@ endfunction
|
||||
""
|
||||
" Dump floating-point value.
|
||||
function s:msgpack_dump_float(v) abort
|
||||
return string(type(a:v) == type({}) ? a:v._VAL : a:v)
|
||||
return substitute(string(type(a:v) == type({}) ? a:v._VAL : a:v),
|
||||
\'\V\^\(-\)\?str2float(''\(inf\|nan\)'')\$', '\1\2', '')
|
||||
endfunction
|
||||
|
||||
""
|
||||
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
|
||||
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" URL: https://github.com/shawncplus/phpcomplete.vim
|
||||
" Last Change: 2015 Apr 02
|
||||
" Last Change: 2015 Jul 13
|
||||
"
|
||||
" OPTIONS:
|
||||
"
|
||||
@ -318,7 +318,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
||||
\ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
|
||||
if f_name =~? '^'.substitute(a:base, '\\', '\\\\', 'g')
|
||||
let f_args = matchstr(i,
|
||||
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|$\)')
|
||||
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|$\)')
|
||||
let int_functions[f_name.'('] = f_args.')'
|
||||
endif
|
||||
endfor
|
||||
@ -646,7 +646,7 @@ function! phpcomplete#CompleteUnknownClass(base, context) " {{{
|
||||
let f_name = matchstr(i,
|
||||
\ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
|
||||
let f_args = matchstr(i,
|
||||
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|$\)')
|
||||
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|$\)')
|
||||
|
||||
let int_functions[f_name.'('] = f_args.')'
|
||||
endfor
|
||||
@ -981,7 +981,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
|
||||
let f_name = matchstr(i,
|
||||
\ 'function\s*&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
|
||||
let f_args = matchstr(i,
|
||||
\ 'function\s*&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|\_$\)')
|
||||
\ 'function\s*&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|\_$\)')
|
||||
if f_name != '' && stridx(f_name, '__') != 0
|
||||
let c_functions[f_name.'('] = f_args
|
||||
if g:phpcomplete_parse_docblock_comments
|
||||
@ -1379,8 +1379,8 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
|
||||
" Get Structured information of all classes and subclasses including namespace and includes
|
||||
" try to find the method's return type in docblock comment
|
||||
for classstructure in classcontents
|
||||
let doclock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method
|
||||
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), doclock_target_pattern)
|
||||
let docblock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method
|
||||
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern)
|
||||
if doc_str != ''
|
||||
break
|
||||
endif
|
||||
@ -1659,7 +1659,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
|
||||
" function declaration line
|
||||
if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*('
|
||||
let function_lines = join(reverse(lines), " ")
|
||||
let function_lines = join(reverse(copy(lines)), " ")
|
||||
" search for type hinted arguments
|
||||
if function_lines =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.class_name_pattern.'\s\+'.object && !object_is_array
|
||||
let f_args = matchstr(function_lines, '\cfunction\(\s\+'.function_name_pattern.'\)\?\s*(\zs.\{-}\ze)')
|
||||
@ -1700,10 +1700,12 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
|
||||
" try to find the next non-comment or string ";" char
|
||||
let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s\+\(clone\)\?\s*'.variable_name_pattern)
|
||||
let filelines = reverse(lines)
|
||||
let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
|
||||
let filelines = reverse(copy(lines))
|
||||
let [pos, char] = s:getNextCharWithPos(filelines, [len(filelines) - i, start_col])
|
||||
let chars_read = 1
|
||||
let last_pos = pos
|
||||
" function_boundary == 0 if we are not in a function
|
||||
let real_lines_offset = len(function_boundary) == 1 ? 1 : function_boundary[0][0]
|
||||
" read while end of the file
|
||||
while char != 'EOF' && chars_read < 1000
|
||||
let last_pos = pos
|
||||
@ -1711,7 +1713,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let chars_read += 1
|
||||
" we got a candidate
|
||||
if char == ';'
|
||||
let synIDName = synIDattr(synID(pos[0] + 1, pos[1] + 1, 0), 'name')
|
||||
" pos values is relative to the function's lines,
|
||||
" line 0 need to be offsetted with the line number
|
||||
" where te function was started to get the line number
|
||||
" in real buffer terms
|
||||
let synIDName = synIDattr(synID(real_lines_offset + pos[0], pos[1] + 1, 0), 'name')
|
||||
" it's not a comment or string, end search
|
||||
if synIDName !~? 'comment\|string'
|
||||
break
|
||||
@ -1719,7 +1725,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
endif
|
||||
endwhile
|
||||
|
||||
let prev_context = phpcomplete#GetCurrentInstruction(last_pos[0] + 1, last_pos[1], b:phpbegin)
|
||||
let prev_context = phpcomplete#GetCurrentInstruction(real_lines_offset + last_pos[0], last_pos[1], b:phpbegin)
|
||||
if prev_context == ''
|
||||
" cannot get previous context give up
|
||||
return
|
||||
@ -1739,13 +1745,14 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
|
||||
" assignment for the variable in question with a function on the right hand side
|
||||
if line =~# '^\s*'.object.'\s*=&\?\s*'.function_invocation_pattern
|
||||
|
||||
" try to find the next non-comment or string ";" char
|
||||
let start_col = match(line, '\C^\s*'.object.'\s*=\zs&\?\s*'.function_invocation_pattern)
|
||||
let filelines = reverse(lines)
|
||||
let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
|
||||
let filelines = reverse(copy(lines))
|
||||
let [pos, char] = s:getNextCharWithPos(filelines, [len(filelines) - i, start_col])
|
||||
let chars_read = 1
|
||||
let last_pos = pos
|
||||
" function_boundary == 0 if we are not in a function
|
||||
let real_lines_offset = len(function_boundary) == 1 ? 1 : function_boundary[0][0]
|
||||
" read while end of the file
|
||||
while char != 'EOF' && chars_read < 1000
|
||||
let last_pos = pos
|
||||
@ -1753,7 +1760,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let chars_read += 1
|
||||
" we got a candidate
|
||||
if char == ';'
|
||||
let synIDName = synIDattr(synID(pos[0] + 1, pos[1] + 1, 0), 'name')
|
||||
" pos values is relative to the function's lines,
|
||||
" line 0 need to be offsetted with the line number
|
||||
" where te function was started to get the line number
|
||||
" in real buffer terms
|
||||
let synIDName = synIDattr(synID(real_lines_offset + pos[0], pos[1] + 1, 0), 'name')
|
||||
" it's not a comment or string, end search
|
||||
if synIDName !~? 'comment\|string'
|
||||
break
|
||||
@ -1761,7 +1772,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
endif
|
||||
endwhile
|
||||
|
||||
let prev_context = phpcomplete#GetCurrentInstruction(last_pos[0] + 1, last_pos[1], b:phpbegin)
|
||||
let prev_context = phpcomplete#GetCurrentInstruction(real_lines_offset + last_pos[0], last_pos[1], b:phpbegin)
|
||||
if prev_context == ''
|
||||
" cannot get previous context give up
|
||||
return
|
||||
@ -1864,6 +1875,9 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{
|
||||
if has_key(g:php_builtin_classes, tolower(a:classname)) && (a:namespace == '' || a:namespace == '\')
|
||||
return 'VIMPHP_BUILTINOBJECT'
|
||||
endif
|
||||
if has_key(g:php_builtin_interfaces, tolower(a:classname)) && (a:namespace == '' || a:namespace == '\')
|
||||
return 'VIMPHP_BUILTINOBJECT'
|
||||
endif
|
||||
|
||||
if a:namespace == '' || a:namespace == '\'
|
||||
let search_namespace = '\'
|
||||
@ -1876,7 +1890,7 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{
|
||||
let i = 1
|
||||
while i < line('.')
|
||||
let line = getline(line('.')-i)
|
||||
if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*\(class\|interface\|trait\)\s*'.a:classname.'\(\s\+\|$\)' && tolower(current_namespace) == search_namespace
|
||||
if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*\(class\|interface\|trait\)\s*'.a:classname.'\(\s\+\|$\|{\)' && tolower(current_namespace) == search_namespace
|
||||
return expand('%:p')
|
||||
else
|
||||
let i += 1
|
||||
@ -2048,9 +2062,18 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
let content = join(getline(cfline, endline), "\n")
|
||||
" Catch extends
|
||||
if content =~? 'extends'
|
||||
let extends_class = matchstr(content, 'class\_s\+'.a:class_name.'\_s\+extends\_s\+\zs'.class_name_pattern.'\ze')
|
||||
let extends_string = matchstr(content, '\(class\|interface\)\_s\+'.a:class_name.'\_.\+extends\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze\(extends\|{\)')
|
||||
let extended_classes = map(split(extends_string, '\(,\|\_s\)\+'), 'substitute(v:val, "\\_s\\+", "", "g")')
|
||||
else
|
||||
let extends_class = ''
|
||||
let extended_classes = ''
|
||||
endif
|
||||
|
||||
" Catch implements
|
||||
if content =~? 'implements'
|
||||
let implements_string = matchstr(content, 'class\_s\+'.a:class_name.'\_.\+implements\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze')
|
||||
let implemented_interfaces = map(split(implements_string, '\(,\|\_s\)\+'), 'substitute(v:val, "\\_s\\+", "", "g")')
|
||||
else
|
||||
let implemented_interfaces = []
|
||||
endif
|
||||
call searchpair('{', '', '}', 'W')
|
||||
let class_closing_bracket_line = line('.')
|
||||
@ -2108,8 +2131,11 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
\ })
|
||||
|
||||
let all_extends = used_traits
|
||||
if extends_class != ''
|
||||
call add(all_extends, extends_class)
|
||||
if len(extended_classes) > 0
|
||||
call extend(all_extends, extended_classes)
|
||||
endif
|
||||
if len(implemented_interfaces) > 0
|
||||
call extend(all_extends, implemented_interfaces)
|
||||
endif
|
||||
if len(all_extends) > 0
|
||||
for class in all_extends
|
||||
@ -2119,11 +2145,16 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
endif
|
||||
let classlocation = phpcomplete#GetClassLocation(class, namespace)
|
||||
if classlocation == "VIMPHP_BUILTINOBJECT"
|
||||
let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(class)])]
|
||||
if has_key(g:php_builtin_classes, tolower(class))
|
||||
let result += [phpcomplete#GenerateBuiltinClassStub('class', g:php_builtin_classes[tolower(class)])]
|
||||
endif
|
||||
if has_key(g:php_builtin_interfaces, tolower(class))
|
||||
let result += [phpcomplete#GenerateBuiltinClassStub('interface', g:php_builtin_interfaces[tolower(class)])]
|
||||
endif
|
||||
elseif classlocation != '' && filereadable(classlocation)
|
||||
let full_file_path = fnamemodify(classlocation, ':p')
|
||||
let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), class)
|
||||
elseif tolower(current_namespace) == tolower(namespace)
|
||||
elseif tolower(current_namespace) == tolower(namespace) && match(join(a:file_lines, "\n"), '\c\(class\|interface\|trait\)\_s\+'.class.'\(\>\|$\)') != -1
|
||||
" try to find the declaration in the same file.
|
||||
let result += phpcomplete#GetClassContentsStructure(full_file_path, a:file_lines, class)
|
||||
endif
|
||||
@ -2144,43 +2175,53 @@ function! phpcomplete#GetClassContents(classlocation, class_name) " {{{
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
function! phpcomplete#GenerateBuiltinClassStub(class_info) " {{{
|
||||
let re = 'class '.a:class_info['name']." {"
|
||||
for [name, initializer] in items(a:class_info.constants)
|
||||
let re .= "\n\tconst ".name." = ".initializer.";"
|
||||
endfor
|
||||
for [name, info] in items(a:class_info.properties)
|
||||
let re .= "\n\t// @var $".name." ".info.type
|
||||
let re .= "\n\tpublic $".name.";"
|
||||
endfor
|
||||
for [name, info] in items(a:class_info.static_properties)
|
||||
let re .= "\n\t// @var ".name." ".info.type
|
||||
let re .= "\n\tpublic static ".name." = ".info.initializer.";"
|
||||
endfor
|
||||
for [name, info] in items(a:class_info.methods)
|
||||
if name =~ '^__'
|
||||
continue
|
||||
endif
|
||||
let re .= "\n\t/**"
|
||||
let re .= "\n\t * ".name
|
||||
let re .= "\n\t *"
|
||||
let re .= "\n\t * @return ".info.return_type
|
||||
let re .= "\n\t */"
|
||||
let re .= "\n\tpublic function ".name."(".info.signature."){"
|
||||
let re .= "\n\t}"
|
||||
endfor
|
||||
for [name, info] in items(a:class_info.static_methods)
|
||||
let re .= "\n\t/**"
|
||||
let re .= "\n\t * ".name
|
||||
let re .= "\n\t *"
|
||||
let re .= "\n\t * @return ".info.return_type
|
||||
let re .= "\n\t */"
|
||||
let re .= "\n\tpublic static function ".name."(".info.signature."){"
|
||||
let re .= "\n\t}"
|
||||
endfor
|
||||
function! phpcomplete#GenerateBuiltinClassStub(type, class_info) " {{{
|
||||
let re = a:type.' '.a:class_info['name']." {"
|
||||
if has_key(a:class_info, 'constants')
|
||||
for [name, initializer] in items(a:class_info.constants)
|
||||
let re .= "\n\tconst ".name." = ".initializer.";"
|
||||
endfor
|
||||
endif
|
||||
if has_key(a:class_info, 'properties')
|
||||
for [name, info] in items(a:class_info.properties)
|
||||
let re .= "\n\t// @var $".name." ".info.type
|
||||
let re .= "\n\tpublic $".name.";"
|
||||
endfor
|
||||
endif
|
||||
if has_key(a:class_info, 'static_properties')
|
||||
for [name, info] in items(a:class_info.static_properties)
|
||||
let re .= "\n\t// @var ".name." ".info.type
|
||||
let re .= "\n\tpublic static ".name." = ".info.initializer.";"
|
||||
endfor
|
||||
endif
|
||||
if has_key(a:class_info, 'methods')
|
||||
for [name, info] in items(a:class_info.methods)
|
||||
if name =~ '^__'
|
||||
continue
|
||||
endif
|
||||
let re .= "\n\t/**"
|
||||
let re .= "\n\t * ".name
|
||||
let re .= "\n\t *"
|
||||
let re .= "\n\t * @return ".info.return_type
|
||||
let re .= "\n\t */"
|
||||
let re .= "\n\tpublic function ".name."(".info.signature."){"
|
||||
let re .= "\n\t}"
|
||||
endfor
|
||||
endif
|
||||
if has_key(a:class_info, 'static_methods')
|
||||
for [name, info] in items(a:class_info.static_methods)
|
||||
let re .= "\n\t/**"
|
||||
let re .= "\n\t * ".name
|
||||
let re .= "\n\t *"
|
||||
let re .= "\n\t * @return ".info.return_type
|
||||
let re .= "\n\t */"
|
||||
let re .= "\n\tpublic static function ".name."(".info.signature."){"
|
||||
let re .= "\n\t}"
|
||||
endfor
|
||||
endif
|
||||
let re .= "\n}"
|
||||
|
||||
return { 'class': a:class_info['name'],
|
||||
return { a:type : a:class_info['name'],
|
||||
\ 'content': re,
|
||||
\ 'namespace': '',
|
||||
\ 'imports': {},
|
||||
@ -2204,8 +2245,11 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
|
||||
" start backward serch for the comment block
|
||||
while l != 0
|
||||
let line = a:sccontent[l]
|
||||
" if comment end found save line position and end search
|
||||
if line =~? '^\s*\*/'
|
||||
" if it's a one line docblock like comment and we can just return it right away
|
||||
if line =~? '^\s*\/\*\*.\+\*\/\s*$'
|
||||
return substitute(line, '\v^\s*(\/\*\*\s*)|(\s*\*\/)\s*$', '', 'g')
|
||||
"... or if comment end found save line position and end search
|
||||
elseif line =~? '^\s*\*/'
|
||||
let comment_end = l
|
||||
break
|
||||
" ... or the line doesn't blank (only whitespace or nothing) end search
|
||||
@ -2227,6 +2271,7 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
|
||||
endif
|
||||
let l -= 1
|
||||
endwhile
|
||||
|
||||
" no docblock comment start found
|
||||
if comment_start == -1
|
||||
return ''
|
||||
@ -2388,7 +2433,15 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
break
|
||||
endif
|
||||
let block_end_pos = searchpairpos('{', '', '}\|\%$', 'W', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
|
||||
silent! exec block_start_pos[0].','.block_end_pos[0].'d'
|
||||
|
||||
if block_end_pos != [0, 0]
|
||||
" end of the block found, just delete it
|
||||
silent! exec block_start_pos[0].','.block_end_pos[0].'d _'
|
||||
else
|
||||
" block pair not found, use block start as beginning and the end
|
||||
" of the buffer instead
|
||||
silent! exec block_start_pos[0].',$d _'
|
||||
endif
|
||||
endwhile
|
||||
normal! G
|
||||
|
||||
@ -2407,8 +2460,8 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
while i < file_length
|
||||
let line = file_lines[i]
|
||||
|
||||
if line =~? '^\s*namespace\s*'.namespace_name_pattern
|
||||
let current_namespace = matchstr(line, '\c^\s*namespace\s*\zs'.namespace_name_pattern.'\ze')
|
||||
if line =~? '^\(<?php\)\?\s*namespace\s*'.namespace_name_pattern
|
||||
let current_namespace = matchstr(line, '\c^\(<?php\)\?\s*namespace\s*\zs'.namespace_name_pattern.'\ze')
|
||||
break
|
||||
endif
|
||||
|
||||
@ -2571,7 +2624,7 @@ endfunction
|
||||
|
||||
function! phpcomplete#ExpandClassName(classname, current_namespace, imports) " {{{
|
||||
" if there's an imported class, just use that class's information
|
||||
if has_key(a:imports, a:classname) && (a:imports[a:classname].kind == 'c' || a:imports[a:classname].kind == 'i')
|
||||
if has_key(a:imports, a:classname) && (a:imports[a:classname].kind == 'c' || a:imports[a:classname].kind == 'i' || a:imports[a:classname].kind == 't')
|
||||
let namespace = has_key(a:imports[a:classname], 'namespace') ? a:imports[a:classname].namespace : ''
|
||||
return [a:imports[a:classname].name, namespace]
|
||||
endif
|
||||
|
@ -47,6 +47,11 @@ elseif exists('$DISPLAY') && executable('xclip')
|
||||
let s:paste['+'] = 'xclip -o -selection clipboard'
|
||||
let s:copy['*'] = 'xclip -quiet -i -selection primary'
|
||||
let s:paste['*'] = 'xclip -o -selection primary'
|
||||
elseif executable('lemonade')
|
||||
let s:copy['+'] = 'lemonade copy'
|
||||
let s:paste['+'] = 'lemonade paste'
|
||||
let s:copy['*'] = 'lemonade copy'
|
||||
let s:paste['*'] = 'lemonade paste'
|
||||
else
|
||||
echom 'clipboard: No clipboard tool available. See :help nvim-clipboard'
|
||||
finish
|
||||
|
@ -24,12 +24,10 @@ if s:prog == ''
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:plugin_path = expand('<sfile>:p:h').'/script_host.py'
|
||||
|
||||
" The Python provider plugin will run in a separate instance of the Python
|
||||
" host.
|
||||
call remote#host#RegisterClone('legacy-python-provider', 'python')
|
||||
call remote#host#RegisterPlugin('legacy-python-provider', s:plugin_path, [])
|
||||
call remote#host#RegisterPlugin('legacy-python-provider', 'script_host.py', [])
|
||||
|
||||
function! provider#python#Call(method, args)
|
||||
if s:err != ''
|
||||
|
@ -24,12 +24,10 @@ if s:prog == ''
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:plugin_path = expand('<sfile>:p:h').'/script_host.py'
|
||||
|
||||
" The Python3 provider plugin will run in a separate instance of the Python3
|
||||
" host.
|
||||
call remote#host#RegisterClone('legacy-python3-provider', 'python3')
|
||||
call remote#host#RegisterPlugin('legacy-python3-provider', s:plugin_path, [])
|
||||
call remote#host#RegisterPlugin('legacy-python3-provider', 'script_host.py', [])
|
||||
|
||||
function! provider#python3#Call(method, args)
|
||||
if s:err != ''
|
||||
|
@ -5,6 +5,32 @@ endif
|
||||
|
||||
let s:loaded_pythonx_provider = 1
|
||||
|
||||
function! provider#pythonx#Require(host) abort
|
||||
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
|
||||
|
||||
" Python host arguments
|
||||
let args = ['-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()']
|
||||
|
||||
" Collect registered Python plugins into args
|
||||
let python_plugins = remote#host#PluginsForHost(a:host.name)
|
||||
for plugin in python_plugins
|
||||
call add(args, plugin.path)
|
||||
endfor
|
||||
|
||||
try
|
||||
let channel_id = rpcstart((ver == '2' ?
|
||||
\ provider#python#Prog() : provider#python3#Prog()), args)
|
||||
if rpcrequest(channel_id, 'poll') == 'ok'
|
||||
return channel_id
|
||||
endif
|
||||
catch
|
||||
echomsg v:throwpoint
|
||||
echomsg v:exception
|
||||
endtry
|
||||
throw remote#host#LoadErrorForHost(a:host.orig_name,
|
||||
\ '$NVIM_PYTHON_LOG_FILE')
|
||||
endfunction
|
||||
|
||||
function! provider#pythonx#Detect(major_ver) abort
|
||||
let host_var = (a:major_ver == 2) ?
|
||||
\ 'g:python_host_prog' : 'g:python3_host_prog'
|
||||
|
34
runtime/autoload/provider/ruby.vim
Normal file
34
runtime/autoload/provider/ruby.vim
Normal file
@ -0,0 +1,34 @@
|
||||
" The Ruby provider helper
|
||||
if exists('s:loaded_ruby_provider')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:loaded_ruby_provider = 1
|
||||
|
||||
function! provider#ruby#Require(host) abort
|
||||
" Collect registered Ruby plugins into args
|
||||
let args = []
|
||||
let ruby_plugins = remote#host#PluginsForHost(a:host.name)
|
||||
|
||||
for plugin in ruby_plugins
|
||||
call add(args, plugin.path)
|
||||
endfor
|
||||
|
||||
try
|
||||
let channel_id = rpcstart(provider#ruby#Prog(), args)
|
||||
|
||||
if rpcrequest(channel_id, 'poll') == 'ok'
|
||||
return channel_id
|
||||
endif
|
||||
catch
|
||||
echomsg v:throwpoint
|
||||
echomsg v:exception
|
||||
endtry
|
||||
|
||||
throw remote#host#LoadErrorForHost(a:host.orig_name,
|
||||
\ '$NVIM_RUBY_LOG_FILE')
|
||||
endfunction
|
||||
|
||||
function! provider#ruby#Prog() abort
|
||||
return 'neovim-ruby-host'
|
||||
endfunction
|
@ -1,247 +0,0 @@
|
||||
"""Legacy python/python3-vim emulation."""
|
||||
import imp
|
||||
import io
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
import neovim
|
||||
|
||||
__all__ = ('ScriptHost',)
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
debug, info, warn = (logger.debug, logger.info, logger.warn,)
|
||||
|
||||
IS_PYTHON3 = sys.version_info >= (3, 0)
|
||||
|
||||
if IS_PYTHON3:
|
||||
basestring = str
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
from importlib.machinery import PathFinder
|
||||
|
||||
|
||||
@neovim.plugin
|
||||
class ScriptHost(object):
|
||||
|
||||
"""Provides an environment for running python plugins created for Vim."""
|
||||
|
||||
def __init__(self, nvim):
|
||||
"""Initialize the legacy python-vim environment."""
|
||||
self.setup(nvim)
|
||||
# context where all code will run
|
||||
self.module = imp.new_module('__main__')
|
||||
nvim.script_context = self.module
|
||||
# it seems some plugins assume 'sys' is already imported, so do it now
|
||||
exec('import sys', self.module.__dict__)
|
||||
self.legacy_vim = nvim.with_hook(LegacyEvalHook())
|
||||
sys.modules['vim'] = self.legacy_vim
|
||||
|
||||
def setup(self, nvim):
|
||||
"""Setup import hooks and global streams.
|
||||
|
||||
This will add import hooks for importing modules from runtime
|
||||
directories and patch the sys module so 'print' calls will be
|
||||
forwarded to Nvim.
|
||||
"""
|
||||
self.nvim = nvim
|
||||
info('install import hook/path')
|
||||
self.hook = path_hook(nvim)
|
||||
sys.path_hooks.append(self.hook)
|
||||
nvim.VIM_SPECIAL_PATH = '_vim_path_'
|
||||
sys.path.append(nvim.VIM_SPECIAL_PATH)
|
||||
info('redirect sys.stdout and sys.stderr')
|
||||
self.saved_stdout = sys.stdout
|
||||
self.saved_stderr = sys.stderr
|
||||
sys.stdout = RedirectStream(lambda data: nvim.out_write(data))
|
||||
sys.stderr = RedirectStream(lambda data: nvim.err_write(data))
|
||||
|
||||
def teardown(self):
|
||||
"""Restore state modified from the `setup` call."""
|
||||
for plugin in self.installed_plugins:
|
||||
if hasattr(plugin, 'on_teardown'):
|
||||
plugin.teardown()
|
||||
nvim = self.nvim
|
||||
info('uninstall import hook/path')
|
||||
sys.path.remove(nvim.VIM_SPECIAL_PATH)
|
||||
sys.path_hooks.remove(self.hook)
|
||||
info('restore sys.stdout and sys.stderr')
|
||||
sys.stdout = self.saved_stdout
|
||||
sys.stderr = self.saved_stderr
|
||||
|
||||
@neovim.rpc_export('python_execute', sync=True)
|
||||
def python_execute(self, script, range_start, range_stop):
|
||||
"""Handle the `python` ex command."""
|
||||
self._set_current_range(range_start, range_stop)
|
||||
exec(script, self.module.__dict__)
|
||||
|
||||
@neovim.rpc_export('python_execute_file', sync=True)
|
||||
def python_execute_file(self, file_path, range_start, range_stop):
|
||||
"""Handle the `pyfile` ex command."""
|
||||
self._set_current_range(range_start, range_stop)
|
||||
with open(file_path) as f:
|
||||
script = compile(f.read(), file_path, 'exec')
|
||||
exec(script, self.module.__dict__)
|
||||
|
||||
@neovim.rpc_export('python_do_range', sync=True)
|
||||
def python_do_range(self, start, stop, code):
|
||||
"""Handle the `pydo` ex command."""
|
||||
self._set_current_range(start, stop)
|
||||
nvim = self.nvim
|
||||
start -= 1
|
||||
stop -= 1
|
||||
fname = '_vim_pydo'
|
||||
|
||||
# define the function
|
||||
function_def = 'def %s(line, linenr):\n %s' % (fname, code,)
|
||||
exec(function_def, self.module.__dict__)
|
||||
# get the function
|
||||
function = self.module.__dict__[fname]
|
||||
while start <= stop:
|
||||
# Process batches of 5000 to avoid the overhead of making multiple
|
||||
# API calls for every line. Assuming an average line length of 100
|
||||
# bytes, approximately 488 kilobytes will be transferred per batch,
|
||||
# which can be done very quickly in a single API call.
|
||||
sstart = start
|
||||
sstop = min(start + 5000, stop)
|
||||
lines = nvim.current.buffer.get_line_slice(sstart, sstop, True,
|
||||
True)
|
||||
|
||||
exception = None
|
||||
newlines = []
|
||||
linenr = sstart + 1
|
||||
for i, line in enumerate(lines):
|
||||
result = function(line, linenr)
|
||||
if result is None:
|
||||
# Update earlier lines, and skip to the next
|
||||
if newlines:
|
||||
end = sstart + len(newlines) - 1
|
||||
nvim.current.buffer.set_line_slice(sstart, end,
|
||||
True, True,
|
||||
newlines)
|
||||
sstart += len(newlines) + 1
|
||||
newlines = []
|
||||
pass
|
||||
elif isinstance(result, basestring):
|
||||
newlines.append(result)
|
||||
else:
|
||||
exception = TypeError('pydo should return a string ' +
|
||||
'or None, found %s instead'
|
||||
% result.__class__.__name__)
|
||||
break
|
||||
linenr += 1
|
||||
|
||||
start = sstop + 1
|
||||
if newlines:
|
||||
end = sstart + len(newlines) - 1
|
||||
nvim.current.buffer.set_line_slice(sstart, end, True, True,
|
||||
newlines)
|
||||
if exception:
|
||||
raise exception
|
||||
# delete the function
|
||||
del self.module.__dict__[fname]
|
||||
|
||||
@neovim.rpc_export('python_eval', sync=True)
|
||||
def python_eval(self, expr):
|
||||
"""Handle the `pyeval` vim function."""
|
||||
return eval(expr, self.module.__dict__)
|
||||
|
||||
def _set_current_range(self, start, stop):
|
||||
current = self.legacy_vim.current
|
||||
current.range = current.buffer.range(start, stop)
|
||||
|
||||
|
||||
class RedirectStream(io.IOBase):
|
||||
def __init__(self, redirect_handler):
|
||||
self.redirect_handler = redirect_handler
|
||||
|
||||
def write(self, data):
|
||||
self.redirect_handler(data)
|
||||
|
||||
def writelines(self, seq):
|
||||
self.redirect_handler('\n'.join(seq))
|
||||
|
||||
|
||||
class LegacyEvalHook(neovim.SessionHook):
|
||||
|
||||
"""Injects legacy `vim.eval` behavior to a Nvim instance."""
|
||||
|
||||
def __init__(self):
|
||||
super(LegacyEvalHook, self).__init__(from_nvim=self._string_eval)
|
||||
|
||||
def _string_eval(self, obj, session, method, kind):
|
||||
if method == 'vim_eval':
|
||||
if IS_PYTHON3:
|
||||
if isinstance(obj, (int, float)):
|
||||
return str(obj)
|
||||
elif isinstance(obj, (int, long, float)):
|
||||
return str(obj)
|
||||
return obj
|
||||
|
||||
|
||||
# This was copied/adapted from nvim-python help
|
||||
def path_hook(nvim):
|
||||
def _get_paths():
|
||||
return discover_runtime_directories(nvim)
|
||||
|
||||
def _find_module(fullname, oldtail, path):
|
||||
idx = oldtail.find('.')
|
||||
if idx > 0:
|
||||
name = oldtail[:idx]
|
||||
tail = oldtail[idx+1:]
|
||||
fmr = imp.find_module(name, path)
|
||||
module = imp.find_module(fullname[:-len(oldtail)] + name, *fmr)
|
||||
return _find_module(fullname, tail, module.__path__)
|
||||
else:
|
||||
return imp.find_module(fullname, path)
|
||||
|
||||
class VimModuleLoader(object):
|
||||
def __init__(self, module):
|
||||
self.module = module
|
||||
|
||||
def load_module(self, fullname, path=None):
|
||||
# Check sys.modules, required for reload (see PEP302).
|
||||
if fullname in sys.modules:
|
||||
return sys.modules[fullname]
|
||||
return imp.load_module(fullname, *self.module)
|
||||
|
||||
class VimPathFinder(object):
|
||||
@staticmethod
|
||||
def find_module(fullname, path=None):
|
||||
"Method for Python 2.7 and 3.3."
|
||||
try:
|
||||
return VimModuleLoader(
|
||||
_find_module(fullname, fullname, path or _get_paths()))
|
||||
except ImportError:
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def find_spec(fullname, path=None, target=None):
|
||||
"Method for Python 3.4+."
|
||||
return PathFinder.find_spec(fullname, path or _get_paths(), target)
|
||||
|
||||
def hook(path):
|
||||
if path == nvim.VIM_SPECIAL_PATH:
|
||||
return VimPathFinder
|
||||
else:
|
||||
raise ImportError
|
||||
|
||||
return hook
|
||||
|
||||
|
||||
def discover_runtime_directories(nvim):
|
||||
rv = []
|
||||
for path in nvim.list_runtime_paths():
|
||||
if not os.path.exists(path):
|
||||
continue
|
||||
path1 = os.path.join(path, 'pythonx')
|
||||
if IS_PYTHON3:
|
||||
path2 = os.path.join(path, 'python3')
|
||||
else:
|
||||
path2 = os.path.join(path, 'python2')
|
||||
if os.path.exists(path1):
|
||||
rv.append(path1)
|
||||
if os.path.exists(path2):
|
||||
rv.append(path2)
|
||||
return rv
|
@ -1,7 +1,7 @@
|
||||
"python3complete.vim - Omni Completion for python
|
||||
" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
|
||||
" Version: 0.9
|
||||
" Last Updated: 18 Jun 2009
|
||||
" Last Updated: 18 Jun 2009 (small fix 2015 Sep 14 from Debian)
|
||||
"
|
||||
" Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim
|
||||
"
|
||||
@ -359,6 +359,7 @@ class PyParser:
|
||||
def __init__(self):
|
||||
self.top = Scope('global',0)
|
||||
self.scope = self.top
|
||||
self.parserline = 0
|
||||
|
||||
def _parsedotname(self,pre=None):
|
||||
#returns (dottedname, nexttoken)
|
||||
|
@ -1,7 +1,7 @@
|
||||
function! remote#define#CommandOnHost(host, method, sync, name, opts)
|
||||
let prefix = ''
|
||||
|
||||
if has_key(a:opts, 'range')
|
||||
if has_key(a:opts, 'range')
|
||||
if a:opts.range == '' || a:opts.range == '%'
|
||||
" -range or -range=%, pass the line range in a list
|
||||
let prefix = '<line1>,<line2>'
|
||||
@ -30,7 +30,7 @@ function! remote#define#CommandOnHost(host, method, sync, name, opts)
|
||||
exe s:GetCommandPrefix(a:name, a:opts)
|
||||
\ .' call remote#define#CommandBootstrap("'.a:host.'"'
|
||||
\ . ', "'.a:method.'"'
|
||||
\ . ', "'.a:sync.'"'
|
||||
\ . ', '.string(a:sync)
|
||||
\ . ', "'.a:name.'"'
|
||||
\ . ', '.string(a:opts).''
|
||||
\ . ', "'.join(forward_args, '').'"'
|
||||
@ -94,7 +94,7 @@ function! remote#define#AutocmdOnHost(host, method, sync, name, opts)
|
||||
let bootstrap_def = s:GetAutocmdPrefix(a:name, a:opts)
|
||||
\ .' call remote#define#AutocmdBootstrap("'.a:host.'"'
|
||||
\ . ', "'.a:method.'"'
|
||||
\ . ', "'.a:sync.'"'
|
||||
\ . ', '.string(a:sync)
|
||||
\ . ', "'.a:name.'"'
|
||||
\ . ', '.string(a:opts).''
|
||||
\ . ', "'.escape(forward, '"').'"'
|
||||
@ -133,7 +133,7 @@ function! remote#define#FunctionOnHost(host, method, sync, name, opts)
|
||||
exe 'autocmd! '.group.' FuncUndefined '.a:name
|
||||
\ .' call remote#define#FunctionBootstrap("'.a:host.'"'
|
||||
\ . ', "'.a:method.'"'
|
||||
\ . ', "'.a:sync.'"'
|
||||
\ . ', '.string(a:sync)
|
||||
\ . ', "'.a:name.'"'
|
||||
\ . ', '.string(a:opts)
|
||||
\ . ', "'.group.'"'
|
||||
@ -157,6 +157,9 @@ endfunction
|
||||
|
||||
function! remote#define#FunctionOnChannel(channel, method, sync, name, opts)
|
||||
let rpcargs = [a:channel, '"'.a:method.'"', 'a:000']
|
||||
if has_key(a:opts, 'range')
|
||||
call add(rpcargs, '[a:firstline, a:lastline]')
|
||||
endif
|
||||
call s:AddEval(rpcargs, a:opts)
|
||||
|
||||
let function_def = s:GetFunctionPrefix(a:name, a:opts)
|
||||
@ -187,7 +190,7 @@ let s:next_gid = 1
|
||||
function! s:GetNextAutocmdGroup()
|
||||
let gid = s:next_gid
|
||||
let s:next_gid += 1
|
||||
|
||||
|
||||
let group_name = 'RPC_DEFINE_AUTOCMD_GROUP_'.gid
|
||||
" Ensure the group is defined
|
||||
exe 'augroup '.group_name.' | augroup END'
|
||||
@ -218,7 +221,11 @@ endfunction
|
||||
|
||||
|
||||
function! s:GetFunctionPrefix(name, opts)
|
||||
return "function! ".a:name."(...)\n"
|
||||
let res = "function! ".a:name."(...)"
|
||||
if has_key(a:opts, 'range')
|
||||
let res = res." range"
|
||||
endif
|
||||
return res."\n"
|
||||
endfunction
|
||||
|
||||
|
||||
|
@ -2,10 +2,11 @@ let s:hosts = {}
|
||||
let s:plugin_patterns = {}
|
||||
let s:remote_plugins_manifest = fnamemodify(expand($MYVIMRC, 1), ':h')
|
||||
\.'/.'.fnamemodify($MYVIMRC, ':t').'-rplugin~'
|
||||
let s:plugins_for_host = {}
|
||||
|
||||
|
||||
" Register a host by associating it with a factory(funcref)
|
||||
function! remote#host#Register(name, pattern, factory)
|
||||
function! remote#host#Register(name, pattern, factory) abort
|
||||
let s:hosts[a:name] = {'factory': a:factory, 'channel': 0, 'initialized': 0}
|
||||
let s:plugin_patterns[a:name] = a:pattern
|
||||
if type(a:factory) == type(1) && a:factory
|
||||
@ -19,7 +20,7 @@ endfunction
|
||||
" as `source`, but it will run as a different process. This can be used by
|
||||
" plugins that should run isolated from other plugins created for the same host
|
||||
" type
|
||||
function! remote#host#RegisterClone(name, orig_name)
|
||||
function! remote#host#RegisterClone(name, orig_name) abort
|
||||
if !has_key(s:hosts, a:orig_name)
|
||||
throw 'No host named "'.a:orig_name.'" is registered'
|
||||
endif
|
||||
@ -34,7 +35,10 @@ endfunction
|
||||
|
||||
|
||||
" Get a host channel, bootstrapping it if necessary
|
||||
function! remote#host#Require(name)
|
||||
function! remote#host#Require(name) abort
|
||||
if empty(s:plugins_for_host)
|
||||
call remote#host#LoadRemotePlugins()
|
||||
endif
|
||||
if !has_key(s:hosts, a:name)
|
||||
throw 'No host named "'.a:name.'" is registered'
|
||||
endif
|
||||
@ -51,7 +55,7 @@ function! remote#host#Require(name)
|
||||
endfunction
|
||||
|
||||
|
||||
function! remote#host#IsRunning(name)
|
||||
function! remote#host#IsRunning(name) abort
|
||||
if !has_key(s:hosts, a:name)
|
||||
throw 'No host named "'.a:name.'" is registered'
|
||||
endif
|
||||
@ -72,7 +76,7 @@ endfunction
|
||||
"
|
||||
" The third item in a declaration is a boolean: non zero means the command,
|
||||
" autocommand or function will be executed synchronously with rpcrequest.
|
||||
function! remote#host#RegisterPlugin(host, path, specs)
|
||||
function! remote#host#RegisterPlugin(host, path, specs) abort
|
||||
let plugins = remote#host#PluginsForHost(a:host)
|
||||
|
||||
for plugin in plugins
|
||||
@ -116,14 +120,21 @@ function! remote#host#RegisterPlugin(host, path, specs)
|
||||
endfunction
|
||||
|
||||
|
||||
function! remote#host#LoadRemotePlugins()
|
||||
function! remote#host#LoadRemotePlugins() abort
|
||||
if filereadable(s:remote_plugins_manifest)
|
||||
exe 'source '.s:remote_plugins_manifest
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:RegistrationCommands(host)
|
||||
function! remote#host#LoadRemotePluginsEvent(event, pattern) abort
|
||||
autocmd! nvim-rplugin
|
||||
call remote#host#LoadRemotePlugins()
|
||||
execute 'silent doautocmd <nomodeline>' a:event a:pattern
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:RegistrationCommands(host) abort
|
||||
" Register a temporary host clone for discovering specs
|
||||
let host_id = a:host.'-registration-clone'
|
||||
call remote#host#RegisterClone(host_id, a:host)
|
||||
@ -138,7 +149,9 @@ function! s:RegistrationCommands(host)
|
||||
endfor
|
||||
let channel = remote#host#Require(host_id)
|
||||
let lines = []
|
||||
let registered = []
|
||||
for path in paths
|
||||
unlet! specs
|
||||
let specs = rpcrequest(channel, 'specs', path)
|
||||
if type(specs) != type([])
|
||||
" host didn't return a spec list, indicates a failure while loading a
|
||||
@ -151,9 +164,10 @@ function! s:RegistrationCommands(host)
|
||||
call add(lines, " \\ ".string(spec).",")
|
||||
endfor
|
||||
call add(lines, " \\ ])")
|
||||
call add(registered, path)
|
||||
endfor
|
||||
echomsg printf("remote/host: %s host registered plugins %s",
|
||||
\ a:host, string(map(copy(paths), "fnamemodify(v:val, ':t')")))
|
||||
\ a:host, string(map(registered, "fnamemodify(v:val, ':t')")))
|
||||
|
||||
" Delete the temporary host clone
|
||||
call rpcstop(s:hosts[host_id].channel)
|
||||
@ -163,7 +177,7 @@ function! s:RegistrationCommands(host)
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:UpdateRemotePlugins()
|
||||
function! remote#host#UpdateRemotePlugins() abort
|
||||
let commands = []
|
||||
let hosts = keys(s:hosts)
|
||||
for host in hosts
|
||||
@ -180,14 +194,12 @@ function! s:UpdateRemotePlugins()
|
||||
endif
|
||||
endfor
|
||||
call writefile(commands, s:remote_plugins_manifest)
|
||||
echomsg printf('remote/host: generated the manifest file in "%s"',
|
||||
\ s:remote_plugins_manifest)
|
||||
endfunction
|
||||
|
||||
|
||||
command! UpdateRemotePlugins call s:UpdateRemotePlugins()
|
||||
|
||||
|
||||
let s:plugins_for_host = {}
|
||||
function! remote#host#PluginsForHost(host)
|
||||
function! remote#host#PluginsForHost(host) abort
|
||||
if !has_key(s:plugins_for_host, a:host)
|
||||
let s:plugins_for_host[a:host] = []
|
||||
end
|
||||
@ -195,40 +207,25 @@ function! remote#host#PluginsForHost(host)
|
||||
endfunction
|
||||
|
||||
|
||||
" Registration of standard hosts
|
||||
|
||||
" Python/Python3 {{{
|
||||
function! s:RequirePythonHost(host)
|
||||
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
|
||||
|
||||
" Python host arguments
|
||||
let args = ['-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()']
|
||||
|
||||
" Collect registered Python plugins into args
|
||||
let python_plugins = remote#host#PluginsForHost(a:host.name)
|
||||
for plugin in python_plugins
|
||||
call add(args, plugin.path)
|
||||
endfor
|
||||
|
||||
try
|
||||
let channel_id = rpcstart((ver == '2' ?
|
||||
\ provider#python#Prog() : provider#python3#Prog()), args)
|
||||
if rpcrequest(channel_id, 'poll') == 'ok'
|
||||
return channel_id
|
||||
endif
|
||||
catch
|
||||
echomsg v:throwpoint
|
||||
echomsg v:exception
|
||||
endtry
|
||||
throw 'Failed to load '. a:host.orig_name . ' host. '.
|
||||
function! remote#host#LoadErrorForHost(host, log) abort
|
||||
return 'Failed to load '. a:host . ' host. '.
|
||||
\ 'You can try to see what happened '.
|
||||
\ 'by starting Neovim with the environment variable '.
|
||||
\ '$NVIM_PYTHON_LOG_FILE set to a file and opening '.
|
||||
\ 'the generated log file. Also, the host stderr will be available '.
|
||||
\ a:log . ' set to a file and opening the generated '.
|
||||
\ 'log file. Also, the host stderr will be available '.
|
||||
\ 'in Neovim log, so it may contain useful information. '.
|
||||
\ 'See also ~/.nvimlog.'
|
||||
endfunction
|
||||
|
||||
call remote#host#Register('python', '*.py', function('s:RequirePythonHost'))
|
||||
call remote#host#Register('python3', '*.py', function('s:RequirePythonHost'))
|
||||
" }}}
|
||||
|
||||
" Registration of standard hosts
|
||||
|
||||
" Python/Python3
|
||||
call remote#host#Register('python', '*',
|
||||
\ function('provider#pythonx#Require'))
|
||||
call remote#host#Register('python3', '*',
|
||||
\ function('provider#pythonx#Require'))
|
||||
|
||||
" Ruby
|
||||
call remote#host#Register('ruby', '*.rb',
|
||||
\ function('provider#ruby#Require'))
|
||||
|
@ -1,6 +1,4 @@
|
||||
" Vim script to download a missing spell file
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2012 Jan 08
|
||||
|
||||
if !exists('g:spellfile_URL')
|
||||
" Prefer using http:// when netrw should be able to use it, since
|
||||
@ -43,22 +41,23 @@ function! spellfile#LoadFile(lang)
|
||||
if len(dirlist) == 0
|
||||
let dir_to_create = spellfile#WritableSpellDir()
|
||||
if &verbose || dir_to_create != ''
|
||||
echomsg 'spellfile#LoadFile(): There is no writable spell directory.'
|
||||
echomsg 'spellfile#LoadFile(): No (writable) spell directory found.'
|
||||
endif
|
||||
if dir_to_create != ''
|
||||
if confirm("Shall I create " . dir_to_create, "&Yes\n&No", 2) == 1
|
||||
" After creating the directory it should show up in the list.
|
||||
call mkdir(dir_to_create, "p")
|
||||
let [dirlist, dirchoices] = spellfile#GetDirChoices()
|
||||
endif
|
||||
call mkdir(dir_to_create, "p")
|
||||
" Now it should show up in the list.
|
||||
let [dirlist, dirchoices] = spellfile#GetDirChoices()
|
||||
endif
|
||||
if len(dirlist) == 0
|
||||
echomsg 'Failed to create: '.dir_to_create
|
||||
return
|
||||
else
|
||||
echomsg 'Created '.dir_to_create
|
||||
endif
|
||||
endif
|
||||
|
||||
let msg = 'Cannot find spell file for "' . a:lang . '" in ' . &enc
|
||||
let msg .= "\nDo you want me to try downloading it?"
|
||||
let msg = 'No spell file for "' . a:lang . '" in ' . &enc
|
||||
let msg .= "\nDownload it?"
|
||||
if confirm(msg, "&Yes\n&No", 2) == 1
|
||||
let enc = &encoding
|
||||
if enc == 'iso-8859-15'
|
||||
@ -78,78 +77,77 @@ function! spellfile#LoadFile(lang)
|
||||
" Careful: Nread() may have opened a new window for the error message,
|
||||
" we need to go back to our own buffer and window.
|
||||
if newbufnr != winbufnr(0)
|
||||
let winnr = bufwinnr(newbufnr)
|
||||
if winnr == -1
|
||||
" Our buffer has vanished!? Open a new window.
|
||||
echomsg "download buffer disappeared, opening a new one"
|
||||
new
|
||||
setlocal bin fenc=
|
||||
else
|
||||
exe winnr . "wincmd w"
|
||||
endif
|
||||
let winnr = bufwinnr(newbufnr)
|
||||
if winnr == -1
|
||||
" Our buffer has vanished!? Open a new window.
|
||||
echomsg "download buffer disappeared, opening a new one"
|
||||
new
|
||||
setlocal bin fenc=
|
||||
else
|
||||
exe winnr . "wincmd w"
|
||||
endif
|
||||
endif
|
||||
if newbufnr == winbufnr(0)
|
||||
" We are back the old buffer, remove any (half-finished) download.
|
||||
g/^/d
|
||||
" We are back the old buffer, remove any (half-finished) download.
|
||||
g/^/d_
|
||||
else
|
||||
let newbufnr = winbufnr(0)
|
||||
let newbufnr = winbufnr(0)
|
||||
endif
|
||||
|
||||
let fname = a:lang . '.ascii.spl'
|
||||
echo 'Could not find it, trying ' . fname . '...'
|
||||
call spellfile#Nread(fname)
|
||||
if getline(2) !~ 'VIMspell'
|
||||
echo 'Sorry, downloading failed'
|
||||
exe newbufnr . "bwipe!"
|
||||
return
|
||||
echo 'Download failed'
|
||||
exe newbufnr . "bwipe!"
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
" Delete the empty first line and mark the file unmodified.
|
||||
1d
|
||||
1d_
|
||||
set nomod
|
||||
|
||||
let msg = "In which directory do you want to write the file:"
|
||||
for i in range(len(dirlist))
|
||||
let msg .= "\n" . (i + 1) . '. ' . dirlist[i]
|
||||
endfor
|
||||
let dirchoice = confirm(msg, dirchoices) - 2
|
||||
if len(dirlist) == 1
|
||||
let dirchoice = 0
|
||||
else
|
||||
let msg = "In which directory do you want to write the file:"
|
||||
for i in range(len(dirlist))
|
||||
let msg .= "\n" . (i + 1) . '. ' . dirlist[i]
|
||||
endfor
|
||||
let dirchoice = confirm(msg, dirchoices) - 2
|
||||
endif
|
||||
if dirchoice >= 0
|
||||
if exists('*fnameescape')
|
||||
let dirname = fnameescape(dirlist[dirchoice])
|
||||
let dirname = fnameescape(dirlist[dirchoice])
|
||||
else
|
||||
let dirname = escape(dirlist[dirchoice], ' ')
|
||||
let dirname = escape(dirlist[dirchoice], ' ')
|
||||
endif
|
||||
setlocal fenc=
|
||||
exe "write " . dirname . '/' . fname
|
||||
|
||||
" Also download the .sug file, if the user wants to.
|
||||
let msg = "Do you want me to try getting the .sug file?\n"
|
||||
let msg .= "This will improve making suggestions for spelling mistakes,\n"
|
||||
let msg .= "but it uses quite a bit of memory."
|
||||
if confirm(msg, "&No\n&Yes") == 2
|
||||
g/^/d
|
||||
let fname = substitute(fname, '\.spl$', '.sug', '')
|
||||
echo 'Downloading ' . fname . '...'
|
||||
call spellfile#Nread(fname)
|
||||
if getline(2) =~ 'VIMsug'
|
||||
1d
|
||||
exe "write " . dirname . '/' . fname
|
||||
set nomod
|
||||
else
|
||||
echo 'Sorry, downloading failed'
|
||||
" Go back to our own buffer/window, Nread() may have taken us to
|
||||
" another window.
|
||||
if newbufnr != winbufnr(0)
|
||||
let winnr = bufwinnr(newbufnr)
|
||||
if winnr != -1
|
||||
exe winnr . "wincmd w"
|
||||
endif
|
||||
endif
|
||||
if newbufnr == winbufnr(0)
|
||||
set nomod
|
||||
endif
|
||||
endif
|
||||
" Also download the .sug file.
|
||||
g/^/d_
|
||||
let fname = substitute(fname, '\.spl$', '.sug', '')
|
||||
echo 'Downloading ' . fname . '...'
|
||||
call spellfile#Nread(fname)
|
||||
if getline(2) =~ 'VIMsug'
|
||||
1d_
|
||||
exe "write " . dirname . '/' . fname
|
||||
set nomod
|
||||
else
|
||||
echo 'Download failed'
|
||||
" Go back to our own buffer/window, Nread() may have taken us to
|
||||
" another window.
|
||||
if newbufnr != winbufnr(0)
|
||||
let winnr = bufwinnr(newbufnr)
|
||||
if winnr != -1
|
||||
exe winnr . "wincmd w"
|
||||
endif
|
||||
endif
|
||||
if newbufnr == winbufnr(0)
|
||||
set nomod
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
" Vim autoload file for the tohtml plugin.
|
||||
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
|
||||
" Last Change: 2013 Jun 19
|
||||
" Last Change: 2013 Sep 03
|
||||
"
|
||||
" Additional contributors:
|
||||
"
|
||||
@ -302,7 +302,7 @@ func! tohtml#Convert2HTML(line1, line2) "{{{
|
||||
else "{{{
|
||||
let win_list = []
|
||||
let buf_list = []
|
||||
windo | if &diff | call add(win_list, winbufnr(0)) | endif
|
||||
windo if &diff | call add(win_list, winbufnr(0)) | endif
|
||||
let s:settings.whole_filler = 1
|
||||
let g:html_diff_win_num = 0
|
||||
for window in win_list
|
||||
|
99
runtime/doc/api.txt
Normal file
99
runtime/doc/api.txt
Normal file
@ -0,0 +1,99 @@
|
||||
*api.txt* For Nvim. {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||
|
||||
The C API of Nvim *nvim-api*
|
||||
|
||||
1. Introduction |nvim-api-intro|
|
||||
2. API Types |nvim-api-types|
|
||||
3. API metadata |nvim-api-metadata|
|
||||
4. Buffer highlighting |nvim-api-highlights|
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *nvim-api-intro*
|
||||
|
||||
Nvim defines a C API as the primary way for external code to interact with
|
||||
the NVim core. In the present version of Nvim the API is primarily used by
|
||||
external processes to interact with Nvim using the msgpack-rpc protocol, see
|
||||
|msgpack-rpc|. The API will also be used from vimscript to access new Nvim core
|
||||
features, but this is not implemented yet. Later on, Nvim might be embeddable
|
||||
in C applications as libnvim, and the application will then control the
|
||||
embedded instance by calling the C API directly.
|
||||
|
||||
==============================================================================
|
||||
2. API Types *nvim-api-types*
|
||||
|
||||
Nvim's C API uses custom types for all functions. Some are just typedefs
|
||||
around C99 standard types, and some are Nvim defined data structures.
|
||||
|
||||
Boolean -> bool
|
||||
Integer (signed 64-bit integer) -> int64_t
|
||||
Float (IEEE 754 double precision) -> double
|
||||
String -> {char* data, size_t size} struct
|
||||
|
||||
Additionally, the following data structures are defined:
|
||||
|
||||
Array
|
||||
Dictionary
|
||||
Object
|
||||
|
||||
The following handle types are defined as integer typedefs, but are
|
||||
discriminated as separate types in an Object:
|
||||
|
||||
Buffer -> enum value kObjectTypeBuffer
|
||||
Window -> enum value kObjectTypeWindow
|
||||
Tabpage -> enum value kObjectTypeTabpage
|
||||
|
||||
==============================================================================
|
||||
3. API metadata *nvim-api-metadata*
|
||||
|
||||
Nvim exposes metadata about the API as a Dictionary with the following keys:
|
||||
|
||||
functions calling signature of the API functions
|
||||
types The custom handle types defined by Nvim
|
||||
error_types The possible kinds of errors an API function can exit with.
|
||||
|
||||
This metadata is mostly useful for external programs accessing the api over
|
||||
msgpack-api, see |msgpack-rpc-api|.
|
||||
|
||||
==============================================================================
|
||||
4. Buffer highlighting *nvim-api-highlights*
|
||||
|
||||
Nvim allows plugins to add position-based highlights to buffers. This is
|
||||
similar to |matchaddpos()| but with some key differences. The added highlights
|
||||
are associated with a buffer and adapts to line insertions and deletions,
|
||||
similar to signs. It is also possible to manage a set of highlights as a group
|
||||
and delete or replace all at once.
|
||||
|
||||
The intended use case are linter or semantic highlighter plugins that monitor
|
||||
a buffer for changes, and in the background compute highlights to the buffer.
|
||||
Another use case are plugins that show output in an append-only buffer, and
|
||||
want to add highlights to the outputs. Highlight data cannot be preserved
|
||||
on writing and loading a buffer to file, nor in undo/redo cycles.
|
||||
|
||||
Highlights are registered using the |buffer_add_highlight| function, see the
|
||||
generated API documentation for details. If an external highlighter plugin is
|
||||
adding a large number of highlights in a batch, performance can be improved by
|
||||
calling |buffer_add_highlight| as an asynchronous notification, after first
|
||||
(synchronously) reqesting a source id. Here is an example using wrapper
|
||||
functions in the python client:
|
||||
>
|
||||
src = vim.new_highlight_source()
|
||||
|
||||
buf = vim.current.buffer
|
||||
for i in range(5):
|
||||
buf.add_highlight("String",i,0,-1,src_id=src)
|
||||
|
||||
# some time later
|
||||
|
||||
buf.clear_highlight(src)
|
||||
<
|
||||
If the highlights don't need to be deleted or updated, just pass -1 as
|
||||
src_id (this is the default in python). |buffer_clear_highlight| can be used
|
||||
to clear highligts from a specific source, in a specific line range or the
|
||||
entire buffer by passing in the line range 0, -1 (the later is the default
|
||||
in python as used above).
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 7.4. Last change: 2015 Mar 21
|
||||
*autocmd.txt* For Vim version 7.4. Last change: 2015 Aug 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -308,6 +308,8 @@ Name triggered by ~
|
||||
|InsertCharPre| when a character was typed in Insert mode, before
|
||||
inserting it
|
||||
|
||||
|TextYankPost| when some text is yanked or deleted
|
||||
|
||||
|TextChanged| after a change was made to the text in Normal mode
|
||||
|TextChangedI| after a change was made to the text in Insert mode
|
||||
|
||||
@ -722,6 +724,18 @@ InsertCharPre When a character is typed in Insert mode,
|
||||
It is not allowed to change the text |textlock|.
|
||||
The event is not triggered when 'paste' is
|
||||
set.
|
||||
*TextYankPost*
|
||||
TextYankPost Just after a |yank| or |deleting| command, but not
|
||||
if the black hole register |quote_| is used nor
|
||||
for |setreg()|. Pattern must be * because its
|
||||
meaning may change in the future.
|
||||
Sets these |v:event| keys:
|
||||
operator
|
||||
regcontents
|
||||
regname
|
||||
regtype
|
||||
Recursion is ignored.
|
||||
It is not allowed to change the text |textlock|.
|
||||
*InsertEnter*
|
||||
InsertEnter Just before starting Insert mode. Also for
|
||||
Replace mode and Virtual Replace mode. The
|
||||
@ -756,13 +770,15 @@ OptionSet After setting an option. The pattern is
|
||||
it's global or local scoped and |<amatch>|
|
||||
indicates what option has been set.
|
||||
|
||||
Note: It's a bad idea, to reset an option
|
||||
during this autocommand, since this will
|
||||
probably break plugins. You can always use
|
||||
|:noa| to prevent triggering this autocommand.
|
||||
Could be used, to check for existence of the
|
||||
'backupdir' and 'undodir' options and create
|
||||
directories, if they don't exist yet.
|
||||
Usage example: Check for the existence of the
|
||||
directory in the 'backupdir' and 'undodir'
|
||||
options, create the directory if it doesn't
|
||||
exist yet.
|
||||
|
||||
Note: It's a bad idea to reset an option
|
||||
during this autocommand, this may break a
|
||||
plugin. You can always use `:noa` to prevent
|
||||
triggering this autocommand.
|
||||
|
||||
*QuickFixCmdPre*
|
||||
QuickFixCmdPre Before a quickfix command is run (|:make|,
|
||||
@ -1086,7 +1102,7 @@ Instead of a pattern buffer-local autocommands use one of these forms:
|
||||
Examples: >
|
||||
:au CursorHold <buffer> echo 'hold'
|
||||
:au CursorHold <buffer=33> echo 'hold'
|
||||
:au CursorHold <buffer=abuf> echo 'hold'
|
||||
:au BufNewFile * au CursorHold <buffer=abuf> echo 'hold'
|
||||
|
||||
All the commands for autocommands also work with buffer-local autocommands,
|
||||
simply use the special string instead of the pattern. Examples: >
|
||||
|
@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 7.4. Last change: 2015 Feb 10
|
||||
*change.txt* For Vim version 7.4. Last change: 2015 Sep 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -366,14 +366,45 @@ Adding and subtracting ~
|
||||
CTRL-A Add [count] to the number or alphabetic character at
|
||||
or after the cursor.
|
||||
|
||||
*v_CTRL-A*
|
||||
{Visual}CTRL-A Add [count] to the number or alphabetic character in
|
||||
the highlighted text. {not in Vi}
|
||||
|
||||
*v_g_CTRL-A*
|
||||
{Visual}g CTRL-A Add [count] to the number or alphabetic character in
|
||||
the highlighted text. If several lines are
|
||||
highlighted, each one will be incremented by an
|
||||
additional [count] (so effectively creating a
|
||||
[count] incrementing sequence). {not in Vi}
|
||||
For Example, if you have this list of numbers:
|
||||
1. ~
|
||||
1. ~
|
||||
1. ~
|
||||
1. ~
|
||||
Move to the second "1." and Visually select three
|
||||
lines, pressing g CTRL-A results in:
|
||||
1. ~
|
||||
2. ~
|
||||
3. ~
|
||||
4. ~
|
||||
|
||||
*CTRL-X*
|
||||
CTRL-X Subtract [count] from the number or alphabetic
|
||||
character at or after the cursor.
|
||||
|
||||
The CTRL-A and CTRL-X commands can work for:
|
||||
- signed and unsigned decimal numbers
|
||||
- unsigned binary, octal and hexadecimal numbers
|
||||
- alphabetic characters
|
||||
*v_CTRL-X*
|
||||
{Visual}CTRL-X Subtract [count] from the number or alphabetic
|
||||
character in the highlighted text. {not in Vi}
|
||||
|
||||
*v_g_CTRL-X*
|
||||
{Visual}g CTRL-X Subtract [count] from the number or alphabetic
|
||||
character in the highlighted text. If several lines
|
||||
are highlighted, each value will be decremented by an
|
||||
additional [count] (so effectively creating a [count]
|
||||
decrementing sequence). {not in Vi}
|
||||
|
||||
The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned
|
||||
binary/octal/hexadecimal numbers and alphabetic characters.
|
||||
|
||||
This depends on the 'nrformats' option:
|
||||
- When 'nrformats' includes "bin", Vim assumes numbers starting with '0b' or
|
||||
@ -591,9 +622,9 @@ For MS-Windows: $TMP, $TEMP, $USERPROFILE, current-dir.
|
||||
may add [flags], see |:s_flags|.
|
||||
Note that after `:substitute` the '&' flag can't be
|
||||
used, it's recognized as a pattern separator.
|
||||
The space between `:substitute` and the 'c', 'g' and
|
||||
'r' flags isn't required, but in scripts it's a good
|
||||
idea to keep it to avoid confusion.
|
||||
The space between `:substitute` and the 'c', 'g',
|
||||
'i', 'I' and 'r' flags isn't required, but in scripts
|
||||
it's a good idea to keep it to avoid confusion.
|
||||
|
||||
:[range]~[&][flags] [count] *:~*
|
||||
Repeat last substitute with same substitute string
|
||||
@ -1071,7 +1102,7 @@ Rationale: In Vi the "y" command followed by a backwards motion would
|
||||
With a linewise yank command the cursor is put in the first line, but the
|
||||
column is unmodified, thus it may not be on the first yanked character.
|
||||
|
||||
There are nine types of registers: *registers* *E354*
|
||||
There are ten types of registers: *registers* *E354*
|
||||
1. The unnamed register ""
|
||||
2. 10 numbered registers "0 to "9
|
||||
3. The small delete register "-
|
||||
|
@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 7.4. Last change: 2014 Sep 06
|
||||
*cmdline.txt* For Vim version 7.4. Last change: 2015 Sep 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -565,6 +565,7 @@ starts editing the three files "foo bar", "goes to" and "school ".
|
||||
When you want to use the special characters '"' or '|' in a command, or want
|
||||
to use '%' or '#' in a file name, precede them with a backslash. The
|
||||
backslash is not required in a range and in the ":substitute" command.
|
||||
See also |`=|.
|
||||
|
||||
*:_!*
|
||||
The '!' (bang) character after an Ex command makes the command behave in a
|
||||
@ -714,13 +715,13 @@ to insert special things while typing you can use the CTRL-R command. For
|
||||
example, "%" stands for the current file name, while CTRL-R % inserts the
|
||||
current file name right away. See |c_CTRL-R|.
|
||||
|
||||
Note: If you want to avoid the special characters in a Vim script you may want
|
||||
to use |fnameescape()|.
|
||||
Note: If you want to avoid the effects of special characters in a Vim script
|
||||
you may want to use |fnameescape()|. Also see |`=|.
|
||||
|
||||
|
||||
In Ex commands, at places where a file name can be used, the following
|
||||
characters have a special meaning. These can also be used in the expression
|
||||
function expand() |expand()|.
|
||||
function |expand()|.
|
||||
% Is replaced with the current file name. *:_%* *c_%*
|
||||
# Is replaced with the alternate file name. *:_#* *c_#*
|
||||
This is remembered for every window.
|
||||
@ -755,6 +756,7 @@ it, no matter how many backslashes.
|
||||
# alternate.file
|
||||
\# #
|
||||
\\# \#
|
||||
Also see |`=|.
|
||||
|
||||
*:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
|
||||
*:<sfile>* *<sfile>* *:<afile>* *<afile>*
|
||||
@ -776,13 +778,13 @@ Note: these are typed literally, they are not special keys!
|
||||
<afile> only when the file name isn't used to match with
|
||||
(for FileType, Syntax and SpellFileMissing events).
|
||||
<sfile> When executing a ":source" command, is replaced with the
|
||||
file name of the sourced file. *E498*
|
||||
When executing a function, is replaced with
|
||||
"function {function-name}"; function call nesting is
|
||||
indicated like this:
|
||||
"function {function-name1}..{function-name2}". Note that
|
||||
filename-modifiers are useless when <sfile> is used inside
|
||||
a function.
|
||||
file name of the sourced file. *E498*
|
||||
When executing a function, is replaced with:
|
||||
"function {function-name}[{lnum}]"
|
||||
function call nesting is indicated like this:
|
||||
"function {function-name1}[{lnum}]..{function-name2}[{lnum}]"
|
||||
Note that filename-modifiers are useless when <sfile> is
|
||||
used inside a function.
|
||||
<slnum> When executing a ":source" command, is replaced with the
|
||||
line number. *E842*
|
||||
When executing a function it's the line number relative to
|
||||
@ -844,7 +846,7 @@ These modifiers can be given, in this order:
|
||||
:gs?pat?sub?
|
||||
Substitute all occurrences of "pat" with "sub". Otherwise
|
||||
this works like ":s".
|
||||
:S Escape special characters for use with a shell command (see
|
||||
:S Escape special characters for use with a shell command (see
|
||||
|shellescape()|). Must be the last one. Examples: >
|
||||
:!dir <cfile>:S
|
||||
:call system('chmod +w -- ' . expand('%:S'))
|
||||
@ -897,9 +899,8 @@ name). This is included for backwards compatibility with version 3.0, the
|
||||
|
||||
Note: Where a file name is expected wildcards expansion is done. On Unix the
|
||||
shell is used for this, unless it can be done internally (for speed).
|
||||
Backticks also work, like in >
|
||||
Unless in |restricted-mode|, backticks work also, like in >
|
||||
:n `echo *.c`
|
||||
(backtick expansion is not possible in |restricted-mode|)
|
||||
But expansion is only done if there are any wildcards before expanding the
|
||||
'%', '#', etc.. This avoids expanding wildcards inside a file name. If you
|
||||
want to expand the result of <cfile>, add a wildcard character to it.
|
||||
@ -910,6 +911,7 @@ Examples: (alternate file name is "?readme?")
|
||||
:e #.* :e {files matching "?readme?.*"}
|
||||
:cd <cfile> :cd {file name under cursor}
|
||||
:cd <cfile>* :cd {file name under cursor plus "*" and then expanded}
|
||||
Also see |`=|.
|
||||
|
||||
When the expanded argument contains a "!" and it is used for a shell command
|
||||
(":!cmd", ":r !cmd" or ":w !cmd"), the "!" is escaped with a backslash to
|
||||
@ -936,6 +938,8 @@ for the file "$home" in the root directory. A few examples:
|
||||
/\$home file "$home" in root directory
|
||||
\\$home file "\\", followed by expanded $home
|
||||
|
||||
Also see |`=|.
|
||||
|
||||
==============================================================================
|
||||
7. Command-line window *cmdline-window* *cmdwin*
|
||||
*command-line-window*
|
||||
|
@ -1,4 +1,4 @@
|
||||
*diff.txt* For Vim version 7.4. Last change: 2015 Feb 03
|
||||
*diff.txt* For Vim version 7.4. Last change: 2015 Jul 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -124,8 +124,9 @@ file for a moment and come back to the same file and be in diff mode again.
|
||||
if the current window does not have 'diff' set then no options
|
||||
in it are changed.
|
||||
|
||||
The ":diffoff" command resets the relevant options to the values they had when
|
||||
using |:diffsplit|, |:diffpatch| , |:diffthis|. or starting Vim in diff mode.
|
||||
The `:diffoff` command resets the relevant options to the values they had when
|
||||
using `:diffsplit`, `:diffpatch` , `:diffthis`. or starting Vim in diff mode.
|
||||
When using `:diffoff` twice the last saved values are restored.
|
||||
Otherwise they are set to their default value:
|
||||
|
||||
'diff' off
|
||||
|
@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 7.4. Last change: 2015 Apr 18
|
||||
*editing.txt* For Vim version 7.4. Last change: 2015 Aug 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -378,25 +378,38 @@ Finds files:
|
||||
/usr/include/sys/types.h
|
||||
/usr/inc_old/types.h
|
||||
*backtick-expansion* *`-expansion*
|
||||
On Unix and a few other systems you can also use backticks in the file name,
|
||||
for example: >
|
||||
:e `find . -name ver\\*.c -print`
|
||||
The backslashes before the star are required to prevent "ver*.c" to be
|
||||
expanded by the shell before executing the find program.
|
||||
On Unix and a few other systems you can also use backticks for the file name
|
||||
argument, for example: >
|
||||
:next `find . -name ver\\*.c -print`
|
||||
:view `ls -t *.patch \| head -n1`
|
||||
The backslashes before the star are required to prevent the shell from
|
||||
expanding "ver*.c" prior to execution of the find program. The backslash
|
||||
before the shell pipe symbol "|" prevents Vim from parsing it as command
|
||||
termination.
|
||||
This also works for most other systems, with the restriction that the
|
||||
backticks must be around the whole item. It is not possible to have text
|
||||
directly before the first or just after the last backtick.
|
||||
|
||||
*`=*
|
||||
You can have the backticks expanded as a Vim expression, instead of an
|
||||
external command, by using the syntax `={expr}` e.g.: >
|
||||
You can have the backticks expanded as a Vim expression, instead of as an
|
||||
external command, by putting an equal sign right after the first backtick,
|
||||
e.g.: >
|
||||
:e `=tempname()`
|
||||
The expression can contain just about anything, thus this can also be used to
|
||||
avoid the special meaning of '"', '|', '%' and '#'. However, 'wildignore'
|
||||
does apply like to other wildcards.
|
||||
|
||||
Environment variables in the expression are expanded when evaluating the
|
||||
expression, thus this works: >
|
||||
:e `=$HOME . '/.vimrc'`
|
||||
This does not work, $HOME is inside a string and used literally: >
|
||||
:e `='$HOME' . '/.vimrc'`
|
||||
|
||||
If the expression returns a string then names are to be separated with line
|
||||
breaks. When the result is a |List| then each item is used as a name. Line
|
||||
breaks also separate names.
|
||||
Note that such expressions are only supported in places where a filename is
|
||||
expected as an argument to an Ex-command.
|
||||
|
||||
*++opt* *[++opt]*
|
||||
The [++opt] argument can be used to force the value of 'fileformat',
|
||||
@ -1203,12 +1216,18 @@ use has("browsefilter"): >
|
||||
==============================================================================
|
||||
7. The current directory *current-directory*
|
||||
|
||||
You may use the |:cd| and |:lcd| commands to change to another directory, so
|
||||
you will not have to type that directory name in front of the file names. It
|
||||
also makes a difference for executing external commands, e.g. ":!ls".
|
||||
You can use |:cd|, |:tcd| and |:lcd| to change to another directory, so you
|
||||
will not have to type that directory name in front of the file names. It also
|
||||
makes a difference for executing external commands, e.g. ":!ls" or ":te ls".
|
||||
|
||||
Changing directory fails when the current buffer is modified, the '.' flag is
|
||||
present in 'cpoptions' and "!" is not used in the command.
|
||||
There are three current-directory "scopes": global, tab and window. The
|
||||
window-local working directory takes precedence over the tab-local
|
||||
working directory, which in turn takes precedence over the global
|
||||
working directory. If a local working directory (tab or window) does not
|
||||
exist, the next-higher scope in the hierarchy applies.
|
||||
|
||||
Commands for changing the working directory can be suffixed with a bang "!"
|
||||
(e.g. |:cd!|) which is ignored, for compatibility with Vim.
|
||||
|
||||
*:cd* *E747* *E472*
|
||||
:cd[!] On non-Unix systems: Print the current directory
|
||||
@ -1233,29 +1252,50 @@ present in 'cpoptions' and "!" is not used in the command.
|
||||
*:chd* *:chdir*
|
||||
:chd[ir][!] [path] Same as |:cd|.
|
||||
|
||||
*:tc* *:tcd* *E5000* *E5001* *E5002*
|
||||
:tc[d][!] {path} Like |:cd|, but set the current directory for the
|
||||
current tab and window. The current directory for
|
||||
other tabs and windows is not changed.
|
||||
|
||||
*:tcd-*
|
||||
:tcd[!] - Change to the previous current directory (before the
|
||||
previous ":tcd {path}" command).
|
||||
|
||||
*:tch* *:tchdir*
|
||||
:tch[dir][!] Same as |:tcd|.
|
||||
|
||||
*:lc* *:lcd*
|
||||
:lc[d][!] {path} Like |:cd|, but only set the current directory for the
|
||||
current window. The current directory for other
|
||||
windows is not changed.
|
||||
windows or any tabs is not changed.
|
||||
|
||||
*:lch* *:lchdir*
|
||||
:lch[dir][!] Same as |:lcd|.
|
||||
|
||||
*:lcd-*
|
||||
:lcd[!] - Change to the previous current directory (before the
|
||||
previous ":tcd {path}" command).
|
||||
|
||||
*:pw* *:pwd* *E187*
|
||||
:pw[d] Print the current directory name.
|
||||
Also see |getcwd()|.
|
||||
|
||||
So long as no |:lcd| command has been used, all windows share the same current
|
||||
directory. Using a command to jump to another window doesn't change anything
|
||||
for the current directory.
|
||||
When a |:lcd| command has been used for a window, the specified directory
|
||||
becomes the current directory for that window. Windows where the |:lcd|
|
||||
command has not been used stick to the global current directory. When jumping
|
||||
to another window the current directory will become the last specified local
|
||||
current directory. If none was specified, the global current directory is
|
||||
used.
|
||||
When a |:cd| command is used, the current window will lose his local current
|
||||
directory and will use the global current directory from now on.
|
||||
So long as no |:tcd| or |:lcd| command has been used, all windows share the
|
||||
same "current directory". Using a command to jump to another window doesn't
|
||||
change anything for the current directory.
|
||||
|
||||
When |:lcd| has been used for a window, the specified directory becomes the
|
||||
current directory for that window. Windows where the |:lcd| command has not
|
||||
been used stick to the global or tab-local directory. When jumping to another
|
||||
window the current directory will become the last specified local current
|
||||
directory. If none was specified, the global or tab-local directory is used.
|
||||
|
||||
When changing tabs the same behaviour applies. If the current tab has no
|
||||
local working directory the global working directory is used. When a |:cd|
|
||||
command is used, the current window and tab will lose their local current
|
||||
directories and will use the global current directory from now on. When
|
||||
a |:tcd| command is used, only the current window will lose its local working
|
||||
directory.
|
||||
|
||||
After using |:cd| the full path name will be used for reading and writing
|
||||
files. On some networked file systems this may cause problems. The result of
|
||||
@ -1292,7 +1332,7 @@ There are a few things to remember when editing binary files:
|
||||
and when the file is written the <NL> will be replaced with <CR> <NL>.
|
||||
- <Nul> characters are shown on the screen as ^@. You can enter them with
|
||||
"CTRL-V CTRL-@" or "CTRL-V 000".
|
||||
- To insert a <NL> character in the file split up a line. When writing the
|
||||
- To insert a <NL> character in the file split a line. When writing the
|
||||
buffer to a file a <NL> will be written for the <EOL>.
|
||||
- Vim normally appends an <EOL> at the end of the file if there is none.
|
||||
Setting the 'binary' option prevents this. If you want to add the final
|
||||
@ -1304,9 +1344,7 @@ There are a few things to remember when editing binary files:
|
||||
9. Encryption *encryption*
|
||||
|
||||
*:X* *E817* *E818* *E819* *E820*
|
||||
Support for editing encrypted files has been removed, but may be added back in
|
||||
the future. See the following discussions for more information:
|
||||
|
||||
Support for editing encrypted files has been removed.
|
||||
https://github.com/neovim/neovim/issues/694
|
||||
https://github.com/neovim/neovim/issues/701
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 7.4. Last change: 2015 Nov 30
|
||||
*eval.txt* For Vim version 7.4. Last change: 2016 Jan 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -916,6 +916,11 @@ just above, except that indexes out of range cause an error. Examples: >
|
||||
Using expr8[expr1] or expr8[expr1a : expr1b] on a |Funcref| results in an
|
||||
error.
|
||||
|
||||
Watch out for confusion between a namespace and a variable followed by a colon
|
||||
for a sublist: >
|
||||
mylist[n:] " uses variable n
|
||||
mylist[s:] " uses namespace s:, error!
|
||||
|
||||
|
||||
expr8.name entry in a |Dictionary| *expr-entry*
|
||||
|
||||
@ -1003,7 +1008,7 @@ function. Example: >
|
||||
|
||||
|
||||
|
||||
string *string* *expr-string* *E114*
|
||||
string *string* *String* *expr-string* *E114*
|
||||
------
|
||||
"string" string constant *expr-quote*
|
||||
|
||||
@ -1386,6 +1391,22 @@ v:errors Errors found by assert functions, such as |assert_true()|.
|
||||
< If v:errors is set to anything but a list it is made an empty
|
||||
list by the assert function.
|
||||
|
||||
*v:event* *event-variable*
|
||||
v:event Dictionary of event data for the current |autocommand|. The
|
||||
available keys differ per event type and are specified at the
|
||||
documentation for each |event|. The possible keys are:
|
||||
operator The operation performed. Unlike
|
||||
|v:operator|, it is set also for an Ex
|
||||
mode command. For instance, |:yank| is
|
||||
translated to "|y|".
|
||||
regcontents Text stored in the register as a
|
||||
|readfile()|-style list of lines.
|
||||
regname Requested register (e.g "x" for "xyy)
|
||||
or the empty string for an unnamed
|
||||
operation.
|
||||
regtype Type of register as returned by
|
||||
|getregtype()|.
|
||||
|
||||
*v:exception* *exception-variable*
|
||||
v:exception The value of the exception most recently caught and not
|
||||
finished. See also |v:throwpoint| and |throw-variables|.
|
||||
@ -1397,6 +1418,13 @@ v:exception The value of the exception most recently caught and not
|
||||
:endtry
|
||||
< Output: "caught oops".
|
||||
|
||||
*v:false* *false-variable*
|
||||
v:false Special value used to put "false" in JSON and msgpack. See
|
||||
|json_encode()|. This value is converted to "false" when used
|
||||
as a String (e.g. in |expr5| with string concatenation
|
||||
operator) and to zero when used as a Number (e.g. in |expr5|
|
||||
or |expr7| when used with numeric operators).
|
||||
|
||||
*v:fcs_reason* *fcs_reason-variable*
|
||||
v:fcs_reason The reason why the |FileChangedShell| event was triggered.
|
||||
Can be used in an autocommand to decide what to do and/or what
|
||||
@ -1475,7 +1503,9 @@ v:hlsearch Variable that indicates whether search highlighting is on.
|
||||
this variable to zero acts like the |:nohlsearch| command,
|
||||
setting it to one acts like >
|
||||
let &hlsearch = &hlsearch
|
||||
<
|
||||
< Note that the value is restored when returning from a
|
||||
function. |function-search-undo|.
|
||||
|
||||
*v:insertmode* *insertmode-variable*
|
||||
v:insertmode Used for the |InsertEnter| and |InsertChange| autocommand
|
||||
events. Values:
|
||||
@ -1534,6 +1564,13 @@ v:msgpack_types Dictionary containing msgpack types used by |msgpackparse()|
|
||||
(not editable) empty lists. To check whether some list is one
|
||||
of msgpack types, use |is| operator.
|
||||
|
||||
*v:null* *null-variable*
|
||||
v:null Special value used to put "null" in JSON and NIL in msgpack.
|
||||
See |json_encode()|. This value is converted to "null" when
|
||||
used as a String (e.g. in |expr5| with string concatenation
|
||||
operator) and to zero when used as a Number (e.g. in |expr5|
|
||||
or |expr7| when used with numeric operators).
|
||||
|
||||
*v:oldfiles* *oldfiles-variable*
|
||||
v:oldfiles List of file names that is loaded from the |shada| file on
|
||||
startup. These are the files that Vim remembers marks for.
|
||||
@ -1699,6 +1736,13 @@ v:throwpoint The point where the exception most recently caught and not
|
||||
:endtry
|
||||
< Output: "Exception from test.vim, line 2"
|
||||
|
||||
*v:true* *true-variable*
|
||||
v:true Special value used to put "true" in JSON and msgpack. See
|
||||
|json_encode()|. This value is converted to "true" when used
|
||||
as a String (e.g. in |expr5| with string concatenation
|
||||
operator) and to one when used as a Number (e.g. in |expr5| or
|
||||
|expr7| when used with numeric operators).
|
||||
|
||||
*v:val* *val-variable*
|
||||
v:val Value of the current item of a |List| or |Dictionary|. Only
|
||||
valid while evaluating the expression used with |map()| and
|
||||
@ -1719,7 +1763,8 @@ v:version Version number of Vim: Major version number times 100 plus
|
||||
v:warningmsg Last given warning message. It's allowed to set this variable.
|
||||
|
||||
*v:windowid* *windowid-variable* {Nvim}
|
||||
v:windowid Is a no-op at the moment; the value is always set to 0.
|
||||
v:windowid Application-specific window ID ("window handle" in MS-Windows)
|
||||
which may be set by any attached UI. Defaults to zero.
|
||||
Note: for windows inside Vim use |winnr()|.
|
||||
|
||||
==============================================================================
|
||||
@ -1756,7 +1801,7 @@ bufexists( {expr}) Number TRUE if buffer {expr} exists
|
||||
buflisted( {expr}) Number TRUE if buffer {expr} is listed
|
||||
bufloaded( {expr}) Number TRUE if buffer {expr} is loaded
|
||||
bufname( {expr}) String Name of the buffer {expr}
|
||||
bufnr( {expr}) Number Number of the buffer {expr}
|
||||
bufnr( {expr} [, {create}]) Number Number of the buffer {expr}
|
||||
bufwinnr( {expr}) Number window number of buffer {expr}
|
||||
byte2line( {byte}) Number line number at byte count {byte}
|
||||
byteidx( {expr}, {nr}) Number byte index of {nr}'th char in {expr}
|
||||
@ -1785,9 +1830,11 @@ cursor( {lnum}, {col} [, {off}])
|
||||
Number move cursor to {lnum}, {col}, {off}
|
||||
cursor( {list}) Number move cursor to position in {list}
|
||||
deepcopy( {expr} [, {noref}]) any make a full copy of {expr}
|
||||
delete( {fname}) Number delete file {fname}
|
||||
dictwatcheradd({dict}, {pattern}, {callback}) Start watching a dictionary
|
||||
dictwatcherdel({dict}, {pattern}, {callback}) Stop watching a dictionary
|
||||
delete( {fname} [, {flags}]) Number delete the file or directory {fname}
|
||||
dictwatcheradd( {dict}, {pattern}, {callback})
|
||||
Start watching a dictionary
|
||||
dictwatcherdel( {dict}, {pattern}, {callback})
|
||||
Stop watching a dictionary
|
||||
did_filetype() Number TRUE if FileType autocommand event used
|
||||
diff_filler( {lnum}) Number diff filler lines about {lnum}
|
||||
diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col}
|
||||
@ -1807,7 +1854,7 @@ 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
|
||||
filter( {expr}, {string}) List/Dict remove items from {expr} where
|
||||
{string} is 0
|
||||
{string} is 0
|
||||
finddir( {name}[, {path}[, {count}]])
|
||||
String find directory {name} in {path}
|
||||
findfile( {name}[, {path}[, {count}]])
|
||||
@ -1833,12 +1880,13 @@ getbufvar( {expr}, {varname} [, {def}])
|
||||
any variable {varname} in buffer {expr}
|
||||
getchar( [expr]) Number get one character from the user
|
||||
getcharmod( ) Number modifiers for the last typed character
|
||||
getcharsearch() Dict last character search
|
||||
getcmdline() String return the current command-line
|
||||
getcmdpos() Number return cursor position in command-line
|
||||
getcmdtype() String return current command-line type
|
||||
getcmdwintype() String return current command-line window type
|
||||
getcurpos() List position of the cursor
|
||||
getcwd() String the current working directory
|
||||
getcwd( [{scope}]) String the current working directory
|
||||
getfontname( [{name}]) String name of font being used
|
||||
getfperm( {fname}) String file permissions of file {fname}
|
||||
getfsize( {fname}) Number size in bytes of file {fname}
|
||||
@ -1889,21 +1937,25 @@ inputdialog( {p} [, {t} [, {c}]]) String like input() but in a GUI dialog
|
||||
inputlist( {textlist}) Number let the user pick from a choice list
|
||||
inputrestore() Number restore typeahead
|
||||
inputsave() Number save and clear typeahead
|
||||
inputsecret( {prompt} [, {text}]) String like input() but hiding the text
|
||||
insert( {list}, {item} [, {idx}]) List insert {item} in {list} [before {idx}]
|
||||
inputsecret( {prompt} [, {text}])
|
||||
String like input() but hiding the text
|
||||
insert( {list}, {item} [, {idx}])
|
||||
List insert {item} in {list} [before {idx}]
|
||||
invert( {expr}) Number bitwise invert
|
||||
isdirectory( {directory}) Number TRUE if {directory} is a directory
|
||||
islocked( {expr}) Number TRUE if {expr} is locked
|
||||
items( {dict}) List key-value pairs in {dict}
|
||||
jobclose({job}[, {stream}]) Number Closes a job stream(s)
|
||||
jobpid({job}) Number Returns pid of a job.
|
||||
jobresize({job}, {width}, {height})
|
||||
jobclose( {job}[, {stream}]) Number Closes a job stream(s)
|
||||
jobpid( {job}) Number Returns pid of a job.
|
||||
jobresize( {job}, {width}, {height})
|
||||
Number Resize {job}'s pseudo terminal window
|
||||
jobsend({job}, {data}) Number Writes {data} to {job}'s stdin
|
||||
jobstart({cmd}[, {opts}]) Number Spawns {cmd} as a job
|
||||
jobstop({job}) Number Stops a job
|
||||
jobwait({ids}[, {timeout}]) Number Wait for a set of jobs
|
||||
jobsend( {job}, {data}) Number Writes {data} to {job}'s stdin
|
||||
jobstart( {cmd}[, {opts}]) Number Spawns {cmd} as a job
|
||||
jobstop( {job}) Number Stops a job
|
||||
jobwait( {ids}[, {timeout}]) Number Wait for a set of jobs
|
||||
join( {list} [, {sep}]) String join {list} items into one String
|
||||
json_decode( {expr}) any Convert {expr} from JSON
|
||||
json_encode( {expr}) String Convert {expr} to JSON
|
||||
keys( {dict}) List keys in {dict}
|
||||
len( {expr}) Number the length of {expr}
|
||||
libcall( {lib}, {func}, {arg}) String call {func} in library {lib} with {arg}
|
||||
@ -1972,12 +2024,12 @@ repeat( {expr}, {count}) String repeat {expr} {count} times
|
||||
resolve( {filename}) String get filename a shortcut points to
|
||||
reverse( {list}) List reverse {list} in-place
|
||||
round( {expr}) Float round off {expr}
|
||||
rpcnotify({channel}, {event}[, {args}...])
|
||||
rpcnotify( {channel}, {event}[, {args}...])
|
||||
Sends a |msgpack-rpc| notification to {channel}
|
||||
rpcrequest({channel}, {method}[, {args}...])
|
||||
rpcrequest( {channel}, {method}[, {args}...])
|
||||
Sends a |msgpack-rpc| request to {channel}
|
||||
rpcstart({prog}[, {argv}]) Spawns {prog} and opens a |msgpack-rpc| channel
|
||||
rpcstop({channel}) Closes a |msgpack-rpc| {channel}
|
||||
rpcstart( {prog}[, {argv}]) Spawns {prog} and opens a |msgpack-rpc| channel
|
||||
rpcstop( {channel}) Closes a |msgpack-rpc| {channel}
|
||||
screenattr( {row}, {col}) Number attribute at screen position
|
||||
screenchar( {row}, {col}) Number character at screen position
|
||||
screencol() Number current cursor column
|
||||
@ -1999,11 +2051,12 @@ setbufvar( {expr}, {varname}, {val}) set {varname} in buffer {expr} to {val}
|
||||
setcharsearch( {dict}) Dict set character search from {dict}
|
||||
setcmdpos( {pos}) Number set cursor position in command-line
|
||||
setline( {lnum}, {line}) Number set line {lnum} to {line}
|
||||
setloclist( {nr}, {list}[, {action}])
|
||||
setloclist( {nr}, {list}[, {action}[, {title}]])
|
||||
Number modify location list using {list}
|
||||
setmatches( {list}) Number restore a list of matches
|
||||
setpos( {expr}, {list}) Number set the {expr} position to {list}
|
||||
setqflist( {list}[, {action}]) Number modify quickfix list using {list}
|
||||
setqflist( {list}[, {action}[, {title}]]
|
||||
Number modify quickfix list using {list}
|
||||
setreg( {n}, {v}[, {opt}]) Number set register to value and type
|
||||
settabvar( {nr}, {varname}, {val}) set {varname} in tab page {nr} to {val}
|
||||
settabwinvar( {tabnr}, {winnr}, {varname}, {val}) set {varname} in window
|
||||
@ -2028,7 +2081,7 @@ split( {expr} [, {pat} [, {keepempty}]])
|
||||
sqrt( {expr}) Float square root of {expr}
|
||||
str2float( {expr}) Float convert String to Float
|
||||
str2nr( {expr} [, {base}]) Number convert String to Number
|
||||
strchars( {expr}) Number character length of the String {expr}
|
||||
strchars( {expr} [, {skipcc}]) Number character length of the String {expr}
|
||||
strdisplaywidth( {expr} [, {col}]) Number display length of the String {expr}
|
||||
strftime( {format}[, {time}]) String time in specified format
|
||||
stridx( {haystack}, {needle}[, {start}])
|
||||
@ -2193,17 +2246,17 @@ assert_equal({expected}, {actual}, [, {msg}])
|
||||
|
||||
assert_false({actual}, [, {msg}]) *assert_false()*
|
||||
When {actual} is not false an error message is added to
|
||||
|v:errors|, like with |assert_equal()|..
|
||||
A value is false when it is zero. When "{actual}" is not a
|
||||
number the assert fails.
|
||||
|v:errors|, like with |assert_equal()|.
|
||||
A value is false when it is zero or |v:false|. When "{actual}"
|
||||
is not a number or |v:false| the assert fails.
|
||||
When {msg} is omitted an error in the form "Expected False but
|
||||
got {actual}" is produced.
|
||||
|
||||
assert_true({actual}, [, {msg}]) *assert_true()*
|
||||
When {actual} is not true an error message is added to
|
||||
|v:errors|, like with |assert_equal()|..
|
||||
A value is true when it is a non-zeron number. When {actual}
|
||||
is not a number the assert fails.
|
||||
|v:errors|, like with |assert_equal()|.
|
||||
A value is true when it is a non-zero number or |v:true|.
|
||||
When {actual} is not a number or |v:true| the assert fails.
|
||||
When {msg} is omitted an error in the form "Expected True but
|
||||
got {actual}" is produced.
|
||||
|
||||
@ -2717,13 +2770,19 @@ deepcopy({expr}[, {noref}]) *deepcopy()* *E698*
|
||||
{noref} set to 1 will fail.
|
||||
Also see |copy()|.
|
||||
|
||||
delete({fname}) *delete()*
|
||||
Deletes the file by the name {fname}. The result is a Number,
|
||||
which is 0 if the file was deleted successfully, and non-zero
|
||||
when the deletion failed.
|
||||
Use |remove()| to delete an item from a |List|.
|
||||
To delete a line from the buffer use |:delete|. Use |:exe|
|
||||
when the line number is in a variable.
|
||||
delete({fname} [, {flags}]) *delete()*
|
||||
Without {flags} or with {flags} empty: Deletes the file by the
|
||||
name {fname}. This also works when {fname} is a symbolic link.
|
||||
A symbolic link itself is deleted, not what it points to.
|
||||
|
||||
When {flags} is "d": Deletes the directory by the name
|
||||
{fname}. This fails when directory {fname} is not empty.
|
||||
|
||||
When {flags} is "rf": Deletes the directory by the name
|
||||
{fname} and everything in it, recursively. BE CAREFUL!
|
||||
|
||||
The result is a Number, which is 0 if the delete operation was
|
||||
successful and -1 when the deletion failed or partly failed.
|
||||
|
||||
dictwatcheradd({dict}, {pattern}, {callback}) *dictwatcheradd()*
|
||||
Adds a watcher to a dictionary. A dictionary watcher is
|
||||
@ -2797,9 +2856,8 @@ diff_hlID({lnum}, {col}) *diff_hlID()*
|
||||
empty({expr}) *empty()*
|
||||
Return the Number 1 if {expr} is empty, zero otherwise.
|
||||
A |List| or |Dictionary| is empty when it does not have any
|
||||
items. A Number is empty when its value is zero.
|
||||
For a long |List| this is much faster than comparing the
|
||||
length with zero.
|
||||
items. A Number is empty when its value is zero. Special
|
||||
variable is empty when it is |v:false| or |v:null|.
|
||||
|
||||
escape({string}, {chars}) *escape()*
|
||||
Escape the characters in {chars} that occur in {string} with a
|
||||
@ -3507,9 +3565,18 @@ getcurpos() Get the position of the cursor. This is like getpos('.'), but
|
||||
MoveTheCursorAround
|
||||
call setpos('.', save_cursor)
|
||||
<
|
||||
*getcwd()*
|
||||
getcwd() The result is a String, which is the name of the current
|
||||
working directory.
|
||||
getcwd([{window}[, {tab}]]) *getcwd()*
|
||||
With no arguments the result is a String, which is the name of
|
||||
the current effective working directory. With {window} or
|
||||
{tab} the working directory of that scope is returned.
|
||||
Tabs and windows are identified by their respective numbers,
|
||||
0 means current tab or window. Missing argument implies 0.
|
||||
Thus the following are equivalent: >
|
||||
getcwd()
|
||||
getcwd(0)
|
||||
getcwd(0, 0)
|
||||
< If {window} is -1 it is ignored, only the tab is resolved.
|
||||
|
||||
|
||||
getfsize({fname}) *getfsize()*
|
||||
The result is a Number, which is the size in bytes of the
|
||||
@ -3844,9 +3911,18 @@ has_key({dict}, {key}) *has_key()*
|
||||
The result is a Number, which is 1 if |Dictionary| {dict} has
|
||||
an entry with key {key}. Zero otherwise.
|
||||
|
||||
haslocaldir() *haslocaldir()*
|
||||
The result is a Number, which is 1 when the current
|
||||
window has set a local path via |:lcd|, and 0 otherwise.
|
||||
haslocaldir([{window}[, {tab}]]) *haslocaldir()*
|
||||
The result is a Number, which is 1 when the specified tabpage
|
||||
or window has a local path set via |:lcd| or |:tcd|, and
|
||||
0 otherwise.
|
||||
|
||||
Tabs and windows are identified by their respective numbers,
|
||||
0 means current tab or window. Missing argument implies 0.
|
||||
Thus the following are equivalent: >
|
||||
haslocaldir()
|
||||
haslocaldir(0)
|
||||
haslocaldir(0, 0)
|
||||
< If {window} is -1 it is ignored, only the tab is resolved.
|
||||
|
||||
hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()*
|
||||
The result is a Number, which is 1 if there is a mapping that
|
||||
@ -4262,6 +4338,46 @@ join({list} [, {sep}]) *join()*
|
||||
converted into a string like with |string()|.
|
||||
The opposite function is |split()|.
|
||||
|
||||
json_decode({expr}) *json_decode()*
|
||||
Convert {expr} from JSON object. Accepts |readfile()|-style
|
||||
list as the input, as well as regular string. May output any
|
||||
Vim value. When 'encoding' is not UTF-8 string is converted
|
||||
from UTF-8 to 'encoding', failing conversion fails
|
||||
json_decode(). In the following cases it will output
|
||||
|msgpack-special-dict|:
|
||||
1. Dictionary contains duplicate key.
|
||||
2. Dictionary contains empty key.
|
||||
3. String contains NUL byte. Two special dictionaries: for
|
||||
dictionary and for string will be emitted in case string
|
||||
with NUL byte was a dictionary key.
|
||||
|
||||
Note: function treats its input as UTF-8 always regardless of
|
||||
'encoding' value. This is needed because JSON source is
|
||||
supposed to be external (e.g. |readfile()|) and JSON standard
|
||||
allows only a few encodings, of which UTF-8 is recommended and
|
||||
the only one required to be supported. Non-UTF-8 characters
|
||||
are an error.
|
||||
|
||||
json_encode({expr}) *json_encode()*
|
||||
Convert {expr} into a JSON string. Accepts
|
||||
|msgpack-special-dict| as the input. Converts from 'encoding'
|
||||
to UTF-8 when encoding strings. Will not convert |Funcref|s,
|
||||
mappings with non-string keys (can be created as
|
||||
|msgpack-special-dict|), values with self-referencing
|
||||
containers, strings which contain non-UTF-8 characters,
|
||||
pseudo-UTF-8 strings which contain codepoints reserved for
|
||||
surrogate pairs (such strings are not valid UTF-8 strings).
|
||||
When converting 'encoding' is taken into account, if it is not
|
||||
"utf-8", then conversion is performed before encoding strings.
|
||||
Non-printable characters are converted into "\u1234" escapes
|
||||
or special escapes like "\t", other are dumped as-is.
|
||||
|
||||
Note: all characters above U+0079 are considered non-printable
|
||||
when 'encoding' is not UTF-8. This function always outputs
|
||||
UTF-8 strings as required by the standard thus when 'encoding'
|
||||
is not unicode resulting string will look incorrect if
|
||||
"\u1234" notation is not used.
|
||||
|
||||
keys({dict}) *keys()*
|
||||
Return a |List| with all the keys of {dict}. The |List| is in
|
||||
arbitrary order.
|
||||
@ -4573,7 +4689,7 @@ match({expr}, {pat}[, {start}[, {count}]]) *match()*
|
||||
done like 'magic' is set and 'cpoptions' is empty.
|
||||
|
||||
*matchadd()* *E798* *E799* *E801*
|
||||
matchadd({group}, {pattern}[, {priority}[, {id}]])
|
||||
matchadd({group}, {pattern}[, {priority}[, {id} [, {dict}]]])
|
||||
Defines a pattern to be highlighted in the current window (a
|
||||
"match"). It will be highlighted with {group}. Returns an
|
||||
identification number (ID), which can be used to delete the
|
||||
@ -4581,6 +4697,8 @@ matchadd({group}, {pattern}[, {priority}[, {id}]])
|
||||
Matching is case sensitive and magic, unless case sensitivity
|
||||
or magicness are explicitly overridden in {pattern}. The
|
||||
'magic', 'smartcase' and 'ignorecase' options are not used.
|
||||
The "Conceal" value is special, it causes the match to be
|
||||
concealed.
|
||||
|
||||
The optional {priority} argument assigns a priority to the
|
||||
match. A match with a high priority will have its
|
||||
@ -4598,9 +4716,18 @@ matchadd({group}, {pattern}[, {priority}[, {id}]])
|
||||
message will appear and the match will not be added. An ID
|
||||
is specified as a positive integer (zero excluded). IDs 1, 2
|
||||
and 3 are reserved for |:match|, |:2match| and |:3match|,
|
||||
respectively. If the {id} argument is not specified,
|
||||
respectively. If the {id} argument is not specified or -1,
|
||||
|matchadd()| automatically chooses a free ID.
|
||||
|
||||
The optional {dict} argmument allows for further custom
|
||||
values. Currently this is used to specify a match specifc
|
||||
conceal character that will be shown for |hl-Conceal|
|
||||
highlighted matches. The dict can have the following members:
|
||||
|
||||
conceal Special character to show instead of the
|
||||
match (only for |hl-Conceal| highlighed
|
||||
matches, see |:syn-cchar|)
|
||||
|
||||
The number of matches is not limited, as it is the case with
|
||||
the |:match| commands.
|
||||
|
||||
@ -4614,7 +4741,7 @@ matchadd({group}, {pattern}[, {priority}[, {id}]])
|
||||
available from |getmatches()|. All matches can be deleted in
|
||||
one operation by |clearmatches()|.
|
||||
|
||||
matchaddpos({group}, {pos}[, {priority}[, {id}]]) *matchaddpos()*
|
||||
matchaddpos({group}, {pos}[, {priority}[, {id}[, {dict}]]]) *matchaddpos()*
|
||||
Same as |matchadd()|, but requires a list of positions {pos}
|
||||
instead of a pattern. This command is faster than |matchadd()|
|
||||
because it does not require to handle regular expressions and
|
||||
@ -4778,7 +4905,7 @@ msgpackdump({list}) {Nvim} *msgpackdump()*
|
||||
(dictionary with zero items is represented by 0x80 byte in
|
||||
messagepack).
|
||||
|
||||
Limitations: *E951* *E952*
|
||||
Limitations: *E951* *E952* *E953*
|
||||
1. |Funcref|s cannot be dumped.
|
||||
2. Containers that reference themselves cannot be dumped.
|
||||
3. Dictionary keys are always dumped as STR strings.
|
||||
@ -4813,9 +4940,13 @@ msgpackparse({list}) {Nvim} *msgpackparse()*
|
||||
contains name of the key from |v:msgpack_types|):
|
||||
|
||||
Key Value ~
|
||||
nil Zero, ignored when dumping.
|
||||
boolean One or zero. When dumping it is only checked that
|
||||
value is a |Number|.
|
||||
nil Zero, ignored when dumping. This value cannot
|
||||
possibly appear in |msgpackparse()| output in Neovim
|
||||
versions which have |v:null|.
|
||||
boolean One or zero. When dumping it is only checked that
|
||||
value is a |Number|. This value cannot possibly
|
||||
appear in |msgpackparse()| output in Neovim versions
|
||||
which have |v:true| and |v:false|.
|
||||
integer |List| with four numbers: sign (-1 or 1), highest two
|
||||
bits, number with bits from 62nd to 31st, lowest 31
|
||||
bits. I.e. to get actual number one will need to use
|
||||
@ -5146,7 +5277,7 @@ readfile({fname} [, {binary} [, {max}]])
|
||||
separated with CR will result in a single long line (unless a
|
||||
NL appears somewhere).
|
||||
All NUL characters are replaced with a NL character.
|
||||
When {binary/append} contains "b" binary mode is used:
|
||||
When {binary} contains "b" binary mode is used:
|
||||
- When the last line ends in a NL an extra empty list item is
|
||||
added.
|
||||
- No CR characters are removed.
|
||||
@ -5670,7 +5801,7 @@ setbufvar({expr}, {varname}, {val}) *setbufvar()*
|
||||
:call setbufvar("todo", "myvar", "foobar")
|
||||
< This function is not available in the |sandbox|.
|
||||
|
||||
setcharsearch() *setcharsearch()*
|
||||
setcharsearch({dict}) *setcharsearch()*
|
||||
Set the current character search information to {dict},
|
||||
which contains one or more of the following entries:
|
||||
|
||||
@ -5723,11 +5854,13 @@ setline({lnum}, {text}) *setline()*
|
||||
:endfor
|
||||
< Note: The '[ and '] marks are not set.
|
||||
|
||||
setloclist({nr}, {list} [, {action}]) *setloclist()*
|
||||
setloclist({nr}, {list} [, {action}[, {title}]]) *setloclist()*
|
||||
Create or replace or add to the location list for window {nr}.
|
||||
When {nr} is zero the current window is used. For a location
|
||||
list window, the displayed location list is modified. For an
|
||||
invalid window number {nr}, -1 is returned.
|
||||
invalid window number {nr}, -1 is returned. If {title} is
|
||||
given, it will be used to set |w:quickfix_title| after opening
|
||||
the location window.
|
||||
Otherwise, same as |setqflist()|.
|
||||
Also see |location-list|.
|
||||
|
||||
@ -5784,7 +5917,7 @@ setpos({expr}, {list})
|
||||
|winrestview()|.
|
||||
|
||||
|
||||
setqflist({list} [, {action}]) *setqflist()*
|
||||
setqflist({list} [, {action}[, {title}]]) *setqflist()*
|
||||
Create or replace or add to the quickfix list using the items
|
||||
in {list}. Each item in {list} is a dictionary.
|
||||
Non-dictionary items in {list} are ignored. Each dictionary
|
||||
@ -5823,6 +5956,9 @@ setqflist({list} [, {action}]) *setqflist()*
|
||||
with the items from {list}. If {action} is not present or is
|
||||
set to ' ', then a new list is created.
|
||||
|
||||
If {title} is given, it will be used to set |w:quickfix_title|
|
||||
after opening the quickfix window.
|
||||
|
||||
Returns zero for success, -1 for failure.
|
||||
|
||||
This function can be used to create a quickfix list
|
||||
@ -6109,7 +6245,8 @@ split({expr} [, {pattern} [, {keepempty}]]) *split()*
|
||||
:let words = split(getline('.'), '\W\+')
|
||||
< To split a string in individual characters: >
|
||||
:for c in split(mystring, '\zs')
|
||||
< If you want to keep the separator you can also use '\zs': >
|
||||
< If you want to keep the separator you can also use '\zs' at
|
||||
the end of the pattern: >
|
||||
:echo split('abc:def:ghi', ':\zs')
|
||||
< ['abc:', 'def:', 'ghi'] ~
|
||||
Splitting a table where the first element can be empty: >
|
||||
@ -6157,15 +6294,35 @@ str2nr( {expr} [, {base}]) *str2nr()*
|
||||
Text after the number is silently ignored.
|
||||
|
||||
|
||||
strchars({expr}) *strchars()*
|
||||
strchars({expr} [, {skipcc}]) *strchars()*
|
||||
The result is a Number, which is the number of characters
|
||||
String {expr} occupies. Composing characters are counted
|
||||
separately.
|
||||
in String {expr}.
|
||||
When {skipcc} is omitted or zero, composing characters are
|
||||
counted separately.
|
||||
When {skipcc} set to 1, Composing characters are ignored.
|
||||
Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
|
||||
|
||||
|
||||
{skipcc} is only available after 7.4.755. For backward
|
||||
compatibility, you can define a wrapper function: >
|
||||
if has("patch-7.4.755")
|
||||
function s:strchars(str, skipcc)
|
||||
return strchars(a:str, a:skipcc)
|
||||
endfunction
|
||||
else
|
||||
function s:strchars(str, skipcc)
|
||||
if a:skipcc
|
||||
return strlen(substitute(a:str, ".", "x", "g"))
|
||||
else
|
||||
return strchars(a:str)
|
||||
endif
|
||||
endfunction
|
||||
endif
|
||||
<
|
||||
|
||||
strdisplaywidth({expr}[, {col}]) *strdisplaywidth()*
|
||||
The result is a Number, which is the number of display cells
|
||||
String {expr} occupies on the screen when it starts a {col}.
|
||||
String {expr} occupies on the screen when it starts at {col}.
|
||||
When {col} is omitted zero is used. Otherwise it is the
|
||||
screen column where to start. This matters for Tab
|
||||
characters.
|
||||
@ -6221,25 +6378,31 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number,
|
||||
{expr} type result ~
|
||||
String 'string'
|
||||
Number 123
|
||||
Float 123.123456 or 1.123456e8
|
||||
Funcref function('name')
|
||||
Float 123.123456 or 1.123456e8 or
|
||||
`str2float('inf')`
|
||||
Funcref `function('name')`
|
||||
List [item, item]
|
||||
Dictionary {key: value, key: value}
|
||||
Note that in String values the ' character is doubled.
|
||||
Also see |strtrans()|.
|
||||
Note 2: Output format is mostly compatible with YAML, except
|
||||
for infinite and NaN floating-point values representations
|
||||
which use |str2float()|. Strings are also dumped literally,
|
||||
only single quote is escaped, which does not allow using YAML
|
||||
for parsing back binary strings (including text when
|
||||
'encoding' is not UTF-8). |eval()| should always work for
|
||||
strings and floats though and this is the only official
|
||||
method, use |msgpackdump()| or |json_encode()| if you need to
|
||||
share data with other application.
|
||||
|
||||
*strlen()*
|
||||
strlen({expr}) The result is a Number, which is the length of the String
|
||||
{expr} in bytes.
|
||||
If you want to count the number of multi-byte characters (not
|
||||
counting composing characters) use something like this: >
|
||||
|
||||
:let len = strlen(substitute(str, ".", "x", "g"))
|
||||
<
|
||||
If the argument is a Number it is first converted to a String.
|
||||
For other types an error is given.
|
||||
Also see |len()|, |strchars()|, |strdisplaywidth()| and
|
||||
|strwidth()|.
|
||||
If you want to count the number of multi-byte characters use
|
||||
|strchars()|.
|
||||
Also see |len()|, |strdisplaywidth()| and |strwidth()|.
|
||||
|
||||
strpart({src}, {start}[, {len}]) *strpart()*
|
||||
The result is a String, which is part of {src}, starting from
|
||||
@ -6353,6 +6516,9 @@ synID({lnum}, {col}, {trans}) *synID()*
|
||||
|
||||
{col} is 1 for the leftmost column, {lnum} is 1 for the first
|
||||
line. 'synmaxcol' applies, in a longer line zero is returned.
|
||||
Note that when the position is after the last character,
|
||||
that's where the cursor can be in Insert mode, synID() returns
|
||||
zero.
|
||||
|
||||
When {trans} is non-zero, transparent items are reduced to the
|
||||
item that they reveal. This is useful when wanting to know
|
||||
@ -6658,12 +6824,14 @@ trunc({expr}) *trunc()*
|
||||
|
||||
type({expr}) *type()*
|
||||
The result is a Number, depending on the type of {expr}:
|
||||
Number: 0
|
||||
String: 1
|
||||
Number: 0
|
||||
String: 1
|
||||
Funcref: 2
|
||||
List: 3
|
||||
List: 3
|
||||
Dictionary: 4
|
||||
Float: 5
|
||||
Float: 5
|
||||
Boolean: 6 (|v:true| and |v:false|)
|
||||
Null: 7 (|v:null|)
|
||||
To avoid the magic numbers it should be used this way: >
|
||||
:if type(myvar) == type(0)
|
||||
:if type(myvar) == type("")
|
||||
@ -6671,6 +6839,10 @@ type({expr}) *type()*
|
||||
:if type(myvar) == type([])
|
||||
:if type(myvar) == type({})
|
||||
:if type(myvar) == type(0.0)
|
||||
:if type(myvar) == type(v:true)
|
||||
< In place of checking for |v:null| type it is better to check
|
||||
for |v:null| directly as it is the only value of this type: >
|
||||
:if myvar is v:null
|
||||
|
||||
undofile({name}) *undofile()*
|
||||
Return the name of the undo file that would be used for a file
|
||||
|
@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 7.4. Last change: 2015 Feb 12
|
||||
*index.txt* For Vim version 7.4. Last change: 2015 Sep 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 7.4. Last change: 2015 May 22
|
||||
*insert.txt* For Vim version 7.4. Last change: 2015 Sep 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -78,8 +78,8 @@ CTRL-W Delete the word before the cursor (see |i_backspacing| about
|
||||
|word-motions|, for the definition of a word.
|
||||
*i_CTRL-U*
|
||||
CTRL-U Delete all entered characters before the cursor in the current
|
||||
line. If there are no newly entereed characters and
|
||||
'backspace'is not empty, delete all characters before the
|
||||
line. If there are no newly entered characters and
|
||||
'backspace' is not empty, delete all characters before the
|
||||
cursor in the current line.
|
||||
See |i_backspacing| about joining lines.
|
||||
*i_CTRL-I* *i_<Tab>* *i_Tab*
|
||||
@ -148,7 +148,7 @@ CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
|
||||
CTRL-R a results in "ac".
|
||||
CTRL-R CTRL-R a results in "ab^Hc".
|
||||
< Options 'textwidth', 'formatoptions', etc. still apply. If
|
||||
you also want to avoid these, use "<C-R><C-O>r", see below.
|
||||
you also want to avoid these, use CTRL-R CTRL-O, see below.
|
||||
The '.' register (last inserted text) is still inserted as
|
||||
typed.
|
||||
|
||||
|
@ -452,7 +452,7 @@ notation meaning equivalent decimal value(s) ~
|
||||
<C-...> control-key *control* *ctrl* *<C-*
|
||||
<M-...> alt-key or meta-key *meta* *alt* *<M-*
|
||||
<A-...> same as <M-...> *<A-*
|
||||
<D-...> command-key (Macintosh only) *<D-*
|
||||
<D-...> command-key or "super" key *<D-*
|
||||
<t_xx> key with "xx" entry in termcap
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
The Msgpack-RPC Interface to Nvim *msgpack-rpc*
|
||||
|
||||
1. Introduction |msgpack-rpc-intro|
|
||||
2. API |msgpack-rpc-api|
|
||||
2. API mapping |msgpack-rpc-api|
|
||||
3. Connecting |msgpack-rpc-connecting|
|
||||
4. Clients |msgpack-rpc-clients|
|
||||
5. Types |msgpack-rpc-types|
|
||||
@ -36,13 +36,13 @@ Nvim's msgpack-rpc interface is like a more powerful version of Vim's
|
||||
`clientserver` feature.
|
||||
|
||||
==============================================================================
|
||||
2. API *msgpack-rpc-api*
|
||||
2. API mapping *msgpack-rpc-api*
|
||||
|
||||
The Nvim C API is automatically exposed to the msgpack-rpc interface by the
|
||||
build system, which parses headers at src/nvim/api from the project root. A
|
||||
dispatch function is generated, which matches msgpack-rpc method names with
|
||||
non-static API functions, converting/validating arguments and return values
|
||||
back to msgpack.
|
||||
The Nvim C API, see |nvim-api|, is automatically exposed to the msgpack-rpc
|
||||
interface by the build system, which parses headers at src/nvim/api from the
|
||||
project root. A dispatch function is generated, which matches msgpack-rpc method
|
||||
names with non-static API functions, converting/validating arguments and return
|
||||
values back to msgpack.
|
||||
|
||||
Client libraries will normally provide wrappers that hide msgpack-rpc details
|
||||
from programmers. The wrappers can be automatically generated by reading
|
||||
@ -63,7 +63,7 @@ Here's a simple way to get human-readable description of the API (requires
|
||||
Python and the `pyyaml`/`msgpack-python` pip packages):
|
||||
>
|
||||
nvim --api-info | python -c 'import msgpack, sys, yaml; print yaml.dump(msgpack.unpackb(sys.stdin.read()))' > api.yaml
|
||||
|
||||
<
|
||||
==============================================================================
|
||||
3. Connecting *msgpack-rpc-connecting*
|
||||
|
||||
@ -162,8 +162,8 @@ https://github.com/msgpack-rpc/msgpack-rpc-ruby/blob/master/lib/msgpack/rpc/tran
|
||||
==============================================================================
|
||||
5. Types *msgpack-rpc-types*
|
||||
|
||||
Nvim's C API uses custom types for all functions (some are just typedefs
|
||||
around C99 standard types). The types can be split into two groups:
|
||||
Nvim's C API uses custom types for all functions, se |nvim-api-types|.
|
||||
For the purpose of mapping to msgpack, he types can be split into two groups:
|
||||
|
||||
- Basic types that map natively to msgpack (and probably have a default
|
||||
representation in msgpack-supported programming languages)
|
||||
|
@ -22,6 +22,8 @@ is found in your `$PATH`.
|
||||
- xclip
|
||||
- xsel (newer alternative to xclip)
|
||||
- pbcopy/pbpaste (only for Mac OS X)
|
||||
- lemonade (useful for SSH machine)
|
||||
https://github.com/pocke/lemonade
|
||||
|
||||
The presence of a suitable clipboard tool implicitly enables the '+' and '*'
|
||||
registers.
|
||||
|
@ -49,9 +49,12 @@ achieve special effects. These options come in three forms:
|
||||
:se[t] {option}&vi Reset option to its Vi default value.
|
||||
:se[t] {option}&vim Reset option to its Vim default value.
|
||||
|
||||
:se[t] all& Set all options, except terminal options, to their
|
||||
default value. The values of 'term', 'lines' and
|
||||
'columns' are not changed.
|
||||
:se[t] all& Set all options to their default value. The values of
|
||||
these options are not changed:
|
||||
'columns'
|
||||
'encoding'
|
||||
'lines'
|
||||
Warning: This may have a lot of side effects.
|
||||
|
||||
*:set-args* *E487* *E521*
|
||||
:se[t] {option}={value} or
|
||||
@ -704,7 +707,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
line.
|
||||
When 'smartindent' or 'cindent' is on the indent is changed in
|
||||
a different way.
|
||||
The 'autoindent' option is reset when the 'paste' option is set.
|
||||
The 'autoindent' option is reset when the 'paste' option is set and
|
||||
restored when 'paste' is reset.
|
||||
{small difference from Vi: After the indent is deleted when typing
|
||||
<Esc> or <CR>, the cursor position when moving up or down is after the
|
||||
deleted indent; Vi puts the cursor somewhere in the deleted indent}.
|
||||
@ -772,14 +776,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
putting a ":gui" command in the gvimrc file, before where the value
|
||||
of 'background' is used (e.g., before ":syntax on").
|
||||
|
||||
For Windows the default is "dark".
|
||||
For other systems "dark" is used when 'term' is "linux",
|
||||
"screen.linux", "cygwin" or "putty", or $COLORFGBG suggests a dark
|
||||
background. Otherwise the default is "light".
|
||||
For Windows the default is "dark". "dark" should be used if $COLORFGBG
|
||||
suggests a dark background (not yet implemented). Otherwise the default
|
||||
is "light".
|
||||
|
||||
Normally this option would be set in the vimrc file. Possibly
|
||||
depending on the terminal name. Example: >
|
||||
:if &term == "xterm"
|
||||
:if $TERM == "xterm"
|
||||
: set background=dark
|
||||
:endif
|
||||
< When this option is set, the default settings for the highlight groups
|
||||
@ -1361,7 +1364,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
option, yank and delete operations (but not put)
|
||||
will additionally copy the text into register
|
||||
'*'. See |nvim-clipboard|.
|
||||
<
|
||||
|
||||
*clipboard-autoselect*
|
||||
autoselect Works like the 'a' flag in 'guioptions': If present,
|
||||
then whenever Visual mode is started, or the Visual
|
||||
@ -2274,6 +2277,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
<Tab>. Spaces are used in indents with the '>' and '<' commands and
|
||||
when 'autoindent' is on. To insert a real tab when 'expandtab' is
|
||||
on, use CTRL-V<Tab>. See also |:retab| and |ins-expandtab|.
|
||||
This option is reset when the 'paste' option is set and restored when
|
||||
the 'paste' option is reset.
|
||||
|
||||
*'exrc'* *'ex'* *'noexrc'* *'noex'*
|
||||
'exrc' 'ex' boolean (default off)
|
||||
@ -4518,19 +4523,21 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When the 'paste' option is switched on (also when it was already on):
|
||||
- mapping in Insert mode and Command-line mode is disabled
|
||||
- abbreviations are disabled
|
||||
- 'textwidth' is set to 0
|
||||
- 'wrapmargin' is set to 0
|
||||
- 'autoindent' is reset
|
||||
- 'smartindent' is reset
|
||||
- 'softtabstop' is set to 0
|
||||
- 'expandtab' is reset
|
||||
- 'formatoptions' is used like it is empty
|
||||
- 'revins' is reset
|
||||
- 'ruler' is reset
|
||||
- 'showmatch' is reset
|
||||
- 'formatoptions' is used like it is empty
|
||||
- 'smartindent' is reset
|
||||
- 'smarttab' is reset
|
||||
- 'softtabstop' is set to 0
|
||||
- 'textwidth' is set to 0
|
||||
- 'wrapmargin' is set to 0
|
||||
These options keep their value, but their effect is disabled:
|
||||
- 'lisp'
|
||||
- 'indentexpr'
|
||||
- 'cindent'
|
||||
- 'indentexpr'
|
||||
- 'lisp'
|
||||
NOTE: When you start editing another file while the 'paste' option is
|
||||
on, settings from the modelines or autocommands may change the
|
||||
settings again, causing trouble when pasting text. You might want to
|
||||
@ -4853,7 +4860,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Inserting characters in Insert mode will work backwards. See "typing
|
||||
backwards" |ins-reverse|. This option can be toggled with the CTRL-_
|
||||
command in Insert mode, when 'allowrevins' is set.
|
||||
NOTE: This option is reset when 'paste' is set.
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
|
||||
*'rightleft'* *'rl'* *'norightleft'* *'norl'*
|
||||
'rightleft' 'rl' boolean (default off)
|
||||
@ -4902,7 +4910,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
separated with a dash.
|
||||
For an empty line "0-1" is shown.
|
||||
For an empty buffer the line number will also be zero: "0,0-1".
|
||||
This option is reset when the 'paste' option is set.
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
If you don't want to see the ruler all the time but want to know where
|
||||
you are, use "g CTRL-G" |g_CTRL-G|.
|
||||
|
||||
@ -5539,6 +5548,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
c don't give |ins-completion-menu| messages. For example,
|
||||
"-- XXX completion (YYY)", "match 1 of 2", "The only match",
|
||||
"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
|
||||
|
||||
This gives you the opportunity to avoid that a change between buffers
|
||||
requires you to hit <Enter>, but still gives as useful a message as
|
||||
@ -5607,7 +5619,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
jump is only done if the match can be seen on the screen. The time to
|
||||
show the match can be set with 'matchtime'.
|
||||
A Beep is given if there is no match (no matter if the match can be
|
||||
seen or not). This option is reset when the 'paste' option is set.
|
||||
seen or not).
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
When the 'm' flag is not included in 'cpoptions', typing a character
|
||||
will immediately move the cursor back to where it belongs.
|
||||
See the "sm" field in 'guicursor' for setting the cursor shape and
|
||||
@ -5706,7 +5720,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H.
|
||||
When using the ">>" command, lines starting with '#' are not shifted
|
||||
right.
|
||||
NOTE: When 'paste' is set smart indenting is disabled.
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
|
||||
*'smarttab'* *'sta'* *'nosmarttab'* *'nosta'*
|
||||
'smarttab' 'sta' boolean (default on)
|
||||
@ -5721,6 +5736,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
What gets inserted (a <Tab> or spaces) depends on the 'expandtab'
|
||||
option. Also see |ins-expandtab|. When 'expandtab' is not set, the
|
||||
number of spaces is minimized by using <Tab>s.
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
|
||||
*'softtabstop'* *'sts'*
|
||||
'softtabstop' 'sts' number (default 0)
|
||||
@ -5733,7 +5750,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
commands like "x" still work on the actual characters.
|
||||
When 'sts' is zero, this feature is off.
|
||||
When 'sts' is negative, the value of 'shiftwidth' is used.
|
||||
'softtabstop' is set to 0 when the 'paste' option is set.
|
||||
'softtabstop' is set to 0 when the 'paste' option is set and restored
|
||||
when 'paste' is reset.
|
||||
See also |ins-expandtab|. When 'expandtab' is not set, the number of
|
||||
spaces is minimized by using <Tab>s.
|
||||
The 'L' flag in 'cpoptions' changes how tabs are used when 'list' is
|
||||
@ -6177,6 +6195,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
split If included, split the current window before loading
|
||||
a buffer for a |quickfix| command that display errors.
|
||||
Otherwise: do not split, use current window.
|
||||
vsplit Just like "split" but split vertically.
|
||||
newtab Like "split", but open a new tab page. Overrules
|
||||
"split" when both are present.
|
||||
|
||||
@ -6370,17 +6389,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
mapping which should not change the tagstack.
|
||||
|
||||
*'term'* *E529* *E530* *E531*
|
||||
'term' string (default is $TERM, if that fails:
|
||||
in the GUI: "builtin_gui"
|
||||
on Mac: "mac-ansi"
|
||||
on Unix: "ansi"
|
||||
on Windows: "win32")
|
||||
global
|
||||
Name of the terminal. Used for choosing the terminal control
|
||||
characters. Environment variables are expanded |:set_env|.
|
||||
For example: >
|
||||
:set term=$TERM
|
||||
< See |termcap|.
|
||||
'term' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'termbidi'* *'tbidi'*
|
||||
*'notermbidi'* *'notbidi'*
|
||||
@ -6411,8 +6420,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
local to buffer
|
||||
Maximum width of text that is being inserted. A longer line will be
|
||||
broken after white space to get this width. A zero value disables
|
||||
this. 'textwidth' is set to 0 when the 'paste' option is set. When
|
||||
'textwidth' is zero, 'wrapmargin' may be used. See also
|
||||
this.
|
||||
'textwidth' is set to 0 when the 'paste' option is set and restored
|
||||
when 'paste' is reset.
|
||||
When 'textwidth' is zero, 'wrapmargin' may be used. See also
|
||||
'formatoptions' and |ins-textwidth|.
|
||||
When 'formatexpr' is set it will be used to break the line.
|
||||
|
||||
@ -6560,9 +6571,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'ttyscroll' 'tsl' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'ttytype'* *'tty'*
|
||||
'ttytype' 'tty' string (default from $TERM)
|
||||
global
|
||||
Alias for 'term', see above.
|
||||
'ttytype' 'tty' Alias for 'term'. Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'undodir'* *'udir'* *E926*
|
||||
'undodir' 'udir' string (default "$XDG_DATA_HOME/nvim/undo")
|
||||
|
@ -1,279 +0,0 @@
|
||||
*os_dos.txt* For Vim version 7.4. Last change: 2006 Mar 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
*dos* *DOS*
|
||||
This file documents some particularities of the Win32
|
||||
version of Vim. Also see |os_win32.txt|.
|
||||
|
||||
1. File locations |dos-locations|
|
||||
2. Using backslashes |dos-backslash|
|
||||
3. Standard mappings |dos-standard-mappings|
|
||||
4. Screen output and colors |dos-colors|
|
||||
5. File formats |dos-file-formats|
|
||||
6. :cd command |dos-:cd|
|
||||
7. Interrupting |dos-CTRL-Break|
|
||||
8. Temp files |dos-temp-files|
|
||||
9. Shell option default |dos-shell|
|
||||
|
||||
==============================================================================
|
||||
1. File locations *dos-locations*
|
||||
|
||||
If you keep the Vim executable in the directory that contains the help and
|
||||
syntax subdirectories, there is no need to do anything special for Vim to
|
||||
work. No registry entries or environment variables need to be set. Just make
|
||||
sure that the directory is in your search path, or use a shortcut on the
|
||||
desktop.
|
||||
|
||||
Your vimrc files ("_vimrc" and "_gvimrc") are normally located one directory
|
||||
up from the runtime files. If you want to put them somewhere else, set the
|
||||
environment variable $VIM to the directory where you keep them. Example: >
|
||||
set VIM=C:\user\piet
|
||||
Will find "c:\user\piet\_vimrc".
|
||||
Note: This would only be needed when the computer is used by several people.
|
||||
Otherwise it's simpler to keep your _vimrc file in the default place.
|
||||
|
||||
If you move the executable to another location, you also need to set the $VIM
|
||||
environment variable. The runtime files will be found in "$VIM/vim{version}".
|
||||
Example: >
|
||||
set VIM=E:\vim
|
||||
Will find the version 5.4 runtime files in "e:\vim\vim54".
|
||||
Note: This is _not_ recommended. The preferred way is to keep the executable
|
||||
in the runtime directory.
|
||||
|
||||
If you move your executable AND want to put your "_vimrc" and "_gvimrc" files
|
||||
somewhere else, you must set $VIM to where you vimrc files are, and set
|
||||
$VIMRUNTIME to the runtime files. Example: >
|
||||
set VIM=C:\usr\piet
|
||||
set VIMRUNTIME=E:\vim\vim54
|
||||
Will find "c:\user\piet\_vimrc" and the runtime files in "e:\vim\vim54".
|
||||
|
||||
See |$VIM| and |$VIMRUNTIME| for more information.
|
||||
|
||||
You can set environment variables for each user separately under
|
||||
"Start/Settings/Control Panel->System", or through the properties in the menu
|
||||
of "My Computer", under the Environment Tab.
|
||||
|
||||
==============================================================================
|
||||
2. Using backslashes *dos-backslash*
|
||||
|
||||
Using backslashes in file names can be a problem. Vi halves the number of
|
||||
backslashes for some commands. Vim is a bit more tolerant and does not remove
|
||||
backslashes from a file name, so ":e c:\foo\bar" works as expected. But when
|
||||
a backslash occurs before a special character (space, comma, backslash, etc.),
|
||||
Vim removes the backslash. Use slashes to avoid problems: ":e c:/foo/bar"
|
||||
works fine. Vim replaces the slashes with backslashes internally to avoid
|
||||
problems with some MS-DOS programs and Win32 programs.
|
||||
|
||||
When you prefer to use forward slashes, set the 'shellslash' option. Vim will
|
||||
then replace backslashes with forward slashes when expanding file names. This
|
||||
is especially useful when using a Unix-like 'shell'.
|
||||
|
||||
==============================================================================
|
||||
3. Standard mappings *dos-standard-mappings*
|
||||
|
||||
The mappings for CTRL-PageUp and CTRL-PageDown have been removed, they now
|
||||
jump to the next or previous tab page |<C-PageUp>| |<C-PageDown>|
|
||||
|
||||
If you want them to move to the first and last screen line you can use these
|
||||
mappings:
|
||||
|
||||
key key code Normal/Visual mode Insert mode ~
|
||||
CTRL-PageUp <M-N><M-C-D> H <C-O>H
|
||||
CTRL-PageDown <M-N>v L$ <C-O>L<C-O>$
|
||||
|
||||
Additionally, these keys are available for copy/cut/paste.
|
||||
In the Win32 version, they also use the clipboard.
|
||||
|
||||
Shift-Insert paste text (from clipboard) *<S-Insert>*
|
||||
CTRL-Insert copy Visual text (to clipboard) *<C-Insert>*
|
||||
CTRL-Del cut Visual text (to clipboard) *<C-Del>*
|
||||
Shift-Del cut Visual text (to clipboard) *<S-Del>*
|
||||
|
||||
These mappings accomplish this (Win32 version of Vim):
|
||||
|
||||
key key code Normal Visual Insert ~
|
||||
Shift-Insert <M-N><M-T> "*P "-d"*P <C-R><C-O>*
|
||||
CTRL-Insert <M-N><M-U> "*y
|
||||
Shift-Del <M-N><M-W> "*d
|
||||
CTRL-Del <M-N><M-X> "*d
|
||||
|
||||
Or these mappings (non-Win32 version of Vim):
|
||||
|
||||
key key code Normal Visual Insert ~
|
||||
Shift-Insert <M-N><M-T> P "-dP <C-R><C-O>"
|
||||
CTRL-Insert <M-N><M-U> y
|
||||
Shift-Del <M-N><M-W> d
|
||||
CTRL-Del <M-N><M-X> d
|
||||
|
||||
When the clipboard is supported, the "* register is used.
|
||||
|
||||
==============================================================================
|
||||
4. Screen output and colors *dos-colors*
|
||||
|
||||
The default output method for the screen is to use bios calls. This works
|
||||
right away on most systems. You do not need ansi.sys. You can use ":mode" to
|
||||
set the current screen mode. See |:mode|.
|
||||
|
||||
To change the screen colors that Vim uses, you can use the |:highlight|
|
||||
command. The Normal highlight group specifies the colors Vim uses for normal
|
||||
text. For example, to get grey text on a blue background: >
|
||||
:hi Normal ctermbg=Blue ctermfg=grey
|
||||
See |highlight-groups| for other groups that are available.
|
||||
|
||||
A DOS console does not support attributes like bold and underlining. You can
|
||||
set the color used in five modes with nine terminal options. Note that this
|
||||
is not necessary since you can set the color directly with the ":highlight"
|
||||
command; these options are for backward compatibility with older Vim versions.
|
||||
The |'highlight'| option specifies which of the five modes is used for which
|
||||
action. >
|
||||
|
||||
:set t_mr=^V^[\|xxm start of invert mode
|
||||
:set t_md=^V^[\|xxm start of bold mode
|
||||
:set t_me=^V^[\|xxm back to normal text
|
||||
|
||||
:set t_so=^V^[\|xxm start of standout mode
|
||||
:set t_se=^V^[\|xxm back to normal text
|
||||
|
||||
:set t_us=^V^[\|xxm start of underline mode
|
||||
:set t_ue=^V^[\|xxm back to normal text
|
||||
|
||||
:set t_ZH=^V^[\|xxm start of italics mode
|
||||
:set t_ZR=^V^[\|xxm back to normal text
|
||||
|
||||
^V is CTRL-V
|
||||
^[ is <Esc>
|
||||
You must replace xx with a decimal code, which is the foreground color number
|
||||
and background color number added together:
|
||||
|
||||
COLOR FOREGROUND BACKGROUND ~
|
||||
Black 0 0
|
||||
DarkBlue 1 16
|
||||
DarkGreen 2 32
|
||||
DarkCyan 3 48
|
||||
DarkRed 4 64
|
||||
DarkMagenta 5 80
|
||||
Brown, DarkYellow 6 96
|
||||
LightGray 7 112
|
||||
DarkGray 8 128 *
|
||||
Blue, LightBlue 9 144 *
|
||||
Green, LightGreen 10 160 *
|
||||
Cyan, LightCyan 11 176 *
|
||||
Red, LightRed 12 192 *
|
||||
Magenta, LightMagenta 13 208 *
|
||||
Yellow, LightYellow 14 224 *
|
||||
White 15 240 *
|
||||
|
||||
* Depending on the display mode, the color codes above 128 may not be
|
||||
available, and code 128 will make the text blink.
|
||||
|
||||
When you use 0, the color is reset to the one used when you started Vim
|
||||
(usually 7, lightgray on black, but you can override this. If you have
|
||||
overridden the default colors in a command prompt, you may need to adjust
|
||||
some of the highlight colors in your vimrc---see below).
|
||||
This is the default for t_me.
|
||||
|
||||
The defaults for the various highlight modes are:
|
||||
t_mr 112 reverse mode: Black text (0) on LightGray (112)
|
||||
t_md 15 bold mode: White text (15) on Black (0)
|
||||
t_me 0 normal mode (revert to default)
|
||||
|
||||
t_so 31 standout mode: White (15) text on DarkBlue (16)
|
||||
t_se 0 standout mode end (revert to default)
|
||||
|
||||
t_czh 225 italic mode: DarkBlue text (1) on Yellow (224)
|
||||
t_czr 0 italic mode end (revert to default)
|
||||
|
||||
t_us 67 underline mode: DarkCyan text (3) on DarkRed (64)
|
||||
t_ue 0 underline mode end (revert to default)
|
||||
|
||||
These colors were chosen because they also look good when using an inverted
|
||||
display, but you can change them to your liking.
|
||||
|
||||
Example: >
|
||||
:set t_mr=^V^[\|97m " start of invert mode: DarkBlue (1) on Brown (96)
|
||||
:set t_md=^V^[\|67m " start of bold mode: DarkCyan (3) on DarkRed (64)
|
||||
:set t_me=^V^[\|112m " back to normal mode: Black (0) on LightGray (112)
|
||||
|
||||
:set t_so=^V^[\|37m " start of standout mode: DarkMagenta (5) on DarkGreen
|
||||
(32)
|
||||
:set t_se=^V^[\|112m " back to normal mode: Black (0) on LightGray (112)
|
||||
|
||||
==============================================================================
|
||||
5. File formats *dos-file-formats*
|
||||
|
||||
If the 'fileformat' option is set to "dos" (which is the default), Vim accepts
|
||||
a single <NL> or a <CR><NL> pair for end-of-line (<EOL>). When writing a
|
||||
file, Vim uses <CR><NL>. Thus, if you edit a file and write it, Vim replaces
|
||||
<NL> with <CR><NL>.
|
||||
|
||||
If the 'fileformat' option is set to "unix", Vim uses a single <NL> for <EOL>
|
||||
and shows <CR> as ^M.
|
||||
|
||||
You can use Vim to replace <NL> with <CR><NL> by reading in any mode and
|
||||
writing in Dos mode (":se ff=dos").
|
||||
You can use Vim to replace <CR><NL> with <NL> by reading in Dos mode and
|
||||
writing in Unix mode (":se ff=unix").
|
||||
|
||||
Vim sets 'fileformat' automatically when 'fileformats' is not empty (which is
|
||||
the default), so you don't really have to worry about what you are doing.
|
||||
|'fileformat'| |'fileformats'|
|
||||
|
||||
If you want to edit a script file or a binary file, you should set the
|
||||
'binary' option before loading the file. Script files and binary files may
|
||||
contain single <NL> characters which Vim would replace with <CR><NL>. You can
|
||||
set 'binary' automatically by starting Vim with the "-b" (binary) option.
|
||||
|
||||
==============================================================================
|
||||
6. :cd command *dos-:cd*
|
||||
|
||||
The ":cd" command recognizes the drive specifier and changes the current
|
||||
drive. Use ":cd c:" to make drive C the active drive. Use ":cd d:\foo" to go
|
||||
to the directory "foo" in the root of drive D. Vim also recognizes UNC names
|
||||
if the system supports them; e.g., ":cd \\server\share\dir". |:cd|
|
||||
|
||||
==============================================================================
|
||||
7. Interrupting *dos-CTRL-Break*
|
||||
|
||||
Use CTRL-Break instead of CTRL-C to interrupt searches. Vim does not detect
|
||||
the CTRL-C until it tries to read a key.
|
||||
|
||||
==============================================================================
|
||||
8. Temp files *dos-temp-files*
|
||||
|
||||
Vim uses standard Windows functions to obtain a temporary file name (for
|
||||
filtering). The first of these directories that exists and in which Vim can
|
||||
create a file is used:
|
||||
$TMP
|
||||
$TEMP
|
||||
current directory
|
||||
|
||||
==============================================================================
|
||||
9. Shell option default *dos-shell*
|
||||
|
||||
The default for the 'sh' ('shell') option is "cmd.exe" on Windows.
|
||||
If SHELL is defined, Vim uses SHELL instead, and if SHELL is not defined
|
||||
but COMSPEC is, Vim uses COMSPEC. Vim starts external commands with
|
||||
"<shell> /c <command_name>". Typing CTRL-Z starts a new command
|
||||
subshell. Return to Vim with "exit". |'shell'| |CTRL-Z|
|
||||
|
||||
If you are running a third-party shell, you may need to set the
|
||||
|'shellcmdflag'| ('shcf') and |'shellquote'| ('shq') or |'shellxquote'|
|
||||
('sxq') options. Unfortunately, this also depends on the version of Vim used.
|
||||
For example, with the MKS Korn shell or with bash, the values of the options
|
||||
on Win32 should be:
|
||||
|
||||
'shellcmdflag' -c
|
||||
'shellquote' (empty)
|
||||
'shellxquote' "
|
||||
|
||||
For Win32, this starts the shell as:
|
||||
<shell> -c "command name >file"
|
||||
|
||||
When starting up, Vim checks for the presence of "sh" anywhere in the 'shell'
|
||||
option. If it is present, Vim sets the 'shellcmdflag' and 'shellquote' or
|
||||
'shellxquote' options will be set as described above.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 7.4. Last change: 2014 Mar 27
|
||||
*quickfix.txt* For Vim version 7.4. Last change: 2015 Sep 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -302,16 +302,22 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
|
||||
etc.
|
||||
< When the current file can't be |abandon|ed and the [!]
|
||||
is not present, the command fails.
|
||||
When an error is detected on one buffer, further
|
||||
buffers will not be visited.
|
||||
When an error is detected excecution stops.
|
||||
The last buffer (or where an error occurred) becomes
|
||||
the current buffer.
|
||||
{cmd} can contain '|' to concatenate several commands.
|
||||
|
||||
Only valid entries in the quickfix list are used.
|
||||
A range can be used to select entries, e.g.: >
|
||||
:10,$cdo cmd
|
||||
< To skip entries 1 to 9.
|
||||
|
||||
Note: While this command is executing, the Syntax
|
||||
autocommand event is disabled by adding it to
|
||||
'eventignore'. This considerably speeds up editing
|
||||
each buffer.
|
||||
{not in Vi} {not available when compiled without the
|
||||
|+listcmds| feature}
|
||||
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|
||||
|:ldo|, |:cfdo| and |:lfdo|.
|
||||
|
||||
@ -323,20 +329,9 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
|
||||
:cnfile
|
||||
:{cmd}
|
||||
etc.
|
||||
< When the current file can't be |abandon|ed and the [!]
|
||||
is not present, the command fails.
|
||||
When an error is detected on one buffer, further
|
||||
buffers will not be visited.
|
||||
The last buffer (or where an error occurred) becomes
|
||||
the current buffer.
|
||||
{cmd} can contain '|' to concatenate several commands.
|
||||
Only valid entries in the quickfix list are used.
|
||||
Note: While this command is executing, the Syntax
|
||||
autocommand event is disabled by adding it to
|
||||
'eventignore'. This considerably speeds up editing
|
||||
each buffer.
|
||||
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|
||||
|:cdo|, |:ldo| and |:lfdo|.
|
||||
< Otherwise it works the same as `:cdo`.
|
||||
{not in Vi} {not available when compiled without the
|
||||
|+listcmds| feature}
|
||||
|
||||
*:ldo*
|
||||
:ld[o][!] {cmd} Execute {cmd} in each valid entry in the location list
|
||||
@ -347,20 +342,10 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
|
||||
:lnext
|
||||
:{cmd}
|
||||
etc.
|
||||
< When the current file can't be |abandon|ed and the [!]
|
||||
is not present, the command fails.
|
||||
When an error is detected on one buffer, further
|
||||
buffers will not be visited.
|
||||
The last buffer (or where an error occurred) becomes
|
||||
the current buffer.
|
||||
{cmd} can contain '|' to concatenate several commands.
|
||||
Only valid entries in the location list are used.
|
||||
Note: While this command is executing, the Syntax
|
||||
autocommand event is disabled by adding it to
|
||||
'eventignore'. This considerably speeds up editing
|
||||
each buffer.
|
||||
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|
||||
|:cdo|, |:cfdo| and |:lfdo|.
|
||||
< Only valid entries in the location list are used.
|
||||
Otherwise it works the same as `:cdo`.
|
||||
{not in Vi} {not available when compiled without the
|
||||
|+listcmds| feature}
|
||||
|
||||
*:lfdo*
|
||||
:lfdo[!] {cmd} Execute {cmd} in each file in the location list for
|
||||
@ -371,20 +356,9 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
|
||||
:lnfile
|
||||
:{cmd}
|
||||
etc.
|
||||
< When the current file can't be |abandon|ed and the [!]
|
||||
is not present, the command fails.
|
||||
When an error is detected on one buffer, further
|
||||
buffers will not be visited.
|
||||
The last buffer (or where an error occurred) becomes
|
||||
the current buffer.
|
||||
{cmd} can contain '|' to concatenate several commands.
|
||||
Only valid entries in the location list are used.
|
||||
Note: While this command is executing, the Syntax
|
||||
autocommand event is disabled by adding it to
|
||||
'eventignore'. This considerably speeds up editing
|
||||
each buffer.
|
||||
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|
||||
|:cdo|, |:ldo| and |:cfdo|.
|
||||
< Otherwise it works the same as `:ldo`.
|
||||
{not in Vi} {not available when compiled without the
|
||||
|+listcmds| feature}
|
||||
|
||||
=============================================================================
|
||||
2. The error window *quickfix-window*
|
||||
|
@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 7.4. Last change: 2014 Nov 19
|
||||
*quickref.txt* For Vim version 7.4. Last change: 2015 Jul 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -617,6 +617,7 @@ Short explanation of each option: *option-list*
|
||||
'balloondelay' 'bdlay' delay in mS before a balloon may pop up
|
||||
'ballooneval' 'beval' switch on balloon evaluation
|
||||
'balloonexpr' 'bexpr' expression to show in balloon
|
||||
'belloff' 'bo' do not ring the bell for these reasons
|
||||
'binary' 'bin' read/write/edit file in binary mode
|
||||
'bomb' prepend a Byte Order Mark to the file
|
||||
'breakat' 'brk' characters that may cause a line break
|
||||
@ -688,6 +689,7 @@ Short explanation of each option: *option-list*
|
||||
'fileignorecase' 'fic' ignore case when using file names
|
||||
'filetype' 'ft' type of file, used for autocommands
|
||||
'fillchars' 'fcs' characters to use for displaying special items
|
||||
'fixendofline' 'fixeol' make sure last line in file has <EOL>
|
||||
'fkmap' 'fk' Farsi keyboard mapping
|
||||
'foldclose' 'fcl' close a fold when the cursor leaves it
|
||||
'foldcolumn' 'fdc' width of the column used to indicate folds
|
||||
@ -702,10 +704,10 @@ Short explanation of each option: *option-list*
|
||||
'foldnestmax' 'fdn' maximum fold depth
|
||||
'foldopen' 'fdo' for which commands a fold will be opened
|
||||
'foldtext' 'fdt' expression used to display for a closed fold
|
||||
'formatexpr' 'fex' expression used with "gq" command
|
||||
'formatlistpat' 'flp' pattern used to recognize a list header
|
||||
'formatoptions' 'fo' how automatic formatting is to be done
|
||||
'formatprg' 'fp' name of external program used with "gq" command
|
||||
'formatexpr' 'fex' expression used with "gq" command
|
||||
'fsync' 'fs' whether to invoke fsync() after file write
|
||||
'gdefault' 'gd' the ":substitute" flag 'g' is default on
|
||||
'grepformat' 'gfm' format of 'grepprg' output
|
||||
@ -873,9 +875,9 @@ Short explanation of each option: *option-list*
|
||||
'switchbuf' 'swb' sets behavior when switching to another buffer
|
||||
'synmaxcol' 'smc' maximum column to find syntax items
|
||||
'syntax' 'syn' syntax to be loaded for current buffer
|
||||
'tabstop' 'ts' number of spaces that <Tab> in file uses
|
||||
'tabline' 'tal' custom format for the console tab pages line
|
||||
'tabpagemax' 'tpm' maximum number of tab pages for |-p| and "tab all"
|
||||
'tabstop' 'ts' number of spaces that <Tab> in file uses
|
||||
'tagbsearch' 'tbs' use binary searching in tags files
|
||||
'taglength' 'tl' number of significant characters for a tag
|
||||
'tagrelative' 'tr' file names in tag file are relative
|
||||
|
@ -109,6 +109,12 @@ q{0-9a-zA-Z"} Record typed characters into register {0-9a-zA-Z"}
|
||||
while executing a register, and it doesn't work inside
|
||||
a mapping and |:normal|.
|
||||
|
||||
Note: If the register being used for recording is also
|
||||
used for |y| and |p| the result is most likely not
|
||||
what is expected, because the put will paste the
|
||||
recorded macro and the yank will overwrite the
|
||||
recorded macro.
|
||||
|
||||
q Stops recording.
|
||||
Implementation note: The 'q' that stops recording is
|
||||
not stored in the register, unless it was the result
|
||||
|
@ -217,7 +217,7 @@ argument.
|
||||
:set to display option values.
|
||||
When 'verbose' is non-zero messages are printed (for
|
||||
debugging, to stderr).
|
||||
'term' and $TERM are not used.
|
||||
$TERM is not used.
|
||||
If Vim appears to be stuck try typing "qa!<Enter>". You don't
|
||||
get a prompt thus you can't see Vim is waiting for you to type
|
||||
something.
|
||||
@ -315,9 +315,10 @@ argument.
|
||||
When {vimrc} is equal to "NONE" (all uppercase), all
|
||||
initializations from files and environment variables are
|
||||
skipped, including reading the |ginit.vim| file when the GUI
|
||||
starts. Loading plugins is also skipped.
|
||||
starts. Plugins and syntax highlighting are also skipped.
|
||||
When {vimrc} is equal to "NORC" (all uppercase), this has the
|
||||
same effect as "NONE", but loading plugins is not skipped.
|
||||
same effect as "NONE", but plugins and syntax highlighting are
|
||||
not skipped.
|
||||
|
||||
*-i*
|
||||
-i {shada} The file {shada} is used instead of the default ShaDa
|
||||
@ -354,13 +355,10 @@ argument.
|
||||
At startup, Vim checks environment variables and files and sets values
|
||||
accordingly. Vim proceeds in this order:
|
||||
|
||||
1. Set the 'shell' and 'term' option *SHELL* *COMSPEC* *TERM*
|
||||
1. Set the 'shell' option *SHELL* *COMSPEC* *TERM*
|
||||
The environment variable SHELL, if it exists, is used to set the
|
||||
'shell' option. On Windows, the COMSPEC variable is used
|
||||
if SHELL is not set.
|
||||
The environment variable TERM, if it exists, is used to set the 'term'
|
||||
option. However, 'term' will change later when starting the GUI (step
|
||||
8 below).
|
||||
|
||||
2. Process the arguments
|
||||
The options and file names from the command that start Vim are
|
||||
@ -382,6 +380,8 @@ accordingly. Vim proceeds in this order:
|
||||
Places for your personal initializations:
|
||||
Unix $XDG_CONFIG_HOME/nvim/init.vim
|
||||
(default for $XDG_CONFIG_HOME is ~/.config)
|
||||
Windows $XDG_CONFIG_HOME/nvim/init.vim
|
||||
(default for $XDG_CONFIG_HOME is ~/AppData/Local)
|
||||
|
||||
The files are searched in the order specified above and only the first
|
||||
one that is found is read.
|
||||
@ -394,7 +394,8 @@ accordingly. Vim proceeds in this order:
|
||||
All following initializations until 4. are skipped. $MYVIMRC is not
|
||||
set.
|
||||
"vim -u NORC" can be used to skip these initializations without
|
||||
reading a file. "vim -u NONE" also skips loading plugins. |-u|
|
||||
reading a file. "vim -u NONE" also skips plugins and syntax
|
||||
highlighting. |-u|
|
||||
|
||||
If Vim was started in Ex mode with the "-s" argument, all following
|
||||
initializations until 4. are skipped. Only the "-u" option is
|
||||
@ -427,7 +428,22 @@ accordingly. Vim proceeds in this order:
|
||||
- The file ".exrc" (for Unix)
|
||||
"_exrc" (for Win32)
|
||||
|
||||
4. Load the plugin scripts. *load-plugins*
|
||||
4. Enable filetype and indent plugins.
|
||||
This does the same as the commands: >
|
||||
:runtime! filetype.vim
|
||||
:runtime! ftplugin.vim
|
||||
:runtime! indent.vim
|
||||
< This step is skipped if ":filetype ..." was called before now or if
|
||||
the "-u NONE" command line argument was given.
|
||||
|
||||
5. Enable syntax highlighting.
|
||||
This does the same as the command: >
|
||||
:runtime! syntax/syntax.vim
|
||||
< Note: This enables filetype detection even if ":filetype off" was
|
||||
called before now.
|
||||
This step is skipped if the "-u NONE" command line argument was given.
|
||||
|
||||
6. Load the plugin scripts. *load-plugins*
|
||||
This does the same as the command: >
|
||||
:runtime! plugin/**/*.vim
|
||||
< The result is that all directories in the 'runtimepath' option will be
|
||||
@ -443,31 +459,30 @@ accordingly. Vim proceeds in this order:
|
||||
commands from the command line have not been executed yet. You can
|
||||
use "--cmd 'set noloadplugins'" |--cmd|.
|
||||
|
||||
5. Set 'shellpipe' and 'shellredir'
|
||||
7. Set 'shellpipe' and 'shellredir'
|
||||
The 'shellpipe' and 'shellredir' options are set according to the
|
||||
value of the 'shell' option, unless they have been set before.
|
||||
This means that Vim will figure out the values of 'shellpipe' and
|
||||
'shellredir' for you, unless you have set them yourself.
|
||||
|
||||
6. Set 'updatecount' to zero, if "-n" command argument used
|
||||
8. Set 'updatecount' to zero, if "-n" command argument used
|
||||
|
||||
7. Set binary options
|
||||
9. Set binary options
|
||||
If the "-b" flag was given to Vim, the options for binary editing will
|
||||
be set now. See |-b|.
|
||||
|
||||
8. Perform GUI initializations
|
||||
10. Perform GUI initializations
|
||||
Only when starting "gvim", the GUI initializations will be done. See
|
||||
|gui-init|.
|
||||
|
||||
9. Read the ShaDa file
|
||||
If the 'shada' option is not empty, the ShaDa file is read. See
|
||||
|shada-file|.
|
||||
11. Read the ShaDa file
|
||||
See |shada-file|.
|
||||
|
||||
10. Read the quickfix file
|
||||
12. Read the quickfix file
|
||||
If the "-q" flag was given to Vim, the quickfix file is read. If this
|
||||
fails, Vim exits.
|
||||
|
||||
11. Open all windows
|
||||
13. Open all windows
|
||||
When the |-o| flag was given, windows will be opened (but not
|
||||
displayed yet).
|
||||
When the |-p| flag was given, tab pages will be created (but not
|
||||
@ -476,7 +491,7 @@ accordingly. Vim proceeds in this order:
|
||||
If the "-q" flag was given to Vim, the first error is jumped to.
|
||||
Buffers for all windows will be loaded.
|
||||
|
||||
12. Execute startup commands
|
||||
14. Execute startup commands
|
||||
If a "-t" flag was given to Vim, the tag is jumped to.
|
||||
The commands given with the |-c| and |+cmd| arguments are executed.
|
||||
The starting flag is reset, has("vim_starting") will now return zero.
|
||||
@ -705,8 +720,8 @@ vimrc file.
|
||||
These commands will write ":map" and ":set" commands to a file, in such a way
|
||||
that when these commands are executed, the current key mappings and options
|
||||
will be set to the same values. The options 'columns', 'endofline',
|
||||
'fileformat', 'lines', 'modified', 'scroll', and 'term' are not included,
|
||||
because these are terminal or file dependent.
|
||||
'fileformat', 'lines', 'modified', and 'scroll' are not included, because
|
||||
these are terminal or file dependent.
|
||||
Note that the options 'binary', 'paste' and 'readonly' are included, this
|
||||
might not always be what you want.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 7.4. Last change: 2015 Mar 29
|
||||
*syntax.txt* For Vim version 7.4. Last change: 2015 Sep 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -417,18 +417,19 @@ and last line to be converted. Example, using the last set Visual area: >
|
||||
*:TOhtml*
|
||||
:[range]TOhtml The ":TOhtml" command is defined in a standard plugin.
|
||||
This command will source |2html.vim| for you. When a
|
||||
range is given, set |g:html_start_line| and
|
||||
|g:html_end_line| to the start and end of the range,
|
||||
respectively. Default range is the entire buffer.
|
||||
range is given, this command sets |g:html_start_line|
|
||||
and |g:html_end_line| to the start and end of the
|
||||
range, respectively. Default range is the entire
|
||||
buffer.
|
||||
|
||||
If the current window is part of a |diff|, unless
|
||||
|g:html_diff_one_file| is set, :TOhtml will convert
|
||||
all windows which are part of the diff in the current
|
||||
tab and place them side-by-side in a <table> element
|
||||
in the generated HTML. With |g:html_line_ids| you can
|
||||
jump to lines in specific windows with (for example)
|
||||
#W1L42 for line 42 in the first diffed window, or
|
||||
#W3L87 for line 87 in the third.
|
||||
If the current window is part of a |diff|, unless
|
||||
|g:html_diff_one_file| is set, :TOhtml will convert
|
||||
all windows which are part of the diff in the current
|
||||
tab and place them side-by-side in a <table> element
|
||||
in the generated HTML. With |g:html_line_ids| you can
|
||||
jump to lines in specific windows with (for example)
|
||||
#W1L42 for line 42 in the first diffed window, or
|
||||
#W3L87 for line 87 in the third.
|
||||
|
||||
Examples: >
|
||||
|
||||
@ -742,6 +743,22 @@ and UTF-32 instead, use: >
|
||||
Note that documents encoded in either UTF-32 or UTF-16 have known
|
||||
compatibility problems with some major browsers.
|
||||
|
||||
*g:html_font*
|
||||
Default: "monospace"
|
||||
You can specify the font or fonts used in the converted document using
|
||||
g:html_font. If this option is set to a string, then the value will be
|
||||
surrounded with single quotes. If this option is set to a list then each list
|
||||
item is surrounded by single quotes and the list is joined with commas. Either
|
||||
way, "monospace" is added as the fallback generic family name and the entire
|
||||
result used as the font family (using CSS) or font face (if not using CSS).
|
||||
Examples: >
|
||||
|
||||
" font-family: 'Consolas', monospace;
|
||||
:let g:html_font = "Consolas"
|
||||
|
||||
" font-family: 'DejaVu Sans Mono', 'Consolas', monospace;
|
||||
:let g:html_font = ["DejaVu Sans Mono", "Consolas"]
|
||||
<
|
||||
*convert-to-XML* *convert-to-XHTML* *g:html_use_xhtml*
|
||||
Default: 0.
|
||||
When 0, generate standard HTML 4.01 (strict when possible).
|
||||
@ -3430,7 +3447,7 @@ DEFINING KEYWORDS *:syn-keyword*
|
||||
:syntax keyword Type contained int long char
|
||||
:syntax keyword Type int long contained char
|
||||
:syntax keyword Type int long char contained
|
||||
< *E789*
|
||||
< *E789* *E890*
|
||||
When you have a keyword with an optional tail, like Ex commands in
|
||||
Vim, you can put the optional characters inside [], to define all the
|
||||
variations at once: >
|
||||
@ -3684,6 +3701,7 @@ Whether or not it is actually concealed depends on the value of the
|
||||
'conceallevel' option. The 'concealcursor' option is used to decide whether
|
||||
concealable items in the current line are displayed unconcealed to be able to
|
||||
edit the line.
|
||||
Another way to conceal text with with |matchadd()|.
|
||||
|
||||
concealends *:syn-concealends*
|
||||
|
||||
|
@ -273,8 +273,8 @@ window on the same buffer and then edit another buffer. Thus ":tabnew"
|
||||
triggers:
|
||||
WinLeave leave current window
|
||||
TabLeave leave current tab page
|
||||
TabEnter enter new tab page
|
||||
WinEnter enter window in new tab page
|
||||
TabEnter enter new tab page
|
||||
BufLeave leave current buffer
|
||||
BufEnter enter new empty buffer
|
||||
|
||||
@ -282,8 +282,8 @@ When switching to another tab page the order is:
|
||||
BufLeave
|
||||
WinLeave
|
||||
TabLeave
|
||||
TabEnter
|
||||
WinEnter
|
||||
TabEnter
|
||||
BufEnter
|
||||
|
||||
When entering a new tab page (|:tabnew|), TabNew is triggered before TabEnter
|
||||
|
@ -250,8 +250,8 @@ ignored if its owner differs from the owner of the edited file, except when
|
||||
the owner of the undo file is the current user. Set 'verbose' to get a
|
||||
message about that when opening a file.
|
||||
|
||||
Undo files are normally saved in the same directory as the file. This can be
|
||||
changed with the 'undodir' option.
|
||||
Location of the undo files is controlled by the 'undodir' option, by default
|
||||
they are saved to the dedicated directory in the application data folder.
|
||||
|
||||
You can also save and restore undo histories by using ":wundo" and ":rundo"
|
||||
respectively:
|
||||
|
@ -37,9 +37,10 @@ for you), you can edit it this way: >
|
||||
If you don't have a vimrc file yet, see |init.vim| to find out where you can
|
||||
create a vimrc file.
|
||||
|
||||
For Unix and Macintosh this file is always used and is recommended:
|
||||
This file is always used and is recommended:
|
||||
|
||||
~/.config/nvim/init.vim ~
|
||||
~/.config/nvim/init.vim (Unix and OSX) ~
|
||||
~/AppData/Local/nvim/init.vim (Windows) ~
|
||||
|
||||
The vimrc file can contain all the commands that you type after a colon. The
|
||||
most simple ones are for setting options. For example, if you want Vim to
|
||||
|
@ -152,7 +152,7 @@ You could also write your own color scheme. This is how you do it:
|
||||
directory. For Unix, this should work: >
|
||||
|
||||
!mkdir -p ~/.config/nvim/colors
|
||||
!cp $VIMRUNTIME/colors/morning.vim ~/.vim/colors/mine.vim
|
||||
!cp $VIMRUNTIME/colors/morning.vim ~/.config/nvim/colors/mine.vim
|
||||
<
|
||||
This is done from Vim, because it knows the value of $VIMRUNTIME.
|
||||
|
||||
|
@ -222,6 +222,10 @@ g8 Print the hex values of the bytes used in the
|
||||
modified, but can be forced with "!". See |termopen()|
|
||||
and |nvim-terminal-emulator| for more information.
|
||||
|
||||
To switch to terminal mode automatically:
|
||||
>
|
||||
autocmd BufEnter term://* startinsert
|
||||
<
|
||||
*:!cmd* *:!* *E34*
|
||||
:!{cmd} Execute {cmd} with 'shell'. See also |:terminal|.
|
||||
|
||||
|
@ -11,7 +11,7 @@ the "{Nvim}" tag. This document is a complete and centralized list of all
|
||||
these differences.
|
||||
|
||||
1. Configuration |nvim-configuration|
|
||||
2. Option defaults |nvim-option-defaults|
|
||||
2. Defaults |nvim-defaults|
|
||||
3. Changed features |nvim-features-changed|
|
||||
4. New features |nvim-features-new|
|
||||
5. Missing legacy features |nvim-features-missing|
|
||||
@ -21,14 +21,17 @@ these differences.
|
||||
==============================================================================
|
||||
1. Configuration *nvim-configuration*
|
||||
|
||||
- Use `$XDG_CONFIG_HOME/nvim/init.vim` instead of `.vimrc` for storing
|
||||
- Use `$XDG_CONFIG_HOME/nvim/init.vim` instead of `.vimrc` for storing
|
||||
configuration.
|
||||
- Use `$XDG_CONFIG_HOME/nvim` instead of `.vim` to store configuration files.
|
||||
- Use `$XDG_DATA_HOME/nvim/shada/main.shada` instead of `.viminfo` for persistent
|
||||
- Use `$XDG_DATA_HOME/nvim/shada/main.shada` instead of `.viminfo` for persistent
|
||||
session information.
|
||||
|
||||
==============================================================================
|
||||
2. Option defaults *nvim-option-defaults*
|
||||
2. Defaults *nvim-defaults*
|
||||
|
||||
- Syntax highlighting is enabled by default
|
||||
- ":filetype plugin indent on" is enabled by default
|
||||
|
||||
- 'autoindent' is set by default
|
||||
- 'autoread' is set by default
|
||||
@ -45,7 +48,7 @@ these differences.
|
||||
- 'listchars' defaults to "tab:> ,trail:-,nbsp:+"
|
||||
- 'mouse' defaults to "a"
|
||||
- 'nocompatible' is always set
|
||||
- 'nrformats' defaults to "hex"
|
||||
- 'nrformats' defaults to "bin,hex"
|
||||
- 'sessionoptions' doesn't include "options"
|
||||
- 'smarttab' is set by default
|
||||
- 'tabpagemax' defaults to 50
|
||||
@ -68,54 +71,72 @@ are always available and may be used simultaneously in separate plugins. The
|
||||
|nvim-python|).
|
||||
|
||||
|mkdir()| behaviour changed:
|
||||
1. Assuming /tmp/foo does not exist and /tmp can be written to
|
||||
1. Assuming /tmp/foo does not exist and /tmp can be written to
|
||||
mkdir('/tmp/foo/bar', 'p', 0700) will create both /tmp/foo and /tmp/foo/bar
|
||||
with 0700 permissions. Vim mkdir will create /tmp/foo with 0755.
|
||||
2. If you try to create an existing directory with `'p'` (e.g. mkdir('/',
|
||||
2. If you try to create an existing directory with `'p'` (e.g. mkdir('/',
|
||||
'p')) mkdir() will silently exit. In Vim this was an error.
|
||||
3. mkdir() error messages now include strerror() text when mkdir fails.
|
||||
|
||||
'encoding' cannot be changed after startup.
|
||||
|
||||
|string()| and |:echo| behaviour changed:
|
||||
1. No maximum recursion depth limit is applied to nested container
|
||||
1. No maximum recursion depth limit is applied to nested container
|
||||
structures.
|
||||
2. |string()| fails immediately on nested containers, not when recursion limit
|
||||
2. |string()| fails immediately on nested containers, not when recursion limit
|
||||
was exceeded.
|
||||
2. When |:echo| encounters duplicate containers like >
|
||||
|
||||
let l = []
|
||||
echo [l, l]
|
||||
<
|
||||
it does not use "[...]" (was: "[[], [...]]", now: "[[], []]"). "..." is
|
||||
it does not use "[...]" (was: "[[], [...]]", now: "[[], []]"). "..." is
|
||||
only used for recursive containers.
|
||||
3. |:echo| printing nested containers adds "@level" after "..." designating
|
||||
the level at which recursive container was printed: |:echo-self-refer|.
|
||||
Same thing applies to |string()| (though it uses construct like
|
||||
"{E724@level}"), but this is not reliable because |string()| continues to
|
||||
3. |:echo| printing nested containers adds "@level" after "..." designating
|
||||
the level at which recursive container was printed: |:echo-self-refer|.
|
||||
Same thing applies to |string()| (though it uses construct like
|
||||
"{E724@level}"), but this is not reliable because |string()| continues to
|
||||
error out.
|
||||
4. Stringifyed infinite and NaN values now use |str2float()| and can be evaled
|
||||
back.
|
||||
5. (internal) Trying to print or stringify VAR_UNKNOWN in Vim results in
|
||||
nothing, |E908|, in Neovim it is internal error.
|
||||
|
||||
Viminfo text files were replaced with binary (messagepack) ShaDa files.
|
||||
|json_decode()| behaviour changed:
|
||||
1. It may output |msgpack-special-dict|.
|
||||
2. |msgpack-special-dict| is emitted also in case of duplicate keys, while in
|
||||
Vim it errors out.
|
||||
3. It accepts only valid JSON. Trailing commas are not accepted.
|
||||
|
||||
|json_encode()| behaviour slightly changed: now |msgpack-special-dict| values
|
||||
are accepted, but |v:none| is not.
|
||||
|
||||
*v:none* variable is absent. In Vim it represents “no value” in “js” strings
|
||||
like "[,]" parsed as "[v:none]" by |js_decode()|.
|
||||
|
||||
*js_encode()* and *js_decode()* functions are also absent.
|
||||
|
||||
Viminfo text files were replaced with binary (messagepack) ShaDa files.
|
||||
Additional differences:
|
||||
|
||||
- |shada-c| has no effect.
|
||||
- |shada-s| now limits size of every item and not just registers.
|
||||
- When reading ShaDa files items are merged according to the timestamp.
|
||||
- When reading ShaDa files items are merged according to the timestamp.
|
||||
|shada-merging|
|
||||
- 'viminfo' option got renamed to 'shada'. Old option is kept as an alias for
|
||||
- 'viminfo' option got renamed to 'shada'. Old option is kept as an alias for
|
||||
compatibility reasons.
|
||||
- |:wviminfo| was renamed to |:wshada|, |:rviminfo| to |:rshada|. Old
|
||||
- |:wviminfo| was renamed to |:wshada|, |:rviminfo| to |:rshada|. Old
|
||||
commands are still kept.
|
||||
- |:oldfiles| supports !.
|
||||
- When writing (|:wshada| without bang or at exit) it merges much more data,
|
||||
and does this according to the timestamp. Vim merges only marks.
|
||||
- When writing (|:wshada| without bang or at exit) it merges much more data,
|
||||
and does this according to the timestamp. Vim merges only marks.
|
||||
|shada-merging|
|
||||
- ShaDa file format was designed with forward and backward compatibility in
|
||||
- ShaDa file format was designed with forward and backward compatibility in
|
||||
mind. |shada-compatibility|
|
||||
- Some errors make ShaDa code keep temporary file in-place for user to decide
|
||||
what to do with it. Vim deletes temporary file in these cases.
|
||||
- Some errors make ShaDa code keep temporary file in-place for user to decide
|
||||
what to do with it. Vim deletes temporary file in these cases.
|
||||
|shada-error-handling|
|
||||
- Vim keeps no timestamps at all, neither in viminfo file nor in the instance
|
||||
- Vim keeps no timestamps at all, neither in viminfo file nor in the instance
|
||||
itself.
|
||||
- ShaDa file keeps search direction (|v:searchforward|), viminfo does not.
|
||||
|
||||
@ -134,8 +155,8 @@ Meta (alt) chords are recognized (even in the terminal).
|
||||
|
||||
Note: Meta chords are case-sensitive (<M-a> is distinguished from <M-A>).
|
||||
|
||||
Some `CTRL-SHIFT-...` key chords are distinguished from `CTRL-...` variants (even in
|
||||
the terminal). Specifically, the following are known to work:
|
||||
Some `CTRL-SHIFT-...` key chords are distinguished from `CTRL-...` variants
|
||||
(even in the terminal). Specifically, the following are known to work:
|
||||
<C-Tab>, <C-S-Tab>
|
||||
<C-BS>, <C-S-BS>
|
||||
<C-Enter>, <C-S-Enter>
|
||||
@ -207,6 +228,7 @@ Other options:
|
||||
'shelltype'
|
||||
'shortname'
|
||||
'swapsync'
|
||||
'term'
|
||||
'termencoding' (Vim 7.4.852 also removed this for Windows)
|
||||
'textauto'
|
||||
'textmode'
|
||||
@ -214,6 +236,8 @@ Other options:
|
||||
'toolbariconsize'
|
||||
'ttybuiltin'
|
||||
'ttymouse'
|
||||
'ttyscroll'
|
||||
'ttytype'
|
||||
'weirdinvert'
|
||||
|
||||
Other commands:
|
||||
|
@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 7.4. Last change: 2015 Jan 31
|
||||
*windows.txt* For Vim version 7.4. Last change: 2015 Aug 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -706,7 +706,7 @@ can also get to them with the buffer list commands, like ":bnext".
|
||||
|
||||
*:bufdo*
|
||||
:[range]bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list or if
|
||||
[range[ is given only for buffers for which their
|
||||
[range] is given only for buffers for which their
|
||||
buffer name is in the [range]. It works like doing
|
||||
this: >
|
||||
:bfirst
|
||||
@ -1099,13 +1099,13 @@ list of buffers. |unlisted-buffer|
|
||||
the current buffer remains being edited. See |:buffer-!| for
|
||||
[!]. This will also edit a buffer that is not in the buffer
|
||||
list, without setting the 'buflisted' flag.
|
||||
Also see ||+cmd|.
|
||||
Also see |+cmd|.
|
||||
|
||||
:[N]b[uffer][!] [+cmd] {bufname}
|
||||
Edit buffer for {bufname} from the buffer list. See
|
||||
|:buffer-!| for [!]. This will also edit a buffer that is not
|
||||
in the buffer list, without setting the 'buflisted' flag.
|
||||
Also see ||+cmd|.
|
||||
Also see |+cmd|.
|
||||
|
||||
:[N]sb[uffer] [+cmd] [N] *:sb* *:sbuffer*
|
||||
Split window and edit buffer [N] from the buffer list. If [N]
|
||||
@ -1113,7 +1113,7 @@ list of buffers. |unlisted-buffer|
|
||||
"useopen" setting of 'switchbuf' when splitting. This will
|
||||
also edit a buffer that is not in the buffer list, without
|
||||
setting the 'buflisted' flag.
|
||||
Also see ||+cmd|.
|
||||
Also see |+cmd|.
|
||||
|
||||
:[N]sb[uffer] [+cmd] {bufname}
|
||||
Split window and edit buffer for {bufname} from the buffer
|
||||
@ -1122,13 +1122,13 @@ list of buffers. |unlisted-buffer|
|
||||
Note: If what you want to do is split the buffer, make a copy
|
||||
under another name, you can do it this way: >
|
||||
:w foobar | sp #
|
||||
< Also see ||+cmd|.
|
||||
< Also see |+cmd|.
|
||||
|
||||
:[N]bn[ext][!] [+cmd] [N] *:bn* *:bnext* *E87*
|
||||
Go to [N]th next buffer in buffer list. [N] defaults to one.
|
||||
Wraps around the end of the buffer list.
|
||||
See |:buffer-!| for [!].
|
||||
Also see ||+cmd|.
|
||||
Also see |+cmd|.
|
||||
If you are in a help buffer, this takes you to the next help
|
||||
buffer (if there is one). Similarly, if you are in a normal
|
||||
(non-help) buffer, this takes you to the next normal buffer.
|
||||
@ -1141,21 +1141,21 @@ list of buffers. |unlisted-buffer|
|
||||
:[N]sbn[ext] [+cmd] [N]
|
||||
Split window and go to [N]th next buffer in buffer list.
|
||||
Wraps around the end of the buffer list. Uses 'switchbuf'
|
||||
Also see ||+cmd|.
|
||||
Also see |+cmd|.
|
||||
|
||||
:[N]bN[ext][!] [+cmd] [N] *:bN* *:bNext* *:bp* *:bprevious* *E88*
|
||||
:[N]bp[revious][!] [+cmd] [N]
|
||||
Go to [N]th previous buffer in buffer list. [N] defaults to
|
||||
one. Wraps around the start of the buffer list.
|
||||
See |:buffer-!| for [!] and 'switchbuf'.
|
||||
Also see ||+cmd|.
|
||||
Also see |+cmd|.
|
||||
|
||||
:[N]sbN[ext] [+cmd] [N] *:sbN* *:sbNext* *:sbp* *:sbprevious*
|
||||
:[N]sbp[revious] [+cmd] [N]
|
||||
Split window and go to [N]th previous buffer in buffer list.
|
||||
Wraps around the start of the buffer list.
|
||||
Uses 'switchbuf'.
|
||||
Also see ||+cmd|.
|
||||
Also see |+cmd|.
|
||||
|
||||
:br[ewind][!] [+cmd] *:br* *:brewind*
|
||||
Go to first buffer in buffer list. If the buffer list is
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2015 Apr 06
|
||||
" Last Change: 2015 Oct 13
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@ -139,7 +139,7 @@ au BufNewFile,BufRead .arch-inventory,=tagging-method setf arch
|
||||
au BufNewFile,BufRead *.art setf art
|
||||
|
||||
" AsciiDoc
|
||||
au BufNewFile,BufRead *.asciidoc setf asciidoc
|
||||
au BufNewFile,BufRead *.asciidoc,*.adoc setf asciidoc
|
||||
|
||||
" ASN.1
|
||||
au BufNewFile,BufRead *.asn,*.asn1 setf asn
|
||||
@ -304,6 +304,9 @@ au BufNewFile,BufRead *.bl setf blank
|
||||
" Blkid cache file
|
||||
au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
|
||||
|
||||
" Bazel (http://bazel.io)
|
||||
autocmd BufRead,BufNewFile *.bzl,BUILD,WORKSPACE setfiletype bzl
|
||||
|
||||
" C or lpc
|
||||
au BufNewFile,BufRead *.c call s:FTlpc()
|
||||
|
||||
@ -822,7 +825,7 @@ au BufNewFile,BufRead *.gs setf grads
|
||||
au BufNewFile,BufRead *.gretl setf gretl
|
||||
|
||||
" Groovy
|
||||
au BufNewFile,BufRead *.groovy setf groovy
|
||||
au BufNewFile,BufRead *.gradle,*.groovy setf groovy
|
||||
|
||||
" GNU Server Pages
|
||||
au BufNewFile,BufRead *.gsp setf gsp
|
||||
@ -868,7 +871,7 @@ func! s:FThtml()
|
||||
setf xhtml
|
||||
return
|
||||
endif
|
||||
if getline(n) =~ '{%\s*\(extends\|block\|load\)\>'
|
||||
if getline(n) =~ '{%\s*\(extends\|block\|load\)\>\|{#\s\+'
|
||||
setf htmldjango
|
||||
return
|
||||
endif
|
||||
@ -1164,7 +1167,7 @@ func! s:FTm()
|
||||
let n = 1
|
||||
while n < 10
|
||||
let line = getline(n)
|
||||
if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\|//\)'
|
||||
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\|//\)'
|
||||
setf objc
|
||||
return
|
||||
endif
|
||||
@ -1332,7 +1335,7 @@ func! s:FTmm()
|
||||
let n = 1
|
||||
while n < 10
|
||||
let line = getline(n)
|
||||
if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\)'
|
||||
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)'
|
||||
setf objcpp
|
||||
return
|
||||
endif
|
||||
@ -1855,7 +1858,7 @@ au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog')
|
||||
|
||||
" Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
|
||||
" Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts
|
||||
au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash_profile*,.bash_logout*,.bash_aliases*,*.bash,*.ebuild,PKGBUILD* call SetFileTypeSH("bash")
|
||||
au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass call SetFileTypeSH("bash")
|
||||
au BufNewFile,BufRead .kshrc*,*.ksh call SetFileTypeSH("ksh")
|
||||
au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call SetFileTypeSH(getline(1))
|
||||
|
||||
@ -2119,6 +2122,9 @@ au BufNewFile,BufRead *.cm setf voscm
|
||||
" Sysctl
|
||||
au BufNewFile,BufRead */etc/sysctl.conf,*/etc/sysctl.d/*.conf setf sysctl
|
||||
|
||||
" Systemd unit files
|
||||
au BufNewFile,BufRead */systemd/*.{automount,mount,path,service,socket,swap,target,timer} setf systemd
|
||||
|
||||
" Synopsys Design Constraints
|
||||
au BufNewFile,BufRead *.sdc setf sdc
|
||||
|
||||
@ -2174,6 +2180,9 @@ au BufNewFile,BufRead *.tli setf tli
|
||||
" Telix Salt
|
||||
au BufNewFile,BufRead *.slt setf tsalt
|
||||
|
||||
" Tera Term Language
|
||||
au BufRead,BufNewFile *.ttl setf teraterm
|
||||
|
||||
" Terminfo
|
||||
au BufNewFile,BufRead *.ti setf terminfo
|
||||
|
||||
|
94
runtime/ftplugin/bzl.vim
Normal file
94
runtime/ftplugin/bzl.vim
Normal file
@ -0,0 +1,94 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Bazel (http://bazel.io)
|
||||
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
|
||||
" Last Change: 2015 Aug 11
|
||||
|
||||
""
|
||||
" @section Introduction, intro
|
||||
" Core settings for the bzl filetype, used for BUILD and *.bzl files for the
|
||||
" Bazel build system (http://bazel.io/).
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
" Vim 7.4.051 has opinionated settings in ftplugin/python.vim that try to force
|
||||
" PEP8 conventions on every python file, but these conflict with Google's
|
||||
" indentation guidelines. As a workaround, we explicitly source the system
|
||||
" ftplugin, but save indentation settings beforehand and restore them after.
|
||||
let s:save_expandtab = &l:expandtab
|
||||
let s:save_shiftwidth = &l:shiftwidth
|
||||
let s:save_softtabstop = &l:softtabstop
|
||||
let s:save_tabstop = &l:tabstop
|
||||
|
||||
" NOTE: Vim versions before 7.3.511 had a ftplugin/python.vim that was broken
|
||||
" for compatible mode.
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Load base python ftplugin (also defines b:did_ftplugin).
|
||||
source $VIMRUNTIME/ftplugin/python.vim
|
||||
|
||||
" NOTE: Vim versions before 7.4.104 and later set this in ftplugin/python.vim.
|
||||
setlocal comments=b:#,fb:-
|
||||
|
||||
" Restore pre-existing indentation settings.
|
||||
let &l:expandtab = s:save_expandtab
|
||||
let &l:shiftwidth = s:save_shiftwidth
|
||||
let &l:softtabstop = s:save_softtabstop
|
||||
let &l:tabstop = s:save_tabstop
|
||||
|
||||
setlocal formatoptions-=t
|
||||
|
||||
" Make gf work with imports in BUILD files.
|
||||
setlocal includeexpr=substitute(v:fname,'//','','')
|
||||
|
||||
" Enable syntax-based folding, if specified.
|
||||
if get(g:, 'ft_bzl_fold', 0)
|
||||
setlocal foldmethod=syntax
|
||||
setlocal foldtext=BzlFoldText()
|
||||
endif
|
||||
|
||||
if exists('*BzlFoldText')
|
||||
finish
|
||||
endif
|
||||
|
||||
function BzlFoldText() abort
|
||||
let l:start_num = nextnonblank(v:foldstart)
|
||||
let l:end_num = prevnonblank(v:foldend)
|
||||
|
||||
if l:end_num <= l:start_num + 1
|
||||
" If the fold is empty, don't print anything for the contents.
|
||||
let l:content = ''
|
||||
else
|
||||
" Otherwise look for something matching the content regex.
|
||||
" And if nothing matches, print an ellipsis.
|
||||
let l:content = '...'
|
||||
for l:line in getline(l:start_num + 1, l:end_num - 1)
|
||||
let l:content_match = matchstr(l:line, '\m\C^\s*name = \zs.*\ze,$')
|
||||
if !empty(l:content_match)
|
||||
let l:content = l:content_match
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
" Enclose content with start and end
|
||||
let l:start_text = getline(l:start_num)
|
||||
let l:end_text = substitute(getline(l:end_num), '^\s*', '', '')
|
||||
let l:text = l:start_text . ' ' . l:content . ' ' . l:end_text
|
||||
|
||||
" Compute the available width for the displayed text.
|
||||
let l:width = winwidth(0) - &foldcolumn - (&number ? &numberwidth : 0)
|
||||
let l:lines_folded = ' ' . string(1 + v:foldend - v:foldstart) . ' lines'
|
||||
|
||||
" Expand tabs, truncate, pad, and concatenate
|
||||
let l:text = substitute(l:text, '\t', repeat(' ', &tabstop), 'g')
|
||||
let l:text = strpart(l:text, 0, l:width - len(l:lines_folded))
|
||||
let l:padding = repeat(' ', l:width - len(l:lines_folded) - len(l:text))
|
||||
return l:text . l:padding . l:lines_folded
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
@ -2,7 +2,7 @@
|
||||
" Language: J
|
||||
" Maintainer: David Bürgin <676c7473@gmail.com>
|
||||
" URL: https://github.com/glts/vim-j
|
||||
" Last Change: 2015-03-27
|
||||
" Last Change: 2015-09-27
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
@ -12,13 +12,20 @@ let b:did_ftplugin = 1
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal iskeyword=48-57,A-Z,_,a-z
|
||||
setlocal iskeyword=48-57,A-Z,a-z,_
|
||||
setlocal comments=:NB.
|
||||
setlocal commentstring=NB.\ %s
|
||||
setlocal formatoptions-=t
|
||||
setlocal matchpairs=(:)
|
||||
setlocal path-=/usr/include
|
||||
|
||||
let b:undo_ftplugin = 'setlocal matchpairs< formatoptions< commentstring< comments< iskeyword<'
|
||||
" Includes. To make the shorthand form "require 'web/cgi'" work, double the
|
||||
" last path component. Also strip off leading folder names like "~addons/".
|
||||
setlocal include=\\v^\\s*(load\|require)\\s*'\\zs\\f+\\ze'
|
||||
setlocal includeexpr=substitute(substitute(tr(v:fname,'\\','/'),'\\v^[^~][^/.]*(/[^/.]+)$','&\\1',''),'\\v^\\~[^/]+/','','')
|
||||
setlocal suffixesadd=.ijs
|
||||
|
||||
let b:undo_ftplugin = 'setlocal matchpairs< formatoptions< commentstring< comments< iskeyword< path< include< includeexpr< suffixesadd<'
|
||||
|
||||
" Section movement with ]] ][ [[ []. The start/end patterns below are amended
|
||||
" inside the function in order to avoid matching on the current cursor line.
|
||||
|
@ -24,11 +24,11 @@ setlocal buftype=nofile noswapfile
|
||||
setlocal nomodifiable readonly bufhidden=hide nobuflisted tabstop=8
|
||||
|
||||
if !exists("g:no_plugin_maps") && !exists("g:no_man_maps")
|
||||
nnoremap <silent> <buffer> <C-]> :call man#get_page(v:count)<CR>
|
||||
nnoremap <silent> <buffer> <C-]> :call man#get_page(v:count, expand('<cword>'))<CR>
|
||||
nnoremap <silent> <buffer> <C-T> :call man#pop_page()<CR>
|
||||
nnoremap <silent> <nowait><buffer> q <C-W>c
|
||||
if &keywordprg !=# ':Man'
|
||||
nnoremap <silent> <buffer> K :call man#get_page(v:count)<CR>
|
||||
nnoremap <silent> <buffer> K :call man#get_page(v:count, expand('<cword>'))<CR>
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
" Filename: spec.vim
|
||||
" Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com
|
||||
" Former Maintainer: Gustavo Niemeyer <niemeyer@conectiva.com> (until March 2014)
|
||||
" Last Change: Fri Feb 20 16:01 MSK 2014 Igor Gnatenko
|
||||
" Last Change: Mon Jun 01 21:15 MSK 2015 Igor Gnatenko
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
|
7
runtime/ftplugin/systemd.vim
Normal file
7
runtime/ftplugin/systemd.vim
Normal file
@ -0,0 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: systemd.unit(5)
|
||||
|
||||
if !exists('b:did_ftplugin')
|
||||
" Looks a lot like dosini files.
|
||||
runtime! ftplugin/dosini.vim
|
||||
endif
|
97
runtime/indent/bzl.vim
Normal file
97
runtime/indent/bzl.vim
Normal file
@ -0,0 +1,97 @@
|
||||
" Vim indent file
|
||||
" Language: Bazel (http://bazel.io)
|
||||
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
|
||||
" Last Change: 2015 Aug 11
|
||||
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Load base python indent.
|
||||
if !exists('*GetPythonIndent')
|
||||
runtime! indent/python.vim
|
||||
endif
|
||||
|
||||
let b:did_indent = 1
|
||||
|
||||
" Only enable bzl google indent if python google indent is enabled.
|
||||
if !get(g:, 'no_google_python_indent')
|
||||
setlocal indentexpr=GetBzlIndent(v:lnum)
|
||||
endif
|
||||
|
||||
if exists('*GetBzlIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo-=C
|
||||
|
||||
" Maximum number of lines to look backwards.
|
||||
let s:maxoff = 50
|
||||
|
||||
""
|
||||
" Determine the correct indent level given an {lnum} in the current buffer.
|
||||
function GetBzlIndent(lnum) abort
|
||||
let l:use_recursive_indent = !get(g:, 'no_google_python_recursive_indent')
|
||||
if l:use_recursive_indent
|
||||
" Backup and override indent setting variables.
|
||||
if exists('g:pyindent_nested_paren')
|
||||
let l:pyindent_nested_paren = g:pyindent_nested_paren
|
||||
endif
|
||||
if exists('g:pyindent_open_paren')
|
||||
let l:pyindent_open_paren = g:pyindent_open_paren
|
||||
endif
|
||||
" Vim 7.3.693 and later defines a shiftwidth() function to get the effective
|
||||
" shiftwidth value. Fall back to &shiftwidth if the function doesn't exist.
|
||||
let l:sw_expr = exists('*shiftwidth') ? 'shiftwidth()' : '&shiftwidth'
|
||||
let g:pyindent_nested_paren = l:sw_expr . ' * 2'
|
||||
let g:pyindent_open_paren = l:sw_expr . ' * 2'
|
||||
endif
|
||||
|
||||
let l:indent = -1
|
||||
|
||||
" Indent inside parens.
|
||||
" Align with the open paren unless it is at the end of the line.
|
||||
" E.g.
|
||||
" open_paren_not_at_EOL(100,
|
||||
" (200,
|
||||
" 300),
|
||||
" 400)
|
||||
" open_paren_at_EOL(
|
||||
" 100, 200, 300, 400)
|
||||
call cursor(a:lnum, 1)
|
||||
let [l:par_line, l:par_col] = searchpairpos('(\|{\|\[', '', ')\|}\|\]', 'bW',
|
||||
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" .
|
||||
\ " synIDattr(synID(line('.'), col('.'), 1), 'name')" .
|
||||
\ " =~ '\\(Comment\\|String\\)$'")
|
||||
if l:par_line > 0
|
||||
call cursor(l:par_line, 1)
|
||||
if l:par_col != col('$') - 1
|
||||
let l:indent = l:par_col
|
||||
endif
|
||||
endif
|
||||
|
||||
" Delegate the rest to the original function.
|
||||
if l:indent == -1
|
||||
let l:indent = GetPythonIndent(a:lnum)
|
||||
endif
|
||||
|
||||
if l:use_recursive_indent
|
||||
" Restore global variables.
|
||||
if exists('l:pyindent_nested_paren')
|
||||
let g:pyindent_nested_paren = l:pyindent_nested_paren
|
||||
else
|
||||
unlet g:pyindent_nested_paren
|
||||
endif
|
||||
if exists('l:pyindent_open_paren')
|
||||
let g:pyindent_open_paren = l:pyindent_open_paren
|
||||
else
|
||||
unlet g:pyindent_open_paren
|
||||
endif
|
||||
endif
|
||||
|
||||
return l:indent
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
@ -2,7 +2,7 @@
|
||||
" Header: "{{{
|
||||
" Maintainer: Bram Moolenaar
|
||||
" Original Author: Andy Wokula <anwoku@yahoo.de>
|
||||
" Last Change: 2015 Jun 12
|
||||
" Last Change: 2015 Sep 25
|
||||
" Version: 1.0
|
||||
" Description: HTML indent script with cached state for faster indenting on a
|
||||
" range of lines.
|
||||
@ -178,13 +178,15 @@ let s:countonly = 0
|
||||
" 3 "script"
|
||||
" 4 "style"
|
||||
" 5 comment start
|
||||
" 6 conditional comment start
|
||||
" -1 closing tag
|
||||
" -2 "/pre"
|
||||
" -3 "/script"
|
||||
" -4 "/style"
|
||||
" -5 comment end
|
||||
" -6 conditional comment end
|
||||
let s:indent_tags = {}
|
||||
let s:endtags = [0,0,0,0,0,0] " long enough for the highest index
|
||||
let s:endtags = [0,0,0,0,0,0,0] " long enough for the highest index
|
||||
"}}}
|
||||
|
||||
" Add a list of tag names for a pair of <tag> </tag> to "tags".
|
||||
@ -257,6 +259,7 @@ call s:AddBlockTag('pre', 2)
|
||||
call s:AddBlockTag('script', 3)
|
||||
call s:AddBlockTag('style', 4)
|
||||
call s:AddBlockTag('<!--', 5, '-->')
|
||||
call s:AddBlockTag('<!--[', 6, '![endif]-->')
|
||||
"}}}
|
||||
|
||||
" Return non-zero when "tagname" is an opening tag, not being a block tag, for
|
||||
@ -291,7 +294,7 @@ func! s:CountITags(text)
|
||||
let s:nextrel = 0 " relative indent steps for next line [unit &sw]:
|
||||
let s:block = 0 " assume starting outside of a block
|
||||
let s:countonly = 1 " don't change state
|
||||
call substitute(a:text, '<\zs/\=\w\+\(-\w\+\)*\>\|<!--\|-->', '\=s:CheckTag(submatch(0))', 'g')
|
||||
call substitute(a:text, '<\zs/\=\w\+\(-\w\+\)*\>\|<!--\[\|\[endif\]-->\|<!--\|-->', '\=s:CheckTag(submatch(0))', 'g')
|
||||
let s:countonly = 0
|
||||
endfunc "}}}
|
||||
|
||||
@ -303,7 +306,7 @@ func! s:CountTagsAndState(text)
|
||||
let s:nextrel = 0 " relative indent steps for next line [unit &sw]:
|
||||
|
||||
let s:block = b:hi_newstate.block
|
||||
let tmp = substitute(a:text, '<\zs/\=\w\+\(-\w\+\)*\>\|<!--\|-->', '\=s:CheckTag(submatch(0))', 'g')
|
||||
let tmp = substitute(a:text, '<\zs/\=\w\+\(-\w\+\)*\>\|<!--\[\|\[endif\]-->\|<!--\|-->', '\=s:CheckTag(submatch(0))', 'g')
|
||||
if s:block == 3
|
||||
let b:hi_newstate.scripttype = s:GetScriptType(matchstr(tmp, '\C.*<SCRIPT\>\zs[^>]*'))
|
||||
endif
|
||||
@ -425,7 +428,7 @@ func! s:FreshState(lnum)
|
||||
" State:
|
||||
" lnum last indented line == prevnonblank(a:lnum - 1)
|
||||
" block = 0 a:lnum located within special tag: 0:none, 2:<pre>,
|
||||
" 3:<script>, 4:<style>, 5:<!--
|
||||
" 3:<script>, 4:<style>, 5:<!--, 6:<!--[
|
||||
" baseindent use this indent for line a:lnum as a start - kind of
|
||||
" autoindent (if block==0)
|
||||
" scripttype = '' type attribute of a script tag (if block==3)
|
||||
@ -464,10 +467,13 @@ func! s:FreshState(lnum)
|
||||
" FI
|
||||
|
||||
" look back for a blocktag
|
||||
call cursor(a:lnum, 1)
|
||||
let [stopline, stopcol] = searchpos('\c<\zs\/\=\%(pre\>\|script\>\|style\>\)', "bW")
|
||||
if stopline > 0
|
||||
" fugly ... why isn't there searchstr()
|
||||
let stopline2 = v:lnum + 1
|
||||
if has_key(b:hi_indent, 'block') && b:hi_indent.block > 5
|
||||
let [stopline2, stopcol2] = searchpos('<!--', 'bnW')
|
||||
endif
|
||||
let [stopline, stopcol] = searchpos('\c<\zs\/\=\%(pre\>\|script\>\|style\>\)', "bnW")
|
||||
if stopline > 0 && stopline < stopline2
|
||||
" ugly ... why isn't there searchstr()
|
||||
let tagline = tolower(getline(stopline))
|
||||
let blocktag = matchstr(tagline, '\/\=\%(pre\>\|script\>\|style\>\)', stopcol - 1)
|
||||
if blocktag[0] != "/"
|
||||
@ -487,23 +493,29 @@ func! s:FreshState(lnum)
|
||||
" blocktag == "/..."
|
||||
let swendtag = match(tagline, '^\s*</') >= 0
|
||||
if !swendtag
|
||||
let [bline, bcol] = searchpos('<'.blocktag[1:].'\>', "bW")
|
||||
let [bline, bcol] = searchpos('<'.blocktag[1:].'\>', "bnW")
|
||||
call s:CountITags(tolower(getline(bline)[: bcol-2]))
|
||||
let state.baseindent = indent(bline) + (s:curind + s:nextrel) * s:ShiftWidth()
|
||||
return state
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
if stopline > stopline2
|
||||
let stopline = stopline2
|
||||
let stopcol = stopcol2
|
||||
endif
|
||||
|
||||
" else look back for comment
|
||||
call cursor(a:lnum, 1)
|
||||
let [comlnum, comcol, found] = searchpos('\(<!--\)\|-->', 'bpW', stopline)
|
||||
if found == 2
|
||||
let [comlnum, comcol, found] = searchpos('\(<!--\[\)\|\(<!--\)\|-->', 'bpnW', stopline)
|
||||
if found == 2 || found == 3
|
||||
" comment opener found, assume a:lnum within comment
|
||||
let state.block = 5
|
||||
let state.block = (found == 3 ? 5 : 6)
|
||||
let state.blocklnr = comlnum
|
||||
" check preceding tags in the line:
|
||||
call s:CountITags(tolower(getline(comlnum)[: comcol-2]))
|
||||
if found == 2
|
||||
let state.baseindent = b:hi_indent.baseindent
|
||||
endif
|
||||
let state.blocktagind = indent(comlnum) + (s:curind + s:nextrel) * s:ShiftWidth()
|
||||
return state
|
||||
endif
|
||||
@ -819,6 +831,20 @@ func! s:Alien5()
|
||||
return indent(prevlnum)
|
||||
endfunc "}}}
|
||||
|
||||
" Return the indent for conditional comment: <!--[ ![endif]-->
|
||||
func! s:Alien6()
|
||||
"{{{
|
||||
let curtext = getline(v:lnum)
|
||||
if curtext =~ '\s*\zs<!\[endif\]-->'
|
||||
" current line starts with end of comment, line up with comment start.
|
||||
let lnum = search('<!--', 'bn')
|
||||
if lnum > 0
|
||||
return indent(lnum)
|
||||
endif
|
||||
endif
|
||||
return b:hi_indent.baseindent + s:ShiftWidth()
|
||||
endfunc "}}}
|
||||
|
||||
" When the "lnum" line ends in ">" find the line containing the matching "<".
|
||||
func! HtmlIndent_FindTagStart(lnum)
|
||||
"{{{
|
||||
|
@ -1,8 +1,11 @@
|
||||
" Vim indent file
|
||||
" Language: Shell Script
|
||||
" Maintainer: Peter Aronoff <telemachus@arpinum.org>
|
||||
" Original Author: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2014-08-22
|
||||
" Language: Shell Script
|
||||
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||
" Previous Maintainer: Peter Aronoff <telemachus@arpinum.org>
|
||||
" Original Author: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2015-07-28
|
||||
" License: Vim (see :h license)
|
||||
" Repository: https://github.com/chrisbra/vim-sh-indent
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
@ -10,7 +13,7 @@ endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetShIndent()
|
||||
setlocal indentkeys+=0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,),0=;;,0=;&
|
||||
setlocal indentkeys+=0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,0=end,),0=;;,0=;&
|
||||
setlocal indentkeys+=0=fin,0=fil,0=fip,0=fir,0=fix
|
||||
setlocal indentkeys-=:,0#
|
||||
setlocal nosmartindent
|
||||
@ -54,8 +57,8 @@ function! GetShIndent()
|
||||
|
||||
let ind = indent(lnum)
|
||||
let line = getline(lnum)
|
||||
if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\)\>'
|
||||
if line !~ '\<\%(fi\|esac\|done\)\>\s*\%(#.*\)\=$'
|
||||
if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>'
|
||||
if line !~ '\<\%(fi\|esac\|done\|end\)\>\s*\%(#.*\)\=$'
|
||||
let ind += s:indent_value('default')
|
||||
endif
|
||||
elseif s:is_case_label(line, pnum)
|
||||
@ -76,7 +79,7 @@ function! GetShIndent()
|
||||
|
||||
let pine = line
|
||||
let line = getline(v:lnum)
|
||||
if line =~ '^\s*\%(then\|do\|else\|elif\|fi\|done\)\>' || line =~ '^\s*}'
|
||||
if line =~ '^\s*\%(then\|do\|else\|elif\|fi\|done\|end\)\>' || line =~ '^\s*}'
|
||||
let ind -= s:indent_value('default')
|
||||
elseif line =~ '^\s*esac\>' && s:is_case_empty(getline(v:lnum - 1))
|
||||
let ind -= s:indent_value('default')
|
||||
|
10
runtime/indent/systemd.vim
Normal file
10
runtime/indent/systemd.vim
Normal file
@ -0,0 +1,10 @@
|
||||
" Vim indent file
|
||||
" Language: systemd.unit(5)
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Looks a lot like dosini files.
|
||||
runtime! indent/dosini.vim
|
67
runtime/indent/teraterm.vim
Normal file
67
runtime/indent/teraterm.vim
Normal file
@ -0,0 +1,67 @@
|
||||
" Vim indent file
|
||||
" Language: Tera Term Language (TTL)
|
||||
" Based on Tera Term Version 4.86
|
||||
" Maintainer: Ken Takata
|
||||
" URL: https://github.com/k-takata/vim-teraterm
|
||||
" Last Change: 2015 Jun 4
|
||||
" Filenames: *.ttl
|
||||
" License: VIM License
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal nosmartindent
|
||||
setlocal noautoindent
|
||||
setlocal indentexpr=GetTeraTermIndent(v:lnum)
|
||||
setlocal indentkeys=!^F,o,O,e
|
||||
setlocal indentkeys+==elseif,=endif,=loop,=next,=enduntil,=endwhile
|
||||
|
||||
if exists("*GetTeraTermIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
" The shiftwidth() function is relatively new.
|
||||
" Don't require it to exist.
|
||||
if exists('*shiftwidth')
|
||||
function s:sw() abort
|
||||
return shiftwidth()
|
||||
endfunction
|
||||
else
|
||||
function s:sw() abort
|
||||
return &shiftwidth
|
||||
endfunction
|
||||
endif
|
||||
|
||||
function! GetTeraTermIndent(lnum)
|
||||
let l:prevlnum = prevnonblank(a:lnum-1)
|
||||
if l:prevlnum == 0
|
||||
" top of file
|
||||
return 0
|
||||
endif
|
||||
|
||||
" grab the previous and current line, stripping comments.
|
||||
let l:prevl = substitute(getline(l:prevlnum), ';.*$', '', '')
|
||||
let l:thisl = substitute(getline(a:lnum), ';.*$', '', '')
|
||||
let l:previ = indent(l:prevlnum)
|
||||
|
||||
let l:ind = l:previ
|
||||
|
||||
if l:prevl =~ '^\s*if\>.*\<then\s*$'
|
||||
" previous line opened a block
|
||||
let l:ind += s:sw()
|
||||
endif
|
||||
if l:prevl =~ '^\s*\%(elseif\|else\|do\|until\|while\|for\)\>'
|
||||
" previous line opened a block
|
||||
let l:ind += s:sw()
|
||||
endif
|
||||
if l:thisl =~ '^\s*\%(elseif\|else\|endif\|enduntil\|endwhile\|loop\|next\)\>'
|
||||
" this line closed a block
|
||||
let l:ind -= s:sw()
|
||||
endif
|
||||
|
||||
return l:ind
|
||||
endfunction
|
||||
|
||||
" vim: ts=8 sw=2 sts=2
|
@ -1,6 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: YAML
|
||||
" Maintainer: Nikolai Pavlov <zyx.vim@gmail.com>
|
||||
" Last Change: 2015 Sep 25
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
@ -115,8 +116,13 @@ function GetYAMLIndent(lnum)
|
||||
\ s:liststartregex))
|
||||
elseif line =~# s:mapkeyregex
|
||||
" Same for line containing mapping key
|
||||
return indent(s:FindPrevLEIndentedLineMatchingRegex(a:lnum,
|
||||
\ s:mapkeyregex))
|
||||
let prevmapline = s:FindPrevLEIndentedLineMatchingRegex(a:lnum,
|
||||
\ s:mapkeyregex)
|
||||
if getline(prevmapline) =~# '^\s*- '
|
||||
return indent(prevmapline) + 2
|
||||
else
|
||||
return indent(prevmapline)
|
||||
endif
|
||||
elseif prevline =~# '^\s*- '
|
||||
" - List with
|
||||
" multiline scalar
|
||||
|
@ -4,7 +4,7 @@ rem Read stdin if no arguments were given.
|
||||
rem Written by Ken Takata.
|
||||
|
||||
if "%1"=="" (
|
||||
vim --cmd "let no_plugin_maps = 1" -c "runtime! macros/less.vim" -
|
||||
nvim --cmd "let no_plugin_maps = 1" -c "runtime! macros/less.vim" -
|
||||
) else (
|
||||
vim --cmd "let no_plugin_maps = 1" -c "runtime! macros/less.vim" %*
|
||||
nvim --cmd "let no_plugin_maps = 1" -c "runtime! macros/less.vim" %*
|
||||
)
|
||||
|
@ -8,9 +8,9 @@ if test -t 1; then
|
||||
echo "Missing filename" 1>&2
|
||||
exit
|
||||
fi
|
||||
vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' -
|
||||
nvim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' -
|
||||
else
|
||||
vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' "$@"
|
||||
nvim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' "$@"
|
||||
fi
|
||||
else
|
||||
# Output is not a terminal, cat arguments or stdin
|
||||
|
@ -177,6 +177,7 @@ SynMenu DE.Doxygen.C\ with\ doxygen:c.doxygen
|
||||
SynMenu DE.Doxygen.C++\ with\ doxygen:cpp.doxygen
|
||||
SynMenu DE.Doxygen.IDL\ with\ doxygen:idl.doxygen
|
||||
SynMenu DE.Doxygen.Java\ with\ doxygen:java.doxygen
|
||||
SynMenu DE.Doxygen.DataScript\ with\ doxygen:datascript.doxygen
|
||||
SynMenu DE.Dracula:dracula
|
||||
SynMenu DE.DSSSL:dsl
|
||||
SynMenu DE.DTD:dtd
|
||||
|
@ -1,7 +1,7 @@
|
||||
" These commands create the option window.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2014 Nov 19
|
||||
" Last Change: 2015 Jul 22
|
||||
|
||||
" If there already is an option window, jump to that one.
|
||||
if bufwinnr("option-window") > 0
|
||||
@ -673,6 +673,8 @@ call append("$", "errorbells\tring the bell for error messages")
|
||||
call <SID>BinOptionG("eb", &eb)
|
||||
call append("$", "visualbell\tuse a visual bell instead of beeping")
|
||||
call <SID>BinOptionG("vb", &vb)
|
||||
call append("$", "belloff\tdo not ring the bell for these reasons")
|
||||
call <SID>OptionG("belloff", &belloff)
|
||||
if has("multi_lang")
|
||||
call append("$", "helplang\tlist of preferred languages for finding help")
|
||||
call <SID>OptionG("hlg", &hlg)
|
||||
@ -922,7 +924,7 @@ call <SID>BinOptionL("bin")
|
||||
call append("$", "endofline\tlast line in the file has an end-of-line")
|
||||
call append("$", "\t(local to buffer)")
|
||||
call <SID>BinOptionL("eol")
|
||||
call append("$", "fixeol\tfixes missing end-of-line at end of text file")
|
||||
call append("$", "fixendofline\tfixes missing end-of-line at end of text file")
|
||||
call append("$", "\t(local to buffer)")
|
||||
call <SID>BinOptionL("fixeol")
|
||||
if has("multi_byte")
|
||||
|
@ -303,7 +303,7 @@ fun! s:CleanUp(options, mode, startline, startcol, ...)
|
||||
let regexp = s:Wholematch(matchline, a:1, currcol-1)
|
||||
let endcol = matchend(matchline, regexp)
|
||||
if endcol > currcol " This is NOT off by one!
|
||||
execute "normal!" . (endcol - currcol) . "l"
|
||||
call cursor(0, endcol)
|
||||
endif
|
||||
endif " a:0
|
||||
endif " a:mode != "o" && etc.
|
||||
|
@ -1,5 +1,16 @@
|
||||
if exists('loaded_remote_plugins') || &cp
|
||||
if exists('g:loaded_remote_plugins')
|
||||
finish
|
||||
endif
|
||||
let loaded_remote_plugins = 1
|
||||
call remote#host#LoadRemotePlugins()
|
||||
let g:loaded_remote_plugins = 1
|
||||
|
||||
command! UpdateRemotePlugins call remote#host#UpdateRemotePlugins()
|
||||
|
||||
augroup nvim-rplugin
|
||||
autocmd!
|
||||
autocmd FuncUndefined *
|
||||
\ call remote#host#LoadRemotePluginsEvent(
|
||||
\ 'FuncUndefined', expand('<amatch>'))
|
||||
autocmd CmdUndefined *
|
||||
\ call remote#host#LoadRemotePluginsEvent(
|
||||
\ 'CmdUndefined', expand('<amatch>'))
|
||||
augroup END
|
||||
|
@ -1,15 +1,8 @@
|
||||
" Vim plugin for downloading spell files
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2006 Feb 01
|
||||
|
||||
" Exit quickly when:
|
||||
" - this plugin was already loaded
|
||||
" - when 'compatible' is set
|
||||
" - some autocommands are already taking care of spell files
|
||||
if exists("loaded_spellfile_plugin") || &cp || exists("#SpellFileMissing")
|
||||
finish
|
||||
endif
|
||||
let loaded_spellfile_plugin = 1
|
||||
|
||||
" The function is in the autoload directory.
|
||||
autocmd SpellFileMissing * call spellfile#LoadFile(expand('<amatch>'))
|
||||
|
@ -1,6 +1,6 @@
|
||||
" Vim plugin for converting a syntax highlighted file to HTML.
|
||||
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
|
||||
" Last Change: 2013 Jul 08
|
||||
" Last Change: 2015 Sep 08
|
||||
"
|
||||
" The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and
|
||||
" $VIMRUNTIME/syntax/2html.vim
|
||||
@ -67,20 +67,24 @@
|
||||
if exists('g:loaded_2html_plugin')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_2html_plugin = 'vim7.4_v1'
|
||||
let g:loaded_2html_plugin = 'vim7.4_v2'
|
||||
|
||||
"
|
||||
" Changelog: {{{
|
||||
" 7.4_v1 (this version): Fix modeline mangling for new "Vim:" format, and
|
||||
" 7.4_v2 (this version): Fix error raised when converting a diff containing
|
||||
" an empty buffer. Jan Stocker: allow g:html_font to
|
||||
" take a list so it is easier to specfiy fallback
|
||||
" fonts in the generated CSS.
|
||||
" 7.4_v1 (Vim 7.4.0000): Fix modeline mangling for new "Vim:" format, and
|
||||
" also for version-specific modelines like "vim>703:".
|
||||
"
|
||||
" 7.3 updates: {{{
|
||||
" 7.3_v14 (ad6996a23e3e): Allow suppressing line number anchors using
|
||||
" 7.3_v14 (Vim 7.3.1246): Allow suppressing line number anchors using
|
||||
" g:html_line_ids=0. Allow customizing
|
||||
" important IDs (like line IDs and fold IDs) using
|
||||
" g:html_id_expr evalutated when the buffer conversion
|
||||
" is started.
|
||||
" 7.3_v13 (2eb30f341e8d): Keep foldmethod at manual in the generated file and
|
||||
" 7.3_v13 (Vim 7.3.1088): Keep foldmethod at manual in the generated file and
|
||||
" insert modeline to set it to manual.
|
||||
" Fix bug: diff mode with 2 unsaved buffers creates a
|
||||
" duplicate of one buffer instead of including both.
|
||||
@ -91,7 +95,7 @@ let g:loaded_2html_plugin = 'vim7.4_v1'
|
||||
" Fix XML validation error: &nsbp; not part of XML.
|
||||
" Allow TOhtml to chain together with other commands
|
||||
" using |.
|
||||
" 7.3_v12 (9910cbff5f16): Fix modeline mangling to also work for when multiple
|
||||
" 7.3_v12 (Vim 7.3.0616): Fix modeline mangling to also work for when multiple
|
||||
" highlight groups make up the start-of-modeline text.
|
||||
" Improve render time of page with uncopyable regions
|
||||
" by not using one-input-per-char. Change name of
|
||||
@ -117,23 +121,23 @@ let g:loaded_2html_plugin = 'vim7.4_v1'
|
||||
" http://groups.google.com/d/topic/vim_dev/B6FSGfq9VoI/discussion.
|
||||
" This patch has not yet been included in Vim, thus
|
||||
" these changes are removed in the next version.
|
||||
" 7.3_v10 (fd09a9c8468e): Fix error E684 when converting a range wholly inside
|
||||
" 7.3_v10 (Vim 7.3.0227): Fix error E684 when converting a range wholly inside
|
||||
" multiple nested folds with dynamic folding on.
|
||||
" Also fix problem with foldtext in this situation.
|
||||
" 7.3_v9 (0877b8d6370e): Add html_pre_wrap option active with html_use_css
|
||||
" 7.3_v9 (Vim 7.3.0170): Add html_pre_wrap option active with html_use_css
|
||||
" and without html_no_pre, default value same as
|
||||
" 'wrap' option, (Andy Spencer). Don't use
|
||||
" 'fileencoding' for converted document encoding if
|
||||
" 'buftype' indicates a special buffer which isn't
|
||||
" written.
|
||||
" 7.3_v8 (85c5a72551e2): Add html_expand_tabs option to allow leaving tab
|
||||
" 7.3_v8 (Vim 7.3.0100): Add html_expand_tabs option to allow leaving tab
|
||||
" characters in generated output (Andy Spencer).
|
||||
" Escape text that looks like a modeline so Vim
|
||||
" doesn't use anything in the converted HTML as a
|
||||
" modeline. Bugfixes: Fix folding when a fold starts
|
||||
" before the conversion range. Remove fold column when
|
||||
" there are no folds.
|
||||
" 7.3_v7 (840c3cadb842): see betas released on vim_dev below:
|
||||
" 7.3_v7 (Vim 7-3-0063): see betas released on vim_dev below:
|
||||
" 7.3_v7b3: Fixed bug, convert Unicode to UTF-8 all the way.
|
||||
" 7.3_v7b2: Remove automatic detection of encodings that are not
|
||||
" supported by all major browsers according to
|
||||
@ -147,23 +151,22 @@ let g:loaded_2html_plugin = 'vim7.4_v1'
|
||||
" charset, and make sure the 'fenc' of the generated
|
||||
" file matches its indicated charset. Add charsets for
|
||||
" all of Vim's natively supported encodings.
|
||||
" 7.3_v6 (0d3f0e3d289b): Really fix bug with 'nowrapscan', 'magic' and other
|
||||
" 7.3_v6 (Vim 7.3.0000): Really fix bug with 'nowrapscan', 'magic' and other
|
||||
" user settings interfering with diff mode generation,
|
||||
" trailing whitespace (e.g. line number column) when
|
||||
" using html_no_pre, and bugs when using
|
||||
" html_hover_unfold.
|
||||
" 7.3_v5 ( unreleased ): Fix bug with 'nowrapscan' and also with out-of-sync
|
||||
" folds in diff mode when first line was folded.
|
||||
" 7.3_v4 (7e008c174cc3): Bugfixes, especially for xhtml markup, and diff mode
|
||||
" 7.3_v3 (a29075150aee): Refactor option handling and make html_use_css
|
||||
" 7.3_v4 (Vim 7.3.0000): Bugfixes, especially for xhtml markup, and diff mode
|
||||
" 7.3_v3 (Vim 7.3.0000): Refactor option handling and make html_use_css
|
||||
" default to true when not set to anything. Use strict
|
||||
" doctypes where possible. Rename use_xhtml option to
|
||||
" html_use_xhtml for consistency. Use .xhtml extension
|
||||
" when using this option. Add meta tag for settings.
|
||||
" 7.3_v2 (80229a724a11): Fix syntax highlighting in diff mode to use both the
|
||||
" 7.3_v2 (Vim 7.3.0000): Fix syntax highlighting in diff mode to use both the
|
||||
" diff colors and the normal syntax colors
|
||||
" 7.3_v1 (e7751177126b): Add conceal support and meta tags in output
|
||||
" Pre-v1 baseline: Mercurial changeset 3c9324c0800e
|
||||
" 7.3_v1 (Vim 7.3.0000): Add conceal support and meta tags in output
|
||||
"}}}
|
||||
"}}}
|
||||
|
||||
|
@ -161,6 +161,7 @@ an 50.30.290 &Syntax.DE.Doxygen.C\ with\ doxygen :cal SetSyn("c.doxygen")<CR>
|
||||
an 50.30.300 &Syntax.DE.Doxygen.C++\ with\ doxygen :cal SetSyn("cpp.doxygen")<CR>
|
||||
an 50.30.310 &Syntax.DE.Doxygen.IDL\ with\ doxygen :cal SetSyn("idl.doxygen")<CR>
|
||||
an 50.30.320 &Syntax.DE.Doxygen.Java\ with\ doxygen :cal SetSyn("java.doxygen")<CR>
|
||||
an 50.30.320 &Syntax.DE.Doxygen.DataScript\ with\ doxygen :cal SetSyn("datascript.doxygen")<CR>
|
||||
an 50.30.330 &Syntax.DE.Dracula :cal SetSyn("dracula")<CR>
|
||||
an 50.30.340 &Syntax.DE.DSSSL :cal SetSyn("dsl")<CR>
|
||||
an 50.30.350 &Syntax.DE.DTD :cal SetSyn("dtd")<CR>
|
||||
|
@ -1,6 +1,6 @@
|
||||
" Vim syntax support file
|
||||
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
|
||||
" Last Change: 2013 Jul 08
|
||||
" Last Change: 2015 Sep 08
|
||||
"
|
||||
" Additional contributors:
|
||||
"
|
||||
@ -26,7 +26,11 @@ let s:end=line('$')
|
||||
|
||||
" Font
|
||||
if exists("g:html_font")
|
||||
let s:htmlfont = "'". g:html_font . "', monospace"
|
||||
if type(g:html_font) == type([])
|
||||
let s:htmlfont = "'". join(g:html_font,"','") . "', monospace"
|
||||
else
|
||||
let s:htmlfont = "'". g:html_font . "', monospace"
|
||||
endif
|
||||
else
|
||||
let s:htmlfont = "monospace"
|
||||
endif
|
||||
|
16
runtime/syntax/bzl.vim
Normal file
16
runtime/syntax/bzl.vim
Normal file
@ -0,0 +1,16 @@
|
||||
" Vim syntax file
|
||||
" Language: Bazel (http://bazel.io)
|
||||
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
|
||||
" Last Change: 2015 Aug 11
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
runtime! syntax/python.vim
|
||||
|
||||
let b:current_syntax = 'bzl'
|
||||
|
||||
syn region bzlRule start='^\w\+($' end='^)\n*' transparent fold
|
||||
syn region bzlList start='\[' end='\]' transparent fold
|
@ -2,10 +2,10 @@
|
||||
" Program: CMake - Cross-Platform Makefile Generator
|
||||
" Module: $RCSfile: cmake-syntax.vim,v $
|
||||
" Language: CMake
|
||||
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>
|
||||
" Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
|
||||
" Last Change: 2012 Jun 01
|
||||
" (Dominique Pelle added @Spell)
|
||||
" Former Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
|
||||
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>
|
||||
" Last Change: 2015 Sep 29
|
||||
" Version: $Revision: 1.10 $
|
||||
"
|
||||
" Licence: The CMake license applies to this file. See
|
||||
@ -31,9 +31,9 @@ syn region cmakeVariableValue start=/\${/ end=/}/
|
||||
\ contained oneline contains=CONTAINED,cmakeTodo
|
||||
syn region cmakeEnvironment start=/\$ENV{/ end=/}/
|
||||
\ contained oneline contains=CONTAINED,cmakeTodo
|
||||
syn region cmakeString start=/"/ end=/"/
|
||||
syn region cmakeString start=/"/ end=/"/
|
||||
\ contains=CONTAINED,cmakeTodo,cmakeOperators
|
||||
syn region cmakeArguments start=/(/ end=/)/
|
||||
syn region cmakeArguments start=/(/ end=/)/
|
||||
\ contains=ALLBUT,cmakeArguments,cmakeTodo
|
||||
syn keyword cmakeSystemVariables
|
||||
\ WIN32 UNIX APPLE CYGWIN BORLAND MINGW MSVC MSVC_IDE MSVC60 MSVC70 MSVC71 MSVC80 MSVC90
|
||||
@ -44,11 +44,11 @@ syn keyword cmakeDeprecated ABSTRACT_FILES BUILD_NAME SOURCE_FILES SOURCE_FILES_
|
||||
\ nextgroup=cmakeArguments
|
||||
|
||||
" The keywords are generated as: cmake --help-command-list | tr "\n" " "
|
||||
syn keyword cmakeStatement
|
||||
syn keyword cmakeStatement
|
||||
\ ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_SUBDIRECTORY ADD_TEST AUX_SOURCE_DIRECTORY BUILD_COMMAND BUILD_NAME CMAKE_MINIMUM_REQUIRED CONFIGURE_FILE CREATE_TEST_SOURCELIST ELSE ELSEIF ENABLE_LANGUAGE ENABLE_TESTING ENDFOREACH ENDFUNCTION ENDIF ENDMACRO ENDWHILE EXEC_PROGRAM EXECUTE_PROCESS EXPORT_LIBRARY_DEPENDENCIES FILE FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI FOREACH FUNCTION GET_CMAKE_PROPERTY GET_DIRECTORY_PROPERTY GET_FILENAME_COMPONENT GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY GET_TEST_PROPERTY IF INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS LINK_DIRECTORIES LINK_LIBRARIES LIST LOAD_CACHE LOAD_COMMAND MACRO MAKE_DIRECTORY MARK_AS_ADVANCED MATH MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI REMOVE REMOVE_DEFINITIONS SEPARATE_ARGUMENTS SET SET_DIRECTORY_PROPERTIES SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SET_TESTS_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIR_DEPENDS SUBDIRS TARGET_LINK_LIBRARIES TRY_COMPILE TRY_RUN UNSET USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WHILE WRITE_FILE
|
||||
\ nextgroup=cmakeArguments
|
||||
syn keyword cmakeTodo
|
||||
\ TODO FIXME XXX
|
||||
syn keyword cmakeTodo
|
||||
\ TODO FIXME XXX
|
||||
\ contained
|
||||
|
||||
" Define the default highlighting.
|
||||
|
@ -2,7 +2,7 @@
|
||||
" Language: C++
|
||||
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
|
||||
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
||||
" Last Change: 2015 Mar 1
|
||||
" Last Change: 2015 May 04
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
@ -46,7 +46,7 @@ if !exists("cpp_no_cpp11")
|
||||
syn keyword cppConstant ATOMIC_WCHAR_T_LOCK_FREE ATOMIC_SHORT_LOCK_FREE
|
||||
syn keyword cppConstant ATOMIC_INT_LOCK_FREE ATOMIC_LONG_LOCK_FREE
|
||||
syn keyword cppConstant ATOMIC_LLONG_LOCK_FREE ATOMIC_POINTER_LOCK_FREE
|
||||
syn region cppRawString matchgroup=cppRawDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
|
||||
syn region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
|
||||
endif
|
||||
|
||||
" The minimum and maximum operators in GNU C++
|
||||
|
@ -1,11 +1,12 @@
|
||||
" Vim syntax file
|
||||
" Language: Datascript
|
||||
" Language: DataScript
|
||||
" Maintainer: Dominique Pelle <dominique.pelle@gmail.com>
|
||||
" Last Change: 2014 Feb 26
|
||||
" Last Change: 2015 Jul 30
|
||||
"
|
||||
" DataScript is a formal language for modelling binary datatypes,
|
||||
" bitstreams or file formats. For more information, see:
|
||||
" http://datascript.berlios.de/DataScriptLanguageOverview.html
|
||||
"
|
||||
" http://dstools.sourceforge.net/DataScriptLanguageOverview.html
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
@ -19,6 +20,8 @@ syn keyword dsPackage import package
|
||||
syn keyword dsType bit bool string
|
||||
syn keyword dsType int int8 int16 int32 int64
|
||||
syn keyword dsType uint8 uint16 uint32 uint64
|
||||
syn keyword dsType varint16 varint32 varint64
|
||||
syn keyword dsType varuint16 varuint32 varuint64
|
||||
syn keyword dsType leint16 leint32 leint64
|
||||
syn keyword dsType leuint16 leuint32 leuint64
|
||||
syn keyword dsEndian little big
|
||||
@ -32,7 +35,8 @@ syn keyword dsOperator sizeof bitsizeof lengthof is sum forall in
|
||||
syn keyword dsStorageClass const
|
||||
syn keyword dsTodo contained TODO FIXME XXX
|
||||
syn keyword dsSql sql sql_table sql_database sql_pragma sql_index
|
||||
syn keyword dsSql sql_integer sql_metadata sql_key foreign_key
|
||||
syn keyword dsSql sql_integer sql_metadata sql_key sql_virtual
|
||||
syn keyword dsSql using reference_key foreign_key to
|
||||
|
||||
" dsCommentGroup allows adding matches for special things in comments.
|
||||
syn cluster dsCommentGroup contains=dsTodo
|
||||
@ -61,6 +65,8 @@ syn region dsComment
|
||||
syn region dsString
|
||||
\ start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
|
||||
|
||||
syn sync ccomment dsComment
|
||||
|
||||
" Define the default highlighting.
|
||||
hi def link dsType Type
|
||||
hi def link dsEndian StorageClass
|
||||
|
@ -4,8 +4,8 @@
|
||||
" :3s+-foo++g
|
||||
" Description: highlight dnsmasq configuration files
|
||||
" File: runtime/syntax/dnsmasq.vim
|
||||
" Version: 2.70
|
||||
" Last Change: 2014 Apr 30
|
||||
" Version: 2.76
|
||||
" Last Change: 2015 Sep 27
|
||||
" Modeline: vim: ts=8:sw=2:sts=2:
|
||||
"
|
||||
" License: VIM License
|
||||
@ -131,10 +131,12 @@ syn match DnsmasqKeyword "^\s*dhcp-sequential-ip\>"
|
||||
syn match DnsmasqKeyword "^\s*dhcp-subscrid\>"
|
||||
syn match DnsmasqKeyword "^\s*dhcp-userclass\>"
|
||||
syn match DnsmasqKeyword "^\s*dhcp-vendorclass\>"
|
||||
syn match DnsmasqKeyword "^\s*dhcp-hostsdir\>"
|
||||
syn match DnsmasqKeyword "^\s*dns-rr\>"
|
||||
syn match DnsmasqKeyword "^\s*dnssec\>"
|
||||
syn match DnsmasqKeyword "^\s*dnssec-check-unsigned\>"
|
||||
syn match DnsmasqKeyword "^\s*dnssec-no-timecheck\>"
|
||||
syn match DnsmasqKeyword "^\s*dnssec-timestamp\>"
|
||||
syn match DnsmasqKeyword "^\s*dns-forward-max\>"
|
||||
syn match DnsmasqKeyword "^\s*domain\>"
|
||||
syn match DnsmasqKeyword "^\s*domain-needed\>"
|
||||
@ -150,6 +152,7 @@ syn match DnsmasqKeyword "^\s*host-record\>"
|
||||
syn match DnsmasqKeyword "^\s*interface\>"
|
||||
syn match DnsmasqKeyword "^\s*interface-name\>"
|
||||
syn match DnsmasqKeyword "^\s*ipset\>"
|
||||
syn match DnsmasqKeyword "^\s*ignore-address\>"
|
||||
syn match DnsmasqKeyword "^\s*keep-in-foreground\>"
|
||||
syn match DnsmasqKeyword "^\s*leasefile-ro\>"
|
||||
syn match DnsmasqKeyword "^\s*listen-address\>"
|
||||
@ -164,6 +167,7 @@ syn match DnsmasqKeyword "^\s*log-facility\>"
|
||||
syn match DnsmasqKeyword "^\s*log-queries\>"
|
||||
syn match DnsmasqKeyword "^\s*max-ttl\>"
|
||||
syn match DnsmasqKeyword "^\s*max-cache-ttl\>"
|
||||
syn match DnsmasqKeyword "^\s*min-cache-ttl\>"
|
||||
syn match DnsmasqKeyword "^\s*min-port\>"
|
||||
syn match DnsmasqKeyword "^\s*mx-host\>"
|
||||
syn match DnsmasqKeyword "^\s*mx-target\>"
|
||||
@ -204,6 +208,7 @@ syn match DnsmasqKeyword "^\s*test\>"
|
||||
syn match DnsmasqKeyword "^\s*tftp-max\>"
|
||||
syn match DnsmasqKeyword "^\s*tftp-lowercase\>"
|
||||
syn match DnsmasqKeyword "^\s*tftp-no-blocksize\>"
|
||||
syn match DnsmasqKeyword "^\s*tftp-no-fail\>"
|
||||
syn match DnsmasqKeyword "^\s*tftp-port-range\>"
|
||||
syn match DnsmasqKeyword "^\s*tftp-root\>"
|
||||
syn match DnsmasqKeyword "^\s*tftp-secure\>"
|
||||
|
@ -1,8 +1,9 @@
|
||||
" Vim syntax file
|
||||
" Language: gnuplot 4.7.0
|
||||
" Maintainer: Andrew Rasmussen andyras@users.sourceforge.net
|
||||
" Maintainer: Josh Wainwright <wainwright DOT ja AT gmail DOT com>
|
||||
" Last Maintainer: Andrew Rasmussen andyras@users.sourceforge.net
|
||||
" Original Maintainer: John Hoelzel johnh51@users.sourceforge.net
|
||||
" Last Change: 2014-02-24
|
||||
" Last Change: 2015-08-25
|
||||
" Filenames: *.gnu *.plt *.gpi *.gih *.gp *.gnuplot scripts: #!*gnuplot
|
||||
" URL: http://www.vim.org/scripts/script.php?script_id=4873
|
||||
" Original URL: http://johnh51.get.to/vim/syntax/gnuplot.vim
|
||||
@ -364,18 +365,18 @@ syn keyword gnuplotKeyword samples
|
||||
" set size
|
||||
syn keyword gnuplotKeyword size square nosquare ratio noratio
|
||||
" set style
|
||||
syn keyword gnuplotKeyword style function data noborder rectangle arrow
|
||||
syn keyword gnuplotKeyword default nohead head heads size filled empty
|
||||
syn keyword gnuplotKeyword nofilled front back boxplot range fraction
|
||||
syn keyword gnuplotKeyword outliers nooutliers pointtype candlesticks
|
||||
syn keyword gnuplotKeyword separation labels off auto x x2 sorted unsorted
|
||||
syn keyword gnuplotKeyword fill empty transparent solid pattern border
|
||||
syn keyword gnuplotKeyword increment userstyles financebars line default
|
||||
syn keyword gnuplotKeyword linetype lt linecolor lc linewidth lw pointtype
|
||||
syn keyword gnuplotKeyword pt pointsize ps pointinterval pi palette circle
|
||||
syn keyword gnuplotKeyword radius graph screen wedge nowedge ellipse size
|
||||
syn keyword gnuplotKeyword units xx xy yy histogram line textbox opaque
|
||||
syn keyword gnuplotKeyword border noborder
|
||||
syn keyword gnuplotKeyword style arrow auto back border boxplot
|
||||
syn keyword gnuplotKeyword candlesticks circle clustered columnstacked data
|
||||
syn keyword gnuplotKeyword default ellipse empty fill[ed] financebars
|
||||
syn keyword gnuplotKeyword fraction front function gap graph head[s]
|
||||
syn keyword gnuplotKeyword histogram increment labels lc line linecolor
|
||||
syn keyword gnuplotKeyword linetype linewidth lt lw noborder nofilled
|
||||
syn keyword gnuplotKeyword nohead nooutliers nowedge off opaque outliers
|
||||
syn keyword gnuplotKeyword palette pattern pi pointinterval pointsize
|
||||
syn keyword gnuplotKeyword pointtype ps pt radius range rectangle
|
||||
syn keyword gnuplotKeyword rowstacked screen separation size solid sorted
|
||||
syn keyword gnuplotKeyword textbox transparent units unsorted userstyles
|
||||
syn keyword gnuplotKeyword wedge x x2 xx xy yy
|
||||
" set surface
|
||||
syn keyword gnuplotKeyword surface implicit explicit
|
||||
" set table
|
||||
@ -496,8 +497,8 @@ syn keyword gnuplotTodo contained TODO FIXME XXX
|
||||
syn keyword gnuplotStatement cd call clear evaluate exit fit help history
|
||||
syn keyword gnuplotStatement load lower pause plot p print pwd quit raise
|
||||
syn keyword gnuplotStatement refresh replot rep reread reset save set show
|
||||
syn keyword gnuplotStatement shell splot spstats system test undefine unset
|
||||
syn keyword gnuplotStatement update
|
||||
syn keyword gnuplotStatement shell splot spstats stats system test undefine
|
||||
syn keyword gnuplotStatement unset update
|
||||
|
||||
" ---- Define the default highlighting ---- "
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
|
@ -2,9 +2,9 @@
|
||||
" Language: Groovy
|
||||
" Original Author: Alessio Pace <billy.corgan@tiscali.it>
|
||||
" Maintainer: Tobias Rapp <yahuxo@gmx.de>
|
||||
" Version: 0.1.13
|
||||
" Version: 0.1.14
|
||||
" URL: http://www.vim.org/scripts/script.php?script_id=945
|
||||
" Last Change: 2015 Apr 13
|
||||
" Last Change: 2015 Apr 21
|
||||
|
||||
" THE ORIGINAL AUTHOR'S NOTES:
|
||||
"
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Python
|
||||
" Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
|
||||
" Last Change: 2015 Jun 19
|
||||
" Last Change: 2015 Sep 15
|
||||
" Credits: Neil Schemenauer <nas@python.ca>
|
||||
" Dmitry Vasiliev
|
||||
"
|
||||
@ -51,24 +51,26 @@ set cpo&vim
|
||||
|
||||
" Keep Python keywords in alphabetical order inside groups for easy
|
||||
" comparison with the table in the 'Python Language Reference'
|
||||
" http://docs.python.org/reference/lexical_analysis.html#keywords.
|
||||
" https://docs.python.org/2/reference/lexical_analysis.html#keywords,
|
||||
" https://docs.python.org/3/reference/lexical_analysis.html#keywords.
|
||||
" Groups are in the order presented in NAMING CONVENTIONS in syntax.txt.
|
||||
" Exceptions come last at the end of each group (class and def below).
|
||||
"
|
||||
" Keywords 'with' and 'as' are new in Python 2.6
|
||||
" (use 'from __future__ import with_statement' in Python 2.5).
|
||||
"
|
||||
" Some compromises had to be made to support both Python 3.0 and 2.6.
|
||||
" We include Python 3.0 features, but when a definition is duplicated,
|
||||
" Some compromises had to be made to support both Python 3 and 2.
|
||||
" We include Python 3 features, but when a definition is duplicated,
|
||||
" the last definition takes precedence.
|
||||
"
|
||||
" - 'False', 'None', and 'True' are keywords in Python 3.0 but they are
|
||||
" built-ins in 2.6 and will be highlighted as built-ins below.
|
||||
" - 'exec' is a built-in in Python 3.0 and will be highlighted as
|
||||
" - 'False', 'None', and 'True' are keywords in Python 3 but they are
|
||||
" built-ins in 2 and will be highlighted as built-ins below.
|
||||
" - 'exec' is a built-in in Python 3 and will be highlighted as
|
||||
" built-in below.
|
||||
" - 'nonlocal' is a keyword in Python 3.0 and will be highlighted.
|
||||
" - 'print' is a built-in in Python 3.0 and will be highlighted as
|
||||
" built-in below (use 'from __future__ import print_function' in 2.6)
|
||||
" - 'nonlocal' is a keyword in Python 3 and will be highlighted.
|
||||
" - 'print' is a built-in in Python 3 and will be highlighted as
|
||||
" built-in below (use 'from __future__ import print_function' in 2)
|
||||
" - async and await were added in Python 3.5 and are soft keywords.
|
||||
"
|
||||
syn keyword pythonStatement False, None, True
|
||||
syn keyword pythonStatement as assert break continue del exec global
|
||||
@ -79,6 +81,7 @@ syn keyword pythonRepeat for while
|
||||
syn keyword pythonOperator and in is not or
|
||||
syn keyword pythonException except finally raise try
|
||||
syn keyword pythonInclude from import
|
||||
syn keyword pythonAsync async await
|
||||
|
||||
" Decorators (new in Python 2.4)
|
||||
syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite
|
||||
@ -147,7 +150,8 @@ endif
|
||||
" - 08e0 or 08j are highlighted,
|
||||
"
|
||||
" and so on, as specified in the 'Python Language Reference'.
|
||||
" http://docs.python.org/reference/lexical_analysis.html#numeric-literals
|
||||
" https://docs.python.org/2/reference/lexical_analysis.html#numeric-literals
|
||||
" https://docs.python.org/3/reference/lexical_analysis.html#numeric-literals
|
||||
if !exists("python_no_number_highlight")
|
||||
" numbers (including longs and complex)
|
||||
syn match pythonNumber "\<0[oO]\=\o\+[Ll]\=\>"
|
||||
@ -159,54 +163,58 @@ if !exists("python_no_number_highlight")
|
||||
syn match pythonNumber
|
||||
\ "\<\d\+\.\%([eE][+-]\=\d\+\)\=[jJ]\=\%(\W\|$\)\@="
|
||||
syn match pythonNumber
|
||||
\ "\%(^\|\W\)\@<=\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>"
|
||||
\ "\%(^\|\W\)\zs\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>"
|
||||
endif
|
||||
|
||||
" Group the built-ins in the order in the 'Python Library Reference' for
|
||||
" easier comparison.
|
||||
" http://docs.python.org/library/constants.html
|
||||
" http://docs.python.org/library/functions.html
|
||||
" http://docs.python.org/library/functions.html#non-essential-built-in-functions
|
||||
" https://docs.python.org/2/library/constants.html
|
||||
" https://docs.python.org/3/library/constants.html
|
||||
" http://docs.python.org/2/library/functions.html
|
||||
" http://docs.python.org/3/library/functions.html
|
||||
" http://docs.python.org/2/library/functions.html#non-essential-built-in-functions
|
||||
" http://docs.python.org/3/library/functions.html#non-essential-built-in-functions
|
||||
" Python built-in functions are in alphabetical order.
|
||||
if !exists("python_no_builtin_highlight")
|
||||
" built-in constants
|
||||
" 'False', 'True', and 'None' are also reserved words in Python 3.0
|
||||
" 'False', 'True', and 'None' are also reserved words in Python 3
|
||||
syn keyword pythonBuiltin False True None
|
||||
syn keyword pythonBuiltin NotImplemented Ellipsis __debug__
|
||||
" built-in functions
|
||||
syn keyword pythonBuiltin abs all any bin bool chr classmethod
|
||||
syn keyword pythonBuiltin compile complex delattr dict dir divmod
|
||||
syn keyword pythonBuiltin enumerate eval filter float format
|
||||
syn keyword pythonBuiltin abs all any bin bool bytearray callable chr
|
||||
syn keyword pythonBuiltin classmethod compile complex delattr dict dir
|
||||
syn keyword pythonBuiltin divmod enumerate eval filter float format
|
||||
syn keyword pythonBuiltin frozenset getattr globals hasattr hash
|
||||
syn keyword pythonBuiltin help hex id input int isinstance
|
||||
syn keyword pythonBuiltin issubclass iter len list locals map max
|
||||
syn keyword pythonBuiltin min next object oct open ord pow print
|
||||
syn keyword pythonBuiltin property range repr reversed round set
|
||||
syn keyword pythonBuiltin memoryview min next object oct open ord pow
|
||||
syn keyword pythonBuiltin print property range repr reversed round set
|
||||
syn keyword pythonBuiltin setattr slice sorted staticmethod str
|
||||
syn keyword pythonBuiltin sum super tuple type vars zip __import__
|
||||
" Python 2.6 only
|
||||
syn keyword pythonBuiltin basestring callable cmp execfile file
|
||||
" Python 2 only
|
||||
syn keyword pythonBuiltin basestring cmp execfile file
|
||||
syn keyword pythonBuiltin long raw_input reduce reload unichr
|
||||
syn keyword pythonBuiltin unicode xrange
|
||||
" Python 3.0 only
|
||||
syn keyword pythonBuiltin ascii bytearray bytes exec memoryview
|
||||
" non-essential built-in functions; Python 2.6 only
|
||||
" Python 3 only
|
||||
syn keyword pythonBuiltin ascii bytes exec
|
||||
" non-essential built-in functions; Python 2 only
|
||||
syn keyword pythonBuiltin apply buffer coerce intern
|
||||
endif
|
||||
|
||||
" From the 'Python Library Reference' class hierarchy at the bottom.
|
||||
" http://docs.python.org/library/exceptions.html
|
||||
" http://docs.python.org/2/library/exceptions.html
|
||||
" http://docs.python.org/3/library/exceptions.html
|
||||
if !exists("python_no_exception_highlight")
|
||||
" builtin base exceptions (only used as base classes for other exceptions)
|
||||
" builtin base exceptions (used mostly as base classes for other exceptions)
|
||||
syn keyword pythonExceptions BaseException Exception
|
||||
syn keyword pythonExceptions ArithmeticError EnvironmentError
|
||||
syn keyword pythonExceptions ArithmeticError BufferError
|
||||
syn keyword pythonExceptions LookupError
|
||||
" builtin base exception removed in Python 3.0
|
||||
syn keyword pythonExceptions StandardError
|
||||
" builtin base exceptions removed in Python 3
|
||||
syn keyword pythonExceptions EnvironmentError StandardError
|
||||
" builtin exceptions (actually raised)
|
||||
syn keyword pythonExceptions AssertionError AttributeError BufferError
|
||||
syn keyword pythonExceptions AssertionError AttributeError
|
||||
syn keyword pythonExceptions EOFError FloatingPointError GeneratorExit
|
||||
syn keyword pythonExceptions IOError ImportError IndentationError
|
||||
syn keyword pythonExceptions ImportError IndentationError
|
||||
syn keyword pythonExceptions IndexError KeyError KeyboardInterrupt
|
||||
syn keyword pythonExceptions MemoryError NameError NotImplementedError
|
||||
syn keyword pythonExceptions OSError OverflowError ReferenceError
|
||||
@ -214,13 +222,27 @@ if !exists("python_no_exception_highlight")
|
||||
syn keyword pythonExceptions SystemError SystemExit TabError TypeError
|
||||
syn keyword pythonExceptions UnboundLocalError UnicodeError
|
||||
syn keyword pythonExceptions UnicodeDecodeError UnicodeEncodeError
|
||||
syn keyword pythonExceptions UnicodeTranslateError ValueError VMSError
|
||||
syn keyword pythonExceptions WindowsError ZeroDivisionError
|
||||
syn keyword pythonExceptions UnicodeTranslateError ValueError
|
||||
syn keyword pythonExceptions ZeroDivisionError
|
||||
" builtin OS exceptions in Python 3
|
||||
syn keyword pythonExceptions BlockingIOError BrokenPipeError
|
||||
syn keyword pythonExceptions ChildProcessError ConnectionAbortedError
|
||||
syn keyword pythonExceptions ConnectionError ConnectionRefusedError
|
||||
syn keyword pythonExceptions ConnectionResetError FileExistsError
|
||||
syn keyword pythonExceptions FileNotFoundError InterruptedError
|
||||
syn keyword pythonExceptions IsADirectoryError NotADirectoryError
|
||||
syn keyword pythonExceptions PermissionError ProcessLookupError
|
||||
syn keyword pythonExceptions RecursionError StopAsyncIteration
|
||||
syn keyword pythonExceptions TimeoutError
|
||||
" builtin exceptions deprecated/removed in Python 3
|
||||
syn keyword pythonExceptions IOError VMSError WindowsError
|
||||
" builtin warnings
|
||||
syn keyword pythonExceptions BytesWarning DeprecationWarning FutureWarning
|
||||
syn keyword pythonExceptions ImportWarning PendingDeprecationWarning
|
||||
syn keyword pythonExceptions RuntimeWarning SyntaxWarning UnicodeWarning
|
||||
syn keyword pythonExceptions UserWarning Warning
|
||||
" builtin warnings in Python 3
|
||||
syn keyword pythonExceptions ResourceWarning
|
||||
endif
|
||||
|
||||
if exists("python_space_error_highlight")
|
||||
@ -267,6 +289,7 @@ if version >= 508 || !exists("did_python_syn_inits")
|
||||
HiLink pythonOperator Operator
|
||||
HiLink pythonException Exception
|
||||
HiLink pythonInclude Include
|
||||
HiLink pythonAsync Statement
|
||||
HiLink pythonDecorator Define
|
||||
HiLink pythonFunction Function
|
||||
HiLink pythonComment Comment
|
||||
|
@ -2,7 +2,7 @@
|
||||
" Language: reStructuredText documentation format
|
||||
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2014-10-03
|
||||
" Latest Revision: 2015-09-07
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@ -81,7 +81,7 @@ syn region rstHyperlinkTarget matchgroup=rstDirective
|
||||
execute 'syn region rstExDirective contained matchgroup=rstDirective' .
|
||||
\ ' start=+' . s:ReferenceName . '::\_s+' .
|
||||
\ ' skip=+^$+' .
|
||||
\ ' end=+^\s\@!+ contains=@rstCruft'
|
||||
\ ' end=+^\s\@!+ contains=@rstCruft,rstLiteralBlock'
|
||||
|
||||
execute 'syn match rstSubstitutionDefinition contained' .
|
||||
\ ' /|' . s:ReferenceName . '|\_s\+/ nextgroup=@rstDirectives'
|
||||
|
@ -1,7 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: screen(1) configuration file
|
||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2010-01-03
|
||||
" Language: screen(1) configuration file
|
||||
" Maintainer: Dmitri Vereshchagin <dmitri.vereshchagin@gmail.com>
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2015-09-24
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@ -76,12 +77,16 @@ syn keyword screenCommands
|
||||
\ break
|
||||
\ breaktype
|
||||
\ bufferfile
|
||||
\ bumpleft
|
||||
\ bumpright
|
||||
\ c1
|
||||
\ caption
|
||||
\ chacl
|
||||
\ charset
|
||||
\ chdir
|
||||
\ cjkwidth
|
||||
\ clear
|
||||
\ collapse
|
||||
\ colon
|
||||
\ command
|
||||
\ compacthist
|
||||
@ -104,6 +109,7 @@ syn keyword screenCommands
|
||||
\ deflogin
|
||||
\ defmode
|
||||
\ defmonitor
|
||||
\ defmousetrack
|
||||
\ defnonblock
|
||||
\ defobuflimit
|
||||
\ defscrollback
|
||||
@ -113,6 +119,7 @@ syn keyword screenCommands
|
||||
\ defutf8
|
||||
\ defwrap
|
||||
\ defwritelock
|
||||
\ defzombie
|
||||
\ detach
|
||||
\ digraph
|
||||
\ dinfo
|
||||
@ -126,7 +133,9 @@ syn keyword screenCommands
|
||||
\ fit
|
||||
\ flow
|
||||
\ focus
|
||||
\ focusminsize
|
||||
\ gr
|
||||
\ group
|
||||
\ hardcopy
|
||||
\ hardcopy_append
|
||||
\ hardcopydir
|
||||
@ -155,6 +164,7 @@ syn keyword screenCommands
|
||||
\ maxwin
|
||||
\ meta
|
||||
\ monitor
|
||||
\ mousetrack
|
||||
\ msgminwait
|
||||
\ msgwait
|
||||
\ multiuser
|
||||
@ -182,6 +192,7 @@ syn keyword screenCommands
|
||||
\ register
|
||||
\ remove
|
||||
\ removebuf
|
||||
\ rendition
|
||||
\ reset
|
||||
\ resize
|
||||
\ screen
|
||||
@ -197,6 +208,7 @@ syn keyword screenCommands
|
||||
\ sleep
|
||||
\ slowpaste
|
||||
\ sorendition
|
||||
\ sort
|
||||
\ source
|
||||
\ split
|
||||
\ startup_message
|
||||
@ -210,6 +222,7 @@ syn keyword screenCommands
|
||||
\ time
|
||||
\ title
|
||||
\ umask
|
||||
\ unbindall
|
||||
\ unsetenv
|
||||
\ utf8
|
||||
\ vbell
|
||||
@ -228,6 +241,7 @@ syn keyword screenCommands
|
||||
\ xon
|
||||
\ zmodem
|
||||
\ zombie
|
||||
\ zombie_timeout
|
||||
|
||||
hi def link screenEscape Special
|
||||
hi def link screenComment Comment
|
||||
|
@ -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: May 29, 2015
|
||||
" Version: 137
|
||||
" Last Change: Oct 09, 2015
|
||||
" Version: 139
|
||||
" 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 ?ric Brunet (eric.brunet@ens.fr)
|
||||
@ -16,14 +16,14 @@ elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" AFAICT "." should be considered part of the iskeyword. Using iskeywords in
|
||||
" syntax is dicey, so the following code permits the user to
|
||||
" AFAICT "." should be considered part of the iskeyword for ksh. Using iskeywords
|
||||
" in syntax is dicey, so the following code permits the user to prevent/override
|
||||
" g:sh_isk set to a string : specify iskeyword.
|
||||
" g:sh_noisk exists : don't change iskeyword
|
||||
" g:sh_noisk does not exist : (default) append "." to iskeyword
|
||||
" g:sh_noisk does not exist : (default) append "." to iskeyword for kornshell
|
||||
if exists("g:sh_isk") && type(g:sh_isk) == 1 " user specifying iskeyword
|
||||
exe "setl isk=".g:sh_isk
|
||||
elseif !exists("g:sh_noisk") " optionally prevent appending '.' to iskeyword
|
||||
elseif !exists("g:sh_noisk") && exists("b:is_kornshell") " append '.' to iskeyword
|
||||
setl isk+=.
|
||||
endif
|
||||
|
||||
@ -128,7 +128,7 @@ syn cluster shIdList contains=shCommandSub,shWrapLineOperator,shSetOption,shDere
|
||||
syn cluster shIfList contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo
|
||||
syn cluster shLoopList contains=@shCaseList,@shErrorList,shCaseEsac,shConditional,shDblBrace,shExpr,shFor,shForPP,shIf,shOption,shSet,shTest,shTestOpr
|
||||
syn cluster shSubShList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator
|
||||
syn cluster shTestList contains=shCharClass,shCommandSub,shComment,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr
|
||||
syn cluster shTestList contains=shCharClass,shCommandSub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr
|
||||
" Echo: {{{1
|
||||
" ====
|
||||
" This one is needed INSIDE a CommandSub, so that `echo bla` be correct
|
||||
@ -321,12 +321,11 @@ elseif !exists("g:sh_no_error")
|
||||
endif
|
||||
syn region shSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=@Spell
|
||||
syn region shDoubleQuote matchgroup=shQuote start=+\%(\%(\\\\\)*\\\)\@<!"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell
|
||||
syn region shDoubleQuote matchgroup=shQuote start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell
|
||||
syn match shStringSpecial "[^[:print:] \t]" contained
|
||||
syn match shStringSpecial "\%(\\\\\)*\\[\\"'`$()#]"
|
||||
" COMBAK: why is ,shComment on next line???
|
||||
syn match shSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial,shComment
|
||||
syn match shSpecial "^\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shComment
|
||||
syn match shSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]"
|
||||
syn match shSpecial "^\%(\\\\\)*\\[\\"'`$()#]"
|
||||
syn match shMoreSpecial "\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial contained
|
||||
|
||||
" Comments: {{{1
|
||||
@ -409,27 +408,27 @@ endif
|
||||
|
||||
if exists("b:is_bash")
|
||||
if s:sh_fold_functions
|
||||
syn region shFunctionOne fold matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
syn region shFunctionTwo fold matchgroup=shFunction start="\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
syn region shFunctionThree fold matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*(" end=")" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
syn region shFunctionFour fold matchgroup=shFunction start="\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*)" end=")" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
syn region shFunctionOne fold matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
syn region shFunctionTwo fold matchgroup=shFunction start="\<[^d][^o]\&\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
syn region shFunctionThree fold matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*(" end=")" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
syn region shFunctionFour fold matchgroup=shFunction start="\<[^d][^o]\&\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*)" end=")" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
else
|
||||
syn region shFunctionOne matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*{" end="}" contains=@shFunctionList
|
||||
syn region shFunctionTwo matchgroup=shFunction start="\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained
|
||||
syn region shFunctionThree matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*(" end=")" contains=@shFunctionList
|
||||
syn region shFunctionFour matchgroup=shFunction start="\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*(" end=")" contains=shFunctionKey,@shFunctionList contained
|
||||
syn region shFunctionOne matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*{" end="}" contains=@shFunctionList
|
||||
syn region shFunctionTwo matchgroup=shFunction start="\<[^d][^o]\&\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained
|
||||
syn region shFunctionThree matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*(" end=")" contains=@shFunctionList
|
||||
syn region shFunctionFour matchgroup=shFunction start="\<[^d][^o]\&\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*(" end=")" contains=shFunctionKey,@shFunctionList contained
|
||||
endif
|
||||
else
|
||||
if s:sh_fold_functions
|
||||
syn region shFunctionOne fold matchgroup=shFunction start="^\s*\h\w*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
syn region shFunctionTwo fold matchgroup=shFunction start="\h\w*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
syn region shFunctionThree fold matchgroup=shFunction start="^\s*\h\w*\s*()\_s*(" end=")" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
syn region shFunctionFour fold matchgroup=shFunction start="\h\w*\s*\%(()\)\=\_s*(" end=")" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
syn region shFunctionOne fold matchgroup=shFunction start="^\s*\h\w*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
syn region shFunctionTwo fold matchgroup=shFunction start="\<[^d][^o]\&\h\w*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
syn region shFunctionThree fold matchgroup=shFunction start="^\s*\h\w*\s*()\_s*(" end=")" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
syn region shFunctionFour fold matchgroup=shFunction start="\<[^d][^o]\&\h\w*\s*\%(()\)\=\_s*(" end=")" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment
|
||||
else
|
||||
syn region shFunctionOne matchgroup=shFunction start="^\s*\h\w*\s*()\_s*{" end="}" contains=@shFunctionList
|
||||
syn region shFunctionTwo matchgroup=shFunction start="\h\w*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained
|
||||
syn region shFunctionThree matchgroup=shFunction start="^\s*\h\w*\s*()\_s*(" end=")" contains=@shFunctionList
|
||||
syn region shFunctionFour matchgroup=shFunction start="\h\w*\s*\%(()\)\=\_s*(" end=")" contains=shFunctionKey,@shFunctionList contained
|
||||
syn region shFunctionOne matchgroup=shFunction start="^\s*\h\w*\s*()\_s*{" end="}" contains=@shFunctionList
|
||||
syn region shFunctionTwo matchgroup=shFunction start="\<[^d][^o]\&\h\w*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained
|
||||
syn region shFunctionThree matchgroup=shFunction start="^\s*\h\w*\s*()\_s*(" end=")" contains=@shFunctionList
|
||||
syn region shFunctionFour matchgroup=shFunction start="\<[^d][^o]\&\h\w*\s*\%(()\)\=\_s*(" end=")" contains=shFunctionKey,@shFunctionList contained
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -60,8 +60,8 @@ fun! s:SynSet()
|
||||
endfun
|
||||
|
||||
|
||||
" Handle adding doxygen to other languages (C, C++, C#, IDL)
|
||||
au Syntax c,cpp,cs,idl,php
|
||||
" Handle adding doxygen to other languages (C, C++, C#, IDL, java, php, DataScript)
|
||||
au Syntax c,cpp,cs,idl,java,php,datascript
|
||||
\ if (exists('b:load_doxygen_syntax') && b:load_doxygen_syntax)
|
||||
\ || (exists('g:load_doxygen_syntax') && g:load_doxygen_syntax)
|
||||
\ | runtime! syntax/doxygen.vim
|
||||
|
8
runtime/syntax/systemd.vim
Normal file
8
runtime/syntax/systemd.vim
Normal file
@ -0,0 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: systemd.unit(5)
|
||||
|
||||
if !exists('b:current_syntax')
|
||||
" Looks a lot like dosini files.
|
||||
runtime! syntax/dosini.vim
|
||||
let b:current_syntax = 'systemd'
|
||||
endif
|
139
runtime/syntax/teraterm.vim
Normal file
139
runtime/syntax/teraterm.vim
Normal file
@ -0,0 +1,139 @@
|
||||
" Vim syntax file
|
||||
" Language: Tera Term Language (TTL)
|
||||
" Based on Tera Term Version 4.86
|
||||
" Maintainer: Ken Takata
|
||||
" URL: https://github.com/k-takata/vim-teraterm
|
||||
" Last Change: 2015 Jun 24
|
||||
" Filenames: *.ttl
|
||||
" License: VIM License
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn case ignore
|
||||
|
||||
syn region ttlComment start=";" end="$" contains=@Spell
|
||||
syn region ttlComment start="/\*" end="\*/" contains=@Spell
|
||||
syn region ttlFirstComment start="/\*" end="\*/" contained contains=@Spell
|
||||
\ nextgroup=ttlStatement,ttlFirstComment
|
||||
|
||||
syn match ttlCharacter "#\%(\d\+\|\$\x\+\)\>"
|
||||
syn match ttlNumber "\%(\<\d\+\|\$\x\+\)\>"
|
||||
syn match ttlString "'[^']*'" contains=@Spell
|
||||
syn match ttlString '"[^"]*"' contains=@Spell
|
||||
syn cluster ttlConstant contains=ttlCharacter,ttlNumber,ttlString
|
||||
|
||||
syn match ttlLabel ":\s*\w\{1,32}\>"
|
||||
|
||||
syn keyword ttlOperator and or xor not
|
||||
|
||||
syn match ttlVar "\<groupmatchstr\d\>"
|
||||
syn match ttlVar "\<param\d\>"
|
||||
syn keyword ttlVar inputstr matchstr paramcnt result timeout mtimeout
|
||||
|
||||
|
||||
syn match ttlLine nextgroup=ttlStatement "^"
|
||||
syn match ttlStatement contained "\s*"
|
||||
\ nextgroup=ttlIf,ttlElseIf,ttlConditional,ttlRepeat,
|
||||
\ ttlFirstComment,ttlComment,ttlLabel,@ttlCommand
|
||||
|
||||
syn cluster ttlCommand contains=ttlControlCommand,ttlCommunicationCommand,
|
||||
\ ttlStringCommand,ttlFileCommand,ttlPasswordCommand,
|
||||
\ ttlMiscCommand
|
||||
|
||||
|
||||
syn keyword ttlIf contained nextgroup=ttlIfExpression if
|
||||
syn keyword ttlElseIf contained nextgroup=ttlElseIfExpression elseif
|
||||
|
||||
syn match ttlIfExpression contained "\s.*"
|
||||
\ contains=@ttlConstant,ttlVar,ttlOperator,ttlComment,ttlThen,
|
||||
\ @ttlCommand
|
||||
syn match ttlElseIfExpression contained "\s.*"
|
||||
\ contains=@ttlConstant,ttlVar,ttlOperator,ttlComment,ttlThen
|
||||
|
||||
syn keyword ttlThen contained then
|
||||
syn keyword ttlConditional contained else endif
|
||||
|
||||
syn keyword ttlRepeat contained for next until enduntil while endwhile
|
||||
syn match ttlRepeat contained
|
||||
\ "\<\%(do\|loop\)\%(\s\+\%(while\|until\)\)\?\>"
|
||||
syn keyword ttlControlCommand contained
|
||||
\ break call continue end execcmnd exit goto include
|
||||
\ mpause pause return
|
||||
|
||||
|
||||
syn keyword ttlCommunicationCommand contained
|
||||
\ bplusrecv bplussend callmenu changedir clearscreen
|
||||
\ closett connect cygconnect disconnect dispstr
|
||||
\ enablekeyb flushrecv gethostname getmodemstatus
|
||||
\ gettitle kmtfinish kmtget kmtrecv kmtsend loadkeymap
|
||||
\ logautoclosemode logclose loginfo logopen logpause
|
||||
\ logrotate logstart logwrite quickvanrecv
|
||||
\ quickvansend recvln restoresetup scprecv scpsend
|
||||
\ send sendbreak sendbroadcast sendfile sendkcode
|
||||
\ sendln sendlnbroadcast sendmulticast setbaud
|
||||
\ setdebug setdtr setecho setmulticastname setrts
|
||||
\ setsync settitle showtt testlink unlink wait
|
||||
\ wait4all waitevent waitln waitn waitrecv waitregex
|
||||
\ xmodemrecv xmodemsend ymodemrecv ymodemsend
|
||||
\ zmodemrecv zmodemsend
|
||||
syn keyword ttlStringCommand contained
|
||||
\ code2str expandenv int2str regexoption sprintf
|
||||
\ sprintf2 str2code str2int strcompare strconcat
|
||||
\ strcopy strinsert strjoin strlen strmatch strremove
|
||||
\ strreplace strscan strspecial strsplit strtrim
|
||||
\ tolower toupper
|
||||
syn keyword ttlFileCommand contained
|
||||
\ basename dirname fileclose fileconcat filecopy
|
||||
\ filecreate filedelete filelock filemarkptr fileopen
|
||||
\ filereadln fileread filerename filesearch fileseek
|
||||
\ fileseekback filestat filestrseek filestrseek2
|
||||
\ filetruncate fileunlock filewrite filewriteln
|
||||
\ findfirst findnext findclose foldercreate
|
||||
\ folderdelete foldersearch getdir getfileattr makepath
|
||||
\ setdir setfileattr
|
||||
syn keyword ttlPasswordCommand contained
|
||||
\ delpassword getpassword ispassword passwordbox
|
||||
\ setpassword
|
||||
syn keyword ttlMiscCommand contained
|
||||
\ beep bringupbox checksum8 checksum8file checksum16
|
||||
\ checksum16file checksum32 checksum32file closesbox
|
||||
\ clipb2var crc16 crc16file crc32 crc32file exec
|
||||
\ dirnamebox filenamebox getdate getenv getipv4addr
|
||||
\ getipv6addr getspecialfolder gettime getttdir getver
|
||||
\ ifdefined inputbox intdim listbox messagebox random
|
||||
\ rotateleft rotateright setdate setdlgpos setenv
|
||||
\ setexitcode settime show statusbox strdim uptime
|
||||
\ var2clipb yesnobox
|
||||
|
||||
|
||||
hi def link ttlCharacter Character
|
||||
hi def link ttlNumber Number
|
||||
hi def link ttlComment Comment
|
||||
hi def link ttlFirstComment Comment
|
||||
hi def link ttlString String
|
||||
hi def link ttlLabel Label
|
||||
hi def link ttlIf Conditional
|
||||
hi def link ttlElseIf Conditional
|
||||
hi def link ttlThen Conditional
|
||||
hi def link ttlConditional Conditional
|
||||
hi def link ttlRepeat Repeat
|
||||
hi def link ttlControlCommand Keyword
|
||||
hi def link ttlVar Identifier
|
||||
hi def link ttlOperator Operator
|
||||
hi def link ttlCommunicationCommand Keyword
|
||||
hi def link ttlStringCommand Keyword
|
||||
hi def link ttlFileCommand Keyword
|
||||
hi def link ttlPasswordCommand Keyword
|
||||
hi def link ttlMiscCommand Keyword
|
||||
|
||||
let b:current_syntax = "teraterm"
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: ts=8 sw=2 sts=2
|
@ -223,7 +223,7 @@ syn keyword vbStatement Explicit FileCopy For ForEach Function Get GoSub
|
||||
syn keyword vbStatement GoTo Gosub Implements Kill LSet Let Lib LineInput
|
||||
syn keyword vbStatement Load Lock Loop Mid MkDir Name Next On OnError Open
|
||||
syn keyword vbStatement Option Preserve Private Property Public Put RSet
|
||||
syn keyword vbStatement RaiseEvent Randomize ReDim Redim Rem Reset Resume
|
||||
syn keyword vbStatement RaiseEvent Randomize ReDim Redim Reset Resume
|
||||
syn keyword vbStatement Return RmDir SavePicture SaveSetting Seek SendKeys
|
||||
syn keyword vbStatement Sendkeys Set SetAttr Static Step Stop Sub Time
|
||||
syn keyword vbStatement Type Unload Unlock Until Wend While Width With
|
||||
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Daniel Kho <daniel.kho@tauhop.com>
|
||||
" Previous Maintainer: Czo <Olivier.Sirol@lip6.fr>
|
||||
" Credits: Stephan Hegel <stephan.hegel@snc.siemens.com.cn>
|
||||
" Last Changed: 2015 Apr 25 by Daniel Kho
|
||||
" Last Changed: 2015 Oct 13 by Daniel Kho
|
||||
" $Id: vhdl.vim,v 1.1 2004/06/13 15:34:56 vimboss Exp $
|
||||
|
||||
" VHSIC (Very High Speed Integrated Circuit) Hardware Description Language
|
||||
@ -72,6 +72,7 @@ syn keyword vhdlType boolean_vector integer_vector real_vector time_vector
|
||||
syn keyword vhdlType string severity_level
|
||||
" Predefined standard ieee VHDL types
|
||||
syn keyword vhdlType positive natural signed unsigned
|
||||
syn keyword vhdlType unresolved_signed unresolved_unsigned u_signed u_unsigned
|
||||
syn keyword vhdlType line text
|
||||
syn keyword vhdlType std_logic std_logic_vector
|
||||
syn keyword vhdlType std_ulogic std_ulogic_vector
|
||||
@ -92,12 +93,12 @@ syn match vhdlAttribute "\'reverse_range"
|
||||
syn match vhdlAttribute "\'right"
|
||||
syn match vhdlAttribute "\'ascending"
|
||||
" block attributes
|
||||
syn match vhdlAttribute "\'behaviour"
|
||||
syn match vhdlAttribute "\'structure"
|
||||
"syn match vhdlAttribute "\'behaviour" " Non-standard VHDL
|
||||
"syn match vhdlAttribute "\'structure" " Non-standard VHDL
|
||||
syn match vhdlAttribute "\'simple_name"
|
||||
syn match vhdlAttribute "\'instance_name"
|
||||
syn match vhdlAttribute "\'path_name"
|
||||
syn match vhdlAttribute "\'foreign"
|
||||
syn match vhdlAttribute "\'foreign" " VHPI
|
||||
" signal attribute
|
||||
syn match vhdlAttribute "\'active"
|
||||
syn match vhdlAttribute "\'delayed"
|
||||
@ -112,10 +113,9 @@ syn match vhdlAttribute "\'driving"
|
||||
syn match vhdlAttribute "\'driving_value"
|
||||
" type attributes
|
||||
syn match vhdlAttribute "\'base"
|
||||
syn match vhdlAttribute "\'high"
|
||||
syn match vhdlAttribute "\'left"
|
||||
syn match vhdlAttribute "\'subtype"
|
||||
syn match vhdlAttribute "\'element"
|
||||
syn match vhdlAttribute "\'leftof"
|
||||
syn match vhdlAttribute "\'low"
|
||||
syn match vhdlAttribute "\'pos"
|
||||
syn match vhdlAttribute "\'pred"
|
||||
syn match vhdlAttribute "\'rightof"
|
||||
@ -150,34 +150,76 @@ syn match vhdlNumber "-\=\<\d\+\(E[+\-]\=\d\+\)\>"
|
||||
syn match vhdlNumber "-\=\<\d\+\>"
|
||||
syn match vhdlNumber "0*2#[01_]\+#\(E[+\-]\=\d\+\)\="
|
||||
syn match vhdlNumber "0*16#[0-9a-f_]\+#\(E[+\-]\=\d\+\)\="
|
||||
|
||||
" operators
|
||||
syn keyword vhdlOperator and nand or nor xor xnor
|
||||
syn keyword vhdlOperator rol ror sla sll sra srl
|
||||
syn keyword vhdlOperator mod rem abs not
|
||||
syn match vhdlOperator "[&><=:+\-*\/|]"
|
||||
syn match vhdlSpecial "[().,;]"
|
||||
syn keyword vhdlOperator and nand or nor xor xnor
|
||||
syn keyword vhdlOperator rol ror sla sll sra srl
|
||||
syn keyword vhdlOperator mod rem abs not
|
||||
" TODO remove the following line. You can't have a sequence of */=+ as an operator for example.
|
||||
"syn match vhdlOperator "[&><=:+\-*\/|]"
|
||||
" The following lines match valid and invalid operators.
|
||||
|
||||
" Concatenation and math operators
|
||||
syn match vhdlOperator "&\|+\|-\|\*\|\/"
|
||||
|
||||
" Equality and comparison operators
|
||||
syn match vhdlOperator "=\|\/=\|>\|<\|>="
|
||||
|
||||
" Assignment operators
|
||||
syn match vhdlOperator "<=\|:="
|
||||
syn match vhdlOperator "=>"
|
||||
|
||||
" VHDL-2008 conversion, matching equality/non-equality operators
|
||||
syn match vhdlOperator "??\|?=\|?\/=\|?<\|?<=\|?>\|?>="
|
||||
|
||||
" Linting for illegal operators
|
||||
" '='
|
||||
syn match vhdlError "\(=\)[<=&+\-\*\/\\]\+"
|
||||
syn match vhdlError "[=&+\-\*\\]\+\(=\)"
|
||||
" '>', '<'
|
||||
syn match vhdlError "\(>\)[<>&+\-\/\\]\+"
|
||||
syn match vhdlError "[>&+\-\/\\]\+\(>\)"
|
||||
syn match vhdlError "\(<\)[<&+\-\/\\]\+"
|
||||
syn match vhdlError "[<>=&+\-\/\\]\+\(<\)"
|
||||
" Covers most operators
|
||||
syn match vhdlError "\(&\|+\|\-\|\*\*\|\/=\|??\|?=\|?\/=\|?<=\|?>=\|>=\|<=\|:=\|=>\)[<>=&+\-\*\\?:]\+"
|
||||
syn match vhdlError "[<>=&+\-\*\\:]\+\(&\|+\|\-\|\*\*\|\/=\|??\|?=\|?\/=\|?<\|?<=\|?>\|?>=\|>=\|<=\|:=\|=>\)"
|
||||
syn match vhdlError "\(?<\|?>\)[<>&+\-\*\/\\?:]\+"
|
||||
|
||||
"syn match vhdlError "[?]\+\(&\|+\|\-\|\*\*\|??\|?=\|?\/=\|?<\|?<=\|?>\|?>=\|:=\|=>\)"
|
||||
" '/'
|
||||
syn match vhdlError "\(\/\)[<>&+\-\*\/\\?:]\+"
|
||||
syn match vhdlError "[<>=&+\-\*\/\\:]\+\(\/\)"
|
||||
|
||||
syn match vhdlSpecial "<>"
|
||||
syn match vhdlSpecial "[().,;]"
|
||||
|
||||
|
||||
" time
|
||||
syn match vhdlTime "\<\d\+\s\+\(\([fpnum]s\)\|\(sec\)\|\(min\)\|\(hr\)\)\>"
|
||||
syn match vhdlTime "\<\d\+\.\d\+\s\+\(\([fpnum]s\)\|\(sec\)\|\(min\)\|\(hr\)\)\>"
|
||||
|
||||
syn case match
|
||||
syn keyword vhdlTodo contained TODO NOTE
|
||||
syn keyword vhdlFixme contained FIXME
|
||||
syn case ignore
|
||||
|
||||
" Regex for space is '\s'
|
||||
" Any number of spaces: \s*
|
||||
" At least one space: \s+
|
||||
syn region vhdlComment start="/\*" end="\*/" contains=vhdlTodo,vhdlFixme,@Spell
|
||||
syn match vhdlComment "--.*" contains=vhdlTodo,vhdlFixme,@Spell
|
||||
syn region vhdlComment start="/\*" end="\*/" contains=vhdlTodo,vhdlFixme,@Spell
|
||||
syn match vhdlComment "\(^\|\s\)--.*" contains=vhdlTodo,vhdlFixme,@Spell
|
||||
|
||||
" Industry-standard directives. These are not standard VHDL, but are commonly
|
||||
" used in the industry.
|
||||
syn match vhdlPreProc "/\* synthesis .* \*/"
|
||||
"syn match vhdlPreProc "/\* simulation .* \*/"
|
||||
syn match vhdlPreProc "/\* pragma .* \*/"
|
||||
syn match vhdlPreProc "/\* synopsys .* \*/"
|
||||
syn match vhdlPreProc "--\s*synthesis .*"
|
||||
"syn match vhdlPreProc "--\s*simulation .*"
|
||||
syn match vhdlPreProc "--\s*pragma .*"
|
||||
syn match vhdlPreProc "--\s*synopsys .*"
|
||||
" syn match vhdlGlobal "[\'$#~!%@?\^\[\]{}\\]"
|
||||
|
||||
"Modify the following as needed. The trade-off is performance versus functionality.
|
||||
syn sync minlines=200
|
||||
syn sync minlines=600
|
||||
|
||||
" Define the default highlighting.
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
@ -203,7 +245,7 @@ if version >= 508 || !exists("did_vhdl_syntax_inits")
|
||||
HiLink vhdlTime Number
|
||||
HiLink vhdlType Type
|
||||
HiLink vhdlOperator Operator
|
||||
" HiLink vhdlGlobal Error
|
||||
HiLink vhdlError Error
|
||||
HiLink vhdlAttribute Special
|
||||
HiLink vhdlPreProc PreProc
|
||||
|
||||
|
@ -39,6 +39,7 @@ local redraw_flags={
|
||||
|
||||
local list_flags={
|
||||
comma='P_COMMA',
|
||||
onecomma='P_ONECOMMA',
|
||||
flags='P_FLAGLIST',
|
||||
flagscomma='P_COMMA|P_FLAGLIST',
|
||||
}
|
||||
|
32
scripts/git-log-pretty-since.sh
Executable file
32
scripts/git-log-pretty-since.sh
Executable file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Shows a log with changes grouped next to their merge-commit.
|
||||
#
|
||||
# Parameters:
|
||||
# $1 "since" commit
|
||||
# $2 "inverse match" regex pattern
|
||||
|
||||
set -e
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
__SINCE=$1
|
||||
__INVMATCH=$2
|
||||
|
||||
is_merge_commit() {
|
||||
git rev-parse $1 >/dev/null 2>&1 \
|
||||
|| { echo "ERROR: invalid commit: $1"; exit 1; }
|
||||
git log $1^2 >/dev/null 2>&1 && return 0 || return 1
|
||||
}
|
||||
|
||||
for commit in $(git log --format='%H' --first-parent --since $__SINCE); do
|
||||
if is_merge_commit ${commit} ; then
|
||||
if [ -z "$__INVMATCH" ] || ! git log --oneline ${commit}^1..${commit}^2 \
|
||||
| grep -E "$__INVMATCH" >/dev/null 2>&1 ; then
|
||||
git log -1 --oneline ${commit}
|
||||
git log --format=' %h %s' ${commit}^1..${commit}^2
|
||||
fi
|
||||
else
|
||||
git log -1 --oneline ${commit}
|
||||
fi
|
||||
done
|
@ -287,7 +287,7 @@ local feed, insert, source = helpers.feed, helpers.insert, helpers.source
|
||||
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
|
||||
|
||||
describe('$test_name', function()
|
||||
setup(clear)
|
||||
before_each(clear)
|
||||
|
||||
it('is working', function()
|
||||
@{[join "\n", map { /^$/ ? '' : ' ' . $_ } @{$test_body_lines}]}
|
||||
|
@ -1,5 +1,5 @@
|
||||
lpeg = require('lpeg')
|
||||
msgpack = require('MessagePack')
|
||||
mpack = require('mpack')
|
||||
|
||||
-- lpeg grammar for building api metadata from a set of header files. It
|
||||
-- ignores comments and preprocessor commands and parses a very small subset
|
||||
@ -115,7 +115,7 @@ static const uint8_t msgpack_metadata[] = {
|
||||
]])
|
||||
-- serialize the API metadata using msgpack and embed into the resulting
|
||||
-- binary for easy querying by clients
|
||||
packed = msgpack.pack(functions)
|
||||
packed = mpack.pack(functions)
|
||||
for i = 1, #packed do
|
||||
output:write(string.byte(packed, i)..', ')
|
||||
if i % 10 == 0 then
|
||||
|
63
scripts/release.sh
Executable file
63
scripts/release.sh
Executable file
@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Performs steps to tag a release.
|
||||
#
|
||||
# Steps:
|
||||
# Create the "release" commit:
|
||||
# - CMakeLists.txt: Unset NVIM_VERSION_PRERELEASE
|
||||
# - Tag the commit.
|
||||
# Create the "version bump" commit:
|
||||
# - CMakeLists.txt: Set NVIM_VERSION_PRERELEASE to "-dev"
|
||||
#
|
||||
# Manual steps:
|
||||
# - CMakeLists.txt: Bump NVIM_VERSION_* as appropriate.
|
||||
# - git push --follow-tags
|
||||
|
||||
set -e
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
|
||||
__LAST_TAG=$(git describe --abbrev=0)
|
||||
[ -z "$__LAST_TAG" ] && { echo 'ERROR: no tag found'; exit 1; }
|
||||
__VERSION_MAJOR=$(grep 'set(NVIM_VERSION_MAJOR' CMakeLists.txt\
|
||||
|sed -r 's/.*NVIM_VERSION_MAJOR ([[:digit:]]).*/\1/')
|
||||
__VERSION_MINOR=$(grep 'set(NVIM_VERSION_MINOR' CMakeLists.txt\
|
||||
|sed -r 's/.*NVIM_VERSION_MINOR ([[:digit:]]).*/\1/')
|
||||
__VERSION_PATCH=$(grep 'set(NVIM_VERSION_PATCH' CMakeLists.txt\
|
||||
|sed -r 's/.*NVIM_VERSION_PATCH ([[:digit:]]).*/\1/')
|
||||
__VERSION="${__VERSION_MAJOR}.${__VERSION_MINOR}.${__VERSION_PATCH}"
|
||||
{ [ -z "$__VERSION_MAJOR" ] || [ -z "$__VERSION_MINOR" ] || [ -z "$__VERSION_PATCH" ]; } \
|
||||
&& { echo "ERROR: version parse failed: '${__VERSION}'"; exit 1; }
|
||||
__RELEASE_MSG="NVIM v${__VERSION}
|
||||
|
||||
Features:
|
||||
|
||||
Fixes:
|
||||
|
||||
Changes:
|
||||
|
||||
"
|
||||
__BUMP_MSG="version bump"
|
||||
|
||||
echo "Most recent tag: ${__LAST_TAG}"
|
||||
echo "Release version: ${__VERSION}"
|
||||
sed -i -r 's/(NVIM_VERSION_PRERELEASE) "-dev"/\1 ""/' CMakeLists.txt
|
||||
echo "Building changelog since ${__LAST_TAG}..."
|
||||
__CHANGELOG="$(./scripts/git-log-pretty-since.sh $__LAST_TAG 'vim-patch:\S')"
|
||||
|
||||
git add CMakeLists.txt
|
||||
git commit --edit -m "${__RELEASE_MSG} ${__CHANGELOG}"
|
||||
git tag -a v${__VERSION} -m "NVIM v${__VERSION}"
|
||||
|
||||
sed -i -r 's/(NVIM_VERSION_PRERELEASE) ""/\1 "-dev"/' CMakeLists.txt
|
||||
nvim -c '/NVIM_VERSION' -c 'echo "Update version numbers"' CMakeLists.txt
|
||||
git add CMakeLists.txt
|
||||
git commit -m "$__BUMP_MSG"
|
||||
|
||||
echo "
|
||||
Next steps:
|
||||
- Double-check NVIM_VERSION_* in CMakeLists.txt
|
||||
- git push --follow-tags
|
||||
- update website: index.html"
|
@ -5,9 +5,12 @@ set -u
|
||||
set -o pipefail
|
||||
|
||||
readonly NEOVIM_SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
readonly VIM_SOURCE_DIR_DEFAULT=${NEOVIM_SOURCE_DIR}/.vim-src
|
||||
readonly VIM_SOURCE_DIR_DEFAULT="${NEOVIM_SOURCE_DIR}/.vim-src"
|
||||
readonly VIM_SOURCE_DIR="${VIM_SOURCE_DIR:-${VIM_SOURCE_DIR_DEFAULT}}"
|
||||
readonly BASENAME="$(basename "${0}")"
|
||||
readonly BRANCH_PREFIX="vim-"
|
||||
|
||||
CREATED_FILES=()
|
||||
|
||||
usage() {
|
||||
echo "Helper script for porting Vim patches. For more information, see"
|
||||
@ -21,6 +24,7 @@ usage() {
|
||||
echo " -p {vim-revision} Download and apply the Vim patch vim-revision."
|
||||
echo " vim-revision can be a version number of the "
|
||||
echo " format '7.4.xxx' or a Git commit hash."
|
||||
echo " -s Submit a vim-patch pull request to Neovim."
|
||||
echo " -r {pr-number} Review a vim-patch pull request to Neovim."
|
||||
echo
|
||||
echo "Set VIM_SOURCE_DIR to change where Vim's sources are stored."
|
||||
@ -35,12 +39,33 @@ check_executable() {
|
||||
fi
|
||||
}
|
||||
|
||||
clean_files() {
|
||||
if [[ ${#CREATED_FILES[@]} -eq 0 ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Created files:"
|
||||
local file
|
||||
for file in ${CREATED_FILES[@]}; do
|
||||
echo " • ${file}"
|
||||
done
|
||||
|
||||
read -p "Delete these files (Y/n)? " -n 1 -r reply
|
||||
echo
|
||||
if [[ "${reply}" =~ ^[Yy]$ ]]; then
|
||||
rm -- ${CREATED_FILES[@]}
|
||||
else
|
||||
echo "You can use 'git clean' to remove these files when you're done."
|
||||
fi
|
||||
}
|
||||
|
||||
get_vim_sources() {
|
||||
check_executable git
|
||||
|
||||
if [[ ! -d ${VIM_SOURCE_DIR} ]]; then
|
||||
echo "Cloning Vim sources into '${VIM_SOURCE_DIR}'."
|
||||
git clone --depth=1000 https://github.com/vim/vim.git "${VIM_SOURCE_DIR}"
|
||||
git clone https://github.com/vim/vim.git "${VIM_SOURCE_DIR}"
|
||||
cd "${VIM_SOURCE_DIR}"
|
||||
else
|
||||
if [[ ! -d "${VIM_SOURCE_DIR}/.git" ]]; then
|
||||
@ -61,27 +86,36 @@ commit_message() {
|
||||
"${vim_message}" "${vim_commit_url}"
|
||||
}
|
||||
|
||||
find_git_remote() {
|
||||
git remote -v \
|
||||
| awk '$2 ~ /github.com[:/]neovim\/neovim/ && $3 == "(fetch)" {print $1}'
|
||||
}
|
||||
|
||||
assign_commit_details() {
|
||||
if [[ ${1} =~ [0-9]\.[0-9]\.[0-9]{3,4} ]]; then
|
||||
# Interpret parameter as version number (tag).
|
||||
vim_version="${1}"
|
||||
vim_tag="v${1}"
|
||||
vim_commit=$( cd "${VIM_SOURCE_DIR}" \
|
||||
&& git log -1 --format="%H" ${vim_tag} )
|
||||
vim_commit=$(cd "${VIM_SOURCE_DIR}" \
|
||||
&& git log -1 --format="%H" ${vim_tag})
|
||||
local strip_commit_line=true
|
||||
else
|
||||
# Interpret parameter as commit hash.
|
||||
vim_version="${1:0:7}"
|
||||
vim_commit="${1}"
|
||||
vim_commit=$(cd "${VIM_SOURCE_DIR}" \
|
||||
&& git log -1 --format="%H" ${vim_version})
|
||||
local strip_commit_line=false
|
||||
fi
|
||||
|
||||
vim_commit_url="https://github.com/vim/vim/commit/${vim_commit}"
|
||||
vim_message="$(git log -1 --pretty='format:%B' "${vim_commit}")"
|
||||
vim_message="$(cd "${VIM_SOURCE_DIR}" \
|
||||
&& git log -1 --pretty='format:%B' "${vim_commit}" \
|
||||
| sed -e 's/\(#[0-9]*\)/vim\/vim\1/g')"
|
||||
if [[ ${strip_commit_line} == "true" ]]; then
|
||||
# Remove first line of commit message.
|
||||
vim_message="$(echo "${vim_message}" | sed -e '1d')"
|
||||
fi
|
||||
patch_file="vim-${vim_version}.patch"
|
||||
}
|
||||
|
||||
get_vim_patch() {
|
||||
@ -96,66 +130,111 @@ get_vim_patch() {
|
||||
echo
|
||||
echo "✔ Found Vim revision '${vim_commit}'."
|
||||
|
||||
# Collect patch details and store into variables.
|
||||
vim_full="$(git show -1 --pretty=medium "${vim_commit}")"
|
||||
# Patch surgery: preprocess the patch.
|
||||
# - transform src/ paths to src/nvim/
|
||||
vim_diff="$(git show -1 "${vim_commit}" \
|
||||
local vim_full="$(git show -1 --pretty=medium "${vim_commit}" \
|
||||
| LC_ALL=C sed -e 's/\( [ab]\/src\)/\1\/nvim/g')"
|
||||
neovim_message="$(commit_message)"
|
||||
neovim_pr="
|
||||
\`\`\`
|
||||
${vim_message}
|
||||
\`\`\`
|
||||
local neovim_branch="${BRANCH_PREFIX}${vim_version}"
|
||||
|
||||
${vim_commit_url}
|
||||
|
||||
Original patch:
|
||||
|
||||
\`\`\`diff
|
||||
${vim_diff}
|
||||
\`\`\`"
|
||||
neovim_branch="vim-${vim_version}"
|
||||
|
||||
echo
|
||||
echo "Creating Git branch."
|
||||
cd "${NEOVIM_SOURCE_DIR}"
|
||||
output="$(git checkout -b "${neovim_branch}" 2>&1)" &&
|
||||
echo "✔ ${output}" ||
|
||||
(echo "✘ ${output}"; false)
|
||||
local git_remote=$(find_git_remote)
|
||||
local checked_out_branch="$(git rev-parse --abbrev-ref HEAD)"
|
||||
|
||||
if [[ "${checked_out_branch}" == ${BRANCH_PREFIX}* ]]; then
|
||||
echo "✔ Current branch '${checked_out_branch}' seems to be a vim-patch"
|
||||
echo " branch; not creating a new branch."
|
||||
else
|
||||
echo
|
||||
echo "Fetching '${git_remote}/master'."
|
||||
output="$(git fetch "${git_remote}" master 2>&1)" &&
|
||||
echo "✔ ${output}" ||
|
||||
(echo "✘ ${output}"; false)
|
||||
|
||||
echo
|
||||
echo "Creating new branch '${neovim_branch}' based on '${git_remote}/master'."
|
||||
cd "${NEOVIM_SOURCE_DIR}"
|
||||
output="$(git checkout -b "${neovim_branch}" "${git_remote}/master" 2>&1)" &&
|
||||
echo "✔ ${output}" ||
|
||||
(echo "✘ ${output}"; false)
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Creating empty commit with correct commit message."
|
||||
output="$(git commit --allow-empty --file 2>&1 - <<< "${neovim_message}")" &&
|
||||
output="$(commit_message | git commit --allow-empty --file 2>&1 -)" &&
|
||||
echo "✔ ${output}" ||
|
||||
(echo "✘ ${output}"; false)
|
||||
|
||||
echo
|
||||
echo "Creating files."
|
||||
echo "${vim_diff}" > "${NEOVIM_SOURCE_DIR}/${neovim_branch}.diff"
|
||||
echo "✔ Saved diff to '${NEOVIM_SOURCE_DIR}/${neovim_branch}.diff'."
|
||||
echo "${vim_full}" > "${NEOVIM_SOURCE_DIR}/${neovim_branch}.patch"
|
||||
echo "✔ Saved full commit details to '${NEOVIM_SOURCE_DIR}/${neovim_branch}.patch'."
|
||||
echo "${neovim_pr}" > "${NEOVIM_SOURCE_DIR}/${neovim_branch}.pr"
|
||||
echo "✔ Saved suggested PR description to '${NEOVIM_SOURCE_DIR}/${neovim_branch}.pr'."
|
||||
echo "You can use 'git clean' to remove these files when you're done."
|
||||
echo "${vim_full}" > "${NEOVIM_SOURCE_DIR}/${patch_file}"
|
||||
echo "✔ Saved full commit details to '${NEOVIM_SOURCE_DIR}/${patch_file}'."
|
||||
|
||||
echo
|
||||
echo "Instructions:"
|
||||
echo
|
||||
echo " Proceed to port the patch."
|
||||
echo " You might want to try 'patch -p1 < ${neovim_branch}.diff' first."
|
||||
echo " You might want to try 'patch -p1 < ${patch_file}' first."
|
||||
echo
|
||||
echo " If the patch contains a new test, consider porting it to Lua."
|
||||
echo " You might want to try 'scripts/legacy2luatest.pl'."
|
||||
echo
|
||||
echo " Stage your changes ('git add ...') and use 'git commit --amend' to commit."
|
||||
echo
|
||||
echo " Push your changes with 'git push origin ${neovim_branch}' and create a"
|
||||
echo " pull request called '[RFC] vim-patch:${vim_version}'. You might want "
|
||||
echo " to use the text in '${neovim_branch}.pr' as the description of this pull request."
|
||||
echo " To port additional patches related to ${vim_version} and add them to the current"
|
||||
echo " branch, call '${BASENAME} -p' again. Please use this only if it wouldn't make"
|
||||
echo " sense to send in each patch individually, as it will increase the size of the"
|
||||
echo " pull request and make it harder to review."
|
||||
echo
|
||||
echo " When you are finished, use '${BASENAME} -s' to submit a pull request."
|
||||
echo
|
||||
echo " See https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-vim"
|
||||
echo " for more information."
|
||||
}
|
||||
|
||||
submit_pr() {
|
||||
check_executable git
|
||||
check_executable hub
|
||||
|
||||
cd "${NEOVIM_SOURCE_DIR}"
|
||||
local checked_out_branch="$(git rev-parse --abbrev-ref HEAD)"
|
||||
if [[ "${checked_out_branch}" != ${BRANCH_PREFIX}* ]]; then
|
||||
echo "✘ Current branch '${checked_out_branch}' doesn't seem to be a vim-patch branch."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local git_remote=$(find_git_remote)
|
||||
local pr_body="$(git log --reverse --format='#### %s%n%n%b%n' ${git_remote}/master..HEAD)"
|
||||
local patches=("$(git log --reverse --format='%s' ${git_remote}/master..HEAD)")
|
||||
patches=(${patches[@]//vim-patch:}) # Remove 'vim-patch:' prefix for each item in array.
|
||||
local pr_title="${patches[@]}" # Create space-separated string from array.
|
||||
pr_title="${pr_title// /,}" # Replace spaces with commas.
|
||||
|
||||
local pr_message="$(printf '[RFC] vim-patch:%s\n\n%s\n' "${pr_title#,}" "${pr_body}")"
|
||||
|
||||
echo "Pushing to 'origin/${checked_out_branch}'."
|
||||
output="$(git push origin "${checked_out_branch}" 2>&1)" &&
|
||||
echo "✔ ${output}" ||
|
||||
(echo "✘ ${output}"; git reset --soft HEAD^1; false)
|
||||
|
||||
echo
|
||||
echo "Creating pull request."
|
||||
output="$(hub pull-request -F - 2>&1 <<< "${pr_message}")" &&
|
||||
echo "✔ ${output}" ||
|
||||
(echo "✘ ${output}"; false)
|
||||
|
||||
echo
|
||||
echo "Cleaning up files."
|
||||
local patch_file
|
||||
for patch_file in ${patches[@]}; do
|
||||
patch_file="vim-${patch_file}.patch"
|
||||
if [[ ! -f "${NEOVIM_SOURCE_DIR}/${patch_file}" ]]; then
|
||||
continue
|
||||
fi
|
||||
rm -- "${NEOVIM_SOURCE_DIR}/${patch_file}"
|
||||
echo "✔ Removed '${NEOVIM_SOURCE_DIR}/${patch_file}'."
|
||||
done
|
||||
}
|
||||
|
||||
list_vim_patches() {
|
||||
get_vim_sources
|
||||
|
||||
@ -172,7 +251,7 @@ list_vim_patches() {
|
||||
local patch_number="${vim_tag:5}" # Remove prefix like "v7.4."
|
||||
# Tagged Vim patch, check version.c:
|
||||
is_missing="$(sed -n '/static int included_patches/,/}/p' "${NEOVIM_SOURCE_DIR}/src/nvim/version.c" |
|
||||
grep -x -e "[[:space:]]*//[[:space:]]${patch_number} NA" -e "[[:space:]]*${patch_number}," >/dev/null && echo "false" || echo "true")"
|
||||
grep -x -e "[[:space:]]*//[[:space:]]${patch_number} NA.*" -e "[[:space:]]*${patch_number}," >/dev/null && echo "false" || echo "true")"
|
||||
vim_commit="${vim_tag#v}"
|
||||
else
|
||||
# Untagged Vim patch (e.g. runtime updates), check the Neovim git log:
|
||||
@ -189,7 +268,8 @@ list_vim_patches() {
|
||||
echo "Instructions:"
|
||||
echo
|
||||
echo " To port one of the above patches to Neovim, execute"
|
||||
echo " this script with the patch revision as argument."
|
||||
echo " this script with the patch revision as argument and"
|
||||
echo " follow the instructions."
|
||||
echo
|
||||
echo " Examples: '${BASENAME} -p 7.4.487'"
|
||||
echo " '${BASENAME} -p 1e8ebf870720e7b671f98f22d653009826304c4f'"
|
||||
@ -198,32 +278,28 @@ list_vim_patches() {
|
||||
echo " Out-of-order patches increase the possibility of bugs."
|
||||
}
|
||||
|
||||
review_pr() {
|
||||
check_executable curl
|
||||
check_executable nvim
|
||||
|
||||
get_vim_sources
|
||||
|
||||
local pr="${1}"
|
||||
echo
|
||||
echo "Downloading data for pull request #${pr}."
|
||||
review_commit() {
|
||||
local neovim_commit_url="${1}"
|
||||
local neovim_patch_url="${neovim_commit_url}.patch"
|
||||
|
||||
local git_patch_prefix='Subject: \[PATCH\] '
|
||||
local neovim_patch="$(curl -Ssf "https://patch-diff.githubusercontent.com/raw/neovim/neovim/pull/${pr}.patch")"
|
||||
echo "${neovim_patch}" > a
|
||||
local neovim_patch="$(curl -Ssf "${neovim_patch_url}")"
|
||||
local vim_version="$(head -n 4 <<< "${neovim_patch}" | sed -n "s/${git_patch_prefix}vim-patch:\([a-z0-9.]*\)$/\1/p")"
|
||||
|
||||
echo
|
||||
if [[ -n "${vim_version}" ]]; then
|
||||
echo "✔ Detected Vim patch '${vim_version}'."
|
||||
else
|
||||
echo "✘ Could not detect the Vim patch number."
|
||||
echo " This script assumes that the PR contains a single commit"
|
||||
echo " with 'vim-patch:XXX' as its title."
|
||||
echo " This script assumes that the PR contains only commits"
|
||||
echo " with 'vim-patch:XXX' in their title."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
assign_commit_details "${vim_version}"
|
||||
|
||||
local vim_patch_url="${vim_commit_url}.patch"
|
||||
|
||||
local expected_commit_message="$(commit_message)"
|
||||
local message_length="$(wc -l <<< "${expected_commit_message}")"
|
||||
local commit_message="$(tail -n +4 <<< "${neovim_patch}" | head -n "${message_length}")"
|
||||
@ -235,26 +311,57 @@ review_pr() {
|
||||
echo "${expected_commit_message}"
|
||||
echo " Actual:"
|
||||
echo "${commit_message#${git_patch_prefix}}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local base_name="vim-${vim_version}"
|
||||
echo
|
||||
echo "Creating files."
|
||||
curl -Ssfo "${NEOVIM_SOURCE_DIR}/n${base_name}.diff" "https://patch-diff.githubusercontent.com/raw/neovim/neovim/pull/${pr}.diff"
|
||||
echo "✔ Saved pull request diff to '${NEOVIM_SOURCE_DIR}/n${base_name}.diff'."
|
||||
echo "${neovim_patch}" > "${NEOVIM_SOURCE_DIR}/n${base_name}.patch"
|
||||
echo "✔ Saved full pull request commit details to '${NEOVIM_SOURCE_DIR}/n${base_name}.patch'."
|
||||
git show "${vim_commit}" > "${NEOVIM_SOURCE_DIR}/${base_name}.diff"
|
||||
echo "✔ Saved Vim diff to '${NEOVIM_SOURCE_DIR}/${base_name}.diff'."
|
||||
echo "You can use 'git clean' to remove these files when you're done."
|
||||
echo "${neovim_patch}" > "${NEOVIM_SOURCE_DIR}/n${patch_file}"
|
||||
echo "✔ Saved pull request diff to '${NEOVIM_SOURCE_DIR}/n${patch_file}'."
|
||||
CREATED_FILES+=("${NEOVIM_SOURCE_DIR}/n${patch_file}")
|
||||
|
||||
curl -Ssfo "${NEOVIM_SOURCE_DIR}/${patch_file}" "${vim_patch_url}"
|
||||
echo "✔ Saved Vim diff to '${NEOVIM_SOURCE_DIR}/${patch_file}'."
|
||||
CREATED_FILES+=("${NEOVIM_SOURCE_DIR}/${patch_file}")
|
||||
|
||||
echo
|
||||
echo "Launching nvim."
|
||||
exec nvim -O "${NEOVIM_SOURCE_DIR}/${base_name}.diff" "${NEOVIM_SOURCE_DIR}/n${base_name}.diff"
|
||||
nvim -c "cd ${NEOVIM_SOURCE_DIR}" \
|
||||
-O "${NEOVIM_SOURCE_DIR}/${patch_file}" "${NEOVIM_SOURCE_DIR}/n${patch_file}"
|
||||
}
|
||||
|
||||
while getopts "hlp:r:" opt; do
|
||||
review_pr() {
|
||||
check_executable curl
|
||||
check_executable nvim
|
||||
check_executable jq
|
||||
|
||||
get_vim_sources
|
||||
|
||||
local pr="${1}"
|
||||
echo
|
||||
echo "Downloading data for pull request #${pr}."
|
||||
|
||||
local pr_commit_urls=($(curl -Ssf "https://api.github.com/repos/neovim/neovim/pulls/${pr}/commits" \
|
||||
| jq -r '.[].html_url'))
|
||||
|
||||
echo "Found ${#pr_commit_urls[@]} commit(s)."
|
||||
|
||||
local pr_commit_url
|
||||
local reply
|
||||
for pr_commit_url in ${pr_commit_urls[@]}; do
|
||||
review_commit "${pr_commit_url}"
|
||||
if [[ "${pr_commit_url}" != "${pr_commit_urls[-1]}" ]]; then
|
||||
read -p "Continue with next commit (Y/n)? " -n 1 -r reply
|
||||
echo
|
||||
if [[ ! "${reply}" =~ ^[Yy]$ ]]; then
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
clean_files
|
||||
}
|
||||
|
||||
while getopts "hlp:r:s" opt; do
|
||||
case ${opt} in
|
||||
h)
|
||||
usage
|
||||
@ -272,6 +379,10 @@ while getopts "hlp:r:" opt; do
|
||||
review_pr "${OPTARG}"
|
||||
exit 0
|
||||
;;
|
||||
s)
|
||||
submit_pr
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
|
@ -1,4 +1,4 @@
|
||||
BasedOnStyle: llvm
|
||||
BasedOnStyle: Google
|
||||
Language: Cpp
|
||||
ColumnLimit: 80
|
||||
IndentWidth: 2
|
||||
@ -10,3 +10,9 @@ AlignEscapedNewlinesLeft: false
|
||||
AllowShortFunctionsOnASingleLine: false
|
||||
SpacesBeforeTrailingComments: 2
|
||||
PenaltyReturnTypeOnItsOwnLine: 200
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
BinPackParameters: false
|
||||
BreakBeforeBinaryOperators: true
|
||||
ContinuationIndentWidth: 4
|
||||
|
@ -41,25 +41,33 @@ include_directories(${GENERATED_DIR})
|
||||
include_directories(${GENERATED_INCLUDES_DIR})
|
||||
|
||||
file(MAKE_DIRECTORY ${GENERATED_DIR})
|
||||
file(MAKE_DIRECTORY ${GENERATED_DIR}/os)
|
||||
file(MAKE_DIRECTORY ${GENERATED_DIR}/api)
|
||||
file(MAKE_DIRECTORY ${GENERATED_DIR}/api/private)
|
||||
file(MAKE_DIRECTORY ${GENERATED_DIR}/msgpack_rpc)
|
||||
file(MAKE_DIRECTORY ${GENERATED_DIR}/tui)
|
||||
file(MAKE_DIRECTORY ${GENERATED_DIR}/event)
|
||||
file(MAKE_DIRECTORY ${GENERATED_INCLUDES_DIR})
|
||||
file(MAKE_DIRECTORY ${GENERATED_INCLUDES_DIR}/os)
|
||||
file(MAKE_DIRECTORY ${GENERATED_INCLUDES_DIR}/api)
|
||||
file(MAKE_DIRECTORY ${GENERATED_INCLUDES_DIR}/api/private)
|
||||
file(MAKE_DIRECTORY ${GENERATED_INCLUDES_DIR}/msgpack_rpc)
|
||||
file(MAKE_DIRECTORY ${GENERATED_INCLUDES_DIR}/tui)
|
||||
file(MAKE_DIRECTORY ${GENERATED_INCLUDES_DIR}/event)
|
||||
|
||||
file(GLOB NEOVIM_SOURCES *.c os/*.c api/*.c api/private/*.c msgpack_rpc/*.c
|
||||
tui/*.c event/*.c)
|
||||
file(GLOB NEOVIM_SOURCES *.c)
|
||||
|
||||
foreach(subdir
|
||||
os
|
||||
api
|
||||
api/private
|
||||
msgpack_rpc
|
||||
tui
|
||||
event
|
||||
eval
|
||||
)
|
||||
file(MAKE_DIRECTORY ${GENERATED_DIR}/${subdir})
|
||||
file(MAKE_DIRECTORY ${GENERATED_INCLUDES_DIR}/${subdir})
|
||||
file(GLOB sources ${subdir}/*.c)
|
||||
list(APPEND NEOVIM_SOURCES ${sources})
|
||||
endforeach()
|
||||
|
||||
file(GLOB_RECURSE NEOVIM_HEADERS *.h)
|
||||
file(GLOB UNIT_TEST_FIXTURES ${PROJECT_SOURCE_DIR}/test/unit/fixtures/*.c)
|
||||
|
||||
# Sort file lists to ensure generated files are created in the same order from
|
||||
# build to build.
|
||||
list(SORT NEOVIM_SOURCES)
|
||||
list(SORT NEOVIM_HEADERS)
|
||||
|
||||
foreach(sfile ${NEOVIM_SOURCES})
|
||||
get_filename_component(f ${sfile} NAME)
|
||||
if(${f} MATCHES "^(regexp_nfa.c)$")
|
||||
@ -72,11 +80,9 @@ list(REMOVE_ITEM NEOVIM_SOURCES ${to_remove})
|
||||
# Handle legacy files that don't yet pass -Wconversion.
|
||||
set(CONV_SOURCES
|
||||
buffer.c
|
||||
charset.c
|
||||
diff.c
|
||||
edit.c
|
||||
eval.c
|
||||
ex_cmds2.c
|
||||
ex_cmds.c
|
||||
ex_docmd.c
|
||||
ex_getln.c
|
||||
@ -85,10 +91,7 @@ set(CONV_SOURCES
|
||||
mbyte.c
|
||||
memline.c
|
||||
message.c
|
||||
misc1.c
|
||||
ops.c
|
||||
path.c
|
||||
quickfix.c
|
||||
regexp.c
|
||||
screen.c
|
||||
search.c
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "nvim/mark.h"
|
||||
#include "nvim/fileio.h"
|
||||
#include "nvim/move.h"
|
||||
#include "nvim/syntax.h"
|
||||
#include "nvim/window.h"
|
||||
#include "nvim/undo.h"
|
||||
|
||||
@ -44,14 +45,22 @@ Integer buffer_line_count(Buffer buffer, Error *err)
|
||||
|
||||
/// Gets a buffer line
|
||||
///
|
||||
/// @deprecated use buffer_get_lines instead.
|
||||
/// for positive indices (including 0) use
|
||||
/// "buffer_get_lines(buffer, index, index+1, true)"
|
||||
/// for negative indices use
|
||||
/// "buffer_get_lines(buffer, index-1, index, true)"
|
||||
///
|
||||
/// @param buffer The buffer handle
|
||||
/// @param index The line index
|
||||
/// @param[out] err Details of an error that may have occurred
|
||||
/// @return The line string
|
||||
String buffer_get_line(Buffer buffer, Integer index, Error *err)
|
||||
{
|
||||
String rv = {.size = 0};
|
||||
Array slice = buffer_get_line_slice(buffer, index, index, true, true, err);
|
||||
String rv = { .size = 0 };
|
||||
|
||||
index = convert_index(index);
|
||||
Array slice = buffer_get_lines(buffer, index, index+1, true, err);
|
||||
|
||||
if (!err->set && slice.size) {
|
||||
rv = slice.items[0].data.string;
|
||||
@ -64,6 +73,12 @@ String buffer_get_line(Buffer buffer, Integer index, Error *err)
|
||||
|
||||
/// Sets a buffer line
|
||||
///
|
||||
/// @deprecated use buffer_set_lines instead.
|
||||
/// for positive indices use
|
||||
/// "buffer_set_lines(buffer, index, index+1, true, [line])"
|
||||
/// for negative indices use
|
||||
/// "buffer_set_lines(buffer, index-1, index, true, [line])"
|
||||
///
|
||||
/// @param buffer The buffer handle
|
||||
/// @param index The line index
|
||||
/// @param line The new line.
|
||||
@ -71,23 +86,34 @@ String buffer_get_line(Buffer buffer, Integer index, Error *err)
|
||||
void buffer_set_line(Buffer buffer, Integer index, String line, Error *err)
|
||||
{
|
||||
Object l = STRING_OBJ(line);
|
||||
Array array = {.items = &l, .size = 1};
|
||||
buffer_set_line_slice(buffer, index, index, true, true, array, err);
|
||||
Array array = { .items = &l, .size = 1 };
|
||||
index = convert_index(index);
|
||||
buffer_set_lines(buffer, index, index+1, true, array, err);
|
||||
}
|
||||
|
||||
/// Deletes a buffer line
|
||||
///
|
||||
/// @deprecated use buffer_set_lines instead.
|
||||
/// for positive indices use
|
||||
/// "buffer_set_lines(buffer, index, index+1, true, [])"
|
||||
/// for negative indices use
|
||||
/// "buffer_set_lines(buffer, index-1, index, true, [])"
|
||||
/// @param buffer The buffer handle
|
||||
/// @param index The line index
|
||||
/// @param[out] err Details of an error that may have occurred
|
||||
void buffer_del_line(Buffer buffer, Integer index, Error *err)
|
||||
{
|
||||
Array array = ARRAY_DICT_INIT;
|
||||
buffer_set_line_slice(buffer, index, index, true, true, array, err);
|
||||
index = convert_index(index);
|
||||
buffer_set_lines(buffer, index, index+1, true, array, err);
|
||||
}
|
||||
|
||||
/// Retrieves a line range from the buffer
|
||||
///
|
||||
/// @deprecated use buffer_get_lines(buffer, newstart, newend, false)
|
||||
/// where newstart = start + int(not include_start) - int(start < 0)
|
||||
/// newend = end + int(include_end) - int(end < 0)
|
||||
/// int(bool) = 1 if bool is true else 0
|
||||
/// @param buffer The buffer handle
|
||||
/// @param start The first line index
|
||||
/// @param end The last line index
|
||||
@ -101,17 +127,49 @@ ArrayOf(String) buffer_get_line_slice(Buffer buffer,
|
||||
Boolean include_start,
|
||||
Boolean include_end,
|
||||
Error *err)
|
||||
{
|
||||
start = convert_index(start) + !include_start;
|
||||
end = convert_index(end) + include_end;
|
||||
return buffer_get_lines(buffer, start , end, false, err);
|
||||
}
|
||||
|
||||
|
||||
/// Retrieves a line range from the buffer
|
||||
///
|
||||
/// Indexing is zero-based, end-exclusive. Negative indices are interpreted
|
||||
/// as length+1+index, i e -1 refers to the index past the end. So to get the
|
||||
/// last element set start=-2 and end=-1.
|
||||
///
|
||||
/// Out-of-bounds indices are clamped to the nearest valid value, unless
|
||||
/// `strict_indexing` is set.
|
||||
///
|
||||
/// @param buffer The buffer handle
|
||||
/// @param start The first line index
|
||||
/// @param end The last line index (exclusive)
|
||||
/// @param strict_indexing whether out-of-bounds should be an error.
|
||||
/// @param[out] err Details of an error that may have occurred
|
||||
/// @return An array of lines
|
||||
ArrayOf(String) buffer_get_lines(Buffer buffer,
|
||||
Integer start,
|
||||
Integer end,
|
||||
Boolean strict_indexing,
|
||||
Error *err)
|
||||
{
|
||||
Array rv = ARRAY_DICT_INIT;
|
||||
buf_T *buf = find_buffer_by_handle(buffer, err);
|
||||
|
||||
if (!buf || !inbounds(buf, start)) {
|
||||
if (!buf) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
start = normalize_index(buf, start) + (include_start ? 0 : 1);
|
||||
include_end = include_end || (end >= buf->b_ml.ml_line_count);
|
||||
end = normalize_index(buf, end) + (include_end ? 1 : 0);
|
||||
bool oob = false;
|
||||
start = normalize_index(buf, start, &oob);
|
||||
end = normalize_index(buf, end, &oob);
|
||||
|
||||
if (strict_indexing && oob) {
|
||||
api_set_error(err, Validation, _("Index out of bounds"));
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (start >= end) {
|
||||
// Return 0-length array
|
||||
@ -151,8 +209,14 @@ end:
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
/// Replaces a line range on the buffer
|
||||
///
|
||||
/// @deprecated use buffer_set_lines(buffer, newstart, newend, false, lines)
|
||||
/// where newstart = start + int(not include_start) + int(start < 0)
|
||||
/// newend = end + int(include_end) + int(end < 0)
|
||||
/// int(bool) = 1 if bool is true else 0
|
||||
///
|
||||
/// @param buffer The buffer handle
|
||||
/// @param start The first line index
|
||||
/// @param end The last line index
|
||||
@ -168,6 +232,37 @@ void buffer_set_line_slice(Buffer buffer,
|
||||
Boolean include_end,
|
||||
ArrayOf(String) replacement,
|
||||
Error *err)
|
||||
{
|
||||
start = convert_index(start) + !include_start;
|
||||
end = convert_index(end) + include_end;
|
||||
buffer_set_lines(buffer, start, end, false, replacement, err);
|
||||
}
|
||||
|
||||
|
||||
/// Replaces line range on the buffer
|
||||
///
|
||||
/// Indexing is zero-based, end-exclusive. Negative indices are interpreted
|
||||
/// as length+1+index, i e -1 refers to the index past the end. So to change
|
||||
/// or delete the last element set start=-2 and end=-1.
|
||||
///
|
||||
/// To insert lines at a given index, set both start and end to the same index.
|
||||
/// To delete a range of lines, set replacement to an empty array.
|
||||
///
|
||||
/// Out-of-bounds indices are clamped to the nearest valid value, unless
|
||||
/// `strict_indexing` is set.
|
||||
///
|
||||
/// @param buffer The buffer handle
|
||||
/// @param start The first line index
|
||||
/// @param end The last line index (exclusive)
|
||||
/// @param strict_indexing whether out-of-bounds should be an error.
|
||||
/// @param replacement An array of lines to use as replacement
|
||||
/// @param[out] err Details of an error that may have occurred
|
||||
void buffer_set_lines(Buffer buffer,
|
||||
Integer start,
|
||||
Integer end,
|
||||
Boolean strict_indexing,
|
||||
ArrayOf(String) replacement,
|
||||
Error *err)
|
||||
{
|
||||
buf_T *buf = find_buffer_by_handle(buffer, err);
|
||||
|
||||
@ -175,14 +270,15 @@ void buffer_set_line_slice(Buffer buffer,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!inbounds(buf, start)) {
|
||||
bool oob = false;
|
||||
start = normalize_index(buf, start, &oob);
|
||||
end = normalize_index(buf, end, &oob);
|
||||
|
||||
if (strict_indexing && oob) {
|
||||
api_set_error(err, Validation, _("Index out of bounds"));
|
||||
return;
|
||||
}
|
||||
|
||||
start = normalize_index(buf, start) + (include_start ? 0 : 1);
|
||||
include_end = include_end || (end >= buf->b_ml.ml_line_count);
|
||||
end = normalize_index(buf, end) + (include_end ? 1 : 0);
|
||||
|
||||
if (start > end) {
|
||||
api_set_error(err,
|
||||
@ -327,13 +423,16 @@ Object buffer_get_var(Buffer buffer, String name, Error *err)
|
||||
return dict_get_value(buf->b_vars, name, err);
|
||||
}
|
||||
|
||||
/// Sets a buffer-scoped (b:) variable. 'nil' value deletes the variable.
|
||||
/// Sets a buffer-scoped (b:) variable
|
||||
///
|
||||
/// @param buffer The buffer handle
|
||||
/// @param name The variable name
|
||||
/// @param value The variable value
|
||||
/// @param[out] err Details of an error that may have occurred
|
||||
/// @return The old value
|
||||
/// @return The old value or nil if there was no previous value.
|
||||
///
|
||||
/// @warning It may return nil if there was no previous value
|
||||
/// or if previous value was `v:null`.
|
||||
Object buffer_set_var(Buffer buffer, String name, Object value, Error *err)
|
||||
{
|
||||
buf_T *buf = find_buffer_by_handle(buffer, err);
|
||||
@ -342,7 +441,27 @@ Object buffer_set_var(Buffer buffer, String name, Object value, Error *err)
|
||||
return (Object) OBJECT_INIT;
|
||||
}
|
||||
|
||||
return dict_set_value(buf->b_vars, name, value, err);
|
||||
return dict_set_value(buf->b_vars, name, value, false, err);
|
||||
}
|
||||
|
||||
/// Removes a buffer-scoped (b:) variable
|
||||
///
|
||||
/// @param buffer The buffer handle
|
||||
/// @param name The variable name
|
||||
/// @param[out] err Details of an error that may have occurred
|
||||
/// @return The old value or nil if there was no previous value.
|
||||
///
|
||||
/// @warning It may return nil if there was no previous value
|
||||
/// or if previous value was `v:null`.
|
||||
Object buffer_del_var(Buffer buffer, String name, Error *err)
|
||||
{
|
||||
buf_T *buf = find_buffer_by_handle(buffer, err);
|
||||
|
||||
if (!buf) {
|
||||
return (Object) OBJECT_INIT;
|
||||
}
|
||||
|
||||
return dict_set_value(buf->b_vars, name, NIL, true, err);
|
||||
}
|
||||
|
||||
/// Gets a buffer option value
|
||||
@ -456,6 +575,8 @@ Boolean buffer_is_valid(Buffer buffer)
|
||||
|
||||
/// Inserts a sequence of lines to a buffer at a certain index
|
||||
///
|
||||
/// @deprecated use buffer_set_lines(buffer, lnum, lnum, true, lines)
|
||||
///
|
||||
/// @param buffer The buffer handle
|
||||
/// @param lnum Insert the lines after `lnum`. If negative, it will append
|
||||
/// to the end of the buffer.
|
||||
@ -466,8 +587,9 @@ void buffer_insert(Buffer buffer,
|
||||
ArrayOf(String) lines,
|
||||
Error *err)
|
||||
{
|
||||
bool end_start = lnum < 0;
|
||||
buffer_set_line_slice(buffer, lnum, lnum, !end_start, end_start, lines, err);
|
||||
// "lnum" will be the index of the line after inserting,
|
||||
// no matter if it is negative or not
|
||||
buffer_set_lines(buffer, lnum, lnum, true, lines, err);
|
||||
}
|
||||
|
||||
/// Return a tuple (row,col) representing the position of the named mark
|
||||
@ -514,6 +636,99 @@ ArrayOf(Integer, 2) buffer_get_mark(Buffer buffer, String name, Error *err)
|
||||
return rv;
|
||||
}
|
||||
|
||||
/// Adds a highlight to buffer.
|
||||
///
|
||||
/// This can be used for plugins which dynamically generate highlights to a
|
||||
/// buffer (like a semantic highlighter or linter). The function adds a single
|
||||
/// highlight to a buffer. Unlike matchaddpos() highlights follow changes to
|
||||
/// line numbering (as lines are inserted/removed above the highlighted line),
|
||||
/// like signs and marks do.
|
||||
///
|
||||
/// "src_id" is useful for batch deletion/updating of a set of highlights. When
|
||||
/// called with src_id = 0, an unique source id is generated and returned.
|
||||
/// Succesive calls can pass in it as "src_id" to add new highlights to the same
|
||||
/// source group. All highlights in the same group can then be cleared with
|
||||
/// buffer_clear_highlight. If the highlight never will be manually deleted
|
||||
/// pass in -1 for "src_id".
|
||||
///
|
||||
/// If "hl_group" is the empty string no highlight is added, but a new src_id
|
||||
/// is still returned. This is useful for an external plugin to synchrounously
|
||||
/// request an unique src_id at initialization, and later asynchronously add and
|
||||
/// clear highlights in response to buffer changes.
|
||||
///
|
||||
/// @param buffer The buffer handle
|
||||
/// @param src_id Source group to use or 0 to use a new group,
|
||||
/// or -1 for ungrouped highlight
|
||||
/// @param hl_group Name of the highlight group to use
|
||||
/// @param line The line to highlight
|
||||
/// @param col_start Start of range of columns to highlight
|
||||
/// @param col_end End of range of columns to highlight,
|
||||
/// or -1 to highlight to end of line
|
||||
/// @param[out] err Details of an error that may have occurred
|
||||
/// @return The src_id that was used
|
||||
Integer buffer_add_highlight(Buffer buffer,
|
||||
Integer src_id,
|
||||
String hl_group,
|
||||
Integer line,
|
||||
Integer col_start,
|
||||
Integer col_end,
|
||||
Error *err)
|
||||
{
|
||||
buf_T *buf = find_buffer_by_handle(buffer, err);
|
||||
if (!buf) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (line < 0 || line >= MAXLNUM) {
|
||||
api_set_error(err, Validation, _("Line number outside range"));
|
||||
return 0;
|
||||
}
|
||||
if (col_start < 0 || col_start > MAXCOL) {
|
||||
api_set_error(err, Validation, _("Column value outside range"));
|
||||
return 0;
|
||||
}
|
||||
if (col_end < 0 || col_end > MAXCOL) {
|
||||
col_end = MAXCOL;
|
||||
}
|
||||
|
||||
int hlg_id = syn_name2id((char_u*)hl_group.data);
|
||||
src_id = bufhl_add_hl(buf, (int)src_id, hlg_id, (linenr_T)line+1,
|
||||
(colnr_T)col_start+1, (colnr_T)col_end);
|
||||
return src_id;
|
||||
}
|
||||
|
||||
/// Clears highlights from a given source group and a range of lines
|
||||
///
|
||||
/// To clear a source group in the entire buffer, pass in 1 and -1 to
|
||||
/// line_start and line_end respectively.
|
||||
///
|
||||
/// @param buffer The buffer handle
|
||||
/// @param src_id Highlight source group to clear, or -1 to clear all groups.
|
||||
/// @param line_start Start of range of lines to clear
|
||||
/// @param line_end End of range of lines to clear (exclusive)
|
||||
/// or -1 to clear to end of file.
|
||||
/// @param[out] err Details of an error that may have occurred
|
||||
void buffer_clear_highlight(Buffer buffer,
|
||||
Integer src_id,
|
||||
Integer line_start,
|
||||
Integer line_end,
|
||||
Error *err)
|
||||
{
|
||||
buf_T *buf = find_buffer_by_handle(buffer, err);
|
||||
if (!buf) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (line_start < 0 || line_start >= MAXLNUM) {
|
||||
api_set_error(err, Validation, _("Line number outside range"));
|
||||
return;
|
||||
}
|
||||
if (line_end < 0 || line_end > MAXLNUM) {
|
||||
line_end = MAXLNUM;
|
||||
}
|
||||
|
||||
bufhl_clear_line_range(buf, (int)src_id, (int)line_start+1, (int)line_end);
|
||||
}
|
||||
|
||||
// Check if deleting lines made the cursor position invalid.
|
||||
// Changed the lines from "lo" to "hi" and added "extra" lines (negative if
|
||||
@ -538,20 +753,26 @@ static void fix_cursor(linenr_T lo, linenr_T hi, linenr_T extra)
|
||||
}
|
||||
|
||||
// Normalizes 0-based indexes to buffer line numbers
|
||||
static int64_t normalize_index(buf_T *buf, int64_t index)
|
||||
static int64_t normalize_index(buf_T *buf, int64_t index, bool *oob)
|
||||
{
|
||||
int64_t line_count = buf->b_ml.ml_line_count;
|
||||
// Fix if < 0
|
||||
index = index < 0 ? buf->b_ml.ml_line_count + index : index;
|
||||
index = index < 0 ? line_count + index +1 : index;
|
||||
|
||||
// Check for oob
|
||||
if (index > line_count) {
|
||||
*oob = true;
|
||||
index = line_count;
|
||||
} else if (index < 0) {
|
||||
*oob = true;
|
||||
index = 0;
|
||||
}
|
||||
// Convert the index to a vim line number
|
||||
index++;
|
||||
// Fix if > line_count
|
||||
index = index > buf->b_ml.ml_line_count ? buf->b_ml.ml_line_count : index;
|
||||
return index;
|
||||
}
|
||||
|
||||
// Returns true if the 0-indexed `index` is within the 1-indexed buffer bounds.
|
||||
static bool inbounds(buf_T *buf, int64_t index)
|
||||
static int64_t convert_index(int64_t index)
|
||||
{
|
||||
linenr_T nlines = buf->b_ml.ml_line_count;
|
||||
return index >= -nlines && index < nlines;
|
||||
return index < 0 ? index - 1 : index;
|
||||
}
|
||||
|
@ -99,4 +99,3 @@ struct key_value_pair {
|
||||
|
||||
|
||||
#endif // NVIM_API_PRIVATE_DEFS_H
|
||||
|
||||
|
@ -90,14 +90,17 @@ Object dict_get_value(dict_T *dict, String key, Error *err)
|
||||
}
|
||||
|
||||
/// Set a value in a dict. Objects are recursively expanded into their
|
||||
/// vimscript equivalents. Passing 'nil' as value deletes the key.
|
||||
/// vimscript equivalents.
|
||||
///
|
||||
/// @param dict The vimscript dict
|
||||
/// @param key The key
|
||||
/// @param value The new value
|
||||
/// @param del Delete key in place of setting it. Argument `value` is ignored in
|
||||
/// this case.
|
||||
/// @param[out] err Details of an error that may have occurred
|
||||
/// @return the old value, if any
|
||||
Object dict_set_value(dict_T *dict, String key, Object value, Error *err)
|
||||
Object dict_set_value(dict_T *dict, String key, Object value, bool del,
|
||||
Error *err)
|
||||
{
|
||||
Object rv = OBJECT_INIT;
|
||||
|
||||
@ -118,7 +121,7 @@ Object dict_set_value(dict_T *dict, String key, Object value, Error *err)
|
||||
|
||||
dictitem_T *di = dict_find(dict, (uint8_t *)key.data, (int)key.size);
|
||||
|
||||
if (value.type == kObjectTypeNil) {
|
||||
if (del) {
|
||||
// Delete the key
|
||||
if (di == NULL) {
|
||||
// Doesn't exist, fail
|
||||
@ -397,13 +400,13 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err)
|
||||
|
||||
switch (obj.type) {
|
||||
case kObjectTypeNil:
|
||||
tv->v_type = VAR_NUMBER;
|
||||
tv->vval.v_number = 0;
|
||||
tv->v_type = VAR_SPECIAL;
|
||||
tv->vval.v_special = kSpecialVarNull;
|
||||
break;
|
||||
|
||||
case kObjectTypeBoolean:
|
||||
tv->v_type = VAR_NUMBER;
|
||||
tv->vval.v_number = obj.data.boolean;
|
||||
tv->v_type = VAR_SPECIAL;
|
||||
tv->vval.v_special = obj.data.boolean? kSpecialVarTrue: kSpecialVarFalse;
|
||||
break;
|
||||
|
||||
case kObjectTypeBuffer:
|
||||
@ -651,6 +654,21 @@ static Object vim_to_object_rec(typval_T *obj, PMap(ptr_t) *lookup)
|
||||
}
|
||||
|
||||
switch (obj->v_type) {
|
||||
case VAR_SPECIAL:
|
||||
switch (obj->vval.v_special) {
|
||||
case kSpecialVarTrue:
|
||||
case kSpecialVarFalse: {
|
||||
rv.type = kObjectTypeBoolean;
|
||||
rv.data.boolean = (obj->vval.v_special == kSpecialVarTrue);
|
||||
break;
|
||||
}
|
||||
case kSpecialVarNull: {
|
||||
rv.type = kObjectTypeNil;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case VAR_STRING:
|
||||
rv.type = kObjectTypeString;
|
||||
rv.data.string = cstr_to_string((char *) obj->vval.v_string);
|
||||
@ -730,6 +748,10 @@ static Object vim_to_object_rec(typval_T *obj, PMap(ptr_t) *lookup)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case VAR_UNKNOWN:
|
||||
case VAR_FUNC:
|
||||
break;
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user