Compare commits

...

68 Commits

Author SHA1 Message Date
a022bb3567 updated for version 7.1a 2007-05-06 17:22:46 +00:00
2d0ed69d58 updated for version 7.1a 2007-05-06 17:19:06 +00:00
89cf6cf04c updated for version 7.1a 2007-05-06 16:50:15 +00:00
edfe968e1a updated for version 7.1a 2007-05-06 16:46:03 +00:00
ad44decbac updated for version 7.1a 2007-05-06 16:41:27 +00:00
fee049ad25 updated for version 7.1a 2007-05-06 16:39:48 +00:00
8da4467eb3 updated for version 7.1a 2007-05-06 16:33:11 +00:00
7b85141b84 updated for version 7.1a 2007-05-06 16:28:11 +00:00
b317167494 updated for version 7.1a 2007-05-06 16:19:19 +00:00
1f8ae7a083 updated for version 7.1a 2007-05-06 16:15:07 +00:00
b57bf7277b updated for version 7.1a 2007-05-06 15:48:14 +00:00
7ec09eeb83 updated for version 7.1a 2007-05-06 15:30:35 +00:00
15aa18172b updated for version 7.1a 2007-05-06 15:28:16 +00:00
24652c0005 updated for version 7.1a 2007-05-06 15:11:45 +00:00
d955be3f20 updated for version 7.1a 2007-05-06 14:33:06 +00:00
6b803a739f updated for version 7.1a 2007-05-06 14:25:46 +00:00
17e79197d5 updated for version 7.1a 2007-05-06 14:15:36 +00:00
8cfdc0df95 updated for version 7.1a 2007-05-06 14:12:36 +00:00
da65f156f3 updated for version 7.1a 2007-05-06 13:54:35 +00:00
8d1ab51e8f updated for version 7.1a 2007-05-06 13:49:21 +00:00
6519ac87d8 updated for version 7.1a 2007-05-06 13:45:52 +00:00
d55de224a0 updated for version 7.1a 2007-05-06 13:38:48 +00:00
ef2f6569ce updated for version 7.1a 2007-05-06 13:32:59 +00:00
c3739303b0 updated for version 7.1a 2007-05-06 13:28:50 +00:00
d7afed3753 updated for version 7.1a 2007-05-06 13:26:41 +00:00
9fc8c24ef8 updated for version 7.1a 2007-05-06 13:23:02 +00:00
024678745b updated for version 7.1a 2007-05-06 13:22:01 +00:00
ff4a37e325 updated for version 7.1a 2007-05-06 13:18:29 +00:00
ea430ea7d5 updated for version 7.1a 2007-05-06 13:10:49 +00:00
e9400a45da updated for version 7.1a 2007-05-06 13:04:32 +00:00
24b231793e updated for version 7.1a 2007-05-06 12:54:06 +00:00
9e1d2839c6 updated for version 7.1a 2007-05-06 12:51:41 +00:00
a9af0e6a0a updated for version 7.1a 2007-05-06 12:48:13 +00:00
1f5c517296 updated for version 7.1a 2007-05-06 12:46:22 +00:00
36f5ac0859 updated for version 7.1a 2007-05-06 12:40:34 +00:00
623fe606ae updated for version 7.1a 2007-05-06 12:39:05 +00:00
7bff313a94 updated for version 7.1a 2007-05-06 12:34:30 +00:00
7528dd68a7 updated for version 7.1a 2007-05-06 12:32:12 +00:00
b5dd424dc3 updated for version 7.1a 2007-05-06 12:28:24 +00:00
8bc7847e20 updated for version 7.1a 2007-05-06 12:26:25 +00:00
82de0d760b updated for version 7.1a 2007-05-06 12:18:31 +00:00
5c5b0941ca updated for version 7.1a 2007-05-06 12:07:59 +00:00
c980de3382 updated for version 7.1a 2007-05-06 11:59:04 +00:00
4e86cbab27 updated for version 7.1a 2007-05-06 11:56:32 +00:00
044defef06 updated for version 7.1a 2007-05-06 11:55:00 +00:00
be860d34dd updated for version 7.1a 2007-05-06 11:53:06 +00:00
7b98ce07ce updated for version 7.1a 2007-05-06 11:29:37 +00:00
83e138c606 updated for version 7.1a 2007-05-05 18:27:07 +00:00
c81e5e79a0 updated for version 7.1a 2007-05-05 18:24:42 +00:00
9aae141a6b updated for version 7.1a 2007-05-05 18:01:06 +00:00
756ec0f3c9 updated for version 7.1a 2007-05-05 17:59:48 +00:00
313b7237ad updated for version 7.1a 2007-05-05 17:56:55 +00:00
9964e468c0 updated for version 7.1a 2007-05-05 17:54:07 +00:00
d5ab34bd5e updated for version 7.1a 2007-05-05 17:15:44 +00:00
0630b8d96d updated for version 7.1a 2007-05-05 17:11:56 +00:00
dd2a3cda55 updated for version 7.1a 2007-05-05 17:10:09 +00:00
3ed4447ed7 updated for version 7.0-243 2007-05-05 10:52:16 +00:00
aea02fa475 updated for version 7.0-242 2007-05-04 20:29:09 +00:00
4142324d25 updated for version 7.0-241 2007-05-03 20:11:13 +00:00
ee79cbc7af updated for version 7.0-240 2007-05-02 19:50:14 +00:00
eeefcc7723 updated for version 7.0-239 2007-05-01 21:21:21 +00:00
0ddf0a7df0 updated for version 7.0-238 2007-05-01 20:04:53 +00:00
8243a7928b updated for version 7.0-237 2007-05-01 17:05:03 +00:00
914572aba4 updated for version 7.0-236 2007-05-01 11:37:47 +00:00
d9fe7c4bb8 updated for version 7.0-235 2007-04-29 11:53:56 +00:00
3d43a6658c updated for version 7.0-234 2007-04-27 20:15:55 +00:00
bbe8c3f735 updated for version 7.0-233 2007-04-26 16:40:56 +00:00
79ee315b72 updated for version 7.0-232 2007-04-26 16:20:50 +00:00
489 changed files with 35077 additions and 13594 deletions

View File

@ -9,10 +9,10 @@ Vim Vi IMproved. A clone of the UNIX text editor Vi. Very useful
messages, shows current file name in window title, on-line
help, rectangular cut/paste, etc., etc., etc...
Version 7.0. Also runs under UNIX, MSDOS and other systems.
vim70rt.tgz contains the documentation and syntax files.
vim70bin.tgz contains the binaries.
vim70src.tgz contains the sources.
Version 7.1a. Also runs under UNIX, MSDOS and other systems.
vim71art.tgz contains the documentation and syntax files.
vim71abin.tgz contains the binaries.
vim71asrc.tgz contains the sources.
Author: Bram Moolenaar et al.

View File

@ -568,7 +568,8 @@ RT_AMI = \
libs/arp.library \
runtime/doc.info \
runtime/doc/*.info \
runtime/icons \
runtime/icons/README.txt \
runtime/icons/*.info \
runtime/icons.info \
runtime/macros.info \
runtime/macros/*.info \
@ -644,7 +645,8 @@ EXTRA = \
$(SRC_EXTRA) \
README_extra.txt \
src/VisVim/VisVim.dll \
farsi \
farsi/README.txt \
farsi/fonts/*/far* \
runtime/vimlogo.xpm \
src/swis.s \
src/tee/Makefile* \
@ -669,12 +671,15 @@ LANG_GEN = \
runtime/tutor/README.*.txt \
runtime/tutor/Makefile \
runtime/tutor/tutor.?? \
runtime/tutor/tutor.cs.* \
runtime/tutor/tutor.gr.* \
runtime/tutor/tutor.hu.* \
runtime/tutor/tutor.ja.* \
runtime/tutor/tutor.ko.* \
runtime/tutor/tutor.pl.* \
runtime/tutor/tutor.ru.* \
runtime/tutor/tutor.sk.* \
runtime/tutor/tutor.tr.* \
runtime/tutor/tutor.zh.* \
runtime/spell/README.txt \
runtime/spell/??/*.diff \

View File

@ -27,7 +27,7 @@ first:
# Some make programs use the last target for the $@ default; put the other
# targets separately to always let $@ expand to "first" by default.
all install uninstall tools config configure proto depend lint tags types test testclean clean distclean:
all install uninstall tools config configure reconfig proto depend lint tags types test testclean clean distclean:
@echo "Starting make in the src directory."
@echo "If there are problems, cd to the src directory and run make there"
cd src && $(MAKE) $@
@ -69,7 +69,7 @@ all install uninstall tools config configure proto depend lint tags types test t
# Before creating an archive first delete all backup files, *.orig, etc.
MAJOR = 7
MINOR = 0
MINOR = 1a
# Uncomment this line if the Win32s version is to be included.
DOSBIN_S = dosbin_s
@ -81,14 +81,14 @@ DOSBIN_S = dosbin_s
# 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, MZscheme, Cscope and "huge"
# features. Exclude workshop and SNiFF.
# - Compile Vim with GTK, Perl, Python, TCL, Ruby, MZscheme (if you can make it
# work), 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).
# - "make lint" and check the output (ignore GTK warnings).
# - Enable the efence library in "src/Makefile" and run "make test". May
# require disabling Python to avoid trouble with threads.
# require disabling Python and Ruby to avoid trouble with threads.
# - Check for missing entries in runtime/makemenu.vim (with checkmenu script).
# - Check for missing options in runtime/optwin.vim et al. (with check.vim).
# - Do "make menu" to update the runtime/synmenu.vim file.
@ -128,24 +128,25 @@ DOSBIN_S = dosbin_s
# - Rename the executables to "vimd32.exe", "xxdd32.exe", "installd32.exe" and
# "uninstald32.exe".
# Win32 console version:
# - Set environment for Visual C++ Toolkit 2003: "msvcsetup.bat"
# - Set environment for Visual C++ Toolkit 2003: "msvcsetup.bat" (adjust the
# paths when necessary).
# - "nmake -f Make_mvc.mak"
# - "rm testdir/*.out", "nmake -f Make_mvc.mak test" and check the output.
# - Rename the executables to "vimw32.exe", "xxdw32.exe".
# - Rename ObjC/vim.pdb to vimw32.pdb.
# - Rename vim.pdb to vimw32.pdb.
# - When building the Win32s version later, delete vimrun.exe, install.exe and
# uninstal.exe. Otherwise rename executables to installw32.exe and
# uninstalw32.exe.
# Win32 GUI version:
# - "nmake -f Make_mvc.mak GUI=yes.
# - move "gvim.exe" to here (otherwise the OLE version will overwrite it).
# - Move ObjG/gvim.pdb to here.
# - Move gvim.pdb to here.
# - Delete vimrun.exe, install.exe and uninstall.exe.
# - Copy "GvimExt/gvimext.dll" to here.
# Win32 GUI version with OLE, PERL, TCL, PYTHON and dynamic IME:
# - Run src/bigvim.bat ("nmake -f Make_mvc.mak GUI=yes OLE=yes IME=yes ...)
# - Rename "gvim.exe" to "gvim_ole.exe".
# - Rename ObjGOLYTR/gvim.pdb to "gvim_ole.pdb".
# - Rename gvim.pdb to "gvim_ole.pdb".
# - Delete install.exe and uninstall.exe.
# - If building the Win32s version delete vimrun.exe.
# Win32s GUI version:

View File

@ -1,4 +1,4 @@
README.txt for version 7.0 of Vim: Vi IMproved.
README.txt for version 7.1a of Vim: Vi IMproved.
WHAT IS VIM

View File

@ -1,4 +1,4 @@
README_ami.txt for version 7.0 of Vim: Vi IMproved.
README_ami.txt for version 7.1a of Vim: Vi IMproved.
This file explains the installation of Vim on Amiga systems.
See README.txt for general information about Vim.

View File

@ -1,4 +1,4 @@
README_amibin.txt for version 7.0 of Vim: Vi IMproved.
README_amibin.txt for version 7.1a of Vim: Vi IMproved.
See "README.txt" for general information about Vim.
See "README_ami.txt" for installation instructions for the Amiga.

View File

@ -1,4 +1,4 @@
README_amisrc.txt for version 7.0 of Vim: Vi IMproved.
README_amisrc.txt for version 7.1a of Vim: Vi IMproved.
See "README.txt" for general information about Vim.
See "README_ami.txt" for installation instructions for the Amiga.

View File

@ -1,4 +1,4 @@
README_bindos.txt for version 7.0 of Vim: Vi IMproved.
README_bindos.txt for version 7.1a of Vim: Vi IMproved.
See "README.txt" for general information about Vim.
See "README_dos.txt" for installation instructions for MS-DOS and MS-Windows.

View File

@ -1,4 +1,4 @@
README_dos.txt for version 7.0 of Vim: Vi IMproved.
README_dos.txt for version 7.1a of Vim: Vi IMproved.
This file explains the installation of Vim on MS-DOS and MS-Windows systems.
See "README.txt" for general information about Vim.

View File

@ -1,4 +1,4 @@
README_extra.txt for version 7.0 of Vim: Vi IMproved.
README_extra.txt for version 7.1a of Vim: Vi IMproved.
The extra archive of Vim is to be used in combination with the source archive
(vim-7.0-src.tar.gz). The extra archive is useless without it.

View File

@ -1,4 +1,4 @@
README_lang.txt for version 7.0 of Vim: Vi IMproved.
README_lang.txt for version 7.1a of Vim: Vi IMproved.
This file contains files for non-English languages:
- Translated messages.

View File

@ -1,4 +1,4 @@
README_mac.txt for version 7.0 of Vim: Vi IMproved.
README_mac.txt for version 7.1a of Vim: Vi IMproved.
This file explains the installation of Vim on Macintosh systems.
See "README.txt" for general information about Vim.

View File

@ -1,4 +1,4 @@
README_ole.txt for version 7.0 of Vim: Vi IMproved.
README_ole.txt for version 7.1a of Vim: Vi IMproved.
This archive contains gvim.exe with OLE interface and VisVim.
This version of gvim.exe can also load a number of interface dynamically (you

View File

@ -1,32 +1,32 @@
README_os2.txt for version 7.0 of Vim: Vi IMproved.
README_os2.txt for version 7.1a of Vim: Vi IMproved.
This file explains the installation of Vim on OS/2 systems.
See "README.txt" for general information about Vim.
NOTE: You will need two archives:
vim70rt.zip contains the runtime files (same as for the PC version)
vim70os2.zip contains the OS/2 executables
vim71art.zip contains the runtime files (same as for the PC version)
vim71aos2.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/vim70",
2. Unpack the zip archives. This will create a new directory "vim/vim71a",
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 vim70os2.zip
unzip vim70os2.zip
pkunzip -d vim71aos2.zip
unzip vim71aos2.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\vim70
set path=%path%;D:\editors\vim\vim70
set path=%path%;C:\vim\vim71a
set path=%path%;D:\editors\vim\vim71a
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\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.
C:\vim\vim71a\vim.exe The Vim version 7.1a executable.
C:\vim\vim71a\doc\*.txt The version 7.1a documentation files.
C:\vim\vim71a\bugreport.vim A Vim version 7.1a script.
C:\vim\vim71a\... Other version 7.1a distributed files.
In this case the $VIM environment variable would be set like this:
set VIM=C:\vim

View File

@ -1,4 +1,4 @@
README_os_390.txt for version 7.0 of Vim: Vi IMproved.
README_os_390.txt for version 7.1a of Vim: Vi IMproved.
Welcome to the OS/390 Unix port of VIM.

View File

@ -1,4 +1,4 @@
README_src.txt for version 7.0 of Vim: Vi IMproved.
README_src.txt for version 7.1a of Vim: Vi IMproved.
The source archive contains the files needed to compile Vim on Unix systems.
It is packed for Unix systems (NL line separator). It is also used for other

View File

@ -1,4 +1,4 @@
README_srcdos.txt for version 7.0 of Vim: Vi IMproved.
README_srcdos.txt for version 7.1a of Vim: Vi IMproved.
See "README.txt" for general information about Vim.
See "README_dos.txt" for installation instructions for MS-DOS and MS-Windows.

View File

@ -1,4 +1,4 @@
README_unix.txt for version 7.0 of Vim: Vi IMproved.
README_unix.txt for version 7.1a of Vim: Vi IMproved.
This file explains the installation of Vim on Unix systems.
See "README.txt" for general information about Vim.

View File

@ -1,4 +1,4 @@
README_vms.txt for version 7.0 of Vim: Vi IMproved.
README_vms.txt for version 7.1a of Vim: Vi IMproved.
This file explains the installation of Vim on VMS systems.
See "README.txt" in the runtime archive for information about Vim.

View File

@ -1,4 +1,4 @@
README_w32s.txt for version 7.0 of Vim: Vi IMproved.
README_w32s.txt for version 7.1a of Vim: Vi IMproved.
This archive contains the gvim.exe that was specifically compiled for use in
the Win32s subsystem in MS-Windows 3.1 and 3.11.

2
farsi/README.txt Normal file
View File

@ -0,0 +1,2 @@
For information about installation of Farsi fonts and Vim usage in Farsi mode,
refer to the Farsi help file by typing ":help farsi" in Vim.

BIN
farsi/fonts/DOS/far-a01.com Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -22,7 +22,7 @@
!define HAVE_NLS
!define VER_MAJOR 7
!define VER_MINOR 0
!define VER_MINOR 1a
# ----------- No configurable settings below this line -----------

595
runtime/autoload/ada.vim Normal file
View File

@ -0,0 +1,595 @@
"------------------------------------------------------------------------------
" Description: Perform Ada specific completion & tagging.
" Language: Ada (2005)
" $Id$
" Maintainer: Martin Krischik
" Neil Bird <neil@fnxweb.com>
" $Author$
" $Date$
" Version: 4.2
" $Revision$
" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $
" History: 24.05.2006 MK Unified Headers
" 26.05.2006 MK ' should not be in iskeyword.
" 16.07.2006 MK Ada-Mode as vim-ball
" 02.10.2006 MK Better folding.
" 15.10.2006 MK Bram's suggestion for runtime integration
" 05.11.2006 MK Bram suggested not to use include protection for
" autoload
" 05.11.2006 MK Bram suggested to save on spaces
" Help Page: ft-ada-functions
"------------------------------------------------------------------------------
if version < 700
finish
endif
" Section: Constants {{{1
"
let g:ada#DotWordRegex = '\a\w*\(\_s*\.\_s*\a\w*\)*'
let g:ada#WordRegex = '\a\w*'
let g:ada#Comment = "\\v^(\"[^\"]*\"|'.'|[^\"']){-}\\zs\\s*--.*"
let g:ada#Keywords = []
" Section: g:ada#Keywords {{{1
"
" Section: add Ada keywords {{{2
"
for Item in ['abort', 'else', 'new', 'return', 'abs', 'elsif', 'not', 'reverse', 'abstract', 'end', 'null', 'accept', 'entry', 'select', 'access', 'exception', 'of', 'separate', 'aliased', 'exit', 'or', 'subtype', 'all', 'others', 'synchronized', 'and', 'for', 'out', 'array', 'function', 'overriding', 'tagged', 'at', 'task', 'generic', 'package', 'terminate', 'begin', 'goto', 'pragma', 'then', 'body', 'private', 'type', 'if', 'procedure', 'case', 'in', 'protected', 'until', 'constant', 'interface', 'use', 'is', 'raise', 'declare', 'range', 'when', 'delay', 'limited', 'record', 'while', 'delta', 'loop', 'rem', 'with', 'digits', 'renames', 'do', 'mod', 'requeue', 'xor']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'keyword',
\ 'info': 'Ada keyword.',
\ 'kind': 'k',
\ 'icase': 1}]
endfor
" Section: GNAT Project Files {{{3
"
if exists ('g:ada_with_gnat_project_files')
for Item in ['project']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'keyword',
\ 'info': 'GNAT projectfile keyword.',
\ 'kind': 'k',
\ 'icase': 1}]
endfor
endif
" Section: add standart exception {{{2
"
for Item in ['Constraint_Error', 'Program_Error', 'Storage_Error', 'Tasking_Error', 'Status_Error', 'Mode_Error', 'Name_Error', 'Use_Error', 'Device_Error', 'End_Error', 'Data_Error', 'Layout_Error', 'Length_Error', 'Pattern_Error', 'Index_Error', 'Translation_Error', 'Time_Error', 'Argument_Error', 'Tag_Error', 'Picture_Error', 'Terminator_Error', 'Conversion_Error', 'Pointer_Error', 'Dereference_Error', 'Update_Error']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'exception',
\ 'info': 'Ada standart exception.',
\ 'kind': 'x',
\ 'icase': 1}]
endfor
" Section: add GNAT exception {{{3
"
if exists ('g:ada_gnat_extensions')
for Item in ['Assert_Failure']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'exception',
\ 'info': 'GNAT exception.',
\ 'kind': 'x',
\ 'icase': 1}]
endfor
endif
" Section: add Ada buildin types {{{2
"
for Item in ['Boolean', 'Integer', 'Natural', 'Positive', 'Float', 'Character', 'Wide_Character', 'Wide_Wide_Character', 'String', 'Wide_String', 'Wide_Wide_String', 'Duration']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'type',
\ 'info': 'Ada buildin type.',
\ 'kind': 't',
\ 'icase': 1}]
endfor
" Section: add GNAT buildin types {{{3
"
if exists ('g:ada_gnat_extensions')
for Item in ['Short_Integer', 'Short_Short_Integer', 'Long_Integer', 'Long_Long_Integer', 'Short_Float', 'Short_Short_Float', 'Long_Float', 'Long_Long_Float']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'type',
\ 'info': 'GNAT buildin type.',
\ 'kind': 't',
\ 'icase': 1}]
endfor
endif
" Section: add Ada Attributes {{{2
"
for Item in ['''Access', '''Address', '''Adjacent', '''Aft', '''Alignment', '''Base', '''Bit_Order', '''Body_Version', '''Callable', '''Caller', '''Ceiling', '''Class', '''Component_Size', '''Compose', '''Constrained', '''Copy_Sign', '''Count', '''Definite', '''Delta', '''Denorm', '''Digits', '''Emax', '''Exponent', '''External_Tag', '''Epsilon', '''First', '''First_Bit', '''Floor', '''Fore', '''Fraction', '''Identity', '''Image', '''Input', '''Large', '''Last', '''Last_Bit', '''Leading_Part', '''Length', '''Machine', '''Machine_Emax', '''Machine_Emin', '''Machine_Mantissa', '''Machine_Overflows', '''Machine_Radix', '''Machine_Rounding', '''Machine_Rounds', '''Mantissa', '''Max', '''Max_Size_In_Storage_Elements', '''Min', '''Mod', '''Model', '''Model_Emin', '''Model_Epsilon', '''Model_Mantissa', '''Model_Small', '''Modulus', '''Output', '''Partition_ID', '''Pos', '''Position', '''Pred', '''Priority', '''Range', '''Read', '''Remainder', '''Round', '''Rounding', '''Safe_Emax', '''Safe_First', '''Safe_Large', '''Safe_Last', '''Safe_Small', '''Scale', '''Scaling', '''Signed_Zeros', '''Size', '''Small', '''Storage_Pool', '''Storage_Size', '''Stream_Size', '''Succ', '''Tag', '''Terminated', '''Truncation', '''Unbiased_Rounding', '''Unchecked_Access', '''Val', '''Valid', '''Value', '''Version', '''Wide_Image', '''Wide_Value', '''Wide_Wide_Image', '''Wide_Wide_Value', '''Wide_Wide_Width', '''Wide_Width', '''Width', '''Write']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'attribute',
\ 'info': 'Ada attribute.',
\ 'kind': 'a',
\ 'icase': 1}]
endfor
" Section: add GNAT Attributes {{{3
"
if exists ('g:ada_gnat_extensions')
for Item in ['''Abort_Signal', '''Address_Size', '''Asm_Input', '''Asm_Output', '''AST_Entry', '''Bit', '''Bit_Position', '''Code_Address', '''Default_Bit_Order', '''Elaborated', '''Elab_Body', '''Elab_Spec', '''Emax', '''Enum_Rep', '''Epsilon', '''Fixed_Value', '''Has_Access_Values', '''Has_Discriminants', '''Img', '''Integer_Value', '''Machine_Size', '''Max_Interrupt_Priority', '''Max_Priority', '''Maximum_Alignment', '''Mechanism_Code', '''Null_Parameter', '''Object_Size', '''Passed_By_Reference', '''Range_Length', '''Storage_Unit', '''Target_Name', '''Tick', '''To_Address', '''Type_Class', '''UET_Address', '''Unconstrained_Array', '''Universal_Literal_String', '''Unrestricted_Access', '''VADS_Size', '''Value_Size', '''Wchar_T_Size', '''Word_Size']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'attribute',
\ 'info': 'GNAT attribute.',
\ 'kind': 'a',
\ 'icase': 1}]
endfor
endif
" Section: add Ada Pragmas {{{2
"
for Item in ['All_Calls_Remote', 'Assert', 'Assertion_Policy', 'Asynchronous', 'Atomic', 'Atomic_Components', 'Attach_Handler', 'Controlled', 'Convention', 'Detect_Blocking', 'Discard_Names', 'Elaborate', 'Elaborate_All', 'Elaborate_Body', 'Export', 'Import', 'Inline', 'Inspection_Point', 'Interface (Obsolescent)', 'Interrupt_Handler', 'Interrupt_Priority', 'Linker_Options', 'List', 'Locking_Policy', 'Memory_Size (Obsolescent)', 'No_Return', 'Normalize_Scalars', 'Optimize', 'Pack', 'Page', 'Partition_Elaboration_Policy', 'Preelaborable_Initialization', 'Preelaborate', 'Priority', 'Priority_Specific_Dispatching', 'Profile', 'Pure', 'Queueing_Policy', 'Relative_Deadline', 'Remote_Call_Interface', 'Remote_Types', 'Restrictions', 'Reviewable', 'Shared (Obsolescent)', 'Shared_Passive', 'Storage_Size', 'Storage_Unit (Obsolescent)', 'Suppress', 'System_Name (Obsolescent)', 'Task_Dispatching_Policy', 'Unchecked_Union', 'Unsuppress', 'Volatile', 'Volatile_Components']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'pragma',
\ 'info': 'Ada pragma.',
\ 'kind': 'p',
\ 'icase': 1}]
endfor
" Section: add GNAT Pragmas {{{3
"
if exists ('g:ada_gnat_extensions')
for Item in ['Abort_Defer', 'Ada_83', 'Ada_95', 'Ada_05', 'Annotate', 'Ast_Entry', 'C_Pass_By_Copy', 'Comment', 'Common_Object', 'Compile_Time_Warning', 'Complex_Representation', 'Component_Alignment', 'Convention_Identifier', 'CPP_Class', 'CPP_Constructor', 'CPP_Virtual', 'CPP_Vtable', 'Debug', 'Elaboration_Checks', 'Eliminate', 'Export_Exception', 'Export_Function', 'Export_Object', 'Export_Procedure', 'Export_Value', 'Export_Valued_Procedure', 'Extend_System', 'External', 'External_Name_Casing', 'Finalize_Storage_Only', 'Float_Representation', 'Ident', 'Import_Exception', 'Import_Function', 'Import_Object', 'Import_Procedure', 'Import_Valued_Procedure', 'Initialize_Scalars', 'Inline_Always', 'Inline_Generic', 'Interface_Name', 'Interrupt_State', 'Keep_Names', 'License', 'Link_With', 'Linker_Alias', 'Linker_Section', 'Long_Float', 'Machine_Attribute', 'Main_Storage', 'Obsolescent', 'Passive', 'Polling', 'Profile_Warnings', 'Propagate_Exceptions', 'Psect_Object', 'Pure_Function', 'Restriction_Warnings', 'Source_File_Name', 'Source_File_Name_Project', 'Source_Reference', 'Stream_Convert', 'Style_Checks', 'Subtitle', 'Suppress_All', 'Suppress_Exception_Locations', 'Suppress_Initialization', 'Task_Info', 'Task_Name', 'Task_Storage', 'Thread_Body', 'Time_Slice', 'Title', 'Unimplemented_Unit', 'Universal_Data', 'Unreferenced', 'Unreserve_All_Interrupts', 'Use_VADS_Size', 'Validity_Checks', 'Warnings', 'Weak_External']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'pragma',
\ 'info': 'GNAT pragma.',
\ 'kind': 'p',
\ 'icase': 1}]
endfor
endif
" 1}}}
" Section: g:ada#Ctags_Kinds {{{1
"
let g:ada#Ctags_Kinds = {
\ 'P': ["packspec", "package specifications"],
\ 'p': ["package", "packages"],
\ 'T': ["typespec", "type specifications"],
\ 't': ["type", "types"],
\ 'U': ["subspec", "subtype specifications"],
\ 'u': ["subtype", "subtypes"],
\ 'c': ["component", "record type components"],
\ 'l': ["literal", "enum type literals"],
\ 'V': ["varspec", "variable specifications"],
\ 'v': ["variable", "variables"],
\ 'f': ["formal", "generic formal parameters"],
\ 'n': ["constant", "constants"],
\ 'x': ["exception", "user defined exceptions"],
\ 'R': ["subprogspec", "subprogram specifications"],
\ 'r': ["subprogram", "subprograms"],
\ 'K': ["taskspec", "task specifications"],
\ 'k': ["task", "tasks"],
\ 'O': ["protectspec", "protected data specifications"],
\ 'o': ["protected", "protected data"],
\ 'E': ["entryspec", "task/protected data entry specifications"],
\ 'e': ["entry", "task/protected data entries"],
\ 'b': ["label", "labels"],
\ 'i': ["identifier", "loop/declare identifiers"],
\ 'a': ["autovar", "automatic variables"],
\ 'y': ["annon", "loops and blocks with no identifier"]}
" Section: ada#Word (...) {{{1
"
" Extract current Ada word across multiple lines
" AdaWord ([line, column])\
"
function ada#Word (...)
if a:0 > 1
let l:Line_Nr = a:1
let l:Column_Nr = a:2 - 1
else
let l:Line_Nr = line('.')
let l:Column_Nr = col('.') - 1
endif
let l:Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' )
" Cope with tag searching for items in comments; if we are, don't loop
" backards looking for previous lines
if l:Column_Nr > strlen(l:Line)
" We were in a comment
let l:Line = getline(l:Line_Nr)
let l:Search_Prev_Lines = 0
else
let l:Search_Prev_Lines = 1
endif
" Go backwards until we find a match (Ada ID) that *doesn't* include our
" location - i.e., the previous ID. This is because the current 'correct'
" match will toggle matching/not matching as we traverse characters
" backwards. Thus, we have to find the previous unrelated match, exclude
" it, then use the next full match (ours).
" Remember to convert vim column 'l:Column_Nr' [1..n] to string offset [0..(n-1)]
" ... but start, here, one after the required char.
let l:New_Column = l:Column_Nr + 1
while 1
let l:New_Column = l:New_Column - 1
if l:New_Column < 0
" Have to include previous l:Line from file
let l:Line_Nr = l:Line_Nr - 1
if l:Line_Nr < 1 || !l:Search_Prev_Lines
" Start of file or matching in a comment
let l:Line_Nr = 1
let l:New_Column = 0
let l:Our_Match = match (l:Line, g:ada#WordRegex )
break
endif
" Get previous l:Line, and prepend it to our search string
let l:New_Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' )
let l:New_Column = strlen (l:New_Line) - 1
let l:Column_Nr = l:Column_Nr + l:New_Column
let l:Line = l:New_Line . l:Line
endif
" Check to see if this is a match excluding 'us'
let l:Match_End = l:New_Column +
\ matchend (strpart (l:Line,l:New_Column), g:ada#WordRegex ) - 1
if l:Match_End >= l:New_Column &&
\ l:Match_End < l:Column_Nr
" Yes
let l:Our_Match = l:Match_End+1 +
\ match (strpart (l:Line,l:Match_End+1), g:ada#WordRegex )
break
endif
endwhile
" Got anything?
if l:Our_Match < 0
return ''
else
let l:Line = strpart (l:Line, l:Our_Match)
endif
" Now simply add further lines until the match gets no bigger
let l:Match_String = matchstr (l:Line, g:ada#WordRegex)
let l:Last_Line = line ('$')
let l:Line_Nr = line ('.') + 1
while l:Line_Nr <= l:Last_Line
let l:Last_Match = l:Match_String
let l:Line = l:Line .
\ substitute (getline (l:Line_Nr), g:ada#Comment, '', '')
let l:Match_String = matchstr (l:Line, g:ada#WordRegex)
if l:Match_String == l:Last_Match
break
endif
endwhile
" Strip whitespace & return
return substitute (l:Match_String, '\s\+', '', 'g')
endfunction ada#Word
" Section: ada#List_Tag (...) {{{1
"
" List tags in quickfix window
"
function ada#List_Tag (...)
if a:0 > 1
let l:Tag_Word = ada#Word (a:1, a:2)
elseif a:0 > 0
let l:Tag_Word = a:1
else
let l:Tag_Word = ada#Word ()
endif
echo "Searching for" l:Tag_Word
let l:Pattern = '^' . l:Tag_Word . '$'
let l:Tag_List = taglist (l:Pattern)
let l:Error_List = []
"
" add symbols
"
for Tag_Item in l:Tag_List
if l:Tag_Item['kind'] == ''
let l:Tag_Item['kind'] = 's'
endif
let l:Error_List += [
\ l:Tag_Item['filename'] . '|' .
\ l:Tag_Item['cmd'] . '|' .
\ l:Tag_Item['kind'] . "\t" .
\ l:Tag_Item['name'] ]
endfor
set errorformat=%f\|%l\|%m
cexpr l:Error_List
cwindow
endfunction ada#List_Tag
" Section: ada#Jump_Tag (Word, Mode) {{{1
"
" Word tag - include '.' and if Ada make uppercase
"
function ada#Jump_Tag (Word, Mode)
if a:Word == ''
" Get current word
let l:Word = ada#Word()
if l:Word == ''
throw "NOT_FOUND: no identifier found."
endif
else
let l:Word = a:Word
endif
echo "Searching for " . l:Word
try
execute a:Mode l:Word
catch /.*:E426:.*/
let ignorecase = &ignorecase
set ignorecase
execute a:Mode l:Word
let &ignorecase = ignorecase
endtry
return
endfunction ada#Jump_Tag
" Section: ada#Insert_Backspace () {{{1
"
" Backspace at end of line after auto-inserted commentstring '-- ' wipes it
"
function ada#Insert_Backspace ()
let l:Line = getline ('.')
if col ('.') > strlen (l:Line) &&
\ match (l:Line, '-- $') != -1 &&
\ match (&comments,'--') != -1
return "\<bs>\<bs>\<bs>"
else
return "\<bs>"
endif
return
endfunction ada#InsertBackspace
" Section: Insert Completions {{{1
"
" Section: ada#User_Complete(findstart, base) {{{2
"
" This function is used for the 'complete' option.
"
function! ada#User_Complete(findstart, base)
if a:findstart == 1
"
" locate the start of the word
"
let line = getline ('.')
let start = col ('.') - 1
while start > 0 && line[start - 1] =~ '\i\|'''
let start -= 1
endwhile
return start
else
"
" look up matches
"
let l:Pattern = '^' . a:base . '.*$'
"
" add keywords
"
for Tag_Item in g:ada#Keywords
if l:Tag_Item['word'] =~? l:Pattern
if complete_add (l:Tag_Item) == 0
return []
endif
if complete_check ()
return []
endif
endif
endfor
return []
endif
endfunction ada#User_Complete
" Section: ada#Completion (cmd) {{{2
"
" Word completion (^N/^R/^X^]) - force '.' inclusion
function ada#Completion (cmd)
set iskeyword+=46
return a:cmd . "\<C-R>=ada#Completion_End ()\<CR>"
endfunction ada#Completion
" Section: ada#Completion_End () {{{2
"
function ada#Completion_End ()
set iskeyword-=46
return ''
endfunction ada#Completion_End
" Section: ada#Create_Tags {{{1
"
function ada#Create_Tags (option)
if a:option == 'file'
let l:Filename = fnamemodify (bufname ('%'), ':p')
elseif a:option == 'dir'
let l:Filename =
\ fnamemodify (bufname ('%'), ':p:h') . "*.ada " .
\ fnamemodify (bufname ('%'), ':p:h') . "*.adb " .
\ fnamemodify (bufname ('%'), ':p:h') . "*.ads"
else
let l:Filename = a:option
endif
execute '!ctags --excmd=number ' . l:Filename
endfunction ada#Create_Tags
function ada#Switch_Session (New_Session) "{{{1
if a:New_Session != v:this_session
"
" We actualy got a new session - otherwise there
" is nothing to do.
"
if strlen (v:this_session) > 0
execute 'mksession! ' . v:this_session
endif
let v:this_session = a:New_Session
if filereadable (v:this_session)
execute 'source ' . v:this_session
endif
augroup ada_session
autocmd!
autocmd VimLeavePre * execute 'mksession! ' . v:this_session
augroup END
endif
return
endfunction ada#Switch_Session "}}}1
" Section: GNAT Pretty Printer folding {{{1
"
if exists('g:ada_folding') && g:ada_folding[0] == 'g'
"
" Lines consisting only of ')' ';' are due to a gnat pretty bug and
" have the same level as the line above (can't happen in the first
" line).
"
let s:Fold_Collate = '^\([;)]*$\|'
"
" some lone statements are folded with the line above
"
if stridx (g:ada_folding, 'i') >= 0
let s:Fold_Collate .= '\s\+\<is\>$\|'
endif
if stridx (g:ada_folding, 'b') >= 0
let s:Fold_Collate .= '\s\+\<begin\>$\|'
endif
if stridx (g:ada_folding, 'p') >= 0
let s:Fold_Collate .= '\s\+\<private\>$\|'
endif
if stridx (g:ada_folding, 'x') >= 0
let s:Fold_Collate .= '\s\+\<exception\>$\|'
endif
" We also handle empty lines and
" comments here.
let s:Fold_Collate .= '--\)'
function ada#Pretty_Print_Folding (Line) " {{{2
let l:Text = getline (a:Line)
if l:Text =~ s:Fold_Collate
"
" fold with line above
"
let l:Level = "="
elseif l:Text =~ '^\s\+('
"
" gnat outdents a line which stards with a ( by one characters so
" that parameters which follow are aligned.
"
let l:Level = (indent (a:Line) + 1) / &shiftwidth
else
let l:Level = indent (a:Line) / &shiftwidth
endif
return l:Level
endfunction ada#Pretty_Print_Folding " }}}2
endif
" Section: Options and Menus {{{1
"
" Section: ada#Switch_Syntax_Options {{{2
"
function ada#Switch_Syntax_Option (option)
syntax off
if exists ('g:ada_' . a:option)
unlet g:ada_{a:option}
echo a:option . 'now off'
else
let g:ada_{a:option}=1
echo a:option . 'now on'
endif
syntax on
endfunction ada#Switch_Syntax_Option
" Section: ada#Map_Menu {{{2
"
function ada#Map_Menu (Text, Keys, Command)
if a:Keys[0] == ':'
execute
\ "50amenu " .
\ "Ada." . escape(a:Text, ' ') .
\ "<Tab>" . a:Keys .
\ " :" . a:Command . "<CR>"
execute
\ "command -buffer " .
\ a:Keys[1:] .
\" :" . a:Command . "<CR>"
elseif a:Keys[0] == '<'
execute
\ "50amenu " .
\ "Ada." . escape(a:Text, ' ') .
\ "<Tab>" . a:Keys .
\ " :" . a:Command . "<CR>"
execute
\ "nnoremap <buffer> " .
\ a:Keys .
\" :" . a:Command . "<CR>"
execute
\ "inoremap <buffer> " .
\ a:Keys .
\" <C-O>:" . a:Command . "<CR>"
else
execute
\ "50amenu " .
\ "Ada." . escape(a:Text, ' ') .
\ "<Tab>" . escape(g:mapleader . "a" . a:Keys , '\') .
\ " :" . a:Command . "<CR>"
execute
\ "nnoremap <buffer>" .
\ escape(g:mapleader . "a" . a:Keys , '\') .
\" :" . a:Command
execute
\ "inoremap <buffer>" .
\ escape(g:mapleader . "a" . a:Keys , '\') .
\" <C-O>:" . a:Command
endif
return
endfunction
" Section: ada#Map_Popup {{{2
"
function ada#Map_Popup (Text, Keys, Command)
execute
\ "50amenu " .
\ "PopUp." . escape(a:Text, ' ') .
\ "<Tab>" . escape(g:mapleader . "a" . a:Keys , '\') .
\ " :" . a:Command . "<CR>"
call ada#Map_Menu (a:Text, a:Keys, a:Command)
return
endfunction ada#Map_Popup
" }}}1
lockvar g:ada#WordRegex
lockvar g:ada#DotWordRegex
lockvar g:ada#Comment
lockvar! g:ada#Keywords
lockvar! g:ada#Ctags_Kinds
finish " 1}}}
"------------------------------------------------------------------------------
" Copyright (C) 2006 Martin Krischik
"
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
"------------------------------------------------------------------------------
" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
" vim: foldmethod=marker

View File

@ -0,0 +1,109 @@
"------------------------------------------------------------------------------
" Description: Vim Ada omnicompletion file
" Language: Ada (2005)
" $Id$
" Maintainer: Martin Krischik
" $Author$
" $Date$
" Version: 4.2
" $Revision$
" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/adacomplete.vim $
" History: 24.05.2006 MK Unified Headers
" 26.05.2006 MK improved search for begin of word.
" 16.07.2006 MK Ada-Mode as vim-ball
" 15.10.2006 MK Bram's suggestion for runtime integration
" 05.11.2006 MK Bram suggested not to use include protection for
" autoload
" 05.11.2006 MK Bram suggested agaist using setlocal omnifunc
" 05.11.2006 MK Bram suggested to save on spaces
" Help Page: ft-ada-omni
"------------------------------------------------------------------------------
if version < 700
finish
endif
" Section: adacomplete#Complete () {{{1
"
" This function is used for the 'omnifunc' option.
"
function! adacomplete#Complete (findstart, base)
if a:findstart == 1
return ada#User_Complete (a:findstart, a:base)
else
"
" look up matches
"
if exists ("g:ada_omni_with_keywords")
call ada#User_Complete (a:findstart, a:base)
endif
"
" search tag file for matches
"
let l:Pattern = '^' . a:base . '.*$'
let l:Tag_List = taglist (l:Pattern)
"
" add symbols
"
for Tag_Item in l:Tag_List
if l:Tag_Item['kind'] == ''
"
" Tag created by gnat xref
"
let l:Match_Item = {
\ 'word': l:Tag_Item['name'],
\ 'menu': l:Tag_Item['filename'],
\ 'info': "Symbol from file " . l:Tag_Item['filename'] . " line " . l:Tag_Item['cmd'],
\ 'kind': 's',
\ 'icase': 1}
else
"
" Tag created by ctags
"
let l:Info = 'Symbol : ' . l:Tag_Item['name'] . "\n"
let l:Info .= 'Of type : ' . g:ada#Ctags_Kinds[l:Tag_Item['kind']][1] . "\n"
let l:Info .= 'Defined in File : ' . l:Tag_Item['filename'] . "\n"
if has_key( l:Tag_Item, 'package')
let l:Info .= 'Package : ' . l:Tag_Item['package'] . "\n"
let l:Menu = l:Tag_Item['package']
elseif has_key( l:Tag_Item, 'separate')
let l:Info .= 'Separate from Package : ' . l:Tag_Item['separate'] . "\n"
let l:Menu = l:Tag_Item['separate']
elseif has_key( l:Tag_Item, 'packspec')
let l:Info .= 'Package Specification : ' . l:Tag_Item['packspec'] . "\n"
let l:Menu = l:Tag_Item['packspec']
elseif has_key( l:Tag_Item, 'type')
let l:Info .= 'Datetype : ' . l:Tag_Item['type'] . "\n"
let l:Menu = l:Tag_Item['type']
else
let l:Menu = l:Tag_Item['filename']
endif
let l:Match_Item = {
\ 'word': l:Tag_Item['name'],
\ 'menu': l:Menu,
\ 'info': l:Info,
\ 'kind': l:Tag_Item['kind'],
\ 'icase': 1}
endif
if complete_add (l:Match_Item) == 0
return []
endif
if complete_check ()
return []
endif
endfor
return []
endif
endfunction adacomplete#Complete
finish " 1}}}
"------------------------------------------------------------------------------
" Copyright (C) 2006 Martin Krischik
"
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
"------------------------------------------------------------------------------
" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
" vim: foldmethod=marker

View File

@ -1,86 +1,87 @@
" Vim completion script
" Language: CSS 2.1
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2006 Apr 30
" Last Change: 2007 Mar 11
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\|-\)'
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")
endif
" 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 know 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
else
let line = a:base
endif
endif
let res = []
let res2 = []
let borders = {}
let res = []
let res2 = []
let borders = {}
" We need the last occurrence of char so reverse line
let revline = join(reverse(split(line, '.\zs')), '')
" Check last occurrence of sequence
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, '!')
let openbrace = strridx(line, '{')
let closebrace = strridx(line, '}')
let colon = strridx(line, ':')
let semicolon = strridx(line, ';')
let opencomm = strridx(line, '/*')
let closecomm = strridx(line, '*/')
let style = strridx(line, 'style\s*=')
let atrule = strridx(line, '@')
let exclam = strridx(line, '!')
if openbrace > -1
if openbrace > -1
let borders[openbrace] = "openbrace"
endif
if closebrace > -1
endif
if closebrace > -1
let borders[closebrace] = "closebrace"
endif
if colon > -1
endif
if colon > -1
let borders[colon] = "colon"
endif
if semicolon > -1
endif
if semicolon > -1
let borders[semicolon] = "semicolon"
endif
if opencomm > -1
endif
if opencomm > -1
let borders[opencomm] = "opencomm"
endif
if closecomm > -1
endif
if closecomm > -1
let borders[closecomm] = "closecomm"
endif
if style > -1
endif
if style > -1
let borders[style] = "style"
endif
if atrule > -1
endif
if atrule > -1
let borders[atrule] = "atrule"
endif
if exclam > -1
endif
if exclam > -1
let borders[exclam] = "exclam"
endif
endif
if len(borders) == 0 || borders[min(keys(borders))] =~ '^\(openbrace\|semicolon\|opencomm\|closecomm\|style\)$'
if len(borders) == 0 || borders[max(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")
@ -97,7 +98,7 @@ else
return res + res2
elseif borders[min(keys(borders))] == 'colon'
elseif borders[max(keys(borders))] == 'colon'
" Get name of property
let prop = tolower(matchstr(line, '\zs[a-zA-Z-]*\ze\s*:[^:]\{-}$'))
@ -111,9 +112,9 @@ else
let values = ["url(", "none"]
elseif prop == 'background-position'
let vals = matchstr(line, '.*:\s*\zs.*')
if vals =~ '^\([a-zA-Z]\+\)\?$'
if vals =~ '^\%([a-zA-Z]\+\)\?$'
let values = ["top", "center", "bottom"]
elseif vals =~ '^[a-zA-Z]\+\s\+\([a-zA-Z]\+\)\?$'
elseif vals =~ '^[a-zA-Z]\+\s\+\%([a-zA-Z]\+\)\?$'
let values = ["left", "center", "right"]
else
return []
@ -130,32 +131,32 @@ else
return []
elseif prop == 'border-style'
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
elseif prop =~ 'border-\(top\|right\|bottom\|left\)$'
elseif prop =~ 'border-\%(top\|right\|bottom\|left\)$'
let vals = matchstr(line, '.*:\s*\zs.*')
if vals =~ '^\([a-zA-Z0-9.]\+\)\?$'
if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$'
let values = ["thin", "thick", "medium"]
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\([a-zA-Z]\+\)\?$'
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(]\+\)\?$'
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'
elseif prop =~ 'border-\%(top\|right\|bottom\|left\)-color'
let values = ["rgb(", "#", "transparent"]
elseif prop =~ 'border-\(top\|right\|bottom\|left\)-style'
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'
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.]\+\)\?$'
if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$'
let values = ["thin", "thick", "medium"]
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\([a-zA-Z]\+\)\?$'
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(]\+\)\?$'
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
let values = ["rgb(", "#", "transparent"]
else
return []
@ -172,9 +173,9 @@ else
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\)$'
elseif prop =~ 'counter-\%(increment\|reset\)$'
let values = ["none"]
elseif prop =~ '^\(cue-after\|cue-before\|cue\)$'
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"]
@ -200,9 +201,9 @@ else
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\)$'
elseif prop =~ '^\%(height\|width\)$'
let values = ["auto"]
elseif prop =~ '^\(left\|rigth\)$'
elseif prop =~ '^\%(left\|rigth\)$'
let values = ["auto"]
elseif prop == 'letter-spacing'
let values = ["normal"]
@ -218,7 +219,7 @@ else
return []
elseif prop == 'margin'
let values = ["auto"]
elseif prop =~ 'margin-\(right\|left\|top\|bottom\)$'
elseif prop =~ 'margin-\%(right\|left\|top\|bottom\)$'
let values = ["auto"]
elseif prop == 'max-height'
let values = ["auto"]
@ -238,11 +239,11 @@ else
let values = ["thin", "thick", "medium"]
elseif prop == 'outline'
let vals = matchstr(line, '.*:\s*\zs.*')
if vals =~ '^\([a-zA-Z0-9,()#]\+\)\?$'
if vals =~ '^\%([a-zA-Z0-9,()#]\+\)\?$'
let values = ["rgb(", "#"]
elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+\([a-zA-Z]\+\)\?$'
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(]\+\)\?$'
elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
let values = ["thin", "thick", "medium"]
else
return []
@ -251,13 +252,13 @@ else
let values = ["visible", "hidden", "scroll", "auto"]
elseif prop == 'padding'
return []
elseif prop =~ 'padding-\(top\|right\|bottom\|left\)$'
elseif prop =~ 'padding-\%(top\|right\|bottom\|left\)$'
return []
elseif prop =~ 'page-break-\(after\|before\)$'
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\)$'
elseif prop =~ 'pause-\%(after\|before\)$'
return []
elseif prop == 'pause'
return []
@ -319,7 +320,7 @@ 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.','
if stridx(',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.',') > -1
let values = ["first-child", "link", "visited", "hover", "active", "focus", "lang", "first-line", "first-letter", "before", "after"]
else
return []
@ -339,11 +340,11 @@ else
return res + res2
elseif borders[min(keys(borders))] == 'closebrace'
elseif borders[max(keys(borders))] == 'closebrace'
return []
elseif borders[min(keys(borders))] == 'exclam'
elseif borders[max(keys(borders))] == 'exclam'
" Complete values
let entered_imp = matchstr(line, '.\{-}!\s*\zs[a-zA-Z ]*$')
@ -358,7 +359,7 @@ else
return res
elseif borders[min(keys(borders))] == 'atrule'
elseif borders[max(keys(borders))] == 'atrule'
let afterat = matchstr(line, '.*@\zs.*')
@ -422,9 +423,8 @@ else
return res + res2
endif
endif
return []
return []
endif
endfunction

View File

@ -0,0 +1,75 @@
"------------------------------------------------------------------------------
" Description: Vim Ada/Dec Ada compiler file
" Language: Ada (Dec Ada)
" $Id$
" Copyright: Copyright (C) 2006 Martin Krischik
" Maintainer: Martin Krischik
" $Author$
" $Date$
" Version: 4.2
" $Revision$
" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/decada.vim $
" History: 21.07.2006 MK New Dec Ada
" 15.10.2006 MK Bram's suggestion for runtime integration
" 05.11.2006 MK Bram suggested not to use include protection for
" autoload
" 05.11.2006 MK Bram suggested to save on spaces
" Help Page: compiler-decada
"------------------------------------------------------------------------------
if version < 700
finish
endif
function decada#Unit_Name () dict " {{{1
" Convert filename into acs unit:
" 1: remove the file extenstion.
" 2: replace all double '_' or '-' with an dot (which denotes a separate)
" 3: remove a trailing '_' (wich denotes a specification)
return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '')
endfunction decada#Unit_Name " }}}1
function decada#Make () dict " {{{1
let l:make_prg = substitute (g:self.Make_Command, '%<', self.Unit_Name(), '')
let &errorformat = g:self.Error_Format
let &makeprg = l:make_prg
wall
make
copen
set wrap
wincmd W
endfunction decada#Build " }}}1
function decada#Set_Session (...) dict " {{{1
if a:0 > 0
call ada#Switch_Session (a:1)
elseif argc() == 0 && strlen (v:servername) > 0
call ada#Switch_Session (
\ expand('~')[0:-2] . ".vimfiles.session]" .
\ v:servername . ".vim")
endif
return
endfunction decada#Set_Session " }}}1
function decada#New () " }}}1
let Retval = {
\ 'Make' : function ('decada#Make'),
\ 'Unit_Name' : function ('decada#Unit_Name'),
\ 'Set_Session' : function ('decada#Set_Session'),
\ 'Project_Dir' : '',
\ 'Make_Command' : 'ACS COMPILE /Wait /Log /NoPreLoad /Optimize=Development /Debug %<',
\ 'Error_Format' : '%+A%%ADAC-%t-%m,%C %#%m,%Zat line number %l in file %f,' .
\ '%+I%%ada-I-%m,%C %#%m,%Zat line number %l in file %f'}
return Retval
endfunction decada#New " }}}1
finish " 1}}}
"------------------------------------------------------------------------------
" Copyright (C) 2006 Martin Krischik
"
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
"------------------------------------------------------------------------------
" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
" vim: foldmethod=marker

View File

@ -1,40 +1,55 @@
" ---------------------------------------------------------------------
" GetLatestVimScripts.vim
" getscript.vim
" Author: Charles E. Campbell, Jr.
" Date: Feb 15, 2006
" Version: 20
" Date: Nov 27, 2006
" Version: 23
" Installing: :help glvs-install
" Usage: :help glvs
"
" GetLatestVimScripts: 642 1 :AutoInstall: GetLatestVimScripts.vim
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
" ---------------------------------------------------------------------
" Initialization: {{{1
" if you're sourcing this file, surely you can't be
" expecting vim to be in its vi-compatible mode
if &cp
if &verbose
echo "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
endif
echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
finish
endif
let s:keepfo = &fo
let s:keepcpo = &cpo
set cpo&vim
if exists("loaded_GetLatestVimScripts")
if exists("g:loaded_getscript")
finish
endif
let g:loaded_GetLatestVimScripts= "v20"
let g:loaded_getscript= "v23"
" ---------------------------------------------------------------------
" Global Variables: {{{1
" allow user to change the command for obtaining scripts (does fetch work?)
if !exists("g:GetLatestVimScripts_wget")
if executable("wget")
let g:GetLatestVimScripts_wget= "wget"
elseif executable("curl")
let g:GetLatestVimScripts_wget= "curl"
else
let g:GetLatestVimScripts_wget = 'echo "GetLatestVimScripts needs wget or curl"'
let g:GetLatestVimScripts_options = ""
endif
endif
" options that wget and curl require:
if !exists("g:GetLatestVimScripts_options")
if g:GetLatestVimScripts_wget == "wget"
let g:GetLatestVimScripts_options= "-q -O"
elseif g:GetLatestVimScripts_wget == "curl"
let g:GetLatestVimScripts_options= "-s -O"
else
let g:GetLatestVimScripts_options= ""
endif
endif
" by default, allow autoinstall lines to work
if !exists("g:GetLatestVimScripts_allowautoinstall")
let g:GetLatestVimScripts_allowautoinstall= 1
endif
@ -43,7 +58,8 @@ endif
"let g:GetLatestVimScripts_wget = "echo"
"let g:GetLatestVimScripts_options = "options"
" check if s:autoinstall is possible
" ---------------------------------------------------------------------
" Check If AutoInstall Capable: {{{1
let s:autoinstall= ""
if g:GetLatestVimScripts_allowautoinstall
@ -66,21 +82,22 @@ if g:GetLatestVimScripts_allowautoinstall
let s:autoinstall= $HOME."/".s:dotvim
endif
" call Decho("s:autoinstall<".s:autoinstall.">")
else
"else "Decho
" call Decho("g:GetLatestVimScripts_allowautoinstall=".g:GetLatestVimScripts_allowautoinstall.": :AutoInstall: disabled")
endif
" ---------------------------------------------------------------------
" Public Interface: {{{1
com! -nargs=0 GetLatestVimScripts call <SID>GetLatestVimScripts()
silent! com -nargs=0 GLVS call <SID>GetLatestVimScripts()
com! -nargs=0 GetLatestVimScripts call getscript#GetLatestVimScripts()
com! -nargs=0 GetScript call getscript#GetLatestVimScripts()
silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts()
" ---------------------------------------------------------------------
" GetOneScript: (Get Latest Vim Script) this function operates {{{1
" on the current line, interpreting two numbers and text as
" ScriptID, SourceID, and Filename.
" It downloads any scripts that have newer versions from vim.sf.net.
fun! <SID>GetOneScript(...)
fun! s:GetOneScript(...)
" call Dfunc("GetOneScript()")
" set options to allow progress to be shown on screen
@ -96,13 +113,18 @@ fun! <SID>GetOneScript(...)
if a:0 >= 3
let scriptid = a:1
let srcid = a:2
let cmmnt = a:3
let fname = a:3
let cmmnt = ""
" call Decho("scriptid<".scriptid.">")
" call Decho("srcid <".srcid.">")
" call Decho("cmmnt <".cmmnt.">")
" call Decho("fname <".fname.">")
else
let curline = getline(".")
let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(.\{-}\)$'
if curline =~ '^\s*#'
" call Dret("GetOneScript : skipping a pure comment line")
return
endif
let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(.\{-}\)\(\s*#.*\)\=$'
try
let scriptid = substitute(curline,parsepat,'\1','e')
catch /^Vim\%((\a\+)\)\=:E486/
@ -114,7 +136,12 @@ fun! <SID>GetOneScript(...)
let srcid= 0
endtry
try
let cmmnt = substitute(curline,parsepat,'\3','e')
let fname= substitute(curline,parsepat,'\3','e')
catch /^Vim\%((\a\+)\)\=:E486/
let fname= ""
endtry
try
let cmmnt= substitute(curline,parsepat,'\4','e')
catch /^Vim\%((\a\+)\)\=:E486/
let cmmnt= ""
endtry
@ -122,7 +149,7 @@ fun! <SID>GetOneScript(...)
" call Decho("parsepat<".parsepat.">")
" call Decho("scriptid<".scriptid.">")
" call Decho("srcid <".srcid.">")
" call Decho("cmmnt <".cmmnt.">")
" call Decho("fname <".fname.">")
endif
if scriptid == 0 || srcid == 0
@ -133,15 +160,15 @@ fun! <SID>GetOneScript(...)
endif
let doautoinstall= 0
if cmmnt =~ ":AutoInstall:"
" call Decho("cmmnt<".cmmnt."> has :AutoInstall:...")
let aicmmnt= substitute(cmmnt,'\s\+:AutoInstall:\s\+',' ','')
if fname =~ ":AutoInstall:"
" call Decho("fname<".fname."> has :AutoInstall:...")
let aicmmnt= substitute(fname,'\s\+:AutoInstall:\s\+',' ','')
" call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall)
if s:autoinstall != ""
let doautoinstall = g:GetLatestVimScripts_allowautoinstall
endif
else
let aicmmnt= cmmnt
let aicmmnt= fname
endif
" call Decho("aicmmnt<".aicmmnt.">: doautoinstall=".doautoinstall)
@ -252,7 +279,7 @@ fun! <SID>GetOneScript(...)
if filereadable(fname)
" call Decho("move <".fname."> to ".s:autoinstall)
" call Decho("DISABLED for testing")
exe "silent !"g:GetLatestVimScripts_mv." ".fname." ".s:autoinstall
exe "silent !".g:GetLatestVimScripts_mv." ".fname." ".s:autoinstall
let curdir= escape(substitute(getcwd(),'\','/','ge'),"|[]*'\" #")
exe "cd ".s:autoinstall
if fname =~ '\.bz2$'
@ -269,19 +296,27 @@ fun! <SID>GetOneScript(...)
exe "silent !unzip -o".fname
elseif fname =~ '\.tar$'
" call Decho("attempt to untar ".fname)
exe "silent !tar -oxvf ".fname
exe "silent !tar -xvf ".fname
elseif fname =~ '\.vba$'
" call Decho("attempt to handle a vimball: ".fname)
1split
exe "e ".fname
so %
q
endif
if fname =~ '.vim$'
" call Decho("attempt to simply move ".fname." to plugin")
exe "silent !".g:GetLatestVimScripts_mv." ".fname." plugin"
endif
exe "helptags ../".s:dotvim."/doc"
let docdir= substitute(&rtp,',.*','','e')."/doc"
" call Decho("helptags docdir<".docdir.">")
exe "helptags ".docdir
exe "cd ".curdir
endif
endif
" update the data in the <GetLatestVimScripts.dat> file
let modline=scriptid." ".latestsrcid." ".cmmnt
let modline=scriptid." ".latestsrcid." ".fname.cmmnt
call setline(line("."),modline)
" call Decho("modline<".modline."> (updated GetLatestVimScripts.dat file)")
endif
@ -297,9 +332,8 @@ endfun
" ---------------------------------------------------------------------
" GetLatestVimScripts: this function gets the latest versions of {{{1
" scripts based on the list in
"
" (first dir in runtimepath)/GetLatest/GetLatestVimScripts.dat
fun! <SID>GetLatestVimScripts()
fun! getscript#GetLatestVimScripts()
" call Dfunc("GetLatestVimScripts() autoinstall<".s:autoinstall.">")
" insure that wget is executable
@ -309,30 +343,27 @@ fun! <SID>GetLatestVimScripts()
return
endif
" Find the .../GetLatest sudirectory under the runtimepath
let rtplist= &rtp
while rtplist != ""
let datadir= substitute(rtplist,',.*$','','e')."/GetLatest"
if isdirectory(datadir)
" Find the .../GetLatest subdirectory under the runtimepath
for datadir in split(&rtp,',') + ['']
if isdirectory(datadir."/GetLatest")
" call Decho("found directory<".datadir.">")
let datadir= datadir . "/GetLatest"
break
endif
unlet datadir
if rtplist =~ ','
let rtplist= substitute(rtplist,'^.\{-},','','e')
else
let rtplist= ""
if filereadable(datadir."GetLatestVimScripts.dat")
" call Decho("found ".datadir."/GetLatestVimScripts.dat")
break
endif
endwhile
endfor
" Sanity checks: readability and writability
if !exists("datadir")
echoerr "Unable to find a GetLatest subdirectory on your runtimepath"
if datadir == ""
echoerr 'Missing "GetLatest/" on your runtimepath - see :help glvs-dist-install'
" call Dret("GetLatestVimScripts : unable to find a GetLatest subdirectory")
return
endif
if filewritable(datadir) != 2
echoerr "Your ".datadir." isn't writable"
echoerr "(getLatestVimScripts) Your ".datadir." isn't writable"
" call Dret("GetLatestVimScripts : non-writable directory<".datadir.">")
return
endif
@ -434,6 +465,7 @@ fun! <SID>GetLatestVimScripts()
return
endtry
exe "norm! kz\<CR>"
redraw!
let s:msg = ""
if s:downloads == 1
let s:msg = "Downloaded one updated script to <".datadir.">"
@ -450,10 +482,9 @@ fun! <SID>GetLatestVimScripts()
echomsg s:msg
" save the file
if &mod
wq
else
q
silent! w!
endif
q
" restore events and current directory
exe "cd ".escape(substitute(origdir,'\','/','ge'),"|[]*'\" #")

139
runtime/autoload/gnat.vim Normal file
View File

@ -0,0 +1,139 @@
"------------------------------------------------------------------------------
" Description: Vim Ada/GNAT compiler file
" Language: Ada (GNAT)
" $Id$
" Copyright: Copyright (C) 2006 Martin Krischik
" Maintainer: Martin Krischik
" $Author$
" $Date$
" Version: 4.2
" $Revision$
" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/gnat.vim $
" History: 24.05.2006 MK Unified Headers
" 16.07.2006 MK Ada-Mode as vim-ball
" 05.08.2006 MK Add session support
" 15.10.2006 MK Bram's suggestion for runtime integration
" 05.11.2006 MK Bram suggested not to use include protection for
" autoload
" 05.11.2006 MK Bram suggested to save on spaces
" Help Page: compiler-gnat
"------------------------------------------------------------------------------
if version < 700
finish
endif
function gnat#Make () dict " {{{1
let &l:makeprg = self.Get_Command('Make')
let &l:errorformat = self.Error_Format
wall
make
copen
set wrap
wincmd W
endfunction gnat#Make " }}}1
function gnat#Pretty () dict " {{{1
execute "!" . self.Get_Command('Pretty')
endfunction gnat#Make " }}}1
function gnat#Find () dict " {{{1
execute "!" . self.Get_Command('Find')
endfunction gnat#Find " }}}1
function gnat#Tags () dict " {{{1
execute "!" . self.Get_Command('Tags')
edit tags
call gnat#Insert_Tags_Header ()
update
quit
endfunction gnat#Tags " }}}1
function gnat#Set_Project_File (...) dict " {{{1
if a:0 > 0
let self.Project_File = a:1
if ! filereadable (self.Project_File)
let self.Project_File = findfile (
\ fnamemodify (self.Project_File, ':r'),
\ $ADA_PROJECT_PATH,
\ 1)
endif
elseif strlen (self.Project_File) > 0
let self.Project_File = browse (0, 'GNAT Project File?', '', self.Project_File)
elseif expand ("%:e") == 'gpr'
let self.Project_File = browse (0, 'GNAT Project File?', '', expand ("%:e"))
else
let self.Project_File = browse (0, 'GNAT Project File?', '', 'default.gpr')
endif
if strlen (v:this_session) > 0
execute 'mksession! ' . v:this_session
endif
if strlen (self.Project_File) > 0
call ada#Switch_Session (
\ expand('~') . "/vimfiles/session/" .
\ fnamemodify (self.Project_File, ":t:r") . ".vim")
else
call ada#Switch_Session ('')
endif
return
endfunction gnat#Set_Project_File " }}}1
function gnat#Get_Command (Command) dict " {{{1
let l:Command = eval ('self.' . a:Command . '_Command')
return eval (l:Command)
endfunction gnat#Get_Command " }}}1
function gnat#Set_Session (...) dict " {{{1
if argc() == 1 && fnamemodify (argv(0), ':e') == 'gpr'
call self.Set_Project_File (argv(0))
elseif strlen (v:servername) > 0
call self.Set_Project_File (v:servername . '.gpr')
endif
endfunction gnat#Set_Session " }}}1
function gnat#New () " {{{1
let l:Retval = {
\ 'Make' : function ('gnat#Make'),
\ 'Pretty' : function ('gnat#Pretty'),
\ 'Find' : function ('gnat#Find'),
\ 'Tags' : function ('gnat#Tags'),
\ 'Set_Project_File' : function ('gnat#Set_Project_File'),
\ 'Set_Session' : function ('gnat#Set_Session'),
\ 'Get_Command' : function ('gnat#Get_Command'),
\ 'Project_File' : '',
\ 'Make_Command' : '"gnat make -P " . self.Project_File . " -F -gnatef "',
\ 'Pretty_Command' : '"gnat pretty -P " . self.Project_File . " "',
\ 'Find_Program' : '"gnat find -P " . self.Project_File . " -F "',
\ 'Tags_Command' : '"gnat xref -P " . self.Project_File . " -v *.AD*"',
\ 'Error_Format' : '%f:%l:%c: %trror: %m,' .
\ '%f:%l:%c: %tarning: %m,' .
\ '%f:%l:%c: (%ttyle) %m'}
return l:Retval
endfunction gnat#New " }}}1
function gnat#Insert_Tags_Header () " {{{1
1insert
!_TAG_FILE_FORMAT 1 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR AdaCore /info@adacore.com/
!_TAG_PROGRAM_NAME gnatxref //
!_TAG_PROGRAM_URL http://www.adacore.com /official site/
!_TAG_PROGRAM_VERSION 5.05w //
.
return
endfunction gnat#Insert_Tags_Header " }}}1
finish " 1}}}
"------------------------------------------------------------------------------
" Copyright (C) 2006 Martin Krischik
"
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
"------------------------------------------------------------------------------
" vim: textwidth=0 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
" vim: foldmethod=marker

View File

@ -1,6 +1,6 @@
" Vim autoload file for editing compressed files.
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2006 Oct 03
" Last Change: 2006 Oct 09
" These functions are used by the gzip plugin.
@ -177,7 +177,7 @@ endfun
fun s:escape(name)
" shellescape() was added by patch 7.0.111
if v:version > 700 || (v:version == 700 && has('patch111'))
if exists("*shellescape")
return shellescape(a:name)
endif
return "'" . a:name . "'"

View File

@ -1,7 +1,7 @@
" Vim completion script
" Language: HTML and XHTML
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2006 Apr 30
" Last Change: 2006 Oct 19
function! htmlcomplete#CompleteTags(findstart, base)
if a:findstart
@ -84,7 +84,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
let context_line = getline(curline-i)
if context_line =~ '<[^>]*$'
" Yep, this is this line
let context_lines = getline(curline-i, curline)
let context_lines = getline(curline-i, curline-1) + [b:compl_context]
let b:compl_context = join(context_lines, ' ')
break
elseif context_line =~ '>[^<]*$' || i == curline
@ -448,6 +448,15 @@ function! htmlcomplete#CompleteTags(findstart, base)
let attrname = matchstr(attr, '.*\ze\s*=')
let entered_value = matchstr(attr, ".*=\\s*[\"']\\?\\zs.*")
let values = []
" Load data {{{
if !exists("b:html_doctype")
call htmlcomplete#CheckDoctype()
endif
if !exists("b:html_omni")
"runtime! autoload/xml/xhtml10s.vim
call htmlcomplete#LoadData()
endif
" }}}
if attrname == 'href'
" Now we are looking for local anchors defined by name or id
if entered_value =~ '^#'
@ -604,21 +613,20 @@ function! htmlcomplete#CompleteTags(findstart, base)
if exists("uppercase_tag") && uppercase_tag == 1
let context = tolower(context)
endif
" Handle XML keywords: DOCTYPE and CDATA.
" Handle XML keywords: DOCTYPE
if opentag == ''
let tags += [
\ '!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">',
\ '!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">',
\ '!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">',
\ '!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" "http://www.w3.org/TR/REC-html40/frameset.dtd">',
\ '!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
\ '!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
\ '!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
\ '!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
\ '!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
\ '!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
\ '!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/1999/xhtml">',
\ '!CDATA'
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" "http://www.w3.org/TR/REC-html40/frameset.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/1999/xhtml">'
\ ]
endif

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
" netrwFileHandlers: contains various extension-based file handlers for
" netrw's browsers' x command ("eXecute launcher")
" Author: Charles E. Campbell, Jr.
" Date: May 01, 2006
" Version: 8
" Date: May 30, 2006
" Version: 9
" 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
@ -22,16 +22,41 @@ if exists("g:loaded_netrwFileHandlers") || &cp
endif
let s:keepcpo= &cpo
set cpo&vim
let g:loaded_netrwFileHandlers= "v8"
let g:loaded_netrwFileHandlers= "v9"
" ---------------------------------------------------------------------
" netrwFileHandlers#Invoke: {{{1
fun! netrwFileHandlers#Invoke(exten,fname)
" call Dfunc("netrwFileHandlers#Invoke(exten<".a:exten."> fname<".a:fname.">)")
let fname= a:fname
" list of supported special characters. Consider rcs,v --- that can be
" supported with a NFH_rcsCOMMAv() handler
if a:fname =~ '[@:,$!=\-+%?;~]'
let specials= {
\ '@' : 'AT',
\ ':' : 'COLON',
\ ',' : 'COMMA',
\ '$' : 'DOLLAR',
\ '!' : 'EXCLAMATION',
\ '=' : 'EQUAL',
\ '-' : 'MINUS',
\ '+' : 'PLUS',
\ '%' : 'PERCENT',
\ '?' : 'QUESTION',
\ ';' : 'SEMICOLON',
\ '~' : 'TILDE'}
let fname= substitute(a:fname,'[@:,$!=\-+%?;~]','\=specials[submatch(0)]','ge')
" call Decho('fname<'.fname.'> done with dictionary')
endif
if a:exten != "" && exists("*s:NFH_".a:exten)
" call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.a:fname.'")')
exe "let ret= s:NFH_".a:exten.'("'.a:fname.'")'
if a:exten != "" && exists("*NFH_".a:exten)
" support user NFH_*() functions
" call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")')
exe "let ret= NFH_".a:exten.'("'.fname.'")'
elseif a:exten != "" && exists("*s:NFH_".a:exten)
" use builtin-NFH_*() functions
" call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")')
exe "let ret= s:NFH_".a:exten.'("'.fname.'")'
endif
" call Dret("netrwFileHandlers#Invoke 0 : ret=".ret)
@ -48,10 +73,10 @@ fun! s:NFH_html(pagefile)
if executable("mozilla")
" call Decho("executing !mozilla ".page)
exe "!mozilla \"".page.'"'
exe "!mozilla ".g:netrw_shq.page.g:netrw_shq
elseif executable("netscape")
" call Decho("executing !netscape ".page)
exe "!netscape \"".page.'"'
exe "!netscape ".g:netrw_shq..page.g:netrw_shq
else
" call Dret("s:NFH_html 0")
return 0
@ -71,10 +96,10 @@ fun! s:NFH_htm(pagefile)
if executable("mozilla")
" call Decho("executing !mozilla ".page)
exe "!mozilla \"".page.'"'
exe "!mozilla ".g:netrw_shq.page.g:netrw_shq
elseif executable("netscape")
" call Decho("executing !netscape ".page)
exe "!netscape \"".page.'"'
exe "!netscape ".g:netrw_shq.page.g:netrw_shq
else
" call Dret("s:NFH_htm 0")
return 0
@ -90,10 +115,10 @@ fun! s:NFH_jpg(jpgfile)
" call Dfunc("s:NFH_jpg(jpgfile<".a:jpgfile.">)")
if executable("gimp")
exe "silent! !gimp -s ".a:jpgfile
exe "silent! !gimp -s ".g:netrw_shq.a:jpgfile.g:netrw_shq
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
" call Decho("silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".escape(a:jpgfile," []|'"))
exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:jpgfile.'"'
exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:jpgfile.g:netrw_shq
else
" call Dret("s:NFH_jpg 0")
return 0
@ -109,9 +134,9 @@ fun! s:NFH_gif(giffile)
" call Dfunc("s:NFH_gif(giffile<".a:giffile.">)")
if executable("gimp")
exe "silent! !gimp -s ".a:giffile
exe "silent! !gimp -s ".g:netrw_shq.a:giffile.g:netrw_shq
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:giffile.'"'
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:giffile.g:netrw_shq
else
" call Dret("s:NFH_gif 0")
return 0
@ -127,9 +152,9 @@ fun! s:NFH_png(pngfile)
" call Dfunc("s:NFH_png(pngfile<".a:pngfile.">)")
if executable("gimp")
exe "silent! !gimp -s ".a:pngfile
exe "silent! !gimp -s ".g:netrw_shq.a:pngfile.g:netrw_shq
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:pngfile.'"'
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:pngfile.g:netrw_shq
else
" call Dret("s:NFH_png 0")
return 0
@ -145,9 +170,9 @@ fun! s:NFH_pnm(pnmfile)
" call Dfunc("s:NFH_pnm(pnmfile<".a:pnmfile.">)")
if executable("gimp")
exe "silent! !gimp -s ".a:pnmfile
exe "silent! !gimp -s ".g:netrw_shq.a:pnmfile.g:netrw_shq
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:pnmfile.'"'
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:pnmfile.g:netrw_shq
else
" call Dret("s:NFH_pnm 0")
return 0
@ -165,7 +190,7 @@ fun! s:NFH_bmp(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.'"'
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:bmpfile.g:netrw_shq
else
" call Dret("s:NFH_bmp 0")
return 0
@ -180,7 +205,9 @@ endfun
fun! s:NFH_pdf(pdf)
" call Dfunc("s:NFH_pdf(pdf<".a:pdf.">)")
if executable("gs")
exe 'silent! !gs "'.a:pdf.'"'
exe 'silent! !gs '.g:netrw_shq.a:pdf.g:netrw_shq
elseif executable("pdftotext")
exe 'silent! pdftotext -nopgbrk '.g:netrw_shq.a:pdf.g:netrw_shq
else
" call Dret("s:NFH_pdf 0")
return 0
@ -196,7 +223,7 @@ fun! s:NFH_doc(doc)
" call Dfunc("s:NFH_doc(doc<".a:doc.">)")
if executable("oowriter")
exe 'silent! !oowriter "'.a:doc.'"'
exe 'silent! !oowriter '.g:netrw_shq.a:doc.g:netrw_shq
redraw!
else
" call Dret("s:NFH_doc 0")
@ -213,7 +240,7 @@ fun! s:NFH_sxw(sxw)
" call Dfunc("s:NFH_sxw(sxw<".a:sxw.">)")
if executable("oowriter")
exe 'silent! !oowriter "'.a:sxw.'"'
exe 'silent! !oowriter '.g:netrw_shq.a:sxw.g:netrw_shq
redraw!
else
" call Dret("s:NFH_sxw 0")
@ -230,7 +257,7 @@ fun! s:NFH_xls(xls)
" call Dfunc("s:NFH_xls(xls<".a:xls.">)")
if executable("oocalc")
exe 'silent! !oocalc "'.a:xls.'"'
exe 'silent! !oocalc '.g:netrw_shq.a:xls.g:netrw_shq
redraw!
else
" call Dret("s:NFH_xls 0")
@ -247,15 +274,15 @@ fun! s:NFH_ps(ps)
" call Dfunc("s:NFH_ps(ps<".a:ps.">)")
if executable("gs")
" call Decho("exe silent! !gs ".a:ps)
exe "silent! !gs ".a:ps
exe "silent! !gs ".g:netrw_shq.a:ps.g:netrw_shq
redraw!
elseif executable("ghostscript")
" call Decho("exe silent! !ghostscript ".a:ps)
exe "silent! !ghostscript ".a:ps
exe "silent! !ghostscript ".g:netrw_shq.a:ps.g:netrw_shq
redraw!
elseif executable("gswin32")
" call Decho("exe silent! !gswin32 \"".a:ps.'"')
exe "silent! !gswin32 \"".a:ps.'"'
" call Decho("exe silent! !gswin32 ".g:netrw_shq.a:ps.g:netrw_shq)
exe "silent! !gswin32 ".g:netrw_shq.a:ps.g:netrw_shq
redraw!
else
" call Dret("s:NFH_ps 0")
@ -271,16 +298,16 @@ endfun
fun! s:NFH_eps(eps)
" call Dfunc("s:NFH_eps()")
if executable("gs")
exe "silent! !gs ".a:eps
exe "silent! !gs ".g:netrw_shq.a:eps.g:netrw_shq
redraw!
elseif executable("ghostscript")
exe "silent! !ghostscript ".a:eps
exe "silent! !ghostscript ".g:netrw_shq.a:eps.g:netrw_shq
redraw!
elseif executable("ghostscript")
exe "silent! !ghostscript ".a:eps
exe "silent! !ghostscript ".g:netrw_shq.a:eps.g:netrw_shq
redraw!
elseif executable("gswin32")
exe "silent! !gswin32 \"".a:eps.'"'
exe "silent! !gswin32 ".g:netrw_shq.a:eps.g:netrw_shq
redraw!
else
" call Dret("s:NFH_eps 0")
@ -325,4 +352,4 @@ endfun
let &cpo= s:keepcpo
" ---------------------------------------------------------------------
" Modelines: {{{1
" vim: ts=4 fdm=marker
" vim: fdm=marker

View File

@ -1,8 +1,8 @@
" netrwSettings.vim: makes netrw settings simpler
" Date: Mar 22, 2006
" Date: Jan 05, 2007
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" Version: 6
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
" Version: 9b ASTRO-ONLY
" Copyright: Copyright (C) 1999-2007 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,
@ -19,7 +19,7 @@
if exists("g:loaded_netrwSettings") || &cp
finish
endif
let g:loaded_netrwSettings = "v6"
let g:loaded_netrwSettings = "v9b"
" ---------------------------------------------------------------------
" NetrwSettings: {{{1
@ -39,8 +39,8 @@ fun! netrwSettings#NetrwSettings()
" 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
if !exists("g:netrw_liststyle")
let g:netrw_liststyle= 0
let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa"
endif
if !exists("g:netrw_silent")
@ -81,6 +81,8 @@ fun! netrwSettings#NetrwSettings()
put = 'let g:netrw_ftp = '.g:netrw_ftp
put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode
put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc
let shqline= line("$")
put = 'let g:netrw_shq...'
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(".")
@ -99,14 +101,17 @@ fun! netrwSettings#NetrwSettings()
put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse
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_ftp_sizelist_cmd = '.g:netrw_ftp_sizelist_cmd
put = 'let g:netrw_ftp_timelist_cmd = '.g:netrw_ftp_timelist_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_liststyle = '.g:netrw_liststyle
put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen
put = 'let g:netrw_menu = '.g:netrw_menu
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
@ -118,6 +123,7 @@ fun! netrwSettings#NetrwSettings()
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_use_noswf = '.g:netrw_use_noswf
put = 'let g:netrw_winsize = '.g:netrw_winsize
put =''
@ -130,9 +136,18 @@ fun! netrwSettings#NetrwSettings()
silent %s/= $/= ''/e
1
" Put in shq setting.
" (deferred so as to avoid the quote manipulation just preceding)
if g:netrw_shq == "'"
call setline(shqline,'let g:netrw_shq = "'.g:netrw_shq.'"')
else
call setline(shqline,"let g:netrw_shq = '".g:netrw_shq."'")
endif
set nomod
map <buffer> <silent> <F1> :call NetrwSettingHelp()<cr>
nmap <buffer> <silent> <F1> :call NetrwSettingHelp()<cr>
nnoremap <buffer> <silent> <leftmouse> <leftmouse>:call NetrwSettingHelp()<cr>
let tmpfile= tempname()
exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod'
endfun

View File

@ -1,7 +1,7 @@
" Vim completion script
" Language: PHP
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2006 Apr 30
" Last Change: 2006 May 9
"
" TODO:
" - Class aware completion:
@ -74,7 +74,7 @@ function! phpcomplete#CompletePHP(findstart, base)
let file = getline(1, '$')
call filter(file,
\ 'v:val =~ "class\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("')
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
let jfile = join(file, ' ')
let int_values = split(jfile, 'class\s\+')
let int_classes = {}
@ -85,12 +85,13 @@ function! phpcomplete#CompletePHP(findstart, base)
endif
endfor
" Prepare list of functions from tags file
" Prepare list of classes from tags file
let ext_classes = {}
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
if fnames != ''
exe 'silent! vimgrep /^'.a:base.'.*\tc\(\t\|$\)/j '.fnames
let qflist = getqflist()
if len(qflist) > 0
for field in qflist
" [:space:] thing: we don't have to be so strict when
" dealing with tags files - entries there were already
@ -99,19 +100,28 @@ function! phpcomplete#CompletePHP(findstart, base)
let ext_classes[item] = ''
endfor
endif
endif
call extend(int_classes, ext_classes)
" Prepare list of built in classes from g:php_builtin_functions
if !exists("g:php_omni_bi_classes")
let g:php_omni_bi_classes = {}
for i in keys(g:php_builtin_object_functions)
let g:php_omni_bi_classes[substitute(i, '::.*$', '', '')] = ''
endfor
endif
for m in sort(keys(int_classes))
let classes = sort(keys(int_classes))
let classes += sort(keys(ext_classes))
let classes += sort(keys(g:php_omni_bi_classes))
for m in classes
if m =~ '^'.a:base
call add(res, m)
endif
endfor
let int_list = res
let final_menu = []
for i in int_list
for i in res
let final_menu += [{'word':i, 'kind':'c'}]
endfor
@ -138,6 +148,19 @@ function! phpcomplete#CompletePHP(findstart, base)
let classlocation = ''
endif
if classlocation == 'VIMPHP_BUILTINOBJECT'
for object in keys(g:php_builtin_object_functions)
if object =~ '^'.classname
let res += [{'word':substitute(object, '.*::', '', ''),
\ 'info': g:php_builtin_object_functions[object]}]
endif
endfor
return res
endif
if filereadable(classlocation)
let classfile = readfile(classlocation)
let classcontent = ''
@ -154,7 +177,7 @@ function! phpcomplete#CompletePHP(findstart, base)
" Functions declared with public keyword or without any
" keyword are public
let functions = filter(deepcopy(sccontent),
\ 'v:val =~ "^\\s*\\(public\\s\\*\\)\\?function"')
\ 'v:val =~ "^\\s*\\(static\\s\\+\\|public\\s\\+\\)*function"')
let jfuncs = join(functions, ' ')
let sfuncs = split(jfuncs, 'function\s\+')
let c_functions = {}
@ -185,7 +208,6 @@ function! phpcomplete#CompletePHP(findstart, base)
let all_values = {}
call extend(all_values, c_functions)
call extend(all_values, c_variables)
call extend(all_values, g:php_builtin_object_functions)
for m in sort(keys(all_values))
if m =~ '^'.a:base && m !~ '::'
@ -244,12 +266,13 @@ function! phpcomplete#CompletePHP(findstart, base)
" ctags has good support for PHP, use tags file for external
" variables
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
let ext_vars = {}
if fnames != ''
let sbase = substitute(a:base, '^\$', '', '')
exe 'silent! vimgrep /^'.sbase.'.*\tv\(\t\|$\)/j '.fnames
let qflist = getqflist()
if len(qflist) > 0
for field in qflist
let item = matchstr(field['text'], '^[^[:space:]]\+')
" Add -> if it is possible object declaration
@ -262,6 +285,7 @@ function! phpcomplete#CompletePHP(findstart, base)
let ext_vars[adddollar.item] = classname
endfor
endif
endif
" Now we have all variables in int_vars dictionary
call extend(int_vars, ext_vars)
@ -270,7 +294,7 @@ function! phpcomplete#CompletePHP(findstart, base)
let file = getline(1, '$')
call filter(file,
\ 'v:val =~ "function\\s\\+&\\?[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("')
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
let jfile = join(file, ' ')
let int_values = split(jfile, 'function\s\+')
let int_functions = {}
@ -287,6 +311,7 @@ function! phpcomplete#CompletePHP(findstart, base)
if fnames != ''
exe 'silent! vimgrep /^'.a:base.'.*\tf\(\t\|$\)/j '.fnames
let qflist = getqflist()
if len(qflist) > 0
for field in qflist
" File name
let item = matchstr(field['text'], '^[^[:space:]]\+')
@ -296,6 +321,7 @@ function! phpcomplete#CompletePHP(findstart, base)
let ext_functions[item.'('] = prototype.') - '.fname
endfor
endif
endif
let all_values = {}
call extend(all_values, int_functions)
@ -375,12 +401,13 @@ function! phpcomplete#CompletePHP(findstart, base)
call extend(int_vars,g:php_builtin_vars)
" ctags has support for PHP, use tags file for external variables
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
let ext_vars = {}
if fnames != ''
let sbase = substitute(a:base, '^\$', '', '')
exe 'silent! vimgrep /^'.sbase.'.*\tv\(\t\|$\)/j '.fnames
let qflist = getqflist()
if len(qflist) > 0
for field in qflist
let item = '$'.matchstr(field['text'], '^[^[:space:]]\+')
let m_menu = ''
@ -393,6 +420,7 @@ function! phpcomplete#CompletePHP(findstart, base)
let ext_vars[item] = m_menu
endfor
endif
endif
call extend(int_vars, ext_vars)
let g:a0 = keys(int_vars)
@ -433,7 +461,7 @@ function! phpcomplete#CompletePHP(findstart, base)
let file = getline(1, '$')
call filter(file,
\ 'v:val =~ "function\\s\\+&\\?[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("')
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
let jfile = join(file, ' ')
let int_values = split(jfile, 'function\s\+')
let int_functions = {}
@ -450,6 +478,7 @@ function! phpcomplete#CompletePHP(findstart, base)
if fnames != ''
exe 'silent! vimgrep /^'.a:base.'.*\tf\(\t\|$\)/j '.fnames
let qflist = getqflist()
if len(qflist) > 0
for field in qflist
" File name
let item = matchstr(field['text'], '^[^[:space:]]\+')
@ -459,6 +488,7 @@ function! phpcomplete#CompletePHP(findstart, base)
let ext_functions[item.'('] = prototype.') - '.fname
endfor
endif
endif
" All functions
call extend(int_functions, ext_functions)
@ -480,16 +510,18 @@ function! phpcomplete#CompletePHP(findstart, base)
endfor
" Prepare list of constants from tags file
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
let ext_constants = {}
if fnames != ''
exe 'silent! vimgrep /^'.a:base.'.*\td\(\t\|$\)/j '.fnames
let qflist = getqflist()
if len(qflist) > 0
for field in qflist
let item = matchstr(field['text'], '^[^[:space:]]\+')
let ext_constants[item] = ''
endfor
endif
endif
" All constants
call extend(int_constants, ext_constants)
@ -558,7 +590,7 @@ function! phpcomplete#GetClassName(scontext) " {{{
endwhile
" OK, first way failed, now check tags file(s)
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
exe 'silent! vimgrep /^'.object.'.*\$'.object.'.*=\s*new\s\+.*\tv\(\t\|$\)/j '.fnames
let qflist = getqflist()
if len(qflist) == 0
@ -573,6 +605,17 @@ function! phpcomplete#GetClassName(scontext) " {{{
endfunction
" }}}
function! phpcomplete#GetClassLocation(classname) " {{{
" Check classname may be name of built in object
if !exists("g:php_omni_bi_classes")
let g:php_omni_bi_classes = {}
for i in keys(g:php_builtin_object_functions)
let g:php_omni_bi_classes[substitute(i, '::.*$', '', '')] = ''
endfor
endif
if has_key(g:php_omni_bi_classes, a:classname)
return 'VIMPHP_BUILTINOBJECT'
endif
" Get class location
for fname in tagfiles()
let fhead = fnamemodify(fname, ":h")
@ -583,8 +626,12 @@ function! phpcomplete#GetClassLocation(classname) " {{{
let fname = escape(fname, " \\")
exe 'silent! vimgrep /^'.a:classname.'.*\tc\(\t\|$\)/j '.fname
let qflist = getqflist()
" As in GetClassName we can manage only one element
" As in GetClassName we can manage only one element if it exists
if len(qflist) > 0
let classlocation = matchstr(qflist[0]['text'], '\t\zs\f\+\ze\t')
else
return ''
endif
" And only one class location
if classlocation != ''
let classlocation = fhead.classlocation
@ -614,6 +661,7 @@ function! phpcomplete#GetClassContents(file, name) " {{{
else
let extends_class = ''
endif
call search('{')
normal! %
let classc = getline(cfline, ".")
let classcontent = join(classc, "\n")

View File

@ -1,16 +1,34 @@
"pythoncomplete.vim - Omni Completion for python
" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
" Version: 0.5
" Last Updated: 19 April 2006
"
" Yeah, I skipped a version number - 0.4 was never public.
" It was a bugfix version on top of 0.3. This is a complete
" rewrite.
" Version: 0.7
" Last Updated: 19 Oct 2006
"
" Changes
" TODO:
" User defined docstrings aren't handled right...
" 'info' item output can use some formatting work
" Add an "unsafe eval" mode, to allow for return type evaluation
" Complete basic syntax along with import statements
" i.e. "import url<c-x,c-o>"
" Continue parsing on invalid line??
"
" v 0.7
" * Fixed function list sorting (_ and __ at the bottom)
" * Removed newline removal from docs. It appears vim handles these better in
" recent patches
"
" v 0.6:
" * Fixed argument completion
" * Removed the 'kind' completions, as they are better indicated
" with real syntax
" * Added tuple assignment parsing (whoops, that was forgotten)
" * Fixed import handling when flattening scope
"
" v 0.5:
" Yeah, I skipped a version number - 0.4 was never public.
" It was a bugfix version on top of 0.3. This is a complete
" rewrite.
"
if !has('python')
echo "Error: Required vim compiled with +python"
@ -28,7 +46,7 @@ function! pythoncomplete#Complete(findstart, base)
if c =~ '\w'
continue
elseif ! c =~ '\.'
idx = -1
let idx = -1
break
else
break
@ -45,7 +63,7 @@ function! pythoncomplete#Complete(findstart, base)
while idx > 0
let idx -= 1
let c = line[idx]
if c =~ '\w' || c =~ '\.'
if c =~ '\w' || c =~ '\.' || c == '('
let cword = c . cword
continue
elseif strlen(cword) > 0 || idx == 0
@ -73,7 +91,24 @@ def vimcomplete(context,match):
try:
import vim
def complsort(x,y):
return x['abbr'] > y['abbr']
try:
xa = x['abbr']
ya = y['abbr']
if xa[0] == '_':
if xa[1] == '_' and ya[0:2] == '__':
return xa > ya
elif ya[0:2] == '__':
return -1
elif y[0] == '_':
return xa > ya
else:
return 1
elif ya[0] == '_':
return -1
else:
return xa > ya
except:
return 0
cmpl = Completer()
cmpl.evalsource('\n'.join(vim.current.buffer),vim.eval("line('.')"))
all = cmpl.get_completions(context,match)
@ -86,7 +121,7 @@ def vimcomplete(context,match):
dictstr += '"icase":0},'
if dictstr[-1] == ',': dictstr = dictstr[:-1]
dictstr += ']'
dbg("dict: %s" % dictstr)
#dbg("dict: %s" % dictstr)
vim.command("silent let g:pythoncomplete_completions = %s" % dictstr)
#dbg("Completion dict:\n%s" % all)
except vim.error:
@ -108,11 +143,7 @@ class Completer(object):
except: dbg("locals: %s, %s [%s]" % (sys.exc_info()[0],sys.exc_info()[1],l))
def _cleanstr(self,doc):
return doc.replace('"',' ')\
.replace("'",' ')\
.replace('\n',' ')\
.replace('\r',' ')\
.replace('
return doc.replace('"',' ').replace("'",' ')
def get_arguments(self,func_obj):
def _ctor(obj):
@ -128,23 +159,23 @@ class Completer(object):
elif type(func_obj) == types.MethodType: func_obj = func_obj.im_func
else: arg_offset = 0
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]
real_args = cd.co_varnames[arg_offset:cd.co_argcount]
defaults = func_obj.func_defaults or []
defaults = func_obj.func_defaults or ''
defaults = 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("***")
items.append("***")
arg_text = (','.join(items)) + ')'
except:
except:
dbg("arg completion: %s: %s" % (sys.exc_info()[0],sys.exc_info()[1]))
pass
if len(arg_text) == 0:
# The doc string sometimes contains the function signature
@ -160,6 +191,7 @@ class Completer(object):
ridx = sigline.find(')')
if lidx > 0 and ridx > 0:
arg_text = sigline[lidx+1:ridx] + ')'
if len(arg_text) == 0: arg_text = ')'
return arg_text
def get_completions(self,context,match):
@ -172,12 +204,11 @@ class Completer(object):
all = {}
ridx = stmt.rfind('.')
if len(stmt) > 0 and stmt[-1] == '(':
if len(stmt) > 0 and stmt[-1] == '(':
result = eval(_sanitize(stmt[:-1]), self.compldict)
doc = result.__doc__
if doc == None: doc = ''
if doc == None: doc = ''
args = self.get_arguments(res)
args = self.get_arguments(result)
return [{'word':self._cleanstr(args),'info':self._cleanstr(doc)}]
elif ridx == -1:
match = stmt
all = self.compldict
@ -206,22 +237,18 @@ class Completer(object):
if doc == None or doc == '': doc = maindoc
wrd = m[len(match):]
wrd = m[len(match):]
c = {'word':wrd, 'abbr':m, 'info':self._cleanstr(doc)}
if "function" in typestr:
c['word'] += '('
c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst))
c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst))
elif "method" in typestr:
c['word'] += '('
c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst))
c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst))
elif "module" in typestr:
c['word'] += '.'
c['word'] += '.'
elif "class" in typestr:
c['word'] += '('
c['abbr'] += '('
c['abbr'] += '('
completions.append(c)
except:
i = sys.exc_info()
@ -277,10 +304,13 @@ class Scope(object):
# we need to start with this, to fix up broken completions
# hopefully this name is unique enough...
str = '"""'+self.docstr+'"""\n'
for l in self.locals:
if l.startswith('import'): str += l+'\n'
str += 'class _PyCmplNoType:\n def __getattr__(self,name):\n return None\n'
for sub in self.subscopes:
str += sub.get_code()
str += sub.get_code()
for l in self.locals:
if not l.startswith('import'): str += l+'\n'
return str
@ -420,6 +450,8 @@ class PyParser:
tokentype, token, indent = self.next()
if tokentype == tokenize.STRING or token == 'str':
return '""'
elif token == '(' or token == 'tuple':
return '()'
elif token == '[' or token == 'list':
return '[]'
elif token == '{' or token == 'dict':
@ -494,9 +526,9 @@ class PyParser:
freshscope=True
while True:
tokentype, token, indent = self.next()
tokentype, token, indent = self.next()
#dbg( 'main: token=[%s] indent=[%s]' % (token,indent))
if tokentype == DEDENT or token == "pass":
self.scope = self.scope.pop(indent)
elif token == 'def':
func = self._parsefunction(indent)

View File

@ -5,6 +5,7 @@
" URL: http://vim-ruby.rubyforge.org
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" Maintainer Version: 0.8
" ----------------------------------------------------------------------------
"
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
@ -12,20 +13,20 @@
" {{{ requirement checks
if !has('ruby')
echohl ErrorMsg
echo "Error: Required vim compiled with +ruby"
echohl None
s:ErrMsg( "Error: Rubycomplete requires vim compiled with +ruby" )
s:ErrMsg( "Error: falling back to syntax completion" )
" lets fall back to syntax completion
setlocal omnifunc=syntaxcomplete#Complete
finish
endif
if version < 700
echohl ErrorMsg
echo "Error: Required vim >= 7.0"
echohl None
s:ErrMsg( "Error: Required vim >= 7.0" )
finish
endif
" }}} requirement checks
" {{{ configuration failsafe initialization
if !exists("g:rubycomplete_rails")
let g:rubycomplete_rails = 0
endif
@ -34,76 +35,131 @@ if !exists("g:rubycomplete_classes_in_global")
let g:rubycomplete_classes_in_global = 0
endif
if !exists("g:rubycomplete_buffer_loading")
let g:rubycomplete_classes_in_global = 0
endif
if !exists("g:rubycomplete_include_object")
let g:rubycomplete_include_object = 0
endif
if !exists("g:rubycomplete_include_objectspace")
let g:rubycomplete_include_objectspace = 0
endif
" }}} configuration failsafe initialization
" {{{ vim-side support functions
function! GetBufferRubyModule(name)
let [snum,enum] = GetBufferRubyEntity(a:name, "module")
let s:rubycomplete_debug = 0
function! s:ErrMsg(msg)
echohl ErrorMsg
echo a:msg
echohl None
endfunction
function! s:dprint(msg)
if s:rubycomplete_debug == 1
echom a:msg
endif
endfunction
function! s:GetBufferRubyModule(name, ...)
if a:0 == 1
let [snum,enum] = s:GetBufferRubyEntity(a:name, "module", a:1)
else
let [snum,enum] = s:GetBufferRubyEntity(a:name, "module")
endif
return snum . '..' . enum
endfunction
function! GetBufferRubyClass(name)
let [snum,enum] = GetBufferRubyEntity(a:name, "class")
function! s:GetBufferRubyClass(name, ...)
if a:0 >= 1
let [snum,enum] = s:GetBufferRubyEntity(a:name, "class", a:1)
else
let [snum,enum] = s:GetBufferRubyEntity(a:name, "class")
endif
return snum . '..' . enum
endfunction
function! GetBufferRubySingletonMethods(name)
function! s:GetBufferRubySingletonMethods(name)
endfunction
function! GetBufferRubyEntity( name, type )
function! s:GetBufferRubyEntity( name, type, ... )
let lastpos = getpos(".")
let lastline = lastpos
if (a:0 >= 1)
let lastline = [ 0, a:1, 0, 0 ]
call cursor( a:1, 0 )
endif
let stopline = 1
let crex = '^\s*' . a:type . '\s*' . a:name . '\s*\(<\s*.*\s*\)\?\n*\(\(\s\|#\).*\n*\)*\n*\s*end$'
let [lnum,lcol] = searchpos( crex, 'nbw')
let crex = '^\s*\<' . a:type . '\>\s*\<' . a:name . '\>\s*\(<\s*.*\s*\)\?'
let [lnum,lcol] = searchpos( crex, 'w' )
"let [lnum,lcol] = searchpairpos( crex . '\zs', '', '\(end\|}\)', 'w' )
if lnum == 0 && lcol == 0
call cursor(lastpos[1], lastpos[2])
return [0,0]
endif
let [enum,ecol] = searchpos( crex, 'nebw')
let curpos = getpos(".")
let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'wr' )
call cursor(lastpos[1], lastpos[2])
if lnum > enum
let realdef = getline( lnum )
let crexb = '^' . realdef . '\n*\(\(\s\|#\).*\n*\)*\n*\s*end$'
let [enum,ecol] = searchpos( crexb, 'necw' )
return [0,0]
endif
" we found a the class def
return [lnum,enum]
endfunction
function! IsInClassDef()
let [snum,enum] = GetBufferRubyEntity( '.*', "class" )
let ret = 'nil'
let pos = line('.')
function! s:IsInClassDef()
return s:IsPosInClassDef( line('.') )
endfunction
if snum < pos && pos < enum
function! s:IsPosInClassDef(pos)
let [snum,enum] = s:GetBufferRubyEntity( '.*', "class" )
let ret = 'nil'
if snum < a:pos && a:pos < enum
let ret = snum . '..' . enum
endif
return ret
endfunction
function! GetRubyVarType(v)
function! s:GetRubyVarType(v)
let stopline = 1
let vtp = ''
let pos = getpos('.')
let [lnum,lcol] = searchpos('^\s*#\s*@var\s*'.a:v.'\>\s\+[^ \t]\+\s*$','nb',stopline)
let sstr = '^\s*#\s*@var\s*'.a:v.'\>\s\+[^ \t]\+\s*$'
let [lnum,lcol] = searchpos(sstr,'nb',stopline)
if lnum != 0 && lcol != 0
call setpos('.',pos)
let str = getline(lnum)
let vtp = substitute(str,'^\s*#\s*@var\s*'.a:v.'\>\s\+\([^ \t]\+\)\s*$','\1','')
let vtp = substitute(str,sstr,'\1','')
return vtp
endif
call setpos('.',pos)
if g:rubycomplete_rails == 1 && g:rubycomplete_rails_loaded == 1
let ctors = '\(now\|new\|open\|get_instance\|find\|create\)'
let ctors = '\(now\|new\|open\|get_instance'
if exists('g:rubycomplete_rails') && g:rubycomplete_rails == 1 && s:rubycomplete_rails_loaded == 1
let ctors = ctors.'\|find\|create'
else
let ctors = '\(now\|new\|open\|get_instance\)'
endif
let ctors = ctors.'\)'
let [lnum,lcol] = searchpos(''.a:v.'\>\s*[+\-*/]*=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%r{\|[A-Za-z0-9@:\-()]\+...\?\)','nb',stopline)
let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)'
let sstr = ''.a:v.'\>\s*[+\-*/]*'.fstr
let [lnum,lcol] = searchpos(sstr,'nb',stopline)
if lnum != 0 && lcol != 0
let str = matchstr(getline(lnum),'=\s*\([^ \t]\+.' . ctors . '\>\|[\[{"''/]\|%r{\|[A-Za-z0-9@:\-()]\+...\?\)',lcol)
let str = matchstr(getline(lnum),fstr,lcol)
let str = substitute(str,'^=\s*','','')
call setpos('.',pos)
if str == '"' || str == ''''
if str == '"' || str == '''' || stridx(tolower(str), '%q[') != -1
return 'String'
elseif str == '['
elseif str == '[' || stridx(str, '%w[') != -1
return 'Array'
elseif str == '{'
return 'Hash'
@ -111,6 +167,8 @@ function! GetRubyVarType(v)
return 'Regexp'
elseif strlen(str) >= 4 && stridx(str,'..') != -1
return 'Range'
elseif stridx(str, 'lambda') != -1 || str == '&'
return 'Proc'
elseif strlen(str) > 4
let l = stridx(str,'.')
return str[0:l-1]
@ -123,6 +181,11 @@ endfunction
"}}} vim-side support functions
"{{{ vim-side completion function
function! rubycomplete#Init()
execute "ruby VimRubyCompletion.preload_rails"
endfunction
function! rubycomplete#Complete(findstart, base)
"findstart = 1 when we need to get the text length
if a:findstart
@ -145,21 +208,26 @@ function! rubycomplete#Complete(findstart, base)
"findstart = 0 when we need to return the list of completions
else
let g:rubycomplete_completions = []
execute "ruby get_completions('" . a:base . "')"
execute "ruby VimRubyCompletion.get_completions('" . a:base . "')"
return g:rubycomplete_completions
endif
endfunction
"}}} vim-side completion function
"{{{ ruby-side code
function! s:DefRuby()
ruby << RUBYEOF
# {{{ ruby completion
RailsWords = [
"has_many", "has_one",
"belongs_to",
]
ReservedWords = [
begin
require 'rubygems' # let's assume this is safe...?
rescue Exception
#ignore?
end
class VimRubyCompletion
# {{{ constants
@@debug = false
@@ReservedWords = [
"BEGIN", "END",
"alias", "and",
"begin", "break",
@ -179,12 +247,13 @@ ReservedWords = [
"yield",
]
Operators = [ "%", "&", "*", "**", "+", "-", "/",
@@Operators = [ "%", "&", "*", "**", "+", "-", "/",
"<", "<<", "<=", "<=>", "==", "===", "=~", ">", ">=", ">>",
"[]", "[]=", "^", ]
# }}} constants
def load_requires
# {{{ buffer analysis magic
def load_requires
buf = VIM::Buffer.current
enum = buf.line_number
nums = Range.new( 1, enum )
@ -196,247 +265,460 @@ def load_requires
#ignore?
end
end
end
end
def load_buffer_class(name)
classdef = get_buffer_entity(name, 'GetBufferRubyClass("%s")')
def load_buffer_class(name)
dprint "load_buffer_class(%s) START" % name
classdef = get_buffer_entity(name, 's:GetBufferRubyClass("%s")')
return if classdef == nil
pare = /^\s*class\s*(.*)\s*<\s*(.*)\s*\n/.match( classdef )
load_buffer_class( $2 ) if pare != nil
load_buffer_class( $2 ) if pare != nil && $2 != name # load parent class if needed
mixre = /.*\n\s*include\s*(.*)\s*\n/.match( classdef )
load_buffer_module( $2 ) if mixre != nil
load_buffer_module( $2 ) if mixre != nil && $2 != name # load mixins if needed
begin
eval classdef
end
rescue Exception
VIM::evaluate( "s:ErrMsg( 'Problem loading class \"%s\", was it already completed?' )" % name )
end
dprint "load_buffer_class(%s) END" % name
end
def load_buffer_module(name)
classdef = get_buffer_entity(name, 'GetBufferRubyModule("%s")')
def load_buffer_module(name)
dprint "load_buffer_module(%s) START" % name
classdef = get_buffer_entity(name, 's:GetBufferRubyModule("%s")')
return if classdef == nil
begin
eval classdef
end
rescue Exception
VIM::evaluate( "s:ErrMsg( 'Problem loading module \"%s\", was it already completed?' )" % name )
end
dprint "load_buffer_module(%s) END" % name
end
def get_buffer_entity(name, vimfun)
def get_buffer_entity(name, vimfun)
loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading")
return nil if loading_allowed != '1'
return nil if /(\"|\')+/.match( name )
buf = VIM::Buffer.current
nums = eval( VIM::evaluate( vimfun % name ) )
return nil if nums == nil
return nil if nums.min == nums.max && nums.min == 0
cur_line = VIM::Buffer.current.line_number
dprint "get_buffer_entity START"
visited = []
clscnt = 0
bufname = VIM::Buffer.current.name
classdef = ""
cur_line = VIM::Buffer.current.line_number
while (nums != nil && !(nums.min == 0 && nums.max == 0) )
dprint "visited: %s" % visited.to_s
break if visited.index( nums )
visited << nums
nums.each do |x|
if x != cur_line
next if x == 0
ln = buf[x]
if /^\s*(module|class|def|include)\s+/.match(ln)
clscnt += 1 if $1 == "class"
#dprint "\$1: %s" % $1
classdef += "%s\n" % ln
classdef += "end\n" if /def\s+/.match(ln)
dprint ln
end
end
end
nm = "%s(::.*)*\", %s, \"" % [ name, nums.last ]
nums = eval( VIM::evaluate( vimfun % nm ) )
dprint "nm: \"%s\"" % nm
dprint "vimfun: %s" % (vimfun % nm)
dprint "got nums: %s" % nums.to_s
end
if classdef.length > 1
classdef += "end\n"*clscnt
# classdef = "class %s\n%s\nend\n" % [ bufname.gsub( /\/|\\/, "_" ), classdef ]
end
dprint "get_buffer_entity END"
dprint "classdef====start"
lns = classdef.split( "\n" )
lns.each { |x| dprint x }
dprint "classdef====end"
return classdef
end
end
def get_var_type( receiver )
def get_var_type( receiver )
if /(\"|\')+/.match( receiver )
"String"
else
VIM::evaluate("GetRubyVarType('%s')" % receiver)
VIM::evaluate("s:GetRubyVarType('%s')" % receiver)
end
end
end
def get_buffer_classes()
def dprint( txt )
print txt if @@debug
end
def get_buffer_entity_list( type )
# this will be a little expensive.
allow_aggressive_load = VIM::evaluate('g:rubycomplete_classes_in_global')
return [] if allow_aggressive_load != '1'
loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading")
allow_aggressive_load = VIM::evaluate("exists('g:rubycomplete_classes_in_global') && g:rubycomplete_classes_in_global")
return [] if allow_aggressive_load != '1' || loading_allowed != '1'
buf = VIM::Buffer.current
eob = buf.length
ret = []
rg = 1..eob
re = eval( "/^\s*%s\s*([A-Za-z0-9_:-]*)(\s*<\s*([A-Za-z0-9_:-]*))?\s*/" % type )
rg.each do |x|
if /^\s*class\s*([A-Za-z0-9_-]*)(\s*<\s*([A-Za-z0-9_:-]*))?\s*/.match( buf[x] )
if re.match( buf[x] )
next if type == "def" && eval( VIM::evaluate("s:IsPosInClassDef(%s)" % x) ) != nil
ret.push $1
end
end
return ret
end
end
def load_rails()
allow_rails = VIM::evaluate('g:rubycomplete_rails')
def get_buffer_modules
return get_buffer_entity_list( "modules" )
end
def get_buffer_methods
return get_buffer_entity_list( "def" )
end
def get_buffer_classes
return get_buffer_entity_list( "class" )
end
def load_rails
allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails")
return if allow_rails != '1'
buf_path = VIM::evaluate('expand("%:p")')
file_name = VIM::evaluate('expand("%:t")')
path = buf_path.gsub( file_name, '' )
path.gsub!( /\\/, "/" )
pup = [ "./", "../", "../../", "../../../", "../../../../" ]
pok = nil
vim_dir = VIM::evaluate('getcwd()')
file_dir = buf_path.gsub( file_name, '' )
file_dir.gsub!( /\\/, "/" )
vim_dir.gsub!( /\\/, "/" )
vim_dir << "/"
dirs = [ vim_dir, file_dir ]
sdirs = [ "", "./", "../", "../../", "../../../", "../../../../" ]
rails_base = nil
pup.each do |sup|
tpok = "%s%sconfig" % [ path, sup ]
if File.exists?( tpok )
pok = tpok
dirs.each do |dir|
sdirs.each do |sub|
trail = "%s%s" % [ dir, sub ]
tcfg = "%sconfig" % trail
if File.exists?( tcfg )
rails_base = trail
break
end
end
break if rails_base
end
return if pok == nil
return if rails_base == nil
$:.push rails_base unless $:.index( rails_base )
bootfile = pok + "/boot.rb"
envfile = pok + "/environment.rb"
rails_config = rails_base + "config/"
rails_lib = rails_base + "lib/"
$:.push rails_config unless $:.index( rails_config )
$:.push rails_lib unless $:.index( rails_lib )
bootfile = rails_config + "boot.rb"
envfile = rails_config + "environment.rb"
if File.exists?( bootfile ) && File.exists?( envfile )
begin
require bootfile
require envfile
begin
require 'console_app'
require 'console_with_helpers'
VIM::command('let g:rubycomplete_rails_loaded = 1')
rescue
print "Error loading rails environment"
rescue Exception
dprint "Rails 1.1+ Error %s" % $!
# assume 1.0
end
#eval( "Rails::Initializer.run" ) #not necessary?
VIM::command('let s:rubycomplete_rails_loaded = 1')
dprint "rails loaded"
rescue Exception
dprint "Rails Error %s" % $!
VIM::evaluate( "s:ErrMsg('Error loading rails environment')" )
end
end
end
end
def get_rails_helpers
allow_rails = VIM::evaluate('g:rubycomplete_rails')
rails_loaded = VIM::evaluate('g:rubycomplete_rails_loaded')
def get_rails_helpers
allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails")
rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded')
return [] if allow_rails != '1' || rails_loaded != '1'
return RailsWords
end
def get_completions(base)
buf_path = VIM::evaluate('expand("%:p")')
buf_path.gsub!( /\\/, "/" )
path_elm = buf_path.split( "/" )
dprint "buf_path: %s" % buf_path
types = [ "app", "db", "lib", "test", "components", "script" ]
i = nil
ret = []
type = nil
types.each do |t|
i = path_elm.index( t )
break if i
end
type = path_elm[i]
type.downcase!
dprint "type: %s" % type
case type
when "app"
i += 1
subtype = path_elm[i]
subtype.downcase!
dprint "subtype: %s" % subtype
case subtype
when "views"
ret += ActionView::Base.instance_methods
ret += ActionView::Base.methods
when "controllers"
ret += ActionController::Base.instance_methods
ret += ActionController::Base.methods
when "models"
ret += ActiveRecord::Base.instance_methods
ret += ActiveRecord::Base.methods
end
when "db"
ret += ActiveRecord::ConnectionAdapters::SchemaStatements.instance_methods
ret += ActiveRecord::ConnectionAdapters::SchemaStatements.methods
end
return ret
end
def add_rails_columns( cls )
allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails")
rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded')
return [] if allow_rails != '1' || rails_loaded != '1'
begin
eval( "#{cls}.establish_connection" )
return [] unless eval( "#{cls}.ancestors.include?(ActiveRecord::Base).to_s" )
col = eval( "#{cls}.column_names" )
return col if col
rescue
dprint "add_rails_columns err: (cls: %s) %s" % [ cls, $! ]
return []
end
return []
end
def clean_sel(sel, msg)
sel.delete_if { |x| x == nil }
sel.uniq!
sel.grep(/^#{Regexp.quote(msg)}/) if msg != nil
end
def get_rails_view_methods
allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails")
rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded')
return [] if allow_rails != '1' || rails_loaded != '1'
buf_path = VIM::evaluate('expand("%:p")')
buf_path.gsub!( /\\/, "/" )
pelm = buf_path.split( "/" )
idx = pelm.index( "views" )
return [] unless idx
idx += 1
clspl = pelm[idx].camelize.pluralize
cls = clspl.singularize
ret = []
begin
ret += eval( "#{cls}.instance_methods" )
ret += eval( "#{clspl}Helper.instance_methods" )
rescue Exception
dprint "Error: Unable to load rails view helpers for %s: %s" % [ cls, $! ]
end
return ret
end
# }}} buffer analysis magic
# {{{ main completion code
def self.preload_rails
a = VimRubyCompletion.new
require 'Thread'
Thread.new(a) do |b|
begin
b.load_rails
rescue
end
end
a.load_rails
rescue
end
def self.get_completions(base)
b = VimRubyCompletion.new
b.get_completions base
end
def get_completions(base)
loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading")
if loading_allowed == '1'
load_requires
load_rails
end
input = VIM::Buffer.current.line
cpos = VIM::Window.current.cursor[1] - 1
input = input[0..cpos] if cpos != 0
input = input[0..cpos]
input += base
input.sub!(/.*[ \t\n\"\\'`><=;|&{(]/, '') # Readline.basic_word_break_characters
input.sub!(/self\./, '')
input.sub!(/.*((\.\.[\[(]?)|([\[(]))/, '')
rip = input.rindex(/\s/,cpos)
if rip
input = input[rip..input.length]
end
asn = /^.*(\+|\-|\*|=|\(|\[)=?(\s*[A-Za-z0-9_:@.-]*)(\s*(\{|\+|\-|\*|\%|\/)?\s*).*/
if asn.match(input)
input = $2
end
input.strip!
dprint 'input %s' % input
message = nil
receiver = nil
candidates = []
methods = []
variables = []
classes = []
constants = []
case input
when /^(\/[^\/]*\/)\.([^.]*)$/ # Regexp
receiver = $1
message = Regexp.quote($2)
candidates = Regexp.instance_methods(true)
methods = Regexp.instance_methods(true)
when /^([^\]]*\])\.([^.]*)$/ # Array
receiver = $1
message = Regexp.quote($2)
candidates = Array.instance_methods(true)
methods = Array.instance_methods(true)
when /^([^\}]*\})\.([^.]*)$/ # Proc or Hash
receiver = $1
message = Regexp.quote($2)
candidates = Proc.instance_methods(true) | Hash.instance_methods(true)
methods = Proc.instance_methods(true) | Hash.instance_methods(true)
when /^(:[^:.]*)$/ # Symbol
dprint "symbol"
if Symbol.respond_to?(:all_symbols)
receiver = $1
candidates = Symbol.all_symbols.collect{|s| s.id2name}
candidates.delete_if { |c| c.match( /'/ ) }
message = $1.sub( /:/, '' )
methods = Symbol.all_symbols.collect{|s| s.id2name}
methods.delete_if { |c| c.match( /'/ ) }
end
when /^::([A-Z][^:\.\(]*)$/ # Absolute Constant or class methods
dprint "const or cls"
receiver = $1
candidates = Object.constants
candidates.grep(/^#{receiver}/).collect{|e| "::" + e}
methods = Object.constants
methods.grep(/^#{receiver}/).collect{|e| "::" + e}
when /^(((::)?[A-Z][^:.\(]*)+)::?([^:.]*)$/ # Constant or class methods
receiver = $1
message = Regexp.quote($4)
dprint "const or cls 2 [recv: \'%s\', msg: \'%s\']" % [ receiver, message ]
load_buffer_class( receiver )
begin
candidates = eval("#{receiver}.constants | #{receiver}.methods")
classes = eval("#{receiver}.constants")
#methods = eval("#{receiver}.methods")
rescue Exception
candidates = []
dprint "exception: %s" % $!
methods = []
end
candidates.grep(/^#{message}/).collect{|e| receiver + "::" + e}
methods.grep(/^#{message}/).collect{|e| receiver + "::" + e}
when /^(:[^:.]+)\.([^.]*)$/ # Symbol
dprint "symbol"
receiver = $1
message = Regexp.quote($2)
candidates = Symbol.instance_methods(true)
methods = Symbol.instance_methods(true)
when /^([0-9_]+(\.[0-9_]+)?(e[0-9]+)?)\.([^.]*)$/ # Numeric
dprint "numeric"
receiver = $1
message = Regexp.quote($4)
begin
candidates = eval(receiver).methods
methods = eval(receiver).methods
rescue Exception
candidates
methods = []
end
when /^(\$[^.]*)$/ #global
candidates = global_variables.grep(Regexp.new(Regexp.quote($1)))
dprint "global"
methods = global_variables.grep(Regexp.new(Regexp.quote($1)))
when /^((\.?[^.]+)+)\.([^.]*)$/ # variable
dprint "variable"
receiver = $1
message = Regexp.quote($3)
load_buffer_class( receiver )
cv = eval("self.class.constants")
vartype = get_var_type( receiver )
dprint "vartype: %s" % vartype
if vartype != ''
load_buffer_class( vartype )
begin
candidates = eval("#{vartype}.instance_methods")
methods = eval("#{vartype}.instance_methods")
variables = eval("#{vartype}.instance_variables")
rescue Exception
candidates = []
dprint "load_buffer_class err: %s" % $!
end
elsif (cv).include?(receiver)
# foo.func and foo is local var.
candidates = eval("#{receiver}.methods")
methods = eval("#{receiver}.methods")
vartype = receiver
elsif /^[A-Z]/ =~ receiver and /\./ !~ receiver
vartype = receiver
# Foo::Bar.func
begin
candidates = eval("#{receiver}.methods")
methods = eval("#{receiver}.methods")
rescue Exception
candidates = []
end
else
# func1.func2
candidates = []
ObjectSpace.each_object(Module){|m|
next if m.name != "IRB::Context" and
/^(IRB|SLex|RubyLex|RubyToken)/ =~ m.name
candidates.concat m.instance_methods(false)
methods.concat m.instance_methods(false)
}
end
variables += add_rails_columns( "#{vartype}" ) if vartype && vartype.length > 0
when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/
message = $1
candidates = Range.instance_methods(true)
when /^\[(\s*[A-Za-z0-9:^@.%\/+*\(\)\[\]\{\}.\'\"],?)*\].([^.]*)/
message = $2
candidates = Array.instance_methods(true)
methods = Range.instance_methods(true)
when /^\.([^.]*)$/ # unknown(maybe String)
message = Regexp.quote($1)
candidates = String.instance_methods(true)
methods = String.instance_methods(true)
else
inclass = eval( VIM::evaluate("IsInClassDef()") )
dprint "default/other"
inclass = eval( VIM::evaluate("s:IsInClassDef()") )
if inclass != nil
dprint "inclass"
classdef = "%s\n" % VIM::Buffer.current[ inclass.min ]
found = /^\s*class\s*([A-Za-z0-9_-]*)(\s*<\s*([A-Za-z0-9_:-]*))?\s*\n$/.match( classdef )
@ -445,8 +727,8 @@ def get_completions(base)
message = input
load_buffer_class( receiver )
begin
candidates = eval( "#{receiver}.instance_methods" )
candidates += get_rails_helpers
methods = eval( "#{receiver}.instance_methods" )
variables += add_rails_columns( "#{receiver}" )
rescue Exception
found = nil
end
@ -454,37 +736,67 @@ def get_completions(base)
end
if inclass == nil || found == nil
candidates = eval("self.class.constants")
candidates += get_buffer_classes
dprint "inclass == nil"
methods = get_buffer_methods
methods += get_rails_view_methods
cls_const = Class.constants
constants = cls_const.select { |c| /^[A-Z_-]+$/.match( c ) }
classes = eval("self.class.constants") - constants
classes += get_buffer_classes
classes += get_buffer_modules
include_objectspace = VIM::evaluate("exists('g:rubycomplete_include_objectspace') && g:rubycomplete_include_objectspace")
ObjectSpace.each_object(Class) { |cls| classes << cls.to_s } if include_objectspace == "1"
message = receiver = input
end
methods += get_rails_helpers
methods += Kernel.public_methods
end
candidates.delete_if { |x| x == nil }
candidates.uniq!
candidates.sort!
candidates = candidates.grep(/^#{Regexp.quote(message)}/) if message != nil
include_object = VIM::evaluate("exists('g:rubycomplete_include_object') && g:rubycomplete_include_object")
methods = clean_sel( methods, message )
methods = (methods-Object.instance_methods) if include_object == "0"
rbcmeth = (VimRubyCompletion.instance_methods-Object.instance_methods) # lets remove those rubycomplete methods
methods = (methods-rbcmeth)
variables = clean_sel( variables, message )
classes = clean_sel( classes, message ) - ["VimRubyCompletion"]
constants = clean_sel( constants, message )
valid = []
valid += methods.collect { |m| { :name => m, :type => 'm' } }
valid += variables.collect { |v| { :name => v, :type => 'v' } }
valid += classes.collect { |c| { :name => c, :type => 't' } }
valid += constants.collect { |d| { :name => d, :type => 'd' } }
valid.sort! { |x,y| x[:name] <=> y[:name] }
outp = ""
valid = (candidates-Object.instance_methods)
rg = 0..valid.length
rg.step(150) do |x|
stpos = 0+x
enpos = 150+x
valid[stpos..enpos].each { |c| outp += "{'word':'%s','item':'%s'}," % [ c, c ] }
valid[stpos..enpos].each { |c| outp += "{'word':'%s','item':'%s','kind':'%s'}," % [ c[:name], c[:name], c[:type] ] }
outp.sub!(/,$/, '')
VIM::command("call extend(g:rubycomplete_completions, [%s])" % outp)
outp = ""
end
end
end
# }}} main completion code
end # VimRubyCompletion
# }}} ruby completion
RUBYEOF
endfunction
let g:rubycomplete_rails_loaded = 0
let s:rubycomplete_rails_loaded = 0
call s:DefRuby()
" vim:tw=78:sw=4:ts=8:et:ft=vim:norl:
"}}} ruby-side code
" vim:tw=78:sw=4:ts=8:et:fdm=marker:ft=vim:norl:

View File

@ -1,8 +1,8 @@
" Vim OMNI completion script for SQL
" Language: SQL
" Maintainer: David Fishburn <fishburn@ianywhere.com>
" Version: 4.0
" Last Change: Wed Apr 26 2006 3:00:06 PM
" Version: 5.0
" Last Change: Mon Jun 05 2006 3:30:04 PM
" Usage: For detailed help
" ":help sql.txt"
" or ":help ft-sql-omni"
@ -22,7 +22,7 @@ endif
if exists('g:loaded_sql_completion')
finish
endif
let g:loaded_sql_completion = 40
let g:loaded_sql_completion = 50
" Maintains filename of dictionary
let s:sql_file_table = ""
@ -176,11 +176,19 @@ function! sqlcomplete#Complete(findstart, base)
return []
endif
if s:sql_file_{compl_type} == ""
let compl_type = substitute(compl_type, '\w\+', '\u&', '')
let s:sql_file_{compl_type} = DB_getDictionaryName(compl_type)
" Allow the user to override the dbext plugin to specify whether
" the owner/creator should be included in the list
let saved_dbext_show_owner = 1
if exists('g:dbext_default_dict_show_owner')
let saved_dbext_show_owner = g:dbext_default_dict_show_owner
endif
let s:sql_file_{compl_type} = DB_getDictionaryName(compl_type)
let g:dbext_default_dict_show_owner = g:omni_sql_include_owner
let compl_type_uc = substitute(compl_type, '\w\+', '\u&', '')
if s:sql_file_{compl_type} == ""
let s:sql_file_{compl_type} = DB_getDictionaryName(compl_type_uc)
endif
let s:sql_file_{compl_type} = DB_getDictionaryName(compl_type_uc)
if s:sql_file_{compl_type} != ""
if filereadable(s:sql_file_{compl_type})
let compl_list = readfile(s:sql_file_{compl_type})
@ -194,7 +202,9 @@ function! sqlcomplete#Complete(findstart, base)
" endif
endif
endif
elseif compl_type == 'column'
let g:dbext_default_dict_show_owner = saved_dbext_show_owner
elseif compl_type =~? 'column'
" This type of completion relies upon the dbext.vim plugin
if s:SQLCCheck4dbext() == -1
@ -209,33 +219,88 @@ function! sqlcomplete#Complete(findstart, base)
let base = s:save_prev_table
endif
if base != ""
let compl_list = s:SQLCGetColumns(base, '')
let owner = ''
let column = ''
if base =~ '\.'
" Check if the owner/creator has been specified
let owner = matchstr( base, '^\zs.*\ze\..*\..*' )
let table = matchstr( base, '^\(.*\.\)\?\zs.*\ze\..*' )
let column = matchstr( base, '.*\.\zs.*' )
" It is pretty well impossible to determine if the user
" has entered:
" owner.table
" table.column_prefix
" So there are a couple of things we can do to mitigate
" this issue.
" 1. Check if the dbext plugin has the option turned
" on to even allow owners
" 2. Based on 1, if the user is showing a table list
" and the DrillIntoTable (using <C-Right>) then
" this will be owner.table. In this case, we can
" check to see the table.column exists in the
" cached table list. If it does, then we have
" determined the user has actually chosen
" owner.table, not table.column_prefix.
let found = -1
if g:omni_sql_include_owner == 1 && owner == ''
if filereadable(s:sql_file_table)
let tbl_list = readfile(s:sql_file_table)
let found = index( tbl_list, ((table != '')?(table.'.'):'').column)
endif
endif
" If the table.column was found in the table list, we can safely assume
" the owner was not provided and shift the items appropriately.
" OR
" If the user has indicated not to use table owners at all and
" the base ends in a '.' we know they are not providing a column
" name, so we can shift the items appropriately.
if found != -1 || (g:omni_sql_include_owner == 0 && base !~ '\.$')
let owner = table
let table = column
let column = ''
endif
else
let table = base
endif
" Get anything after the . and consider this the table name
" If an owner has been specified, then we must consider the
" base to be a partial column name
" let base = matchstr( base, '^\(.*\.\)\?\zs.*' )
if table != ""
let s:save_prev_table = base
let list_type = ''
if compl_type == 'column_csv'
" Return one array element, with a comma separated
" list of values instead of multiple array entries
" for each column in the table.
let list_type = 'csv'
endif
let compl_list = s:SQLCGetColumns(table, list_type)
if column != ''
" If no column prefix has been provided and the table
" name was provided, append it to each of the items
" returned.
let compl_list = map(compl_list, "table.'.'.v:val")
if owner != ''
" If an owner has been provided append it to each of the
" items returned.
let compl_list = map(compl_list, "owner.'.'.v:val")
endif
else
let base = ''
endif
elseif compl_type == 'column_csv'
" This type of completion relies upon the dbext.vim plugin
if s:SQLCCheck4dbext() == -1
return []
endif
if base == ""
" The last time we displayed a column list we stored
" the table name. If the user selects a column list
" without a table name of alias present, assume they want
" the previous column list displayed.
let base = s:save_prev_table
endif
if base != ""
let compl_list = s:SQLCGetColumns(base, 'csv')
let s:save_prev_table = base
if compl_type == 'column_csv'
" Join the column array into 1 single element array
" but make the columns column separated
let compl_list = [join(compl_list, ', ')]
let base = ''
endif
endif
elseif compl_type == 'resetCache'
" Reset all cached items
@ -256,7 +321,7 @@ function! sqlcomplete#Complete(findstart, base)
if base != ''
" Filter the list based on the first few characters the user
" entered
let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "^'.base.'"'
let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\|\\([^.]*\\)\\?'.base.'\\)"'
let compl_list = filter(deepcopy(compl_list), expr)
endif
@ -274,6 +339,8 @@ function! sqlcomplete#PreCacheSyntax(...)
else
let syn_group_arr = g:omni_sql_precache_syntax_groups
endif
" For each group specified in the list, precache all
" the sytnax items.
if !empty(syn_group_arr)
for group_name in syn_group_arr
call s:SQLCGetSyntaxList(group_name)
@ -444,9 +511,23 @@ function! s:SQLCAddAlias(table_name, table_alias, cols)
return cols
endfunction
function! s:SQLCGetObjectOwner(object)
" The owner regex matches a word at the start of the string which is
" followed by a dot, but doesn't include the dot in the result.
" ^ - from beginning of line
" "\? - ignore any quotes
" \zs - start the match now
" \w\+ - get owner name
" \ze - end the match
" "\? - ignore any quotes
" \. - must by followed by a .
let owner = matchstr( a:object, '^"\?\zs\w\+\ze"\?\.' )
return owner
endfunction
function! s:SQLCGetColumns(table_name, list_type)
let table_name = matchstr(a:table_name, '^\w\+')
let table_name = matchstr(a:table_name, '^[a-zA-Z0-9_.]\+')
" Check if the table name was provided as part of the column name
let table_name = matchstr(a:table_name, '^[a-zA-Z0-9_]\+\ze\.\?')
let table_cols = []
let table_alias = ''
let move_to_top = 1

View File

@ -1,8 +1,8 @@
" Vim completion script
" Language: All languages, uses existing syntax highlighting rules
" Maintainer: David Fishburn <fishburn@ianywhere.com>
" Version: 2.0
" Last Change: Fri May 05 2006 10:34:57 PM
" Version: 3.0
" Last Change: Wed Nov 08 2006 10:46:46 AM
" Usage: For detailed help, ":help ft-syntax-omni"
" Set completion with CTRL-X CTRL-O to autoloaded function.
@ -19,13 +19,31 @@ endif
if exists('g:loaded_syntax_completion')
finish
endif
let g:loaded_syntax_completion = 20
let g:loaded_syntax_completion = 30
" Set ignorecase to the ftplugin standard
" This is the default setting, but if you define a buffer local
" variable you can override this on a per filetype.
if !exists('g:omni_syntax_ignorecase')
let g:omni_syntax_ignorecase = &ignorecase
endif
" Indicates whether we should use the iskeyword option to determine
" how to split words.
" This is the default setting, but if you define a buffer local
" variable you can override this on a per filetype.
if !exists('g:omni_syntax_use_iskeyword')
let g:omni_syntax_use_iskeyword = 1
endif
" Only display items in the completion window that are at least
" this many characters in length.
" This is the default setting, but if you define a buffer local
" variable you can override this on a per filetype.
if !exists('g:omni_syntax_minimum_length')
let g:omni_syntax_minimum_length = 0
endif
" 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,'.
@ -38,21 +56,28 @@ let s:prepended = ''
" This function is used for the 'omnifunc' option.
function! syntaxcomplete#Complete(findstart, base)
" Only display items in the completion window that are at least
" this many characters in length
if !exists('b:omni_syntax_ignorecase')
if exists('g:omni_syntax_ignorecase')
let b:omni_syntax_ignorecase = g:omni_syntax_ignorecase
else
let b:omni_syntax_ignorecase = &ignorecase
endif
endif
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'
" if line[start - 1] =~ '\S'
" let start -= 1
" elseif line[start - 1] =~ '\.'
if line[start - 1] =~ '\k'
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'
let lastword = a:findstart
else
break
endif
@ -64,11 +89,12 @@ function! syntaxcomplete#Complete(findstart, base)
let s:prepended = ''
return start
endif
let s:prepended = strpart(line, start, lastword - start)
return lastword
let s:prepended = strpart(line, start, (col('.') - 1) - start)
return start
endif
let base = s:prepended . a:base
" let base = s:prepended . a:base
let base = s:prepended
let filetype = substitute(&filetype, '\.', '_', 'g')
let list_idx = index(s:cache_name, filetype, 0, &ignorecase)
@ -82,11 +108,16 @@ function! syntaxcomplete#Complete(findstart, base)
" Return list of matches.
if base =~ '\w'
let compstr = join(compl_list, ' ')
let expr = (g:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*'
let compstr = substitute(compstr, expr, '', 'g')
let compl_list = split(compstr, '\s\+')
if base != ''
" let compstr = join(compl_list, ' ')
" let expr = (b:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*'
" let compstr = substitute(compstr, expr, '', 'g')
" let compl_list = split(compstr, '\s\+')
" Filter the list based on the first few characters the user
" entered
let expr = 'v:val '.(g:omni_syntax_ignorecase==1?'=~?':'=~#')." '^".escape(base, '\\/.*$^~[]').".*'"
let compl_list = filter(deepcopy(compl_list), expr)
endif
return compl_list
@ -100,6 +131,26 @@ function! OmniSyntaxList()
" let use_dictionary = a:1
" endif
" Only display items in the completion window that are at least
" this many characters in length
if !exists('b:omni_syntax_use_iskeyword')
if exists('g:omni_syntax_use_iskeyword')
let b:omni_syntax_use_iskeyword = g:omni_syntax_use_iskeyword
else
let b:omni_syntax_use_iskeyword = 1
endif
endif
" Only display items in the completion window that are at least
" this many characters in length
if !exists('b:omni_syntax_minimum_length')
if exists('g:omni_syntax_minimum_length')
let b:omni_syntax_minimum_length = g:omni_syntax_minimum_length
else
let b:omni_syntax_minimum_length = 0
endif
endif
let saveL = @l
" Loop through all the syntax groupnames, and build a
@ -294,14 +345,32 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
\ , "", 'g'
\ )
if b:omni_syntax_use_iskeyword == 0
" 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 accept_chars = ','.&iskeyword.','
" Remove all character ranges
let accept_chars = substitute(accept_chars, ',[^,]\+-[^,]\+,', ',', 'g')
" Remove all numeric specifications
let accept_chars = substitute(accept_chars, ',\d\{-},', ',', 'g')
" Remove all commas
let accept_chars = substitute(accept_chars, ',', '', 'g')
" Escape special regex characters
let accept_chars = escape(accept_chars, '\\/.*$^~[]' )
" Remove all characters that are not acceptable
let syn_list = substitute( syn_list, '[^0-9A-Za-z_ '.accept_chars.']', ' ', 'g' )
endif
if b:omni_syntax_minimum_length > 0
" If the user specified a minimum length, enforce it
let syn_list = substitute(' '.syn_list.' ', ' \S\{,'.b:omni_syntax_minimum_length.'}\ze ', ' ', 'g')
endif
else
let syn_list = ''
endif
return syn_list
endfunction

View File

@ -1,8 +1,8 @@
" tar.vim: Handles browsing tarfiles
" AUTOLOAD PORTION
" Date: May 02, 2006
" Version: 9
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" Date: Sep 29, 2006
" Version: 11
" Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" License: Vim License (see vim's :help license)
"
" Contains many ideas from Michael Toren's <tar.vim>
@ -18,13 +18,13 @@
" of this software.
" ---------------------------------------------------------------------
" Initialization: {{{1
" Load Once: {{{1
let s:keepcpo= &cpo
set cpo&vim
if exists("g:loaded_tar")
if &cp || exists("g:loaded_tar") || v:version < 700
finish
endif
let g:loaded_tar= "v9"
let g:loaded_tar= "v11"
"call Decho("loading autoload/tar.vim")
" ---------------------------------------------------------------------
@ -41,6 +41,13 @@ endif
if !exists("g:tar_writeoptions")
let g:tar_writeoptions= "uf"
endif
if !exists("g:tar_shq")
if has("unix")
let g:tar_shq= "'"
else
let g:tar_shq= '"'
endif
endif
" ----------------
" Functions: {{{1
@ -55,8 +62,9 @@ fun! tar#Browse(tarfile)
" sanity checks
if !executable(g:tar_cmd)
redraw!
echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system'
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep
" call Dret("tar#Browse")
return
@ -65,8 +73,9 @@ fun! tar#Browse(tarfile)
" call Decho('a:tarfile<'.a:tarfile.'> not filereadable')
if a:tarfile !~# '^\a\+://'
" if its an url, don't complain, let url-handlers such as vim do its thing
redraw!
echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif
let &report= repkeep
" call Dret("tar#Browse : file<".a:tarfile."> not readable")
@ -99,30 +108,26 @@ fun! tar#Browse(tarfile)
endif
let curlast= line("$")
if tarfile =~# '\.\(gz\|tgz\)$'
" call Decho("exe silent r! gzip -d -c '".tarfile."'| tar -".g:tar_browseoptions." - ")
exe "silent r! gzip -d -c '".tarfile."'| tar -".g:tar_browseoptions." - "
" call Decho("exe silent r! gzip -d -c ".g:tar_shq.tarfile.g:tar_shq."| ".g:tar_cmd." -".g:tar_browseoptions." - ")
exe "silent r! gzip -d -c ".g:tar_shq.tarfile.g:tar_shq."| ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif tarfile =~# '\.bz2$'
" call Decho("exe silent r! bzip2 -d -c '".tarfile."'| tar -".g:tar_browseoptions." - ")
exe "silent r! bzip2 -d -c '".tarfile."'| tar -".g:tar_browseoptions." - "
" call Decho("exe silent r! bzip2 -d -c ".g:tar_shq.tarfile.g:tar_shq."| ".g:tar_cmd." -".g:tar_browseoptions." - ")
exe "silent r! bzip2 -d -c ".g:tar_shq.tarfile.g:tar_shq."| ".g:tar_cmd." -".g:tar_browseoptions." - "
else
" call Decho("exe silent r! ".g:tar_cmd." -".g:tar_browseoptions." '".tarfile."'")
exe "silent r! ".g:tar_cmd." -".g:tar_browseoptions." '".tarfile."'"
" call Decho("exe silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".g:tar_shq.tarfile.g:tar_shq)
exe "silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".g:tar_shq.tarfile.g:tar_shq
endif
if v:shell_error != 0
redraw!
echohl WarningMsg | echo "***warning*** (tar#Browse) please check your g:tar_browseoptions<".g:tar_browseoptions.">"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" call Dret("tar#Browse : a:tarfile<".a:tarfile.">")
silent %d
let eikeep= &ei
set ei=BufReadCmd,FileReadCmd
exe "r ".a:tarfile
let &ei= eikeep
1d
return
endif
if line("$") == curlast || ( line("$") == (curlast + 1) && getline("$") =~? '\c\%(warning\|error\|inappropriate\|unrecognized\)')
if line("$") == curlast || ( line("$") == (curlast + 1) && getline("$") =~ '\c\%(warning\|error\|inappropriate\|unrecognized\)')
redraw!
echohl WarningMsg | echo "***warning*** (tar#Browse) ".a:tarfile." doesn't appear to be a tar file" | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
silent %d
let eikeep= &ei
set ei=BufReadCmd,FileReadCmd
@ -190,14 +195,14 @@ fun! tar#Read(fname,mode)
" call Decho("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."'"
" call Decho("exe silent r! gzip -d -c ".g:tar_shq.tarfile.g:tar_shq."| ".g:tar_cmd." -OPxf - '".fname."'")
exe "silent r! gzip -d -c ".g:tar_shq.tarfile.g:tar_shq."| ".g:tar_cmd." -".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."'"
" call Decho("exe silent r! bzip2 -d -c ".g:tar_shq.tarfile.g:tar_shq."| ".g:tar_cmd." -".g:tar_readoptions." - '".fname."'")
exe "silent r! bzip2 -d -c ".g:tar_shq.tarfile.g:tar_shq."| ".g:tar_cmd." -".g:tar_readoptions." - '".fname."'"
else
" call Decho("exe silent r! tar -".g:tar_readoptions." '".tarfile."' '".fname."'")
exe "silent r! ".g:tar_cmd." -".g:tar_readoptions." '".tarfile."' '".fname."'"
" call Decho("exe silent r! ".g:tar_cmd." -".g:tar_readoptions." ".g:tar_shq.tarfile.g:tar_shq." ".g:tar_shq.fname.g:tar_shq)
exe "silent r! ".g:tar_cmd." -".g:tar_readoptions." ".g:tar_shq.tarfile.g:tar_shq." ".g:tar_shq.fname.g:tar_shq
endif
let w:tarfile= a:fname
exe "file tarfile:".fname
@ -219,15 +224,17 @@ fun! tar#Write(fname)
" sanity checks
if !executable(g:tar_cmd)
redraw!
echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system'
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep
" call Dret("tar#Write")
return
endif
if !exists("*mkdir")
redraw!
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()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep
" call Dret("tar#Write")
return
@ -246,8 +253,9 @@ fun! tar#Write(fname)
try
exe "cd ".escape(tmpdir,' \')
catch /^Vim\%((\a\+)\)\=:E344/
redraw!
echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep
" call Dret("tar#Write")
return
@ -282,8 +290,9 @@ fun! tar#Write(fname)
endif
if v:shell_error != 0
redraw!
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()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
else
" call Decho("tarfile<".tarfile."> fname<".fname.">")
@ -309,16 +318,18 @@ fun! tar#Write(fname)
" call Decho("tar --delete -f '".tarfile."' '".fname."'")
call system("tar --delete -f '".tarfile."' '".fname."'")
if v:shell_error != 0
redraw!
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()
" 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
redraw!
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()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
elseif exists("compress")
" call Decho("call system(".compress.")")
call system(compress)

View File

@ -1,7 +1,7 @@
" vimball : construct a file containing both paths and files
" vimball.vim : construct a file containing both paths and files
" Author: Charles E. Campbell, Jr.
" Date: May 01, 2006
" Version: 13
" Date: Jan 03, 2007
" Version: 21
" GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim
" Copyright: (c) 2004-2006 by Charles E. Campbell, Jr.
" The VIM LICENSE applies to Vimball.vim, and Vimball.txt
@ -11,18 +11,26 @@
" ---------------------------------------------------------------------
" Load Once: {{{1
if &cp || exists("g:loaded_vimball")
if &cp || exists("g:loaded_vimball") || v:version < 700
finish
endif
let s:keepcpo = &cpo
let g:loaded_vimball = "v13"
let g:loaded_vimball = "v21"
set cpo&vim
" =====================================================================
" Constants: {{{1
if !exists("s:USAGE")
let s:USAGE = 0
let s:WARNING = 1
let s:ERROR = 2
endif
" =====================================================================
" Functions: {{{1
" ---------------------------------------------------------------------
" MkVimball: creates a vimball given a list of paths to files {{{2
" vimball#MkVimball: creates a vimball given a list of paths to files {{{2
" Vimball Format:
" path
" filesize
@ -30,11 +38,24 @@ set cpo&vim
" path
" filesize
" [file]
fun! vimball#MkVimball(line1,line2,writelevel,vimballname) range
" call Dfunc("MkVimball(line1=".a:line1." line2=".a:line2." writelevel=".a:writelevel." vimballname<".a:vimballname.">")
let vbname= substitute(a:vimballname,'\.[^.]*$','','e').'.vba'
fun! vimball#MkVimball(line1,line2,writelevel,...) range
" call Dfunc("MkVimball(line1=".a:line1." line2=".a:line2." writelevel=".a:writelevel." vimballname<".a:1.">) a:0=".a:0)
if a:1 =~ '.vim' || a:1 =~ '.txt'
let vbname= substitute(a:1,'\.\a\{3}$','.vba','')
else
let vbname= a:1
endif
if vbname !~ '\.vba$'
let vbname= vbname.'.vba'
endif
" call Decho("vbname<".vbname.">")
if a:1 =~ '[\/]'
call vimball#ShowMesg(s:ERROR,"(MkVimball) vimball name<".a:1."> should not include slashes")
" call Dret("MkVimball : vimball name<".a:1."> should not include slashes")
return
endif
if !a:writelevel && filereadable(vbname)
echohl Error | echoerr "(MkVimball) file<".vbname."> exists; use ! to insist" | echohl None
call vimball#ShowMesg(s:ERROR,"(MkVimball) file<".vbname."> exists; use ! to insist")
" call Dret("MkVimball : file<".vbname."> already exists; use ! to insist")
return
endif
@ -42,17 +63,13 @@ fun! vimball#MkVimball(line1,line2,writelevel,vimballname) range
" user option bypass
call s:SaveSettings()
" go to vim plugin home
for home in split(&rtp,',') + ['']
if isdirectory(home) | break | endif
endfor
if home == ""
let home= substitute(&rtp,',.*$','','')
if a:0 >= 2
" allow user to specify where to get the files
let home= expand(a:2)
else
" use first existing directory from rtp
let home= s:VimballHome()
endif
if (has("win32") || has("win95") || has("win64") || has("win16"))
let home= substitute(home,'/','\\','ge')
endif
" call Decho("home<".home.">")
" save current directory
let curdir = getcwd()
@ -68,7 +85,7 @@ fun! vimball#MkVimball(line1,line2,writelevel,vimballname) range
" call Decho("svfile<".svfile.">")
if !filereadable(svfile)
echohl Error | echo "unable to read file<".svfile.">" | echohl None
call vimball#ShowMesg(s:ERROR,"unable to read file<".svfile.">")
call s:ChgDir(curdir)
call s:RestoreSettings()
" call Dret("MkVimball")
@ -89,9 +106,9 @@ fun! vimball#MkVimball(line1,line2,writelevel,vimballname) range
call setline(1,'" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.')
call setline(2,'UseVimball')
call setline(3,'finish')
let lastline= 4
let lastline= line("$") + 1
endif
call setline(lastline ,svfile)
call setline(lastline ,substitute(svfile,'$',' [[[1',''))
call setline(lastline+1,0)
" write the file from the tab
@ -134,13 +151,13 @@ fun! vimball#MkVimball(line1,line2,writelevel,vimballname) range
endfun
" ---------------------------------------------------------------------
" Vimball: {{{2
fun! vimball#Vimball(really)
" call Dfunc("Vimball(really=".a:really.")")
" vimball#Vimball: extract and distribute contents from a vimball {{{2
fun! vimball#Vimball(really,...)
" call Dfunc("vimball#Vimball(really=".a:really.") a:0=".a:0)
if getline(1) !~ '^" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.$'
echoerr "(Vimball) The current file does not appear to be a Vimball!"
" call Dret("Vimball")
" call Dret("vimball#Vimball")
return
endif
@ -149,26 +166,27 @@ fun! vimball#Vimball(really)
let curtabnr = tabpagenr()
" set up vimball tab
" call Decho("setting up vimball tab")
tabnew
silent! file Vimball
let vbtabnr= tabpagenr()
let didhelp= ""
" go to vim plugin home
for home in split(&rtp,',') + ['']
if isdirectory(home) | break | endif
endfor
if home == ""
let home= substitute(&rtp,',.*$','','')
endif
if (has("win32") || has("win95") || has("win64") || has("win16"))
let home= substitute(home,'/','\\','ge')
if a:0 > 0
let home= expand(a:1)
else
let home= s:VimballHome()
endif
" call Decho("home<".home.">")
" save current directory
" save current directory and remove older same-named vimball, if any
let curdir = getcwd()
" call Decho("home<".home.">")
" call Decho("curdir<".curdir.">")
call s:ChgDir(home)
call vimball#RmVimball()
let linenr = 4
let filecnt = 0
@ -186,9 +204,12 @@ fun! vimball#Vimball(really)
exe "tabn ".curtabnr
" call Decho("linenr=".linenr." line$=".line("$"))
while 1 < linenr && linenr < line("$")
let fname = getline(linenr)
let fname = substitute(getline(linenr),'\t\[\[\[1$','','')
let fname = substitute(fname,'\\','/','g')
let fsize = getline(linenr+1)
let filecnt = filecnt + 1
" call Decho("fname<".fname."> fsize=".fsize." filecnt=".filecnt)
if a:really
echomsg "extracted <".fname.">: ".fsize." lines"
else
@ -197,16 +218,30 @@ fun! vimball#Vimball(really)
" call Decho("using L#".linenr.": will extract file<".fname.">")
" call Decho("using L#".(linenr+1).": fsize=".fsize)
" Allow AsNeeded/ directory to take place of plugin/ directory
" when AsNeeded/filename is filereadable
if fname =~ '\<plugin/'
let anfname= substitute(fname,'\<plugin/','AsNeeded/','')
if filereadable(anfname)
" call Decho("using anfname<".anfname."> instead of <".fname.">")
let fname= anfname
endif
endif
" make directories if they don't exist yet
" call Decho("making directories if they don't exist yet")
if a:really
let fnamebuf= fname
" call Decho("making directories if they don't exist yet (fname<".fname.">)")
let fnamebuf= substitute(fname,'\\','/','g')
let dirpath = substitute(home,'\\','/','g')
while fnamebuf =~ '/'
let dirname = home."/".substitute(fnamebuf,'/.*$','','e')
let fnamebuf = substitute(fnamebuf,'^.\{-}/\(.*\)$','\1','e')
let dirname = dirpath."/".substitute(fnamebuf,'/.*$','','')
let dirpath = dirname
let fnamebuf = substitute(fnamebuf,'^.\{-}/\(.*\)$','\1','')
" call Decho("dirname<".dirname.">")
if !isdirectory(dirname)
" call Decho("making <".dirname.">")
call mkdir(dirname)
call s:RecordInVar(home,"rmdir('".dirname."')")
endif
endwhile
endif
@ -233,6 +268,7 @@ fun! vimball#Vimball(really)
" call Decho("exe w! ".fnamepath)
exe "silent w! ".fnamepath
echo "wrote ".fnamepath
call s:RecordInVar(home,"call delete('".fnamepath."')")
endif
" return to tab with vimball
@ -242,7 +278,7 @@ fun! vimball#Vimball(really)
" set up help if its a doc/*.txt file
" call Decho("didhelp<".didhelp."> fname<".fname.">")
if a:really && didhelp == "" && fname =~ 'doc/[^/]\+\.txt$'
let didhelp= substitute(fname,'^\(.*\<doc\)[/\\][^.]*\.txt$','\1','e')
let didhelp= substitute(fname,'^\(.*\<doc\)[/\\][^.]*\.txt$','\1','')
" call Decho("didhelp<".didhelp.">")
endif
@ -255,7 +291,7 @@ fun! vimball#Vimball(really)
" set up help
" call Decho("about to set up help: didhelp<".didhelp.">")
if didhelp != ""
let htpath= escape(substitute(s:Path(home."/".didhelp,'"'),'"','','ge'),' ')
let htpath= escape(substitute(s:Path(home."/".didhelp,'"'),'"','','g'),' ')
" call Decho("exe helptags ".htpath)
exe "helptags ".htpath
echo "did helptags"
@ -267,6 +303,9 @@ fun! vimball#Vimball(really)
let filecnt= filecnt + 1
endwhile
" record actions in <.VimballRecord>
call s:RecordInFile(home)
" restore events, delete tab and buffer
exe "tabn ".vbtabnr
setlocal nomod bh=wipe
@ -275,7 +314,76 @@ fun! vimball#Vimball(really)
call s:RestoreSettings()
call s:ChgDir(curdir)
" call Dret("Vimball")
" call Dret("vimball#Vimball")
endfun
" ---------------------------------------------------------------------
" vimball#RmVimball: remove any files, remove any directories made by any {{{2
" previous vimball extraction based on a file of the current
" name.
" Usage: RmVimball (assume current file is a vimball; remove)
" RmVimball vimballname
fun! vimball#RmVimball(...)
" call Dfunc("vimball#RmVimball() a:0=".a:0)
if exists("g:vimball_norecord")
" call Dret("vimball#RmVimball : (g:vimball_norecord)")
return
endif
let eikeep= &ei
set ei=all
" call Decho("turned off all events")
if a:0 == 0
let curfile= '^'.expand("%:tr")
else
if a:1 =~ '[\/]'
call vimball#ShowMesg(s:USAGE,"RmVimball vimballname [path]")
" call Dret("vimball#RmVimball : suspect a:1<".a:1.">")
return
endif
let curfile= a:1
endif
if curfile !~ '.vba$'
let curfile= curfile.".vba: "
else
let curfile= curfile.": "
endif
if a:0 >= 2
let home= expand(a:2)
else
let home= s:VimballHome()
endif
let curdir = getcwd()
" call Decho("home <".home.">")
" call Decho("curfile<".curfile.">")
" call Decho("curdir <".curdir.">")
call s:ChgDir(home)
if filereadable(".VimballRecord")
" call Decho(".VimballRecord is readable")
" call Decho("curfile<".curfile.">")
keepalt keepjumps 1split
silent! keepalt keepjumps e .VimballRecord
let keepsrch= @/
if search(curfile,'cw')
let exestring= substitute(getline("."),curfile,'','')
" call Decho("exe ".exestring)
silent! keepalt keepjumps exe exestring
silent! keepalt keepjumps d
else
" call Decho("unable to find <".curfile."> in .VimballRecord")
endif
silent! keepalt keepjumps g/^\s*$/d
silent! keepalt keepjumps wq!
let @/= keepsrch
endif
call s:ChgDir(curdir)
" restoring events
" call Decho("restoring events")
let &ei= eikeep
" call Dret("vimball#RmVimball")
endfun
" ---------------------------------------------------------------------
@ -288,24 +396,59 @@ fun! vimball#Decompress(fname)
exe "!gunzip ".a:fname
let fname= substitute(a:fname,'\.gz$','','')
exe "e ".escape(fname,' \')
call vimball#ShowMesg("Source this file to extract it! (:so %)")
call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
elseif expand("%") =~ '.*\.bz2' && executable("bunzip2")
exe "!bunzip2 ".a:fname
let fname= substitute(a:fname,'\.bz2$','','')
exe "e ".escape(fname,' \')
call vimball#ShowMesg("Source this file to extract it! (:so %)")
call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
elseif expand("%") =~ '.*\.zip' && executable("unzip")
exe "!unzip ".a:fname
let fname= substitute(a:fname,'\.zip$','','')
exe "e ".escape(fname,' \')
call vimball#ShowMesg("Source this file to extract it! (:so %)")
call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
endif
set noma bt=nofile fmr=[[[,]]] fdm=marker
" call Dret("Decompress")
endfun
" ---------------------------------------------------------------------
" ChgDir: change directory (in spite of Windoze) {{{2
" vimball#ShowMesg: {{{2
fun! vimball#ShowMesg(level,msg)
" call Dfunc("vimball#ShowMesg(level=".a:level." msg<".a:msg.">)")
let rulerkeep = &ruler
let showcmdkeep = &showcmd
set noruler noshowcmd
redraw!
if &fo =~ '[ta]'
echomsg "***vimball*** " a:msg
else
if a:level == s:WARNING || a:level == s:USAGE
echohl WarningMsg
elseif a:level == s:ERROR
echohl Error
endif
echomsg "***vimball*** " a:msg
echohl None
endif
if a:level != s:USAGE
call inputsave()|let ok= input("Press <cr> to continue")|call inputrestore()
endif
let &ruler = rulerkeep
let &showcmd = showcmdkeep
" call Dret("vimball#ShowMesg")
endfun
" ---------------------------------------------------------------------
let &cpo= s:keepcpo
unlet s:keepcpo
" =====================================================================
" s:ChgDir: change directory (in spite of Windoze) {{{2
fun! s:ChgDir(newdir)
" call Dfunc("ChgDir(newdir<".a:newdir.">)")
if (has("win32") || has("win95") || has("win64") || has("win16"))
@ -317,11 +460,11 @@ fun! s:ChgDir(newdir)
endfun
" ---------------------------------------------------------------------
" Path: {{{2
" s:Path: prepend and append quotes, do escaping, as necessary {{{2
fun! s:Path(cmd,quote)
" call Dfunc("Path(cmd<".a:cmd."> quote<".a:quote.">)")
if (has("win32") || has("win95") || has("win64") || has("win16"))
let cmdpath= a:quote.substitute(a:cmd,'/','\\','ge').a:quote
let cmdpath= a:quote.substitute(a:cmd,'/','\\','g').a:quote
else
let cmdpath= a:quote.a:cmd.a:quote
endif
@ -333,16 +476,98 @@ fun! s:Path(cmd,quote)
endfun
" ---------------------------------------------------------------------
" vimball#ShowMesg: {{{2
fun! vimball#ShowMesg(msg)
" call Dfunc("vimball#ShowMesg(msg<".a:msg.">)")
let ich= 1
echohl WarningMsg | echo a:msg | echohl None
while ich < &ch
echo " "
let ich= ich + 1
endwhile
" call Dret("vimball#ShowMesg")
" s:RecordInVar: record a un-vimball command in the .VimballRecord file {{{2
fun! s:RecordInVar(home,cmd)
" call Dfunc("RecordInVar(home<".a:home."> cmd<".a:cmd.">)")
if a:cmd =~ '^rmdir'
" if !exists("s:recorddir")
" let s:recorddir= substitute(a:cmd,'^rmdir',"call s:Rmdir",'')
" else
" let s:recorddir= s:recorddir."|".substitute(a:cmd,'^rmdir',"call s:Rmdir",'')
" endif
" call Decho("recorddir=".s:recorddir)
elseif !exists("s:recordfile")
let s:recordfile= a:cmd
" call Decho("recordfile=".s:recordfile)
else
let s:recordfile= s:recordfile."|".a:cmd
" call Decho("recordfile=".s:recordfile)
endif
" call Dret("RecordInVar")
endfun
" ---------------------------------------------------------------------
" s:RecordInFile: {{{2
fun! s:RecordInFile(home)
" call Dfunc("RecordInFile()")
if exists("g:vimball_norecord")
" call Dret("RecordInFile : (g:vimball_norecord)")
return
endif
if exists("s:recordfile") || exists("s:recorddir")
let curdir= getcwd()
call s:ChgDir(a:home)
keepalt keepjumps 1split
let cmd= expand("%:tr").": "
silent! keepalt keepjumps e .VimballRecord
$
if exists("s:recordfile") && exists("s:recorddir")
let cmd= cmd.s:recordfile."|".s:recorddir
elseif exists("s:recorddir")
let cmd= cmd.s:recorddir
elseif exists("s:recordfile")
let cmd= cmd.s:recordfile
else
" call Dret("RecordInFile")
return
endif
keepalt keepjumps put=cmd
silent! keepalt keepjumps g/^\s*$/d
silent! keepalt keepjumps wq!
call s:ChgDir(curdir)
if exists("s:recorddir") |unlet s:recorddir |endif
if exists("s:recordfile")|unlet s:recordfile|endif
else
" call Decho("s:record[file|dir] doesn't exist")
endif
" call Dret("RecordInFile")
endfun
" ---------------------------------------------------------------------
" s:Rmdir: {{{2
"fun! s:Rmdir(dirname)
"" call Dfunc("s:Rmdir(dirname<".a:dirname.">)")
" if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$'
" call system("del ".a:dirname)
" else
" call system("rmdir ".a:dirname)
" endif
"" call Dret("s:Rmdir")
"endfun
" ---------------------------------------------------------------------
" s:VimballHome: determine/get home directory path (usually from rtp) {{{2
fun! s:VimballHome()
" call Dfunc("VimballHome()")
if exists("g:vimball_home")
let home= g:vimball_home
else
" go to vim plugin home
for home in split(&rtp,',') + ['']
if isdirectory(home) && filewritable(home) | break | endif
endfor
if home == ""
" just pick the first directory
let home= substitute(&rtp,',.*$','','')
endif
if (has("win32") || has("win95") || has("win64") || has("win16"))
let home= substitute(home,'/','\\','g')
endif
endif
" call Dret("VimballHome <".home.">")
return home
endfun
" ---------------------------------------------------------------------
@ -360,10 +585,11 @@ fun! s:SaveSettings()
let s:ickeep = &ic
let s:repkeep = &report
let s:vekeep = &ve
let s:lzkeep = &lz
if exists("&acd")
set ei=all ve=all noacd nofen noic report=999 nohid
set ei=all ve=all noacd nofen noic report=999 nohid bt= ma lz
else
set ei=all ve=all nofen noic report=999 nohid
set ei=all ve=all nofen noic report=999 nohid bt= ma lz
endif
" call Dret("SaveSettings")
endfun
@ -376,28 +602,27 @@ fun! s:RestoreSettings()
if exists("&acd")
let &acd = s:acdkeep
endif
let &ei = s:eikeep
let &fen = s:fenkeep
let &hidden = s:hidkeep
let &ic = s:ickeep
let &lz = s:lzkeep
let &report = s:repkeep
let &ve = s:vekeep
let &ei = s:eikeep
if s:makeep[0] != 0
" restore mark a
" call Decho("restore mark-a: makeep=".string(makeep))
call setpos("'a",s:makeep)
endif
if exists("&acd")
unlet s:regakeep s:acdkeep s:eikeep s:fenkeep s:hidkeep s:ickeep s:repkeep s:vekeep s:makeep
unlet s:regakeep s:acdkeep s:eikeep s:fenkeep s:hidkeep s:ickeep s:repkeep s:vekeep s:makeep s:lzkeep
else
unlet s:regakeep s:eikeep s:fenkeep s:hidkeep s:ickeep s:repkeep s:vekeep s:makeep
unlet s:regakeep s:eikeep s:fenkeep s:hidkeep s:ickeep s:repkeep s:vekeep s:makeep s:lzkeep
endif
set bt=nofile noma
" call Dret("RestoreSettings")
endfun
" ---------------------------------------------------------------------
let &cpo= s:keepcpo
unlet s:keepcpo
" =====================================================================
" Modelines: {{{1
" vim: fdm=marker

View File

@ -1,7 +1,12 @@
" Vim completion script
" Language: XML
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2006 Apr 30
" Last Change: 2006 Jul 18
" Version: 1.8
"
" Changelog:
" 1.8 - 2006 Jul 18
" - allow for closing of xml tags even when data file isn't available
" This function will create Dictionary with users namespace strings and values
" canonical (system) names of data files. Names should be lowercase,
@ -80,7 +85,7 @@ function! xmlcomplete#CompleteTags(findstart, base)
let context_line = getline(curline-i)
if context_line =~ '<[^>]*$'
" Yep, this is this line
let context_lines = getline(curline-i, curline)
let context_lines = getline(curline-i, curline-1) + [b:compl_context]
let b:compl_context = join(context_lines, ' ')
break
elseif context_line =~ '>[^<]*$' || i == curline
@ -106,10 +111,6 @@ function! xmlcomplete#CompleteTags(findstart, base)
return start
else
" There is no connection 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 = []
@ -119,6 +120,17 @@ function! xmlcomplete#CompleteTags(findstart, base)
endif
let context = matchstr(b:compl_context, '^<\zs.*')
unlet! b:compl_context
" There is no connection of namespace and data file.
if !exists("g:xmldata_connection") || g:xmldata_connection == {}
" There is still possibility we may do something - eg. 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.">"]
else
return []
endif
endif
" Make entities completion
if exists("b:entitiescompl")

View File

@ -1,8 +1,8 @@
" zip.vim: Handles browsing zipfiles
" AUTOLOAD PORTION
" Date: May 01, 2006
" Version: 9
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" Date: Sep 29, 2006
" Version: 12
" Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" 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,
@ -15,15 +15,28 @@
" of this software.
" ---------------------------------------------------------------------
" Initialization: {{{1
" Load Once: {{{1
let s:keepcpo= &cpo
set cpo&vim
if exists("g:loaded_zip")
if &cp || exists("g:loaded_zip") || v:version < 700
finish
endif
let g:loaded_zip = "v9"
let g:loaded_zip = "v12"
let s:zipfile_escape = ' ?&;\'
let s:ERROR = 2
let s:WARNING = 1
let s:NOTE = 0
" ---------------------------------------------------------------------
" Global Values: {{{1
if !exists("g:zip_shq")
if has("unix")
let g:zip_shq= "'"
else
let g:zip_shq= '"'
endif
endif
" ----------------
" Functions: {{{1
@ -38,8 +51,9 @@ fun! zip#Browse(zipfile)
" sanity checks
if !executable("unzip")
redraw!
echohl Error | echo "***error*** (zip#Browse) unzip not available on your system"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep
" call Dret("zip#Browse")
return
@ -47,8 +61,9 @@ fun! zip#Browse(zipfile)
if !filereadable(a:zipfile)
if a:zipfile !~# '^\a\+://'
" if its an url, don't complain, let url-handlers such as vim do its thing
redraw!
echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif
let &report= repkeep
" call Dret("zip#Browse : file<".a:zipfile."> not readable")
@ -75,11 +90,12 @@ fun! zip#Browse(zipfile)
0d
$
" call Decho("exe silent r! unzip -l '".a:zipfile."'")
exe "silent r! unzip -l '".a:zipfile."'"
" call Decho("exe silent r! unzip -l ".s:QuoteFileDir(a:zipfile))
exe "silent r! unzip -l ".s:QuoteFileDir(a:zipfile)
if v:shell_error != 0
redraw!
echohl WarningMsg | echo "***warning*** (zip#Browse) ".a:zipfile." is not a zip file" | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
silent %d
let eikeep= &ei
set ei=BufReadCmd,FileReadCmd
@ -121,8 +137,9 @@ fun! s:ZipBrowseSelect()
return
endif
if fname =~ '/$'
redraw!
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()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep
" call Dret("ZipBrowseSelect")
return
@ -131,7 +148,7 @@ fun! s:ZipBrowseSelect()
" call Decho("fname<".fname.">")
" get zipfile to the new-window
let zipfile= substitute(w:zipfile,'.zip$','','e')
let zipfile = w:zipfile
let curfile= expand("%")
" call Decho("zipfile<".zipfile.">")
" call Decho("curfile<".curfile.">")
@ -160,12 +177,15 @@ fun! zip#Read(fname,mode)
else
let zipfile = substitute(a:fname,'^.\{-}zipfile:\(.\{-}\)::[^\\].*$','\1','')
let fname = substitute(a:fname,'^.\{-}zipfile:.\{-}::\([^\\].*\)$','\1','')
" TODO Needs to predicated to using InfoZIP's unzip on Windows
let fname = substitute(fname, '[', '[[]', 'g')
endif
" call Decho("zipfile<".zipfile.">")
" call Decho("fname <".fname.">")
" call Decho("exe r! unzip -p '".zipfile."' '".fname."'")
exe "silent r! unzip -p '".zipfile."' '".fname."'"
" call Decho("exe r! unzip -p ".s:QuoteFileDir(zipfile)." ".s:QuoteFileDir(fname))
exe "silent r! unzip -p ".s:QuoteFileDir(zipfile)." ".s:QuoteFileDir(fname)
" cleanup
0d
@ -184,15 +204,17 @@ fun! zip#Write(fname)
" sanity checks
if !executable("zip")
redraw!
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()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep
" call Dret("zip#Write")
return
endif
if !exists("*mkdir")
redraw!
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()
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep
" call Dret("zip#Write")
return
@ -208,15 +230,11 @@ fun! zip#Write(fname)
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()
if s:ChgDir(tmpdir,s:ERROR,"(zip#Write) cannot cd to temporary directory")
let &report= repkeep
" call Dret("zip#Write")
return
endtry
endif
" call Decho("current directory now: ".getcwd())
" place temporary files under .../_ZIPVIM_/
@ -255,21 +273,27 @@ fun! zip#Write(fname)
let zipfile = substitute(system("cygpath ".zipfile),'\n','','e')
endif
" call Decho("zip -u '".zipfile.".zip' '".fname."'")
call system("zip -u '".zipfile.".zip' '".fname."'")
" TODO Needs to predicated to using InfoZIP's unzip
if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$'
let fname = substitute(fname, '[', '[[]', 'g')
endif
" call Decho("zip -u ".s:QuoteFileDir(zipfile)." ".s:QuoteFileDir(fname))
call system("zip -u ".s:QuoteFileDir(zipfile)." ".s:QuoteFileDir(fname))
if v:shell_error != 0
redraw!
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()
" 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.">")
" call Decho("handle writing <".zipfile."> across network as <".netzipfile.">")
1split|enew
let binkeep= &binary
let eikeep = &ei
set binary ei=all
exe "e! ".zipfile.".zip"
exe "e! ".zipfile
call netrw#NetWrite(netzipfile)
let &ei = eikeep
let &binary = binkeep
@ -280,25 +304,61 @@ fun! zip#Write(fname)
" cleanup and restore current directory
cd ..
call s:Rmdir("_ZIPVIM_")
exe "cd ".escape(curdir,' \')
call s:ChgDir(curdir,s:WARNING,"(zip#Write) unable to return to ".curdir."!")
call s:Rmdir(tmpdir)
setlocal nomod
let &report= repkeep
" call Dret("zip#Write")
endfun
" ---------------------------------------------------------------------
" QuoteFileDir: {{{2
fun! s:QuoteFileDir(fname)
" call Dfunc("QuoteFileDir(fname<".a:fname.">)")
" call Dret("QuoteFileDir")
return g:zip_shq.a:fname.g:zip_shq
endfun
" ---------------------------------------------------------------------
" ChgDir: {{{2
fun! s:ChgDir(newdir,errlvl,errmsg)
" call Dfunc("ChgDir(newdir<".a:newdir."> errlvl=".a:errlvl." errmsg<".a:errmsg.">)")
if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$'
let newdir= escape(a:newdir,' ')
else
let newdir= escape(a:newdir,'\ ')
endif
try
exe "cd ".newdir
catch /^Vim\%((\a\+)\)\=:E344/
redraw!
if a:errlvl == s:NOTE
echo "***note*** ".a:errmsg
elseif a:errlvl == s:WARNING
echohl WarningMsg | echo "***warning*** ".a:errmsg | echohl NONE
elseif a:errlvl == s:ERROR
echohl Error | echo "***error*** ".a:errmsg | echohl NONE
endif
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" call Dret("ChgDir 1")
return 1
endtry
" call Dret("ChgDir 0")
return 0
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)
if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$'
call system("rmdir /S/Q ".s:QuoteFileDir(a:fname))
else
call system("del /S ".a:fname)
endif
call system("/bin/rm -rf ".s:QuoteFileDir(a:fname))
endif
" call Dret("Rmdir")
endfun

View File

@ -2,9 +2,9 @@
" vim: tw=0 ts=4 sw=4
" Vim color file
" Maintainer: Steven Vertigan <steven@vertigan.wattle.id.au>
" Last Change: 2003 May 11
" Revision #4: Support for new "Underline" group. Removed superfluous html
" formatting.
" Last Change: 2006 Sep 23
" Revision #5: Switch main text from white to yellow for easier contrast,
" fixed some problems with terminal backgrounds.
set background=dark
hi clear
@ -12,66 +12,44 @@ if exists("syntax_on")
syntax reset
endif
let g:colors_name = "blue"
hi Normal guifg=white guibg=darkBlue
hi Normal ctermfg=white ctermbg=darkBlue
hi Normal guifg=yellow guibg=darkBlue ctermfg=yellow ctermbg=darkBlue
hi NonText guifg=magenta ctermfg=lightMagenta
hi comment guifg=gray gui=bold
hi comment ctermfg=gray
hi comment guifg=gray ctermfg=gray ctermbg=darkBlue gui=bold
hi constant guifg=cyan ctermfg=cyan
hi identifier guifg=gray ctermfg=gray
hi statement guifg=yellow gui=none ctermfg=yellow
hi identifier guifg=gray ctermfg=red
hi statement guifg=white ctermfg=white ctermbg=darkBlue gui=none
hi preproc guifg=green ctermfg=green
hi type guifg=orange ctermfg=darkYellow
hi special guifg=magenta ctermfg=lightMagenta
hi Underlined guifg=cyan ctermfg=cyan
hi Underlined gui=underline cterm=underline
hi type guifg=orange ctermfg=lightRed ctermbg=darkBlue
hi special guifg=magenta ctermfg=lightMagenta ctermbg=darkBlue
hi Underlined guifg=cyan ctermfg=cyan gui=underline cterm=underline
hi label guifg=yellow ctermfg=yellow
hi operator guifg=orange gui=bold ctermfg=lightRed ctermbg=darkBlue
hi ErrorMsg guifg=orange guibg=darkBlue
hi ErrorMsg ctermfg=lightRed
hi WarningMsg guifg=cyan guibg=darkBlue gui=bold
hi WarningMsg ctermfg=cyan
hi ModeMsg guifg=yellow gui=NONE
hi ModeMsg ctermfg=yellow
hi MoreMsg guifg=yellow gui=NONE
hi MoreMsg ctermfg=yellow
hi Error guifg=red guibg=darkBlue gui=underline
hi Error ctermfg=red
hi ErrorMsg guifg=orange guibg=darkBlue ctermfg=lightRed
hi WarningMsg guifg=cyan guibg=darkBlue ctermfg=cyan gui=bold
hi ModeMsg guifg=yellow gui=NONE ctermfg=yellow
hi MoreMsg guifg=yellow gui=NONE ctermfg=yellow
hi Error guifg=red guibg=darkBlue gui=underline ctermfg=red
hi Todo guifg=black guibg=orange
hi Todo ctermfg=black ctermbg=darkYellow
hi Cursor guifg=black guibg=white
hi Cursor ctermfg=black ctermbg=white
hi Search guifg=black guibg=orange
hi Search ctermfg=black ctermbg=darkYellow
hi IncSearch guifg=black guibg=yellow
hi IncSearch ctermfg=black ctermbg=darkYellow
hi LineNr guifg=pink ctermfg=lightMagenta
hi Todo guifg=black guibg=orange ctermfg=black ctermbg=darkYellow
hi Cursor guifg=black guibg=white ctermfg=black ctermbg=white
hi Search guifg=black guibg=orange ctermfg=black ctermbg=darkYellow
hi IncSearch guifg=black guibg=yellow ctermfg=black ctermbg=darkYellow
hi LineNr guifg=cyan ctermfg=cyan
hi title guifg=white gui=bold cterm=bold
hi StatusLineNC gui=NONE guifg=black guibg=blue
hi StatusLineNC ctermfg=black ctermbg=blue
hi StatusLine gui=bold guifg=cyan guibg=blue
hi StatusLine ctermfg=cyan ctermbg=blue
hi StatusLineNC gui=NONE guifg=black guibg=blue ctermfg=black ctermbg=blue
hi StatusLine gui=bold guifg=cyan guibg=blue ctermfg=cyan ctermbg=blue
hi VertSplit gui=none guifg=blue guibg=blue ctermfg=blue ctermbg=blue
hi label guifg=yellow ctermfg=yellow
hi operator guifg=orange gui=bold ctermfg=darkYellow
hi clear Visual
hi Visual term=reverse
hi Visual ctermfg=black ctermbg=darkCyan
hi Visual guifg=black guibg=darkCyan
hi Visual term=reverse ctermfg=black ctermbg=darkCyan guifg=black guibg=darkCyan
hi DiffChange guibg=darkGreen guifg=black
hi DiffChange ctermbg=darkGreen ctermfg=black
hi DiffText guibg=olivedrab guifg=black
hi DiffText ctermbg=lightGreen ctermfg=black
hi DiffAdd guibg=slateblue guifg=black
hi DiffAdd ctermbg=blue ctermfg=black
hi DiffDelete guibg=coral guifg=black
hi DiffDelete ctermbg=cyan ctermfg=black
hi DiffChange guibg=darkGreen guifg=black ctermbg=darkGreen ctermfg=black
hi DiffText guibg=olivedrab guifg=black ctermbg=lightGreen ctermfg=black
hi DiffAdd guibg=slateblue guifg=black ctermbg=blue ctermfg=black
hi DiffDelete guibg=coral guifg=black ctermbg=cyan ctermfg=black
hi Folded guibg=orange guifg=black
hi Folded ctermbg=yellow ctermfg=black
hi FoldColumn guibg=gray30 guifg=black
hi FoldColumn ctermbg=gray ctermfg=black
hi Folded guibg=orange guifg=black ctermbg=yellow ctermfg=black
hi FoldColumn guibg=gray30 guifg=black ctermbg=gray ctermfg=black
hi cIf0 guifg=gray ctermfg=gray

View File

@ -2,7 +2,7 @@
" vim: tw=0 ts=4 sw=4
" Vim color file
" Maintainer: Ron Aaron <ron@ronware.org>
" Last Change: 2006 Mar 26
" Last Change: 2006 Dec 10
hi clear
set background=dark
@ -13,10 +13,10 @@ let g:colors_name = "koehler"
hi Normal guifg=white guibg=black
hi Scrollbar guifg=darkcyan guibg=cyan
hi Menu guifg=black guibg=cyan
hi SpecialKey term=bold cterm=bold ctermfg=darkred guifg=Blue
hi NonText term=bold cterm=bold ctermfg=darkred gui=bold guifg=Blue
hi Directory term=bold cterm=bold ctermfg=brown guifg=Blue
hi ErrorMsg term=standout cterm=bold ctermfg=grey ctermbg=blue guifg=White guibg=Red
hi SpecialKey term=bold cterm=bold ctermfg=darkred guifg=#cc0000
hi NonText term=bold cterm=bold ctermfg=darkred gui=bold guifg=#cc0000
hi Directory term=bold cterm=bold ctermfg=brown guifg=#cc8000
hi ErrorMsg term=standout cterm=bold ctermfg=grey ctermbg=red guifg=White guibg=Red
hi Search term=reverse ctermfg=white ctermbg=red guifg=white guibg=Red
hi MoreMsg term=bold cterm=bold ctermfg=darkgreen gui=bold guifg=SeaGreen
hi ModeMsg term=bold cterm=bold gui=bold guifg=White guibg=Blue
@ -26,20 +26,20 @@ hi StatusLine term=bold,reverse cterm=bold ctermfg=lightblue ctermbg=white gu
hi StatusLineNC term=reverse ctermfg=white ctermbg=lightblue guifg=white guibg=blue
hi Title term=bold cterm=bold ctermfg=darkmagenta gui=bold guifg=Magenta
hi Visual term=reverse cterm=reverse gui=reverse
hi WarningMsg term=standout cterm=bold ctermfg=darkblue guifg=Red
hi WarningMsg term=standout cterm=bold ctermfg=darkred guifg=Red
hi Cursor guifg=bg guibg=Green
hi Comment term=bold cterm=bold ctermfg=cyan guifg=#80a0ff
hi Constant term=underline cterm=bold ctermfg=magenta guifg=#ffa0a0
hi Special term=bold cterm=bold ctermfg=red guifg=Orange
hi Identifier term=underline ctermfg=brown guifg=#40ffff
hi Statement term=bold cterm=bold ctermfg=yellow gui=bold guifg=#ffff60
hi PreProc term=underline ctermfg=darkblue guifg=#ff80ff
hi PreProc term=underline ctermfg=darkmagenta guifg=#ff80ff
hi Type term=underline cterm=bold ctermfg=lightgreen gui=bold guifg=#60ff60
hi Error term=reverse ctermfg=darkcyan ctermbg=black guifg=Red guibg=Black
hi Todo term=standout ctermfg=black ctermbg=darkcyan guifg=Blue guibg=Yellow
hi CursorLine term=underline guibg=#555555
hi CursorColumn term=underline guibg=#555555
hi MatchParen term=reverse guibg=Blue
hi CursorLine term=underline guibg=#555555 cterm=underline
hi CursorColumn term=underline guibg=#555555 cterm=underline
hi MatchParen term=reverse ctermfg=blue guibg=Blue
hi TabLine term=bold,reverse cterm=bold ctermfg=lightblue ctermbg=white gui=bold guifg=blue guibg=white
hi TabLineFill term=bold,reverse cterm=bold ctermfg=lightblue ctermbg=white gui=bold guifg=blue guibg=white
hi TabLineSel term=reverse ctermfg=white ctermbg=lightblue guifg=white guibg=blue

View File

@ -1,6 +1,6 @@
" Vim color file
" Maintainer: Thorsten Maerz <info@netztorte.de>
" Last Change: 2001 Jul 23
" Last Change: 2006 Dec 07
" grey on black
" optimized for TFT panels
@ -18,7 +18,7 @@ let g:colors_name = "torte"
" GUI
highlight Normal guifg=Grey80 guibg=Black
highlight Search guifg=Black guibg=Red gui=bold
highlight Visual guifg=Grey25 gui=bold
highlight Visual guifg=#404040 gui=bold
highlight Cursor guifg=Black guibg=Green gui=bold
highlight Special guifg=Orange
highlight Comment guifg=#80a0ff
@ -42,7 +42,7 @@ if has("unix")
if v:version<600
highlight Normal ctermfg=Grey ctermbg=Black cterm=NONE guifg=Grey80 guibg=Black gui=NONE
highlight Search ctermfg=Black ctermbg=Red cterm=bold guifg=Black guibg=Red gui=bold
highlight Visual ctermfg=Black ctermbg=yellow cterm=bold guifg=Grey25 gui=bold
highlight Visual ctermfg=Black ctermbg=yellow cterm=bold guifg=#404040 gui=bold
highlight Special ctermfg=LightBlue cterm=NONE guifg=LightBlue gui=NONE
highlight Comment ctermfg=Cyan cterm=NONE guifg=LightBlue gui=NONE
endif

View File

@ -0,0 +1,54 @@
"------------------------------------------------------------------------------
" Description: Vim Ada/Dec Ada compiler file
" Language: Ada (Dec Ada)
" $Id$
" Copyright: Copyright (C) 2006 Martin Krischik
" Maintainer: Martin Krischik
" $Author$
" $Date$
" Version: 4.2
" $Revision$
" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/compiler/decada.vim $
" History: 21.07.2006 MK New Dec Ada
" 15.10.2006 MK Bram's suggestion for runtime integration
" Help Page: compiler-decada
"------------------------------------------------------------------------------
if (exists("current_compiler") &&
\ current_compiler == "decada") ||
\ version < 700
finish
endif
let current_compiler = "decada"
if !exists("g:decada")
let g:decada = decada#New ()
endif
if exists(":CompilerSet") != 2
"
" plugin loaded by other means then the "compiler" command
"
command -nargs=* CompilerSet setlocal <args>
endif
call g:decada.Set_Session ()
execute "CompilerSet makeprg=" . escape (g:decada.Make_Command, ' ')
execute "CompilerSet errorformat=" . escape (g:decada.Error_Format, ' ')
call ada#Map_Menu (
\'Dec Ada.Build',
\'<F7>',
\'call decada.Make ()')
finish " 1}}}
"------------------------------------------------------------------------------
" Copyright (C) 2006 Martin Krischik
"
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
"------------------------------------------------------------------------------
" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
" vim: foldmethod=marker

71
runtime/compiler/gnat.vim Normal file
View File

@ -0,0 +1,71 @@
"------------------------------------------------------------------------------
" Description: Vim Ada/GNAT compiler file
" Language: Ada (GNAT)
" $Id$
" Copyright: Copyright (C) 2006 Martin Krischik
" Maintainer: Martin Krischik
" $Author$
" $Date$
" Version: 4.2
" $Revision$
" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/compiler/gnat.vim $
" History: 24.05.2006 MK Unified Headers
" 16.07.2006 MK Ada-Mode as vim-ball
" 15.10.2006 MK Bram's suggestion for runtime integration
" Help Page: compiler-gnat
"------------------------------------------------------------------------------
if (exists("current_compiler") &&
\ current_compiler == "gnat") ||
\ version < 700
finish
endif
let current_compiler = "gnat"
if !exists("g:gnat")
let g:gnat = gnat#New ()
call ada#Map_Menu (
\ 'GNAT.Build',
\ '<F7>',
\ 'call gnat.Make ()')
call ada#Map_Menu (
\ 'GNAT.Pretty Print',
\ ':GnatPretty',
\ 'call gnat.Pretty ()')
call ada#Map_Menu (
\ 'GNAT.Tags',
\ ':GnatTags',
\ 'call gnat.Tags ()')
call ada#Map_Menu (
\ 'GNAT.Find',
\ ':GnatFind',
\ 'call gnat.Find ()')
call ada#Map_Menu (
\ 'GNAT.Set Projectfile\.\.\.',
\ ':SetProject',
\ 'call gnat.Set_Project_File ()')
endif
if exists(":CompilerSet") != 2
"
" plugin loaded by other means then the "compiler" command
"
command -nargs=* CompilerSet setlocal <args>
endif
call g:gnat.Set_Session ()
execute "CompilerSet makeprg=" . escape (g:gnat.Get_Command('Make'), ' ')
execute "CompilerSet errorformat=" . escape (g:gnat.Error_Format, ' ')
finish " 1}}}
"------------------------------------------------------------------------------
" Copyright (C) 2006 Martin Krischik
"
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
"------------------------------------------------------------------------------
" vim: textwidth=0 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
" vim: foldmethod=marker

24
runtime/compiler/mcs.vim Normal file
View File

@ -0,0 +1,24 @@
" Vim compiler file
" Compiler: Mono C# Compiler
" Maintainer: Jarek Sobiecki <harijari@go2.pl>
" Latest Revision: 2006-06-18
if exists("current_compiler")
finish
endif
let current_compiler = "mcs"
let s:cpo_save = &cpo
set cpo-=C
setlocal errorformat=
\%E%f(%l\\,%c):\ error\ CS%n:%m,
\%W%f(%l\\,%c):\ warning\ CS%n:%m,
\%E%>syntax\ error\\,%m,%Z%f(%l\\,%c):\ error\ CS%n:%m,
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
\%DMaking\ %*\\a\ in\ %f,
\%G-%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -14,6 +14,7 @@ VIMEXE = vim
include ../../src/auto/config.mk
DOCS = \
ada.txt \
arabic.txt \
autocmd.txt \
change.txt \
@ -28,7 +29,6 @@ DOCS = \
farsi.txt \
filetype.txt \
fold.txt \
getscript.txt \
gui.txt \
gui_w16.txt \
gui_w32.txt \
@ -70,6 +70,7 @@ DOCS = \
os_vms.txt \
os_win32.txt \
pattern.txt \
pi_getscript.txt \
pi_gzip.txt \
pi_netrw.txt \
pi_paren.txt \
@ -144,6 +145,7 @@ DOCS = \
workshop.txt
HTMLS = \
ada.html \
arabic.html \
autocmd.html \
change.html \
@ -158,7 +160,6 @@ HTMLS = \
farsi.html \
filetype.html \
fold.html \
getscript.html \
gui.html \
gui_w16.html \
gui_w32.html \
@ -200,6 +201,7 @@ HTMLS = \
os_vms.html \
os_win32.html \
pattern.html \
pi_getscript.html \
pi_gzip.html \
pi_netrw.html \
pi_paren.html \
@ -224,8 +226,8 @@ HTMLS = \
sql.html \
syntax.html \
tabpage.html \
tagsrch.html \
tags.html \
tagsrch.html \
term.html \
tips.html \
todo.html \

515
runtime/doc/ada.txt Normal file
View File

@ -0,0 +1,515 @@
*ada.txt* For Vim version 7.1a. Last change: 2006 Nov 12
ADA FILE TYPE PLUG-INS REFERENCE MANUAL~
ADA *ada.vim*
1. Syntax Highlighting |ft-ada-syntax|
2. Plug-in |ft-ada-plugin|
3. Omni Completion |ft-ada-omni|
3.1 Omni Completion with "gnat xref" |gnat-xref|
3.2 Omni Completion with "ctags" |ada-ctags|
4. Compiler Support |ada-compiler|
4.1 GNAT |compiler-gnat|
4.1 Dec Ada |compiler-decada|
5. References |ada-reference|
5.1 Options |ft-ada-options|
5.2 Functions |ft-ada-functions|
5.3 Commands |ft-ada-commands|
5.4 Variables |ft-ada-variables|
5.5 Constants |ft-ada-constants|
8. Extra Plug-ins |ada-extra-plugins|
==============================================================================
1. Syntax Highlighting ~
*ft-ada-syntax*
This mode is designed for the 2005 edition of Ada ("Ada 2005"), which includes
support for objected-programming, protected types, and so on. It handles code
written for the original Ada language ("Ada83", "Ada87", "Ada95") as well,
though code which uses Ada 2005-only keywords will be wrongly colored (such
code should be fixed anyway). For more information about Ada, see
http://www.adapower.com.
The Ada mode handles a number of situations cleanly.
For example, it knows that the "-" in "-5" is a number, but the same character
in "A-5" is an operator. Normally, a "with" or "use" clause referencing
another compilation unit is coloured the same way as C's "#include" is coloured.
If you have "Conditional" or "Repeat" groups coloured differently, then "end
if" and "end loop" will be coloured as part of those respective groups.
You can set these to different colours using vim's "highlight" command (e.g.,
to change how loops are displayed, enter the command ":hi Repeat" followed by
the colour specification; on simple terminals the colour specification
ctermfg=White often shows well).
There are several options you can select in this Ada mode. See|ft-ada-options|
for a complete list.
To enable them, assign a value to the option. For example, to turn one on:
>
> let g:ada_standard_types = 1
>
To disable them use ":unlet". Example:
>
> unlet g:ada_standard_types
You can just use ":" and type these into the command line to set these
temporarily before loading an Ada file. You can make these option settings
permanent by adding the "let" command(s), without a colon, to your "~/.vimrc"
file.
Even on a slow (90Mhz) PC this mode works quickly, but if you find the
performance unacceptable, turn on |g:ada_withuse_ordinary|.
Syntax folding instructions (|fold-syntax|) are added when |g:ada_folding| is
set.
==============================================================================
2. File type Plug-in ~
*ft-ada-indent* *ft-ada-plugin*
The Ada plug-in provides support for:
- auto indenting (|indent.txt|)
- insert completion (|i_CTRL-N|)
- user completion (|i_CTRL-X_CTRL-U|)
- tag searches (|tagsrch.txt|)
- Quick Fix (|quickfix.txt|)
- backspace handling (|'backspace'|)
- comment handling (|'comments'|, |'commentstring'|)
The plug-in only activates the features of the Ada mode whenever an Ada
files is opened and add adds Ada related entries to the main and pop-up menu.
==============================================================================
3. Omni Completion ~
*ft-ada-omni*
The Ada omni-completions (|i_CTRL-X_CTRL-O|) uses tags database created either
by "gnat xref -v" or the "exuberant Ctags (http://ctags.sourceforge.net). The
complete function will automatically detect which tool was used to create the
tags file.
------------------------------------------------------------------------------
3.1 Omni Completion with "gnat xref" ~
*gnat-xref*
GNAT XREF uses the compiler internal informations (ali-files) to produce the
tags file. This has the advantage to be 100% correct and the option of deep
nested analysis. However the code must compile, the generator is quite
slow and the created tags file contains only the basic Ctags informations for
each entry - not enough for some of the more advanced Vim code browser
plug-ins.
NOTE: "gnat xref -v" is very tricky to use as it has almost no diagnostic
output - If nothing is printed then usually the parameters are wrong.
Here some important tips:
1) You need to compile your code first and use the "-aO" option to point to
your .ali files.
2) "gnat xref -v ../Include/adacl.ads" won't work - use the "gnat xref -v
-aI../Include adacl.ads" instead.
3) "gnat xref -v -aI../Include *.ad?" won't work - use "cd ../Include" and
then "gnat xref -v *.ad?"
4) Project manager support is completely broken - don't even try "gnat xref
-Padacl.gpr".
5) VIM is faster when the tags file is sorted - use "sort --unique
--ignore-case --output=tags tags" .
6) Remember to insert "!_TAG_FILE_SORTED 2 %sort ui" as first line to mark
the file assorted.
------------------------------------------------------------------------------
3.2 Omni Completion with "ctags"~
*ada-ctags*
Exuberant Ctags uses it's own multi-language code parser. The parser is quite
fast, produces a lot of extra informations (hence the name "Exuberant Ctags")
and can run on files which currently do not compile.
There are also lots of other Vim-tools which use exuberant Ctags.
You will need to install a version of the Exuberant Ctags which has Ada
support patched in. Such a version is available from the GNU Ada Project
(http://gnuada.sourceforge.net).
The Ada parser for Exuberant Ctags is fairly new - don't expect complete
support yet.
==============================================================================
4. Compiler Support ~
*ada-compiler*
The Ada mode supports more then one Ada compiler and will automatically load the
compiler set in|g:ada_default_compiler|whenever an Ada source is opened. The
provided compiler plug-ins are split into the actual compiler plug-in and a
collection of support functions and variables. This allows the easy
development of specialized compiler plug-ins fine tuned to your development
environment.
------------------------------------------------------------------------------
4.1 GNAT ~
*compiler-gnat*
GNAT is the only free (beer and speech) Ada compiler available. There are
several version available which differentiate in the licence terms used.
The GNAT compiler plug-in will perform a compile on pressing <F7> and then
immediately shows the result. You can set the project file to be used by
setting:
>
> call g:gnat.Set_Project_File ('my_project.gpr')
Setting a project file will also create a Vim session (|views-sessions|) so -
like with the GPS - opened files, window positions etc. will remembered
separately for all projects.
*gnat_members*
GNAT OBJECT ~
*g:gnat.Make()*
g:gnat.Make()
Calls|g:gnat.Make_Command|and displays the result inside a
|quickfix| window.
*g:gnat.Pretty()*
g:gnat.Pretty()
Calls|g:gnat.Pretty_Command|
*g:gnat.Find()*
g:gnat.Find()
Calls|g:gnat.Find_Command|
*g:gnat.Tags()*
g:gnat.Tags()
Calls|g:gnat.Tags_Command|
*g:gnat.Set_Project_File()*
g:gnat.Set_Project_File([{file}])
Set gnat project file and load associated session. An open
project will be closed and the session written. If called
without file name the file selector opens for selection of a
project file. If called with an empty string then the project
and associated session are closed.
*g:gnat.Project_File*
g:gnat.Project_File string
Current project file.
*g:gnat.Make_Command*
g:gnat.Make_Command string
External command used for|g:gnat.Make()| (|'makeprg'|).
*g:gnat.Pretty_Program*
g:gnat.Pretty_Program string
External command used for|g:gnat.Pretty()|
*g:gnat.Find_Program*
g:gnat.Find_Program string
External command used for|g:gnat.Find()|
*g:gnat.Tags_Command*
g:gnat.Tags_Command string
External command used for|g:gnat.Tags()|
*g:gnat.Error_Format*
g:gnat.Error_Format string
Error format (|'errorformat'|)
------------------------------------------------------------------------------
4.2 Dec Ada ~
*compiler-hpada* *compiler-decada*
*compiler-vaxada* *compiler-compaqada*
Dec Ada (also known by - in chronological order - VAX Ada, Dec Ada, Compaq Ada
and HP Ada) is a fairly dated Ada 83 compiler. Support is basic: <F7> will
compile the current unit.
The Dec Ada compiler expects the package name and not the file name to be
passed a parameter. The compiler plug-in supports the usual file name
convention to convert the file into a unit name. For separates both '-' and
'__' are allowed.
*decada_members*
DEC ADA OBJECT ~
*g:decada.Make()*
g:decada.Make() function
Calls|g:decada.Make_Command|and displays the result inside a
|quickfix| window.
*g:decada.Unit_Name()*
g:decada.Unit_Name() function
Get the Unit name for the current file.
*g:decada.Make_Command*
g:decada.Make_Command string
External command used for|g:decadat.Make()| (|'makeprg'|).
*g:decada.Error_Format*
g:decada.Error_Format| string
Error format (|'errorformat'|).
==============================================================================
5. References ~
*ada-reference*
------------------------------------------------------------------------------
5.1 Options ~
*ft-ada-options*
*g:ada_standard_types*
g:ada_standard_types bool (true when exists)
Highlight types in package Standard (e.g., "Float")
*g:ada_space_errors*
*g:ada_no_trail_space_error*
*g:ada_no_tab_space_error*
*g:ada_all_tab_usage*
g:ada_space_errors bool (true when exists)
Highlight extraneous errors in spaces ...
g:ada_no_trail_space_error
- but ignore trailing spaces at the end of a line
g:ada_no_tab_space_error
- but ignore tabs after spaces
g:ada_all_tab_usage
- highlight all tab use
*g:ada_line_errors*
g:ada_line_errors bool (true when exists)
Highlight lines which are to long. Note: This highlighting
option is quite CPU intensive.
*g:ada_rainbow_color*
g:ada_rainbow_color bool (true when exists)
Use rainbow colours for '(' and ')'. You need the
rainbow_parenthesis for this to work
*g:ada_folding*
g:ada_folding set ('sigpft')
Use folding for Ada sources.
's': activate syntax folding on load
'p': fold packages
'f': fold functions and procedures
't': fold types
'c': fold conditionals
'g': activate gnat pretty print folding on load
'i': lone 'is' folded with line above
'b': lone 'begin' folded with line above
'p': lone 'private' folded with line above
'x': lone 'exception' folded with line above
'i': activate indent folding on load
Note: Syntax folding is in an early (unuseable) stage and
indent or gnat pretty folding is suggested.
For gnat pretty folding to work the following settings are
suggested: -cl3 -M79 -c2 -c3 -c4 -A1 -A2 -A3 -A4 -A5
For indent folding to work the following settings are
suggested: shiftwidth=3 softtabstop=3
*g:ada_abbrev*
g:ada_abbrev bool (true when exists)
Add some abbreviations. This feature more or less superseded
by the various completion methods.
*g:ada_withuse_ordinary*
g:ada_withuse_ordinary bool (true when exists)
Show "with" and "use" as ordinary keywords (when used to
reference other compilation units they're normally highlighted
specially).
*g:ada_begin_preproc*
g:ada_begin_preproc bool (true when exists)
Show all begin-like keywords using the colouring of C
preprocessor commands.
*g:ada_omni_with_keywords*
g:ada_omni_with_keywords
Add Keywords, Pragmas, Attributes to omni-completions
(|compl-omni|). Note: You can always complete then with user
completion (|i_CTRL-X_CTRL-U|).
*g:ada_extended_tagging*
g:ada_extended_tagging enum ('jump', 'list')
use extended tagging, two options are available
'jump': use tjump to jump.
'list': add tags quick fix list.
Normal tagging does not support function or operator
overloading as these features are not available in C and
tagging was originally developed for C.
*g:ada_extended_completion*
g:ada_extended_completion
Uses extended completion for <C-N> and <C-R> completions
(|i_CTRL-N|). In this mode the '.' is used as part of the
identifier so that 'Object.Method' or 'Package.Procedure' are
completed together.
*g:ada_gnat_extensions*
g:ada_gnat_extensions bool (true when exists)
Support GNAT extensions.
*g:ada_with_gnat_project_files*
g:ada_with_gnat_project_files bool (true when exists)
Add gnat project file keywords and Attributes.
*g:ada_default_compiler*
g:ada_default_compiler string
set default compiler. Currently supported is 'gnat' and
'decada'.
An "exists" type is a boolean is considered true when the variable is defined
and false when the variable is undefined. The value which the variable is
set makes no difference.
------------------------------------------------------------------------------
5.3 Commands ~
*ft-ada-commands*
:AdaRainbow *:AdaRainbow*
Toggles rainbow colour (|g:ada_rainbow_color|) mode for
'(' and ')'
:AdaLines *:AdaLines*
Toggles line error (|g:ada_line_errors|) display
:AdaSpaces *:AdaSpaces*
Toggles space error (|g:ada_space_errors|) display.
:AdaTagDir *:AdaTagDir*
Creates tags file for the directory of the current file.
:AdaTagFile *:AdaTagFile*
Creates tags file for the current file.
:AdaTypes *:AdaTypes*
Toggles standard types (|g:ada_standard_types|) colour.
:GnatFind *:GnatFind*
Calls |g:gnat.Find()|
:GnatPretty *:GnatPretty*
Calls |g:gnat.Pretty()|
:GnatTags *:GnatTags*
Calls |g:gnat.Tags()|
------------------------------------------------------------------------------
5.3 Variables ~
*ft-ada-variables*
*g:gnat*
g:gnat object
Control object which manages GNAT compiles. The object
is created when the first Ada source code is loaded provided
that |g:ada_default_compiler|is set to 'gnat'. See|gnat_members|
for details.
*g:decada*
g:decada object
Control object which manages Dec Ada compiles. The object
is created when the first Ada source code is loaded provided
that |g:ada_default_compiler|is set to 'decada'. See
|decada_members|for details.
------------------------------------------------------------------------------
5.4 Constants ~
*ft-ada-constants*
All constants are locked. See |:lockvar| for details.
*g:ada#WordRegex*
g:ada#WordRegex string
Regular expression to search for Ada words
*g:ada#DotWordRegex*
g:ada#DotWordRegex string
Regular expression to search for Ada words separated by dots.
*g:ada#Comment*
g:ada#Comment string
Regular expression to search for Ada comments
*g:ada#Keywords*
g:ada#Keywords list of dictionaries
List of keywords, attributes etc. pp. in the format used by
omni completion. See |complete-items| for details.
*g:ada#Ctags_Kinds*
g:ada#Ctags_Kinds dictionary of lists
Dictionary of the various kinds of items which the Ada support
for Ctags generates.
------------------------------------------------------------------------------
5.2 Functions ~
*ft-ada-functions*
ada#Word([{line}, {col}]) *ada#Word()*
Return full name of Ada entity under the cursor (or at given
line/column), stripping white space/newlines as necessary.
ada#List_Tag([{line}, {col}]) *ada#Listtags()*
List all occurrences of the Ada entity under the cursor (or at
given line/column) inside the quick-fix window
ada#Jump_Tag ({ident}, {mode}) *ada#Jump_Tag()*
List all occurrences of the Ada entity under the cursor (or at
given line/column) in the tag jump list. Mode can either be
'tjump' or 'stjump'.
ada#Create_Tags ({option}) *ada#Create_Tags()*
Creates tag file using Ctags. The option can either be 'file'
for the current file, 'dir' for the directory of the current
file or a file name.
gnat#Insert_Tags_Header() *gnat#Insert_Tags_Header()*
Adds the tag file header (!_TAG_) informations to the current
file which are missing from the GNAT XREF output.
ada#Switch_Syntax_Option ({option}) *ada#Switch_Syntax_Option()*
Toggles highlighting options on or off. Used for the Ada menu.
*gnat#New()*
gnat#New ()
Create a new gnat object. See |g:gnat| for details.
==============================================================================
8. Extra Plugins ~
*ada-extra-plugins*
You can optionally install the following extra plug-in. They work well with Ada
and enhance the ability of the Ada mode.:
backup.vim
http://www.vim.org/scripts/script.php?script_id=1537
Keeps as many backups as you like so you don't have to.
rainbow_parenthsis.vim
http://www.vim.org/scripts/script.php?script_id=1561
Very helpful since Ada uses only '(' and ')'.
nerd_comments.vim
http://www.vim.org/scripts/script.php?script_id=1218
Excellent commenting and uncommenting support for almost any
programming language.
matchit.vim
http://www.vim.org/scripts/script.php?script_id=39
'%' jumping for any language. The normal '%' jump only works for '{}'
style languages. The Ada mode will set the needed search patters.
taglist.vim
http://www.vim.org/scripts/script.php?script_id=273
Source code explorer sidebar. There is a patch for Ada available.
The GNU Ada Project distribution (http://gnuada.sourceforge.net) of Vim
contains all of the above.
==============================================================================
vim: textwidth=78 nowrap tabstop=8 shiftwidth=4 softtabstop=4 noexpandtab
vim: filetype=help encoding=latin1

View File

@ -1,4 +1,4 @@
*arabic.txt* For Vim version 7.0. Last change: 2005 Mar 29
*arabic.txt* For Vim version 7.1a. Last change: 2005 Mar 29
VIM REFERENCE MANUAL by Nadim Shaikli

View File

@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 7.0. Last change: 2007 Jan 16
*autocmd.txt* For Vim version 7.1a. Last change: 2007 Mar 27
VIM REFERENCE MANUAL by Bram Moolenaar
@ -263,7 +263,7 @@ Name triggered by ~
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
|TermResponse| after the terminal response to |t_RV| is received
|VimLeavePre| before exiting Vim, before writing the viminfo file
|VimLeave| before exiting Vim, after writing the viminfo file
@ -461,6 +461,9 @@ CursorHold When the user doesn't press a key for the time
make some coffee. :) See |CursorHold-example|
for previewing tags.
This event is only triggered in Normal mode.
It is not triggered when waiting for a command
argument to be typed, or a movement after an
operator.
While recording the CursorHold event is not
triggered. |q|
Note: Interactive commands cannot be used for
@ -528,8 +531,6 @@ FileChangedShell When Vim notices that the modification time of
and the buffer was not changed. If a
FileChangedShell autocommand is present the
warning message and prompt is not given.
This is useful for reloading related buffers
which are affected by a single command.
The |v:fcs_reason| variable is set to indicate
what happened and |v:fcs_choice| can be used
to tell Vim what to do next.
@ -561,7 +562,8 @@ FileReadPost After reading a file with a ":read" command.
*FileReadPre*
FileReadPre Before reading a file with a ":read" command.
*FileType*
FileType When the 'filetype' option has been set.
FileType When the 'filetype' option has been set. The
pattern is matched against the filetype.
<afile> can be used for the name of the file
where this option was set, and <amatch> for
the new value of 'filetype'.
@ -617,8 +619,9 @@ FocusLost When Vim lost input focus. Only for the GUI
*FuncUndefined*
FuncUndefined When a user function is used but it isn't
defined. Useful for defining a function only
when it's used. Both <amatch> and <afile> are
set to the name of the function.
when it's used. The pattern is matched
against the function name. Both <amatch> and
<afile> are set to the name of the function.
See |autoload-functions|.
*GUIEnter*
GUIEnter After starting the GUI successfully, and after
@ -626,6 +629,12 @@ GUIEnter After starting the GUI successfully, and after
VimEnter when using gvim. Can be used to
position the window from a .gvimrc file: >
:autocmd GUIEnter * winpos 100 50
< *GUIFailed*
GUIFailed After starting the GUI failed. Vim may
continue to run in the terminal, if possible
(only on Unix and alikes, when connecting the
X server fails). You may want to quit Vim: >
:autocmd GUIFailed * qall
< *InsertChange*
InsertChange When typing <Insert> while in Insert or
Replace mode. The |v:insertmode| variable
@ -633,8 +642,8 @@ InsertChange When typing <Insert> while in Insert or
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
InsertEnter Just before 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.
@ -657,7 +666,7 @@ MenuPopup Just before showing the popup menu (under the
QuickFixCmdPre Before a quickfix command is run (|:make|,
|:lmake|, |:grep|, |:lgrep|, |:grepadd|,
|:lgrepadd|, |:vimgrep|, |:lvimgrep|,
|:vimgrepadd|, |:vimgrepadd|). The pattern is
|:vimgrepadd|, |:lvimgrepadd|). The pattern is
matched against the command being run. When
|:grep| is used but 'grepprg' is set to
"internal" it still matches "grep".
@ -671,7 +680,8 @@ QuickFixCmdPost Like QuickFixCmdPre, but after a quickfix
location.
*RemoteReply*
RemoteReply When a reply from a Vim that functions as
server was received |server2client()|.
server was received |server2client()|. The
pattern is matched against the {serverid}.
<amatch> is equal to the {serverid} from which
the reply was sent, and <afile> is the actual
reply string.
@ -735,7 +745,8 @@ SwapExists Detected an existing swap file when starting
Note: Do not try to change the buffer, the
results are unpredictable.
*Syntax*
Syntax When the 'syntax' option has been set.
Syntax When the 'syntax' option has been set. The
pattern is matched against the syntax name.
<afile> can be used for the name of the file
where this option was set, and <amatch> for
the new value of 'syntax'.

View File

@ -1,4 +1,4 @@
*change.txt* For Vim version 7.0. Last change: 2006 May 05
*change.txt* For Vim version 7.1a. Last change: 2007 Jan 07
VIM REFERENCE MANUAL by Bram Moolenaar
@ -640,7 +640,7 @@ The flags that you can use for the substitute commands:
[#] Like [p] and prepend the line number.
[l] Like [l] but print the text like |:list|.
[l] Like [p] but print the text like |:list|.
[r] Only useful in combination with ":&" or ":s" without arguments. ":&r"
works the same way as ":~": When the search pattern is empty, use the
@ -670,14 +670,20 @@ pattern from the last substitute or ":global" command. With the [r] flag, the
command uses the pattern from the last substitute, ":global", or search
command.
If the {string} is omitted the substitute is done as if it's empty. Thus the
matched pattern is deleted. The separator after {pattern} can also be left
out then. Example: >
:%s/TESTING
This deletes "TESTING" from all lines, but only one per line.
For compatibility with Vi these two exceptions are allowed:
"\/{string}/" and "\?{string}?" do the same as "//{string}/r".
"\&{string}&" does the same as "//{string}/".
*E146*
Instead of the '/' which surrounds the pattern and replacement string, you
can use any other character, but not an alphanumeric character, '\', '"' or
'|'. This is useful if you want to include a '/' in the search pattern or
replacement string. Example: >
can use any other single-byte character, but not an alphanumeric character,
'\', '"' or '|'. This is useful if you want to include a '/' in the search
pattern or replacement string. Example: >
:s+/+//+
For the definition of a pattern, see |pattern|.
@ -1075,7 +1081,7 @@ and ":put" commands and with CTRL-R. {not in Vi}
{not available when compiled without the |+cmdline_hist|
feature}
6. Expression register "= *quote_=* *quote=*
6. Expression register "= *quote_=* *quote=* *@=*
This is not really a register that stores text, but is a way to use an
expression in commands which use a register. The expression register is
read-only; you cannot put text into it. After the '=', the cursor moves to
@ -1365,7 +1371,7 @@ readability.
letter meaning when present in 'formatoptions' ~
t Auto-wrap text using textwidth (does not apply to comments)
t Auto-wrap text using textwidth
c Auto-wrap comments using textwidth, inserting the current comment
leader automatically.
r Automatically insert the current comment leader after hitting

View File

@ -1,4 +1,4 @@
*cmdline.txt* For Vim version 7.0. Last change: 2006 Apr 30
*cmdline.txt* For Vim version 7.1a. Last change: 2006 Jul 18
VIM REFERENCE MANUAL by Bram Moolenaar
@ -301,6 +301,10 @@ CTRL-^ Toggle the use of language |:lmap| mappings and/or Input
for the next command or Search pattern.
{not in Vi}
*c_CTRL-]*
CTRL-] Trigger abbreviation, without inserting a character. {not in
Vi}
For Emacs-style editing on the command-line see |emacs-keys|.
The <Up> and <Down> keys take the current command-line as a search string.

View File

@ -1,4 +1,4 @@
*debug.txt* For Vim version 7.0. Last change: 2006 May 01
*debug.txt* For Vim version 7.1a. Last change: 2006 May 01
VIM REFERENCE MANUAL by Bram Moolenaar

View File

@ -1,4 +1,4 @@
*debugger.txt* For Vim version 7.0. Last change: 2005 Mar 29
*debugger.txt* For Vim version 7.1a. Last change: 2005 Mar 29
VIM REFERENCE MANUAL by Gordon Prieur

View File

@ -1,4 +1,4 @@
*develop.txt* For Vim version 7.0. Last change: 2006 Mar 09
*develop.txt* For Vim version 7.1a. Last change: 2006 Sep 26
VIM REFERENCE MANUAL by Bram Moolenaar
@ -224,7 +224,7 @@ __.* POSIX, system
_[A-Z].* POSIX, system
E[A-Z0-9]* POSIX, errno.h
*_t POSIX, for typedefs. Use *_T instead.
.*_t POSIX, for typedefs. Use .*_T instead.
wait don't use as argument to a function, conflicts with types.h
index shadows global declaration

View File

@ -1,4 +1,4 @@
*diff.txt* For Vim version 7.0. Last change: 2006 Apr 14
*diff.txt* For Vim version 7.1a. Last change: 2006 Oct 02
VIM REFERENCE MANUAL by Bram Moolenaar
@ -155,13 +155,16 @@ All the buffers edited in a window where the 'diff' option is set will join in
the diff. This is also possible for hidden buffers. They must have been
edited in a window first for this to be possible.
*:DiffOrig* *diff-original-file*
Since 'diff' is a window-local option, it's possible to view the same buffer
in diff mode in one window and "normal" in another window. It is also
possible to view the changes you have made to a buffer, but since Vim doesn't
allow having two buffers for the same file, you need to make a copy of the
original file and diff with that. For example: >
:!cp % tempfile
:diffsplit tempfile
possible to view the changes you have made to a buffer since the file was
loaded. Since Vim doesn't allow having two buffers for the same file, you
need another buffer. This command is useful: >
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
\ | wincmd p | diffthis
(this is in |vimrc_example.vim|). Use ":DiffOrig" to see the differences
between the current buffer and the file it was loaded from.
A buffer that is unloaded cannot be used for the diff. But it does work for
hidden buffers. You can use ":hide" to close a window without unloading the
@ -239,7 +242,7 @@ that the buffers will be equal within the specified range.
mode.
See below for [range].
*:diffpu* *:diffput*
*:diffpu* *:diffput* *E793*
:[range]diffpu[t] [bufspec]
Modify another buffer to undo difference with the current
buffer. Just like ":diffget" but the other buffer is modified

View File

@ -1,4 +1,4 @@
*digraph.txt* For Vim version 7.0. Last change: 2006 Apr 25
*digraph.txt* For Vim version 7.1a. Last change: 2006 Jul 18
VIM REFERENCE MANUAL by Bram Moolenaar
@ -107,13 +107,12 @@ If you accidentally typed an 'a' that should be an 'e', you will type 'a' <BS>
this, you will have to type <BS> e again. To avoid this don't set the
'digraph' option and use CTRL-K to enter digraphs.
You may have problems using Vim with characters which have an ASCII value
above 128. For example: You insert ue (u-umlaut) and the editor echoes \334
in Insert mode. After leaving the Insert mode everything is fine. Note that
fmt removes all characters with ASCII codes above 128 from the text being
formatted. On some Unix systems this means you have to define the
environment-variable LC_CTYPE. If you are using csh, then put the following
line in your .cshrc: >
You may have problems using Vim with characters which have a value above 128.
For example: You insert ue (u-umlaut) and the editor echoes \334 in Insert
mode. After leaving the Insert mode everything is fine. Note that fmt
removes all characters with a value above 128 from the text being formatted.
On some Unix systems this means you have to define the environment-variable
LC_CTYPE. If you are using csh, then put the following line in your .cshrc: >
setenv LC_CTYPE iso_8859_1
==============================================================================

View File

@ -1,4 +1,4 @@
*editing.txt* For Vim version 7.0. Last change: 2006 Apr 30
*editing.txt* For Vim version 7.1a. Last change: 2006 Oct 10
VIM REFERENCE MANUAL by Bram Moolenaar
@ -372,7 +372,7 @@ Example: The command ":e Long File Name " will edit the file "Long File
Name". When using a command that accepts more than one file name (like ":next
file1 file2") embedded spaces must be escaped with a backslash.
*wildcard*
*wildcard* *wildcards*
Wildcards in {file} are expanded. Which wildcards are supported depends on
the system. These are the common ones:
? matches one character
@ -849,7 +849,7 @@ Note: When the 'write' option is off, you are not able to write any file.
*:w* *:write*
*E502* *E503* *E504* *E505*
*E512* *E514* *E667*
*E512* *E514* *E667* *E796*
:w[rite] Write the whole buffer to the current file. This is
the normal way to save changes to a file. It fails
when the 'readonly' option is set or when there is
@ -1150,8 +1150,8 @@ If you want to always use ":confirm", set the 'confirm' option.
*:browse* *:bro* *E338* *E614* *E615* *E616* *E578*
:bro[wse] {command} Open a file selection dialog for an argument to
{command}. At present this works for |:e|, |:w|,
|:r|, |:saveas|, |:sp|, |:mkexrc|, |:mkvimrc| and
|:mksession|.
|:r|, |:saveas|, |:sp|, |:mkexrc|, |:mkvimrc|,
|:mksession|, |:split|, |:vsplit|, and |:tabe|.
{only in Win32, Athena, Motif, GTK and Mac GUI}
When ":browse" is not possible you get an error
message. If the |+browse| feature is missing or the
@ -1469,7 +1469,9 @@ problem goes away the next day.
{not available when compiled without the |+path_extra| feature}
The file searching is currently used for the 'path', 'cdpath' and 'tags'
options. There are three different types of searching:
options, for |finddir()| and |findfile()|.
There are three different types of searching:
1) Downward search: *starstar*
Downward search uses the wildcards '*', '**' and possibly others

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.0. Last change: 2007 Apr 24
*eval.txt* For Vim version 7.1a. Last change: 2007 May 03
VIM REFERENCE MANUAL by Bram Moolenaar
@ -192,7 +192,7 @@ separated by a colon in square brackets: >
:let shortlist = mylist[2:-1] " get List [3, "four"]
Omitting the first index is similar to zero. Omitting the last index is
similar to -1.
similar to -1. >
:let endlist = mylist[2:] " from item 2 to the end: [3, "four"]
:let shortlist = mylist[2:2] " List with one item: [3]
:let otherlist = mylist[:] " make a copy of the List
@ -444,8 +444,8 @@ To loop over the values use the |values()| function: >
If you want both the key and the value use the |items()| function. It returns
a List in which each item is a List with two items, the key and the value: >
:for entry in items(mydict)
: echo entry[0] . ': ' . entry[1]
:for [key, value] in items(mydict)
: echo key . ': ' . value
:endfor
@ -486,7 +486,7 @@ expect ":echo adict" to show the items from bdict after the older entries in
adict.
Weeding out entries from a Dictionary can be done with |filter()|: >
:call filter(dict 'v:val =~ "x"')
:call filter(dict, 'v:val =~ "x"')
This removes all entries from "dict" with a value not matching 'x'.
@ -650,6 +650,9 @@ To keep this readable, using |line-continuation| is suggested: >
:\ ? "last"
:\ : lnum
You should always put a space before the ':', otherwise it can be mistaken for
use in a variable such as "a:1".
expr2 and expr3 *expr2* *expr3*
---------------
@ -750,10 +753,12 @@ results in the mathematical difference (comparing byte values), not
necessarily the alphabetical difference in the local language.
When using the operators with a trailing '#", or the short version and
'ignorecase' is off, the comparing is done with strcmp().
'ignorecase' is off, the comparing is done with strcmp(): case matters.
When using the operators with a trailing '?', or the short version and
'ignorecase' is set, the comparing is done with stricmp().
'ignorecase' is set, the comparing is done with stricmp(): case is ignored.
'smartcase' is not used.
The "=~" and "!~" operators match the lefthand argument with the righthand
argument, which is used as a pattern. See |pattern| for what a pattern is.
@ -932,6 +937,10 @@ A string constant accepts these special characters:
\" double quote
\<xxx> Special key named "xxx". e.g. "\<C-W>" for CTRL-W.
Note that "\xff" is stored as the byte 255, which may be invalid in some
encodings. Use "\u00ff" to store character 255 according to the current value
of 'encoding'.
Note that "\000" and "\x00" force the end of the string.
@ -965,7 +974,7 @@ and there is no buffer-local or window-local value, the global value is used
anyway.
register *expr-register*
register *expr-register* *@r*
--------
@r contents of register 'r'
@ -1079,7 +1088,10 @@ place if you like.
*local-variable* *l:var*
Inside functions local variables are accessed without prepending anything.
But you can also prepend "l:" if you like.
But you can also prepend "l:" if you like. However, without prepending "l:"
you may run into reserved variable names. For example "count". By itself it
refers to "v:count". Using "l:count" you can have a local variable with the
same name.
*script-variable* *s:var*
In a Vim script variables starting with "s:" can be used. They cannot be
@ -1097,8 +1109,8 @@ Thus not in:
- mappings
- etc.
script variables can be used to avoid conflicts with global variable names.
Take this example:
Script variables can be used to avoid conflicts with global variable names.
Take this example: >
let s:counter = 0
function MyCounter()
@ -1889,7 +1901,9 @@ bufname({expr}) *bufname()*
"" or "%" can be used for the current buffer, "#" for the
alternate buffer.
A full match is preferred, otherwise a match at the start, end
or middle of the buffer name is accepted.
or middle of the buffer name is accepted. If you only want a
full match then put "^" at the start and "$" at the end of the
pattern.
Listed buffers are found first. If there is a single match
with a listed buffer, that one is returned. Next unlisted
buffers are searched for.
@ -1934,6 +1948,7 @@ bufwinnr({expr}) *bufwinnr()*
< The number can be used with |CTRL-W_w| and ":wincmd w"
|:wincmd|.
Only deals with the current tab page.
byte2line({byte}) *byte2line()*
@ -1984,8 +1999,8 @@ char2nr({expr}) *char2nr()*
char2nr(" ") returns 32
char2nr("ABC") returns 65
< The current 'encoding' is used. Example for "utf-8": >
char2nr("?") returns 225
char2nr("?"[0]) returns 195
char2nr("<EFBFBD>") returns 225
char2nr("<EFBFBD>"[0]) returns 195
< nr2char() does the opposite.
cindent({lnum}) *cindent()*
@ -2005,7 +2020,7 @@ col({expr}) The result is a Number, which is the byte index of the column
number of characters in the cursor line plus one)
'x position of mark x (if the mark is not set, 0 is
returned)
To get the line number use |col()|. To get both use
To get the line number use |line()|. To get both use
|getpos()|.
For the screen column position use |virtcol()|.
Note that only marks in the current file can be used.
@ -2015,6 +2030,8 @@ col({expr}) The result is a Number, which is the byte index of the column
col("'t") column of mark t
col("'" . markname) column of mark markname
< The first column is 1. 0 is returned for an error.
For an uppercase mark the column may actually be in another
buffer.
For the cursor position, when 'virtualedit' is active, the
column is one higher if the cursor is after the end of the
line. This can be used to obtain the column in Insert mode: >
@ -2027,8 +2044,8 @@ col({expr}) The result is a Number, which is the byte index of the column
complete({startcol}, {matches}) *complete()* *E785*
Set the matches for Insert mode completion.
Can only be used in Insert mode. You need to use a mapping
with an expression argument |:map-<expr>| or CTRL-R =
|i_CTRL-R|. It does not work after CTRL-O.
with CTRL-R = |i_CTRL-R|. It does not work after CTRL-O or
with an expression mapping.
{startcol} is the byte offset in the line where the completed
text start. The text up to the cursor is the original text
that will be replaced by the matches. Use col('.') for an
@ -2042,7 +2059,7 @@ complete({startcol}, {matches}) *complete()* *E785*
Insert mode completion. The popup menu will appear if
specified, see |ins-completion-menu|.
Example: >
inoremap <expr> <F5> ListMonths()
inoremap <F5> <C-R>=ListMonths()<CR>
func! ListMonths()
call complete(col('.'), ['January', 'February', 'March',
@ -2179,8 +2196,8 @@ cscope_connection([{num} , {dbpath} [, {prepend}]])
<
cursor({lnum}, {col} [, {off}]) *cursor()*
cursor({list})
Positions the cursor at the column {col} in the line {lnum}.
The first column is one.
Positions the cursor at the column (byte count) {col} in the
line {lnum}. The first column is one.
When there is one argument {list} this is used as a |List|
with two or three items {lnum}, {col} and {off}. This is like
the return value of |getpos()|, but without the first item.
@ -2487,8 +2504,8 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
feedkeys({string} [, {mode}]) *feedkeys()*
Characters in {string} are queued for processing as if they
come from a mapping or were typed by user. They are added to
the end of the typeahead buffer, thus if a mapping is still
come from a mapping or were typed by the user. They are added
to the end of the typeahead buffer, thus if a mapping is still
being executed these characters come after them.
The function does not wait for processing of keys contained in
{string}.
@ -2510,10 +2527,19 @@ filereadable({file}) *filereadable()*
name {file} exists, and can be read. If {file} doesn't exist,
or is a directory, the result is FALSE. {file} is any
expression, which is used as a String.
If you don't care about the file being readable you can use
|glob()|.
*file_readable()*
Obsolete name: file_readable().
filewritable({file}) *filewritable()*
The result is a Number, which is 1 when a file with the
name {file} exists, and can be written. If {file} doesn't
exist, or is not writable, the result is 0. If (file) is a
directory, and we can write to it, the result is 2.
filter({expr}, {string}) *filter()*
{expr} must be a |List| or a |Dictionary|.
For each item in {expr} evaluate {string} and when the result
@ -2560,14 +2586,8 @@ findfile({name}[, {path}[, {count}]]) *findfile()*
Uses 'suffixesadd'.
Example: >
:echo findfile("tags.vim", ".;")
< Searches from the current directory upwards until it finds
the file "tags.vim".
filewritable({file}) *filewritable()*
The result is a Number, which is 1 when a file with the
name {file} exists, and can be written. If {file} doesn't
exist, or is not writable, the result is 0. If (file) is a
directory, and we can write to it, the result is 2.
< Searches from the directory of the current file upwards until
it finds the file "tags.vim".
fnamemodify({fname}, {mods}) *fnamemodify()*
Modify file name {fname} according to {mods}. {mods} is a
@ -2883,6 +2903,8 @@ getline({lnum} [, {end}])
:let end = search("^$") - 1
:let lines = getline(start, end)
< To get lines from another buffer see |getbufline()|
getloclist({nr}) *getloclist()*
Returns a list with all the entries in the location list for
window {nr}. When {nr} is zero the current window is used.
@ -2940,15 +2962,19 @@ getregtype([{regname}]) *getregtype()*
If {regname} is not specified, |v:register| is used.
gettabwinvar({tabnr}, {winnr}, {varname}) *gettabwinvar()*
Get the value of an option or local window variable {varname}
in window {winnr} in tab page {tabnr}.
Get the value of window-local variable {varname} in window
{winnr} in tab page {tabnr}.
When {varname} starts with "&" get the value of a window-local
option.
Tabs are numbered starting with one. For the current tabpage
use |getwinvar()|.
When {winnr} is zero the current window is used.
This also works for a global option, buffer-local option and
window-local option, but it doesn't work for a global variable
or buffer-local variable.
Note that the name without "w:" must be used.
When {varname} is empty a dictionary with all window-local
variables is returned.
Note that {varname} must be the name without "w:".
Examples: >
:let list_is_on = gettabwinvar(1, 2, '&list')
:echo "myvar = " . gettabwinvar(3, 1, 'myvar')
@ -2970,7 +2996,9 @@ getwinvar({winnr}, {varname}) *getwinvar()*
:echo "myvar = " . getwinvar(1, 'myvar')
<
*glob()*
glob({expr}) Expand the file wildcards in {expr}. The result is a String.
glob({expr}) Expand the file wildcards in {expr}. See |wildcards| for the
use of special characters.
The result is a String.
When there are several matches, they are separated by <NL>
characters.
If the expansion fails, the result is an empty string.
@ -3254,7 +3282,8 @@ inputlist({textlist}) *inputlist()*
is returned.
Make sure {textlist} has less then 'lines' entries, otherwise
it won't work. It's a good idea to put the entry number at
the start of the string. Example: >
the start of the string. And put a prompt in the first item.
Example: >
let color = inputlist(['Select color:', '1. red',
\ '2. green', '3. blue'])
@ -3414,7 +3443,8 @@ line({expr}) The result is a Number, which is the line number of the file
returned)
w0 first line visible in current window
w$ last line visible in current window
Note that a mark in another file can be used.
Note that a mark in another file can be used. The line number
then applies to another buffer.
To get the column number use |col()|. To get both use
|getpos()|.
Examples: >
@ -3942,7 +3972,10 @@ reltimestr({time}) *reltimestr()*
echo reltimestr(reltime(start))
< Note that overhead for the commands will be added to the time.
The accuracy depends on the system.
Also see |profiling|.
Leading spaces are used to make the string align nicely. You
can use split() to remove it. >
echo split(reltimestr(reltime(start)))[0]
< Also see |profiling|.
{only available when compiled with the +reltime feature}
*remote_expr()* *E449*
@ -4098,6 +4131,8 @@ search({pattern} [, {flags} [, {stopline}]]) *search()*
cursor is moved. The 's' flag cannot be combined with the 'n'
flag.
'ignorecase', 'smartcase' and 'magic' are used.
When the {stopline} argument is given then the search stops
after searching this line. This is useful to restrict the
search to a range of lines. Examples: >
@ -4372,6 +4407,9 @@ setpos({expr}, {list})
Also see |getpos()|
This does not restore the preferred column for moving
vertically. See |winrestview()| for that.
setqflist({list} [, {action}]) *setqflist()*
Create or replace or add to the quickfix list using the items
@ -4666,6 +4704,7 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number,
List [item, item]
Dictionary {key: value, key: value}
Note that in String values the ' character is doubled.
Also see |strtrans()|.
*strlen()*
strlen({expr}) The result is a Number, which is the length of the String
@ -4735,7 +4774,7 @@ substitute({expr}, {pat}, {sub}, {flags}) *substitute()*
like the ":substitute" command (without any flags). But the
matching with {pat} is always done like the 'magic' option is
set and 'cpoptions' is empty (to make scripts portable).
'ignorecase' is still relevant.
'ignorecase' is still relevant. 'smartcase' is not used.
See |string-match| for how {pat} is used.
And a "~" in {sub} is not replaced with the previous {sub}.
Note that some codes in {sub} have a special meaning
@ -4888,22 +4927,23 @@ taglist({expr}) *taglist()*
entries:
name Name of the tag.
filename Name of the file where the tag is
defined.
defined. It is either relative to the
current directory or a full path.
cmd Ex command used to locate the tag in
the file.
kind Type of the tag. The value for this
entry depends on the language specific
kind values generated by the ctags
tool.
kind values. Only available when
using a tags file generated by
Exuberant ctags or hdrtag.
static A file specific tag. Refer to
|static-tag| for more information.
The "kind" entry is only available when using Exuberant ctags
generated tags file. More entries may be present, depending
on the content of the tags file: access, implementation,
inherits and signature. Refer to the ctags documentation for
information about these fields. For C code the fields
"struct", "class" and "enum" may appear, they give the name of
the entity the tag is contained in.
More entries may be present, depending on the content of the
tags file: access, implementation, inherits and signature.
Refer to the ctags documentation for information about these
fields. For C code the fields "struct", "class" and "enum"
may appear, they give the name of the entity the tag is
contained in.
The ex-command 'cmd' can be either an ex search pattern, a
line number or a line number followed by a byte number.
@ -5005,6 +5045,10 @@ virtcol({expr}) *virtcol()*
virtcol("$") with text "foo^Lbar", returns 9
virtcol("'t") with text " there", with 't at 'h', returns 6
< The first column is 1. 0 is returned for an error.
A more advanced example that echoes the maximum length of
all lines: >
echo max(map(range(1, line('$')), "virtcol([v:val, '$'])"))
visualmode([expr]) *visualmode()*
The result is a String, which describes the last Visual mode
@ -5059,9 +5103,11 @@ winnr([{arg}]) The result is a Number, which is the number of the current
last window is returned (the window count).
When the optional argument is "#", the number of the last
accessed window is returned (where |CTRL-W_p| goes to).
If there is no previous window 0 is returned.
If there is no previous window or it is in another tab page 0
is returned.
The number can be used with |CTRL-W_w| and ":wincmd w"
|:wincmd|.
Also see |tabpagewinnr()|.
*winrestcmd()*
winrestcmd() Returns a sequence of |:resize| commands that should restore
@ -5146,6 +5192,8 @@ There are three types of features:
Then the "patch123" feature means that patch 123 has been included for
this version. Example (checking version 6.2.148 or later): >
:if v:version > 602 || v:version == 602 && has("patch148")
< Note that it's possible for patch 147 to be omitted even though 148 is
included.
all_builtin_terms Compiled with all builtin terminals enabled.
amiga Amiga version of Vim.
@ -5447,7 +5495,7 @@ See |:verbose-cmd| for more information.
*function-argument* *a:var*
An argument can be defined by giving its name. In the function this can then
be used as "a:name" ("a:" for argument).
*a:0* *a:1* *a:000* *E740*
*a:0* *a:1* *a:000* *E740* *...*
Up to 20 arguments can be given, separated by commas. After the named
arguments an argument "..." can be specified, which means that more arguments
may optionally be following. In the function the extra arguments can be used
@ -5490,40 +5538,25 @@ This function can then be called with: >
call Table("Table", "line1", "line2")
call Table("Empty Table")
To return more than one value, pass the name of a global variable: >
:function Compute(n1, n2, divname)
To return more than one value, return a |List|: >
:function Compute(n1, n2)
: if a:n2 == 0
: return "fail"
: return ["fail", 0]
: endif
: let g:{a:divname} = a:n1 / a:n2
: return "ok"
: return ["ok", a:n1 / a:n2]
:endfunction
This function can then be called with: >
:let success = Compute(13, 1324, "div")
:let [success, div] = Compute(102, 6)
:if success == "ok"
: echo div
:endif
An alternative is to return a command that can be executed. This also works
with local variables in a calling function. Example: >
:function Foo()
: execute Bar()
: echo "line " . lnum . " column " . col
:endfunction
:function Bar()
: return "let lnum = " . line(".") . " | let col = " . col(".")
:endfunction
The names "lnum" and "col" could also be passed as argument to Bar(), to allow
the caller to set the names.
<
*:cal* *:call* *E107* *E117*
:[range]cal[l] {name}([arguments])
Call a function. The name of the function and its arguments
are as specified with |:function|. Up to 20 arguments can be
used.
used. The returned value is discarded.
Without a range and for functions that accept a range, the
function is called once. When a range is given the cursor is
positioned at the start of the first line before executing the
@ -5554,6 +5587,11 @@ the caller to set the names.
This function inserts the continuation character "\" in front
of all the lines in the range, except the first one.
When the function returns a composite value it can be further
dereferenced, but the range will not be used then. Example: >
:4,8call GetDict().method()
< Here GetDict() gets the range but method() does not.
*E132*
The recursiveness of user functions is restricted with the |'maxfuncdepth'|
option.
@ -5740,7 +5778,7 @@ This would call the function "my_func_whizz(parameter)".
Append {expr1} to register {reg-name}. If the
register was empty it's like setting it to {expr1}.
:let &{option-name} = {expr1} *:let-option* *:let-star*
:let &{option-name} = {expr1} *:let-option* *:let-&*
Set option {option-name} to the result of the
expression {expr1}. A String or Number value is
always converted to the type of the option.
@ -5830,7 +5868,7 @@ This would call the function "my_func_whizz(parameter)".
* Funcref
:unl[et][!] {name} ... *:unlet* *:unl* *E108*
:unl[et][!] {name} ... *:unlet* *:unl* *E108* *E795*
Remove the internal variable {name}. Several variable
names can be given, they are all removed. The name
may also be a |List| or |Dictionary| item.
@ -6100,11 +6138,14 @@ This would call the function "my_func_whizz(parameter)".
Cannot be followed by a comment.
Example: >
:echo "the value of 'shell' is" &shell
< A later redraw may make the message disappear again.
To avoid that a command from before the ":echo" causes
a redraw afterwards (redraws are often postponed until
you type something), force a redraw with the |:redraw|
command. Example: >
< *:echo-redraw*
A later redraw may make the message disappear again.
And since Vim mostly postpones redrawing until it's
finished with a sequence of commands this happens
quite often. To avoid that a command from before the
":echo" causes a redraw afterwards (redraws are often
postponed until you type something), force a redraw
with the |:redraw| command. Example: >
:new | redraw | echo "there is a new window"
<
*:echon*
@ -6144,10 +6185,16 @@ This would call the function "my_func_whizz(parameter)".
Spaces are placed between the arguments as with the
|:echo| command. But unprintable characters are
displayed, not interpreted.
The parsing works slightly different from |:echo|,
more like |:execute|. All the expressions are first
evaluated and concatenated before echoing anything.
The expressions must evaluate to a Number or String, a
Dictionary or List causes an error.
Uses the highlighting set by the |:echohl| command.
Example: >
:echomsg "It's a Zizzer Zazzer Zuzz, as you can plainly see."
<
< See |:echo-redraw| to avoid the message disappearing
when the screen is redrawn.
*:echoe* *:echoerr*
:echoe[rr] {expr1} .. Echo the expression(s) as an error message, saving the
message in the |message-history|. When used in a
@ -7198,106 +7245,51 @@ a "E600: Missing :endtry" error message is given, see |except-single-line|.
==============================================================================
9. Examples *eval-examples*
Printing in Hex ~
Printing in Binary ~
>
:" The function Nr2Hex() returns the Hex string of a number.
:func Nr2Hex(nr)
:" The function Nr2Bin() returns the Hex string of a number.
:func Nr2Bin(nr)
: let n = a:nr
: let r = ""
: while n
: let r = '0123456789ABCDEF'[n % 16] . r
: let n = n / 16
: let r = '01'[n % 2] . r
: let n = n / 2
: endwhile
: return r
:endfunc
:" The function String2Hex() converts each character in a string to a two
:" character Hex string.
:func String2Hex(str)
:" The function String2Bin() converts each character in a string to a
:" binary string, separated with dashes.
:func String2Bin(str)
: let out = ''
: let ix = 0
: while ix < strlen(a:str)
: let out = out . Nr2Hex(char2nr(a:str[ix]))
: let ix = ix + 1
: endwhile
: return out
: for ix in range(strlen(a:str))
: let out = out . '-' . Nr2Bin(char2nr(a:str[ix]))
: endfor
: return out[1:]
:endfunc
Example of its use: >
:echo Nr2Hex(32)
result: "20" >
:echo String2Hex("32")
result: "3332"
:echo Nr2Bin(32)
result: "100000" >
:echo String2Bin("32")
result: "110011-110010"
Sorting lines (by Robert Webb) ~
Sorting lines ~
Here is a Vim script to sort lines. Highlight the lines in Vim and type
":Sort". This doesn't call any external programs so it'll work on any
platform. The function Sort() actually takes the name of a comparison
function as its argument, like qsort() does in C. So you could supply it
with different comparison functions in order to sort according to date etc.
>
:" Function for use with Sort(), to compare two strings.
:func! Strcmp(str1, str2)
: if (a:str1 < a:str2)
: return -1
: elseif (a:str1 > a:str2)
: return 1
: else
: return 0
: endif
This example sorts lines with a specific compare function. >
:func SortBuffer()
: let lines = getline(1, '$')
: call sort(lines, function("Strcmp"))
: call setline(1, lines)
:endfunction
:" Sort lines. SortR() is called recursively.
:func! SortR(start, end, cmp)
: if (a:start >= a:end)
: return
: endif
: let partition = a:start - 1
: let middle = partition
: let partStr = getline((a:start + a:end) / 2)
: let i = a:start
: while (i <= a:end)
: let str = getline(i)
: exec "let result = " . a:cmp . "(str, partStr)"
: if (result <= 0)
: " Need to put it before the partition. Swap lines i and partition.
: let partition = partition + 1
: if (result == 0)
: let middle = partition
: endif
: if (i != partition)
: let str2 = getline(partition)
: call setline(i, str2)
: call setline(partition, str)
: endif
: endif
: let i = i + 1
: endwhile
As a one-liner: >
:call setline(1, sort(getline(1, '$'), function("Strcmp")))
: " Now we have a pointer to the "middle" element, as far as partitioning
: " goes, which could be anywhere before the partition. Make sure it is at
: " the end of the partition.
: if (middle != partition)
: let str = getline(middle)
: let str2 = getline(partition)
: call setline(middle, str2)
: call setline(partition, str)
: endif
: call SortR(a:start, partition - 1, a:cmp)
: call SortR(partition + 1, a:end, a:cmp)
:endfunc
:" To Sort a range of lines, pass the range to Sort() along with the name of a
:" function that will compare two lines.
:func! Sort(cmp) range
: call SortR(a:firstline, a:lastline, a:cmp)
:endfunc
:" :Sort takes a range of lines and sorts them.
:command! -nargs=0 -range Sort <line1>,<line2>call Sort("Strcmp")
<
scanf() replacement ~
*sscanf*
There is no sscanf() function in Vim. If you need to extract parts from a
line, you can use matchstr() and substitute() to do it. This example shows
@ -7315,6 +7307,35 @@ how to get the file name, line number and column number out of a line like
The input is in the variable "line", the results in the variables "file",
"lnum" and "col". (idea from Michael Geddes)
getting the scriptnames in a Dictionary ~
*scriptnames-dictionary*
The |:scriptnames| command can be used to get a list of all script files that
have been sourced. There is no equivalent function or variable for this
(because it's rarely needed). In case you need to manipulate the list this
code can be used: >
" Get the output of ":scriptnames" in the scriptnames_output variable.
let scriptnames_output = ''
redir => scriptnames_output
silent scriptnames
redir END
" Split the output into lines and parse each line. Add an entry to the
" "scripts" dictionary.
let scripts = {}
for line in split(scriptnames_output, "\n")
" Only do non-blank lines.
if line =~ '\S'
" Get the first number in the line.
let nr = matchstr(line, '\d\+')
" Get the file name, remove the script number " 123: ".
let name = substitute(line, '.\+:\s*', '', '')
" Add an item to the Dictionary
let scripts[nr] = name
endif
endfor
unlet scriptnames_output
==============================================================================
10. No +eval feature *no-eval-feature*
@ -7349,6 +7370,7 @@ These items are not allowed in the sandbox:
- changing the buffer text
- defining or changing mapping, autocommands, functions, user commands
- setting certain options (see |option-summary|)
- setting certain v: variables (see |v:var|) *E794*
- executing a shell command
- reading or writing a file
- jumping to another buffer or editing a file

View File

@ -1,4 +1,4 @@
*farsi.txt* For Vim version 7.0. Last change: 2005 Mar 29
*farsi.txt* For Vim version 7.1a. Last change: 2005 Mar 29
VIM REFERENCE MANUAL by Mortaza Ghassab Shiran

View File

@ -1,4 +1,4 @@
*filetype.txt* For Vim version 7.0. Last change: 2006 Apr 28
*filetype.txt* For Vim version 7.1a. Last change: 2007 Mar 24
VIM REFERENCE MANUAL by Bram Moolenaar
@ -43,6 +43,8 @@ Detail: The ":filetype on" command will load one of these files:
BufNewFile and BufRead events. If the file type is not found by the
name, the file $VIMRUNTIME/scripts.vim is used to detect it from the
contents of the file.
When the GUI is running or will start soon, the menu.vim script is
also sourced. See |'go-M'| about avoiding that.
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
@ -304,24 +306,28 @@ all loaded. For example, if this command: >
set runtimepath
produces this output: >
produces this output:
runtimepath=/etc/vim,~/.vim,/usr/local/share/vim/vim60
runtimepath=/etc/vim,~/.vim,/usr/local/share/vim/vim60 ~
then Vim will load all plugins in these directories: >
then Vim will load all plugins in these directories and below:
/etc/vim/plugin/
~/.vim/plugin/
/usr/local/share/vim/vim60/plugin/
/etc/vim/plugin/ ~
~/.vim/plugin/ ~
/usr/local/share/vim/vim60/plugin/ ~
Note that the last one is the value of $VIMRUNTIME which has been expanded.
What if it looks like your plugin is not being loaded? You can find out what
happens when Vim starts up by using the |-V| argument: >
vim -V1
vim -V2
You will see a lot of messages, in between them is a remark about loading the
plugins. It starts with: >
Searching for "plugin/*.vim" in
plugins. It starts with:
Searching for "plugin/**/*.vim" in ~
There you can see where Vim looks for your plugin scripts.
==============================================================================

View File

@ -1,4 +1,4 @@
*fold.txt* For Vim version 7.0. Last change: 2006 Mar 29
*fold.txt* For Vim version 7.1a. Last change: 2006 Mar 29
VIM REFERENCE MANUAL by Bram Moolenaar

View File

@ -1,303 +0,0 @@
*getscript.txt* For Vim version 7.0. Last change: 2006 Apr 30
Get the Latest VimScripts
Authors: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamilyA.Mbiz>
(remove NOSPAM from the email address)
*GetLatestVimScripts-copyright*
Copyright: (c) 2004-2005 by Charles E. Campbell, Jr.
The VIM LICENSE applies to GetLatestVimScripts.vim and
GetLatestVimScripts.txt (see |copyright|) except use
"GetLatestVimScripts" instead of "Vim".
No warranty, express or implied. Use At-Your-Own-Risk.
==============================================================================
1. Contents *glvs-contents*
1. Contents.......................................: |glvs-contents|
2. GetLatestVimScripts Usage......................: |glvs|
3. GetLatestVimScripts Data File..................: |glvs-data|
4. GetLatestVimScripts Plugins....................: |glvs-plugins|
5. GetLatestVimScripts AutoInstall................: |glvs-autoinstall|
6. GetLatestVimScripts Algorithm..................: |glvs-alg|
7. GetLatestVimScripts History....................: |glvs-hist|
==============================================================================
2. GetLatestVimScripts Usage *getlatestvimscripts* *getscript* *glvs*
While in vim, type
>
:GetLatestVimScripts
<
Unless its been defined elsewhere,
>
:GLVS
<
will also work.
The script will attempt to update and, if so directed, automatically
install scripts from http://vim.sourceforge.net/. To do so it will
peruse a file, [.vim|vimfiles]/GetLatest/GetLatestVimScripts.dat
(see |glvs-data|), and examine plugins in your [.vim|vimfiles]/plugin
directory (see |glvs-plugins|).
Scripts which have been downloaded will appear in the .../GetLatest
subdirectory.
The <GetLatestVimScripts.dat> file will be automatically be updated to
reflect the latest version of script(s) so downloaded.
==============================================================================
3. GetLatestVimScripts Data File *getlatestvimscripts-data* *glvs-data*
The Data file has a header which should appear as:
>
ScriptID SourceID Filename
--------------------------
<
Below that are three columns; the first two are numeric followed by a
text column.
The first number on each line gives the script's ScriptID. When
you're about to use a web browser to look at scripts on
http://vim.sf.net/, just before you click on the script's link, you'll
see a line resembling
http://vim.sourceforge.net/scripts/script.php?script_id=40
The "40" happens to be a ScriptID that GetLatestVimScripts needs to
download the associated page.
The second number on each line gives the script's SourceID. The
SourceID records the count of uploaded scripts as determined by
vim.sf.net; hence it serves to indicate "when" a script was uploaded.
Setting the SourceID to 1 insures that GetLatestVimScripts will assume
that the script it has is out-of-date.
The SourceID is extracted by GetLatestVimScripts from the script's
page on vim.sf.net; whenever its greater than the one stored in the
GetLatestVimScripts.dat file, the script will be downloaded.
If your script's author has included a special comment line in his/her
plugin, the plugin itself will be used by GetLatestVimScripts to build
your <GetLatestVimScripts.dat> file, including any dependencies on
other scripts it may have.
If your comment field begins with :AutoInstall:, GetLatestVimScripts
will attempt to automatically install the script. Thus,
GetLatestVimScripts thus provides a comprehensive ability to keep your
plugins up-to-date!
==============================================================================
4. GetLatestVimScripts Plugins *getlatestvimscripts-plugins* *glvs-plugins*
If a plugin author includes the following comment anywhere in their
plugin, GetLatestVimScripts will find it and use it to build user's
GetLatestVimScripts.dat files:
>
src_id
v
" GetLatestVimScripts: ### ### yourscriptname
^
scriptid
<
As an author, you should include such a line in to refer to your own
script plus any additional lines describing any plugin dependencies it
may have. Same format, of course!
If your command is auto-installable (see |glvs-autoinstall|), and most
scripts are, then you may include :AutoInstall: at the start of
"yourscriptname".
GetLatestVimScript commands for those scripts are then appended, if
not already present, to the user's GetLatest/GetLatestVimScripts.dat
file. Its a relatively painless way to automate the acquisition of
any scripts your plugins depend upon.
Now, as an author, you probably don't want GetLatestVimScripts to
download your own scripts for you yourself, thereby overwriting your
not-yet-released hard work. GetLatestVimScripts provides a solution
for this: put
>
0 0 yourscriptname
<
into your <GetLatestVimScripts.dat> file and GetLatestVimScripts will
skip examining the "yourscriptname" scripts for those
GetLatestVimScript comment lines. As a result, those lines won't be
inadvertently installed into your <GetLatestVimScripts.dat> file and
subsequently used to download your own scripts. This is especially
important to do if you've included the :AutoInstall: option.
Be certain to use the same "yourscriptname" in the "0 0
yourscriptname" line as you've used in your GetLatestVimScript
comment!
==============================================================================
5. GetLatestVimScripts AutoInstall *getlatestvimscripts-autoinstall*
*glvs-autoinstall*
GetLatestVimScripts now supports "AutoInstall". Not all scripts are
supportive of auto-install, as they may have special things you need
to do to install them (please refer to the script's "install"
directions). On the other hand, most scripts will be
auto-installable.
To let GetLatestVimScripts do an autoinstall, the data file's comment
field should begin with (surrounding blanks are ignored):
:AutoInstall:
Both colons are needed, and it should begin the comment
(yourscriptname) field.
One may prevent any autoinstalling by putting the following line
in your <.vimrc>:
>
let g:GetLatestVimScripts_allowautoinstall= 0
<
With :AutoInstall: enabled, as it is by default, files which end with
---.tar.bz2 : decompressed and untarred in [.vim|vimfiles] directory
---.tar.gz : decompressed and untarred in [.vim|vimfiles] directory
---.vim.bz2 : decompressed and moved to the .vim/plugin directory
---.vim.gz : decompressed and moved to the .vim/plugin directory
---.zip : unzipped in [.vim|vimfiles] directory
---.vim : moved to [.vim|vimfiles]/plugin directory
and which merely need to have their components placed by the
untar/gunzip or move-to-plugin-directory process should be
auto-installable.
When is a script not auto-installable? Let me give an example:
>
[.vim|vimfiles]/after/syntax/blockhl.vim
<
The <blockhl.vim> script provides block highlighting for C/C++
programs; it is available at:
>
http://vim.sourceforge.net/scripts/script.php?script_id=104
<
Currently, vim's after/syntax only supports by-filetype scripts (in
blockhl.vim's case, that's after/syntax/c.vim). Hence, auto-install
would possibly overwrite the current user's after/syntax/c.vim file.
In my own case, I use <aftersyntax.vim> (renamed to
after/syntax/c.vim) to allow a after/syntax/c/ directory:
>
http://vim.sourceforge.net/scripts/script.php?script_id=1023
<
The script allows multiple syntax files to exist separately in the
after/syntax/c subdirectory. I can't bundle aftersyntax.vim in and
build an appropriate tarball for auto-install because of the potential
for the after/syntax/c.vim contained in it to overwrite a user's
c.vim.
==============================================================================
6. GetLatestVimScripts Algorithm *getlatestvimscripts-algorithm*
*glvs-alg*
The Vim sourceforge page dynamically creates a page by keying off of
the so-called script-id. Within the webpage of
http://vim.sourceforge.net/scripts/script.php?script_id=40
is a line specifying the latest source-id (src_id). The source
identifier numbers are always increasing, hence if the src_id is
greater than the one recorded for the script in GetLatestVimScripts
then its time to download a newer copy of that script.
GetLatestVimScripts will then download the script and update its
internal database of script ids, source ids, and scriptnames.
The AutoInstall process will:
Move the file from GetLatest/ to the following directory
Unix : $HOME/.vim
Windows: $HOME\vimfiles
if the downloaded file ends with ".bz2"
bunzip2 it
else if the downloaded file ends with ".gz"
gunzip it
if the resulting file ends with ".zip"
unzip it
else if the resulting file ends with ".tar"
tar -oxvf it
else if the resulting file ends with ".vim"
move it to the plugin subdirectory
==============================================================================
7. GetLatestVimScripts History *getlatestvimscripts-history* *glvs-hist*
v20 Dec 23, 2005 : * Eric Haarbauer found&fixed a bug with unzip use;
unzip needs the -o flag to overwrite.
v19 Nov 28, 2005 : * v18's GetLatestVimScript line accessed the wrong
script! Fixed.
v18 Mar 21, 2005 : * bugfix to automatic database construction
* bugfix - nowrapscan caused an error
(tnx to David Green for the fix)
Apr 01, 2005 * if shell is bash, "mv" instead of "ren" used in
:AutoInstall:s, even though its o/s is windows
Apr 01, 2005 * when downloading errors occurred, GLVS was
terminating early. It now just goes on to trying
the next script (after trying three times to
download a script description page)
Apr 20, 2005 * bugfix - when a failure to download occurred,
GetLatestVimScripts would stop early and claim that
everything was current. Fixed.
v17 Aug 25, 2004 : * g:GetLatestVimScripts_allowautoinstall, which
defaults to 1, can be used to prevent all
:AutoInstall:
v16 Aug 25, 2004 : * made execution of bunzip2/gunzip/tar/zip silent
* fixed bug with :AutoInstall: use of helptags
v15 Aug 24, 2004 : * bugfix: the "0 0 comment" download prevention wasn't
always preventing downloads (just usually). Fixed.
v14 Aug 24, 2004 : * bugfix -- helptags was using dotvim, rather than
s:dotvim. Fixed.
v13 Aug 23, 2004 : * will skip downloading a file if its scriptid or srcid
is zero. Useful for script authors; that way their
own GetLatestVimScripts activity won't overwrite
their scripts.
v12 Aug 23, 2004 : * bugfix - a "return" got left in the distribution that
was intended only for testing. Removed, now works.
* :AutoInstall: implemented
v11 Aug 20, 2004 : * GetLatestVimScripts is now a plugin:
* :GetLatestVimScripts command
* (runtimepath)/GetLatest/GetLatestVimScripts.dat
now holds scripts that need updating
v10 Apr 19, 2004 : * moved history from script to doc
v9 Jan 23, 2004 : windows (win32/win16/win95) will use
double quotes ("") whereas other systems will use
single quotes ('') around the urls in calls via wget
v8 Dec 01, 2003 : makes three tries at downloading
v7 Sep 02, 2003 : added error messages if "Click on..." or "src_id="
not found in downloaded webpage
Uses t_ti, t_te, and rs to make progress visible
v6 Aug 06, 2003 : final status messages now display summary of work
( "Downloaded someqty scripts" or
"Everything was current")
Now GetLatestVimScripts is careful about downloading
GetLatestVimScripts.vim itself!
(goes to <NEW_GetLatestVimScripts.vim>)
v5 Aug 04, 2003 : missing an endif near bottom
v4 Jun 17, 2003 : redraw! just before each "considering" message
v3 May 27, 2003 : Protects downloaded files from errant shell
expansions with single quotes: '...'
v2 May 14, 2003 : extracts name of item to be obtained from the
script file. Uses it instead of comment field
for output filename; comment is used in the
"considering..." line and is now just a comment!
* Fixed a bug: a string-of-numbers is not the
same as a number, so I added zero to them
and they became numbers. Fixes comparison.
==============================================================================
vim:tw=78:ts=8:ft=help

View File

@ -1,4 +1,4 @@
*gui.txt* For Vim version 7.0. Last change: 2006 May 04
*gui.txt* For Vim version 7.1a. Last change: 2006 Aug 08
VIM REFERENCE MANUAL by Bram Moolenaar
@ -510,7 +510,7 @@ floating menus that do not appear on the main menu bar.
*:ime* *:imenu* *:inoreme* *:inoremenu*
*:cme* *:cmenu* *:cnoreme* *:cnoremenu*
*E330* *E327* *E331* *E336* *E333*
*E328* *E329* *E337*
*E328* *E329* *E337* *E792*
To create a new menu item, use the ":menu" commands. They are mostly like
the ":map" set of commands but the first argument is a menu item name, given
as a path of menus and submenus with a '.' between them, e.g.: >

View File

@ -1,4 +1,4 @@
*gui_w16.txt* For Vim version 7.0. Last change: 2005 Mar 29
*gui_w16.txt* For Vim version 7.1a. Last change: 2005 Mar 29
VIM REFERENCE MANUAL by Bram Moolenaar

View File

@ -1,4 +1,4 @@
*gui_w32.txt* For Vim version 7.0. Last change: 2005 Mar 29
*gui_w32.txt* For Vim version 7.1a. Last change: 2007 May 03
VIM REFERENCE MANUAL by Bram Moolenaar
@ -233,7 +233,8 @@ $VIMRUNTIME/mswin.vim script. You could add this line to your _vimrc file: >
Since CTRL-C is used to copy the text to the clipboard, it can't be used to
cancel an operation. Use CTRL-Break for that.
CTRL-Z is used for undo. This means you can't suspend Vim.
CTRL-Z is used for undo. This means you can't suspend Vim with this key, use
|:suspend| instead (if it's supported at all).
*CTRL-V-alternative* *CTRL-Q*
Since CTRL-V is used to paste, you can't use it to start a blockwise Visual
@ -463,6 +464,8 @@ This maps Alt-Space to pop down the system menu for the Vim window. Note that
Maps Control-N to produce the keys Alt-Space followed by N. This minimizes the
Vim window via the system menu.
Note that the key changes depending on the language you are using.
*intellimouse-wheel-problems*
When using the Intellimouse mouse wheel causes Vim to stop accepting input, go
to:

View File

@ -1,4 +1,4 @@
*gui_x11.txt* For Vim version 7.0. Last change: 2006 Apr 30
*gui_x11.txt* For Vim version 7.1a. Last change: 2006 Jul 12
VIM REFERENCE MANUAL by Bram Moolenaar
@ -406,8 +406,9 @@ These are the different looks:
- That means the menubar and toolbar handles are back! Yeah! And the
resizing grid still works too.
GNOME is automatically compiled with if it was found by configure.
(FIXME: Is this still true? Use --enable-gnome-check to force it to.)
GNOME is compiled with if it was found by configure and the
--enable-gnome-check argument was used.
GNOME session support *gui-gnome-session* *gnome-session*
@ -436,7 +437,7 @@ command line argument).
==============================================================================
7. KDE version *gui-kde* *kde* *KDE* *KVim*
*gui-x11-kde*
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.
@ -497,12 +498,6 @@ menus look a bit better. Edit the Makefile and look for "XAW_LIB". The
scrollbars will remain the same, because Vim has its own, which are already
3D (in fact, they look more like Motif).
*gui-x11-kde*
For Vim-KDE, you need at least Qt(>=2.x) and the corresponding kdelibs.
To compile, you must use the --with-qt-dir configure flag because QTDIR is not
automatically detected yet. Giving KDE's directories to the configure script
may also help in some cases.
*gui-x11-neXtaw*
The neXtaw version is mostly like Athena, but uses different widgets.

View File

@ -1,4 +1,4 @@
*hangulin.txt* For Vim version 7.0. Last change: 2006 Apr 02
*hangulin.txt* For Vim version 7.1a. Last change: 2006 Apr 02
VIM REFERENCE MANUAL by Chi-Deok Hwang and Sung-Hyun Nam

View File

@ -1,4 +1,4 @@
*hebrew.txt* For Vim version 7.0. Last change: 2003 May 11
*hebrew.txt* For Vim version 7.1a. Last change: 2003 May 11
VIM REFERENCE MANUAL by Ron Aaron (and Avner Lottem)

View File

@ -1,4 +1,4 @@
*help.txt* For Vim version 7.0. Last change: 2006 May 07
*help.txt* For Vim version 7.1a. Last change: 2006 Nov 07
VIM - main help file
k
@ -143,6 +143,7 @@ Special issues ~
|farsi.txt| Farsi (Persian) editing
|hebrew.txt| Hebrew language support and editing
|russian.txt| Russian language support and editing
|ada.txt| Ada (the programming language) support
|hangulin.txt| Hangul (Korean) input mode
|rileft.txt| right-to-left editing mode
@ -189,10 +190,12 @@ Remarks about specific systems ~
|os_win32.txt| MS-Windows 95/98/NT
*standard-plugin-list*
Standard plugins ~
|pi_getscript.txt| Downloading latest version of Vim scripts
|pi_gzip.txt| Reading and writing compressed files
|pi_netrw.txt| Reading and writing files over a network
|pi_paren.txt| Highlight matching parens
|pi_tar.txt| Tar file explorer
|pi_vimball.txt| Create a self-installing Vim script
|pi_zip.txt| Zip archive explorer
LOCAL ADDITIONS: *local-additions*

View File

@ -1,4 +1,4 @@
*howto.txt* For Vim version 7.0. Last change: 2006 Apr 02
*howto.txt* For Vim version 7.1a. Last change: 2006 Apr 02
VIM REFERENCE MANUAL by Bram Moolenaar

View File

@ -1,4 +1,4 @@
*if_cscop.txt* For Vim version 7.0. Last change: 2005 Mar 29
*if_cscop.txt* For Vim version 7.1a. Last change: 2005 Mar 29
VIM REFERENCE MANUAL by Andy Kahn

View File

@ -1,4 +1,4 @@
*if_mzsch.txt* For Vim version 7.0. Last change: 2006 Apr 30
*if_mzsch.txt* For Vim version 7.1a. Last change: 2007 May 03
VIM REFERENCE MANUAL by Sergey Khorev
@ -23,6 +23,8 @@ Dynamic loading added by Sergey Khorev
For downloading MzScheme and other info:
http://www.plt-scheme.org/software/mzscheme/
Note: On FreeBSD you should use the "drscheme" port.
==============================================================================
1. Commands *mzscheme-commands*
@ -262,8 +264,9 @@ 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".
"libmzgc209_000.dll". To know for sure look at the output of the ":version"
command, look for -DDYNAMIC_MZSCH_DLL="something" and
-DDYNAMIC_MZGC_DLL="something" in the "Compilation" info.
======================================================================
vim:tw=78:ts=8:sts=4:ft=help:norl:

View File

@ -1,4 +1,4 @@
*if_ole.txt* For Vim version 7.0. Last change: 2006 Apr 30
*if_ole.txt* For Vim version 7.1a. Last change: 2006 Apr 30
VIM REFERENCE MANUAL by Paul Moore

View File

@ -1,4 +1,4 @@
*if_perl.txt* For Vim version 7.0. Last change: 2006 Mar 06
*if_perl.txt* For Vim version 7.1a. Last change: 2006 Mar 06
VIM REFERENCE MANUAL by Sven Verdoolaege

View File

@ -1,4 +1,4 @@
*if_pyth.txt* For Vim version 7.0. Last change: 2006 Apr 30
*if_pyth.txt* For Vim version 7.1a. Last change: 2006 Apr 30
VIM REFERENCE MANUAL by Paul Moore

View File

@ -1,4 +1,4 @@
*if_ruby.txt* For Vim version 7.0. Last change: 2006 Apr 30
*if_ruby.txt* For Vim version 7.1a. Last change: 2006 Apr 30
VIM REFERENCE MANUAL by Shugo Maeda

View File

@ -1,4 +1,4 @@
*if_sniff.txt* For Vim version 7.0. Last change: 2005 Mar 29
*if_sniff.txt* For Vim version 7.1a. Last change: 2005 Mar 29
VIM REFERENCE MANUAL

View File

@ -1,4 +1,4 @@
*if_tcl.txt* For Vim version 7.0. Last change: 2006 Mar 06
*if_tcl.txt* For Vim version 7.1a. Last change: 2006 Mar 06
VIM REFERENCE MANUAL by Ingo Wilken

View File

@ -1,4 +1,4 @@
*indent.txt* For Vim version 7.0. Last change: 2007 Mar 17
*indent.txt* For Vim version 7.1a. Last change: 2007 Mar 17
VIM REFERENCE MANUAL by Bram Moolenaar

View File

@ -1,4 +1,4 @@
*index.txt* For Vim version 7.0. Last change: 2006 Apr 30
*index.txt* For Vim version 7.1a. Last change: 2007 May 05
VIM REFERENCE MANUAL by Bram Moolenaar
@ -624,9 +624,10 @@ tag char note action in Normal mode ~
included files that contains the word under
the cursor, start searching at beginning of
current file
|[p| [p 2 like "P", but adjust indent to current line
|[m| [m 1 cursor N times back to start of member
function
|[p| [p 2 like "P", but adjust indent to current line
|[s| [s 1 move to the previous misspelled word
|[z| [z 1 move to start of open fold
|[{| [{ 1 cursor N times back to unmatched '{'
|[<MiddleMouse> [<MiddleMouse> 2 same as "[p"
@ -663,9 +664,10 @@ tag char note action in Normal mode ~
included files that contains the word under
the cursor, start searching at cursor
position
|]p| ]p 2 like "p", but adjust indent to current line
|]m| ]m 1 cursor N times forward to end of member
function
|]p| ]p 2 like "p", but adjust indent to current line
|]s| ]s 1 move to next misspelled word
|]z| ]z 1 move to end of open fold
|]}| ]} 1 cursor N times forward to unmatched '}'
|]<MiddleMouse> ]<MiddleMouse> 2 same as "]p"
@ -748,6 +750,8 @@ 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
|netrw-gx| gx execute application for file name under the
cursor (only with |netrw| plugin)
|g@| g@{motion} call 'operatorfunc'
|g~| g~{motion} 2 swap case for Nmove text
|g<Down>| g<Down> 1 same as "gj"
@ -984,7 +988,7 @@ file names, tags, commands etc. as appropriate.
{expr}
CTRL-\ f - z reserved for extensions
CTRL-\ others not used
CTRL-] not used
|c_CTRL-]| CTRL-] trigger abbreviation
|c_CTRL-^| CTRL-^ toggle use of |:lmap| mappings
|c_CTRL-_| CTRL-_ when 'allowrevins' set: change language
(Hebrew, Farsi)

View File

@ -1,4 +1,4 @@
*insert.txt* For Vim version 7.0. Last change: 2006 May 05
*insert.txt* For Vim version 7.1a. Last change: 2007 Apr 28
VIM REFERENCE MANUAL by Bram Moolenaar
@ -219,8 +219,8 @@ CTRL-_ Switch between languages, as follows:
Please refer to |rileft.txt| for more information about
right-to-left mode.
{not in Vi}
Only if compiled with the |+rightleft| feature (which is not
the default).
Only if compiled with the |+rightleft| feature.
*i_CTRL-^*
CTRL-^ Toggle the use of typing language characters.
When language |:lmap| mappings are defined:
@ -1156,14 +1156,15 @@ any printable, non-white character:
In all three states these can be used:
CTRL-Y Yes: Accept the currently selected match and stop completion.
CTRL-E End completion, go back to what was typed.
CTRL-E End completion, go back to what was there before selecting a
match (what was typed or longest common string).
<PageUp> Select a match several entries back, but don't insert it.
<PageDown> Select a match several entries further, but don't insert it.
<Up> Select the previous match, as if CTRL-P was used, but don't
insert it.
<Down> Select the next match, as if CTRL-N was used, but don't
insert it.
space or <Tab> Stop completion without changing the match and insert the
<Space> or <Tab> Stop completion without changing the match and insert the
typed character.
The behavior of the Enter key depends on the state you are in:
@ -1210,7 +1211,8 @@ 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/
it here: http://ctags.sourceforge.net/ Version 5.6 or later is recommended.
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
A compiled .exe for MS-Windows can be found at:
@ -1330,9 +1332,9 @@ will be suggested. All other elements are not placed in suggestion list.
PHP *ft-php-omni*
Completion of PHP code requires tags file for completion of data from external
files. You should use Exuberant ctags version 5.5.4 or newer. You can find it
here: http://ctags.sourceforge.net/
Completion of PHP code requires a tags file for completion of data from
external files and for class aware completion. You should use Exuberant ctags
version 5.5.4 or newer. You can find it here: http://ctags.sourceforge.net/
Script completes:
@ -1390,8 +1392,10 @@ The completions provided by CTRL-X CTRL-O are sensitive to the context:
Notes:
- Vim will load/evaluate code in order to provide completions. This may
cause some code execution, which may be a concern.
- In context 1 above, Vim can parse the entire buffer to add a list of
cause some code execution, which may be a concern. This is no longer
enabled by default, to enable this feature add >
let g:rubycomplete_buffer_loading = 1
<- In context 1 above, Vim can parse the entire buffer to add a list of
classes to the completion results. This feature is turned off by default,
to enable it add >
let g:rubycomplete_classes_in_global = 1
@ -1407,8 +1411,13 @@ Notes:
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.
Vim has the ability to color syntax highlight nearly 500 languages. Part of
this highlighting includes knowing what keywords are part of a language. Many
filetypes already have custom completion scripts written for them, the
syntaxcomplete plugin provides basic completion for all other filetypes. It
does this by populating the omni completion list with the text Vim already
knows how to color highlight. It can be used for any filetype and provides a
minimal language-sensitive completion.
To enable syntax code completion you can run: >
setlocal omnifunc=syntaxcomplete#Complete
@ -1461,6 +1470,15 @@ groups: >
You can create as many of these variables as you need, varying only the
filetype at the end of the variable name.
The plugin uses the isKeyword option to determine where word boundaries are
for the syntax items. For example, in the Scheme language completion should
include the "-", call-with-output-file. Depending on your filetype, this may
not provide the words you are expecting. Setting the
g:omni_syntax_use_iskeyword option to 0 will force the syntax plugin to break
on word characters. This can be controlled adding the following to your
vimrc: >
let g:omni_syntax_use_iskeyword = 0
SQL *ft-sql-omni*
@ -1771,13 +1789,13 @@ NOTE: ":append" and ":insert" don't work properly in between ":if" and
See |++opt| for the possible values of [++opt].
*:r!* *:read!*
:r[ead] !{cmd} Execute {cmd} and insert its standard output below
the cursor. A temporary file is used to store the
output of the command which is then read into the
buffer. 'shellredir' is used to save the output of
the command, which can be set to include stderr or
not. {cmd} is executed like with ":!{cmd}", any '!'
is replaced with the previous command |:!|.
:[range]r[ead] !{cmd} Execute {cmd} and insert its standard output below
the cursor or the specified line. A temporary file is
used to store the output of the command which is then
read into the buffer. 'shellredir' is used to save
the output of the command, which can be set to include
stderr or not. {cmd} is executed like with ":!{cmd}",
any '!' is replaced with the previous command |:!|.
These commands insert the contents of a file, or the output of a command,
into the buffer. They can be undone. They cannot be repeated with the "."

View File

@ -1,4 +1,4 @@
*intro.txt* For Vim version 7.0. Last change: 2006 Apr 20
*intro.txt* For Vim version 7.1a. Last change: 2006 Apr 20
VIM REFERENCE MANUAL by Bram Moolenaar

View File

@ -1,4 +1,4 @@
*map.txt* For Vim version 7.0. Last change: 2007 Mar 08
*map.txt* For Vim version 7.1a. Last change: 2007 Mar 24
VIM REFERENCE MANUAL by Bram Moolenaar
@ -227,10 +227,12 @@ text before the cursor and start omni completion when some condition is met.
Be very careful about side effects! The expression is evaluated while
obtaining characters, you may very well make the command dysfunctional.
For this reason the following is blocked:
- changing the buffer text |textlock|
- editing another buffer
- the |:normal| command
- moving the cursor is allowed, but it is restored afterwards
- Changing the buffer text |textlock|.
- Editing another buffer.
- The |:normal| command.
- Moving the cursor is allowed, but it is restored afterwards.
- You can use getchar(), but the existing typeahead isn't seen and new
typeahead is discarded.
If you want the mapping to do any of these let the returned characters do
that.
@ -352,9 +354,11 @@ was already done when typing the mapping.
When listing mappings the characters in the first two columns are:
CHAR MODE ~
<Space> Normal, Visual and Operator-pending
<Space> Normal, Visual, Select and Operator-pending
n Normal
v Visual
v Visual and Select
s Select
x Visual
o Operator-pending
! Insert and Command-line
i Insert
@ -590,7 +594,18 @@ the '<' flag must not be present in 'cpoptions' for this to work). >
:map <M-g> /foo<CR>cwbar<Esc>
:map _x d/END/e<CR>
:map! qq quadrillion questions
<
Multiplying a count
When you type a count before triggering a mapping, it's like the count was
typed before the {lhs}. For example, with this mapping: >
:map <F4> 3w
Typing 2<F4> will result in "23w". Thus not moving 2 * 3 words but 23 words.
If you want to multiply counts use the expression register: >
:map <F4> @='3w'<CR>
The part between quotes is the expression being executed. |@=|
1.9 USING MAPPINGS *map-typing*
@ -1127,7 +1142,7 @@ There are a number of attributes, split into four categories: argument
handling, completion behavior, range handling, and special cases. The
attributes are described below, by category.
Argument handling *E175* *E176*
Argument handling *E175* *E176* *:command-nargs*
By default, a user defined command will take no arguments (and an error is
reported if any are supplied). However, it is possible to specify that the
@ -1155,8 +1170,8 @@ defined, not where it is invoked! Example:
Executing script2.vim will result in "None" to be echoed. Not what you
intended! Calling a function may be an alternative.
Completion behavior *:command-completion*
*E179* *E180* *E181*
Completion behavior *:command-completion* *E179*
*E180* *E181* *:command-complete*
By default, the arguments of user defined commands do not undergo completion.
However, by specifying one or the other of the following attributes, argument
completion can be enabled:
@ -1228,13 +1243,16 @@ the 'path' option: >
:endfun
<
Range handling *E177* *E178*
Range handling *E177* *E178* *:command-range*
*:command-count*
By default, user-defined commands do not accept a line number range. However,
it is possible to specify that the command does take a range (the -range
attribute), or that it takes an arbitrary count value, either in the line
number position (-range=N, like the |:split| command) or as a "count"
argument (-count=N, like the |:Next| command). Possible attributes are:
argument (-count=N, like the |:Next| command). The count will then be
available in the argument with |<count>|.
Possible attributes are:
-range Range allowed, default is current line
-range=% Range allowed, default is whole file (1,$)
@ -1247,8 +1265,8 @@ argument (-count=N, like the |:Next| command). Possible attributes are:
Note that -range=N and -count=N are mutually exclusive - only one should be
specified.
Special cases
Special cases *:command-bang* *:command-bar*
*:command-register* *:command-buffer*
There are some special cases as well:
-bang The command can take a ! modifier (like :q or :w)

View File

@ -1,4 +1,4 @@
*mbyte.txt* For Vim version 7.0. Last change: 2006 Apr 30
*mbyte.txt* For Vim version 7.1a. Last change: 2006 Aug 11
VIM REFERENCE MANUAL by Bram Moolenaar et al.
@ -403,7 +403,8 @@ depends on the system used, no detailed list can be given.
8bit 2byte MS-Windows: works for all codepages installed on your
system; you can only type 8bit characters;
Other systems: does NOT work.
8bit Unicode Works, but you can only type 8bit characters; in a
8bit Unicode Works, but only 8bit characters can be typed directly
(others through digraphs, keymaps, etc.); in a
terminal you can only see 8bit characters; the GUI can
show all characters that the 'guifont' supports.

View File

@ -1,4 +1,4 @@
*message.txt* For Vim version 7.0. Last change: 2006 Apr 30
*message.txt* For Vim version 7.1a. Last change: 2007 Mar 20
VIM REFERENCE MANUAL by Bram Moolenaar
@ -25,7 +25,8 @@ 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.
prompt. You are then back at the hit-enter prompt and can then scroll further
back.
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.

View File

@ -1,4 +1,4 @@
*mlang.txt* For Vim version 7.0. Last change: 2004 Feb 24
*mlang.txt* For Vim version 7.1a. Last change: 2006 Jul 12
VIM REFERENCE MANUAL by Bram Moolenaar
@ -114,7 +114,7 @@ the language of your choice. use "en" to disable translations. >
==============================================================================
2. Menus *multilang-menus*
See |45.2| for the basics.
See |45.2| for the basics, esp. using 'langmenu'.
Note that if changes have been made to the menus after the translation was
done, some of the menus may be shown in English. Please try contacting the

View File

@ -1,4 +1,4 @@
*motion.txt* For Vim version 7.0. Last change: 2006 Apr 30
*motion.txt* For Vim version 7.1a. Last change: 2006 Dec 07
VIM REFERENCE MANUAL by Bram Moolenaar
@ -169,15 +169,15 @@ l or *l*
*0*
0 To the first character of the line. |exclusive|
motion. When moving up or down, stay in same screen
column (if possible).
motion.
*<Home>* *<kHome>*
<Home> To the first character of the line. |exclusive|
motion. When moving up or down, stay in same text
column (if possible). Works like "1|", which differs
from "0" when the line starts with a <Tab>. {not in
Vi}
motion. When moving up or down next, stay in same
TEXT column (if possible). Most other commands stay
in the same SCREEN column. <Home> works like "1|",
which differs from "0" when the line starts with a
<Tab>. {not in Vi}
*^*
^ To the first non-blank character of the line.
@ -752,11 +752,11 @@ m[ or m] Set the |'[| or |']| mark. Useful when an operator is
be omitted.
*'* *'a* *`* *`a*
'{a-z} `{a-z} Jump to the mark {a-z}.
'{a-z} `{a-z} Jump to the mark {a-z} in the current buffer.
*'A* *'0* *`A* *`0*
'{A-Z0-9} `{A-Z0-9} To the mark {A-Z0-9} in the correct file (not a motion
command when in another file). {not in Vi}
'{A-Z0-9} `{A-Z0-9} To the mark {A-Z0-9} in the file where it was set (not
a motion command when in another file). {not in Vi}
*g'* *g'a* *g`* *g`a*
g'{mark} g`{mark}

View File

@ -1,4 +1,4 @@
*netbeans.txt* For Vim version 7.0. Last change: 2006 Nov 14
*netbeans.txt* For Vim version 7.1a. Last change: 2006 Nov 14
VIM REFERENCE MANUAL by Gordon Prieur

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 7.0. Last change: 2006 May 04
*options.txt* For Vim version 7.1a. Last change: 2007 May 05
VIM REFERENCE MANUAL by Bram Moolenaar
@ -312,7 +312,7 @@ For example, you have two windows, both on C source code. They use the global
then the other window will switch to the same value. There is no need to set
the 'makeprg' option in the other C source window too.
However, if you start editing a Perl file in a new window, you want to use
another 'makeprog' for it, without changing the value used for the C source
another 'makeprg' for it, without changing the value used for the C source
files. You use this command: >
:setlocal makeprg=perlmake
You can switch back to using the global value by making the local value empty: >
@ -455,7 +455,7 @@ There are two forms of modelines. The first form:
[white] optional white space
{options} a list of option settings, separated with white space or ':',
where each part between ':' is the argument for a ":set"
command
command (can be empty)
Example:
vi:noai:sw=3 ts=6 ~
@ -528,7 +528,12 @@ This sets the 'dir' option to "c:\tmp". Only a single backslash before the
':' is removed. Thus to include "\:" you have to specify "\\:".
No other commands than "set" are supported, for security reasons (somebody
might create a Trojan horse text file with modelines).
might create a Trojan horse text file with modelines). And not all options
can be set. For some options a flag is set, so that when it's used the
|sandbox| is effective. Still, there is always a small risk that a modeline
causes trouble. E.g., when some joker sets 'textwidth' to 5 all your lines
are wrapped unexpectedly. So disable modelines before editing untrusted text.
The mail ftplugin does this, for example.
Hint: If you would like to do something else than setting an option, you could
define an autocommand that checks the file for a specific string. For
@ -734,9 +739,9 @@ A jump table for the options with a short description can be found at |Q_op|.
Copy indent from current line when starting a new line (typing <CR>
in Insert mode or when using the "o" or "O" command). If you do not
type anything on the new line except <BS> or CTRL-D and then type
<Esc> or <CR>, the indent is deleted again. Moving the cursor to
another line has the same effect, unless the 'I' flag is included in
'cpoptions'.
<Esc>, CTRL-O or <CR>, the indent is deleted again. Moving the cursor
to another line has the same effect, unless the 'I' flag is included
in 'cpoptions'.
When autoindent is on, formatting (with the "gq" command or when you
reach 'textwidth' in Insert mode) uses the indentation of the first
line.
@ -896,8 +901,8 @@ A jump table for the options with a short description can be found at |Q_op|.
The "auto" value is the middle way: When Vim sees that renaming file
is possible without side effects (the attributes can be passed on and
and the file is not a link) that is used. When problems are expected,
a copy will be made.
the file is not a link) that is used. When problems are expected, a
copy will be made.
The "breaksymlink" and "breakhardlink" values can be used in
combination with any of "yes", "no" and "auto". When included, they
@ -1000,7 +1005,12 @@ 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
Note that environment variables are not expanded. If you want to use
$HOME you must expand it explicitly, e.g.: >
:let backupskip = escape(expand('$HOME'), '\') . '/tmp/*'
< 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|.
@ -1464,8 +1474,12 @@ A jump table for the options with a short description can be found at |Q_op|.
option will cause the window size to be changed. When you only want
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.
Minimum value is 12, maximum value is 10000.
number of columns of the display, the display may be messed up. For
the GUI it is always possible and Vim limits the number of columns to
what fits on the screen. You can use this command to get the widest
window possible: >
:set columns=9999
< Minimum value is 12, maximum value is 10000.
*'comments'* *'com'* *E524* *E525*
'comments' 'com' string (default
@ -1510,8 +1524,9 @@ A jump table for the options with a short description can be found at |Q_op|.
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|.
happen for the system-wide vimrc or gvimrc file, nor for a file given
with the |-u| argument). 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
@ -1658,7 +1673,9 @@ A jump table for the options with a short description can be found at |Q_op|.
used.
preview Show extra information about the currently selected
completion in the preview window.
completion in the preview window. Only works in
combination with "menu" or "menuone".
*'confirm'* *'cf'* *'noconfirm'* *'nocf'*
'confirm' 'cf' boolean (default off)
@ -2326,7 +2343,7 @@ A jump table for the options with a short description can be found at |Q_op|.
NOTE: Changing this option will not change the encoding of the
existing text in Vim. It may cause non-ASCII text to become invalid.
It should normally be kept at its default value, or set when Vim
starts up. See |multibyte|.
starts up. See |multibyte|. To reload the menus see |:menutrans|.
NOTE: For GTK+ 2 it is highly recommended to set 'encoding' to
"utf-8". Although care has been taken to allow different values of
@ -2516,7 +2533,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|mbyte-conversion|.
When reading a file 'fileencoding' will be set from 'fileencodings'.
To read a file in a certain encoding it won't work by setting
'fileencoding', use the |++enc| argument.
'fileencoding', use the |++enc| argument. One exception: when
'fileencodings' is empty the value of 'fileencoding' is used.
For a new file the global value of 'fileencoding' is used.
Prepending "8bit-" and "2byte-" has no meaning here, they are ignored.
When the option is set, the value is converted to lowercase. Thus
@ -3311,7 +3329,7 @@ A jump table for the options with a short description can be found at |Q_op|.
"+=" and "-=" feature of ":set" |add-option-flags|.
Valid letters are as follows:
*guioptions_a*
*guioptions_a* *'go-a'*
'a' Autoselect: If present, then whenever VISUAL mode is started,
or the Visual area extended, Vim tries to become the owner of
the windowing system's global selection. This means that the
@ -3326,7 +3344,7 @@ A jump table for the options with a short description can be found at |Q_op|.
windowing system's global selection unless explicitly told to
by a yank or delete operation for the "* register.
The same applies to the modeless selection.
*'go-A'*
'A' Autoselect for the modeless selection. Like 'a', but only
applies to the modeless selection.
@ -3336,15 +3354,16 @@ A jump table for the options with a short description can be found at |Q_op|.
"A" - yes
"aA" yes yes
*'go-c'*
'c' Use console dialogs instead of popup dialogs for simple
choices.
*'go-e'*
'e' Add tab pages when indicated with 'showtabline'.
'guitablabel' can be used to change the text in the labels.
When 'e' is missing a non-GUI tab pages line may be used.
The GUI tabs are only supported on some systems, currently
GTK, Motif and MS-Windows.
*'go-f'*
'f' Foreground: Don't use fork() to detach the GUI from the shell
where it was started. Use this for programs that wait for the
editor to finish (e.g., an e-mail program). Alternatively you
@ -3352,51 +3371,63 @@ A jump table for the options with a short description can be found at |Q_op|.
foreground. |gui-fork|
Note: Set this option in the vimrc file. The forking may have
happened already when the |gvimrc| file is read.
*'go-i'*
'i' Use a Vim icon. For GTK with KDE it is used in the left-upper
corner of the window. It's black&white on non-GTK, because of
limitations of X11. For a color icon, see |X11-icon|.
*'go-m'*
'm' Menu bar is present.
*'go-M'*
'M' The system menu "$VIMRUNTIME/menu.vim" is not sourced. Note
that this flag must be added in the .vimrc file, before
switching on syntax or filetype recognition (when the |gvimrc|
file is sourced the system menu has already been loaded; the
":syntax on" and ":filetype on" commands load the menu too).
*'go-g'*
'g' Grey menu items: Make menu items that are not active grey. If
'g' is not included inactive menu items are not shown at all.
Exception: Athena will always use grey menu items.
*'go-t'*
't' Include tearoff menu items. Currently only works for Win32,
GTK+, and Motif 1.2 GUI.
*'go-T'*
'T' Include Toolbar. Currently only in Win32, GTK+, Motif, Photon
and Athena GUIs.
*'go-r'*
'r' Right-hand scrollbar is always present.
*'go-R'*
'R' Right-hand scrollbar is present when there is a vertically
split window.
*'go-l'*
'l' Left-hand scrollbar is always present.
*'go-L'*
'L' Left-hand scrollbar is present when there is a vertically
split window.
*'go-b'*
'b' Bottom (horizontal) scrollbar is present. Its size depends on
the longest visible line, or on the cursor line if the 'h'
flag is included. |gui-horiz-scroll|
*'go-h'*
'h' Limit horizontal scrollbar size to the length of the cursor
line. Reduces computations. |gui-horiz-scroll|
And yes, you may even have scrollbars on the left AND the right if
you really want to :-). See |gui-scrollbars| for more information.
*'go-v'*
'v' Use a vertical button layout for dialogs. When not included,
a horizontal layout is preferred, but when it doesn't fit a
vertical layout is used anyway.
*'go-p'*
'p' Use Pointer callbacks for X11 GUI. This is required for some
window managers. If the cursor is not blinking or hollow at
the right moment, try adding this flag. This must be done
before starting the GUI. Set it in your |gvimrc|. Adding or
removing it after the GUI has started has no effect.
*'go-F'*
'F' Add a footer. Only for Motif. See |gui-footer|.
*'guipty'* *'noguipty'*
'guipty' boolean (default on)
global
@ -4304,6 +4335,7 @@ A jump table for the options with a short description can be found at |Q_op|.
:set lcs=extends:>,precedes:<
< The "NonText" highlighting will be used for "eol", "extends" and
"precedes". "SpecialKey" for "nbsp", "tab" and "trail".
|hl-NonText| |hl-SpecialKey|
*'lpl'* *'nolpl'* *'loadplugins'* *'noloadplugins'*
'loadplugins' 'lpl' boolean (default on)
@ -4328,7 +4360,9 @@ A jump table for the options with a short description can be found at |Q_op|.
if exists('&macatsui')
set nomacatsui
endif
<
< Another option to check if you have drawing problems is
'termencoding'.
*'magic'* *'nomagic'*
'magic' boolean (default on)
global
@ -4361,13 +4395,14 @@ A jump table for the options with a short description can be found at |Q_op|.
'makeprg' 'mp' string (default "make", VMS: "MMS")
global or local to buffer |global-local|
{not in Vi}
Program to use for the ":make" command. See |:make_makeprg|. This
option may contain '%' and '#' characters, which are expanded like
when used in a command-line. Environment variables are expanded
|:set_env|. See |option-backslash| about including spaces and
backslashes. Note that a '|' must be escaped twice: once for ":set"
and once for the interpretation of a command. When you use a filter
called "myfilter" do it like this: >
Program to use for the ":make" command. See |:make_makeprg|.
This option may contain '%' and '#' characters, which are expanded to
the current and alternate file name. |:_%| |:_#|
Environment variables are expanded |:set_env|. See |option-backslash|
about including spaces and backslashes.
Note that a '|' must be escaped twice: once for ":set" and once for
the interpretation of a command. When you use a filter called
"myfilter" do it like this: >
:set makeprg=gmake\ \\\|\ myfilter
< The placeholder "$*" can be given (even multiple times) to specify
where the arguments will be included, for example: >
@ -4380,10 +4415,10 @@ A jump table for the options with a short description can be found at |Q_op|.
local to buffer
{not in Vi}
Characters that form pairs. The |%| command jumps from one to the
other. Currently only single character pairs are allowed, and they
must be different. The characters must be separated by a colon. The
pairs must be separated by a comma. Example for including '<' and '>'
(HTML): >
other. Currently only single byte character pairs are allowed, and
they must be different. The characters must be separated by a colon.
The pairs must be separated by a comma. Example for including '<' and
'>' (HTML): >
:set mps+=<:>
< A more exotic example, to jump between the '=' and ';' in an
@ -4419,6 +4454,8 @@ A jump table for the options with a short description can be found at |Q_op|.
'maxfuncdepth' 'mfd' number (default 100)
global
{not in Vi}
{not available when compiled without the +eval
feature}
Maximum depth of function calls for user functions. This normally
catches endless recursion. When using a recursive function with
more depth, set 'maxfuncdepth' to a bigger number. But this will use
@ -4453,8 +4490,8 @@ A jump table for the options with a short description can be found at |Q_op|.
Maximum amount of memory (in Kbyte) to use for pattern matching.
Maximum value 2000000. Use this to work without a limit.
*E363*
When Vim runs into the limit it gives an error message mostly behaves
like CTRL-C was typed.
When Vim runs into the limit it gives an error message and mostly
behaves like CTRL-C was typed.
Running into the limit often means that the pattern is very
inefficient or too complex. This may already happen with the pattern
"\(.\)*" on a very long line. ".*" works much better.
@ -4520,7 +4557,8 @@ A jump table for the options with a short description can be found at |Q_op|.
languages, no matter what you set 'mkspellmem' to.
*'modeline'* *'ml'* *'nomodeline'* *'noml'*
'modeline' 'ml' boolean (Vim default: on, Vi default: off)
'modeline' 'ml' boolean (Vim default: on (off for root),
Vi default: off)
local to buffer
*'modelines'* *'mls'*
'modelines' 'mls' number (default 5)
@ -4796,7 +4834,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|:filetype-plugin-on|
*'opendevice* *'odev* *'noopendevice* *'noodev*
*'opendevice'* *'odev'* *'noopendevice'* *'noodev'*
'opendevice' 'odev' boolean (default off)
global
{not in Vi}
@ -5422,7 +5460,7 @@ A jump table for the options with a short description can be found at |Q_op|.
1. When "jump" is not included, the relative offset is
adjusted for the scroll position in the new current
window. When going back to the other window, the
the new relative offset will be used.
new relative offset will be used.
2. When "jump" is included, the other windows are
scrolled to keep the same relative offset. When
going back to the other window, it still uses the
@ -5527,8 +5565,6 @@ A jump table for the options with a short description can be found at |Q_op|.
winsize window sizes
Don't include both "curdir" and "sesdir".
There is no option to include tab pages yet, only the current tab page
is stored in the session. |tab-page|
When "curdir" nor "sesdir" is included, file names are stored with
absolute paths.
"slash" and "unix" are useful on Windows when sharing session files
@ -5823,8 +5859,8 @@ 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
|+cmdline_info| feature}
Show (partial) command in status line. Set this option off if your
terminal is slow.
Show (partial) command in the last line of the screen. Set this
option off if your terminal is slow.
In Visual mode the size of the selected area is shown:
- When selecting characters within a line, the number of characters.
- When selecting more than one line, the number of lines.
@ -6228,7 +6264,8 @@ A jump table for the options with a short description can be found at |Q_op|.
- not applicable
item meaning ~
f S Path to the file in the buffer, relative to current directory.
f S Path to the file in the buffer, as typed or relative to current
directory.
F S Full path to the file in the buffer.
t S File name (tail) of file in the buffer.
m F Modified flag, text is " [+]"; " [-]" if 'modifiable' is off.
@ -6672,7 +6709,8 @@ A jump table for the options with a short description can be found at |Q_op|.
Encoding used for the terminal. This specifies what character
encoding the keyboard produces and the display will understand. For
the GUI it only applies to the keyboard ('encoding' is used for the
display).
display). Except for the Mac when 'macatsui' is off, then
'termencoding' should be "macroman".
In the Win32 console version the default value is the console codepage
when it differs from the ANSI codepage.
*E617*
@ -7451,7 +7489,7 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
Completion mode that is used for the character specified with
'wildchar'. It is a comma separated list of up to four parts. Each
part specifies what to do for each consecutive use of 'wildchar. The
part specifies what to do for each consecutive use of 'wildchar'. The
first part specifies the behavior for the first use of 'wildchar',
The second part for the second use, etc.
These are the possible values for each part:
@ -7559,8 +7597,8 @@ A jump table for the options with a short description can be found at |Q_op|.
{not available when compiled without the +windows
feature}
Keep the window height when windows are opened or closed and
'equalalways' is set. Set by default for the |preview-window| and
|quickfix-window|.
'equalalways' is set. Also for |CTRL-W_=|. Set by default for the
|preview-window| and |quickfix-window|.
The height may be changed anyway when running out of room.
*'winfixwidth'* *'wfw'* *'nowinfixwidth'* *'nowfw'*
@ -7570,7 +7608,7 @@ A jump table for the options with a short description can be found at |Q_op|.
{not available when compiled without the +windows
feature}
Keep the window width when windows are opened or closed and
'equalalways' is set.
'equalalways' is set. Also for |CTRL-W_=|.
The width may be changed anyway when running out of room.
*'winminheight'* *'wmh'*

View File

@ -1,4 +1,4 @@
*os_390.txt* For Vim version 7.0. Last change: 2005 Mar 29
*os_390.txt* For Vim version 7.1a. Last change: 2005 Mar 29
VIM REFERENCE MANUAL by Ralf Schandl

View File

@ -1,4 +1,4 @@
*os_amiga.txt* For Vim version 7.0. Last change: 2005 Mar 29
*os_amiga.txt* For Vim version 7.1a. Last change: 2005 Mar 29
VIM REFERENCE MANUAL by Bram Moolenaar

Some files were not shown because too many files have changed in this diff Show More