updated for version 7.0023

This commit is contained in:
Bram Moolenaar
2004-12-19 22:46:22 +00:00
parent 46c9c73de8
commit 1cd871b534
76 changed files with 2397 additions and 1391 deletions

View File

@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 7.0aa. Last change: 2004 Sep 17
*autocmd.txt* For Vim version 7.0aa. Last change: 2004 Dec 16
VIM REFERENCE MANUAL by Bram Moolenaar
@ -230,8 +230,10 @@ BufWritePost After writing the whole buffer to a file
*BufWriteCmd*
BufWriteCmd Before writing the whole buffer to a file.
Should do the writing of the file and reset
'modified' if successful. The buffer contents
should not be changed. |Cmd-event|
'modified' if successful, unless '+' is in
'cpo' and writing to another file |cpo-+|.
The buffer contents should not be changed.
|Cmd-event|
*FileWritePre*
FileWritePre Before writing to a file, when not writing the
whole buffer. Use the '[ and '] marks for the

View File

@ -1,4 +1,4 @@
*change.txt* For Vim version 7.0aa. Last change: 2004 Nov 30
*change.txt* For Vim version 7.0aa. Last change: 2004 Dec 17
VIM REFERENCE MANUAL by Bram Moolenaar
@ -351,7 +351,8 @@ The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned
octal and hexadecimal numbers and alphabetic characters. This depends on the
'nrformats' option.
- When 'nrformats' includes "octal", Vim considers numbers starting with a '0'
to be octal. Other numbers are decimal and may have a preceding minus sign.
to be octal, unless the number includes a '8' or '9'. Other numbers are
decimal and may have a preceding minus sign.
If the cursor is on a number, the commands apply to that number; otherwise
Vim uses the number to the right of the cursor.
- When 'nrformats' includes "hex", Vim assumes numbers starting with '0x' or
@ -365,9 +366,13 @@ octal and hexadecimal numbers and alphabetic characters. This depends on the
For numbers with leading zeros (including all octal and hexadecimal numbers),
Vim preserves the number of characters in the number when possible. CTRL-A on
"0077" results in "0100", CTRL-X on "0x100" results in "0x0ff".
There is one exception: When a number that starts with a zero is found not to
be octal (it contains a '8' or '9'), but 'nrformats' does include "octal",
leading zeros are removed to avoid that the result may be recognized as an
octal number.
Note that when 'nrformats' includes "octal", decimal numbers with leading
zeros are impossible because they are indistinguishable from octal numbers.
zeros cause mistakes, because they can be confused with octal numbers.
The CTRL-A command is very useful in a macro. Example: Use the following
steps to make a numbered list.

View File

@ -1,4 +1,4 @@
*editing.txt* For Vim version 7.0aa. Last change: 2004 Oct 12
*editing.txt* For Vim version 7.0aa. Last change: 2004 Dec 16
VIM REFERENCE MANUAL by Bram Moolenaar
@ -8,21 +8,22 @@ Editing files *edit-files*
1. Introduction |edit-intro|
2. Editing a file |edit-a-file|
3. Dialogs |edit-dialogs|
4. The current directory |current-directory|
5. The argument list |argument-list|
6. Writing |writing|
7. Writing and quitting |write-quit|
3. The argument list |argument-list|
4. Writing |writing|
5. Writing and quitting |write-quit|
6. Dialogs |edit-dialogs|
7. The current directory |current-directory|
8. Editing binary files |edit-binary|
9. Encryption |encryption|
10. Timestamps |timestamps|
11. File Searching |file-searching|
==============================================================================
1. Introduction *edit-intro*
Editing a file with Vim means:
1. reading the file into the internal buffer
1. reading the file into a buffer
2. changing the buffer with editor commands
3. writing the buffer into a file
@ -30,12 +31,13 @@ Editing a file with Vim means:
As long as you don't write the buffer, the original file remains unchanged.
If you start editing a file (read a file into the buffer), the file name is
remembered as the "current file name". This is also known as the name of the
current buffer.
current buffer. It can be used with "%" on the command line |:_%|.
*alternate-file*
If there already was a current file name, then that one becomes the alternate
file name. It can later be used with "#" on the command line |:_#|. However,
the alternate file name is not changed when |:keepalt| is used.
file name. It can be used with "#" on the command line |:_#| and you can use
the |CTRL-^| command to toggle between the current and the alternate file.
However, the alternate file name is not changed when |:keepalt| is used.
*:keepalt* *:keepa*
:keepalt {cmd} Execute {cmd} while keeping the current alternate file
@ -43,12 +45,13 @@ the alternate file name is not changed when |:keepalt| is used.
with a function) may still set the alternate file
name. {not in Vi}
All file names are remembered in the file list. When you enter a file name,
All file names are remembered in the buffer list. When you enter a file name,
for editing (e.g., with ":e filename") or writing (e.g., with (:w file name"),
the file name is added to the list. You can use this list to remember which
files you edited and to quickly switch from one file to another with the
CTRL-^ command (e.g., to copy text). First type the number of the file and
then hit CTRL-^. {Vi: only one alternate file name}
the file name is added to the list. You can use the buffer list to remember
which files you edited and to quickly switch from one file to another (e.g.,
to copy text) with the |CTRL-^| command. First type the number of the file
and then hit CTRL-^. {Vi: only one alternate file name is remembered}
CTRL-G or *CTRL-G* *:f* *:fi* *:file*
:f[ile] Prints the current file name (as typed), the
@ -215,11 +218,10 @@ If you want to keep the changed buffer without saving it, switch on the
{Vi: no ++opt}
:e[dit] [++opt] [+cmd] #[count]
Edit the [count]th alternate file name (as shown by
:files). This command does the same as
[count] CTRL-^. But ":e #" doesn't work if the
alternate buffer doesn't have a file name, while
CTRL-^ still works then.
Edit the [count]th buffer (as shown by |:files|).
This command does the same as [count] CTRL-^. But ":e
#" doesn't work if the alternate buffer doesn't have a
file name, while CTRL-^ still works then.
Also see |++opt| and |+cmd|.
{Vi: no ++opt}
@ -268,10 +270,10 @@ If you want to keep the changed buffer without saving it, switch on the
'readonly' option for this buffer. {not in Vi}
*CTRL-^* *CTRL-6*
[count]CTRL-^ Edit [count]th alternate file (equivalent to ":e
#[count]"). Without count this gets you to the
previously edited file. This is a quick way to toggle
between two (or more) files.
CTRL-^ Edit the alternate file (equivalent to ":e #").
Mostly the alternate file is the previously edited
file. This is a quick way to toggle between two
files.
If the 'autowrite' or 'autowriteall' option is on and
the buffer was changed, write it.
Mostly the ^ character is positioned on the 6 key,
@ -279,6 +281,12 @@ If you want to keep the changed buffer without saving it, switch on the
But on some non-US keyboards CTRL-^ is produced in
another way.
{count}CTRL-^ Edit [count]th file in the buffer list (equivalent to
":e #[count]"). This is a quick way to switch between
files.
See |CTRL-^| above for further details.
{not in Vi}
[count]]f *]f* *[f*
[count][f Same as "gf". Deprecated.
@ -335,11 +343,12 @@ current file name.
Note for systems other than Unix and MS-DOS: When using a command that
accepts a single file name (like ":edit file") spaces in the file name are
allowed, but trailing spaces are ignored. This is useful on systems that
allow file names with embedded spaces (like the Amiga). 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.
allow file names with embedded spaces (like MS-Windows and the Amiga).
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*
Wildcards in {file} are expanded. Which wildcards are supported depends on
the system. These are the common ones:
* matches anything, including nothing
@ -351,7 +360,8 @@ as a wildcard when "[" is in the 'isfname' option. A simple way to avoid this
is to use "path\[[]abc]". Then the file "path[abc]" literally.
*backtick-expansion* *`-expansion*
On Unix you can also use backticks in the file name, for example: >
On Unix and a few other systems you can also use backticks in the file name,
for example: >
:e `find . -name ver\\*.c -print`
The backslashes before the star are required to prevent "ver*.c" to be
expanded by the shell before executing the find program.
@ -360,12 +370,11 @@ backticks must be around the whole item. It is not possible to have text
directly before the first or just after the last backtick.
*`=*
You can have the backticks expanded as a Vim expression, instead of
an external command, by using the syntax `={expr}` e.g.: >
:let foo='bar'
:e `=foo . ".c" `
This will edit "bar.c". The expression can contain just about anything, thus
this can also be used to avoid the special meaning of '"', '|', '%' and '#'.
You can have the backticks expanded as a Vim expression, instead of an
external command, by using the syntax `={expr}` e.g.: >
:e `=tempname()`
The expression can contain just about anything, thus this can also be used to
avoid the special meaning of '"', '|', '%' and '#'.
*++opt* *[++opt]*
The [++opt] argument can be used to force the value of 'fileformat' or
@ -470,241 +479,17 @@ You can encrypt files that are written by setting the 'key' option. This
provides some security against others reading your files. |encryption|
File Searching *file-searching*
{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:
1) Downward search:
Downward search uses the wildcards '*', '**' and possibly others
supported by your operating system. '*' and '**' are handled inside Vim, so
they work on all operating systems.
The usage of '*' is quite simple: It matches 0 or more characters.
'**' is more sophisticated:
- It ONLY matches directories.
- It matches up to 30 directories deep, so you can use it to search an
entire directory tree
- The maximum number of levels matched can be given by appending a number
to '**'.
Thus '/usr/**2' can match: >
/usr
/usr/include
/usr/include/sys
/usr/include/g++
/usr/lib
/usr/lib/X11
....
< It does NOT match '/usr/include/g++/std' as this would be three
levels.
The allowed number range is 0 ('**0' is removed) to 255.
If the given number is smaller than 0 it defaults to 30, if it's
bigger than 255 it defaults to 255.
- '**' can only be at the end of the path or be followed by a path
separator or by a number and a path separator.
You can combine '*' and '**' in any order: >
/usr/**/sys/*
/usr/*/sys/**
/usr/**2/sys/*
2) Upward search:
Here you can give a directory and then search the directory tree upward for
a file. You could give stop-directories to limit the upward search. The
stop-directories are appended to the path (for the 'path' option) or to
the filename (for the 'tags' option) with a ';'. If you want several
stop-directories separate them with ';'. If you want no stop-directory
("search upward till the root directory) just use ';'. >
/usr/include/sys;/usr
< will search in: >
/usr/include/sys
/usr/include
/usr
<
If you use a relative path the upward search is started in Vim's current
directory or in the directory of the current file (if the relative path
starts with './' and 'd' is not included in 'cpoptions').
If Vim's current path is /u/user_x/work/release and you do >
:set path=include;/u/user_x
< and then search for a file with |gf| the file is searched in: >
/u/user_x/work/release/include
/u/user_x/work/include
/u/user_x/include
3) Combined up/downward search
If Vim's current path is /u/user_x/work/release and you do >
set path=**;/u/user_x
< and then search for a file with |gf| the file is searched in: >
/u/user_x/work/release/**
/u/user_x/work/**
/u/user_x/**
<
BE CAREFUL! This might consume a lot of time, as the search of
'/u/user_x/**' includes '/u/user_x/work/**' and
'/u/user_x/work/release/**'. So '/u/user_x/work/release/**' is searched
three and '/u/user_x/work/**' is searched two times.
In the above example you might want to set path to: >
:set path=**,/u/user_x/**
< This searches: >
/u/user_x/work/release/**
/u/user_x/**
< This searches the same directories, but in a different order.
==============================================================================
3. Dialogs *edit-dialogs*
*:confirm* *:conf*
:conf[irm] {command} Execute {command}, and use a dialog when an
operation has to be confirmed. Can be used on the
":q", ":qa" and ":w" commands (the latter to over-ride
a read-only setting).
Examples: >
:confirm w foo
< Will ask for confirmation when "foo" already exists. >
:confirm q
< Will ask for confirmation when there are changes. >
:confirm qa
< If any modified, unsaved buffers exist, you will be prompted to save
or abandon each one. There are also choices to "save all" or "abandon
all".
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|.
{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
{command} doesn't support browsing, the {command} is
executed without a dialog.
":browse set" works like |:options|.
The syntax is best shown via some examples: >
:browse e $vim/foo
< Open the browser in the $vim/foo directory, and edit the
file chosen. >
:browse e
< Open the browser in the directory specified with 'browsedir',
and edit the file chosen. >
:browse w
< Open the browser in the directory of the current buffer,
with the current buffer filename as default, and save the
buffer under the filename chosen. >
:browse w C:/bar
< Open the browser in the C:/bar directory, with the current
buffer filename as default, and save the buffer under the
filename chosen.
Also see the |'browsedir'| option.
For versions of Vim where browsing is not supported, the command is executed
unmodified.
*browsefilter*
For MS Windows, you can modify the filters that are used in the browse dialog.
By setting the g:browsefilter or b:browsefilter variables, you can change the
filters globally or locally to the buffer. The variable is set to a string in
the format "{filter label}\t{pattern};{pattern}\n" where {filter label} is the
text that appears in the "Files of Type" comboBox, and {pattern} is the
pattern which filters the filenames. Several patterns can be given, separated
by ';'.
For Motif the same format is used, but only the very first pattern is actually
used (Motif only offers one pattern, but you can edit it).
For example, to have only Vim files in the dialog, you could use the following
command: >
let g:browsefilter="Vim Scripts\t*.vim\nVim Startup Files\t*vimrc\n"
You can override the filter setting on a per-buffer basis by setting the
b:browsefilter variable. You would most likely set b:browsefilter in a
filetype plugin, so that the browse dialog would contain entries related to
the type of file you are currently editing. Disadvantage: This makes it
difficult to start editing a file of a different type. To overcome this, you
may want to add "All Files\t*.*\n" as the final filter, so that the user can
still access any desired file.
==============================================================================
4. The current directory *current-directory*
You may use the |:cd| and |:lcd| commands to change to another directory, so
you will not have to type that directory name in front of the file names. It
also makes a difference for executing external commands, e.g. ":!ls".
*:cd* *E472*
:cd On non-Unix systems: Print the current directory
name. On Unix systems: Change the current directory
to the home directory. Use |:pwd| to print the
current directory on all systems.
:cd {path} Change the current directory to {path}.
If {path} is relative, it is searched for in the
directories listed in |'cdpath'|.
Does not change the meaning of an already opened file,
because its full path name is remembered. Files from
the |arglist| may change though!
On MS-DOS this also changes the active drive.
To change to the directory of the current file: >
:cd %:h
<
*:cd-* *E186*
:cd - Change to the previous current directory (before the
previous ":cd {path}" command). {not in Vi}
*:chd* *:chdir*
:chd[ir] [path] Same as |:cd|.
*:lc* *:lcd*
:lc[d] {path} Like |:cd|, but only set the current directory for the
current window. The current directory for other
windows is not changed. {not in Vi}
*:lch* *:lchdir*
:lch[dir] Same as |:lcd|. {not in Vi}
*:pw* *:pwd* *E187*
:pw[d] Print the current directory name. {Vi: no pwd}
Also see |getcwd()|.
So long as no |:lcd| command has been used, all windows share the same current
directory. Using a command to jump to another window doesn't change anything
for the current directory.
When a |:lcd| command has been used for a window, the specified directory
becomes the current directory for that window. Windows where the |:lcd|
command has not been used stick to the global current directory. When jumping
to another window the current directory will become the last specified local
current directory. If none was specified, the global current directory is
used.
When a |:cd| command is used, the current window will lose his local current
directory and will use the global current directory from now on.
After using |:cd| the full path name will be used for reading and writing
files. On some networked file systems this may cause problems. The result of
using the full path name is that the file names currently in use will remain
referring to the same file. Example: If you have a file a:test and a
directory a:vim the commands ":e test" ":cd vim" ":w" will overwrite the file
a:test and not write a:vim/test. But if you do ":w test" the file a:vim/test
will be written, because you gave a new file name and did not refer to a
filename before the ":cd".
==============================================================================
5. The argument list *argument-list* *arglist*
3. The argument list *argument-list* *arglist*
If you give more than one file name when starting Vim, this list is remembered
as the argument list. You can jump to each file in this list.
Do not confuse this with the buffer list, which you can see with the
|:buffers| command. The argument list was already present in Vi, the buffer
list is new in Vim. A file name in the argument list will also be present in
the buffer list (unless it was deleted with ":bdel").
list is new in Vim. Every file name in the argument list will also be present
in the buffer list (unless it was deleted with |:bdel| or |:bwipe|). But it's
common that names in the buffer list are not in the argument list.
This subject is introduced in section |07.2| of the user manual.
@ -894,11 +679,17 @@ positioned at the first non-blank in the line, otherwise the last know column
is used. If there is no last known cursor position the cursor will be in the
first line (the last line in Ex mode).
*{arglist}*
The wildcards in the argument list are expanded and the file names are sorted.
Thus you can use the command "vim *.c" to edit all the C files. From within
Vim the command ":n *.c" does the same. On Unix you can also use backticks,
for example: >
:n `find . -name \\*.c -print`
Vim the command ":n *.c" does the same.
White space is used to separate file names. Put a backslash before a space or
Tab to include it in a file name. E.g., to edit the single file "foo bar": >
:next foo\ bar
On Unix and a few other systems you can also use backticks, for example: >
:next `find . -name \\*.c -print`
The backslashes before the star are required to prevent "*.c" to be expanded
by the shell before executing the find program.
@ -988,7 +779,7 @@ flag is used for the ":substitute" command to avoid an error for files where
"my_foo" isn't used. ":update" writes the file only if changes were made.
==============================================================================
6. Writing *writing* *save-file*
4. Writing *writing* *save-file*
Note: When the 'write' option is off, you are not able to write any file.
@ -1173,7 +964,7 @@ For MS-DOS and MS-Windows the device is detected by its name:
The names can be in upper- or lowercase.
==============================================================================
7. Writing and quitting *write-quit*
5. Writing and quitting *write-quit*
*:q* *:quit*
:q[uit] Quit the current window. Quit Vim if this is the last
@ -1265,6 +1056,146 @@ MULTIPLE WINDOWS AND BUFFERS *window-exit*
which cannot be written for another reason, Vim will not quit.
{not in Vi}
==============================================================================
6. Dialogs *edit-dialogs*
*:confirm* *:conf*
:conf[irm] {command} Execute {command}, and use a dialog when an
operation has to be confirmed. Can be used on the
":q", ":qa" and ":w" commands (the latter to over-ride
a read-only setting).
Examples: >
:confirm w foo
< Will ask for confirmation when "foo" already exists. >
:confirm q
< Will ask for confirmation when there are changes. >
:confirm qa
< If any modified, unsaved buffers exist, you will be prompted to save
or abandon each one. There are also choices to "save all" or "abandon
all".
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|.
{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
{command} doesn't support browsing, the {command} is
executed without a dialog.
":browse set" works like |:options|.
The syntax is best shown via some examples: >
:browse e $vim/foo
< Open the browser in the $vim/foo directory, and edit the
file chosen. >
:browse e
< Open the browser in the directory specified with 'browsedir',
and edit the file chosen. >
:browse w
< Open the browser in the directory of the current buffer,
with the current buffer filename as default, and save the
buffer under the filename chosen. >
:browse w C:/bar
< Open the browser in the C:/bar directory, with the current
buffer filename as default, and save the buffer under the
filename chosen.
Also see the |'browsedir'| option.
For versions of Vim where browsing is not supported, the command is executed
unmodified.
*browsefilter*
For MS Windows, you can modify the filters that are used in the browse dialog.
By setting the g:browsefilter or b:browsefilter variables, you can change the
filters globally or locally to the buffer. The variable is set to a string in
the format "{filter label}\t{pattern};{pattern}\n" where {filter label} is the
text that appears in the "Files of Type" comboBox, and {pattern} is the
pattern which filters the filenames. Several patterns can be given, separated
by ';'.
For Motif the same format is used, but only the very first pattern is actually
used (Motif only offers one pattern, but you can edit it).
For example, to have only Vim files in the dialog, you could use the following
command: >
let g:browsefilter="Vim Scripts\t*.vim\nVim Startup Files\t*vimrc\n"
You can override the filter setting on a per-buffer basis by setting the
b:browsefilter variable. You would most likely set b:browsefilter in a
filetype plugin, so that the browse dialog would contain entries related to
the type of file you are currently editing. Disadvantage: This makes it
difficult to start editing a file of a different type. To overcome this, you
may want to add "All Files\t*.*\n" as the final filter, so that the user can
still access any desired file.
==============================================================================
7. The current directory *current-directory*
You may use the |:cd| and |:lcd| commands to change to another directory, so
you will not have to type that directory name in front of the file names. It
also makes a difference for executing external commands, e.g. ":!ls".
*:cd* *E472*
:cd On non-Unix systems: Print the current directory
name. On Unix systems: Change the current directory
to the home directory. Use |:pwd| to print the
current directory on all systems.
:cd {path} Change the current directory to {path}.
If {path} is relative, it is searched for in the
directories listed in |'cdpath'|.
Does not change the meaning of an already opened file,
because its full path name is remembered. Files from
the |arglist| may change though!
On MS-DOS this also changes the active drive.
To change to the directory of the current file: >
:cd %:h
<
*:cd-* *E186*
:cd - Change to the previous current directory (before the
previous ":cd {path}" command). {not in Vi}
*:chd* *:chdir*
:chd[ir] [path] Same as |:cd|.
*:lc* *:lcd*
:lc[d] {path} Like |:cd|, but only set the current directory for the
current window. The current directory for other
windows is not changed. {not in Vi}
*:lch* *:lchdir*
:lch[dir] Same as |:lcd|. {not in Vi}
*:pw* *:pwd* *E187*
:pw[d] Print the current directory name. {Vi: no pwd}
Also see |getcwd()|.
So long as no |:lcd| command has been used, all windows share the same current
directory. Using a command to jump to another window doesn't change anything
for the current directory.
When a |:lcd| command has been used for a window, the specified directory
becomes the current directory for that window. Windows where the |:lcd|
command has not been used stick to the global current directory. When jumping
to another window the current directory will become the last specified local
current directory. If none was specified, the global current directory is
used.
When a |:cd| command is used, the current window will lose his local current
directory and will use the global current directory from now on.
After using |:cd| the full path name will be used for reading and writing
files. On some networked file systems this may cause problems. The result of
using the full path name is that the file names currently in use will remain
referring to the same file. Example: If you have a file a:test and a
directory a:vim the commands ":e test" ":cd vim" ":w" will overwrite the file
a:test and not write a:vim/test. But if you do ":w test" the file a:vim/test
will be written, because you gave a new file name and did not refer to a
filename before the ":cd".
==============================================================================
8. Editing binary files *edit-binary*
@ -1454,5 +1385,91 @@ It is also possible that you modified the file yourself, from another edit
session or with another command (e.g., a filter command). Then you will know
which version of the file you want to keep.
==============================================================================
11. File Searching *file-searching*
{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:
1) Downward search:
Downward search uses the wildcards '*', '**' and possibly others
supported by your operating system. '*' and '**' are handled inside Vim, so
they work on all operating systems.
The usage of '*' is quite simple: It matches 0 or more characters.
'**' is more sophisticated:
- It ONLY matches directories.
- It matches up to 30 directories deep, so you can use it to search an
entire directory tree
- The maximum number of levels matched can be given by appending a number
to '**'.
Thus '/usr/**2' can match: >
/usr
/usr/include
/usr/include/sys
/usr/include/g++
/usr/lib
/usr/lib/X11
....
< It does NOT match '/usr/include/g++/std' as this would be three
levels.
The allowed number range is 0 ('**0' is removed) to 255.
If the given number is smaller than 0 it defaults to 30, if it's
bigger than 255 it defaults to 255.
- '**' can only be at the end of the path or be followed by a path
separator or by a number and a path separator.
You can combine '*' and '**' in any order: >
/usr/**/sys/*
/usr/*/sys/**
/usr/**2/sys/*
2) Upward search:
Here you can give a directory and then search the directory tree upward for
a file. You could give stop-directories to limit the upward search. The
stop-directories are appended to the path (for the 'path' option) or to
the filename (for the 'tags' option) with a ';'. If you want several
stop-directories separate them with ';'. If you want no stop-directory
("search upward till the root directory) just use ';'. >
/usr/include/sys;/usr
< will search in: >
/usr/include/sys
/usr/include
/usr
<
If you use a relative path the upward search is started in Vim's current
directory or in the directory of the current file (if the relative path
starts with './' and 'd' is not included in 'cpoptions').
If Vim's current path is /u/user_x/work/release and you do >
:set path=include;/u/user_x
< and then search for a file with |gf| the file is searched in: >
/u/user_x/work/release/include
/u/user_x/work/include
/u/user_x/include
3) Combined up/downward search
If Vim's current path is /u/user_x/work/release and you do >
set path=**;/u/user_x
< and then search for a file with |gf| the file is searched in: >
/u/user_x/work/release/**
/u/user_x/work/**
/u/user_x/**
<
BE CAREFUL! This might consume a lot of time, as the search of
'/u/user_x/**' includes '/u/user_x/work/**' and
'/u/user_x/work/release/**'. So '/u/user_x/work/release/**' is searched
three and '/u/user_x/work/**' is searched two times.
In the above example you might want to set path to: >
:set path=**,/u/user_x/**
< This searches: >
/u/user_x/work/release/**
/u/user_x/**
< This searches the same directories, but in a different order.
vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,4 +1,4 @@
*intro.txt* For Vim version 7.0aa. Last change: 2004 Nov 18
*intro.txt* For Vim version 7.0aa. Last change: 2004 Dec 16
VIM REFERENCE MANUAL by Bram Moolenaar
@ -278,7 +278,7 @@ the ideas from all these people: They keep Vim alive!
In this documentation there are several references to other versions of Vi:
*Vi*
*Vi* *vi*
Vi "the original". Without further remarks this is the version
of Vi that appeared in Sun OS 4.x. ":version" returns
"Version 3.7, 6/7/85". Sometimes other versions are referred

View File

@ -1,4 +1,4 @@
*mbyte.txt* For Vim version 7.0aa. Last change: 2004 Jul 05
*mbyte.txt* For Vim version 7.0aa. Last change: 2004 Dec 19
VIM REFERENCE MANUAL by Bram Moolenaar et al.
@ -328,6 +328,8 @@ u unicode same as ucs-2
u ucs2be same as ucs-2 (big endian)
u ucs-2be same as ucs-2 (big endian)
u ucs-4be same as ucs-4 (big endian)
default stands for the default value of 'encoding', depends on the
environment
For the UCS codes the byte order matters. This is tricky, use UTF-8 whenever
you can. The default is to use big-endian (most significant byte comes

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 7.0aa. Last change: 2004 Dec 09
*options.txt* For Vim version 7.0aa. Last change: 2004 Dec 19
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1841,6 +1841,10 @@ A jump table for the options with a short description can be found at |Q_op|.
there is one). This works very well for C programs.
This flag is also used for other features, such as
C-indenting.
*cpo-+*
+ When included, a ":write file" command will reset the
'modified' flag of the buffer, even though the buffer
itself may still be different from its file.
cpo-star*
* Use ":*" in the same way as ":@". When not included,
":*" is an alias for ":'<,'>", select the Visual area.
@ -2127,7 +2131,7 @@ A jump table for the options with a short description can be found at |Q_op|.
with. See |encoding-names| for the possible values.
NOTE: Changing this option will not change the encoding of the
existing text in Vim. It may cause multi-byte text to become invalid.
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|.
@ -2338,8 +2342,9 @@ A jump table for the options with a short description can be found at |Q_op|.
old short name was 'fe', which is no longer used.
*'fileencodings'* *'fencs'*
'fileencodings' 'fencs' string (default: "ucs-bom", "ucs-bom,utf-8,latin1"
when 'encoding' is set to a Unicode value)
'fileencodings' 'fencs' string (default: "ucs-bom",
"ucs-bom,utf-8,default,latin1" when
'encoding' is set to a Unicode value)
global
{only available when compiled with the |+multi_byte|
feature}
@ -2373,6 +2378,10 @@ A jump table for the options with a short description can be found at |Q_op|.
An entry for an 8-bit encoding (e.g., "latin1") should be the last,
because Vim cannot detect an error, thus the encoding is always
accepted.
The special value "default" can be used for the encoding from the
environment. This is the default value for 'encoding'. It is useful
when 'encoding' is set to "utf-8" and your environment uses a
non-latin1 encoding, such as Russian.
WRONG VALUES: WHAT'S WRONG:
latin1,utf-8 "latin1" will always be used
utf-8,ucs-bom,latin1 BOM won't be recognized in an utf-8

View File

@ -1,4 +1,4 @@
*os_mac.txt* For Vim version 7.0aa. Last change: 2004 Jul 19
*os_mac.txt* For Vim version 7.0aa. Last change: 2004 Dec 13
VIM REFERENCE MANUAL by Bram Moolenaar et al.
@ -71,6 +71,12 @@ Q: I can't enter non-ASCII character in Apple Terminal.
A: Under Window Settings, Emulation, make sure that "Escape non-ASCII
characters" is not checked.
Q: How do I start the GUI from the command line?
A: Assuming that Vim.app is located in /Applications:
open /Applications/Vim.app
Or:
/Applications/Vim.app/Contents/MacOS/Vim -g {arguments}
==============================================================================
4. Mac Lack *mac-lack*

View File

@ -1,4 +1,4 @@
*pattern.txt* For Vim version 7.0aa. Last change: 2004 Sep 07
*pattern.txt* For Vim version 7.0aa. Last change: 2004 Dec 18
VIM REFERENCE MANUAL by Bram Moolenaar
@ -153,6 +153,7 @@ The offset gives the cursor position relative to the found match:
s[-num] [num] characters to the left of the start of the match
b[+num] [num] identical to s[+num] above (mnemonic: begin)
b[-num] [num] identical to s[-num] above (mnemonic: begin)
;{pattern} perform another searcn, see |//;|
If a '-' or '+' is given but [num] is omitted, a count of one will be used.
When including an offset with 'e', the search becomes inclusive (the

View File

@ -6579,6 +6579,7 @@ version4.txt version4.txt /*version4.txt*
version5.txt version5.txt /*version5.txt*
version6.txt version6.txt /*version6.txt*
version7.txt version7.txt /*version7.txt*
vi intro.txt /*vi*
vi-differences vi_diff.txt /*vi-differences*
vi: options.txt /*vi:*
vi_diff.txt vi_diff.txt /*vi_diff.txt*
@ -6655,6 +6656,7 @@ w:var eval.txt /*w:var*
warningmsg-variable eval.txt /*warningmsg-variable*
white-space pattern.txt /*white-space*
whitespace pattern.txt /*whitespace*
wildcard editing.txt /*wildcard*
win16-!start gui_w16.txt /*win16-!start*
win16-clipboard gui_w16.txt /*win16-clipboard*
win16-colors gui_w16.txt /*win16-colors*
@ -6828,6 +6830,7 @@ zz scroll.txt /*zz*
{ motion.txt /*{*
{Visual} intro.txt /*{Visual}*
{address} cmdline.txt /*{address}*
{arglist} editing.txt /*{arglist}*
{char1-char2} intro.txt /*{char1-char2}*
{event} autocmd.txt /*{event}*
{file} editing.txt /*{file}*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.0aa. Last change: 2004 Dec 11
*todo.txt* For Vim version 7.0aa. Last change: 2004 Dec 19
VIM REFERENCE MANUAL by Bram Moolenaar
@ -30,21 +30,18 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs*
-------------------- Known bugs and current work -----------------------
":e <cfile>" does not expand ~/file, very confusing compared to ":e ~/file".
Win32: Cannot edit a file starting with # with --remote. (Giuseppe Bilotta,
Oct 6 2004)
When no termcap/termlib library is found, check that compiling Vim works in
configure. Give an clear error message ("install termcap or ncurses-dev
package") when it doesn't.
Add Makefile code to install *-it.1 manual pages in .../man/it/man1/*.1
When doing ":w file" 'modified' is reset, but "u" sets it, while the file is
actually unchanged. Don't reset 'modified' when 'nocp' is set.
Win32: "gvim -V100" should use dialog with scrollbar. Using
gui_mch_dialog() would be good, but need to move display_errors() to after
creating the window, so that s_hwnd is valid.
How to add a scrollbar to the dialog?
Win32: "gvim -V100" should use dialog with scrollbar.
Using CTRL-A on "08" should not work like octal. (Matthew Duggan)
Cursor onder laatste regel na ":g/pat/s//>" commando waardoor regels niet meer
wrappen. (Adri Verhoef, Dec 1)
Win32: tearoff menu window should have a scrollbar when it's taller than the
screen.
Included NetBeans patches (Gordon Prieur, Oct 20)
See two messages for list of changed files. Additionally:
@ -57,6 +54,8 @@ Included NetBeans patches (Gordon Prieur, Oct 20)
For version 7.0:
- Include many PATCHES:
- Patch for 'breakindent' option: repeat indent for wrapped line. (Vaclav
Smilauer, 2004 Sep 13, fix Oct 31)
7 Add 'taglistfiles' option, show file name and type when listing matching
tags name with CTRL-D completion. Patch from Yegappan Lakshmanan.
2004 Jul 11
@ -189,16 +188,19 @@ For version 7.0:
Also see the "minigrep.vim" script on www.vim.org.
- Edit same file on Unix and from MS-Windows: no warning for swap file.
- Drop the kvim support? There is no maintenance and "yzis" is supposed to
replace it.
- In the kvim/KDE source files fix the formatting.
- KDE version is called "kvim". Make it "gvim", like the others?
- Better configure check for KDE include files from Dan Sharp.
- KDE GUI Input method patch. (Yasuhiro Matsumoto) (upd. Oct 25 2004)
After including patches:
- Change ga_room into ga_maxlen, so that it doesn't need to be
incremented/decremented each time.
- For string variables, use length instead of NUL termination.
- For string variables, use length instead of NUL termination?
+ can include NUL characters
- setline() will have problems with NL vs NUL.
- new DATA TYPES: lists, dictionaries and function references.
Check old patch from Robert Webb for array support.
Add type checking? See ~/vim/ideas.txt.
@ -258,11 +260,6 @@ For version 7.0:
before some time/date can be flushed. 'undopersist' gives maximum time to
keep undo: "3h", "1d", "2w", "1y", etc. For the file use dot and
extension: ".filename.un~" (like swapfile but "un~" instead of "swp").
7 SWAP FILE CHANGE: When a dos format file was edited with ":e ++ff=unix",
Vim is killed and trying to recover the file, 'ff' will be dos. Same for
non-default fileencoding. (Miroslaw Dobrzanski-Neumann, Jul 17)
Should store the values in block 0 of the swap file, but that is an
incompatible change.
7 Support WINDOW TABS. Works like several pages, each with their own
split windows. Patch for GTK 1.2 passed on by Christian Michon, 2004 Jan 6.
Also for the console!
@ -285,6 +282,10 @@ For version 7.0:
- make it possible to have 'defineAnnoType' also handle terminal colors.
- send 'balloonText' events for the cursor position (using CursorHold ?)
in terminal mode.
- ECLIPSE plugin. Problem is: the interface is very complicated. Need to
implement part in Java and then connect to Vim. Some hints from Alexandru
Roman, 2004 Dec 15. Should then also work with Oracle Jdeveloper, see JSR
198 standard http://www.jcp.org/en/jsr/detail?id=198.
- STICKY CURSOR: Add a way of scrolling that leaves the cursor where it is.
Especially when using the scrollbar. Typing a cursor-movement command
scrolls back to where the cursor is.
@ -324,25 +325,9 @@ For version 7.0:
- "onemore" flag in 'virtualedit': move cursor past end of line. Patch by
Mattias Flodin (2004 Jul 30)
Win32: When setting 'encoding' in a Vim server to "utf-8", and using "vim
--remote russian" in a console, "russian" should be converted from the console
encoding to utf-8. Send all remote messages in utf-8? Only on Win32?
Support ":set syntax=cpp.doxygen"? Suggested patch by Michael Geddes (9 Aug
2004). Should also work for 'filetype'.
Patch for 'breakindent' option: repeat indent for wrapped line. (Vaclav
Smilauer, 2004 Sep 13, fix Oct 31)
":bufdo g/something/p" has the last match overwritten by the file info.
Example by Cesar Andalou (Nov 3).
Win32: In 'fileencodings' allow using "acp" for the active codepage. Useful
value: "ucs-bom,utf-8,acp,latin1"
Win32: Cannot edit a file starting with # with --remote. (Giuseppe Bilotta,
Oct 6 2004)
For manipulating buffers without opening a new window, support Virtual
windows. Example:
:virtwin let l = GetBufLine(4, 10)
@ -360,19 +345,13 @@ Win32: In the generated batch files, use $VIMRUNTIME if it's set. Examples by
Mathias Michaelis (2004 Sep 6)
Also place vimtutor.bat in %windir%?
Support ":enew filename" to edit a new buffer with a name. It's like "enew |
file filename" but without setting the alternate file to a buffer without a
name. (Charles Campbell)
Add gui_mch_browsedir() for Motif, KDE and Mac OS/X.
Add Makefile code to install *-it.1 manual pages in .../man/it/man1/*.1
HTML indenting can be slow, find out why. Any way to do some kind of
profiling for Vim script?
Mac: problem with Xcode, Vim doesn't continue until the next click.
Apparently hanges in handle_drop(). A PostEvent() avoids it. (Da Woon Jung)
Apparently hangs in handle_drop(). A PostEvent() avoids it. (Da Woon Jung)
Vi incompatibility:
@ -943,11 +922,6 @@ Macintosh:
swap file. Then using ":write" (without making any changes) doesn't give
a warning either. Should check for an existing swap file without creating
one.
7 On MS-DOS or MS-Windows, when editing the same file over a network, the
drive letter is different, thus an existing swap file doesn't generate a
warning. Use some flag to indicate the swap file is in the same directory
as the original file? Could make b0_fname[] start with a special
character like ">".
7 When 'showbreak' is set, the amount of space a Tab occupies changes.
Should work like 'showbreak' is inserted without changing the Tabs.
7 When there is a "help.txt" window in a session file, restoring that
@ -977,10 +951,6 @@ Macintosh:
9 dosinst.c: The DJGPP version can't uninstall the Uninstall registry key on
Windows NT. How to install a .inf file on Windows NT and how to detect
that Windows NT is being used?
8 When opening the same file on Unix and on MS-Windows, there is no
ATTENTION message, because the path in the swap file is different. Using
a relative path name will cause no ATTENTION for Vim 5.8.
Somehow add a flag that the swap file is in the same dir as the file?
8 When 'virtualedit' is "block,insert" and encoding is "utf-8", selecting a
block of one double-wide character, then "d" deletes only half of it.
8 When 'virtualedit' is set, should "I" in blockwise visual mode also insert
@ -2658,12 +2628,14 @@ Incsearch:
Searching:
8 Add a mechanism for recursiveness: "\(([^()]*\@@[^()]*)\)\@r". \@@ stands
for "go recursive here" and \@r marks the recursive atom.
item stack to allow matching (). One side is "push X on
7 Add an item stack to allow matching (). One side is "push X on
the stack if previous atom matched". Other side is "match with top of
stack, pop it when it matches". Use "\@pX" and "\@m"?
Example: \((\@p).\{-}\@m\)*
7 Add an option to accept a match at the cursor position. Also for
search(). (Brett)
7 Add a flag to "/pat/" to discard an error. Useful to continue a mapping
when a search fails. Could be "/pat/E" (e is already used for an offset).
7 Add pattern item to use properties of Unicode characters. In Perl it's
"\p{L}" for a letter. See Regular Expression Pocket Reference.
8 Would it be possible to allow ":23,45/pat/flags" to search for "pat" in
@ -2828,9 +2800,6 @@ Swap (.swp) files:
twice (e.g. when using quickfix). Also try to make the name of the backup
file the same as the actual file?
Use the code for resolve()?
7 Store the options 'fileencoding', 'fileformat', etc. in the swapfile,
because they change what will be written to the file. Requires adding
another block to the swapfile.
7 When using 64 bit inode numbers, also store the top 32 bits. Add another
field for this, using part of bo_fname[], to keep it compatible.
7 When editing a file on removable media, should put swap file somewhere
@ -3153,8 +3122,6 @@ Various improvements:
7 Add ModeMsgVisual, ModeMsgInsert, etc. so that each mode message can be
highlighted differently.
8 Allow using "**" as a wildcard in commands like ":next" and ":args".
8 Provide a way to avoid wildcard expansion. Use double quotes, like in the
shell? :edit "my[file].txt" (currently works if there is no "myf.txt")
7 Add a message area for the user. Set some option to reserve space (above
the command line?). Use an ":echouser" command to display the message
(truncated to fit in the space).

View File

@ -1,4 +1,4 @@
*version7.txt* For Vim version 7.0aa. Last change: 2004 Dec 11
*version7.txt* For Vim version 7.0aa. Last change: 2004 Dec 19
VIM REFERENCE MANUAL by Bram Moolenaar
@ -36,6 +36,20 @@ run into a problem when upgrading from Vim 6.x to 7.0
":helpgrep" now uses a help window to display a match.
In an argument list double quotes could be used to include spaces in a file
name. This caused a difference between ":edit" and ":next" for escaping
double quotes and it is incompatible with some versions of Vi.
Command Vim 6.x file name Vim 7.x file name ~
:edit foo\"888 'foo"888' 'foo"888'
:next foo\"888 'foo888' 'foo"888'
:next a\"b c\"d 'ab cd' 'a"b' and 'c"d'
A ":write file" command no longer resets the 'modified' flag of the buffer,
unless the '+' flag is in 'cpoptions' |cpo-+|. This was illogical, since the
buffer is still modified compared to the original file. And when undoing
all changes the file would actually be marked modified. It does mean that
":quit" fails now.
Minor incompatibilities:
@ -61,6 +75,16 @@ Win32: The effect of the <F10> key depended on 'winaltkeys'. Now it depends
on whether <F10> has been mapped or not. This allows mapping <F10> without
changing 'winaltkeys'.
When using CTRL-A on "08" it became "018", which is illogical. Now it becomes
"9". The leading zero(s) is(are) removed to avoid the number becoming octal
after incrementing "009" to "010".
When 'encoding' is set to a Unicode encoding, the value for 'fileencodings'
now includes "default" before "latin1". This means that for files with 8-bit
encodings the default is to use the encoding specified by the environment, if
possible. Previously latin1 would always be used, which is wrong in a
non-latin1 environment, such as Russian.
==============================================================================
NEW FEATURES *new-7*
@ -303,6 +327,18 @@ When foldtext() finds no text after removing the comment leader, use the
second line of the fold. Helps for C-style /* */ comments where the first
line is just "/*".
When editing the same file from two systems (e.g., Unix and MS-Windows) there
mostly was no warning for an existing swap file, because the name of the
edited file differs (e.g., y:\dir\file vs /home/me/dir/file). Added a flag to
the swap file to indicate it is in the same directory as the edited file. The
used path then doesn't matter and the check for editing the same file is much
more reliable.
Client-server communication now supports 'encoding'. When setting 'encoding'
in a Vim server to "utf-8", and using "vim --remote fname" in a console,
"fname" is converted from the console encoding to utf-8. Also allows Vims
with different 'encoding' settings to exchange messages.
==============================================================================
COMPILE TIME CHANGES *compile-changes-7*
@ -506,4 +542,26 @@ When using "set laststatus=2 cmdheight=2" in the .gvimrc you may only get one
line for the cmdline. (Christian Robinson) Invoke command_height() after the
GUI has started up.
When completing a file name on the command line backslashes are required for
white space. Was only done for a space, not for a Tab.
When configure could not find a terminal library, compiling continued for a
long time before reporting the problem. Added a configure check for tgetent()
being found in a library.
When the cursor is on the first char of the last line a ":g/pat/s///" command
may cause the cursor to be displayed below the text.
Win32: Editing a file with non-ASCII characters doesn't work when 'encoding'
is "utf-8". use _wfullpath() instead of _fullpath(). (Yu-sung Moon)
When recovering the 'fileformat' and 'fileencoding' were taken from the
original file instead of from the swapfile. When the file didn't exist, was
empty or the option was changed (e.g., with ":e ++fenc=cp123 file") it could
be wrong. Now store 'fileformat' and 'fileencoding' in the swapfile and use
the values when recovering.
":bufdo g/something/p" overwrites each last printed text line with the file
message for the next buffer. Temporarily clear 'shortmess' to avoid that.
vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2004 Nov 18
" Last Change: 2004 Dec 17
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@ -893,6 +893,9 @@ au BufNewFile,BufRead .muttrc*,*/.mutt/muttrc*,Muttrc setf muttrc
" Natural
au BufNewFile,BufRead *.NS[ACGLMNPS] setf natural
" Netrc
au BufNewFile,BufRead .netrc setf netrc
" Novell netware batch files
au BufNewFile,BufRead *.ncf setf ncf
@ -1486,6 +1489,9 @@ au BufNewFile,BufRead *.stp setf stp
" Standard ML
au BufNewFile,BufRead *.sml setf sml
" Sudoers
au BufNewFile,BufRead /etc/sudoers,sudoers.tmp setf sudoers
" Tads (or Nroff)
au BufNewFile,BufRead *.t
\ if !<SID>FTnroff() | setf tads | endif

View File

@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: Make
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2003 May 04
" Last Change: 2004 Dec 17
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@ -23,3 +23,6 @@ setlocal com=sO:#\ -,mO:#\ \ ,b:#
" Set 'commentstring' to put the marker after a #.
setlocal commentstring=#\ %s
" Including files.
let &l:include = '^\s*include'

View File

@ -1,6 +1,6 @@
" Script to define the syntax menu in synmenu.vim
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2004 Nov 20
" Last Change: 2004 Dec 17
" This is used by "make menu" in the src directory.
edit <sfile>:p:h/synmenu.vim
@ -407,6 +407,7 @@ SynMenu Sh-S.Standard\ ML:sml
SynMenu Sh-S.Stored\ Procedures:stp
SynMenu Sh-S.Strace:strace
SynMenu Sh-S.Subversion\ commit:svn
SynMenu Sh-S.Sudoers:sudoers
SynMenu TUV.TADS:tads
SynMenu TUV.Tags:tags

View File

@ -1,6 +1,6 @@
" Vim syntax support file
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2004 Oct 15
" Last Change: 2004 Dec 14
" (modified by David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>)
" (XHTML support by Panagiotis Issaris <takis@lumumba.luc.ac.be>)
@ -211,7 +211,11 @@ let s:old_magic = &magic
set magic
if exists("use_xhtml")
exe "normal! a<?xml version=\"1.0\"?>\n\e"
if s:html_encoding != ""
exe "normal! a<?xml version=\"1.0\" encoding=\"" . s:html_encoding . "\"?>\n\e"
else
exe "normal! a<?xml version=\"1.0\"?>\n\e"
endif
let s:tag_close = '/>'
else
let s:tag_close = '>'
@ -230,8 +234,8 @@ endif
" HTML header, with the title and generator ;-). Left free space for the CSS,
" to be filled at the end.
exe "normal! a<html>\n<head>\n<title>\e"
exe "normal! a" . expand("%:p:~") . "</title>\n\e"
exe "normal! a<html>\n\e"
exe "normal! a<head>\n<title>" . expand("%:p:~") . "</title>\n\e"
exe "normal! a<meta name=\"Generator\" content=\"Vim/" . v:version/100 . "." . v:version %100 . '"' . s:tag_close . "\n\e"
if s:html_encoding != ""
exe "normal! a<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:html_encoding . '"' . s:tag_close . "\n\e"
@ -477,11 +481,19 @@ while s:idlist != ""
endwhile
" Add hyperlinks
%s+\(http://\S\{-}\)\(\([.,;:}]\=\(\s\|$\)\)\|[\\"'<>]\|&gt;\|&lt;\|&quot;\)+<A HREF="\1">\1</A>\2+ge
%s+\(https\=://\S\{-}\)\(\([.,;:}]\=\(\s\|$\)\)\|[\\"'<>]\|&gt;\|&lt;\|&quot;\)+<a href="\1">\1</a>\2+ge
" The DTD
if exists("html_use_css")
exe "normal! gg0i<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n\e"
if exists("use_xhtml")
exe "normal! gg$a\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\e"
else
exe "normal! gg0i<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n\e"
endif
endif
if exists("use_xhtml")
exe "normal! gg/<html/e\na xmlns=\"http://www.w3.org/1999/xhtml\"\e"
endif
" Cleanup

View File

@ -2,7 +2,12 @@
" Language: Inno Setup File (iss file) and My InnoSetup extension
" Maintainer: Jason Mills (jmills@cs.mun.ca)
" Previous Maintainer: Dominique St<53>phan (dominique@mggen.com)
" Last Change: 2004 Jul 13
" Last Change: 2004 Dec 14
"
" Todo:
" - The paramter String: is matched as flag string (because of case ignore).
" - Pascal scripting syntax is not recognized.
" - Embedded double quotes confuse string matches. e.g. "asfd""asfa"
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@ -19,36 +24,37 @@ syn case ignore
syn region issPreProc start="^\s*#" end="$"
" Section
syn region issHeader start="\[" end="\]"
syn region issSection start="\[" end="\]"
" Label in the [Setup] Section
syn match issLabel "^[^=]\+="
syn match issDirective "^[^=]\+="
" URL
syn match issURL "http[s]\=:\/\/.*$"
syn match issURL "http[s]\=:\/\/.*$"
" syn match issName "[^: ]\+:"
syn match issName "Name:"
syn match issName "MinVersion:\|OnlyBelowVersion:\|Languages:"
syn match issName "Source:\|DestDir:\|DestName:\|CopyMode:"
syn match issName "Attribs:\|Permissions:\|FontInstall:\|Flags:"
syn match issName "FileName:\|Parameters:\|WorkingDir:\|HotKey:\|Comment:"
syn match issName "IconFilename:\|IconIndex:"
syn match issName "Section:\|Key:\|String:"
syn match issName "Root:\|SubKey:\|ValueType:\|ValueName:\|ValueData:"
syn match issName "RunOnceId:"
syn match issName "Type:"
syn match issName "Components:\|Description:\|GroupDescription:\|Types:\|ExtraDiskSpaceRequired:"
syn match issName "StatusMsg:\|RunOnceId:\|Tasks:"
syn match issName "MessagesFile:\|LicenseFile:\|InfoBeforeFile:\|InfoAfterFile:"
" Parameters used for any section.
" syn match issParam"[^: ]\+:"
syn match issParam "Name:"
syn match issParam "MinVersion:\|OnlyBelowVersion:\|Languages:"
syn match issParam "Source:\|DestDir:\|DestName:\|CopyMode:"
syn match issParam "Attribs:\|Permissions:\|FontInstall:\|Flags:"
syn match issParam "FileName:\|Parameters:\|WorkingDir:\|HotKey:\|Comment:"
syn match issParam "IconFilename:\|IconIndex:"
syn match issParam "Section:\|Key:\|String:"
syn match issParam "Root:\|SubKey:\|ValueType:\|ValueName:\|ValueData:"
syn match issParam "RunOnceId:"
syn match issParam "Type:\|Excludes:"
syn match issParam "Components:\|Description:\|GroupDescription:\|Types:\|ExtraDiskSpaceRequired:"
syn match issParam "StatusMsg:\|RunOnceId:\|Tasks:"
syn match issParam "MessagesFile:\|LicenseFile:\|InfoBeforeFile:\|InfoAfterFile:"
syn match issComment "^;.*$"
syn match issComment "^\s*;.*$"
" folder constant
syn match issFolder "{[^{]*}"
syn match issFolder "{[^{]*}"
" string
syn region issString start=+"+ end=+"+ contains=issFolder
syn region issString start=+"+ end=+"+ contains=issFolder
" [Dirs]
syn keyword issDirsFlags deleteafterinstall uninsalwaysuninstall uninsneveruninstall
@ -63,6 +69,8 @@ syn keyword issFilesFlags isreadme onlyifdestfileexists onlyifdoesntexist overwr
syn keyword issFilesFlags promptifolder recursesubdirs regserver regtypelib restartreplace
syn keyword issFilesFlags sharedfile skipifsourcedoesntexist sortfilesbyextension touch
syn keyword issFilesFlags uninsremovereadonly uninsrestartdelete uninsneveruninstall
syn keyword issFilesFlags replacesameversion nocompression noencryption noregerror
" [Icons]
syn keyword issIconsFlags closeonexit createonlyiffileexists dontcloseonexit
@ -108,30 +116,30 @@ if version >= 508 || !exists("did_iss_syntax_inits")
endif
" The default methods for highlighting. Can be overridden later
HiLink issHeader Special
HiLink issComment Comment
HiLink issLabel Type
HiLink issName Type
HiLink issFolder Special
HiLink issString String
HiLink issValue String
HiLink issURL Include
HiLink issPreProc PreProc
HiLink issSection Special
HiLink issComment Comment
HiLink issDirective Type
HiLink issParam Type
HiLink issFolder Special
HiLink issString String
HiLink issURL Include
HiLink issPreProc PreProc
HiLink issDirsFlags Keyword
HiLink issFilesCopyMode Keyword
HiLink issFilesAttribs Keyword
HiLink issFilesFlags Keyword
HiLink issIconsFlags Keyword
HiLink issINIFlags Keyword
HiLink issRegRootKey Keyword
HiLink issRegValueType Keyword
HiLink issRegFlags Keyword
HiLink issRunFlags Keyword
HiLink issTypesFlags Keyword
HiLink issComponentsFlags Keyword
HiLink issInstallDeleteType Keyword
HiLink issTasksFlags Keyword
HiLink issDirsFlags Keyword
HiLink issFilesCopyMode Keyword
HiLink issFilesAttribs Keyword
HiLink issFilesPermissions Keyword
HiLink issFilesFlags Keyword
HiLink issIconsFlags Keyword
HiLink issINIFlags Keyword
HiLink issRegRootKey Keyword
HiLink issRegValueType Keyword
HiLink issRegFlags Keyword
HiLink issRunFlags Keyword
HiLink issTypesFlags Keyword
HiLink issComponentsFlags Keyword
HiLink issInstallDeleteType Keyword
HiLink issTasksFlags Keyword
delcommand HiLink
endif

55
runtime/syntax/netrc.vim Normal file
View File

@ -0,0 +1,55 @@
" Vim syntax file
" Maintainer: Nikolai Weibull <source@pcppopper.org>
" URL: http://www.pcppopper.org/
" Latest Revision: 2004-12-16
" arch-tag: 4f6ecb37-d10c-4eca-add0-77991559414a
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" Keywords
syn keyword netrcKeyword machine password nextgroup=netrcName skipwhite skipnl
syn keyword netrcKeyword login nextgroup=netrcName,netrcSpecial skipwhite skipnl
syn keyword netrcKeyword default
syn keyword netrcKeyword macdef nextgroup=netrcInit,netrcMacroName skipwhite skipnl
syn region netrcMacro contained start='.' end='^$'
" Names
syn match netrcName contained display '\S\+'
syn match netrcName contained display '"[^\\"]*\(\\.[^\\"]*\)*'
syn match netrcMacroName contained display '\S\+' nextgroup=netrcMacro skipwhite skipnl
syn match netrcMacroName contained display '"[^\\"]*\(\\.[^\\"]*\)*' nextgroup=netrcMacro skipwhite skipnl
" Special
syn keyword netrcSpecial contained anonymous
syn match netrcInit contained '\<init$' nextgroup=netrcMacro skipwhite skipnl
syn sync fromstart
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_netrc_syn_inits")
if version < 508
let did_netrc_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink netrcKeyword Keyword
HiLink netrcMacro PreProc
HiLink netrcName String
HiLink netrcMacroName String
HiLink netrcSpecial Special
HiLink netrcInit Special
delcommand HiLink
endif
let b:current_syntax = "netrc"
" vim: set sts=2 sw=2:

290
runtime/syntax/sudoers.vim Normal file
View File

@ -0,0 +1,290 @@
" Vim syntax file
" Language: sudoers(5) configuration files.
" Maintainer: Nikolai Weibull <source@pcppopper.org>
" URL: http://www.pcppopper.org/
" Latest Revision: 2004-12-17
" arch-tag: 02fc3bc8-4308-466f-b83e-718a7487b198
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" TODO: instead of 'skipnl', we would like to match a specific group that would
" match \\$ and then continue with the nextgroup, actually, the skipnl doesn't
" work...
" TODO: treat 'ALL' like a special (yay, a bundle of new rules!!!)
" User Specs
syn match sudoersUserSpec '^' nextgroup=@sudoersUserInSpec skipwhite
syn match sudoersSpecEquals contained '=' nextgroup=@sudoersCmndSpecList skipwhite
syn cluster sudoersCmndSpecList contains=sudoersUserRunasBegin,sudoersPASSWD,@sudoersCmndInSpec
" Todo
syn keyword sudoersTodo contained TODO FIXME XXX NOTE
" Comments
syn region sudoersComment matchgroup=sudoersComment start='#' end='$' contains=sudoersTodo
" Aliases
syn keyword sudoersAlias User_Alias Runas_Alias nextgroup=sudoersUserAlias skipwhite skipnl
syn keyword sudoersAlias Host_Alias nextgroup=sudoersHostAlias skipwhite skipnl
syn keyword sudoersAlias Cmnd_Alias nextgroup=sudoersCmndAlias skipwhite skipnl
" Names
syn match sudoersUserAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersUserAliasEquals skipwhite skipnl
syn match sudoersUserNameInList contained '\<\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl
syn match sudoersUIDInList contained '#\d\+\>' nextgroup=@sudoersUserList skipwhite skipnl
syn match sudoersGroupInList contained '%\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl
syn match sudoersUserNetgroupInList contained '+\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl
syn match sudoersUserAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserList skipwhite skipnl
syn match sudoersUserName contained '\<\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
syn match sudoersUID contained '#\d\+\>' nextgroup=@sudoersParameter skipwhite skipnl
syn match sudoersGroup contained '%\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
syn match sudoersUserNetgroup contained '+\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
syn match sudoersUserAliasRef contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersParameter skipwhite skipnl
syn match sudoersUserNameInSpec contained '\<\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
syn match sudoersUIDInSpec contained '#\d\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
syn match sudoersGroupInSpec contained '%\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
syn match sudoersUserNetgroupInSpec contained '+\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
syn match sudoersUserAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserSpec skipwhite skipnl
syn match sudoersUserNameInRunas contained '\<\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
syn match sudoersUIDInRunas contained '#\d\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
syn match sudoersGroupInRunas contained '%\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
syn match sudoersUserNetgroupInRunas contained '+\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
syn match sudoersUserAliasInRunas contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserRunas skipwhite skipnl
syn match sudoersHostAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersHostAliasEquals skipwhite skipnl
syn match sudoersHostNameInList contained '\<\l\+\>' nextgroup=@sudoersHostList skipwhite skipnl
syn match sudoersIPAddrInList contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersHostList skipwhite skipnl
syn match sudoersNetworkInList contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersHostList skipwhite skipnl
syn match sudoersHostNetgroupInList contained '+\l\+\>' nextgroup=@sudoersHostList skipwhite skipnl
syn match sudoersHostAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersHostList skipwhite skipnl
syn match sudoersHostName contained '\<\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
syn match sudoersIPAddr contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersParameter skipwhite skipnl
syn match sudoersNetwork contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersParameter skipwhite skipnl
syn match sudoersHostNetgroup contained '+\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
syn match sudoersHostAliasRef contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersParameter skipwhite skipnl
syn match sudoersHostNameInSpec contained '\<\l\+\>' nextgroup=@sudoersHostSpec skipwhite skipnl
syn match sudoersIPAddrInSpec contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersHostSpec skipwhite skipnl
syn match sudoersNetworkInSpec contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersHostSpec skipwhite skipnl
syn match sudoersHostNetgroupInSpec contained '+\l\+\>' nextgroup=@sudoersHostSpec skipwhite skipnl
syn match sudoersHostAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersHostSpec skipwhite skipnl
syn match sudoersCmndAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersCmndAliasEquals skipwhite skipnl
syn match sudoersCmndNameInList contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=@sudoersCmndList,sudoersCommandEmpty,sudoersCommandArgs skipwhite
syn match sudoersCmndAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersCmndList skipwhite skipnl
syn match sudoersCmndNameInSpec contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=@sudoersCmndSpec,sudoersCommandEmptyInSpec,sudoersCommandArgsInSpec skipwhite
syn match sudoersCmndAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersCmndSpec skipwhite skipnl
" Delimiters
syn match sudoersUserAliasEquals contained '=' nextgroup=@sudoersUserInList skipwhite skipnl
syn match sudoersUserListComma contained ',' nextgroup=@sudoersUserInList skipwhite skipnl
syn match sudoersUserListColon contained ':' nextgroup=sudoersUserAlias skipwhite skipnl
syn cluster sudoersUserList contains=sudoersUserListComma,sudoersUserListColon
syn match sudoersUserSpecComma contained ',' nextgroup=@sudoersUserInSpec skipwhite skipnl
syn cluster sudoersUserSpec contains=sudoersUserSpecComma,@sudoersHostInSpec
syn match sudoersUserRunasBegin contained '(' nextgroup=@sudoersUserInRunas skipwhite skipnl
syn match sudoersUserRunasComma contained ',' nextgroup=@sudoersUserInRunas skipwhite skipnl
syn match sudoersUserRunasEnd contained ')' nextgroup=sudoersPASSWD,@sudoersCmndInSpec skipwhite skipnl
syn cluster sudoersUserRunas contains=sudoersUserRunasComma,@sudoersUserInRunas,sudoersUserRunasEnd
syn match sudoersHostAliasEquals contained '=' nextgroup=@sudoersHostInList skipwhite skipnl
syn match sudoersHostListComma contained ',' nextgroup=@sudoersHostInList skipwhite skipnl
syn match sudoersHostListColon contained ':' nextgroup=sudoersHostAlias skipwhite skipnl
syn cluster sudoersHostList contains=sudoersHostListComma,sudoersHostListColon
syn match sudoersHostSpecComma contained ',' nextgroup=@sudoersHostInSpec skipwhite skipnl
syn cluster sudoersHostSpec contains=sudoersHostSpecComma,sudoersSpecEquals
syn match sudoersCmndAliasEquals contained '=' nextgroup=@sudoersCmndInList skipwhite skipnl
syn match sudoersCmndListComma contained ',' nextgroup=@sudoersCmndInList skipwhite skipnl
syn match sudoersCmndListColon contained ':' nextgroup=sudoersCmndAlias skipwhite skipnl
syn cluster sudoersCmndList contains=sudoersCmndListComma,sudoersCmndListColon
syn match sudoersCmndSpecComma contained ',' nextgroup=@sudoersCmndSpecList skipwhite skipnl
syn match sudoersCmndSpecColon contained ':' nextgroup=@sudoersUserInSpec skipwhite skipnl
syn cluster sudoersCmndSpec contains=sudoersCmndSpecComma,sudoersCmndSpecColon
" Lists
syn cluster sudoersUserInList contains=sudoersUserNegationInList,sudoersUserNameInList,sudoersUIDInList,sudoersGroupInList,sudoersUserNetgroupInList,sudoersUserAliasInList
syn cluster sudoersHostInList contains=sudoersHostNegationInList,sudoersHostNameInList,sudoersIPAddrInList,sudoersNetworkInList,sudoersHostNetgroupInList,sudoersHostAliasInList
syn cluster sudoersCmndInList contains=sudoersCmndNegationInList,sudoersCmndNameInList,sudoersCmndAliasInList
syn cluster sudoersUser contains=sudoersUserNegation,sudoersUserName,sudoersUID,sudoersGroup,sudoersUserNetgroup,sudoersUserAliasRef
syn cluster sudoersHost contains=sudoersHostNegation,sudoersHostName,sudoersIPAddr,sudoersNetwork,sudoersHostNetgroup,sudoersHostAliasRef
syn cluster sudoersUserInSpec contains=sudoersUserNegationInSpec,sudoersUserNameInSpec,sudoersUIDInSpec,sudoersGroupInSpec,sudoersUserNetgroupInSpec,sudoersUserAliasInSpec
syn cluster sudoersHostInSpec contains=sudoersHostNegationInSpec,sudoersHostNameInSpec,sudoersIPAddrInSpec,sudoersNetworkInSpec,sudoersHostNetgroupInSpec,sudoersHostAliasInSpec
syn cluster sudoersUserInRunas contains=sudoersUserNegationInRunas,sudoersUserNameInRunas,sudoersUIDInRunas,sudoersGroupInRunas,sudoersUserNetgroupInRunas,sudoersUserAliasInRunas
syn cluster sudoersCmndInSpec contains=sudoersCmndNegationInSpec,sudoersCmndNameInSpec,sudoersCmndAliasInSpec
" Operators
syn match sudoersUserNegationInList contained '!\+' nextgroup=@sudoersUserInList skipwhite skipnl
syn match sudoersHostNegationInList contained '!\+' nextgroup=@sudoersHostInList skipwhite skipnl
syn match sudoersCmndNegationInList contained '!\+' nextgroup=@sudoersCmndInList skipwhite skipnl
syn match sudoersUserNegation contained '!\+' nextgroup=@sudoersUser skipwhite skipnl
syn match sudoersHostNegation contained '!\+' nextgroup=@sudoersHost skipwhite skipnl
syn match sudoersUserNegationInSpec contained '!\+' nextgroup=@sudoersUserInSpec skipwhite skipnl
syn match sudoersHostNegationInSpec contained '!\+' nextgroup=@sudoersHostInSpec skipwhite skipnl
syn match sudoersUserNegationInRunas contained '!\+' nextgroup=@sudoersUserInRunas skipwhite skipnl
syn match sudoersCmndNegationInSpec contained '!\+' nextgroup=@sudoersCmndInSpec skipwhite skipnl
" Arguments
syn match sudoersCommandArgs contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersCommandArgs,@sudoersCmndList skipwhite
syn match sudoersCommandEmpty contained '""' nextgroup=@sudoersCmndList skipwhite skipnl
syn match sudoersCommandArgsInSpec contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersCommandArgsInSpec,@sudoersCmndSpec skipwhite
syn match sudoersCommandEmptyInSpec contained '""' nextgroup=@sudoersCmndSpec skipwhite skipnl
" Default Entries
syn keyword sudoersDefaultEntry Defaults nextgroup=sudoersDefaultTypeAt,sudoersDefaultTypeColon,sudoersDefaultTypeGreaterThan,@sudoersParameter skipwhite skipnl
syn match sudoersDefaultTypeAt contained '@' nextgroup=@sudoersHost skipwhite skipnl
syn match sudoersDefaultTypeColon contained ':' nextgroup=@sudoersUser skipwhite skipnl
syn match sudoersDefaultTypeGreaterThan contained '>' nextgroup=@sudoersUser skipwhite skipnl
" TODO: could also deal with special characters here
syn keyword sudoersBooleanParameter contained long_opt_prompt ignore_dot mail_always mail_badpass mail_no_user mail_no_perms tty_tickets lecture authenticate root_sudo log_host log_year shell_noargs set_home always_set_home path_info preserve_groups fqdn insults requiretty env_editor rootpw runaspw targetpw set_logname stay_setuid env_reset use_loginclass nextgroup=sudoersParameterListComma skipwhite skipnl
syn keyword sudoersIntegerParameter contained passwd_tries loglinelen timestamp_timeout passwd_timeout umask nextgroup=sudoersIntegerParameterEquals skipwhite skipnl
syn keyword sudoersStringParameter contained mailsub badpass_message timestampdir timestampowner passprompt runas_default syslog_goodpri syslog_badpri editor logfile syslog mailerpath mailerflags mailto exempt_group verifypw listpw nextgroup=sudoersStringParameterEquals skipwhite skipnl
syn keyword sudoersListParameter contained env_check env_delete env_keep nextgroup=sudoersListParameterEquals skipwhite skipnl
syn match sudoersParameterListComma contained ',' nextgroup=@sudoersParameter skipwhite skipnl
syn cluster sudoersParameter contains=sudoersBooleanParameter,sudoersIntegerParameterEquals,sudoersStringParameter,sudoersListParameter
syn match sudoersIntegerParameterEquals contained '[+-]\==' nextgroup=sudoersIntegerValue skipwhite skipnl
syn match sudoersStringParameterEquals contained '[+-]\==' nextgroup=sudoersStringValue skipwhite skipnl
syn match sudoersListParameterEquals contained '[+-]\==' nextgroup=sudoersListValue skipwhite skipnl
syn match sudoersIntegerValue contained '\d\+' nextgroup=sudoersParameterListComma skipwhite skipnl
syn match sudoersStringValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl
syn region sudoersStringValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl
syn match sudoersListValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl
syn region sudoersListValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl
" Special for specs
syn match sudoersPASSWD contained '\%(NO\)\=PASSWD:' nextgroup=@sudoersCmndInSpec skipwhite
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_sudoers_syn_inits")
if version < 508
let did_sudoers_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink sudoersSpecEquals Operator
HiLink sudoersTodo Todo
HiLink sudoersComment Comment
HiLink sudoersAlias Keyword
HiLink sudoersUserAlias Identifier
HiLink sudoersUserNameInList String
HiLink sudoersUIDInList Number
HiLink sudoersGroupInList PreProc
HiLink sudoersUserNetgroupInList PreProc
HiLink sudoersUserAliasInList PreProc
HiLink sudoersUserName String
HiLink sudoersUID Number
HiLink sudoersGroup PreProc
HiLink sudoersUserNetgroup PreProc
HiLink sudoersUserAliasRef PreProc
HiLink sudoersUserNameInSpec String
HiLink sudoersUIDInSpec Number
HiLink sudoersGroupInSpec PreProc
HiLink sudoersUserNetgroupInSpec PreProc
HiLink sudoersUserAliasInSpec PreProc
HiLink sudoersUserNameInRunas String
HiLink sudoersUIDInRunas Number
HiLink sudoersGroupInRunas PreProc
HiLink sudoersUserNetgroupInRunas PreProc
HiLink sudoersUserAliasInRunas PreProc
HiLink sudoersHostAlias Identifier
HiLink sudoersHostNameInList String
HiLink sudoersIPAddrInList Number
HiLink sudoersNetworkInList Number
HiLink sudoersHostNetgroupInList PreProc
HiLink sudoersHostAliasInList PreProc
HiLink sudoersHostName String
HiLink sudoersIPAddr Number
HiLink sudoersNetwork Number
HiLink sudoersHostNetgroup PreProc
HiLink sudoersHostAliasRef PreProc
HiLink sudoersHostNameInSpec String
HiLink sudoersIPAddrInSpec Number
HiLink sudoersNetworkInSpec Number
HiLink sudoersHostNetgroupInSpec PreProc
HiLink sudoersHostAliasInSpec PreProc
HiLink sudoersCmndAlias Identifier
HiLink sudoersCmndNameInList String
HiLink sudoersCmndAliasInList PreProc
HiLink sudoersCmndNameInSpec String
HiLink sudoersCmndAliasInSpec PreProc
HiLink sudoersUserAliasEquals Operator
HiLink sudoersUserListComma Delimiter
HiLink sudoersUserListColon Delimiter
HiLink sudoersUserSpecComma Delimiter
HiLink sudoersUserRunasBegin Delimiter
HiLink sudoersUserRunasComma Delimiter
HiLink sudoersUserRunasEnd Delimiter
HiLink sudoersHostAliasEquals Operator
HiLink sudoersHostListComma Delimiter
HiLink sudoersHostListColon Delimiter
HiLink sudoersHostSpecComma Delimiter
HiLink sudoersCmndAliasEquals Operator
HiLink sudoersCmndListComma Delimiter
HiLink sudoersCmndListColon Delimiter
HiLink sudoersCmndSpecComma Delimiter
HiLink sudoersCmndSpecColon Delimiter
HiLink sudoersUserNegationInList Operator
HiLink sudoersHostNegationInList Operator
HiLink sudoersCmndNegationInList Operator
HiLink sudoersUserNegation Operator
HiLink sudoersHostNegation Operator
HiLink sudoersUserNegationInSpec Operator
HiLink sudoersHostNegationInSpec Operator
HiLink sudoersUserNegationInRunas Operator
HiLink sudoersCmndNegationInSpec Operator
HiLink sudoersCommandArgs String
HiLink sudoersCommandEmpty Special
HiLink sudoersDefaultEntry Keyword
HiLink sudoersDefaultTypeAt Special
HiLink sudoersDefaultTypeColon Special
HiLink sudoersDefaultTypeGreaterThan Special
HiLink sudoersBooleanParameter Identifier
HiLink sudoersIntegerParameter Identifier
HiLink sudoersStringParameter Identifier
HiLink sudoersListParameter Identifier
HiLink sudoersParameterListComma Delimiter
HiLink sudoersIntegerParameterEquals Operator
HiLink sudoersStringParameterEquals Operator
HiLink sudoersListParameterEquals Operator
HiLink sudoersIntegerValue Number
HiLink sudoersStringValue String
HiLink sudoersListValue String
HiLink sudoersPASSWD Special
delcommand HiLink
endif
let b:current_syntax = "sudoers"
" vim: set sts=2 sw=2: