mirror of
https://github.com/zoriya/vim.git
synced 2025-12-28 01:48:19 +00:00
Compare commits
323 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d12f5c17be | ||
|
|
28c258fd24 | ||
|
|
7df351eb8a | ||
|
|
09df3127f4 | ||
|
|
33aec765bd | ||
|
|
71fe80dddd | ||
|
|
66fa271a25 | ||
|
|
0ac9379acf | ||
|
|
c716c306e9 | ||
|
|
b1b715d1fb | ||
|
|
b71eaaeaa8 | ||
|
|
2d3f489e09 | ||
|
|
8ada17c4d9 | ||
|
|
05a7bb363b | ||
|
|
c32840f267 | ||
|
|
04dbce064e | ||
|
|
316059c019 | ||
|
|
ea8bd73212 | ||
|
|
a40ceaf88a | ||
|
|
4770d09abd | ||
|
|
1cbe5f739d | ||
|
|
c7486e034e | ||
|
|
86e01085a1 | ||
|
|
371baa928d | ||
|
|
ebefac63f3 | ||
|
|
cc984263d7 | ||
|
|
0ce33f34a4 | ||
|
|
8fa0445c4f | ||
|
|
5c2f050d91 | ||
|
|
f4cd3e8074 | ||
|
|
bb1004ee56 | ||
|
|
a9b1e74b5d | ||
|
|
195d6357b4 | ||
|
|
46b8015066 | ||
|
|
e3226be91a | ||
|
|
d35f9711d4 | ||
|
|
da1b1a7357 | ||
|
|
3b18181f28 | ||
|
|
acf534595b | ||
|
|
97d29a1ace | ||
|
|
146522e760 | ||
|
|
83c465c705 | ||
|
|
12033fb4bf | ||
|
|
bca84a12bd | ||
|
|
38f1825274 | ||
|
|
61da4986dd | ||
|
|
6496966ad1 | ||
|
|
b2c2efa53a | ||
|
|
c6d8db78b1 | ||
|
|
b0bf8580c3 | ||
|
|
900b4d77f0 | ||
|
|
2c7a29c7fd | ||
|
|
5b962cf71c | ||
|
|
63a121b750 | ||
|
|
b348038631 | ||
|
|
292ad19e92 | ||
|
|
cdbac1ee33 | ||
|
|
cc016f5410 | ||
|
|
e5180526fd | ||
|
|
24552beda0 | ||
|
|
43abc52195 | ||
|
|
ba930509b0 | ||
|
|
18f9a79673 | ||
|
|
77197e44d6 | ||
|
|
d5bc83f576 | ||
|
|
4e330bbf21 | ||
|
|
b815dac061 | ||
|
|
be79f90adc | ||
|
|
e64ac77a28 | ||
|
|
241a8aaa48 | ||
|
|
9372a11ca6 | ||
|
|
cef9dcc37e | ||
|
|
943d2b5b80 | ||
|
|
f4d1145328 | ||
|
|
c6039d8fcb | ||
|
|
bba577a242 | ||
|
|
36c31f71ad | ||
|
|
9835862c81 | ||
|
|
a39571032c | ||
|
|
c64d13ad5b | ||
|
|
16d8f87b45 | ||
|
|
5fe38612c9 | ||
|
|
3d2381ec09 | ||
|
|
b4d392824a | ||
|
|
12625caaa3 | ||
|
|
1afcace307 | ||
|
|
c20658076d | ||
|
|
a5792f5890 | ||
|
|
af289d333a | ||
|
|
a5fac54aea | ||
|
|
61036991ab | ||
|
|
8349fd7c7e | ||
|
|
784c614cb1 | ||
|
|
95b28ecc4a | ||
|
|
202795bed4 | ||
|
|
a5fb28b609 | ||
|
|
d5cdbeb8dd | ||
|
|
196dfbcca1 | ||
|
|
ac30844d60 | ||
|
|
4b77947252 | ||
|
|
8d4f404a7b | ||
|
|
9b9714bee4 | ||
|
|
761b1131b8 | ||
|
|
07d4d7328a | ||
|
|
1c7715dfe4 | ||
|
|
bb15b65864 | ||
|
|
69e0ff94dc | ||
|
|
c54b8a78fa | ||
|
|
f25fd51b89 | ||
|
|
4effc80a8c | ||
|
|
482aaeb058 | ||
|
|
4463f296d0 | ||
|
|
1e01546026 | ||
|
|
bfd8fc0529 | ||
|
|
60a795aad6 | ||
|
|
6b730e111c | ||
|
|
58071af793 | ||
|
|
ab194816fe | ||
|
|
cd292719e0 | ||
|
|
4c903f9891 | ||
|
|
e6facf9490 | ||
|
|
f75a963eea | ||
|
|
5e0d6678ad | ||
|
|
6efa2b30f4 | ||
|
|
dcca87b394 | ||
|
|
578b49e4f7 | ||
|
|
32330d3c67 | ||
|
|
d43b6cf7de | ||
|
|
a4a0838802 | ||
|
|
e7eb9df59a | ||
|
|
a5373faa17 | ||
|
|
7ca3043e1e | ||
|
|
7bb4c6e3f6 | ||
|
|
caa0fcfa6b | ||
|
|
4615234489 | ||
|
|
ffb8ab0402 | ||
|
|
d1231f991a | ||
|
|
cafda4f893 | ||
|
|
4440382f3c | ||
|
|
dd2436f352 | ||
|
|
92d640fad1 | ||
|
|
8b96d64cb5 | ||
|
|
e344bead3e | ||
|
|
da2303d96b | ||
|
|
ac6e65f88d | ||
|
|
81f1ecbc4d | ||
|
|
955295684b | ||
|
|
6e7c7f3a19 | ||
|
|
5bcb2eba3d | ||
|
|
6de6853ce3 | ||
|
|
a2036d2b48 | ||
|
|
6f16eb817b | ||
|
|
7862282f2e | ||
|
|
a6c840d7d4 | ||
|
|
e52325c254 | ||
|
|
d52d9741ee | ||
|
|
90915b5d48 | ||
|
|
50c8195012 | ||
|
|
cee5560a4b | ||
|
|
d12a132603 | ||
|
|
8aff23a13e | ||
|
|
5195e45609 | ||
|
|
5b8d8fdb52 | ||
|
|
ae5bce1c12 | ||
|
|
90cfdbe040 | ||
|
|
e5b8e3d3c6 | ||
|
|
8c45cdf4cf | ||
|
|
488c6512d9 | ||
|
|
8b1e71fa25 | ||
|
|
8b59de9f2f | ||
|
|
0fa313a718 | ||
|
|
c388fbf9d9 | ||
|
|
670f9312cc | ||
|
|
aba2f487ff | ||
|
|
4f574c8ab1 | ||
|
|
329cc7e429 | ||
|
|
8af244281c | ||
|
|
f57907ec2c | ||
|
|
f6cf987574 | ||
|
|
648120b750 | ||
|
|
572cb561ac | ||
|
|
86eb7a2c03 | ||
|
|
0be6e647d1 | ||
|
|
1d94f9b30e | ||
|
|
04a09c1975 | ||
|
|
83bab71b3c | ||
|
|
d314b2519b | ||
|
|
ecf07c8910 | ||
|
|
78984f503c | ||
|
|
53805d1eaa | ||
|
|
34cf2f5f49 | ||
|
|
25ceb22747 | ||
|
|
5a8684e782 | ||
|
|
3a6c56e422 | ||
|
|
403bd9487a | ||
|
|
4be06f9e1b | ||
|
|
661b182095 | ||
|
|
cfc7d63267 | ||
|
|
87e25fdf80 | ||
|
|
231334e6ef | ||
|
|
027436338b | ||
|
|
c013cb66a6 | ||
|
|
81366db6d6 | ||
|
|
65de869c4f | ||
|
|
58d9823409 | ||
|
|
b01585904a | ||
|
|
d8c0087cce | ||
|
|
63b3ce8757 | ||
|
|
342337a1a0 | ||
|
|
4536002e30 | ||
|
|
a3ffd9c780 | ||
|
|
80fc04348a | ||
|
|
87b774daf2 | ||
|
|
84fb85aaf6 | ||
|
|
fd6e52886b | ||
|
|
7b30e18223 | ||
|
|
0e634daa95 | ||
|
|
84110acb60 | ||
|
|
6a9aa37a3e | ||
|
|
9fad308621 | ||
|
|
ff6f061a9d | ||
|
|
d6c04cd66a | ||
|
|
6c131c43ff | ||
|
|
e7c5a15631 | ||
|
|
f8c07b2712 | ||
|
|
ce0842a6ee | ||
|
|
bbebc85750 | ||
|
|
fe3ca8ddd9 | ||
|
|
b635633989 | ||
|
|
e759a7aa9a | ||
|
|
8d34330fe5 | ||
|
|
1f28b07867 | ||
|
|
5eba4c2daf | ||
|
|
a40058acc7 | ||
|
|
3b56eb3d31 | ||
|
|
9ff7011bcb | ||
|
|
d8e9bb2090 | ||
|
|
35fdbb540a | ||
|
|
a466c99842 | ||
|
|
ac76e4dd91 | ||
|
|
51bab74a87 | ||
|
|
8d7fc6c298 | ||
|
|
e8bb2552eb | ||
|
|
045e82deef | ||
|
|
63b80986ac | ||
|
|
ec8a10a4e4 | ||
|
|
97409f1261 | ||
|
|
8e735a17f8 | ||
|
|
42332f5856 | ||
|
|
dc27ac1c5e | ||
|
|
bfb2006fd5 | ||
|
|
551f84f4e8 | ||
|
|
1756879365 | ||
|
|
53180ce2e7 | ||
|
|
dfb9ac0021 | ||
|
|
0dc065ee7c | ||
|
|
7d1f5dbc0a | ||
|
|
51ac12f683 | ||
|
|
0d9c26dd83 | ||
|
|
f9184a1d31 | ||
|
|
0f7d31ad83 | ||
|
|
1f8a5f0eac | ||
|
|
ba4128faa3 | ||
|
|
7887d88a9f | ||
|
|
505e82870e | ||
|
|
7fae636fc8 | ||
|
|
d042c56e34 | ||
|
|
e6b165e0f4 | ||
|
|
9c96f592af | ||
|
|
42eeac3552 | ||
|
|
24bbcfe8fe | ||
|
|
d7b31706f7 | ||
|
|
a1ba811ac9 | ||
|
|
9a50b1bf21 | ||
|
|
39a58ca3d4 | ||
|
|
d4098f5f19 | ||
|
|
702517dd70 | ||
|
|
b61d40504e | ||
|
|
cf6bf39f68 | ||
|
|
238f4fa798 | ||
|
|
d9fba318b8 | ||
|
|
80b29f273d | ||
|
|
1e498f5e5d | ||
|
|
0017fc52cb | ||
|
|
4eec5ec8ce | ||
|
|
f461c8e7f8 | ||
|
|
ea408854a8 | ||
|
|
29a1c1d374 | ||
|
|
1ec484f58e | ||
|
|
0a5fe2140d | ||
|
|
c4def13f8b | ||
|
|
3b506942eb | ||
|
|
47cc752267 | ||
|
|
f417f2b6af | ||
|
|
f81b0fe011 | ||
|
|
6ad01d6077 | ||
|
|
30abd28f16 | ||
|
|
d114dbee50 | ||
|
|
0c40586a7b | ||
|
|
0dd492fdd5 | ||
|
|
d857f0e0f4 | ||
|
|
3f77047607 | ||
|
|
25414f2917 | ||
|
|
e13305e3be | ||
|
|
3c2def6bd2 | ||
|
|
1d73c88503 | ||
|
|
92124a33fd | ||
|
|
b2ec307fc6 | ||
|
|
e756604ff5 | ||
|
|
f7bbbc506e | ||
|
|
8db7318c2a | ||
|
|
520470a9d6 | ||
|
|
6bab4d1fd7 | ||
|
|
cf851ce930 | ||
|
|
ea424166e2 | ||
|
|
78599adb52 | ||
|
|
c998e3c16e | ||
|
|
f3bd51a172 | ||
|
|
a41461e061 | ||
|
|
8348ea624c | ||
|
|
9f30f50471 | ||
|
|
9ba0eb850c | ||
|
|
bac97eb8ae |
49
Filelist
49
Filelist
@@ -2,7 +2,7 @@
|
||||
# Used by Makefile and upload.aap.
|
||||
|
||||
# source files for all source archives
|
||||
SRC_ALL1 = \
|
||||
SRC_ALL = \
|
||||
src/README.txt \
|
||||
src/arabic.c \
|
||||
src/arabic.h \
|
||||
@@ -30,6 +30,7 @@ SRC_ALL1 = \
|
||||
src/gui.h \
|
||||
src/gui_beval.c \
|
||||
src/gui_beval.h \
|
||||
src/hardcopy.c \
|
||||
src/hashtable.c \
|
||||
src/keymap.h \
|
||||
src/macros.h \
|
||||
@@ -51,6 +52,7 @@ SRC_ALL1 = \
|
||||
src/ops.c \
|
||||
src/option.c \
|
||||
src/option.h \
|
||||
src/popupmenu.c \
|
||||
src/quickfix.c \
|
||||
src/regexp.c \
|
||||
src/regexp.h \
|
||||
@@ -70,13 +72,12 @@ SRC_ALL1 = \
|
||||
src/vim.h \
|
||||
src/window.c \
|
||||
src/xxd/xxd.c \
|
||||
|
||||
SRC_ALL2 = \
|
||||
src/main.aap \
|
||||
src/testdir/main.aap \
|
||||
src/testdir/*.in \
|
||||
src/testdir/test[0-9]*.ok \
|
||||
src/testdir/test49.vim \
|
||||
src/testdir/test60.vim \
|
||||
src/proto.h \
|
||||
src/proto/buffer.pro \
|
||||
src/proto/charset.pro \
|
||||
@@ -94,6 +95,7 @@ SRC_ALL2 = \
|
||||
src/proto/getchar.pro \
|
||||
src/proto/gui.pro \
|
||||
src/proto/gui_beval.pro \
|
||||
src/proto/hardcopy.pro \
|
||||
src/proto/hashtable.pro \
|
||||
src/proto/main.pro \
|
||||
src/proto/mark.pro \
|
||||
@@ -109,6 +111,7 @@ SRC_ALL2 = \
|
||||
src/proto/normal.pro \
|
||||
src/proto/ops.pro \
|
||||
src/proto/option.pro \
|
||||
src/proto/popupmenu.pro \
|
||||
src/proto/quickfix.pro \
|
||||
src/proto/regexp.pro \
|
||||
src/proto/screen.pro \
|
||||
@@ -122,8 +125,6 @@ SRC_ALL2 = \
|
||||
src/proto/undo.pro \
|
||||
src/proto/version.pro \
|
||||
src/proto/window.pro \
|
||||
src/spell/*.diff \
|
||||
src/spell/Makefile \
|
||||
|
||||
|
||||
# source files for Unix only
|
||||
@@ -136,7 +137,6 @@ SRC_UNIX = \
|
||||
pixmaps/gen-inline-pixbufs.sh \
|
||||
pixmaps/stock_icons.h \
|
||||
src/INSTALL \
|
||||
src/INSTALLkde.txt \
|
||||
src/Makefile \
|
||||
src/auto/configure \
|
||||
src/config.aap.in \
|
||||
@@ -153,11 +153,6 @@ SRC_UNIX = \
|
||||
src/gui_gtk_f.c \
|
||||
src/gui_gtk_f.h \
|
||||
src/gui_gtk_x11.c \
|
||||
src/gui_kde.cc \
|
||||
src/gui_kde_wid.cc \
|
||||
src/gui_kde_wid.h \
|
||||
src/gui_kde_x11.cc \
|
||||
src/kvim_iface.h \
|
||||
src/gui_motif.c \
|
||||
src/gui_xmdlg.c \
|
||||
src/gui_xmebw.c \
|
||||
@@ -183,8 +178,6 @@ SRC_UNIX = \
|
||||
src/proto/gui_athena.pro \
|
||||
src/proto/gui_gtk.pro \
|
||||
src/proto/gui_gtk_x11.pro \
|
||||
src/proto/gui_kde.pro \
|
||||
src/proto/gui_kde_x11.pro \
|
||||
src/proto/gui_motif.pro \
|
||||
src/proto/gui_xmdlg.pro \
|
||||
src/proto/gui_x11.pro \
|
||||
@@ -217,6 +210,7 @@ SRC_DOS_UNIX = \
|
||||
src/if_perlsfio.c \
|
||||
src/if_python.c \
|
||||
src/if_ruby.c \
|
||||
src/if_sniff.h \
|
||||
src/if_tcl.c \
|
||||
src/proto/if_cscope.pro \
|
||||
src/proto/if_mzsch.pro \
|
||||
@@ -362,21 +356,15 @@ SRC_AMI = \
|
||||
# source files for the Mac (also in the extra archive)
|
||||
SRC_MAC = \
|
||||
src/INSTALLmac.txt \
|
||||
src/Make_mpw.mak \
|
||||
src/dehqx.py \
|
||||
src/gui_mac.c \
|
||||
src/gui_mac.icns \
|
||||
src/gui_mac.r \
|
||||
src/os_mac.build \
|
||||
src/os_mac.c \
|
||||
src/os_mac.h \
|
||||
src/os_mac.rsr.hqx \
|
||||
src/os_mac.sit.hqx \
|
||||
src/os_mac_conv.c \
|
||||
src/os_macosx.c \
|
||||
src/os_mac.pbproj/project.pbxproj \
|
||||
src/proto/gui_mac.pro \
|
||||
src/proto/os_mac.pro \
|
||||
src/proto/os_mac_conv.pro \
|
||||
|
||||
# source files for VMS (in the extra archive)
|
||||
SRC_VMS = \
|
||||
@@ -426,7 +414,6 @@ SRC_EXTRA = \
|
||||
src/gui_riscos.c \
|
||||
src/gui_riscos.h \
|
||||
src/if_sniff.c \
|
||||
src/if_sniff.h \
|
||||
src/infplist.xml \
|
||||
src/link.390 \
|
||||
src/os_beos.c \
|
||||
@@ -458,6 +445,7 @@ RT_ALL = \
|
||||
runtime/gvimrc_example.vim \
|
||||
runtime/macros/README.txt \
|
||||
runtime/macros/dvorak \
|
||||
runtime/macros/editexisting.vim \
|
||||
runtime/macros/hanoi/click.me \
|
||||
runtime/macros/hanoi/hanoi.vim \
|
||||
runtime/macros/hanoi/poster \
|
||||
@@ -511,6 +499,8 @@ RT_SCRIPTS = \
|
||||
runtime/delmenu.vim \
|
||||
runtime/synmenu.vim \
|
||||
runtime/makemenu.vim \
|
||||
runtime/autoload/*.vim \
|
||||
runtime/autoload/README.txt \
|
||||
runtime/colors/*.vim \
|
||||
runtime/colors/README.txt \
|
||||
runtime/compiler/*.vim \
|
||||
@@ -530,10 +520,6 @@ RT_UNIX = \
|
||||
runtime/KVim.desktop \
|
||||
runtime/hi16-action-make.png \
|
||||
runtime/hi22-action-make.png \
|
||||
runtime/kde-tips \
|
||||
runtime/kvim32x32.png \
|
||||
runtime/kvim48x48.png \
|
||||
runtime/kvim64x64.png \
|
||||
runtime/vim16x16.png \
|
||||
runtime/vim16x16.xpm \
|
||||
runtime/vim32x32.png \
|
||||
@@ -682,22 +668,35 @@ LANG_GEN = \
|
||||
runtime/tutor/tutor.ko.* \
|
||||
runtime/tutor/tutor.pl.* \
|
||||
runtime/tutor/tutor.ru.* \
|
||||
runtime/tutor/tutor.sk.* \
|
||||
runtime/tutor/tutor.zh.* \
|
||||
runtime/spell/README.txt \
|
||||
runtime/spell/??/*.diff \
|
||||
runtime/spell/??/main.aap \
|
||||
runtime/spell/yi/README.txt \
|
||||
runtime/spell/main.aap \
|
||||
runtime/spell/*.vim \
|
||||
runtime/spell/fixdup \
|
||||
|
||||
# generic language files, binary
|
||||
LANG_GEN_BIN = \
|
||||
runtime/spell/README_en.txt \
|
||||
runtime/spell/en.ascii.spl \
|
||||
runtime/spell/en.latin1.spl \
|
||||
runtime/spell/en.utf-8.spl \
|
||||
runtime/spell/en.ascii.sug \
|
||||
runtime/spell/en.latin1.sug \
|
||||
runtime/spell/en.utf-8.sug \
|
||||
|
||||
# all files for lang archive
|
||||
LANG_SRC = \
|
||||
src/po/README.txt \
|
||||
src/po/README_mingw.txt \
|
||||
src/po/README_mvc.txt \
|
||||
src/po/check.vim \
|
||||
src/po/cleanup.vim \
|
||||
src/po/Makefile \
|
||||
src/po/Make_cyg.mak \
|
||||
src/po/Make_ming.mak \
|
||||
src/po/Make_mvc.mak \
|
||||
src/po/sjiscorr.c \
|
||||
|
||||
75
Makefile
75
Makefile
@@ -37,8 +37,6 @@ all install uninstall tools config configure proto depend lint tags types test t
|
||||
#
|
||||
# TARGET PRODUCES CONTAINS
|
||||
# unixall vim-#.#.tar.bz2 Runtime files and Sources for Unix
|
||||
# unixrt vim-#.#-rt[12].tar.gz Runtime files for Unix
|
||||
# unixsrc vim-#.#-src[12].tar.gz Sources for Unix
|
||||
#
|
||||
# extra vim-#.#-extra.tar.gz Extra source and runtime files
|
||||
# lang vim-#.#-lang.tar.gz multi-language files
|
||||
@@ -66,12 +64,12 @@ all install uninstall tools config configure proto depend lint tags types test t
|
||||
#
|
||||
# All output files are created in the "dist" directory. Existing files are
|
||||
# overwritten!
|
||||
# To do all this you need the unixrt, unixsrc, extra and lang archives, and
|
||||
# To do all this you need the unix, extra and lang archives, and
|
||||
# compiled binaries.
|
||||
# Before creating an archive first delete all backup files, *.orig, etc.
|
||||
|
||||
MAJOR = 6
|
||||
MINOR = 3
|
||||
MAJOR = 7
|
||||
MINOR = 0aa
|
||||
|
||||
# Uncomment this line if the Win32s version is to be included.
|
||||
#DOSBIN_S = dosbin_s
|
||||
@@ -80,10 +78,11 @@ MINOR = 3
|
||||
#
|
||||
# - Update Vim version number. For a test version in: src/version.h, Contents,
|
||||
# MAJOR/MINOR above, VIMRTDIR and VERSION in src/Makefile, README*.txt,
|
||||
# runtime/doc/*.txt and nsis/gvim.nsi. For a minor/major version:
|
||||
# src/GvimExt/GvimExt.reg, src/vim16.def.
|
||||
# runtime/doc/*.txt and nsis/gvim.nsi. Other things in README_os2.txt. For a
|
||||
# minor/major version: src/GvimExt/GvimExt.reg, src/vim.def, src/vim16.def.
|
||||
# - Correct included_patches[] in src/version.c.
|
||||
# - Compile Vim with GTK, Perl, Python, TCL, Ruby, Cscope and "huge" features.
|
||||
# - Compile Vim with GTK, Perl, Python, TCL, Ruby, MZscheme, Cscope and "huge"
|
||||
# features. Exclude workshop and SNiFF.
|
||||
# - With these features: "make proto" (requires cproto and Motif installed;
|
||||
# ignore warnings for missing include files, fix problems for syntax errors).
|
||||
# - With these features: "make depend" (works best with gcc).
|
||||
@@ -125,7 +124,7 @@ MINOR = 3
|
||||
# "uninstald16.exe".
|
||||
# 32 bit DOS version:
|
||||
# - Set environment for compiling with DJGPP; "gmake -f Make_djg.mak".
|
||||
# - "rm testdir/*.out", "make -f Make_djg.mak test" and check the output.
|
||||
# - "rm testdir/*.out", "gmake -f Make_djg.mak test" and check the output.
|
||||
# - Rename the executables to "vimd32.exe", "xxdd32.exe", "installd32.exe" and
|
||||
# "uninstald32.exe".
|
||||
# Win32 console version:
|
||||
@@ -262,10 +261,8 @@ dist/$(COMMENT_FARSI): dist/comment
|
||||
dist/$(COMMENT_LANG): dist/comment
|
||||
echo "Vim - Vi IMproved - v$(VDOT) MS-Windows language files" > dist/$(COMMENT_LANG)
|
||||
|
||||
unixrt: dist prepare
|
||||
-rm -f dist/$(VIMVER)-rt1.tar.gz
|
||||
-rm -f dist/$(VIMVER)-rt2.tar.gz
|
||||
# first runtime file
|
||||
unixall: dist prepare
|
||||
-rm -f dist/$(VIMVER).tar.bz2
|
||||
-rm -rf dist/$(VIMRTDIR)
|
||||
mkdir dist/$(VIMRTDIR)
|
||||
tar cf - \
|
||||
@@ -273,36 +270,10 @@ unixrt: dist prepare
|
||||
$(RT_ALL_BIN) \
|
||||
$(RT_UNIX) \
|
||||
$(RT_UNIX_DOS_BIN) \
|
||||
| (cd dist/$(VIMRTDIR); tar xf -)
|
||||
cd dist && tar cf $(VIMVER)-rt1.tar $(VIMRTDIR)
|
||||
gzip -9 dist/$(VIMVER)-rt1.tar
|
||||
# second runtime file (script and language files)
|
||||
-rm -rf dist/$(VIMRTDIR)
|
||||
mkdir dist/$(VIMRTDIR)
|
||||
tar cf - \
|
||||
$(RT_SCRIPTS) \
|
||||
$(LANG_GEN) \
|
||||
$(LANG_GEN_BIN) \
|
||||
| (cd dist/$(VIMRTDIR); tar xf -)
|
||||
cd dist && tar cf $(VIMVER)-rt2.tar $(VIMRTDIR)
|
||||
gzip -9 dist/$(VIMVER)-rt2.tar
|
||||
|
||||
unixsrc: dist prepare
|
||||
-rm -f dist/$(VIMVER)-src1.tar.gz
|
||||
-rm -f dist/$(VIMVER)-src2.tar.gz
|
||||
# first source file
|
||||
-rm -rf dist/$(VIMRTDIR)
|
||||
mkdir dist/$(VIMRTDIR)
|
||||
tar cf - \
|
||||
$(SRC_ALL1) \
|
||||
| (cd dist/$(VIMRTDIR); tar xf -)
|
||||
cd dist && tar cf $(VIMVER)-src1.tar $(VIMRTDIR)
|
||||
gzip -9 dist/$(VIMVER)-src1.tar
|
||||
# second source file
|
||||
-rm -rf dist/$(VIMRTDIR)
|
||||
mkdir dist/$(VIMRTDIR)
|
||||
tar cf - \
|
||||
$(SRC_ALL2) \
|
||||
$(SRC_ALL) \
|
||||
$(SRC_UNIX) \
|
||||
$(SRC_DOS_UNIX) \
|
||||
| (cd dist/$(VIMRTDIR); tar xf -)
|
||||
@@ -310,21 +281,6 @@ unixsrc: dist prepare
|
||||
cp -f src/config.mk.dist dist/$(VIMRTDIR)/src/auto/config.mk
|
||||
# Create an empty config.h file, make dependencies require it
|
||||
touch dist/$(VIMRTDIR)/src/auto/config.h
|
||||
# Make sure configure is newer than config.mk to force it to be generated
|
||||
touch dist/$(VIMRTDIR)/src/configure
|
||||
cd dist && tar cf $(VIMVER)-src2.tar $(VIMRTDIR)
|
||||
gzip -9 dist/$(VIMVER)-src2.tar
|
||||
|
||||
unixall: dist unixsrc unixrt
|
||||
-rm -f dist/$(VIMVER).tar.bz2
|
||||
-rm -rf dist/$(VIMRTDIR)
|
||||
mkdir dist/$(VIMRTDIR)
|
||||
cd dist && tar xfz $(VIMVER)-src1.tar.gz
|
||||
cd dist && tar xfz $(VIMVER)-src2.tar.gz
|
||||
cd dist && tar xfz $(VIMVER)-rt1.tar.gz
|
||||
cd dist && tar xfz $(VIMVER)-rt2.tar.gz
|
||||
# Create an empty config.h file, make dependencies require it
|
||||
touch dist/$(VIMRTDIR)/src/auto/config.h
|
||||
# Make sure configure is newer than config.mk to force it to be generated
|
||||
touch dist/$(VIMRTDIR)/src/configure
|
||||
cd dist && tar cf $(VIMVER).tar $(VIMRTDIR)
|
||||
@@ -405,8 +361,7 @@ amisrc: dist prepare
|
||||
mkdir dist/Vim/$(VIMRTDIR)
|
||||
tar cf - \
|
||||
$(ROOT_AMI) \
|
||||
$(SRC_ALL1) \
|
||||
$(SRC_ALL2) \
|
||||
$(SRC_ALL) \
|
||||
$(SRC_AMI) \
|
||||
$(SRC_AMI_DOS) \
|
||||
| (cd dist/Vim/$(VIMRTDIR); tar xf -)
|
||||
@@ -423,12 +378,15 @@ dosrt: dist dist/$(COMMENT_RT) dosrt_unix2dos
|
||||
-rm -rf dist/vim$(VERSION)rt.zip
|
||||
cd dist && zip -9 -rD -z vim$(VERSION)rt.zip vim <$(COMMENT_RT)
|
||||
|
||||
# Split in two parts to avoid a "argument list too long" error.
|
||||
dosrt_unix2dos: dist prepare no_title.vim
|
||||
-rm -rf dist/vim
|
||||
mkdir dist/vim
|
||||
mkdir dist/vim/$(VIMRTDIR)
|
||||
tar cf - \
|
||||
$(RT_ALL) \
|
||||
| (cd dist/vim/$(VIMRTDIR); tar xf -)
|
||||
tar cf - \
|
||||
$(RT_SCRIPTS) \
|
||||
$(RT_DOS) \
|
||||
$(RT_NO_UNIX) \
|
||||
@@ -590,8 +548,7 @@ dossrc: dist no_title.vim dist/$(COMMENT_SRC) runtime/doc/uganda.nsis.txt
|
||||
mkdir dist/vim
|
||||
mkdir dist/vim/$(VIMRTDIR)
|
||||
tar cf - \
|
||||
$(SRC_ALL1) \
|
||||
$(SRC_ALL2) \
|
||||
$(SRC_ALL) \
|
||||
$(SRC_DOS) \
|
||||
$(SRC_AMI_DOS) \
|
||||
$(SRC_DOS_UNIX) \
|
||||
|
||||
@@ -5,28 +5,28 @@ See "README.txt" for general information about Vim.
|
||||
|
||||
|
||||
NOTE: You will need two archives:
|
||||
vim62rt.zip contains the runtime files (same as for the PC version)
|
||||
vim62os2.zip contains the OS/2 executables
|
||||
vim70rt.zip contains the runtime files (same as for the PC version)
|
||||
vim70os2.zip contains the OS/2 executables
|
||||
|
||||
1. Go to the directory where you want to put the Vim files. Examples:
|
||||
cd C:\
|
||||
cd D:\editors
|
||||
|
||||
2. Unpack the zip archives. This will create a new directory "vim/vim62",
|
||||
2. Unpack the zip archives. This will create a new directory "vim/vim70",
|
||||
in which all the distributed Vim files are placed. Since the directory
|
||||
name includes the version number, it is unlikely that you overwrite
|
||||
existing files.
|
||||
Examples:
|
||||
pkunzip -d vim62os2.zip
|
||||
unzip vim62os2.zip
|
||||
pkunzip -d vim70os2.zip
|
||||
unzip vim70os2.zip
|
||||
|
||||
After you unpacked the files, you can still move the whole directory tree
|
||||
to another location.
|
||||
|
||||
3. Add the directory where vim.exe is to your path. The simplest is to add a
|
||||
line to your autoexec.bat. Examples:
|
||||
set path=%path%;C:\vim\vim62
|
||||
set path=%path%;D:\editors\vim\vim62
|
||||
set path=%path%;C:\vim\vim70
|
||||
set path=%path%;D:\editors\vim\vim70
|
||||
|
||||
That's it!
|
||||
|
||||
@@ -41,10 +41,10 @@ Extra remarks:
|
||||
C:\vim\_viminfo Dynamic info for 'viminfo'.
|
||||
C:\vim\... Other files you made.
|
||||
Distributed files:
|
||||
C:\vim\vim62\vim.exe The Vim version 6.2 executable.
|
||||
C:\vim\vim62\doc\*.txt The version 6.2 documentation files.
|
||||
C:\vim\vim62\bugreport.vim A Vim version 6.2 script.
|
||||
C:\vim\vim62\... Other version 6.2 distributed files.
|
||||
C:\vim\vim70\vim.exe The Vim version 7.0 executable.
|
||||
C:\vim\vim70\doc\*.txt The version 7.0 documentation files.
|
||||
C:\vim\vim70\bugreport.vim A Vim version 7.0 script.
|
||||
C:\vim\vim70\... Other version 7.0 distributed files.
|
||||
In this case the $VIM environment variable would be set like this:
|
||||
set VIM=C:\vim
|
||||
|
||||
|
||||
@@ -14,27 +14,34 @@ To compile Vim yourself you need three archives:
|
||||
vim-X.X-extra.tar.gz extra source files
|
||||
|
||||
Compilation is recommended, in order to make sure that the correct
|
||||
libraries are used for your specific system. However, you might not be
|
||||
able to compile Vim, read more from src/INSTALLvms.txt.
|
||||
libraries are used for your specific system. Read about compiling in
|
||||
src/INSTALLvms.txt.
|
||||
|
||||
To use the binary version, you need one of these archives:
|
||||
|
||||
vim-XX-exe-alpha-gui.zip Alpha GUI/Motif executables
|
||||
vim-XX-exe-alpha-gtk.zip Alpha GUI/GTK executables
|
||||
vim-XX-exe-alpha-term.zip Alpha console executables
|
||||
vim-XX-exe-ia64-gui.zip IA64 GUI/Motif executables
|
||||
vim-XX-exe-ia64-gtk.zip IA64 GUI/GTK executables
|
||||
vim-XX-exe-ia64-term.zip IA64 console executables
|
||||
vim-XX-exe-axp-gui.zip Alpha GUI/Motif executables
|
||||
vim-XX-exe-axp-gtk.zip Alpha GUI/GTK executables
|
||||
vim-XX-exe-axp-term.zip Alpha console executables
|
||||
vim-XX-exe-vax-gui.zip VAX GUI executables
|
||||
vim-XX-exe-vax-term.zip VAX console executables
|
||||
vim-XX-exe-vax-term.zip VAX console executables
|
||||
|
||||
and of course
|
||||
vim-XX-runtime.zip runtime files
|
||||
|
||||
The binary archives contain: vim.exe, ctags.exe, xxd.exe, mms_vim.exe files,
|
||||
The binary archives contain: vim.exe, ctags.exe, xxd.exe files,
|
||||
but there are also prepared "deploy ready" archives:
|
||||
|
||||
vim-XX-alpha.zip GUI and console executables with runtime and
|
||||
help files for Alpha systems
|
||||
vim-XX-vax.zip GUI and console executables with runtime and
|
||||
help files for VAX systems
|
||||
vim-XX-ia64.zip GUI and console executables with runtime and
|
||||
help files for IA64 systems
|
||||
vim-XX-axp.zip GUI and console executables with runtime and
|
||||
help files for Alpha systems
|
||||
vim-XX-vax.zip GUI and console executables with runtime and
|
||||
help files for VAX systems
|
||||
|
||||
GTK builds need LIBGTK library installed.
|
||||
|
||||
These executables and up to date patches for OpenVMS system are downloadable
|
||||
from http://www.polarhome.com/vim/ or ftp://ftp.polarhome.com/pub/vim/
|
||||
|
||||
15
runtime/autoload/README.txt
Normal file
15
runtime/autoload/README.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
The autoload directory is for standard Vim autoload scripts.
|
||||
|
||||
These are functions used by plugins and for general use. They will be loaded
|
||||
automatically when the function is invoked. See ":help autoload".
|
||||
|
||||
gzip.vim for editing compressed files
|
||||
netrw.vim browsing (remote) directories and editing remote files
|
||||
tar.vim browsing tar files
|
||||
zip.vim browsing zip files
|
||||
|
||||
Occult completion files:
|
||||
ccomplete.vim C
|
||||
csscomplete.vim HTML / CSS
|
||||
htmlcomplete.vim HTML
|
||||
|
||||
257
runtime/autoload/ccomplete.vim
Normal file
257
runtime/autoload/ccomplete.vim
Normal file
@@ -0,0 +1,257 @@
|
||||
" Vim completion script
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2005 Dec 18
|
||||
|
||||
|
||||
" This function is used for the 'omnifunc' option.
|
||||
function! ccomplete#Complete(findstart, base)
|
||||
if a:findstart
|
||||
" Locate the start of the item, including "." and "->".
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
let lastword = -1
|
||||
while start > 0
|
||||
if line[start - 1] =~ '\w'
|
||||
let start -= 1
|
||||
elseif line[start - 1] =~ '\.'
|
||||
if lastword == -1
|
||||
let lastword = start
|
||||
endif
|
||||
let start -= 1
|
||||
elseif start > 1 && line[start - 2] == '-' && line[start - 1] == '>'
|
||||
if lastword == -1
|
||||
let lastword = start
|
||||
endif
|
||||
let start -= 2
|
||||
else
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" Return the column of the last word, which is going to be changed.
|
||||
" Remember the text that comes before it in s:prepended.
|
||||
if lastword == -1
|
||||
let s:prepended = ''
|
||||
return start
|
||||
endif
|
||||
let s:prepended = strpart(line, start, lastword - start)
|
||||
return lastword
|
||||
endif
|
||||
|
||||
" Return list of matches.
|
||||
|
||||
let base = s:prepended . a:base
|
||||
|
||||
" Split item in words, keep empty word after "." or "->".
|
||||
" "aa" -> ['aa'], "aa." -> ['aa', ''], "aa.bb" -> ['aa', 'bb'], etc.
|
||||
let items = split(base, '\.\|->', 1)
|
||||
if len(items) <= 1
|
||||
" Don't do anything for an empty base, would result in all the tags in the
|
||||
" tags file.
|
||||
if base == ''
|
||||
return []
|
||||
endif
|
||||
|
||||
" Only one part, no "." or "->": complete from tags file.
|
||||
" When local completion is wanted CTRL-N would have been used.
|
||||
return map(taglist('^' . base), 'v:val["name"]')
|
||||
endif
|
||||
|
||||
" Find the variable items[0].
|
||||
" 1. in current function (like with "gd")
|
||||
" 2. in tags file(s) (like with ":tag")
|
||||
" 3. in current file (like with "gD")
|
||||
let res = []
|
||||
if searchdecl(items[0], 0, 1) == 0
|
||||
" Found, now figure out the type.
|
||||
" TODO: join previous line if it makes sense
|
||||
let line = getline('.')
|
||||
let col = col('.')
|
||||
let res = s:Nextitem(strpart(line, 0, col), items[1:])
|
||||
endif
|
||||
|
||||
if len(res) == 0
|
||||
" Find the variable in the tags file(s)
|
||||
let diclist = taglist('^' . items[0] . '$')
|
||||
|
||||
let res = []
|
||||
for i in range(len(diclist))
|
||||
" New ctags has the "typename" field.
|
||||
if has_key(diclist[i], 'typename')
|
||||
call extend(res, s:StructMembers(diclist[i]['typename'], items[1:]))
|
||||
endif
|
||||
|
||||
" For a variable use the command, which must be a search pattern that
|
||||
" shows the declaration of the variable.
|
||||
if diclist[i]['kind'] == 'v'
|
||||
let line = diclist[i]['cmd']
|
||||
if line[0] == '/' && line[1] == '^'
|
||||
let col = match(line, '\<' . items[0] . '\>')
|
||||
call extend(res, s:Nextitem(strpart(line, 2, col - 2), items[1:]))
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
if len(res) == 0 && searchdecl(items[0], 1) == 0
|
||||
" Found, now figure out the type.
|
||||
" TODO: join previous line if it makes sense
|
||||
let line = getline('.')
|
||||
let col = col('.')
|
||||
let res = s:Nextitem(strpart(line, 0, col), items[1:])
|
||||
endif
|
||||
|
||||
" If the one and only match was what's already there and it is a composite
|
||||
" type, add a "." or "->".
|
||||
if len(res) == 1 && res[0]['match'] == items[-1] && len(s:SearchMembers(res, [''])) > 0
|
||||
" If there is a '*' before the name use "->".
|
||||
if match(res[0]['tagline'], '\*\s*' . res[0]['match']) > 0
|
||||
let res[0]['match'] .= '->'
|
||||
else
|
||||
let res[0]['match'] .= '.'
|
||||
endif
|
||||
endif
|
||||
|
||||
return map(res, 'v:val["match"]')
|
||||
endfunc
|
||||
|
||||
" Find composing type in "lead" and match items[0] with it.
|
||||
" Repeat this recursively for items[1], if it's there.
|
||||
" Return the list of matches.
|
||||
function! s:Nextitem(lead, items)
|
||||
|
||||
" Use the text up to the variable name and split it in tokens.
|
||||
let tokens = split(a:lead, '\s\+\|\<')
|
||||
|
||||
" Try to recognize the type of the variable. This is rough guessing...
|
||||
let res = []
|
||||
for tidx in range(len(tokens))
|
||||
|
||||
" Recognize "struct foobar" and "union foobar".
|
||||
if (tokens[tidx] == 'struct' || tokens[tidx] == 'union') && tidx + 1 < len(tokens)
|
||||
let res = s:StructMembers(tokens[tidx] . ':' . tokens[tidx + 1], a:items)
|
||||
break
|
||||
endif
|
||||
|
||||
" TODO: add more reserved words
|
||||
if index(['int', 'float', 'static', 'unsigned', 'extern'], tokens[tidx]) >= 0
|
||||
continue
|
||||
endif
|
||||
|
||||
" Use the tags file to find out if this is a typedef.
|
||||
let diclist = taglist('^' . tokens[tidx] . '$')
|
||||
for tagidx in range(len(diclist))
|
||||
" New ctags has the "typename" field.
|
||||
if has_key(diclist[tagidx], 'typename')
|
||||
call extend(res, s:StructMembers(diclist[tagidx]['typename'], a:items))
|
||||
continue
|
||||
endif
|
||||
|
||||
" Only handle typedefs here.
|
||||
if diclist[tagidx]['kind'] != 't'
|
||||
continue
|
||||
endif
|
||||
|
||||
" For old ctags we recognize "typedef struct aaa" and
|
||||
" "typedef union bbb" in the tags file command.
|
||||
let cmd = diclist[tagidx]['cmd']
|
||||
let ei = matchend(cmd, 'typedef\s\+')
|
||||
if ei > 1
|
||||
let cmdtokens = split(strpart(cmd, ei), '\s\+\|\<')
|
||||
if len(cmdtokens) > 1
|
||||
if cmdtokens[0] == 'struct' || cmdtokens[0] == 'union'
|
||||
let name = ''
|
||||
" Use the first identifier after the "struct" or "union"
|
||||
for ti in range(len(cmdtokens) - 1)
|
||||
if cmdtokens[ti] =~ '^\w'
|
||||
let name = cmdtokens[ti]
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if name != ''
|
||||
call extend(res, s:StructMembers(cmdtokens[0] . ':' . name, a:items))
|
||||
endif
|
||||
else
|
||||
" Could be "typedef other_T some_T".
|
||||
call extend(res, s:Nextitem(cmdtokens[0], a:items))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
if len(res) > 0
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res
|
||||
endfunction
|
||||
|
||||
|
||||
" Return a list with resulting matches.
|
||||
" Each match is a dictionary with "match" and "tagline" entries.
|
||||
function! s:StructMembers(typename, items)
|
||||
" Todo: What about local structures?
|
||||
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
|
||||
if fnames == ''
|
||||
return []
|
||||
endif
|
||||
|
||||
let typename = a:typename
|
||||
let qflist = []
|
||||
while 1
|
||||
exe 'silent! vimgrep /\t' . typename . '\(\t\|$\)/j ' . fnames
|
||||
let qflist = getqflist()
|
||||
if len(qflist) > 0 || match(typename, "::") < 0
|
||||
break
|
||||
endif
|
||||
" No match for "struct:context::name", remove "context::" and try again.
|
||||
let typename = substitute(typename, ':[^:]*::', ':', '')
|
||||
endwhile
|
||||
|
||||
let matches = []
|
||||
for l in qflist
|
||||
let memb = matchstr(l['text'], '[^\t]*')
|
||||
if memb =~ '^' . a:items[0]
|
||||
call add(matches, {'match': memb, 'tagline': l['text']})
|
||||
endif
|
||||
endfor
|
||||
|
||||
if len(matches) > 0
|
||||
" No further items, return the result.
|
||||
if len(a:items) == 1
|
||||
return matches
|
||||
endif
|
||||
|
||||
" More items following. For each of the possible members find the
|
||||
" matching following members.
|
||||
return s:SearchMembers(matches, a:items[1:])
|
||||
endif
|
||||
|
||||
" Failed to find anything.
|
||||
return []
|
||||
endfunction
|
||||
|
||||
" For matching members, find matches for following items.
|
||||
function! s:SearchMembers(matches, items)
|
||||
let res = []
|
||||
for i in range(len(a:matches))
|
||||
let line = a:matches[i]['tagline']
|
||||
let e = matchend(line, '\ttypename:')
|
||||
if e > 0
|
||||
" Use typename field
|
||||
let name = matchstr(line, '[^\t]*', e)
|
||||
call extend(res, s:StructMembers(name, a:items))
|
||||
else
|
||||
" Use the search command (the declaration itself).
|
||||
let s = match(line, '\t\zs/^')
|
||||
if s > 0
|
||||
let e = match(line, a:matches[i]['match'], s)
|
||||
if e > 0
|
||||
call extend(res, s:Nextitem(strpart(line, s, e - s), a:items))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
endfunc
|
||||
430
runtime/autoload/csscomplete.vim
Normal file
430
runtime/autoload/csscomplete.vim
Normal file
@@ -0,0 +1,430 @@
|
||||
" Vim completion script
|
||||
" Language: CSS 2.1
|
||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2005 Oct 12
|
||||
|
||||
function! csscomplete#CompleteCSS(findstart, base)
|
||||
if a:findstart
|
||||
" We need whole line to proper checking
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
let compl_begin = col('.') - 2
|
||||
while start >= 0 && line[start - 1] =~ '\(\k\|-\)'
|
||||
let start -= 1
|
||||
endwhile
|
||||
let b:compl_context = getline('.')[0:compl_begin]
|
||||
return start
|
||||
else
|
||||
" There are few chars important for context:
|
||||
" ^ ; : { } /* */
|
||||
" Where ^ is start of line and /* */ are comment borders
|
||||
" Depending on their relative position to cursor we will now what should
|
||||
" be completed.
|
||||
" 1. if nearest are ^ or { or ; current word is property
|
||||
" 2. if : it is value (with exception of pseudo things)
|
||||
" 3. if } we are outside of css definitions
|
||||
" 4. for comments ignoring is be the easiest but assume they are the same
|
||||
" as 1.
|
||||
" 5. if @ complete at-rule
|
||||
" 6. if ! complete important
|
||||
if exists("b:compl_context")
|
||||
let line = b:compl_context
|
||||
unlet! b:compl_context
|
||||
else
|
||||
let line = a:base
|
||||
endif
|
||||
|
||||
let res = []
|
||||
let res2 = []
|
||||
let borders = {}
|
||||
|
||||
" We need the last occurrence of char so reverse line
|
||||
let revline = join(reverse(split(line, '.\zs')), '')
|
||||
|
||||
let openbrace = stridx(revline, '{')
|
||||
let closebrace = stridx(revline, '}')
|
||||
let colon = stridx(revline, ':')
|
||||
let semicolon = stridx(revline, ';')
|
||||
let opencomm = stridx(revline, '*/') " Line was reversed
|
||||
let closecomm = stridx(revline, '/*') " Line was reversed
|
||||
let style = stridx(revline, '=\s*elyts') " Line was reversed
|
||||
let atrule = stridx(revline, '@')
|
||||
let exclam = stridx(revline, '!')
|
||||
|
||||
if openbrace > -1
|
||||
let borders[openbrace] = "openbrace"
|
||||
endif
|
||||
if closebrace > -1
|
||||
let borders[closebrace] = "closebrace"
|
||||
endif
|
||||
if colon > -1
|
||||
let borders[colon] = "colon"
|
||||
endif
|
||||
if semicolon > -1
|
||||
let borders[semicolon] = "semicolon"
|
||||
endif
|
||||
if opencomm > -1
|
||||
let borders[opencomm] = "opencomm"
|
||||
endif
|
||||
if closecomm > -1
|
||||
let borders[closecomm] = "closecomm"
|
||||
endif
|
||||
if style > -1
|
||||
let borders[style] = "style"
|
||||
endif
|
||||
if atrule > -1
|
||||
let borders[atrule] = "atrule"
|
||||
endif
|
||||
if exclam > -1
|
||||
let borders[exclam] = "exclam"
|
||||
endif
|
||||
|
||||
|
||||
if len(borders) == 0 || borders[min(keys(borders))] =~ '^\(openbrace\|semicolon\|opencomm\|closecomm\|style\)$'
|
||||
" Complete properties
|
||||
|
||||
let values = split("azimuth background background-attachment background-color background-image background-position background-repeat border bottom border-collapse border-color border-spacing border-style border-top border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width border-bottom-width border-left-width border-width caption-side clear clip color content counter-increment counter-reset cue cue-after cue-before cursor display direction elevation empty-cells float font font-family font-size font-style font-variant font-weight height left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-right margin-left margin-top margin-bottom max-height max-width min-height min-width orphans outline outline-color outline-style outline-width overflow padding padding-top padding-right padding-bottom padding-left page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position quotes right richness speak speak-header speak-numeral speak-punctuation speech-rate stress table-layout text-align text-decoration text-indent text-transform top unicode-bidi vertical-align visibility voice-family volume white-space width widows word-spacing z-index")
|
||||
|
||||
let entered_property = matchstr(line, '.\{-}\zs[a-zA-Z-]*$')
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.entered_property
|
||||
call add(res, m . ':')
|
||||
elseif m =~? entered_property
|
||||
call add(res2, m . ':')
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
elseif borders[min(keys(borders))] == 'colon'
|
||||
" Get name of property
|
||||
let prop = tolower(matchstr(line, '\zs[a-zA-Z-]*\ze\s*:[^:]\{-}$'))
|
||||
|
||||
if prop == 'azimuth'
|
||||
let values = ["left-side", "far-left", "left", "center-left", "center", "center-right", "right", "far-right", "right-side", "behind", "leftwards", "rightwards"]
|
||||
elseif prop == 'background-attachment'
|
||||
let values = ["scroll", "fixed"]
|
||||
elseif prop == 'background-color'
|
||||
let values = ["transparent", "rgb(", "#"]
|
||||
elseif prop == 'background-image'
|
||||
let values = ["url(", "none"]
|
||||
elseif prop == 'background-position'
|
||||
let vals = matchstr(line, '.*:\s*\zs.*')
|
||||
if vals =~ '^\([a-zA-Z]\+\)\?$'
|
||||
let values = ["top", "center", "bottom"]
|
||||
elseif vals =~ '^[a-zA-Z]\+\s\+\([a-zA-Z]\+\)\?$'
|
||||
let values = ["left", "center", "right"]
|
||||
else
|
||||
return []
|
||||
endif
|
||||
elseif prop == 'background-repeat'
|
||||
let values = ["repeat", "repeat-x", "repeat-y", "no-repeat"]
|
||||
elseif prop == 'background'
|
||||
let values = ["url(", "scroll", "fixed", "transparent", "rgb(", "#", "none", "top", "center", "bottom" , "left", "right", "repeat", "repeat-x", "repeat-y", "no-repeat"]
|
||||
elseif prop == 'border-collapse'
|
||||
let values = ["collapse", "separate"]
|
||||
elseif prop == 'border-color'
|
||||
let values = ["rgb(", "#", "transparent"]
|
||||
elseif prop == 'border-spacing'
|
||||
return []
|
||||
elseif prop == 'border-style'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif prop =~ 'border-\(top\|right\|bottom\|left\)$'
|
||||
let vals = matchstr(line, '.*:\s*\zs.*')
|
||||
if vals =~ '^\([a-zA-Z0-9.]\+\)\?$'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\([a-zA-Z]\+\)\?$'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$'
|
||||
let values = ["rgb(", "#", "transparent"]
|
||||
else
|
||||
return []
|
||||
endif
|
||||
elseif prop =~ 'border-\(top\|right\|bottom\|left\)-color'
|
||||
let values = ["rgb(", "#", "transparent"]
|
||||
elseif prop =~ 'border-\(top\|right\|bottom\|left\)-style'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif prop =~ 'border-\(top\|right\|bottom\|left\)-width'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
elseif prop == 'border-width'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
elseif prop == 'border'
|
||||
let vals = matchstr(line, '.*:\s*\zs.*')
|
||||
if vals =~ '^\([a-zA-Z0-9.]\+\)\?$'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\([a-zA-Z]\+\)\?$'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$'
|
||||
let values = ["rgb(", "#", "transparent"]
|
||||
else
|
||||
return []
|
||||
endif
|
||||
elseif prop == 'bottom'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'caption-side'
|
||||
let values = ["top", "bottom"]
|
||||
elseif prop == 'clear'
|
||||
let values = ["none", "left", "right", "both"]
|
||||
elseif prop == 'clip'
|
||||
let values = ["auto", "rect("]
|
||||
elseif prop == 'color'
|
||||
let values = ["rgb(", "#"]
|
||||
elseif prop == 'content'
|
||||
let values = ["normal", "attr(", "open-quote", "close-quote", "no-open-quote", "no-close-quote"]
|
||||
elseif prop =~ 'counter-\(increment\|reset\)$'
|
||||
let values = ["none"]
|
||||
elseif prop =~ '^\(cue-after\|cue-before\|cue\)$'
|
||||
let values = ["url(", "none"]
|
||||
elseif prop == 'cursor'
|
||||
let values = ["url(", "auto", "crosshair", "default", "pointer", "move", "e-resize", "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help", "progress"]
|
||||
elseif prop == 'direction'
|
||||
let values = ["ltr", "rtl"]
|
||||
elseif prop == 'display'
|
||||
let values = ["inline", "block", "list-item", "run-in", "inline-block", "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption", "none"]
|
||||
elseif prop == 'elevation'
|
||||
let values = ["below", "level", "above", "higher", "lower"]
|
||||
elseif prop == 'empty-cells'
|
||||
let values = ["show", "hide"]
|
||||
elseif prop == 'float'
|
||||
let values = ["left", "right", "none"]
|
||||
elseif prop == 'font-family'
|
||||
let values = ["sans-serif", "serif", "monospace", "cursive", "fantasy"]
|
||||
elseif prop == 'font-size'
|
||||
let values = ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller"]
|
||||
elseif prop == 'font-style'
|
||||
let values = ["normal", "italic", "oblique"]
|
||||
elseif prop == 'font-variant'
|
||||
let values = ["normal", "small-caps"]
|
||||
elseif prop == 'font-weight'
|
||||
let values = ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"]
|
||||
elseif prop == 'font'
|
||||
let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"]
|
||||
elseif prop =~ '^\(height\|width\)$'
|
||||
let values = ["auto"]
|
||||
elseif prop =~ '^\(left\|rigth\)$'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'letter-spacing'
|
||||
let values = ["normal"]
|
||||
elseif prop == 'line-height'
|
||||
let values = ["normal"]
|
||||
elseif prop == 'list-style-image'
|
||||
let values = ["url(", "none"]
|
||||
elseif prop == 'list-style-position'
|
||||
let values = ["inside", "outside"]
|
||||
elseif prop == 'list-style-type'
|
||||
let values = ["disc", "circle", "square", "decimal", "decimal-leading-zero", "lower-roman", "upper-roman", "lower-latin", "upper-latin", "none"]
|
||||
elseif prop == 'list-style'
|
||||
return []
|
||||
elseif prop == 'margin'
|
||||
let values = ["auto"]
|
||||
elseif prop =~ 'margin-\(right\|left\|top\|bottom\)$'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'max-height'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'max-width'
|
||||
let values = ["none"]
|
||||
elseif prop == 'min-height'
|
||||
let values = ["none"]
|
||||
elseif prop == 'min-width'
|
||||
let values = ["none"]
|
||||
elseif prop == 'orphans'
|
||||
return []
|
||||
elseif prop == 'outline-color'
|
||||
let values = ["rgb(", "#"]
|
||||
elseif prop == 'outline-style'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif prop == 'outline-width'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
elseif prop == 'outline'
|
||||
let vals = matchstr(line, '.*:\s*\zs.*')
|
||||
if vals =~ '^\([a-zA-Z0-9,()#]\+\)\?$'
|
||||
let values = ["rgb(", "#"]
|
||||
elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+\([a-zA-Z]\+\)\?$'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
else
|
||||
return []
|
||||
endif
|
||||
elseif prop == 'overflow'
|
||||
let values = ["visible", "hidden", "scroll", "auto"]
|
||||
elseif prop == 'padding'
|
||||
return []
|
||||
elseif prop =~ 'padding-\(top\|right\|bottom\|left\)$'
|
||||
return []
|
||||
elseif prop =~ 'page-break-\(after\|before\)$'
|
||||
let values = ["auto", "always", "avoid", "left", "right"]
|
||||
elseif prop == 'page-break-inside'
|
||||
let values = ["auto", "avoid"]
|
||||
elseif prop =~ 'pause-\(after\|before\)$'
|
||||
return []
|
||||
elseif prop == 'pause'
|
||||
return []
|
||||
elseif prop == 'pitch-range'
|
||||
return []
|
||||
elseif prop == 'pitch'
|
||||
let values = ["x-low", "low", "medium", "high", "x-high"]
|
||||
elseif prop == 'play-during'
|
||||
let values = ["url(", "mix", "repeat", "auto", "none"]
|
||||
elseif prop == 'position'
|
||||
let values = ["static", "relative", "absolute", "fixed"]
|
||||
elseif prop == 'quotes'
|
||||
let values = ["none"]
|
||||
elseif prop == 'richness'
|
||||
return []
|
||||
elseif prop == 'speak-header'
|
||||
let values = ["once", "always"]
|
||||
elseif prop == 'speak-numeral'
|
||||
let values = ["digits", "continuous"]
|
||||
elseif prop == 'speak-punctuation'
|
||||
let values = ["code", "none"]
|
||||
elseif prop == 'speak'
|
||||
let values = ["normal", "none", "spell-out"]
|
||||
elseif prop == 'speech-rate'
|
||||
let values = ["x-slow", "slow", "medium", "fast", "x-fast", "faster", "slower"]
|
||||
elseif prop == 'stress'
|
||||
return []
|
||||
elseif prop == 'table-layout'
|
||||
let values = ["auto", "fixed"]
|
||||
elseif prop == 'text-align'
|
||||
let values = ["left", "right", "center", "justify"]
|
||||
elseif prop == 'text-decoration'
|
||||
let values = ["none", "underline", "overline", "line-through", "blink"]
|
||||
elseif prop == 'text-indent'
|
||||
return []
|
||||
elseif prop == 'text-transform'
|
||||
let values = ["capitalize", "uppercase", "lowercase", "none"]
|
||||
elseif prop == 'top'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'unicode-bidi'
|
||||
let values = ["normal", "embed", "bidi-override"]
|
||||
elseif prop == 'vertical-align'
|
||||
let values = ["baseline", "sub", "super", "top", "text-top", "middle", "bottom", "text-bottom"]
|
||||
elseif prop == 'visibility'
|
||||
let values = ["visible", "hidden", "collapse"]
|
||||
elseif prop == 'voice-family'
|
||||
return []
|
||||
elseif prop == 'volume'
|
||||
let values = ["silent", "x-soft", "soft", "medium", "loud", "x-loud"]
|
||||
elseif prop == 'white-space'
|
||||
let values = ["normal", "pre", "nowrap", "pre-wrap", "pre-line"]
|
||||
elseif prop == 'widows'
|
||||
return []
|
||||
elseif prop == 'word-spacing'
|
||||
let values = ["normal"]
|
||||
elseif prop == 'z-index'
|
||||
let values = ["auto"]
|
||||
else
|
||||
" If no property match it is possible we are outside of {} and
|
||||
" trying to complete pseudo-(class|element)
|
||||
let element = tolower(matchstr(line, '\zs[a-zA-Z1-6]*\ze:[^:[:space:]]\{-}$'))
|
||||
if ",a,abbr,acronym,address,area,b,base,bdo,big,blockquote,body,br,button,caption,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,fieldset,form,head,h1,h2,h3,h4,h5,h6,hr,html,i,img,input,ins,kbd,label,legend,li,link,map,meta,noscript,object,ol,optgroup,option,p,param,pre,q,samp,script,select,small,span,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,title,tr,tt,ul,var," =~ ','.element.','
|
||||
let values = ["first-child", "link", "visited", "hover", "active", "focus", "lang", "first-line", "first-letter", "before", "after"]
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
" Complete values
|
||||
let entered_value = matchstr(line, '.\{-}\zs[a-zA-Z0-9#,.(_-]*$')
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.entered_value
|
||||
call add(res, m)
|
||||
elseif m =~? entered_value
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
elseif borders[min(keys(borders))] == 'closebrace'
|
||||
|
||||
return []
|
||||
|
||||
elseif borders[min(keys(borders))] == 'exclam'
|
||||
|
||||
" Complete values
|
||||
let entered_imp = matchstr(line, '.\{-}!\s*\zs[a-zA-Z ]*$')
|
||||
|
||||
let values = ["important"]
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.entered_imp
|
||||
call add(res, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res
|
||||
|
||||
elseif borders[min(keys(borders))] == 'atrule'
|
||||
|
||||
let afterat = matchstr(line, '.*@\zs.*')
|
||||
|
||||
if afterat =~ '\s'
|
||||
|
||||
let atrulename = matchstr(line, '.*@\zs[a-zA-Z-]\+\ze')
|
||||
|
||||
if atrulename == 'media'
|
||||
let values = ["screen", "tty", "tv", "projection", "handheld", "print", "braille", "aural", "all"]
|
||||
|
||||
let atruleafterbase = matchstr(line, '.*@media\s\+\ze.*$')
|
||||
let entered_atruleafter = matchstr(line, '.*@media\s\+\zs.*$')
|
||||
|
||||
elseif atrulename == 'import'
|
||||
let atruleafterbase = matchstr(line, '.*@import\s\+\ze.*$')
|
||||
let entered_atruleafter = matchstr(line, '.*@import\s\+\zs.*$')
|
||||
|
||||
if entered_atruleafter =~ "^[\"']"
|
||||
let filestart = matchstr(entered_atruleafter, '^.\zs.*')
|
||||
let files = split(glob(filestart.'*'), '\n')
|
||||
let values = map(copy(files), '"\"".v:val')
|
||||
|
||||
elseif entered_atruleafter =~ "^url("
|
||||
let filestart = matchstr(entered_atruleafter, "^url([\"']\\?\\zs.*")
|
||||
let files = split(glob(filestart.'*'), '\n')
|
||||
let values = map(copy(files), '"url(".v:val')
|
||||
|
||||
else
|
||||
let values = ['"', 'url(']
|
||||
|
||||
endif
|
||||
|
||||
else
|
||||
return []
|
||||
|
||||
endif
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.entered_atruleafter
|
||||
call add(res, m)
|
||||
elseif m =~? entered_atruleafter
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
|
||||
let values = ["charset", "page", "media", "import", "font-face"]
|
||||
|
||||
let entered_atrule = matchstr(line, '.*@\zs[a-zA-Z-]*$')
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.entered_atrule
|
||||
call add(res, m .' ')
|
||||
elseif m =~? entered_atrule
|
||||
call add(res2, m .' ')
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
|
||||
return []
|
||||
|
||||
endif
|
||||
endfunction
|
||||
173
runtime/autoload/gzip.vim
Normal file
173
runtime/autoload/gzip.vim
Normal file
@@ -0,0 +1,173 @@
|
||||
" Vim autoload file for editing compressed files.
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2005 Jul 26
|
||||
|
||||
" These functions are used by the gzip plugin.
|
||||
|
||||
" Function to check that executing "cmd [-f]" works.
|
||||
" The result is cached in s:have_"cmd" for speed.
|
||||
fun s:check(cmd)
|
||||
let name = substitute(a:cmd, '\(\S*\).*', '\1', '')
|
||||
if !exists("s:have_" . name)
|
||||
let e = executable(name)
|
||||
if e < 0
|
||||
let r = system(name . " --version")
|
||||
let e = (r !~ "not found" && r != "")
|
||||
endif
|
||||
exe "let s:have_" . name . "=" . e
|
||||
endif
|
||||
exe "return s:have_" . name
|
||||
endfun
|
||||
|
||||
" Set b:gzip_comp_arg to the gzip argument to be used for compression, based on
|
||||
" the flags in the compressed file.
|
||||
" The only compression methods that can be detected are max speed (-1) and max
|
||||
" compression (-9).
|
||||
fun s:set_compression(line)
|
||||
" get the Compression Method
|
||||
let l:cm = char2nr(a:line[2])
|
||||
" if it's 8 (DEFLATE), we can check for the compression level
|
||||
if l:cm == 8
|
||||
" get the eXtra FLags
|
||||
let l:xfl = char2nr(a:line[8])
|
||||
" max compression
|
||||
if l:xfl == 2
|
||||
let b:gzip_comp_arg = "-9"
|
||||
" min compression
|
||||
elseif l:xfl == 4
|
||||
let b:gzip_comp_arg = "-1"
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
|
||||
" After reading compressed file: Uncompress text in buffer with "cmd"
|
||||
fun gzip#read(cmd)
|
||||
" don't do anything if the cmd is not supported
|
||||
if !s:check(a:cmd)
|
||||
return
|
||||
endif
|
||||
|
||||
" for gzip check current compression level and set b:gzip_comp_arg.
|
||||
silent! unlet b:gzip_comp_arg
|
||||
if a:cmd[0] == 'g'
|
||||
call s:set_compression(getline(1))
|
||||
endif
|
||||
|
||||
" make 'patchmode' empty, we don't want a copy of the written file
|
||||
let pm_save = &pm
|
||||
set pm=
|
||||
" remove 'a' and 'A' from 'cpo' to avoid the alternate file changes
|
||||
let cpo_save = &cpo
|
||||
set cpo-=a cpo-=A
|
||||
" set 'modifiable'
|
||||
let ma_save = &ma
|
||||
setlocal ma
|
||||
" when filtering the whole buffer, it will become empty
|
||||
let empty = line("'[") == 1 && line("']") == line("$")
|
||||
let tmp = tempname()
|
||||
let tmpe = tmp . "." . expand("<afile>:e")
|
||||
" write the just read lines to a temp file "'[,']w tmp.gz"
|
||||
execute "silent '[,']w " . tmpe
|
||||
" uncompress the temp file: call system("gzip -dn tmp.gz")
|
||||
call system(a:cmd . " " . tmpe)
|
||||
if !filereadable(tmp)
|
||||
" uncompress didn't work! Keep the compressed file then.
|
||||
echoerr "Error: Could not read uncompressed file"
|
||||
return
|
||||
endif
|
||||
" delete the compressed lines; remember the line number
|
||||
let l = line("'[") - 1
|
||||
if exists(":lockmarks")
|
||||
lockmarks '[,']d _
|
||||
else
|
||||
'[,']d _
|
||||
endif
|
||||
" read in the uncompressed lines "'[-1r tmp"
|
||||
setlocal nobin
|
||||
if exists(":lockmarks")
|
||||
execute "silent lockmarks " . l . "r " . tmp
|
||||
else
|
||||
execute "silent " . l . "r " . tmp
|
||||
endif
|
||||
|
||||
" if buffer became empty, delete trailing blank line
|
||||
if empty
|
||||
silent $delete _
|
||||
1
|
||||
endif
|
||||
" delete the temp file and the used buffers
|
||||
call delete(tmp)
|
||||
silent! exe "bwipe " . tmp
|
||||
silent! exe "bwipe " . tmpe
|
||||
let &pm = pm_save
|
||||
let &cpo = cpo_save
|
||||
let &l:ma = ma_save
|
||||
" When uncompressed the whole buffer, do autocommands
|
||||
if empty
|
||||
if &verbose >= 8
|
||||
execute "doau BufReadPost " . expand("%:r")
|
||||
else
|
||||
execute "silent! doau BufReadPost " . expand("%:r")
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" After writing compressed file: Compress written file with "cmd"
|
||||
fun gzip#write(cmd)
|
||||
" don't do anything if the cmd is not supported
|
||||
if s:check(a:cmd)
|
||||
" Rename the file before compressing it.
|
||||
let nm = resolve(expand("<afile>"))
|
||||
let nmt = s:tempname(nm)
|
||||
if rename(nm, nmt) == 0
|
||||
if exists("b:gzip_comp_arg")
|
||||
call system(a:cmd . " " . b:gzip_comp_arg . " " . nmt)
|
||||
else
|
||||
call system(a:cmd . " " . nmt)
|
||||
endif
|
||||
call rename(nmt . "." . expand("<afile>:e"), nm)
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" Before appending to compressed file: Uncompress file with "cmd"
|
||||
fun gzip#appre(cmd)
|
||||
" don't do anything if the cmd is not supported
|
||||
if s:check(a:cmd)
|
||||
let nm = expand("<afile>")
|
||||
|
||||
" for gzip check current compression level and set b:gzip_comp_arg.
|
||||
silent! unlet b:gzip_comp_arg
|
||||
if a:cmd[0] == 'g'
|
||||
call s:set_compression(readfile(nm, "b", 1)[0])
|
||||
endif
|
||||
|
||||
" Rename to a weird name to avoid the risk of overwriting another file
|
||||
let nmt = expand("<afile>:p:h") . "/X~=@l9q5"
|
||||
let nmte = nmt . "." . expand("<afile>:e")
|
||||
if rename(nm, nmte) == 0
|
||||
if &patchmode != "" && getfsize(nm . &patchmode) == -1
|
||||
" Create patchmode file by creating the decompressed file new
|
||||
call system(a:cmd . " -c " . nmte . " > " . nmt)
|
||||
call rename(nmte, nm . &patchmode)
|
||||
else
|
||||
call system(a:cmd . " " . nmte)
|
||||
endif
|
||||
call rename(nmt, nm)
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" find a file name for the file to be compressed. Use "name" without an
|
||||
" extension if possible. Otherwise use a weird name to avoid overwriting an
|
||||
" existing file.
|
||||
fun s:tempname(name)
|
||||
let fn = fnamemodify(a:name, ":r")
|
||||
if !filereadable(fn) && !isdirectory(fn)
|
||||
return fn
|
||||
endif
|
||||
return fnamemodify(a:name, ":p:h") . "/X~=@l9q5"
|
||||
endfun
|
||||
|
||||
" vim: set sw=2 :
|
||||
523
runtime/autoload/htmlcomplete.vim
Normal file
523
runtime/autoload/htmlcomplete.vim
Normal file
@@ -0,0 +1,523 @@
|
||||
" Vim completion script
|
||||
" Language: XHTML 1.0 Strict
|
||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2006 Jan 24
|
||||
|
||||
function! htmlcomplete#CompleteTags(findstart, base)
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
let curline = line('.')
|
||||
let compl_begin = col('.') - 2
|
||||
while start >= 0 && line[start - 1] =~ '\(\k\|[:.-]\)'
|
||||
let start -= 1
|
||||
endwhile
|
||||
if start >= 0 && line[start - 1] =~ '&'
|
||||
let b:entitiescompl = 1
|
||||
let b:compl_context = ''
|
||||
return start
|
||||
endif
|
||||
let stylestart = searchpair('<style\>', '', '<\/style\>', "bnW")
|
||||
let styleend = searchpair('<style\>', '', '<\/style\>', "nW")
|
||||
if stylestart != 0 && styleend != 0
|
||||
if stylestart <= curline && styleend >= curline
|
||||
let start = col('.') - 1
|
||||
let b:csscompl = 1
|
||||
while start >= 0 && line[start - 1] =~ '\(\k\|-\)'
|
||||
let start -= 1
|
||||
endwhile
|
||||
endif
|
||||
endif
|
||||
if !exists("b:csscompl")
|
||||
let b:compl_context = getline('.')[0:(compl_begin)]
|
||||
if b:compl_context !~ '<[^>]*$'
|
||||
" Look like we may have broken tag. Check previous lines. Up to
|
||||
" 10?
|
||||
let i = 1
|
||||
while 1
|
||||
let context_line = getline(curline-i)
|
||||
if context_line =~ '<[^>]*$'
|
||||
" Yep, this is this line
|
||||
let context_lines = getline(curline-i, curline)
|
||||
let b:compl_context = join(context_lines, ' ')
|
||||
break
|
||||
elseif context_line =~ '>[^<]*$'
|
||||
" Normal tag line, no need for completion at all
|
||||
let b:compl_context = ''
|
||||
break
|
||||
endif
|
||||
let i += 1
|
||||
endwhile
|
||||
" Make sure we don't have counter
|
||||
unlet! i
|
||||
endif
|
||||
let b:compl_context = matchstr(b:compl_context, '.*\zs<.*')
|
||||
else
|
||||
let b:compl_context = getline('.')[0:compl_begin]
|
||||
endif
|
||||
return start
|
||||
else
|
||||
" Initialize base return lists
|
||||
let res = []
|
||||
let res2 = []
|
||||
" a:base is very short - we need context
|
||||
let context = b:compl_context
|
||||
" Check if we should do CSS completion inside of <style> tag
|
||||
if exists("b:csscompl")
|
||||
unlet! b:csscompl
|
||||
let context = b:compl_context
|
||||
return csscomplete#CompleteCSS(0, context)
|
||||
else
|
||||
if len(b:compl_context) == 0 && !exists("b:entitiescompl")
|
||||
return []
|
||||
endif
|
||||
let context = matchstr(b:compl_context, '.\zs.*')
|
||||
endif
|
||||
unlet! b:compl_context
|
||||
" Make entities completion
|
||||
if exists("b:entitiescompl")
|
||||
unlet! b:entitiescompl
|
||||
|
||||
if !exists("g:xmldata_xhtml10s")
|
||||
runtime! autoload/xml/xhtml10s.vim
|
||||
endif
|
||||
|
||||
let entities = g:xmldata_xhtml10s['vimxmlentities']
|
||||
|
||||
if len(a:base) == 1
|
||||
for m in entities
|
||||
if m =~ '^'.a:base
|
||||
call add(res, m.';')
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
else
|
||||
for m in entities
|
||||
if m =~? '^'.a:base
|
||||
call add(res, m.';')
|
||||
elseif m =~? a:base
|
||||
call add(res2, m.';')
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
endif
|
||||
|
||||
|
||||
endif
|
||||
if context =~ '>'
|
||||
" Generally if context contains > it means we are outside of tag and
|
||||
" should abandon action - with one exception: <style> span { bo
|
||||
if context =~ 'style[^>]\{-}>[^<]\{-}$'
|
||||
return csscomplete#CompleteCSS(0, context)
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
" Set attribute groups
|
||||
let coreattrs = ["id", "class", "style", "title"]
|
||||
let i18n = ["lang", "xml:lang", "dir=\"ltr\" ", "dir=\"rtl\" "]
|
||||
let events = ["onclick", "ondblclick", "onmousedown", "onmouseup", "onmousemove",
|
||||
\ "onmouseover", "onmouseout", "onkeypress", "onkeydown", "onkeyup"]
|
||||
let focus = ["accesskey", "tabindex", "onfocus", "onblur"]
|
||||
let coregroup = coreattrs + i18n + events
|
||||
" find tags matching with "context"
|
||||
" If context contains > it means we are already outside of tag and we
|
||||
" should abandon action
|
||||
" If context contains white space it is attribute.
|
||||
" It could be also value of attribute...
|
||||
" We have to get first word to offer
|
||||
" proper completions
|
||||
if context == ''
|
||||
let tag = ''
|
||||
else
|
||||
let tag = split(context)[0]
|
||||
endif
|
||||
" Get last word, it should be attr name
|
||||
let attr = matchstr(context, '.*\s\zs.*')
|
||||
" Possible situations where any prediction would be difficult:
|
||||
" 1. Events attributes
|
||||
if context =~ '\s'
|
||||
" Sort out style, class, and on* cases
|
||||
if context =~ "\\(on[a-z]*\\|id\\|style\\|class\\)\\s*=\\s*[\"']"
|
||||
if context =~ "\\(id\\|class\\)\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
|
||||
if context =~ "class\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
|
||||
let search_for = "class"
|
||||
elseif context =~ "id\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
|
||||
let search_for = "id"
|
||||
endif
|
||||
" Handle class name completion
|
||||
" 1. Find lines of <link stylesheet>
|
||||
" 1a. Check file for @import
|
||||
" 2. Extract filename(s?) of stylesheet,
|
||||
call cursor(1,1)
|
||||
let head = getline(search('<head\>'), search('<\/head>'))
|
||||
let headjoined = join(copy(head), ' ')
|
||||
if headjoined =~ '<style'
|
||||
" Remove possibly confusing CSS operators
|
||||
let stylehead = substitute(headjoined, '+>\*[,', ' ', 'g')
|
||||
if search_for == 'class'
|
||||
let styleheadlines = split(stylehead)
|
||||
let headclasslines = filter(copy(styleheadlines), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'")
|
||||
else
|
||||
let stylesheet = split(headjoined, '[{}]')
|
||||
" Get all lines which fit id syntax
|
||||
let classlines = filter(copy(stylesheet), "v:val =~ '#[a-zA-Z0-9_-]\\+'")
|
||||
" Filter out possible color definitions
|
||||
call filter(classlines, "v:val !~ ':\\s*#[a-zA-Z0-9_-]\\+'")
|
||||
" Filter out complex border definitions
|
||||
call filter(classlines, "v:val !~ '\\(none\\|hidden\\|dotted\\|dashed\\|solid\\|double\\|groove\\|ridge\\|inset\\|outset\\)\\s*#[a-zA-Z0-9_-]\\+'")
|
||||
let templines = join(classlines, ' ')
|
||||
let headclasslines = split(templines)
|
||||
call filter(headclasslines, "v:val =~ '#[a-zA-Z0-9_-]\\+'")
|
||||
endif
|
||||
let internal = 1
|
||||
else
|
||||
let internal = 0
|
||||
endif
|
||||
let styletable = []
|
||||
let secimportfiles = []
|
||||
let filestable = filter(copy(head), "v:val =~ '\\(@import\\|link.*stylesheet\\)'")
|
||||
for line in filestable
|
||||
if line =~ "@import"
|
||||
let styletable += [matchstr(line, "import\\s\\+\\(url(\\)\\?[\"']\\?\\zs\\f\\+\\ze")]
|
||||
elseif line =~ "<link"
|
||||
let styletable += [matchstr(line, "href\\s*=\\s*[\"']\\zs\\f\\+\\ze")]
|
||||
endif
|
||||
endfor
|
||||
for file in styletable
|
||||
if filereadable(file)
|
||||
let stylesheet = readfile(file)
|
||||
let secimport = filter(copy(stylesheet), "v:val =~ '@import'")
|
||||
if len(secimport) > 0
|
||||
for line in secimport
|
||||
let secfile = matchstr(line, "import\\s\\+\\(url(\\)\\?[\"']\\?\\zs\\f\\+\\ze")
|
||||
let secfile = fnamemodify(file, ":p:h").'/'.secfile
|
||||
let secimportfiles += [secfile]
|
||||
endfor
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
let cssfiles = styletable + secimportfiles
|
||||
let classes = []
|
||||
for file in cssfiles
|
||||
if filereadable(file)
|
||||
let stylesheet = readfile(file)
|
||||
let stylefile = join(stylesheet, ' ')
|
||||
let stylefile = substitute(stylefile, '+>\*[,', ' ', 'g')
|
||||
if search_for == 'class'
|
||||
let stylesheet = split(stylefile)
|
||||
let classlines = filter(copy(stylesheet), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'")
|
||||
else
|
||||
let stylesheet = split(stylefile, '[{}]')
|
||||
" Get all lines which fit id syntax
|
||||
let classlines = filter(copy(stylesheet), "v:val =~ '#[a-zA-Z0-9_-]\\+'")
|
||||
" Filter out possible color definitions
|
||||
call filter(classlines, "v:val !~ ':\\s*#[a-zA-Z0-9_-]\\+'")
|
||||
" Filter out complex border definitions
|
||||
call filter(classlines, "v:val !~ '\\(none\\|hidden\\|dotted\\|dashed\\|solid\\|double\\|groove\\|ridge\\|inset\\|outset\\)\\s*#[a-zA-Z0-9_-]\\+'")
|
||||
let templines = join(classlines, ' ')
|
||||
let stylelines = split(templines)
|
||||
let classlines = filter(stylelines, "v:val =~ '#[a-zA-Z0-9_-]\\+'")
|
||||
|
||||
endif
|
||||
endif
|
||||
" We gathered classes definitions from all external files
|
||||
let classes += classlines
|
||||
endfor
|
||||
if internal == 1
|
||||
let classes += headclasslines
|
||||
endif
|
||||
|
||||
if search_for == 'class'
|
||||
let elements = {}
|
||||
for element in classes
|
||||
if element =~ '^\.'
|
||||
let class = matchstr(element, '^\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze')
|
||||
let class = substitute(class, ':.*', '', '')
|
||||
if has_key(elements, 'common')
|
||||
let elements['common'] .= ' '.class
|
||||
else
|
||||
let elements['common'] = class
|
||||
endif
|
||||
else
|
||||
let class = matchstr(element, '[a-zA-Z1-6]*\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze')
|
||||
let tagname = tolower(matchstr(element, '[a-zA-Z1-6]*\ze.'))
|
||||
if tagname != ''
|
||||
if has_key(elements, tagname)
|
||||
let elements[tagname] .= ' '.class
|
||||
else
|
||||
let elements[tagname] = class
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
if has_key(elements, tag) && has_key(elements, 'common')
|
||||
let values = split(elements[tag]." ".elements['common'])
|
||||
elseif has_key(elements, tag) && !has_key(elements, 'common')
|
||||
let values = split(elements[tag])
|
||||
elseif !has_key(elements, tag) && has_key(elements, 'common')
|
||||
let values = split(elements['common'])
|
||||
else
|
||||
return []
|
||||
endif
|
||||
|
||||
elseif search_for == 'id'
|
||||
" Find used IDs
|
||||
" 1. Catch whole file
|
||||
let filelines = getline(1, line('$'))
|
||||
" 2. Find lines with possible id
|
||||
let used_id_lines = filter(filelines, 'v:val =~ "id\\s*=\\s*[\"''][a-zA-Z0-9_-]\\+"')
|
||||
" 3a. Join all filtered lines
|
||||
let id_string = join(used_id_lines, ' ')
|
||||
" 3b. And split them to be sure each id is in separate item
|
||||
let id_list = split(id_string, 'id\s*=\s*')
|
||||
" 4. Extract id values
|
||||
let used_id = map(id_list, 'matchstr(v:val, "[\"'']\\zs[a-zA-Z0-9_-]\\+\\ze")')
|
||||
let joined_used_id = ','.join(used_id, ',').','
|
||||
|
||||
let allvalues = map(classes, 'matchstr(v:val, ".*#\\zs[a-zA-Z0-9_-]\\+")')
|
||||
|
||||
let values = []
|
||||
|
||||
for element in classes
|
||||
if joined_used_id !~ ','.element.','
|
||||
let values += [element]
|
||||
endif
|
||||
|
||||
endfor
|
||||
|
||||
endif
|
||||
|
||||
" We need special version of sbase
|
||||
let classbase = matchstr(context, ".*[\"']")
|
||||
let classquote = matchstr(classbase, '.$')
|
||||
|
||||
let entered_class = matchstr(attr, ".*=\\s*[\"']\\zs.*")
|
||||
|
||||
for m in sort(values)
|
||||
if m =~? '^'.entered_class
|
||||
call add(res, m . classquote)
|
||||
elseif m =~? entered_class
|
||||
call add(res2, m . classquote)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
elseif context =~ "style\\s*=\\s*[\"'][^\"']*$"
|
||||
return csscomplete#CompleteCSS(0, context)
|
||||
|
||||
endif
|
||||
let stripbase = matchstr(context, ".*\\(on[a-z]*\\|style\\|class\\)\\s*=\\s*[\"']\\zs.*")
|
||||
" Now we have context stripped from all chars up to style/class.
|
||||
" It may fail with some strange style value combinations.
|
||||
if stripbase !~ "[\"']"
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
" If attr contains =\s*[\"'] we catched value of attribute
|
||||
if attr =~ "=\s*[\"']"
|
||||
" Let do attribute specific completion
|
||||
let attrname = matchstr(attr, '.*\ze\s*=')
|
||||
let entered_value = matchstr(attr, ".*=\\s*[\"']\\zs.*")
|
||||
let values = []
|
||||
if attrname == 'media'
|
||||
let values = ["screen", "tty", "tv", "projection", "handheld", "print", "braille", "aural", "all"]
|
||||
elseif attrname == 'xml:space'
|
||||
let values = ["preserve"]
|
||||
elseif attrname == 'shape'
|
||||
let values = ["rect", "circle", "poly", "default"]
|
||||
elseif attrname == 'valuetype'
|
||||
let values = ["data", "ref", "object"]
|
||||
elseif attrname == 'method'
|
||||
let values = ["get", "post"]
|
||||
elseif attrname == 'dir'
|
||||
let values = ["ltr", "rtl"]
|
||||
elseif attrname == 'frame'
|
||||
let values = ["void", "above", "below", "hsides", "lhs", "rhs", "vsides", "box", "border"]
|
||||
elseif attrname == 'rules'
|
||||
let values = ["none", "groups", "rows", "all"]
|
||||
elseif attrname == 'align'
|
||||
let values = ["left", "center", "right", "justify", "char"]
|
||||
elseif attrname == 'valign'
|
||||
let values = ["top", "middle", "bottom", "baseline"]
|
||||
elseif attrname == 'scope'
|
||||
let values = ["row", "col", "rowgroup", "colgroup"]
|
||||
elseif attrname == 'href'
|
||||
" Now we are looking for local anchors defined by name or id
|
||||
if entered_value =~ '^#'
|
||||
let file = join(getline(1, line('$')), ' ')
|
||||
" Split it be sure there will be one id/name element in
|
||||
" item, it will be also first word [a-zA-Z0-9_-] in element
|
||||
let oneelement = split(file, "\\(meta \\)\\@<!\\(name\\|id\\)\\s*=\\s*[\"']")
|
||||
for i in oneelement
|
||||
let values += ['#'.matchstr(i, "^[a-zA-Z][a-zA-Z0-9%_-]*")]
|
||||
endfor
|
||||
endif
|
||||
elseif attrname == 'type'
|
||||
if context =~ '^input'
|
||||
let values = ["text", "password", "checkbox", "radio", "submit", "reset", "file", "hidden", "image", "button"]
|
||||
elseif context =~ '^button'
|
||||
let values = ["button", "submit", "reset"]
|
||||
elseif context =~ '^style'
|
||||
let values = ["text/css"]
|
||||
elseif context =~ '^script'
|
||||
let values = ["text/javascript"]
|
||||
endif
|
||||
else
|
||||
return []
|
||||
endif
|
||||
|
||||
if len(values) == 0
|
||||
return []
|
||||
endif
|
||||
|
||||
" We need special version of sbase
|
||||
let attrbase = matchstr(context, ".*[\"']")
|
||||
let attrquote = matchstr(attrbase, '.$')
|
||||
|
||||
for m in values
|
||||
" This if is needed to not offer all completions as-is
|
||||
" alphabetically but sort them. Those beginning with entered
|
||||
" part will be as first choices
|
||||
if m =~ '^'.entered_value
|
||||
call add(res, m . attrquote.' ')
|
||||
elseif m =~ entered_value
|
||||
call add(res2, m . attrquote.' ')
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
" Shorten context to not include last word
|
||||
let sbase = matchstr(context, '.*\ze\s.*')
|
||||
if tag =~ '^\(abbr\|acronym\|address\|b\|bdo\|big\|caption\|cite\|code\|dd\|dfn\|div\|dl\|dt\|em\|fieldset\|h\d\|hr\|i\|kbd\|li\|noscript\|ol\|p\|samp\|small\|span\|strong\|sub\|sup\|tt\|ul\|var\)$'
|
||||
let attrs = coregroup
|
||||
elseif tag == 'a'
|
||||
let attrs = coregroup + focus + ["charset", "type", "name", "href", "hreflang", "rel", "rev", "shape", "coords"]
|
||||
elseif tag == 'area'
|
||||
let attrs = coregroup + focus + ["shape", "coords", "href", "nohref", "alt"]
|
||||
elseif tag == 'base'
|
||||
let attrs = ["href", "id"]
|
||||
elseif tag == 'blockquote'
|
||||
let attrs = coregroup + ["cite"]
|
||||
elseif tag == 'body'
|
||||
let attrs = coregroup + ["onload", "onunload"]
|
||||
elseif tag == 'br'
|
||||
let attrs = coreattrs
|
||||
elseif tag == 'button'
|
||||
let attrs = coregroup + focus + ["name", "value", "type"]
|
||||
elseif tag == '^\(col\|colgroup\)$'
|
||||
let attrs = coregroup + ["span", "width", "align", "char", "charoff", "valign"]
|
||||
elseif tag =~ '^\(del\|ins\)$'
|
||||
let attrs = coregroup + ["cite", "datetime"]
|
||||
elseif tag == 'form'
|
||||
let attrs = coregroup + ["action", "method=\"get\" ", "method=\"post\" ", "enctype", "onsubmit", "onreset", "accept", "accept-charset"]
|
||||
elseif tag == 'head'
|
||||
let attrs = i18n + ["id", "profile"]
|
||||
elseif tag == 'html'
|
||||
let attrs = i18n + ["id", "xmlns"]
|
||||
elseif tag == 'img'
|
||||
let attrs = coregroup + ["src", "alt", "longdesc", "height", "width", "usemap", "ismap"]
|
||||
elseif tag == 'input'
|
||||
let attrs = coregroup + ["type", "name", "value", "checked", "disabled", "readonly", "size", "maxlength", "src", "alt", "usemap", "onselect", "onchange", "accept"]
|
||||
elseif tag == 'label'
|
||||
let attrs = coregroup + ["for", "accesskey", "onfocus", "onblur"]
|
||||
elseif tag == 'legend'
|
||||
let attrs = coregroup + ["accesskey"]
|
||||
elseif tag == 'link'
|
||||
let attrs = coregroup + ["charset", "href", "hreflang", "type", "rel", "rev", "media"]
|
||||
elseif tag == 'map'
|
||||
let attrs = i18n + events + ["id", "class", "style", "title", "name"]
|
||||
elseif tag == 'meta'
|
||||
let attrs = i18n + ["id", "http-equiv", "content", "scheme", "name"]
|
||||
elseif tag == 'title'
|
||||
let attrs = i18n + ["id"]
|
||||
elseif tag == 'object'
|
||||
let attrs = coregroup + ["declare", "classid", "codebase", "data", "type", "codetype", "archive", "standby", "height", "width", "usemap", "name", "tabindex"]
|
||||
elseif tag == 'optgroup'
|
||||
let attrs = coregroup + ["disbled", "label"]
|
||||
elseif tag == 'option'
|
||||
let attrs = coregroup + ["disbled", "selected", "value", "label"]
|
||||
elseif tag == 'param'
|
||||
let attrs = ["id", "name", "value", "valuetype", "type"]
|
||||
elseif tag == 'pre'
|
||||
let attrs = coregroup + ["xml:space"]
|
||||
elseif tag == 'q'
|
||||
let attrs = coregroup + ["cite"]
|
||||
elseif tag == 'script'
|
||||
let attrs = ["id", "charset", "type=\"text/javascript\"", "type", "src", "defer", "xml:space"]
|
||||
elseif tag == 'select'
|
||||
let attrs = coregroup + ["name", "size", "multiple", "disabled", "tabindex", "onfocus", "onblur", "onchange"]
|
||||
elseif tag == 'style'
|
||||
let attrs = coreattrs + ["id", "type=\"text/css\"", "type", "media", "title", "xml:space"]
|
||||
elseif tag == 'table'
|
||||
let attrs = coregroup + ["summary", "width", "border", "frame", "rules", "cellspacing", "cellpadding"]
|
||||
elseif tag =~ '^\(thead\|tfoot\|tbody\|tr\)$'
|
||||
let attrs = coregroup + ["align", "char", "charoff", "valign"]
|
||||
elseif tag == 'textarea'
|
||||
let attrs = coregroup + ["name", "rows", "cols", "disabled", "readonly", "onselect", "onchange"]
|
||||
elseif tag =~ '^\(th\|td\)$'
|
||||
let attrs = coregroup + ["abbr", "headers", "scope", "rowspan", "colspan", "align", "char", "charoff", "valign"]
|
||||
else
|
||||
return []
|
||||
endif
|
||||
|
||||
for m in sort(attrs)
|
||||
if m =~ '^'.attr
|
||||
if m =~ '^\(ismap\|defer\|declare\|nohref\|checked\|disabled\|selected\|readonly\)$' || m =~ '='
|
||||
call add(res, m)
|
||||
else
|
||||
call add(res, m.'="')
|
||||
endif
|
||||
elseif m =~ attr
|
||||
if m =~ '^\(ismap\|defer\|declare\|nohref\|checked\|disabled\|selected\|readonly\)$' || m =~ '='
|
||||
call add(res2, m)
|
||||
else
|
||||
call add(res2, m.'="')
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
" Close tag
|
||||
let b:unaryTagsStack = "base meta link hr br param img area input col"
|
||||
if context =~ '^\/'
|
||||
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
|
||||
return [opentag.">"]
|
||||
endif
|
||||
" Deal with tag completion.
|
||||
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
|
||||
if opentag == ''
|
||||
" Hack for sometimes failing GetLastOpenTag.
|
||||
" As far as I tested fail isn't GLOT fault but problem
|
||||
" of invalid document - not properly closed tags and other mish-mash.
|
||||
" If returns empty string assume <body>. Safe bet.
|
||||
let opentag = 'body'
|
||||
endif
|
||||
|
||||
if !exists("g:xmldata_xhtml10s")
|
||||
runtime! autoload/xml/xhtml10s.vim
|
||||
endif
|
||||
|
||||
let tags = g:xmldata_xhtml10s[opentag][0]
|
||||
|
||||
for m in sort(tags)
|
||||
if m =~ '^'.context
|
||||
call add(res, m)
|
||||
elseif m =~ context
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
endfunction
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,21 +1,43 @@
|
||||
" NetrwFileHandlers: contains various extension-based file handlers for
|
||||
" netrwFileHandlers: contains various extension-based file handlers for
|
||||
" netrw's browsers' x command ("eXecute launcher")
|
||||
" Author: Charles E. Campbell, Jr.
|
||||
" Date: Aug 31, 2004
|
||||
" Version: 3
|
||||
" Date: Oct 12, 2005
|
||||
" Version: 7
|
||||
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
|
||||
" Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this copyright
|
||||
" notice is copied with it. Like anything else that's free,
|
||||
" netrwFileHandlers.vim is provided *as is* and comes with no
|
||||
" warranty of any kind, either expressed or implied. In no
|
||||
" event will the copyright holder be liable for any damages
|
||||
" resulting from the use of this software.
|
||||
"
|
||||
" Rom 6:23 (WEB) For the wages of sin is death, but the free gift of God {{{1
|
||||
" is eternal life in Christ Jesus our Lord.
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Prevent Reloading: {{{1
|
||||
if exists("g:loaded_netrwfilehandlers") || &cp
|
||||
" Load Once: {{{1
|
||||
if exists("g:loaded_netrwFileHandlers") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_netrwfilehandlers= "v3"
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
let g:loaded_netrwFileHandlers= "v7"
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_html: handles html when the user hits "x" when the {{{1
|
||||
" netrwFileHandlers#Init: {{{1
|
||||
" This functions is here to allow a call to this function to autoload
|
||||
" the netrwFileHandlers.vim file
|
||||
fun! netrwFileHandlers#Init()
|
||||
" call Dfunc("netrwFileHandlers#Init()")
|
||||
" call Dret("netrwFileHandlers#Init")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" netrwFileHandlers#NFH_html: handles html when the user hits "x" when the {{{1
|
||||
" cursor is atop a *.html file
|
||||
fun! NetrwFileHandler_html(pagefile)
|
||||
" call Dfunc("NetrwFileHandler_html(".a:pagefile.")")
|
||||
fun! netrwFileHandlers#NFH_html(pagefile)
|
||||
" call Dfunc("netrwFileHandlers#NFH_html(".a:pagefile.")")
|
||||
|
||||
let page= substitute(a:pagefile,'^','file://','')
|
||||
|
||||
@@ -26,19 +48,19 @@ fun! NetrwFileHandler_html(pagefile)
|
||||
" call Decho("executing !netscape ".page)
|
||||
exe "!netscape \"".page.'"'
|
||||
else
|
||||
" call Dret("NetrwFileHandler_html 0")
|
||||
" call Dret("netrwFileHandlers#NFH_html 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_html 1")
|
||||
" call Dret("netrwFileHandlers#NFH_html 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_htm: handles html when the user hits "x" when the {{{1
|
||||
" netrwFileHandlers#NFH_htm: handles html when the user hits "x" when the {{{1
|
||||
" cursor is atop a *.htm file
|
||||
fun! NetrwFileHandler_htm(pagefile)
|
||||
" call Dfunc("NetrwFileHandler_htm(".a:pagefile.")")
|
||||
fun! netrwFileHandlers#NFH_htm(pagefile)
|
||||
" call Dfunc("netrwFileHandlers#NFH_htm(".a:pagefile.")")
|
||||
|
||||
let page= substitute(a:pagefile,'^','file://','')
|
||||
|
||||
@@ -49,18 +71,18 @@ fun! NetrwFileHandler_htm(pagefile)
|
||||
" call Decho("executing !netscape ".page)
|
||||
exe "!netscape \"".page.'"'
|
||||
else
|
||||
" call Dret("NetrwFileHandler_htm 0")
|
||||
" call Dret("netrwFileHandlers#NFH_htm 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_htm 1")
|
||||
" call Dret("netrwFileHandlers#NFH_htm 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_jpg: {{{1
|
||||
fun! NetrwFileHandler_jpg(jpgfile)
|
||||
" call Dfunc("NetrwFileHandler_jpg(jpgfile<".a:jpgfile.">)")
|
||||
" netrwFileHandlers#NFH_jpg: {{{1
|
||||
fun! netrwFileHandlers#NFH_jpg(jpgfile)
|
||||
" call Dfunc("netrwFileHandlers#NFH_jpg(jpgfile<".a:jpgfile.">)")
|
||||
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".a:jpgfile
|
||||
@@ -68,171 +90,156 @@ fun! NetrwFileHandler_jpg(jpgfile)
|
||||
" call Decho("silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".escape(a:jpgfile," []|'"))
|
||||
exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:jpgfile.'"'
|
||||
else
|
||||
" call Dret("NetrwFileHandler_jpg 0")
|
||||
" call Dret("netrwFileHandlers#NFH_jpg 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_jpg 1")
|
||||
" call Dret("netrwFileHandlers#NFH_jpg 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_gif: {{{1
|
||||
fun! NetrwFileHandler_gif(giffile)
|
||||
" call Dfunc("NetrwFileHandler_gif(giffile<".a:giffile.">)")
|
||||
" netrwFileHandlers#NFH_gif: {{{1
|
||||
fun! netrwFileHandlers#NFH_gif(giffile)
|
||||
" call Dfunc("netrwFileHandlers#NFH_gif(giffile<".a:giffile.">)")
|
||||
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".a:giffile
|
||||
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:giffile.'"'
|
||||
else
|
||||
" call Dret("NetrwFileHandler_gif 0")
|
||||
" call Dret("netrwFileHandlers#NFH_gif 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_gif 1")
|
||||
" call Dret("netrwFileHandlers#NFH_gif 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_png: {{{1
|
||||
fun! NetrwFileHandler_png(pngfile)
|
||||
" call Dfunc("NetrwFileHandler_png(pngfile<".a:pngfile.">)")
|
||||
" netrwFileHandlers#NFH_png: {{{1
|
||||
fun! netrwFileHandlers#NFH_png(pngfile)
|
||||
" call Dfunc("netrwFileHandlers#NFH_png(pngfile<".a:pngfile.">)")
|
||||
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".a:pngfile
|
||||
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:pngfile.'"'
|
||||
else
|
||||
" call Dret("NetrwFileHandler_png 0")
|
||||
" call Dret("netrwFileHandlers#NFH_png 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_png 1")
|
||||
" call Dret("netrwFileHandlers#NFH_png 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_pnm: {{{1
|
||||
fun! NetrwFileHandler_pnm(pnmfile)
|
||||
" call Dfunc("NetrwFileHandler_pnm(pnmfile<".a:pnmfile.">)")
|
||||
" netrwFileHandlers#NFH_pnm: {{{1
|
||||
fun! netrwFileHandlers#NFH_pnm(pnmfile)
|
||||
" call Dfunc("netrwFileHandlers#NFH_pnm(pnmfile<".a:pnmfile.">)")
|
||||
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".a:pnmfile
|
||||
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:pnmfile.'"'
|
||||
else
|
||||
" call Dret("NetrwFileHandler_pnm 0")
|
||||
" call Dret("netrwFileHandlers#NFH_pnm 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_pnm 1")
|
||||
" call Dret("netrwFileHandlers#NFH_pnm 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_bmp: visualize bmp files {{{1
|
||||
fun! NetrwFileHandler_bmp(bmpfile)
|
||||
" call Dfunc("NetrwFileHandler_bmp(bmpfile<".a:bmpfile.">)")
|
||||
" netrwFileHandlers#NFH_bmp: visualize bmp files {{{1
|
||||
fun! netrwFileHandlers#NFH_bmp(bmpfile)
|
||||
" call Dfunc("netrwFileHandlers#NFH_bmp(bmpfile<".a:bmpfile.">)")
|
||||
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".a:bmpfile
|
||||
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:bmpfile.'"'
|
||||
else
|
||||
" call Dret("NetrwFileHandler_bmp 0")
|
||||
" call Dret("netrwFileHandlers#NFH_bmp 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_bmp 1")
|
||||
" call Dret("netrwFileHandlers#NFH_bmp 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_pdf: visualize pdf files {{{1
|
||||
fun! NetrwFileHandler_pdf(pdf)
|
||||
" " call Dfunc("NetrwFileHandler_pdf(pdf<".a:pdf.">)")
|
||||
" netrwFileHandlers#NFH_pdf: visualize pdf files {{{1
|
||||
fun! netrwFileHandlers#NFH_pdf(pdf)
|
||||
" " call Dfunc("netrwFileHandlers#NFH_pdf(pdf<".a:pdf.">)")
|
||||
if executable("gs")
|
||||
exe 'silent! !gs "'.a:pdf.'"'
|
||||
else
|
||||
" " call Dret("NetrwFileHandler_pdf 0")
|
||||
" " call Dret("netrwFileHandlers#NFH_pdf 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" " call Dret("NetrwFileHandler_pdf 1")
|
||||
" " call Dret("netrwFileHandlers#NFH_pdf 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_sxw: visualize sxw files {{{1
|
||||
fun! NetrwFileHandler_sxw(sxw)
|
||||
" " call Dfunc("NetrwFileHandler_sxw(sxw<".a:sxw.">)")
|
||||
if executable("gs")
|
||||
exe 'silent! !gs "'.a:sxw.'"'
|
||||
else
|
||||
" " call Dret("NetrwFileHandler_sxw 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" " call Dret("NetrwFileHandler_sxw 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_doc: visualize doc files {{{1
|
||||
fun! NetrwFileHandler_doc(doc)
|
||||
" " call Dfunc("NetrwFileHandler_doc(doc<".a:doc.">)")
|
||||
" netrwFileHandlers#NFH_doc: visualize doc files {{{1
|
||||
fun! netrwFileHandlers#NFH_doc(doc)
|
||||
" " call Dfunc("netrwFileHandlers#NFH_doc(doc<".a:doc.">)")
|
||||
|
||||
if executable("oowriter")
|
||||
exe 'silent! !oowriter "'.a:doc.'"'
|
||||
redraw!
|
||||
else
|
||||
" " call Dret("NetrwFileHandler_doc 0")
|
||||
" " call Dret("netrwFileHandlers#NFH_doc 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" " call Dret("NetrwFileHandler_doc 1")
|
||||
" " call Dret("netrwFileHandlers#NFH_doc 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_sxw: visualize sxw files {{{1
|
||||
fun! NetrwFileHandler_sxw(sxw)
|
||||
" " call Dfunc("NetrwFileHandler_sxw(sxw<".a:sxw.">)")
|
||||
" netrwFileHandlers#NFH_sxw: visualize sxw files {{{1
|
||||
fun! netrwFileHandlers#NFH_sxw(sxw)
|
||||
" " call Dfunc("netrwFileHandlers#NFH_sxw(sxw<".a:sxw.">)")
|
||||
|
||||
if executable("oowriter")
|
||||
exe 'silent! !oowriter "'.a:sxw.'"'
|
||||
redraw!
|
||||
else
|
||||
" " call Dret("NetrwFileHandler_sxw 0")
|
||||
" " call Dret("netrwFileHandlers#NFH_sxw 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" " call Dret("NetrwFileHandler_sxw 1")
|
||||
" " call Dret("netrwFileHandlers#NFH_sxw 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_xls: visualize xls files {{{1
|
||||
fun! NetrwFileHandler_xls(xls)
|
||||
" " call Dfunc("NetrwFileHandler_xls(xls<".a:xls.">)")
|
||||
" netrwFileHandlers#NFH_xls: visualize xls files {{{1
|
||||
fun! netrwFileHandlers#NFH_xls(xls)
|
||||
" " call Dfunc("netrwFileHandlers#NFH_xls(xls<".a:xls.">)")
|
||||
|
||||
if executable("oocalc")
|
||||
exe 'silent! !oocalc "'.a:xls.'"'
|
||||
redraw!
|
||||
else
|
||||
" " call Dret("NetrwFileHandler_xls 0")
|
||||
" " call Dret("netrwFileHandlers#NFH_xls 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" " call Dret("NetrwFileHandler_xls 1")
|
||||
" " call Dret("netrwFileHandlers#NFH_xls 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_ps: handles PostScript files {{{1
|
||||
fun! NetrwFileHandler_ps(ps)
|
||||
" call Dfunc("NetrwFileHandler_ps()")
|
||||
" netrwFileHandlers#NFH_ps: handles PostScript files {{{1
|
||||
fun! netrwFileHandlers#NFH_ps(ps)
|
||||
" call Dfunc("netrwFileHandlers#NFH_ps()")
|
||||
if executable("gs")
|
||||
exe "silent! !gs ".a:ps
|
||||
redraw!
|
||||
@@ -246,18 +253,18 @@ fun! NetrwFileHandler_ps(ps)
|
||||
exe "silent! !gswin32 \"".a:ps.'"'
|
||||
redraw!
|
||||
else
|
||||
" call Dret("NetrwFileHandler_ps 0")
|
||||
" call Dret("netrwFileHandlers#NFH_ps 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_ps 1")
|
||||
" call Dret("netrwFileHandlers#NFH_ps 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_eps: handles encapsulated PostScript files {{{1
|
||||
fun! NetrwFileHandler_eps(eps)
|
||||
" call Dfunc("NetrwFileHandler_ps()")
|
||||
" netrwFileHandlers#NFH_eps: handles encapsulated PostScript files {{{1
|
||||
fun! netrwFileHandlers#NFH_eps(eps)
|
||||
" call Dfunc("netrwFileHandlers#NFH_ps()")
|
||||
if executable("gs")
|
||||
exe "silent! !gs ".a:eps
|
||||
redraw!
|
||||
@@ -271,43 +278,44 @@ fun! NetrwFileHandler_eps(eps)
|
||||
exe "silent! !gswin32 \"".a:eps.'"'
|
||||
redraw!
|
||||
else
|
||||
" call Dret("NetrwFileHandler_ps 0")
|
||||
" call Dret("netrwFileHandlers#NFH_ps 0")
|
||||
return 0
|
||||
endif
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_fig: handles xfig files {{{1
|
||||
fun! NetrwFileHandler_fig(fig)
|
||||
" call Dfunc("NetrwFileHandler_fig()")
|
||||
" netrwFileHandlers#NFH_fig: handles xfig files {{{1
|
||||
fun! netrwFileHandlers#NFH_fig(fig)
|
||||
" call Dfunc("netrwFileHandlers#NFH_fig()")
|
||||
if executable("xfig")
|
||||
exe "silent! !xfig ".a:fig
|
||||
redraw!
|
||||
else
|
||||
" call Dret("NetrwFileHandler_fig 0")
|
||||
" call Dret("netrwFileHandlers#NFH_fig 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_fig 1")
|
||||
" call Dret("netrwFileHandlers#NFH_fig 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_obj: handles tgif's obj files {{{1
|
||||
fun! NetrwFileHandler_obj(obj)
|
||||
" call Dfunc("NetrwFileHandler_obj()")
|
||||
" netrwFileHandlers#NFH_obj: handles tgif's obj files {{{1
|
||||
fun! netrwFileHandlers#NFH_obj(obj)
|
||||
" call Dfunc("netrwFileHandlers#NFH_obj()")
|
||||
if has("unix") && executable("tgif")
|
||||
exe "silent! !tgif ".a:obj
|
||||
redraw!
|
||||
else
|
||||
" call Dret("NetrwFileHandler_obj 0")
|
||||
" call Dret("netrwFileHandlers#NFH_obj 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_obj 1")
|
||||
" call Dret("netrwFileHandlers#NFH_obj 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
|
||||
let &cpo= s:keepcpo
|
||||
" ---------------------------------------------------------------------
|
||||
" Modelines: {{{1
|
||||
" vim: ts=4 fdm=marker
|
||||
161
runtime/autoload/netrwSettings.vim
Normal file
161
runtime/autoload/netrwSettings.vim
Normal file
@@ -0,0 +1,161 @@
|
||||
" netrwSettings.vim: makes netrw settings simpler
|
||||
" Date: Oct 12, 2005
|
||||
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
||||
" Version: 4
|
||||
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
|
||||
" Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this copyright
|
||||
" notice is copied with it. Like anything else that's free,
|
||||
" netrwSettings.vim is provided *as is* and comes with no
|
||||
" warranty of any kind, either expressed or implied. By using
|
||||
" this plugin, you agree that in no event will the copyright
|
||||
" holder be liable for any damages resulting from the use
|
||||
" of this software.
|
||||
"
|
||||
" Mat 4:23 (WEB) Jesus went about in all Galilee, teaching in their {{{1
|
||||
" synagogues, preaching the gospel of the kingdom, and healing
|
||||
" every disease and every sickness among the people.
|
||||
" Load Once: {{{1
|
||||
if exists("g:loaded_netrwSettings") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_netrwSettings = "v4"
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwSettings: {{{1
|
||||
fun! netrwSettings#NetrwSettings()
|
||||
" this call is here largely just to insure that netrw has been loaded
|
||||
call netrw#NetSavePosn()
|
||||
if !exists("g:loaded_netrw")
|
||||
echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None
|
||||
return
|
||||
endif
|
||||
|
||||
above wincmd s
|
||||
enew
|
||||
setlocal noswapfile bh=wipe
|
||||
set ft=vim
|
||||
file Netrw\ Settings
|
||||
|
||||
" these variables have the following default effects when they don't
|
||||
" exist (ie. have not been set by the user in his/her .vimrc)
|
||||
if !exists("g:netrw_longlist")
|
||||
let g:netrw_longlist= 0
|
||||
let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa"
|
||||
endif
|
||||
if !exists("g:netrw_silent")
|
||||
let g:netrw_silent= 0
|
||||
endif
|
||||
if !exists("g:netrw_use_nt_rcp")
|
||||
let g:netrw_use_nt_rcp= 0
|
||||
endif
|
||||
if !exists("g:netrw_ftp")
|
||||
let g:netrw_ftp= 0
|
||||
endif
|
||||
if !exists("g:netrw_ignorenetrc")
|
||||
let g:netrw_ignorenetrc= 0
|
||||
endif
|
||||
|
||||
put ='+ ---------------------------------------------'
|
||||
put ='+ NetrwSettings: (by Charles E. Campbell, Jr.)'
|
||||
put ='+ Press ? with cursor atop any line for help '
|
||||
put ='+ ---------------------------------------------'
|
||||
let s:netrw_settings_stop= line(".")
|
||||
|
||||
put =''
|
||||
put ='+ Netrw Protocol Commands'
|
||||
put = 'let g:netrw_dav_cmd = '.g:netrw_dav_cmd
|
||||
put = 'let g:netrw_fetch_cmd = '.g:netrw_fetch_cmd
|
||||
put = 'let g:netrw_ftp_cmd = '.g:netrw_ftp_cmd
|
||||
put = 'let g:netrw_http_cmd = '.g:netrw_http_cmd
|
||||
put = 'let g:netrw_rcp_cmd = '.g:netrw_rcp_cmd
|
||||
put = 'let g:netrw_rsync_cmd = '.g:netrw_rsync_cmd
|
||||
put = 'let g:netrw_scp_cmd = '.g:netrw_scp_cmd
|
||||
put = 'let g:netrw_sftp_cmd = '.g:netrw_sftp_cmd
|
||||
put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd
|
||||
let s:netrw_protocol_stop= line(".")
|
||||
put = ''
|
||||
|
||||
put ='+Netrw Transfer Control'
|
||||
put = 'let g:netrw_cygwin = '.g:netrw_cygwin
|
||||
put = 'let g:netrw_ftp = '.g:netrw_ftp
|
||||
put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode
|
||||
put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc
|
||||
put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp
|
||||
put = 'let g:netrw_win95ftp = '.g:netrw_win95ftp
|
||||
let s:netrw_xfer_stop= line(".")
|
||||
|
||||
put = ''
|
||||
put ='+ Netrw Browser Control'
|
||||
put = 'let g:netrw_alto = '.g:netrw_alto
|
||||
put = 'let g:netrw_altv = '.g:netrw_altv
|
||||
put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax
|
||||
put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject
|
||||
put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd
|
||||
put = 'let g:netrw_hide = '.g:netrw_hide
|
||||
put = 'let g:netrw_keepdir = '.g:netrw_keepdir
|
||||
put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd
|
||||
put = 'let g:netrw_list_hide = '.g:netrw_list_hide
|
||||
put = 'let g:netrw_local_mkdir = '.g:netrw_local_mkdir
|
||||
put = 'let g:netrw_local_rmdir = '.g:netrw_local_rmdir
|
||||
put = 'let g:netrw_longlist = '.g:netrw_longlist
|
||||
put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen
|
||||
put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd
|
||||
put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd
|
||||
put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd
|
||||
put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd
|
||||
put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd
|
||||
put = 'let g:netrw_silent = '.g:netrw_silent
|
||||
put = 'let g:netrw_sort_by = '.g:netrw_sort_by
|
||||
put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction
|
||||
put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence
|
||||
put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject
|
||||
put = 'let g:netrw_timefmt = '.g:netrw_timefmt
|
||||
put = 'let g:netrw_winsize = '.g:netrw_winsize
|
||||
|
||||
put =''
|
||||
put ='+ For help, place cursor on line and press ?'
|
||||
|
||||
1d
|
||||
silent %s/^+/"/e
|
||||
res 99
|
||||
silent %s/= \([^0-9].*\)$/= '\1'/e
|
||||
silent %s/= $/= ''/e
|
||||
1
|
||||
|
||||
set nomod
|
||||
|
||||
map <buffer> <silent> ? :call NetrwSettingHelp()<cr>
|
||||
let tmpfile= tempname()
|
||||
exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod'
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwSettingHelp: {{{2
|
||||
fun! NetrwSettingHelp()
|
||||
" call Dfunc("NetrwSettingHelp()")
|
||||
let curline = getline(".")
|
||||
if curline =~ '='
|
||||
let varhelp = substitute(curline,'^\s*let ','','e')
|
||||
let varhelp = substitute(varhelp,'\s*=.*$','','e')
|
||||
" call Decho("trying help ".varhelp)
|
||||
try
|
||||
exe "he ".varhelp
|
||||
catch /^Vim\%((\a\+)\)\=:E149/
|
||||
echo "***sorry*** no help available for <".varhelp.">"
|
||||
endtry
|
||||
elseif line(".") < s:netrw_settings_stop
|
||||
he netrw-settings
|
||||
elseif line(".") < s:netrw_protocol_stop
|
||||
he netrw-externapp
|
||||
elseif line(".") < s:netrw_xfer_stop
|
||||
he netrw-variables
|
||||
else
|
||||
he netrw-browse-var
|
||||
endif
|
||||
" call Dret("NetrwSettingHelp")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Modelines: {{{1
|
||||
" vim:ts=8 fdm=marker
|
||||
351
runtime/autoload/pycomplete.vim
Normal file
351
runtime/autoload/pycomplete.vim
Normal file
@@ -0,0 +1,351 @@
|
||||
"pycomplete.vim - Omni Completion for python
|
||||
" Maintainer: Aaron Griffin
|
||||
" Version: 0.3
|
||||
" Last Updated: 23 January 2006
|
||||
"
|
||||
" v0.3 Changes:
|
||||
" added top level def parsing
|
||||
" for safety, call returns are not evaluated
|
||||
" handful of parsing changes
|
||||
" trailing ( and . characters
|
||||
" argument completion on open parens
|
||||
" stop parsing at current line - ++performance, local var resolution
|
||||
"
|
||||
" TODO
|
||||
" RExec subclass
|
||||
" Code cleanup + make class
|
||||
" use internal dict, not globals()
|
||||
|
||||
if !has('python')
|
||||
echo "Error: Required vim compiled with +python"
|
||||
finish
|
||||
endif
|
||||
|
||||
function! pycomplete#Complete(findstart, base)
|
||||
"findstart = 1 when we need to get the text length
|
||||
if a:findstart
|
||||
let line = getline('.')
|
||||
let idx = col('.')
|
||||
while idx > 0
|
||||
let idx -= 1
|
||||
let c = line[idx-1]
|
||||
if c =~ '\w'
|
||||
continue
|
||||
elseif ! c =~ '\.'
|
||||
idx = -1
|
||||
break
|
||||
else
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
|
||||
return idx
|
||||
"findstart = 0 when we need to return the list of completions
|
||||
else
|
||||
execute "python get_completions('" . a:base . "')"
|
||||
return g:pycomplete_completions
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:DefPython()
|
||||
python << PYTHONEOF
|
||||
import vim, sys, types
|
||||
import __builtin__
|
||||
import tokenize, keyword, cStringIO
|
||||
|
||||
LOCALDEFS = \
|
||||
['LOCALDEFS', 'clean_up','eval_source_code', \
|
||||
'get_completions', '__builtin__', '__builtins__', \
|
||||
'dbg', '__name__', 'vim', 'sys', 'parse_to_end', \
|
||||
'parse_statement', 'tokenize', 'keyword', 'cStringIO', \
|
||||
'debug_level', 'safe_eval', '_ctor', 'get_arguments', \
|
||||
'strip_calls', 'types', 'parse_block']
|
||||
|
||||
def dbg(level,msg):
|
||||
debug_level = 1
|
||||
try:
|
||||
debug_level = vim.eval("g:pycomplete_debug_level")
|
||||
except:
|
||||
pass
|
||||
if level <= debug_level: print(msg)
|
||||
|
||||
def strip_calls(stmt):
|
||||
parsed=''
|
||||
level = 0
|
||||
for c in stmt:
|
||||
if c in ['[','(']:
|
||||
level += 1
|
||||
elif c in [')',']']:
|
||||
level -= 1
|
||||
elif level == 0:
|
||||
parsed += c
|
||||
##dbg(10,"stripped: %s" % parsed)
|
||||
return parsed
|
||||
|
||||
def get_completions(base):
|
||||
stmt = vim.eval('expand("<cWORD>")')
|
||||
#dbg(1,"statement: %s - %s" % (stmt, base))
|
||||
stmt = stmt+base
|
||||
eval_source_code()
|
||||
|
||||
try:
|
||||
ridx = stmt.rfind('.')
|
||||
if stmt[-1] == '(':
|
||||
match = ""
|
||||
stmt = strip_calls(stmt[:len(stmt)-1])
|
||||
all = get_arguments(eval(stmt))
|
||||
elif ridx == -1:
|
||||
match = stmt
|
||||
all = globals() + __builtin__.__dict__
|
||||
else:
|
||||
match = stmt[ridx+1:]
|
||||
stmt = strip_calls(stmt[:ridx])
|
||||
all = eval(stmt).__dict__
|
||||
|
||||
#dbg(15,"completions for: %s, match=%s" % (stmt,match))
|
||||
completions = []
|
||||
if type(all) == types.DictType:
|
||||
for m in all:
|
||||
if m.find('_') != 0 and m.find(match) == 0 and \
|
||||
m not in LOCALDEFS:
|
||||
#dbg(25,"matched... %s, %s" % (m, m.find(match)))
|
||||
typestr = str(all[m])
|
||||
if "function" in typestr: m += '('
|
||||
elif "method" in typestr: m += '('
|
||||
elif "module" in typestr: m += '.'
|
||||
elif "class" in typestr: m += '('
|
||||
completions.append(m)
|
||||
completions.sort()
|
||||
else:
|
||||
completions.append(all)
|
||||
#dbg(10,"all completions: %s" % completions)
|
||||
vim.command("let g:pycomplete_completions = %s" % completions)
|
||||
except:
|
||||
vim.command("let g:pycomplete_completions = []")
|
||||
#dbg(1,"exception: %s" % sys.exc_info()[1])
|
||||
clean_up()
|
||||
|
||||
def get_arguments(func_obj):
|
||||
def _ctor(obj):
|
||||
try:
|
||||
return class_ob.__init__.im_func
|
||||
except AttributeError:
|
||||
for base in class_ob.__bases__:
|
||||
rc = _find_constructor(base)
|
||||
if rc is not None: return rc
|
||||
return None
|
||||
|
||||
arg_offset = 1
|
||||
if type(func_obj) == types.ClassType: func_obj = _ctor(func_obj)
|
||||
elif type(func_obj) == types.MethodType: func_obj = func_obj.im_func
|
||||
else: arg_offset = 0
|
||||
|
||||
#dbg(20,"%s, offset=%s" % (str(func_obj), arg_offset))
|
||||
|
||||
arg_text = ''
|
||||
if type(func_obj) in [types.FunctionType, types.LambdaType]:
|
||||
try:
|
||||
cd = func_obj.func_code
|
||||
real_args = cd.co_varnames[arg_offset:cd.co_argcount]
|
||||
defaults = func_obj.func_defaults or []
|
||||
defaults = list(map(lambda name: "=%s" % name, defaults))
|
||||
defaults = [""] * (len(real_args)-len(defaults)) + defaults
|
||||
items = map(lambda a,d: a+d, real_args, defaults)
|
||||
if func_obj.func_code.co_flags & 0x4:
|
||||
items.append("...")
|
||||
if func_obj.func_code.co_flags & 0x8:
|
||||
items.append("***")
|
||||
arg_text = ", ".join(items) + ')'
|
||||
|
||||
except:
|
||||
#dbg(1,"exception: %s" % sys.exc_info()[1])
|
||||
pass
|
||||
if len(arg_text) == 0:
|
||||
# The doc string sometimes contains the function signature
|
||||
# this works for alot of C modules that are part of the
|
||||
# standard library
|
||||
doc = getattr(func_obj, '__doc__', '')
|
||||
if doc:
|
||||
doc = doc.lstrip()
|
||||
pos = doc.find('\n')
|
||||
if pos > 0:
|
||||
sigline = doc[:pos]
|
||||
lidx = sigline.find('(')
|
||||
ridx = sigline.find(')')
|
||||
retidx = sigline.find('->')
|
||||
ret = sigline[retidx+2:].strip()
|
||||
if lidx > 0 and ridx > 0:
|
||||
arg_text = sigline[lidx+1:ridx] + ')'
|
||||
if len(ret) > 0: arg_text += ' #returns %s' % ret
|
||||
#dbg(15,"argument completion: %s" % arg_text)
|
||||
return arg_text
|
||||
|
||||
def parse_to_end(gen):
|
||||
stmt=''
|
||||
level = 0
|
||||
for type, str, begin, end, line in gen:
|
||||
if line == vim.eval('getline(\'.\')'): break
|
||||
elif str == '\\': continue
|
||||
elif str == ';':
|
||||
break
|
||||
elif type == tokenize.NEWLINE and level == 0:
|
||||
break
|
||||
elif str in ['[','(']:
|
||||
level += 1
|
||||
elif str in [')',']']:
|
||||
level -= 1
|
||||
elif level == 0:
|
||||
stmt += str
|
||||
#dbg(10,"current statement: %s" % stmt)
|
||||
return stmt
|
||||
|
||||
def parse_block(gen):
|
||||
lines = []
|
||||
level = 0
|
||||
for type, str, begin, end, line in gen:
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif type == tokenize.INDENT:
|
||||
level += 1
|
||||
elif type == tokenize.DEDENT:
|
||||
level -= 1
|
||||
if level == 0: break;
|
||||
else:
|
||||
stmt = parse_statement(gen,str)
|
||||
if len(stmt) > 0: lines.append(stmt)
|
||||
return lines
|
||||
|
||||
def parse_statement(gen,curstr=''):
|
||||
var = curstr
|
||||
type, str, begin, end, line = gen.next()
|
||||
if str == '=':
|
||||
type, str, begin, end, line = gen.next()
|
||||
if type == tokenize.NEWLINE:
|
||||
return ''
|
||||
elif type == tokenize.STRING or str == 'str':
|
||||
return '%s = str' % var
|
||||
elif str == '[' or str == 'list':
|
||||
return '%s= list' % var
|
||||
elif str == '{' or str == 'dict':
|
||||
return '%s = dict' % var
|
||||
elif type == tokenize.NUMBER:
|
||||
return '%s = 0' % var
|
||||
elif str == 'Set':
|
||||
return '%s = Set' % var
|
||||
elif str == 'open' or str == 'file':
|
||||
return '%s = file' % var
|
||||
else:
|
||||
inst = str + parse_to_end(gen)
|
||||
if len(inst) > 0:
|
||||
#dbg(5,"found [%s = %s]" % (var, inst))
|
||||
return '%s = %s' % (var, inst)
|
||||
return ''
|
||||
|
||||
def eval_source_code():
|
||||
LINE=vim.eval('getline(\'.\')')
|
||||
s = cStringIO.StringIO('\n'.join(vim.current.buffer[:]) + '\n')
|
||||
g = tokenize.generate_tokens(s.readline)
|
||||
|
||||
stmts = []
|
||||
lineNo = 0
|
||||
try:
|
||||
for type, str, begin, end, line in g:
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif begin[0] == lineNo: continue
|
||||
#junk
|
||||
elif type == tokenize.INDENT or \
|
||||
type == tokenize.DEDENT or \
|
||||
type == tokenize.ERRORTOKEN or \
|
||||
type == tokenize.ENDMARKER or \
|
||||
type == tokenize.NEWLINE or \
|
||||
type == tokenize.COMMENT:
|
||||
continue
|
||||
#import statement
|
||||
elif str == 'import':
|
||||
import_stmt=parse_to_end(g)
|
||||
if len(import_stmt) > 0:
|
||||
#dbg(5,"found [import %s]" % import_stmt)
|
||||
stmts.append("import %s" % import_stmt)
|
||||
#import from statement
|
||||
elif str == 'from':
|
||||
type, str, begin, end, line = g.next()
|
||||
mod = str
|
||||
|
||||
type, str, begin, end, line = g.next()
|
||||
if str != "import": break
|
||||
from_stmt=parse_to_end(g)
|
||||
if len(from_stmt) > 0:
|
||||
#dbg(5,"found [from %s import %s]" % (mod, from_stmt))
|
||||
stmts.append("from %s import %s" % (mod, from_stmt))
|
||||
#def statement
|
||||
elif str == 'def':
|
||||
funcstr = ''
|
||||
for type, str, begin, end, line in g:
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif str == ':':
|
||||
stmts += parse_block(g)
|
||||
break
|
||||
funcstr += str
|
||||
if len(funcstr) > 0:
|
||||
#dbg(5,"found [def %s]" % funcstr)
|
||||
stmts.append("def %s:\n pass" % funcstr)
|
||||
#class declaration
|
||||
elif str == 'class':
|
||||
type, str, begin, end, line = g.next()
|
||||
classname = str
|
||||
#dbg(5,"found [class %s]" % classname)
|
||||
|
||||
level = 0
|
||||
members = []
|
||||
for type, str, begin, end, line in g:
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif type == tokenize.INDENT:
|
||||
level += 1
|
||||
elif type == tokenize.DEDENT:
|
||||
level -= 1
|
||||
if level == 0: break;
|
||||
elif str == 'def':
|
||||
memberstr = ''
|
||||
for type, str, begin, end, line in g:
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif str == ':':
|
||||
stmts += parse_block(g)
|
||||
break
|
||||
memberstr += str
|
||||
#dbg(5," member [%s]" % memberstr)
|
||||
members.append(memberstr)
|
||||
classstr = 'class %s:' % classname
|
||||
for m in members:
|
||||
classstr += ("\n def %s:\n pass" % m)
|
||||
stmts.append("%s\n" % classstr)
|
||||
elif keyword.iskeyword(str) or str in globals():
|
||||
#dbg(5,"keyword = %s" % str)
|
||||
lineNo = begin[0]
|
||||
else:
|
||||
assign = parse_statement(g,str)
|
||||
if len(assign) > 0: stmts.append(assign)
|
||||
|
||||
for s in stmts:
|
||||
try:
|
||||
#dbg(15,"evaluating: %s\n" % s)
|
||||
exec(s) in globals()
|
||||
except:
|
||||
#dbg(1,"exception: %s" % sys.exc_info()[1])
|
||||
pass
|
||||
except:
|
||||
#dbg(1,"exception: %s" % sys.exc_info()[1])
|
||||
pass
|
||||
|
||||
def clean_up():
|
||||
for o in globals().keys():
|
||||
if o not in LOCALDEFS:
|
||||
try:
|
||||
exec('del %s' % o) in globals()
|
||||
except: pass
|
||||
|
||||
sys.path.extend(['.','..'])
|
||||
PYTHONEOF
|
||||
endfunction
|
||||
|
||||
let g:pycomplete_debug_level = 0
|
||||
call s:DefPython()
|
||||
" vim: set et ts=4:
|
||||
179
runtime/autoload/syntaxcomplete.vim
Normal file
179
runtime/autoload/syntaxcomplete.vim
Normal file
@@ -0,0 +1,179 @@
|
||||
" Vim completion script
|
||||
" Language: All languages, uses existing syntax highlighting rules
|
||||
" Maintainer: David Fishburn <fishburn@ianywhere.com>
|
||||
" Version: 1.0
|
||||
" Last Change: Sun Jan 08 2006 10:17:51 PM
|
||||
|
||||
" Set completion with CTRL-X CTRL-O to autoloaded function.
|
||||
if exists('&ofu')
|
||||
setlocal ofu=syntaxcomplete#Complete
|
||||
endif
|
||||
|
||||
if exists('g:loaded_syntax_completion')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntax_completion = 1
|
||||
|
||||
" This script will build a completion list based on the syntax
|
||||
" elements defined by the files in $VIMRUNTIME/syntax.
|
||||
|
||||
let s:syn_remove_words = 'match,matchgroup=,contains,'.
|
||||
\ 'links to,start=,end=,nextgroup='
|
||||
|
||||
let s:cache_name = []
|
||||
let s:cache_list = []
|
||||
|
||||
" This function is used for the 'omnifunc' option.
|
||||
function! syntaxcomplete#Complete(findstart, base)
|
||||
|
||||
if a:findstart
|
||||
" Locate the start of the item, including "."
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
let lastword = -1
|
||||
while start > 0
|
||||
if line[start - 1] =~ '\w'
|
||||
let start -= 1
|
||||
elseif line[start - 1] =~ '\.'
|
||||
" The user must be specifying a column name
|
||||
if lastword == -1
|
||||
let lastword = start
|
||||
endif
|
||||
let start -= 1
|
||||
let b:sql_compl_type = 'column'
|
||||
else
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" Return the column of the last word, which is going to be changed.
|
||||
" Remember the text that comes before it in s:prepended.
|
||||
if lastword == -1
|
||||
let s:prepended = ''
|
||||
return start
|
||||
endif
|
||||
let s:prepended = strpart(line, start, lastword - start)
|
||||
return lastword
|
||||
endif
|
||||
|
||||
let base = s:prepended . a:base
|
||||
|
||||
let list_idx = index(s:cache_name, &filetype, 0, &ignorecase)
|
||||
if list_idx > -1
|
||||
let compl_list = s:cache_list[list_idx]
|
||||
else
|
||||
let compl_list = s:SyntaxList()
|
||||
let s:cache_name = add( s:cache_name, &filetype )
|
||||
let s:cache_list = add( s:cache_list, compl_list )
|
||||
endif
|
||||
|
||||
" Return list of matches.
|
||||
|
||||
if base =~ '\w'
|
||||
let compstr = join(compl_list, ' ')
|
||||
let compstr = substitute(compstr, '\<\%('.base.'\)\@!\w\+\s*', '', 'g')
|
||||
let compl_list = split(compstr, '\s\+')
|
||||
endif
|
||||
|
||||
return compl_list
|
||||
endfunc
|
||||
|
||||
function! s:SyntaxList()
|
||||
let saveL = @l
|
||||
|
||||
" Loop through all the syntax groupnames, and build a
|
||||
" syntax file which contains these names. This can
|
||||
" work generically for any filetype that does not already
|
||||
" have a plugin defined.
|
||||
" This ASSUMES the syntax groupname BEGINS with the name
|
||||
" of the filetype. From my casual viewing of the vim7\sytax
|
||||
" directory.
|
||||
redir @l
|
||||
silent! exec 'syntax list '
|
||||
redir END
|
||||
|
||||
let syntax_groups = @l
|
||||
let @l = saveL
|
||||
|
||||
if syntax_groups =~ 'E28'
|
||||
\ || syntax_groups =~ 'E411'
|
||||
\ || syntax_groups =~ 'E415'
|
||||
\ || syntax_groups =~ 'No sytax items'
|
||||
return -1
|
||||
endif
|
||||
|
||||
" Abort names - match, links to, matchgroup=, start=, contains=, contained,
|
||||
" cluster=, nextgroup=, end=
|
||||
let next_group_regex = '\n' .
|
||||
\ '\zs'.&filetype.'\w\+\ze'.
|
||||
\ '\s\+xxx\s\+'.
|
||||
\ '\<\('.
|
||||
\ substitute(s:syn_remove_words, ',', '\\|', 'g').
|
||||
\ '\)\@!'
|
||||
let syn_list = ''
|
||||
let index = 0
|
||||
let index = match(syntax_groups, next_group_regex, index)
|
||||
|
||||
|
||||
while index > 0
|
||||
let group_name = matchstr( syntax_groups, '\w\+', index )
|
||||
|
||||
let extra_syn_list = s:SyntaxGroupItems(group_name)
|
||||
|
||||
let syn_list = syn_list . extra_syn_list . "\n"
|
||||
|
||||
let index = index + strlen(group_name)
|
||||
let index = match(syntax_groups, next_group_regex, index)
|
||||
endwhile
|
||||
|
||||
return sort(split(syn_list))
|
||||
endfunction
|
||||
|
||||
function! s:SyntaxGroupItems( group_name )
|
||||
let saveL = @l
|
||||
|
||||
" Generate (based on the syntax highlight rules) a list of
|
||||
" the Statements, functions, keywords and so on available
|
||||
" If this needs updating, the syntax\sql.vim file should be
|
||||
" updated
|
||||
redir @l
|
||||
silent! exec 'syntax list ' . a:group_name
|
||||
redir END
|
||||
|
||||
if @l !~ 'E28'
|
||||
" let syn_list = substitute( @l, '^.*xxx\s*\%(contained\s*\)\?', "", '' )
|
||||
let syn_list = substitute( @l, '^.*xxx\s*', "", '' )
|
||||
|
||||
" We only want the words for the lines begining with
|
||||
" containedin, but there could be other items.
|
||||
|
||||
" Tried to remove all lines that do not begin with contained
|
||||
" but this does not work in all cases since you can have
|
||||
" contained nextgroup=...
|
||||
" So this will strip off the ending of lines with known
|
||||
" keywords.
|
||||
let syn_list = substitute( syn_list, '\<\('.
|
||||
\ substitute(
|
||||
\ escape( s:syn_remove_words, '\\/.*$^~[]')
|
||||
\ , ',', '\\|', 'g').
|
||||
\ '\).\{-}\%($\|'."\n".'\)'
|
||||
\ , "\n", 'g' )
|
||||
|
||||
" Now strip off the newline + blank space + contained
|
||||
let syn_list = substitute( syn_list, '\%(^\|\n\)\@<=\s*\<\('.
|
||||
\ 'contained\)'
|
||||
\ , "", 'g' )
|
||||
|
||||
" There are a number of items which have non-word characters in
|
||||
" them, *'T_F1'*. vim.vim is one such file.
|
||||
" This will replace non-word characters with spaces.
|
||||
let syn_list = substitute( syn_list, '[^0-9A-Za-z_ ]', ' ', 'g' )
|
||||
else
|
||||
let syn_list = ''
|
||||
endif
|
||||
|
||||
let @l = saveL
|
||||
|
||||
return syn_list
|
||||
endfunction
|
||||
|
||||
333
runtime/autoload/tar.vim
Normal file
333
runtime/autoload/tar.vim
Normal file
@@ -0,0 +1,333 @@
|
||||
" tar.vim: Handles browsing tarfiles
|
||||
" AUTOLOAD PORTION
|
||||
" Date: Dec 24, 2005
|
||||
" Version: 7
|
||||
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
||||
" License: Vim License (see vim's :help license)
|
||||
"
|
||||
" Contains many ideas from Michael Toren's <tar.vim>
|
||||
"
|
||||
" Copyright: Copyright (C) 2005 Charles E. Campbell, Jr. {{{1
|
||||
" Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this copyright
|
||||
" notice is copied with it. Like anything else that's free,
|
||||
" tarPlugin.vim is provided *as is* and comes with no warranty
|
||||
" of any kind, either expressed or implied. By using this
|
||||
" plugin, you agree that in no event will the copyright
|
||||
" holder be liable for any damages resulting from the use
|
||||
" of this software.
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Initialization: {{{1
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
if exists("g:loaded_tar")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_tar= "v7"
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Default Settings: {{{1
|
||||
if !exists("g:tar_browseoptions")
|
||||
let g:tar_browseoptions= "Ptf"
|
||||
endif
|
||||
if !exists("g:tar_readoptions")
|
||||
let g:tar_readoptions= "OPxf"
|
||||
endif
|
||||
if !exists("g:tar_writeoptions")
|
||||
let g:tar_writeoptions= "uf"
|
||||
endif
|
||||
|
||||
" ----------------
|
||||
" Functions: {{{1
|
||||
" ----------------
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" tar#Browse: {{{2
|
||||
fun! tar#Browse(tarfile)
|
||||
" call Dfunc("tar#Browse(tarfile<".a:tarfile.">)")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
|
||||
" sanity checks
|
||||
if !executable("tar")
|
||||
echohl Error | echo '***error*** (tar#Browse) "tar" not available on your system'
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Browse")
|
||||
return
|
||||
endif
|
||||
if !filereadable(a:tarfile)
|
||||
if a:tarfile !~# '^\a\+://'
|
||||
" if its an url, don't complain, let url-handlers such as vim do its thing
|
||||
echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
endif
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Browse : file<".a:tarfile."> not readable")
|
||||
return
|
||||
endif
|
||||
if &ma != 1
|
||||
set ma
|
||||
endif
|
||||
let w:tarfile= a:tarfile
|
||||
|
||||
setlocal noswapfile
|
||||
setlocal buftype=nofile
|
||||
setlocal bufhidden=hide
|
||||
setlocal nobuflisted
|
||||
setlocal nowrap
|
||||
set ft=tar
|
||||
|
||||
" give header
|
||||
exe "$put ='".'\"'." tar.vim version ".g:loaded_tar."'"
|
||||
exe "$put ='".'\"'." Browsing tarfile ".a:tarfile."'"
|
||||
exe "$put ='".'\"'." Select a file with cursor and press ENTER"."'"
|
||||
0d
|
||||
$
|
||||
|
||||
if a:tarfile =~# '\.\(gz\|tgz\)$'
|
||||
exe "silent r! gzip -d -c '".a:tarfile."'| tar -".g:tar_browseoptions." - "
|
||||
elseif a:tarfile =~# '\.bz2$'
|
||||
exe "silent r! bzip2 -d -c '".a:tarfile."'| tar -".g:tar_browseoptions." - "
|
||||
else
|
||||
exe "silent r! tar -".g:tar_browseoptions." '".a:tarfile."'"
|
||||
endif
|
||||
silent %g@/$@d
|
||||
|
||||
setlocal noma nomod ro
|
||||
noremap <silent> <buffer> <cr> :call <SID>TarBrowseSelect()<cr>
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Browse : w:tarfile<".w:tarfile.">")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" TarBrowseSelect: {{{2
|
||||
fun! s:TarBrowseSelect()
|
||||
" call Dfunc("TarBrowseSelect() w:tarfile<".w:tarfile."> curfile<".expand("%").">")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
let fname= getline(".")
|
||||
" call Decho("fname<".fname.">")
|
||||
|
||||
" sanity check
|
||||
if fname =~ '^"'
|
||||
let &report= repkeep
|
||||
" call Dret("TarBrowseSelect")
|
||||
return
|
||||
endif
|
||||
|
||||
" about to make a new window, need to use w:tarfile
|
||||
let tarfile= w:tarfile
|
||||
let curfile= expand("%")
|
||||
|
||||
new
|
||||
wincmd _
|
||||
let s:tblfile_{winnr()}= curfile
|
||||
" call Decho("exe e tarfile:".tarfile.':'.fname)
|
||||
exe "e tarfile:".tarfile.':'.fname
|
||||
filetype detect
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("TarBrowseSelect : s:tblfile_".winnr()."<".s:tblfile_{winnr()}.">")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" tar#Read: {{{2
|
||||
fun! tar#Read(fname,mode)
|
||||
" call Dfunc("tar#Read(fname<".a:fname.">,mode=".a:mode.")")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
let tarfile = substitute(a:fname,'tarfile:\(.\{-}\):.*$','\1','')
|
||||
let fname = substitute(a:fname,'tarfile:.\{-}:\(.*\)$','\1','')
|
||||
" call Decho("tarfile<".tarfile."> fname<".fname.">")
|
||||
|
||||
if tarfile =~# '\.\(gz\|tgz\)$'
|
||||
" call Decho("exe silent r! gzip -d -c '".tarfile."'| tar -OPxf - '".fname."'")
|
||||
exe "silent r! gzip -d -c '".tarfile."'| tar -".g:tar_readoptions." - '".fname."'"
|
||||
elseif tarfile =~# '\.bz2$'
|
||||
" call Decho("exe silent r! bzip2 -d -c '".tarfile."'| tar -".g:tar_readoptions." - '".fname."'")
|
||||
exe "silent r! bzip2 -d -c '".tarfile."'| tar -".g:tar_readoptions." - '".fname."'"
|
||||
else
|
||||
" call Decho("exe silent r! tar -".g:tar_readoptions." '".tarfile."' '".fname."'")
|
||||
exe "silent r! tar -".g:tar_readoptions." '".tarfile."' '".fname."'"
|
||||
endif
|
||||
let w:tarfile= a:fname
|
||||
exe "file tarfile:".fname
|
||||
|
||||
" cleanup
|
||||
0d
|
||||
set nomod
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Read : w:tarfile<".w:tarfile.">")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" tar#Write: {{{2
|
||||
fun! tar#Write(fname)
|
||||
" call Dfunc("tar#Write(fname<".a:fname.">) w:tarfile<".w:tarfile."> tblfile_".winnr()."<".s:tblfile_{winnr()}.">")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
|
||||
" sanity checks
|
||||
if !executable("tar")
|
||||
echohl Error | echo '***error*** (tar#Browse) "tar" not available on your system'
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Write")
|
||||
return
|
||||
endif
|
||||
if !exists("*mkdir")
|
||||
echohl Error | echo "***error*** (tar#Write) sorry, mkdir() doesn't work on your system" | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Write")
|
||||
return
|
||||
endif
|
||||
|
||||
let curdir= getcwd()
|
||||
let tmpdir= tempname()
|
||||
" call Decho("orig tempname<".tmpdir.">")
|
||||
if tmpdir =~ '\.'
|
||||
let tmpdir= substitute(tmpdir,'\.[^.]*$','','e')
|
||||
endif
|
||||
" call Decho("tmpdir<".tmpdir.">")
|
||||
call mkdir(tmpdir,"p")
|
||||
|
||||
" attempt to change to the indicated directory
|
||||
try
|
||||
exe "cd ".escape(tmpdir,' \')
|
||||
catch /^Vim\%((\a\+)\)\=:E344/
|
||||
echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Write")
|
||||
return
|
||||
endtry
|
||||
" call Decho("current directory now: ".getcwd())
|
||||
|
||||
" place temporary files under .../_ZIPVIM_/
|
||||
if isdirectory("_ZIPVIM_")
|
||||
call s:Rmdir("_ZIPVIM_")
|
||||
endif
|
||||
call mkdir("_ZIPVIM_")
|
||||
cd _ZIPVIM_
|
||||
" call Decho("current directory now: ".getcwd())
|
||||
|
||||
let tarfile = substitute(w:tarfile,'tarfile:\(.\{-}\):.*$','\1','')
|
||||
let fname = substitute(w:tarfile,'tarfile:.\{-}:\(.*\)$','\1','')
|
||||
|
||||
" handle compressed archives
|
||||
if tarfile =~# '\.gz'
|
||||
call system("gzip -d ".tarfile)
|
||||
let tarfile = substitute(tarfile,'\.gz','','e')
|
||||
let compress= "gzip '".tarfile."'"
|
||||
elseif tarfile =~# '\.tgz'
|
||||
call system("gzip -d ".tarfile)
|
||||
let tarfile = substitute(tarfile,'\.tgz','.tar','e')
|
||||
let compress= "gzip '".tarfile."'"
|
||||
let tgz = 1
|
||||
elseif tarfile =~# '\.bz2'
|
||||
call system("bzip2 -d ".tarfile)
|
||||
let tarfile = substitute(tarfile,'\.bz2','','e')
|
||||
let compress= "bzip2 '".tarfile."'"
|
||||
endif
|
||||
|
||||
if v:shell_error != 0
|
||||
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
else
|
||||
|
||||
" call Decho("tarfile<".tarfile."> fname<".fname.">")
|
||||
|
||||
if fname =~ '/'
|
||||
let dirpath = substitute(fname,'/[^/]\+$','','e')
|
||||
if executable("cygpath")
|
||||
let dirpath = substitute(system("cygpath ".dirpath),'\n','','e')
|
||||
endif
|
||||
call mkdir(dirpath,"p")
|
||||
endif
|
||||
if tarfile !~ '/'
|
||||
let tarfile= curdir.'/'.tarfile
|
||||
endif
|
||||
" call Decho("tarfile<".tarfile."> fname<".fname.">")
|
||||
|
||||
exe "w! ".fname
|
||||
if executable("cygpath")
|
||||
let tarfile = substitute(system("cygpath ".tarfile),'\n','','e')
|
||||
endif
|
||||
|
||||
" delete old file from tarfile
|
||||
" call Decho("tar --delete -f '".tarfile."' '".fname."'")
|
||||
call system("tar --delete -f '".tarfile."' '".fname."'")
|
||||
if v:shell_error != 0
|
||||
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
else
|
||||
|
||||
" update tarfile with new file
|
||||
" call Decho("tar -".g:tar_writeoptions." '".tarfile."' '".fname."'")
|
||||
call system("tar -".g:tar_writeoptions." '".tarfile."' '".fname."'")
|
||||
if v:shell_error != 0
|
||||
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
elseif exists("compress")
|
||||
" call Decho("call system(".compress.")")
|
||||
call system(compress)
|
||||
if exists("tgz")
|
||||
" call Decho("rename(".tarfile.".gz,".substitute(tarfile,'\.tar$','.tgz','e').")")
|
||||
call rename(tarfile.".gz",substitute(tarfile,'\.tar$','.tgz','e'))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
" support writing tarfiles across a network
|
||||
if s:tblfile_{winnr()} =~ '^\a\+://'
|
||||
" call Decho("handle writing <".tarfile."> across network to <".s:tblfile_{winnr()}.">")
|
||||
let tblfile= s:tblfile_{winnr()}
|
||||
1split|enew
|
||||
let binkeep= &binary
|
||||
let eikeep = &ei
|
||||
set binary ei=all
|
||||
exe "e! ".tarfile
|
||||
call netrw#NetWrite(tblfile)
|
||||
let &ei = eikeep
|
||||
let &binary = binkeep
|
||||
q!
|
||||
unlet s:tblfile_{winnr()}
|
||||
endif
|
||||
endif
|
||||
|
||||
" cleanup and restore current directory
|
||||
cd ..
|
||||
call s:Rmdir("_ZIPVIM_")
|
||||
exe "cd ".escape(curdir,' \')
|
||||
setlocal nomod
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Write")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Rmdir: {{{2
|
||||
fun! s:Rmdir(fname)
|
||||
" call Dfunc("Rmdir(fname<".a:fname.">)")
|
||||
if has("unix")
|
||||
call system("/bin/rm -rf ".a:fname)
|
||||
elseif has("win32") || has("win95") || has("win64") || has("win16")
|
||||
if &shell =~? "sh$"
|
||||
call system("/bin/rm -rf ".a:fname)
|
||||
else
|
||||
call system("del /S ".a:fname)
|
||||
endif
|
||||
endif
|
||||
" call Dret("Rmdir")
|
||||
endfun
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" Modelines And Restoration: {{{1
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
" vim:ts=8 fdm=marker
|
||||
467
runtime/autoload/xmlcomplete.vim
Normal file
467
runtime/autoload/xmlcomplete.vim
Normal file
@@ -0,0 +1,467 @@
|
||||
" Vim completion script
|
||||
" Language: XML
|
||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2006 Jan 24
|
||||
|
||||
" This function will create Dictionary with users namespace strings and values
|
||||
" canonical (system) names of data files. Names should be lowercase,
|
||||
" descriptive to avoid any future conflicts. For example 'xhtml10s' should be
|
||||
" name for data of XHTML 1.0 Strict and 'xhtml10t' for XHTML 1.0 Transitional
|
||||
" User interface will be provided by XMLns command defined ...
|
||||
" Currently supported canonicals are:
|
||||
" xhtml10s - XHTML 1.0 Strict
|
||||
" xsl - XSL
|
||||
function! xmlcomplete#CreateConnection(canonical, ...)
|
||||
|
||||
" When only one argument provided treat name as default namespace (without
|
||||
" 'prefix:').
|
||||
if exists("a:1")
|
||||
let users = a:1
|
||||
else
|
||||
let users = 'DEFAULT'
|
||||
endif
|
||||
|
||||
" Source data file. Due to suspected errors in autoload do it with
|
||||
" :runtime.
|
||||
" TODO: make it properly (using autoload, that is) later
|
||||
exe "runtime autoload/xml/".a:canonical.".vim"
|
||||
|
||||
" Remove all traces of unexisting files to return [] when trying
|
||||
" omnicomplete something
|
||||
" TODO: give warning about non-existing canonicals - should it be?
|
||||
if !exists("g:xmldata_".a:canonical)
|
||||
unlet! g:xmldata_connection
|
||||
return 0
|
||||
endif
|
||||
|
||||
" We need to initialize Dictionary to add key-value pair
|
||||
if !exists("g:xmldata_connection")
|
||||
let g:xmldata_connection = {}
|
||||
endif
|
||||
|
||||
let g:xmldata_connection[users] = a:canonical
|
||||
|
||||
endfunction
|
||||
|
||||
function! xmlcomplete#CreateEntConnection(...)
|
||||
if a:0 > 0
|
||||
let g:xmldata_entconnect = a:1
|
||||
else
|
||||
let g:xmldata_entconnect = 'DEFAULT'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! xmlcomplete#CompleteTags(findstart, base)
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let curline = line('.')
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
let compl_begin = col('.') - 2
|
||||
|
||||
while start >= 0 && line[start - 1] =~ '\(\k\|[:.-]\)'
|
||||
let start -= 1
|
||||
endwhile
|
||||
|
||||
if start >= 0 && line[start - 1] =~ '&'
|
||||
let b:entitiescompl = 1
|
||||
let b:compl_context = ''
|
||||
return start
|
||||
endif
|
||||
|
||||
let b:compl_context = getline('.')[0:(compl_begin)]
|
||||
if b:compl_context !~ '<[^>]*$'
|
||||
" Look like we may have broken tag. Check previous lines. Up to
|
||||
" 10?
|
||||
let i = 1
|
||||
while 1
|
||||
let context_line = getline(curline-i)
|
||||
if context_line =~ '<[^>]*$'
|
||||
" Yep, this is this line
|
||||
let context_lines = getline(curline-i, curline)
|
||||
let b:compl_context = join(context_lines, ' ')
|
||||
break
|
||||
elseif context_line =~ '>[^<]*$'
|
||||
" Normal tag line, no need for completion at all
|
||||
let b:compl_context = ''
|
||||
break
|
||||
endif
|
||||
let i += 1
|
||||
endwhile
|
||||
" Make sure we don't have counter
|
||||
unlet! i
|
||||
endif
|
||||
let b:compl_context = matchstr(b:compl_context, '.*\zs<.*')
|
||||
|
||||
" Make sure we will have only current namespace
|
||||
unlet! b:xml_namespace
|
||||
let b:xml_namespace = matchstr(b:compl_context, '^<\zs\k*\ze:')
|
||||
if b:xml_namespace == ''
|
||||
let b:xml_namespace = 'DEFAULT'
|
||||
endif
|
||||
|
||||
return start
|
||||
|
||||
else
|
||||
" There is no connction of namespace and data file. Abandon action
|
||||
if !exists("g:xmldata_connection") || g:xmldata_connection == {}
|
||||
return []
|
||||
endif
|
||||
" Initialize base return lists
|
||||
let res = []
|
||||
let res2 = []
|
||||
" a:base is very short - we need context
|
||||
if len(b:compl_context) == 0 && !exists("b:entitiescompl")
|
||||
return []
|
||||
endif
|
||||
let context = matchstr(b:compl_context, '^<\zs.*')
|
||||
unlet! b:compl_context
|
||||
|
||||
" Make entities completion
|
||||
if exists("b:entitiescompl")
|
||||
unlet! b:entitiescompl
|
||||
|
||||
if !exists("g:xmldata_entconnect") || g:xmldata_entconnect == 'DEFAULT'
|
||||
let values = g:xmldata{'_'.g:xmldata_connection['DEFAULT']}['vimxmlentities']
|
||||
else
|
||||
let values = g:xmldata{'_'.g:xmldata_entconnect}['vimxmlentities']
|
||||
endif
|
||||
|
||||
" Get only lines with entity declarations but throw out
|
||||
" parameter-entities - they may be completed in future
|
||||
let entdecl = filter(getline(1, "$"), 'v:val =~ "<!ENTITY\\s\\+[^%]"')
|
||||
|
||||
if len(entdecl) > 0
|
||||
let intent = map(copy(entdecl), 'matchstr(v:val, "<!ENTITY\\s\\+\\zs\\(\\k\\|[.-:]\\)\\+\\ze")')
|
||||
let values = intent + values
|
||||
endif
|
||||
|
||||
if len(a:base) == 1
|
||||
for m in values
|
||||
if m =~ '^'.a:base
|
||||
call add(res, m.';')
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
else
|
||||
for m in values
|
||||
if m =~? '^'.a:base
|
||||
call add(res, m.';')
|
||||
elseif m =~? a:base
|
||||
call add(res2, m.';')
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
endif
|
||||
|
||||
endif
|
||||
if context =~ '>'
|
||||
" Generally if context contains > it means we are outside of tag and
|
||||
" should abandon action
|
||||
return []
|
||||
endif
|
||||
|
||||
" find tags matching with "a:base"
|
||||
" If a:base contains white space it is attribute.
|
||||
" It could be also value of attribute...
|
||||
" We have to get first word to offer
|
||||
" proper completions
|
||||
if context == ''
|
||||
let tag = ''
|
||||
else
|
||||
let tag = split(context)[0]
|
||||
endif
|
||||
" Get rid of namespace
|
||||
let tag = substitute(tag, '^'.b:xml_namespace.':', '', '')
|
||||
|
||||
|
||||
" Get last word, it should be attr name
|
||||
let attr = matchstr(context, '.*\s\zs.*')
|
||||
" Possible situations where any prediction would be difficult:
|
||||
" 1. Events attributes
|
||||
if context =~ '\s'
|
||||
|
||||
" If attr contains =\s*[\"'] we catched value of attribute
|
||||
if attr =~ "=\s*[\"']"
|
||||
" Let do attribute specific completion
|
||||
let attrname = matchstr(attr, '.*\ze\s*=')
|
||||
let entered_value = matchstr(attr, ".*=\\s*[\"']\\zs.*")
|
||||
|
||||
if tag =~ '^[?!]'
|
||||
" Return nothing if we are inside of ! or ? tag
|
||||
return []
|
||||
else
|
||||
let values = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][attrname]
|
||||
endif
|
||||
|
||||
if len(values) == 0
|
||||
return []
|
||||
endif
|
||||
|
||||
" We need special version of sbase
|
||||
let attrbase = matchstr(context, ".*[\"']")
|
||||
let attrquote = matchstr(attrbase, '.$')
|
||||
|
||||
for m in values
|
||||
" This if is needed to not offer all completions as-is
|
||||
" alphabetically but sort them. Those beginning with entered
|
||||
" part will be as first choices
|
||||
if m =~ '^'.entered_value
|
||||
call add(res, m . attrquote.' ')
|
||||
elseif m =~ entered_value
|
||||
call add(res2, m . attrquote.' ')
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
|
||||
if tag =~ '?xml'
|
||||
" Two possible arguments for <?xml> plus variation
|
||||
let attrs = ['encoding', 'version="1.0"', 'version']
|
||||
elseif tag =~ '^!'
|
||||
" Don't make completion at all
|
||||
return []
|
||||
else
|
||||
let attrs = keys(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1])
|
||||
endif
|
||||
|
||||
for m in sort(attrs)
|
||||
if m =~ '^'.attr
|
||||
if tag !~ '^[?!]' && len(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m]) > 0 && g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m][0] =~ '^BOOL$'
|
||||
call add(res, m)
|
||||
elseif m =~ '='
|
||||
call add(res, m)
|
||||
else
|
||||
call add(res, m.'="')
|
||||
endif
|
||||
elseif m =~ attr
|
||||
if tag !~ '^[?!]' && len(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m]) > 0 && g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m][0] =~ '^BOOL$'
|
||||
call add(res, m)
|
||||
elseif m =~ '='
|
||||
call add(res, m)
|
||||
else
|
||||
call add(res2, m.'="')
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
" Close tag
|
||||
let b:unaryTagsStack = "base meta link hr br param img area input col"
|
||||
if context =~ '^\/'
|
||||
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
|
||||
return [opentag.">"]
|
||||
endif
|
||||
|
||||
" Complete elements of XML structure
|
||||
" TODO: #REQUIRED, #IMPLIED, #FIXED, #PCDATA - but these should be detected like
|
||||
" entities - in first run
|
||||
" keywords: CDATA, ID, IDREF, IDREFS, ENTITY, ENTITIES, NMTOKEN, NMTOKENS
|
||||
" are hardly recognizable but keep it in reserve
|
||||
" also: EMPTY ANY SYSTEM PUBLIC DATA
|
||||
if context =~ '^!'
|
||||
let tags = ['!ELEMENT', '!DOCTYPE', '!ATTLIST', '!ENTITY', '!NOTATION', '![CDATA[', '![INCLUDE[', '![IGNORE[']
|
||||
|
||||
for m in tags
|
||||
if m =~ '^'.context
|
||||
let m = substitute(m, '^!\[\?', '', '')
|
||||
call add(res, m)
|
||||
elseif m =~ context
|
||||
let m = substitute(m, '^!\[\?', '', '')
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
|
||||
" Complete text declaration
|
||||
let g:co = context
|
||||
if context =~ '^?'
|
||||
let tags = ['?xml']
|
||||
|
||||
for m in tags
|
||||
if m =~ '^'.context
|
||||
call add(res, substitute(m, '^?', '', ''))
|
||||
elseif m =~ context
|
||||
call add(res, substitute(m, '^?', '', ''))
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
|
||||
" Deal with tag completion.
|
||||
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
|
||||
let opentag = substitute(opentag, '^\k*:', '', '')
|
||||
if opentag == ''
|
||||
return []
|
||||
endif
|
||||
|
||||
let tags = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[opentag][0]
|
||||
let context = substitute(context, '^\k*:', '', '')
|
||||
|
||||
if b:xml_namespace == 'DEFAULT'
|
||||
let b:xml_namespace = ''
|
||||
else
|
||||
let b:xml_namespace .= ':'
|
||||
endif
|
||||
|
||||
for m in tags
|
||||
if m =~ '^'.context
|
||||
call add(res, b:xml_namespace.m)
|
||||
elseif m =~ context
|
||||
call add(res2, b:xml_namespace.m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" MM: This is greatly reduced closetag.vim used with kind permission of Steven
|
||||
" Mueller
|
||||
" Changes: strip all comments; delete error messages; add checking for
|
||||
" namespace
|
||||
" Author: Steven Mueller <diffusor@ugcs.caltech.edu>
|
||||
" Last Modified: Tue May 24 13:29:48 PDT 2005
|
||||
" Version: 0.9.1
|
||||
|
||||
function! xmlcomplete#GetLastOpenTag(unaryTagsStack)
|
||||
let linenum=line('.')
|
||||
let lineend=col('.') - 1 " start: cursor position
|
||||
let first=1 " flag for first line searched
|
||||
let b:TagStack='' " main stack of tags
|
||||
let startInComment=s:InComment()
|
||||
|
||||
if exists("b:xml_namespace")
|
||||
if b:xml_namespace == 'DEFAULT'
|
||||
let tagpat='</\=\(\k\|[.-]\)\+\|/>'
|
||||
else
|
||||
let tagpat='</\='.b:xml_namespace.':\(\k\|[.-]\)\+\|/>'
|
||||
endif
|
||||
else
|
||||
let tagpat='</\=\(\k\|[.-]\)\+\|/>'
|
||||
endif
|
||||
while (linenum>0)
|
||||
let line=getline(linenum)
|
||||
if first
|
||||
let line=strpart(line,0,lineend)
|
||||
else
|
||||
let lineend=strlen(line)
|
||||
endif
|
||||
let b:lineTagStack=''
|
||||
let mpos=0
|
||||
let b:TagCol=0
|
||||
while (mpos > -1)
|
||||
let mpos=matchend(line,tagpat)
|
||||
if mpos > -1
|
||||
let b:TagCol=b:TagCol+mpos
|
||||
let tag=matchstr(line,tagpat)
|
||||
|
||||
if exists('b:closetag_disable_synID') || startInComment==s:InCommentAt(linenum, b:TagCol)
|
||||
let b:TagLine=linenum
|
||||
call s:Push(matchstr(tag,'[^<>]\+'),'b:lineTagStack')
|
||||
endif
|
||||
let lineend=lineend-mpos
|
||||
let line=strpart(line,mpos,lineend)
|
||||
endif
|
||||
endwhile
|
||||
while (!s:EmptystackP('b:lineTagStack'))
|
||||
let tag=s:Pop('b:lineTagStack')
|
||||
if match(tag, '^/') == 0 "found end tag
|
||||
call s:Push(tag,'b:TagStack')
|
||||
elseif s:EmptystackP('b:TagStack') && !s:Instack(tag, a:unaryTagsStack) "found unclosed tag
|
||||
return tag
|
||||
else
|
||||
let endtag=s:Peekstack('b:TagStack')
|
||||
if endtag == '/'.tag || endtag == '/'
|
||||
call s:Pop('b:TagStack') "found a open/close tag pair
|
||||
elseif !s:Instack(tag, a:unaryTagsStack) "we have a mismatch error
|
||||
return ''
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
let linenum=linenum-1 | let first=0
|
||||
endwhile
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! s:InComment()
|
||||
return synIDattr(synID(line('.'), col('.'), 0), 'name') =~ 'Comment'
|
||||
endfunction
|
||||
|
||||
function! s:InCommentAt(line, col)
|
||||
return synIDattr(synID(a:line, a:col, 0), 'name') =~ 'Comment'
|
||||
endfunction
|
||||
|
||||
function! s:SetKeywords()
|
||||
let g:IsKeywordBak=&iskeyword
|
||||
let &iskeyword='33-255'
|
||||
endfunction
|
||||
|
||||
function! s:RestoreKeywords()
|
||||
let &iskeyword=g:IsKeywordBak
|
||||
endfunction
|
||||
|
||||
function! s:Push(el, sname)
|
||||
if !s:EmptystackP(a:sname)
|
||||
exe 'let '.a:sname."=a:el.' '.".a:sname
|
||||
else
|
||||
exe 'let '.a:sname.'=a:el'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:EmptystackP(sname)
|
||||
exe 'let stack='.a:sname
|
||||
if match(stack,'^ *$') == 0
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:Instack(el, sname)
|
||||
exe 'let stack='.a:sname
|
||||
call s:SetKeywords()
|
||||
let m=match(stack, '\<'.a:el.'\>')
|
||||
call s:RestoreKeywords()
|
||||
if m < 0
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:Peekstack(sname)
|
||||
call s:SetKeywords()
|
||||
exe 'let stack='.a:sname
|
||||
let top=matchstr(stack, '\<.\{-1,}\>')
|
||||
call s:RestoreKeywords()
|
||||
return top
|
||||
endfunction
|
||||
|
||||
function! s:Pop(sname)
|
||||
if s:EmptystackP(a:sname)
|
||||
return ''
|
||||
endif
|
||||
exe 'let stack='.a:sname
|
||||
call s:SetKeywords()
|
||||
let loc=matchend(stack,'\<.\{-1,}\>')
|
||||
exe 'let '.a:sname.'=strpart(stack, loc+1, strlen(stack))'
|
||||
let top=strpart(stack, match(stack, '\<'), loc)
|
||||
call s:RestoreKeywords()
|
||||
return top
|
||||
endfunction
|
||||
|
||||
function! s:Clearstack(sname)
|
||||
exe 'let '.a:sname."=''"
|
||||
endfunction
|
||||
271
runtime/autoload/zip.vim
Normal file
271
runtime/autoload/zip.vim
Normal file
@@ -0,0 +1,271 @@
|
||||
" zip.vim: Handles browsing zipfiles
|
||||
" AUTOLOAD PORTION
|
||||
" Date: Dec 21, 2005
|
||||
" Version: 6
|
||||
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
||||
" License: Vim License (see vim's :help license)
|
||||
" Copyright: Copyright (C) 2005 Charles E. Campbell, Jr. {{{1
|
||||
" Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this copyright
|
||||
" notice is copied with it. Like anything else that's free,
|
||||
" zipPlugin.vim is provided *as is* and comes with no warranty
|
||||
" of any kind, either expressed or implied. By using this
|
||||
" plugin, you agree that in no event will the copyright
|
||||
" holder be liable for any damages resulting from the use
|
||||
" of this software.
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Initialization: {{{1
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
if exists("g:loaded_zip")
|
||||
finish
|
||||
endif
|
||||
|
||||
let g:loaded_zip= "v6"
|
||||
|
||||
" ----------------
|
||||
" Functions: {{{1
|
||||
" ----------------
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" zip#Browse: {{{2
|
||||
fun! zip#Browse(zipfile)
|
||||
" call Dfunc("zip#Browse(zipfile<".a:zipfile.">)")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
|
||||
" sanity checks
|
||||
if !executable("unzip")
|
||||
echohl Error | echo "***error*** (zip#Browse) unzip not available on your system"
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Browse")
|
||||
return
|
||||
endif
|
||||
if !filereadable(a:zipfile)
|
||||
if a:zipfile !~# '^\a\+://'
|
||||
" if its an url, don't complain, let url-handlers such as vim do its thing
|
||||
echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
endif
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Browse : file<".a:zipfile."> not readable")
|
||||
return
|
||||
endif
|
||||
if &ma != 1
|
||||
set ma
|
||||
endif
|
||||
let w:zipfile= a:zipfile
|
||||
|
||||
setlocal noswapfile
|
||||
setlocal buftype=nofile
|
||||
setlocal bufhidden=hide
|
||||
setlocal nobuflisted
|
||||
setlocal nowrap
|
||||
set ft=tar
|
||||
|
||||
" give header
|
||||
exe "$put ='".'\"'." zip.vim version ".g:loaded_zip."'"
|
||||
exe "$put ='".'\"'." Browsing zipfile ".a:zipfile."'"
|
||||
exe "$put ='".'\"'." Select a file with cursor and press ENTER"."'"
|
||||
$put =''
|
||||
0d
|
||||
$
|
||||
|
||||
exe "silent r! unzip -l ".a:zipfile
|
||||
$d
|
||||
silent 4,$v/^\s\+\d\+\s\{0,5}\d/d
|
||||
silent 4,$s/^\%(.*\)\s\+\(\S\)/\1/
|
||||
|
||||
setlocal noma nomod ro
|
||||
noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr>
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Browse")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" ZipBrowseSelect: {{{2
|
||||
fun! s:ZipBrowseSelect()
|
||||
" call Dfunc("ZipBrowseSelect() zipfile<".w:zipfile."> curfile<".expand("%").">")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
let fname= getline(".")
|
||||
|
||||
" sanity check
|
||||
if fname =~ '^"'
|
||||
let &report= repkeep
|
||||
" call Dret("ZipBrowseSelect")
|
||||
return
|
||||
endif
|
||||
if fname =~ '/$'
|
||||
echohl Error | echo "***error*** (zip#Browse) Please specify a file, not a directory" | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("ZipBrowseSelect")
|
||||
return
|
||||
endif
|
||||
|
||||
" call Decho("fname<".fname.">")
|
||||
|
||||
" get zipfile to the new-window
|
||||
let zipfile= substitute(w:zipfile,'.zip$','','e')
|
||||
let curfile= expand("%")
|
||||
|
||||
new
|
||||
wincmd _
|
||||
let s:zipfile_{winnr()}= curfile
|
||||
exe "e zipfile:".zipfile.':'.fname
|
||||
filetype detect
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("ZipBrowseSelect : s:zipfile_".winnr()."<".s:zipfile_{winnr()}.">")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" zip#Read: {{{2
|
||||
fun! zip#Read(fname,mode)
|
||||
" call Dfunc("zip#Read(fname<".a:fname.">,mode=".a:mode.")")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
|
||||
let zipfile = substitute(a:fname,'zipfile:\(.\{-}\):.*$','\1','')
|
||||
let fname = substitute(a:fname,'zipfile:.\{-}:\(.*\)$','\1','')
|
||||
" call Decho("zipfile<".zipfile."> fname<".fname.">")
|
||||
|
||||
exe "r! unzip -p ".zipfile." ".fname
|
||||
|
||||
" cleanup
|
||||
0d
|
||||
set nomod
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Read")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" zip#Write: {{{2
|
||||
fun! zip#Write(fname)
|
||||
" call Dfunc("zip#Write(fname<".a:fname.") zipfile_".winnr()."<".s:zipfile_{winnr()}.">")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
|
||||
" sanity checks
|
||||
if !executable("zip")
|
||||
echohl Error | echo "***error*** (zip#Write) sorry, your system doesn't appear to have the zip pgm" | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Write")
|
||||
return
|
||||
endif
|
||||
if !exists("*mkdir")
|
||||
echohl Error | echo "***error*** (zip#Write) sorry, mkdir() doesn't work on your system" | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Write")
|
||||
return
|
||||
endif
|
||||
|
||||
let curdir= getcwd()
|
||||
let tmpdir= tempname()
|
||||
" call Decho("orig tempname<".tmpdir.">")
|
||||
if tmpdir =~ '\.'
|
||||
let tmpdir= substitute(tmpdir,'\.[^.]*$','','e')
|
||||
endif
|
||||
" call Decho("tmpdir<".tmpdir.">")
|
||||
call mkdir(tmpdir,"p")
|
||||
|
||||
" attempt to change to the indicated directory
|
||||
try
|
||||
exe "cd ".escape(tmpdir,' \')
|
||||
catch /^Vim\%((\a\+)\)\=:E344/
|
||||
echohl Error | echo "***error*** (zip#Write) cannot cd to temporary directory" | Echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Write")
|
||||
return
|
||||
endtry
|
||||
" call Decho("current directory now: ".getcwd())
|
||||
|
||||
" place temporary files under .../_ZIPVIM_/
|
||||
if isdirectory("_ZIPVIM_")
|
||||
call s:Rmdir("_ZIPVIM_")
|
||||
endif
|
||||
call mkdir("_ZIPVIM_")
|
||||
cd _ZIPVIM_
|
||||
" call Decho("current directory now: ".getcwd())
|
||||
|
||||
let zipfile = substitute(a:fname,'zipfile:\(.\{-}\):.*$','\1','')
|
||||
let fname = substitute(a:fname,'zipfile:.\{-}:\(.*\)$','\1','')
|
||||
|
||||
if fname =~ '/'
|
||||
let dirpath = substitute(fname,'/[^/]\+$','','e')
|
||||
if executable("cygpath")
|
||||
let dirpath = substitute(system("cygpath ".dirpath),'\n','','e')
|
||||
endif
|
||||
call mkdir(dirpath,"p")
|
||||
endif
|
||||
if zipfile !~ '/'
|
||||
let zipfile= curdir.'/'.zipfile
|
||||
endif
|
||||
" call Decho("zipfile<".zipfile."> fname<".fname.">")
|
||||
|
||||
exe "w! ".fname
|
||||
if executable("cygpath")
|
||||
let zipfile = substitute(system("cygpath ".zipfile),'\n','','e')
|
||||
endif
|
||||
|
||||
" call Decho("zip -u ".zipfile.".zip ".fname)
|
||||
call system("zip -u ".zipfile.".zip ".fname)
|
||||
if v:shell_error != 0
|
||||
echohl Error | echo "***error*** (zip#Write) sorry, unable to update ".zipfile." with ".fname | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
|
||||
elseif s:zipfile_{winnr()} =~ '^\a\+://'
|
||||
" support writing zipfiles across a network
|
||||
let netzipfile= s:zipfile_{winnr()}
|
||||
" call Decho("handle writing <".zipfile.".zip> across network as <".netzipfile.">")
|
||||
1split|enew
|
||||
let binkeep= &binary
|
||||
let eikeep = &ei
|
||||
set binary ei=all
|
||||
exe "e! ".zipfile.".zip"
|
||||
call netrw#NetWrite(netzipfile)
|
||||
let &ei = eikeep
|
||||
let &binary = binkeep
|
||||
q!
|
||||
unlet s:zipfile_{winnr()}
|
||||
endif
|
||||
|
||||
" cleanup and restore current directory
|
||||
cd ..
|
||||
call s:Rmdir("_ZIPVIM_")
|
||||
exe "cd ".escape(curdir,' \')
|
||||
setlocal nomod
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Write")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Rmdir: {{{2
|
||||
fun! s:Rmdir(fname)
|
||||
" call Dfunc("Rmdir(fname<".a:fname.">)")
|
||||
if has("unix")
|
||||
call system("/bin/rm -rf ".a:fname)
|
||||
elseif has("win32") || has("win95") || has("win64") || has("win16")
|
||||
if &shell =~? "sh$"
|
||||
call system("/bin/rm -rf ".a:fname)
|
||||
else
|
||||
call system("del /S ".a:fname)
|
||||
endif
|
||||
endif
|
||||
" call Dret("Rmdir")
|
||||
endfun
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" Modelines And Restoration: {{{1
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
" vim:ts=8 fdm=marker
|
||||
@@ -2,7 +2,7 @@
|
||||
:" information about the environment of a possible bug in Vim.
|
||||
:"
|
||||
:" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
:" Last change: 2001 Feb 02
|
||||
:" Last change: 2005 Jun 12
|
||||
:"
|
||||
:" To use inside Vim:
|
||||
:" :so $VIMRUNTIME/bugreport.vim
|
||||
@@ -49,6 +49,8 @@
|
||||
: call <SID>CheckFile($VIMRUNTIME . "/syntax/synload.vim")
|
||||
: delfun <SID>CheckDir
|
||||
: delfun <SID>CheckFile
|
||||
: echo "--- Scripts sourced ---"
|
||||
: scriptnames
|
||||
:endif
|
||||
:set all
|
||||
:set termcap
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
" Vim compiler file
|
||||
" Compiler: BDF to PCF Conversion
|
||||
" Maintainer: Nikolai Weibull <sourc@pcppopper.org>
|
||||
" URL: http://www.pcppopper.org/vim/compiler/pcp/bdf/
|
||||
" Latest Revision: 2004-05-22
|
||||
" arch-tag: 2e2f3a55-199b-468c-aa2e-d6b1a7b87806
|
||||
" Compiler: BDF to PCF Conversion
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-06-29
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "bdf"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
@@ -26,5 +20,3 @@ CompilerSet errorformat=%ABDF\ %trror\ on\ line\ %l:\ %m,
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: set sts=2 sw=2:
|
||||
|
||||
41
runtime/compiler/eruby.vim
Normal file
41
runtime/compiler/eruby.vim
Normal file
@@ -0,0 +1,41 @@
|
||||
" Vim compiler file
|
||||
" Language: eRuby
|
||||
" Maintainer: Doug Kearns <djkea2 at gus.gscit.monash.edu.au>
|
||||
" Info: $Id$
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" ----------------------------------------------------------------------------
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "eruby"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
if exists("eruby_compiler") && eruby_compiler == "eruby"
|
||||
CompilerSet makeprg=eruby
|
||||
else
|
||||
CompilerSet makeprg=erb
|
||||
endif
|
||||
|
||||
CompilerSet errorformat=
|
||||
\eruby:\ %f:%l:%m,
|
||||
\%+E%f:%l:\ parse\ error,
|
||||
\%W%f:%l:\ warning:\ %m,
|
||||
\%E%f:%l:in\ %*[^:]:\ %m,
|
||||
\%E%f:%l:\ %m,
|
||||
\%-C%\tfrom\ %f:%l:in\ %.%#,
|
||||
\%-Z%\tfrom\ %f:%l,
|
||||
\%-Z%p^,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 ff=unix:
|
||||
17
runtime/compiler/fpc.vim
Normal file
17
runtime/compiler/fpc.vim
Normal file
@@ -0,0 +1,17 @@
|
||||
" Vim compiler file
|
||||
" Compiler: FPC 2.1
|
||||
" Maintainer: Jaroslaw Blasiok <jaro3000@o2.pl>
|
||||
" Last Change: 2005 October 07
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "fpc"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
" NOTE: compiler must be runned with -vb to write whole source path, not only file
|
||||
" name.
|
||||
CompilerSet errorformat=%f(%l\\,%c)\ %m
|
||||
26
runtime/compiler/gcc.vim
Normal file
26
runtime/compiler/gcc.vim
Normal file
@@ -0,0 +1,26 @@
|
||||
" Vim compiler file
|
||||
" Compiler: GNU C Compiler
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-06-29
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "gcc"
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
setlocal errorformat=
|
||||
\%*[^\"]\"%f\"%*\\D%l:\ %m,
|
||||
\\"%f\"%*\\D%l:\ %m,
|
||||
\%-G%f:%l:\ %trror:\ (Each\ undeclared\ identifier\ is\ reported\ only\ once,
|
||||
\%-G%f:%l:\ %trror:\ for\ each\ function\ it\ appears\ in.),
|
||||
\%f:%l:\ %m,
|
||||
\\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
|
||||
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
|
||||
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
|
||||
\%DMaking\ %*\\a\ in\ %f
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim compiler file
|
||||
" Compiler: HP aCC
|
||||
" Maintainer: Matthias Ulrich <matthias-ulrich@web.de>
|
||||
" URL: http://www.subhome.de/vim/hp_acc.vim
|
||||
" Last Change: 2004 Mar 27
|
||||
" URL: http://www.subhome.de/vim/hp_acc.vim
|
||||
" Last Change: 2005 Nov 19
|
||||
"
|
||||
" aCC --version says: "HP ANSI C++ B3910B A.03.13"
|
||||
" This compiler has been tested on:
|
||||
@@ -10,6 +10,10 @@
|
||||
"
|
||||
" Tim Brown's aCC is: "HP ANSI C++ B3910B A.03.33"
|
||||
" and it also works fine...
|
||||
"
|
||||
" Now suggestions by aCC are supported (compile flag aCC +w).
|
||||
" Thanks to Tim Brown again!!
|
||||
"
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@@ -21,6 +25,7 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
endif
|
||||
|
||||
CompilerSet errorformat=%A%trror\ %n\:\ \"%f\"\\,\ line\ %l\ \#\ %m,
|
||||
\%A%tarning\ (suggestion)\ %n\:\ \"%f\"\\,\ line\ %l\ \#\ %m\ %#,
|
||||
\%A%tarning\ %n\:\ \"%f\"\\,\ line\ %l\ \#\ %m\ %#,
|
||||
\%Z\ \ \ \ %p^%.%#,
|
||||
\%-C%.%#
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Miscrosoft Visual C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2004 Mar 19
|
||||
" Last Change: 2005 Nov 30
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "msvc"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
" The errorformat for MSVC is the default.
|
||||
CompilerSet errorformat&
|
||||
CompilerSet makeprg=nmake
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
" Vim compiler file
|
||||
" Compiler: reStructuredText Documentation Format
|
||||
" Maintainer: Nikolai Weibull <source@pcppopper.org>
|
||||
" URL: http://www.pcppopper.org/vim/compiler/pcp/rst/
|
||||
" Latest Revision: 2004-05-22
|
||||
" arch-tag: ac64a95a-5d45-493d-a9f9-f96fc8568657
|
||||
" Compiler: reStructuredText Documentation Format
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-06-29
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "rst"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
@@ -29,5 +23,3 @@ CompilerSet errorformat=
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: set sts=2 sw=2:
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Ruby syntax check and/or error reporting
|
||||
" Maintainer: Tim Hammerquist <timmy@cpan.org>
|
||||
" Last Change: Tue Jul 16 00:38:00 PDT 2002
|
||||
" Language: Ruby
|
||||
" Function: Syntax check and/or error reporting
|
||||
" Maintainer: Tim Hammerquist <timh at rubyforge.org>
|
||||
" Info: $Id$
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" ----------------------------------------------------------------------------
|
||||
"
|
||||
" Changelog:
|
||||
" 0.2: script saves and restores 'cpoptions' value to prevent problems with
|
||||
" line continuations
|
||||
" 0.1: initial release
|
||||
" 0.2: script saves and restores 'cpoptions' value to prevent problems with
|
||||
" line continuations
|
||||
" 0.1: initial release
|
||||
"
|
||||
" Contributors:
|
||||
" Hugh Sasse <hgs@dmu.ac.uk>
|
||||
@@ -22,6 +26,7 @@
|
||||
" This is my first experience with 'errorformat' and compiler plugins and
|
||||
" I welcome any input from more experienced (or clearer-thinking)
|
||||
" individuals.
|
||||
" ----------------------------------------------------------------------------
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@@ -59,4 +64,4 @@ CompilerSet errorformat=
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: ft=vim
|
||||
" vim: nowrap sw=2 sts=2 ts=8 ff=unix:
|
||||
|
||||
35
runtime/compiler/rubyunit.vim
Normal file
35
runtime/compiler/rubyunit.vim
Normal file
@@ -0,0 +1,35 @@
|
||||
" Vim compiler file
|
||||
" Language: Test::Unit - Ruby Unit Testing Framework
|
||||
" Maintainer: Doug Kearns <djkea2 at gus.gscit.monash.edu.au>
|
||||
" Info: $Id$
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" ----------------------------------------------------------------------------
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "rubyunit"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
CompilerSet makeprg=testrb
|
||||
|
||||
CompilerSet errorformat=\%W\ %\\+%\\d%\\+)\ Failure:,
|
||||
\%C%m\ [%f:%l]:,
|
||||
\%E\ %\\+%\\d%\\+)\ Error:,
|
||||
\%C%m:,
|
||||
\%C\ \ \ \ %f:%l:%.%#,
|
||||
\%C%m,
|
||||
\%Z\ %#,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 ff=unix:
|
||||
@@ -19,6 +19,7 @@ DOCS = \
|
||||
change.txt \
|
||||
cmdline.txt \
|
||||
debugger.txt \
|
||||
debug.txt \
|
||||
develop.txt \
|
||||
diff.txt \
|
||||
digraph.txt \
|
||||
@@ -71,6 +72,8 @@ DOCS = \
|
||||
pi_gzip.txt \
|
||||
pi_netrw.txt \
|
||||
pi_spec.txt \
|
||||
pi_tar.txt \
|
||||
pi_zip.txt \
|
||||
print.txt \
|
||||
quickfix.txt \
|
||||
quickref.txt \
|
||||
@@ -139,6 +142,7 @@ HTMLS = \
|
||||
autocmd.html \
|
||||
change.html \
|
||||
cmdline.html \
|
||||
debug.html \
|
||||
debugger.html \
|
||||
develop.html \
|
||||
diff.html \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 7.0aa. Last change: 2005 Mar 04
|
||||
*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Jan 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -18,6 +18,7 @@ For a basic explanation, see section |40.3| in the user manual.
|
||||
8. Groups |autocmd-groups|
|
||||
9. Executing autocommands |autocmd-execute|
|
||||
10. Using autocommands |autocmd-use|
|
||||
11. Disabling autocommands |autocmd-disable|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
{only when the |+autocmd| feature has not been disabled at compile time}
|
||||
@@ -155,21 +156,209 @@ argument behavior differs from that for defining and removing autocommands.
|
||||
In order to list buffer-local autocommands, use a pattern in the form <buffer>
|
||||
or <buffer=N>. See |autocmd-buflocal|.
|
||||
|
||||
*:autocmd-verbose*
|
||||
When 'verbose' is non-zero, listing an autocommand will also display where it
|
||||
was last defined. Example: >
|
||||
|
||||
:verbose autocmd BufEnter
|
||||
FileExplorer BufEnter
|
||||
* call s:LocalBrowse(expand("<amatch>"))
|
||||
Last set from /usr/share/vim/vim-7.0/plugin/NetrwPlugin.vim
|
||||
<
|
||||
See |:verbose-cmd| for more information.
|
||||
|
||||
==============================================================================
|
||||
5. Events *autocmd-events* *E215* *E216*
|
||||
|
||||
You can specify a comma-separated list of event names. No white space can be
|
||||
used in this list. The command applies to all the events in the list.
|
||||
|
||||
For READING FILES there are four kinds of events possible:
|
||||
BufNewFile starting to edit a non-existent file
|
||||
BufReadPre BufReadPost starting to edit an existing file
|
||||
FilterReadPre FilterReadPost read the temp file with filter output
|
||||
FileReadPre FileReadPost any other file read
|
||||
Vim uses only one of these four kinds when reading a file. The "Pre" and
|
||||
"Post" events are both triggered, before and after reading the file.
|
||||
|
||||
Note that the autocommands for the *ReadPre events and all the Filter events
|
||||
are not allowed to change the current buffer (you will get an error message if
|
||||
this happens). This is to prevent the file to be read into the wrong buffer.
|
||||
|
||||
Note that the 'modified' flag is reset AFTER executing the BufReadPost
|
||||
and BufNewFile autocommands. But when the 'modified' option was set by the
|
||||
autocommands, this doesn't happen.
|
||||
|
||||
You can use the 'eventignore' option to ignore a number of events or all
|
||||
events.
|
||||
*autocommand-events* *{event}*
|
||||
Vim recognizes the following events. Vim ignores the case of event names
|
||||
(e.g., you can use "BUFread" or "bufread" instead of "BufRead").
|
||||
|
||||
First an overview by function with a short explanation. Then the list
|
||||
alpabetically with full explanations |autocmd-events-abc|.
|
||||
|
||||
Name triggered by ~
|
||||
|
||||
Reading
|
||||
|BufNewFile| starting to edit a file that doesn't exist
|
||||
|BufReadPre| starting to edit a new buffer, before reading the file
|
||||
|BufRead| starting to edit a new buffer, after reading the file
|
||||
|BufReadPost| starting to edit a new buffer, after reading the file
|
||||
|BufReadCmd| before starting to edit a new buffer |Cmd-event|
|
||||
|
||||
|FileReadPre| before reading a file with a ":read" command
|
||||
|FileReadPost| after reading a file with a ":read" command
|
||||
|FileReadCmd| before reading a file with a ":read" comman |Cmd-event|
|
||||
|
||||
|FilterReadPre| before reading a file from a filter command
|
||||
|FilterReadPost| after reading a file from a filter command
|
||||
|
||||
|StdinReadPre| before reading from stdin into the buffer
|
||||
|StdinReadPost| After reading from the stdin into the buffer
|
||||
|
||||
Writing
|
||||
|BufWrite| starting to write the whole buffer to a file
|
||||
|BufWritePre| starting to write the whole buffer to a file
|
||||
|BufWritePost| after writing the whole buffer to a file
|
||||
|BufWriteCmd| before writing the whole buffer to a file |Cmd-event|
|
||||
|
||||
|FileWritePre| starting to write part of a buffer to a file
|
||||
|FileWritePost| after writing part of a buffer to a file
|
||||
|FileWriteCmd| before writing part of a buffer to a file |Cmd-event|
|
||||
|
||||
|FileAppendPre| starting to append to a file
|
||||
|FileAppendPost| after appending to a file
|
||||
|FileAppendCmd| before appending to a file |Cmd-event|
|
||||
|
||||
|FilterWritePre| starting to write a file for a filter command or diff
|
||||
|FilterWritePost| after writing a file for a filter command or diff
|
||||
|
||||
Buffers
|
||||
|BufAdd| just after adding a buffer to the buffer list
|
||||
|BufCreate| just after adding a buffer to the buffer list
|
||||
|BufDelete| before deleting a buffer from the buffer list
|
||||
|BufWipeout| before completely deleting a buffer
|
||||
|
||||
|BufFilePre| before changing the name of the current buffer
|
||||
|BufFilePost| after changing the name of the current buffer
|
||||
|
||||
|BufEnter| after entering a buffer
|
||||
|BufLeave| before leaving to another buffer
|
||||
|BufWinEnter| after a buffer is displayed in a window
|
||||
|BufWinLeave| before a buffer is removed from a window
|
||||
|
||||
|BufUnload| before unloading a buffer
|
||||
|BufHidden| just after a buffer has become hidden
|
||||
|BufNew| just after creating a new buffer
|
||||
|
||||
|SwapExists| detected an existing swap file
|
||||
|
||||
Options
|
||||
|FileType| when the 'filetype' option has been set
|
||||
|Syntax| when the 'syntax' option has been set
|
||||
|EncodingChanged| after the 'encoding' option has been changed
|
||||
|TermChanged| after the value of 'term' has changed
|
||||
|
||||
Startup and exit
|
||||
|VimEnter| after doing all the startup stuff
|
||||
|GUIEnter| after starting the GUI successfully
|
||||
|TermResponse| after the termainal response to |t_RV| is received
|
||||
|
||||
|VimLeavePre| before exiting Vim, before writing the viminfo file
|
||||
|VimLeave| before exiting Vim, after writing the viminfo file
|
||||
|
||||
Various
|
||||
|FileChangedShell| Vim notices that a file changed since editing started
|
||||
|FileChangedRO| before making the first change to a read-only file
|
||||
|
||||
|FuncUndefined| a user function is used but it isn't defined
|
||||
|
||||
|FocusGained| Vim got input focus
|
||||
|FocusLost| Vim lost input focus
|
||||
|CursorHold| the user doesn't press a key for a while
|
||||
|
||||
|WinEnter| after entering another window
|
||||
|WinLeave| before leaving a window
|
||||
|CmdwinEnter| after entering the command-line window
|
||||
|CmdwinLeave| before leaving the command-line window
|
||||
|
||||
|InsertEnter| starting Insert mode
|
||||
|InsertChange| when typing <Insert> while in Insert or Replace mode
|
||||
|InsertLeave| when leaving Insert mode
|
||||
|
||||
|ColorScheme| after loading a color scheme
|
||||
|
||||
|RemoteReply| a reply from a server Vim was received
|
||||
|
||||
|QuickFixCmdPre| before a quickfix command is run
|
||||
|QuickFixCmdPost| after a quickfix command is run
|
||||
|
||||
|SessionLoadPost| after loading a session file
|
||||
|
||||
|MenuPopup| just before showing the popup menu
|
||||
|
||||
|User| to be used in combination with ":doautocmd"
|
||||
|
||||
|
||||
The alphabetical list of autocommand events: *autocmd-events-abc*
|
||||
|
||||
*BufCreate* *BufAdd*
|
||||
BufAdd or BufCreate Just after creating a new buffer which is
|
||||
added to the buffer list, or adding a buffer
|
||||
to the buffer list.
|
||||
Also used just after a buffer in the buffer
|
||||
list has been renamed.
|
||||
The BufCreate event is for historic reasons.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being created "<afile>".
|
||||
*BufDelete*
|
||||
BufDelete Before deleting a buffer from the buffer list.
|
||||
The BufUnload may be called first (if the
|
||||
buffer was loaded).
|
||||
Also used just before a buffer in the buffer
|
||||
list is renamed.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being deleted "<afile>".
|
||||
*BufEnter*
|
||||
BufEnter After entering a buffer. Useful for setting
|
||||
options for a file type. Also executed when
|
||||
starting to edit a buffer, after the
|
||||
BufReadPost autocommands.
|
||||
*BufFilePost*
|
||||
BufFilePost After changing the name of the current buffer
|
||||
with the ":file" or ":saveas" command.
|
||||
*BufFilePre*
|
||||
BufFilePre Before changing the name of the current buffer
|
||||
with the ":file" or ":saveas" command.
|
||||
*BufHidden*
|
||||
BufHidden Just after a buffer has become hidden. That
|
||||
is, when there are no longer windows that show
|
||||
the buffer, but the buffer is not unloaded or
|
||||
deleted. Not used for ":qa" or ":q" when
|
||||
exiting Vim.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufLeave*
|
||||
BufLeave Before leaving to another buffer. Also when
|
||||
leaving or closing the current window and the
|
||||
new current window is not for the same buffer.
|
||||
Not used for ":qa" or ":q" when exiting Vim.
|
||||
*BufNew*
|
||||
BufNew Just after creating a new buffer. Also used
|
||||
just after a buffer has been renamed. When
|
||||
the buffer is added to the buffer list BufAdd
|
||||
will be triggered too.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being created "<afile>".
|
||||
*BufNewFile*
|
||||
BufNewFile When starting to edit a file that doesn't
|
||||
exist. Can be used to read in a skeleton
|
||||
file.
|
||||
*BufReadPre* *E200* *E201*
|
||||
BufReadPre When starting to edit a new buffer, before
|
||||
reading the file into the buffer. Not used
|
||||
if the file doesn't exist.
|
||||
*BufRead* *BufReadPost*
|
||||
BufRead or BufReadPost When starting to edit a new buffer, after
|
||||
reading the file into the buffer, before
|
||||
@@ -182,60 +371,46 @@ BufRead or BufReadPost When starting to edit a new buffer, after
|
||||
*BufReadCmd*
|
||||
BufReadCmd Before starting to edit a new buffer. Should
|
||||
read the file into the buffer. |Cmd-event|
|
||||
*BufFilePre*
|
||||
BufFilePre Before changing the name of the current buffer
|
||||
with the ":file" or ":saveas" command.
|
||||
*BufFilePost*
|
||||
BufFilePost After changing the name of the current buffer
|
||||
with the ":file" or ":saveas" command.
|
||||
*FileReadPre*
|
||||
FileReadPre Before reading a file with a ":read" command.
|
||||
*FileReadPost*
|
||||
FileReadPost After reading a file with a ":read" command.
|
||||
Note that Vim sets the '[ and '] marks to the
|
||||
first and last line of the read. This can be
|
||||
used to operate on the lines just read.
|
||||
*FileReadCmd*
|
||||
FileReadCmd Before reading a file with a ":read" command.
|
||||
Should do the reading of the file. |Cmd-event|
|
||||
*FilterReadPre* *E135*
|
||||
FilterReadPre Before reading a file from a filter command.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer, not the name of the
|
||||
temporary file that is the output of the
|
||||
filter command.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FilterReadPost*
|
||||
FilterReadPost After reading a file from a filter command.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer as with FilterReadPre.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FileType*
|
||||
FileType When the 'filetype' option has been set.
|
||||
<afile> can be used for the name of the file
|
||||
where this option was set, and <amatch> for
|
||||
the new value of 'filetype'.
|
||||
See |filetypes|.
|
||||
*Syntax*
|
||||
Syntax When the 'syntax' option has been set.
|
||||
<afile> can be used for the name of the file
|
||||
where this option was set, and <amatch> for
|
||||
the new value of 'syntax'.
|
||||
See |:syn-on|.
|
||||
*StdinReadPre*
|
||||
StdinReadPre Before reading from stdin into the buffer.
|
||||
Only used when the "-" argument was used when
|
||||
Vim was started |--|.
|
||||
*StdinReadPost*
|
||||
StdinReadPost After reading from the stdin into the buffer,
|
||||
before executing the modelines. Only used
|
||||
when the "-" argument was used when Vim was
|
||||
started |--|.
|
||||
*BufReadPre* *E200* *E201*
|
||||
BufReadPre When starting to edit a new buffer, before
|
||||
reading the file into the buffer. Not used
|
||||
if the file doesn't exist.
|
||||
*BufUnload*
|
||||
BufUnload Before unloading a buffer. This is when the
|
||||
text in the buffer is going to be freed. This
|
||||
may be after a BufWritePost and before a
|
||||
BufDelete. Also used for all buffers that are
|
||||
loaded when Vim is going to exit.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufWinEnter*
|
||||
BufWinEnter After a buffer is displayed in a window. This
|
||||
can be when the buffer is loaded (after
|
||||
processing the modelines), when a hidden
|
||||
buffer is displayed in a window (and is no
|
||||
longer hidden) or a buffer already visible in
|
||||
a window is also displayed in another window.
|
||||
*BufWinLeave*
|
||||
BufWinLeave Before a buffer is removed from a window.
|
||||
Not when it's still visible in another window.
|
||||
Also triggered when exiting. It's triggered
|
||||
before BufUnload or BufHidden.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufWipeout*
|
||||
BufWipeout Before completely deleting a buffer. The
|
||||
BufUnload and BufDelete events may be called
|
||||
first (if the buffer was loaded and was in the
|
||||
buffer list). Also used just before a buffer
|
||||
is renamed (also when it's not in the buffer
|
||||
list).
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being deleted "<afile>".
|
||||
*BufWrite* *BufWritePre*
|
||||
BufWrite or BufWritePre Before writing the whole buffer to a file.
|
||||
*BufWritePost*
|
||||
BufWritePost After writing the whole buffer to a file
|
||||
(should undo the commands for BufWritePre).
|
||||
*BufWriteCmd*
|
||||
BufWriteCmd Before writing the whole buffer to a file.
|
||||
Should do the writing of the file and reset
|
||||
@@ -243,42 +418,70 @@ BufWriteCmd Before writing the whole buffer to a file.
|
||||
'cpo' and writing to another file |cpo-+|.
|
||||
The buffer contents should not be changed.
|
||||
|Cmd-event|
|
||||
*FileWritePre*
|
||||
FileWritePre Before writing to a file, when not writing the
|
||||
whole buffer. Use the '[ and '] marks for the
|
||||
range of lines.
|
||||
*FileWritePost*
|
||||
FileWritePost After writing to a file, when not writing the
|
||||
whole buffer.
|
||||
*FileWriteCmd*
|
||||
FileWriteCmd Before writing to a file, when not writing the
|
||||
whole buffer. Should do the writing to the
|
||||
file. Should not change the buffer. Use the
|
||||
'[ and '] marks for the range of lines.
|
||||
|Cmd-event|
|
||||
*FileAppendPre*
|
||||
FileAppendPre Before appending to a file. Use the '[ and ']
|
||||
marks for the range of lines.
|
||||
*FileAppendPost*
|
||||
FileAppendPost After appending to a file.
|
||||
*BufWritePost*
|
||||
BufWritePost After writing the whole buffer to a file
|
||||
(should undo the commands for BufWritePre).
|
||||
*CmdwinEnter*
|
||||
CmdwinEnter After entering the command-line window.
|
||||
Useful for setting options specifically for
|
||||
this special type of window. This is
|
||||
triggered _instead_ of BufEnter and WinEnter.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*CmdwinLeave*
|
||||
CmdwinLeave Before leaving the command-line window.
|
||||
Useful to clean up any global setting done
|
||||
with CmdwinEnter. This is triggered _instead_
|
||||
of BufLeave and WinLeave.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*ColorScheme*
|
||||
ColorScheme After loading a color scheme. |:colorscheme|
|
||||
*CursorHold*
|
||||
CursorHold When the user doesn't press a key for the time
|
||||
specified with 'updatetime'. Not re-triggered
|
||||
until the user has pressed a key (i.e. doesn't
|
||||
fire every 'updatetime' ms if you leave Vim to
|
||||
make some coffee. :) See |CursorHold-example|
|
||||
for previewing tags.
|
||||
This event is only triggered in Normal mode.
|
||||
While recording the CursorHold event is not
|
||||
triggered. |q|
|
||||
Note: Interactive commands cannot be used for
|
||||
this event. There is no hit-enter prompt,
|
||||
the screen is updated directly (when needed).
|
||||
Note: In the future there will probably be
|
||||
another option to set the time.
|
||||
Hint: to force an update of the status lines
|
||||
use: >
|
||||
:let &ro = &ro
|
||||
< {only on Amiga, Unix, Win32, MSDOS and all GUI
|
||||
versions}
|
||||
*EncodingChanged*
|
||||
EncodingChanged Fires off after the 'encoding' option has been
|
||||
changed. Useful to set up fonts, for example.
|
||||
*FileAppendCmd*
|
||||
FileAppendCmd Before appending to a file. Should do the
|
||||
appending to the file. Use the '[ and ']
|
||||
marks for the range of lines.|Cmd-event|
|
||||
*FilterWritePre*
|
||||
FilterWritePre Before writing a file for a filter command or
|
||||
making a diff.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer, not the name of the
|
||||
temporary file that is the output of the
|
||||
filter command.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FilterWritePost*
|
||||
FilterWritePost After writing a file for a filter command or
|
||||
making a diff.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer as with FilterWritePre.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FileAppendPost*
|
||||
FileAppendPost After appending to a file.
|
||||
*FileAppendPre*
|
||||
FileAppendPre Before appending to a file. Use the '[ and ']
|
||||
marks for the range of lines.
|
||||
*FileChangedRO*
|
||||
FileChangedRO Before making the first change to a read-only
|
||||
file. Can be used to check-out the file from
|
||||
a source control system. Not triggered when
|
||||
the change was caused by an autocommand.
|
||||
This event is triggered when making the first
|
||||
change in a buffer or the first change after
|
||||
'readonly' was set,
|
||||
just before the change is applied to the text.
|
||||
WARNING: If the autocommand moves the cursor
|
||||
the effect of the change is undefined.
|
||||
*FileChangedShell*
|
||||
FileChangedShell When Vim notices that the modification time of
|
||||
a file has changed since editing started.
|
||||
@@ -308,15 +511,64 @@ FileChangedShell When Vim notices that the modification time of
|
||||
commands for the FileChangedShell event no
|
||||
other FileChangedShell event will be
|
||||
triggered.
|
||||
*FileChangedRO*
|
||||
FileChangedRO Before making the first change to a read-only
|
||||
file. Can be used to check-out the file from
|
||||
a source control system. Not triggered when
|
||||
the change was caused by an autocommand.
|
||||
WARNING: This event is triggered when making a
|
||||
change, just before the change is applied to
|
||||
the text. If the autocommand moves the cursor
|
||||
the effect of the change is undefined.
|
||||
*FileEncoding*
|
||||
FileEncoding Obsolete. It still works and is equivalent
|
||||
to |EncodingChanged|.
|
||||
*FileReadCmd*
|
||||
FileReadCmd Before reading a file with a ":read" command.
|
||||
Should do the reading of the file. |Cmd-event|
|
||||
*FileReadPost*
|
||||
FileReadPost After reading a file with a ":read" command.
|
||||
Note that Vim sets the '[ and '] marks to the
|
||||
first and last line of the read. This can be
|
||||
used to operate on the lines just read.
|
||||
*FileReadPre*
|
||||
FileReadPre Before reading a file with a ":read" command.
|
||||
*FileType*
|
||||
FileType When the 'filetype' option has been set.
|
||||
<afile> can be used for the name of the file
|
||||
where this option was set, and <amatch> for
|
||||
the new value of 'filetype'.
|
||||
See |filetypes|.
|
||||
*FileWriteCmd*
|
||||
FileWriteCmd Before writing to a file, when not writing the
|
||||
whole buffer. Should do the writing to the
|
||||
file. Should not change the buffer. Use the
|
||||
'[ and '] marks for the range of lines.
|
||||
|Cmd-event|
|
||||
*FileWritePost*
|
||||
FileWritePost After writing to a file, when not writing the
|
||||
whole buffer.
|
||||
*FileWritePre*
|
||||
FileWritePre Before writing to a file, when not writing the
|
||||
whole buffer. Use the '[ and '] marks for the
|
||||
range of lines.
|
||||
*FilterReadPost*
|
||||
FilterReadPost After reading a file from a filter command.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer as with FilterReadPre.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FilterReadPre* *E135*
|
||||
FilterReadPre Before reading a file from a filter command.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer, not the name of the
|
||||
temporary file that is the output of the
|
||||
filter command.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FilterWritePost*
|
||||
FilterWritePost After writing a file for a filter command or
|
||||
making a diff.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer as with FilterWritePre.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FilterWritePre*
|
||||
FilterWritePre Before writing a file for a filter command or
|
||||
making a diff.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer, not the name of the
|
||||
temporary file that is the output of the
|
||||
filter command.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FocusGained*
|
||||
FocusGained When Vim got input focus. Only for the GUI
|
||||
version and a few console versions where this
|
||||
@@ -332,104 +584,136 @@ FuncUndefined When a user function is used but it isn't
|
||||
when it's used. Both <amatch> and <afile> are
|
||||
set to the name of the function.
|
||||
See |autoload-functions|.
|
||||
*CursorHold*
|
||||
CursorHold When the user doesn't press a key for the time
|
||||
specified with 'updatetime'. Not re-triggered
|
||||
until the user has pressed a key (i.e. doesn't
|
||||
fire every 'updatetime' ms if you leave Vim to
|
||||
make some coffee. :) See |CursorHold-example|
|
||||
for previewing tags.
|
||||
This event is only triggered in Normal mode.
|
||||
Note: Interactive commands cannot be used for
|
||||
this event. There is no hit-enter prompt,
|
||||
the screen is updated directly (when needed).
|
||||
Note: In the future there will probably be
|
||||
another option to set the time.
|
||||
Hint: to force an update of the status lines
|
||||
use: >
|
||||
:let &ro = &ro
|
||||
< {only on Amiga, Unix, Win32, MSDOS and all GUI
|
||||
versions}
|
||||
*BufEnter*
|
||||
BufEnter After entering a buffer. Useful for setting
|
||||
options for a file type. Also executed when
|
||||
starting to edit a buffer, after the
|
||||
BufReadPost autocommands.
|
||||
*BufLeave*
|
||||
BufLeave Before leaving to another buffer. Also when
|
||||
leaving or closing the current window and the
|
||||
new current window is not for the same buffer.
|
||||
Not used for ":qa" or ":q" when exiting Vim.
|
||||
*BufWinEnter*
|
||||
BufWinEnter After a buffer is displayed in a window. This
|
||||
can be when the buffer is loaded (after
|
||||
processing the modelines), when a hidden
|
||||
buffer is displayed in a window (and is no
|
||||
longer hidden) or a buffer already visible in
|
||||
a window is also displayed in another window.
|
||||
*BufWinLeave*
|
||||
BufWinLeave Before a buffer is removed from a window.
|
||||
Not when it's still visible in another window.
|
||||
Also triggered when exiting. It's triggered
|
||||
before BufUnload or BufHidden.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufUnload*
|
||||
BufUnload Before unloading a buffer. This is when the
|
||||
text in the buffer is going to be freed. This
|
||||
may be after a BufWritePost and before a
|
||||
BufDelete. Also used for all buffers that are
|
||||
loaded when Vim is going to exit.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufHidden*
|
||||
BufHidden Just after a buffer has become hidden. That
|
||||
is, when there are no longer windows that show
|
||||
the buffer, but the buffer is not unloaded or
|
||||
deleted. Not used for ":qa" or ":q" when
|
||||
exiting Vim.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufNew*
|
||||
BufNew Just after creating a new buffer. Also used
|
||||
just after a buffer has been renamed. When
|
||||
the buffer is added to the buffer list BufAdd
|
||||
will be triggered too.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being created "<afile>".
|
||||
*BufCreate* *BufAdd*
|
||||
BufAdd or BufCreate Just after creating a new buffer which is
|
||||
added to the buffer list, or adding a buffer
|
||||
to the buffer list.
|
||||
Also used just after a buffer in the buffer
|
||||
list has been renamed.
|
||||
The BufCreate event is for historic reasons.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being created "<afile>".
|
||||
*BufDelete*
|
||||
BufDelete Before deleting a buffer from the buffer list.
|
||||
The BufUnload may be called first (if the
|
||||
buffer was loaded).
|
||||
Also used just before a buffer in the buffer
|
||||
list is renamed.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being deleted "<afile>".
|
||||
*BufWipeout*
|
||||
BufWipeout Before completely deleting a buffer. The
|
||||
BufUnload and BufDelete events may be called
|
||||
first (if the buffer was loaded and was in the
|
||||
buffer list). Also used just before a buffer
|
||||
is renamed (also when it's not in the buffer
|
||||
list).
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being deleted "<afile>".
|
||||
*GUIEnter*
|
||||
GUIEnter After starting the GUI successfully, and after
|
||||
opening the window. It is triggered before
|
||||
VimEnter when using gvim. Can be used to
|
||||
position the window from a .gvimrc file: >
|
||||
:autocmd GUIEnter * winpos 100 50
|
||||
< *InsertChange*
|
||||
InsertChange When typing <Insert> while in Insert or
|
||||
Replace mode. The |v:insertmode| variable
|
||||
indicates the new mode.
|
||||
Be careful not to move the cursor or do
|
||||
anything else that the user does not expect.
|
||||
*InsertEnter*
|
||||
InsertEnter When starting Insert mode. Also for Replace
|
||||
mode and Virtual Replace mode. The
|
||||
|v:insertmode| variable indicates the mode.
|
||||
Be careful not to move the cursor or do
|
||||
anything else that the user does not expect.
|
||||
*InsertLeave*
|
||||
InsertLeave When leaving Insert mode. Also when using
|
||||
CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|.
|
||||
*MenuPopup*
|
||||
MenuPopup Just before showing the popup menu (under the
|
||||
right mouse button). Useful for adjusting the
|
||||
menu for what is under the cursor or mouse
|
||||
pointer.
|
||||
The pattern is matched against a single
|
||||
character representing the mode:
|
||||
n Normal
|
||||
v Visual
|
||||
o Operator-pending
|
||||
i Insert
|
||||
c Commmand line
|
||||
*QuickFixCmdPre*
|
||||
QuickFixCmdPre Before a quickfix command is run (|:make|,
|
||||
|:grep|, |:grepadd|, |:vimgrep|,
|
||||
|:vimgrepadd|). The pattern is matched against
|
||||
the command being run. When |:grep| is used
|
||||
but 'grepprg' is set to "internal" it still
|
||||
matches "grep".
|
||||
This command cannot be used to set the
|
||||
'makeprg' and 'grepprg' variables.
|
||||
If this command causes an error, the quickfix
|
||||
command is not executed.
|
||||
*QuickFixCmdPost*
|
||||
QuickFixCmdPost Like QuickFixCmdPre, but after a quickfix
|
||||
command is run.
|
||||
*RemoteReply*
|
||||
RemoteReply When a reply from a Vim that functions as
|
||||
server was received |server2client()|.
|
||||
<amatch> is equal to the {serverid} from which
|
||||
the reply was sent, and <afile> is the actual
|
||||
reply string.
|
||||
Note that even if an autocommand is defined,
|
||||
the reply should be read with |remote_read()|
|
||||
to consume it.
|
||||
*SessionLoadPost*
|
||||
SessionLoadPost After loading the session file created using
|
||||
the |:mksession| command.
|
||||
*StdinReadPost*
|
||||
StdinReadPost After reading from the stdin into the buffer,
|
||||
before executing the modelines. Only used
|
||||
when the "-" argument was used when Vim was
|
||||
started |--|.
|
||||
*StdinReadPre*
|
||||
StdinReadPre Before reading from stdin into the buffer.
|
||||
Only used when the "-" argument was used when
|
||||
Vim was started |--|.
|
||||
*SwapExists*
|
||||
SwapExists Detected an existing swap file when starting
|
||||
to edit a file. Only when it is possible to
|
||||
select a way to handle the situation, when Vim
|
||||
would ask the user what to do.
|
||||
The |v:swapname| variable holds the name of
|
||||
the swap file found, <afile> the file being
|
||||
edited. |v:swapcommand| may contain a command
|
||||
to be executed in the opened file.
|
||||
The commands should set the |v:swapchoice|
|
||||
variable to a string with one character to
|
||||
tell Vim what should be done next:
|
||||
'o' open read-only
|
||||
'e' edit the file anyway
|
||||
'r' recover
|
||||
'd' delete the swap file
|
||||
'q' quit, don't edit the file
|
||||
'a' abort, like hitting CTRL-C
|
||||
When set to an empty string the user will be
|
||||
asked, as if there was no SwapExists autocmd.
|
||||
Note: Do not try to change the buffer, the
|
||||
results are unpredictable.
|
||||
*Syntax*
|
||||
Syntax When the 'syntax' option has been set.
|
||||
<afile> can be used for the name of the file
|
||||
where this option was set, and <amatch> for
|
||||
the new value of 'syntax'.
|
||||
See |:syn-on|.
|
||||
*TermChanged*
|
||||
TermChanged After the value of 'term' has changed. Useful
|
||||
for re-loading the syntax file to update the
|
||||
colors, fonts and other terminal-dependent
|
||||
settings. Executed for all loaded buffers.
|
||||
*TermResponse*
|
||||
TermResponse After the response to |t_RV| is received from
|
||||
the terminal. The value of |v:termresponse|
|
||||
can be used to do things depending on the
|
||||
terminal version.
|
||||
*User*
|
||||
User Never executed automatically. To be used for
|
||||
autocommands that are only executed with
|
||||
":doautocmd".
|
||||
*UserGettingBored*
|
||||
UserGettingBored When the user hits CTRL-C. Just kidding! :-)
|
||||
*VimEnter*
|
||||
VimEnter After doing all the startup stuff, including
|
||||
loading .vimrc files, executing the "-c cmd"
|
||||
arguments, creating all windows and loading
|
||||
the buffers in them.
|
||||
*VimLeave*
|
||||
VimLeave Before exiting Vim, just after writing the
|
||||
.viminfo file. Executed only once, like
|
||||
VimLeavePre.
|
||||
To detect an abnormal exit use |v:dying|.
|
||||
*VimLeavePre*
|
||||
VimLeavePre Before exiting Vim, just before writing the
|
||||
.viminfo file. This is executed only once,
|
||||
if there is a match with the name of what
|
||||
happens to be the current buffer when exiting.
|
||||
Mostly useful with a "*" pattern. >
|
||||
:autocmd VimLeavePre * call CleanupStuff()
|
||||
< To detect an abnormal exit use |v:dying|.
|
||||
*WinEnter*
|
||||
WinEnter After entering another window. Not done for
|
||||
the first window, when Vim has just started.
|
||||
@@ -446,130 +730,6 @@ WinLeave Before leaving a window. If the window to be
|
||||
executes the BufLeave autocommands before the
|
||||
WinLeave autocommands (but not for ":new").
|
||||
Not used for ":qa" or ":q" when exiting Vim.
|
||||
*CmdwinEnter*
|
||||
CmdwinEnter After entering the command-line window.
|
||||
Useful for setting options specifically for
|
||||
this special type of window. This is
|
||||
triggered _instead_ of BufEnter and WinEnter.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*CmdwinLeave*
|
||||
CmdwinLeave Before leaving the command-line window.
|
||||
Useful to clean up any global setting done
|
||||
with CmdwinEnter. This is triggered _instead_
|
||||
of BufLeave and WinLeave.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*GUIEnter*
|
||||
GUIEnter After starting the GUI successfully, and after
|
||||
opening the window. It is triggered before
|
||||
VimEnter when using gvim. Can be used to
|
||||
position the window from a .gvimrc file: >
|
||||
:autocmd GUIEnter * winpos 100 50
|
||||
< *VimEnter*
|
||||
VimEnter After doing all the startup stuff, including
|
||||
loading .vimrc files, executing the "-c cmd"
|
||||
arguments, creating all windows and loading
|
||||
the buffers in them.
|
||||
*VimLeavePre*
|
||||
VimLeavePre Before exiting Vim, just before writing the
|
||||
.viminfo file. This is executed only once,
|
||||
if there is a match with the name of what
|
||||
happens to be the current buffer when exiting.
|
||||
Mostly useful with a "*" pattern. >
|
||||
:autocmd VimLeavePre * call CleanupStuff()
|
||||
< To detect an abnormal exit use |v:dying|.
|
||||
*VimLeave*
|
||||
VimLeave Before exiting Vim, just after writing the
|
||||
.viminfo file. Executed only once, like
|
||||
VimLeavePre.
|
||||
To detect an abnormal exit use |v:dying|.
|
||||
*EncodingChanged*
|
||||
EncodingChanged Fires off when the 'encoding' option is
|
||||
changed. Useful to set up fonts, for example.
|
||||
*InsertEnter*
|
||||
InsertEnter When starting Insert mode. Also for Replace
|
||||
mode and Virtual Replace mode. The
|
||||
|v:insertmode| variable indicates the mode.
|
||||
Be careful not to move the cursor or do
|
||||
anything else that the user does not expect.
|
||||
*InsertChange*
|
||||
InsertChange When typing <Insert> while in Insert or
|
||||
Replace mode. The |v:insertmode| variable
|
||||
indicates the new mode.
|
||||
Be careful not to move the cursor or do
|
||||
anything else that the user does not expect.
|
||||
*InsertLeave*
|
||||
InsertLeave When leaving Insert mode. Also when using
|
||||
CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|.
|
||||
*FileEncoding*
|
||||
FileEncoding Obsolete. It still works and is equivalent
|
||||
to |EncodingChanged|.
|
||||
*ColorScheme*
|
||||
ColorScheme After loading a color scheme. |:colorscheme|
|
||||
*RemoteReply*
|
||||
RemoteReply When a reply from a Vim that functions as
|
||||
server was received |server2client()|.
|
||||
<amatch> is equal to the {serverid} from which
|
||||
the reply was sent, and <afile> is the actual
|
||||
reply string.
|
||||
Note that even if an autocommand is defined,
|
||||
the reply should be read with |remote_read()|
|
||||
to consume it.
|
||||
*TermChanged*
|
||||
TermChanged After the value of 'term' has changed. Useful
|
||||
for re-loading the syntax file to update the
|
||||
colors, fonts and other terminal-dependent
|
||||
settings. Executed for all loaded buffers.
|
||||
*TermResponse*
|
||||
TermResponse After the response to |t_RV| is received from
|
||||
the terminal. The value of |v:termresponse|
|
||||
can be used to do things depending on the
|
||||
terminal version.
|
||||
QuickFixCmdPre *QuickFixCmdPre*
|
||||
Before a quickfix command is run (|:make|,
|
||||
|:grep|, |:grepadd|, |:vimgrep|,
|
||||
|:vimgrepadd|). The pattern is matched against
|
||||
the command being run. When |:grep| is used
|
||||
but 'grepprg' is set to "internal" it still
|
||||
matches "grep".
|
||||
This command cannot be used to set the
|
||||
'makeprg' and 'grepprg' variables.
|
||||
If this command causes an error, the quickfix
|
||||
command is not executed.
|
||||
QuickFixCmdPost *QuickFixCmdPost*
|
||||
like QuickFixCmdPre, but after a quickfix
|
||||
command is run.
|
||||
*UserGettingBored*
|
||||
UserGettingBored When the user hits CTRL-C. Just kidding! :-)
|
||||
*User*
|
||||
User Never executed automatically. To be used for
|
||||
autocommands that are only executed with
|
||||
":doautocmd".
|
||||
|
||||
You can specify a comma-separated list of event names. No white space can be
|
||||
used in this list. The command applies to all the events in the list.
|
||||
|
||||
For READING FILES there are four kinds of events possible:
|
||||
BufNewFile starting to edit a non-existent file
|
||||
BufReadPre BufReadPost starting to edit an existing file
|
||||
FilterReadPre FilterReadPost read the temp file with filter output
|
||||
FileReadPre FileReadPost any other file read
|
||||
Vim uses only one of these four kinds when reading a file. The "Pre" and
|
||||
"Post" events are both triggered, before and after reading the file.
|
||||
|
||||
Note that the autocommands for the *ReadPre events and all the Filter events
|
||||
are not allowed to change the current buffer (you will get an error message if
|
||||
this happens). This is to prevent the file to be read into the wrong buffer.
|
||||
|
||||
Note that the 'modified' flag is reset AFTER executing the BufReadPost
|
||||
and BufNewFile autocommands. But when the 'modified' option was set by the
|
||||
autocommands, this doesn't happen.
|
||||
|
||||
You can use the 'eventignore' option to ignore a number of events or all
|
||||
events.
|
||||
|
||||
==============================================================================
|
||||
6. Patterns *autocmd-patterns* *{pat}*
|
||||
@@ -787,6 +947,10 @@ option will not cause any commands to be executed.
|
||||
autocommands for that group. Note: if you use an
|
||||
undefined group name, Vim gives you an error message.
|
||||
|
||||
After applying the autocommands the modelines are
|
||||
processed, so that their overrule the settings from
|
||||
autocommands, like what happens when editing a file.
|
||||
|
||||
*:doautoa* *:doautoall*
|
||||
:doautoa[ll] [group] {event} [fname]
|
||||
Like ":doautocmd", but apply the autocommands to each
|
||||
@@ -893,10 +1057,8 @@ It's possible to use the ":au" command in an autocommand. This can be a
|
||||
self-modifying command! This can be useful for an autocommand that should
|
||||
execute only once.
|
||||
|
||||
There is currently no way to disable the autocommands. If you want to write a
|
||||
file without executing the autocommands for that type of file, write it under
|
||||
another name and rename it with a shell command. In some situations you can
|
||||
use the 'eventignore' option.
|
||||
If you want to skip autocommands for one command, use the |:noautocmd| command
|
||||
modifier or the 'eventignore' option.
|
||||
|
||||
Note: When reading a file (with ":read file" or with a filter command) and the
|
||||
last line in the file does not have an <EOL>, Vim remembers this. At the next
|
||||
@@ -1013,5 +1175,22 @@ The |v:cmdbang| variable is one when "!" was used, zero otherwise.
|
||||
|
||||
See the $VIMRUNTIME/plugin/netrw.vim for examples.
|
||||
|
||||
==============================================================================
|
||||
11. Disabling autocommands *autocmd-disable*
|
||||
|
||||
To disable autocommands for some time use the 'eventignore' option. Note that
|
||||
this may cause unexpected behavior, make sure you restore 'eventignore'
|
||||
afterwards, using a |:try| block with |:finally|.
|
||||
|
||||
*:noautocmd* *:noa*
|
||||
To disable autocommands for just one command use the ":noautocmd" command
|
||||
modifier. This will set 'eventignore' to "all" for the duration of the
|
||||
following command. Example: >
|
||||
|
||||
:noautocmd w fname.gz
|
||||
|
||||
This will write the file without triggering the autocommands defined by the
|
||||
gzip plugin.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 7.0aa. Last change: 2005 May 31
|
||||
*change.txt* For Vim version 7.0aa. Last change: 2005 Dec 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -503,6 +503,8 @@ comment (starting with '"') after the ":!" command.
|
||||
temporary file and then reads the file into the
|
||||
buffer. Vim uses the 'shellredir' option to redirect
|
||||
the filter output to the temporary file.
|
||||
However, if the 'shelltemp' option is off then pipes
|
||||
are used when possible (on Unix).
|
||||
When the 'R' flag is included in 'cpoptions' marks in
|
||||
the filtered lines are deleted, unless the
|
||||
|:keepmarks| command is used. Example: >
|
||||
@@ -682,8 +684,8 @@ For the definition of a pattern, see |pattern|.
|
||||
|
||||
*sub-replace-special* *:s\=*
|
||||
When the {string} starts with "\=" it is evaluated as an expression, see
|
||||
|sub-replace-expression|. Otherwise these characters in {string} have a
|
||||
special meaning:
|
||||
|sub-replace-expression|. You can use that for any special characters.
|
||||
Otherwise these characters in {string} have a special meaning:
|
||||
*:s%*
|
||||
When {string} is equal to "%" and '/' is included with the 'cpotions' option,
|
||||
then the {string} of the previous substitute command is used. |cpo-/|
|
||||
@@ -771,9 +773,12 @@ Be careful: The separation character must not appear in the expression!
|
||||
Consider using a character like "@" or ":". There is no problem if the result
|
||||
of the expression contains the separation character.
|
||||
|
||||
Example: >
|
||||
Examples: >
|
||||
:s@\n@\="\r" . expand("$HOME") . "\r"@
|
||||
This replaces an end-of-line with a new line containing the value of $HOME.
|
||||
This replaces an end-of-line with a new line containing the value of $HOME. >
|
||||
|
||||
s/E/\="\<Char-0x20ac>"/g
|
||||
This replaces 'E' characters with an euro sign. Read more in |<Char->|.
|
||||
|
||||
|
||||
4.3 Search and replace *search-replace*
|
||||
@@ -1074,14 +1079,18 @@ normal command-line editing commands are available, including a special
|
||||
history for expressions. When you end the command-line by typing <CR>, Vim
|
||||
computes the result of the expression. If you end it with <Esc>, Vim abandons
|
||||
the expression. If you do not enter an expression, Vim uses the previous
|
||||
expression (like with the "/" command). If the "= register is used for the
|
||||
"p" command, the string is split up at <NL> characters. If the string ends in
|
||||
a <NL>, it is regarded as a linewise register. {not in Vi}
|
||||
expression (like with the "/" command). The expression must evaluate to a
|
||||
string. If the result is a number it's turned into a string. A List,
|
||||
Dictionary or FuncRef results in an error message (use string() to convert).
|
||||
If the "= register is used for the "p" command, the string is split up at <NL>
|
||||
characters. If the string ends in a <NL>, it is regarded as a linewise
|
||||
register. {not in Vi}
|
||||
|
||||
7. Selection and drop registers "*, "+ and "~
|
||||
Use these register for storing and retrieving the selected text for the GUI.
|
||||
See |quotestar| and |quoteplus|. When the clipboard is not available or not
|
||||
working, the unnamed register is used instead. {not in Vi}
|
||||
working, the unnamed register is used instead. For Unix systems the clipboard
|
||||
is only available when the |+xterm_clipboard| feature is present. {not in Vi}
|
||||
|
||||
Note that there is only a distinction between "* and "+ for X11 systems. For
|
||||
an explanation of the difference, see |x11-selection|. Under MS-Windows, use
|
||||
@@ -1487,8 +1496,9 @@ Vim has a sorting function and a sorting command. The sorting function can be
|
||||
found here: |sort()|.
|
||||
|
||||
*:sor* *:sort*
|
||||
:[range]sor[t][!] [i] [u] [/{pattern}/]
|
||||
Sort lines in [range].
|
||||
:[range]sor[t][!] [i][u][n][x][o] [/{pattern}/]
|
||||
Sort lines in [range]. When no range is given all
|
||||
lines are sorted.
|
||||
|
||||
With [!] the order is reversed.
|
||||
|
||||
@@ -1524,4 +1534,12 @@ found here: |sort()|.
|
||||
Note that using ":sort" with ":global" doesn't sort the matching lines, it's
|
||||
quite useless.
|
||||
|
||||
The details about sorting depend on the library function used. There is no
|
||||
guarantee that sorting is "stable" or obeys the current locale. You will have
|
||||
to try it out.
|
||||
|
||||
The sorting itself cannot be interrupted, because of using a system library
|
||||
function. You can interrupt the preparation (for undo) and putting the sorted
|
||||
lines into the buffer. In the last case you may end up with duplicated lines.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 7.0aa. Last change: 2005 Feb 14
|
||||
*cmdline.txt* For Vim version 7.0aa. Last change: 2006 Jan 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -153,6 +153,9 @@ CTRL-R {0-9a-z"%#:-=.} *c_CTRL-R* *c_<C-R>*
|
||||
*c_CTRL-R_=*
|
||||
'=' the expression register: you are prompted to
|
||||
enter an expression (see |expression|)
|
||||
(doesn't work at the expression prompt; some
|
||||
things such as changing the buffer or current
|
||||
window are not allowed to avoid side effects)
|
||||
See |registers| about registers. {not in Vi}
|
||||
Implementation detail: When using the |expression| register
|
||||
and invoking setcmdpos(), this sets the position before
|
||||
@@ -191,10 +194,13 @@ CTRL-\ e {expr} *c_CTRL-\_e*
|
||||
to finish it. It's most useful in mappings though. See
|
||||
|expression|.
|
||||
See |c_CTRL-R_=| for inserting the result of an expression.
|
||||
Useful functions are |getcmdline()| and |getcmdpos()|.
|
||||
Useful functions are |getcmdtype()|, |getcmdline()| and
|
||||
|getcmdpos()|.
|
||||
The cursor position is unchanged, except when the cursor was
|
||||
at the end of the line, then it stays at the end.
|
||||
|setcmdpos()| can be used to set the cursor position.
|
||||
The |sandbox| is used for evaluating the expression to avoid
|
||||
nasty side effects.
|
||||
Example: >
|
||||
:cmap <F7> <C-\>eAppendSome()<CR>
|
||||
:func AppendSome()
|
||||
@@ -203,7 +209,9 @@ CTRL-\ e {expr} *c_CTRL-\_e*
|
||||
:call setcmdpos(strlen(cmd))
|
||||
:return cmd
|
||||
:endfunc
|
||||
<
|
||||
< This doesn't work recursively, thus not when already editing
|
||||
an expression.
|
||||
|
||||
*c_CTRL-Y*
|
||||
CTRL-Y When there is a modeless selection, copy the selection into
|
||||
the clipboard. |modeless-selection|
|
||||
@@ -558,7 +566,7 @@ argument for the command, which has a different meaning. For example:
|
||||
"name"
|
||||
|
||||
==============================================================================
|
||||
4. Ex command-line ranges *cmdline-ranges* *[range]* *E16* *E493*
|
||||
4. Ex command-line ranges *cmdline-ranges* *[range]* *E16*
|
||||
|
||||
Some Ex commands accept a line range in front of them. This is noted as
|
||||
[range]. It consists of one or more line specifiers, separated with ',' or
|
||||
@@ -644,11 +652,15 @@ When folds are active the line numbers are rounded off to include the whole
|
||||
closed fold. See |fold-behavior|.
|
||||
|
||||
|
||||
Reverse Range
|
||||
Reverse Range *E493*
|
||||
|
||||
A range should have the lower line number first. If this is not the case, Vim
|
||||
will ask you if it should swap the line numbers. This is not done within the
|
||||
global command ":g".
|
||||
will ask you if it should swap the line numbers.
|
||||
Backwards range given, OK to swap ~
|
||||
This is not done within the global command ":g".
|
||||
|
||||
You can use ":silent" before a command to avoid the question, the range will
|
||||
always be swapped then.
|
||||
|
||||
|
||||
Count and Range *N:*
|
||||
@@ -684,6 +696,12 @@ output.
|
||||
==============================================================================
|
||||
6. Ex special characters *cmdline-special*
|
||||
|
||||
Note: These are special characters in the executed command line. If you want
|
||||
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|.
|
||||
|
||||
|
||||
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()|.
|
||||
@@ -726,7 +744,7 @@ Note: these are typed literally, they are not special keys!
|
||||
effective buffer number (for ":r file" it is the current
|
||||
buffer, the file being read is not in a buffer).
|
||||
<amatch> when executing autocommands, is replaced with the match for
|
||||
which this autocommand was executed. It differs form
|
||||
which this autocommand was executed. It differs from
|
||||
<afile> only when the file name isn't used to match with
|
||||
(for FileType and Syntax events).
|
||||
<sfile> when executing a ":source" command, is replaced with the
|
||||
|
||||
70
runtime/doc/debug.txt
Normal file
70
runtime/doc/debug.txt
Normal file
@@ -0,0 +1,70 @@
|
||||
*debug.txt* For Vim version 7.0aa. Last change: 2005 Dec 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Debugging Vim *debug-vim*
|
||||
|
||||
This is for debugging Vim itself, when it doesn't work properly.
|
||||
For debugging Vim scripts, functions, etc. see |debug-scripts|
|
||||
|
||||
1. Location of a crash, using gcc and gdb |debug-gcc|
|
||||
2. Windows Bug Reporting |debug-win32|
|
||||
|
||||
==============================================================================
|
||||
|
||||
1. Location of a crash, using gcc and gdb *debug-gcc*
|
||||
|
||||
When Vim crashes in one of the test files, and you are using gcc for
|
||||
compilation, here is what you can do to find out exactly where Vim crashes.
|
||||
This also applies when using the MingW tools.
|
||||
|
||||
1. Compile Vim with the "-g" option (there is a line in the Makefile for this,
|
||||
which you can uncomment).
|
||||
|
||||
2. Execute these commands (replace "11" with the test that fails): >
|
||||
cd testdir
|
||||
gdb ../vim
|
||||
run -u unix.vim -U NONE -s dotest.in test11.in
|
||||
|
||||
3. Check where Vim crashes, gdb should give a message for this.
|
||||
|
||||
4. Get a stack trace from gdb with this command: >
|
||||
where
|
||||
< You can check out different places in the stack trace with: >
|
||||
frame 3
|
||||
< Replace "3" with one of the numbers in the stack trace.
|
||||
|
||||
==============================================================================
|
||||
|
||||
2. Windows Bug Reporting *debug-win32*
|
||||
|
||||
If the Windows version of Vim crashes in a reproducible manner,
|
||||
you can take some steps to provide a useful bug report.
|
||||
|
||||
First, you must obtain the debugger symbols (PDB) file for your executable:
|
||||
gvim.pdb for gvim.exe, or vim.pdb for vim.exe. It should be available
|
||||
from the same place that you obtained the executable. Be sure to use
|
||||
the PDB that matches the EXE.
|
||||
|
||||
If you built the executable yourself with the Microsoft Visual C++ compiler,
|
||||
then the PDB was built with the EXE.
|
||||
|
||||
You can download the Microsoft Visual C++ Toolkit from
|
||||
http://msdn.microsoft.com/visualc/vctoolkit2003/
|
||||
This contains the command-line tools, but not the Visual Studio IDE.
|
||||
|
||||
The Debugging Tools for Windows can be downloaded from
|
||||
http://www.microsoft.com/whdc/devtools/debugging/default.mspx
|
||||
This includes the WinDbg debugger.
|
||||
|
||||
If you have Visual Studio, use that instead of the VC Toolkit
|
||||
and WinDbg.
|
||||
|
||||
For other compilers, you should always use the corresponding debugger: TD for
|
||||
a Vim executable compiled with the Borland compiler; gdb (see above
|
||||
|debug-gcc|) for the Cygwin and MinGW compilers.
|
||||
|
||||
=========================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
@@ -1,4 +1,4 @@
|
||||
*develop.txt* For Vim version 7.0aa. Last change: 2005 Jun 04
|
||||
*develop.txt* For Vim version 7.0aa. Last change: 2006 Jan 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -123,7 +123,8 @@ VIM IS... MAINTAINABLE *design-maintain*
|
||||
|
||||
- The source code should not become a mess. It should be reliable code.
|
||||
- Use the same layout in all files to make it easy to read |coding-style|.
|
||||
- Use comments in a useful way!
|
||||
- Use comments in a useful way! Quoting the function name and argument names
|
||||
is NOT useful. Do explain what they are for.
|
||||
- Porting to another platform should be made easy, without having to change
|
||||
too much platform-independent code.
|
||||
- Use the object-oriented spirit: Put data and code together. Minimize the
|
||||
@@ -237,8 +238,8 @@ get_env_value() Linux system function
|
||||
|
||||
VARIOUS *style-various*
|
||||
|
||||
Typedef'ed names should end in "_t": >
|
||||
typedef int some_t;
|
||||
Typedef'ed names should end in "_T": >
|
||||
typedef int some_T;
|
||||
Define'ed names should be uppercase: >
|
||||
#define SOME_THING
|
||||
Features always start with "FEAT_": >
|
||||
@@ -375,12 +376,14 @@ checking engine in Vim, for various reasons:
|
||||
|
||||
- Missing support for multi-byte encodings. At least UTF-8 must be supported,
|
||||
so that more than one language can be used in the same file.
|
||||
Doing on-the-fly conversion is not always possible (would require iconv
|
||||
support).
|
||||
- For the programs and libraries: Using them as-is would require installing
|
||||
them separately from Vim. That's not impossible, but a drawback.
|
||||
them separately from Vim. That's mostly not impossible, but a drawback.
|
||||
- Performance: A few tests showed that it's possible to check spelling on the
|
||||
fly (while redrawing), just like syntax highlighting. But the mechanisms
|
||||
used by other code are much slower. Myspell uses a simplistic hashtable,
|
||||
for example.
|
||||
used by other code are much slower. Myspell uses a hashtable, for example.
|
||||
The affix compression that most spell checkers use makes it slower too.
|
||||
- For using an external program like aspell a communication mechanism would
|
||||
have to be setup. That's complicated to do in a portable way (Unix-only
|
||||
would be relatively simple, but that's not good enough). And performance
|
||||
@@ -392,16 +395,92 @@ checking engine in Vim, for various reasons:
|
||||
all English words and highlight non-Canadian words differently.
|
||||
- Missing support for rare words. Many words are correct but hardly ever used
|
||||
and could be a misspelled often-used word.
|
||||
- For making suggestions the speed is less important and requiring to install
|
||||
another program or library would be acceptable. But the word lists probably
|
||||
differ, the suggestions may be wrong words.
|
||||
|
||||
|
||||
Spelling suggestions *develop-spell-suggestions*
|
||||
|
||||
For making suggestions there are two basic mechanisms:
|
||||
1. Try changing the bad word a little bit and check for a match with a good
|
||||
word. Or go through the list of good words, change them a little bit and
|
||||
check for a match with the bad word. The changes are deleting a character,
|
||||
inserting a character, swapping two characters, etc.
|
||||
2. Perform soundfolding on both the bad word and the good words and then find
|
||||
matches, possibly with a few changes like with the first mechanism.
|
||||
|
||||
The first is good for finding typing mistakes. After experimenting with
|
||||
hashtables and looking at solutions from other spell checkers the conclusion
|
||||
was that a trie (a kind of tree structure) is ideal for this. Both for
|
||||
reducing memory use and being able to try sensible changes. For example, when
|
||||
inserting a character only characters that lead to good words need to be
|
||||
tried. Other mechanisms (with hashtables) need to try all possible letters at
|
||||
every position in the word. Also, a hashtable has the requirement that word
|
||||
boundaries are identified separately, while a trie does not require this.
|
||||
That makes the mechanism a lot simpler.
|
||||
|
||||
Soundfolding is useful when someone knows how the words sounds but doesn't
|
||||
know how it is spelled. For example, the word "dictionary" might be written
|
||||
as "daktonerie". The number of changes that the first method would need to
|
||||
try is very big, it's hard to find the good word that way. After soundfolding
|
||||
the words become "tktnr" and "tkxnry", these differ by only two letters.
|
||||
|
||||
To find words by their soundfolded equivalent (soundalike word) we need a list
|
||||
of all soundfolded words. A few experiments have been done to find out what
|
||||
the best method is. Alternatives:
|
||||
1. Do the sound folding on the fly when looking for suggestions. This means
|
||||
walking through the trie of good words, soundfolding each word and
|
||||
checking how different it is from the bad word. This is very efficient for
|
||||
memory use, but takes a long time. On a fast PC it takes a couple of
|
||||
seconds for English, which can be acceptable for interactive use. But for
|
||||
some languages it takes more than ten seconds (e.g., German, Catalan),
|
||||
which is unacceptable slow. For batch processing (automatic corrections)
|
||||
it's to slow for all languages.
|
||||
2. Use a trie for the soundfolded words, so that searching can be done just
|
||||
like how it works without soundfolding. This requires remembering a list
|
||||
of good words for each soundfolded word. This makes finding matches very
|
||||
fast but requires quite a lot of memory, in the order of 1 to 10 Mbyte.
|
||||
For some languages more than the original word list.
|
||||
3. Like the second alternative, but reduce the amount of memory by using affix
|
||||
compression and store only the soundfolded basic word. This is what Aspell
|
||||
does. Disadvantage is that affixes need to be stripped from the bad word
|
||||
before soundfolding it, which means that mistakes at the start and/or end
|
||||
of the word will cause the mechanism to fail. Also, this becomes slow when
|
||||
the bad word is quite different from the good word.
|
||||
|
||||
The choice made is to use the second mechanism and use a separate file. This
|
||||
way a user with sufficient memory can get very good suggestions while a user
|
||||
who is short of memory or just wants the spell checking and no suggestions
|
||||
doesn't use so much memory.
|
||||
|
||||
|
||||
Word frequency
|
||||
|
||||
For sorting suggestions it helps to know which words are common. In theory we
|
||||
could store a word frequency with the word in the dictionary. However, this
|
||||
requires storing a count per word. That degrades word tree compression a lot.
|
||||
And maintaining the word frequency for all languages will be a heavy task.
|
||||
Also, it would be nice to prefer words that are already in the text. This way
|
||||
the words that appear in the specific text are preferred for suggestions.
|
||||
|
||||
What has been implemented is to count words that have been seen during
|
||||
displaying. A hashtable is used to quickly find the word count. The count is
|
||||
initialized from words listed in COMMON items in the affix file, so that it
|
||||
also works when starting a new file.
|
||||
|
||||
This isn't ideal, because the longer Vim is running the higher the counts
|
||||
become. But in practice it is a noticable improvement over not using the word
|
||||
count.
|
||||
|
||||
==============================================================================
|
||||
4. Assumptions *design-assumptions*
|
||||
|
||||
Size of variables:
|
||||
char 8 bit signed
|
||||
char_u 8 bit unsigned
|
||||
int 16, 32 or 64 bit signed
|
||||
unsigned 16, 32 or 64 bit unsigned
|
||||
int 32 or 64 bit signed (16 might be possible with limited features)
|
||||
unsigned 32 or 64 bit unsigned (16 as with ints)
|
||||
long 32 or 64 bit signed, can hold a pointer
|
||||
|
||||
Note that some compilers cannot handle long lines or strings. The C89
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*diff.txt* For Vim version 7.0aa. Last change: 2005 Apr 26
|
||||
*diff.txt* For Vim version 7.0aa. Last change: 2006 Jan 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -218,7 +218,7 @@ It is an error if there is no change for the cursor to move to.
|
||||
|
||||
==============================================================================
|
||||
4. Diff copying *copy-diffs* *E99* *E100* *E101* *E102* *E103*
|
||||
|
||||
*merge*
|
||||
There are two commands to copy text from one buffer to another. The result is
|
||||
that the buffers will be equal within the specified range.
|
||||
|
||||
@@ -235,6 +235,8 @@ that the buffers will be equal within the specified range.
|
||||
Modify another buffer to undo difference with the current
|
||||
buffer. Just like ":diffget" but the other buffer is modified
|
||||
instead of the current one.
|
||||
When [bufspec] is omitted and there is more than one other
|
||||
buffer in diff mode where 'modifiable' is set this fails.
|
||||
See below for [range].
|
||||
|
||||
*do*
|
||||
@@ -343,8 +345,8 @@ get an error message. Possible causes:
|
||||
- The 'shell' and associated options are not set correctly. Try if filtering
|
||||
works with a command like ":!sort".
|
||||
- You are using 'diffexpr' and it doesn't work.
|
||||
If it's not clear what the problem is set the 'verbose' option to see more
|
||||
messages.
|
||||
If it's not clear what the problem is set the 'verbose' option to one or more
|
||||
to see more messages.
|
||||
|
||||
The self-installing Vim includes a diff program. If you don't have it you
|
||||
might want to download a diff.exe. For example from
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*digraph.txt* For Vim version 7.0aa. Last change: 2005 Mar 06
|
||||
*digraph.txt* For Vim version 7.0aa. Last change: 2005 Sep 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -166,7 +166,8 @@ EURO
|
||||
Exception: RFC1345 doesn't specify the euro sign. In Vim the digraph =e was
|
||||
added for this. Note the difference between latin1, where the digraph Cu is
|
||||
used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is
|
||||
used for the euro sign, while both of them are the character 164, 0xa4.
|
||||
used for the euro sign, while both of them are the character 164, 0xa4. For
|
||||
compatibility with zsh Eu can also be used for the euro sign.
|
||||
|
||||
*digraph-table*
|
||||
char digraph hex dec official name ~
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 7.0aa. Last change: 2005 May 21
|
||||
*editing.txt* For Vim version 7.0aa. Last change: 2006 Jan 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -155,11 +155,14 @@ Technical: On the Amiga you can use 30 characters for a file name. But on an
|
||||
When you started editing without giving a file name, "No File" is displayed in
|
||||
messages. If the ":write" command is used with a file name argument, the file
|
||||
name for the current file is set to that file name. This only happens when
|
||||
the 'F' flag is included in 'cpoptions' (by default it is included). This is
|
||||
useful when entering text in an empty buffer and then writing it to a file.
|
||||
If 'cpoptions' contains the 'f' flag (by default it is NOT included) the file
|
||||
name is set for the ":read file" command. This is useful when starting Vim
|
||||
without an argument and then doing ":read file" to start editing a file.
|
||||
the 'F' flag is included in 'cpoptions' (by default it is included) |cpo-F|.
|
||||
This is useful when entering text in an empty buffer and then writing it to a
|
||||
file. If 'cpoptions' contains the 'f' flag (by default it is NOT included)
|
||||
|cpo-f| the file name is set for the ":read file" command. This is useful
|
||||
when starting Vim without an argument and then doing ":read file" to start
|
||||
editing a file.
|
||||
When the file name was set and 'filetype' is empty the filetype detection
|
||||
autocommands will be triggered.
|
||||
*not-edited*
|
||||
Because the file name was set without really starting to edit that file, you
|
||||
are protected from overwriting that file. This is done by setting the
|
||||
@@ -354,14 +357,32 @@ file1 file2") embedded spaces must be escaped with a backslash.
|
||||
*wildcard*
|
||||
Wildcards in {file} are expanded. Which wildcards are supported depends on
|
||||
the system. These are the common ones:
|
||||
* matches anything, including nothing
|
||||
? matches one character
|
||||
* matches anything, including nothing
|
||||
** matches anything, including nothing, recurses into directories
|
||||
[abc] match 'a', 'b' or 'c'
|
||||
|
||||
To avoid the special meaning of the wildcards prepend a backslash. However,
|
||||
on MS-Windows the backslash is a path separator and "path\[abc]" is still seen
|
||||
as a wildcard when "[" is in the 'isfname' option. A simple way to avoid this
|
||||
is to use "path\[[]abc]". Then the file "path[abc]" literally.
|
||||
|
||||
*starstar-wildcard*
|
||||
Expanding "**" is possible on Unix, Win32, Mac OS/X and a few other systems.
|
||||
This allows searching a directory tree. This goes up to 100 directories deep.
|
||||
Example: >
|
||||
:n **/*.txt
|
||||
Finds files:
|
||||
ttt.txt
|
||||
subdir/ttt.txt
|
||||
a/b/c/d/ttt.txt
|
||||
When non-wildcard characters are used these are only matched in the first
|
||||
directory. Example: >
|
||||
:n /usr/inc**/*.h
|
||||
Finds files:
|
||||
/usr/include/types.h
|
||||
/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: >
|
||||
@@ -380,8 +401,9 @@ The expression can contain just about anything, thus this can also be used to
|
||||
avoid the special meaning of '"', '|', '%' and '#'.
|
||||
|
||||
*++opt* *[++opt]*
|
||||
The [++opt] argument can be used to force the value of 'fileformat' or
|
||||
'fileencoding' to a value for one command. The form is: >
|
||||
The [++opt] argument can be used to force the value of 'fileformat',
|
||||
'fileencoding' or 'binary' to a value for one command, and to specify the
|
||||
behavior for bad characters. The form is: >
|
||||
++{optname}={value}
|
||||
|
||||
Where {optname} is one of: *++ff* *++enc* *++bin* *++nobin*
|
||||
@@ -389,6 +411,7 @@ Where {optname} is one of: *++ff* *++enc* *++bin* *++nobin*
|
||||
enc or encoding overrides 'fileencoding'
|
||||
bin or binary sets 'binary'
|
||||
nobin or nobinary resets 'binary'
|
||||
bad specifies behavior for bad characters
|
||||
|
||||
{value} cannot contain white space. It can be any valid value for these
|
||||
options. Examples: >
|
||||
@@ -398,12 +421,24 @@ This edits the same file again with 'fileformat' set to "unix". >
|
||||
:w ++enc=latin1 newfile
|
||||
This writes the current buffer to "newfile" in latin1 format.
|
||||
|
||||
There may be several ++opt arguments, separated by white space. They must all
|
||||
appear before any |+cmd| argument.
|
||||
|
||||
*++bad*
|
||||
The argument of "++bad=" specifies what happens with characters that can't be
|
||||
converted and illegal bytes. It can be one of three things:
|
||||
++bad=X A single-byte character that replaces each bad character.
|
||||
++bad=keep Keep bad characters without conversion. Note that this may
|
||||
result in illegal bytes in your text!
|
||||
++bad=drop Remove the bad characters.
|
||||
|
||||
The default is like "++bad=?": Replace each bad character with a question
|
||||
mark.
|
||||
|
||||
Note that when reading, the 'fileformat' and 'fileencoding' options will be
|
||||
set to the used format. When writing this doesn't happen, thus a next write
|
||||
will use the old value of the option. Same for the 'binary' option.
|
||||
|
||||
There may be several ++opt arguments, separated by white space. They must all
|
||||
appear before any |+cmd| argument.
|
||||
|
||||
*+cmd* *[+cmd]*
|
||||
The [+cmd] argument can be used to position the cursor in the newly opened
|
||||
@@ -842,6 +877,8 @@ used, for example, when the write fails and you want to try again later with
|
||||
the filename of the current buffer to {file}. The
|
||||
previous name is used for the alternate file name.
|
||||
The [!] is needed to overwrite an existing file.
|
||||
When 'filetype' is empty filetype detection is done
|
||||
with the new name, before the file is written.
|
||||
{not in Vi}
|
||||
|
||||
*:up* *:update*
|
||||
@@ -1406,7 +1443,7 @@ problem goes away the next day.
|
||||
The file searching is currently used for the 'path', 'cdpath' and 'tags'
|
||||
options. There are three different types of searching:
|
||||
|
||||
1) Downward search:
|
||||
1) Downward search: *starstar*
|
||||
Downward search uses the wildcards '*', '**' and possibly others
|
||||
supported by your operating system. '*' and '**' are handled inside Vim, so
|
||||
they work on all operating systems.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
*filetype.txt* For Vim version 7.0aa. Last change: 2005 Mar 29
|
||||
*filetype.txt* For Vim version 7.0aa. Last change: 2005 Sep 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -44,15 +44,21 @@ Detail: The ":filetype on" command will load one of these files:
|
||||
name, the file $VIMRUNTIME/scripts.vim is used to detect it from the
|
||||
contents of the file.
|
||||
|
||||
To add your own file types, see |new-filetype| below.
|
||||
To add your own file types, see |new-filetype| below. To search for help on a
|
||||
filetype prepend "ft-" and optionally append "-syntax", "-indent" or
|
||||
"-plugin". For example: >
|
||||
:help ft-vim-indent
|
||||
:help ft-vim-syntax
|
||||
:help ft-man-plugin
|
||||
|
||||
If the file type is not detected automatically, or it finds the wrong type,
|
||||
you can either set the 'filetype' option manually, or add a modeline to your
|
||||
file. Example, for in an IDL file use the command: >
|
||||
:set filetype=idl
|
||||
or add this |modeline| to the file: >
|
||||
/* vim: set filetype=idl : */
|
||||
<
|
||||
|
||||
or add this |modeline| to the file:
|
||||
/* vim: set filetype=idl : */ ~
|
||||
|
||||
*:filetype-plugin-on*
|
||||
You can enable loading the plugin files for specific file types with: >
|
||||
:filetype plugin on
|
||||
@@ -132,16 +138,16 @@ kind of file it is. This doesn't always work. A number of global variables
|
||||
can be used to overrule the filetype used for certain extensions:
|
||||
|
||||
file name variable ~
|
||||
*.asa g:filetype_asa |aspvbs-syntax| |aspperl-syntax|
|
||||
*.asp g:filetype_asp |aspvbs-syntax| |aspperl-syntax|
|
||||
*.asm g:asmsyntax |asm-syntax|
|
||||
*.asa g:filetype_asa |ft-aspvbs-syntax| |ft-aspperl-syntax|
|
||||
*.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax|
|
||||
*.asm g:asmsyntax |ft-asm-syntax|
|
||||
*.prg g:filetype_prg
|
||||
*.pl g:filetype_pl
|
||||
*.inc g:filetype_inc
|
||||
*.w g:filetype_w |cweb-syntax|
|
||||
*.i g:filetype_i |progress-syntax|
|
||||
*.p g:filetype_p |pascal-syntax|
|
||||
*.sh g:bash_is_sh |sh-syntax|
|
||||
*.w g:filetype_w |ft-cweb-syntax|
|
||||
*.i g:filetype_i |ft-progress-syntax|
|
||||
*.p g:filetype_p |ft-pascal-syntax|
|
||||
*.sh g:bash_is_sh |ft-sh-syntax|
|
||||
|
||||
*filetype-ignore*
|
||||
To avoid that certain files are being inspected, the g:ft_ignore_pat variable
|
||||
@@ -178,7 +184,8 @@ A. If you want to overrule all default file type checks.
|
||||
< 3. To use the new filetype detection you must restart Vim.
|
||||
|
||||
The files in the "ftdetect" directory are used after all the default
|
||||
checks, thus they can overrule a previously detected file type.
|
||||
checks, thus they can overrule a previously detected file type. But you
|
||||
can also use |:setfiletype| to keep a previously detected filetype.
|
||||
|
||||
B. If you want to detect your file after the default file type checks.
|
||||
|
||||
@@ -380,7 +387,7 @@ ways to change this:
|
||||
3. Docs for the default filetype plugins. *ftplugin-docs*
|
||||
|
||||
|
||||
CHANGELOG *changelog-plugin*
|
||||
CHANGELOG *ft-changelog-plugin*
|
||||
|
||||
Allows for easy entrance of Changelog entries in Changelog files. There are
|
||||
some commands, mappings, and variables worth exploring:
|
||||
@@ -401,7 +408,7 @@ Local mappings:
|
||||
Global mappings:
|
||||
NOTE: The global mappings are accessed by sourcing the
|
||||
ftplugin/changelog.vim file first, e.g. with >
|
||||
runtime ftplugin/man.vim
|
||||
runtime ftplugin/changelog.vim
|
||||
< in your |.vimrc|.
|
||||
<Leader>o Switches to the ChangeLog buffer opened for the
|
||||
current directory, or opens it in a new buffer if it
|
||||
@@ -466,7 +473,7 @@ under it. If not found, a new entry and item is prepended to the beginning of
|
||||
the Changelog.
|
||||
|
||||
|
||||
FORTRAN *fortran-plugin*
|
||||
FORTRAN *ft-fortran-plugin*
|
||||
|
||||
Options:
|
||||
'expandtab' is switched on to avoid tabs as required by the Fortran
|
||||
@@ -476,10 +483,10 @@ Options:
|
||||
'formatoptions' is set to break code and comment lines and to preserve long
|
||||
lines. You can format comments with |gq|.
|
||||
For further discussion of fortran_have_tabs and the method used for the
|
||||
detection of source format see |fortran-syntax|.
|
||||
detection of source format see |ft-fortran-syntax|.
|
||||
|
||||
|
||||
MAIL *mail-plugin*
|
||||
MAIL *ft-mail-plugin*
|
||||
|
||||
Options:
|
||||
'modeline' is switched off to avoid the danger of trojan horses, and to
|
||||
@@ -496,7 +503,7 @@ Local mappings:
|
||||
to the end of the file in Normal mode. This means "> " is inserted in
|
||||
each line.
|
||||
|
||||
MAN *man-plugin* *:Man*
|
||||
MAN *ft-man-plugin* *:Man*
|
||||
|
||||
Displays a manual page in a nice way. Also see the user manual
|
||||
|find-manpage|.
|
||||
@@ -523,7 +530,7 @@ CTRL-] Jump to the manual page for the word under the cursor.
|
||||
CTRL-T Jump back to the previous manual page.
|
||||
|
||||
|
||||
RPM SPEC *spec-plugin*
|
||||
RPM SPEC *ft-spec-plugin*
|
||||
|
||||
Since the text for this plugin is rather long it has been put in a separate
|
||||
file: |pi_spec.txt|.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*fold.txt* For Vim version 7.0aa. Last change: 2005 Mar 29
|
||||
*fold.txt* For Vim version 7.0aa. Last change: 2005 Sep 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -512,7 +512,8 @@ FOLDCOLUMN *fold-foldcolumn*
|
||||
|
||||
'foldcolumn' is a number, which sets the width for a column on the side of the
|
||||
window to indicate folds. When it is zero, there is no foldcolumn. A normal
|
||||
value is 4 or 5. The minimal useful value is 2. The maximum is 12.
|
||||
value is 4 or 5. The minimal useful value is 2, although 1 still provides
|
||||
some information. The maximum is 12.
|
||||
|
||||
An open fold is indicated with a column that has a '-' at the top and '|'
|
||||
characters below it. This column stops where the open fold stops. When folds
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*gui.txt* For Vim version 7.0aa. Last change: 2005 Apr 11
|
||||
*gui.txt* For Vim version 7.0aa. Last change: 2005 Aug 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -79,7 +79,7 @@ All this happens AFTER the normal Vim initializations, like reading your
|
||||
But the GUI window is only opened after all the initializations have been
|
||||
carried out. If you want some commands to be executed just after opening the
|
||||
GUI window, use the |GUIEnter| autocommand event. Example: >
|
||||
:autocommand GUIEnter * winpos 100 50
|
||||
:autocmd GUIEnter * winpos 100 50
|
||||
|
||||
You can use the gvimrc files to set up your own customized menus (see |:menu|)
|
||||
and initialize other things that you may want to set up differently from the
|
||||
@@ -736,9 +736,9 @@ from the main menu bar. You must then use the |:popup| or |:tearoff| command
|
||||
to display it.
|
||||
|
||||
*popup-menu*
|
||||
In the Win32, KDE, GTK+, Motif, Athena and Photon GUI, you can define the special
|
||||
menu "PopUp". This is the menu that is displayed when the right mouse button
|
||||
is pressed, if 'mousemodel' is set to popup or popup_setpos.
|
||||
In the Win32, KDE, GTK+, Motif, Athena and Photon GUI, you can define the
|
||||
special menu "PopUp". This is the menu that is displayed when the right mouse
|
||||
button is pressed, if 'mousemodel' is set to popup or popup_setpos.
|
||||
|
||||
|
||||
5.3 Showing What Menus Are Mapped To *showing-menus*
|
||||
@@ -897,9 +897,13 @@ it behaves in a strange way.
|
||||
appear on the menu-bar (see |hidden-menus|).
|
||||
{only available for Win32 and GTK GUI}
|
||||
|
||||
:popu[p]! {name} Like above, but use the position of the mouse
|
||||
pointer instead of the cursor.
|
||||
|
||||
Example: >
|
||||
:popup File
|
||||
will make the "File" menu (if there is one) appear at the text cursor. >
|
||||
will make the "File" menu (if there is one) appear at the text cursor (mouse
|
||||
pointer if ! was used). >
|
||||
|
||||
:amenu ]Toolbar.Make :make<CR>
|
||||
:popup ]Toolbar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*gui_x11.txt* For Vim version 7.0aa. Last change: 2005 Mar 29
|
||||
*gui_x11.txt* For Vim version 7.0aa. Last change: 2005 Dec 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -437,59 +437,9 @@ command line argument).
|
||||
==============================================================================
|
||||
7. KDE version *gui-kde* *kde* *KDE* *KVim*
|
||||
|
||||
NOTE: The KDE version is still under development. It is not recommended for
|
||||
daily work.
|
||||
|
||||
The KDE version of Vim works with KDE 2.x and KDE 3.x.
|
||||
KVim (name code for gui-kde) does not use traditional X settings for its
|
||||
configuration.
|
||||
Most important difference is the font handling, KVim uses QFont to display the
|
||||
text. To set your font use the following syntax :
|
||||
>
|
||||
:set guifont=Fixed\ [Misc]/10/-1/5/50/0/0/0/1/0
|
||||
<
|
||||
the '10' value is the font size, other settings concerns more specific Qt
|
||||
options which you should not need to care with.
|
||||
The suggested way to choose your font is through the font selection dialog
|
||||
available with the command :
|
||||
:set guifont=*
|
||||
|
||||
Note: X Font names are not supported any more, so if you use GVim too, you'll
|
||||
have to set something like this in your ~/.gvimrc : >
|
||||
|
||||
if has("gui_kde")
|
||||
:set guifont=Fixed\ [Misc]/10/-1/5/50/0/0/0/1/0
|
||||
else if has("gui_gtk")
|
||||
:set guifont=-misc-fixed-medium-r-normal-*-*-100-*-*-c-*-iso10646-1
|
||||
endif
|
||||
<
|
||||
*antialias*
|
||||
KVim uses antialias for its font, so that the text looks better, to disable
|
||||
this you have to refer to Qt's documentation (export QT_XFT=0 for QT 2.x).
|
||||
|
||||
KDE provides some other features, like being able to move the menubar and the
|
||||
toolbar wherever you want around the text area.
|
||||
|
||||
*kde-toolbar*
|
||||
KVim can be used with a KDE-look toolbar instead of Vim's default toolbar. To
|
||||
enable this feature you have to run the configure script with the
|
||||
--enable-kde-toolbar switch. It may be moved to a runtime option in the
|
||||
future.
|
||||
|
||||
*DCOP*
|
||||
Since Vim 6.0, the new ClientServer feature has been added, it works fine in
|
||||
KVim too. KVim also provides its own communication scheme based on DCOP. This
|
||||
is mainly used by the |vimpart| but can freely be used by other applications
|
||||
or manually through KDE's DCOP tools. The DCOP servername is synchronized with
|
||||
the X11 servername so that it's easier to identify the same KVim through the
|
||||
two communication systems.
|
||||
|
||||
*vimpart* *vim-kpart*
|
||||
KVim developers are also working on a component to allow embedding of Vim into
|
||||
KDE's applications. As of this writing, the component is working and can be
|
||||
used in different KDE applications. New KDE applications should support it
|
||||
soon. To get more information about this component, refer to
|
||||
http://freehackers.org/kvim or to the KDE project.
|
||||
There is no KDE version of Vim. There has been some work on a port using the
|
||||
Qt toolkit, but it never worked properly and it has been abandoned. Work
|
||||
continues on Yzis: www.yzis.org.
|
||||
|
||||
==============================================================================
|
||||
8. Compiling *gui-x11-compiling*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*help.txt* For Vim version 7.0aa. Last change: 2005 Mar 19
|
||||
*help.txt* For Vim version 7.0aa. Last change: 2005 Nov 30
|
||||
|
||||
VIM - main help file
|
||||
k
|
||||
@@ -17,13 +17,13 @@ Get specific help: It is possible to go directly to whatever you want help
|
||||
It is possible to further specify the context:
|
||||
*help-context*
|
||||
WHAT PREPEND EXAMPLE ~
|
||||
Normal mode commands (nothing) :help x
|
||||
Visual mode commands v_ :help v_u
|
||||
Insert mode commands i_ :help i_<Esc>
|
||||
Command-line commands : :help :quit
|
||||
Normal mode command (nothing) :help x
|
||||
Visual mode command v_ :help v_u
|
||||
Insert mode command i_ :help i_<Esc>
|
||||
Command-line command : :help :quit
|
||||
Command-line editing c_ :help c_<Del>
|
||||
Vim command arguments - :help -r
|
||||
Options ' :help 'textwidth'
|
||||
Vim command argument - :help -r
|
||||
Option ' :help 'textwidth'
|
||||
Search for help: Type ":help word", then hit CTRL-D to see matching
|
||||
help entries for "word".
|
||||
|
||||
@@ -97,6 +97,7 @@ General subjects ~
|
||||
|quotes.txt| remarks from users of Vim
|
||||
|todo.txt| known problems and desired extensions
|
||||
|develop.txt| development of Vim
|
||||
|debug.txt| debugging Vim itself
|
||||
|uganda.txt| Vim distribution conditions and what to do with your money
|
||||
|
||||
Basic editing ~
|
||||
@@ -190,6 +191,13 @@ Standard plugins ~
|
||||
|pi_expl.txt| File explorer
|
||||
|
||||
LOCAL ADDITIONS: *local-additions*
|
||||
|cecutil.txt| DrChip's Utilities Jun 11, 2004
|
||||
|engspchk.txt| English Spelling Checker (v61) Mar 14, 2005
|
||||
|example.txt| Example for a locally added help file
|
||||
|matchit.txt| Extended "%" matching
|
||||
|test.txt| Testing the h<>lp c<>mm<6D>nd n<>w
|
||||
|typecorr.txt| Plugin for correcting typing mistakes
|
||||
|helpp.txt| Dummy line to avoid an error message
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*bars* Bars example
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_mzsch.txt* For Vim version 7.0aa. Last change: 2005 May 08
|
||||
*if_mzsch.txt* For Vim version 7.0aa. Last change: 2006 Jan 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Sergey Khorev
|
||||
@@ -10,6 +10,7 @@ The MzScheme Interface to Vim *mzscheme* *MzScheme*
|
||||
2. Examples |mzscheme-examples|
|
||||
3. Threads |mzscheme-threads|
|
||||
4. The Vim access procedures |mzscheme-vim|
|
||||
5. Dynamic loading |mzscheme-dynamic|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
@@ -243,5 +244,23 @@ Windows *mzscheme-window*
|
||||
a pair (linenr . column).
|
||||
(set-cursor (line . col) [window]) Set cursor position.
|
||||
|
||||
==============================================================================
|
||||
5. Dynamic loading *mzscheme-dynamic*
|
||||
|
||||
On MS-Windows the MzScheme libraries can be loaded dynamically. The |:version|
|
||||
output then includes |+mzscheme/dyn|.
|
||||
|
||||
This means that Vim will search for the MzScheme DLL files only when needed.
|
||||
When you don't use the MzScheme interface you don't need them, thus you can
|
||||
use Vim without these DLL files.
|
||||
|
||||
To use the MzScheme interface the MzScheme DLLs must be in your search path.
|
||||
In a console window type "path" to see what directories are used.
|
||||
|
||||
The names of the DLLs must match the MzScheme version Vim was compiled with.
|
||||
For MzScheme version 209 they will be "libmzsch209_000.dll" and
|
||||
"libmzgc209_000.dll". To know for sure edit "gvim.exe" and search for
|
||||
"libmzsch\d\d\d_\d\d\d\.dll\c".
|
||||
|
||||
======================================================================
|
||||
vim:tw=78:ts=8:sts=4:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_perl.txt* For Vim version 7.0aa. Last change: 2005 Mar 29
|
||||
*if_perl.txt* For Vim version 7.0aa. Last change: 2005 Oct 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Sven Verdoolaege
|
||||
@@ -9,6 +9,7 @@ Perl and Vim *perl* *Perl*
|
||||
1. Editing Perl files |perl-editing|
|
||||
2. Compiling VIM with Perl interface |perl-compiling|
|
||||
3. Using the Perl interface |perl-using|
|
||||
4. Dynamic loading |perl-dynamic|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
@@ -259,4 +260,22 @@ function: >
|
||||
endif
|
||||
Note that "EOF" must be at the start of the line.
|
||||
|
||||
==============================================================================
|
||||
4. Dynamic loading *perl-dynamic*
|
||||
|
||||
On MS-Windows the Perl library can be loaded dynamically. The |:version|
|
||||
output then includes |+perl/dyn|.
|
||||
|
||||
This means that Vim will search for the Perl DLL file only when needed. When
|
||||
you don't use the Perl interface you don't need it, thus you can use Vim
|
||||
without this DLL file.
|
||||
|
||||
To use the Perl interface the Perl DLL must be in your search path. In a
|
||||
console window type "path" to see what directories are used.
|
||||
|
||||
The name of the DLL must match the Perl version Vim was compiled with.
|
||||
Currently the name is "perl58.dll". That is for Perl 5.8. To know for
|
||||
sure edit "gvim.exe" and search for "perl\d*.dll\c".
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_pyth.txt* For Vim version 7.0aa. Last change: 2005 Mar 29
|
||||
*if_pyth.txt* For Vim version 7.0aa. Last change: 2006 Jan 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Paul Moore
|
||||
@@ -11,6 +11,7 @@ The Python Interface to Vim *python* *Python*
|
||||
3. Buffer objects |python-buffer|
|
||||
4. Range objects |python-range|
|
||||
5. Window objects |python-window|
|
||||
6. Dynamic loading |python-dynamic|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
@@ -130,14 +131,24 @@ vim.command(str) *python-command*
|
||||
|
||||
vim.eval(str) *python-eval*
|
||||
Evaluates the expression str using the vim internal expression
|
||||
evaluator (see |expression|). Returns the expression result as a
|
||||
string.
|
||||
evaluator (see |expression|). Returns the expression result as:
|
||||
- a string if the Vim expression evaluates to a string or number
|
||||
- a list if the Vim expression evaluates to a Vim list
|
||||
- a dictionary if the Vim expression evaluates to a Vim dictionary
|
||||
Dictionaries and lists are recursively expanded.
|
||||
Examples: >
|
||||
:py text_width = vim.eval("&tw")
|
||||
:py str = vim.eval("12+12") # NB result is a string! Use
|
||||
# string.atoi() to convert to
|
||||
# a number.
|
||||
|
||||
:py tagList = vim.eval('taglist("eval_expr")')
|
||||
< The latter will return a python list of python dicts, for instance:
|
||||
[{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name':
|
||||
'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}]
|
||||
|
||||
|
||||
|
||||
Error object of the "vim" module
|
||||
|
||||
vim.error *python-error*
|
||||
@@ -299,5 +310,22 @@ Window attributes are:
|
||||
The height attribute is writable only if the screen is split horizontally.
|
||||
The width attribute is writable only if the screen is split vertically.
|
||||
|
||||
==============================================================================
|
||||
6. Dynamic loading *python-dynamic*
|
||||
|
||||
On MS-Windows the Python library can be loaded dynamically. The |:version|
|
||||
output then includes |+python/dyn|.
|
||||
|
||||
This means that Vim will search for the Python DLL file only when needed.
|
||||
When you don't use the Python interface you don't need it, thus you can use
|
||||
Vim without this DLL file.
|
||||
|
||||
To use the Python interface the Python DLL must be in your search path. In a
|
||||
console window type "path" to see what directories are used.
|
||||
|
||||
The name of the DLL must match the Python version Vim was compiled with.
|
||||
Currently the name is "python24.dll". That is for Python 2.4. To know for
|
||||
sure edit "gvim.exe" and search for "python\d*.dll\c".
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_ruby.txt* For Vim version 7.0aa. Last change: 2005 Mar 29
|
||||
*if_ruby.txt* For Vim version 7.0aa. Last change: 2005 Oct 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Shugo Maeda
|
||||
@@ -11,6 +11,7 @@ The Ruby Interface to Vim *ruby* *Ruby*
|
||||
3. VIM::Buffer objects |ruby-buffer|
|
||||
4. VIM::Window objects |ruby-window|
|
||||
5. Global variables |ruby-globals|
|
||||
6. Dynamic loading |ruby-dynamic|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
*E266* *E267* *E268* *E269* *E270* *E271* *E272* *E273*
|
||||
@@ -159,17 +160,36 @@ Methods:
|
||||
buffer Returns the buffer displayed in the window.
|
||||
height Returns the height of the window.
|
||||
height = {n} Sets the window height to {n}.
|
||||
width Returns the width of the window.
|
||||
width = {n} Sets the window width to {n}.
|
||||
cursor Returns a [row, col] array for the cursor position.
|
||||
cursor = [{row}, {col}]
|
||||
Sets the cursor position to {row} and {col}.
|
||||
|
||||
==============================================================================
|
||||
4. Global variables *ruby-globals*
|
||||
5. Global variables *ruby-globals*
|
||||
|
||||
There are two global variables.
|
||||
|
||||
$curwin The current window object.
|
||||
$curbuf The current buffer object.
|
||||
|
||||
==============================================================================
|
||||
6. Dynamic loading *ruby-dynamic*
|
||||
|
||||
On MS-Windows the Ruby library can be loaded dynamically. The |:version|
|
||||
output then includes |+ruby/dyn|.
|
||||
|
||||
This means that Vim will search for the Ruby DLL file only when needed. When
|
||||
you don't use the Ruby interface you don't need it, thus you can use Vim
|
||||
without this DLL file.
|
||||
|
||||
To use the Ruby interface the Ruby DLL must be in your search path. In a
|
||||
console window type "path" to see what directories are used.
|
||||
|
||||
The name of the DLL must match the Ruby version Vim was compiled with.
|
||||
Currently the name is "ruby18.dll". That is for Ruby 1.8. To know for sure
|
||||
edit "gvim.exe" and search for "ruby\d*.dll\c".
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_tcl.txt* For Vim version 7.0aa. Last change: 2005 Mar 29
|
||||
*if_tcl.txt* For Vim version 7.0aa. Last change: 2005 Oct 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Ingo Wilken
|
||||
@@ -14,6 +14,7 @@ The Tcl Interface to Vim *tcl* *Tcl* *TCL*
|
||||
6. Miscellaneous; Output from Tcl |tcl-misc| |tcl-output|
|
||||
7. Known bugs & problems |tcl-bugs|
|
||||
8. Examples |tcl-examples|
|
||||
9. Dynamic loading |tcl-dynamic|
|
||||
|
||||
{Vi does not have any of these commands} *E280* *E281*
|
||||
|
||||
@@ -508,5 +509,22 @@ startup file (usually "~/.vimrc" on Unix):
|
||||
tclfile ~/.vimrc.tcl
|
||||
endif
|
||||
|
||||
==============================================================================
|
||||
9. Dynamic loading *tcl-dynamic*
|
||||
|
||||
On MS-Windows the Tcl library can be loaded dynamically. The |:version|
|
||||
output then includes |+tcl/dyn|.
|
||||
|
||||
This means that Vim will search for the Tcl DLL file only when needed. When
|
||||
you don't use the Tcl interface you don't need it, thus you can use Vim
|
||||
without this DLL file.
|
||||
|
||||
To use the Tcl interface the Tcl DLL must be in your search path. In a
|
||||
console window type "path" to see what directories are used.
|
||||
|
||||
The name of the DLL must match the Tcl version Vim was compiled with.
|
||||
Currently the name is "tcl83.dll". That is for Tcl 8.3. To know for sure
|
||||
edit "gvim.exe" and search for "tcl\d*.dll\c".
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*indent.txt* For Vim version 7.0aa. Last change: 2005 Mar 29
|
||||
*indent.txt* For Vim version 7.0aa. Last change: 2005 Aug 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -449,7 +449,7 @@ $VIMRUNTIME/indent directory for examples.
|
||||
REMARKS ABOUT SPECIFIC INDENT FILES ~
|
||||
|
||||
|
||||
FORTRAN *fortran-indent*
|
||||
FORTRAN *ft-fortran-indent*
|
||||
|
||||
Block if, select case, and where constructs are indented. Comments, labelled
|
||||
statements and continuation lines are indented if the Fortran is in free
|
||||
@@ -457,7 +457,7 @@ source form, whereas they are not indented if the Fortran is in fixed source
|
||||
form because of the left margin requirements. Hence manual indent corrections
|
||||
will be necessary for labelled statements and continuation lines when fixed
|
||||
source form is being used. For further discussion of the method used for the
|
||||
detection of source format see |fortran-syntax|.
|
||||
detection of source format see |ft-fortran-syntax|.
|
||||
|
||||
Do loops ~
|
||||
All do loops are left unindented by default. Do loops can be unstructured in
|
||||
@@ -485,7 +485,7 @@ to get do loops indented in .f90 files and left alone in Fortran files with
|
||||
other extensions such as .for.
|
||||
|
||||
|
||||
PYTHON *python-indent*
|
||||
PYTHON *ft-python-indent*
|
||||
|
||||
The amount of indent can be set for the following situations. The examples
|
||||
given are de the defaults. Note that the variables are set to an expression,
|
||||
@@ -499,7 +499,7 @@ Indent for a continuation line: >
|
||||
let g:pyindent_continue = '&sw * 2'
|
||||
|
||||
|
||||
VERILOG *verilog-indent*
|
||||
VERILOG *ft-verilog-indent*
|
||||
|
||||
General block statements such as if, for, case, always, initial, function,
|
||||
specify and begin, etc., are indented. The module block statements (first
|
||||
@@ -534,7 +534,7 @@ In addition, you can turn the verbose mode for debug issue: >
|
||||
Make sure to do ":set cmdheight=2" first to allow the display of the message.
|
||||
|
||||
|
||||
VIM *vim-indent*
|
||||
VIM *ft-vim-indent*
|
||||
|
||||
For indenting Vim scripts there is one variable that specifies the amount of
|
||||
indent for a continuation line, a line that starts with a backslash: >
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 7.0aa. Last change: 2005 May 22
|
||||
*index.txt* For Vim version 7.0aa. Last change: 2006 Jan 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -150,12 +150,15 @@ commands in CTRL-X submode *i_CTRL-X_index*
|
||||
|i_CTRL-X_CTRL-K| CTRL-X CTRL-K complete identifiers from dictionary
|
||||
|i_CTRL-X_CTRL-L| CTRL-X CTRL-L complete whole lines
|
||||
|i_CTRL-X_CTRL-N| CTRL-X CTRL-N next completion
|
||||
|i_CTRL-X_CTRL-O| CTRL-X CTRL-O omni completion
|
||||
|i_CTRL-X_CTRL-P| CTRL-X CTRL-P previous completion
|
||||
|i_CTRL-X_CTRL-S| CTRL-X CTRL-S spelling suggestions
|
||||
|i_CTRL-X_CTRL-T| CTRL-X CTRL-T complete identifiers from thesaurus
|
||||
|i_CTRL-X_CTRL-Y| CTRL-X CTRL-Y scroll down
|
||||
|i_CTRL-X_CTRL-U| CTRL-X CTRL-U complete with 'completefunc'
|
||||
|i_CTRL-X_CTRL-V| CTRL-X CTRL-V complete like in : command line
|
||||
|i_CTRL-X_CTRL-]| CTRL-X CTRL-] complete tags
|
||||
|i_CTRL-X_s| CTRL-X s spelling suggestions
|
||||
{not available when compiled without the +insert_expand feature}
|
||||
|
||||
==============================================================================
|
||||
@@ -340,9 +343,9 @@ tag char note action in Normal mode ~
|
||||
"yy"
|
||||
|ZZ| ZZ store current file if modified, and exit
|
||||
|ZQ| ZQ exit current file always
|
||||
|[| [{char} square bracket command (see below)
|
||||
|[| [{char} square bracket command (see |[| below)
|
||||
\ not used
|
||||
|]| ]{char} square bracket command (see below)
|
||||
|]| ]{char} square bracket command (see |]| below)
|
||||
|^| ^ 1 cursor to the first CHAR of the line
|
||||
|_| _ 1 cursor to the first CHAR N - 1 lines lower
|
||||
|`| `{a-zA-Z0-9} 1 cursor to the mark {a-zA-Z0-9}
|
||||
@@ -370,7 +373,7 @@ tag char note action in Normal mode ~
|
||||
|e| e 1 cursor forward to the end of word N
|
||||
|f| f{char} 1 cursor to Nth occurrence of {char} to the
|
||||
right
|
||||
|g| g{char} extended commands, see below
|
||||
|g| g{char} extended commands, see |g| below
|
||||
|h| h 1 cursor N chars to the left
|
||||
|i| i 2 insert text before the cursor N times
|
||||
|j| j 1 cursor N lines downward
|
||||
@@ -400,7 +403,7 @@ tag char note action in Normal mode ~
|
||||
cursor [into buffer x]
|
||||
|y| ["x]y{motion} yank Nmove text [into buffer x]
|
||||
|yy| ["x]yy yank N lines [into buffer x]
|
||||
|z| z{char} commands starting with 'z', see below
|
||||
|z| z{char} commands starting with 'z', see |z| below
|
||||
|{| { 1 cursor N paragraphs backward
|
||||
|bar| | 1 cursor to column N
|
||||
|}| } 1 cursor N paragraphs forward
|
||||
@@ -684,6 +687,7 @@ tag char note action in Normal mode ~
|
||||
of the current screen line
|
||||
|g8| g8 print hex value of bytes used in UTF-8
|
||||
character under the cursor
|
||||
|g<| g< display previous command output
|
||||
|g?| g? 2 Rot13 encoding operator
|
||||
|g?g?| g?? 2 Rot13 encode current line
|
||||
|g?g?| g?g? 2 Rot13 encode current line
|
||||
@@ -732,6 +736,7 @@ tag char note action in Normal mode ~
|
||||
|gu| gu{motion} 2 make Nmove text lowercase
|
||||
|gv| gv reselect the previous Visual area
|
||||
|gw| gw{motion} 2 format Nmove text and keep cursor
|
||||
|g@| g@{motion} call 'operatorfunc'
|
||||
|g~| g~{motion} 2 swap case for Nmove text
|
||||
|g<Down>| g<Down> 1 same as "gj"
|
||||
|g<End>| g<End> 1 same as "g$"
|
||||
@@ -755,16 +760,19 @@ tag char note action in Normal mode ~
|
||||
cursor on first non-blank
|
||||
|z.| z. redraw, cursor line to center of window,
|
||||
cursor on first non-blank
|
||||
|z=| z= give spelling suggestions
|
||||
|zA| zA open a closed fold or close an open fold
|
||||
recursively
|
||||
|zC| zC close folds recursively
|
||||
|zD| zD delete folds recursively
|
||||
|zE| zE eliminate all folds
|
||||
|zF| zF create a fold for N lines
|
||||
|zG| zG mark word as good spelled word
|
||||
|zM| zM set 'foldlevel' to zero
|
||||
|zN| zN set 'foldenable'
|
||||
|zO| zO open folds recursively
|
||||
|zR| zR set 'foldlevel' to the deepest fold
|
||||
|zW| zW mark word as wrong (bad) spelled word
|
||||
|zX| zX re-apply 'foldlevel'
|
||||
|z^| z^ cursor on line N (default line above
|
||||
window), otherwise like "z-"
|
||||
@@ -776,6 +784,7 @@ tag char note action in Normal mode ~
|
||||
position the cursor at the end (right side)
|
||||
of the screen
|
||||
|zf| zf{motion} create a fold for Nmove text
|
||||
|zg| zg mark word as good spelled word
|
||||
|zh| zh when 'wrap' off scroll screen N characters
|
||||
to the right
|
||||
|zi| zi toggle 'foldenable'
|
||||
@@ -792,6 +801,7 @@ tag char note action in Normal mode ~
|
||||
side) of the screen
|
||||
|zt| zt redraw, cursor line at top of window
|
||||
|zv| zv open enough folds to view the cursor line
|
||||
|zw| zw mark word as wrong (bad) spelled word
|
||||
|zx| zx re-apply 'foldlevel' and do "zv"
|
||||
|zz| zz redraw, cursor line at center of window
|
||||
|z<Left>| z<Left> same as "zh"
|
||||
@@ -1059,6 +1069,8 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:cNfile| :cNf[ile] go to last error in previous file
|
||||
|:cabbrev| :ca[bbrev] like ":abbreviate" but for Command-line mode
|
||||
|:cabclear| :cabc[lear] clear all abbreviations for Command-line mode
|
||||
|:caddexpr| :cad[dexpr] add errors from expr
|
||||
|:caddfile| :caddf[ile] add error message to current quickfix list
|
||||
|:call| :cal[l] call a function
|
||||
|:catch| :cat[ch] part of a :try command
|
||||
|:cbuffer| :cb[uffer] parse error messages and jump to first error
|
||||
@@ -1066,6 +1078,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:cclose| :ccl[ose] close quickfix window
|
||||
|:cd| :cd change directory
|
||||
|:center| :ce[nter] format lines at the center
|
||||
|:cexpr| :cex[pr] read errors from expr and jump to first
|
||||
|:cfile| :cf[ile] read file with error messages and jump to first
|
||||
|:cfirst| :cfir[st] go to the specified error, default first one
|
||||
|:cgetfile| :cg[etfile] read file with error messages
|
||||
@@ -1137,6 +1150,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:elseif| :elsei[f] part of an :if command
|
||||
|:emenu| :em[enu] execute a menu by name
|
||||
|:endif| :en[dif] end previous :if
|
||||
|:endfor| :endfo[r] end previous :for
|
||||
|:endfunction| :endf[unction] end of a user function
|
||||
|:endtry| :endt[ry] end previous :try
|
||||
|:endwhile| :endw[hile] end previous :while
|
||||
@@ -1158,11 +1172,12 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:folddoopen| :foldd[oopen] execute command on lines not in a closed fold
|
||||
|:folddoclosed| :folddoc[losed] execute command on lines in a closed fold
|
||||
|:foldopen| :foldo[pen] open folds
|
||||
|:for| :for for loop
|
||||
|:function| :fu[nction] define a user function
|
||||
|:global| :g[lobal] execute commands for matching lines
|
||||
|:goto| :go[to] go to byte in the buffer
|
||||
|:grep| :gr[ep] run 'grepprg' and jump to first match
|
||||
|:grepadd| :grepa[dd] like grep, but append to current list
|
||||
|:grepadd| :grepa[dd] like :grep, but append to current list
|
||||
|:gui| :gu[i] start the GUI
|
||||
|:gvim| :gv[im] start the GUI
|
||||
|:hardcopy| :ha[rdcopy] send text to the printer
|
||||
@@ -1195,25 +1210,48 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:join| :j[oin] join lines
|
||||
|:jumps| :ju[mps] print the jump list
|
||||
|:k| :k set a mark
|
||||
|:keepalt| :keepa[lt] following command keeps the alternate file
|
||||
|:keepmarks| :kee[pmarks] following command keeps marks where they are
|
||||
|:keepjumps| :keepj[jumps] following command keeps jumplist and marks
|
||||
|:lNext| :lN[ext] go to previous entry in location list
|
||||
|:lNfile| :lNf[ile] go to last entry in previous file
|
||||
|:list| :l[ist] print lines
|
||||
|:laddexpr| :lad[dexpr] add locations from expr
|
||||
|:laddfile| :laddf[ile] add locations to current location list
|
||||
|:last| :la[st] go to the last file in the argument list
|
||||
|:language| :lan[guage] set the language (locale)
|
||||
|:lbuffer| :lb[uffer] parse locations and jump to first location
|
||||
|:lcd| :lc[d] change directory locally
|
||||
|:lchdir| :lch[dir] change directory locally
|
||||
|:lclose| :lcl[ose] close location window
|
||||
|:left| :le[ft] left align lines
|
||||
|:leftabove| :lefta[bove] make split window appear left or above
|
||||
|:let| :let assign a value to a variable or option
|
||||
|:lexpr| :lex[pr] read locations from expr and jump to first
|
||||
|:lfile| :lf[ile] read file with locations and jump to first
|
||||
|:lfirst| :lfir[st] go to the specified location, default first one
|
||||
|:lgetfile| :lg[etfile] read file with locations
|
||||
|:ll| :ll go to specific location
|
||||
|:llast| :lla[st] go to the specified location, default last one
|
||||
|:llist| :lli[st] list all locations
|
||||
|:lmap| :lm[ap] like ":map!" but includes Lang-Arg mode
|
||||
|:lmapclear| :lmapc[lear] like ":mapclear!" but includes Lang-Arg mode
|
||||
|:lnext| :ln[ext] go to next location
|
||||
|:lnewer| :lnew[er] go to newer location list
|
||||
|:lnfile| :lnf[ile] go to first location in next file
|
||||
|:lnoremap| :ln[oremap] like ":noremap!" but includes Lang-Arg mode
|
||||
|:loadkeymap| :loadk[eymap] load the following keymaps until EOF
|
||||
|:loadview| :lo[adview] load view for current window from a file
|
||||
|:lockmarks| :loc[kmarks] following command keeps marks where they are
|
||||
|:lockvar| :lockv[ar] lock variables
|
||||
|:lolder| :lol[der] go to older location list
|
||||
|:lopen| :lope[n] open location window
|
||||
|:lprevious| :lp[revious] go to previous location
|
||||
|:lpfile| :lpf[ile] go to last location in previous file
|
||||
|:lrewind| :lr[ewind] go to the specified location, default first one
|
||||
|:ls| :ls list all buffers
|
||||
|:lunmap| :lu[nmap] like ":unmap!" but includes Lang-Arg mode
|
||||
|:lwindow| :lw[indow] open or close location window
|
||||
|:move| :m[ove] move lines
|
||||
|:mark| :ma[rk] set a mark
|
||||
|:make| :mak[e] execute external command 'makeprg' and parse
|
||||
@@ -1227,11 +1265,13 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:messages| :mes[sages] view previously displayed messages
|
||||
|:mkexrc| :mk[exrc] write current mappings and settings to a file
|
||||
|:mksession| :mks[ession] write session info to a file
|
||||
|:mkspell| :mksp[ell] produce .spl spell file
|
||||
|:mkvimrc| :mkv[imrc] write current mappings and settings to a file
|
||||
|:mkview| :mkvie[w] write view of current window to a file
|
||||
|:mode| :mod[e] show or change the screen mode
|
||||
|:mzscheme| :mz[scheme] execute MzScheme command
|
||||
|:mzfile| :mzf[ile] execute MzScheme script file
|
||||
|:nbkey| :nb[key] pass a key to Netbeans
|
||||
|:next| :n[ext] go to next file in the argument list
|
||||
|:new| :new create a new empty window
|
||||
|:nmap| :nm[ap] like ":map" but for Normal mode
|
||||
@@ -1239,6 +1279,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:nmenu| :nme[nu] add menu for Normal mode
|
||||
|:nnoremap| :nn[oremap] like ":noremap" but for Normal mode
|
||||
|:nnoremenu| :nnoreme[nu] like ":noremenu" but for Normal mode
|
||||
|:noautocmd| :noa[utocmd] following command don't trigger autocommands
|
||||
|:noremap| :no[remap] enter a mapping that will not be remapped
|
||||
|:nohlsearch| :noh[lsearch] suspend 'hlsearch' highlighting
|
||||
|:noreabbrev| :norea[bbrev] enter an abbreviation that will not be
|
||||
@@ -1262,6 +1303,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:pedit| :ped[it] edit file in the preview window
|
||||
|:perl| :pe[rl] execute Perl command
|
||||
|:print| :p[rint] print lines
|
||||
|:profdel| :profd[el] stop profiling a function or script
|
||||
|:profile| :prof[ile] profiling functions and scripts
|
||||
|:promptfind| :pro[mtfind] open GUI dialog for searching
|
||||
|:promptrepl| :promtr[epl] open GUI dialog for search/replace
|
||||
@@ -1311,6 +1353,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:substitute| :s[ubstitute] find and replace text
|
||||
|:sNext| :sN[ext] split window and go to previous file in
|
||||
argument list
|
||||
|:sandbox| :san[dbox] execute a command in the sandbox
|
||||
|:sargument| :sa[rgument] split window and go to specific file in
|
||||
argument list
|
||||
|:sall| :sal[l] open a window for each file in argument list
|
||||
@@ -1334,7 +1377,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
buffer list
|
||||
|:scriptnames| :scrip[tnames] list names of all sourced Vim scripts
|
||||
|:scriptencoding| :scripte[ncoding] encoding used in sourced Vim script
|
||||
|:scscope| :scs[cope] split window and execute cscope command
|
||||
|:scscope| :scs[cope] split window and execute cscope command
|
||||
|:set| :se[t] show or set options
|
||||
|:setfiletype| :setf[iletype] set 'filetype', unless it was set already
|
||||
|:setglobal| :setg[lobal] show global values of options
|
||||
@@ -1356,6 +1399,10 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:snomagic| :sno[magic] :substitute with 'nomagic'
|
||||
|:sort| :sor[t] sort lines
|
||||
|:source| :so[urce] read Vim or Ex commands from a file
|
||||
|:spelldump| :spelld[ump] split window and fill with all correct words
|
||||
|:spellgood| :spe[llgood] add good word for spelling
|
||||
|:spellrepall| :spellr[epall] replace all bad words like last |z=|
|
||||
|:spellwrong| :spellw[rong] add spelling mistake
|
||||
|:split| :sp[lit] split current window
|
||||
|:sprevious| :spr[evious] split window and go to previous file in the
|
||||
argument list
|
||||
@@ -1364,6 +1411,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:stop| :st[op] suspend the editor or escape to a shell
|
||||
|:stag| :sta[g] split window and jump to a tag
|
||||
|:startinsert| :star[tinsert] start Insert mode
|
||||
|:startgreplace| :startg[replace] start Virtual Replace mode
|
||||
|:startreplace| :startr[eplace] start Replace mode
|
||||
|:stopinsert|| :stopi[nsert] stop Insert mode
|
||||
|:stjump| :stj[ump] do ":tjump" and split window
|
||||
@@ -1408,6 +1456,8 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:version| :ve[rsion] print version number and other info
|
||||
|:verbose| :verb[ose] execute command with 'verbose' set
|
||||
|:vertical| :vert[ical] make following command split vertically
|
||||
|:vimgrep| :vim[grep] search for pattern in files
|
||||
|:vimgrepadd| :vimgrepa[dd] like :vimgrep, but append to current list
|
||||
|:visual| :vi[sual] same as ":edit", but turns off "Ex" mode
|
||||
|:viusage| :viu[sage] overview of Normal mode commands
|
||||
|:view| :vie[w] edit a file read-only
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 7.0aa. Last change: 2005 Apr 08
|
||||
*insert.txt* For Vim version 7.0aa. Last change: 2006 Jan 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -354,6 +354,8 @@ CTRL-G CTRL-J cursor one line down, insert start column *i_CTRL-G_CTRL-J*
|
||||
<MouseUp> scroll three lines up *i_<MouseUp>*
|
||||
<S-MouseUp> scroll a full page up *i_<S-MouseUp>*
|
||||
CTRL-O execute one command, return to Insert mode *i_CTRL-O*
|
||||
CTRL-\ CTRL-O like CTRL-O but don't move the cursor *i_CTRL-\_CTRL-O*
|
||||
CTRL-L when 'insertmode' is set: go to Normal mode *i_CTRL-L*
|
||||
CTRL-G u break undo sequence, start new change *i_CTRL-G_u*
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
@@ -363,7 +365,8 @@ option.
|
||||
The CTRL-O command sometimes has a side effect: If the cursor was beyond the
|
||||
end of the line, it will be put on the last character in the line. In
|
||||
mappings it's often better to use <Esc> (first put an "x" in the text, <Esc>
|
||||
will then always put the cursor on it).
|
||||
will then always put the cursor on it). Or use CTRL-\ CTRL-O, but then
|
||||
beware of the cursor possibly being beyond the end of the line.
|
||||
|
||||
The shifted cursor keys are not available on all terminals.
|
||||
|
||||
@@ -547,7 +550,7 @@ entering new data while keeping all the columns aligned.
|
||||
==============================================================================
|
||||
7. Insert mode completion *ins-completion*
|
||||
|
||||
In Insert and Replace modes, there are several commands to complete part of a
|
||||
In Insert and Replace mode, there are several commands to complete part of a
|
||||
keyword or line that has been typed. This is useful if you are using
|
||||
complicated keywords (e.g., function names with capitals and underscores).
|
||||
|
||||
@@ -565,7 +568,10 @@ Completion can be done for:
|
||||
7. file names |i_CTRL-X_CTRL-F|
|
||||
8. definitions or macros |i_CTRL-X_CTRL-D|
|
||||
9. Vim command-line |i_CTRL-X_CTRL-V|
|
||||
10. keywords in 'complete' |i_CTRL-N|
|
||||
10. User defined completion |i_CTRL-X_CTRL-U|
|
||||
11. omni completion |i_CTRL-X_CTRL-O|
|
||||
12. Spelling suggestions |i_CTRL-X_s|
|
||||
13. keywords in 'complete' |i_CTRL-N|
|
||||
|
||||
All these (except 2) are done in CTRL-X mode. This is a sub-mode of Insert
|
||||
and Replace modes. You enter CTRL-X mode by typing CTRL-X and one of the
|
||||
@@ -612,12 +618,12 @@ Completing whole lines *compl-whole-line*
|
||||
|
||||
*i_CTRL-X_CTRL-L*
|
||||
CTRL-X CTRL-L Search backwards for a line that starts with the
|
||||
same characters as in the current line before the
|
||||
cursor. Indent is ignored. The found line is
|
||||
same characters as those in the current line before
|
||||
the cursor. Indent is ignored. The matching line is
|
||||
inserted in front of the cursor.
|
||||
The 'complete' option is used to decide in which
|
||||
buffers a match is searched for. But only loaded
|
||||
buffers are used.
|
||||
The 'complete' option is used to decide which buffers
|
||||
are searched for a match. Only loaded buffers are
|
||||
used.
|
||||
CTRL-L or
|
||||
CTRL-P Search backwards for next matching line. This line
|
||||
replaces the previous matching line.
|
||||
@@ -668,6 +674,9 @@ at least two characters is matched.
|
||||
just type:
|
||||
printf("(%g, %g, %g)", vector[0], ^P[1], ^P[2]);
|
||||
|
||||
The search wraps around the end of the file, the value of 'wrapscan' is not
|
||||
used here.
|
||||
|
||||
Multiple repeats of the same completion are skipped; thus a different match
|
||||
will be inserted at each CTRL-N and CTRL-P (unless there is only one
|
||||
matching keyword).
|
||||
@@ -839,7 +848,8 @@ CTRL-X CTRL-D Search in the current and included files for the
|
||||
Completing Vim commands *compl-vim*
|
||||
|
||||
Completion is context-sensitive. It works like on the Command-line. It
|
||||
completes an Ex command as well as its arguments.
|
||||
completes an Ex command as well as its arguments. This is useful when writing
|
||||
a Vim script.
|
||||
|
||||
*i_CTRL-X_CTRL-V*
|
||||
CTRL-X CTRL-V Guess what kind of item is in front of the cursor and
|
||||
@@ -858,11 +868,11 @@ CTRL-X CTRL-V Guess what kind of item is in front of the cursor and
|
||||
completion, for example: >
|
||||
:imap <Tab> <C-X><C-V>
|
||||
|
||||
User defined completing *compl-function*
|
||||
User defined completion *compl-function*
|
||||
|
||||
Completion is done by a function that can be defined by the user with the
|
||||
'completefunc' option. See the option for how the function is called and an
|
||||
example.
|
||||
'completefunc' option. See the 'completefunc' help for how the function
|
||||
is called and an example.
|
||||
|
||||
*i_CTRL-X_CTRL-U*
|
||||
CTRL-X CTRL-U Guess what kind of item is in front of the cursor and
|
||||
@@ -875,6 +885,47 @@ CTRL-X CTRL-U Guess what kind of item is in front of the cursor and
|
||||
previous one.
|
||||
|
||||
|
||||
Omni completion *compl-omni*
|
||||
|
||||
Completion is done by a function that can be defined by the user with the
|
||||
'omnifunc' option. This is to be used for filetype-specific completion.
|
||||
|
||||
See the 'completefunc' help for how the function is called and an example.
|
||||
For remarks about specific filetypes see |compl-omni-filetypes|.
|
||||
|
||||
*i_CTRL-X_CTRL-O*
|
||||
CTRL-X CTRL-O Guess what kind of item is in front of the cursor and
|
||||
find the first match for it.
|
||||
CTRL-O or
|
||||
CTRL-N Use the next match. This match replaces the previous
|
||||
one.
|
||||
|
||||
CTRL-P Use the previous match. This match replaces the
|
||||
previous one.
|
||||
|
||||
|
||||
Spelling suggestions *compl-spelling*
|
||||
|
||||
A word before or at the cursor is located and correctly spelled words are
|
||||
suggested to replace it. If there is a badly spelled word in the line, before
|
||||
or under the cursor, the cursor is moved to after it. Otherwise the word just
|
||||
before the cursor is used for suggestions, even though it isn't badly spelled.
|
||||
|
||||
NOTE: CTRL-S suspends display in many Unix terminals. Use 's' instead. Type
|
||||
CTRL-Q to resume displaying.
|
||||
|
||||
*i_CTRL-X_CTRL-S* *i_CTRL-X_s*
|
||||
CTRL-X CTRL-S or
|
||||
CTRL-X s Locate the word in front of the cursor and find the
|
||||
first spell suggestion for it.
|
||||
CTRL-S or
|
||||
CTRL-N Use the next suggestion. This replaces the previous
|
||||
one. Note that you can't use 's' here.
|
||||
|
||||
CTRL-P Use the previous suggestion. This replaces the
|
||||
previous one.
|
||||
|
||||
|
||||
Completing keywords from different sources *compl-generic*
|
||||
|
||||
*i_CTRL-N*
|
||||
@@ -900,6 +951,223 @@ CTRL-P Find previous match for words that start with the
|
||||
copy the words following the previous expansion in
|
||||
other contexts unless a double CTRL-X is used.
|
||||
|
||||
|
||||
INSERT COMPLETION POPUP MENU *ins-completion-menu*
|
||||
*popupmenu-completion*
|
||||
Vim can display the matches in a simplistic popup menu.
|
||||
|
||||
The menu is used when:
|
||||
- The 'completeopt' option contains "menu".
|
||||
- The terminal supports at least 8 colors.
|
||||
- There are at least two matches.
|
||||
|
||||
While the menu is displayed these keys have a special meaning:
|
||||
<CR> and <Enter>: Accept the currently selected match
|
||||
<Up>: Select the previous match, as if CTRL-P was used
|
||||
<Down>: Select the next match, as if CTRL-N was used
|
||||
<PageUp>: Select a match several entries back
|
||||
<PageDown>: Select a match several entries further
|
||||
|
||||
The colors of the menu can be changed with these highlight groups:
|
||||
Pmenu normal item |hl-Pmenu|
|
||||
PmenuSel selected item |hl-PmenuSel|
|
||||
PmenuSbar scrollbar |hl-PmenuSbar|
|
||||
PmenuThumb thumb of the scrollbar |hl-PmenuThumb|
|
||||
|
||||
|
||||
Filetype-specific remarks for omni completion *compl-omni-filetypes*
|
||||
|
||||
|
||||
C *ft-c-omni*
|
||||
|
||||
Completion of C code requires a tags file. You should use Exuberant ctags,
|
||||
because it adds extra information that is needed for completion. You can find
|
||||
it here: http://ctags.sourceforge.net/
|
||||
For version 5.5.4 you should add a patch that adds the "typename:" field:
|
||||
ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
|
||||
|
||||
If you want to complete system functions you can do something like this. Use
|
||||
ctags to generate a tags file for all the system header files: >
|
||||
% ctags -R -f ~/.vim/systags /usr/include /usr/local/include
|
||||
In your vimrc file add this tags file to the 'tags' option: >
|
||||
set tags+=~/.vim/systags
|
||||
|
||||
When using CTRL-X CTRL-O after a name without any "." or "->" it is completed
|
||||
from the tags file directly. This works for any identifier, also function
|
||||
names. If you want to complete a local variable name, which does not appear
|
||||
in the tags file, use CTRL-P instead.
|
||||
|
||||
When using CTRL-X CTRL-O after something that has "." or "->" Vim will attempt
|
||||
to recognize the type of the variable and figure out what members it has.
|
||||
This means only members valid for the variable will be listed.
|
||||
|
||||
When a member name already was complete, CTRL-X CTRL-O will add a "." or
|
||||
"->" for composite types.
|
||||
|
||||
Vim doesn't include a C compiler, only the most obviously formatted
|
||||
declarations are recognized. Preprocessor stuff may cause confusion.
|
||||
When the same structure name appears in multiple places all possible members
|
||||
are included.
|
||||
|
||||
|
||||
CSS *ft-css-omni*
|
||||
|
||||
Complete properties and their appropriate values according to CSS 2.1
|
||||
specification.
|
||||
|
||||
|
||||
(X)HTML *ft-html-omni*
|
||||
*ft-xhtml-omni*
|
||||
|
||||
CTRL-X CTRL-O provides completion of various elements of (X)HTML files.
|
||||
It is designed to support writing of XHTML 1.0 Strict files but will
|
||||
also works for other versions of HTML. Features:
|
||||
|
||||
- after "<" complete tag name depending on context (no div suggest
|
||||
inside of an a tag)
|
||||
- inside of tag complete proper attributes (no width attribute for an
|
||||
a tag)
|
||||
- when attribute has limited number of possible values help to complete
|
||||
them
|
||||
- complete names of entities
|
||||
- complete values of "class" and "id" attributes with data obtained from
|
||||
style tag and included CSS files
|
||||
- when completing "style" attribute or working inside of "style" tag
|
||||
switch to |ft-css-omni| completion
|
||||
- when used after "</" CTRL-X CTRL-O will close the last opened tag
|
||||
|
||||
Note: When used first time completion menu will be shown with little delay
|
||||
- this is time needed for loading of data file.
|
||||
|
||||
|
||||
SYNTAX *ft-syntax-omni*
|
||||
|
||||
This uses the current syntax highlighting for completion. It can be used for
|
||||
any filetype and provides a minimal language-sensitive completion.
|
||||
|
||||
To enable code completion do: >
|
||||
source $VIMRUNTIME/autoload/syntaxcomplete.vim
|
||||
|
||||
You can automate this by placing this in your vimrc (after any ":filetype"
|
||||
command): >
|
||||
autocmd Filetype *
|
||||
\ if exists('&ofu') && &ofu == "" |
|
||||
\ source $VIMRUNTIME/autoload/syntaxcomplete.vim |
|
||||
\ endif
|
||||
|
||||
The above will set completion to this script only if a proper one does not
|
||||
already exist for that filetype.
|
||||
|
||||
|
||||
XML *ft-xml-omni*
|
||||
|
||||
Vim 7 provides mechanism to context aware completion of XML files. It depends
|
||||
on special |xml-omni-datafile| and two commands: |:XMLns| and |:XMLent|.
|
||||
Features are:
|
||||
|
||||
- after "<" complete tag name depending on context (no div suggest
|
||||
inside of an a tag)
|
||||
- inside of tag complete proper attributes (no width attribute for an
|
||||
a tag)
|
||||
- when attribute has limited number of possible values help to complete
|
||||
them
|
||||
- complete names of entities (defined in |xml-omni-datafile| and in current file
|
||||
with "<!ENTITY" declarations
|
||||
- when used after "</" CTRL-X CTRL-O will close the last opened tag
|
||||
|
||||
Format of XML data file *xml-omni-datafile*
|
||||
|
||||
Vim distribution provides two data files as examples (xhtml10s.vim, xsl.vim)
|
||||
|
||||
XML data files are stored in "autoload/xml" directory in 'runtimepath'. They
|
||||
have meaningful name which will be used in commands. It should be unique name
|
||||
which will not create conflicts in future. For example name xhtml10s.vim means
|
||||
it is data file for XHTML 1.0 Strict.
|
||||
|
||||
File contains one variable with fixed name: g:xmldata_xhtml10s . It is
|
||||
compound from two parts:
|
||||
|
||||
1. "g:xmldata_" general prefix
|
||||
2. "xhtml10s" name of file and name of described XML dialect
|
||||
|
||||
Part two must be exactly the same as name of file.
|
||||
|
||||
Variable is data structure in form of |Dictionary|. Keys are tag names and
|
||||
values are two element |List|. First element of List is also List with
|
||||
names of possible children, second element is |Dictionary| with names of
|
||||
attributes as keys and possible values of attributes as values. Example: >
|
||||
|
||||
let g:xmldata_crippledhtml = {
|
||||
\ "html":
|
||||
\ [ ["body", "head"], {"id": [], "xmlns": ["http://www.w3.org/1999/xhtml"],
|
||||
\ "lang": [], "xml:lang": [], "dir": ["ltr", "rtl"]}],
|
||||
\ "script":
|
||||
\ [ [], {"id": [], "charset": [], "type": ["text/javascript"], "src": [],
|
||||
\ "defer": ["BOOL"], "xml:space": ["preserve"]}],
|
||||
\ "meta":
|
||||
\ [ [], {"id": [], "http-equiv": [], "name": [], "content": [], "scheme":
|
||||
\ [], "lang": [], "xml:lang": [], "dir": ["ltr", "rtl"]}]
|
||||
\ "vimxmlentities": ["amp", "lt", "gt", "apos", "quot"]}
|
||||
|
||||
This example should be put in "autoload/xml/crippledhtml.vim" file.
|
||||
|
||||
In example are visible two special elements:
|
||||
|
||||
1. "vimxmlentities" - special key with List containing entities of this XML
|
||||
dialect.
|
||||
2. "BOOL" - value of attribute key showing if attribute should be inserted
|
||||
bare ("defer" vs. 'defer="'). It can be the only element of List of
|
||||
attribute values.
|
||||
|
||||
Note: Tag names in data file MUST not contain namespace description. Check
|
||||
xsl.vim for example.
|
||||
|
||||
Commands
|
||||
|
||||
:XMLns {name} [{namespace}] *:XMLns*
|
||||
|
||||
Vim has to know which data file should be used and with which namespace. For
|
||||
loading of data file and connecting data with prope namespace use |:XMLns|
|
||||
command. First (obligatory) argument is name of data (xhtml10s, xsl). Second
|
||||
argument is code of namespace (h, xsl). When used without second argument
|
||||
dialect will be used as default - without namespace declaration. For example
|
||||
to use XML completion in .xsl files: >
|
||||
|
||||
:XMLns xhtml10s
|
||||
:XMLns xsl xsl
|
||||
|
||||
|
||||
:XMLent {name} *:XMLent*
|
||||
|
||||
By default entities will be completed from data file of default
|
||||
namespace. XMLent command should be used in case when there is no
|
||||
default namespace: >
|
||||
|
||||
:XMLent xhtml10s
|
||||
|
||||
Usage
|
||||
|
||||
While used in situation (after declarations from previous part, | is
|
||||
cursor position): >
|
||||
|
||||
<|
|
||||
|
||||
Will complete to appropriate XHTML tag, and in this situation: >
|
||||
|
||||
<xsl:|
|
||||
|
||||
Will complete to appropriate XSL tag.
|
||||
|
||||
File xmlcomplete.vim provides through |autoload| mechanism
|
||||
GetLastOpenTag function which can be used in XML files to get name of
|
||||
last open tag with (b:unaryTagsStack has to be defined): >
|
||||
|
||||
:echo xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
==============================================================================
|
||||
8. Insert mode commands *inserting*
|
||||
|
||||
@@ -1004,6 +1272,7 @@ NOTE: ":append" and ":insert" don't work properly in between ":if" and
|
||||
Note that when using this command in a function or
|
||||
script, the insertion only starts after the function
|
||||
or script is finished.
|
||||
This command does not work from |:normal|.
|
||||
{not in Vi}
|
||||
{not available when compiled without the +ex_extra
|
||||
feature}
|
||||
@@ -1025,6 +1294,13 @@ NOTE: ":append" and ":insert" don't work properly in between ":if" and
|
||||
the function or script is finished.
|
||||
{not in Vi}
|
||||
{not available when compiled without the +ex_extra
|
||||
feature}
|
||||
|
||||
*:startgreplace*
|
||||
:startg[replace][!] Just like |:startreplace|, but use Virtual Replace
|
||||
mode, like with |gR|.
|
||||
{not in Vi}
|
||||
{not available when compiled without the +ex_extra
|
||||
feature}
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*intro.txt* For Vim version 7.0aa. Last change: 2005 Mar 29
|
||||
*intro.txt* For Vim version 7.0aa. Last change: 2005 Sep 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -151,31 +151,19 @@ example and try to find out which settings or other things influence the
|
||||
appearance of the bug. Try different machines, if possible. Send me patches
|
||||
if you can!
|
||||
|
||||
In case of doubt, use: >
|
||||
It will help to include information about the version of Vim you are using and
|
||||
your setup. You can get the information with this command: >
|
||||
:so $VIMRUNTIME/bugreport.vim
|
||||
This will create a file "bugreport.txt" in the current directory, with a lot
|
||||
of information of your environment. Before sending this out, check if it
|
||||
doesn't contain any confidential information!
|
||||
|
||||
*debug-vim*
|
||||
When Vim crashes in one of the test files, and you are using gcc for
|
||||
compilation, here is what you can do to find out exactly where Vim crashes:
|
||||
If Vim crashes, please try to find out where. You can find help on this here:
|
||||
|debug.txt|.
|
||||
|
||||
1. Compile Vim with the "-g" option (there is a line in the Makefile for this,
|
||||
which you can uncomment).
|
||||
|
||||
2. Execute these commands (replace "11" with the test that fails): >
|
||||
cd testdir
|
||||
gdb ../vim
|
||||
run -u unix.vim -U NONE -s dotest.in test11.in
|
||||
|
||||
3. Check where Vim crashes, gdb should give a message for this.
|
||||
|
||||
4. Get a stack trace from gdb with this command: >
|
||||
where
|
||||
< You can check out different places in the stack trace with: >
|
||||
frame 3
|
||||
< Replace "3" with one of the numbers in the stack trace.
|
||||
In case of doubt or when you wonder if the problem has already been fixed but
|
||||
you can't find a fix for it, become a member of the vim-dev maillist and ask
|
||||
your question there. |maillist|
|
||||
|
||||
*year-2000* *Y2K*
|
||||
Since Vim internally doesn't use dates for editing, there is no year 2000
|
||||
@@ -198,7 +186,7 @@ The user may create scripts for Vim that use external commands. These might
|
||||
introduce Y2K problems, but those are not really part of Vim itself.
|
||||
|
||||
==============================================================================
|
||||
3. Credits *credits* *author*
|
||||
3. Credits *credits* *author* *Bram* *Moolenaar*
|
||||
|
||||
Most of Vim was written by Bram Moolenaar <Bram@vim.org>.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 7.0aa. Last change: 2005 Jun 03
|
||||
*map.txt* For Vim version 7.0aa. Last change: 2006 Jan 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -10,6 +10,17 @@ This subject is introduced in sections |05.3|, |24.7| and |40.1| of the user
|
||||
manual.
|
||||
|
||||
1. Key mapping |key-mapping|
|
||||
1.1 MAP COMMANDS |:map-commands|
|
||||
1.2 Special arguments |:map-arguments|
|
||||
1.3 Mapping and modes |:map-modes|
|
||||
1.4 Listing mappings |map-listing|
|
||||
1.5 Mapping special keys |:map-special-keys|
|
||||
1.6 Special characters |:map-special-chars|
|
||||
1.7 What keys to map |map-which-keys|
|
||||
1.8 Examples |map-examples|
|
||||
1.9 Using mappings |map-typing|
|
||||
1.10 Mapping alt-keys |:map-alt-keys|
|
||||
1.11 Mapping an operator |:map-operator|
|
||||
2. Abbreviations |abbreviations|
|
||||
3. Local mappings and functions |script-local|
|
||||
4. User-defined commands |user-commands|
|
||||
@@ -24,6 +35,9 @@ is to define a sequence commands for a function key. Example: >
|
||||
|
||||
This appends the current date and time after the cursor (in <> notation |<>|).
|
||||
|
||||
|
||||
1.1 MAP COMMANDS *:map-commands*
|
||||
|
||||
There are commands to enter new mappings, remove mappings and list mappings.
|
||||
See |map-overview| for the various forms of "map" and their relationships with
|
||||
modes.
|
||||
@@ -116,6 +130,21 @@ characters. You can use this to put command sequences under function keys,
|
||||
translate one key into another, etc. See |:mkexrc| for how to save and
|
||||
restore the current mappings.
|
||||
|
||||
*map-ambiguous*
|
||||
When two mappings start with the same sequence of characters, they are
|
||||
ambiguous. Example: >
|
||||
:imap aa foo
|
||||
:imap aaa bar
|
||||
When Vim has read "aa", it will need to get another character to be able to
|
||||
decide if "aa" or "aaa" should be mapped. This means that after typing "aa"
|
||||
that mapping won't get expanded yet, Vim is waiting for another character.
|
||||
If you type a space, then "foo" will get inserted, plus the space. If you
|
||||
type "a", then "bar" will get inserted.
|
||||
{Vi does not allow ambiguous mappings}
|
||||
|
||||
|
||||
1.2 SPECIAL ARGUMENTS *:map-arguments*
|
||||
|
||||
*:map-local* *:map-<buffer>* *E224* *E225*
|
||||
If the first argument to one of these commands is "<buffer>" it will apply to
|
||||
mappings locally to the current buffer only. Example: >
|
||||
@@ -162,12 +191,14 @@ already exists which is equal.
|
||||
Example of what will fail: >
|
||||
:map ,w /[#&!]<CR>
|
||||
:map <buffer> <unique> ,w /[.,;]<CR>
|
||||
If you want to map a key and then have it do what it was originally mapped to,
|
||||
have a look at |maparg()|.
|
||||
|
||||
"<buffer>", "<silent>", "<script>" and "<unique>" can be used in any order.
|
||||
They must appear right after the command, before any other arguments.
|
||||
|
||||
|
||||
MAPPING AND MODES
|
||||
1.3 MAPPING AND MODES *:map-modes*
|
||||
|
||||
There are five sets of mappings
|
||||
- For Normal mode: When typing commands.
|
||||
@@ -236,19 +267,9 @@ character as an argument to command like "f" or "t".
|
||||
are only used for typed characters. This assumes that the language mapping
|
||||
was already done when typing the mapping.
|
||||
|
||||
*map-multibyte*
|
||||
It is possible to map multibyte characters, but only the whole character. You
|
||||
cannot map the first byte only. This was done to prevent problems in this
|
||||
scenario: >
|
||||
:set encoding=latin1
|
||||
:imap <M-C> foo
|
||||
:set encoding=utf-8
|
||||
The mapping for <M-C> is defined with the latin1 encoding, resulting in a 0xc3
|
||||
byte. If you type the character <20> (0xea <M-a>) in UTF-8 encoding this is the
|
||||
two bytes 0xc3 0xa1. You don't want the 0xc3 byte to be mapped then,
|
||||
otherwise it would be impossible to type the <20> character.
|
||||
|
||||
*map-listing*
|
||||
1.4 LISTING MAPPINGS *map-listing*
|
||||
|
||||
When listing mappings the characters in the first two columns are:
|
||||
|
||||
CHAR MODE ~
|
||||
@@ -273,6 +294,58 @@ with a space.
|
||||
Note: When using mappings for Visual mode, you can use the "'<" mark, which
|
||||
is the start of the last selected Visual area in the current buffer |'<|.
|
||||
|
||||
*:map-verbose*
|
||||
When 'verbose' is non-zero, listing a key map will also display where it was
|
||||
last defined. Example: >
|
||||
|
||||
:verbose map <C-W>*
|
||||
n <C-W>* * <C-W><C-S>*
|
||||
Last set from /home/abcd/.vimrc
|
||||
|
||||
See |:verbose-cmd| for more information.
|
||||
|
||||
|
||||
1.5 MAPPING SPECIAL KEYS *:map-special-keys*
|
||||
|
||||
There are three ways to map a special key:
|
||||
1. The Vi-compatible method: Map the key code. Often this is a sequence that
|
||||
starts with <Esc>. To enter a mapping like this you type ":map " and then
|
||||
you have to type CTRL-V before hitting the function key. Note that when
|
||||
the key code for the key is in the termcap (the t_ options), it will
|
||||
automatically be translated into the internal code and become the second
|
||||
way of mapping (unless the 'k' flag is included in 'cpoptions').
|
||||
2. The second method is to use the internal code for the function key. To
|
||||
enter such a mapping type CTRL-K and then hit the function key, or use
|
||||
the form "#1", "#2", .. "#9", "#0", "<Up>", "<S-Down>", "<S-F7>", etc.
|
||||
(see table of keys |key-notation|, all keys from <Up> can be used). The
|
||||
first ten function keys can be defined in two ways: Just the number, like
|
||||
"#2", and with "<F>", like "<F2>". Both stand for function key 2. "#0"
|
||||
refers to function key 10, defined with option 't_f10', which may be
|
||||
function key zero on some keyboards. The <> form cannot be used when
|
||||
'cpoptions' includes the '<' flag.
|
||||
3. Use the termcap entry, with the form <t_xx>, where "xx" is the name of the
|
||||
termcap entry. Any string entry can be used. For example: >
|
||||
:map <t_F3> G
|
||||
< Maps function key 13 to "G". This does not work if 'cpoptions' includes
|
||||
the '<' flag.
|
||||
|
||||
The advantage of the second and third method is that the mapping will work on
|
||||
different terminals without modification (the function key will be
|
||||
translated into the same internal code or the actual key code, no matter what
|
||||
terminal you are using. The termcap must be correct for this to work, and you
|
||||
must use the same mappings).
|
||||
|
||||
DETAIL: Vim first checks if a sequence from the keyboard is mapped. If it
|
||||
isn't the terminal key codes are tried (see |terminal-options|). If a
|
||||
terminal code is found it is replaced with the internal code. Then the check
|
||||
for a mapping is done again (so you can map an internal code to something
|
||||
else). What is written into the script file depends on what is recognized.
|
||||
If the terminal key code was recognized as a mapping the key code itself is
|
||||
written to the script file. If it was recognized as a terminal code the
|
||||
internal code is written to the script file.
|
||||
|
||||
|
||||
1.6 SPECIAL CHARACTERS *:map-special-chars*
|
||||
*map_backslash*
|
||||
Note that only CTRL-V is mentioned here as a special character for mappings
|
||||
and abbreviations. When 'cpoptions' does not contain 'B', a backslash can
|
||||
@@ -284,23 +357,12 @@ To map a backslash, or use a backslash literally in the {rhs}, the special
|
||||
sequence "<Bslash>" can be used. This avoids the need to double backslashes
|
||||
when using nested mappings.
|
||||
|
||||
*map-ambiguous*
|
||||
When two mappings start with the same sequence of characters, they are
|
||||
ambiguous. Example: >
|
||||
:imap aa foo
|
||||
:imap aaa bar
|
||||
When Vim has read "aa", it will need to get another character to be able to
|
||||
decide if "aa" or "aaa" should be mapped. This means that after typing "aa"
|
||||
that mapping won't get expanded yet, Vim is waiting for another character.
|
||||
If you type a space, then "foo" will get inserted, plus the space. If you
|
||||
type "a", then "bar" will get inserted.
|
||||
{Vi does not allow ambiguous mappings}
|
||||
|
||||
*map_CTRL_C*
|
||||
It's not possible to use a CTRL-C in the {lhs}. You just can't map CTRL-C.
|
||||
The reason is that CTRL-C must always be available to break a running command.
|
||||
Exception: When using the GUI version on MS-Windows CTRL-C can be mapped to
|
||||
allow a Copy command to the clipboard. Use CTRL-Break to interrupt Vim.
|
||||
*map_CTRL-C*
|
||||
Using CTRL-C in the {lhs} is possible, but it will only work when Vim is
|
||||
waiting for a key, not when Vim is busy with something. When Vim is busy
|
||||
CTRL-C interrupts/breaks the command.
|
||||
When using the GUI version on MS-Windows CTRL-C can be mapped to allow a Copy
|
||||
command to the clipboard. Use CTRL-Break to interrupt Vim.
|
||||
|
||||
*map_space_in_lhs*
|
||||
To include a space in {lhs} precede it with a CTRL-V (type two CTRL-Vs for
|
||||
@@ -320,6 +382,18 @@ example, to make sure that function key 8 does nothing at all: >
|
||||
:map <F8> <Nop>
|
||||
:map! <F8> <Nop>
|
||||
<
|
||||
*map-multibyte*
|
||||
It is possible to map multibyte characters, but only the whole character. You
|
||||
cannot map the first byte only. This was done to prevent problems in this
|
||||
scenario: >
|
||||
:set encoding=latin1
|
||||
:imap <M-C> foo
|
||||
:set encoding=utf-8
|
||||
The mapping for <M-C> is defined with the latin1 encoding, resulting in a 0xc3
|
||||
byte. If you type the character <20> (0xea <M-a>) in UTF-8 encoding this is the
|
||||
two bytes 0xc3 0xa1. You don't want the 0xc3 byte to be mapped then,
|
||||
otherwise it would be impossible to type the <20> character.
|
||||
|
||||
*<Leader>* *mapleader*
|
||||
To define a mapping which uses the "mapleader" variable, the special string
|
||||
"<Leader>" can be used. It is replaced with the string value of "mapleader".
|
||||
@@ -407,14 +481,16 @@ and CTRL-X is not mapped. This was done to be able to use all the named
|
||||
registers and marks, even when the command with the same name has been
|
||||
mapped.
|
||||
|
||||
*map-which-keys*
|
||||
|
||||
1.7 WHAT KEYS TO MAP *map-which-keys*
|
||||
|
||||
If you are going to map something, you will need to choose which key(s) to use
|
||||
for the {lhs}. You will have to avoid keys that are used for Vim commands,
|
||||
otherwise you would not be able to use those commands anymore. Here are a few
|
||||
suggestions:
|
||||
- Function keys <F2>, <F3>, etc.. Also the shifted function keys <S-F1>,
|
||||
<S-F2>, etc. Note that <F1> is already used for the help command.
|
||||
- Meta-keys (with the ALT key pressed).
|
||||
- Meta-keys (with the ALT key pressed). |:map-alt-keys|
|
||||
- Use the '_' or ',' character and then any other character. The "_" and ","
|
||||
commands do exist in Vim (see |_| and |,|), but you probably never use them.
|
||||
- Use a key that is a synonym for another command. For example: CTRL-P and
|
||||
@@ -425,7 +501,9 @@ losing any builtin function. You can also use ":help {key}^D" to find out if
|
||||
a key is used for some command. ({key} is the specific key you want to find
|
||||
out about, ^D is CTRL-D).
|
||||
|
||||
*map-examples*
|
||||
|
||||
1.8 EXAMPLES *map-examples*
|
||||
|
||||
A few examples (given as you type them, for "<CR>" you type four characters;
|
||||
the '<' flag must not be present in 'cpoptions' for this to work). >
|
||||
|
||||
@@ -434,7 +512,9 @@ the '<' flag must not be present in 'cpoptions' for this to work). >
|
||||
:map _x d/END/e<CR>
|
||||
:map! qq quadrillion questions
|
||||
<
|
||||
*map-typing*
|
||||
|
||||
1.9 USING MAPPINGS *map-typing*
|
||||
|
||||
Vim will compare what you type with the start of a mapped sequence. If there
|
||||
is an incomplete match, it will get more characters until there either is a
|
||||
complete match or until there is no match at all. Example: If you map! "qq",
|
||||
@@ -447,14 +527,15 @@ you type slowly, or your system is slow, reset the 'timeout' option. Then you
|
||||
might want to set the 'ttimeout' option.
|
||||
|
||||
*map-keys-fails*
|
||||
There is one situation where key codes might not be recognized:
|
||||
There are situations where key codes might not be recognized:
|
||||
- Vim can only read part of the key code. Mostly this is only the first
|
||||
character. This happens on some Unix versions in an xterm.
|
||||
- The key code is after character(s) that are mapped. E.g., "<F1><F1>" or
|
||||
"g<F1>".
|
||||
|
||||
The result is that the key code is not recognized in this situation, and the
|
||||
mapping fails.
|
||||
There are two actions needed to avoid this problem:
|
||||
mapping fails. There are two actions needed to avoid this problem:
|
||||
|
||||
- Remove the 'K' flag from 'cpoptions'. This will make Vim wait for the rest
|
||||
of the characters of the function key.
|
||||
- When using <F1> to <F4> the actual key code generated may correspond to
|
||||
@@ -470,6 +551,9 @@ special key: >
|
||||
Don't type a real <Esc>, Vim will recognize the key code and replace it with
|
||||
<F1> anyway.
|
||||
|
||||
Another problem may be that when keeping ALT or Meta pressed the terminal
|
||||
prepends ESC instead of setting the 8th bit. See |:map-alt-keys|.
|
||||
|
||||
*recursive_mapping*
|
||||
If you include the {lhs} in the {rhs} you have a recursive mapping. When
|
||||
{lhs} is typed, it will be replaced with {rhs}. When the {lhs} which is
|
||||
@@ -506,43 +590,104 @@ the original Vi, as long as there is only one undo command in the mapped
|
||||
sequence (having two undo commands in a mapped sequence did not make sense
|
||||
in the original Vi, you would get back the text before the first undo).
|
||||
|
||||
*:map-special-keys*
|
||||
There are three ways to map a special key:
|
||||
1. The Vi-compatible method: Map the key code. Often this is a sequence that
|
||||
starts with <Esc>. To enter a mapping like this you type ":map " and then
|
||||
you have to type CTRL-V before hitting the function key. Note that when
|
||||
the key code for the key is in the termcap (the t_ options), it will
|
||||
automatically be translated into the internal code and become the second
|
||||
way of mapping (unless the 'k' flag is included in 'cpoptions').
|
||||
2. The second method is to use the internal code for the function key. To
|
||||
enter such a mapping type CTRL-K and then hit the function key, or use
|
||||
the form "#1", "#2", .. "#9", "#0", "<Up>", "<S-Down>", "<S-F7>", etc.
|
||||
(see table of keys |key-notation|, all keys from <Up> can be used). The
|
||||
first ten function keys can be defined in two ways: Just the number, like
|
||||
"#2", and with "<F>", like "<F2>". Both stand for function key 2. "#0"
|
||||
refers to function key 10, defined with option 't_f10', which may be
|
||||
function key zero on some keyboards. The <> form cannot be used when
|
||||
'cpoptions' includes the '<' flag.
|
||||
3. Use the termcap entry, with the form <t_xx>, where "xx" is the name of the
|
||||
termcap entry. Any string entry can be used. For example: >
|
||||
:map <t_F3> G
|
||||
< Maps function key 13 to "G". This does not work if 'cpoptions' includes
|
||||
the '<' flag.
|
||||
|
||||
The advantage of the second and third method is that the mapping will work on
|
||||
different terminals without modification (the function key will be
|
||||
translated into the same internal code or the actual key code, no matter what
|
||||
terminal you are using. The termcap must be correct for this to work, and you
|
||||
must use the same mappings).
|
||||
1.10 MAPPING ALT-KEYS *:map-alt-keys*
|
||||
|
||||
DETAIL: Vim first checks if a sequence from the keyboard is mapped. If it
|
||||
isn't the terminal key codes are tried (see |terminal-options|). If a
|
||||
terminal code is found it is replaced with the internal code. Then the check
|
||||
for a mapping is done again (so you can map an internal code to something
|
||||
else). What is written into the script file depends on what is recognized.
|
||||
If the terminal key code was recognized as a mapping the key code itself is
|
||||
written to the script file. If it was recognized as a terminal code the
|
||||
internal code is written to the script file.
|
||||
In the GUI Vim handles the Alt key itself, thus mapping keys with ALT should
|
||||
always work. But in a terminal Vim gets a sequence of bytes and has to figure
|
||||
out whether ALT was pressed or not.
|
||||
|
||||
By default Vim assumes that pressing the ALT key sets the 8th bit of a typed
|
||||
character. Most decent terminals can work that way, such as xterm, aterm and
|
||||
rxvt. If your <A-k> mappings don't work it might be that the terminal is
|
||||
prefixing the character with an ESC character. But you can just as well type
|
||||
ESC before a character, thus Vim doesn't know what happened (except for
|
||||
checking the delay between characters, which is not reliable).
|
||||
|
||||
As of this writing, some mainstream terminals like gnome-terminal and konsole
|
||||
use the ESC prefix. There doesn't appear a way to have them use the 8th bit
|
||||
instead. Xterm should work well by default. Aterm and rxvt should work well
|
||||
when started with the "--meta8" argument. You can also tweak resources like
|
||||
"metaSendsEscape", "eightBitInput" and "eightBitOutput".
|
||||
|
||||
On the Linux console, this behavior can be toggled with the "setmetamode"
|
||||
command. Bear in mind that not using an ESC prefix could get you in trouble
|
||||
with other programs. You should make sure that bash has the "convert-meta"
|
||||
option set to "on" in order for your Meta keybindings to still work on it
|
||||
(it's the default readline behavior, unless changed by specific system
|
||||
configuration). For that, you can add the line: >
|
||||
|
||||
set convert-meta on
|
||||
|
||||
to your ~/.inputrc file. If you're creating the file, you might want to use: >
|
||||
|
||||
$include /etc/inputrc
|
||||
|
||||
as the first line, if that file exists on your system, to keep global options.
|
||||
This may cause a problem for entering special characters, such as the umlaut.
|
||||
Then you should use CTRL-V before that character.
|
||||
|
||||
Bear in mind that convert-meta has been reported to have troubles when used in
|
||||
UTF-8 locales. On terminals like xterm, the "metaSendsEscape" resource can be
|
||||
toggled on the fly through the "Main Options" menu, by pressing Ctrl-LeftClick
|
||||
on the terminal; that's a good last resource in case you want to send ESC when
|
||||
using other applications but not when inside VIM.
|
||||
|
||||
|
||||
1.11 MAPPING AN OPERATOR *:map-operator*
|
||||
|
||||
An operator is used before a {motion} command. To define your own operator
|
||||
you must create mapping that first sets the 'operatorfunc' option and then
|
||||
invoke the |g@| operator. After the user types the {motion} command the
|
||||
specified function will be called.
|
||||
|
||||
*g@* *E774* *E775*
|
||||
g@{motion} Call the function set by the 'operatorfunc' option.
|
||||
The '[ mark is positioned at the start of the text
|
||||
moved over by {motion}, the '] mark on the last
|
||||
character of the text.
|
||||
The function is called with one String argument:
|
||||
"line" {motion} was |linewise|
|
||||
"char" {motion} was |characterwise|
|
||||
"block" {motion} was |blockwise-visual||
|
||||
Although "block" would rarely appear, since it can
|
||||
only result from Visual mode where "g@" is not useful.
|
||||
{not available when compiled without the +eval
|
||||
feature}
|
||||
|
||||
Here is an example that counts the number of spaces with <F4>: >
|
||||
|
||||
nmap <silent> <F4> :set opfunc=CountSpaces<CR>g@
|
||||
vmap <silent> <F4> :<C-U>call CountSpaces(visualmode(), 1)<CR>
|
||||
|
||||
function! CountSpaces(type, ...)
|
||||
let sel_save = &selection
|
||||
let &selection = "inclusive"
|
||||
let reg_save = @@
|
||||
|
||||
if a:0 " Invoked from Visual mode, use '< and '> marks.
|
||||
silent exe "normal! `<" . a:type . "`>y"
|
||||
elseif a:type == 'line'
|
||||
silent exe "normal! '[V']y"
|
||||
elseif a:type == 'block'
|
||||
silent exe "normal! `[\<C-V>`]y"
|
||||
else
|
||||
silent exe "normal! `[v`]y"
|
||||
endif
|
||||
|
||||
echomsg strlen(substitute(@@, '[^ ]', '', 'g'))
|
||||
|
||||
let &selection = sel_save
|
||||
let @@ = reg_save
|
||||
endfunction
|
||||
|
||||
Note that the 'selection' option is temporarily set to "inclusive" to be able
|
||||
to yank exactly the right text by using Visual mode from the '[ to the ']
|
||||
mark.
|
||||
|
||||
Also note that there is a separate mapping for Visual mode. It removes the
|
||||
"'<,'>" range that ":" inserts in Visual mode and invokes the function with
|
||||
visualmode() and an extra argument.
|
||||
|
||||
==============================================================================
|
||||
2. Abbreviations *abbreviations* *Abbreviations*
|
||||
@@ -656,6 +801,16 @@ used in a |filetype-plugin| file. Example for a C plugin file: >
|
||||
mode, '!' for both. These are the same as for
|
||||
mappings, see |map-listing|.
|
||||
|
||||
*:abbreviate-verbose*
|
||||
When 'verbose' is non-zero, listing an abbreviation will also display where it
|
||||
was last defined. Example: >
|
||||
|
||||
:verbose abbreviate
|
||||
! teh the
|
||||
Last set from /home/abcd/vim/abbr.vim
|
||||
|
||||
See |:verbose-cmd| for more information.
|
||||
|
||||
:ab[breviate] {lhs} list the abbreviations that start with {lhs}
|
||||
You may need to insert a CTRL-V (type it twice) to
|
||||
avoid that a typed {lhs} is expanded, since
|
||||
@@ -793,11 +948,10 @@ local function or uses a local mapping.
|
||||
Otherwise, using "<SID>" outside of a script context is an error.
|
||||
|
||||
If you need to get the script number to use in a complicated script, you can
|
||||
use this trick: >
|
||||
:map <SID>xx <SID>xx
|
||||
:let s:sid = maparg("<SID>xx")
|
||||
:unmap <SID>xx
|
||||
And remove the trailing "xx".
|
||||
use this function: >
|
||||
function s:SID()
|
||||
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
|
||||
endfun
|
||||
|
||||
The "<SNR>" will be shown when listing functions and mappings. This is useful
|
||||
to find out what they are defined to.
|
||||
@@ -855,6 +1009,17 @@ scripts.
|
||||
|
||||
:com[mand] {cmd} List the user-defined commands that start with {cmd}
|
||||
|
||||
*:command-verbose*
|
||||
When 'verbose' is non-zero, listing a command will also display where it was
|
||||
last defined. Example: >
|
||||
|
||||
:verbose command TOhtml
|
||||
Name Args Range Complete Definition
|
||||
TOhtml 0 % :call Convert2HTML(<line1>, <line2>)
|
||||
Last set from /usr/share/vim/vim-7.0/plugin/tohtml.vim
|
||||
<
|
||||
See |:verbose-cmd| for more information.
|
||||
|
||||
*E174* *E182*
|
||||
:com[mand][!] [{attr}...] {cmd} {rep}
|
||||
Define a user command. The name of the command is
|
||||
@@ -932,26 +1097,38 @@ completion can be enabled:
|
||||
-complete=tag_listfiles tags, file names are shown when CTRL-D is hit
|
||||
-complete=var user variables
|
||||
-complete=custom,{func} custom completion, defined via {func}
|
||||
-complete=customlist,{func} custom completion, defined via {func}
|
||||
|
||||
Custom completion *:command-completion-custom*
|
||||
*E467* *E468*
|
||||
|
||||
Custom completion *:command-completion-custom*
|
||||
*:command-completion-customlist*
|
||||
*E467* *E468*
|
||||
It is possible to define customized completion schemes via the "custom,{func}"
|
||||
completion argument. The {func} part should be a function with the following
|
||||
prototype >
|
||||
or the "customlist,{func}" completion argument. The {func} part should be a
|
||||
function with the following prototype >
|
||||
|
||||
:function {func}(ArgLead, CmdLine, CursorPos)
|
||||
|
||||
The function need not use all these arguments, but it should provide the
|
||||
completion candidates as the return value, one per line in a newline separated
|
||||
string. The function arguments are:
|
||||
The function need not use all these arguments. The function should provide the
|
||||
completion candidates as the return value.
|
||||
|
||||
For the "custom" argument, the function should return the completion
|
||||
candidates one per line in a newline separated string.
|
||||
|
||||
For the "customlist" argument, the function should return the completion
|
||||
candidates as a Vim List. Non-string items in the list are ignored.
|
||||
|
||||
The function arguments are:
|
||||
ArgLead the leading portion of the argument currently being
|
||||
completed on
|
||||
CmdLine the entire command line
|
||||
CursorPos the cursor position in it
|
||||
The function may use these for determining context. It is not necessary to
|
||||
filter candidates against the (implicit pattern in) ArgLead. Vim will do
|
||||
filter the candidates with its regexp engine after function return, and this
|
||||
is probably more efficient in most cases.
|
||||
CursorPos the cursor position in it (byte index)
|
||||
The function may use these for determining context. For the "custom"
|
||||
argument, it is not necessary to filter candidates against the (implicit
|
||||
pattern in) ArgLead. Vim will do filter the candidates with its regexp engine
|
||||
after function return, and this is probably more efficient in most cases. For
|
||||
the "customlist" argument, Vim will not filter the returned completion
|
||||
candidates and the user supplied function should filter the candidates.
|
||||
|
||||
The following example lists user names to a Finger command >
|
||||
:com -complete=custom,ListUsers -nargs=1 Finger !finger <args>
|
||||
@@ -959,6 +1136,15 @@ The following example lists user names to a Finger command >
|
||||
: return system("cut -d: -f1 /etc/passwd")
|
||||
:endfun
|
||||
|
||||
The following example completes filenames from the directories specified in
|
||||
the 'path' option: >
|
||||
:com -nargs=1 -bang -complete=customlist,EditFileComplete
|
||||
\ EditFile edit<bang> <args>
|
||||
:fun EditFileComplete(A,L,P)
|
||||
: return split(globpath(&path, a:ArgLead), "\n")
|
||||
:endfun
|
||||
<
|
||||
|
||||
Range handling *E177* *E178*
|
||||
|
||||
By default, user-defined commands do not accept a line number range. However,
|
||||
@@ -1038,8 +1224,7 @@ To allow commands to pass their arguments on to a user-defined function, there
|
||||
is a special form <f-args> ("function args"). This splits the command
|
||||
arguments at spaces and Tabs, quotes each argument individually, and the
|
||||
<f-args> sequence is replaced by the comma-separated list of quoted arguments.
|
||||
See the Mycmd example below. When there is no argument, <f-args> also has no
|
||||
argument.
|
||||
See the Mycmd example below. If no arguments are given <f-args> is removed.
|
||||
|
||||
Examples >
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*mbyte.txt* For Vim version 7.0aa. Last change: 2005 Mar 29
|
||||
*mbyte.txt* For Vim version 7.0aa. Last change: 2005 Oct 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar et al.
|
||||
@@ -286,6 +286,29 @@ Supported 'encoding' values are: *encoding-values*
|
||||
1 koi8-u Ukrainian
|
||||
1 macroman MacRoman (Macintosh encoding)
|
||||
1 8bit-{name} any 8-bit encoding (Vim specific name)
|
||||
1 cp437 similar to iso-8859-1
|
||||
1 cp737 similar to iso-8859-7
|
||||
1 cp775 Baltic
|
||||
1 cp850 similar to iso-8859-4
|
||||
1 cp852 similar to iso-8859-1
|
||||
1 cp855 similar to iso-8859-2
|
||||
1 cp857 similar to iso-8859-5
|
||||
1 cp860 similar to iso-8859-9
|
||||
1 cp861 similar to iso-8859-1
|
||||
1 cp862 similar to iso-8859-1
|
||||
1 cp863 similar to iso-8859-8
|
||||
1 cp865 similar to iso-8859-1
|
||||
1 cp866 similar to iso-8859-5
|
||||
1 cp869 similar to iso-8859-7
|
||||
1 cp874 Thai
|
||||
1 cp1250 Czech, Polish, etc.
|
||||
1 cp1251 Cyrillic
|
||||
1 cp1253 Greek
|
||||
1 cp1254 Turkish
|
||||
1 cp1255 Hebrew
|
||||
1 cp1256 Arabic
|
||||
1 cp1257 Baltic
|
||||
1 cp1258 Vietnamese
|
||||
1 cp{number} MS-Windows: any installed single-byte codepage
|
||||
2 cp932 Japanese (Windows only)
|
||||
2 euc-jp Japanese (Unix only)
|
||||
@@ -461,6 +484,12 @@ conversion needs to be done. These conversions are supported:
|
||||
request a very large buffer, more than Vim is willing to provide).
|
||||
Try getting another iconv() implementation.
|
||||
|
||||
*iconv-dynamic*
|
||||
On MS-Windows Vim can be compiled with the |+iconv/dyn| feature. This means
|
||||
Vim will search for the "iconv.dll" and "libiconv.dll" libraries. When
|
||||
neither of them can be found Vim will still work but some conversions won't be
|
||||
possible.
|
||||
|
||||
==============================================================================
|
||||
4. Using a terminal *mbyte-terminal*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*message.txt* For Vim version 7.0aa. Last change: 2005 Feb 13
|
||||
*message.txt* For Vim version 7.0aa. Last change: 2006 Jan 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -19,7 +19,16 @@ The ":messages" command can be used to view previously given messages. This
|
||||
is especially useful when messages have been overwritten or truncated. This
|
||||
depends on the 'shortmess' option.
|
||||
|
||||
The number of remembered messages is fixed at 20.
|
||||
The number of remembered messages is fixed at 20 for the tiny version and 100
|
||||
for other versions.
|
||||
|
||||
*g<*
|
||||
The "g<" command can be used to see the last page of previous command output.
|
||||
This is especially useful if you accidentally typed <Space> at the hit-enter
|
||||
prompt.
|
||||
Note: when you stopped the output with "q" at the more prompt only up to that
|
||||
point will be displayed.
|
||||
The previous command output is cleared when another command produces output.
|
||||
|
||||
If you are using translated messages, the first printed line tells who
|
||||
maintains the messages or the translations. You can use this to contact the
|
||||
@@ -279,6 +288,19 @@ Example: >
|
||||
changes to: >
|
||||
:w! /tmp/test
|
||||
<
|
||||
*E768* >
|
||||
Swap file exists: {filename} (:silent! overrides)
|
||||
|
||||
You are protected from overwriting a file that is being edited by Vim. This
|
||||
happens when you use ":w! filename" and a swapfile is found.
|
||||
- If the swapfile was left over from an old crashed edit session you may want
|
||||
to delete the swapfile. Edit {filename} to find out information about the
|
||||
swapfile.
|
||||
- If you want to write anyway prepend ":silent!" to the command. For example: >
|
||||
:silent! w! /tmp/test
|
||||
< The special command is needed, since you already added the ! for overwriting
|
||||
an existing file.
|
||||
|
||||
*E139* >
|
||||
File is loaded in another buffer
|
||||
|
||||
@@ -568,6 +590,7 @@ The file is read-only and you are making a change to it anyway. You can use
|
||||
the |FileChangedRO| autocommand event to avoid this message (the autocommand
|
||||
must reset the 'readonly' option). See 'modifiable' to completely disallow
|
||||
making changes to a file.
|
||||
This message is only given for the first change after 'readonly' has been set.
|
||||
|
||||
*W13* >
|
||||
Warning: File "{filename}" has been created after editing started
|
||||
@@ -714,9 +737,10 @@ a user-defined command.
|
||||
|
||||
This is an (incomplete) overview of various messages that Vim gives:
|
||||
|
||||
*hit-enter* *press-enter* *hit-return* *press-return* >
|
||||
*hit-enter* *press-enter* *hit-return*
|
||||
*press-return* *hit-enter-prompt*
|
||||
|
||||
Hit ENTER or type command to continue
|
||||
Press ENTER or type command to continue
|
||||
|
||||
This message is given when there is something on the screen for you to read,
|
||||
and the screen is about to be redrawn:
|
||||
@@ -724,10 +748,13 @@ and the screen is about to be redrawn:
|
||||
- Something is displayed on the status line that is longer than the width of
|
||||
the window, or runs into the 'showcmd' or 'ruler' output.
|
||||
|
||||
-> Hit <Enter> or <Space> to redraw the screen and continue, without that key
|
||||
being used otherwise.
|
||||
-> Hit ":" or any other Normal mode command character to start that command.
|
||||
-> Hit <C-Y> to copy (yank) a modeless selection to the clipboard register.
|
||||
-> Press <Enter> or <Space> to redraw the screen and continue, without that
|
||||
key being used otherwise.
|
||||
-> Press ':' or any other Normal mode command character to start that command.
|
||||
-> Press 'k', 'u', 'b' or 'g' to scroll back in the messages. This works the
|
||||
same way as at the |more-prompt|. Only works when 'compatible' is off and
|
||||
'more' is on.
|
||||
-> Press <C-Y> to copy (yank) a modeless selection to the clipboard register.
|
||||
-> Use a menu. The characters defined for Cmdline-mode are used.
|
||||
-> When 'mouse' contains the 'r' flag, clicking the left mouse button works
|
||||
like pressing <Space>. This makes it impossible to select text though.
|
||||
@@ -735,19 +762,24 @@ and the screen is about to be redrawn:
|
||||
pressing <Space>.
|
||||
{Vi: only ":" commands are interpreted}
|
||||
|
||||
If you accidentally hit <Enter> or <Space> and you want to see the displayed
|
||||
text then use |g<|. This only works when 'more' is set.
|
||||
|
||||
To reduce the number of hit-enter prompts:
|
||||
- Set 'cmdheight' to 2 or higher.
|
||||
- Add flags to 'shortmess'.
|
||||
- Reset 'showcmd' and/or 'ruler'.
|
||||
|
||||
If your script causes the hit-enter prompt and you don't know why, you may
|
||||
find the |v:scrollstart| variable useful.
|
||||
|
||||
Also see 'mouse'. The hit-enter message is highlighted with the |hl-Question|
|
||||
group.
|
||||
|
||||
|
||||
*more-prompt* *pager* >
|
||||
-- More --
|
||||
-- More -- (RET: line, SPACE: page, d: half page, q: quit)
|
||||
-- More -- (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)
|
||||
-- More -- SPACE/d/j: screen/page/line down, b/u/k: up, q: quit
|
||||
|
||||
This message is given when the screen is filled with messages. It is only
|
||||
given when the 'more' option is on. It is highlighted with the |hl-MoreMsg|
|
||||
@@ -755,11 +787,16 @@ group.
|
||||
|
||||
Type effect ~
|
||||
<CR> or <NL> or j or <Down> one more line
|
||||
d down a page (half a screen)
|
||||
<Space> or <PageDown> down a screen
|
||||
G down all the way, until the hit-enter
|
||||
prompt
|
||||
|
||||
<BS> or k or <Up> one line back (*)
|
||||
<Space> or <PageDown> next page
|
||||
b or <PageUp> previous page (*)
|
||||
d down half a page
|
||||
u up half a page (*)
|
||||
u up a page (half a screen) (*)
|
||||
b or <PageUp> back a screen (*)
|
||||
g back to the start (*)
|
||||
|
||||
q, <Esc> or CTRL-C stop the listing
|
||||
: stop the listing and enter a
|
||||
command-line
|
||||
@@ -771,8 +808,8 @@ Type effect ~
|
||||
|
||||
Any other key causes the meaning of the keys to be displayed.
|
||||
|
||||
(*) backwards scrolling is only supported for these commands: >
|
||||
:clist
|
||||
(*) backwards scrolling is {not in Vi}. Only scrolls back to where messages
|
||||
started to scroll.
|
||||
(**) Clicking the left mouse button only works:
|
||||
- For the GUI: in the last line of the screen.
|
||||
- When 'r' is included in 'mouse' (but then selecting text won't work).
|
||||
@@ -781,4 +818,8 @@ Any other key causes the meaning of the keys to be displayed.
|
||||
Note: The typed key is directly obtained from the terminal, it is not mapped
|
||||
and typeahead is ignored.
|
||||
|
||||
The |g<| command can be used to see the last page of previous command output.
|
||||
This is especially useful if you accidentally typed <Space> at the hit-enter
|
||||
prompt.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*motion.txt* For Vim version 7.0aa. Last change: 2005 Apr 04
|
||||
*motion.txt* For Vim version 7.0aa. Last change: 2006 Jan 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -57,6 +57,7 @@ or change text. The following operators are available:
|
||||
|>| > shift right
|
||||
|<| < shift left
|
||||
|zf| zf define a fold
|
||||
|g@| g@ call function set with the 'operatorfunc' option
|
||||
|
||||
If the motion includes a count and the operator also had a count before it,
|
||||
the two counts are multiplied. For example: "2d3w" deletes six words.
|
||||
@@ -72,13 +73,13 @@ and end position. Generally, motions that move between lines affect lines
|
||||
characterwise). However, there are some exceptions.
|
||||
|
||||
*exclusive* *inclusive*
|
||||
A character motion is either inclusive or exclusive. When inclusive, the start
|
||||
and end position of the motion are included in the operation. When exclusive,
|
||||
the last character towards the end of the buffer is not included. Linewise
|
||||
motions always include the start and end position.
|
||||
A character motion is either inclusive or exclusive. When inclusive, the
|
||||
start and end position of the motion are included in the operation. When
|
||||
exclusive, the last character towards the end of the buffer is not included.
|
||||
Linewise motions always include the start and end position.
|
||||
|
||||
Which motions are linewise, inclusive or exclusive is mentioned below. There
|
||||
are however, two general exceptions:
|
||||
Which motions are linewise, inclusive or exclusive is mentioned with the
|
||||
command. There are however, two general exceptions:
|
||||
1. If the motion is exclusive and the end of the motion is in column 1, the
|
||||
end of the motion is moved to the end of the previous line and the motion
|
||||
becomes inclusive. Example: "}" moves to the first line after a paragraph,
|
||||
@@ -247,7 +248,7 @@ f{char} To [count]'th occurrence of {char} to the right. The
|
||||
|
||||
*F*
|
||||
F{char} To the [count]'th occurrence of {char} to the left.
|
||||
The cursor is placed on {char} |inclusive|.
|
||||
The cursor is placed on {char} |exclusive|.
|
||||
{char} can be entered like with the |f| command.
|
||||
|
||||
*t*
|
||||
@@ -259,7 +260,7 @@ t{char} Till before [count]'th occurrence of {char} to the
|
||||
*T*
|
||||
T{char} Till after [count]'th occurrence of {char} to the
|
||||
left. The cursor is placed on the character right of
|
||||
{char} |inclusive|.
|
||||
{char} |exclusive|.
|
||||
{char} can be entered like with the |f| command.
|
||||
|
||||
*;*
|
||||
@@ -385,10 +386,11 @@ These commands move over words or WORDS.
|
||||
*word*
|
||||
A word consists of a sequence of letters, digits and underscores, or a
|
||||
sequence of other non-blank characters, separated with white space (spaces,
|
||||
tabs, <EOL>). This can be changed with the 'iskeyword' option.
|
||||
tabs, <EOL>). This can be changed with the 'iskeyword' option. An empty line
|
||||
is also considered to be a word.
|
||||
*WORD*
|
||||
A WORD consists of a sequence of non-blank characters, separated with white
|
||||
space. An empty line is also considered to be a word and a WORD.
|
||||
space. An empty line is also considered to be a WORD.
|
||||
|
||||
A sequence of folded lines is counted for one word of a single character.
|
||||
"w" and "W", "e" and "E" move to the start/end of the first word or WORD after
|
||||
@@ -595,6 +597,20 @@ i< "inner <> block", select [count] <> blocks, from
|
||||
'>', excluding the '<' and '>'.
|
||||
When used in Visual mode it is made characterwise.
|
||||
|
||||
*v_at* *at*
|
||||
at "a tag block", select [count] tag blocks, from the
|
||||
[count]'th unmatched "<aaa>" backwards to the matching
|
||||
"</aaa>", including the "<aaa>" and "</aaa>".
|
||||
See |tag-blocks| about the details.
|
||||
When used in Visual mode it is made characterwise.
|
||||
|
||||
*v_it* *it*
|
||||
it "inner tag block", select [count] tag blocks, from the
|
||||
[count]'th unmatched "<aaa>" backwards to the matching
|
||||
"</aaa>", excluding the "<aaa>" and "</aaa>".
|
||||
See |tag-blocks| about the details.
|
||||
When used in Visual mode it is made characterwise.
|
||||
|
||||
a} *v_a}* *a}* *a{*
|
||||
a{ *v_aB* *v_a{* *aB*
|
||||
aB "a Block", select [count] Blocks, from "[count] [{" to
|
||||
@@ -628,6 +644,8 @@ i' *v_i'* *i'*
|
||||
i` *v_i`* *i`*
|
||||
Like a", a' and a`, but exclude the quotes and
|
||||
repeating won't extend the Visual selection.
|
||||
Special case: With a count of 2 the quotes are
|
||||
included, but no extra white space as with a"/a'/a`.
|
||||
|
||||
When used after an operator:
|
||||
For non-block objects:
|
||||
@@ -679,6 +697,25 @@ where on the object the cursor is. For example, compare "dw" and "daw": "dw"
|
||||
deletes from the cursor position to the start of the next word, "daw" deletes
|
||||
the word under the cursor and the space after or before it.
|
||||
|
||||
|
||||
Tag blocks *tag-blocks*
|
||||
|
||||
For the "it" and "at" text objects an attempt is done to select blocks between
|
||||
matching tags for HTML and XML. But since these are not completely compatible
|
||||
there are a few restrictions.
|
||||
|
||||
The normal method is to select a <tag> until the matching </tag>. For "at"
|
||||
the tags are included, for "it" they are excluded. But when "it" is repeated
|
||||
the tags will be included (otherwise nothing would change).
|
||||
|
||||
"<aaa/>" items are skipped. Case is ignored, also for XML where case does
|
||||
matter.
|
||||
|
||||
In HTML it is possible to have a tag like <br> or <meta ...> without a
|
||||
matching end tag. These are ignored.
|
||||
|
||||
The text objects are tolerant about mistakes. Stray end tags are ignored.
|
||||
|
||||
==============================================================================
|
||||
7. Marks *mark-motions* *E20* *E78*
|
||||
|
||||
@@ -938,7 +975,7 @@ These commands are not marks themselves, but jump to a mark:
|
||||
position. E.g., when updating a "Last change"
|
||||
timestamp in the first line: >
|
||||
|
||||
:let lnum = getline(".")
|
||||
:let lnum = line(".")
|
||||
:keepjumps normal gg
|
||||
:call SetLastChange()
|
||||
:keepjumps exe "normal " . lnum . "G"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 7.0aa. Last change: 2005 Jun 07
|
||||
*options.txt* For Vim version 7.0aa. Last change: 2006 Jan 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -19,7 +19,7 @@ achieve special effects. These options come in three forms:
|
||||
string has a string value
|
||||
|
||||
==============================================================================
|
||||
1. Setting options *set-option*
|
||||
1. Setting options *set-option* *E764*
|
||||
|
||||
*:se* *:set*
|
||||
:se[t] Show all options that differ from their default value.
|
||||
@@ -76,10 +76,8 @@ achieve special effects. These options come in three forms:
|
||||
comma separated list, a comma is added, unless the
|
||||
value was empty.
|
||||
If the option is a list of flags, superfluous flags
|
||||
are removed. Otherwise there is no check for doubled
|
||||
values. You can avoid this by removing a value first.
|
||||
Example: >
|
||||
:set guioptions-=T guioptions+=T
|
||||
are removed. When adding a flag that was already
|
||||
present the option value doesn't change.
|
||||
< Also see |:set-args| above.
|
||||
{not in Vi}
|
||||
|
||||
@@ -164,6 +162,11 @@ include the "|" in the option value, use "\|" instead. This example sets the
|
||||
This sets the 'titlestring' option to "hi" and 'iconstring' to "there": >
|
||||
:set titlestring=hi|set iconstring=there
|
||||
|
||||
Similarly, the double quote character starts a comment. To include the '"' in
|
||||
the option value, use '\"' instead. This example sets the 'titlestring'
|
||||
option to 'hi "there"': >
|
||||
:set titlestring=hi\ \"there\"
|
||||
|
||||
For MS-DOS and WIN32 backslashes in file names are mostly not removed. More
|
||||
precise: For options that expect a file name (those where environment
|
||||
variables are expanded) a backslash before a normal file name character is not
|
||||
@@ -560,12 +563,20 @@ is entered, this is almost like having global options. If 's' and 'S' are not
|
||||
present, the options are copied from the currently active buffer when the
|
||||
buffer is created.
|
||||
|
||||
Not all options are supported in all versions. To test if option "foo" can be
|
||||
used with ":set" use "exists('&foo')". This doesn't mean the value is
|
||||
actually remembered and works. Some options are hidden, which means that you
|
||||
can set them but the value is not remembered. To test if option "foo" is
|
||||
really supported use "exists('+foo')".
|
||||
Hidden options *hidden-options*
|
||||
|
||||
Not all options are supported in all versions. This depends on the supported
|
||||
features and sometimes on the system. A remark about this is in curly braces
|
||||
below. When an option is not supported it may still be set without getting an
|
||||
error, this is called a hidden option. You can't get the value of a hidden
|
||||
option though, it is not stored.
|
||||
|
||||
To test if option "foo" can be used with ":set" use something like this: >
|
||||
if exists('&foo')
|
||||
This also returns true for a hidden option. To test if option "foo" is really
|
||||
supported use something like this: >
|
||||
if exists('+foo')
|
||||
<
|
||||
*E355*
|
||||
A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
@@ -657,12 +668,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{not in Vi}
|
||||
{only available when compiled with the
|
||||
|+netbeans_intg| or |+sun_workshop| feature}
|
||||
When on, Vim will change its value for the current working directory
|
||||
whenever you open a file, switch buffers, delete a buffer or
|
||||
open/close a window. It will change to the directory containing the
|
||||
file which was opened or selected. This option is provided for
|
||||
backward compatibility with the Vim released with Sun ONE Studio 4
|
||||
Enterprise Edition.
|
||||
When on, Vim will change the current working directory whenever you
|
||||
open a file, switch buffers, delete a buffer or open/close a window.
|
||||
It will change to the directory containing the file which was opened
|
||||
or selected.
|
||||
This option is provided for backward compatibility with the Vim
|
||||
released with Sun ONE Studio 4 Enterprise Edition.
|
||||
Note: When this option is on some plugins may not work. The directory
|
||||
browser sets if off.
|
||||
|
||||
*'arabic'* *'arab'* *'noarabic'* *'noarab'*
|
||||
'arabic' 'arab' boolean (default off)
|
||||
@@ -978,6 +991,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Watch out for special characters, see |option-backslash|.
|
||||
When $TMPDIR, $TMP or $TEMP is not defined, it is not used for the
|
||||
default value. "/tmp/*" is only used for Unix.
|
||||
Note that the default also makes sure that "crontab -e" works (when a
|
||||
backup would be made by renaming the original file crontab won't see
|
||||
the newly created file). Also see 'backupcopy' and |crontab|.
|
||||
|
||||
*'balloondelay'* *'bdlay'*
|
||||
'balloondelay' 'bdlay' number (default: 600)
|
||||
@@ -1013,7 +1029,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The evaluation of the expression must not have side effects!
|
||||
Example: >
|
||||
function! MyBalloonExpr()
|
||||
return 'Cursor is at line ' . v:beval_lnum .
|
||||
return 'Cursor is at line ' . v:beval_lnum .
|
||||
\', column ' . v:beval_col .
|
||||
\ ' of file ' . bufname(v:beval_bufnr) .
|
||||
\ ' on word "' . v:beval_text . '"'
|
||||
@@ -1026,6 +1042,15 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Vim does not try to send a message to an external debugger (Netbeans
|
||||
or Sun Workshop).
|
||||
|
||||
The expression may be evaluated in the |sandbox|, see
|
||||
|sandbox-option|.
|
||||
|
||||
It is not allowed to change text or jump to another window while
|
||||
evaluating 'balloonexpr' |textlock|.
|
||||
|
||||
To check whether line breaks in the balloon text work use this check: >
|
||||
if has("balloon_multiline")
|
||||
<
|
||||
*'binary'* *'bin'* *'nobinary'* *'nobin'*
|
||||
'binary' 'bin' boolean (default off)
|
||||
local to buffer
|
||||
@@ -1061,7 +1086,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'bioskey' 'biosk' boolean (default on)
|
||||
global
|
||||
{not in Vi} {only for MS-DOS}
|
||||
When on the bios is called to obtain a keyboard character. This works
|
||||
When on the BIOS is called to obtain a keyboard character. This works
|
||||
better to detect CTRL-C, but only works for the console. When using a
|
||||
terminal over a serial port reset this option.
|
||||
Also see |'conskey'|.
|
||||
@@ -1095,7 +1120,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{not available when compiled without the |+linebreak|
|
||||
feature}
|
||||
This option lets you choose which characters might cause a line
|
||||
break if 'linebreak' is on.
|
||||
break if 'linebreak' is on. Only works for ASCII and also for 8-bit
|
||||
characters when 'encoding' is an 8-bit encoding.
|
||||
|
||||
*'browsedir'* *'bsdir'*
|
||||
'browsedir' 'bsdir' string (default: "last")
|
||||
@@ -1195,9 +1221,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
these words, separated by a comma:
|
||||
internal Use internal case mapping functions, the current
|
||||
locale does not change the case mapping. This only
|
||||
matters when 'encoding' is a Unicode encoding. When
|
||||
"internal" is omitted, the towupper() and towlower()
|
||||
system library functions are used when available.
|
||||
matters when 'encoding' is a Unicode encoding,
|
||||
"latin1" or "iso-8859-15". When "internal" is
|
||||
omitted, the towupper() and towlower() system library
|
||||
functions are used when available.
|
||||
keepascii For the ASCII characters (0x00 to 0x7f) use the US
|
||||
case mapping, the current locale is not effective.
|
||||
This probably only matters for Turkish.
|
||||
@@ -1420,6 +1447,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
to use the size for the GUI, put the command in your |gvimrc| file.
|
||||
When you set this option and Vim is unable to change the physical
|
||||
number of columns of the display, the display may be messed up.
|
||||
Mimimum value is 12, maximum value is 10000.
|
||||
|
||||
*'comments'* *'com'* *E524* *E525*
|
||||
'comments' 'com' string (default
|
||||
@@ -1443,7 +1471,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|fold-marker|.
|
||||
|
||||
*'compatible'* *'cp'* *'nocompatible'* *'nocp'*
|
||||
'compatible' 'cp' boolean (default on, off when a .vimrc file is found)
|
||||
'compatible' 'cp' boolean (default on, off when a .vimrc or .gvimrc file
|
||||
is found)
|
||||
global
|
||||
{not in Vi}
|
||||
This option has the effect of making Vim either more Vi-compatible, or
|
||||
@@ -1458,12 +1487,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
options. This default was chosen for those people who want to use Vim
|
||||
just like Vi, and don't even (want to) know about the 'compatible'
|
||||
option.
|
||||
When a ".vimrc" file is found while Vim is starting up, this option is
|
||||
switched off, and all options that have not been modified will be set
|
||||
to the Vim defaults. Effectively, this means that when a ".vimrc"
|
||||
file exists, Vim will use the Vim defaults, otherwise it will use the
|
||||
Vi defaults. (Note: This doesn't happen for the system-wide vimrc
|
||||
file). Also see |compatible-default| and |posix-compliance|.
|
||||
When a ".vimrc" or ".gvimrc" file is found while Vim is starting up,
|
||||
this option is switched off, and all options that have not been
|
||||
modified will be set to the Vim defaults. Effectively, this means
|
||||
that when a ".vimrc" or ".gvimrc" file exists, Vim will use the Vim
|
||||
defaults, otherwise it will use the Vi defaults. (Note: This doesn't
|
||||
happen for the system-wide vimrc or gvimrc file). Also see
|
||||
|compatible-default| and |posix-compliance|.
|
||||
You can also set this option with the "-C" argument, and reset it with
|
||||
"-N". See |-C| and |-N|.
|
||||
Switching this option off makes the Vim defaults be used for options
|
||||
@@ -1577,46 +1607,106 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'completefunc' 'cfu' string (default: empty)
|
||||
local to buffer
|
||||
{not in Vi}
|
||||
This option specifies a completion function to be used for CTRL-X
|
||||
CTRL-X. The function will be invoked with four arguments:
|
||||
a:line the text of the current line
|
||||
a:base the text with which matches should match
|
||||
a:col column in a:line where the cursor is, first column is
|
||||
zero
|
||||
a:findstart either 1 or 0
|
||||
When the a:findstart argument is 1, the function must return the
|
||||
column of where the completion starts. It must be a number between
|
||||
zero and "a:col". This involves looking at the characters in a:line
|
||||
before column a:col and include those characters that could be part of
|
||||
the completed item.
|
||||
When the a:findstart argument is 0 the function must return a string
|
||||
with the matching words, separated by newlines. When there are no
|
||||
matches return an empty string.
|
||||
{not available when compiled without the +eval
|
||||
or +insert_expand feature}
|
||||
This option specifies a function to be used for Insert mode completion
|
||||
with CTRL-X CTRL-U. |i_CTRL-X_CTRL-U|
|
||||
|
||||
The function will be invoked with two arguments. First the function
|
||||
is called to find the start of the text to be completed. Secondly the
|
||||
function is called to actually find the matches.
|
||||
|
||||
On the first invocation the arguments are:
|
||||
a:findstart 1
|
||||
a:base empty
|
||||
|
||||
The function must return the column of where the completion starts.
|
||||
It must be a number between zero and the cursor column "col('.')".
|
||||
This involves looking at the characters just before the cursor and
|
||||
including those characters that could be part of the completed item.
|
||||
The text between this column and the cursor column will be replaced
|
||||
with the matches. Return -1 if no completion can be done.
|
||||
|
||||
On the second invocation the arguments are:
|
||||
a:findstart 0
|
||||
a:base the text with which matches should match, what was
|
||||
located in the first call (can be empty)
|
||||
|
||||
The function must return a List with the matching words. These
|
||||
matches usually include the "a:base" text. When there are no matches
|
||||
return an empty List.
|
||||
|
||||
When searching for matches takes some time call |complete_add()| to
|
||||
add each match to the total list. These matches should then not
|
||||
appear in the returned list! Call |complete_check()| now and then to
|
||||
allow the user to press a key while still searching for matches. Stop
|
||||
searching when it returns non-zero.
|
||||
|
||||
The function may move the cursor, it is restored afterwards.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
An example that completes the names of the months: >
|
||||
fun! CompleteMonths(line, base, col, findstart)
|
||||
fun! CompleteMonths(findstart, base)
|
||||
if a:findstart
|
||||
" locate start column of word
|
||||
let start = a:col
|
||||
while start > 0 && a:line[start - 1] =~ '\a'
|
||||
let start = start - 1
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
while start > 0 && line[start - 1] =~ '\a'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
" find months matching with "a:base"
|
||||
let res = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"
|
||||
if a:base != ''
|
||||
let res = substitute(res, '\c\<\(\(' . a:base . '.\{-}\>\)\|.\{-}\>\)', '\2', 'g')
|
||||
endif
|
||||
let res = substitute(res, ' \+', "\n", 'g')
|
||||
let res = []
|
||||
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
|
||||
if m =~ '^' . a:base
|
||||
call add(res, m)
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
endif
|
||||
endfun
|
||||
set completefunc=CompleteMonths
|
||||
< Note that a substitute() function is used to reduce the list of
|
||||
possible values and remove the ones that don't match the base. The
|
||||
part before the "\|" matches the base, the part after it is used
|
||||
when there is no match. The "\2" in the replacement is empty if the
|
||||
part before the "\|" does not match.
|
||||
<
|
||||
The same, but now pretending searching for matches is slow: >
|
||||
fun! CompleteMonths(findstart, base)
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
while start > 0 && line[start - 1] =~ '\a'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
" find months matching with "a:base"
|
||||
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
|
||||
if m =~ '^' . a:base
|
||||
call complete_add(m)
|
||||
endif
|
||||
sleep 300m " simulate searching for next match
|
||||
if complete_check()
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return []
|
||||
endif
|
||||
endfun
|
||||
set completefunc=CompleteMonths
|
||||
<
|
||||
|
||||
*'completeopt'* *'cot'*
|
||||
'completeopt' 'cot' string (default: "menu")
|
||||
global
|
||||
{not in Vi}
|
||||
Options for Insert mode completion |ins-completion|.
|
||||
Currently the only supported value is:
|
||||
|
||||
menu Use a popup menu to show the possible completions. The
|
||||
menu is only shown when there is more than one match and
|
||||
sufficient colors are available. |ins-completion-menu|
|
||||
|
||||
|
||||
*'confirm'* *'cf'* *'noconfirm'* *'nocf'*
|
||||
'confirm' 'cf' boolean (default off)
|
||||
@@ -1740,7 +1830,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
F When included, a ":write" command with a file name
|
||||
argument will set the file name for the current
|
||||
buffer, if the current buffer doesn't have a file name
|
||||
yet.
|
||||
yet. Also see |cpo-P|.
|
||||
*cpo-g*
|
||||
g Goto line 1 when using ":edit" without argument.
|
||||
*cpo-H*
|
||||
@@ -1809,6 +1899,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*cpo-p*
|
||||
p Vi compatible Lisp indenting. When not present, a
|
||||
slightly better algorithm is used.
|
||||
*cpo-P*
|
||||
P When included, a ":write" command that appends to a
|
||||
file will set the file name for the current buffer, if
|
||||
the current buffer doesn't have a file name yet and
|
||||
the 'F' flag is also included |cpo-F|.
|
||||
*cpo-q*
|
||||
q When joining multiple lines leave the cursor at the
|
||||
position where it would be when joining two lines.
|
||||
@@ -1898,11 +1993,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
C-indenting.
|
||||
*cpo--*
|
||||
- When included, a vertical movement command fails when
|
||||
it would above the first line or below the last line.
|
||||
Without it the cursor moves to the first or last line,
|
||||
unless it already was in that line.
|
||||
it would go above the first line or below the last
|
||||
line. Without it the cursor moves to the first or
|
||||
last line, unless it already was in that line.
|
||||
Applies to the commands "-", "k", CTRL-P, "+", "j",
|
||||
CTRL-N and CTRL-J.
|
||||
CTRL-N, CTRL-J and ":1234".
|
||||
*cpo-+*
|
||||
+ When included, a ":write file" command will reset the
|
||||
'modified' flag of the buffer, even though the buffer
|
||||
@@ -1935,9 +2030,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*cpo-\*
|
||||
\ Backslash in a [] range in a search pattern is taken
|
||||
literally, only "\]" is special See |/[]|
|
||||
'l' included: "/[ \t]" finds <Space>, '\' and 't'
|
||||
'l' excluded: "/[ \t]" finds <Space> and <Tab>
|
||||
Also see |cpo-\|.
|
||||
'\' included: "/[ \-]" finds <Space>, '\' and '-'
|
||||
'\' excluded: "/[ \-]" finds <Space> and '-'
|
||||
Also see |cpo-l|.
|
||||
*cpo-/*
|
||||
/ When "%" is used as the replacement string in a |:s|
|
||||
command, use the previous replacement string. |:s%|
|
||||
@@ -2161,10 +2256,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
- A directory starting with "./" (or ".\" for MS-DOS et al.) means to
|
||||
put the swap file relative to where the edited file is. The leading
|
||||
"." is replaced with the path name of the edited file.
|
||||
- For Unix and Win32, if a directory ends in two path separators, the
|
||||
swap file name will be built from the complete path to the file
|
||||
with all path separators substituted to percent '%' signs. This will
|
||||
ensure file name uniqueness in the preserve directory.
|
||||
- For Unix and Win32, if a directory ends in two path separators "//"
|
||||
or "\\", the swap file name will be built from the complete path to
|
||||
the file with all path separators substituted to percent '%' signs.
|
||||
This will ensure file name uniqueness in the preserve directory.
|
||||
- Spaces after the comma are ignored, other spaces are considered part
|
||||
of the directory name. To have a space at the start of a directory
|
||||
name, precede it with a backslash.
|
||||
@@ -2276,8 +2371,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
setting 'encoding' to one of these values instead of utf-8 only has
|
||||
effect for encoding used for files when 'fileencoding' is empty.
|
||||
|
||||
When 'encoding' is set to a Unicode encoding, and 'fileencodings' was
|
||||
not set yet, the default for 'fileencodings' is changed.
|
||||
When 'encoding' is set to a Unicode encoding, and 'fileencodings' was
|
||||
not set yet, the default for 'fileencodings' is changed.
|
||||
|
||||
*'endofline'* *'eol'* *'noendofline'* *'noeol'*
|
||||
'endofline' 'eol' boolean (default on)
|
||||
@@ -2461,7 +2556,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'encoding' is "utf-8" (or one of the other Unicode variants)
|
||||
conversion is most likely done in a way that the reverse
|
||||
conversion results in the same text. When 'encoding' is not
|
||||
"utf-8" special characters may be lost!
|
||||
"utf-8" some non-ASCII characters may be lost! You can use
|
||||
the |++bad| argument to specify what is done with characters
|
||||
that can't be converted.
|
||||
For an empty file or a file with only ASCII characters most encodings
|
||||
will work and the first entry of 'fileencodings' will be used (except
|
||||
"ucs-bom", which requires the BOM to be present). If you prefer
|
||||
@@ -2471,7 +2568,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
\ set fenc=iso-2022-jp | endif
|
||||
< This sets 'fileencoding' to "iso-2022-jp" if the file does not contain
|
||||
non-blank characters.
|
||||
Note that 'fileencodings' is not used for an new file, 'fileencoding'
|
||||
When the |++enc| argument is used then the value of 'fileencodings' is
|
||||
not used.
|
||||
Note that 'fileencodings' is not used for a new file, 'fileencoding'
|
||||
is always empty then. This means that a non-existing file may get a
|
||||
different encoding than an empty file.
|
||||
The special value "ucs-bom" can be used to check for a Unicode BOM
|
||||
@@ -2683,8 +2782,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{not available when compiled without the |+folding|
|
||||
or |+eval| feature}
|
||||
The expression used for when 'foldmethod' is "expr". It is evaluated
|
||||
for each line to obtain its fold level. See |fold-expr|. Also see
|
||||
|eval-sandbox|.
|
||||
for each line to obtain its fold level. See |fold-expr|.
|
||||
|
||||
The expression may be evaluated in the |sandbox|, see
|
||||
|sandbox-option|.
|
||||
|
||||
It is not allowed to change text or jump to another window while
|
||||
evaluating 'foldexpr' |textlock|.
|
||||
|
||||
*'foldignore'* *'fdi'*
|
||||
'foldignore' 'fdi' string (default: "#")
|
||||
@@ -2816,6 +2920,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
An expression which is used to specify the text displayed for a closed
|
||||
fold. See |fold-foldtext|.
|
||||
|
||||
The expression may be evaluated in the |sandbox|, see
|
||||
|sandbox-option|.
|
||||
|
||||
It is not allowed to change text or jump to another window while
|
||||
evaluating 'foldtext' |textlock|.
|
||||
|
||||
*'formatoptions'* *'fo'*
|
||||
'formatoptions' 'fo' string (Vim default: "tcq", Vi default: "vt")
|
||||
local to buffer
|
||||
@@ -2850,10 +2960,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The name of an external program that will be used to format the lines
|
||||
selected with the "gq" command. The program must take the input on
|
||||
stdin and produce the output on stdout. The Unix program "fmt" is
|
||||
such a program. If this option is an empty string, the internal
|
||||
format function will be used |C-indenting|. Environment variables are
|
||||
expanded |:set_env|. See |option-backslash| about including spaces
|
||||
and backslashes.
|
||||
such a program.
|
||||
If this option is an empty string, the internal format function will
|
||||
be used |C-indenting|.
|
||||
Environment variables are expanded |:set_env|. See |option-backslash|
|
||||
about including spaces and backslashes.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
@@ -3316,7 +3427,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
t:Title,v:Visual,w:WarningMsg,W:WildMenu,
|
||||
f:Folded,F:FoldColumn,A:DiffAdd,
|
||||
C:DiffChange,D:DiffDelete,T:DiffText,
|
||||
>:SignColumn")
|
||||
>:SignColumn,B:SpellBad,P:SpellCap,
|
||||
R:SpellRare,L:SpellLocal,
|
||||
+:Pmenu,=:PmenuSel,
|
||||
x:PmenuSbar,X:PmenuThumb")
|
||||
global
|
||||
{not in Vi}
|
||||
This option can be used to set highlighting mode for various
|
||||
@@ -3348,10 +3462,19 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|hl-WildMenu| W wildcard matches displayed for 'wildmenu'
|
||||
|hl-Folded| f line used for closed folds
|
||||
|hl-FoldColumn| F 'foldcolumn'
|
||||
|hl-DiffAdd| A added line in diff mode
|
||||
|hl-DiffChange| C changed line in diff mode
|
||||
|hl-DiffDelete| D deleted line in diff mode
|
||||
|hl-DiffText| T inserted text in diff mode
|
||||
|hl-SignColumn| > column used for |signs|
|
||||
|hl-SpellBad| B misspelled word |spell|
|
||||
|hl-SpellCap| P word that should start with capital|spell|
|
||||
|hl-SpellRare| R rare word |spell|
|
||||
|hl-SpellLocal| L word from other region |spell|
|
||||
|hl-Pmenu| + popup menu normal line
|
||||
|hl-PmenuSel| = popup menu normal line
|
||||
|hl-PmenuSbar| x popup menu scrollbar
|
||||
|hl-PmenuThumb| X popup menu scrollbar thumb
|
||||
|
||||
The display modes are:
|
||||
r reverse (termcap entry "mr" and "me")
|
||||
@@ -3576,9 +3699,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Pattern to be used to find an include command. It is a search
|
||||
pattern, just like for the "/" command (See |pattern|). The default
|
||||
value is for C programs. This option is used for the commands "[i",
|
||||
"]I", "[d", etc. The 'isfname' option is used to recognize the file
|
||||
name that comes after the matched pattern. See |option-backslash|
|
||||
about including spaces and backslashes.
|
||||
"]I", "[d", etc.
|
||||
Normally the 'isfname' option is used to recognize the file name that
|
||||
comes after the matched pattern. But if "\zs" appears in the pattern
|
||||
then the text matched from "\zs" to the end, or until "\ze" if it
|
||||
appears, is used as the file name. Use this to include characters
|
||||
that are not in 'isfname', such as a space. You can then use
|
||||
'includeexpr' to process the matched text.
|
||||
See |option-backslash| about including spaces and backslashes.
|
||||
|
||||
*'includeexpr'* *'inex'*
|
||||
'includeexpr' 'inex' string (default "")
|
||||
@@ -3590,11 +3718,17 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
option to a file name. Mostly useful to change "." to "/" for Java: >
|
||||
:set includeexpr=substitute(v:fname,'\\.','/','g')
|
||||
< The "v:fname" variable will be set to the file name that was detected.
|
||||
Evaluated in the |sandbox|.
|
||||
|
||||
Also used for the |gf| command if an unmodified file name can't be
|
||||
found. Allows doing "gf" on the name after an 'include' statement.
|
||||
Also used for |<cfile>|.
|
||||
|
||||
The expression may be evaluated in the |sandbox|, see
|
||||
|sandbox-option|.
|
||||
|
||||
It is not allowed to change text or jump to another window while
|
||||
evaluating 'includeexpr' |textlock|.
|
||||
|
||||
*'incsearch'* *'is'* *'noincsearch'* *'nois'*
|
||||
'incsearch' 'is' boolean (default off)
|
||||
global
|
||||
@@ -3626,7 +3760,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'smartindent' indenting.
|
||||
When 'paste' is set this option is not used for indenting.
|
||||
The expression is evaluated with |v:lnum| set to the line number for
|
||||
which the indent is to be computed. The cursor is also as this line
|
||||
which the indent is to be computed. The cursor is also in this line
|
||||
when the expression is evaluated (but it may be moved around).
|
||||
The expression must return the number of spaces worth of indent. It
|
||||
can return "-1" to keep the current indent (this means 'autoindent' is
|
||||
@@ -3640,9 +3774,16 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
:set indentexpr=GetMyIndent()
|
||||
< Error messages will be suppressed, unless the 'debug' option contains
|
||||
"msg".
|
||||
See |indent-expression|. Also see |eval-sandbox|.
|
||||
See |indent-expression|.
|
||||
NOTE: This option is made empty when 'compatible' is set.
|
||||
|
||||
The expression may be evaluated in the |sandbox|, see
|
||||
|sandbox-option|.
|
||||
|
||||
It is not allowed to change text or jump to another window while
|
||||
evaluating 'indentexpr' |textlock|.
|
||||
|
||||
|
||||
*'indentkeys'* *'indk'*
|
||||
'indentkeys' 'indk' string (default "0{,0},:,0#,!^F,o,O,e")
|
||||
local to buffer
|
||||
@@ -3677,9 +3818,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
- Use CTRL-O to execute one Normal mode command |i_CTRL-O|). When
|
||||
this is a mapping, it is executed as if 'insertmode' was off.
|
||||
Normal mode remains active until the mapping is finished.
|
||||
*i_CTRL-L*
|
||||
- Use CTRL-L to execute a number of Normal mode commands, then use
|
||||
<Esc> to get back to Insert mode.
|
||||
<Esc> to get back to Insert mode. Note that CTRL-L moves the cursor
|
||||
left, like <Esc> does when 'insertmode' isn't set. |i_CTRL-L|
|
||||
|
||||
These items change when 'insertmode' is set:
|
||||
- when starting to edit of a file, Vim goes to Insert mode.
|
||||
@@ -3995,7 +4136,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Vim limits the number of lines to what fits on the screen. You can
|
||||
use this command to get the tallest window possible: >
|
||||
:set lines=999
|
||||
< If you get less lines than expected, check the 'guiheadroom' option.
|
||||
< Minimum value is 2, maximum value is 1000.
|
||||
If you get less lines than expected, check the 'guiheadroom' option.
|
||||
When you set this option and Vim is unable to change the physical
|
||||
number of lines of the display, the display may be messed up.
|
||||
|
||||
@@ -4229,6 +4371,45 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
generated from a list of items, e.g., the Buffers menu. Changing this
|
||||
option has no direct effect, the menu must be refreshed first.
|
||||
|
||||
*'mkspellmem'* *'msm'*
|
||||
'mkspellmem' 'msm' string (default "460000,2000,500")
|
||||
global
|
||||
{not in Vi}
|
||||
{not available when compiled without the |+syntax|
|
||||
feature}
|
||||
Parameters for |:mkspell|. This tunes when to start compressing the
|
||||
word tree. Compression can be slow when there are many words, but
|
||||
it's needed to avoid running out of memory. The amount of memory used
|
||||
per word depends very much on how similar the words are, that's why
|
||||
this tuning is complicated.
|
||||
|
||||
There are three numbers, separated by commas:
|
||||
{start},{inc},{added}
|
||||
|
||||
For most languages the uncompressed word tree fits in memory. {start}
|
||||
gives the amount of memory in Kbyte that can be used before any
|
||||
compression is done. It should be a bit smaller than the amount of
|
||||
memory that is available to Vim.
|
||||
|
||||
When going over the {start} limit the {inc} number specifies the
|
||||
amount of memory in Kbyte that can be allocated before another
|
||||
compression is done. A low number means compression is done after
|
||||
less words are added, which is slow. A high number means more memory
|
||||
will be allocated.
|
||||
|
||||
After doing compression, {added} times 1024 words can be added before
|
||||
the {inc} limit is ignored and compression is done when any extra
|
||||
amount of memory is needed. A low number means there is a smaller
|
||||
chance of hitting the {inc} limit, less memory is used but it's
|
||||
slower.
|
||||
|
||||
The languages for which these numbers are important are Italian and
|
||||
Hungarian. The default works for when you have about 512 Mbyte. If
|
||||
you have 1 Gbyte you could use: >
|
||||
:set mkspellmem=900000,3000,800
|
||||
< If you have less than 512 Mbyte |:mkspell| may fail for some
|
||||
languages, no matter what you set 'mkspellmem' to.
|
||||
|
||||
*'modeline'* *'ml'* *'nomodeline'* *'noml'*
|
||||
'modeline' 'ml' boolean (Vim default: on, Vi default: off)
|
||||
local to buffer
|
||||
@@ -4451,12 +4632,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
This defines what bases Vim will consider for numbers when using the
|
||||
CTRL-A and CTRL-X commands for adding to and subtracting from a number
|
||||
respectively; see |CTRL-A| for more info on these commands.
|
||||
alpha if included, single alphabetical characters will be
|
||||
alpha If included, single alphabetical characters will be
|
||||
incremented or decremented. This is useful for a list with a
|
||||
letter index a), b), etc.
|
||||
octal if included, numbers that start with a zero will be considered
|
||||
octal If included, numbers that start with a zero will be considered
|
||||
to be octal. Example: Using CTRL-A on "007" results in "010".
|
||||
hex if included, numbers starting with "0x" or "0X" will be
|
||||
hex If included, numbers starting with "0x" or "0X" will be
|
||||
considered to be hexadecimal. Example: Using CTRL-X on
|
||||
"0x100" results in "0x0ff".
|
||||
Numbers which simply begin with a digit in the range 1-9 are always
|
||||
@@ -4492,6 +4673,28 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The minimum value is 1, the maximum value is 10.
|
||||
NOTE: 'numberwidth' is reset to 8 when 'compatible' is set.
|
||||
|
||||
*'omnifunc'* *'ofu'*
|
||||
'omnifunc' 'ofu' string (default: empty)
|
||||
local to buffer
|
||||
{not in Vi}
|
||||
{not available when compiled without the +eval
|
||||
or +insert_expand feature}
|
||||
This option specifies a function to be used for Insert mode omni
|
||||
completion with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O|
|
||||
For the use of the function see 'completefunc'.
|
||||
|
||||
|
||||
*'operatorfunc'* *'opfunc'*
|
||||
'operatorfunc' 'opfunc' string (default: empty)
|
||||
global
|
||||
{not in Vi}
|
||||
This option specifies a function to be called by the |g@| operator.
|
||||
See |:map-operator| for more info and an example.
|
||||
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
|
||||
*'osfiletype'* *'oft'* *E366*
|
||||
'osfiletype' 'oft' string (RISC-OS default: "Text",
|
||||
others default: "")
|
||||
@@ -5038,6 +5241,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Minimal number of lines to scroll when the cursor gets off the
|
||||
screen (e.g., with "j"). Not used for scroll commands (e.g., CTRL-E,
|
||||
CTRL-D). Useful if your terminal scrolls very slowly.
|
||||
When set to a negative number from -1 to -100 this is used as the
|
||||
percentage of the window height. Thus -50 scrolls half the window
|
||||
height.
|
||||
NOTE: This option is set to 1 when 'compatible' is set.
|
||||
|
||||
*'scrolloff'* *'so'*
|
||||
@@ -5535,13 +5741,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
{not in Vi}
|
||||
The minimal number of screen columns to keep to the left and to the
|
||||
right of the cursor if 'nowrap' is set. Setting this option to a value
|
||||
greater than 0 while having |'sidescroll'| also at a non-zero value
|
||||
makes some context visible in the line you are scrolling in
|
||||
horizontally (except at the end and beginning of the line). Setting
|
||||
this option to a large value (like 999) has the effect of keeping the
|
||||
cursor horizontally centered in the window, as long as one does not
|
||||
come too close to the beginning or end of the line.
|
||||
right of the cursor if 'nowrap' is set. Setting this option to a
|
||||
value greater than 0 while having |'sidescroll'| also at a non-zero
|
||||
value makes some context visible in the line you are scrolling in
|
||||
horizontally (except at beginning of the line). Setting this option
|
||||
to a large value (like 999) has the effect of keeping the cursor
|
||||
horizontally centered in the window, as long as one does not come too
|
||||
close to the beginning of the line.
|
||||
NOTE: This option is set to 0 when 'compatible' is set.
|
||||
|
||||
Example: Try this together with 'sidescroll' and 'listchars' as
|
||||
@@ -5633,6 +5839,22 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When on spell checking will be done. See |spell|.
|
||||
The languages are specified with 'spelllang'.
|
||||
|
||||
*'spellcapcheck'* *'spc'*
|
||||
'spellcapcheck' 'spc' string (default "[.?!]\_[\])'" \t]\+")
|
||||
local to buffer
|
||||
{not in Vi}
|
||||
{not available when compiled without the |+syntax|
|
||||
feature}
|
||||
Pattern to locate the end of a sentence. The following word will be
|
||||
checked to start with a capital letter. If not then it is highlighted
|
||||
with SpellCap |hl-SpellCap| (unless the word is also badly spelled).
|
||||
When this check is not wanted make this option empty.
|
||||
Only used when 'spell' is set.
|
||||
Be careful with special characters, see |option-backslash| about
|
||||
including spaces and backslashes.
|
||||
To set this option automatically depending on the language, see
|
||||
|set-spc-auto|.
|
||||
|
||||
*'spellfile'* *'spf'*
|
||||
'spellfile' 'spf' string (default empty)
|
||||
local to buffer
|
||||
@@ -5640,10 +5862,24 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{not available when compiled without the |+syntax|
|
||||
feature}
|
||||
Name of the word list file where words are added for the |zg| and |zw|
|
||||
commands. It must end in ".add".
|
||||
commands. It must end in ".{encoding}.add". You need to include the
|
||||
path, otherwise the file is placed in the current directory.
|
||||
*E765*
|
||||
It may also be a comma separated list of names. A count before the
|
||||
|zg| and |zw| commands can be used to access each. This allows using
|
||||
a personal word list file and a project word list file.
|
||||
When a word is added while this option is empty Vim will set it for
|
||||
you: Using the first "spell" directory in 'runtimepath' that is
|
||||
writable and the first language name that appears in 'spelllang'.
|
||||
writable and the first language name that appears in 'spelllang',
|
||||
ignoring the region.
|
||||
The resulting ".spl" file will be used for spell checking, it does not
|
||||
have to appear in 'spelllang'.
|
||||
Normally one file is used for all regions, but you can add the region
|
||||
name if you want to. However, it will then only be used when
|
||||
'spellfile' is set to it, for entries in 'spelllang' only files
|
||||
without region name will be found.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'spelllang'* *'spl'*
|
||||
'spelllang' 'spl' string (default "en")
|
||||
@@ -5651,14 +5887,96 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{not in Vi}
|
||||
{not available when compiled without the |+syntax|
|
||||
feature}
|
||||
A comma separated list of languages. when the 'spell' option is on
|
||||
spellchecking will be done for these languages. Example: >
|
||||
set spelllang=en_us,nl
|
||||
< This means both US English and Dutch words are recognized. Words that
|
||||
are not recognized will be highlighted.
|
||||
A comma separated list of word list names. When the 'spell' option is
|
||||
on spellchecking will be done for these languages. Example: >
|
||||
set spelllang=en_us,nl,medical
|
||||
< This means US English, Dutch and medical words are recognized. Words
|
||||
that are not recognized will be highlighted.
|
||||
The word list name must not include a comma or dot. Using a dash is
|
||||
recommended to separate the two letter language name from a
|
||||
specification. Thus "en-rare" is used for rare English words.
|
||||
A region name must come last and have the form "_xx", where "xx" is
|
||||
the two-letter, lower case region name. You can use more than one
|
||||
region by listing them: "en_us,en_ca" supports both US and Canadian
|
||||
English, but not words specific for Australia, New Zealand or Great
|
||||
Britain.
|
||||
*E757*
|
||||
As a special case the name of a .spl file can be given as-is. The
|
||||
first "_xx" in the name is removed and used as the region name
|
||||
(_xx is an underscore, two letters and followed by a non-letter).
|
||||
This is mainly for testing purposes. You must make sure the correct
|
||||
encoding is used, Vim doesn't check it.
|
||||
When 'encoding' is set the word lists are reloaded. Thus it's a good
|
||||
idea to set 'spelllang' after setting 'encoding'.
|
||||
More info at |spell|.
|
||||
idea to set 'spelllang' after setting 'encoding' to avoid loading the
|
||||
files twice.
|
||||
How the related spell files are found is explained here: |spell-load|.
|
||||
|
||||
After this option has been set successfully, Vim will source the files
|
||||
"spell/LANG.vim" in 'runtimepath'. "LANG" is the value of 'spelllang'
|
||||
up to the first comma, dot or underscore. See |set-spc-auto|.
|
||||
|
||||
|
||||
*'spellsuggest'* *'sps'*
|
||||
'spellsuggest' 'sps' string (default "best")
|
||||
global
|
||||
{not in Vi}
|
||||
{not available when compiled without the |+syntax|
|
||||
feature}
|
||||
Methods used for spelling suggestions. Both for the |z=| command and
|
||||
the |spellsuggest()| function. This is a comma-separated list of
|
||||
items:
|
||||
|
||||
best Internal method that works best for English. Finds
|
||||
changes like "fast" and uses a bit of sound-a-like
|
||||
scoring to improve the ordering.
|
||||
|
||||
double Internal method that uses two methods and mixes the
|
||||
results. The first method is "fast", the other method
|
||||
computes how much the suggestion sounds like the bad
|
||||
word. That only works when the language specifies
|
||||
sound folding. Can be slow and doesn't always give
|
||||
better results.
|
||||
|
||||
fast Internal method that only checks for simple changes:
|
||||
character inserts/deletes/swaps. Works well for
|
||||
simple typing mistakes.
|
||||
|
||||
{number} The maximum number of suggestions listed for |z=|.
|
||||
Not used for |spellsuggest()|. The number of
|
||||
suggestions is never more than the value of 'lines'
|
||||
minus two.
|
||||
|
||||
file:{filename} Read file {filename}, which must have two columns,
|
||||
separated by a slash. The first column contains the
|
||||
bad word, the second column the suggested good word.
|
||||
Example:
|
||||
theribal/terrible ~
|
||||
Use this for common mistakes that do not appear at the
|
||||
top of the suggestion list with the internal methods.
|
||||
Lines without a slash are ignored, use this for
|
||||
comments.
|
||||
The file is used for all languages.
|
||||
|
||||
expr:{expr} Evaluate expression {expr}. Use a function to avoid
|
||||
trouble with spaces. |v:val| holds the badly spelled
|
||||
word. The expression must evaluate to a List of
|
||||
Lists, each with a suggestion and a score.
|
||||
Example:
|
||||
[['the', 33], ['that', 44]]
|
||||
Set 'verbose' and use |z=| to see the scores that the
|
||||
internal methods use. A lower score is better.
|
||||
This may invoke |spellsuggest()| if you temporarily
|
||||
set 'spellsuggest' to exclude the "expr:" part.
|
||||
Errors are silently ignored, unless you set the
|
||||
'verbose' option to a non-zero value.
|
||||
|
||||
Only one of "best", "double" or "fast" may be used. The others may
|
||||
appear several times in any order. Example: >
|
||||
:set sps=file:~/.vim/sugg,best,expr:MySuggest()
|
||||
<
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
|
||||
*'splitbelow'* *'sb'* *'nosplitbelow'* *'nosb'*
|
||||
'splitbelow' 'sb' boolean (default off)
|
||||
@@ -5767,6 +6085,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
a S Argument list status as in default title. ({current} of {max})
|
||||
Empty if the argument file count is zero or one.
|
||||
{ NF Evaluate expression between '{' and '}' and substitute result.
|
||||
Note that there is no '%' before the closing '}'.
|
||||
( - Start of item group. Can be used for setting the width and
|
||||
alignment of a section. Must be followed by %) somewhere.
|
||||
) - End of item group. No width fields allowed.
|
||||
@@ -5800,7 +6119,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
temporarily to that of the window (and buffer) whose statusline is
|
||||
currently being drawn. The expression will evaluate in this context.
|
||||
The variable "actual_curbuf" is set to the 'bufnr()' number of the
|
||||
real current buffer. The expression is evaluated in the |sandbox|.
|
||||
real current buffer.
|
||||
|
||||
The 'statusline' option may be evaluated in the |sandbox|, see
|
||||
|sandbox-option|.
|
||||
|
||||
It is not allowed to change text or jump to another window while
|
||||
evaluating 'statusline' |textlock|.
|
||||
|
||||
If the statusline is not updated when you want it (e.g., after setting
|
||||
a variable that's used in an expression), you can force an update by
|
||||
@@ -5911,6 +6236,19 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
a buffer. Otherwise: do not split, use current window.
|
||||
Supported in |quickfix| commands that display errors.
|
||||
|
||||
*'synmaxcol'* *'smc'*
|
||||
'synmaxcol' 'smc' number (default 3000)
|
||||
local to buffer
|
||||
{not in Vi}
|
||||
{not available when compiled without the |+syntax|
|
||||
feature}
|
||||
Maximum column in which to search for syntax items. In long lines the
|
||||
text after this column is not highlighted and following lines may not
|
||||
be highlighted correctly, because the syntax state is cleared.
|
||||
This helps to avoid very slow redrawing for an XML file that is one
|
||||
long line.
|
||||
Set to zero to remove the limit.
|
||||
|
||||
*'syntax'* *'syn'*
|
||||
'syntax' 'syn' string (default empty)
|
||||
local to buffer
|
||||
@@ -5922,7 +6260,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Otherwise this option does not always reflect the current syntax (the
|
||||
b:current_syntax variable does).
|
||||
This option is most useful in a modeline, for a file which syntax is
|
||||
not automatically recognized. Example, for in an IDL file: >
|
||||
not automatically recognized. Example, in an IDL file: >
|
||||
/* vim: set syntax=idl : */
|
||||
< To switch off syntax highlighting for the current file, use: >
|
||||
:set syntax=OFF
|
||||
@@ -6036,6 +6374,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
"*", "**" and other wildcards can be used to search for tags files in
|
||||
a directory tree. See |file-searching|. {not available when compiled
|
||||
without the |+path_extra| feature}
|
||||
The |tagfiles()| function can be used to get a list of the file names
|
||||
actually used.
|
||||
If Vim was compiled with the |+emacs_tags| feature, Emacs-style tag
|
||||
files are also supported. They are automatically recognized. The
|
||||
default value becomes "./tags,./TAGS,tags,TAGS", unless case
|
||||
@@ -7062,7 +7402,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'wrapscan'* *'ws'* *'nowrapscan'* *'nows'*
|
||||
'wrapscan' 'ws' boolean (default on) *E384* *E385*
|
||||
global
|
||||
Searches wrap around the end of the file.
|
||||
Searches wrap around the end of the file. Also applies to |]s| and
|
||||
|[s|, searching for spelling mistakes.
|
||||
|
||||
*'write'* *'nowrite'*
|
||||
'write' boolean (default on)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*os_vms.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
|
||||
*os_vms.txt* For Vim version 7.0aa. Last change: 2005 Jul 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL
|
||||
@@ -47,16 +47,19 @@ You can download precompiled executables from:
|
||||
|
||||
To use the precompiled binary version, you need one of these archives:
|
||||
|
||||
vim-XX-exe-alpha-gui.zip Alpha GUI/Motif executables
|
||||
vim-XX-exe-alpha-gtk.zip Alpha GUI/GTK executables
|
||||
vim-XX-exe-alpha-term.zip Alpha console executables
|
||||
vim-XX-exe-ia64-gui.zip IA64 GUI/Motif executables
|
||||
vim-XX-exe-ia64-gtk.zip IA64 GUI/GTK executables
|
||||
vim-XX-exe-ia64-term.zip IA64 console executables
|
||||
vim-XX-exe-axp-gui.zip Alpha GUI/Motif executables
|
||||
vim-XX-exe-axp-gtk.zip Alpha GUI/GTK executables
|
||||
vim-XX-exe-axp-term.zip Alpha console executables
|
||||
vim-XX-exe-vax-gui.zip VAX GUI executables
|
||||
vim-XX-exe-vax-term.zip VAX console executables
|
||||
|
||||
and of course
|
||||
vim-XX-runtime.zip runtime files
|
||||
|
||||
The binary archives contain: vim.exe, ctags.exe, xxd.exe, mms_vim.exe files.
|
||||
The binary archives contain: vim.exe, ctags.exe, xxd.exe files.
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -68,8 +71,8 @@ See the file [.SRC]INSTALLVMS.TXT.
|
||||
|
||||
4. Problems *vms-problems*
|
||||
|
||||
The code has been tested under Open VMS 6.2 - 7.3 on Alpha and VAX platforms
|
||||
with the DEC C compiler. It should work without bigger problems.
|
||||
The code has been tested under Open VMS 6.2 - 8.2 on Alpha, VAX and IA64
|
||||
platforms with the DEC C compiler. It should work without bigger problems.
|
||||
If your system does not have some include libraries you can tune up in
|
||||
OS_VMS_CONF.H file.
|
||||
|
||||
@@ -78,6 +81,8 @@ to download OpenVMS distributions of Perl and Python. Build and deploy the
|
||||
libraries and change adequate lines in MAKE_VMS.MMS file. There should not be
|
||||
a problem from Vim side.
|
||||
|
||||
Also GTK, XPM library paths should be configured in MAKE_VMS.MMS
|
||||
|
||||
Note: Under VAX it should work with the DEC C compiler without problems. The
|
||||
VAX C compiler is not fully ANSI C compatible in pre-processor directives
|
||||
semantics, therefore you have to use a converter program what will do the lion
|
||||
@@ -250,7 +255,7 @@ you will get errors that some shareable libraries are missing.
|
||||
|
||||
Third: If you choose to run Vim with extra features such as GUI/GTK then you
|
||||
need a GTK installation too or at least a GTK runtime environment (LIBGTK
|
||||
etc.).
|
||||
can be downloaded from http://www.polarhome.com/vim/).
|
||||
|
||||
1) If you are working on the VMS X/Motif console:
|
||||
Start Vim with the command: >
|
||||
@@ -648,6 +653,17 @@ start it with: >
|
||||
|
||||
9. VMS related changes *vms-changes*
|
||||
|
||||
Version 7.0
|
||||
- GTKLIB and Vim build on IA64
|
||||
- colors in terminal mode
|
||||
- syntax highlighting in terminal mode
|
||||
- write problem fixed (extra CR)
|
||||
- ESC and ESC sequence recognition in terminal mode
|
||||
- make file changed to support new MMS version
|
||||
- env variable expansion in path corrected
|
||||
- printing problems corrected
|
||||
- help text added for case insensitive arguments
|
||||
|
||||
Version 6.3 (2004 May 10)
|
||||
- Improved vms_read function
|
||||
- CTAGS v5.5.4 included
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*pattern.txt* For Vim version 7.0aa. Last change: 2005 May 22
|
||||
*pattern.txt* For Vim version 7.0aa. Last change: 2006 Jan 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -117,6 +117,14 @@ gD Goto global Declaration. When the cursor is on a
|
||||
like "gd", except that the search for the keyword
|
||||
always starts in line 1. {not in Vi}
|
||||
|
||||
*1gd*
|
||||
1gd Like "gd", but ignore matches inside a {} block that
|
||||
ends before the cursor position. {not in Vi}
|
||||
|
||||
*1gD*
|
||||
1gD Like "gD", but ignore matches inside a {} block that
|
||||
ends before the cursor position. {not in Vi}
|
||||
|
||||
*CTRL-C*
|
||||
CTRL-C Interrupt current (search) command. Use CTRL-Break on
|
||||
MS-DOS |dos-CTRL-Break|.
|
||||
@@ -248,9 +256,13 @@ switched off by setting the 's' flag in the 'shortmess' option. The highlight
|
||||
method 'w' is used for this message (default: standout).
|
||||
|
||||
*search-range*
|
||||
You cannot limit the search command "/" to a certain range of lines. A trick
|
||||
to do this anyway is to use the ":substitute" command with the 'c' flag.
|
||||
Example: >
|
||||
You can limit the search command "/" to a certain range of lines by including
|
||||
\%>l items. For example, to match the word "limit" below line 199 and above
|
||||
line 300: >
|
||||
/\%>199l\%<300llimit
|
||||
Also see |/\%>l|.
|
||||
|
||||
Another way is to use the ":substitute" command with the 'c' flag. Example: >
|
||||
:.,300s/Pattern//gc
|
||||
This command will search from the cursor position until line 300 for
|
||||
"Pattern". At the match, you will be asked to type a character. Type 'q' to
|
||||
@@ -382,7 +394,9 @@ More explanation and examples below, follow the links.
|
||||
|/\ze| \ze \ze anything, sets end of match
|
||||
|/\%^| \%^ \%^ beginning of file |/zero-width| *E71*
|
||||
|/\%$| \%$ \%$ end of file |/zero-width|
|
||||
|/\%V| \%V \%V inside Visual area |/zero-width|
|
||||
|/\%#| \%# \%# cursor position |/zero-width|
|
||||
|/\%'m| \%'m \%'m mark m position |/zero-width|
|
||||
|/\%l| \%23l \%23l in line 23 |/zero-width|
|
||||
|/\%c| \%23c \%23c in column 23 |/zero-width|
|
||||
|/\%v| \%23v \%23v in virtual column 23 |/zero-width|
|
||||
@@ -776,6 +790,11 @@ $ At end of pattern or in front of "\|" or "\)" ("|" or ")" after "\v"):
|
||||
position after the first "VIM".
|
||||
Searching from the end of the file backwards is easier!
|
||||
|
||||
*/\%V*
|
||||
\%V Match inside the Visual area. When Visual mode has already been
|
||||
stopped match in the area that |gv| would reselect.
|
||||
Only works for the current buffer.
|
||||
|
||||
*/\%#* *cursor-position*
|
||||
\%# Matches with the cursor position. Only works when matching in a
|
||||
buffer displayed in a window. {not in Vi}
|
||||
@@ -790,10 +809,24 @@ $ At end of pattern or in front of "\|" or "\)" ("|" or ")" after "\v"):
|
||||
< When 'hlsearch' is set and you move the cursor around and make changes
|
||||
this will clearly show when the match is updated or not.
|
||||
|
||||
*/\%'m* */\%<'m* */\%>'m*
|
||||
\%'m Matches with the position of mark m.
|
||||
\%<'m Matches before the position of mark m.
|
||||
\%>'m Matches after the position of mark m.
|
||||
Example, to highlight the text from mark 's to 'e: >
|
||||
/.\%>'s.*\%<'e..
|
||||
< Note that two dots are required to include mark 'e in the match. That
|
||||
is because "\%<'e" matches at the character before the 'e mark, and
|
||||
since it's a |/zero-width| match it doesn't include that character.
|
||||
{not in Vi}
|
||||
WARNING: When the mark is moved after the pattern was used, the result
|
||||
becomes invalid. Vim doesn't automatically update the matches.
|
||||
Similar to moving the cursor for |\%#|.
|
||||
|
||||
*/\%l* */\%>l* */\%<l*
|
||||
\%23l Matches in a specific line.
|
||||
\%<23l Matches above a specific line.
|
||||
\%>23l Matches below a specific line.
|
||||
\%<23l Matches above a specific line (lower line number).
|
||||
\%>23l Matches below a specific line (higher line number).
|
||||
These three can be used to match specific lines in a buffer. The "23"
|
||||
can be any line number. The first line is 1. {not in Vi}
|
||||
WARNING: When inserting or deleting lines Vim does not automatically
|
||||
@@ -943,6 +976,10 @@ x A single character, with no special meaning, matches itself
|
||||
"\_[^ab]" matches the end-of-line and any character but "a" and "b".
|
||||
This makes it Vi compatible: Without the "\_" or "\n" the collection
|
||||
does not match an end-of-line.
|
||||
*E769*
|
||||
When the ']' is not there Vim will not give an error message but
|
||||
assume no collection is used. Useful to search for '['. However, you
|
||||
do get E769 for internal searching.
|
||||
|
||||
If the sequence begins with "^", it matches any single character NOT
|
||||
in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
*pi_spec.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
|
||||
*pi_spec.txt* For Vim version 7.0aa. Last change: 2005 Oct 03
|
||||
|
||||
by Gustavo Niemeyer ~
|
||||
|
||||
@@ -26,13 +26,13 @@ your maplocalleader key (default is '\') plus 'c'. If you do not have
|
||||
|spec_chglog_format| set, the plugin will ask you for an email address
|
||||
to use in this edit session.
|
||||
|
||||
Everytime you run the plugin, it will check to see if the last entry
|
||||
in the changelog has been written today and by you. If it's the entry
|
||||
mathes, it will just insert a new changelog item, otherwise it will
|
||||
create a new changelog entry. If you are running with
|
||||
|spec_chglog_release_info| enabled, it will also check if the name, version
|
||||
and release matches. The plugin is smart enough to ask you if it should
|
||||
update the package release, if you have not done so.
|
||||
Every time you run the plugin, it will check to see if the last entry in the
|
||||
changelog has been written today and by you. If the entry matches, it will
|
||||
just insert a new changelog item, otherwise it will create a new changelog
|
||||
entry. If you are running with |spec_chglog_release_info| enabled, it will
|
||||
also check if the name, version and release matches. The plugin is smart
|
||||
enough to ask you if it should update the package release, if you have not
|
||||
done so.
|
||||
|
||||
Setting a map *spec-setting-a-map*
|
||||
-------------
|
||||
|
||||
40
runtime/doc/pi_tar.txt
Normal file
40
runtime/doc/pi_tar.txt
Normal file
@@ -0,0 +1,40 @@
|
||||
*tar.txt* Tar File Interface Dec 21, 2005
|
||||
|
||||
Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
|
||||
(remove NOSPAM from Campbell's email first)
|
||||
Copyright: The GPL (gnu public license) applies to *tar-copyright*
|
||||
tarPlugin.vim, and pi_tar.txt.
|
||||
No warranty, express or implied. Use At-Your-Own-Risk.
|
||||
|
||||
==============================================================================
|
||||
1. Contents *tar* *tar-contents*
|
||||
1. Contents..................................................|tar-contents|
|
||||
2. Usage.....................................................|tar-usage|
|
||||
3. History...................................................|tar-history|
|
||||
|
||||
==============================================================================
|
||||
2. Usage *tar-usage* *tar-manual*
|
||||
|
||||
When one edits a *.tar file, this plugin will handle displaying a
|
||||
contents page. Select a file to edit by moving the cursor atop
|
||||
the desired file, then hit the <return> key. After editing, one may
|
||||
also write to the file. Currently, one may not make a new file in
|
||||
tar archives via the plugin.
|
||||
|
||||
==============================================================================
|
||||
3. History *tar-history*
|
||||
v6 Dec 21, 2005 * writing to files not in directories caused problems -
|
||||
fixed (pointed out by Christian Robinson)
|
||||
v5 Nov 22, 2005 * report option workaround installed
|
||||
v3 Sep 16, 2005 * handles writing files in an archive back to the
|
||||
archive
|
||||
Oct 18, 2005 * <amatch> used instead of <afile> in autocmds
|
||||
Oct 18, 2005 * handles writing to compressed archives
|
||||
Nov 03, 2005 * handles writing tarfiles across a network using
|
||||
netrw#NetWrite()
|
||||
v2 * converted to use Vim7's new autoload feature by
|
||||
Bram Moolenaar
|
||||
v1 (original) * Michael Toren (see http://michael.toren.net/code/)
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help
|
||||
44
runtime/doc/pi_zip.txt
Normal file
44
runtime/doc/pi_zip.txt
Normal file
@@ -0,0 +1,44 @@
|
||||
*zip.txt* Zip File Interface Nov 28, 2005
|
||||
|
||||
Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
|
||||
(remove NOSPAM from Campbell's email first)
|
||||
Copyright: Copyright (C) 2005 Charles E. Campbell, Jr. {{{1 *zip-copyright*
|
||||
Permission is hereby granted to use and distribute this code,
|
||||
with or without modifications, provided that this copyright
|
||||
notice is copied with it. Like anything else that's free,
|
||||
zip.vim, zipPlugin.vim, and pi_zip.txt are provided *as is*
|
||||
and it comes with no warranty of any kind, either expressed or
|
||||
implied. By using this plugin, you agree that in no event will
|
||||
the copyright holder be liable for any damages resulting from
|
||||
the use of this software.
|
||||
|
||||
==============================================================================
|
||||
1. Contents *zip* *zip-contents*
|
||||
1. Contents..................................................|zip-contents|
|
||||
2. Usage.....................................................|zip-usage|
|
||||
3. History...................................................|zip-history|
|
||||
|
||||
==============================================================================
|
||||
2. Usage *zip-usage* *zip-manual*
|
||||
|
||||
When one edits a *.zip file, this plugin will handle displaying a
|
||||
contents page. Select a file to edit by moving the cursor atop
|
||||
the desired file, then hit the <return> key. After editing, one may
|
||||
also write to the file. Currently, one may not make a new file in
|
||||
zip archives via the plugin.
|
||||
|
||||
==============================================================================
|
||||
3. History *zip-history*
|
||||
v6 Dec 21, 2005 * writing to files not in directories caused problems -
|
||||
fixed (pointed out by Christian Robinson)
|
||||
v5 Nov 22, 2005 * report option workaround installed
|
||||
v3 Oct 18, 2005 * <amatch> used instead of <afile> in autocmds
|
||||
v2 Sep 16, 2005 * silenced some commands (avoiding hit-enter prompt)
|
||||
* began testing under Windows; works thus far
|
||||
* filetype detection fixed
|
||||
Nov 03, 2005 * handles writing zipfiles across a network using
|
||||
netrw#NetWrite()
|
||||
v1 Sep 15, 2005 * Initial release, had browsing, reading, and writing
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 7.0aa. Last change: 2005 May 20
|
||||
*quickfix.txt* For Vim version 7.0aa. Last change: 2006 Jan 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -42,6 +42,13 @@ easy way to do this is with the |:make| command (see below). The
|
||||
'errorformat' option should be set to match the error messages from your
|
||||
compiler (see |errorformat| below).
|
||||
|
||||
*location-list* *E776*
|
||||
A location list is a window-local quickfix list. Each window can have a
|
||||
separate location list. A location list can be associated with only one
|
||||
window. When a window with a location list is split, the new window gets a
|
||||
copy of the location list. When there are no references to a location list,
|
||||
the location list is destroyed.
|
||||
|
||||
The following quickfix commands can be used:
|
||||
|
||||
*:cc*
|
||||
@@ -56,18 +63,32 @@ The following quickfix commands can be used:
|
||||
The 'switchbuf' settings are respected when jumping
|
||||
to a buffer.
|
||||
|
||||
*:ll*
|
||||
:ll[!] [nr] Same as ":cc", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:cn* *:cnext* *E553*
|
||||
:[count]cn[ext][!] Display the [count] next error in the list that
|
||||
includes a file name. If there are no file names at
|
||||
all, go to the [count] next error. See |:cc| for
|
||||
[!] and 'switchbuf'.
|
||||
|
||||
*:ln* *:lnext*
|
||||
:[count]ln[ext][!] Same as ":cnext", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
:[count]cN[ext][!] *:cp* *:cprevious* *:cN* *:cNext*
|
||||
:[count]cp[revious][!] Display the [count] previous error in the list that
|
||||
includes a file name. If there are no file names at
|
||||
all, go to the [count] previous error. See |:cc| for
|
||||
[!] and 'switchbuf'.
|
||||
|
||||
*:lp* *:lprevious* *:lN* *:lNext*
|
||||
:[count]lN[ext][!]
|
||||
:[count]lp[revious][!] Same as ":cNext" and ":cprevious", except the location
|
||||
list for the current window is used instead of the
|
||||
quickfix list.
|
||||
|
||||
*:cnf* *:cnfile*
|
||||
:[count]cnf[ile][!] Display the first error in the [count] next file in
|
||||
the list that includes a file name. If there are no
|
||||
@@ -75,6 +96,10 @@ The following quickfix commands can be used:
|
||||
the [count] next error. See |:cc| for [!] and
|
||||
'switchbuf'.
|
||||
|
||||
*:lnf* *:lnfile*
|
||||
:[count]lnf[ile][!] Same as ":cnfile", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
:[count]cNf[ile][!] *:cpf* *:cpfile* *:cNf* *:cNfile*
|
||||
:[count]cpf[ile][!] Display the last error in the [count] previous file in
|
||||
the list that includes a file name. If there are no
|
||||
@@ -82,17 +107,34 @@ The following quickfix commands can be used:
|
||||
the [count] previous error. See |:cc| for [!] and
|
||||
'switchbuf'.
|
||||
|
||||
*:lpf* *:lpfile* *:lNf* *:lNfile*
|
||||
:[count]lNf[ile][!]
|
||||
:[count]lpf[ile][!] Same as ":cNfile" and ":cpfile", except the location
|
||||
list for the current window is used instead of the
|
||||
quickfix list.
|
||||
|
||||
*:crewind* *:cr*
|
||||
:cr[ewind][!] [nr] Display error [nr]. If [nr] is omitted, the FIRST
|
||||
error is displayed. See |:cc|.
|
||||
|
||||
*:lrewind* *:lr*
|
||||
:lr[ewind][!] [nr] Same as ":crewind", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:cfirst* *:cfir*
|
||||
:cfir[st][!] [nr] Same as ":crewind".
|
||||
|
||||
*:lfirst* *:lfir*
|
||||
:lfir[st][!] [nr] Same as ":lrewind".
|
||||
|
||||
*:clast* *:cla*
|
||||
:cla[st][!] [nr] Display error [nr]. If [nr] is omitted, the LAST
|
||||
error is displayed. See |:cc|.
|
||||
|
||||
*:llast* *:lla*
|
||||
:lla[st][!] [nr] Same as ":clast", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:cq* *:cquit*
|
||||
:cq[uit] Quit Vim with an error code, so that the compiler
|
||||
will not compile the same file again.
|
||||
@@ -105,11 +147,31 @@ The following quickfix commands can be used:
|
||||
name of the errorfile, the 'errorfile' option will
|
||||
be set to [errorfile]. See |:cc| for [!].
|
||||
|
||||
*:lf* *:lfile*
|
||||
:lf[ile][!] [errorfile] Same as ":cfile", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
You can not use the -q command-line option to set
|
||||
the location list.
|
||||
|
||||
*:cg* *:cgetfile*
|
||||
:cg[etfile][!] [errorfile]
|
||||
Read the error file. Just like ":cfile" but don't
|
||||
jump to the first error.
|
||||
|
||||
*:lg* *:lgetfile*
|
||||
:lg[etfile][!] [errorfile]
|
||||
Same as ":cgetfile", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:caddf* *:caddfile*
|
||||
:caddf[ile] [errorfile] Read the error file and add the errors from the
|
||||
errorfile to the current quickfix list. If a quickfix
|
||||
list is not present, then a new list is created.
|
||||
|
||||
*:laddf* *:laddfile*
|
||||
:laddf[ile] [errorfile] Same as ":caddfile", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:cb* *:cbuffer* *E681*
|
||||
:cb[uffer] [bufnr] Read the error list from the current buffer.
|
||||
When [bufnr] is given it must be the number of a
|
||||
@@ -118,6 +180,41 @@ The following quickfix commands can be used:
|
||||
A range can be specified for the lines to be used.
|
||||
Otherwise all lines in the buffer are used.
|
||||
|
||||
*:lb* *:lbuffer*
|
||||
:lb[uffer] [bufnr] Same as ":cbuffer", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:cex* *:cexpr* *E777*
|
||||
:cex[pr][!] {expr} Create a quickfix list using the result of {expr} and
|
||||
jump to the first error. If {expr} is a String, then
|
||||
each new-line terminated line in the String is
|
||||
processed using 'errorformat' and the result is added
|
||||
to the quickfix list. If {expr} is a List, then each
|
||||
String item in the list is processed and added to the
|
||||
quickfix list. Non String items in the List are
|
||||
ignored. See |:cc|
|
||||
for [!].
|
||||
Examples: >
|
||||
:cexpr system('grep -n xyz *')
|
||||
:cexpr getline(1, '$')
|
||||
<
|
||||
*:lex* *:lexpr*
|
||||
:lex[pr][!] {expr} Same as ":cexpr", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:cad* *:caddexpr*
|
||||
:cad[dexpr][!] {expr} Evaluate {expr} and add the resulting lines to the
|
||||
current quickfix list. If a quickfix list is not
|
||||
present, then a new list is created. The current
|
||||
cursor position will not be changed. See |:cexpr| for
|
||||
more information.
|
||||
Example: >
|
||||
:g/mypattern/caddexpr expand("%") . ":" . line(".") . ":" . getline(".")
|
||||
<
|
||||
*:lad* *:laddexpr*
|
||||
:lad[dexpr][!] {expr} Same as ":caddexpr", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:cl* *:clist*
|
||||
:cl[ist] [from] [, [to]]
|
||||
List all errors that are valid |quickfix-valid|.
|
||||
@@ -130,6 +227,15 @@ The following quickfix commands can be used:
|
||||
:cl[ist]! [from] [, [to]]
|
||||
List all errors.
|
||||
|
||||
*:lli* *:llist*
|
||||
:lli[st] [from] [, [to]]
|
||||
Same as ":clist", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
:lli[st]! [from] [, [to]]
|
||||
List all the entries in the location list for the
|
||||
current window.
|
||||
|
||||
If you insert or delete lines, mostly the correct error location is still
|
||||
found because hidden marks are used. Sometimes, when the mark has been
|
||||
deleted for some reason, the message "line changed" is shown to warn you that
|
||||
@@ -154,14 +260,28 @@ on) is executed. See |QuickFixCmdPre| and |QuickFixCmdPost| for details.
|
||||
the current window. It is not possible to open a
|
||||
second quickfix window.
|
||||
|
||||
*:lope* *:lopen*
|
||||
:lope[n] [height] Open a window to show the location list for the
|
||||
current window. Works only when the location list for
|
||||
the current window is present. You can have more than
|
||||
one location window opened at a time. Otherewise,
|
||||
same as ":copen".
|
||||
|
||||
*:ccl* *:cclose*
|
||||
:ccl[ose] Close the quickfix window.
|
||||
|
||||
*:lcl* *:lclose*
|
||||
:lcl[ose] Close the window showing the location list for the
|
||||
current window.
|
||||
|
||||
*:cw* *:cwindow*
|
||||
:cw[indow] [height] Open the quickfix window when there are recognized
|
||||
errors. If the window is already open and there are
|
||||
no recognized errors, close the window.
|
||||
|
||||
*:lw* *:lwindow*
|
||||
:lw[indow] [height] Same as ":cwindow", except use the window showing the
|
||||
location list for the current window.
|
||||
|
||||
Normally the quickfix window is at the bottom of the screen. If there are
|
||||
vertical splits, it's at the bottom of the rightmost column of windows. To
|
||||
@@ -200,6 +320,19 @@ errors. 'modifiable' is off to avoid making changes. If you delete or insert
|
||||
lines anyway, the relation between the text and the error number is messed up.
|
||||
If you really want to do this, you could write the contents of the quickfix
|
||||
window to a file and use ":cfile" to have it parsed and used as the new error
|
||||
list.
|
||||
|
||||
*location-list-window*
|
||||
The location list window displays the entries in a location list. When
|
||||
opening a location list window, it is created just below the current window
|
||||
and displays the location list for the current window. The location list
|
||||
window is similar to the quickfix window, except that you can have more than
|
||||
one location list window opened at a time.
|
||||
|
||||
When an entry is selected from the location list window, the file is opened in
|
||||
the window with the corresponding location list. If the window is not found,
|
||||
but the file is opened in another window, then cursor is moved to that window.
|
||||
Otherwise a new window is opened. The new window gets a copy of the location
|
||||
list.
|
||||
|
||||
=============================================================================
|
||||
@@ -215,11 +348,19 @@ lists. They set one of the existing error lists as the current one.
|
||||
this [count] times. When already at the oldest error
|
||||
list, an error message is given.
|
||||
|
||||
*:lolder* *:lol*
|
||||
:lol[der] [count] Same as ":colder", except use the location list for
|
||||
the current window instead of the quickfix list.
|
||||
|
||||
*:cnewer* *:cnew* *E381*
|
||||
:cnew[er] [count] Go to newer error list. When [count] is given, do
|
||||
this [count] times. When already at the newest error
|
||||
list, an error message is given.
|
||||
|
||||
*:lnewer* *:lnew*
|
||||
:lnew[er] [count] Same as ":cnewer", except use the location list for
|
||||
the current window instead of the quickfix list.
|
||||
|
||||
When adding a new error list, it becomes the current list.
|
||||
|
||||
When ":colder" has been used and ":make" or ":grep" is used to add a new error
|
||||
@@ -334,6 +475,8 @@ advantages are:
|
||||
Examples: >
|
||||
:vimgrep /an error/ *.c
|
||||
:vimgrep /\<FileName\>/ *.h include/*
|
||||
:vimgrep /myfunc/ **/*.c
|
||||
< For the use of "**" see |starstar-wildcard|.
|
||||
|
||||
:vim[grep][!] {pattern} {file} ...
|
||||
Like above, but instead of enclosing the pattern in a
|
||||
@@ -611,15 +754,13 @@ Basic items
|
||||
%% the single '%' character
|
||||
%s search text (finds a string)
|
||||
|
||||
The "%f" conversion depends on the current 'isfname' setting. "~/" is
|
||||
The "%f" conversion may depend on the current 'isfname' setting. "~/" is
|
||||
expanded to the home directory and environment variables are expanded.
|
||||
|
||||
The "%f" and "%m" conversions have to detect the end of the string. They
|
||||
should be followed by a character that cannot be in the string. Everything
|
||||
up to that character is included in the string. But when the next character
|
||||
is a '%' or a backslash, "%f" will look for any 'isfname' character and "%m"
|
||||
finds anything. If the "%f" or "%m" is at the end, everything up to the end
|
||||
of the line is included.
|
||||
The "%f" and "%m" conversions have to detect the end of the string. This
|
||||
normally happens by matching following characters and items. When nothing is
|
||||
following the rest of the line is matched. If "%f" is followed by a '%' or a
|
||||
backslash, it will look for a sequence of 'isfname' characters.
|
||||
|
||||
On MS-DOS, MS-Windows and OS/2 a leading "C:" will be included in "%f", even
|
||||
when using "%f:". This means that a file name which is a single alphabetical
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
|
||||
*quickref.txt* For Vim version 7.0aa. Last change: 2006 Jan 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -633,6 +633,7 @@ Short explanation of each option: *option-list*
|
||||
|'compatible'| |'cp'| behave Vi-compatible as much as possible
|
||||
|'complete'| |'cpt'| specify how Insert mode completion works
|
||||
|'completefunc'| |'cfu'| function to be used for Insert mode completion
|
||||
|'completeopt'| |'cot'| options for Insert mode completion
|
||||
|'confirm'| |'cf'| ask what to do about unsaved/read-only files
|
||||
|'conskey'| |'consk'| get keys directly from console (MS-DOS only)
|
||||
|'copyindent'| |'ci'| make 'autoindent' use existing indent structure
|
||||
@@ -686,8 +687,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
|
||||
|'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
|
||||
|'fsync'| |'fs'| whether to invoke fsync() after file write
|
||||
|'gdefault'| |'gd'| the ":substitute" flag 'g' is default on
|
||||
|'grepformat'| |'gfm'| format of 'grepprg' output
|
||||
|'grepprg'| |'gp'| program to use for ":grep"
|
||||
@@ -754,6 +757,7 @@ Short explanation of each option: *option-list*
|
||||
|'maxmempattern'| |'mmp'| maximum memory (in Kbyte) used for pattern search
|
||||
|'maxmemtot'| |'mmt'| maximum memory (in Kbyte) used for all buffers
|
||||
|'menuitems'| |'mis'| maximum number of items in a menu
|
||||
|'mkspellmem'| |'msm'| memory used before |:mkspell| compresses the tree
|
||||
|'modeline'| |'ml'| recognize modelines at start or end of file
|
||||
|'modelines'| |'mls'| number of lines checked for modelines
|
||||
|'modifiable'| |'ma'| changes to the text are not possible
|
||||
@@ -769,6 +773,8 @@ Short explanation of each option: *option-list*
|
||||
|'nrformats'| |'nf'| number formats recognized for CTRL-A command
|
||||
|'number'| |'nu'| print the line number in front of each line
|
||||
|'numberwidth'| |'nuw'| number of columns used for the line number
|
||||
|'omnifunc'| |'ofu'| function for filetype-specific completion
|
||||
|'operatorfunc'| |'opfunc'| funtion to be called for |g@| operator
|
||||
|'osfiletype'| |'oft'| operating system-specific filetype information
|
||||
|'paragraphs'| |'para'| nroff macros that separate paragraphs
|
||||
|'paste'| allow pasting text
|
||||
@@ -814,6 +820,7 @@ Short explanation of each option: *option-list*
|
||||
|'shellquote'| |'shq'| quote character(s) for around shell command
|
||||
|'shellredir'| |'srr'| string to put output of filter in a temp file
|
||||
|'shellslash'| |'ssl'| use forward slash for shell file names
|
||||
|'shelltemp'| |'stmp'| whether to use a temp file for shell commands
|
||||
|'shelltype'| |'st'| Amiga: influences how to use a shell
|
||||
|'shellxquote'| |'sxq'| like 'shellquote', but include redirection
|
||||
|'shiftround'| |'sr'| round indent to multiple of shiftwidth
|
||||
@@ -831,6 +838,11 @@ Short explanation of each option: *option-list*
|
||||
|'smartindent'| |'si'| smart autoindenting for C programs
|
||||
|'smarttab'| |'sta'| use 'shiftwidth' when inserting <Tab>
|
||||
|'softtabstop'| |'sts'| number of spaces that <Tab> uses while editing
|
||||
|'spell'| enable spell checking
|
||||
|'spellcapcheck'| |'spc'| pattern to locate end of a sentence
|
||||
|'spellfile'| |'spf'| files where |zg| and |zw| store words
|
||||
|'spelllang'| |'spl'| language(s) to do spell checking for
|
||||
|'spellsuggest'| |'sps'| method(s) used to suggest spelling corrections
|
||||
|'splitbelow'| |'sb'| new window from split is below the current one
|
||||
|'splitright'| |'spr'| new window is put right of the current one
|
||||
|'startofline'| |'sol'| commands move cursor to first blank in line
|
||||
@@ -840,6 +852,7 @@ Short explanation of each option: *option-list*
|
||||
|'swapfile'| |'swf'| whether to use a swapfile for a buffer
|
||||
|'swapsync'| |'sws'| how to sync the swap file
|
||||
|'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
|
||||
|'tagbsearch'| |'tbs'| use binary searching in tags files
|
||||
@@ -875,6 +888,7 @@ Short explanation of each option: *option-list*
|
||||
|'updatecount'| |'uc'| after this many characters flush swap file
|
||||
|'updatetime'| |'ut'| after this many milliseconds flush swap file
|
||||
|'verbose'| |'vbs'| give informative messages
|
||||
|'verbosefile'| |'vfile'| file to write messages in
|
||||
|'viewdir'| |'vdir'| directory where to store files with :mkview
|
||||
|'viewoptions'| |'vop'| specifies what to save for :mkview
|
||||
|'viminfo'| |'vi'| use .viminfo file upon startup and exiting
|
||||
@@ -888,6 +902,7 @@ Short explanation of each option: *option-list*
|
||||
|'wildignore'| |'wig'| files matching these patterns are not completed
|
||||
|'wildmenu'| |'wmnu'| use menu for command line completion
|
||||
|'wildmode'| |'wim'| mode for 'wildchar' command-line expansion
|
||||
|'wildoptions'| |'wop'| specifies how command line completion is done.
|
||||
|'winaltkeys'| |'wak'| when the windows system handles ALT keys
|
||||
|'winheight'| |'wh'| minimum number of lines for the current window
|
||||
|'winfixheight'| |'wfh'| keep window height when opening/closing windows
|
||||
@@ -922,6 +937,13 @@ Short explanation of each option: *option-list*
|
||||
|:cprevious| :cp display the previous error
|
||||
|:clist| :cl list all errors
|
||||
|:cfile| :cf read errors from the file 'errorfile'
|
||||
|:cgetfile| :cg like :cfile but don't jump to the first error
|
||||
|:caddfile| :caddf add errors from the error file to the current
|
||||
quickfix list
|
||||
|:caddexpr| :cad add errors from an expression to the current
|
||||
quickfix list
|
||||
|:cbuffer| :cb read errors from text in a buffer
|
||||
|:cexpr| :cex read errors from an expression
|
||||
|:cquit| :cq quit without writing and return error code (to
|
||||
the compiler)
|
||||
|:make| :make [args] start make, read errors, and jump to first
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*recover.txt* For Vim version 7.0aa. Last change: 2005 Feb 10
|
||||
*recover.txt* For Vim version 7.0aa. Last change: 2005 Dec 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -126,6 +126,28 @@ command:
|
||||
A Vim swap file can be recognized by the first six characters: "b0VIM ".
|
||||
After that comes the version number, e.g., "3.0".
|
||||
|
||||
|
||||
Links and symbolic links ~
|
||||
|
||||
On Unix it is possible to have two names for the same file. This can be done
|
||||
with hard links and with symbolic links (symlinks).
|
||||
|
||||
For hard links Vim does not know the other name of the file. Therefore, the
|
||||
name of the swapfile will be based on the name you used to edit the file.
|
||||
There is no check for editing the same file by the other name too, because Vim
|
||||
cannot find the other swapfile (except for searching all of your harddisk,
|
||||
which would be very slow).
|
||||
|
||||
For symbolic links Vim resolves the links to find the name of the actual file.
|
||||
The swap file name is based on that name. Thus it doesn't matter by what name
|
||||
you edit the file, the swap file name will normally be the same. However,
|
||||
there are exceptions:
|
||||
- When the directory of the actual file is not writable the swapfile is put
|
||||
elsewhere.
|
||||
- When the symbolic links somehow create a loop you get an *E773* error
|
||||
message and the unmodified file name will be used. You won't be able to
|
||||
save your file normally.
|
||||
|
||||
==============================================================================
|
||||
2. Recovery *recovery* *E308* *E311*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
|
||||
*repeat.txt* For Vim version 7.0aa. Last change: 2005 Jun 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -290,7 +290,7 @@ first line has something like ":map <F1> :help^M", where "^M" is a <CR>. If
|
||||
the first line ends in a <CR>, but following ones don't, you will get an error
|
||||
message, because the <CR> from the first lines will be lost.
|
||||
|
||||
Macintosh: Files that are read with ":source" normally have <CR> <EOL>s.
|
||||
Mac Classic: Files that are read with ":source" normally have <CR> <EOL>s.
|
||||
These always work. If you are using a file with <NL> <EOL>s (for example, a
|
||||
file made on Unix), this will be recognized if 'fileformats' is not empty and
|
||||
the first line does not end in a <CR>. Be careful not to use a file with <NL>
|
||||
@@ -515,6 +515,9 @@ DELETING BREAKPOINTS
|
||||
Delete breakpoint {nr}. Use |:breaklist| to see the number of
|
||||
each breakpoint.
|
||||
|
||||
:breakd[el] *
|
||||
Delete all breakpoints.
|
||||
|
||||
:breakd[el] func [lnum] {name}
|
||||
Delete a breakpoint in a function.
|
||||
|
||||
@@ -576,6 +579,11 @@ It is only included when Vim was compiled with "huge" features.
|
||||
this command.
|
||||
|
||||
|
||||
:profd[el] ... *:profd* *:profdel*
|
||||
Stop profiling for the arguments specified. See |:breakdel|
|
||||
for the arguments.
|
||||
|
||||
|
||||
You must always start with a ":profile start fname" command. The resulting
|
||||
file is written when Vim exits. Here is an example of the output, with line
|
||||
numbers prepended for the explanation:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*scroll.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
|
||||
*scroll.txt* For Vim version 7.0aa. Last change: 2005 Dec 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -153,31 +153,39 @@ to the closest character that is on the screen. The value of 'sidescroll' is
|
||||
not used.
|
||||
|
||||
z<Right> or *zl* *z<Right>*
|
||||
zl Scroll the screen [count] characters to the left.
|
||||
This only works when 'wrap' is off. {not in Vi}
|
||||
zl Move the view on the text [count] characters to the
|
||||
right, thus scroll the text [count] characters to the
|
||||
left. This only works when 'wrap' is off. {not in
|
||||
Vi}
|
||||
|
||||
z<Left> or *zh* *z<Left>*
|
||||
zh Scroll the screen [count] characters to the right.
|
||||
This only works when 'wrap' is off. {not in Vi}
|
||||
zh Move the view on the text [count] characters to the
|
||||
left, thus scroll the text [count] characters to the
|
||||
right. This only works when 'wrap' is off. {not in
|
||||
Vi}
|
||||
|
||||
*zL*
|
||||
zL Scroll the screen half a screenwidth to the left.
|
||||
This only works when 'wrap' is off. {not in Vi}
|
||||
zL Move the view on the text half a screenwidth to the
|
||||
right, thus scroll the text half a screenwidth to the
|
||||
left. This only works when 'wrap' is off. {not in
|
||||
Vi}
|
||||
|
||||
*zH*
|
||||
zH Scroll the screen half a screenwidth to the right.
|
||||
This only works when 'wrap' is off. {not in Vi}
|
||||
zH Move the view on the text half a screenwidth to the
|
||||
left, thus scroll the text half a screenwidth to the
|
||||
right. This only works when 'wrap' is off. {not in
|
||||
Vi}
|
||||
|
||||
For the following two commands the cursor is not moved in the text, only the
|
||||
text scrolls on the screen.
|
||||
|
||||
*zs*
|
||||
zs Scroll the screen horizontally to position the cursor
|
||||
zs Scroll the text horizontally to position the cursor
|
||||
at the start (left side) of the screen. This only
|
||||
works when 'wrap' is off. {not in Vi}
|
||||
|
||||
*ze*
|
||||
ze Scroll the screen horizontally to position the cursor
|
||||
ze Scroll the text horizontally to position the cursor
|
||||
at the end (right side) of the screen. This only
|
||||
works when 'wrap' is off. {not in Vi}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
*starting.txt* For Vim version 7.0aa. Last change: 2005 May 31
|
||||
*starting.txt* For Vim version 7.0aa. Last change: 2006 Jan 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -789,17 +789,19 @@ accordingly. Vim proceeds in this order:
|
||||
|
||||
4. Load the plugin scripts. *load-plugins*
|
||||
This does the same as the command: >
|
||||
:runtime! plugin/*.vim
|
||||
:runtime! plugin/**/*.vim
|
||||
< The result is that all directories in the 'runtimepath' option will be
|
||||
searched for the "plugin" sub-directory and all files ending in ".vim"
|
||||
will be sourced (in alphabetical order per directory).
|
||||
will be sourced (in alphabetical order per directory), also in
|
||||
subdirectories.
|
||||
Loading plugins won't be done when:
|
||||
- The 'loadplugins' option was reset in a vimrc file.
|
||||
- The |--noplugin| command line argument is used.
|
||||
- The "-u NONE" command line argument is used |-u|.
|
||||
- When Vim was compiled without the |+eval| feature.
|
||||
Note that using "-c set noloadplugins" doesn't work, because the
|
||||
commands from the command line have not been executed yet.
|
||||
Note that using "-c 'set noloadplugins'" doesn't work, because the
|
||||
commands from the command line have not been executed yet. You can
|
||||
use "--cmd 'set noloadplugins'" |--cmd|.
|
||||
|
||||
5. Set 'shellpipe' and 'shellredir'
|
||||
The 'shellpipe' and 'shellredir' options are set according to the
|
||||
@@ -890,7 +892,8 @@ set, it will be set to 'nocompatible'. This has the side effect of setting or
|
||||
resetting other options (see 'compatible'). But only the options that have
|
||||
not been set or reset will be changed. This has the same effect like the
|
||||
value of 'compatible' had this value when starting Vim. Note that this
|
||||
doesn't happen for the system-wide vimrc file.
|
||||
doesn't happen for the system-wide vimrc file. It does also happen for gvimrc
|
||||
files.
|
||||
|
||||
But there is a side effect of setting or resetting 'compatible' at the moment
|
||||
a .vimrc file is found: Mappings are interpreted the moment they are
|
||||
@@ -1199,6 +1202,13 @@ An example mapping: >
|
||||
:nmap <F2> :wa<Bar>exe "mksession! " . v:this_session<CR>:so ~/sessions/
|
||||
This saves the current Session, and starts off the command to load another.
|
||||
|
||||
The |SessionLoadPost| autocmd event is triggered after a session file is
|
||||
loaded/sourced.
|
||||
*SessionLoad-variable*
|
||||
While the session file is loading the SessionLoad global variable is set to 1.
|
||||
Plugins can use this to postpone some work until the SessionLoadPost event is
|
||||
triggered.
|
||||
|
||||
*:mkvie* *:mkview*
|
||||
:mkvie[w][!] [file] Write a Vim script that restores the contents of the
|
||||
current window.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 7.0aa. Last change: 2005 Jun 03
|
||||
*syntax.txt* For Vim version 7.0aa. Last change: 2006 Jan 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -399,7 +399,7 @@ Go back to the default to use 'number' by deleting the variable: >
|
||||
:unlet html_number_lines
|
||||
|
||||
Closed folds are put in the HTML as they are displayed. If you don't want
|
||||
this, use the "zR" command before invoking 2html, or use: >
|
||||
this, use the |zR| command before invoking 2html, or use: >
|
||||
:let html_ignore_folding = 1
|
||||
|
||||
By default, HTML optimized for old browsers is generated. If you prefer using
|
||||
@@ -426,16 +426,13 @@ To go back to the automatic mechanism, delete the g:html_use_encoding
|
||||
variable: >
|
||||
:unlet html_use_encoding
|
||||
<
|
||||
Closed folds are kept as they are displayed. If you don't want closed folds
|
||||
in the HTML use the |zR| command before converting.
|
||||
|
||||
For diff mode a sequence of more than 3 filler lines is displayed as three
|
||||
lines with the middle line mentioning the total number of inserted lines. If
|
||||
you prefer to see all the inserted lines use: >
|
||||
:let html_whole_filler = 1
|
||||
And to go back to displaying up to three lines again: >
|
||||
:unlet html_whole_filler
|
||||
|
||||
<
|
||||
*convert-to-XML* *convert-to-XHTML*
|
||||
An alternative is to have the script generate XHTML (XML compliant HTML). To
|
||||
do this set the "use_xhtml" variable: >
|
||||
@@ -457,7 +454,7 @@ Unix shell: >
|
||||
for f in *.[ch]; do gvim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" $f; done
|
||||
<
|
||||
|
||||
ABEL *abel.vim* *abel-syntax*
|
||||
ABEL *abel.vim* *ft-abel-syntax*
|
||||
|
||||
ABEL highlighting provides some user-defined options. To enable them, assign
|
||||
any value to the respective variable. Example: >
|
||||
@@ -470,7 +467,7 @@ abel_obsolete_ok obsolete keywords are statements, not errors
|
||||
abel_cpp_comments_illegal do not interpret '//' as inline comment leader
|
||||
|
||||
|
||||
ADA *ada.vim* *ada-syntax*
|
||||
ADA *ada.vim* *ft-ada-syntax*
|
||||
|
||||
This mode is designed for the 1995 edition of Ada ("Ada95"), which
|
||||
includes support for objected-programming, protected types, and so on.
|
||||
@@ -518,7 +515,7 @@ Even on a slow (90Mhz) PC this mode works quickly, but if you find
|
||||
the performance unacceptable, turn on ada_withuse_ordinary.
|
||||
|
||||
|
||||
ANT *ant.vim* *ant-syntax*
|
||||
ANT *ant.vim* *ft-ant-syntax*
|
||||
|
||||
The ant syntax file provides syntax highlighting for javascript and python
|
||||
by default. Syntax highlighting for other script languages can be installed
|
||||
@@ -536,7 +533,7 @@ will install syntax perl highlighting for the following ant code >
|
||||
See |mysyntaxfile-add| for installing script languages permanently.
|
||||
|
||||
|
||||
APACHE *apache.vim* *apache-syntax*
|
||||
APACHE *apache.vim* *ft-apache-syntax*
|
||||
|
||||
The apache syntax file provides syntax highlighting depending on Apache HTTP
|
||||
server version, by default for 1.3.x. Set "apache_version" to Apache version
|
||||
@@ -546,8 +543,8 @@ server version, by default for 1.3.x. Set "apache_version" to Apache version
|
||||
<
|
||||
|
||||
*asm.vim* *asmh8300.vim* *nasm.vim* *masm.vim* *asm68k*
|
||||
ASSEMBLY *asm-syntax* *asmh8300-syntax* *nasm-syntax* *masm-syntax*
|
||||
*asm68k-syntax* *fasm.vim*
|
||||
ASSEMBLY *ft-asm-syntax* *ft-asmh8300-syntax* *ft-nasm-syntax*
|
||||
*ft-masm-syntax* *ft-asm68k-syntax* *fasm.vim*
|
||||
|
||||
Files matching "*.i" could be Progress or Assembly. If the automatic detection
|
||||
doesn't work for you, or you don't edit Progress at all, use this in your
|
||||
@@ -601,7 +598,7 @@ nasm_ctx_outside_macro contexts outside macro not as Error
|
||||
nasm_no_warn potentially risky syntax not as ToDo
|
||||
|
||||
|
||||
ASPPERL and ASPVBS *aspperl-syntax* *aspvbs-syntax*
|
||||
ASPPERL and ASPVBS *ft-aspperl-syntax* *ft-aspvbs-syntax*
|
||||
|
||||
*.asp and *.asa files could be either Perl or Visual Basic script. Since it's
|
||||
hard to detect this you can set two global variables to tell Vim what you are
|
||||
@@ -613,7 +610,7 @@ For Visual Basic use: >
|
||||
:let g:filetype_asp = "aspvbs"
|
||||
|
||||
|
||||
BASIC *basic.vim* *vb.vim* *basic-syntax* *vb-syntax*
|
||||
BASIC *basic.vim* *vb.vim* *ft-basic-syntax* *ft-vb-syntax*
|
||||
|
||||
Both Visual Basic and "normal" basic use the extension ".bas". To detect
|
||||
which one should be used, Vim checks for the string "VB_Name" in the first
|
||||
@@ -622,7 +619,7 @@ otherwise "vb". Files with the ".frm" extension will always be seen as Visual
|
||||
Basic.
|
||||
|
||||
|
||||
C *c.vim* *c-syntax*
|
||||
C *c.vim* *ft-c-syntax*
|
||||
|
||||
A few things in C highlighting are optional. To enable them assign any value
|
||||
to the respective variable. Example: >
|
||||
@@ -689,7 +686,7 @@ an the "after" directory in 'runtimepath'. For Unix this would be
|
||||
syn sync fromstart
|
||||
set foldmethod=syntax
|
||||
|
||||
CH *ch.vim* *ch-syntax*
|
||||
CH *ch.vim* *ft-ch-syntax*
|
||||
|
||||
C/C++ interpreter. Ch has similar syntax highlighting to C and builds upon
|
||||
the C syntax file. See |c.vim| for all the settings that are available for C.
|
||||
@@ -699,7 +696,7 @@ of C or C++: >
|
||||
:let ch_syntax_for_h = 1
|
||||
|
||||
|
||||
CHILL *chill.vim* *chill-syntax*
|
||||
CHILL *chill.vim* *ft-chill-syntax*
|
||||
|
||||
Chill syntax highlighting is similar to C. See |c.vim| for all the settings
|
||||
that are available. Additionally there is:
|
||||
@@ -709,7 +706,7 @@ chill_comment_string like c_comment_strings
|
||||
chill_minlines like c_minlines
|
||||
|
||||
|
||||
CHANGELOG *changelog.vim* *changelog-syntax*
|
||||
CHANGELOG *changelog.vim* *ft-changelog-syntax*
|
||||
|
||||
ChangeLog supports highlighting spaces at the start of a line.
|
||||
If you do not like this, add following line to your .vimrc: >
|
||||
@@ -725,7 +722,7 @@ Or to avoid the highlighting: >
|
||||
This works immediately.
|
||||
|
||||
|
||||
COBOL *cobol.vim* *cobol-syntax*
|
||||
COBOL *cobol.vim* *ft-cobol-syntax*
|
||||
|
||||
COBOL highlighting has different needs for legacy code than it does for fresh
|
||||
development. This is due to differences in what is being done (maintenance
|
||||
@@ -736,7 +733,7 @@ To disable it again, use this: >
|
||||
:unlet cobol_legacy_code
|
||||
|
||||
|
||||
COLD FUSION *coldfusion.vim* *coldfusion-syntax*
|
||||
COLD FUSION *coldfusion.vim* *ft-coldfusion-syntax*
|
||||
|
||||
The ColdFusion has its own version of HTML comments. To turn on ColdFusion
|
||||
comment highlighting, add the following line to your startup file: >
|
||||
@@ -746,7 +743,7 @@ comment highlighting, add the following line to your startup file: >
|
||||
The ColdFusion syntax file is based on the HTML syntax file.
|
||||
|
||||
|
||||
CSH *csh.vim* *csh-syntax*
|
||||
CSH *csh.vim* *ft-csh-syntax*
|
||||
|
||||
This covers the shell named "csh". Note that on some systems tcsh is actually
|
||||
used.
|
||||
@@ -769,7 +766,7 @@ will be classified as tcsh, UNLESS the "filetype_csh" variable exists. If the
|
||||
variable.
|
||||
|
||||
|
||||
CYNLIB *cynlib.vim* *cynlib-syntax*
|
||||
CYNLIB *cynlib.vim* *ft-cynlib-syntax*
|
||||
|
||||
Cynlib files are C++ files that use the Cynlib class library to enable
|
||||
hardware modelling and simulation using C++. Typically Cynlib files have a .cc
|
||||
@@ -789,7 +786,7 @@ To disable these again, use this: >
|
||||
:unlet cynlib_cyntax_for_cpp
|
||||
<
|
||||
|
||||
CWEB *cweb.vim* *cweb-syntax*
|
||||
CWEB *cweb.vim* *ft-cweb-syntax*
|
||||
|
||||
Files matching "*.w" could be Progress or cweb. If the automatic detection
|
||||
doesn't work for you, or you don't edit Progress at all, use this in your
|
||||
@@ -797,7 +794,7 @@ startup vimrc: >
|
||||
:let filetype_w = "cweb"
|
||||
|
||||
|
||||
DESKTOP *desktop.vim* *desktop-syntax*
|
||||
DESKTOP *desktop.vim* *ft-desktop-syntax*
|
||||
|
||||
Primary goal of this syntax file is to highlight .desktop and .directory files
|
||||
according to freedesktop.org standard: http://pdx.freedesktop.org/Standards/
|
||||
@@ -807,7 +804,7 @@ to standard by placing this in your vimrc file: >
|
||||
:let enforce_freedesktop_standard = 1
|
||||
|
||||
|
||||
DIRCOLORS *dircolors.vim* *dircolors-syntax*
|
||||
DIRCOLORS *dircolors.vim* *ft-dircolors-syntax*
|
||||
|
||||
The dircolors utility highlighting definition has one option. It exists to
|
||||
provide compatibility with the Slackware GNU/Linux distributions version of
|
||||
@@ -818,9 +815,9 @@ line to your startup file: >
|
||||
let dircolors_is_slackware = 1
|
||||
|
||||
|
||||
DOCBOOK *docbk.vim* *docbk-syntax* *docbook*
|
||||
DOCBOOK XML *docbkxml.vim* *docbkxml-syntax*
|
||||
DOCBOOK SGML *docbksgml.vim* *docbksgml-syntax*
|
||||
DOCBOOK *docbk.vim* *ft-docbk-syntax* *docbook*
|
||||
DOCBOOK XML *docbkxml.vim* *ft-docbkxml-syntax*
|
||||
DOCBOOK SGML *docbksgml.vim* *ft-docbksgml-syntax*
|
||||
|
||||
There are two types of DocBook files: SGML and XML. To specify what type you
|
||||
are using the "b:docbk_type" variable should be set. Vim does this for you
|
||||
@@ -837,7 +834,7 @@ or: >
|
||||
:set filetype=docbkxml
|
||||
|
||||
|
||||
DOSBATCH *dosbatch.vim* *dosbatch-syntax*
|
||||
DOSBATCH *dosbatch.vim* *ft-dosbatch-syntax*
|
||||
|
||||
There is one option with highlighting DOS batch files. This covers new
|
||||
extensions to the Command Interpreter introduced with Windows 2000 and
|
||||
@@ -860,7 +857,7 @@ If this variable is undefined or zero, btm syntax is selected.
|
||||
|
||||
|
||||
|
||||
DTD *dtd.vim* *dtd-syntax*
|
||||
DTD *dtd.vim* *ft-dtd-syntax*
|
||||
|
||||
The DTD syntax highlighting is case sensitive by default. To disable
|
||||
case-sensitive highlighting, add the following line to your startup file: >
|
||||
@@ -884,7 +881,7 @@ delimiters % and ;. This can be turned off by setting: >
|
||||
The DTD syntax file is also included by xml.vim to highlight included dtd's.
|
||||
|
||||
|
||||
EIFFEL *eiffel.vim* *eiffel-syntax*
|
||||
EIFFEL *eiffel.vim* *ft-eiffel-syntax*
|
||||
|
||||
While Eiffel is not case-sensitive, its style guidelines are, and the
|
||||
syntax highlighting file encourages their use. This also allows to
|
||||
@@ -927,7 +924,7 @@ Finally, some vendors support hexadecimal constants. To handle them, add >
|
||||
to your startup file.
|
||||
|
||||
|
||||
ERLANG *erlang.vim* *erlang-syntax*
|
||||
ERLANG *erlang.vim* *ft-erlang-syntax*
|
||||
|
||||
The erlang highlighting supports Erlang (ERicsson LANGuage).
|
||||
Erlang is case sensitive and default extension is ".erl".
|
||||
@@ -942,7 +939,7 @@ your .vimrc: >
|
||||
:let erlang_characters = 1
|
||||
|
||||
|
||||
FORM *form.vim* *form-syntax*
|
||||
FORM *form.vim* *ft-form-syntax*
|
||||
|
||||
The coloring scheme for syntax elements in the FORM file uses the default
|
||||
modes Conditional, Number, Statement, Comment, PreProc, Type, and String,
|
||||
@@ -976,7 +973,7 @@ gvim display. Here, statements are colored LightYellow instead of Yellow, and
|
||||
conditionals are LightBlue for better distinction.
|
||||
|
||||
|
||||
FORTRAN *fortran.vim* *fortran-syntax*
|
||||
FORTRAN *fortran.vim* *ft-fortran-syntax*
|
||||
|
||||
Default highlighting and dialect ~
|
||||
Highlighting appropriate for f95 (Fortran 95) is used by default. This choice
|
||||
@@ -1117,11 +1114,11 @@ Parenthesis checking does not catch too few closing parentheses. Hollerith
|
||||
strings are not recognized. Some keywords may be highlighted incorrectly
|
||||
because Fortran90 has no reserved words.
|
||||
|
||||
For further information related to fortran, see |fortran-indent| and
|
||||
|fortran-plugin|.
|
||||
For further information related to fortran, see |ft-fortran-indent| and
|
||||
|ft-fortran-plugin|.
|
||||
|
||||
|
||||
FVWM CONFIGURATION FILES *fvwm.vim* *fvwm-syntax*
|
||||
FVWM CONFIGURATION FILES *fvwm.vim* *ft-fvwm-syntax*
|
||||
|
||||
In order for Vim to recognize Fvwm configuration files that do not match
|
||||
the patterns *fvwmrc* or *fvwm2rc* , you must put additional patterns
|
||||
@@ -1145,7 +1142,7 @@ in /usr/X11/lib/X11/, you should add the line >
|
||||
to your .vimrc file.
|
||||
|
||||
|
||||
GSP *gsp.vim*
|
||||
GSP *gsp.vim* *ft-gsp-syntax*
|
||||
|
||||
The default coloring style for GSP pages is defined by |html.vim|, and
|
||||
the coloring for java code (within java tags or inline between backticks)
|
||||
@@ -1168,7 +1165,7 @@ The backticks for inline java are highlighted according to the htmlError
|
||||
group to make them easier to see.
|
||||
|
||||
|
||||
GROFF *groff.vim* *groff-syntax*
|
||||
GROFF *groff.vim* *ft-groff-syntax*
|
||||
|
||||
The groff syntax file is a wrapper for |nroff.vim|, see the notes
|
||||
under that heading for examples of use and configuration. The purpose
|
||||
@@ -1177,7 +1174,7 @@ filetype from a |modeline| or in a personal filetype definitions file
|
||||
(see |filetype.txt|).
|
||||
|
||||
|
||||
HASKELL *haskell.vim* *lhaskell.vim* *haskell-syntax*
|
||||
HASKELL *haskell.vim* *lhaskell.vim* *ft-haskell-syntax*
|
||||
|
||||
The Haskell syntax files support plain Haskell code as well as literate
|
||||
Haskell code, the latter in both Bird style and TeX style. The Haskell
|
||||
@@ -1221,7 +1218,7 @@ set before turning syntax highlighting on for the buffer or
|
||||
loading a file.
|
||||
|
||||
|
||||
HTML *html.vim* *html-syntax*
|
||||
HTML *html.vim* *ft-html-syntax*
|
||||
|
||||
The coloring scheme for tags in the HTML file works as follows.
|
||||
|
||||
@@ -1294,7 +1291,7 @@ Now you just need to make sure that you add all regions that contain
|
||||
the preprocessor language to the cluster htmlPreproc.
|
||||
|
||||
|
||||
HTML/OS (by Aestiva) *htmlos.vim* *htmlos-syntax*
|
||||
HTML/OS (by Aestiva) *htmlos.vim* *ft-htmlos-syntax*
|
||||
|
||||
The coloring scheme for HTML/OS works as follows:
|
||||
|
||||
@@ -1315,7 +1312,7 @@ Lastly, it should be noted that the opening and closing characters to begin a
|
||||
block of HTML/OS code can either be << or [[ and >> or ]], respectively.
|
||||
|
||||
|
||||
IA64 *ia64.vim* *intel-itanium* *ia64-syntax*
|
||||
IA64 *ia64.vim* *intel-itanium* *ft-ia64-syntax*
|
||||
|
||||
Highlighting for the Intel Itanium 64 assembly language. See |asm.vim| for
|
||||
how to recognize this filetype.
|
||||
@@ -1324,7 +1321,7 @@ To have *.inc files be recognized as IA64, add this to your .vimrc file: >
|
||||
:let g:filetype_inc = "ia64"
|
||||
|
||||
|
||||
INFORM *inform.vim* *inform-syntax*
|
||||
INFORM *inform.vim* *ft-inform-syntax*
|
||||
|
||||
Inform highlighting includes symbols provided by the Inform Library, as
|
||||
most programs make extensive use of it. If do not wish Library symbols
|
||||
@@ -1353,7 +1350,7 @@ startup sequence: >
|
||||
:let inform_highlight_old=1
|
||||
|
||||
|
||||
JAVA *java.vim* *java-syntax*
|
||||
JAVA *java.vim* *ft-java-syntax*
|
||||
|
||||
The java.vim syntax highlighting file offers several options:
|
||||
|
||||
@@ -1446,7 +1443,7 @@ displayed line. The default value is 10. The disadvantage of using a larger
|
||||
number is that redrawing can become slow.
|
||||
|
||||
|
||||
LACE *lace.vim* *lace-syntax*
|
||||
LACE *lace.vim* *ft-lace-syntax*
|
||||
|
||||
Lace (Language for Assembly of Classes in Eiffel) is case insensitive, but the
|
||||
style guide lines are not. If you prefer case insensitive highlighting, just
|
||||
@@ -1454,7 +1451,7 @@ define the vim variable 'lace_case_insensitive' in your startup file: >
|
||||
:let lace_case_insensitive=1
|
||||
|
||||
|
||||
LEX *lex.vim* *lex-syntax*
|
||||
LEX *lex.vim* *ft-lex-syntax*
|
||||
|
||||
Lex uses brute-force synchronizing as the "^%%$" section delimiter
|
||||
gives no clue as to what section follows. Consequently, the value for >
|
||||
@@ -1463,7 +1460,26 @@ may be changed by the user if s/he is experiencing synchronization
|
||||
difficulties (such as may happen with large lex files).
|
||||
|
||||
|
||||
LITE *lite.vim* *lite-syntax*
|
||||
LISP *lisp.vim* *ft-lisp-syntax*
|
||||
|
||||
The lisp syntax highlighting provides two options: >
|
||||
|
||||
g:lisp_instring : if it exists, then "(...)" strings are highlighted
|
||||
as if the contents of the string were lisp.
|
||||
Useful for AutoLisp.
|
||||
g:lisp_rainbow : if it exists and is nonzero, then differing levels
|
||||
of parenthesization will receive different
|
||||
highlighting.
|
||||
<
|
||||
The g:lisp_rainbow option provides 10 levels of individual colorization for
|
||||
the parentheses and backquoted parentheses. Because of the quantity of
|
||||
colorization levels, unlike non-rainbow highlighting, the rainbow mode
|
||||
specifies its highlighting using ctermfg and guifg, thereby bypassing the
|
||||
usual colorscheme control using standard highlighting groups. The actual
|
||||
highlighting used depends on the dark/bright setting (see |'bg'|).
|
||||
|
||||
|
||||
LITE *lite.vim* *ft-lite-syntax*
|
||||
|
||||
There are two options for the lite syntax highlighting.
|
||||
|
||||
@@ -1477,7 +1493,7 @@ set "lite_minlines" to the value you desire. Example: >
|
||||
:let lite_minlines = 200
|
||||
|
||||
|
||||
LPC *lpc.vim* *lpc-syntax*
|
||||
LPC *lpc.vim* *ft-lpc-syntax*
|
||||
|
||||
LPC stands for a simple, memory-efficient language: Lars Pensj| C. The
|
||||
file name of LPC is usually *.c. Recognizing these files as LPC would bother
|
||||
@@ -1518,7 +1534,7 @@ uLPC has been developed to Pike, so you should use Pike syntax
|
||||
instead, and the name of your source file should be *.pike
|
||||
|
||||
|
||||
LUA *lua.vim* *lua-syntax*
|
||||
LUA *lua.vim* *ft-lua-syntax*
|
||||
|
||||
This syntax file may be used for Lua 4.0 and Lua 5.0 (default). If you are
|
||||
programming in Lua 4.0, use this: >
|
||||
@@ -1528,7 +1544,7 @@ programming in Lua 4.0, use this: >
|
||||
If lua_version variable doesn't exist, it is set to 5.
|
||||
|
||||
|
||||
MAIL *mail.vim*
|
||||
MAIL *mail.vim* *ft-mail.vim*
|
||||
|
||||
Vim highlights all the standard elements of an email (headers, signatures,
|
||||
quoted text and URLs / email addresses). In keeping with standard conventions,
|
||||
@@ -1546,7 +1562,7 @@ with short headers, you can change this to a smaller value: >
|
||||
:let mail_minlines = 30
|
||||
|
||||
|
||||
MAKE *make.vim* *make-syntax*
|
||||
MAKE *make.vim* *ft-make-syntax*
|
||||
|
||||
In makefiles, commands are usually highlighted to make it easy for you to spot
|
||||
errors. However, this may be too much coloring for you. You can turn this
|
||||
@@ -1555,7 +1571,7 @@ feature off by using: >
|
||||
:let make_no_commands = 1
|
||||
|
||||
|
||||
MAPLE *maple.vim* *maple-syntax*
|
||||
MAPLE *maple.vim* *ft-maple-syntax*
|
||||
|
||||
Maple V, by Waterloo Maple Inc, supports symbolic algebra. The language
|
||||
supports many packages of functions which are selectively loaded by the user.
|
||||
@@ -1580,7 +1596,7 @@ $VIMRUNTIME/syntax/syntax.vim).
|
||||
mv_finance mv_logic mv_powseries
|
||||
|
||||
|
||||
MATHEMATICA *mma.vim* *mma-syntax* *mathematica-syntax*
|
||||
MATHEMATICA *mma.vim* *ft-mma-syntax* *ft-mathematica-syntax*
|
||||
|
||||
Empty *.m files will automatically be presumed to be Matlab files unless you
|
||||
have the following in your .vimrc: >
|
||||
@@ -1588,7 +1604,7 @@ have the following in your .vimrc: >
|
||||
let filetype_m = "mma"
|
||||
|
||||
|
||||
MOO *moo.vim* *moo-syntax*
|
||||
MOO *moo.vim* *ft-moo-syntax*
|
||||
|
||||
If you use C-style comments inside expressions and find it mangles your
|
||||
highlighting, you may want to use extended (slow!) matches for C-style
|
||||
@@ -1624,7 +1640,7 @@ An example of adding sprintf() to the list of known builtin functions: >
|
||||
:syn keyword mooKnownBuiltinFunction sprintf contained
|
||||
|
||||
|
||||
MSQL *msql.vim* *msql-syntax*
|
||||
MSQL *msql.vim* *ft-msql-syntax*
|
||||
|
||||
There are two options for the msql syntax highlighting.
|
||||
|
||||
@@ -1638,7 +1654,7 @@ set "msql_minlines" to the value you desire. Example: >
|
||||
:let msql_minlines = 200
|
||||
|
||||
|
||||
NCF *ncf.vim* *ncf-syntax*
|
||||
NCF *ncf.vim* *ft-ncf-syntax*
|
||||
|
||||
There is one option for NCF syntax highlighting.
|
||||
|
||||
@@ -1650,7 +1666,7 @@ errors, use this: >
|
||||
If you don't want to highlight these errors, leave it unset.
|
||||
|
||||
|
||||
NROFF *nroff.vim* *nroff-syntax*
|
||||
NROFF *nroff.vim* *ft-nroff-syntax*
|
||||
|
||||
The nroff syntax file works with AT&T n/troff out of the box. You need to
|
||||
activate the GNU groff extra features included in the syntax file before you
|
||||
@@ -1721,7 +1737,7 @@ Finally, there is a |groff.vim| syntax file that can be used for enabling
|
||||
groff syntax highlighting either on a file basis or globally by default.
|
||||
|
||||
|
||||
OCAML *ocaml.vim* *ocaml-syntax*
|
||||
OCAML *ocaml.vim* *ft-ocaml-syntax*
|
||||
|
||||
The OCaml syntax file handles files having the following prefixes: .ml,
|
||||
.mli, .mll and .mly. By setting the following variable >
|
||||
@@ -1737,7 +1753,7 @@ prevents highlighting of "end" as error, which is useful when sources
|
||||
contain very long structures that Vim does not synchronize anymore.
|
||||
|
||||
|
||||
PAPP *papp.vim* *papp-syntax*
|
||||
PAPP *papp.vim* *ft-papp-syntax*
|
||||
|
||||
The PApp syntax file handles .papp files and, to a lesser extend, .pxml
|
||||
and .pxsl files which are all a mixture of perl/xml/html/other using xml
|
||||
@@ -1755,7 +1771,7 @@ The newest version of the papp.vim syntax file can usually be found at
|
||||
http://papp.plan9.de.
|
||||
|
||||
|
||||
PASCAL *pascal.vim* *pascal-syntax*
|
||||
PASCAL *pascal.vim* *ft-pascal-syntax*
|
||||
|
||||
Files matching "*.p" could be Progress or Pascal. If the automatic detection
|
||||
doesn't work for you, or you don't edit Progress at all, use this in your
|
||||
@@ -1809,7 +1825,7 @@ will be highlighted as Error. >
|
||||
|
||||
|
||||
|
||||
PERL *perl.vim* *perl-syntax*
|
||||
PERL *perl.vim* *ft-perl-syntax*
|
||||
|
||||
There are a number of possible options to the perl syntax highlighting.
|
||||
|
||||
@@ -1868,8 +1884,15 @@ If you want to fold blocks in if statements, etc. as well set the following: >
|
||||
|
||||
:let perl_fold_blocks = 1
|
||||
|
||||
To avoid folding packages or subs when perl_fold is let, let the appropriate
|
||||
variable(s): >
|
||||
|
||||
PHP3 and PHP4 *php.vim* *php3.vim* *php-syntax* *php3-syntax*
|
||||
:unlet perl_nofold_packages
|
||||
:unlet perl_nofold_subs
|
||||
|
||||
|
||||
|
||||
PHP3 and PHP4 *php.vim* *php3.vim* *ft-php-syntax* *ft-php3-syntax*
|
||||
|
||||
[note: previously this was called "php3", but since it now also supports php4
|
||||
it has been renamed to "php"]
|
||||
@@ -1922,7 +1945,7 @@ x > 0 to sync at least x lines backwards,
|
||||
x = 0 to sync from start.
|
||||
|
||||
|
||||
PPWIZARD *ppwiz.vim* *ppwiz-syntax*
|
||||
PPWIZARD *ppwiz.vim* *ft-ppwiz-syntax*
|
||||
|
||||
PPWizard is a preprocessor for HTML and OS/2 INF files
|
||||
|
||||
@@ -1944,7 +1967,7 @@ This syntax file has the options:
|
||||
HTML code; if 0, treat HTML code like ordinary text.
|
||||
|
||||
|
||||
PHTML *phtml.vim* *phtml-syntax*
|
||||
PHTML *phtml.vim* *ft-phtml-syntax*
|
||||
|
||||
There are two options for the phtml syntax highlighting.
|
||||
|
||||
@@ -1958,7 +1981,7 @@ set "phtml_minlines" to the value you desire. Example: >
|
||||
:let phtml_minlines = 200
|
||||
|
||||
|
||||
POSTSCRIPT *postscr.vim* *postscr-syntax*
|
||||
POSTSCRIPT *postscr.vim* *ft-postscr-syntax*
|
||||
|
||||
There are several options when it comes to highlighting PostScript.
|
||||
|
||||
@@ -2013,8 +2036,8 @@ postscr_andornot_binary as follows: >
|
||||
:let postscr_andornot_binary=1
|
||||
<
|
||||
|
||||
*ptcap.vim*
|
||||
PRINTCAP + TERMCAP *ptcap-syntax* *termcap-syntax* *printcap-syntax*
|
||||
*ptcap.vim* *ft-printcap-syntax*
|
||||
PRINTCAP + TERMCAP *ft-ptcap-syntax* *ft-termcap-syntax*
|
||||
|
||||
This syntax file applies to the printcap and termcap databases.
|
||||
|
||||
@@ -2039,7 +2062,7 @@ internal variable to a larger number: >
|
||||
(The default is 20 lines.)
|
||||
|
||||
|
||||
PROGRESS *progress.vim* *progress-syntax*
|
||||
PROGRESS *progress.vim* *ft-progress-syntax*
|
||||
|
||||
Files matching "*.w" could be Progress or cweb. If the automatic detection
|
||||
doesn't work for you, or you don't edit cweb at all, use this in your
|
||||
@@ -2051,7 +2074,7 @@ Pascal. Use this if you don't use assembly and Pascal: >
|
||||
:let filetype_p = "progress"
|
||||
|
||||
|
||||
PYTHON *python.vim* *python-syntax*
|
||||
PYTHON *python.vim* *ft-python-syntax*
|
||||
|
||||
There are four options to control Python syntax highlighting.
|
||||
|
||||
@@ -2072,7 +2095,7 @@ preceding three options): >
|
||||
:let python_highlight_all = 1
|
||||
|
||||
|
||||
QUAKE *quake.vim* *quake-syntax*
|
||||
QUAKE *quake.vim* *ft-quake-syntax*
|
||||
|
||||
The Quake syntax definition should work for most any FPS (First Person
|
||||
Shooter) based on one of the Quake engines. However, the command names vary
|
||||
@@ -2094,7 +2117,7 @@ Any combination of these three variables is legal, but might highlight more
|
||||
commands than are actually available to you by the game.
|
||||
|
||||
|
||||
READLINE *readline.vim* *readline-syntax*
|
||||
READLINE *readline.vim* *ft-readline-syntax*
|
||||
|
||||
The readline library is primarily used by the BASH shell, which adds quite a
|
||||
few commands and options to the ones already available. To highlight these
|
||||
@@ -2106,7 +2129,7 @@ This will add highlighting for the commands that BASH (version 2.05a and
|
||||
later, and part earlier) adds.
|
||||
|
||||
|
||||
REXX *rexx.vim* *rexx-syntax*
|
||||
REXX *rexx.vim* *ft-rexx-syntax*
|
||||
|
||||
If you notice highlighting errors while scrolling backwards, which are fixed
|
||||
when redrawing with CTRL-L, try setting the "rexx_minlines" internal variable
|
||||
@@ -2117,32 +2140,61 @@ displayed line. The default value is 10. The disadvantage of using a larger
|
||||
number is that redrawing can become slow.
|
||||
|
||||
|
||||
RUBY *ruby.vim* *ruby-syntax*
|
||||
RUBY *ruby.vim* *ft-ruby-syntax*
|
||||
|
||||
There are a few options to the Ruby syntax highlighting.
|
||||
There are a number of options to the Ruby syntax highlighting.
|
||||
|
||||
By default, the "end" keyword is colorized according to the opening statement
|
||||
of the block it closes. While useful, this feature can be expensive: if you
|
||||
of the block it closes. While useful, this feature can be expensive; if you
|
||||
experience slow redrawing (or you are on a terminal with poor color support)
|
||||
you may want to turn it off by defining the "ruby_no_expensive" variable: >
|
||||
|
||||
:let ruby_no_expensive = 1
|
||||
|
||||
In this case the same color will be used for all control keywords.
|
||||
|
||||
If you do want this feature enabled, but notice highlighting errors while
|
||||
scrolling backwards, which are fixed when redrawing with CTRL-L, try setting
|
||||
the "ruby_minlines" variable to a value larger than 50: >
|
||||
|
||||
:let ruby_minlines = 100
|
||||
|
||||
Ideally, this value should be a number of lines large enough to embrace your
|
||||
largest class or module.
|
||||
|
||||
Finally, if you do not like to see too many color items around, you can define
|
||||
Highlighting of special identifiers can be disabled by defining
|
||||
"ruby_no_identifiers": >
|
||||
|
||||
:let ruby_no_identifiers = 1
|
||||
|
||||
This will prevent highlighting of special identifiers like "ConstantName",
|
||||
"$global_var", "@instance_var", "| iterator |", and ":symbol".
|
||||
"$global_var", "@@class_var", "@instance_var", "| block_param |", and
|
||||
":symbol".
|
||||
|
||||
Significant methods of Kernel, Module and Object are highlighted by default.
|
||||
This can be disabled by defining "ruby_no_special_methods": >
|
||||
|
||||
SCHEME *scheme.vim* *scheme-syntax*
|
||||
:let ruby_no_special_methods = 1
|
||||
|
||||
This will prevent highlighting of important methods such as "require", "attr",
|
||||
"private", "raise" and "proc".
|
||||
|
||||
Whitespace errors can be highlighted by defining "ruby_space_errors": >
|
||||
|
||||
:let ruby_space_errors = 1
|
||||
|
||||
This will highlight trailing whitespace and tabs preceded by a space character
|
||||
as errors. This can be refined by defining "ruby_no_trail_space_error" and
|
||||
"ruby_no_tab_space_error" which will ignore trailing whitespace and tabs after
|
||||
spaces respectively.
|
||||
|
||||
Folding can be enabled by defining "ruby_fold": >
|
||||
|
||||
:let ruby_fold = 1
|
||||
|
||||
This will set the 'foldmethod' option to "syntax" and allow folding of
|
||||
classes, modules, methods, code blocks, heredocs and comments.
|
||||
SCHEME *scheme.vim* *ft-scheme-syntax*
|
||||
|
||||
By default only R5RS keywords are highlighted and properly indented.
|
||||
|
||||
@@ -2153,7 +2205,7 @@ Also scheme.vim supports keywords of the Chicken Scheme->C compiler. Define
|
||||
b:is_chicken or g:is_chicken, if you need them.
|
||||
|
||||
|
||||
SDL *sdl.vim* *sdl-syntax*
|
||||
SDL *sdl.vim* *ft-sdl-syntax*
|
||||
|
||||
The SDL highlighting probably misses a few keywords, but SDL has so many
|
||||
of them it's almost impossibly to cope.
|
||||
@@ -2173,7 +2225,7 @@ The indentation is probably also incomplete, but right now I am very
|
||||
satisfied with it for my own projects.
|
||||
|
||||
|
||||
SED *sed.vim* *sed-syntax*
|
||||
SED *sed.vim* *ft-sed-syntax*
|
||||
|
||||
To make tabs stand out from regular blanks (accomplished by using Todo
|
||||
highlighting on the tabs), define "highlight_sedtabs" by putting >
|
||||
@@ -2196,7 +2248,7 @@ Bugs:
|
||||
each plausible pattern delimiter).
|
||||
|
||||
|
||||
SGML *sgml.vim* *sgml-syntax*
|
||||
SGML *sgml.vim* *ft-sgml-syntax*
|
||||
|
||||
The coloring scheme for tags in the SGML file works as follows.
|
||||
|
||||
@@ -2237,7 +2289,7 @@ vimrc file: >
|
||||
(Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>)
|
||||
|
||||
|
||||
SH *sh.vim* *sh-syntax*
|
||||
SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax*
|
||||
|
||||
This covers the "normal" Unix (Bourne) sh, bash and the Korn shell.
|
||||
|
||||
@@ -2288,7 +2340,7 @@ The default is to use the twice sh_minlines. Set it to a smaller number to
|
||||
speed up displaying. The disadvantage is that highlight errors may appear.
|
||||
|
||||
|
||||
SPEEDUP (AspenTech plant simulator) *spup.vim* *spup-syntax*
|
||||
SPEEDUP (AspenTech plant simulator) *spup.vim* *ft-spup-syntax*
|
||||
|
||||
The Speedup syntax file has some options:
|
||||
|
||||
@@ -2320,8 +2372,8 @@ fast enough, you can increase minlines and/or maxlines near the end of
|
||||
the syntax file.
|
||||
|
||||
|
||||
SQL *sql.vim* *sql-syntax*
|
||||
*sqlinformix.vim* *sqlinformix-syntax*
|
||||
SQL *sql.vim* *ft-sql-syntax*
|
||||
*sqlinformix.vim* *ft-sqlinformix-syntax*
|
||||
|
||||
While there is an ANSI standard for SQL, most database engines add their
|
||||
own custom extensions. Vim currently supports the Oracle and Informix
|
||||
@@ -2331,7 +2383,7 @@ If you want to use the Informix dialect, put this in your startup vimrc: >
|
||||
:let g:filetype_sql = "sqlinformix"
|
||||
|
||||
|
||||
TCSH *tcsh.vim* *tcsh-syntax*
|
||||
TCSH *tcsh.vim* *ft-tcsh-syntax*
|
||||
|
||||
This covers the shell named "tcsh". It is a superset of csh. See |csh.vim|
|
||||
for how the filetype is detected.
|
||||
@@ -2353,20 +2405,32 @@ displayed line. The default value is 15. The disadvantage of using a larger
|
||||
number is that redrawing can become slow.
|
||||
|
||||
|
||||
TEX *tex.vim* *tex-syntax*
|
||||
TEX *tex.vim* *ft-tex-syntax*
|
||||
|
||||
*tex-folding*
|
||||
Want Syntax Folding? ~
|
||||
|
||||
As of version 28 of <syntax/tex.vim>, syntax-based folding of parts, chapters,
|
||||
sections, subsections, etc are supported. Put >
|
||||
let g:tex_fold_enabled=1
|
||||
in your <.vimrc>, and :set fdm=syntax. I suggest doing the latter via a
|
||||
modeline at the end of your LaTeX file: >
|
||||
% vim: fdm=syntax
|
||||
<
|
||||
*tex-runon*
|
||||
Run-on Comments/Math? ~
|
||||
|
||||
The tex highlighting supports TeX, LaTeX, and some AmsTeX. The
|
||||
highlighting supports three primary zones: normal, texZone, and texMathZone.
|
||||
Although a considerable effort has been made to have these zones terminate
|
||||
properly, zones delineated by $..$ and $$..$$ cannot be synchronized as
|
||||
there's no difference between start and end patterns. Consequently, a
|
||||
The <syntax/tex.vim> highlighting supports TeX, LaTeX, and some AmsTeX. The
|
||||
highlighting supports three primary zones/regions: normal, texZone, and
|
||||
texMathZone. Although considerable effort has been made to have these zones
|
||||
terminate properly, zones delineated by $..$ and $$..$$ cannot be synchronized
|
||||
as there's no difference between start and end patterns. Consequently, a
|
||||
special "TeX comment" has been provided >
|
||||
%stopzone
|
||||
which will forcibly terminate the highlighting of either a texZone or a
|
||||
texMathZone.
|
||||
|
||||
*tex-slow*
|
||||
Slow Syntax Highlighting? ~
|
||||
|
||||
If you have a slow computer, you may wish to reduce the values for >
|
||||
@@ -2376,6 +2440,7 @@ If you have a slow computer, you may wish to reduce the values for >
|
||||
increase them. This primarily affects synchronizing (i.e. just what group,
|
||||
if any, is the text at the top of the screen supposed to be in?).
|
||||
|
||||
*tex-error*
|
||||
Excessive Error Highlighting? ~
|
||||
|
||||
The <tex.vim> supports lexical error checking of various sorts. Thus,
|
||||
@@ -2383,28 +2448,24 @@ although the error checking is ofttimes very useful, it can indicate
|
||||
errors where none actually are. If this proves to be a problem for you,
|
||||
you may put in your <.vimrc> the following statement: >
|
||||
let tex_no_error=1
|
||||
and all error checking by <tex.vim> will be suppressed.
|
||||
and all error checking by <syntax/tex.vim> will be suppressed.
|
||||
|
||||
*tex-math*
|
||||
Need a new Math Group? ~
|
||||
|
||||
If you want to include a new math group in your LaTeX, the following
|
||||
code shows you an example as to how you might do so: >
|
||||
call TexNewMathZone(sfx,mathzone,starform)
|
||||
You'll want to provide the new math group with a unique suffix
|
||||
(currently, A-L and V-Z are taken by <syntax/tex.vim> itself).
|
||||
As an example, consider how eqnarray is set up by <syntax/tex.vim>: >
|
||||
call TexNewMathZone("D","eqnarray",1)
|
||||
You'll need to change "mathzone" to the name of your new math group,
|
||||
and then to the call to it in .vim/after/syntax/tex.vim.
|
||||
The "starform" variable, if true, implies that your new math group
|
||||
has a starred form (ie. eqnarray*).
|
||||
|
||||
syn cluster texMathZones add=texMathZoneLOCAL
|
||||
syn region texMathZoneLOCAL start="\\begin\s*{\s*LOCALMATH\s*}"
|
||||
\ end="\\end\s*{\s*LOCALMATH\s*}" keepend
|
||||
\ contains=@texMathZoneGroup
|
||||
if !exists("tex_no_math")
|
||||
syn sync match texSyncMathZoneLOCAL grouphere texMathZoneLOCAL
|
||||
\ "\\begin\s*{\s*LOCALMATH\*\s*}"
|
||||
syn sync match texSyncMathZoneLOCAL groupthere NONE
|
||||
\ "\\end\s*{\s*LOCALMATH\*\s*}"
|
||||
endif
|
||||
hi link texMathZoneLOCAL texMath
|
||||
<
|
||||
You'll need to change LOCALMATH to the name of your new math group,
|
||||
and then to put it into .vim/after/syntax/tex.vim.
|
||||
|
||||
*tex-style*
|
||||
Starting a New Style? ~
|
||||
|
||||
One may use "\makeatletter" in *.tex files, thereby making the use of "@" in
|
||||
@@ -2419,7 +2480,7 @@ Putting "let g:tex_stylish=1" into your <.vimrc> will make <syntax/tex.vim>
|
||||
always accept such use of @.
|
||||
|
||||
|
||||
TF *tf.vim* *tf-syntax*
|
||||
TF *tf.vim* *ft-tf-syntax*
|
||||
|
||||
There is one option for the tf syntax highlighting.
|
||||
|
||||
@@ -2429,7 +2490,7 @@ set "tf_minlines" to the value you desire. Example: >
|
||||
:let tf_minlines = your choice
|
||||
|
||||
|
||||
VIM *vim.vim* *vim-syntax*
|
||||
VIM *vim.vim* *ft-vim-syntax*
|
||||
|
||||
There is a tradeoff between more accurate syntax highlighting versus
|
||||
screen updating speed. To improve accuracy, you may wish to increase
|
||||
@@ -2453,7 +2514,7 @@ for external scripting languages (currently perl, python, ruby, and tcl).
|
||||
loaded.
|
||||
|
||||
|
||||
XF86CONFIG *xf86conf.vim* *xf86conf-syntax*
|
||||
XF86CONFIG *xf86conf.vim* *ft-xf86conf-syntax*
|
||||
|
||||
The syntax of XF86Config file differs in XFree86 v3.x and v4.x. Both
|
||||
variants are supported. Automatic detection is used, but is far from perfect.
|
||||
@@ -2468,7 +2529,7 @@ Note that spaces and underscores in option names are not supported. Use
|
||||
highlighted.
|
||||
|
||||
|
||||
XML *xml.vim* *xml-syntax*
|
||||
XML *xml.vim* *ft-xml-syntax*
|
||||
|
||||
Xml namespaces are highlighted by default. This can be inhibited by
|
||||
setting a global variable: >
|
||||
@@ -2486,7 +2547,7 @@ Note: syntax folding might slow down syntax highlighting significantly,
|
||||
especially for large files.
|
||||
|
||||
|
||||
X Pixmaps (XPM) *xpm.vim* *xpm-syntax*
|
||||
X Pixmaps (XPM) *xpm.vim* *ft-xpm-syntax*
|
||||
|
||||
xpm.vim creates its syntax items dynamically based upon the contents of the
|
||||
XPM file. Thus if you make changes e.g. in the color specification strings,
|
||||
@@ -2516,17 +2577,17 @@ It will look much better with a font in a quadratic cell size, e.g. for X: >
|
||||
|
||||
Vim understands three types of syntax items:
|
||||
|
||||
1. Keyword.
|
||||
1. Keyword
|
||||
It can only contain keyword characters, according to the 'iskeyword'
|
||||
option. It cannot contain other syntax items. It will only match with a
|
||||
complete word (there are no keyword characters before or after the match).
|
||||
The keyword "if" would match in "if(a=b)", but not in "ifdef x", because
|
||||
"(" is not a keyword character and "d" is.
|
||||
|
||||
2. Match.
|
||||
2. Match
|
||||
This is a match with a single regexp pattern.
|
||||
|
||||
3. Region.
|
||||
3. Region
|
||||
This starts at a match of the "start" regexp pattern and ends with a match
|
||||
with the "end" regexp pattern. Any other text can appear in between. A
|
||||
"skip" regexp pattern can be used to avoid matching the "end" pattern.
|
||||
@@ -2565,13 +2626,30 @@ When several syntax items may match, these rules are used:
|
||||
|
||||
DEFINING CASE *:syn-case* *E390*
|
||||
|
||||
:sy[ntax] case [match|ignore]
|
||||
:sy[ntax] case [match | ignore]
|
||||
This defines if the following ":syntax" commands will work with
|
||||
matching case, when using "match", or with ignoring case, when using
|
||||
"ignore". Note that any items before this are not affected, and all
|
||||
items until the next ":syntax case" command are affected.
|
||||
|
||||
|
||||
SPELL CHECKING *:syn-spell*
|
||||
|
||||
:sy[ntax] spell [toplevel | notoplevel | default]
|
||||
This defines where spell checking is to be done for text that is not
|
||||
in a syntax item:
|
||||
|
||||
toplevel: Text is spell checked.
|
||||
notoplevel: Text is not spell checked.
|
||||
default: When there is a @Spell cluster no spell checking.
|
||||
|
||||
For text in syntax items use the @Spell and @NoSpell clusters
|
||||
|spell-syntax|. When there is no @Spell and no @NoSpell cluster then
|
||||
spell checking is done for "default" and "toplevel".
|
||||
|
||||
To activate spell checking the 'spell' option must be set.
|
||||
|
||||
|
||||
DEFINING KEYWORDS *:syn-keyword*
|
||||
|
||||
:sy[ntax] keyword {group-name} [{options}] {keyword} .. [{options}]
|
||||
@@ -3174,7 +3252,7 @@ A more complicated Example: >
|
||||
<
|
||||
abcfoostringbarabc
|
||||
mmmmmmmmmmm match
|
||||
ssrrrreee highlight start/region/end ("Foo", "Exa" and "Bar")
|
||||
sssrrreee highlight start/region/end ("Foo", "Exa" and "Bar")
|
||||
|
||||
Leading context *:syn-lc* *:syn-leading* *:syn-context*
|
||||
|
||||
@@ -3539,7 +3617,7 @@ You can clear specific sync patterns with: >
|
||||
==============================================================================
|
||||
11. Listing syntax items *:syntax* *:sy* *:syn* *:syn-list*
|
||||
|
||||
This commands lists all the syntax items: >
|
||||
This command lists all the syntax items: >
|
||||
|
||||
:sy[ntax] [list]
|
||||
|
||||
@@ -3624,6 +3702,16 @@ specified field is used, and settings are merged with previous ones. So, the
|
||||
result is like this single command has been used: >
|
||||
:hi Comment term=bold ctermfg=Cyan guifg=#80a0ff gui=bold
|
||||
<
|
||||
*:highlight-verbose*
|
||||
When listing a highlight group and 'verbose' is non-zero, the listing will
|
||||
also tell where it was last set. Example: >
|
||||
:verbose hi Comment
|
||||
< Comment xxx term=bold ctermfg=4 guifg=Blue ~
|
||||
Last set from /home/mool/vim/vim7/runtime/syntax/syncolor.vim ~
|
||||
|
||||
When ":hi clear" is used then the script where this command is used will be
|
||||
mentioned for the default values. See |:verbose-cmd| for more information.
|
||||
|
||||
*highlight-args* *E416* *E417* *E423*
|
||||
There are three types of terminals for highlighting:
|
||||
term a normal terminal (vt100, xterm)
|
||||
@@ -3812,8 +3900,8 @@ guifg={color-name} *highlight-guifg*
|
||||
guibg={color-name} *highlight-guibg*
|
||||
guisp={color-name} *highlight-guisp*
|
||||
These give the foreground (guifg), background (guibg) and special
|
||||
(guisp) color to use in the GUI. "guisp" is used for underline and
|
||||
undercurl. There are a few special names:
|
||||
(guisp) color to use in the GUI. "guisp" is used for undercurl.
|
||||
There are a few special names:
|
||||
NONE no color (transparent)
|
||||
bg use normal background color
|
||||
background use normal background color
|
||||
@@ -3893,6 +3981,14 @@ NonText '~' and '@' at the end of the window, characters from
|
||||
doesn't fit at the end of the line).
|
||||
*hl-Normal*
|
||||
Normal normal text
|
||||
*hl-Pmenu*
|
||||
Pmenu Popup menu: normal item.
|
||||
*hl-PmenuSel*
|
||||
PmenuSel Popup menu: selected item.
|
||||
*hl-PmenuSbar*
|
||||
PmenuSbar Popup menu: scrollbar.
|
||||
*hl-PmenuThumb*
|
||||
PmenuThumb Popup menu: Thumb of the scrollbar.
|
||||
*hl-Question*
|
||||
Question |hit-enter| prompt and yes/no questions
|
||||
*hl-Search*
|
||||
@@ -3906,6 +4002,9 @@ SpecialKey Meta and special keys listed with ":map", also for text used
|
||||
really is.
|
||||
*hl-SpellBad*
|
||||
SpellBad Word that is not recognized by the spellchecker. |spell|
|
||||
This will be combined with the highlighting used otherwise.
|
||||
*hl-SpellCap*
|
||||
SpellCap Word that should start with a capital. |spell|
|
||||
This will be combined with the highlighting used otherwise.
|
||||
*hl-SpellLocal*
|
||||
SpellLocal Word that is recognized by the spellchecker as one that is
|
||||
@@ -3933,7 +4032,7 @@ WarningMsg warning messages
|
||||
*hl-WildMenu*
|
||||
WildMenu current match in 'wildmenu' completion
|
||||
|
||||
*hl-User1* *hl-User1..9*
|
||||
*hl-User1* *hl-User1..9* *hl-User9*
|
||||
The 'statusline' syntax allows the use of 9 different highlights in the
|
||||
statusline and ruler (via 'rulerformat'). The names are User1 to User9.
|
||||
|
||||
|
||||
573
runtime/doc/tags
573
runtime/doc/tags
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
*tagsrch.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
|
||||
*tagsrch.txt* For Vim version 7.0aa. Last change: 2005 Oct 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -352,6 +352,8 @@ Examples: >
|
||||
When the argument both exists literally, and match when used as a regexp, a
|
||||
literal match has a higher priority. For example, ":tag /open" matches "open"
|
||||
before "open_file" and "file_open".
|
||||
When using a pattern case is ignored. If you want to match case use "\C" in
|
||||
the pattern.
|
||||
|
||||
*tag-!*
|
||||
If the tag is in the current file this will always work. Otherwise the
|
||||
@@ -438,7 +440,7 @@ directory. If it is not found there, then the file "/home/user/commontags"
|
||||
will be searched for the tag.
|
||||
|
||||
This can be switched off by including the 'd' flag in 'cpoptions', to make
|
||||
it Vi compatible. "./tags" will than be the tags file in the current
|
||||
it Vi compatible. "./tags" will then be the tags file in the current
|
||||
directory, instead of the tags file in the directory where the current file
|
||||
is.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 7.0aa. Last change: 2005 Jun 06
|
||||
*term.txt* For Vim version 7.0aa. Last change: 2005 Dec 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -291,6 +291,7 @@ Added by Vim (there are no standard codes for these):
|
||||
t_WS set window size (height, width) in characters *t_WS* *'t_WS'*
|
||||
t_SI start insert mode (bar cursor shape) *t_SI* *'t_SI'*
|
||||
t_EI end insert mode (block cursor shape) *t_EI* *'t_EI'*
|
||||
|termcap-cursor-shape|
|
||||
t_RV request terminal version string (for xterm) *t_RV* *'t_RV'*
|
||||
|xterm-8bit| |v:termresponse| |'ttymouse'| |xterm-codes|
|
||||
|
||||
@@ -427,6 +428,7 @@ Example for an xterm, this changes the color of the cursor: >
|
||||
endif
|
||||
NOTE: When Vim exits the shape for Normal mode will remain. The shape from
|
||||
before Vim started will not be restored.
|
||||
{not available when compiled without the +cursorshape feature}
|
||||
|
||||
*termcap-title*
|
||||
The 't_ts' and 't_fs' options are used to set the window title if the terminal
|
||||
@@ -682,6 +684,7 @@ event position selection change action ~
|
||||
<MiddleMouse> yes if not active no put
|
||||
<MiddleMouse> yes if active no yank and put
|
||||
<RightMouse> yes start or extend yes
|
||||
<A-RightMouse> yes start or extend blockw. yes *<A-RightMouse>*
|
||||
<S-RightMouse> yes no change yes "#" (2) *<S-RightMouse>*
|
||||
<C-RightMouse> no no change no "CTRL-T"
|
||||
<RightDrag> yes extend no *<RightDrag>*
|
||||
@@ -697,6 +700,7 @@ event position selection change action ~
|
||||
<LeftRelease> yes start or extend (1) no like CTRL-O (1)
|
||||
<MiddleMouse> no (cannot be active) no put register
|
||||
<RightMouse> yes start or extend yes like CTRL-O
|
||||
<A-RightMouse> yes start or extend blockw. yes
|
||||
<S-RightMouse> yes (cannot be active) yes "CTRL-O#" (2)
|
||||
<C-RightMouse> no (cannot be active) no "CTRL-O CTRL-T"
|
||||
|
||||
@@ -711,12 +715,14 @@ Normal Mode:
|
||||
event position selection change action ~
|
||||
cursor window ~
|
||||
<S-LeftMouse> yes start or extend (1) no
|
||||
<A-LeftMouse> yes start or extend blockw. no *<A-LeftMouse>*
|
||||
<RightMouse> no popup menu no
|
||||
|
||||
Insert or Replace Mode:
|
||||
event position selection change action ~
|
||||
cursor window ~
|
||||
<S-LeftMouse> yes start or extend (1) no like CTRL-O (1)
|
||||
<A-LeftMouse> yes start or extend blockw. no
|
||||
<RightMouse> no popup menu no
|
||||
|
||||
(1) only if mouse pointer moved since press
|
||||
@@ -742,6 +748,12 @@ Visual area to be extended. When 'mousemodel' is "popup", the left button has
|
||||
to be used while keeping the shift key pressed. When clicking in a window
|
||||
which is editing another buffer, the Visual or Select mode is stopped.
|
||||
|
||||
In Normal, Visual and Select mode clicking the right mouse button with the alt
|
||||
key pressed causes the Visual area to become blockwise. When 'mousemodel is
|
||||
"popup" the left button has to be used with the alt key. Note that this won't
|
||||
work on systems where the window manager uses the mouse when the alt key is
|
||||
pressed (it may move the window).
|
||||
|
||||
*double-click*
|
||||
Double, triple and quadruple clicks are supported when the GUI is active,
|
||||
for MS-DOS and Win32, and for an xterm (if the gettimeofday() function is
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
*uganda.txt* For Vim version 7.0aa. Last change: 2005 Feb 24
|
||||
*uganda.txt* For Vim version 7.0aa. Last change: 2005 Oct 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -211,9 +211,26 @@ Sending money:
|
||||
Check the ICCF web site for the latest information! See |iccf| for the URL.
|
||||
|
||||
|
||||
USA and Canada: Contact Kibaale Children's Fund (KCF) in Surrey, Canada. They
|
||||
USA: The methods mentioned below can be used. Alternatively, you
|
||||
can send a check to the Nehemiah Group Outreach Society
|
||||
(NGOS). This will reduce banking costs and you can get an IRS
|
||||
tax receipt. The NGOS forwards the funds directly to the
|
||||
Kibaale project in Uganda. Checks must be made payable to
|
||||
NGOS but please note on the check "donation Kibaale". Mail
|
||||
checks to:
|
||||
NGOS
|
||||
P.O. Box 50862
|
||||
Indianapolis, IN 45250
|
||||
Questions regarding the Nehemiah Group Outreach Society (NGOS)
|
||||
should be directed to: Ross deMerchant, Executive Director -
|
||||
r.demerchant AT sbcglobal DOT net.
|
||||
For sponsoring a child contact KCF in Canada (see below) and
|
||||
send the check to NGOS in Indianapolis.
|
||||
|
||||
Canada: Contact Kibaale Children's Fund (KCF) in Surrey, Canada. They
|
||||
take care of the Canadian sponsors for the children in
|
||||
Kibaale. You can send them a one time donation directly.
|
||||
Kibaale. KCF forwards 100% of the money to the project in
|
||||
Uganda. You can send them a one time donation directly.
|
||||
Please send me a note so that I know what has been donated
|
||||
because of Vim. Ask KCF for information about sponsorship.
|
||||
Kibaale Children's Fund c/o Pacific Academy
|
||||
@@ -223,12 +240,10 @@ USA and Canada: Contact Kibaale Children's Fund (KCF) in Surrey, Canada. They
|
||||
Phone: 604-581-5353
|
||||
If you make a donation to Kibaale Children's Fund (KCF) you
|
||||
will receive a tax receipt which can be submitted with your
|
||||
tax return (under the Free Trade Agreement tax receipts issued
|
||||
by an organization registered in Canada are fully accepted by
|
||||
the IRS in the USA, with a few conditions).
|
||||
tax return.
|
||||
|
||||
Holland: Transfer to the account of "Stichting ICCF Holland" in Venlo.
|
||||
This will allow for tax deduction (if you live in Holland)!
|
||||
This will allow for tax deduction if you live in Holland.
|
||||
Postbank, nr. 4548774
|
||||
|
||||
Germany: It is possible to make donations that allow for a tax return.
|
||||
@@ -249,10 +264,11 @@ Europe: Use a bank transfer if possible. Your bank should have a form
|
||||
Credit Card: You can use PayPal to send money with a Credit card. This is
|
||||
the most widely used Internet based payment system. It's
|
||||
really simple to use. Use this link to find more info:
|
||||
https://www.paypal.com/affil/pal=Bram%40moolenaar.net
|
||||
https://www.paypal.com/affil/pal=Bram%40iccf-holland.org
|
||||
The e-mail address for sending the money to is:
|
||||
Bram@iccf-holland.org
|
||||
For amounts above $150 sending a cheque is preferred.
|
||||
Bram@iccf-holland.org
|
||||
For amounts above 400 Euro ($500) sending a check is
|
||||
preferred.
|
||||
|
||||
Others: Transfer to one of these accounts if possible:
|
||||
Postbank, account 4548774
|
||||
@@ -263,11 +279,11 @@ Others: Transfer to one of these accounts if possible:
|
||||
Rabobank Venlo, account 3765.05.117
|
||||
Swift code: RABO NL 2U
|
||||
under the name "Bram Moolenaar", Venlo
|
||||
Otherwise, send a cheque in euro or US dollars to the address
|
||||
Otherwise, send a check in euro or US dollars to the address
|
||||
below. Minimal amount: $70 (my bank does not accept smaller
|
||||
amounts for foreign cheques, sorry)
|
||||
amounts for foreign check, sorry)
|
||||
|
||||
Address to send cheques to:
|
||||
Address to send checks to:
|
||||
stichting ICCF Holland
|
||||
Bram Moolenaar
|
||||
Clematisstraat 30
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_05.txt* For Vim version 7.0aa. Last change: 2005 Feb 08
|
||||
*usr_05.txt* For Vim version 7.0aa. Last change: 2005 Oct 04
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -327,6 +327,11 @@ Example for Unix (assuming you didn't have a plugin directory yet): >
|
||||
That's all! Now you can use the commands defined in this plugin to justify
|
||||
text.
|
||||
|
||||
Instead of putting plugins directly into the plugin/ directory, you may
|
||||
better organize them by putting them into subdirectories under plugin/.
|
||||
As an example, consider using "~/.vim/plugin/perl/*.vim" for all your Perl
|
||||
plugins.
|
||||
|
||||
|
||||
FILETYPE PLUGINS *add-filetype-plugin* *ftplugins*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_11.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
|
||||
*usr_11.txt* For Vim version 7.0aa. Last change: 2005 Jun 09
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -34,7 +34,7 @@ messages (with different file names, of course):
|
||||
|
||||
Using swap file ".help.txt.swp" ~
|
||||
Original file "~/vim/runtime/doc/help.txt" ~
|
||||
Recovery completed. You should check if everything is OK. ~
|
||||
Recovery completed. You should check if everything is OK. ~
|
||||
(You might want to write out this file under another name ~
|
||||
and run diff with the original file to check for changes) ~
|
||||
Delete the .swp file afterwards. ~
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 7.0aa. Last change: 2005 May 18
|
||||
*usr_41.txt* For Vim version 7.0aa. Last change: 2005 Nov 30
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -612,13 +612,13 @@ List manipulation:
|
||||
join() join List items into a String
|
||||
string() String representation of a List
|
||||
call() call a function with List as arguments
|
||||
index() index of a value in a list
|
||||
index() index of a value in a List
|
||||
max() maximum value in a List
|
||||
min() minimum value in a List
|
||||
count() count number of times a value appears in a List
|
||||
|
||||
Dictionary manipulation:
|
||||
get() get an entries without error for wrong key
|
||||
get() get an entry without an error for a wrong key
|
||||
len() number of entries in a Dictionary
|
||||
has_key() check whether a key appears in a Dictionary
|
||||
empty() check if Dictionary is empty
|
||||
@@ -692,6 +692,7 @@ Buffers, windows and the argument list:
|
||||
winnr() get the window number for the current window
|
||||
bufwinnr() get the window number of a specific buffer
|
||||
winbufnr() get the buffer number of a specific window
|
||||
getbufline() get a list of lines from the specified buffer
|
||||
getbufvar() get a variable value from a specific buffer
|
||||
setbufvar() set a variable in a specific buffer
|
||||
getwinvar() get a variable value from a specific window
|
||||
@@ -1117,7 +1118,7 @@ over them: >
|
||||
one ~
|
||||
two ~
|
||||
|
||||
The will notice the items are not ordered. You can sort the list to get a
|
||||
The will notice the keys are not ordered. You can sort the list to get a
|
||||
specific order: >
|
||||
|
||||
:for key in sort(keys(uk2nl))
|
||||
@@ -2113,7 +2114,7 @@ a user to overrule or add to the default file. The default files start with: >
|
||||
When you write a compiler file and put it in your personal runtime directory
|
||||
(e.g., ~/.vim/compiler for Unix), you set the "current_compiler" variable to
|
||||
make the default file skip the settings.
|
||||
|
||||
*:CompilerSet*
|
||||
The second mechanism is to use ":set" for ":compiler!" and ":setlocal" for
|
||||
":compiler". Vim defines the ":CompilerSet" user command for this. However,
|
||||
older Vim versions don't, thus your plugin should define it then. This is an
|
||||
@@ -2138,7 +2139,7 @@ that could be ~/.vim/after/compiler.
|
||||
*41.14* Writing a plugin that loads quickly *write-plugin-quickload*
|
||||
|
||||
A plugin may grow and become quite long. The startup delay may become
|
||||
noticable, while you hardly every use the plugin. Then it's time for a
|
||||
noticeable, while you hardly every use the plugin. Then it's time for a
|
||||
quickload plugin.
|
||||
|
||||
The basic idea is that the plugin is loaded twice. The first time user
|
||||
@@ -2237,8 +2238,8 @@ That script must define the "mylib#myfunction()" function.
|
||||
|
||||
You can put many other functions in the mylib.vim script, you are free to
|
||||
organize your functions in library scripts. But you must use function names
|
||||
where the part before the colon matches the script name. Otherwise Vim
|
||||
would not know what script to load.
|
||||
where the part before the '#' matches the script name. Otherwise Vim would
|
||||
not know what script to load.
|
||||
|
||||
If you get really enthousiastic and write lots of library scripts, you may
|
||||
want to use subdirectories. Example: >
|
||||
@@ -2256,7 +2257,7 @@ Where the function is defined like this: >
|
||||
endfunction
|
||||
|
||||
Notice that the name the function is defined with is exactly the same as the
|
||||
name used for calling the function. And the part before the last colon
|
||||
name used for calling the function. And the part before the last '#'
|
||||
exactly matches the subdirectory and script name.
|
||||
|
||||
You can use the same mechanism for variables: >
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 7.0aa. Last change: 2005 May 31
|
||||
*various.txt* For Vim version 7.0aa. Last change: 2006 Jan 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -14,7 +14,8 @@ Various commands *various*
|
||||
1. Various commands *various-cmds*
|
||||
|
||||
*CTRL-L*
|
||||
CTRL-L Clear and redraw the screen (later).
|
||||
CTRL-L Clear and redraw the screen. The redraw may happen
|
||||
later, after processing typeahead.
|
||||
|
||||
*:redr* *:redraw*
|
||||
:redr[aw][!] Redraw the screen right now. When ! is included it is
|
||||
@@ -267,6 +268,8 @@ N *+cmdline_info* |'showcmd'| and |'ruler'|
|
||||
N *+comments* |'comments'| support
|
||||
N *+cryptv* encryption support |encryption|
|
||||
B *+cscope* |cscope| support
|
||||
m *+cursorshape* |termcap-cursor-shape| support
|
||||
m *+debug* Compiled for debugging.
|
||||
N *+dialog_gui* Support for |:confirm| with GUI dialog.
|
||||
N *+dialog_con* Support for |:confirm| with console dialog.
|
||||
N *+dialog_con_gui* Support for |:confirm| with GUI and console dialog.
|
||||
@@ -292,7 +295,8 @@ N *+gettext* message translations |multi-lang|
|
||||
*+GUI_Motif* Unix only: Motif |GUI|
|
||||
*+GUI_Photon* QNX only: Photon |GUI|
|
||||
m *+hangul_input* Hangul input support |hangul|
|
||||
*+iconv* Compiled with the |iconv()| function, may have |/dyn|
|
||||
*+iconv* Compiled with the |iconv()| function
|
||||
*+iconv/dyn* Likewise |iconv-dynamic| |/dyn|
|
||||
N *+insert_expand* |insert_expand| Insert mode completion
|
||||
N *+jumplist* |jumplist|
|
||||
B *+keymap* |'keymap'|
|
||||
@@ -317,19 +321,23 @@ B *+multi_byte* Korean and other languages |multibyte|
|
||||
*+multi_byte_ime* Win32 input method for multibyte chars |multibyte-ime|
|
||||
N *+multi_lang* non-English language support |multi-lang|
|
||||
m *+mzscheme* Mzscheme interface |mzscheme|
|
||||
m *+mzscheme/dyn* Mzscheme interface |mzscheme-dynamic| |/dyn|
|
||||
m *+netbeans_intg* |netbeans|
|
||||
m *+ole* Win32 GUI only: |ole-interface|
|
||||
*+osfiletype* Support for the 'osfiletype' option and filetype
|
||||
checking in automatic commands. |autocmd-osfiletypes|
|
||||
N *+path_extra* Up/downwards search in 'path' and 'tags'
|
||||
m *+perl* Perl interface |perl|, may have |/dyn|
|
||||
m *+perl* Perl interface |perl|
|
||||
m *+perl/dyn* Perl interface |perl-dynamic| |/dyn|
|
||||
*+postscript* |:hardcopy| writes a PostScript file
|
||||
N *+printer* |:hardcopy| command
|
||||
H *+profile* |:profile| command
|
||||
m *+python* Python interface |python|, may have |/dyn|
|
||||
m *+python* Python interface |python|
|
||||
m *+python/dyn* Python interface |python-dynamic| |/dyn|
|
||||
N *+quickfix* |:make| and |quickfix| commands
|
||||
B *+rightleft* Right to left typing |'rightleft'|
|
||||
m *+ruby* Ruby interface |ruby|, may have |/dyn|
|
||||
m *+ruby* Ruby interface |ruby|
|
||||
m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn|
|
||||
N *+scrollbind* |'scrollbind'|
|
||||
B *+signs* |:sign|
|
||||
N *+smartindent* |'smartindent'|
|
||||
@@ -342,7 +350,8 @@ N *+syntax* Syntax highlighting |syntax|
|
||||
N *+tag_binary* binary searching in tags file |tag-binary-search|
|
||||
N *+tag_old_static* old method for static tags |tag-old-static|
|
||||
m *+tag_any_white* any white space allowed in tags file |tag-any-white|
|
||||
m *+tcl* Tcl interface |tcl|, may have |/dyn|
|
||||
m *+tcl* Tcl interface |tcl|
|
||||
m *+tcl/dyn* Tcl interface |tcl-dynamic| |/dyn|
|
||||
*+terminfo* uses |terminfo| instead of termcap
|
||||
N *+termresponse* support for |t_RV| and |v:termresponse|
|
||||
N *+textobjects* |text-objects| selection
|
||||
@@ -484,6 +493,15 @@ N *+X11* Unix only: can restore window title |X11|
|
||||
For logging verbose messages in a file use the
|
||||
'verbosefile' option.
|
||||
|
||||
*:verbose-cmd*
|
||||
When 'verbose' is non-zero, listing the value of a Vim option or a key map or
|
||||
an abbreviation or a user-defined function or a command or a highlight group
|
||||
or an autocommand will also display where it was last defined. If it was
|
||||
defined manually then there will be no "Last set" message. When it was
|
||||
defined while executing a function, user command or autocommand, the script in
|
||||
which it was defined is reported.
|
||||
{not available when compiled without the +eval feature}
|
||||
|
||||
*K*
|
||||
K Run a program to lookup the keyword under the
|
||||
cursor. The name of the program is given with the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*version6.txt* For Vim version 7.0aa. Last change: 2005 Apr 18
|
||||
*version6.txt* For Vim version 7.0aa. Last change: 2005 Oct 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -80,6 +80,11 @@ Changed |changed-6.3|
|
||||
Added |added-6.3|
|
||||
Fixed |fixed-6.3|
|
||||
|
||||
VERSION 6.4 |version-6.4|
|
||||
Changed |changed-6.4|
|
||||
Added |added-6.4|
|
||||
Fixed |fixed-6.4|
|
||||
|
||||
==============================================================================
|
||||
INCOMPATIBLE CHANGES *incompatible-6*
|
||||
|
||||
@@ -13841,4 +13846,685 @@ Problem: After Visually selecting four characters, changing it to other
|
||||
Solution: Don't store the size of the Visual area when redo is active.
|
||||
Files: src/normal.c
|
||||
|
||||
==============================================================================
|
||||
VERSION 6.4 *version-6.4*
|
||||
|
||||
This section is about improvements made between version 6.3 and 6.4.
|
||||
|
||||
This is a bug-fix release. There are also a few new features. The major
|
||||
number of new items is in the runtime files and translations.
|
||||
|
||||
The big MS-Windows version now uses:
|
||||
Ruby version 1.8.3
|
||||
Perl version 5.8.7
|
||||
Python version 2.4.2
|
||||
|
||||
|
||||
Changed *changed-6.4*
|
||||
-------
|
||||
|
||||
Removed runtime/tools/tcltags, Exuberant ctags does it better.
|
||||
|
||||
|
||||
Added *added-6.4*
|
||||
-----
|
||||
|
||||
Alsaconf syntax file (Nikolai Weibull)
|
||||
Eruby syntax, indent, compiler and ftplugin file (Doug Kearns)
|
||||
Esterel syntax file (Maurizio Tranchero)
|
||||
Mathematica indent file (Steve Layland)
|
||||
Netrc syntax file (Nikolai Weibull)
|
||||
PHP compiler file (Doug Kearns)
|
||||
Pascal indent file (Neil Carter)
|
||||
Prescribe syntax file (Klaus Muth)
|
||||
Rubyunit compiler file (Doug Kearns)
|
||||
SMTPrc syntax file (Kornel Kielczewski)
|
||||
Sudoers syntax file (Nikolai Weibull)
|
||||
TPP syntax file (Gerfried Fuchs)
|
||||
VHDL ftplugin file (R. Shankar)
|
||||
Verilog-AMS syntax file (S. Myles Prather)
|
||||
|
||||
Bulgarian keymap (Alberto Mardegan)
|
||||
Canadian keymap (Eric Joanis)
|
||||
|
||||
Hungarian menu translations in UTF-8 (Kantra Gergely)
|
||||
Ukrainian menu translations (Bohdan Vlasyuk)
|
||||
|
||||
Irish message translations (Kevin Patrick Scannell)
|
||||
|
||||
Configure also checks for tclsh8.4.
|
||||
|
||||
|
||||
Fixed *fixed-6.4*
|
||||
-----
|
||||
|
||||
"dFxd;" deleted the character under the cursor, "d;" didn't remember the
|
||||
exclusiveness of the motion.
|
||||
|
||||
When using "set laststatus=2 cmdheight=2" in the .gvimrc you may only get one
|
||||
line for the cmdline. (Christian Robinson) Invoke command_height() after the
|
||||
GUI has started up.
|
||||
|
||||
Gcc would warn "dereferencing type-punned pointer will break strict -aliasing
|
||||
rules". Avoid using typecasts for variable pointers.
|
||||
|
||||
Gcc 3.x interprets the -MM argument differently. Change "-I /path" to
|
||||
"-isystem /path" for "make depend".
|
||||
|
||||
|
||||
Patch 6.3.001
|
||||
Problem: ":browse split" gives the file selection dialog twice. (Gordon
|
||||
Bazeley) Same problem for ":browse diffpatch".
|
||||
Solution: Reset cmdmod.browse before calling do_ecmd().
|
||||
Files: src/diff.c, src/ex_docmd.c
|
||||
|
||||
Patch 6.3.002
|
||||
Problem: When using translated help files with non-ASCII latin1 characters
|
||||
in the first line the utf-8 detection is wrong.
|
||||
Solution: Properly detect utf-8 characters. When a mix of encodings is
|
||||
detected continue with the next language and avoid a "no matches"
|
||||
error because of "got_int" being set. Add the directory name to
|
||||
the error message for a duplicate tag.
|
||||
Files: src/ex_cmds.c
|
||||
|
||||
Patch 6.3.003
|
||||
Problem: Crash when using a console dialog and the first choice does not
|
||||
have a default button. (Darin Ohashi)
|
||||
Solution: Allocate two more characters for the [] around the character for
|
||||
the default choice.
|
||||
Files: src/message.c
|
||||
|
||||
Patch 6.3.004
|
||||
Problem: When searching for a long string (140 chars in a 80 column
|
||||
terminal) get three hit-enter prompts. (Robert Webb)
|
||||
Solution: Avoid the hit-enter prompt when giving the message for wrapping
|
||||
around the end of the buffer. Don't give that message again when
|
||||
the string was not found.
|
||||
Files: src/message.c, src/search.c
|
||||
|
||||
Patch 6.3.005
|
||||
Problem: Crash when searching for a pattern with a character offset and
|
||||
starting in a closed fold. (Frank Butler)
|
||||
Solution: Check for the column to be past the end of the line. Also fix
|
||||
that a pattern with a character offset relative to the end isn't
|
||||
read back from the viminfo properly.
|
||||
Files: src/search.c
|
||||
|
||||
Patch 6.3.006
|
||||
Problem: ":breakadd file *foo" prepends the current directory to the file
|
||||
pattern. (Hari Krishna Dara)
|
||||
Solution: Keep the pattern as-is.
|
||||
Files: src/ex_cmds2.c
|
||||
|
||||
Patch 6.3.007
|
||||
Problem: When there is a buffer with 'buftype' set to "nofile" and using a
|
||||
":cd" command, the swap file is not deleted when exiting.
|
||||
Solution: Use the full path of the swap file also for "nofile" buffers.
|
||||
Files: src/fileio.c
|
||||
|
||||
Patch 6.3.008
|
||||
Problem: Compiling fails under OS/2.
|
||||
Solution: Include "e_screenmode" also for OS/2. (David Sanders)
|
||||
Files: src/globals.h
|
||||
|
||||
Patch 6.3.009 (after 6.3.006)
|
||||
Problem: ":breakadd file /path/foo.vim" does not match when a symbolic link
|
||||
is involved. (Servatius Brandt)
|
||||
Solution: Do expand the pattern when it does not start with "*".
|
||||
Files: runtime/doc/repeat.txt, src/ex_cmds2.c
|
||||
|
||||
Patch 6.3.010
|
||||
Problem: When writing to a named pipe there is an error for fsync()
|
||||
failing.
|
||||
Solution: Ignore the fsync() error for devices.
|
||||
Files: src/fileio.c
|
||||
|
||||
Patch 6.3.011
|
||||
Problem: Crash when the completion function of a user-command uses a
|
||||
"normal :cmd" command. (Hari Krishna Dara)
|
||||
Solution: Save the command line when invoking the completion function.
|
||||
Files: src/ex_getln.c
|
||||
|
||||
Patch 6.3.012
|
||||
Problem: Internal lalloc(0) error when using a complicated multi-line
|
||||
pattern in a substitute command. (Luc Hermitte)
|
||||
Solution: Avoid going past the end of a line.
|
||||
Files: src/ex_cmds.c
|
||||
|
||||
Patch 6.3.013
|
||||
Problem: Crash when editing a command line and typing CTRL-R = to evaluate
|
||||
a function that uses "normal :cmd". (Hari Krishna Dara)
|
||||
Solution: Save and restore the command line when evaluating an expression
|
||||
for CTRL-R =.
|
||||
Files: src/ex_getln.c, src/ops.c, src/proto/ex_getln.pro,
|
||||
src/proto/ops.pro
|
||||
|
||||
Patch 6.3.014
|
||||
Problem: When using Chinese or Taiwanese the default for 'helplang' is
|
||||
wrong. (Simon Liang)
|
||||
Solution: Use the part of the locale name after "zh_".
|
||||
Files: src/option.c
|
||||
|
||||
Patch 6.3.015
|
||||
Problem: The string that winrestcmd() returns may end in garbage.
|
||||
Solution: NUL-terminate the string. (Walter Briscoe)
|
||||
Files: src/eval.c
|
||||
|
||||
Patch 6.3.016
|
||||
Problem: The default value for 'define' has "\s" before '#'.
|
||||
Solution: Add a star after "\s". (Herculano de Lima Einloft Neto)
|
||||
Files: src/option.c
|
||||
|
||||
Patch 6.3.017
|
||||
Problem: "8zz" may leave the cursor beyond the end of the line. (Niko
|
||||
Maatjes)
|
||||
Solution: Correct the cursor column after moving to another line.
|
||||
Files: src/normal.c
|
||||
|
||||
Patch 6.3.018
|
||||
Problem: ":0argadd zero" added the argument after the first one, instead of
|
||||
before it. (Adri Verhoef)
|
||||
Solution: Accept a zero range for ":argadd".
|
||||
Files: src/ex_cmds.h
|
||||
|
||||
Patch 6.3.019
|
||||
Problem: Crash in startup for debug version. (David Rennals)
|
||||
Solution: Move the call to nbdebug_wait() to after allocating NameBuff.
|
||||
Files: src/main.c
|
||||
|
||||
Patch 6.3.020
|
||||
Problem: When 'encoding' is "utf-8" and 'delcombine' is set, "dw" does not
|
||||
delete a word but only a combining character of the first
|
||||
character, if there is one. (Raphael Finkel)
|
||||
Solution: Correctly check that one character is being deleted.
|
||||
Files: src/misc1.c
|
||||
|
||||
Patch 6.3.021
|
||||
Problem: When the last character of a file name is a multi-byte character
|
||||
and the last byte is a path separator, the file cannot be edited.
|
||||
Solution: Check for the last byte to be part of a multi-byte character.
|
||||
(Taro Muraoka)
|
||||
Files: src/fileio.c
|
||||
|
||||
Patch 6.3.022 (extra)
|
||||
Problem: Win32: When the last character of a file name is a multi-byte
|
||||
character and the last byte is a path separator, the file cannot
|
||||
be written. A trail byte that is a space makes that a file cannot
|
||||
be opened from the command line.
|
||||
Solution: Recognize double-byte characters when parsing the command line.
|
||||
In mch_stat() check for the last byte to be part of a multi-byte
|
||||
character. (Taro Muraoka)
|
||||
Files: src/gui_w48.c, src/os_mswin.c
|
||||
|
||||
Patch 6.3.023
|
||||
Problem: When the "to" part of a mapping starts with its "from" part,
|
||||
abbreviations for the same characters is not possible. For
|
||||
example, when <Space> is mapped to something that starts with a
|
||||
space, typing <Space> does not expand abbreviations.
|
||||
Solution: Only disable expanding abbreviations when a mapping is not
|
||||
remapped, don't disable it when the RHS of a mapping starts with
|
||||
the LHS.
|
||||
Files: src/getchar.c, src/vim.h
|
||||
|
||||
Patch 6.3.024
|
||||
Problem: In a few places a string in allocated memory is not terminated
|
||||
with a NUL.
|
||||
Solution: Add ga_append(NUL) in script_get(), gui_do_findrepl() and
|
||||
serverGetVimNames().
|
||||
Files: src/ex_getln.c, src/gui.c, src/if_xcmdsrv.c, src/os_mswin.c
|
||||
|
||||
Patch 6.3.025 (extra)
|
||||
Problem: Missing NUL for list of server names.
|
||||
Solution: Add ga_append(NUL) in serverGetVimNames().
|
||||
Files: src/os_mswin.c
|
||||
|
||||
Patch 6.3.026
|
||||
Problem: When ~/.vim/after/syntax/syncolor.vim contains a command that
|
||||
reloads the colors an endless loop and/or a crash may occur.
|
||||
Solution: Only free the old value of an option when it was originally
|
||||
allocated. Limit recursiveness of init_highlight() to 5 levels.
|
||||
Files: src/option.c, src/syntax.c
|
||||
|
||||
Patch 6.3.027
|
||||
Problem: VMS: Writing a file may insert extra CR characters. Not all
|
||||
terminals are recognized correctly. Vt320 doesn't support colors.
|
||||
Environment variables are not expanded correctly.
|
||||
Solution: Use another method to write files. Add vt320 termcap codes for
|
||||
colors. (Zoltan Arpadffy)
|
||||
Files: src/fileio.c, src/misc1.c, src/os_unix.c, src/structs.h,
|
||||
src/term.c
|
||||
|
||||
Patch 6.3.028
|
||||
Problem: When appending to a file the BOM marker may be written. (Alex
|
||||
Jakushev)
|
||||
Solution: Do not write the BOM marker when appending.
|
||||
Files: src/fileio.c
|
||||
|
||||
Patch 6.3.029
|
||||
Problem: Crash when inserting a line break. (Walter Briscoe)
|
||||
Solution: In the syntax highlighting code, don't use an old state after a
|
||||
change was made, current_col may be past the end of the line.
|
||||
Files: src/syntax.c
|
||||
|
||||
Patch 6.3.030
|
||||
Problem: GTK 2: Crash when sourcing a script that deletes the menus, sets
|
||||
'encoding' to "utf-8" and loads the menus again. GTK error
|
||||
message when tooltip text is in a wrong encoding.
|
||||
Solution: Don't copy characters from the old screen to the new screen when
|
||||
switching 'encoding' to utf-8, they may be invalid. Only set the
|
||||
tooltip when it is valid utf-8.
|
||||
Files: src/gui_gtk.c, src/mbyte.c, src/proto/mbyte.pro, src/screen.c
|
||||
|
||||
Patch 6.3.031
|
||||
Problem: When entering a mapping and pressing Tab halfway the command line
|
||||
isn't redrawn properly. (Adri Verhoef)
|
||||
Solution: Reposition the cursor after drawing over the "..." of the
|
||||
completion attempt.
|
||||
Files: src/ex_getln.c
|
||||
|
||||
Patch 6.3.032
|
||||
Problem: Using Python 2.3 with threads doesn't work properly.
|
||||
Solution: Release the lock after initialization.
|
||||
Files: src/if_python.c
|
||||
|
||||
Patch 6.3.033
|
||||
Problem: When a mapping ends in a Normal mode command of more than one
|
||||
character Vim doesn't return to Insert mode.
|
||||
Solution: Check that the mapping has ended after obtaining all characters of
|
||||
the Normal mode command.
|
||||
Files: src/normal.c
|
||||
|
||||
Patch 6.3.034
|
||||
Problem: VMS: crash when using ":help".
|
||||
Solution: Avoid using "tags-??", some Open VMS systems can't handle the "?"
|
||||
wildcard. (Zoltan Arpadffy)
|
||||
Files: src/tag.c
|
||||
|
||||
Patch 6.3.035 (extra)
|
||||
Problem: RISC OS: Compile errors.
|
||||
Solution: Change e_screnmode to e_screenmode. Change the way
|
||||
__riscosify_control is set. Improve the makefile. (Andy Wingate)
|
||||
Files: src/os_riscos.c, src/search.c, src/Make_ro.mak
|
||||
|
||||
Patch 6.3.036
|
||||
Problem: ml_get errors when the whole file is a fold, switching
|
||||
'foldmethod' and doing "zj". (Christian J. Robinson) Was not
|
||||
deleting the fold but creating a fold with zero lines.
|
||||
Solution: Delete the fold properly.
|
||||
Files: src/fold.c
|
||||
|
||||
Patch 6.3.037 (after 6.3.032)
|
||||
Problem: Warning for unused variable.
|
||||
Solution: Change the #ifdefs for the saved thread stuff.
|
||||
Files: src/if_python.c
|
||||
|
||||
Patch 6.3.038 (extra)
|
||||
Problem: Win32: When the "file changed" dialog pops up after a click that
|
||||
gives gvim focus and not moving the mouse after that, the effect
|
||||
of the click may occur when moving the mouse later. (Ken Clark)
|
||||
Happened because the release event was missed.
|
||||
Solution: Clear the s_button_pending variable when any input is received.
|
||||
Files: src/gui_w48.c
|
||||
|
||||
Patch 6.3.039
|
||||
Problem: When 'number' is set and inserting lines just above the first
|
||||
displayed line (in another window on the same buffer), the line
|
||||
numbers are not updated. (Hitier Sylvain)
|
||||
Solution: When 'number' is set and lines are inserted/deleted redraw all
|
||||
lines below the change.
|
||||
Files: src/screen.c
|
||||
|
||||
Patch 6.3.040
|
||||
Problem: Error handling does not always work properly and may cause a
|
||||
buffer to be marked as if it's viewed in a window while it isn't.
|
||||
Also when selecting "Abort" at the attention prompt.
|
||||
Solution: Add enter_cleanup() and leave_cleanup() functions to move
|
||||
saving/restoring things for error handling to one place.
|
||||
Clear a buffer read error when it's unloaded.
|
||||
Files: src/buffer.c, src/ex_docmd.c, src/ex_eval.c,
|
||||
src/proto/ex_eval.pro, src/structs.h, src/vim.h
|
||||
|
||||
Patch 6.3.041 (extra)
|
||||
Problem: Win32: When the path to a file has Russian characters, ":cd %:p:h"
|
||||
doesn't work. (Valery Kondakoff)
|
||||
Solution: Use a wide function to change directory.
|
||||
Files: src/os_mswin.c
|
||||
|
||||
Patch 6.3.042
|
||||
Problem: When there is a closed fold at the top of the window, CTRL-X
|
||||
CTRL-E in Insert mode reduces the size of the fold instead of
|
||||
scrolling the text up. (Gautam)
|
||||
Solution: Scroll over the closed fold.
|
||||
Files: src/move.c
|
||||
|
||||
Patch 6.3.043
|
||||
Problem: 'hlsearch' highlighting sometimes disappears when inserting text
|
||||
in PHP code with syntax highlighting. (Marcel Svitalsky)
|
||||
Solution: Don't use pointers to remember where a match was found, use an
|
||||
index. The pointers may become invalid when searching in other
|
||||
lines.
|
||||
Files: src/screen.c
|
||||
|
||||
Patch 6.3.044 (extra)
|
||||
Problem: Mac: When 'linespace' is non-zero the Insert mode cursor leaves
|
||||
pixels behind. (Richard Sandilands)
|
||||
Solution: Erase the character cell before drawing the text when needed.
|
||||
Files: src/gui_mac.c
|
||||
|
||||
|
||||
Patch 6.3.045
|
||||
Problem: Unusual characters in an option value may cause unexpected
|
||||
behavior, especially for a modeline. (Ciaran McCreesh)
|
||||
Solution: Don't allow setting termcap options or 'printdevice' in a
|
||||
modeline. Don't list options for "termcap" and "all" in a
|
||||
modeline. Don't allow unusual characters in 'filetype', 'syntax',
|
||||
'backupext', 'keymap', 'patchmode' and 'langmenu'.
|
||||
Files: src/option.c, runtime/doc/options.txt
|
||||
|
||||
Patch 6.3.046
|
||||
Problem: ":registers" doesn't show multi-byte characters properly.
|
||||
(Valery Kondakoff)
|
||||
Solution: Get the length of each character before displaying it.
|
||||
Files: src/ops.c
|
||||
|
||||
Patch 6.3.047 (extra)
|
||||
Problem: Win32 with Borland C 5.5 on Windows XP: A new file is created with
|
||||
read-only attributes. (Tony Mechelynck)
|
||||
Solution: Don't use the _wopen() function for Borland.
|
||||
Files: src/os_win32.c
|
||||
|
||||
Patch 6.3.048 (extra)
|
||||
Problem: Build problems with VMS on IA64.
|
||||
Solution: Add dependencies to the build file. (Zoltan Arpadffy)
|
||||
Files: src/Make_vms.mms
|
||||
|
||||
Patch 6.3.049 (after 6.3.045)
|
||||
Problem: Compiler warning for "char" vs "char_u" mixup. (Zoltan Arpadffy)
|
||||
Solution: Add a typecast.
|
||||
Files: src/option.c
|
||||
|
||||
Patch 6.3.050
|
||||
Problem: When SIGHUP is received while busy exiting, non-reentrant
|
||||
functions such as free() may cause a crash.
|
||||
Solution: Ignore SIGHUP when exiting because of an error. (Scott Anderson)
|
||||
Files: src/misc1.c, src/main.c
|
||||
|
||||
Patch 6.3.051
|
||||
Problem: When 'wildmenu' is set and completed file names contain multi-byte
|
||||
characters Vim may crash.
|
||||
Solution: Reserve room for multi-byte characters. (Yasuhiro Matsumoto)
|
||||
Files: src/screen.c
|
||||
|
||||
Patch 6.3.052 (extra)
|
||||
Problem: Windows 98: typed keys that are not ASCII may not work properly.
|
||||
For example with a Russian input method. (Jiri Jezdinsky)
|
||||
Solution: Assume that the characters arrive in the current codepage instead
|
||||
of UCS-2. Perform conversion based on that.
|
||||
Files: src/gui_w48.c
|
||||
|
||||
Patch 6.3.053
|
||||
Problem: Win32: ":loadview" cannot find a file with non-ASCII characters.
|
||||
(Valerie Kondakoff)
|
||||
Solution: Use mch_open() instead of open() to open the file.
|
||||
Files: src/ex_cmds2.c
|
||||
|
||||
Patch 6.3.054
|
||||
Problem: When 'insertmode' is set <C-L>4ixxx<C-L> hangs Vim. (Jens Paulus)
|
||||
Vim is actually still working but redraw is disabled.
|
||||
Solution: When stopping Insert mode with CTRL-L don't put an Esc in the redo
|
||||
buffer but a CTRL-L.
|
||||
Files: src/edit.c
|
||||
|
||||
Patch 6.3.055 (after 6.3.013)
|
||||
Problem: Can't use getcmdline(), getcmdpos() or setcmdpos() with <C-R>=
|
||||
when editing a command line. Using <C-\>e may crash Vim. (Peter
|
||||
Winters)
|
||||
Solution: When moving ccline out of the way for recursive use, make it
|
||||
available to the functions that need it. Also save and restore
|
||||
ccline when calling get_expr_line(). Make ccline.cmdbuf NULL at
|
||||
the end of getcmdline().
|
||||
Files: src/ex_getln.c
|
||||
|
||||
Patch 6.3.056
|
||||
Problem: The last characters of a multi-byte file name may not be displayed
|
||||
in the window title.
|
||||
Solution: Avoid to remove a multi-byte character where the last byte looks
|
||||
like a path separator character. (Yasuhiro Matsumoto)
|
||||
Files: src/buffer.c, src/ex_getln.c
|
||||
|
||||
Patch 6.3.057
|
||||
Problem: When filtering lines folds are not updated. (Carl Osterwisch)
|
||||
Solution: Update folds for filtered lines.
|
||||
Files: src/ex_cmds.c
|
||||
|
||||
Patch 6.3.058
|
||||
Problem: When 'foldcolumn' is equal to the window width and 'wrap' is on
|
||||
Vim may crash. Disabling the vertical split feature breaks
|
||||
compiling. (Peter Winters)
|
||||
Solution: Check for zero room for wrapped text. Make compiling without
|
||||
vertical splits possible.
|
||||
Files: src/move.c, src/quickfix.c, src/screen.c, src/netbeans.c
|
||||
|
||||
Patch 6.3.059
|
||||
Problem: Crash when expanding an ":edit" command containing several spaces
|
||||
with the shell. (Brian Hirt)
|
||||
Solution: Allocate enough space for the quotes.
|
||||
Files: src/os_unix.c
|
||||
|
||||
Patch 6.3.060
|
||||
Problem: Using CTRL-R CTRL-O in Insert mode with an invalid register name
|
||||
still causes something to be inserted.
|
||||
Solution: Check the register name for being valid.
|
||||
Files: src/edit.c
|
||||
|
||||
Patch 6.3.061
|
||||
Problem: When editing a utf-8 file in an utf-8 xterm and there is a
|
||||
multi-byte character in the last column, displaying is messed up.
|
||||
(Jo<4A>l Rio)
|
||||
Solution: Check for a multi-byte character, not a multi-column character.
|
||||
Files: src/screen.c
|
||||
|
||||
Patch 6.3.062
|
||||
Problem: ":normal! gQ" hangs.
|
||||
Solution: Quit getcmdline() and do_exmode() when out of typeahead.
|
||||
Files: src/ex_getln.c, src/ex_docmd.c
|
||||
|
||||
Patch 6.3.063
|
||||
Problem: When a CursorHold autocommand changes to another window
|
||||
(temporarily) 'mousefocus' stops working.
|
||||
Solution: Call gui_mouse_correct() after triggering CursorHold.
|
||||
Files: src/gui.c
|
||||
|
||||
Patch 6.3.064
|
||||
Problem: line2byte(line("$") + 1) sometimes returns the wrong number.
|
||||
(Charles Campbell)
|
||||
Solution: Flush the cached line before counting the bytes.
|
||||
Files: src/memline.c
|
||||
|
||||
Patch 6.3.065
|
||||
Problem: The euro digraph doesn't always work.
|
||||
Solution: Add an "e=" digraph for Unicode euro character and adjust the
|
||||
help files.
|
||||
Files: src/digraph.c, runtime/doc/digraph.txt
|
||||
|
||||
Patch 6.3.066
|
||||
Problem: Backup file may get wrong permissions.
|
||||
Solution: Use permissions of original file for backup file in more places.
|
||||
Files: src/fileio.c
|
||||
|
||||
Patch 6.3.067 (after 6.3.066)
|
||||
Problem: Newly created file gets execute permission.
|
||||
Solution: Check for "perm" to be negative before using it.
|
||||
Files: src/fileio.c
|
||||
|
||||
Patch 6.3.068
|
||||
Problem: When editing a compressed file xxx.gz which is a symbolic link to
|
||||
the actual file a ":write" renames the link.
|
||||
Solution: Resolve the link, so that the actual file is renamed and
|
||||
compressed.
|
||||
Files: runtime/plugin/gzip.vim
|
||||
|
||||
Patch 6.3.069
|
||||
Problem: When converting text with illegal characters Vim may crash.
|
||||
Solution: Avoid that too much is subtracted from the length. (Da Woon Jung)
|
||||
Files: src/mbyte.c
|
||||
|
||||
Patch 6.3.070
|
||||
Problem: After ":set number linebreak wrap" and a vertical split, moving
|
||||
the vertical separator far left will crash Vim. (Georg Dahn)
|
||||
Solution: Avoid dividing by zero.
|
||||
Files: src/charset.c
|
||||
|
||||
Patch 6.3.071
|
||||
Problem: The message for CTRL-X mode is still displayed after an error for
|
||||
'thesaurus' or 'dictionary' being empty.
|
||||
Solution: Clear "edit_submode".
|
||||
Files: src/edit.c
|
||||
|
||||
Patch 6.3.072
|
||||
Problem: Crash in giving substitute message when language is Chinese and
|
||||
encoding is utf-8. (Yongwei)
|
||||
Solution: Make the msg_buf size larger when using multi-byte.
|
||||
Files: src/vim.h
|
||||
|
||||
Patch 6.3.073
|
||||
Problem: Win32 GUI: When the Vim window is partly above or below the
|
||||
screen, scrolling causes display errors when the taskbar is not on
|
||||
that side.
|
||||
Solution: Use the SW_INVALIDATE flag when the Vim window is partly below or
|
||||
above the screen.
|
||||
Files: src/gui_w48.c
|
||||
|
||||
Patch 6.3.074
|
||||
Problem: When mswin.vim is used and 'insertmode' is set, typing text in
|
||||
Select mode and then using CTRL-V results in <SNR>99_Pastegi.
|
||||
(Georg Dahn)
|
||||
Solution: When restart_edit is set use "d" instead of "c" to remove the
|
||||
selected text to avoid calling edit() twice.
|
||||
Files: src/normal.c
|
||||
|
||||
Patch 6.3.075
|
||||
Problem: After unloading another buffer, syntax highlighting in the current
|
||||
buffer may be wrong when it uses "containedin". (Eric Arnold)
|
||||
Solution: Use "buf" intead of "curbuf" in syntax_clear().
|
||||
Files: src/syntax.c
|
||||
|
||||
Patch 6.3.076
|
||||
Problem: Crash when using cscope and there is a parse error (e.g., line too
|
||||
long). (Alexey I. Froloff)
|
||||
Solution: Pass the actual number of matches to cs_manage_matches() and
|
||||
correctly handle the error situation.
|
||||
Files: src/if_cscope.c
|
||||
|
||||
Patch 6.3.077 (extra)
|
||||
Problem: VMS: First character input after ESC was not recognized.
|
||||
Solution: Added TRM$M_TM_TIMED in vms_read(). (Zoltan Arpadffy)
|
||||
Files: src/os_vms.c
|
||||
|
||||
Patch 6.3.078 (extra, after 6.3.077)
|
||||
Problem: VMS: Performance issue after patch 6.3.077
|
||||
Solution: Add a timeout in the itemlist. (Zoltan Arpadffy)
|
||||
Files: src/os_vms.c
|
||||
|
||||
Patch 6.3.079
|
||||
Problem: Crash when executing a command in the command line window while
|
||||
syntax highlighting is enabled. (Pero Brbora)
|
||||
Solution: Don't use a pointer to a buffer that has been deleted.
|
||||
Files: src/syntax.c
|
||||
|
||||
Patch 6.3.080 (extra)
|
||||
Problem: Win32: With 'encoding' set to utf-8 while the current codepage is
|
||||
Chinese editing a file with some specific characters in the name
|
||||
fails.
|
||||
Solution: Use _wfullpath() instead of _fullpath() when necessary.
|
||||
Files: src/os_mswin.c
|
||||
|
||||
Patch 6.3.081
|
||||
Problem: Unix: glob() may execute a shell command when it's not wanted.
|
||||
(Georgi Guninski)
|
||||
Solution: Verify the sandbox flag is not set.
|
||||
Files: src/os_unix.c
|
||||
|
||||
Patch 6.3.082 (after 6.3.081)
|
||||
Problem: Unix: expand() may execute a shell command when it's not wanted.
|
||||
(Georgi Guninski)
|
||||
Solution: A more generic solution than 6.3.081.
|
||||
Files: src/os_unix.c
|
||||
|
||||
Patch 6.3.083
|
||||
Problem: VMS: The vt320 termcap entry is incomplete.
|
||||
Solution: Add missing function keys. (Zoltan Arpadffy)
|
||||
Files: src/term.c
|
||||
|
||||
Patch 6.3.084 (extra)
|
||||
Problem: Cygwin: compiling with DEBUG doesn't work. Perl path was ignored.
|
||||
Failure when $(OUTDIR) already exists. "po" makefile is missing.
|
||||
Solution: Use changes tested in Vim 7. (Tony Mechelynck)
|
||||
Files: src/Make_cyg.mak, src/po/Make_cyg.mak
|
||||
|
||||
Patch 6.3.085
|
||||
Problem: Crash in syntax highlighting code. (Marc Espie)
|
||||
Solution: Prevent current_col going past the end of the line.
|
||||
Files: src/syntax.c
|
||||
|
||||
Patch 6.3.086 (extra)
|
||||
Problem: Can't produce message translation file with msgfmt that checks
|
||||
printf strings.
|
||||
Solution: Fix the Russian translation.
|
||||
Files: src/po/ru.po, src/po/ru.cp1251.po
|
||||
|
||||
Patch 6.3.087
|
||||
Problem: MS-DOS: Crash. (Jason Hood)
|
||||
Solution: Don't call fname_case() with a NULL pointer.
|
||||
Files: src/ex_cmds.c
|
||||
|
||||
Patch 6.3.088
|
||||
Problem: Editing ".in" causes error E218. (Stefan Karlsson)
|
||||
Solution: Require some characters before ".in". Same for ".orig" and others.
|
||||
Files: runtime/filetype.vim
|
||||
|
||||
Patch 6.3.089
|
||||
Problem: A session file doesn't work when created while the current
|
||||
directory contains a space or the directory of the session files
|
||||
contains a space. (Paolo Giarrusso)
|
||||
Solution: Escape spaces with a backslash.
|
||||
Files: src/ex_docmd.c
|
||||
|
||||
Patch 6.3.090
|
||||
Problem: A very big value for 'columns' or 'lines' may cause a crash.
|
||||
Solution: Limit the values to 10000 and 1000.
|
||||
Files: src/option.c
|
||||
|
||||
Patch 6.4a.001
|
||||
Problem: The Unix Makefile contained too many dependencies and a few
|
||||
uncommented lines.
|
||||
Solution: Run "make depend" with manual changes to avoid a gcc
|
||||
incompatibility. Comment a few lines.
|
||||
Files: src/Makefile
|
||||
|
||||
Patch 6.4b.001
|
||||
Problem: Vim reports "Vim 6.4a" in the ":version" output.
|
||||
Solution: Change "a" to "b". (Tony Mechelynck)
|
||||
Files: src/version.h
|
||||
|
||||
Patch 6.4b.002
|
||||
Problem: In Insert mode, pasting a multi-byte character after the end of
|
||||
the line leaves the cursor just before that character.
|
||||
Solution: Make sure "gP" leaves the cursor in the right place when
|
||||
'virtualedit' is set.
|
||||
Files: src/ops.c
|
||||
|
||||
Patch 6.4b.003 (after 6.4b.002)
|
||||
Problem: The problem still exists when 'encoding' is set to "cp936".
|
||||
Solution: Fix the problem in getvvcol(), compute the coladd field correctly.
|
||||
Files: src/charset.c, src/ops.c
|
||||
|
||||
Patch 6.4b.004
|
||||
Problem: Selecting a {} block with "viB" includes the '}' when there is an
|
||||
empty line before it.
|
||||
Solution: Don't advance the cursor to include a line break when it's already
|
||||
at the line break.
|
||||
Files: src/search.c
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*version7.txt* For Vim version 7.0aa. Last change: 2005 Jun 07
|
||||
*version7.txt* For Vim version 7.0aa. Last change: 2006 Jan 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -20,13 +20,16 @@ NEW FEATURES |new-7|
|
||||
|
||||
Vim script enhancements |new-vim-script|
|
||||
Spell checking |new-spell|
|
||||
KDE support |new-KDE|
|
||||
Omni completion |new-omni-completion|
|
||||
MzScheme interface |new-MzScheme|
|
||||
Printing multi-byte text |new-print-multi-byte|
|
||||
Translated manual pages |new-manpage-trans|
|
||||
Internal grep |new-vimgrep|
|
||||
Scroll back in messages |new-scroll-back|
|
||||
POSIX compatibility |new-posix|
|
||||
Debugger support |new-debug-support|
|
||||
Remote file explorer |new-netrw-explore|
|
||||
Define an operator |new-define-operator|
|
||||
Various new items |new-items-7|
|
||||
|
||||
IMPROVEMENTS |improvements-7|
|
||||
@@ -61,6 +64,11 @@ In a |literal-string| a single quote can be doubled to get one.
|
||||
":echo 'a''b'" would result in "a b", but now that two quotes stand for one it
|
||||
results in "a'b".
|
||||
|
||||
When overwriting a file with ":w! fname" there was no warning for when "fname"
|
||||
was being edited by another Vim. Vim now gives an error message |E768|.
|
||||
|
||||
The support for Mac OS 9 has been removed.
|
||||
|
||||
|
||||
Minor incompatibilities:
|
||||
|
||||
@@ -111,6 +119,17 @@ translated to <Home>, both for the keys and for mappings. Also for <xEnd>,
|
||||
|
||||
":put" now leaves the cursor on the last inserted line.
|
||||
|
||||
When a .gvimrc file exists then 'compatible' is off, just like when a ".vimrc"
|
||||
file exists.
|
||||
|
||||
When making a string upper-case with "vlllU" or similar then the German sharp
|
||||
s is replaced with "SS". This does not happen with "~" to avoid backwards
|
||||
compatibility problems and because "SS" can't be changed back to a sharp s.
|
||||
|
||||
"gd" previously found the very first occurrence of a variable in a function,
|
||||
that could be the function argument without type. Now it finds the position
|
||||
where the type is given.
|
||||
|
||||
==============================================================================
|
||||
NEW FEATURES *new-7*
|
||||
|
||||
@@ -135,6 +154,9 @@ expr". "-=" and ".=" works in a similar way.
|
||||
With the |:profile| command you can find out where your function or script
|
||||
wastes its time.
|
||||
|
||||
In the Python interface vim.eval() also handles Dictionaries and Lists.
|
||||
|python-eval| (G. Sumner Hayes)
|
||||
|
||||
|
||||
Spell checking *new-spell*
|
||||
--------------
|
||||
@@ -144,6 +166,13 @@ with scripts, but they were slow and/or required an external program.
|
||||
|
||||
The 'spell' option is used to switch spell checking on or off.
|
||||
The 'spelllang' option is used to specify the languages that are accepted.
|
||||
The 'spellfile' option specifies where new words are added.
|
||||
The 'spellsuggest' option specifies the methods used for making suggestions
|
||||
|
||||
The |[s| and |]s| commands can be used to move to the next or previous error.
|
||||
The |zg| and |zw| commands can be used to add good and wrong words.
|
||||
The |z=| command can be used to correct the word.
|
||||
The |:mkspell| command is used to generate a Vim spell file from word lists.
|
||||
|
||||
The "undercurl" highlighting attribute was added to nicely point out spelling
|
||||
mistakes in the GUI (based on patch from Marcin Dalecki).
|
||||
@@ -157,11 +186,25 @@ highlighting.
|
||||
Much more info here: |spell|.
|
||||
|
||||
|
||||
KDE support *new-KDE*
|
||||
-----------
|
||||
Omni completion *new-omni-completion*
|
||||
-----------------
|
||||
|
||||
Kvim is the KDE version of Vim. It uses the Qt toolkit. See |KVim|.
|
||||
(Thomas Capricelli, Philippe Fremy, Mickael Marchand, Mark Westcott, et al.)
|
||||
This could also be called "intellisense", but that is a trademark. It is a
|
||||
smart kind of completion. The text in front of the cursor is inspected to
|
||||
figure out what could be following. This considers struct and class members,
|
||||
unions, etc.
|
||||
|
||||
Use CTRL-X CTRL-O in Insert mode to start the completion. |i_CTRL-X_CTRL-O|
|
||||
|
||||
The 'omnifunc' option is set by filetype plugins to define the function that
|
||||
figures out the completion.
|
||||
|
||||
Currently supported languages:
|
||||
C |ft-c-omni|
|
||||
XHTML |ft-html-omni|
|
||||
|
||||
When the 'completeopt' option contains "menu" then matches for Insert mode
|
||||
completion are displayed in a popup menu.
|
||||
|
||||
|
||||
MzScheme interface *new-MzScheme*
|
||||
@@ -212,6 +255,24 @@ patterns, this also allows grepping in compressed and remote files.
|
||||
If you want to use the search results in a script you can use the
|
||||
|getqflist()| function.
|
||||
|
||||
To search in files in various directories the "**" pattern can be used. It
|
||||
expands into an arbitrary depth of directories. "**" can be used in all
|
||||
places where file names are expanded, thus also with |:next| and |:args|.
|
||||
|
||||
|
||||
Scroll back in messages *new-scroll-back*
|
||||
-----------------------
|
||||
|
||||
When displaying messages, at the |more-prompt| and the |hit-enter-prompt|, The
|
||||
'k', 'u' and 'b' keys can be used to scroll back to previous messages. This
|
||||
is especially useful for commands such as ":syntax", ":autocommand" and
|
||||
":highlight". This is implemented in a generic way thus it works for all
|
||||
commands and highlighting is kept. Only works when the 'more' option is set.
|
||||
Previously it only partly worked for ":clist".
|
||||
|
||||
The |g<| command can be used to see the last page of messages after you have
|
||||
hit <Enter> at the |hit-enter-prompt|. Then you can scroll further back.
|
||||
|
||||
|
||||
POSIX compatibility *new-posix*
|
||||
-------------------
|
||||
@@ -268,22 +329,63 @@ balloon functionality. You can use it to show info for the word under the
|
||||
mouse pointer.
|
||||
|
||||
|
||||
Remote file explorer *new-netrw-explore*
|
||||
--------------------
|
||||
|
||||
The netrw plugin now also supports viewing a directory, when "scp://" is used.
|
||||
Deleting and renaming files is possible.
|
||||
|
||||
To avoid duplicating a lot of code, the previous file explorer plugin has been
|
||||
integrated in the netrw plugin. This means browsing local and remote files
|
||||
works the same way.
|
||||
|
||||
":browse edit" and ":browse split" use the netrw plugin when it's available
|
||||
and a GUI dialog is not possible.
|
||||
|
||||
The netrw plugin is maintained by Charles Campbell.
|
||||
|
||||
|
||||
Define an operator *new-define-operator*
|
||||
------------------
|
||||
|
||||
Previously it was not possible to define your own operator; a command that is
|
||||
followed by a {motion}. Vim 7 introduces the 'operatorfunc' option and the
|
||||
|g@| operator. This makes it possible to define a mapping that works like an
|
||||
operator. The actual work is then done by a function, which is invoked
|
||||
through the |g@| operator.
|
||||
|
||||
See |:map-operator| for the explanation and an example.
|
||||
|
||||
|
||||
Various new items *new-items-7*
|
||||
-----------------
|
||||
|
||||
Normal mode commands: ~
|
||||
|
||||
a", a' and a` New text objects to select quoted strings. |a'|
|
||||
i", i' and i' (Taro Muraoka)
|
||||
i", i' and i` (Taro Muraoka)
|
||||
|
||||
CTRL-W <Enter> In the quickfix window: opens a new window to show the
|
||||
location of the error under the cursor.
|
||||
|
||||
|at| and |it| text objects select a block of text between HTML or XML tags.
|
||||
|
||||
<A-LeftMouse> ('mousemodel' "popup" or "popup-setpos")
|
||||
<A-RightMouse> ('mousemodel' "extend")
|
||||
Make a blockwise selection. |<A-LeftMouse>|
|
||||
|
||||
Insert mode commands: ~
|
||||
|
||||
CTRL-\ CTRL-O Execute a Normal mode command. Like CTRL-O but
|
||||
without moving the cursor.
|
||||
|
||||
Options: ~
|
||||
|
||||
'completefunc' The name of a function used for user-specified Insert
|
||||
mode completion. CTRL-X CTRL-U can be used in Insert
|
||||
mode to do any kind of completion. (Taro Muraoka)
|
||||
'completeopt' Enable popup menu for Insert mode completion.
|
||||
'omnifunc' The name of a function used for omni completion.
|
||||
'quoteescape' Characters used to escape quotes inside a string.
|
||||
Used for the a", a' and a` text objects. |a'|
|
||||
'numberwidth' Minimal width of the space used for the 'number'
|
||||
@@ -300,6 +402,9 @@ Options: ~
|
||||
(idea by Hugo Haas)
|
||||
'spell' switch spell checking on/off
|
||||
'spelllang' languages to check spelling for
|
||||
'spellsuggest' methods for spell suggestions
|
||||
'synmaxcol' maximum column to look for syntax items; avoids very
|
||||
slow redrawing when there are very long lines
|
||||
'verbosefile' Log messages in a file.
|
||||
|
||||
|
||||
@@ -308,18 +413,15 @@ Ex commands: ~
|
||||
Win32: The ":winpos" command now also works in the console. (Vipin Aravind)
|
||||
|
||||
|:startreplace| Start Replace mode. (Charles Campbell)
|
||||
|:startgreplace| Start Virtual Replace mode.
|
||||
|
||||
|:0file| Removes the name of the buffer. (Charles Campbell)
|
||||
|
||||
|:diffoff| Switch off diff mode in the current window or in all
|
||||
windows.
|
||||
|
||||
|:keepalt| Do not change the alternate file.
|
||||
|
||||
|:delmarks| Delete marks.
|
||||
|
||||
|:sandbox| Command modifier: execute the argument in the sandbox.
|
||||
|
||||
|:exusage| Help for Ex commands (Nvi command).
|
||||
|
||||
|:viusage| Help for Vi commands (Nvi command).
|
||||
@@ -330,14 +432,44 @@ Win32: The ":winpos" command now also works in the console. (Vipin Aravind)
|
||||
|:sort| Sort lines in the buffer without depending on an
|
||||
external command.
|
||||
|
||||
|:caddfile| Add error messages to an existing quickfix list
|
||||
(Yegappan Lakshmanan).
|
||||
|
||||
New functions: ~
|
||||
|:cexpr| Read error messages from a Vim expression (Yegappan
|
||||
Lakshmanan).
|
||||
|
||||
|:caddexpr| Add error messages from a Vim expression to an
|
||||
existing quickfix list. (Yegappan Lakshmanan).
|
||||
|
||||
|
||||
Ex command modifiers: ~
|
||||
|
||||
|:keepalt| Do not change the alternate file.
|
||||
|
||||
|:noautocmd| Do not trigger autocommand events.
|
||||
|
||||
|:sandbox| Execute a command in the sandbox.
|
||||
|
||||
|
||||
Ex command arguments: ~
|
||||
|
||||
|++bad| Specify what happens with characters that can't be
|
||||
converted and illegal bytes. (code example by Yasuhiro
|
||||
Matsumoto)
|
||||
Also, when a conversion error occurs or illegal bytes
|
||||
are found include the line number in the error
|
||||
message.
|
||||
|
||||
|
||||
New and extended functions: ~
|
||||
|
||||
|add()| append an item to a List
|
||||
|append()| append List of lines to the buffer
|
||||
|browsedir()| Dialog to select a directory.
|
||||
|byteidx()| Index of a character. (Ilya Sher)
|
||||
|browsedir()| dialog to select a directory
|
||||
|byteidx()| index of a character (Ilya Sher)
|
||||
|call()| call a function with List as arguments
|
||||
|complete_add()| add match for 'completefunc'
|
||||
|complete_check()| check for key pressed, for 'completefunc'
|
||||
|copy()| make a shallow copy of a List or Dictionary
|
||||
|count()| count nr of times a value is in a List or Dictionary
|
||||
|deepcopy()| make a full copy of a List or Dictionary
|
||||
@@ -346,16 +478,21 @@ New functions: ~
|
||||
|extend()| append one List to another or add items from one
|
||||
Dictionary to another
|
||||
|filter()| remove selected items from a List or Dictionary
|
||||
|finddir()| Find a directory in 'path'.
|
||||
|findfile()| Find a file in 'path'. (Johannes Zellner)
|
||||
|foldtextresult()| The text displayed for a closed fold at line "lnum".
|
||||
|finddir()| find a directory in 'path'
|
||||
|findfile()| find a file in 'path' (Johannes Zellner)
|
||||
|foldtextresult()| the text displayed for a closed fold at line "lnum"
|
||||
|function()| make a Funcref out of a function name
|
||||
|get()| get an item from a List or Dictionary
|
||||
|getfontname()| Get actual font name being used.
|
||||
|getfperm()| Get file permission string. (Nikolai Weibull)
|
||||
|getftype()| Get type of file. (Nikolai Weibull)
|
||||
|getline()| With second argument: get List with buffer lines
|
||||
|getbufline()| get a list of lines from a specified buffer
|
||||
(Yegappan Lakshmanan)
|
||||
|getcmdtype()| return the current command-line type
|
||||
(Yegappan Lakshmanan)
|
||||
|getfontname()| get actual font name being used
|
||||
|getfperm()| get file permission string (Nikolai Weibull)
|
||||
|getftype()| get type of file (Nikolai Weibull)
|
||||
|getline()| with second argument: get List with buffer lines
|
||||
|has_key()| check whether a key appears in a Dictionary
|
||||
|inputlist()| select an entry from a list
|
||||
|insert()| insert an item somewhere in a List
|
||||
|items()| get List of Dictionary key-value pairs
|
||||
|join()| join List items into a String
|
||||
@@ -366,17 +503,22 @@ New functions: ~
|
||||
|max()| maximum value in a List or Dictionary
|
||||
|min()| minimum value in a List or Dictionary
|
||||
|mkdir()| create a directory
|
||||
|printf()| format text
|
||||
|readfile()| read a file into a list of lines
|
||||
|remove()| remove one or more items from a List or Dictionary
|
||||
|repeat()| Repeat "expr" "count" times. (Christophe Poucet)
|
||||
|repeat()| repeat "expr" "count" times (Christophe Poucet)
|
||||
|reverse()| reverse the order of a List
|
||||
|searchdecl()| search for declaration of variable
|
||||
|setqflist()| create a quickfix list (Yegappan Lakshmanan)
|
||||
|sort()| sort a List
|
||||
|soundfold()| get the sound-a-like equivalent of a word
|
||||
|split()| split a String into a List
|
||||
|string()| String representation of a List or Dictionary
|
||||
|system()| Filters {input} through a shell command.
|
||||
|taglist()| Get list of matching tags. (Yegappan Lakshmanan)
|
||||
|tr()| Translate characters. (Ron Aaron)
|
||||
|spellbadword()| get a badly spelled word
|
||||
|spellsuggest()| get suggestions for correct spelling
|
||||
|string()| string representation of a List or Dictionary
|
||||
|system()| filters {input} through a shell command
|
||||
|taglist()| get list of matching tags (Yegappan Lakshmanan)
|
||||
|tr()| translate characters (Ron Aaron)
|
||||
|values()| get List of Dictionary values
|
||||
|writefile()| write a list of lines into a file
|
||||
|
||||
@@ -393,6 +535,7 @@ New autocommand events: ~
|
||||
|ColorScheme| after loading a color scheme
|
||||
|QuickFixCmdPre| before :make, :grep et al. (Ciaran McCreesh)
|
||||
|QuickFixCmdPost| after :make, :grep et al. (Ciaran McCreesh)
|
||||
|SessionLoadPost| after loading a session file. (Yegappan Lakshmanan)
|
||||
|
||||
|
||||
New items in search patterns: ~
|
||||
@@ -407,9 +550,15 @@ New items in search patterns: ~
|
||||
|/\%U| \%U1234abcd search for character with 8 pos. hex number
|
||||
|/\]| [\U1234abcd] idem, in a colletion
|
||||
(The above partly by Ciaran McCreesh)
|
||||
|
||||
|/[[=| [[=a=]] an equivalence class (only for latin1 characters)
|
||||
|/[[.| [[.a.]] a collation element (only works with single char)
|
||||
|
||||
|/\%'m| \%'m match at mark m
|
||||
|/\%<'m| \%<'m match before mark m
|
||||
|/\%>'m| \%>'m match after mark m
|
||||
|/\%V| \%V match in Visual area
|
||||
|
||||
Nesting |/multi| items no longer is an error when an empty match is possible.
|
||||
|
||||
It is now possible to use \{0}, it matches the preceding atom zero times. Not
|
||||
@@ -430,6 +579,10 @@ Sive syntax file. (Nikolai Weibull)
|
||||
|
||||
Pascal indent file. (Neil Carter)
|
||||
|
||||
Many filetype plugins and others from Nikolai Weibull.
|
||||
|
||||
Xquery syntax file. (Jean-Marc Vanel)
|
||||
|
||||
Moved all the indent settings from the filetype plugin to the indent file.
|
||||
Implemented b:undo_indent to undo indent settings when setting 'filetype' to a
|
||||
different value.
|
||||
@@ -456,24 +609,23 @@ character selections can be used between two Vims. (Eckehard Berns)
|
||||
Also fixes the problem that setting 'clipboard' to "unnamed" breaks using
|
||||
"yyp".
|
||||
|
||||
Mac: GUI font selector. (Peter "Rain Dog" Cucka)
|
||||
Mac: GUI font selector. (Peter Cucka)
|
||||
|
||||
Mac: support for multi-byte characters. (Da Woon Jung)
|
||||
|
||||
Mac: Support the xterm mouse in the non-GUI version.
|
||||
|
||||
Mac: better integration with Xcode. Post a fake mouse-up event after the odoc
|
||||
event and the drag receive handler to work around a stall after Vim loads a
|
||||
file. Fixed an off-by-one line number error. (Da Woon Jung)
|
||||
|
||||
Added the t_SI and t_EI escape sequences for starting and ending Insert mode.
|
||||
GUI font selector for Motif. (Marcin Dalecki)
|
||||
|
||||
Nicer toolbar buttons for Motif. (Marcin Dalecki)
|
||||
|
||||
Mnemonics for the Motif find/replace dialog. (Marcin Dalecki)
|
||||
|
||||
Mac: better integration with Xcode. Post a fake mouse-up event after the odoc
|
||||
event and the drag receive handler to work around a stall after Vim loads a
|
||||
file. Fixed an off-by-one line number error. (Da Woon Jung)
|
||||
|
||||
The netrw plugin now also supports viewing a directory, when "scp://" is used.
|
||||
Deleting and renaming files is possible. (Charles Campbell)
|
||||
|
||||
Added the t_SI and t_EI escape sequences for starting and ending Insert mode.
|
||||
To be used to set the cursor shape to a bar or a block. No default values,
|
||||
they are not supported by termcap/terminfo.
|
||||
|
||||
@@ -484,6 +636,31 @@ when the buffer does not have a name or no specific name. See
|
||||
For xterm most combinations of modifiers with function keys are recognized.
|
||||
|xterm-modifier-keys|
|
||||
|
||||
When 'verbose' is set the output of ":highlight" will show where a highlight
|
||||
item was last set.
|
||||
When 'verbose' is set the output of the ":map", ":abbreviate", ":command",
|
||||
":function" and ":autocmd" commands will show where it was last defined.
|
||||
(Yegappan Lakshmanan)
|
||||
|
||||
":function /pattern" lists functions matching the pattern.
|
||||
|
||||
"1gd" can be used like "gd" but ignores matches in a {} block that ends before
|
||||
the cursor position. Likewise for "1gD" and "gD".
|
||||
|
||||
'scrolljump' can be set to a negative number to scroll a percentage of the
|
||||
window height.
|
||||
|
||||
The |v:scrollstart| variable has been added to help finding the location in
|
||||
your script that causes the hit-enter prompt.
|
||||
|
||||
To make it possible to handle the situation that a file is being edited that
|
||||
is already being edited by another Vim instance, the |SwapExists| event has
|
||||
been added. The |v:swapname|, |v:swapchoice| and |v:swapcommand| variables
|
||||
can be used, for example to use the |client-server| functionality to bring the
|
||||
other Vim to the foreground.
|
||||
When starting Vim with a "-t tag" argument, there is an existing swapfile and
|
||||
the user selects "quit" or "abort" then exit Vim.
|
||||
|
||||
==============================================================================
|
||||
IMPROVEMENTS *improvements-7*
|
||||
|
||||
@@ -491,11 +668,23 @@ IMPROVEMENTS *improvements-7*
|
||||
|
||||
Move the help for printing to a separate help file. It's quite a lot now.
|
||||
|
||||
When ":silent" is used and a backwards range is given for an Ex command the
|
||||
range is swapped automatically instead of asking if that is OK.
|
||||
|
||||
The pattern matching code was changed from a recursive function to an
|
||||
iterative mechanism. This avoids out-of-stack errors. State is stored in
|
||||
allocated memory, running out of memory can always be detected. Allows
|
||||
matching more complex things, but Vim may seem to hang while doing that.
|
||||
|
||||
Previously some options were always evaluated in the |sandbox|. Now that only
|
||||
happens when the option was set from a modeline or in secure mode. Applies to
|
||||
'balloonexpr', 'foldexpr', 'foldtext' and 'includeexpr'. (Sumner Hayes)
|
||||
|
||||
Some commands and expressions could have nasty side effects, such as using
|
||||
CTRL-R = while editing a search pattern and the expression invokes a function
|
||||
that jumps to another window. The |textlock| has been added to prevent this
|
||||
from happening.
|
||||
|
||||
":breakadd here" and ":breakdel here" can be used to set or delete a
|
||||
breakpoint at the cursor.
|
||||
|
||||
@@ -505,10 +694,14 @@ few more important commands. Used ideas from Gabriel Zachmann.
|
||||
Unix: When libcall() fails obtain an error message with dlerror() and display
|
||||
it. (Johannes Zellner)
|
||||
|
||||
Mac and Cygwin: When editing an existing file make the file name the same case
|
||||
of the edited file. Thus when typing ":e os_UNIX.c" the file name becomes
|
||||
"os_unix.c".
|
||||
|
||||
Added "nbsp" in 'listchars'. (David Blanchet)
|
||||
|
||||
Added the "acwrite" value for the 'buftype' option. This is for a buffer that
|
||||
doesn not have a name that refers to a file and is written with BufWriteCmd
|
||||
does not have a name that refers to a file and is written with BufWriteCmd
|
||||
autocommands.
|
||||
|
||||
For lisp indenting and matching parenthesis: (Sergey Khorev)
|
||||
@@ -567,6 +760,10 @@ the swap file to indicate it is in the same directory as the edited file. The
|
||||
used path then doesn't matter and the check for editing the same file is much
|
||||
more reliable.
|
||||
|
||||
Unix: When editing a file through a symlink the swap file would use the name
|
||||
of the symlink. Now use the name of the actual file, so that editing the same
|
||||
file twice is detected. (suggestions by Stefano Zacchiroli and James Vega)
|
||||
|
||||
Client-server communication now supports 'encoding'. When setting 'encoding'
|
||||
in a Vim server to "utf-8", and using "vim --remote fname" in a console,
|
||||
"fname" is converted from the console encoding to utf-8. Also allows Vims
|
||||
@@ -589,7 +786,7 @@ invalid characters after the register name. |:redir|
|
||||
":redir => variable" and ":redir =>> variable" write or append to a variable.
|
||||
(Yegappan Lakshmanan) |:redir|
|
||||
|
||||
":redir @{a-z}>>" appends to register a to z.
|
||||
":redir @{a-z}>>" appends to register a to z. (Yegappan Lakshmanan)
|
||||
|
||||
The 'verbosefile' option can be used to log messages in a file. Verbose
|
||||
messages are not displayed then. The "-V{filename}" argument can be used to
|
||||
@@ -628,7 +825,7 @@ To count items (pattern matches) without changing the buffer the 'n' flag has
|
||||
been added to |:substitute|. See |count-items|.
|
||||
|
||||
The "screen.linux" $TERM name is recognized to set the default for
|
||||
'background' to "dark". (Ciaran McCreesh) Also for "cygwin".
|
||||
'background' to "dark". (Ciaran McCreesh) Also for "cygwin" and "putty".
|
||||
|
||||
The |FileChangedShell| autocommand event can now use the |v:fcs_reason|
|
||||
variable that specifies what triggered the event. |v:fcs_choice| can be used
|
||||
@@ -649,6 +846,107 @@ Added the "%s" item to 'errorformat'. (Yegappan Lakshmanan)
|
||||
GTK GUI: use the GTK file dialog when it's available. Mix from patches by
|
||||
Grahame Bowland and Evan Webb.
|
||||
|
||||
Added ":scriptnames" to bugreport.vim, so that we can see what plugins were
|
||||
used.
|
||||
|
||||
Win32: If the user changes the setting for the number of lines a scroll wheel
|
||||
click scrolls it is now used immediately. Previously Vim would need to be
|
||||
restarted.
|
||||
|
||||
When using @= in an expression the value is expression @= contains. ":let @=
|
||||
= value" can be used to set the register contents.
|
||||
|
||||
A ! can be added to ":popup" to have the popup menu appear at the mouse
|
||||
pointer position instead of the text cursor.
|
||||
|
||||
The table with encodings has been expanded with many MS-Windows codepages,
|
||||
such as cp1250 and cp737, so that these can also be used on Unix without
|
||||
prepending "8bit-".
|
||||
When an encoding name starts with "microsoft-cp" ignore the "microsoft-" part.
|
||||
|
||||
Added the "customlist" completion argument to a user-defined command. The
|
||||
user-defined completion function should return the completion candidates as a
|
||||
Vim List and the returned results are not filtered by Vim. (Yegappan
|
||||
Lakshmanan)
|
||||
|
||||
Win32: Balloons can have multiple lines if common controls supports it.
|
||||
(Sergey Khorev)
|
||||
|
||||
The 's' flag is added to the search() and searchpair() function to set the
|
||||
' mark if the cursor is moved. (Yegappan Lakshmanan)
|
||||
|
||||
For 'errorformat' it was not possible to have a file name that contains the
|
||||
character that follows after "%f". For example, in "%f:%l:%m" the file name
|
||||
could not contain ":". Now include the first ":" where the rest of the
|
||||
pattern matches. In the example a ":" not followed by a line number is
|
||||
included in the file name. (suggested by Emanuele Giaquinta)
|
||||
|
||||
For command-line completion the matches for various types of arguments are now
|
||||
sorted: user commands, variables, syntax names, etc.
|
||||
|
||||
When no locale is set, thus using the "C" locale, Vim will work with latin1
|
||||
characters, using its own isupper()/toupper()/etc. functions.
|
||||
|
||||
When using an rxvt terminal emulator guess the value of 'background' using the
|
||||
COLORFGBG environment variable. (Ciaran McCreesh)
|
||||
|
||||
Also support t_SI and t_EI on Unix with normal features. (Ciaran McCreesh)
|
||||
|
||||
When 'foldcolumn' is one then put as much info in it as possible. This allows
|
||||
closing a fold with the mouse by clicking on the '-'.
|
||||
|
||||
input() takes an optional completion argument to specify the type of
|
||||
completion supported for the input. (Yegappan Lakshmanan)
|
||||
|
||||
"dp" works with more than two buffers in diff mode if there is only one where
|
||||
'modifiable' is set.
|
||||
|
||||
When the 'include' option contains \zs the file name found is what is being
|
||||
matched from \zs to the end or \ze. Useful to pass more to 'includeexpr'.
|
||||
|
||||
Loading plugins on startup now supports subdirectories in the plugin
|
||||
directory. |load-plugins|
|
||||
|
||||
In the foldcolumn always show the '+' for a closed fold, so that it can be
|
||||
opened easily. It may overwrite another character, esp. if 'foldcolumn' is 1.
|
||||
|
||||
It is now possible to get the W10 message again by setting 'readonly'. Useful
|
||||
in the FileChangedRO autocommand when checking out the file fails.
|
||||
|
||||
Unix: When open() returns EFBIG give an appropriate message.
|
||||
|
||||
":mksession" sets the SessionLoad variable to notify plugins. A modeline is
|
||||
added to the session file to set 'filetype' to "vim".
|
||||
|
||||
In the ATTENTION prompt put the "Delete it" choice before "Quit" to make it
|
||||
more logical. (Robert Webb)
|
||||
|
||||
When appending to a file while the buffer has no name the name of the appended
|
||||
file would be used for the current buffer. But the buffer contents is
|
||||
actually different from the file content. Don't set the file name, unless the
|
||||
'P' flag is present in 'cpoptions'.
|
||||
|
||||
When starting to edit a new file and the directory for the file doesn't exist
|
||||
then Vim will report "[New DIRECTORY]" instead of "[New File] to give the user
|
||||
a hint that something might be wrong.
|
||||
|
||||
Win32: Preserve the hidden attribute of the viminfo file.
|
||||
|
||||
In Insert mode CTRL-A didn't keep the last inserted text when using CTRL-O and
|
||||
then a cursor key. Now keep the previously inserted text if nothing is
|
||||
inserted after the CTRL-O. Allows using CTRL-O commands to move the cursor
|
||||
without losing the last inserted text.
|
||||
|
||||
The exists() function now supports checking for autocmd group definition
|
||||
and for supported autocommand events. (Yegappan Lakshmanan)
|
||||
|
||||
Allow using ":global" in the sandbox, it doesn't do anything harmful by
|
||||
itself.
|
||||
|
||||
":saveas asdf.c" will set 'filetype' to c when it's empty. Also for ":w
|
||||
asdf.c" when it sets the filename for the buffer.
|
||||
|
||||
|
||||
==============================================================================
|
||||
COMPILE TIME CHANGES *compile-changes-7*
|
||||
|
||||
@@ -666,6 +964,24 @@ file.
|
||||
When running the tests and one of them fails to produce "test.out" the
|
||||
following tests are still executed. This helps when running out of memory.
|
||||
|
||||
When compiling with EXITFREE defined and the ccmalloc library it is possible
|
||||
to detect memory leaks. Some memory will always reported as leaked, such as
|
||||
allocated by X11 library functions and the memory allocated in alloc_cmdbuff()
|
||||
to store the ":quit" command.
|
||||
|
||||
Moved the code for printing to src/hardcopy.c.
|
||||
|
||||
Moved some code from main() to separate functions to make it easier to see
|
||||
what is being done. Use a structure to avoid a lot of arguments to the
|
||||
functions.
|
||||
|
||||
Moved unix_expandpath() to misc1.c, so that it can also be used by os_mac.c
|
||||
without copying the code.
|
||||
|
||||
Mac: When running "make install" the runtime files are installed as for Unix.
|
||||
Avoids that too many files are copied. When running "make" a link to the
|
||||
runtime files is created to avoid a recursive copy that takes much time.
|
||||
|
||||
==============================================================================
|
||||
BUG FIXES *bug-fixes-7*
|
||||
|
||||
@@ -722,7 +1038,8 @@ When converting a string with a hex or octal number the leading '-' was
|
||||
ignored. ":echo '-05' + 0" resulted in 5 instead of -5.
|
||||
|
||||
Using "@:" to repeat a command line didn't work when it contains control
|
||||
characters.
|
||||
characters. Also remove "'<,'>" when in Visual mode to avoid that it appears
|
||||
twice.
|
||||
|
||||
When using file completion for a user command, it would not expand environment
|
||||
variables like for a regular command with a file argument.
|
||||
@@ -858,10 +1175,6 @@ doing that a SIGHUP may arrive and disturbe us, thus ignore it. (Scott
|
||||
Anderson) Also postpone SIGHUP, SIGQUIT and SIGTERM until it's safe to
|
||||
handle. Added handle_signal().
|
||||
|
||||
When using "set laststatus=2 cmdheight=2" in the .gvimrc you may only get one
|
||||
line for the cmdline. (Christian Robinson) Invoke command_height() after the
|
||||
GUI has started up.
|
||||
|
||||
When completing a file name on the command line backslashes are required for
|
||||
white space. Was only done for a space, not for a Tab.
|
||||
|
||||
@@ -1074,6 +1387,7 @@ reallocating the buffer every time. (Alexei Alexandrov)
|
||||
|
||||
When using a Python "atexit" function it was not invoked when Vim exits. Now
|
||||
call Py_Finalize() for that. (Ugo Di Girolamo)
|
||||
This breaks the thread stuff though, fixed by Ugo.
|
||||
|
||||
GTK GUI: using a .vimrc with "set cmdheight=2 lines=43" and ":split" right
|
||||
after startup, the window layout is messed up. (Michael Schaap) Added
|
||||
@@ -1118,4 +1432,184 @@ may cause the hit-enter prompt. Typing 'a then didn't result in the accented
|
||||
character. Put the character typed at the prompt back in the typeahead buffer
|
||||
so that mapping is done in the right mode.
|
||||
|
||||
setbufvar() and setwinvar() did not give error messages.
|
||||
|
||||
It was possible to set a variable with an illegal name, e.g. with setbufvar().
|
||||
It was possible to define a function with illegal name, e.t. ":func F{-1}()"
|
||||
|
||||
CTRL-W F and "gf" didn't use the same method to get the file name.
|
||||
|
||||
When reporting a conversion error the line number of the last error could be
|
||||
given. Now report the first encountered error.
|
||||
|
||||
When using ":e ++enc=name file" and iconv() was used for conversion an error
|
||||
caused a fall-back to no conversion. Now replace a character with '?' and
|
||||
continue.
|
||||
|
||||
When opening a new buffer the local value of 'bomb' was not initialized from
|
||||
the global value.
|
||||
|
||||
Win32: When using the "Edit with Vim" entry the file name was limited to about
|
||||
200 characters.
|
||||
|
||||
When using command line completion for ":e *foo" and the file "+foo" exists
|
||||
the resulting command ":e +foo" doesn't work. Now insert a backslash: ":e
|
||||
\+foo".
|
||||
|
||||
When the translation of "-- More --" was not 10 characters long the following
|
||||
message would be in the wrong position.
|
||||
|
||||
At the more-prompt the last character in the last line wasn't drawn.
|
||||
|
||||
When deleting non-existing text while 'virtualedit' is set the '[ and '] marks
|
||||
were not set.
|
||||
|
||||
Win32: Could not use "**/" in 'path', it had to be "**\".
|
||||
|
||||
The search pattern "\n" did not match at the end of the last line.
|
||||
|
||||
Searching for a pattern backwards, starting on the NUL at the end of the line
|
||||
and 'encoding' is "utf-8" would match the pattern just before it incorrectly.
|
||||
Affected searchpair('/\*', '', '\*/').
|
||||
|
||||
For the Find/Replace dialog it was possible that not finding the text resulted
|
||||
in an error message while redrawing, which cleared the syntax highlighting
|
||||
while it was being used, resulting in a crash. Now don't clear syntax
|
||||
highlighting, disable it with b_syn_error.
|
||||
|
||||
Win32: Combining UTF-8 characters were drawn on the previous character.
|
||||
Could be noticed with a Thai font.
|
||||
|
||||
Output of ":function" could leave some of the typed text behind. (Yegappan
|
||||
Lakshmanan)
|
||||
|
||||
When the command line history has only a few lines the command line window
|
||||
would be opened with these lines above the first window line.
|
||||
|
||||
When using a command line window for search strings ":qa" would result in
|
||||
searching for "qa" instead of quitting all windows.
|
||||
|
||||
GUI: When scrolling with the scrollbar and there is a line that doesn't fit
|
||||
redrawing may fail. Make sure w_skipcol is valid before redrawing.
|
||||
|
||||
Limit the values of 'columns' and 'lines' to avoid an overflow in Rows *
|
||||
Columns. Fixed bad effects when running out of memory (command line would be
|
||||
reversed, ":qa!" resulted in ":!aq").
|
||||
|
||||
Motif: "gvim -iconic" opened the window anyway. (David Harrison)
|
||||
|
||||
There is a tiny chance that a symlink gets created between checking for an
|
||||
existing file and creating a file. Use the O_NOFOLLOW for open() if it's
|
||||
available.
|
||||
|
||||
In an empty line "ix<CTRL-O>0" moved the cursor to after the line instead of
|
||||
sticking to the first column.
|
||||
|
||||
When using ":wq" and a BufWriteCmd autocmd uses inputsecret() the text was
|
||||
echoed anyway. Set terminal to raw mode in getcmdline().
|
||||
|
||||
Unix: ":w a;b~c" caused an error in expanding wildcards.
|
||||
|
||||
When appending to a file with ":w >>fname" in a buffer without a name, causing
|
||||
the buffer to use "fname", the modified flag was reset.
|
||||
|
||||
When appending to to current file the "not edited" flag would be reset.
|
||||
":w" would overwrite the file accidentally.
|
||||
|
||||
Unix: When filtering text with an external command Vim would still read input,
|
||||
causing text typed for the command (e.g., a password) to be eaten and echoed.
|
||||
Don't read input when the terminal is in cooked mode.
|
||||
|
||||
The Cygwin version of xxd used CR/LF line separators. (Corinna Vinschen)
|
||||
|
||||
Unix: When filtering text through a shell command some resulting text may be
|
||||
dropped. Now after detecting that the child has exited try reading some more
|
||||
of its output.
|
||||
|
||||
When inside input(), using "CTRL-R =" and the expression throws an exception
|
||||
the command line was not abandoned but it wasn't used either. Now abandon
|
||||
typing the command line.
|
||||
|
||||
'delcombine' was also used in Visual and Select mode and for commands like
|
||||
"cl". That was illogical and has been disabled.
|
||||
|
||||
When recording while a CursorHold autocommand was defined special keys would
|
||||
appear in the register. Now the CursorHold event is not triggered while
|
||||
recording.
|
||||
|
||||
Unix: the src/configure script used ${srcdir-.}, not all shells understand
|
||||
that. Use ${srcdir:-.} instead.
|
||||
|
||||
When editing file "a" which is a symlink to file "b" that doesn't exist,
|
||||
writing file "a" to create "b" and then ":split b" resulted in two buffers on
|
||||
the same file with two different swapfile names. Now set the inode in the
|
||||
buffer when creating a new file.
|
||||
|
||||
When 'esckeys' is not set don't send the xterm code to request the version
|
||||
string, because it may cause trouble in Insert mode.
|
||||
|
||||
When evaluating an expression for CTRL-R = on the command line it was possible
|
||||
to call a function that opens a new window, resulting in errors for
|
||||
incremental search, and many other nasty things were possible. Now use the
|
||||
|textlock| to disallow changing the buffer or jumping to another window
|
||||
to protect from unexpected behavior. Same for CTRL-\ e.
|
||||
|
||||
"d(" deleted the character under the cursor, while the documentation specified
|
||||
an exclusive motion. Vi also doesn't delete the character under the cursor.
|
||||
|
||||
Shift-Insert in Insert mode could put the cursor before the last character
|
||||
when it just fits in the window. In coladvance() don't stop at the window
|
||||
edge when filling with spaces and when in Insert mode. In mswin.vim avoid
|
||||
getting a beep from the "l" command.
|
||||
|
||||
Win32 GUI: When Alt-F4 is used to close the window and Cancel is selected in
|
||||
the dialog then Vim would insert <M-F4> in the text. Now it's ignored.
|
||||
|
||||
When ":silent! {cmd}" caused the swap file dialog, which isn't displayed,
|
||||
there would still be a hit-enter prompt.
|
||||
|
||||
Requesting the termresponse (|t_RV|) early may cause problems with "-c"
|
||||
arguments that invoke an external command or even "-c quit". Postpone it
|
||||
until after executing "-c" arguments.
|
||||
|
||||
When typing in Insert mode so that a new line is started, using CTRL-G u to
|
||||
break undo and start a new change, then joining the lines with <BS> caused
|
||||
undo info to be missing. Now reset the insertion start point.
|
||||
|
||||
Syntax HL: When a region start match has a matchgroup and an offset that
|
||||
happens to be after the end of the line then it continued in the next line and
|
||||
stopped at the region end match, making the region continue after that.
|
||||
Now check for the column being past the end of the line in syn_add_end_off().
|
||||
|
||||
When changing a file, setting 'swapfile' off and then on again, making another
|
||||
change and killing Vim, then some blocks may be missing from the swapfile.
|
||||
When 'swapfile' is switched back on mark all blocks in the swapfile as dirty.
|
||||
Added mf_set_dirty().
|
||||
|
||||
Expanding wildcards in a command like ":e aap;<>!" didn't work. Put
|
||||
backslashes before characters that are special to the shell. (Adri Verhoef)
|
||||
|
||||
A CursorHold autocommand would cause a message to be cleared. Don't show the
|
||||
special key for the event for 'showcmd'.
|
||||
|
||||
When expanding a file name for a shell command, as in "!cmd foo<Tab>" or ":r
|
||||
!cmd foo<Tab>" also escape characters that are special for the shell:
|
||||
"!;&()<>".
|
||||
|
||||
When the name of the buffer was set by a ":r fname" command |cpo-f| no
|
||||
autocommands were triggered to notify about the change in the buffer list.
|
||||
|
||||
In the quickfix buffer 'bufhidden' was set to "delete", which caused closing
|
||||
the quickfix window to leave an unlisted "No Name" buffer behind every time.
|
||||
|
||||
Win32: when using two screens of different size, setting 'lines' to a large
|
||||
value didn't fill the whole screen. (SungHyun Nam)
|
||||
|
||||
Win32 installer: The generated _vimrc contained an absolute path to diff.exe.
|
||||
After upgrading it becomes invalid. Now use $VIMRUNTIME instead.
|
||||
|
||||
The command line was cleared to often when 'showmode' was set and ":silent
|
||||
normal vy" was used. Don't clear the command line unless the mode was
|
||||
actually displayed. Added the "mode_displayed" variable.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*vi_diff.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
|
||||
*vi_diff.txt* For Vim version 7.0aa. Last change: 2006 Jan 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -87,7 +87,9 @@ Length of an expanded string option
|
||||
Maximum display width Unix and Win32: 1024 characters, otherwise 255
|
||||
characters
|
||||
Maximum lhs of a mapping 50 characters.
|
||||
Number of highlighting different types: 223
|
||||
Number of different highlighting types: over 30000
|
||||
Range of a Number variable: -2147483648 to 2147483647 (more on 64 bit
|
||||
systems)
|
||||
|
||||
Information for undo and text in registers is kept in memory, thus when making
|
||||
(big) changes the amount of (virtual) memory available limits the number of
|
||||
|
||||
@@ -30,7 +30,7 @@ DESCRIPTION
|
||||
|
||||
OPTIONS
|
||||
Vertical splits are used to align the lines, as if the "-O" argument
|
||||
was used. To use horizontal splits intead, use the "-o" argument.
|
||||
was used. To use horizontal splits instead, use the "-o" argument.
|
||||
|
||||
For all other arguments see vim(1).
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*visual.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
|
||||
*visual.txt* For Vim version 7.0aa. Last change: 2006 Jan 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -86,7 +86,7 @@ Visual Normal blockwise Visual linewise Visual
|
||||
blockwise Visual Visual Normal linewise Visual
|
||||
linewise Visual Visual blockwise Visual Normal
|
||||
|
||||
*gv* *v_gv*
|
||||
*gv* *v_gv* *reselect-Visual*
|
||||
gv Start Visual mode with the same area as the previous
|
||||
area and the same mode.
|
||||
In Visual mode the current and the previous Visual
|
||||
@@ -258,6 +258,11 @@ operator character: "v{move-around}3>" (move lines 3 indents to the right).
|
||||
The {move-around} is any sequence of movement commands. Note the difference
|
||||
with {motion}, which is only ONE movement command.
|
||||
|
||||
Another way to operate on the Visual area is using the |/\%V| item in a
|
||||
pattern. For example, to replace all '(' in the Visual area with '#': >
|
||||
|
||||
:%s/\%V(/X/g
|
||||
|
||||
==============================================================================
|
||||
5. Blockwise operators *blockwise-operators*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
|
||||
*windows.txt* For Vim version 7.0aa. Last change: 2006 Jan 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1100,18 +1100,18 @@ help Contains a help file. Will only be created with the |:help|
|
||||
|
||||
directory Displays directory contents. Can be used by a file explorer
|
||||
plugin. The buffer is created with these settings: >
|
||||
:set buftype=nowrite
|
||||
:set bufhidden=delete
|
||||
:set noswapfile
|
||||
:setlocal buftype=nowrite
|
||||
:setlocal bufhidden=delete
|
||||
:setlocal noswapfile
|
||||
< The buffer name is the name of the directory and is adjusted
|
||||
when using the |:cd| command.
|
||||
|
||||
scratch Contains text that can be discarded at any time. It is kept
|
||||
when closing the window, it must be deleted explicitly.
|
||||
Settings: >
|
||||
:set buftype=nofile
|
||||
:set bufhidden=hide
|
||||
:set noswapfile
|
||||
:setlocal buftype=nofile
|
||||
:setlocal bufhidden=hide
|
||||
:setlocal noswapfile
|
||||
< The buffer name can be used to identify the buffer.
|
||||
|
||||
*unlisted-buffer*
|
||||
@@ -1119,7 +1119,7 @@ unlisted The buffer is not in the buffer list. It is not used for
|
||||
normal editing, but to show a help file, remember a file name
|
||||
or marks. The ":bdelete" command will also set this option,
|
||||
thus it doesn't completely delete the buffer. Settings: >
|
||||
:set nobuflisted
|
||||
:setlocal nobuflisted
|
||||
<
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2005 May 20
|
||||
" Last Change: 2006 Jan 12
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -16,7 +16,7 @@ set cpo&vim
|
||||
augroup filetypedetect
|
||||
|
||||
" Ignored extensions
|
||||
au BufNewFile,BufRead *.orig,*.bak,*.old,*.new,*.rpmsave,*.rpmnew
|
||||
au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.rpmsave,?\+.rpmnew
|
||||
\ exe "doau filetypedetect BufRead " . expand("<afile>:r")
|
||||
au BufNewFile,BufRead *~
|
||||
\ let s:name = expand("<afile>") |
|
||||
@@ -26,7 +26,7 @@ au BufNewFile,BufRead *~
|
||||
\ endif |
|
||||
\ unlet s:name |
|
||||
\ unlet s:short
|
||||
au BufNewFile,BufRead *.in
|
||||
au BufNewFile,BufRead ?\+.in
|
||||
\ if expand("<afile>:t") != "configure.in" |
|
||||
\ exe "doau filetypedetect BufRead " . expand("<afile>:r") |
|
||||
\ endif
|
||||
@@ -71,6 +71,9 @@ endfun
|
||||
" A-A-P recipe
|
||||
au BufNewFile,BufRead *.aap setf aap
|
||||
|
||||
" A2ps printing utility
|
||||
au BufNewFile,BufRead etc/a2ps.cfg,etc/a2ps/*.cfg,a2psrc,.a2psrc setf a2ps
|
||||
|
||||
" ABAB/4
|
||||
au BufNewFile,BufRead *.abap setf abap
|
||||
|
||||
@@ -194,6 +197,9 @@ au BufNewFile,BufRead *.atl,*.as setf atlas
|
||||
" Automake
|
||||
au BufNewFile,BufRead [mM]akefile.am setf automake
|
||||
|
||||
" Autotest .at files are actually m4
|
||||
au BufNewFile,BufRead *.at setf m4
|
||||
|
||||
" Avenue
|
||||
au BufNewFile,BufRead *.ave setf ave
|
||||
|
||||
@@ -279,6 +285,9 @@ au BufNewFile,BufRead */.calendar/*,
|
||||
" C#
|
||||
au BufNewFile,BufRead *.cs setf cs
|
||||
|
||||
" Cfengine
|
||||
au BufNewFile,BufRead cfengine.conf setf cfengine
|
||||
|
||||
" Comshare Dimension Definition Language
|
||||
au BufNewFile,BufRead *.cdl setf cdl
|
||||
|
||||
@@ -390,7 +399,7 @@ fun! s:FTent()
|
||||
setf dtd
|
||||
endfun
|
||||
|
||||
" Clipper (or FoxPro)
|
||||
" Clipper (or FoxPro; could also be eviews)
|
||||
au BufNewFile,BufRead *.prg
|
||||
\ if exists("g:filetype_prg") |
|
||||
\ exe "setf " . g:filetype_prg |
|
||||
@@ -448,6 +457,12 @@ au BufNewFile,BufRead *.d setf d
|
||||
" Desktop files
|
||||
au BufNewFile,BufRead *.desktop,.directory setf desktop
|
||||
|
||||
" Dict config
|
||||
au BufNewFile,BufRead dict.conf,.dictrc setf dictconf
|
||||
|
||||
" Dictd config
|
||||
au BufNewFile,BufRead dictd.conf setf dictdconf
|
||||
|
||||
" Diff files
|
||||
au BufNewFile,BufRead *.diff,*.rej,*.patch setf diff
|
||||
|
||||
@@ -543,6 +558,9 @@ au BufNewFile,BufRead *.exp setf expect
|
||||
" Exports
|
||||
au BufNewFile,BufRead exports setf exports
|
||||
|
||||
" Factor
|
||||
au BufNewFile,BufRead *.factor setf factor
|
||||
|
||||
" Fetchmail RC file
|
||||
au BufNewFile,BufRead .fetchmailrc setf fetchmail
|
||||
|
||||
@@ -588,12 +606,18 @@ au BufNewFile,BufRead *.gpi setf gnuplot
|
||||
" GrADS scripts
|
||||
au BufNewFile,BufRead *.gs setf grads
|
||||
|
||||
" Gretl
|
||||
au BufNewFile,BufRead *.gretl setf gretl
|
||||
|
||||
" Groovy
|
||||
au BufNewFile,BufRead *.groovy setf groovy
|
||||
|
||||
" GNU Server Pages
|
||||
au BufNewFile,BufRead *.gsp setf gsp
|
||||
|
||||
" Group file
|
||||
au BufNewFile,BufRead /etc/group setf group
|
||||
|
||||
" GTK RC
|
||||
au BufNewFile,BufRead .gtkrc,gtkrc setf gtkrc
|
||||
|
||||
@@ -611,8 +635,8 @@ au BufNewFile,BufRead *.hex,*.h32 setf hex
|
||||
" Tilde (must be before HTML)
|
||||
au BufNewFile,BufRead *.t.html setf tilde
|
||||
|
||||
" HTML (.shtml and .stm for server side, .rhtml for Ruby html)
|
||||
au BufNewFile,BufRead *.html,*.htm,*.shtml,*.rhtml,*.stm call s:FThtml()
|
||||
" HTML (.shtml and .stm for server side)
|
||||
au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call s:FThtml()
|
||||
|
||||
" Distinguish between HTML and XHTML
|
||||
fun! s:FThtml()
|
||||
@@ -627,6 +651,8 @@ fun! s:FThtml()
|
||||
setf html
|
||||
endfun
|
||||
|
||||
" HTML with Ruby - eRuby
|
||||
au BufNewFile,BufRead *.rhtml setf eruby
|
||||
|
||||
" HTML with M4
|
||||
au BufNewFile,BufRead *.html.m4 setf htmlm4
|
||||
@@ -666,6 +692,9 @@ au BufNewFile,BufRead */.icewm/menu setf icemenu
|
||||
" IDL (Interactive Data Language)
|
||||
au BufNewFile,BufRead *.pro setf idlang
|
||||
|
||||
" Indent RC
|
||||
au BufNewFile,BufRead indentrc setf indentrc
|
||||
|
||||
" Inform
|
||||
au BufNewFile,BufRead .indent.pro setf indent
|
||||
|
||||
@@ -730,18 +759,27 @@ au BufNewFile,BufRead *.ace,*.ACE setf lace
|
||||
" Latte
|
||||
au BufNewFile,BufRead *.latte,*.lte setf latte
|
||||
|
||||
" Limits
|
||||
au BufNewFile,BufRead /etc/limits setf limits
|
||||
|
||||
" LambdaProlog (*.mod too, see Modsim)
|
||||
au BufNewFile,BufRead *.sig setf lprolog
|
||||
|
||||
" LDAP LDIF
|
||||
au BufNewFile,BufRead *.ldif setf ldif
|
||||
|
||||
" Ld loader
|
||||
au BufNewFile,BufRead *.ld setf ld
|
||||
|
||||
" Lex
|
||||
au BufNewFile,BufRead *.lex,*.l setf lex
|
||||
|
||||
" Libao
|
||||
au BufNewFile,BufRead /etc/libao.conf,*/.libao setf libao
|
||||
|
||||
" Libsensors
|
||||
au BufNewFile,BufRead /etc/sensors.conf setf sensors
|
||||
|
||||
" LFTP
|
||||
au BufNewFile,BufRead lftp.conf,.lftprc,*lftp/rc setf lftp
|
||||
|
||||
@@ -758,9 +796,18 @@ else
|
||||
au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,.emacs,.sawfishrc setf lisp
|
||||
endif
|
||||
|
||||
" SBCL implementation of Common Lisp
|
||||
au BufNewFile,BufRead sbclrc,.sbclrc setf lisp
|
||||
|
||||
" Lite
|
||||
au BufNewFile,BufRead *.lite,*.lt setf lite
|
||||
|
||||
" Login access
|
||||
au BufNewFile,BufRead /etc/login.access setf loginaccess
|
||||
|
||||
" Login defs
|
||||
au BufNewFile,BufRead /etc/login.defs setf logindefs
|
||||
|
||||
" Logtalk
|
||||
au BufNewFile,BufRead *.lgt setf logtalk
|
||||
|
||||
@@ -784,7 +831,7 @@ au BufNewFile,BufRead *.m4
|
||||
au BufNewFile,BufRead *.mgp setf mgp
|
||||
|
||||
" Mail (for Elm, trn, mutt, rn, slrn)
|
||||
au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt-*-\w\+,mutt\w\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail
|
||||
au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt\w\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail
|
||||
|
||||
" Mailcap configuration file
|
||||
au BufNewFile,BufRead .mailcap,mailcap setf mailcap
|
||||
@@ -798,6 +845,9 @@ au BufNewFile,BufRead *.ist,*.mst setf ist
|
||||
" Manpage
|
||||
au BufNewFile,BufRead *.man setf man
|
||||
|
||||
" Man config
|
||||
au BufNewFile,BufRead /etc/man.conf setf manconf
|
||||
|
||||
" Maple V
|
||||
au BufNewFile,BufRead *.mv,*.mpl,*.mws setf maple
|
||||
|
||||
@@ -911,8 +961,11 @@ au BufRead,BufNewFile *.mu setf mupad
|
||||
au BufNewFile,BufRead *.mush setf mush
|
||||
|
||||
" Mutt setup file
|
||||
au BufNewFile,BufRead Muttrc setf muttrc
|
||||
au BufNewFile,BufRead .muttrc*,*/.mutt/muttrc* call s:StarSetf('muttrc')
|
||||
au BufNewFile,BufRead Mutt{ng,}rc setf muttrc
|
||||
au BufNewFile,BufRead .mutt{ng,}rc*,*/.mutt{ng,}/mutt{ng,}rc* call s:StarSetf('muttrc')
|
||||
|
||||
" Nano
|
||||
au BufNewFile,BufRead /etc/nanorc,.nanorc setf nanorc
|
||||
|
||||
" Nastran input/DMAP
|
||||
"au BufNewFile,BufRead *.dat setf nastran
|
||||
@@ -987,9 +1040,15 @@ au BufNewFile,BufRead *.ora setf ora
|
||||
" Packet filter conf
|
||||
au BufNewFile,BufRead pf.conf setf pf
|
||||
|
||||
" Pam conf
|
||||
au BufNewFile,BufRead /etc/pam.conf setf pamconf
|
||||
|
||||
" PApp
|
||||
au BufNewFile,BufRead *.papp,*.pxml,*.pxsl setf papp
|
||||
|
||||
" Password file
|
||||
au BufNewFile,BufRead /etc/passwd,/etc/shadow,/etc/shadow- setf passwd
|
||||
|
||||
" Pascal (also *.p)
|
||||
au BufNewFile,BufRead *.pas setf pascal
|
||||
|
||||
@@ -1147,7 +1206,7 @@ function! s:FTprogress_asm()
|
||||
" This function checks for an assembly comment the first ten lines.
|
||||
" If not found, assume Progress.
|
||||
let lnum = 1
|
||||
while lnum <= 10
|
||||
while lnum <= 10 && lnum < line('$')
|
||||
let line = getline(lnum)
|
||||
if line =~ '^\s*;' || line =~ '^\*'
|
||||
call s:FTasm()
|
||||
@@ -1174,9 +1233,9 @@ function! s:FTprogress_pascal()
|
||||
" Look for either an opening comment or a program start.
|
||||
" If not found, assume Progress.
|
||||
let lnum = 1
|
||||
while lnum <= 10
|
||||
while lnum <= 10 && lnum < line('$')
|
||||
let line = getline(lnum)
|
||||
if line =~ '^\s*\(program\|procedure\|function\|const\|type\|var\)\>'
|
||||
if line =~ '^\s*\(program\|unit\|procedure\|function\|const\|type\|var\)\>'
|
||||
\ || line =~ '^\s*{' || line =~ '^\s*(\*'
|
||||
setf pascal
|
||||
return
|
||||
@@ -1201,6 +1260,9 @@ au BufNewFile,BufRead INDEX,INFO
|
||||
" Prolog
|
||||
au BufNewFile,BufRead *.pdb setf prolog
|
||||
|
||||
" Protocols
|
||||
au BufNewFile,BufRead /etc/protocols setf protocols
|
||||
|
||||
" Pyrex
|
||||
au BufNewFile,BufRead *.pyx,*.pxd setf pyrex
|
||||
|
||||
@@ -1290,6 +1352,9 @@ au BufNewFile,BufRead *.rtf setf rtf
|
||||
" Ruby
|
||||
au BufNewFile,BufRead *.rb,*.rbw,*.gem,*.gemspec setf ruby
|
||||
|
||||
" Rantfile is like Ruby
|
||||
au BufNewFile,BufRead [rR]antfile,*.rant setf ruby
|
||||
|
||||
" S-lang (or shader language!)
|
||||
au BufNewFile,BufRead *.sl setf slang
|
||||
|
||||
@@ -1320,6 +1385,21 @@ au BufNewFile,BufRead sendmail.cf setf sm
|
||||
" Sendmail .mc files are actually m4
|
||||
au BufNewFile,BufRead *.mc setf m4
|
||||
|
||||
" Services
|
||||
au BufNewFile,BufRead /etc/services setf services
|
||||
|
||||
" Service Location config
|
||||
au BufNewFile,BufRead /etc/slp.conf setf slpconf
|
||||
|
||||
" Service Location registration
|
||||
au BufNewFile,BufRead /etc/slp.reg setf slpreg
|
||||
|
||||
" Service Location SPI
|
||||
au BufNewFile,BufRead /etc/slp.spi setf slpspi
|
||||
|
||||
" Setserial config
|
||||
au BufNewFile,BufRead /etc/serial.conf setf setserial
|
||||
|
||||
" SGML
|
||||
au BufNewFile,BufRead *.sgm,*.sgml
|
||||
\ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'linuxdoc' |
|
||||
@@ -1436,7 +1516,7 @@ au BufNewFile,BufRead *.sim setf simula
|
||||
au BufNewFile,BufRead *.sin,*.s85 setf sinda
|
||||
|
||||
" SKILL
|
||||
au BufNewFile,BufRead *.il setf skill
|
||||
au BufNewFile,BufRead *.il,*.ils,*.cdf setf skill
|
||||
|
||||
" SLRN
|
||||
au BufNewFile,BufRead .slrnrc setf slrnrc
|
||||
@@ -1532,12 +1612,25 @@ au BufNewFile,BufRead *.stp setf stp
|
||||
" Standard ML
|
||||
au BufNewFile,BufRead *.sml setf sml
|
||||
|
||||
" Sysctl
|
||||
au BufNewFile,BufRead /etc/sysctl.conf setf sysctl
|
||||
|
||||
" Sudoers
|
||||
au BufNewFile,BufRead /etc/sudoers,sudoers.tmp setf sudoers
|
||||
|
||||
" Tads (or Nroff)
|
||||
" If the first line starts with '#' and contains 'perl' it's probably a Perl
|
||||
" file.
|
||||
fun! s:FTperl()
|
||||
if getline(1)[0] == '#' && getline(1) =~ 'perl'
|
||||
setf perl
|
||||
return 1
|
||||
endif
|
||||
return 0
|
||||
endfun
|
||||
|
||||
" Tads (or Nroff or Perl test file)
|
||||
au BufNewFile,BufRead *.t
|
||||
\ if !s:FTnroff() | setf tads | endif
|
||||
\ if !s:FTnroff() && !s:FTperl() | setf tads | endif
|
||||
|
||||
" Tags
|
||||
au BufNewFile,BufRead tags setf tags
|
||||
@@ -1545,8 +1638,8 @@ au BufNewFile,BufRead tags setf tags
|
||||
" TAK
|
||||
au BufNewFile,BufRead *.tak setf tak
|
||||
|
||||
" Tcl
|
||||
au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk setf tcl
|
||||
" Tcl (JACL too)
|
||||
au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk,*.jacl setf tcl
|
||||
|
||||
" TealInfo
|
||||
au BufNewFile,BufRead *.tli setf tli
|
||||
@@ -1558,7 +1651,27 @@ au BufNewFile,BufRead *.slt setf tsalt
|
||||
au BufNewFile,BufRead *.ti setf terminfo
|
||||
|
||||
" TeX
|
||||
au BufNewFile,BufRead *.tex,*.latex,*.sty,*.dtx,*.ltx,*.bbl setf tex
|
||||
au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl setf tex
|
||||
au BufNewFile,BufRead *.tex call s:FTtex()
|
||||
|
||||
fun! s:FTtex()
|
||||
let n = 1
|
||||
while n < 10 && n < line("$")
|
||||
let line = getline(n)
|
||||
if line =~ '^\s*\\\%(documentclass\>\|usepackage\>\|begin{\)'
|
||||
setf tex
|
||||
return
|
||||
elseif line =~ '^\s*\\\%(start\l\+\|setup\l\+\|usemodule\)\>'
|
||||
setf context
|
||||
return
|
||||
endif
|
||||
let n = n + 1
|
||||
endwhile
|
||||
setf tex
|
||||
endfun
|
||||
|
||||
" Context
|
||||
au BufNewFile,BufRead tex/context/*/*.tex setf context
|
||||
|
||||
" Texinfo
|
||||
au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo
|
||||
@@ -1575,6 +1688,9 @@ au BufNewFile,BufRead *.tf,.tfrc,tfrc setf tf
|
||||
" TPP - Text Presentation Program
|
||||
au BufNewFile,BufReadPost *.tpp setf tpp
|
||||
|
||||
" Trustees
|
||||
au BufNewFile,BufRead trustees.conf setf trustees
|
||||
|
||||
" TSS - Geometry
|
||||
au BufNewFile,BufReadPost *.tssgm setf tssgm
|
||||
|
||||
@@ -1587,15 +1703,33 @@ au BufNewFile,BufReadPost *.tsscl setf tsscl
|
||||
" Motif UIT/UIL files
|
||||
au BufNewFile,BufRead *.uit,*.uil setf uil
|
||||
|
||||
" Udev conf
|
||||
au BufNewFile,BufRead /etc/udev/udev.conf setf udevconf
|
||||
|
||||
" Udev rules
|
||||
au BufNewFile,BufRead /etc/udev/rules.d/*.rules setf udevrules
|
||||
|
||||
" Udev permissions
|
||||
au BufNewFile,BufRead /etc/udev/permissions.d/*.permissions setf udevperm
|
||||
"
|
||||
" Udev symlinks config
|
||||
au BufNewFile,BufRead /etc/udev/cdsymlinks.conf setf sh
|
||||
|
||||
" UnrealScript
|
||||
au BufNewFile,BufRead *.uc setf uc
|
||||
|
||||
" Updatedb
|
||||
au BufNewFile,BufRead /etc/updatedb.conf setf updatedb
|
||||
|
||||
" Verilog HDL
|
||||
au BufNewFile,BufRead *.v setf verilog
|
||||
|
||||
" Verilog-AMS HDL
|
||||
au BufNewFile,BufRead *.va,*.vams setf verilogams
|
||||
|
||||
" VHDL
|
||||
au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst setf vhdl
|
||||
au BufNewFile,BufRead *.vhdl_[0-9]* call s:StarSetf('vhdl')
|
||||
au BufNewFile,BufRead *.vhdl_[0-9]* call s:StarSetf('vhdl')
|
||||
|
||||
" Vim script
|
||||
au BufNewFile,BufRead *.vim,.exrc,_exrc setf vim
|
||||
@@ -1670,6 +1804,9 @@ au BufNewFile,BufRead XF86Config
|
||||
" Xorg config
|
||||
au BufNewFile,BufRead xorg.conf,xorg.conf-4 let b:xf86c_xfree86_version = 4 | setf xf86conf
|
||||
|
||||
" Xinetd conf
|
||||
au BufNewFile,BufRead /etc/xinetd.conf setf xinetd
|
||||
|
||||
" XS Perl extension interface language
|
||||
au BufNewFile,BufRead *.xs setf xs
|
||||
|
||||
@@ -1699,6 +1836,12 @@ au BufNewFile,BufRead *.csproj,*.csproj.user setf xml
|
||||
" Qt Linguist translation source and Qt User Interface Files are XML
|
||||
au BufNewFile,BufRead *.ts,*.ui setf xml
|
||||
|
||||
" Xdg menus
|
||||
au BufNewFile,BufRead /etc/xdg/menus/*.menu setf xml
|
||||
|
||||
" Xquery
|
||||
au BufNewFile,BufRead *.xq,*.xql,*.xqm,*.xquery,*.xqy setf xquery
|
||||
|
||||
" XSD
|
||||
au BufNewFile,BufRead *.xsd setf xsd
|
||||
|
||||
@@ -1706,7 +1849,28 @@ au BufNewFile,BufRead *.xsd setf xsd
|
||||
au BufNewFile,BufRead *.xsl,*.xslt setf xslt
|
||||
|
||||
" Yacc
|
||||
au BufNewFile,BufRead *.y,*.yy setf yacc
|
||||
au BufNewFile,BufRead *.yy setf yacc
|
||||
|
||||
" Yacc or racc
|
||||
au BufNewFile,BufRead *.y call s:FTy()
|
||||
|
||||
fun! s:FTy()
|
||||
let n = 1
|
||||
while n < 100 && n < line("$")
|
||||
let line = getline(n)
|
||||
if line =~ '^\s*%'
|
||||
setf yacc
|
||||
return
|
||||
endif
|
||||
if getline(n) =~ '^\s*\(#\|class\>\)' && getline(n) !~ '^\s*#\s*include'
|
||||
setf racc
|
||||
return
|
||||
endif
|
||||
let n = n + 1
|
||||
endwhile
|
||||
setf yacc
|
||||
endfun
|
||||
|
||||
|
||||
" Yaml
|
||||
au BufNewFile,BufRead *.yaml,*.yml setf yaml
|
||||
@@ -1740,6 +1904,9 @@ au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif
|
||||
" Most of these should call s:StarSetf() to avoid names ending in .gz and the
|
||||
" like are used.
|
||||
|
||||
" Asterisk config file
|
||||
au BufNewFile,BufRead *asterisk/*.conf* call s:StarSetf('asterisk')
|
||||
|
||||
" BIND zone
|
||||
au BufNewFile,BufRead /var/named/* call s:StarSetf('bindzone')
|
||||
|
||||
@@ -1782,15 +1949,21 @@ au! BufNewFile,BufRead *jarg*
|
||||
" Makefile
|
||||
au BufNewFile,BufRead [mM]akefile* call s:StarSetf('make')
|
||||
|
||||
" Modconf
|
||||
au BufNewFile,BufRead /etc/modprobe.* call s:StarSetf('modconf')
|
||||
|
||||
" Ruby Makefile
|
||||
au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby')
|
||||
|
||||
" Mutt setup file
|
||||
au BufNewFile,BufRead muttrc*,Muttrc* call s:StarSetf('muttrc')
|
||||
au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc* call s:StarSetf('muttrc')
|
||||
|
||||
" Nroff macros
|
||||
au BufNewFile,BufRead tmac.* call s:StarSetf('nroff')
|
||||
|
||||
" Pam conf
|
||||
au BufNewFile,BufRead /etc/pam.d/* call s:StarSetf('pamconf')
|
||||
|
||||
" Printcap and Termcap
|
||||
au BufNewFile,BufRead *printcap*
|
||||
\ if !did_filetype()
|
||||
@@ -1822,6 +1995,9 @@ au BufNewFile,BufRead XF86Config*
|
||||
" X11 xmodmap
|
||||
au BufNewFile,BufRead *xmodmap* call s:StarSetf('xmodmap')
|
||||
|
||||
" Xinetd conf
|
||||
au BufNewFile,BufRead /etc/xinetd.d/* call s:StarSetf('xinetd')
|
||||
|
||||
" Z-Shell script
|
||||
au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh')
|
||||
|
||||
|
||||
@@ -1,125 +1,125 @@
|
||||
" Vim filetype plugin file utility
|
||||
" Language: * (various)
|
||||
" Maintainer: Dave Silvia <dsilvia@mchsi.com>
|
||||
" Date: 6/30/2004
|
||||
|
||||
" The start of match (b:SOM) default is:
|
||||
" '\<'
|
||||
" The end of match (b:EOM) default is:
|
||||
" '\>'
|
||||
"
|
||||
" If you want to use some other start/end of match, just assign the
|
||||
" value to the b:SOM|EOM variable in your filetype script.
|
||||
"
|
||||
" SEE: :h pattern.txt
|
||||
" :h pattern-searches
|
||||
" :h regular-expression
|
||||
" :h matchit
|
||||
|
||||
let s:myName=expand("<sfile>:t")
|
||||
|
||||
" matchit.vim not loaded -- don't do anyting
|
||||
if !exists("loaded_matchit")
|
||||
echomsg s:myName.": matchit.vim not loaded -- finishing without loading"
|
||||
finish
|
||||
endif
|
||||
|
||||
" already been here -- don't redefine
|
||||
if exists("*AppendMatchGroup")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Function To Build b:match_words
|
||||
" The following function, 'AppendMatchGroup', helps to increase
|
||||
" readability of your filetype script if you choose to use matchit.
|
||||
" It also precludes many construction errors, reducing the
|
||||
" construction to simply invoking the function with the match words.
|
||||
" As an example, let's take the ubiquitous if/then/else/endif type
|
||||
" of construct. This is how the entry in your filetype script would look.
|
||||
"
|
||||
" " source the AppendMatchGroup function file
|
||||
" runtime ftplugin/AppendMatchGroup.vim
|
||||
"
|
||||
" " fill b:match_words
|
||||
" call AppendMatchGroup('if,then,else,endif')
|
||||
"
|
||||
" And the b:match_words constructed would look like:
|
||||
"
|
||||
" \<if\>:\<then\>:\<else\>:\<endif\>
|
||||
"
|
||||
" Use of AppendMatchGroup makes your filetype script is a little
|
||||
" less busy and a lot more readable. Additionally, it
|
||||
" checks three critical things:
|
||||
"
|
||||
" 1) Do you have at least 2 entries in your match group.
|
||||
"
|
||||
" 2) Does the buffer variable 'b:match_words' exist? if not, create it.
|
||||
"
|
||||
" 3) If the buffer variable 'b:match_words' does exist, is the last
|
||||
" character a ','? If not, add it before appending.
|
||||
"
|
||||
" You should now be able to match 'if/then/else/endif' in succession
|
||||
" in your source file, in just about any construction you may have
|
||||
" chosen for them.
|
||||
"
|
||||
" To add another group, simply call 'AppendMatchGroup again. E.G.:
|
||||
"
|
||||
" call AppendMatchGroup('while,do,endwhile')
|
||||
|
||||
function AppendMatchGroup(mwordList)
|
||||
let List=a:mwordList
|
||||
let Comma=match(List,',')
|
||||
if Comma == -1 || Comma == strlen(List)-1
|
||||
echoerr "Must supply a comma separated list of at least 2 entries."
|
||||
echoerr "Supplied list: <".List.">"
|
||||
return
|
||||
endif
|
||||
let listEntryBegin=0
|
||||
let listEntryEnd=Comma
|
||||
let listEntry=strpart(List,listEntryBegin,listEntryEnd-listEntryBegin)
|
||||
let List=strpart(List,Comma+1)
|
||||
let Comma=match(List,',')
|
||||
" if listEntry is all spaces || List is empty || List is all spaces
|
||||
if (match(listEntry,'\s\+') == 0 && match(listEntry,'\S\+') == -1)
|
||||
\ || List == '' || (match(List,'\s\+') == 0 && match(List,'\S\+') == -1)
|
||||
echoerr "Can't use all spaces for an entry <".listEntry.">"
|
||||
echoerr "Remaining supplied list: <".List.">"
|
||||
return
|
||||
endif
|
||||
|
||||
if !exists("b:SOM")
|
||||
let b:SOM='\<'
|
||||
endif
|
||||
if !exists("b:EOM")
|
||||
let b:EOM='\>'
|
||||
endif
|
||||
if !exists("b:match_words")
|
||||
let b:match_words=''
|
||||
endif
|
||||
if b:match_words != '' && match(b:match_words,',$') == -1
|
||||
let b:match_words=b:match_words.','
|
||||
endif
|
||||
" okay, all set add first entry in this list
|
||||
let b:match_words=b:match_words.b:SOM.listEntry.b:EOM.':'
|
||||
while Comma != -1
|
||||
let listEntryEnd=Comma
|
||||
let listEntry=strpart(List,listEntryBegin,listEntryEnd-listEntryBegin)
|
||||
let List=strpart(List,Comma+1)
|
||||
let Comma=match(List,',')
|
||||
" if listEntry is all spaces
|
||||
if match(listEntry,'\s\+') == 0 && match(listEntry,'\S\+') == -1
|
||||
echoerr "Can't use all spaces for an entry <".listEntry."> - skipping"
|
||||
echoerr "Remaining supplied list: <".List.">"
|
||||
continue
|
||||
endif
|
||||
let b:match_words=b:match_words.b:SOM.listEntry.b:EOM.':'
|
||||
endwhile
|
||||
let listEntry=List
|
||||
let b:match_words=b:match_words.b:SOM.listEntry.b:EOM
|
||||
endfunction
|
||||
|
||||
" TODO: Write a wrapper to handle multiple groups in one function call.
|
||||
" Don't see a lot of utility in this as it would undoubtedly warrant
|
||||
" continuation lines in the filetype script and it would be a toss
|
||||
" up as to which is more readable: individual calls one to a line or
|
||||
" a single call with continuation lines. I vote for the former.
|
||||
" Vim filetype plugin file utility
|
||||
" Language: * (various)
|
||||
" Maintainer: Dave Silvia <dsilvia@mchsi.com>
|
||||
" Date: 6/30/2004
|
||||
|
||||
" The start of match (b:SOM) default is:
|
||||
" '\<'
|
||||
" The end of match (b:EOM) default is:
|
||||
" '\>'
|
||||
"
|
||||
" If you want to use some other start/end of match, just assign the
|
||||
" value to the b:SOM|EOM variable in your filetype script.
|
||||
"
|
||||
" SEE: :h pattern.txt
|
||||
" :h pattern-searches
|
||||
" :h regular-expression
|
||||
" :h matchit
|
||||
|
||||
let s:myName=expand("<sfile>:t")
|
||||
|
||||
" matchit.vim not loaded -- don't do anyting
|
||||
if !exists("loaded_matchit")
|
||||
echomsg s:myName.": matchit.vim not loaded -- finishing without loading"
|
||||
finish
|
||||
endif
|
||||
|
||||
" already been here -- don't redefine
|
||||
if exists("*AppendMatchGroup")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Function To Build b:match_words
|
||||
" The following function, 'AppendMatchGroup', helps to increase
|
||||
" readability of your filetype script if you choose to use matchit.
|
||||
" It also precludes many construction errors, reducing the
|
||||
" construction to simply invoking the function with the match words.
|
||||
" As an example, let's take the ubiquitous if/then/else/endif type
|
||||
" of construct. This is how the entry in your filetype script would look.
|
||||
"
|
||||
" " source the AppendMatchGroup function file
|
||||
" runtime ftplugin/AppendMatchGroup.vim
|
||||
"
|
||||
" " fill b:match_words
|
||||
" call AppendMatchGroup('if,then,else,endif')
|
||||
"
|
||||
" And the b:match_words constructed would look like:
|
||||
"
|
||||
" \<if\>:\<then\>:\<else\>:\<endif\>
|
||||
"
|
||||
" Use of AppendMatchGroup makes your filetype script is a little
|
||||
" less busy and a lot more readable. Additionally, it
|
||||
" checks three critical things:
|
||||
"
|
||||
" 1) Do you have at least 2 entries in your match group.
|
||||
"
|
||||
" 2) Does the buffer variable 'b:match_words' exist? if not, create it.
|
||||
"
|
||||
" 3) If the buffer variable 'b:match_words' does exist, is the last
|
||||
" character a ','? If not, add it before appending.
|
||||
"
|
||||
" You should now be able to match 'if/then/else/endif' in succession
|
||||
" in your source file, in just about any construction you may have
|
||||
" chosen for them.
|
||||
"
|
||||
" To add another group, simply call 'AppendMatchGroup again. E.G.:
|
||||
"
|
||||
" call AppendMatchGroup('while,do,endwhile')
|
||||
|
||||
function AppendMatchGroup(mwordList)
|
||||
let List=a:mwordList
|
||||
let Comma=match(List,',')
|
||||
if Comma == -1 || Comma == strlen(List)-1
|
||||
echoerr "Must supply a comma separated list of at least 2 entries."
|
||||
echoerr "Supplied list: <".List.">"
|
||||
return
|
||||
endif
|
||||
let listEntryBegin=0
|
||||
let listEntryEnd=Comma
|
||||
let listEntry=strpart(List,listEntryBegin,listEntryEnd-listEntryBegin)
|
||||
let List=strpart(List,Comma+1)
|
||||
let Comma=match(List,',')
|
||||
" if listEntry is all spaces || List is empty || List is all spaces
|
||||
if (match(listEntry,'\s\+') == 0 && match(listEntry,'\S\+') == -1)
|
||||
\ || List == '' || (match(List,'\s\+') == 0 && match(List,'\S\+') == -1)
|
||||
echoerr "Can't use all spaces for an entry <".listEntry.">"
|
||||
echoerr "Remaining supplied list: <".List.">"
|
||||
return
|
||||
endif
|
||||
|
||||
if !exists("b:SOM")
|
||||
let b:SOM='\<'
|
||||
endif
|
||||
if !exists("b:EOM")
|
||||
let b:EOM='\>'
|
||||
endif
|
||||
if !exists("b:match_words")
|
||||
let b:match_words=''
|
||||
endif
|
||||
if b:match_words != '' && match(b:match_words,',$') == -1
|
||||
let b:match_words=b:match_words.','
|
||||
endif
|
||||
" okay, all set add first entry in this list
|
||||
let b:match_words=b:match_words.b:SOM.listEntry.b:EOM.':'
|
||||
while Comma != -1
|
||||
let listEntryEnd=Comma
|
||||
let listEntry=strpart(List,listEntryBegin,listEntryEnd-listEntryBegin)
|
||||
let List=strpart(List,Comma+1)
|
||||
let Comma=match(List,',')
|
||||
" if listEntry is all spaces
|
||||
if match(listEntry,'\s\+') == 0 && match(listEntry,'\S\+') == -1
|
||||
echoerr "Can't use all spaces for an entry <".listEntry."> - skipping"
|
||||
echoerr "Remaining supplied list: <".List.">"
|
||||
continue
|
||||
endif
|
||||
let b:match_words=b:match_words.b:SOM.listEntry.b:EOM.':'
|
||||
endwhile
|
||||
let listEntry=List
|
||||
let b:match_words=b:match_words.b:SOM.listEntry.b:EOM
|
||||
endfunction
|
||||
|
||||
" TODO: Write a wrapper to handle multiple groups in one function call.
|
||||
" Don't see a lot of utility in this as it would undoubtedly warrant
|
||||
" continuation lines in the filetype script and it would be a toss
|
||||
" up as to which is more readable: individual calls one to a line or
|
||||
" a single call with continuation lines. I vote for the former.
|
||||
|
||||
14
runtime/ftplugin/a2ps.vim
Normal file
14
runtime/ftplugin/a2ps.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: a2ps(1) configuration file
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-07-04
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< inc< fo<"
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s include=^\\s*Include:
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
13
runtime/ftplugin/alsaconf.vim
Normal file
13
runtime/ftplugin/alsaconf.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: alsaconf(8) configuration file
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-07-04
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
13
runtime/ftplugin/arch.vim
Normal file
13
runtime/ftplugin/arch.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: GNU Arch inventory file
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-07-04
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
@@ -1,11 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Langugage: Automake
|
||||
" Maintainer: Nikolai Weibull <source@pcppopper.org>
|
||||
" URL: http://www.pcppopper.org/vim/ftplugin/pcp/automake/
|
||||
" Latest Revision: 2004-05-22
|
||||
" arch-tag: 3a78b0cd-27b2-410a-8e7b-51a1717c2a5b
|
||||
" Language: Automake
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-06-22
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Same as makefile filetype plugin for now.
|
||||
runtime! ftplugin/make.vim ftplugin/make_*.vim ftplugin/make/*.vim
|
||||
|
||||
" vim: set sts=2 sw=2:
|
||||
|
||||
14
runtime/ftplugin/bdf.vim
Normal file
14
runtime/ftplugin/bdf.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: BDF font definition
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-07-04
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
|
||||
setlocal comments=b:COMMENT commentstring=COMMENT\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2005 Mar 27
|
||||
" Last Change: 2005 Sep 01
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -12,14 +12,20 @@ endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Using line continuation here.
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< | if has('vms') | setl isk< | endif"
|
||||
let b:undo_ftplugin = "setl fo< com< ofu< | if has('vms') | setl isk< | endif"
|
||||
|
||||
" Set 'formatoptions' to break comment lines but not other lines,
|
||||
" and insert the comment leader when hitting <CR> or using "o".
|
||||
setlocal fo-=t fo+=croql
|
||||
|
||||
" Set completion with CTRL-X CTRL-O to autoloaded function.
|
||||
if exists('&ofu')
|
||||
setlocal ofu=ccomplete#Complete
|
||||
endif
|
||||
|
||||
" Set 'comments' to format dashed lists in comments.
|
||||
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
||||
|
||||
@@ -48,3 +54,6 @@ if has("gui_win32") && !exists("b:browsefilter")
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
14
runtime/ftplugin/calendar.vim
Normal file
14
runtime/ftplugin/calendar.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: calendar(1) input file
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-07-04
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< inc< fo<"
|
||||
|
||||
setlocal comments=s1:/*,mb:*,ex:*/ commentstring& include&
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
@@ -1,24 +1,22 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: generic Changelog file
|
||||
" Maintainer: Nikolai Weibull <source@pcppopper.org>
|
||||
" URL: http://www.pcppopper.org/vim/ftplugin/pcp/changelog/
|
||||
" Latest Revision: 2004-04-25
|
||||
" arch-tag: b00e2974-c559-4477-b7b2-3ef3f4061bdb
|
||||
" Language: generic Changelog file
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-06-29
|
||||
" Variables:
|
||||
" g:changelog_timeformat -
|
||||
" description: the timeformat used in ChangeLog entries.
|
||||
" default: "%Y-%m-%d".
|
||||
" description: the timeformat used in ChangeLog entries.
|
||||
" default: "%Y-%m-%d".
|
||||
" g:changelog_username -
|
||||
" description: the username to use in ChangeLog entries
|
||||
" default: try to deduce it from environment variables and system files.
|
||||
" description: the username to use in ChangeLog entries
|
||||
" default: try to deduce it from environment variables and system files.
|
||||
" Local Mappings:
|
||||
" <Leader>o -
|
||||
" adds a new changelog entry for the current user for the current date.
|
||||
" adds a new changelog entry for the current user for the current date.
|
||||
" Global Mappings:
|
||||
" <Leader>o -
|
||||
" switches to the ChangeLog buffer opened for the current directory, or
|
||||
" opens it in a new buffer if it exists in the current directory. Then
|
||||
" it does the same as the local <Leader>o described above.
|
||||
" switches to the ChangeLog buffer opened for the current directory, or
|
||||
" opens it in a new buffer if it exists in the current directory. Then
|
||||
" it does the same as the local <Leader>o described above.
|
||||
" Notes:
|
||||
" run 'runtime ftplugin/changelog.vim' to enable the global mapping for
|
||||
" changelog files.
|
||||
@@ -28,16 +26,13 @@
|
||||
|
||||
" If 'filetype' isn't "changelog", we must have been to add ChangeLog opener
|
||||
if &filetype == "changelog"
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let cpo_save = &cpo
|
||||
set cpo-=C
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" The format of the date-time field (should have been called dateformat)
|
||||
if !exists("g:changelog_timeformat")
|
||||
@@ -55,56 +50,56 @@ if &filetype == "changelog"
|
||||
" Get the users login name
|
||||
let login = system('whoami')
|
||||
if v:shell_error
|
||||
let login = 'unknown'
|
||||
let login = 'unknown'
|
||||
else
|
||||
let newline = stridx(login, "\n")
|
||||
if newline != -1
|
||||
let login = strpart(login, 0, newline)
|
||||
endif
|
||||
let newline = stridx(login, "\n")
|
||||
if newline != -1
|
||||
let login = strpart(login, 0, newline)
|
||||
endif
|
||||
endif
|
||||
|
||||
" Try to full name from gecos field in /etc/passwd
|
||||
if filereadable('/etc/passwd')
|
||||
let name = substitute(
|
||||
\system('cat /etc/passwd | grep ^`whoami`'),
|
||||
\'^\%([^:]*:\)\{4}\([^:]*\):.*$', '\1', '')
|
||||
let name = substitute(
|
||||
\system('cat /etc/passwd | grep ^`whoami`'),
|
||||
\'^\%([^:]*:\)\{4}\([^:]*\):.*$', '\1', '')
|
||||
endif
|
||||
|
||||
" If there is no such file, or there was some other problem try
|
||||
" others
|
||||
if !filereadable('/etc/passwd') || v:shell_error
|
||||
" Maybe the environment has something of interest
|
||||
if exists("$NAME")
|
||||
let name = $NAME
|
||||
else
|
||||
" No? well, use the login name and capitalize first
|
||||
" character
|
||||
let name = toupper(login[0]) . strpart(login, 1)
|
||||
endif
|
||||
" Maybe the environment has something of interest
|
||||
if exists("$NAME")
|
||||
let name = $NAME
|
||||
else
|
||||
" No? well, use the login name and capitalize first
|
||||
" character
|
||||
let name = toupper(login[0]) . strpart(login, 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
" Only keep stuff before the first comma
|
||||
let comma = stridx(name, ',')
|
||||
if comma != -1
|
||||
let name = strpart(name, 0, comma)
|
||||
let name = strpart(name, 0, comma)
|
||||
endif
|
||||
|
||||
" And substitute & in the real name with the login of our user
|
||||
let amp = stridx(name, '&')
|
||||
if amp != -1
|
||||
let name = strpart(name, 0, amp) . toupper(login[0]) .
|
||||
\strpart(login, 1) . strpart(name, amp + 1)
|
||||
let name = strpart(name, 0, amp) . toupper(login[0]) .
|
||||
\strpart(login, 1) . strpart(name, amp + 1)
|
||||
endif
|
||||
|
||||
" Get our hostname
|
||||
let hostname = system("hostname")
|
||||
if v:shell_error
|
||||
let hostname = 'unknownhost'
|
||||
let hostname = 'unknownhost'
|
||||
else
|
||||
let newline = stridx(hostname, "\n")
|
||||
if newline != -1
|
||||
let hostname = strpart(hostname, 0, newline)
|
||||
endif
|
||||
let newline = stridx(hostname, "\n")
|
||||
if newline != -1
|
||||
let hostname = strpart(hostname, 0, newline)
|
||||
endif
|
||||
endif
|
||||
|
||||
" And finally set the username
|
||||
@@ -134,15 +129,15 @@ if &filetype == "changelog"
|
||||
while i != -1
|
||||
let char = str[i + 1]
|
||||
if char == '%'
|
||||
let middle = '%'
|
||||
let middle = '%'
|
||||
elseif char == 'd'
|
||||
let middle = a:date
|
||||
let middle = a:date
|
||||
elseif char == 'u'
|
||||
let middle = a:user
|
||||
let middle = a:user
|
||||
elseif char == 'c'
|
||||
let middle = '{cursor}'
|
||||
let middle = '{cursor}'
|
||||
else
|
||||
let middle = char
|
||||
let middle = char
|
||||
endif
|
||||
let str = strpart(str, 0, i) . middle . strpart(str, i + 2)
|
||||
let i = stridx(str, '%')
|
||||
@@ -169,17 +164,17 @@ if &filetype == "changelog"
|
||||
" Look for an entry for today by our user
|
||||
let date = strftime(g:changelog_timeformat)
|
||||
let search = s:substitute_items(g:changelog_date_entry_search, date,
|
||||
\g:changelog_username)
|
||||
\g:changelog_username)
|
||||
if search(search) > 0
|
||||
" Ok, now we look for the end of the date-entry, and add an entry
|
||||
let pos = nextnonblank(line('.') + 1)
|
||||
let line = getline(pos)
|
||||
while line =~ '^\s\+\S\+'
|
||||
let pos = pos + 1
|
||||
let line = getline(pos)
|
||||
let pos = pos + 1
|
||||
let line = getline(pos)
|
||||
endwhile
|
||||
let insert = s:substitute_items(g:changelog_new_entry_format,
|
||||
\'', '')
|
||||
\'', '')
|
||||
execute "normal! ".(pos - 1)."Go".insert
|
||||
execute pos
|
||||
else
|
||||
@@ -188,18 +183,18 @@ if &filetype == "changelog"
|
||||
|
||||
" No entry today, so create a date-user header and insert an entry
|
||||
let todays_entry = s:substitute_items(g:changelog_new_date_format,
|
||||
\date, g:changelog_username)
|
||||
\date, g:changelog_username)
|
||||
" Make sure we have a cursor positioning
|
||||
if stridx(todays_entry, '{cursor}') == -1
|
||||
let todays_entry = todays_entry.'{cursor}'
|
||||
let todays_entry = todays_entry.'{cursor}'
|
||||
endif
|
||||
|
||||
" Now do the work
|
||||
execute "normal! i".todays_entry
|
||||
if remove_empty
|
||||
while getline('$') == ''
|
||||
$delete
|
||||
endwhile
|
||||
while getline('$') == ''
|
||||
$delete
|
||||
endwhile
|
||||
endif
|
||||
|
||||
1
|
||||
@@ -216,7 +211,7 @@ if &filetype == "changelog"
|
||||
command! -nargs=0 NewChangelogEntry call s:new_changelog_entry()
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl com< tw< fo< et<"
|
||||
let b:undo_ftplugin = "setl com< tw< fo< et< ai<"
|
||||
|
||||
if &textwidth == 0
|
||||
setlocal textwidth=78
|
||||
@@ -224,9 +219,10 @@ if &filetype == "changelog"
|
||||
setlocal comments=
|
||||
setlocal formatoptions+=t
|
||||
setlocal noexpandtab
|
||||
" setlocal autoindent now in indent file
|
||||
setlocal autoindent
|
||||
|
||||
let &cpo = cpo_save
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
else
|
||||
" Add the Changelog opening mapping
|
||||
nmap <silent> <Leader>o :call <SID>open_changelog()<CR>
|
||||
@@ -234,23 +230,21 @@ else
|
||||
function! s:open_changelog()
|
||||
if filereadable('ChangeLog')
|
||||
if bufloaded('ChangeLog')
|
||||
let buf = bufnr('ChangeLog')
|
||||
execute "normal! \<C-W>t"
|
||||
while winbufnr(winnr()) != buf
|
||||
execute "normal! \<C-W>w"
|
||||
endwhile
|
||||
let buf = bufnr('ChangeLog')
|
||||
execute "normal! \<C-W>t"
|
||||
while winbufnr(winnr()) != buf
|
||||
execute "normal! \<C-W>w"
|
||||
endwhile
|
||||
else
|
||||
split ChangeLog
|
||||
split ChangeLog
|
||||
endif
|
||||
|
||||
if exists("g:mapleader")
|
||||
execute "normal " . g:mapleader . "o"
|
||||
execute "normal " . g:mapleader . "o"
|
||||
else
|
||||
execute "normal \\o"
|
||||
execute "normal \\o"
|
||||
endif
|
||||
startinsert!
|
||||
endif
|
||||
endfunction
|
||||
endif
|
||||
|
||||
" vim: set sts=2 sw=2:
|
||||
|
||||
13
runtime/ftplugin/conf.vim
Normal file
13
runtime/ftplugin/conf.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: generic configuration file
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-07-04
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
36
runtime/ftplugin/context.vim
Normal file
36
runtime/ftplugin/context.vim
Normal file
@@ -0,0 +1,36 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: ConTeXt typesetting engine
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-07-04
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< def< inc< sua< fo<"
|
||||
|
||||
setlocal comments=:%,b:%D,b:%C,b:%M commentstring=%\ %s formatoptions+=tcroql
|
||||
|
||||
let &l:define='\\\%([egx]\|char\|mathchar\|count\|dimen\|muskip\|skip\|toks\)\='
|
||||
\ . 'def\|\\font\|\\\%(future\)\=let'
|
||||
\ . '\|\\new\%(count\|dimen\|skip\|muskip\|box\|toks\|read\|write'
|
||||
\ . '\|fam\|insert\|if\)'
|
||||
|
||||
let &l:include = '^\s*\%(input\|component\)'
|
||||
|
||||
setlocal suffixesadd=.tex
|
||||
|
||||
if exists("loaded_matchit")
|
||||
let b:match_ignorecase = 0
|
||||
let b:match_skip = 'r:\\\@<!\%(\\\\\)*%'
|
||||
let b:match_words = '(:),\[:],{:},\\(:\\),\\\[:\\],' .
|
||||
\ '\\start\(\a\+\):\\stop\1'
|
||||
endif " exists("loaded_matchit")
|
||||
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
13
runtime/ftplugin/crm.vim
Normal file
13
runtime/ftplugin/crm.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: CRM114
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-07-04
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
@@ -1,20 +1,16 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: CSS
|
||||
" Maintainer: Nikolai Weibull <source@pcppopper.org>
|
||||
" URL: http://www.pcppopper.org/vim/ftplugin/pcp/css/
|
||||
" Latest Revision: 2004-04-25
|
||||
" arch-tag: 5fa7c74f-bf1a-47c4-b06f-6efe8f48db3b
|
||||
" Language: CSS
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-07-04
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setl com<"
|
||||
let b:undo_ftplugin = "setl com< cms< inc< fo<"
|
||||
|
||||
setlocal comments=s1:/*,mb:*,ex:*/
|
||||
setlocal comments=s1:/*,mb:*,ex:*/ commentstring&
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
" vim: set sts=2 sw=2:
|
||||
let &l:include = '^\s*@import\s\+\%(url(\)\='
|
||||
|
||||
13
runtime/ftplugin/cvsrc.vim
Normal file
13
runtime/ftplugin/cvsrc.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: cvs(1) RC file
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-07-04
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
|
||||
setlocal comments= commentstring= formatoptions-=tcroql
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user