0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

updated for version 7.0021

This commit is contained in:
Bram Moolenaar 2004-12-09 21:34:53 +00:00
parent 741b07e009
commit 293ee4d421
109 changed files with 3216 additions and 1368 deletions

View File

@ -449,6 +449,7 @@ RT_ALL = \
runtime/doc/vimdiff.1 \ runtime/doc/vimdiff.1 \
runtime/doc/vimtutor.1 \ runtime/doc/vimtutor.1 \
runtime/doc/xxd.1 \ runtime/doc/xxd.1 \
runtime/doc/*-it.1 \
runtime/ftoff.vim \ runtime/ftoff.vim \
runtime/gvimrc_example.vim \ runtime/gvimrc_example.vim \
runtime/macros/README.txt \ runtime/macros/README.txt \

View File

@ -1,8 +1,8 @@
" Vim compiler file " Vim compiler file
" Compiler: Checkstyle " Compiler: Checkstyle
" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au> " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" URL: http://mugca.its.monash.edu.au/~djkea2/vim/compiler/checkstyle.vim " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/compiler/checkstyle.vim
" Last Change: 2004 Mar 27 " Last Change: 2004 Nov 27
if exists("current_compiler") if exists("current_compiler")
finish finish

View File

@ -1,8 +1,8 @@
" Vim compiler file " Vim compiler file
" Compiler: javac " Compiler: javac
" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au> " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" URL: http://mugca.its.monash.edu.au/~djkea2/vim/compiler/javac.vim " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/compiler/javac.vim
" Last Change: 2004 Apr 15 " Last Change: 2004 Nov 27
if exists("current_compiler") if exists("current_compiler")
finish finish

View File

@ -1,8 +1,8 @@
" Vim compiler file " Vim compiler file
" Compiler: PHP " Compiler: PHP
" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au> " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" URL: http://mugca.its.monash.edu.au/~djkea2/vim/compiler/php.vim " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/compiler/php.vim
" Last Change: 2004 Sep 05 " Last Change: 2004 Nov 27
if exists("current_compiler") if exists("current_compiler")
finish finish

View File

@ -10,7 +10,7 @@
" "
" Contributors: " Contributors:
" Hugh Sasse <hgs@dmu.ac.uk> " Hugh Sasse <hgs@dmu.ac.uk>
" Doug Kearns <djkea2@mugca.its.monash.edu.au> " Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" "
" Todo: " Todo:
" match error type %m " match error type %m

View File

@ -1,8 +1,8 @@
" Vim compiler file " Vim compiler file
" Compiler: se (SmartEiffel Compiler) " Compiler: se (SmartEiffel Compiler)
" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au> " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" URL: http://mugca.its.monash.edu.au/~djkea2/vim/compiler/se.vim " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/compiler/se.vim
" Last Change: 2004 May 16 " Last Change: 2004 Nov 27
if exists("current_compiler") if exists("current_compiler")
finish finish

View File

@ -1,8 +1,8 @@
" Vim compiler file " Vim compiler file
" Compiler: tcl " Compiler: tcl
" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au> " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" URL: http://mugca.its.monash.edu.au/~djkea2/vim/compiler/tcl.vim " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/compiler/tcl.vim
" Last Change: 2004 Mar 27 " Last Change: 2004 Nov 27
if exists("current_compiler") if exists("current_compiler")
finish finish

View File

@ -1,8 +1,8 @@
" Vim compiler file " Vim compiler file
" Compiler: HTML Tidy " Compiler: HTML Tidy
" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au> " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" URL: http://mugca.its.monash.edu.au/~djkea2/vim/compiler/tidy.vim " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/compiler/tidy.vim
" Last Change: 2004 Mar 27 " Last Change: 2004 Nov 27
" NOTE: set 'tidy_compiler_040800' if you are using the 4th August 2000 release " NOTE: set 'tidy_compiler_040800' if you are using the 4th August 2000 release
" of HTML Tidy. " of HTML Tidy.

View File

@ -1,8 +1,8 @@
" Vim compiler file " Vim compiler file
" Compiler: xmllint " Compiler: xmllint
" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au> " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" URL: http://mugca.its.monash.edu.au/~djkea2/vim/compiler/xmllint.vim " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/compiler/xmllint.vim
" Last Change: 2004 Mar 27 " Last Change: 2004 Nov 27
if exists("current_compiler") if exists("current_compiler")
finish finish

View File

@ -36,6 +36,7 @@ DOCS = \
help.txt \ help.txt \
howto.txt \ howto.txt \
if_cscop.txt \ if_cscop.txt \
if_mzsch.txt \
if_ole.txt \ if_ole.txt \
if_perl.txt \ if_perl.txt \
if_pyth.txt \ if_pyth.txt \
@ -156,6 +157,7 @@ HTMLS = \
help.html \ help.html \
howto.html \ howto.html \
if_cscop.html \ if_cscop.html \
if_mzsch.html \
if_ole.html \ if_ole.html \
if_perl.html \ if_perl.html \
if_pyth.html \ if_pyth.html \

View File

@ -1,4 +1,4 @@
*change.txt* For Vim version 7.0aa. Last change: 2004 Oct 11 *change.txt* For Vim version 7.0aa. Last change: 2004 Nov 30
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -350,23 +350,24 @@ CTRL-X Subtract [count] from the number or alphabetic
The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned
octal and hexadecimal numbers and alphabetic characters. This depends on the octal and hexadecimal numbers and alphabetic characters. This depends on the
'nrformats' option. 'nrformats' option.
- When 'nrformats' includes "alpha", Vim will change the alphabetic character
under or after the cursor. This is useful to make lists with an alphabetic
index.
- When 'nrformats' includes "hex", Vim assumes numbers starting with '0x' or
'0X' are hexadecimal. The case of the rightmost letter in the number
determines the case of the resulting hexadecimal number. If there is no
letter in the current number, Vim uses the previously detected case.
- When 'nrformats' includes "octal", Vim considers numbers starting with a '0' - 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. 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 If the cursor is on a number, the commands apply to that number; otherwise
Vim uses the number to the right of the cursor. Vim uses the number to the right of the cursor.
- When 'nrformats' includes "hex", Vim assumes numbers starting with '0x' or
'0X' are hexadecimal. The case of the rightmost letter in the number
determines the case of the resulting hexadecimal number. If there is no
letter in the current number, Vim uses the previously detected case.
- When 'nrformats' includes "alpha", Vim will change the alphabetic character
under or after the cursor. This is useful to make lists with an alphabetic
index.
For numbers with leading zeros (including all octal and hexadecimal numbers), 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 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". Note that "0077" results in "0100", CTRL-X on "0x100" results in "0x0ff".
when 'nrformats' includes "octal", decimal numbers with leading zeros are
impossible because they are indistinguishable from octal numbers. Note that when 'nrformats' includes "octal", decimal numbers with leading
zeros are impossible because they are indistinguishable from octal numbers.
The CTRL-A command is very useful in a macro. Example: Use the following The CTRL-A command is very useful in a macro. Example: Use the following
steps to make a numbered list. steps to make a numbered list.
@ -863,8 +864,10 @@ inside of strings can change! Also see 'softtabstop' option. >
*<MiddleMouse>* *<MiddleMouse>*
["x]<MiddleMouse> Put the text from a register before the cursor [count] ["x]<MiddleMouse> Put the text from a register before the cursor [count]
times. Uses the "* register, unless another is times. Uses the "* register, unless another is
specified. Using the mouse only works when 'mouse' specified.
contains 'n' or 'a'. Leaves the cursor at the end of the new text.
Using the mouse only works when 'mouse' contains 'n'
or 'a'.
{not in Vi} {not in Vi}
If you have a scrollwheel and often accidentally paste If you have a scrollwheel and often accidentally paste
text, you can use these mappings to disable the text, you can use these mappings to disable the

54
runtime/doc/evim-it.1 Executable file
View File

@ -0,0 +1,54 @@
.TH EVIM 1 "16 febbraio 2002 "
.SH NOME
evim \- Vim "facile", Vim impostato in modo da poter essere usato
facilmente per modificare file, anche da chi non abbia familiarità
con i comandi.
.SH SINTASSI
.br
.B evim
[opzioni] [file ..]
.br
.B eview
.SH DESCRIZIONE
.B evim
Inizia
.B Vim
e imposta le opzioni per farlo comportare come un editore "modeless".
State sempre usando Vim, ma come un editore "posizionati-e-clicca".
Simile all'uso di Notepad in MS-Windows.
.B evim
richiede la presenza della GUI, per avere a disposizione menu e barra
strumenti.
.PP
Da usarsi solo da parte di chi non è in grado di lavorare con Vim nella
maniera usuale.
La modifica file sarà molto meno efficiente.
.PP
.B eview
come sopra, ma parte in modalità "Sola Lettura". Funziona come evim -R.
.PP
Vedere vim(1) per dettagli riguardo a Vim, opzioni, etc.
.PP
L'opzione 'insertmode' è impostata per poter immettere del testo direttamente.
.br
Sono definite delle mappature che consentono di usare COPIA e INCOLLA con i
familiari tasti usati sotto MS-Windows.
CTRL-X taglia testo, CTRL-C copia testo e CTRL-V incolla testo.
Usate CTRL-Q per ottenere quello chs si ottierrebbe con CTRL-V in Vim nativo.
.SH OPZIONI
Vedere vim(1).
.SH FILE
.TP 15
/usr/local/lib/vim/evim.vim
Lo script caricato per inizializzare eVim.
.SH NAC [NOTO ANCHE COME]
Noto Anche Come "Vim per semplici".
Quando usate evim si suppone che prendiate un fazzoletto,
facciate un nodo ad ogni angolo e ve lo mettiate in testa.
.SH VEDERE ANCHE
vim(1)
.SH AUTORE
Buona parte di
.B Vim
è stato scritto da Bram Moolenaar, con molto aiuto da altri.
Vedere il Menu "Aiuto/Crediti".

View File

@ -1,4 +1,4 @@
*if_ole.txt* For Vim version 7.0aa. Last change: 2003 Jun 19 *if_ole.txt* For Vim version 7.0aa. Last change: 2004 Dec 09
VIM REFERENCE MANUAL by Paul Moore VIM REFERENCE MANUAL by Paul Moore
@ -158,5 +158,41 @@ Studio. This is called "VisVim". It is included in the archive that contains
the OLE version. The documentation can be found in the runtime directory, the the OLE version. The documentation can be found in the runtime directory, the
README_VisVim.txt file. README_VisVim.txt file.
Using Vim with Visual Studio .Net~
With .Net you no longer really need VisVim, since .Net studio has support for
external editors. Follow these directions:
In .Net Studio choose from the menu Tools->External Tools...
Add
Title - Vim
Command - c:\vim\vim63\gvim.exe
Arguments - --servername VS_NET --remote-silent "+call cursor($(CurLine), $(CurCol))" $(ItemPath)
Init Dir - Empty
Now, when you open a file in .Net, you can choose from the .Net menu:
Tools->Vim
That will open the file in Vim.
You can then add this external command as an icon and place it anywhere you
like. You might also be able to set this as your default editor.
If you refine this further, please post back to the Vim maillist so we have a
record of it.
--servername VS_NET
This will create a new instance of vim called VS_NET. So if you open multiple
files from VS, they will use the same instance of Vim. This allows you to
have multiple copies of Vim running, but you can control which one has VS
files in it.
--remote-silent "+call cursor(10, 27)"
- Places the cursor on line 10 column 27
In Vim >
:h --remote-silent for mor details
[.Net remarks provided by Dave Fishburn and Brian Sturk]
============================================================================== ==============================================================================
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,4 +1,4 @@
*index.txt* For Vim version 7.0aa. Last change: 2004 Sep 07 *index.txt* For Vim version 7.0aa. Last change: 2004 Nov 30
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -328,8 +328,7 @@ tag char note action in Normal mode ~
characters, repeat the entered text N-1 characters, repeat the entered text N-1
times times
|S| ["x]S 2 delete N lines [into buffer x] and start |S| ["x]S 2 delete N lines [into buffer x] and start
insert; synonym for "^cc" or "0cc", insert; synonym for "cc".
depending on autoindent
|T| T{char} 1 cursor till after Nth occurrence of {char} |T| T{char} 1 cursor till after Nth occurrence of {char}
to the left to the left
|U| U 2 undo all latest changes on one line |U| U 2 undo all latest changes on one line
@ -425,7 +424,7 @@ tag char note action in Normal mode ~
|<Insert>| <Insert> 2 same as "i" |<Insert>| <Insert> 2 same as "i"
|<Left>| <Left> 1 same as "h" |<Left>| <Left> 1 same as "h"
|<LeftMouse>| <LeftMouse> 1 move cursor to the mouse click position |<LeftMouse>| <LeftMouse> 1 move cursor to the mouse click position
|<MiddleMouse>| <MiddleMouse> 2 same as "P" at the mouse click position |<MiddleMouse>| <MiddleMouse> 2 same as "gP" at the mouse click position
|<PageDown>| <PageDown> same as CTRL-F |<PageDown>| <PageDown> same as CTRL-F
|<PageUp>| <PageUp> same as CTRL-B |<PageUp>| <PageUp> same as CTRL-B
|<Right>| <Right> 1 same as "l" |<Right>| <Right> 1 same as "l"

View File

@ -1,4 +1,4 @@
*insert.txt* For Vim version 7.0aa. Last change: 2004 Jul 04 *insert.txt* For Vim version 7.0aa. Last change: 2004 Nov 18
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -124,6 +124,9 @@ CTRL-R {0-9a-z"%#*+:.-=} *i_CTRL-R*
'-' the last small (less than a line) delete '-' the last small (less than a line) delete
'=' the expression register: you are prompted to '=' the expression register: you are prompted to
enter an expression (see |expression|) enter an expression (see |expression|)
Note that 0x80 (128 decimal) is used for
special keys, use CTRL-R CTRL-R to insert it
literally.
See |registers| about registers. {not in Vi} See |registers| about registers. {not in Vi}
CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R* CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*

View File

@ -1,4 +1,4 @@
*intro.txt* For Vim version 7.0aa. Last change: 2004 Oct 08 *intro.txt* For Vim version 7.0aa. Last change: 2004 Nov 18
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -350,7 +350,7 @@ and <> are part of what you type, the context should make this clear.
concatenated. For example, {a-zA-Z0-9} is any alphanumeric concatenated. For example, {a-zA-Z0-9} is any alphanumeric
character. character.
*{motion}* *{motion}* *movement*
{motion} A command that moves the cursor. These are explained in {motion} A command that moves the cursor. These are explained in
|motion.txt|. Examples: |motion.txt|. Examples:
w to start of next word w to start of next word

View File

@ -1,4 +1,4 @@
*map.txt* For Vim version 7.0aa. Last change: 2004 May 21 *map.txt* For Vim version 7.0aa. Last change: 2004 Dec 09
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -232,8 +232,6 @@ command line (not a search pattern) the mappings are disabled until a CTRL-^
is typed. The state last used is remembered for Insert mode and Search is typed. The state last used is remembered for Insert mode and Search
patterns separately. The state for Insert mode is also used when typing a patterns separately. The state for Insert mode is also used when typing a
character as an argument to command like "f" or "t". character as an argument to command like "f" or "t".
When adding a ":lmap" mapping the use of these mappings in Insert mode and
for Search patterns will be switched on.
Language mappings will never be applied to already mapped characters. They Language mappings will never be applied to already mapped characters. They
are only used for typed characters. This assumes that the language mapping are only used for typed characters. This assumes that the language mapping
was already done when typing the mapping. was already done when typing the mapping.

View File

@ -1,4 +1,4 @@
*motion.txt* For Vim version 7.0aa. Last change: 2004 Sep 07 *motion.txt* For Vim version 7.0aa. Last change: 2004 Nov 23
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -814,8 +814,8 @@ was made yet in the current file.
area in the current buffer. {not in Vi}. area in the current buffer. {not in Vi}.
*''* *``* *''* *``*
'' `` To the position before latest jump, or where the last '' `` To the position before the latest jump, or where the
"m'" or "m`" command was given. Not set when the last "m'" or "m`" command was given. Not set when the
|:keepjumps| command modifier was used. |:keepjumps| command modifier was used.
Also see |restore-position|. Also see |restore-position|.
@ -1240,7 +1240,7 @@ L To line [count] from bottom of window (default: Last
Cursor is adjusted for 'scrolloff' option. Cursor is adjusted for 'scrolloff' option.
<LeftMouse> Moves to the position on the screen where the mouse <LeftMouse> Moves to the position on the screen where the mouse
click is |inclusive|. See also |<LeftMouse>|. If the click is |exclusive|. See also |<LeftMouse>|. If the
position is in a status line, that window is made the position is in a status line, that window is made the
active window and the cursor is not moved. {not in Vi} active window and the cursor is not moved. {not in Vi}

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 7.0aa. Last change: 2004 Oct 21 *options.txt* For Vim version 7.0aa. Last change: 2004 Dec 09
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -139,6 +139,9 @@ example, if Alt-b produces <Esc>b, use this: >
(the ^[ is a real <Esc> here, use CTRL-V <Esc> to enter it) (the ^[ is a real <Esc> here, use CTRL-V <Esc> to enter it)
The advantage over a mapping is that it works in all situations. The advantage over a mapping is that it works in all situations.
The t_xx options cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
The listing from ":set" looks different from Vi. Long string options are put The listing from ":set" looks different from Vi. Long string options are put
at the end of the list. The number of options is quite large. The output of at the end of the list. The number of options is quite large. The output of
"set all" probably does not fit on the screen, causing Vim to give the "set all" probably does not fit on the screen, causing Vim to give the
@ -953,6 +956,7 @@ A jump table for the options with a short description can be found at |Q_op|.
accidentally overwriting existing files with a backup file. You might accidentally overwriting existing files with a backup file. You might
prefer using ".bak", but make sure that you don't have files with prefer using ".bak", but make sure that you don't have files with
".bak" that you want to keep. ".bak" that you want to keep.
Only normal file name characters can be used, "/\*?[|<>" are illegal.
If you like to keep a lot of backups, you could use a BufWritePre If you like to keep a lot of backups, you could use a BufWritePre
autocommand to change 'backupext' just before writing the file to autocommand to change 'backupext' just before writing the file to
@ -1835,7 +1839,9 @@ A jump table for the options with a short description can be found at |Q_op|.
everything inside quotes is ignored. When matching a everything inside quotes is ignored. When matching a
paren inside quotes, it will find the matching one (if paren inside quotes, it will find the matching one (if
there is one). This works very well for C programs. there is one). This works very well for C programs.
*cpo-star* This flag is also used for other features, such as
C-indenting.
cpo-star*
* Use ":*" in the same way as ":@". When not included, * Use ":*" in the same way as ":@". When not included,
":*" is an alias for ":'<,'>", select the Visual area. ":*" is an alias for ":'<,'>", select the Visual area.
*cpo-<* *cpo-<*
@ -2479,6 +2485,7 @@ A jump table for the options with a short description can be found at |Q_op|.
type that is actually stored with the file. type that is actually stored with the file.
This option is not copied to another buffer, independent of the 's' or This option is not copied to another buffer, independent of the 's' or
'S' flag in 'cpoptions'. 'S' flag in 'cpoptions'.
Only normal file name characters can be used, "/\*?[|<>" are illegal.
*'fillchars'* *'fcs'* *'fillchars'* *'fcs'*
'fillchars' 'fcs' string (default "vert:|,fold:-") 'fillchars' 'fcs' string (default "vert:|,fold:-")
@ -2725,6 +2732,20 @@ A jump table for the options with a short description can be found at |Q_op|.
This option cannot be set from a |modeline| or in the |sandbox|, for This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons. security reasons.
*'fsync'* *'fs'*
'fsync' 'fs' boolean (default on)
global
{not in Vi}
When on, the library function fsync() will be called after writing a
file. This will flush a file to disk, ensuring that it is safely
written even on filesystems which do metadata-only journaling. This
will force the harddrive to spin up on Linux systems running in laptop
mode, so it may be undesirable in some situations. Be warned that
turning this off increases the chances of data loss after a crash. On
systems without an fsync() implementation, this variable is always
off.
Also see 'swapsync' for controlling fsync() on swap files.
*'gdefault'* *'gd'* *'nogdefault'* *'nogd'* *'gdefault'* *'gd'* *'nogdefault'* *'nogd'*
'gdefault' 'gd' boolean (default off) 'gdefault' 'gd' boolean (default off)
global global
@ -2791,6 +2812,7 @@ A jump table for the options with a short description can be found at |Q_op|.
the height of the cursor can be changed. This can be done by the height of the cursor can be changed. This can be done by
specifying a block cursor, or a percentage for a vertical or specifying a block cursor, or a percentage for a vertical or
horizontal cursor. horizontal cursor.
For a console the 't_SI' and 't_EI' escape sequences are used.
The option is a comma separated list of parts. Each part consist of a The option is a comma separated list of parts. Each part consist of a
mode-list and an argument-list: mode-list and an argument-list:
@ -3686,6 +3708,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Setting this option to a valid keymap name has the side effect of Setting this option to a valid keymap name has the side effect of
setting 'iminsert' to one, so that the keymap becomes effective. setting 'iminsert' to one, so that the keymap becomes effective.
'imsearch' is also set to one, unless it was -1 'imsearch' is also set to one, unless it was -1
Only normal file name characters can be used, "/\*?[|<>" are illegal.
*'keymodel'* *'km'* *'keymodel'* *'km'*
'keymodel' 'km' string (default "") 'keymodel' 'km' string (default "")
@ -3777,6 +3800,7 @@ A jump table for the options with a short description can be found at |Q_op|.
matter what $LANG is set to: > matter what $LANG is set to: >
:set langmenu=nl_NL.ISO_8859-1 :set langmenu=nl_NL.ISO_8859-1
< When 'langmenu' is empty, |v:lang| is used. < When 'langmenu' is empty, |v:lang| is used.
Only normal file name characters can be used, "/\*?[|<>" are illegal.
If your $LANG is set to a non-English language but you do want to use If your $LANG is set to a non-English language but you do want to use
the English menus: > the English menus: >
:set langmenu=none :set langmenu=none
@ -4427,6 +4451,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Using 'patchmode' for compressed files appends the extension at the Using 'patchmode' for compressed files appends the extension at the
end (e.g., "file.gz.orig"), thus the resulting name isn't always end (e.g., "file.gz.orig"), thus the resulting name isn't always
recognized as a compressed file. recognized as a compressed file.
Only normal file name characters can be used, "/\*?[|<>" are illegal.
*'path'* *'pa'* *E343* *E345* *E347* *'path'* *'pa'* *E343* *E345* *E347*
'path' 'pa' string (default on Unix: ".,/usr/include,," 'path' 'pa' string (default on Unix: ".,/usr/include,,"
@ -4537,6 +4562,8 @@ A jump table for the options with a short description can be found at |Q_op|.
feature} feature}
The name of the printer to be used for |:hardcopy|. The name of the printer to be used for |:hardcopy|.
See |pdev-option|. See |pdev-option|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'printencoding'* *'penc'* *'printencoding'* *'penc'*
'printencoding' 'penc' String (default empty, except for some systems) 'printencoding' 'penc' String (default empty, except for some systems)
@ -5647,6 +5674,7 @@ A jump table for the options with a short description can be found at |Q_op|.
systems the swap file will not be written at all. For a unix system systems the swap file will not be written at all. For a unix system
setting it to "sync" will use the sync() call instead of the default setting it to "sync" will use the sync() call instead of the default
fsync(), which may work better on some systems. fsync(), which may work better on some systems.
The 'fsync' option is used for the actual file.
*'switchbuf'* *'swb'* *'switchbuf'* *'swb'*
'switchbuf' 'swb' string (default "") 'switchbuf' 'swb' string (default "")
@ -5687,6 +5715,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Syntax autocommand event is triggered with the value as argument. Syntax autocommand event is triggered with the value as argument.
This option is not copied to another buffer, independent of the 's' or This option is not copied to another buffer, independent of the 's' or
'S' flag in 'cpoptions'. 'S' flag in 'cpoptions'.
Only normal file name characters can be used, "/\*?[|<>" are illegal.
*'tabstop'* *'ts'* *'tabstop'* *'ts'*
'tabstop' 'ts' number (default 8) 'tabstop' 'ts' number (default 8)
@ -6065,6 +6094,8 @@ A jump table for the options with a short description can be found at |Q_op|.
This option will be used for the window title when exiting Vim if the This option will be used for the window title when exiting Vim if the
original title cannot be restored. Only happens if 'title' is on or original title cannot be restored. Only happens if 'title' is on or
'titlestring' is not empty. 'titlestring' is not empty.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'titlestring'* *'titlestring'*
'titlestring' string (default "") 'titlestring' string (default "")
global global
@ -6649,8 +6680,8 @@ A jump table for the options with a short description can be found at |Q_op|.
keys can be mapped. keys can be mapped.
If the menu is disabled by excluding 'm' from 'guioptions', the ALT If the menu is disabled by excluding 'm' from 'guioptions', the ALT
key is never used for the menu. key is never used for the menu.
In the Win32 version, the <F10> key is handled like this too, since This option is not used for <F10>; on Win32 and with GTK <F10> will
Windows uses it to select a menu. select the menu, unless it has been mapped.
*'winheight'* *'wh'* *E591* *'winheight'* *'wh'* *E591*
'winheight' 'wh' number (default 1) 'winheight' 'wh' number (default 1)

View File

@ -1,4 +1,4 @@
*pi_netrw.txt For Vim version 6.2. Last change: Sep 13, 2004 *pi_netrw.txt* For Vim version 6.3. Last change: Oct 08, 2004
VIM REFERENCE MANUAL by Charles E. Campbell, Jr. VIM REFERENCE MANUAL by Charles E. Campbell, Jr.
@ -536,11 +536,13 @@ from <netrw.vim> itself:
<c-l>......Refreshing the Listing..................|netrw-ctrl-l| <c-l>......Refreshing the Listing..................|netrw-ctrl-l|
o..........Browsing with a Horizontal Split........|netrw-o| o..........Browsing with a Horizontal Split........|netrw-o|
p..........Preview Window..........................|netrw-p| p..........Preview Window..........................|netrw-p|
q..........Listing Bookmarks.......................|netrw-q| q..........Listing Bookmarks and History...........|netrw-q|
r..........Reversing Sorting Order.................|netrw-r| r..........Reversing Sorting Order.................|netrw-r|
R..........Renaming Files or Directories...........|netrw-R| R..........Renaming Files or Directories...........|netrw-R|
s..........Selecting Sorting Style.................|netrw-s| s..........Selecting Sorting Style.................|netrw-s|
S..........Editing the Sorting Sequence............|netrw-S| S..........Editing the Sorting Sequence............|netrw-S|
u..........Changing to a Predecessor Directory.....|netrw-u|
U..........Changing to a Successor Directory.......|netrw-U|
v..........Browsing with a Vertical Split..........|netrw-v| v..........Browsing with a Vertical Split..........|netrw-v|
x..........Customizing Browsing....................|netrw-x| x..........Customizing Browsing....................|netrw-x|
@ -751,7 +753,7 @@ EDIT FILE OR DIRECTORY HIDING LIST *netrw-h*
The "<ctrl-h>" map brings up a requestor allowing the user to change the The "<ctrl-h>" map brings up a requestor allowing the user to change the
file/directory hiding list. The hiding list consists of one or more patterns file/directory hiding list. The hiding list consists of one or more patterns
delimited by commas. Files and/or directories satisfying these patterns will delimited by commas. Files and/or directories satisfying these patterns will
be hidden (ie. not shown). either be hidden (ie. not shown) or be the only ones displayed (see |netrw-a|).
BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o*
@ -802,6 +804,22 @@ One may toggle between normal and reverse sorting order by pressing the
"r" key. "r" key.
CHANGING TO A PREDECESSOR DIRECTORY *netrw-u*
Every time you change to a new directory (new for the current session),
netrw will save the directory in a recently-visited directory history
list (unless g:netrw_dirhistmax is zero; by default, its ten). With the
"u" map, one can change to an earlier directory (predecessor). To do
the opposite, see |netrw-U|.
CHANGING TO A SUCCESSOR DIRECTORY *netrw-U*
With the "U" map, one can change to a later directory (successor).
This map is the opposite of the "u" map. (see |netrw-u|) Use the
q map to list both the bookmarks and history. (see |netrw-q|)
BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v*
Normally one enters a file or directory using the <cr>. However, the "v" Normally one enters a file or directory using the <cr>. However, the "v"
@ -854,7 +872,8 @@ One may easily "bookmark" a directory by using
{cnt}b {cnt}b
Any count may be used. One may use viminfo's "!" option to retain bookmarks Any count may be used. One may use viminfo's "!" option to retain bookmarks
between vim sessions. between vim sessions. See |netrw-B| for how to return to a bookmark and
|netrw-q| for how to list them.
CHANGING TO A BOOKMARKED DIRECTORY *netrw-B* CHANGING TO A BOOKMARKED DIRECTORY *netrw-B*
@ -863,12 +882,14 @@ To change directory back to a bookmarked directory, use
{cnt}B {cnt}B
Any count may be used. Any count may be used to reference any of the bookmarks. See |netrw-b|
for how to bookmark a directory and |netrw-q| for how to list them.
LISTING BOOKMARKS *netrw-q* LISTING BOOKMARKS AND HISTORY *netrw-q*
Pressing "q" will list the bookmarked directories. (query) Pressing "q" will list the bookmarked directories and directory traversal
history (query). (see |netrw-b|, |netrw-B|, |netrw-u|, and |netrw-U|)
IMPROVING DIRECTORY BROWSING *netrw-list-hack* IMPROVING DIRECTORY BROWSING *netrw-list-hack*
@ -991,11 +1012,26 @@ which is loaded automatically at startup (assuming :set nocp).
attempting to read/write your file over the network. Please attempting to read/write your file over the network. Please
send that information to <netrw.vim>'s maintainer, send that information to <netrw.vim>'s maintainer,
drchipNOSPAM at campbellfamily.biz - NOSPAM NdrOchip at ScampbellPfamily.AbizM - NOSPAM
============================================================================== ==============================================================================
10. History *netrw-history* 10. History *netrw-history*
v52: * nonumber'ing now set for browsing buffers
* when the hiding list hid all files, error messages ensued. Fixed
* when browsing, swf is set, but directory is not set, when netrw
was attempting to restore options, vim wanted to save a swapfile
to a local directory using an url-style path. Fixed
v51: * cygwin detection now automated (using windows and &shell is bash)
* customizable browser "file" rejection patterns
* directory history
* :[range]w url now supported (ie. netrw has a FileWriteCmd event)
* error messages have a "Press <cr> to continue" to allow them
to be seen
* directory browser displays no longer bother the swapfile
* u/U commands to go up and down the history stack
* history stack may be saved with viminfo with its "!" option
* bugfixes associated with unwanted [No Files] entries
v50: * directories now displayed using buftype=nofile; should keep the v50: * directories now displayed using buftype=nofile; should keep the
directory names as-is directory names as-is
* attempts to remove empty "[No File]" buffers leftover * attempts to remove empty "[No File]" buffers leftover
@ -1003,8 +1039,8 @@ which is loaded automatically at startup (assuming :set nocp).
* bugfix: a "caps-lock" editing difficulty left in v49 was fixed * bugfix: a "caps-lock" editing difficulty left in v49 was fixed
* syntax highlighting for "Showing:" the hiding list included * syntax highlighting for "Showing:" the hiding list included
* bookmarks can now be retained if "!" is in the viminfo option * bookmarks can now be retained if "!" is in the viminfo option
v49: * will use ftp for http://.../ browsing v48: * One may use ftp to v49: * will use ftp for http://.../ browsing v48:
do remote host file browsing * One may use ftp to do remote host file browsing
* (windows and !cygwin) remote browsing with ftp can now use * (windows and !cygwin) remote browsing with ftp can now use
the "dir" command internally to provide listings the "dir" command internally to provide listings
* g:netrw_keepdir now allows one to keep the initial current * g:netrw_keepdir now allows one to keep the initial current
@ -1032,9 +1068,9 @@ which is loaded automatically at startup (assuming :set nocp).
listings listings
* improved unusual file and directory name handling preview * improved unusual file and directory name handling preview
* window support * window support
v47: * now handles local directory browsing. v46: * now handles v47: * now handles local directory browsing.
remote directory browsing v46: * now handles remote directory browsing
* g:netrw_silent (if 1) will cause all transfers to be silent'd * g:netrw_silent (if 1) will cause all transfers to be silent
v45: * made the [user@]hostname:path form a bit more restrictive to v45: * made the [user@]hostname:path form a bit more restrictive to
better handle errors in using protocols (e.g. scp:usr@host:file better handle errors in using protocols (e.g. scp:usr@host:file
was being recognized as an rcp request) v44: * changed from was being recognized as an rcp request) v44: * changed from

View File

@ -1,4 +1,4 @@
*syntax.txt* For Vim version 7.0aa. Last change: 2004 Oct 12 *syntax.txt* For Vim version 7.0aa. Last change: 2004 Dec 09
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -640,6 +640,10 @@ c_no_if0 don't highlight "#if 0" blocks as comments
c_no_cformat don't highlight %-formats in strings c_no_cformat don't highlight %-formats in strings
c_no_c99 don't highlight C99 standard items c_no_c99 don't highlight C99 standard items
When 'foldmethod' is set to "syntax" then /* */ comments and { } blocks will
become a fold. If you don't want comments to become a fold use: >
:let c_no_comment_fold = 1
If you notice highlighting errors while scrolling backwards, which are fixed If you notice highlighting errors while scrolling backwards, which are fixed
when redrawing with CTRL-L, try setting the "c_minlines" internal variable when redrawing with CTRL-L, try setting the "c_minlines" internal variable
to a larger number: > to a larger number: >
@ -2128,6 +2132,9 @@ By default only R5RS keywords are highlighted and properly indented.
MzScheme-specific stuff will be used if b:is_mzscheme or g:is_mzscheme MzScheme-specific stuff will be used if b:is_mzscheme or g:is_mzscheme
variables are defined. variables are defined.
Also scheme.vim supports keywords of the Chicken Scheme->C compiler. Define
b:is_chicken or g:is_chicken, if you need them.
SDL *sdl.vim* *sdl-syntax* SDL *sdl.vim* *sdl-syntax*

View File

@ -229,6 +229,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'formatoptions' options.txt /*'formatoptions'* 'formatoptions' options.txt /*'formatoptions'*
'formatprg' options.txt /*'formatprg'* 'formatprg' options.txt /*'formatprg'*
'fp' options.txt /*'fp'* 'fp' options.txt /*'fp'*
'fs' options.txt /*'fs'*
'fsync' options.txt /*'fsync'*
'ft' options.txt /*'ft'* 'ft' options.txt /*'ft'*
'gcr' options.txt /*'gcr'* 'gcr' options.txt /*'gcr'*
'gd' options.txt /*'gd'* 'gd' options.txt /*'gd'*
@ -756,6 +758,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
't_CV' term.txt /*'t_CV'* 't_CV' term.txt /*'t_CV'*
't_Co' term.txt /*'t_Co'* 't_Co' term.txt /*'t_Co'*
't_DL' term.txt /*'t_DL'* 't_DL' term.txt /*'t_DL'*
't_EI' term.txt /*'t_EI'*
't_F1' term.txt /*'t_F1'* 't_F1' term.txt /*'t_F1'*
't_F2' term.txt /*'t_F2'* 't_F2' term.txt /*'t_F2'*
't_F3' term.txt /*'t_F3'* 't_F3' term.txt /*'t_F3'*
@ -789,6 +792,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
't_KL' term.txt /*'t_KL'* 't_KL' term.txt /*'t_KL'*
't_RI' term.txt /*'t_RI'* 't_RI' term.txt /*'t_RI'*
't_RV' term.txt /*'t_RV'* 't_RV' term.txt /*'t_RV'*
't_SI' term.txt /*'t_SI'*
't_Sb' term.txt /*'t_Sb'* 't_Sb' term.txt /*'t_Sb'*
't_Sf' term.txt /*'t_Sf'* 't_Sf' term.txt /*'t_Sf'*
't_WP' term.txt /*'t_WP'* 't_WP' term.txt /*'t_WP'*
@ -4298,7 +4302,6 @@ cpo-o options.txt /*cpo-o*
cpo-p options.txt /*cpo-p* cpo-p options.txt /*cpo-p*
cpo-r options.txt /*cpo-r* cpo-r options.txt /*cpo-r*
cpo-s options.txt /*cpo-s* cpo-s options.txt /*cpo-s*
cpo-star options.txt /*cpo-star*
cpo-t options.txt /*cpo-t* cpo-t options.txt /*cpo-t*
cpo-u options.txt /*cpo-u* cpo-u options.txt /*cpo-u*
cpo-v options.txt /*cpo-v* cpo-v options.txt /*cpo-v*
@ -4929,7 +4932,6 @@ hebrew hebrew.txt /*hebrew*
hebrew.txt hebrew.txt /*hebrew.txt* hebrew.txt hebrew.txt /*hebrew.txt*
help various.txt /*help* help various.txt /*help*
help-context help.txt /*help-context* help-context help.txt /*help-context*
help-tags tags 1
help-translated various.txt /*help-translated* help-translated various.txt /*help-translated*
help-xterm-window various.txt /*help-xterm-window* help-xterm-window various.txt /*help-xterm-window*
help.txt help.txt /*help.txt* help.txt help.txt /*help.txt*
@ -5391,6 +5393,7 @@ mouse-mode-table term.txt /*mouse-mode-table*
mouse-overview term.txt /*mouse-overview* mouse-overview term.txt /*mouse-overview*
mouse-swap-buttons term.txt /*mouse-swap-buttons* mouse-swap-buttons term.txt /*mouse-swap-buttons*
mouse-using term.txt /*mouse-using* mouse-using term.txt /*mouse-using*
movement intro.txt /*movement*
ms-dos os_msdos.txt /*ms-dos* ms-dos os_msdos.txt /*ms-dos*
msdos os_msdos.txt /*msdos* msdos os_msdos.txt /*msdos*
msdos-arrows os_msdos.txt /*msdos-arrows* msdos-arrows os_msdos.txt /*msdos-arrows*
@ -5462,6 +5465,7 @@ netrw-B pi_netrw.txt /*netrw-B*
netrw-D pi_netrw.txt /*netrw-D* netrw-D pi_netrw.txt /*netrw-D*
netrw-R pi_netrw.txt /*netrw-R* netrw-R pi_netrw.txt /*netrw-R*
netrw-S pi_netrw.txt /*netrw-S* netrw-S pi_netrw.txt /*netrw-S*
netrw-U pi_netrw.txt /*netrw-U*
netrw-activate pi_netrw.txt /*netrw-activate* netrw-activate pi_netrw.txt /*netrw-activate*
netrw-b pi_netrw.txt /*netrw-b* netrw-b pi_netrw.txt /*netrw-b*
netrw-bookmark pi_netrw.txt /*netrw-bookmark* netrw-bookmark pi_netrw.txt /*netrw-bookmark*
@ -5507,6 +5511,7 @@ netrw-ref pi_netrw.txt /*netrw-ref*
netrw-rename pi_netrw.txt /*netrw-rename* netrw-rename pi_netrw.txt /*netrw-rename*
netrw-s pi_netrw.txt /*netrw-s* netrw-s pi_netrw.txt /*netrw-s*
netrw-transparent pi_netrw.txt /*netrw-transparent* netrw-transparent pi_netrw.txt /*netrw-transparent*
netrw-u pi_netrw.txt /*netrw-u*
netrw-uidpass pi_netrw.txt /*netrw-uidpass* netrw-uidpass pi_netrw.txt /*netrw-uidpass*
netrw-urls pi_netrw.txt /*netrw-urls* netrw-urls pi_netrw.txt /*netrw-urls*
netrw-v pi_netrw.txt /*netrw-v* netrw-v pi_netrw.txt /*netrw-v*
@ -5553,6 +5558,7 @@ new-indent-flex version6.txt /*new-indent-flex*
new-items-6 version6.txt /*new-items-6* new-items-6 version6.txt /*new-items-6*
new-items-7 version7.txt /*new-items-7* new-items-7 version7.txt /*new-items-7*
new-line-continuation version5.txt /*new-line-continuation* new-line-continuation version5.txt /*new-line-continuation*
new-manpage-trans version7.txt /*new-manpage-trans*
new-multi-byte version5.txt /*new-multi-byte* new-multi-byte version5.txt /*new-multi-byte*
new-multi-lang version6.txt /*new-multi-lang* new-multi-lang version6.txt /*new-multi-lang*
new-network-files version6.txt /*new-network-files* new-network-files version6.txt /*new-network-files*
@ -5690,6 +5696,7 @@ phtml-syntax syntax.txt /*phtml-syntax*
phtml.vim syntax.txt /*phtml.vim* phtml.vim syntax.txt /*phtml.vim*
pi_expl.txt pi_expl.txt /*pi_expl.txt* pi_expl.txt pi_expl.txt /*pi_expl.txt*
pi_gzip.txt pi_gzip.txt /*pi_gzip.txt* pi_gzip.txt pi_gzip.txt /*pi_gzip.txt*
pi_netrw.txt pi_netrw.txt /*pi_netrw.txt*
pi_spec.txt pi_spec.txt /*pi_spec.txt* pi_spec.txt pi_spec.txt /*pi_spec.txt*
plugin usr_05.txt /*plugin* plugin usr_05.txt /*plugin*
plugin-details filetype.txt /*plugin-details* plugin-details filetype.txt /*plugin-details*
@ -6084,6 +6091,7 @@ t_CS term.txt /*t_CS*
t_CV term.txt /*t_CV* t_CV term.txt /*t_CV*
t_Co term.txt /*t_Co* t_Co term.txt /*t_Co*
t_DL term.txt /*t_DL* t_DL term.txt /*t_DL*
t_EI term.txt /*t_EI*
t_F1 term.txt /*t_F1* t_F1 term.txt /*t_F1*
t_F2 term.txt /*t_F2* t_F2 term.txt /*t_F2*
t_F3 term.txt /*t_F3* t_F3 term.txt /*t_F3*
@ -6117,6 +6125,7 @@ t_KK term.txt /*t_KK*
t_KL term.txt /*t_KL* t_KL term.txt /*t_KL*
t_RI term.txt /*t_RI* t_RI term.txt /*t_RI*
t_RV term.txt /*t_RV* t_RV term.txt /*t_RV*
t_SI term.txt /*t_SI*
t_Sb term.txt /*t_Sb* t_Sb term.txt /*t_Sb*
t_Sf term.txt /*t_Sf* t_Sf term.txt /*t_Sf*
t_WP term.txt /*t_WP* t_WP term.txt /*t_WP*
@ -6299,6 +6308,8 @@ term.txt term.txt /*term.txt*
termcap term.txt /*termcap* termcap term.txt /*termcap*
termcap-changed version4.txt /*termcap-changed* termcap-changed version4.txt /*termcap-changed*
termcap-colors term.txt /*termcap-colors* termcap-colors term.txt /*termcap-colors*
termcap-cursor-color term.txt /*termcap-cursor-color*
termcap-cursor-shape term.txt /*termcap-cursor-shape*
termcap-syntax syntax.txt /*termcap-syntax* termcap-syntax syntax.txt /*termcap-syntax*
termcap-title term.txt /*termcap-title* termcap-title term.txt /*termcap-title*
terminal-colors os_unix.txt /*terminal-colors* terminal-colors os_unix.txt /*terminal-colors*

View File

@ -1,4 +1,4 @@
*term.txt* For Vim version 7.0aa. Last change: 2004 Oct 20 *term.txt* For Vim version 7.0aa. Last change: 2004 Dec 07
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -275,6 +275,8 @@ Added by Vim (there are no standard codes for these):
t_IE set icon text end *t_IE* *'t_IE'* t_IE set icon text end *t_IE* *'t_IE'*
t_WP set window position (Y, X) in pixels *t_WP* *'t_WP'* t_WP set window position (Y, X) in pixels *t_WP* *'t_WP'*
t_WS set window size (height, width) in characters *t_WS* *'t_WS'* t_WS set window size (height, width) in characters *t_WS* *'t_WS'*
t_SI start insert mode (bar cursor shape) *t_SI* *'t_SI'*
t_EI end insert mode (block cursor shape) *t_EI* *'t_EI'*
t_RV request terminal version string (for xterm) *t_RV* *'t_RV'* t_RV request terminal version string (for xterm) *t_RV* *'t_RV'*
|xterm-8bit| |v:termresponse| |'ttymouse'| |xterm-codes| |xterm-8bit| |v:termresponse| |'ttymouse'| |xterm-codes|
@ -395,6 +397,19 @@ When it is non-zero, the 't_AB' and 't_AF' options are used to set the color.
If one of these is not available, 't_Sb' and 't_Sf' are used. 't_me' is used If one of these is not available, 't_Sb' and 't_Sf' are used. 't_me' is used
to reset to the default colors. to reset to the default colors.
*termcap-cursor-shape* *termcap-cursor-color*
When Vim enters Insert mode the 't_SI' escape sequence is sent. When leaving
Insert mode 't_EI' is used. But only if both are defined. This can be used
to change the shape or color of the cursor in Insert mode. These are not
standard termcap/terminfo entries, you need to set them yourself.
Example for an xterm, this changes the color of the cursor: >
if &term =~ "xterm"
let &t_SI = "\<Esc>]12;purple\x7"
let &t_EI = "\<Esc>]12;blue\x7"
endif
NOTE: When Vim exits the shape for Normal mode will remain. The shape from
before Vim started will not be restored.
*termcap-title* *termcap-title*
The 't_ts' and 't_fs' options are used to set the window title if the terminal The 't_ts' and 't_fs' options are used to set the window title if the terminal
allows title setting via sending strings. They are sent before and after the allows title setting via sending strings. They are sent before and after the

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.0aa. Last change: 2004 Oct 24 *todo.txt* For Vim version 7.0aa. Last change: 2004 Dec 09
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -30,57 +30,6 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs* *known-bugs*
-------------------- Known bugs and current work ----------------------- -------------------- Known bugs and current work -----------------------
Include NetBeans patches (Gordon Prieur, Oct 20)
See two messages for list of changed files. Additionally:
doc/eval.txt
Docs for message E680.
Line number not updated when inserting a line in anothe window. (Hitier
Sylvain, Oct 24)
Aborting at the ATTENTION prompt causes trouble:
buffer remains active, nwindows isn't closed (fixed in buffer.c)
alternate buffer gets "read error" flag.
":sbuf" and ":ball" leave an empty window behind.
Change in handle_swap_exists() also in 6.3?
Add enter_cleanup() and leave_cleanup() also in 6.3?
buffer.c
ex_eval.c
proto/ex_eval.pro
structs.h
vim.h
Win32: When the path to a file has Russian characters, ":cd %:p:h" doesn't
work. (Valery Kondakoff)
Solved in os_mswin.c. Add to 6.3?
Patch for Win32 textdomain: NAKADAIRA Yukihiro, Sept 17.
Handling decimal point on keypad: use MapVirtualKey. (Vince Negri, Oct 20)
Valencia: executable("xxd.exe") returns true while "!xxd" doesn't work.
Works fine for me. Only in specific environment?
netrw plugin: When coming back to the same directory a scratch buffer appears.
Only on Win32. (Charles Campbell, Sept 15)
New Eiffel indent script from Jocelyn Fiat. OK with David Clarke.
Win32: not using 'tenc' in GUI causes problems on Win 98? (Jiri Jezdinsky)
Try out with Russian input method.
After "Y" '[ and '] are not at start/end of the yanked text. (Ken Clark)
Patch for adding 'fsync' option: disable using fsync() on file write. (Sept.
26, Ciaran McCreesh)
Folding for C syntax: (Olaf Dabrunz 27 sept 2004)
Add remark about using Vim with VS .net to Visvim docs. (David Fishburn, Sept
27)
Vim icon for documents associated with Vim? (Rahul Kulkarni, sept 28)
Add a function to test if a font name actually works. Add a function to test if a font name actually works.
When using "set laststatus=2 cmdheight=2" in the .gvimrc you only get one line When using "set laststatus=2 cmdheight=2" in the .gvimrc you only get one line
@ -89,6 +38,30 @@ xterm with many lines) it's OK.
":e <cfile>" does not expand ~/file, very confusing compared to ":e ~/file". ":e <cfile>" does not expand ~/file, very confusing compared to ":e ~/file".
SIGHUP is delayed until waiting for a character. Can the same thing be done
for SIGINT? Then also check when waiting for a short time.
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.
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 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)
Included NetBeans patches (Gordon Prieur, Oct 20)
See two messages for list of changed files. Additionally:
doc/eval.txt
Docs for message E680.
Docs for ":nbkey".
Asked Gordon to send the differences again, some parts apparently are
missing.
For version 7.0: For version 7.0:
@ -172,6 +145,8 @@ For version 7.0:
Tcl implementation ~/vim/HierAssist/ ) Tcl implementation ~/vim/HierAssist/ )
7 Add patch from Benoit Cerrina to integrate Vim and Perl functions 7 Add patch from Benoit Cerrina to integrate Vim and Perl functions
better. Now also works for Ruby (2001 Nov 10) better. Now also works for Ruby (2001 Nov 10)
- Patch from Herculano de Lima Einloft Neto for better formatting of the
quickfix window (2004 dec 2)
7 Motif: use the menu font consistently. Patch from Martin Dalecki 2002 7 Motif: use the menu font consistently. Patch from Martin Dalecki 2002
Jan 11. Jan 11.
- Motif: add 3D shading for the menu entries? Patch from Martin Dalecki. - Motif: add 3D shading for the menu entries? Patch from Martin Dalecki.
@ -204,13 +179,32 @@ For version 7.0:
runtime files? runtime files?
Also: when the environment variable exists, use it. If it doesn't Also: when the environment variable exists, use it. If it doesn't
exist, set it. Requires good names: $VIM_USER_VIMRC $VIM_USER_DIR exist, set it. Requires good names: $VIM_USER_VIMRC $VIM_USER_DIR
- Add the ":cbuffer" command: read list of errors from a buffer instead
of from a file. (Yegappan Lakshmanan, Oct 31, but avoid the temp file)
Perhaps ":cexpr" could read from a list?
Add %b to 'errorformat': buffer number. (Yegappan Lakshmanan / Suresh
Govindachar)
- The Replace dialog takes "\r" literal, unless "replace all" is used.
Need to escape backslashes.
Win32: the text to replace with isn't remembered.
- For GUI Find/Replace dialog support using a regexp. Patch for Motif
and GTK by degreneir (nov 10 and nov 18).
- Use a builtin grep command for ":grep"? Makes it possible to add the
column number. Can use the code of ":helpgrep".
Patch from Yegappan Lakshmanan, Nov 4. Or use ":grep" and set 'grepprg'
to something special? Could also do both.
Also support using "**" in filename, so that a directory tree can be
searched.
Also see the "minigrep.vim" script on www.vim.org.
- Edit same file on Unix and from MS-Windows: no warning for swap file. - 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. - In the kvim/KDE source files fix the formatting.
- KDE version is called "kvim". Make it "gvim", like the others? - KDE version is called "kvim". Make it "gvim", like the others?
- Better configure check for KDE include files from Dan Sharp. - Better configure check for KDE include files from Dan Sharp.
- KDE Input method patch. (Yasuhiro Matsumoto) - KDE GUI Input method patch. (Yasuhiro Matsumoto) (upd. Oct 25 2004)
- Change ga_room into ga_maxlen, so that it doesn't need to be - Change ga_room into ga_maxlen, so that it doesn't need to be
incremented/decremented each time. incremented/decremented each time.
- For string variables, use length instead of NUL termination. - For string variables, use length instead of NUL termination.
@ -279,9 +273,11 @@ For version 7.0:
Should store the values in block 0 of the swap file, but that is an Should store the values in block 0 of the swap file, but that is an
incompatible change. incompatible change.
7 Support WINDOW TABS. Works like several pages, each with their own 7 Support WINDOW TABS. Works like several pages, each with their own
split windows. Patch for GTK 1.2 from Christian Michon, 2004 Jan 6. split windows. Patch for GTK 1.2 passed on by Christian Michon, 2004 Jan 6.
Also for the console! In Emacs these are called frames. Also for the console!
In Emacs these are called frames. Could also call them "pages".
Use "1gt" - "99gt" to switch to a tab? Use "1gt" - "99gt" to switch to a tab?
Simple patch for GTK by Luis M (nov 7).
- EMBEDDING: Make it possible to run Vim inside a window of another program. - EMBEDDING: Make it possible to run Vim inside a window of another program.
For Xwindows this can be done with XReparentWindow(). For Xwindows this can be done with XReparentWindow().
For GTK Neil Bird has a patch to use Vim like a widget. For GTK Neil Bird has a patch to use Vim like a widget.
@ -337,14 +333,18 @@ For version 7.0:
- "onemore" flag in 'virtualedit': move cursor past end of line. Patch by - "onemore" flag in 'virtualedit': move cursor past end of line. Patch by
Mattias Flodin (2004 Jul 30) Mattias Flodin (2004 Jul 30)
The fsync() in buf_write() causes laptop harddisk spinup. Add an option to Win32: When setting 'encoding' in a Vim server to "utf-8", and using "vim
avoid it? --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 Support ":set syntax=cpp.doxygen"? Suggested patch by Michael Geddes (9 Aug
2004). Should also work for 'filetype'. 2004). Should also work for 'filetype'.
Patch for 'breakindent' option: repeat indent for wrapped line. (Vaclav Patch for 'breakindent' option: repeat indent for wrapped line. (Vaclav
Smilauer, 2004 Sep 13) 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 Win32: In 'fileencodings' allow using "acp" for the active codepage. Useful
value: "ucs-bom,utf-8,acp,latin1" value: "ucs-bom,utf-8,acp,latin1"
@ -375,7 +375,13 @@ name. (Charles Campbell)
Add gui_mch_browsedir() for Motif, KDE and Mac OS/X. Add gui_mch_browsedir() for Motif, KDE and Mac OS/X.
Install vim-it.1 manual page in .../man/it/man1/vim.1 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)
Vi incompatibility: Vi incompatibility:
@ -1218,6 +1224,8 @@ Problems that will (probably) not be solved:
*extensions-improvements* *extensions-improvements*
Documentation: Documentation:
8 The GUI help should explain the Find and Find/Replace dialogs. Add a link
to it from ":promptrepl" and ":promptfind".
8 List of options should mention whether environment variables are expanded 8 List of options should mention whether environment variables are expanded
or not. or not.
8 Extend usr_27.txt a bit. (Adam Seyfarth) 8 Extend usr_27.txt a bit. (Adam Seyfarth)
@ -1308,8 +1316,10 @@ Folding:
8 "H" and "L" count buffer lines instead of window lines. (Servatius Brandt) 8 "H" and "L" count buffer lines instead of window lines. (Servatius Brandt)
8 Add a way to add fold-plugins. Johannes Zellner has one for VB. 8 Add a way to add fold-plugins. Johannes Zellner has one for VB.
7 When using manual folding, the undo command should also restore folds. 7 When using manual folding, the undo command should also restore folds.
- Allow completely hiding a closed fold. Require showing a character in - Allow completely hiding a closed fold. E.g., by setting 'foldtext' to an
'foldcolumn' to avoid the missing line goes unnoticed. empty string. Require showing a character in 'foldcolumn' to avoid the
missing line goes unnoticed.
How to implement this?
- When pressing the down arrow of a scrollbar, a closed fold doesn't scroll - When pressing the down arrow of a scrollbar, a closed fold doesn't scroll
until after a long time. How to make scrolling with closed folds until after a long time. How to make scrolling with closed folds
smoother? smoother?
@ -1317,15 +1327,14 @@ Folding:
using the wininfo in wi_folds. using the wininfo in wi_folds.
- 'foldmethod' "textobject": fold on sections and paragraph text objects. - 'foldmethod' "textobject": fold on sections and paragraph text objects.
- Add 'hidecomment' option: don't display comments in /* */ and after //. - Add 'hidecomment' option: don't display comments in /* */ and after //.
Or is the conceal patch from Vince Negri a more generic solution?
- "zu": undo change in manual fold. "zU" redo change in manual fold. How to - "zu": undo change in manual fold. "zU" redo change in manual fold. How to
implement this? implement this?
- "zJ" command: add the line or fold below the fold in the fold under the - "zJ" command: add the line or fold below the fold in the fold under the
cursor. cursor.
- 'foldmethod' "syntax": "fold=3": set fold level for a region. - 'foldmethod' "syntax": "fold=3": set fold level for a region.
- Can set 'foldtext' to empty string: don't display any line. How to
implement this?
- Apply a new foldlevel to a range of lines. (Steve Litt) - Apply a new foldlevel to a range of lines. (Steve Litt)
- Have some way to restrict commands to not folded text. Also commands like 8 Have some way to restrict commands to not folded text. Also commands like
searches. searches.
@ -1344,7 +1353,7 @@ Multi-byte characters:
the encoding. <?xml version="1.0" encoding="UTF-8"?> Or "charset=UTF-8"? the encoding. <?xml version="1.0" encoding="UTF-8"?> Or "charset=UTF-8"?
8 The quickfix file is read without conversion, thus in 'encoding'. Add an 8 The quickfix file is read without conversion, thus in 'encoding'. Add an
option to specify the encoding of the errorfile and convert it. Also for option to specify the encoding of the errorfile and convert it. Also for
":grep". ":grep" and ":helpgrep".
8 When a file was converted from 'fileencoding' to 'encoding', a tag search 8 When a file was converted from 'fileencoding' to 'encoding', a tag search
should also do this on the search pattern. (Andrzej M. Ostruszka) should also do this on the search pattern. (Andrzej M. Ostruszka)
7 When converting a file fails, mention which byte could not be converted, 7 When converting a file fails, mention which byte could not be converted,
@ -1717,8 +1726,8 @@ Performance:
this be improved? this be improved?
8 Set default for 'ttyscroll' to half a screen height? Should speed up 8 Set default for 'ttyscroll' to half a screen height? Should speed up
MS-DOS version. (Negri) MS-DOS version. (Negri)
7 C syntax highlighting gets a lot slower when adding a region for folding 7 C syntax highlighting gets a lot slower after ":set foldmethod=syntax".
from { to }. (Charles Campbell) Inserting a "{" is very slow. (dman) (Charles Campbell) Inserting a "{" is very slow. (dman)
7 HTML syntax highlighting is slow for long lines. Try displaying 7 HTML syntax highlighting is slow for long lines. Try displaying
http://www.theregister.co.uk/content/4/22908.html. (Andre Pang) http://www.theregister.co.uk/content/4/22908.html. (Andre Pang)
7 Check how performance of loading the wordlist can be improved (adding a 7 Check how performance of loading the wordlist can be improved (adding a
@ -2064,7 +2073,7 @@ GUI:
7 Motif: For a confirm() dialog <Enter> should be ignored when no default 7 Motif: For a confirm() dialog <Enter> should be ignored when no default
button selected, <Esc> should close the dialog. button selected, <Esc> should close the dialog.
- Motif steals <F10> from us, to pop up menus with the keyboard. How do we - Motif steals <F10> from us, to pop up menus with the keyboard. How do we
get it back if we want it? get it back if we want it? It's already solved for GTK.
- Paste in Insert mode should not do autowrap etc. Or maybe this should be - Paste in Insert mode should not do autowrap etc. Or maybe this should be
changeable with an option? changeable with an option?
- Put a nice picture in the icon (but how do we do that?). - Put a nice picture in the icon (but how do we do that?).
@ -3340,11 +3349,6 @@ Various improvements:
sufficient. ":setflush" resets the option stack? sufficient. ":setflush" resets the option stack?
How to handle an aborted mapping? Remember position in tag stack when How to handle an aborted mapping? Remember position in tag stack when
mapping starts, restore it when an error aborts the mapping? mapping starts, restore it when an error aborts the mapping?
- Use a builtin grep command for ":grep"? Makes it possible to add the
column number. Can use the code of ":helpgrep".
Also support using "**" in filename, so that a directory tree can be
searched.
Also see the "minigrep.vim" script on www.vim.org.
- Change ":fixdel" into option 'fixdel', t_del will be adjusted each time - Change ":fixdel" into option 'fixdel', t_del will be adjusted each time
t_bs is set? (Webb) t_bs is set? (Webb)
- "gc": goto character, move absolute character positions forward, also - "gc": goto character, move absolute character positions forward, also

View File

@ -1,4 +1,4 @@
*version7.txt* For Vim version 7.0aa. Last change: 2004 Oct 12 *version7.txt* For Vim version 7.0aa. Last change: 2004 Dec 09
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -19,6 +19,7 @@ NEW FEATURES |new-7|
New data types |new-data-types| New data types |new-data-types|
KDE support |new-KDE| KDE support |new-KDE|
Translated manual pages |new-manpage-trans|
Various new items |new-items-7| Various new items |new-items-7|
IMPROVEMENTS |improvements-7| IMPROVEMENTS |improvements-7|
@ -56,6 +57,10 @@ looks like its displayed, with the same folds open and closed. Use "zR" if no
folds should appear in the HTML. (partly by Carl Osterwisch) folds should appear in the HTML. (partly by Carl Osterwisch)
Diff mode now is also converted as it is displayed. Diff mode now is also converted as it is displayed.
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'.
============================================================================== ==============================================================================
NEW FEATURES *new-7* NEW FEATURES *new-7*
@ -95,6 +100,13 @@ The 'printmbcharset' and 'printmbfont' options are used for this.
Also see |postscript-cjk-printing|. (Mike Williams) Also see |postscript-cjk-printing|. (Mike Williams)
Translated manual pages *new-manpage-trans*
-----------------------
The manual page of Vim and associated programs is now also available in
Italian (translated by Antonio Colombo). More languages will follow.
Various new items *new-items-7* Various new items *new-items-7*
----------------- -----------------
@ -115,6 +127,8 @@ Options: ~
'mzquantum' Time in msec to schedule MzScheme threads. 'mzquantum' Time in msec to schedule MzScheme threads.
'printmbcharset' CJK character set to be used for :hardcopy 'printmbcharset' CJK character set to be used for :hardcopy
'printmbfont' font names to be used for CJK output of :hardcopy 'printmbfont' font names to be used for CJK output of :hardcopy
'fsync' Whether fsync() is called after writing a file.
(Ciaran McCreesh)
Ex commands: ~ Ex commands: ~
@ -187,6 +201,8 @@ SQL-Informix syntax file. (Dean L Hill)
PHP compiler plugin. (Doug Kearns) PHP compiler plugin. (Doug Kearns)
Sive syntax file. (Nikolai Weibull)
New Keymaps: ~ New Keymaps: ~
@ -210,6 +226,10 @@ Mac: GUI font selector. (Peter "Rain Dog" Cucka)
The netrw plugin now also supports viewing a directory, when "scp://" is used. The netrw plugin now also supports viewing a directory, when "scp://" is used.
Deleting and renaming files is possible. (Charles Campbell) Deleting and renaming files is possible. (Charles Campbell)
Added the t_SI and t_EI escape sequences for starting and ending Insert mode.
To be used to set the cursor shape to a bar or a block. No default values,
they are not supported by termcap/terminfo.
============================================================================== ==============================================================================
IMPROVEMENTS *improvements-7* IMPROVEMENTS *improvements-7*
@ -267,6 +287,17 @@ the tcl interpreter. (suggested by Alexios Zavras)
Support conversion between utf-8 and latin9 (iso-8859-15) internally, so that Support conversion between utf-8 and latin9 (iso-8859-15) internally, so that
digraphs still work when iconv is not available. digraphs still work when iconv is not available.
When a session file is loaded while editing an unnamed, empty buffer that
buffer is wiped out. Avoids that there is an unused buffer in the buffer
list.
Win32: When libintl.dll supports bind_textdomain_codeset(), use it.
(NAKADAIRA Yukihiro)
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 "/*".
============================================================================== ==============================================================================
COMPILE TIME CHANGES *compile-changes-7* COMPILE TIME CHANGES *compile-changes-7*
@ -421,4 +452,49 @@ directory for the library early in the link flags.
With the GUI find/replace dialog a replace only worked if the pattern was With the GUI find/replace dialog a replace only worked if the pattern was
literal text. Now it works for any pattern. literal text. Now it works for any pattern.
When 'equalalways' is set and 'eadirection' is "hor", ":quit" would still
cause equalizing window heights in the vertical direction.
When ":emenu" is used in a startup script the command was put in the typeahead
buffer, causing a prompt for the crypt key to be messed up.
Mac OS/X: The default for 'isprint' included characters 128-160, causes
problems for Terminal.app.
When a syntax item with "containedin" is used, it may match in the start or
end of a region with a matchgroup, while this doesn't happen for a "contains"
argument.
When a transparent syntax items matches in another item where the highlighting
has already stopped (because of a he= argument), the highlighting would come
back.
When cscope is used to set the quickfix error list, it didn't get set if there
was only one match. (Sergey Khorev)
When 'confirm' is set and using ":bdel" in a modified buffer, then selecting
"cancel", would still give an error message.
The PopUp menu items that started Visual mode didn't work when not in Normal
mode. Switching between selecting a word and a line was not possible.
Win32: The keypad decimal point always resulted in a '.', while on some
keyboards it's a ','. Use MapVirtualKey(VK_DECIMAL, 2).
Removed unused function DisplayCompStringOpaque() from gui_w32.c
In Visual mode there is not always an indication whether the line break is
selected or not. Highlight the character after the line when the line break
is included, e.g., after "v$o".
GTK: The <F10> key can't be mapped, it selects the menu. Disable that with a
GTK setting and do select the menu when <F10> isn't mapped. (David Necas)
After "Y" '[ and '] were not at start/end of the yanked text.
When a telnet connection is dropped Vim preserves files and exits. While
doing that a SIGHUP may arrive and disturbe us, thus ignore it. (Scott
Anderson) Also postpone SIGHUP until it's safe to handle. Added
handle_sighup().
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

558
runtime/doc/vim-it.1 Executable file
View File

@ -0,0 +1,558 @@
.TH VIM 1 "22 febbraio 2002"
.SH NOME
vim \- VI Migliorato, un editor di testi per programmatori
.SH SINTASSI
.br
.B vim
[opzioni] [file ..]
.br
.B vim
[opzioni] -
.br
.B vim
[opzioni] \-t tag
.br
.B vim
[opzioni] \-q [file_errori]
.PP
.br
.B ex
.br
.B view
.br
.B gvim
.B gview
.B evim
.B eview
.br
.B rvim
.B rview
.B rgvim
.B rgview
.SH DESCRIZIONE
.B Vim
Un editore di testi, compatibile con, e migliore di, Vi.
Può essere usato per editare qualsiasi file di testo.
Particolarmente utile per editare programmi.
.PP
Ci sono parecchi miglioramenti rispetto a Vi: undo multipli,
finestre e buffer multipli, evidenziazione sintattica, possibilità
di modificare la linea di comando, completamento nomi file, help
in linea, selezione testi in modalità visuale, etc..
Vedere ":help vi_diff.txt" per un sommario delle differenze fra
.B Vim
e Vi.
.PP
Mentre usate
.B Vim
potete ricevere molto aiuto dal sistema di help online, col comando ":help".
Vedere qui sotto la sezione AIUTO ONLINE.
.PP
Quasi sempre
.B Vim
viene invocato, per modificare un file, col comando
.PP
vim file
.PP
Più in generale
.B Vim
viene invocato con:
.PP
vim [opzioni] [lista_file]
.PP
Se lista_file non è presente, l'editor inizia aprendo un buffer vuoto.
Altrimenti, una e una sola delle quattro maniere indicate qui sotto può
essere usata per scegliere uno o più file da modificare.
.TP 12
file ..
Una lista di nomi di file.
Il primo di questi sarà il file corrente, e verrà letto nel buffer.
Il cursore sarà posizionato sulla prima linea del buffer.
Potete arrivare agli altri file col comando ":next".
Per editare un file il cui nome inizia per "-" premettete "--" alla
lista_file.
.TP
-
Il file da editare è letto dallo "stdin" [di solito, ma non
necessriamente, il terminale - NdT]. I comandi sono letti da "stderr",
che dovrebbe essere un terminale [tty].
.TP
-t {tag}
Il file da editare e la posizione iniziale del cursore dipendono da "tag",
una specie di "etichetta" a cui saltare.
{tag} viene cercata nel file tags, ed il file ad essa associato diventa
quello corrente, ed il comando ad essa associato viene eseguito.
Di solito si usa per programmi C, nel qual caso {tag} potrebbe essere un
nome di funzione.
L'effetto è che il file contenente quella funzione diventa il file corrente
e il cursore è posizionato all'inizio della funzione.
Vedere ":help tag-commands".
.TP
-q [file_errori]
Inizia nella modalità quickFix [correzione veloce].
Il file [file_errori] è letto e il primo errore è visualizzato.
Se [file_errori] non è indicato, il suo nome è ottenuto dal valore
dell'opzione 'errorfile' (che, se non specificata, vale "AztecC.Err"
per l'Amiga, "errors.err" su altri sistemi).
Si può saltare all'errore successivo col comando ":cn".
Vedere ":help quickfix".
.PP
.B Vim
si comporta in modo diverso se invocato con nomi differenti (il programma
eseguibile "sottostante" può essere sempre lo stesso).
.TP 10
vim
Modalità "Normal", comportamento normale.
.TP
ex
Inizia in modalità "Ex".
Si può passare in modalità "Normal" col comandi ":vi".
Si può invocare la modalità "Ex" anche con l'argomento "-e".
.TP
view
Inizia in modalità "Sola Lettura". Non potete modificare i file.
Si può invocare la modalità "Sola Lettura" anche con l'argomento "-R".
.TP
gvim gview
La versione GUI [Graphical User Interface].
Apre una nuova finestra.
Si può invocare la modalità "GUI" anche con l'argomento "-g".
.TP
evim eview
La versione GUI in modalità "Facile" (semplificata).
Apre una nuova finestra.
Si può invocare la modalità "Facile" anche con l'argomento "-y".
.TP
rvim rview rgvim rgview
Come sopra, ma con restrizioni ai comandi. Non si potrnno eseguire comandi
dello shell o sospendere
.B Vim.
Si può invocare la modalità "Ristretta" anche con l'argomento "-Z".
.SH OPZIONI
Le opzioni possono essere in un ordine qualsiasi, prima o dopo i nomi di
file. Opzioni che non necessitano un argomento possono essere raggruppate
dietro a un solo "-".
.TP 12
+[numero]
Per il primo file il cursore sarà posizionato sulla linea "numero".
Se "numero" manca, il cursore sarà posizionato sull'ultima linea del file.
.TP
+/{espressione}
Per il primo file il cursore sarà posizionato alla
prima occorrenza di {espressione}.
Vedere ":help search-pattern" per come specificare l'espressione.
.TP
+{comando}
.TP
-c {comando}
{comando} sarà eseguito dopo che il
primo file è stato letto.
{comando} è interpretato come un comando Ex.
Se il {comando} contiene spazi deve essere incluso fra doppi apici
(o altro delimitatore, a seconda dello shell che si sta usando).
Esempio: Vim "+set si" main.c
.br
Note: Si possono avere fino a 10 comandi "+" o "-c".
.TP
-S {file}
I comandi contenuti in {file} sono eseguiti dopo la lettura del primo file.
Equivalente a -c "source {file}".
{file} non può avere un nome che inizia per '-'.
Se {file} è omesso si usa "Session.vim" (funziona solo se -S è l'ultimo
argomento specificato).
.TP
--cmd {comando}
Come "-c", ma il comando è eseguito PRIMA
di eseguire qualsiasi file vimrc.
Si possono usare fino a 10 di questi comandi, indipendentemente dai comandi
"-c".
.TP
-A
Se
.B Vim
è stato compilato con supporto ARABIC per editare file con orientamento
destra-sinistra e tastiera con mappatura Araba, questa opzione inizia
.B Vim
in modalità "Arabic", cioè impostando 'arabic'.
Altrimenti viene dato un messaggio di errore e
.B Vim
termina in modo anormale.
.TP
-b
Modalità "Binaria".
Vengono impostate alcune opzioni che permettono di modificare un file
binario o un programma eseguibile.
.TP
-C
Compatibile. Imposta l'opzione 'compatible'.
In questo modo
.B Vim
ha quasi lo stesso comportamento di Vi, anche in presenza di un file
di configurazione .vimrc [proprio di Vim - NdT].
.TP
-d
Inizia in modalità "Diff" [differenze].
Dovrebbero esserci come argomenti due o tre nomi di file.
.B Vim
aprirà tutti i file evidenziando le differenze fra gli stessi.
Funziona come vimdiff(1).
.TP
-d {dispositivo}
Apre {dispositivo} per usarlo come terminale.
Solo per l'Amiga.
Esempio:
"\-d con:20/30/600/150".
.TP
-D
Debugging. Vim si mette in modalità "debugging" a partire
dall'esecuzione del primo comando da uno script.
.TP
-e
Eseguire
.B Vim
in modalità "Ex", come se il programma eseguito sia "ex".
.TP
-E
Eseguire
.B Vim
in modalità "Ex" migliorata, come se il programma eseguito sia "exim".
.TP
-f
Direttamente [Foreground]. Per la versione GUI,
.B Vim
non crea [fork] una nuova finestra, indipendente dallo shell di invocazione.
Per l'Amiga,
.B Vim
non è fatto ripartire per aprire una nuova finestra.
Opzione da usare quando
.B Vim
è eseguito da un programma che attende la fine della
sessione di edit (ad es. mail).
Sull'Amiga i comandi ":sh" e ":!" non sono disponibili.
.TP
--nofork
Direttamente [Foreground]. Per la versione GUI,
.B Vim
non crea [fork] una nuova finestra, indipendente dallo shell di invocazione.
.TP
-F
Se
.B Vim
è stato compilato con supporto FKMAP per editare file con orientamento
destra-sinistra e tastiera con mappatura Farsi, questa opzione inizia
.B Vim
in modalità "Farsi", cioè impostando 'fkmap' e 'rightleft'.
Altrimenti viene dato un messaggio di errore e
.B Vim
termina in modo anormale.
.TP
-g
Se
.B Vim
è stato compilato con supporto GUI, questa opzione chiede di usarla.
Se Vim è stato compilato senza supporto GUI viene dato un messaggio di errore e
.B Vim
termina in modo anormale.
.TP
-h
Un po' di aiuto su opzioni e argomenti che si possono dare invocando Vim.
Subito dopo
.B Vim
esce.
.TP
-H
Se
.B Vim
è stato compilato col supporto RIGHTLEFT per editare file con orientamento
destra-sinistra e tastiera con mappatura Ebraica, questa opzione inizia
.B Vim
in modalità "Ebraica", cioè impostando 'hkmap' e 'rightleft'.
Altrimenti viene dato un messaggio di errore e
.B Vim
termina in modo anormale.
.TP
-i {viminfo}
Se è abilitato l'uso di un file viminfo, questa opzione indica il nome
del file da usare invece di quello predefinito "~/.viminfo".
Si può anche evitare l'uso di un file .viminfo, dando come nome "NONE".
.TP
-L
Equivalente a -r.
.TP
-l
Modalità Lisp.
Imposta le opzini 'lisp' e 'showmatch'.
.TP
-m
Inibisce modifica file.
Annulla l'opzione 'write'.
E' ancora possibile modificare un buffer [in memoria - Ndt], ma non scriverlo.
.TP
-M
Modifiche non permesse. Le opzioni 'modifiable' e 'write' sono annullate,
in modo da impedire sia modifiche che riscritture. Da notare che queste
opzioni possono essere abilitate in seguito, permettendo così modifiche.
.TP
-N
Modalità "Non-compatibile". Annulla l'opzione 'compatible'.
Così
.B Vim
va un po' meglio, ma è meno compatibile con Vi, anche in assenza di un
file .vimrc.
.TP
-n
Inibisce l'uso di un file di swap.
Il recupero dopo una caduta di macchina diventa impossibile.
Utile per editare un file su un supporto molto lento (ad es. floppy).
Il comando ":set uc=0" ha lo stesso effetto.
Per abilitare il recupero usare ":set uc=200".
.TP
-nb
Diviene un Editor server per NetBeans. Vedere la documentazione per dettagli.
.TP
-o[N]
Apri N finestre in orizzontale.
Se N manca, apri una finestra per ciascun file.
.TP
-O[N]
Apri N finestre, in verticale.
Se N manca, apri una finestra per ciascun file.
.TP
-R
Modalità "Sola Lettura".
Imposta l'opzione 'readonly'.
Si può ancora modificare il buffer, ma siete protetti da una riscrittura
involontaria.
Se volete davvero riscrivere il file, aggiungete un punto esclamativo
al comando "Ex", come in ":w!".
L'opzione -R implica anche l'opzione -n (vedere sotto).
L'opzione 'readonly' può essere annullata con ":set noro".
Vedere ":help 'readonly'".
.TP
-r
Lista file di swap, assieme a dati utili per un recupero.
.TP
-r {file}
Modalità "Recovery".
Il file di swap è usato per recuperare una sessione di edit finita male.
Il file di swap è un file con lo stesso nome file del file di testo
editato, col suffisso ".swp".
Vedere ":help recovery".
.TP
-s
Modalità silenziosa. Solo quando invocato come "Ex" o quando l'opzione
"-e" è stata data prima dell'opzione "-s".
.TP
-s {scriptin}
Lo script file {scriptin} è letto.
I caratteri nel file sono interpretati come se immessi da voi.
Lo stesso si può ottenere col comando ":source! {scriptin}".
Se la fine del file di input viene raggiunta prima che Vim termini,
l'ulteriore input viene preso dalla tastiera.
.TP
-T {terminale}
Dice a
.B Vim
quale tipo di terminale state usando.
Utile solo se il terminale non viene riconosciuto correttamente da Vim.
Dovrebbe essere un terminale noto a
.B Vim
(internamente) o definito nel file termcap o terminfo.
.TP
-u {vimrc}
Usa i comandi nel file {vimrc} per inizializzazioni.
Tutte le altre inizializzazioni non sono eseguite.
Usate questa opzione per editare qualche file di tipo speciale.
Può anche essere usato per non fare alcuna inizializzazione dando
come nome "NONE".
Vedere ":help initialization" da vim per ulteriori dettagli.
.TP
-U {gvimrc}
Usa i comandi nel file {gvimrc} per inizializzazioni GUI.
Tutte le altre inizializzazioni GUI non sono eseguite.
Può anche essere usata per non fare alcuna inizializzazione GUI dando
come nome "NONE".
Vedere ":help gui-init" da vim per ulteriori dettagli.
.TP
-V[N]
Verboso. Vim manda messaggi relativi agli script file che esegue
e quando legge o scrive un file viminfo. Il numero opzionale N è il valore
dell'opzione 'verbose'.
Il valore predefinito è 10.
.TP
-v
Inizia
.B Vim
in modalità "Vi", come se il programma eseguibile fosse "vi". Questo ha
effetto solo quando Vim viene invocato con il nome "ex".
.TP
-w {scriptout}
Ogni carattere immesso viene registrato nel file {scriptout},
finché non uscite da
.B Vim.
Utile se si vuole creare uno script file da usare con "vim -s" o
":source!".
Se il file {scriptout} esiste, quel che immettete viene aggiunto in fondo.
.TP
-W {scriptout}
Come -w, ma uno script file esistente viene sovrascritto.
.TP
-x
Uso di cifratura nella scrittura dei file. E' necessario immettere
una chiave di cifratura.
.TP
-X
Non connetterti al server X. Vim parte più rapidamente,
ma il titolo della finestra e la clipboard non sono disponibili.
.TP
-y
Eseguire
.B Vim
in modalità "Facile" (semplificata), come se l'eseguibile invocato
sia "evim" o "eview".
Fa sì che
.B Vim
si comporti come un editor che usa solo il mouse e i caratteri.
.TP
-Z
Modalità "Ristretta". Vim si comporta come se invocato con un nome
che inizia per "r".
.TP
--
Specifica la fine delle opzioni.
Argomenti specificati dopo questo sono considerati nomi file.
Si può usare per editare un file il cui nome inizi per '-'.
.TP
--echo-wid
Solo con GUI GTK: Visualizza Window ID su "stdout".
.TP
--help
Vim dà un messaggio ed esce, come con l'argomento "-h".
.TP
--literal
Considera i nomi passati come argomenti letterai, senza espandere
metacaratteri. Non necessario in Unix, lo shell espande i metacaratteri.
.TP
--noplugin
Non caricare plugin. Implicito se si specifica -u NONE.
.TP
--remote
Connettersi a un server Vim e chiedere di editare i file elencati come altri
argomenti. Se non si trova un server viene dato un messaggio e i file sono
editati nel Vim corrente.
.TP
--remote-expr {expr}
Connettersi a un server Vim, valutare ivi {expr} e stampare il risultatoi
su "stdout".
.TP
--remote-send {chiavi}
Connettersi a un server Vim e spedirgli {chiavi}.
.TP
--remote-silent
Come --remote, ma senza avvisare se non si trova un server.
.TP
--remote-wait
Come --remote, ma Vim non termina finché i file non sono stati editati.
.TP
--remote-wait-silent
Come --remote-wait, ma senza avvisare se non si trova un server.
.TP
--serverlist
Lista i nomi di tutti i server Vim disponibili.
.TP
--servername {nome}
Usa {nome} come nome server. Usato per il Vim corrente, a meno che sia
usato con l'argomento --remote, nel qual caso indica il server a cui
connettersi.
.TP
--socketid {id}
Solo con GUI GTK: Usa il meccanismo GtkPlug per eseguire gvim in un'altra
finestra.
.TP
--version
Stampa la versione di Vim ed esci.
.SH AIUTO ONLINE
Battere ":help" in
.B Vim
per iniziare.
Battere ":help argomento" per ricevere aiuto su uno specifico argomento.
Per esempio: ":help ZZ" per ricevere aiuto sul comando "ZZ".
Usare <Tab> e CTRL-D per completare gli argomenti
(":help cmdline-completion").
Ci sono "tag" nei file di help per saltare da un argomento a un altro
(simili a legami ipertestuali, vedere ":help").
Tutti i file di documentazione possono essere navigati così. Ad es.:
":help syntax.txt".
.SH FILE
.TP 15
/usr/local/lib/vim/doc/*.txt
I file di cocumentaziona di
.B Vim
.
Usate ":help doc-file-list" per avere la lista completa.
.TP
/usr/local/lib/vim/doc/tags
Il file di tags usato per trovare informazioni nei file di documentazione.
.TP
/usr/local/lib/vim/syntax/syntax.vim
Inizializzazioni sintattiche a livello di sistema.
.TP
/usr/local/lib/vim/syntax/*.vim
File di colorazione sintattica per vari linguaggi.
.TP
/usr/local/lib/vim/vimrc
Inizializzazioni
.B Vim
a livello di sistema.
.TP
/usr/local/lib/vim/gvimrc
Inizializzazioni gvim a livello di sistema.
.TP
/usr/local/lib/vim/optwin.vim
Script Vim usato dal comando ":options", un modo semplice
per visualizzare e impostare opzioni.
.TP
/usr/local/lib/vim/menu.vim
Inzializzazioni del menu gvim a livello di sistema.
.TP
/usr/local/lib/vim/bugreport.vim
Script Vim per generare una segnalazione di errore. Vedere ":help bugs".
.TP
/usr/local/lib/vim/filetype.vim
Script Vim per determinare il tipo di un file a partire dal suo nome.
Vedere ":help 'filetype'".
.TP
/usr/local/lib/vim/scripts.vim
Script Vim per determinare il tipo di un file a partire dal suo contenuto.
Vedere ":help 'filetype'".
.TP
/usr/local/lib/vim/*.ps
File usati per stampa PostScript.
.PP
Per informazioni aggiornate [in inglese - NdT] vedere la home page di Vim:
.br
<URL:http://www.vim.org/>
.SH VEDERE ANCHE
vimtutor(1)
.SH AUTORE
Buona parte di
.B Vim
è stato scritto da Bram Moolenaar, con molto aiuto da altri.
Vedere ":help credits" in
.B Vim.
.br
.B Vim
è basato su Stevie, scritto da: Tim Thompson,
Tony Andrews e G.R. (Fred) Walter.
In verità, poco o nulla è rimasto del loro codice originale.
.SH BACHI
Probabili.
Vedere ":help todo" per una lista di problemi noti.
.PP
Si noti che un certo numero di comportamenti che possono essere considerati
errori da qualcuno, sono in effetti causati da una riproduzione fin troppo
fedele del comportamento di Vi.
Se ritenete che altre cose siano errori "perché Vi si comporta diversamente",
date prima un'occhiata al file vi_diff.txt
(o battere :help vi_diff.txt da Vim).
Date anche un'occhiata alle opzioni 'compatible' e 'cpoptions.

View File

@ -279,8 +279,8 @@ OPTIONS
-W {scriptout} -W {scriptout}
Like -w, but an existing file is overwritten. Like -w, but an existing file is overwritten.
-x Use encryption when writing files. Will prompt for a -x Use encryption when writing files. Will prompt for a crypt
crypt key. key.
-X Don't connect to the X server. Shortens startup time in a -X Don't connect to the X server. Shortens startup time in a
terminal, but the window title and clipboard will not be terminal, but the window title and clipboard will not be
@ -297,12 +297,13 @@ OPTIONS
be handled as a file name. This can be used to edit a be handled as a file name. This can be used to edit a
filename that starts with a '-'. filename that starts with a '-'.
--echo-wid GTK GUI only: Echo the Window ID on stdout --echo-wid GTK GUI only: Echo the Window ID on stdout.
--help Give a help message and exit, just like "-h". --help Give a help message and exit, just like "-h".
--literal Take file name arguments literally, do not expand wild- --literal Take file name arguments literally, do not expand wild-
cards. Not needed on Unix, the shell expand wildcards. cards. This has no effect on Unix where the shell expands
wildcards.
--noplugin Skip loading plugins. Implied by -u NONE. --noplugin Skip loading plugins. Implied by -u NONE.
@ -311,18 +312,18 @@ OPTIONS
is given and the files are edited in the current Vim. is given and the files are edited in the current Vim.
--remote-expr {expr} --remote-expr {expr}
Connect to a Vim server, evaluate {expr} in it and print Connect to a Vim server, evaluate {expr} in it and print
the result on stdout. the result on stdout.
--remote-send {keys} --remote-send {keys}
Connect to a Vim server and send {keys} to it. Connect to a Vim server and send {keys} to it.
--remote-silent --remote-silent
As --remote, but without the warning when no server is As --remote, but without the warning when no server is
found. found.
--remote-wait --remote-wait
As --remote, but Vim does not exit until the files have As --remote, but Vim does not exit until the files have
been edited. been edited.
--remote-wait-silent --remote-wait-silent
@ -333,31 +334,31 @@ OPTIONS
List the names of all Vim servers that can be found. List the names of all Vim servers that can be found.
--servername {name} --servername {name}
Use {name} as the server name. Used for the current Vim, Use {name} as the server name. Used for the current Vim,
unless used with a --remote argument, then it's the name of unless used with a --remote argument, then it's the name of
the server to connect to. the server to connect to.
--socketid {id} --socketid {id}
GTK GUI only: Use the GtkPlug mechanism to run gvim in GTK GUI only: Use the GtkPlug mechanism to run gvim in
another window. another window.
--version Print version information and exit. --version Print version information and exit.
ON-LINE HELP ON-LINE HELP
Type ":help" in Vim to get started. Type ":help subject" to get help Type ":help" in Vim to get started. Type ":help subject" to get help
on a specific subject. For example: ":help ZZ" to get help for the on a specific subject. For example: ":help ZZ" to get help for the
"ZZ" command. Use <Tab> and CTRL-D to complete subjects (":help cmd- "ZZ" command. Use <Tab> and CTRL-D to complete subjects (":help cmd-
line-completion"). Tags are present to jump from one place to another line-completion"). Tags are present to jump from one place to another
(sort of hypertext links, see ":help"). All documentation files can be (sort of hypertext links, see ":help"). All documentation files can be
viewed in this way, for example ":help syntax.txt". viewed in this way, for example ":help syntax.txt".
FILES FILES
/usr/local/lib/vim/doc/*.txt /usr/local/lib/vim/doc/*.txt
The Vim documentation files. Use ":help doc-file-list" The Vim documentation files. Use ":help doc-file-list"
to get the complete list. to get the complete list.
/usr/local/lib/vim/doc/tags /usr/local/lib/vim/doc/tags
The tags file used for finding information in the docu- The tags file used for finding information in the docu-
mentation files. mentation files.
/usr/local/lib/vim/syntax/syntax.vim /usr/local/lib/vim/syntax/syntax.vim
@ -373,7 +374,7 @@ FILES
System wide gvim initializations. System wide gvim initializations.
/usr/local/lib/vim/optwin.vim /usr/local/lib/vim/optwin.vim
Script used for the ":options" command, a nice way to Script used for the ":options" command, a nice way to
view and set options. view and set options.
/usr/local/lib/vim/menu.vim /usr/local/lib/vim/menu.vim
@ -383,11 +384,11 @@ FILES
Script to generate a bug report. See ":help bugs". Script to generate a bug report. See ":help bugs".
/usr/local/lib/vim/filetype.vim /usr/local/lib/vim/filetype.vim
Script to detect the type of a file by its name. See Script to detect the type of a file by its name. See
":help 'filetype'". ":help 'filetype'".
/usr/local/lib/vim/scripts.vim /usr/local/lib/vim/scripts.vim
Script to detect the type of a file by its contents. Script to detect the type of a file by its contents.
See ":help 'filetype'". See ":help 'filetype'".
/usr/local/lib/vim/*.ps /usr/local/lib/vim/*.ps
@ -402,17 +403,17 @@ SEE ALSO
AUTHOR AUTHOR
Most of Vim was made by Bram Moolenaar, with a lot of help from others. Most of Vim was made by Bram Moolenaar, with a lot of help from others.
See ":help credits" in Vim. See ":help credits" in Vim.
Vim is based on Stevie, worked on by: Tim Thompson, Tony Andrews and Vim is based on Stevie, worked on by: Tim Thompson, Tony Andrews and
G.R. (Fred) Walter. Although hardly any of the original code remains. G.R. (Fred) Walter. Although hardly any of the original code remains.
BUGS BUGS
Probably. See ":help todo" for a list of known problems. Probably. See ":help todo" for a list of known problems.
Note that a number of things that may be regarded as bugs by some, are Note that a number of things that may be regarded as bugs by some, are
in fact caused by a too-faithful reproduction of Vi's behaviour. And in fact caused by a too-faithful reproduction of Vi's behaviour. And
if you think other things are bugs "because Vi does it differently", if you think other things are bugs "because Vi does it differently",
you should take a closer look at the vi_diff.txt file (or type :help you should take a closer look at the vi_diff.txt file (or type :help
vi_diff.txt when in Vim). Also have a look at the 'compatible' and vi_diff.txt when in Vim). Also have a look at the 'compatible' and
'cpoptions' options. 'cpoptions' options.

48
runtime/doc/vimdi-it.1 Executable file
View File

@ -0,0 +1,48 @@
.TH VIMDIFF 1 "30 marzo 2001"
.SH NOME
vimdiff \- modifica due o tre versioni di un file con Vim, visualizzando le
differenze
.SH SINTASSI
.br
.B vimdiff
[opzioni] file1 file2 [file3]
.PP
.B gvimdiff
.SH DESCRIZIONE
.B Vimdiff
inizia
.B Vim
per due (o tre) file.
Ogni file ha una sua finestra.
Le differenze fra file sono evidenziate.
E' una maniera elegante per controllare modifiche e portare modifiche
verso un'altra versione dello stesso file.
.PP
Vedere vim(1) per dettagli su Vim in generale.
.PP
Se iniziato con
.B gvimdiff
la GUI sarà utilizzata, se disponibile.
.PP
In ogni finestra l'opzione 'diff' è impostata, evidenziando così le
differenze.
.br
Le opzioni 'wrap' e 'scrollbind' sono impostate per migliorare la
visibilità del testo.
.br
L'opzione 'foldmethod' è impostata al valore "diff", che mette gruppi di
linee uguali fra i diversi file in una piegatura. 'foldcolumn' è impostato
a due per poter facilmente visualizzare le piegature, aprirle e chiuderle.
.SH OPZIONI
Lo schermo è diviso verticalmente, come se aveste usato l'opzione "-O".
Per dividerlo orizzontalmente, usare l'opzione "-o".
.PP
Per tutte le altre opzioni, vedere vim(1).
.SH VEDERE ANCHE
vim(1)
.SH AUTORE
Buona parte di
.B Vim
è stato scritto da Bram Moolenaar, con molto aiuto da altri.
Vedere ":help credits" in
.B Vim.

54
runtime/doc/vimtu-it.1 Executable file
View File

@ -0,0 +1,54 @@
.TH VIMTUTOR 1 "2001 April 2"
.SH NOME
vimtutor \- the Vim tutor
.SH SINTASSI
.br
.B vimtutor [lingua]
.SH DESCRIZIONE
.B Vimtutor
inizia il
.B Vim
tutor.
It copies the tutor file first, so that it can be modified without changing
the original file.
.PP
The
.B Vimtutor
is useful for people that want to learn their first
.B Vim
commands.
.PP
The optional [language] argument is the two-letter name of a language, like
"it" or "es".
If the [language] argument is missing, the language of the current locale will
be used.
If a tutor in this language is available, it will be used.
Otherwise the English version will be used.
.PP
.B Vim
is always started in Vi compatible mode.
.SH FILE
.TP 15
/usr/local/lib/vim/tutor/tutor[.language]
The
.B Vimtutor
text file(s).
.TP 15
/usr/local/lib/vim/tutor/tutor.vim
The Vim script used to copy the
.B Vimtutor
text file.
.SH AUTORE
The
.B Vimtutor
è stato scritto in origine per Vi da Michael C. Pierce e Robert K. Ware,
Colorado School of Mines, usando idee fornite da Charles Smith,
Colorado State University.
E-mail: bware@mines.colorado.edu.
.br
E' stato modificato per
.B Vim
da Bram Moolenaar.
Per i nomi dei traduttori, vedere i file usati nelle rispettive lingue.
.SH VEDERE ANCHE
vim(1)

402
runtime/doc/xxd-it.1 Executable file
View File

@ -0,0 +1,402 @@
.TH XXD 1 "Agosto 1996" "Pagina di manuale per xxd"
.\"
.\" 21 Maggio 1996
.\" Autore della pagina di manuale:
.\" Tony Nugent <tony@sctnugen.ppp.gu.edu.au> <T.Nugent@sct.gu.edu.au>
.\" Modificato da Bram Moolenaar <Bram@vim.org>
.SH NOME
.I xxd
\- Produce esadecimale da un file binario o viceversa.
.SH SINTASSI
.B xxd
\-h[elp]
.br
.B xxd
[opzioni] [input_file [output_file]]
.br
.B xxd
\-r[evert] [opzioni] [input_file [output_file]]
.SH DESCRIZIONE
.I xxd
crea un'immagine esadecimale di un dato file o dello "standard input".
Può anche ottenere da un'immagine esadecimale il file binario originale.
Come
.BR uuencode(1)
e
.BR uudecode(1)
permette di trasmettere dati binari in una rapresentazione ASCII "a prova
di email", ma ha anche il vantaggio di poter decodificare sullo "standard
output". Inoltre, può essere usato per effettuare delle modifiche (patch)
a file binari.
.SH OPZIONI
Se non si specifica un
.I input_file
il programma legge dallo "standard input".
Se
.I input_file
è specificato come il carattere
.RB \` \- '
, l'input è letto dallo "standard input".
Se non si specifica un
.I output_file
(o si mette al suo posto il carattere
.RB \` \- '
), i risultati sono inviati allo "standard output".
.PP
Si noti che la scansione dei caratteri è "pigra", e non controlla oltre
la prima lettera dell'opzione, a meno che l'opzione sia seguita da un
parametro.
Gli spazi fra una singola lettera di opzione e il corrispondente parametro
dopo di essa sono facoltativi.
I parametri delle opzioni possono essere specificati usando la notazione
decimale, esadecimale oppure ottale.
Pertanto
.BR \-c8 ,
.BR "\-c 8" ,
.B \-c 010
e
.B \-cols 8
sono notazioni equivalenti fra loro.
.PP
.TP
.IR \-a " | " \-autoskip
Richiesta di autoskip: Un singolo '*' rimpiazza linee di zeri binari.
Valore predefinito: off.
.TP
.IR \-b " | " \-bits
Richiesta di una immagine binaria (cifre binarie), invece che esadecimale.
Questa opzione scrive un byte come otto cifre "1" e "0" invece di usare i
numeri esadecimali. Ogni linea è preceduta da un indirizzo in esadecimale e
seguita da una decodifica ascii (o ebcdic). Le opzioni specificabili dalla
linea comando \-r, \-p, \-i non funzionano in questo modo.
.TP
.IR "\-c colonne " | " \-cols colonne"
.IR "\-c colonne " | " \-cols colonne"
In ogni linea sono formattate
.RI < colonne >
colonne. Valore predefinito 16 (\-i: 12, \-ps: 30, \-b: 6).
Valore massimo 256.
.TP
.IR \-E " | " \-EBCDIC
Cambia la codifica della colonna di destra da ASCII a EBCDIC.
Questo non modifica la rappresentazione esadecimale. Non ha senso
specificare questa opzione in combinazione con \-r, \-p o \-i.
.TP
.IR "\-g bytes " | " \-groupsize bytes"
Inserisci ogni
.RI < bytes >
bytes di output (di due caratteri esadecimali o otto numeri binari ognuno)
uno spazio bianco.
Specificando
.I \-g 0
i bytes di output non sono separati da alcuno spazio.
.RI < Bytes "> ha come valore predefinito " 2
in modalità normale [esadecimale] e \fI1\fP in modalità binaria.
Il raggruppamento non si applica agli stili "PostScript" e "include".
.TP
.IR \-h " | " \-help
stampa un sommario dei comandi disponibili ed esce. Non viene fatto
null'altro.
.TP
.IR \-i " | " \-include
L'output è nello stile dei file "include" in C. Viene preparata la
definizione completa di un "array" [vettore], dandogli il nome del
file di input), tranne che nel caso in cui xxd legga dallo "standard input".
.TP
.IR "\-l lunghezza " | " \-len lunghezza"
Il programma esce dopo aver scritto
.RI < lunghezza >
bytes.
.TP
.IR \-p " | " \-ps " | " \-postscript " | " \-plain
L'output è nello stile di un dump continuo sotto postscript.
Noto anche come stile esadecimale semplice [plain].
.TP
.IR \-r " | " \-revert
ricostruzione: converte (o mette una patch) a partire dall'immagine
esadecimale, creando [o modificando] il file binario.
Se non diretto allo "standard output", xxd scrive nel suo file di output
in maniera continua, senza interruzioni. Usare la combinazione
.I \-r \-p
per leggere dump in stile esadecimale semplice [plain], senza l'informazione
di numero di linea e senza un particolare tracciato di colonna. Degli spazi
o delle linee vuote possono essere inserite a piacere [e vengono ingorate].
.TP
.I \-seek distanza
Usato con l'opzione
.I \-r
: (ricostruzione),
.RI < distanza >
viene aggiunta alla posizione nel file trovata nella immagine
esadecimale.
.TP
.I \-s [\+][\-]seek
Inizia a
.RI < seek >
bytes assoluti (o relativi) di distanza all'interno di input_file.
\fI\+ \fRindica che il "seek" è relativo alla posizione corrente nel file
"standard input" (non significativa quando non si legge da "standard input").
\fI\- \fRindica che il "seek" dovrebbe posizionarsi ad quel numero di
caratteri dalla fine dell'input (o se in combinazione con
\fI \+ \fR: prime della posizione corrente nel file "standard input").
Se non si specifica una opzione \-s option, xxd inizia alla posizione
corrente all'interno del file.
.TP
.I \-u
usa lettere esadecimali maiuscole. Il valore predefinito è di usare
lettere minuscole.
.TP
.IR \-v " | " \-version
visualizza la stringa contenente la versione del programma.
.SH ATTENZIONE
.PP
.I xxd \-r
è capace di operare "magie" nell'utilizzare l'informazione "numero di linea".
Se sul file di output ci si può posizionare usando la "seek", il numero di
linea all'inizio di ogni riga esadecimale può essere non ordinato, delle
linee possono mancare delle linee, oppure esserci delle sovrapposizioni.
In simili casi xxd userà lseek(2) per raggiungere la posizione d'inizio.
Se il file di output non consente di usare "seek", sono permessi solo dei
"buchi", che saranno riempiti con zeri binari.
.PP
.I xxd \-r
non genera mai errori di specifica parametri. I parametri non riconosciuti
sono silenziosamente ignorati.
.PP
Nel modificare immagini esadecimali, tenete conto che
.I xxd \-r
salta il resto della linea, dopo aver letto abbastanza caratteri contenenti
dati esadecimali (vedere opzione \-c). Ciò implica pure che le modifiche alle
colonne di caratteri stampabili ascii (o ebcdic) sono sempre ignorate.
La ricostruzione da un file immagine esadecimale in stile semplice
(postscript) con xxd \-r \-p non dipende dal numero corrretto di colonne.
IN questo caso, qualsiasi cosa assomigli a una coppia di cifre esadecimali
è interpretata [e utilizzata].
.PP
Notare la differenza fra
.br
\fI% xxd \-i file\fR
.br
e
.br
\fI% xxd \-i \< file\fR
.PP
.I xxd \-s \+seek
può comportarsi in modo diverso da
.I xxd \-s seek
, perché lseek(2) è usata per tornare indietro nel file di input. Il '+'
fa differenza se il file di input è lo "standard input", e se la pozione nel
file di "standard input" non è all'inizio del file quando xxd è eseguito,
con questo input.
I seguenti esempi possono contribuire a chiarire il concetto
(o ad oscurarlo!)...
.PP
Riavvolge lo "standard input" prima di leggere; necessario perché `cat'
ha già letto lo stesso file ["file"] fino alla fine dello "standard input".
.br
\fI% sh \-c 'cat > copia_normale; xxd \-s 0 > copia_esadecimale' < file
.PP
Stampa immagine esadecimale dalla posizione file 0x480 (=1024+128) in poi.
Il segno `+' vuol dire "rispetto alla posizione corrente", quindi il `128'
si aggiunge a 1k (1024) dove `dd' si era fermato.
.br
\fI% sh \-c 'dd of=normale bs=1k count=1; xxd \-s +128 > esadecimale' < file
.PP
Immagine esadecimale dalla posizione 0x100 ( = 1024-768 ) del file in avanti.
.br
\fI% sh \-c 'dd of=normale bs=1k count=1; xxd \-s +-768 > esadecimale' < file
.PP
Comunque, questo capita raramente, e l'uso del `+' di rado.
L'autore preferisce monitorare il comportamento di xxd con strace(1) o
truss(1), quando si usa l'opzione \-s.
.SH ESEMPI
.PP
.br
Stampa tutto tranne le prime tre linee (0x30 bytes esadecimali) di
.B file
\.
.br
\fI% xxd \-s 0x30 file
.PP
.br
Stampa 3 linee (0x30 bytes esadecimali) alla fine di
.B file
\.
.br
\fI% xxd \-s \-0x30 file
.PP
.br
Stampa 120 bytes come immagine esadecimale continua con 40 bytes per linea.
.br
\fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR
.br
2e54482058584420312022417567757374203139
.br
39362220224d616e75616c207061676520666f72
.br
20787864220a2e5c220a2e5c222032317374204d
.br
617920313939360a2e5c22204d616e2070616765
.br
20617574686f723a0a2e5c2220202020546f6e79
.br
204e7567656e74203c746f6e79407363746e7567
.br
.br
Stampa i primi 120 bytes della pagina di manuale vim.1 a 12 bytes per linea.
.br
\fI% xxd \-l 120 \-c 12 xxd.1\fR
.br
0000000: 2e54 4820 5858 4420 3120 2241 .TH XXD 1 "A
.br
000000c: 7567 7573 7420 3139 3936 2220 ugust 1996"
.br
0000018: 224d 616e 7561 6c20 7061 6765 "Manual page
.br
0000024: 2066 6f72 2078 7864 220a 2e5c for xxd"..\
.br
0000030: 220a 2e5c 2220 3231 7374 204d "..\" 21st M
.br
000003c: 6179 2031 3939 360a 2e5c 2220 ay 1996..\"
.br
0000048: 4d61 6e20 7061 6765 2061 7574 Man page aut
.br
0000054: 686f 723a 0a2e 5c22 2020 2020 hor:..\"
.br
0000060: 546f 6e79 204e 7567 656e 7420 Tony Nugent
.br
000006c: 3c74 6f6e 7940 7363 746e 7567 <tony@sctnug
.PP
.br
Visualizza la data dal file xxd.1
.br
\fI% xxd \-s 0x36 \-l 13 \-c 13 xxd.1\fR
.br
0000036: 3231 7374 204d 6179 2031 3939 36 21st May 1996
.PP
.br
Copiare
.B input_file
su
.B output_file
premettendogli 100 bytes a 0x00.
.br
\fI% xxd input_file | xxd \-r \-s 100 \> output_file\fR
.br
.br
Modificare (patch) la data nel file xxd.1
.br
\fI% echo '0000037: 3574 68' | xxd \-r \- xxd.1\fR
.br
\fI% xxd \-s 0x36 \-l 13 \-c 13 xxd.1\fR
.br
0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996
.PP
.br
Creare un file di 65537 tutto a 0x00,
tranne che l'ultimo carattere che è una 'A' (esadecimale 0x41).
.br
\fI% echo '010000: 41' | xxd \-r \> file\fR
.PP
.br
Stampa una immagine esadecimale del file di cui sopra con opzione autoskip.
.br
\fI% xxd \-a \-c 12 file\fR
.br
0000000: 0000 0000 0000 0000 0000 0000 ............
.br
*
.br
000fffc: 0000 0000 40 ....A
.PP
Crea un file di 1 byte che contiene il solo carattere 'A'.
Il numero dopo '\-r \-s' viene aggiunto a quello trovato nel file;
in pratica, i bytes precedenti non sono stampati.
.br
\fI% echo '010000: 41' | xxd \-r \-s \-0x10000 \> file\fR
.PP
Usare xxd come filtro all'interno di un editor come
.B vim(1)
per ottenere una immagine esadecimale di una parte di file
delimitata dai mark `a' e `z'.
.br
\fI:'a,'z!xxd\fR
.PP
Usare xxd come filtro all'interno di un editor come
.B vim(1)
per ricostruire un pezzo di file binario da una immagine esadecimale
delimitata dai mark `a' e `z'.
.br
\fI:'a,'z!xxd \-r\fR
.PP
Usare xxd come filtro all'interno di un editor come
.B vim(1)
per ricostruire una sola linea di file binario da una immagine esadecimale,
Portare il cursore sopra la linea e battere:
.br
\fI!!xxd \-r\fR
.PP
Per leggere singoli charatteri da una linea seriale
.br
\fI% xxd \-c1 < /dev/term/b &\fR
.br
\fI% stty < /dev/term/b \-echo \-opost \-isig \-icanon min 1\fR
.br
\fI% echo \-n foo > /dev/term/b\fR
.PP
.SH CODICI DI RITORNO
Il programma può restituire questi codici di errore:
.TP
0
nessun errore rilevato.
.TP
\-1
operazione non supportata (
.I xxd \-r \-i
non ancora possible).
.TP
1
errore durante la scansione parametri.
.TP
2
problemi con il file di input.
.TP
3
problemi con il file di output.
.TP
4,5
posizione "seek" specificata non raggiungibile all'interno del file.
.SH VEDERE ANCHE
uuencode(1), uudecode(1), patch(1)
.br
.SH AVVERTIMENTI
La stranezza dello strumento rispecchia la mente del suo creatore.
Usate a vostro rischio e pericolo. Copiate i file. Tracciate l'esecuzione.
Diventate un mago.
.br
.SH VERSIONE
Questa pagina di manuale documenta la versione 1.7 di xxd.
.SH AUTORE
.br
(c) 1990-1997 Juergen Weigert
.br
<jnweiger@informatik.uni-erlangen.de>
.LP
Distribuite liberamente ed attribuitemi il credito,
.br
fate soldi e condivideteli con me
.br
perdete soldi e non venite a chiederli a me.
.PP
Pagina di manuale messa in piedi da Tony Nugent
.br
<tony@sctnugen.ppp.gu.edu.au> <T.Nugent@sct.gu.edu.au>
.br
Piccole modifiche di Bram Moolenaar.
Modificato da Juergen Weigert.
.PP

View File

@ -62,12 +62,11 @@ toggle autoskip: A single '*' replaces nul-lines. Default off.
.IR \-b " | " \-bits .IR \-b " | " \-bits
Switch to bits (binary digits) dump, rather than hexdump. Switch to bits (binary digits) dump, rather than hexdump.
This option writes octets as eight digits "1"s and "0"s instead of a normal This option writes octets as eight digits "1"s and "0"s instead of a normal
hexacecimal dump. Each line is preceded by a line number in hexadecimal and hexadecimal dump. Each line is preceded by a line number in hexadecimal and
followed by an ascii (or ebcdic) representation. The command line switches followed by an ascii (or ebcdic) representation. The command line switches
\-r, \-p, \-i do not work with this mode. \-r, \-p, \-i do not work with this mode.
.TP .TP
.IR "\-c cols " | " \-cols cols" .IR "\-c cols " | " \-cols cols"
.IR "\-c cols " | " \-cols cols"
format format
.RI < cols > .RI < cols >
octets per line. Default 16 (\-i: 12, \-ps: 30, \-b: 6). Max 256. octets per line. Default 16 (\-i: 12, \-ps: 30, \-b: 6). Max 256.
@ -78,7 +77,7 @@ This does not change the hexadecimal representation. The option is
meaningless in combinations with \-r, \-p or \-i. meaningless in combinations with \-r, \-p or \-i.
.TP .TP
.IR "\-g bytes " | " \-groupsize bytes" .IR "\-g bytes " | " \-groupsize bytes"
seperate the output of every separate the output of every
.RI < bytes > .RI < bytes >
bytes (two hex characters or eight bit-digits each) by a whitespace. bytes (two hex characters or eight bit-digits each) by a whitespace.
Specify Specify
@ -139,7 +138,7 @@ show version string.
.PP .PP
.I xxd \-r .I xxd \-r
has some builtin magic while evaluating line number information. has some builtin magic while evaluating line number information.
If the ouput file is seekable, then the linenumbers at the start of each If the output file is seekable, then the linenumbers at the start of each
hexdump line may be out of order, lines may be missing, or overlapping. In hexdump line may be out of order, lines may be missing, or overlapping. In
these cases xxd will lseek(2) to the next position. If the output file is not these cases xxd will lseek(2) to the next position. If the output file is not
seekable, only gaps are allowed, which will be filled by null-bytes. seekable, only gaps are allowed, which will be filled by null-bytes.
@ -152,7 +151,7 @@ When editing hexdumps, please note that
skips everything on the input line after reading enough columns of hexadecimal skips everything on the input line after reading enough columns of hexadecimal
data (see option \-c). This also means, that changes to the printable ascii (or data (see option \-c). This also means, that changes to the printable ascii (or
ebcdic) columns are always ignored. Reverting a plain (or postscript) style ebcdic) columns are always ignored. Reverting a plain (or postscript) style
hexdump with xxd \-r \-p does not depend on the correct number of columns. Here an thing that looks like a pair of hex-digits is interpreted. hexdump with xxd \-r \-p does not depend on the correct number of columns. Here anything that looks like a pair of hex-digits is interpreted.
.PP .PP
Note the difference between Note the difference between
.br .br
@ -186,7 +185,7 @@ Hexdump from file position 0x100 ( = 1024-768) on.
\fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +-768 > hex_snippet' < file \fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +-768 > hex_snippet' < file
.PP .PP
However, this is a rare situation and the use of `+' is rarely needed. However, this is a rare situation and the use of `+' is rarely needed.
the author prefers to monitor the effect of xxd with strace(1) or truss(1), whenever \-s is used. The author prefers to monitor the effect of xxd with strace(1) or truss(1), whenever \-s is used.
.SH EXAMPLES .SH EXAMPLES
.PP .PP
.br .br
@ -208,17 +207,17 @@ Print 120 bytes as continuous hexdump with 40 octets per line.
.br .br
\fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR \fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR
.br .br
2e544820585844203120224d616e75616c207061 2e54482058584420312022417567757374203139
.br .br
676520666f7220787864220a2e5c220a2e5c2220 39362220224d616e75616c207061676520666f72
.br .br
32317374204d617920313939360a2e5c22204d61 20787864220a2e5c220a2e5c222032317374204d
.br .br
6e207061676520617574686f723a0a2e5c222020 617920313939360a2e5c22204d616e2070616765
.br .br
2020546f6e79204e7567656e74203c746f6e7940 20617574686f723a0a2e5c2220202020546f6e79
.br .br
7363746e7567656e2e7070702e67752e6564752e 204e7567656e74203c746f6e79407363746e7567
.br .br
.br .br
@ -226,32 +225,32 @@ Hexdump the first 120 bytes of this man page with 12 octets per line.
.br .br
\fI% xxd \-l 120 \-c 12 xxd.1\fR \fI% xxd \-l 120 \-c 12 xxd.1\fR
.br .br
0000000: 2e54 4820 5858 4420 3120 224d .TH XXD 1 "M 0000000: 2e54 4820 5858 4420 3120 2241 .TH XXD 1 "A
.br .br
000000c: 616e 7561 6c20 7061 6765 2066 anual page f 000000c: 7567 7573 7420 3139 3936 2220 ugust 1996"
.br .br
0000018: 6f72 2078 7864 220a 2e5c 220a or xxd"..\\". 0000018: 224d 616e 7561 6c20 7061 6765 "Manual page
.br .br
0000024: 2e5c 2220 3231 7374 204d 6179 .\\" 21st May 0000024: 2066 6f72 2078 7864 220a 2e5c for xxd"..\\
.br .br
0000030: 2031 3939 360a 2e5c 2220 4d61 1996..\\" Ma 0000030: 220a 2e5c 2220 3231 7374 204d "..\\" 21st M
.br .br
000003c: 6e20 7061 6765 2061 7574 686f n page autho 000003c: 6179 2031 3939 360a 2e5c 2220 ay 1996..\\"
.br .br
0000048: 723a 0a2e 5c22 2020 2020 546f r:..\\" To 0000048: 4d61 6e20 7061 6765 2061 7574 Man page aut
.br .br
0000054: 6e79 204e 7567 656e 7420 3c74 ny Nugent <t 0000054: 686f 723a 0a2e 5c22 2020 2020 hor:..\\"
.br .br
0000060: 6f6e 7940 7363 746e 7567 656e ony@sctnugen 0000060: 546f 6e79 204e 7567 656e 7420 Tony Nugent
.br .br
000006c: 2e70 7070 2e67 752e 6564 752e .ppp.gu.edu. 000006c: 3c74 6f6e 7940 7363 746e 7567 <tony@sctnug
.PP .PP
.br .br
Display just the date from the file xxd.1 Display just the date from the file xxd.1
.br .br
\fI% xxd \-s 0x28 \-l 12 \-c 12 xxd.1\fR \fI% xxd \-s 0x36 \-l 13 \-c 13 xxd.1\fR
.br .br
0000028: 3231 7374 204d 6179 2031 3939 21st May 199 0000036: 3231 7374 204d 6179 2031 3939 36 21st May 1996
.PP .PP
.br .br
Copy Copy
@ -266,11 +265,11 @@ and prepend 100 bytes of value 0x00.
.br .br
Patch the date in the file xxd.1 Patch the date in the file xxd.1
.br .br
\fI% echo '0000029: 3574 68' | xxd \-r \- xxd.1\fR \fI% echo '0000037: 3574 68' | xxd \-r \- xxd.1\fR
.br .br
\fI% xxd \-s 0x28 \-l 12 \-c 12 xxd.1\fR \fI% xxd \-s 0x36 \-l 13 \-c 13 xxd.1\fR
.br .br
0000028: 3235 7468 204d 6179 2031 3939 25th May 199 0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996
.PP .PP
.br .br
Create a 65537 byte file with all bytes 0x00, Create a 65537 byte file with all bytes 0x00,

View File

@ -1,9 +1,7 @@
XXD(1) XXD(1)
XXD(1) XXD(1)
NAME NAME
xxd - make a hexdump or do the reverse. xxd - make a hexdump or do the reverse.
@ -13,239 +11,184 @@ SYNOPSIS
xxd -r[evert] [options] [infile [outfile]] xxd -r[evert] [options] [infile [outfile]]
DESCRIPTION DESCRIPTION
xxd creates a hex dump of a given file or standard input. xxd creates a hex dump of a given file or standard input. It can also
It can also convert a hex dump back to its original binary convert a hex dump back to its original binary form. Like uuencode(1)
form. Like uuencode(1) and uudecode(1) it allows the and uudecode(1) it allows the transmission of binary data in a `mail-
transmission of binary data in a `mail-safe' ASCII repre- safe' ASCII representation, but has the advantage of decoding to stan-
sentation, but has the advantage of decoding to standard dard output. Moreover, it can be used to perform binary file patching.
output. Moreover, it can be used to perform binary file
patching.
OPTIONS OPTIONS
If no infile is given, standard input is read. If infile If no infile is given, standard input is read. If infile is specified
is specified as a `-' character, then input is taken from as a `-' character, then input is taken from standard input. If no
standard input. If no outfile is given (or a `-' charac- outfile is given (or a `-' character is in its place), results are sent
ter is in its place), results are sent to standard output. to standard output.
Note that a "lazy" parser is used which does not check for Note that a "lazy" parser is used which does not check for more than
more than the first option letter, unless the option is the first option letter, unless the option is followed by a parameter.
followed by a parameter. Spaces between a single option Spaces between a single option letter and its parameter are optional.
letter and its parameter are optional. Parameters to Parameters to options can be specified in decimal, hexadecimal or octal
options can be specified in decimal, hexadecimal or octal notation. Thus -c8, -c 8, -c 010 and -cols 8 are all equivalent.
notation. Thus -c8, -c 8, -c 010 and -cols 8 are all
equivalent.
-a | -autoskip -a | -autoskip
toggle autoskip: A single '*' replaces nul-lines. toggle autoskip: A single '*' replaces nul-lines. Default off.
Default off.
-b | -bits -b | -bits
Switch to bits (binary digits) dump, rather than Switch to bits (binary digits) dump, rather than hexdump. This
hexdump. This option writes octets as eight digits option writes octets as eight digits "1"s and "0"s instead of a
"1"s and "0"s instead of a normal hexacecimal dump. normal hexadecimal dump. Each line is preceded by a line number
Each line is preceded by a line number in hexadeci- in hexadecimal and followed by an ascii (or ebcdic) representa-
mal and followed by an ascii (or ebcdic) represen- tion. The command line switches -r, -p, -i do not work with this
tation. The command line switches -r, -p, -i do not mode.
work with this mode.
-c cols | -cols cols -c cols | -cols cols
-c cols | -cols cols format <cols> octets per line. format <cols> octets per line. Default 16 (-i: 12, -ps: 30, -b:
Default 16 (-i: 12, -ps: 30, -b: 6). Max 256. 6). Max 256.
-E | -EBCDIC -E | -EBCDIC
Change the character encoding in the righthand col- Change the character encoding in the righthand column from ASCII
umn from ASCII to EBCDIC. This does not change the to EBCDIC. This does not change the hexadecimal representation.
hexadecimal representation. The option is meaning- The option is meaningless in combinations with -r, -p or -i.
less in combinations with -r, -p or -i.
Manual page for xxd August 1996 1
XXD(1) XXD(1)
-g bytes | -groupsize bytes -g bytes | -groupsize bytes
seperate the output of every <bytes> bytes (two hex separate the output of every <bytes> bytes (two hex characters
characters or eight bit-digits each) by a whites- or eight bit-digits each) by a whitespace. Specify -g 0 to sup-
pace. Specify -g 0 to suppress grouping. <Bytes> press grouping. <Bytes> defaults to 2 in normal mode and 1 in
defaults to 2 in normal mode and 1 in bits mode. bits mode. Grouping does not apply to postscript or include
Grouping does not apply to postscript or include
style. style.
-h | -help -h | -help
print a summary of available commands and exit. No print a summary of available commands and exit. No hex dumping
hex dumping is performed. is performed.
-i | -include -i | -include
output in C include file style. A complete static output in C include file style. A complete static array defini-
array definition is written (named after the input tion is written (named after the input file), unless xxd reads
file), unless xxd reads from stdin. from stdin.
-l len | -len len -l len | -len len
stop after writing <len> octets. stop after writing <len> octets.
-p | -ps | -postscript | -plain -p | -ps | -postscript | -plain
output in postscript continuous hexdump style. Also output in postscript continuous hexdump style. Also known as
known as plain hexdump style. plain hexdump style.
-r | -revert -r | -revert
reverse operation: convert (or patch) hexdump into reverse operation: convert (or patch) hexdump into binary. If
binary. If not writing to stdout, xxd writes into not writing to stdout, xxd writes into its output file without
its output file without truncating it. Use the com- truncating it. Use the combination -r -p to read plain hexadeci-
bination -r -p to read plain hexadecimal dumps mal dumps without line number information and without a particu-
without line number information and without a par- lar column layout. Additional Whitespace and line-breaks are
ticular column layout. Additional Whitespace and allowed anywhere.
line-breaks are allowed anywhere.
-seek offset -seek offset
When used after -r : revert with <offset> added to When used after -r : revert with <offset> added to file posi-
file positions found in hexdump. tions found in hexdump.
-s [+][-]seek -s [+][-]seek
start at <seek> bytes abs. (or rel.) infile offset. start at <seek> bytes abs. (or rel.) infile offset. + indicates
+ indicates that the seek is relative to the cur- that the seek is relative to the current stdin file position
rent stdin file position (meaningless when not (meaningless when not reading from stdin). - indicates that the
reading from stdin). - indicates that the seek seek should be that many characters from the end of the input
should be that many characters from the end of the (or if combined with
input (or if combined with + : before the current stdin file position). Without -s
+ : before the current stdin file position). option, xxd starts at the current file position.
Without -s option, xxd starts at the current file
position.
-u use upper case hex letters. Default is lower case. -u use upper case hex letters. Default is lower case.
-v | -version -v | -version
show version string. show version string.
Manual page for xxd August 1996 2
XXD(1) XXD(1)
CAVEATS CAVEATS
xxd -r has some builtin magic while evaluating line number xxd -r has some builtin magic while evaluating line number information.
information. If the ouput file is seekable, then the If the output file is seekable, then the linenumbers at the start of
linenumbers at the start of each hexdump line may be out each hexdump line may be out of order, lines may be missing, or over-
of order, lines may be missing, or overlapping. In these lapping. In these cases xxd will lseek(2) to the next position. If the
cases xxd will lseek(2) to the next position. If the out- output file is not seekable, only gaps are allowed, which will be
put file is not seekable, only gaps are allowed, which filled by null-bytes.
will be filled by null-bytes.
xxd -r never generates parse errors. Garbage is silently xxd -r never generates parse errors. Garbage is silently skipped.
skipped.
When editing hexdumps, please note that xxd -r skips When editing hexdumps, please note that xxd -r skips everything on the
everything on the input line after reading enough columns input line after reading enough columns of hexadecimal data (see option
of hexadecimal data (see option -c). This also means, that -c). This also means, that changes to the printable ascii (or ebcdic)
changes to the printable ascii (or ebcdic) columns are columns are always ignored. Reverting a plain (or postscript) style
always ignored. Reverting a plain (or postscript) style hexdump with xxd -r -p does not depend on the correct number of col-
hexdump with xxd -r -p does not depend on the correct num- umns. Here anything that looks like a pair of hex-digits is inter-
ber of columns. Here an thing that looks like a pair of preted.
hex-digits is interpreted.
Note the difference between Note the difference between
% xxd -i file % xxd -i file
and and
% xxd -i < file % xxd -i < file
xxd -s +seek may be different from xxd -s seek , as xxd -s +seek may be different from xxd -s seek , as lseek(2) is used to
lseek(2) is used to "rewind" input. A '+' makes a differ- "rewind" input. A '+' makes a difference if the input source is stdin,
ence if the input source is stdin, and if stdin's file and if stdin's file position is not at the start of the file by the
position is not at the start of the file by the time xxd time xxd is started and given its input. The following examples may
is started and given its input. The following examples help to clarify (or further confuse!)...
may help to clarify (or further confuse!)...
Rewind stdin before reading; needed because the `cat' has Rewind stdin before reading; needed because the `cat' has already read
already read to the end of stdin. to the end of stdin.
% sh -c 'cat > plain_copy; xxd -s 0 > hex_copy' < file % sh -c 'cat > plain_copy; xxd -s 0 > hex_copy' < file
Hexdump from file position 0x480 (=1024+128) onwards. The Hexdump from file position 0x480 (=1024+128) onwards. The `+' sign
`+' sign means "relative to the current position", thus means "relative to the current position", thus the `128' adds to the 1k
the `128' adds to the 1k where dd left off. where dd left off.
% sh -c 'dd of=plain_snippet bs=1k count=1; xxd -s +128 > % sh -c 'dd of=plain_snippet bs=1k count=1; xxd -s +128 > hex_snippet'
hex_snippet' < file < file
Hexdump from file position 0x100 ( = 1024-768) on. Hexdump from file position 0x100 ( = 1024-768) on.
% sh -c 'dd of=plain_snippet bs=1k count=1; xxd -s +-768 > % sh -c 'dd of=plain_snippet bs=1k count=1; xxd -s +-768 > hex_snippet'
hex_snippet' < file < file
However, this is a rare situation and the use of `+' is However, this is a rare situation and the use of `+' is rarely needed.
rarely needed. the author prefers to monitor the effect The author prefers to monitor the effect of xxd with strace(1) or
of xxd with strace(1) or truss(1), whenever -s is used. truss(1), whenever -s is used.
EXAMPLES EXAMPLES
Print everything but the first three lines (hex 0x30 Print everything but the first three lines (hex 0x30 bytes) of file
bytes) of file
Manual page for xxd August 1996 3
XXD(1) XXD(1)
% xxd -s 0x30 file % xxd -s 0x30 file
Print 3 lines (hex 0x30 bytes) from the end of file Print 3 lines (hex 0x30 bytes) from the end of file
% xxd -s -0x30 file % xxd -s -0x30 file
Print 120 bytes as continuous hexdump with 40 octets per Print 120 bytes as continuous hexdump with 40 octets per line.
line.
% xxd -l 120 -ps -c 20 xxd.1 % xxd -l 120 -ps -c 20 xxd.1
2e544820585844203120224d616e75616c207061 2e54482058584420312022417567757374203139
676520666f7220787864220a2e5c220a2e5c2220 39362220224d616e75616c207061676520666f72
32317374204d617920313939360a2e5c22204d61 20787864220a2e5c220a2e5c222032317374204d
6e207061676520617574686f723a0a2e5c222020 617920313939360a2e5c22204d616e2070616765
2020546f6e79204e7567656e74203c746f6e7940 20617574686f723a0a2e5c2220202020546f6e79
7363746e7567656e2e7070702e67752e6564752e 204e7567656e74203c746f6e79407363746e7567
Hexdump the first 120 bytes of this man page with 12 Hexdump the first 120 bytes of this man page with 12 octets per line.
octets per line.
% xxd -l 120 -c 12 xxd.1 % xxd -l 120 -c 12 xxd.1
0000000: 2e54 4820 5858 4420 3120 224d .TH XXD 1 "M 0000000: 2e54 4820 5858 4420 3120 2241 .TH XXD 1 "A
000000c: 616e 7561 6c20 7061 6765 2066 anual page f 000000c: 7567 7573 7420 3139 3936 2220 ugust 1996"
0000018: 6f72 2078 7864 220a 2e5c 220a or xxd"..\". 0000018: 224d 616e 7561 6c20 7061 6765 "Manual page
0000024: 2e5c 2220 3231 7374 204d 6179 .\" 21st May 0000024: 2066 6f72 2078 7864 220a 2e5c for xxd"..\
0000030: 2031 3939 360a 2e5c 2220 4d61 1996..\" Ma 0000030: 220a 2e5c 2220 3231 7374 204d "..\" 21st M
000003c: 6e20 7061 6765 2061 7574 686f n page autho 000003c: 6179 2031 3939 360a 2e5c 2220 ay 1996..\"
0000048: 723a 0a2e 5c22 2020 2020 546f r:..\" To 0000048: 4d61 6e20 7061 6765 2061 7574 Man page aut
0000054: 6e79 204e 7567 656e 7420 3c74 ny Nugent <t 0000054: 686f 723a 0a2e 5c22 2020 2020 hor:..\"
0000060: 6f6e 7940 7363 746e 7567 656e ony@sctnugen 0000060: 546f 6e79 204e 7567 656e 7420 Tony Nugent
000006c: 2e70 7070 2e67 752e 6564 752e .ppp.gu.edu. 000006c: 3c74 6f6e 7940 7363 746e 7567 <tony@sctnug
Display just the date from the file xxd.1 Display just the date from the file xxd.1
% xxd -s 0x28 -l 12 -c 12 xxd.1 % xxd -s 0x36 -l 13 -c 13 xxd.1
0000028: 3231 7374 204d 6179 2031 3939 21st May 199 0000036: 3231 7374 204d 6179 2031 3939 36 21st May 1996
Copy input_file to output_file and prepend 100 bytes of Copy input_file to output_file and prepend 100 bytes of value 0x00.
value 0x00.
% xxd input_file | xxd -r -s 100 > output_file % xxd input_file | xxd -r -s 100 > output_file
Patch the date in the file xxd.1 Patch the date in the file xxd.1
% echo '0000029: 3574 68' | xxd -r - xxd.1 % echo '0000037: 3574 68' | xxd -r - xxd.1
% xxd -s 0x28 -l 12 -c 12 xxd.1 % xxd -s 0x36 -l 13 -c 13 xxd.1
0000028: 3235 7468 204d 6179 2031 3939 25th May 199 0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996
Create a 65537 byte file with all bytes 0x00, except for Create a 65537 byte file with all bytes 0x00, except for the last one
the last one which is 'A' (hex 0x41). which is 'A' (hex 0x41).
% echo '010000: 41' | xxd -r > file % echo '010000: 41' | xxd -r > file
Hexdump this file with autoskip. Hexdump this file with autoskip.
@ -254,34 +197,21 @@ XXD(1) XXD(1)
* *
000fffc: 0000 0000 40 ....A 000fffc: 0000 0000 40 ....A
Create a 1 byte file containing a single 'A' character. Create a 1 byte file containing a single 'A' character. The number
The number after '-r -s' adds to the linenumbers found in after '-r -s' adds to the linenumbers found in the file; in effect, the
leading bytes are suppressed.
Manual page for xxd August 1996 4
XXD(1) XXD(1)
the file; in effect, the leading bytes are suppressed.
% echo '010000: 41' | xxd -r -s -0x10000 > file % echo '010000: 41' | xxd -r -s -0x10000 > file
Use xxd as a filter within an editor such as vim(1) to Use xxd as a filter within an editor such as vim(1) to hexdump a region
hexdump a region marked between `a' and `z'. marked between `a' and `z'.
:'a,'z!xxd :'a,'z!xxd
Use xxd as a filter within an editor such as vim(1) to Use xxd as a filter within an editor such as vim(1) to recover a binary
recover a binary hexdump marked between `a' and `z'. hexdump marked between `a' and `z'.
:'a,'z!xxd -r :'a,'z!xxd -r
Use xxd as a filter within an editor such as vim(1) to Use xxd as a filter within an editor such as vim(1) to recover one line
recover one line of a hexdump. Move the cursor over the of a hexdump. Move the cursor over the line and type:
line and type:
!!xxd -r !!xxd -r
Read single characters from a serial line Read single characters from a serial line
@ -295,8 +225,7 @@ RETURN VALUES
0 no errors encountered. 0 no errors encountered.
-1 operation not supported ( xxd -r -i still impossi- -1 operation not supported ( xxd -r -i still impossible).
ble).
1 error while parsing options. 1 error while parsing options.
@ -310,9 +239,8 @@ SEE ALSO
uuencode(1), uudecode(1), patch(1) uuencode(1), uudecode(1), patch(1)
WARNINGS WARNINGS
The tools weirdness matches its creators brain. Use The tools weirdness matches its creators brain. Use entirely at your
entirely at your own risk. Copy files. Trace it. Become a own risk. Copy files. Trace it. Become a wizard.
wizard.
VERSION VERSION
This manual page documents xxd version 1.7 This manual page documents xxd version 1.7
@ -322,75 +250,14 @@ AUTHOR
<jnweiger@informatik.uni-erlangen.de> <jnweiger@informatik.uni-erlangen.de>
Distribute freely and credit me, Distribute freely and credit me,
Manual page for xxd August 1996 5
XXD(1) XXD(1)
make money and share with me, make money and share with me,
lose money and don't ask me. lose money and don't ask me.
Manual page started by Tony Nugent Manual page started by Tony Nugent
<tony@sctnugen.ppp.gu.edu.au> <T.Nugent@sct.gu.edu.au> <tony@sctnugen.ppp.gu.edu.au> <T.Nugent@sct.gu.edu.au>
Small changes by Bram Moolenaar. Edited by Juergen Small changes by Bram Moolenaar. Edited by Juergen Weigert.
Weigert.
Manual page for xxd August 1996 XXD(1)
Manual page for xxd August 1996 6

View File

@ -1,7 +1,7 @@
" Vim support file to detect file types " Vim support file to detect file types
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2004 Oct 14 " Last Change: 2004 Nov 18
" Listen very carefully, I will say this only once " Listen very carefully, I will say this only once
if exists("did_load_filetypes") if exists("did_load_filetypes")
@ -1281,6 +1281,9 @@ au BufNewFile,BufRead *.sdl,*.pr setf sdl
" sed " sed
au BufNewFile,BufRead *.sed setf sed au BufNewFile,BufRead *.sed setf sed
" Sieve (RFC 3028)
au BufNewFile,BufRead *.siv setf sieve
" Sendmail " Sendmail
au BufNewFile,BufRead sendmail.cf setf sm au BufNewFile,BufRead sendmail.cf setf sm

View File

@ -1,7 +1,7 @@
" Vim support file to switch on loading plugins for file types " Vim support file to switch on loading plugins for file types
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2003 May 10 " Last change: 2004 Nov 22
if exists("did_load_ftplugin") if exists("did_load_ftplugin")
finish finish
@ -14,7 +14,7 @@ augroup filetypeplugin
if expand("<amatch>") != "" if expand("<amatch>") != ""
if exists("b:undo_ftplugin") if exists("b:undo_ftplugin")
exe b:undo_ftplugin exe b:undo_ftplugin
unlet b:undo_ftplugin b:did_ftplugin unlet! b:undo_ftplugin b:did_ftplugin
endif endif
if &cpo =~# "S" && exists("b:did_ftplugin") if &cpo =~# "S" && exists("b:did_ftplugin")
" In compatible mode options are reset to the global values, need to " In compatible mode options are reset to the global values, need to

View File

@ -1,8 +1,10 @@
" Vim filetype plugin " Vim filetype plugin
" Language: Lisp " Language: Lisp
" Maintainer: Dorai Sitaram <ds26@gte.com> " Maintainer: Sergey Khorev <sergey.khorev@gmail.com>
" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html " URL: http://iamphet.nm.ru/vim
" Last Change: May 15, 2003 " Original author: Dorai Sitaram <ds26@gte.com>
" Original URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
" Last Change: Nov 8, 2004
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
@ -18,3 +20,11 @@ setl define=^\\s*(def\\k*
setl formatoptions-=t setl formatoptions-=t
setl iskeyword+=+,-,*,/,%,<,=,>,:,$,?,!,@-@,94 setl iskeyword+=+,-,*,/,%,<,=,>,:,$,?,!,@-@,94
setl lisp setl lisp
" make comments behaviour like in c.vim
" e.g. insertion of ;;; and ;; on normal "O" or "o" when staying in comment
setl comments^=:;;;,:;;,sr:#\|,mb:\|,ex:\|#
setl formatoptions+=croql
" with smartindent # cause left alignment
setl nosmartindent

View File

@ -1,7 +1,7 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: Perl " Language: Perl
" Maintainer: Dan Sharp <dwsharp at hotmail dot com> " Maintainer: Dan Sharp <dwsharp at hotmail dot com>
" Last Change: 2004 May 16 " Last Change: 2004 Dec 06
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin " URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
if exists("b:did_ftplugin") | finish | endif if exists("b:did_ftplugin") | finish | endif
@ -27,7 +27,7 @@ endif
" Provided by Ned Konz <ned at bike-nomad dot com> " Provided by Ned Konz <ned at bike-nomad dot com>
"--------------------------------------------- "---------------------------------------------
setlocal include=\\<\\(use\|require\\)\\> setlocal include=\\<\\(use\\|require\\)\\>
setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.pm','') setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.pm','')
setlocal define=[^A-Za-z_] setlocal define=[^A-Za-z_]

View File

@ -1,7 +1,26 @@
" Vim filetype plugin " Vim filetype plugin
" Language: Scheme " Language: Scheme
" Maintainer: Dorai Sitaram <ds26@gte.com> " Maintainer: Sergey Khorev <sergey.khorev@gmail.com>
" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html " URL: http://iamphet.nm.ru/vim
" Last Change: Apr 2, 2003 " Original author: Dorai Sitaram <ds26@gte.com>
" Original URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
" Last Change: Nov 22, 2004
run ftplugin/lisp.vim runtime! ftplugin/lisp.vim ftplugin/lisp_*.vim ftplugin/lisp/*.vim
if exists("b:is_mzscheme") || exists("is_mzscheme")
" improve indenting
setl iskeyword+=#,%,^
setl lispwords+=module,parameterize,let-values,let*-values,letrec-values
setl lispwords+=define-values,opt-lambda,case-lambda,syntax-rules,with-syntax,syntax-case
setl lispwords+=define-signature,unit,unit/sig,compund-unit/sig,define-values/invoke-unit/sig
endif
if exists("b:is_chicken") || exists("is_chicken")
" improve indenting
setl iskeyword+=#,%,^
setl lispwords+=let-optionals,let-optionals*,declare
setl lispwords+=let-values,let*-values,letrec-values
setl lispwords+=define-values,opt-lambda,case-lambda,syntax-rules,with-syntax,syntax-case
setl lispwords+=cond-expand,and-let*,foreign-lambda,foreign-lambda*
endif

View File

@ -1,322 +1,322 @@
" Vim indent file generic utility functions " Vim indent file generic utility functions
" Language: * (various) " Language: * (various)
" Maintainer: Dave Silvia <dsilvia@mchsi.com> " Maintainer: Dave Silvia <dsilvia@mchsi.com>
" Date: 6/30/2004 " Date: 6/30/2004
" SUMMARY: To use GenericIndent, indent/<your_filename>.vim would have the " SUMMARY: To use GenericIndent, indent/<your_filename>.vim would have the
" following general format: " following general format:
" "
" if exists("b:did_indent") | finish | endif " if exists("b:did_indent") | finish | endif
" let b:did_indent = 1 " let b:did_indent = 1
" runtime indent/GenericIndent.vim " runtime indent/GenericIndent.vim
" let b:indentStmts='' " let b:indentStmts=''
" let b:dedentStmts='' " let b:dedentStmts=''
" let b:allStmts='' " let b:allStmts=''
" setlocal indentexpr=GenericIndent() " setlocal indentexpr=GenericIndent()
" setlocal indentkeys=<your_keys> " setlocal indentkeys=<your_keys>
" call GenericIndentStmts(<your_stmts>) " call GenericIndentStmts(<your_stmts>)
" call GenericDedentStmts(<your_stmts>) " call GenericDedentStmts(<your_stmts>)
" call GenericAllStmts() " call GenericAllStmts()
" "
" END SUMMARY: " END SUMMARY:
" NOTE: b:indentStmts, b:dedentStmts, and b:allStmts need to be initialized " NOTE: b:indentStmts, b:dedentStmts, and b:allStmts need to be initialized
" to '' before callin the functions because 'indent.vim' explicitly " to '' before callin the functions because 'indent.vim' explicitly
" 'unlet's b:did_indent. This means that the lists will compound if " 'unlet's b:did_indent. This means that the lists will compound if
" you change back and forth between buffers. This is true as of " you change back and forth between buffers. This is true as of
" version 6.3, 6/23/2004. " version 6.3, 6/23/2004.
" "
" NOTE: By default, GenericIndent is case sensitive. " NOTE: By default, GenericIndent is case sensitive.
" let b:case_insensitive=1 if you want to ignore case, e.g. DOS batch files " let b:case_insensitive=1 if you want to ignore case, e.g. DOS batch files
" The function 'GenericIndent' is data driven and handles most all cases of " The function 'GenericIndent' is data driven and handles most all cases of
" indent checking if you first set up the data. To use this function follow " indent checking if you first set up the data. To use this function follow
" the example below (taken from the file indent/MuPAD_source.vim) " the example below (taken from the file indent/MuPAD_source.vim)
" "
" Before you start, source this file in indent/<your_script>.vim to have it " Before you start, source this file in indent/<your_script>.vim to have it
" define functions for your use. " define functions for your use.
" "
"runtime indent/GenericIndent.vim "runtime indent/GenericIndent.vim
" "
" The data is in 5 sets: " The data is in 5 sets:
" "
" First, set the data set 'indentexpr' to GenericIndent(). " First, set the data set 'indentexpr' to GenericIndent().
" "
"setlocal indentexpr=GenericIndent() "setlocal indentexpr=GenericIndent()
" "
" Second, set the data set 'indentkeys' to the keywords/expressions that need " Second, set the data set 'indentkeys' to the keywords/expressions that need
" to be checked for 'indenting' _as_ they typed. " to be checked for 'indenting' _as_ they typed.
" "
"setlocal indentkeys==end_proc,=else,=then,=elif,=end_if,=end_case,=until,=end_repeat,=end_domain,=end_for,=end_while,=end,o,O "setlocal indentkeys==end_proc,=else,=then,=elif,=end_if,=end_case,=until,=end_repeat,=end_domain,=end_for,=end_while,=end,o,O
" "
" NOTE: 'o,O' at the end of the previous line says you wish to be called " NOTE: 'o,O' at the end of the previous line says you wish to be called
" whenever a newline is placed in the buffer. This allows the previous line " whenever a newline is placed in the buffer. This allows the previous line
" to be checked for indentation parameters. " to be checked for indentation parameters.
" "
" Third, set the data set 'b:indentStmts' to the keywords/expressions that, when " Third, set the data set 'b:indentStmts' to the keywords/expressions that, when
" they are on a line _when_ you _press_ the _<Enter>_ key, " they are on a line _when_ you _press_ the _<Enter>_ key,
" you wish to have the next line indented. " you wish to have the next line indented.
" "
"call GenericIndentStmts('begin,if,then,else,elif,case,repeat,until,domain,do') "call GenericIndentStmts('begin,if,then,else,elif,case,repeat,until,domain,do')
" "
" Fourth, set the data set 'b:dedentStmts' to the keywords/expressions that, when " Fourth, set the data set 'b:dedentStmts' to the keywords/expressions that, when
" they are on a line you are currently typing, you wish to have that line " they are on a line you are currently typing, you wish to have that line
" 'dedented' (having already been indented because of the previous line's " 'dedented' (having already been indented because of the previous line's
" indentation). " indentation).
" "
"call GenericDedentStmts('end_proc,then,else,elif,end_if,end_case,until,end_repeat,end_domain,end_for,end_while,end') "call GenericDedentStmts('end_proc,then,else,elif,end_if,end_case,until,end_repeat,end_domain,end_for,end_while,end')
" "
" Fifth, set the data set 'b:allStmts' to the concatenation of the third and " Fifth, set the data set 'b:allStmts' to the concatenation of the third and
" fourth data sets, used for checking when more than one keyword/expression " fourth data sets, used for checking when more than one keyword/expression
" is on a line. " is on a line.
" "
"call GenericAllStmts() "call GenericAllStmts()
" "
" NOTE: GenericIndentStmts uses two variables: 'b:indentStmtOpen' and " NOTE: GenericIndentStmts uses two variables: 'b:indentStmtOpen' and
" 'b:indentStmtClose' which default to '\<' and '\>' respectively. You can " 'b:indentStmtClose' which default to '\<' and '\>' respectively. You can
" set (let) these to any value you wish before calling GenericIndentStmts with " set (let) these to any value you wish before calling GenericIndentStmts with
" your list. Similarly, GenericDedentStmts uses 'b:dedentStmtOpen' and " your list. Similarly, GenericDedentStmts uses 'b:dedentStmtOpen' and
" 'b:dedentStmtClose'. " 'b:dedentStmtClose'.
" "
" NOTE: Patterns may be used in the lists passed to Generic[In|De]dentStmts " NOTE: Patterns may be used in the lists passed to Generic[In|De]dentStmts
" since each element in the list is copied verbatim. " since each element in the list is copied verbatim.
" "
" Optionally, you can set the DEBUGGING flag within your script to have the " Optionally, you can set the DEBUGGING flag within your script to have the
" debugging messages output. See below for description. This can also be set " debugging messages output. See below for description. This can also be set
" (let) from the command line within your editing buffer. " (let) from the command line within your editing buffer.
" "
"let b:DEBUGGING=1 "let b:DEBUGGING=1
" "
" See: " See:
" :h runtime " :h runtime
" :set runtimepath ? " :set runtimepath ?
" to familiarize yourself with how this works and where you should have this " to familiarize yourself with how this works and where you should have this
" file and your file(s) installed. " file and your file(s) installed.
" "
" For help with setting 'indentkeys' see: " For help with setting 'indentkeys' see:
" :h indentkeys " :h indentkeys
" Also, for some good examples see 'indent/sh.vim' and 'indent/vim.vim' as " Also, for some good examples see 'indent/sh.vim' and 'indent/vim.vim' as
" well as files for other languages you may be familiar with. " well as files for other languages you may be familiar with.
" "
" "
" Alternatively, if you'd rather specify yourself, you can enter " Alternatively, if you'd rather specify yourself, you can enter
" 'b:indentStmts', 'b:dedentStmts', and 'b:allStmts' 'literally': " 'b:indentStmts', 'b:dedentStmts', and 'b:allStmts' 'literally':
" "
"let b:indentStmts='\<begin\>\|\<if\>\|\<then\>\|\<else\>\|\<elif\>\|\<case\>\|\<repeat\>\|\<until\>\|\<domain\>\|\<do\>' "let b:indentStmts='\<begin\>\|\<if\>\|\<then\>\|\<else\>\|\<elif\>\|\<case\>\|\<repeat\>\|\<until\>\|\<domain\>\|\<do\>'
"let b:dedentStmts='\<end_proc\>\|\<else\>\|\<elif\>\|\<end_if\>\|\<end_case\>\|\<until\>\|\<end_repeat\>\|\<end_domain\>\|\<end_for\>\|\<end_while\>\|\<end\>' "let b:dedentStmts='\<end_proc\>\|\<else\>\|\<elif\>\|\<end_if\>\|\<end_case\>\|\<until\>\|\<end_repeat\>\|\<end_domain\>\|\<end_for\>\|\<end_while\>\|\<end\>'
"let b:allStmts=b:indentStmts.'\|'.b:dedentStmts "let b:allStmts=b:indentStmts.'\|'.b:dedentStmts
" "
" This is only useful if you have particularly different parameters for " This is only useful if you have particularly different parameters for
" matching each statement. " matching each statement.
" RECAP: From indent/MuPAD_source.vim " RECAP: From indent/MuPAD_source.vim
" "
"if exists("b:did_indent") | finish | endif "if exists("b:did_indent") | finish | endif
" "
"let b:did_indent = 1 "let b:did_indent = 1
" "
"runtime indent/GenericIndent.vim "runtime indent/GenericIndent.vim
" "
"setlocal indentexpr=GenericIndent() "setlocal indentexpr=GenericIndent()
"setlocal indentkeys==end_proc,=then,=else,=elif,=end_if,=end_case,=until,=end_repeat,=end_domain,=end_for,=end_while,=end,o,O "setlocal indentkeys==end_proc,=then,=else,=elif,=end_if,=end_case,=until,=end_repeat,=end_domain,=end_for,=end_while,=end,o,O
"call GenericIndentStmts('begin,if,then,else,elif,case,repeat,until,domain,do') "call GenericIndentStmts('begin,if,then,else,elif,case,repeat,until,domain,do')
"call GenericDedentStmts('end_proc,then,else,elif,end_if,end_case,until,end_repeat,end_domain,end_for,end_while,end') "call GenericDedentStmts('end_proc,then,else,elif,end_if,end_case,until,end_repeat,end_domain,end_for,end_while,end')
"call GenericAllStmts() "call GenericAllStmts()
" "
" END RECAP: " END RECAP:
let s:hit=0 let s:hit=0
let s:lastVlnum=0 let s:lastVlnum=0
let s:myScriptName=expand("<sfile>:t") let s:myScriptName=expand("<sfile>:t")
if exists("*GenericIndent") if exists("*GenericIndent")
finish finish
endif endif
function GenericAllStmts() function GenericAllStmts()
let b:allStmts=b:indentStmts.'\|'.b:dedentStmts let b:allStmts=b:indentStmts.'\|'.b:dedentStmts
call DebugGenericIndent(expand("<sfile>").": "."b:indentStmts: ".b:indentStmts.", b:dedentStmts: ".b:dedentStmts.", b:allStmts: ".b:allStmts) call DebugGenericIndent(expand("<sfile>").": "."b:indentStmts: ".b:indentStmts.", b:dedentStmts: ".b:dedentStmts.", b:allStmts: ".b:allStmts)
endfunction endfunction
function GenericIndentStmts(stmts) function GenericIndentStmts(stmts)
let Stmts=a:stmts let Stmts=a:stmts
let Comma=match(Stmts,',') let Comma=match(Stmts,',')
if Comma == -1 || Comma == strlen(Stmts)-1 if Comma == -1 || Comma == strlen(Stmts)-1
echoerr "Must supply a comma separated list of at least 2 entries." echoerr "Must supply a comma separated list of at least 2 entries."
echoerr "Supplied list: <".Stmts.">" echoerr "Supplied list: <".Stmts.">"
return return
endif endif
if !exists("b:indentStmtOpen") if !exists("b:indentStmtOpen")
let b:indentStmtOpen='\<' let b:indentStmtOpen='\<'
endif endif
if !exists("b:indentStmtClose") if !exists("b:indentStmtClose")
let b:indentStmtClose='\>' let b:indentStmtClose='\>'
endif endif
if !exists("b:indentStmts") if !exists("b:indentStmts")
let b:indentStmts='' let b:indentStmts=''
endif endif
if b:indentStmts != '' if b:indentStmts != ''
let b:indentStmts=b:indentStmts.'\|' let b:indentStmts=b:indentStmts.'\|'
endif endif
call DebugGenericIndent(expand("<sfile>").": "."b:indentStmtOpen: ".b:indentStmtOpen.", b:indentStmtClose: ".b:indentStmtClose.", b:indentStmts: ".b:indentStmts.", Stmts: ".Stmts) call DebugGenericIndent(expand("<sfile>").": "."b:indentStmtOpen: ".b:indentStmtOpen.", b:indentStmtClose: ".b:indentStmtClose.", b:indentStmts: ".b:indentStmts.", Stmts: ".Stmts)
let stmtEntryBegin=0 let stmtEntryBegin=0
let stmtEntryEnd=Comma let stmtEntryEnd=Comma
let stmtEntry=strpart(Stmts,stmtEntryBegin,stmtEntryEnd-stmtEntryBegin) let stmtEntry=strpart(Stmts,stmtEntryBegin,stmtEntryEnd-stmtEntryBegin)
let Stmts=strpart(Stmts,Comma+1) let Stmts=strpart(Stmts,Comma+1)
let Comma=match(Stmts,',') let Comma=match(Stmts,',')
let b:indentStmts=b:indentStmts.b:indentStmtOpen.stmtEntry.b:indentStmtClose let b:indentStmts=b:indentStmts.b:indentStmtOpen.stmtEntry.b:indentStmtClose
while Comma != -1 while Comma != -1
let stmtEntryEnd=Comma let stmtEntryEnd=Comma
let stmtEntry=strpart(Stmts,stmtEntryBegin,stmtEntryEnd-stmtEntryBegin) let stmtEntry=strpart(Stmts,stmtEntryBegin,stmtEntryEnd-stmtEntryBegin)
let Stmts=strpart(Stmts,Comma+1) let Stmts=strpart(Stmts,Comma+1)
let Comma=match(Stmts,',') let Comma=match(Stmts,',')
let b:indentStmts=b:indentStmts.'\|'.b:indentStmtOpen.stmtEntry.b:indentStmtClose let b:indentStmts=b:indentStmts.'\|'.b:indentStmtOpen.stmtEntry.b:indentStmtClose
endwhile endwhile
let stmtEntry=Stmts let stmtEntry=Stmts
let b:indentStmts=b:indentStmts.'\|'.b:indentStmtOpen.stmtEntry.b:indentStmtClose let b:indentStmts=b:indentStmts.'\|'.b:indentStmtOpen.stmtEntry.b:indentStmtClose
endfunction endfunction
function GenericDedentStmts(stmts) function GenericDedentStmts(stmts)
let Stmts=a:stmts let Stmts=a:stmts
let Comma=match(Stmts,',') let Comma=match(Stmts,',')
if Comma == -1 || Comma == strlen(Stmts)-1 if Comma == -1 || Comma == strlen(Stmts)-1
echoerr "Must supply a comma separated list of at least 2 entries." echoerr "Must supply a comma separated list of at least 2 entries."
echoerr "Supplied list: <".Stmts.">" echoerr "Supplied list: <".Stmts.">"
return return
endif endif
if !exists("b:dedentStmtOpen") if !exists("b:dedentStmtOpen")
let b:dedentStmtOpen='\<' let b:dedentStmtOpen='\<'
endif endif
if !exists("b:dedentStmtClose") if !exists("b:dedentStmtClose")
let b:dedentStmtClose='\>' let b:dedentStmtClose='\>'
endif endif
if !exists("b:dedentStmts") if !exists("b:dedentStmts")
let b:dedentStmts='' let b:dedentStmts=''
endif endif
if b:dedentStmts != '' if b:dedentStmts != ''
let b:dedentStmts=b:dedentStmts.'\|' let b:dedentStmts=b:dedentStmts.'\|'
endif endif
call DebugGenericIndent(expand("<sfile>").": "."b:dedentStmtOpen: ".b:dedentStmtOpen.", b:dedentStmtClose: ".b:dedentStmtClose.", b:dedentStmts: ".b:dedentStmts.", Stmts: ".Stmts) call DebugGenericIndent(expand("<sfile>").": "."b:dedentStmtOpen: ".b:dedentStmtOpen.", b:dedentStmtClose: ".b:dedentStmtClose.", b:dedentStmts: ".b:dedentStmts.", Stmts: ".Stmts)
let stmtEntryBegin=0 let stmtEntryBegin=0
let stmtEntryEnd=Comma let stmtEntryEnd=Comma
let stmtEntry=strpart(Stmts,stmtEntryBegin,stmtEntryEnd-stmtEntryBegin) let stmtEntry=strpart(Stmts,stmtEntryBegin,stmtEntryEnd-stmtEntryBegin)
let Stmts=strpart(Stmts,Comma+1) let Stmts=strpart(Stmts,Comma+1)
let Comma=match(Stmts,',') let Comma=match(Stmts,',')
let b:dedentStmts=b:dedentStmts.b:dedentStmtOpen.stmtEntry.b:dedentStmtClose let b:dedentStmts=b:dedentStmts.b:dedentStmtOpen.stmtEntry.b:dedentStmtClose
while Comma != -1 while Comma != -1
let stmtEntryEnd=Comma let stmtEntryEnd=Comma
let stmtEntry=strpart(Stmts,stmtEntryBegin,stmtEntryEnd-stmtEntryBegin) let stmtEntry=strpart(Stmts,stmtEntryBegin,stmtEntryEnd-stmtEntryBegin)
let Stmts=strpart(Stmts,Comma+1) let Stmts=strpart(Stmts,Comma+1)
let Comma=match(Stmts,',') let Comma=match(Stmts,',')
let b:dedentStmts=b:dedentStmts.'\|'.b:dedentStmtOpen.stmtEntry.b:dedentStmtClose let b:dedentStmts=b:dedentStmts.'\|'.b:dedentStmtOpen.stmtEntry.b:dedentStmtClose
endwhile endwhile
let stmtEntry=Stmts let stmtEntry=Stmts
let b:dedentStmts=b:dedentStmts.'\|'.b:dedentStmtOpen.stmtEntry.b:dedentStmtClose let b:dedentStmts=b:dedentStmts.'\|'.b:dedentStmtOpen.stmtEntry.b:dedentStmtClose
endfunction endfunction
" Debugging function. Displays messages in the command area which can be " Debugging function. Displays messages in the command area which can be
" reviewed using ':messages'. To turn it on use ':let b:DEBUGGING=1'. Once " reviewed using ':messages'. To turn it on use ':let b:DEBUGGING=1'. Once
" on, turn off by using ':let b:DEBUGGING=0. If you don't want it at all and " on, turn off by using ':let b:DEBUGGING=0. If you don't want it at all and
" feel it's slowing down your editing (you must have an _awfully_ slow " feel it's slowing down your editing (you must have an _awfully_ slow
" machine!;-> ), you can just comment out the calls to it from 'GenericIndent' " machine!;-> ), you can just comment out the calls to it from 'GenericIndent'
" below. No need to remove the function or the calls, tho', as you never can " below. No need to remove the function or the calls, tho', as you never can
" tell when they might come in handy!;-) " tell when they might come in handy!;-)
function DebugGenericIndent(msg) function DebugGenericIndent(msg)
if exists("b:DEBUGGING") && b:DEBUGGING if exists("b:DEBUGGING") && b:DEBUGGING
echomsg '['.s:hit.']'.s:myScriptName."::".a:msg echomsg '['.s:hit.']'.s:myScriptName."::".a:msg
endif endif
endfunction endfunction
function GenericIndent() function GenericIndent()
" save ignore case option. Have to set noignorecase for the match " save ignore case option. Have to set noignorecase for the match
" functions to do their job the way we want them to! " functions to do their job the way we want them to!
" NOTE: if you add a return to this function be sure you do " NOTE: if you add a return to this function be sure you do
" if IgnoreCase | set ignorecase | endif " if IgnoreCase | set ignorecase | endif
" before returning. You can just cut and paste from here. " before returning. You can just cut and paste from here.
let IgnoreCase=&ignorecase let IgnoreCase=&ignorecase
" let b:case_insensitive=1 if you want to ignore case, e.g. DOS batch files " let b:case_insensitive=1 if you want to ignore case, e.g. DOS batch files
if !exists("b:case_insensitive") if !exists("b:case_insensitive")
set noignorecase set noignorecase
endif endif
" this is used to let DebugGenericIndent display which invocation of the " this is used to let DebugGenericIndent display which invocation of the
" function goes with which messages. " function goes with which messages.
let s:hit=s:hit+1 let s:hit=s:hit+1
let lnum=v:lnum let lnum=v:lnum
let cline=getline(lnum) let cline=getline(lnum)
let lnum=prevnonblank(lnum) let lnum=prevnonblank(lnum)
if lnum==0 | if IgnoreCase | set ignorecase | endif | return 0 | endif if lnum==0 | if IgnoreCase | set ignorecase | endif | return 0 | endif
let pline=getline(lnum) let pline=getline(lnum)
let ndnt=indent(lnum) let ndnt=indent(lnum)
if !exists("b:allStmts") if !exists("b:allStmts")
call GenericAllStmts() call GenericAllStmts()
endif endif
call DebugGenericIndent(expand("<sfile>").": "."cline=<".cline.">, pline=<".pline.">, lnum=".lnum.", v:lnum=".v:lnum.", ndnt=".ndnt) call DebugGenericIndent(expand("<sfile>").": "."cline=<".cline.">, pline=<".pline.">, lnum=".lnum.", v:lnum=".v:lnum.", ndnt=".ndnt)
if lnum==v:lnum if lnum==v:lnum
" current line, only check dedent " current line, only check dedent
" "
" just dedented this line, don't need to do it again. " just dedented this line, don't need to do it again.
" another dedentStmts was added or an end%[_*] was completed. " another dedentStmts was added or an end%[_*] was completed.
if s:lastVlnum==v:lnum if s:lastVlnum==v:lnum
if IgnoreCase | set ignorecase | endif if IgnoreCase | set ignorecase | endif
return ndnt return ndnt
endif endif
let s:lastVlnum=v:lnum let s:lastVlnum=v:lnum
call DebugGenericIndent(expand("<sfile>").": "."Checking dedent") call DebugGenericIndent(expand("<sfile>").": "."Checking dedent")
let srcStr=cline let srcStr=cline
let dedentKeyBegin=match(srcStr,b:dedentStmts) let dedentKeyBegin=match(srcStr,b:dedentStmts)
if dedentKeyBegin != -1 if dedentKeyBegin != -1
let dedentKeyEnd=matchend(srcStr,b:dedentStmts) let dedentKeyEnd=matchend(srcStr,b:dedentStmts)
let dedentKeyStr=strpart(srcStr,dedentKeyBegin,dedentKeyEnd-dedentKeyBegin) let dedentKeyStr=strpart(srcStr,dedentKeyBegin,dedentKeyEnd-dedentKeyBegin)
"only dedent if it's the beginning of the line "only dedent if it's the beginning of the line
if match(srcStr,'^\s*\<'.dedentKeyStr.'\>') != -1 if match(srcStr,'^\s*\<'.dedentKeyStr.'\>') != -1
call DebugGenericIndent(expand("<sfile>").": "."It's the beginning of the line, dedent") call DebugGenericIndent(expand("<sfile>").": "."It's the beginning of the line, dedent")
let ndnt=ndnt-&shiftwidth let ndnt=ndnt-&shiftwidth
endif endif
endif endif
call DebugGenericIndent(expand("<sfile>").": "."dedent - returning ndnt=".ndnt) call DebugGenericIndent(expand("<sfile>").": "."dedent - returning ndnt=".ndnt)
else else
" previous line, only check indent " previous line, only check indent
call DebugGenericIndent(expand("<sfile>").": "."Checking indent") call DebugGenericIndent(expand("<sfile>").": "."Checking indent")
let srcStr=pline let srcStr=pline
let indentKeyBegin=match(srcStr,b:indentStmts) let indentKeyBegin=match(srcStr,b:indentStmts)
if indentKeyBegin != -1 if indentKeyBegin != -1
" only indent if it's the last indentStmts in the line " only indent if it's the last indentStmts in the line
let allKeyBegin=match(srcStr,b:allStmts) let allKeyBegin=match(srcStr,b:allStmts)
let allKeyEnd=matchend(srcStr,b:allStmts) let allKeyEnd=matchend(srcStr,b:allStmts)
let allKeyStr=strpart(srcStr,allKeyBegin,allKeyEnd-allKeyBegin) let allKeyStr=strpart(srcStr,allKeyBegin,allKeyEnd-allKeyBegin)
let srcStr=strpart(srcStr,allKeyEnd) let srcStr=strpart(srcStr,allKeyEnd)
let allKeyBegin=match(srcStr,b:allStmts) let allKeyBegin=match(srcStr,b:allStmts)
if allKeyBegin != -1 if allKeyBegin != -1
" not the end of the line, check what is and only indent if " not the end of the line, check what is and only indent if
" it's an indentStmts " it's an indentStmts
call DebugGenericIndent(expand("<sfile>").": "."Multiple words in line, checking if last is indent") call DebugGenericIndent(expand("<sfile>").": "."Multiple words in line, checking if last is indent")
while allKeyBegin != -1 while allKeyBegin != -1
let allKeyEnd=matchend(srcStr,b:allStmts) let allKeyEnd=matchend(srcStr,b:allStmts)
let allKeyStr=strpart(srcStr,allKeyBegin,allKeyEnd-allKeyBegin) let allKeyStr=strpart(srcStr,allKeyBegin,allKeyEnd-allKeyBegin)
let srcStr=strpart(srcStr,allKeyEnd) let srcStr=strpart(srcStr,allKeyEnd)
let allKeyBegin=match(srcStr,b:allStmts) let allKeyBegin=match(srcStr,b:allStmts)
endwhile endwhile
if match(b:indentStmts,allKeyStr) != -1 if match(b:indentStmts,allKeyStr) != -1
call DebugGenericIndent(expand("<sfile>").": "."Last word in line is indent") call DebugGenericIndent(expand("<sfile>").": "."Last word in line is indent")
let ndnt=ndnt+&shiftwidth let ndnt=ndnt+&shiftwidth
endif endif
else else
" it's the last indentStmts in the line, go ahead and indent " it's the last indentStmts in the line, go ahead and indent
let ndnt=ndnt+&shiftwidth let ndnt=ndnt+&shiftwidth
endif endif
endif endif
call DebugGenericIndent(expand("<sfile>").": "."indent - returning ndnt=".ndnt) call DebugGenericIndent(expand("<sfile>").": "."indent - returning ndnt=".ndnt)
endif endif
if IgnoreCase | set ignorecase | endif if IgnoreCase | set ignorecase | endif
return ndnt return ndnt
endfunction endfunction
" TODO: I'm open! " TODO: I'm open!
" "
" BUGS: You tell me! Probably. I just haven't found one yet or haven't been " BUGS: You tell me! Probably. I just haven't found one yet or haven't been
" told about one. " told about one.
" "

View File

@ -1,7 +1,7 @@
" Vim indent file " Vim indent file
" Language: Ada " Language: Ada
" Maintainer: Neil Bird <neil@fnxweb.com> " Maintainer: Neil Bird <neil@fnxweb.com>
" Last Change: 2003 May 20 " Last Change: 2004 Nov 23
" Version: $Id$ " Version: $Id$
" Look for the latest version at http://vim.sourceforge.net/ " Look for the latest version at http://vim.sourceforge.net/
" "
@ -25,11 +25,11 @@ if exists("*GetAdaIndent")
finish finish
endif endif
let s:AdaBlockStart = '^\s*\(if\>\|while\>\|else\>\|elsif\>\|loop\>\|for\>.*\<loop\>\|declare\>\|begin\>\|type\>.*\<is\s*$\|\(type\>.*\)\=\<record\>\|procedure\>\|function\>\|accept\>\|do\>\|task\>\|package\>\|then\>\|when\>\|is\>\)' let s:AdaBlockStart = '^\s*\(if\>\|while\>\|else\>\|elsif\>\|loop\>\|for\>.*\<\(loop\|use\)\>\|declare\>\|begin\>\|type\>.*\<is\>[^;]*$\|\(type\>.*\)\=\<record\>\|procedure\>\|function\>\|accept\>\|do\>\|task\>\|package\>\|then\>\|when\>\|is\>\)'
let s:AdaComment = "\\v^(\"[^\"]*\"|'.'|[^\"']){-}\\zs\\s*--.*" let s:AdaComment = "\\v^(\"[^\"]*\"|'.'|[^\"']){-}\\zs\\s*--.*"
" Try to find indent of the block we're in (and about to complete) " Try to find indent of the block we're in
" prev_indent = the previous line's indent " prev_indent = the previous line's indent
" prev_lnum = previous line (to start looking on) " prev_lnum = previous line (to start looking on)
" blockstart = expr. that indicates a possible start of this block " blockstart = expr. that indicates a possible start of this block
@ -44,7 +44,7 @@ function s:MainBlockIndent( prev_indent, prev_lnum, blockstart, stop_at )
let line = substitute( getline(lnum), s:AdaComment, '', '' ) let line = substitute( getline(lnum), s:AdaComment, '', '' )
while lnum > 1 while lnum > 1
if a:stop_at != '' && line =~ '^\s*' . a:stop_at && indent(lnum) < a:prev_indent if a:stop_at != '' && line =~ '^\s*' . a:stop_at && indent(lnum) < a:prev_indent
return -1 return a:prev_indent
elseif line =~ '^\s*' . a:blockstart elseif line =~ '^\s*' . a:blockstart
let ind = indent(lnum) let ind = indent(lnum)
if ind < a:prev_indent if ind < a:prev_indent
@ -111,7 +111,7 @@ function s:EndBlockIndent( prev_indent, prev_lnum, blockstart, blockend )
return a:prev_indent - &sw return a:prev_indent - &sw
endfunction endfunction
" As per MainBlockIndent, but return indent of previous statement-start " Return indent of previous statement-start
" (after we've indented due to multi-line statements). " (after we've indented due to multi-line statements).
" This time, we start searching on the line *before* the one given (which is " This time, we start searching on the line *before* the one given (which is
" the end of a statement - we want the previous beginning). " the end of a statement - we want the previous beginning).
@ -169,6 +169,7 @@ function GetAdaIndent()
" Get default indent (from prev. line) " Get default indent (from prev. line)
let ind = indent(lnum) let ind = indent(lnum)
let initind = ind
" Now check what's on the previous line " Now check what's on the previous line
if line =~ s:AdaBlockStart || line =~ '(\s*$' if line =~ s:AdaBlockStart || line =~ '(\s*$'
@ -210,7 +211,7 @@ function GetAdaIndent()
" Multiple line generic instantiation ('package blah is\nnew thingy') " Multiple line generic instantiation ('package blah is\nnew thingy')
let ind = s:StatementIndent( ind - &sw, lnum ) let ind = s:StatementIndent( ind - &sw, lnum )
elseif line =~ ';\s*$' elseif line =~ ';\s*$'
" Statement end - try to find current statement-start indent " Statement end (but not 'end' ) - try to find current statement-start indent
let ind = s:StatementIndent( ind, lnum ) let ind = s:StatementIndent( ind, lnum )
endif endif
@ -224,11 +225,14 @@ function GetAdaIndent()
" Start of line for ada-pp " Start of line for ada-pp
let ind = 0 let ind = 0
elseif continuation && line =~ '^\s*(' elseif continuation && line =~ '^\s*('
let ind = ind + &sw " Don't do this if we've already indented due to the previous line
if ind == initind
let ind = ind + &sw
endif
elseif line =~ '^\s*\(begin\|is\)\>' elseif line =~ '^\s*\(begin\|is\)\>'
let ind = s:MainBlockIndent( ind, lnum, '\(procedure\|function\|declare\|package\|task\)\>', 'begin\>' ) let ind = s:MainBlockIndent( ind, lnum, '\(procedure\|function\|declare\|package\|task\)\>', 'begin\>' )
elseif line =~ '^\s*record\>' elseif line =~ '^\s*record\>'
let ind = s:MainBlockIndent( ind, lnum, 'type\>', '' ) + &sw let ind = s:MainBlockIndent( ind, lnum, 'type\>\|for\>.*\<use\>', '' ) + &sw
elseif line =~ '^\s*\(else\|elsif\)\>' elseif line =~ '^\s*\(else\|elsif\)\>'
let ind = s:MainBlockIndent( ind, lnum, 'if\>', '' ) let ind = s:MainBlockIndent( ind, lnum, 'if\>', '' )
elseif line =~ '^\s*when\>' elseif line =~ '^\s*when\>'
@ -251,7 +255,7 @@ function GetAdaIndent()
let ind = s:EndBlockIndent( ind, lnum, 'case\>.*\<is\>', 'end\>\s*\<case\>' ) let ind = s:EndBlockIndent( ind, lnum, 'case\>.*\<is\>', 'end\>\s*\<case\>' )
elseif line =~ '^\s*end\>' elseif line =~ '^\s*end\>'
" General case for end " General case for end
let ind = s:MainBlockIndent( ind, lnum, '\(if\|while\|for\|loop\|accept\|begin\|record\|case\|exception\)\>', '' ) let ind = s:MainBlockIndent( ind, lnum, '\(if\|while\|for\|loop\|accept\|begin\|record\|case\|exception\|package\)\>', '' )
elseif line =~ '^\s*exception\>' elseif line =~ '^\s*exception\>'
let ind = s:MainBlockIndent( ind, lnum, 'begin\>', '' ) let ind = s:MainBlockIndent( ind, lnum, 'begin\>', '' )
elseif line =~ '^\s*then\>' elseif line =~ '^\s*then\>'

View File

@ -5,7 +5,7 @@
" $Date$ " $Date$
" $Revision$ " $Revision$
" URL: http://www.djoce.net/page/vim/ " URL: http://www.djoce.net/page/vim/
" Last Change: 2004 Sep 14 " Last Change: 2004 Sept 14 : removed specific value for tab (sw)
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
if exists("b:did_indent") if exists("b:did_indent")

View File

@ -1,6 +1,6 @@
" Vim Keymap file for Sinhala (Sri Lanka) (2003-11-02) " Vim Keymap file for Sinhala (Sri Lanka) (2003-11-02)
" Maintainer : Harshula Jayasuriya <hash@jayasolutions.cjb.net> " Maintainer : Harshula Jayasuriya <hash@jayasolutions.cjb.net>
" Last Updated: 2004-10-10 " Last Updated: 2004-11-14
" This is a static phonetic mapping for a standard US-English keyboard " This is a static phonetic mapping for a standard US-English keyboard
" (qwerty) " (qwerty)
" http://www.nongnu.org/sinhala/doc/keymaps/sinhala-keyboard_3.html " http://www.nongnu.org/sinhala/doc/keymaps/sinhala-keyboard_3.html
@ -12,6 +12,7 @@
" Select the new keymap " Select the new keymap
" set keymap=sinhala-phonetic_utf-8 " set keymap=sinhala-phonetic_utf-8
let b:keymap_name = "sinhala"
loadkeymap loadkeymap
V <char-0x0d82> " - anusvaraya (anusvara) V <char-0x0d82> " - anusvaraya (anusvara)
@ -43,7 +44,7 @@ G <char-0x0d9d> " ඝ - mahaapraana gayanna (gha)
c <char-0x0da0> " ච - alpapraana cayanna (ca) c <char-0x0da0> " ච - alpapraana cayanna (ca)
C <char-0x0da1> " ඡ - mahaapraana cayanna (cha) C <char-0x0da1> " ඡ - mahaapraana cayanna (cha)
j <char-0x0da2> " ජ - alpapraana jayanna (ja) j <char-0x0da2> " ජ - alpapraana jayanna (ja)
J <char-0x0da3> " ඣ - mahaapraana jhayanna (jha) J <char-0x0da3> " ඣ - mahaapraana jayanna (jha)
z <char-0x0da4> " ඤ - taaluja naasikyaya (nya) z <char-0x0da4> " ඤ - taaluja naasikyaya (nya)
Z <char-0x0da5> " ඥ - taaluja sanyooga naasikyaya (jnya) Z <char-0x0da5> " ඥ - taaluja sanyooga naasikyaya (jnya)
<A-j> <char-0x0da6> " ඦ - sanyaka jayanna (nyja) <A-j> <char-0x0da6> " ඦ - sanyaka jayanna (nyja)
@ -52,13 +53,13 @@ T <char-0x0da8> " ඨ - mahaapraana ttayanna (ttha)
d <char-0x0da9> " ඩ - alpapraana ddayanna (dda) d <char-0x0da9> " ඩ - alpapraana ddayanna (dda)
D <char-0x0daa> " ඪ - mahaapraana ddayanna (ddha) D <char-0x0daa> " ඪ - mahaapraana ddayanna (ddha)
N <char-0x0dab> " ණ - muurdhaja nayanna (nna) N <char-0x0dab> " ණ - muurdhaja nayanna (nna)
<A-d> <char-0x0dac> " ඬ - sanyaka ddayanna (nndda) x <char-0x0dac> " ඬ - sanyaka ddayanna (nndda)
<A-t> <char-0x0dad> " ත - alpapraana tayanna (ta) <A-t> <char-0x0dad> " ත - alpapraana tayanna (ta)
<A-T> <char-0x0dae> " ථ - mahaapraana tayanna (tha) <A-T> <char-0x0dae> " ථ - mahaapraana tayanna (tha)
x <char-0x0daf> " ද - alpapraana dayanna (da) <A-d> <char-0x0daf> " ද - alpapraana dayanna (da)
X <char-0x0db0> " ධ - mahaapraana dayanna (dha) <A-D> <char-0x0db0> " ධ - mahaapraana dayanna (dha)
n <char-0x0db1> " න - dantaja nayanna (na) n <char-0x0db1> " න - dantaja nayanna (na)
<A-x> <char-0x0db3> " ඳ - sanyaka dayanna (nda) X <char-0x0db3> " ඳ - sanyaka dayanna (nda)
p <char-0x0db4> " ප - alpapraana payanna (pa) p <char-0x0db4> " ප - alpapraana payanna (pa)
P <char-0x0db5> " ඵ - mahaapraana payanna (pha) P <char-0x0db5> " ඵ - mahaapraana payanna (pha)
b <char-0x0db6> " බ - alpapraana bayanna (ba) b <char-0x0db6> " බ - alpapraana bayanna (ba)
@ -102,5 +103,5 @@ Y <char-0x0dca><char-0x200d><char-0x0dba> " ්‍ය - yansaya
<A-\> <char-0x0dca><char-0x200d> " join - conjunct letters cons 0DCA 200D cons <A-\> <char-0x0dca><char-0x200d> " join - conjunct letters cons 0DCA 200D cons
<A-|> <char-0x200d> " touch - ZWJ <A-|> <char-0x200d> " touch - ZWJ
"<S-space> <char-0x00a0> " - no-break space. <S-space> didn't work. <S-space> <char-0x00a0> " - no-break space. <S-space> didn't work.
<C-space> <char-0x200c> " - ZWNJ. <A-space> doesn't work! <C-space> <char-0x200c> " - ZWNJ. <A-space> doesn't work!

View File

@ -0,0 +1,3 @@
" Vim Keymap file for Sinhala (Sri Lanka)
"
source <sfile>:p:h/sinhala-phonetic_utf-8.vim

View File

@ -1,6 +1,6 @@
" Script to define the syntax menu in synmenu.vim " Script to define the syntax menu in synmenu.vim
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2004 Sep 11 " Last Change: 2004 Nov 20
" This is used by "make menu" in the src directory. " This is used by "make menu" in the src directory.
edit <sfile>:p:h/synmenu.vim edit <sfile>:p:h/synmenu.vim
@ -366,6 +366,7 @@ SynMenu Sh-S.Shell\ script.csh:csh
SynMenu Sh-S.Shell\ script.tcsh:tcsh SynMenu Sh-S.Shell\ script.tcsh:tcsh
SynMenu Sh-S.Shell\ script.zsh:zsh SynMenu Sh-S.Shell\ script.zsh:zsh
SynMenu Sh-S.SiCAD:sicad SynMenu Sh-S.SiCAD:sicad
SynMenu Sh-S.Sieve:sieve
SynMenu Sh-S.Simula:simula SynMenu Sh-S.Simula:simula
SynMenu Sh-S.Sinda.Sinda\ compare:sindacmp SynMenu Sh-S.Sinda.Sinda\ compare:sindacmp
SynMenu Sh-S.Sinda.Sinda\ input:sinda SynMenu Sh-S.Sinda.Sinda\ input:sinda
@ -423,6 +424,7 @@ SynMenu TUV.TeX.Texinfo:texinfo
SynMenu TUV.TF\ mud\ client:tf SynMenu TUV.TF\ mud\ client:tf
SynMenu TUV.Tidy\ configuration:tidy SynMenu TUV.Tidy\ configuration:tidy
SynMenu TUV.Tilde:tilde SynMenu TUV.Tilde:tilde
SynMenu TUV.TPP:tpp
SynMenu TUV.Trasys\ input:trasys SynMenu TUV.Trasys\ input:trasys
SynMenu TUV.TSS.Command\ Line:tsscl SynMenu TUV.TSS.Command\ Line:tsscl
SynMenu TUV.TSS.Geometry:tssgm SynMenu TUV.TSS.Geometry:tssgm

View File

@ -2,7 +2,7 @@
" You can also use this as a start for your own set of menus. " You can also use this as a start for your own set of menus.
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2004 Sep 16 " Last Change: 2004 Dec 04
" Note that ":an" (short for ":anoremenu") is often used to make a menu work " Note that ":an" (short for ":anoremenu") is often used to make a menu work
" in all modes and avoid side effects from mappings defined by the user. " in all modes and avoid side effects from mappings defined by the user.
@ -785,9 +785,37 @@ inoremenu <script> 1.40 PopUp.&Paste <SID>iPaste
vnoremenu 1.50 PopUp.&Delete x vnoremenu 1.50 PopUp.&Delete x
an 1.55 PopUp.-SEP2- <Nop> an 1.55 PopUp.-SEP2- <Nop>
vnoremenu 1.60 PopUp.Select\ Blockwise <C-V> vnoremenu 1.60 PopUp.Select\ Blockwise <C-V>
an 1.70 PopUp.Select\ &Word vaw
an 1.80 PopUp.Select\ &Line V nnoremenu 1.70 PopUp.Select\ &Word vaw
an 1.90 PopUp.Select\ &Block <C-V> onoremenu 1.70 PopUp.Select\ &Word aw
vnoremenu 1.70 PopUp.Select\ &Word <C-C>vaw
inoremenu 1.70 PopUp.Select\ &Word <C-O>vaw
cnoremenu 1.70 PopUp.Select\ &Word <C-C>vaw
nnoremenu 1.73 PopUp.Select\ &Sentence vas
onoremenu 1.73 PopUp.Select\ &Sentence as
vnoremenu 1.73 PopUp.Select\ &Sentence <C-C>vas
inoremenu 1.73 PopUp.Select\ &Sentence <C-O>vas
cnoremenu 1.73 PopUp.Select\ &Sentence <C-C>vas
nnoremenu 1.77 PopUp.Select\ Pa&ragraph vap
onoremenu 1.77 PopUp.Select\ Pa&ragraph ap
vnoremenu 1.77 PopUp.Select\ Pa&ragraph <C-C>vap
inoremenu 1.77 PopUp.Select\ Pa&ragraph <C-O>vap
cnoremenu 1.77 PopUp.Select\ Pa&ragraph <C-C>vap
nnoremenu 1.80 PopUp.Select\ &Line V
onoremenu 1.80 PopUp.Select\ &Line <C-C>V
vnoremenu 1.80 PopUp.Select\ &Line <C-C>V
inoremenu 1.80 PopUp.Select\ &Line <C-O>V
cnoremenu 1.80 PopUp.Select\ &Line <C-C>V
nnoremenu 1.90 PopUp.Select\ &Block <C-V>
onoremenu 1.90 PopUp.Select\ &Block <C-C><C-V>
vnoremenu 1.90 PopUp.Select\ &Block <C-C><C-V>
inoremenu 1.90 PopUp.Select\ &Block <C-O><C-V>
cnoremenu 1.90 PopUp.Select\ &Block <C-C><C-V>
noremenu <script> <silent> 1.100 PopUp.Select\ &All :<C-U>call <SID>SelectAll()<CR> noremenu <script> <silent> 1.100 PopUp.Select\ &All :<C-U>call <SID>SelectAll()<CR>
inoremenu <script> <silent> 1.100 PopUp.Select\ &All <C-O>:call <SID>SelectAll()<CR> inoremenu <script> <silent> 1.100 PopUp.Select\ &All <C-O>:call <SID>SelectAll()<CR>
cnoremenu <script> <silent> 1.100 PopUp.Select\ &All <C-U>call <SID>SelectAll()<CR> cnoremenu <script> <silent> 1.100 PopUp.Select\ &All <C-U>call <SID>SelectAll()<CR>

View File

@ -1,7 +1,7 @@
" These commands create the option window. " These commands create the option window.
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2004 Jul 05 " Last Change: 2004 Dec 09
" If there already is an option window, jump to that one. " If there already is an option window, jump to that one.
if bufwinnr("option-window") > 0 if bufwinnr("option-window") > 0
@ -889,6 +889,8 @@ call append("$", "\t(global or local to buffer)")
call <SID>BinOptionG("ar", &ar) call <SID>BinOptionG("ar", &ar)
call append("$", "patchmode\tkeep oldest version of a file; specifies file name extension") call append("$", "patchmode\tkeep oldest version of a file; specifies file name extension")
call <SID>OptionG("pm", &pm) call <SID>OptionG("pm", &pm)
call append("$", "fsync\tforcibly sync the file to disk after writing it")
call <SID>BinOptionG("fs", &fs)
if !has("msdos") if !has("msdos")
call append("$", "shortname\tuse 8.3 file names") call append("$", "shortname\tuse 8.3 file names")
call append("$", "\t(local to buffer)") call append("$", "\t(local to buffer)")

View File

@ -2,14 +2,14 @@
" netrw's browsers' x command ("eXecute launcher") " netrw's browsers' x command ("eXecute launcher")
" Author: Charles E. Campbell, Jr. " Author: Charles E. Campbell, Jr.
" Date: Aug 31, 2004 " Date: Aug 31, 2004
" Version: 3a NOT RELEASED " Version: 3
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Prevent Reloading: {{{1 " Prevent Reloading: {{{1
if exists("g:loaded_netrwfilehandlers") || &cp if exists("g:loaded_netrwfilehandlers") || &cp
finish finish
endif endif
let g:loaded_netrwfilehandlers= "v3a" let g:loaded_netrwfilehandlers= "v3"
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" NetrwFileHandler_html: handles html when the user hits "x" when the {{{1 " NetrwFileHandler_html: handles html when the user hits "x" when the {{{1
@ -153,7 +153,7 @@ endfun
fun! NetrwFileHandler_pdf(pdf) fun! NetrwFileHandler_pdf(pdf)
" " call Dfunc("NetrwFileHandler_pdf(pdf<".a:pdf.">)") " " call Dfunc("NetrwFileHandler_pdf(pdf<".a:pdf.">)")
if executable("gs") if executable("gs")
exe "silent! !gs ".a:pdf exe 'silent! !gs "'.a:pdf.'"'
else else
" " call Dret("NetrwFileHandler_pdf 0") " " call Dret("NetrwFileHandler_pdf 0")
return 0 return 0
@ -168,7 +168,7 @@ endfun
fun! NetrwFileHandler_sxw(sxw) fun! NetrwFileHandler_sxw(sxw)
" " call Dfunc("NetrwFileHandler_sxw(sxw<".a:sxw.">)") " " call Dfunc("NetrwFileHandler_sxw(sxw<".a:sxw.">)")
if executable("gs") if executable("gs")
exe "silent! !gs ".a:sxw exe 'silent! !gs "'.a:sxw.'"'
else else
" " call Dret("NetrwFileHandler_sxw 0") " " call Dret("NetrwFileHandler_sxw 0")
return 0 return 0
@ -184,7 +184,7 @@ fun! NetrwFileHandler_doc(doc)
" " call Dfunc("NetrwFileHandler_doc(doc<".a:doc.">)") " " call Dfunc("NetrwFileHandler_doc(doc<".a:doc.">)")
if executable("oowriter") if executable("oowriter")
exe "silent! !oowriter ".a:doc exe 'silent! !oowriter "'.a:doc.'"'
redraw! redraw!
else else
" " call Dret("NetrwFileHandler_doc 0") " " call Dret("NetrwFileHandler_doc 0")
@ -201,7 +201,7 @@ fun! NetrwFileHandler_sxw(sxw)
" " call Dfunc("NetrwFileHandler_sxw(sxw<".a:sxw.">)") " " call Dfunc("NetrwFileHandler_sxw(sxw<".a:sxw.">)")
if executable("oowriter") if executable("oowriter")
exe "silent! !oowriter ".a:sxw exe 'silent! !oowriter "'.a:sxw.'"'
redraw! redraw!
else else
" " call Dret("NetrwFileHandler_sxw 0") " " call Dret("NetrwFileHandler_sxw 0")
@ -218,7 +218,7 @@ fun! NetrwFileHandler_xls(xls)
" " call Dfunc("NetrwFileHandler_xls(xls<".a:xls.">)") " " call Dfunc("NetrwFileHandler_xls(xls<".a:xls.">)")
if executable("oocalc") if executable("oocalc")
exe "silent! !oocalc ".a:xls exe 'silent! !oocalc "'.a:xls.'"'
redraw! redraw!
else else
" " call Dret("NetrwFileHandler_xls 0") " " call Dret("NetrwFileHandler_xls 0")

View File

@ -1,7 +1,7 @@
" netrw.vim: Handles file transfer and remote directory listing across a network " netrw.vim: Handles file transfer and remote directory listing across a network
" Last Change: Sep 14, 2004 " last change: Dec 06, 2004
" Maintainer: Charles E. Campbell, Jr. PhD <drchipNOSPAM at campbellfamily.biz> " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" Version: 51a NOT RELEASED " Version: 53
" License: Vim License (see vim's :help license) " License: Vim License (see vim's :help license)
" "
" But be doers of the Word, and not only hearers, deluding your own selves " But be doers of the Word, and not only hearers, deluding your own selves
@ -14,7 +14,7 @@
if exists("g:loaded_netrw") || &cp if exists("g:loaded_netrw") || &cp
finish finish
endif endif
let g:loaded_netrw = "v51a" let g:loaded_netrw = "v53"
let s:save_cpo = &cpo let s:save_cpo = &cpo
let loaded_explorer = 1 let loaded_explorer = 1
set cpo&vim set cpo&vim
@ -29,7 +29,11 @@ if !exists("g:netrw_win95ftp")
endif endif
if !exists("g:netrw_cygwin") if !exists("g:netrw_cygwin")
if has("win32") || has("win95") || has("win64") || has("win16") if has("win32") || has("win95") || has("win64") || has("win16")
let g:netrw_cygwin= 1 if &shell == "bash"
let g:netrw_cygwin= 1
else
let g:netrw_cygwin= 0
endif
else else
let g:netrw_cygwin= 0 let g:netrw_cygwin= 0
endif endif
@ -78,7 +82,7 @@ if !exists("g:netrw_sort_by")
let g:netrw_sort_by= "name" let g:netrw_sort_by= "name"
endif endif
if !exists("g:netrw_sort_sequence") if !exists("g:netrw_sort_sequence")
let g:netrw_sort_sequence= '/$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$' let g:netrw_sort_sequence= '[\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$'
endif endif
if !exists("g:netrw_sort_direction") if !exists("g:netrw_sort_direction")
" alternative: reverse (z y x ...) " alternative: reverse (z y x ...)
@ -117,6 +121,9 @@ endif
if !exists("g:netrw_ftp_browse_reject") if !exists("g:netrw_ftp_browse_reject")
let g:netrw_ftp_browse_reject='^total\s\+\d\+$\|^Trying\s\+\d\+.*$\|^KERBEROS_V\d rejected\|^Security extensions not\|No such file\|: connect to address [0-9a-fA-F:]*: No route to host$' let g:netrw_ftp_browse_reject='^total\s\+\d\+$\|^Trying\s\+\d\+.*$\|^KERBEROS_V\d rejected\|^Security extensions not\|No such file\|: connect to address [0-9a-fA-F:]*: No route to host$'
endif endif
if !exists("g:netrw_ssh_browse_reject")
let g:netrw_ssh_browse_reject='^total\s\+\d\+$'
endif
if !exists("g:netrw_keepdir") if !exists("g:netrw_keepdir")
let g:netrw_keepdir= 1 let g:netrw_keepdir= 1
endif endif
@ -143,6 +150,12 @@ endif
if !exists("g:netrw_maxfilenamelen") if !exists("g:netrw_maxfilenamelen")
let g:netrw_maxfilenamelen= 32 let g:netrw_maxfilenamelen= 32
endif endif
if !exists("g:netrw_dirhistmax")
let g:netrw_dirhistmax= 10
endif
if !exists("g:NETRW_DIRHIST_CNT")
let g:NETRW_DIRHIST_CNT= 0
endif
" BufEnter event ignored by decho when following variable is true " BufEnter event ignored by decho when following variable is true
" Has a side effect that doau BufReadPost doesn't work, so " Has a side effect that doau BufReadPost doesn't work, so
@ -218,7 +231,6 @@ if version >= 600
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<afile>")|exe "Nread " .expand("<afile>")|exe "silent doau BufReadPost ".expand("<afile>") au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<afile>")|exe "Nread " .expand("<afile>")|exe "silent doau BufReadPost ".expand("<afile>")
au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<afile>")|exe "Nwrite " .expand("<afile>")|exe "silent doau BufWritePost ".expand("<afile>") au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<afile>")|exe "Nwrite " .expand("<afile>")|exe "silent doau BufWritePost ".expand("<afile>")
au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<afile>")|exe "'[,']Nwrite " .expand("<afile>")|exe "silent doau BufWritePost ".expand("<afile>") au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<afile>")|exe "'[,']Nwrite " .expand("<afile>")|exe "silent doau BufWritePost ".expand("<afile>")
" au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* if exists("vcount")|call Decho("vcount=".vcount)|else|call Decho("no vcount")|endif
augroup END augroup END
endif endif
@ -335,6 +347,7 @@ fun! s:NetRead(...)
if ichoice > a:0 if ichoice > a:0
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr "Unbalanced string in filename '". wholechoice ."'" echoerr "Unbalanced string in filename '". wholechoice ."'"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
" call Dret("NetRead") " call Dret("NetRead")
return return
@ -363,7 +376,7 @@ fun! s:NetRead(...)
" Check if NetBrowse() should be handling this request " Check if NetBrowse() should be handling this request
" call Decho("checking if netlist: choice<".choice."> netrw_list_cmd<".g:netrw_list_cmd.">") " call Decho("checking if netlist: choice<".choice."> netrw_list_cmd<".g:netrw_list_cmd.">")
if choice =~ "^.*/$" if choice =~ "^.*[\/]$"
keepjumps call s:NetBrowse(choice) keepjumps call s:NetBrowse(choice)
" call Dret("NetRead") " call Dret("NetRead")
return return
@ -421,6 +434,7 @@ fun! s:NetRead(...)
let debugkeep= &debug let debugkeep= &debug
set debug=msg set debug=msg
echoerr getline(1) echoerr getline(1)
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &debug= debugkeep let &debug= debugkeep
endif endif
bd! bd!
@ -466,6 +480,7 @@ fun! s:NetRead(...)
" call Decho("error<".getline(1).">") " call Decho("error<".getline(1).">")
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr getline(1) echoerr getline(1)
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
endif endif
bd! bd!
@ -498,6 +513,7 @@ fun! s:NetRead(...)
if g:netrw_http_cmd == "" if g:netrw_http_cmd == ""
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr "neither wget nor fetch command is available" echoerr "neither wget nor fetch command is available"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
exit exit
endif endif
@ -575,6 +591,7 @@ fun! s:NetRead(...)
if g:netrw_fetch_cmd == "" if g:netrw_fetch_cmd == ""
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr "fetch command not available" echoerr "fetch command not available"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
exit exit
endif endif
@ -639,14 +656,14 @@ fun! s:NetGetFile(readcmd, fname, method)
let line2= line("$") let line2= line("$")
endif endif
" transform paths from / to \ for Windows, unless the shell is bash " transform paths from / to \ for Windows (except for cygwin)
if &term == "win32" if &term == "win32"
if &shell == "bash" if g:netrw_cygwin
let fname=a:fname let fname= a:fname
" call Decho("(win32 && bash) fname<".fname.">") " call Decho("(win32 && cygwin) fname<".fname.">")
else else
let fname=substitute(a:fname,'/','\\\\','ge') let fname= substitute(a:fname,'/','\\\\','ge')
" call Decho("(win32 && !bash) fname<".fname.">") " call Decho("(win32 && !cygwin) fname<".fname.">")
endif endif
else else
let fname= a:fname let fname= a:fname
@ -802,6 +819,7 @@ fun! s:NetWrite(...) range
if choice > a:0 if choice > a:0
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr "Unbalanced string in filename '". wholechoice ."'" echoerr "Unbalanced string in filename '". wholechoice ."'"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
" call Dret("NetWrite") " call Dret("NetWrite")
return return
@ -872,6 +890,7 @@ fun! s:NetWrite(...) range
if getline(1) !~ "^$" if getline(1) !~ "^$"
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr getline(1) echoerr getline(1)
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
let mod=1 let mod=1
endif endif
@ -911,6 +930,7 @@ fun! s:NetWrite(...) range
if getline(1) !~ "^$" if getline(1) !~ "^$"
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr getline(1) echoerr getline(1)
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
let mod=1 let mod=1
endif endif
@ -939,6 +959,7 @@ fun! s:NetWrite(...) range
elseif b:netrw_method == 5 elseif b:netrw_method == 5
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr "***warning*** currently <netrw.vim> does not support writing using http:" echoerr "***warning*** currently <netrw.vim> does not support writing using http:"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
"......................................... ".........................................
@ -1035,6 +1056,7 @@ fun! <SID>NetBrowse(dirname)
if !executable("ftp") if !executable("ftp")
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr "***netrw*** this system doesn't support remote directory listing via ftp" echoerr "***netrw*** this system doesn't support remote directory listing via ftp"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
" call Dret("NetBrowse") " call Dret("NetBrowse")
return return
@ -1042,6 +1064,7 @@ fun! <SID>NetBrowse(dirname)
elseif !exists("g:netrw_list_cmd") || g:netrw_list_cmd == '' elseif !exists("g:netrw_list_cmd") || g:netrw_list_cmd == ''
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr "***netrw*** this system doesn't support remote directory listing via ssh" echoerr "***netrw*** this system doesn't support remote directory listing via ssh"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
" call Dret("NetBrowse") " call Dret("NetBrowse")
return return
@ -1052,20 +1075,22 @@ fun! <SID>NetBrowse(dirname)
" analyze a:dirname and g:netrw_list_cmd " analyze a:dirname and g:netrw_list_cmd
let dirpat = '^\(\w\{-}\)://\(\w\+@\)\=\([^/]\+\)/\(.*\)$' let dirpat = '^\(\w\{-}\)://\(\w\+@\)\=\([^/]\+\)/\(.*\)$'
let dirname = substitute(a:dirname,'\\','/','ge')
" call Decho("dirpat<".dirpat.">") " call Decho("dirpat<".dirpat.">")
if a:dirname !~ dirpat if dirname !~ dirpat
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr "NetBrowse: I don't understand your dirname<".a:dirname.">" echoerr "NetBrowse: I don't understand your dirname<".dirname.">"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
" call Dret("NetBrowse : badly formatted dirname<".a:dirname.">") " call Dret("NetBrowse : badly formatted dirname<".dirname.">")
return return
endif endif
let method = substitute(a:dirname,dirpat,'\1','') let method = substitute(dirname,dirpat,'\1','')
let user = substitute(a:dirname,dirpat,'\2','') let user = substitute(dirname,dirpat,'\2','')
let machine = substitute(a:dirname,dirpat,'\3','') let machine = substitute(dirname,dirpat,'\3','')
let path = substitute(a:dirname,dirpat,'\4','') let path = substitute(dirname,dirpat,'\4','')
let fname = substitute(a:dirname,'^.*/\ze.','','') let fname = substitute(dirname,'^.*/\ze.','','')
" call Decho("set up method <".method .">") " call Decho("set up method <".method .">")
" call Decho("set up user <".user .">") " call Decho("set up user <".user .">")
" call Decho("set up machine<".machine.">") " call Decho("set up machine<".machine.">")
@ -1087,6 +1112,7 @@ fun! <SID>NetBrowse(dirname)
" optionally sort by time (-t) or by size (-S) " optionally sort by time (-t) or by size (-S)
if listcmd == "dir" && g:netrw_sort_by =~ "^[ts]" if listcmd == "dir" && g:netrw_sort_by =~ "^[ts]"
echoerr "***warning*** windows' ftp doesn't support time/size sorts (get cygwin, set g:netrw_cygwin)" echoerr "***warning*** windows' ftp doesn't support time/size sorts (get cygwin, set g:netrw_cygwin)"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
else else
if g:netrw_sort_by =~ "^t" if g:netrw_sort_by =~ "^t"
let listcmd= listcmd."t" let listcmd= listcmd."t"
@ -1102,14 +1128,14 @@ fun! <SID>NetBrowse(dirname)
" call Decho("set up listcmd<".listcmd.">") " call Decho("set up listcmd<".listcmd.">")
if fname =~ '@$' && fname !~ '^"' if fname =~ '@$' && fname !~ '^"'
" call Decho("attempt transfer of symlink as file") " call Decho("attempt transfer of symlink as file")
call s:NetBrowse(substitute(a:dirname,'@$','','e')) call s:NetBrowse(substitute(dirname,'@$','','e'))
redraw! redraw!
" call Dret("NetBrowse : symlink") " call Dret("NetBrowse : symlink")
return return
elseif fname !~ '/$' && fname !~ '^"' elseif fname !~ '[\/]$' && fname !~ '^"'
" looks like a regular file, attempt transfer " looks like a regular file, attempt transfer
" call Decho("attempt transfer as regular file<".a:dirname.">") " call Decho("attempt transfer as regular file<".dirname.">")
" remove any filetype indicator from end of dirname, except for the " remove any filetype indicator from end of dirname, except for the
" "this is a directory" indicator (/). There shouldn't be one of those, " "this is a directory" indicator (/). There shouldn't be one of those,
@ -1157,7 +1183,10 @@ fun! <SID>NetBrowse(dirname)
" call Decho("exe file ".escape(bufname,s:netrw_cd_escape)) " call Decho("exe file ".escape(bufname,s:netrw_cd_escape))
exe 'file '.escape(bufname,s:netrw_cd_escape) exe 'file '.escape(bufname,s:netrw_cd_escape)
" call Decho("renaming file to bufname<".bufname.">") " call Decho("renaming file to bufname<".bufname.">")
setlocal bh=hide nobl setlocal bh=hide nobl nonu
" save current directory on directory history list
call <SID>NetBookmarkDir(3,expand("%"))
" set up buffer-local mappings " set up buffer-local mappings
" call Decho("set up buffer-local mappings") " call Decho("set up buffer-local mappings")
@ -1174,6 +1203,8 @@ fun! <SID>NetBrowse(dirname)
nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr> nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<bar>call <SID>NetRestoreWordPosn()<cr> nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<bar>call <SID>NetRestoreWordPosn()<cr>
nnoremap <buffer> <silent> S :call <SID>NetSortSequence(0)<cr> nnoremap <buffer> <silent> S :call <SID>NetSortSequence(0)<cr>
nnoremap <buffer> <silent> u :<c-u>call <SID>NetBookmarkDir(4,expand("%"))<cr>
nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,expand("%"))<cr>
nnoremap <buffer> <silent> v :exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr> nnoremap <buffer> <silent> v :exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
nnoremap <buffer> <silent> x :exe "norm! 0"<bar>call <SID>NetBrowseX(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()),1)<cr> nnoremap <buffer> <silent> x :exe "norm! 0"<bar>call <SID>NetBrowseX(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()),1)<cr>
nnoremap <buffer> <silent> <2-leftmouse> :exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr> nnoremap <buffer> <silent> <2-leftmouse> :exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
@ -1185,7 +1216,7 @@ fun! <SID>NetBrowse(dirname)
exe 'nnoremap <buffer> <silent> R :exe "norm! 0"<bar>call <SID>NetBrowseRename("'.user.machine.'","'.path.'")<cr>' exe 'nnoremap <buffer> <silent> R :exe "norm! 0"<bar>call <SID>NetBrowseRename("'.user.machine.'","'.path.'")<cr>'
exe 'vnoremap <buffer> <silent> R :call <SID>NetBrowseRename("'.user.machine.'","'.path.'")<cr>' exe 'vnoremap <buffer> <silent> R :call <SID>NetBrowseRename("'.user.machine.'","'.path.'")<cr>'
nnoremap <buffer> ? :he netrw-browse-cmds<cr> nnoremap <buffer> ? :he netrw-browse-cmds<cr>
setlocal ma setlocal ma nonu
" Set up the banner " Set up the banner
" call Decho("set up the banner: sortby<".g:netrw_sort_by."> method<".method.">") " call Decho("set up the banner: sortby<".g:netrw_sort_by."> method<".method.">")
@ -1209,9 +1240,9 @@ fun! <SID>NetBrowse(dirname)
endif endif
if g:netrw_list_hide != "" && g:netrw_hide if g:netrw_list_hide != "" && g:netrw_hide
if g:netrw_hide == 1 if g:netrw_hide == 1
keepjumps put ='\" Hiding: '.g:netrw_list_hide keepjumps put ='\" Hiding: '.g:netrw_list_hide
else else
keepjumps put ='\" Showing: '.g:netrw_list_hide keepjumps put ='\" Showing: '.g:netrw_list_hide
endif endif
let s:netrw_bannercnt= s:netrw_bannercnt + 1 let s:netrw_bannercnt= s:netrw_bannercnt + 1
endif endif
@ -1232,10 +1263,11 @@ fun! <SID>NetBrowse(dirname)
" shorten the listing " shorten the listing
" call Decho("generate short listing") " call Decho("generate short listing")
exe "keepjumps ".s:netrw_bannercnt exe "keepjumps ".s:netrw_bannercnt
" cleanup " cleanup
while getline(".") =~ g:netrw_ftp_browse_reject if g:netrw_ftp_browse_reject != ""
keepjumps d exe "silent! g/".g:netrw_ftp_browse_reject."/keepjumps d"
endwhile endif
" if there's no ../ listed, then put ./ and ../ in " if there's no ../ listed, then put ./ and ../ in
let line1= line(".") let line1= line(".")
@ -1262,6 +1294,10 @@ fun! <SID>NetBrowse(dirname)
" call Decho("exe silent r! ".listcmd." ".shq.escape(path,s:netrw_cd_escape).shq) " call Decho("exe silent r! ".listcmd." ".shq.escape(path,s:netrw_cd_escape).shq)
exe "silent r! ".listcmd." ".shq.escape(path,s:netrw_cd_escape).shq exe "silent r! ".listcmd." ".shq.escape(path,s:netrw_cd_escape).shq
keepjumps 1d keepjumps 1d
" cleanup
if g:netrw_ftp_browse_reject != ""
exe "silent! g/".g:netrw_ssh_browse_reject."/keepjumps d"
endif
endif endif
" manipulate the directory listing (hide, sort) " manipulate the directory listing (hide, sort)
@ -1299,19 +1335,22 @@ fun! <SID>NetBrowse(dirname)
exe s:netrw_bannercnt exe s:netrw_bannercnt
endif endif
if g:netrw_sort_by =~ "^n" if line("$") >= s:netrw_bannercnt
call s:SetSort() if g:netrw_sort_by =~ "^n"
exe 'keepjumps silent '.s:netrw_bannercnt.',$call s:NetSort()' call s:SetSort()
exe 'keepjumps silent '.s:netrw_bannercnt.',$s/^\d\{3}\///e' exe 'keepjumps silent '.s:netrw_bannercnt.',$call s:NetSort()'
endif exe 'keepjumps silent '.s:netrw_bannercnt.',$s/^\d\{3}\///e'
if g:netrw_longlist endif
" shorten the list to keep its width <= 80 characters if g:netrw_longlist
exe "keepjumps silent ".s:netrw_bannercnt.',$s/\t[-dstrwx]\+/\t/e' " shorten the list to keep its width <= 80 characters
exe "keepjumps silent ".s:netrw_bannercnt.',$s/\t[-dstrwx]\+/\t/e'
endif
endif endif
endif endif
exe "keepjumps ".s:netrw_bannercnt exe "keepjumps ".s:netrw_bannercnt
setlocal nomod setlocal nomod
setlocal noma setlocal noma
setlocal nonu
" call Dret("NetBrowse") " call Dret("NetBrowse")
return return
@ -1325,7 +1364,7 @@ fun! <SID>NetBrowseChgDir(dirname,newdir)
let dirname= a:dirname let dirname= a:dirname
let newdir = a:newdir let newdir = a:newdir
if newdir !~ '/$' if newdir !~ '[\/]$'
" handling a file " handling a file
let dirname= dirname.newdir let dirname= dirname.newdir
" call Decho("handling a file: dirname<".dirname.">") " call Decho("handling a file: dirname<".dirname.">")
@ -1394,7 +1433,7 @@ fun! <SID>NetBrowseRm(usrhost,path) range
let rmfile= s:NetGetWord() let rmfile= s:NetGetWord()
" call Decho("rmfile<".rmfile.">") " call Decho("rmfile<".rmfile.">")
if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '/$') if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '[\/]$')
" attempt to remove file " attempt to remove file
if !all if !all
echohl Statement echohl Statement
@ -1445,13 +1484,14 @@ fun! <SID>NetBrowseRm(usrhost,path) range
" call Decho("returned=".ret." errcode=".v:shell_error) " call Decho("returned=".ret." errcode=".v:shell_error)
if v:shell_error != 0 if v:shell_error != 0
let netrw_rmf_cmd= substitute(g:netrw_rmf_cmd,'HOSTNAME',a:usrhost,'').' '.substitute(rmfile,'/$','','e') let netrw_rmf_cmd= substitute(g:netrw_rmf_cmd,'HOSTNAME',a:usrhost,'').' '.substitute(rmfile,'[\/]$','','e')
" call Decho("2nd attempt to remove dir: system(".netrw_rmf_cmd.")") " call Decho("2nd attempt to remove dir: system(".netrw_rmf_cmd.")")
let ret= system(netrw_rmf_cmd) let ret= system(netrw_rmf_cmd)
" call Decho("returned=".ret." errcode=".v:shell_error) " call Decho("returned=".ret." errcode=".v:shell_error)
if v:shell_error != 0 && !exists("g:netrw_quiet") if v:shell_error != 0 && !exists("g:netrw_quiet")
echoerr "unable to remove directory<".rmfile."> -- is it empty?" echoerr "unable to remove directory<".rmfile."> -- is it empty?"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
endif endif
endif endif
@ -1817,6 +1857,7 @@ fun! <SID>NetMakeDir(usrhost)
if isdirectory(fullnewdir) if isdirectory(fullnewdir)
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr "***warning*** <".newdirname."> is already a directory!" echoerr "***warning*** <".newdirname."> is already a directory!"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
" call Dret("NetMakeDir : directory<".newdirname."> exists previously") " call Dret("NetMakeDir : directory<".newdirname."> exists previously")
return return
@ -1824,6 +1865,7 @@ fun! <SID>NetMakeDir(usrhost)
if filereadable(fullnewdir) if filereadable(fullnewdir)
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr "***warning*** <".newdirname."> is already a file!" echoerr "***warning*** <".newdirname."> is already a file!"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
" call Dret("NetMakeDir : file<".newdirname."> exists previously") " call Dret("NetMakeDir : file<".newdirname."> exists previously")
return return
@ -1846,6 +1888,7 @@ fun! <SID>NetMakeDir(usrhost)
exe linenum exe linenum
elseif !exists("g:netrw_quiet") elseif !exists("g:netrw_quiet")
echoerr "***warning*** unable to make directory<".newdirname.">" echoerr "***warning*** unable to make directory<".newdirname.">"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
redraw! redraw!
@ -1865,6 +1908,7 @@ fun! <SID>NetMakeDir(usrhost)
exe linenum exe linenum
elseif !exists("g:netrw_quiet") elseif !exists("g:netrw_quiet")
echoerr "***warning*** unable to make directory<".newdirname.">" echoerr "***warning*** unable to make directory<".newdirname.">"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
redraw! redraw!
endif endif
@ -1896,17 +1940,71 @@ fun! <SID>NetBookmarkDir(chg,curdir)
echomsg "Sorry, bookmark#".v:count." doesn't exist!" echomsg "Sorry, bookmark#".v:count." doesn't exist!"
endif endif
elseif exists("g:NETRW_BOOKMARKMAX") elseif a:chg == 2
" list bookmarks if exists("g:NETRW_BOOKMARKMAX")
" call Decho("list bookmarks [0,".g:NETRW_BOOKMARKMAX."]") " list user's bookmarks
let cnt= 0 " call Decho("list bookmarks [0,".g:NETRW_BOOKMARKMAX."]")
while cnt <= g:NETRW_BOOKMARKMAX let cnt= 0
if exists("g:NETRW_BOOKMARKDIR_{cnt}") while cnt <= g:NETRW_BOOKMARKMAX
echo "Netrw Bookmark#".cnt.": ".g:NETRW_BOOKMARKDIR_{cnt} if exists("g:NETRW_BOOKMARKDIR_{cnt}")
" call Decho("Netrw Bookmark#".cnt.": ".g:NETRW_BOOKMARKDIR_{cnt}) " call Decho("Netrw Bookmark#".cnt.": ".g:NETRW_BOOKMARKDIR_{cnt})
echo "Netrw Bookmark#".cnt.": ".g:NETRW_BOOKMARKDIR_{cnt}
endif
let cnt= cnt + 1
endwhile
endif
" list directory history
let cnt = g:NETRW_DIRHIST_CNT
let first = 1
let histcnt = 0
while ( first || cnt != g:NETRW_DIRHIST_CNT )
" call Decho("first=".first." cnt=".cnt." dirhist_cnt=".g:NETRW_DIRHIST_CNT)
let histcnt= histcnt + 1
if exists("g:NETRW_DIRHIST_{cnt}")
" call Decho("Netrw History#".histcnt.": ".g:NETRW_DIRHIST_{cnt})
echo "Netrw History#".histcnt.": ".g:NETRW_DIRHIST_{cnt}
endif
let first = 0
let cnt = ( cnt - 1 ) % g:netrw_dirhistmax
if cnt < 0
let cnt= cnt + g:netrw_dirhistmax
endif endif
let cnt= cnt + 1
endwhile endwhile
elseif a:chg == 3
" saves most recently visited directories
let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT + 1 ) % g:netrw_dirhistmax
let g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}= substitute(a:curdir,'[/\\]$','','e')
" call Decho("save dirhist#".g:NETRW_DIRHIST_CNT."<".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}.">")
elseif a:chg == 4
" u: change to the previous directory stored on the history list
let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT - 1 ) % g:netrw_dirhistmax
if g:NETRW_DIRHIST_CNT < 0
let g:NETRW_DIRHIST_CNT= g:NETRW_DIRHIST_CNT + g:netrw_dirhistmax
endif
if exists("g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}")
" call Decho("changedir u#".g:NETRW_DIRHIST_CNT."<".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}.">")
exe "e ".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}
else
let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT + 1 ) % g:netrw_dirhistmax
echo "Sorry, no predecessor directory exists yet"
endif
elseif a:chg == 5
" U: change to the subsequent directory stored on the history list
let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT + 1 ) % g:netrw_dirhistmax
if exists("g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}")
" call Decho("changedir U#".g:NETRW_DIRHIST_CNT."<".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}.">")
exe "e ".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}
else
let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT - 1 ) % g:netrw_dirhistmax
if g:NETRW_DIRHIST_CNT < 0
let g:NETRW_DIRHIST_CNT= g:NETRW_DIRHIST_CNT + g:netrw_dirhistmax
endif
echo "Sorry, no successor directory exists yet"
endif
endif endif
" call Dret("NetBookmarkDir") " call Dret("NetBookmarkDir")
endfun endfun
@ -1933,6 +2031,7 @@ fun! <SID>LocalBrowse(dirname)
if v:version < 603 if v:version < 603
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr "vim version<".v:version."> too old for browsing with netrw" echoerr "vim version<".v:version."> too old for browsing with netrw"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
" call Dret("LocalBrowse : vim version<".v:version."> too old") " call Dret("LocalBrowse : vim version<".v:version."> too old")
return return
@ -1941,8 +2040,7 @@ fun! <SID>LocalBrowse(dirname)
" record and change current directory " record and change current directory
let netrw_origdir= s:NetGetcwd(1) let netrw_origdir= s:NetGetcwd(1)
exe 'cd '.escape(substitute(a:dirname,'\\','/','ge'),s:netrw_cd_escape) exe 'cd '.escape(substitute(a:dirname,'\\','/','ge'),s:netrw_cd_escape)
let dirname= s:NetGetcwd(0) " call Decho("dirname<".a:dirname."> buf#".bufnr("%")." winnr=".winnr())
" call Decho("dirname<".dirname."> buf#".bufnr("%")." winnr=".winnr())
" make this buffer modifiable " make this buffer modifiable
setlocal ma setlocal ma
@ -1951,12 +2049,17 @@ fun! <SID>LocalBrowse(dirname)
" Perform Directory Listing: " Perform Directory Listing:
" call Decho("Perform directory listing...") " call Decho("Perform directory listing...")
" set up new buffer and map " set up new buffer and map
" remove the trailing "/" " dirname : current working directory, no escapes, has trailing /
let dirnamens= substitute(dirname,'/$','','e') " dirnamens : dirname, but with no trailing slash
let dirnamenr= bufnr(dirnamens.'$') " dirnamenr : buffer number containing dirnamens
" dirnamebuf: buffer's idea of dirname, with all \ -> /
let dirname = s:NetGetcwd(0)
let dirnamens = substitute(dirname,'[\/]$','','e')
let dirnamenr = bufnr(dirnamens.'$')
let dirnamebuf = substitute(bufname(dirnamenr),'\\','/','ge')
" call Decho("dirnamenr= bufnr(".dirnamens.")=".dirnamenr." bufname(".dirnamenr.")=".bufname(dirnamenr)) " call Decho("dirnamenr= bufnr(".dirnamens.")=".dirnamenr." bufname(".dirnamenr.")=".bufname(dirnamenr))
if dirnamenr != 0 && bufname(dirnamenr) != dirnamens if dirnamenr != 0 && dirnamebuf != dirnamens
" try keeping the trailing slash " try keeping the trailing slash
let dirnamenr = bufnr(dirname.'$') let dirnamenr = bufnr(dirname.'$')
" call Decho("dirnamenr= bufnr(".dirname.")=".dirnamenr." bufname(".dirnamenr.")=".bufname(dirnamenr)." (retry with /)") " call Decho("dirnamenr= bufnr(".dirname.")=".dirnamenr." bufname(".dirnamenr.")=".bufname(dirnamenr)." (retry with /)")
@ -1967,7 +2070,7 @@ fun! <SID>LocalBrowse(dirname)
" call Decho("buffer already exists: dirnamenr=".dirnamenr." dirname<".dirname."> pre-exists") " call Decho("buffer already exists: dirnamenr=".dirnamenr." dirname<".dirname."> pre-exists")
" call Dredir("ls!") " call Dredir("ls!")
exe "b ".dirnamenr exe "b ".dirnamenr
exe 'silent! cd '.escape(substitute(a:dirname,'\\','/','ge'),s:netrw_cd_escape) exe 'silent! cd '.escape(dirname,s:netrw_cd_escape)
" call Decho("changed directory to<".dirname.">") " call Decho("changed directory to<".dirname.">")
if a:dirname != "." && line("$") >= 5 && exists("b:netrw_curdir") if a:dirname != "." && line("$") >= 5 && exists("b:netrw_curdir")
if b:netrw_curdir == dirname if b:netrw_curdir == dirname
@ -1980,11 +2083,13 @@ fun! <SID>LocalBrowse(dirname)
" call Decho("buffer name<".bufname("%")."> dirname<".dirname.">") " call Decho("buffer name<".bufname("%")."> dirname<".dirname.">")
setlocal ma setlocal ma
keepjumps %d keepjumps %d
if expand("%") != dirname let curdir= substitute(substitute(expand("%"),'\\','/','ge'),'[^/]$','&/','e')
if curdir != dirname
" set standard browser options on buffer " set standard browser options on buffer
setlocal bt=nofile bh=hide nobl noswf setlocal bt=nofile bh=hide nobl noswf
exe "setlocal ts=".g:netrw_maxfilenamelen exe "setlocal ts=".g:netrw_maxfilenamelen
exe 'silent! file '.escape(dirname,s:netrw_cd_escape) exe 'silent file '.escape(dirname,s:netrw_cd_escape)
" call Decho("errmsg1<".v:errmsg.">")
" call Decho("renamed buffer to<".escape(dirname,s:netrw_cd_escape).">") " call Decho("renamed buffer to<".escape(dirname,s:netrw_cd_escape).">")
" call Decho("yielding actual bufname<".bufname("%").">") " call Decho("yielding actual bufname<".bufname("%").">")
endif endif
@ -1992,10 +2097,11 @@ fun! <SID>LocalBrowse(dirname)
" call Decho("generate new buffer named<".escape(dirname,' #').">") " call Decho("generate new buffer named<".escape(dirname,' #').">")
silent! enew! silent! enew!
" set standard browser options on buffer " set standard browser options on buffer
setlocal bt=nofile bh=hide nobl noswf setlocal bt=nofile bh=hide nobl noswf nonu
exe "setlocal ts=".g:netrw_maxfilenamelen exe "setlocal ts=".g:netrw_maxfilenamelen
exe 'silent! file '.substitute(escape(dirname,s:netrw_cd_escape),'/$','','e') exe 'silent file '.substitute(escape(dirname,s:netrw_cd_escape),'[\/]$','','e')
" call Decho("renamed buffer to<".substitute(escape(dirname,s:netrw_cd_escape),'/$','','e').">") " call Decho("errmsg2<".v:errmsg.">")
" call Decho("renamed buffer to<".substitute(escape(dirname,s:netrw_cd_escape),'[\/]$','','e').">")
" call Decho("yielding actual bufname<".bufname("%").">") " call Decho("yielding actual bufname<".bufname("%").">")
endif endif
if bufname("#") == "" && bufnr("#") != -1 if bufname("#") == "" && bufnr("#") != -1
@ -2004,6 +2110,9 @@ fun! <SID>LocalBrowse(dirname)
exe bufnr("#")."bwipe" exe bufnr("#")."bwipe"
endif endif
" save current directory on directory history list
call <SID>NetBookmarkDir(3,s:NetGetcwd(0))
" set up all the maps " set up all the maps
" call Decho("Setting up local browser maps") " call Decho("Setting up local browser maps")
let b:netrw_curdir= s:NetGetcwd(1) let b:netrw_curdir= s:NetGetcwd(1)
@ -2023,6 +2132,8 @@ fun! <SID>LocalBrowse(dirname)
nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<cr> nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<cr>
nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<bar>call <SID>NetRestoreWordPosn()<cr> nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<bar>call <SID>NetRestoreWordPosn()<cr>
nnoremap <buffer> <silent> S :call <SID>NetSortSequence(1)<cr> nnoremap <buffer> <silent> S :call <SID>NetSortSequence(1)<cr>
nnoremap <buffer> <silent> u :<c-u>call <SID>NetBookmarkDir(4,expand("%"))<cr>
nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,expand("%"))<cr>
nnoremap <buffer> <silent> v :exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr> nnoremap <buffer> <silent> v :exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
nnoremap <buffer> <silent> x :exe "norm! 0"<bar>call <SID>NetBrowseX(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),0),0)<cr> nnoremap <buffer> <silent> x :exe "norm! 0"<bar>call <SID>NetBrowseX(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),0),0)<cr>
nnoremap <buffer> <silent> <2-leftmouse> :exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr> nnoremap <buffer> <silent> <2-leftmouse> :exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
@ -2041,34 +2152,43 @@ fun! <SID>LocalBrowse(dirname)
keepjumps 1d keepjumps 1d
keepjumps put ='\" Directory Listing (netrw '.g:loaded_netrw.')' keepjumps put ='\" Directory Listing (netrw '.g:loaded_netrw.')'
keepjumps put ='\" '.dirname keepjumps put ='\" '.dirname
let s:netrw_bannercnt= 7 let s:netrw_bannercnt= 3
let sortby= g:netrw_sort_by let sortby= g:netrw_sort_by
if g:netrw_sort_direction =~ "^r" if g:netrw_sort_direction =~ "^r"
let sortby= sortby." reversed" let sortby= sortby." reversed"
endif endif
" Sorted by...
if g:netrw_sort_by =~ "^n" if g:netrw_sort_by =~ "^n"
" call Decho("directories will be sorted by name") " call Decho("directories will be sorted by name")
" sorted by name " sorted by name
let s:netrw_bannercnt= s:netrw_bannercnt + 1
keepjumps put ='\" Sorted by '.sortby keepjumps put ='\" Sorted by '.sortby
keepjumps put ='\" Sort sequence: '.g:netrw_sort_sequence keepjumps put ='\" Sort sequence: '.g:netrw_sort_sequence
let s:netrw_bannercnt= s:netrw_bannercnt + 2
else else
" call Decho("directories will be sorted by size or date") " call Decho("directories will be sorted by size or date")
" sorted by size or date " sorted by size or date
keepjumps put ='\" Sorted by '.sortby keepjumps put ='\" Sorted by '.sortby
let s:netrw_bannercnt= s:netrw_bannercnt + 1
endif endif
" Hiding... -or- Showing...
if g:netrw_list_hide != "" && g:netrw_hide if g:netrw_list_hide != "" && g:netrw_hide
if g:netrw_hide == 1 if g:netrw_hide == 1
keepjumps put ='\" Hiding: '.g:netrw_list_hide keepjumps put ='\" Hiding: '.g:netrw_list_hide
else else
keepjumps put ='\" Showing: '.g:netrw_list_hide keepjumps put ='\" Showing: '.g:netrw_list_hide
endif endif
let s:netrw_bannercnt= s:netrw_bannercnt + 1 let s:netrw_bannercnt= s:netrw_bannercnt + 1
endif endif
keepjumps put ='\" Quick Help: ?:help -:go up dir D:delete R:rename s:sort-by x:exec' keepjumps put ='\" Quick Help: ?:help -:go up dir D:delete R:rename s:sort-by x:exec'
keepjumps put ='\" ============================================================================' keepjumps put ='\" ============================================================================'
let s:netrw_bannercnt= s:netrw_bannercnt + 2
" bannercnt should index the line just after the banner
let s:netrw_bannercnt= s:netrw_bannercnt + 1
" call Decho("bannercnt=".s:netrw_bannercnt)
" generate the requested directory listing " generate the requested directory listing
call LocalBrowseList(dirname) call LocalBrowseList(dirname)
@ -2079,18 +2199,20 @@ fun! <SID>LocalBrowse(dirname)
if g:netrw_hide && g:netrw_list_hide != "" if g:netrw_hide && g:netrw_list_hide != ""
call s:NetrwListHide() call s:NetrwListHide()
endif endif
if g:netrw_sort_by =~ "^n" if line("$") >= s:netrw_bannercnt
call s:SetSort() if g:netrw_sort_by =~ "^n"
exe 'keepjumps silent '.s:netrw_bannercnt.',$call s:NetSort()' call s:SetSort()
exe 'keepjumps silent '.s:netrw_bannercnt.',$s/^\d\{3}\///e' exe 'keepjumps silent '.s:netrw_bannercnt.',$call s:NetSort()'
else exe 'keepjumps silent '.s:netrw_bannercnt.',$s/^\d\{3}\///e'
exe 'keepjumps silent '.s:netrw_bannercnt.',$call s:NetSort()' else
exe 'keepjumps silent '.s:netrw_bannercnt.',$s/^\d\{-}\///e' exe 'keepjumps silent '.s:netrw_bannercnt.',$call s:NetSort()'
exe 'keepjumps silent '.s:netrw_bannercnt.',$s/^\d\{-}\///e'
endif
endif endif
endif endif
exe s:netrw_bannercnt exe s:netrw_bannercnt
setlocal noma nomod setlocal noma nomod nonu
if g:netrw_keepdir | exe 'keepjumps cd '.netrw_origdir | endif if g:netrw_keepdir | exe 'keepjumps cd '.netrw_origdir | endif
" call Dret("LocalBrowse : file<".expand("%:p")."> bufname<".bufname("%").">") " call Dret("LocalBrowse : file<".expand("%:p")."> bufname<".bufname("%").">")
@ -2193,14 +2315,14 @@ fun! <SID>LocalBrowseChgDir(dirname,newdir,...)
let dirname= substitute(a:dirname,'\\','','ge') let dirname= substitute(a:dirname,'\\','','ge')
let newdir = a:newdir let newdir = a:newdir
if dirname !~ '/$' if dirname !~ '[\/]$'
" apparently vim is "recognizing" that it is in the home directory and " apparently vim is "recognizing" that it is in the home directory and
" is removing the "/". Bad idea, so I have to put it back. " is removing the "/". Bad idea, so I have to put it back.
let dirname= dirname.'/' let dirname= dirname.'/'
" call Decho("adjusting dirname<".dirname.">") " call Decho("adjusting dirname<".dirname.">")
endif endif
if newdir !~ '/$' if newdir !~ '[\/]$'
" handling a file " handling a file
let dirname= dirname.newdir let dirname= dirname.newdir
" call Decho("handling a file: dirname<".dirname.">") " call Decho("handling a file: dirname<".dirname.">")
@ -2217,7 +2339,7 @@ fun! <SID>LocalBrowseChgDir(dirname,newdir,...)
elseif newdir == '../' elseif newdir == '../'
" go up one directory " go up one directory
let dirname= substitute(dirname,'^\(.*/\)\([^/]\+/$\)','\1','e') let dirname= substitute(dirname,'^\(.*/\)\([^/]\+[\/]$\)','\1','e')
" call Decho("go up one dir: dirname<".dirname.">") " call Decho("go up one dir: dirname<".dirname.">")
else else
@ -2262,7 +2384,7 @@ fun! <SID>LocalBrowseRm(path) range
let rmfile= a:path.curword let rmfile= a:path.curword
" call Decho("rmfile<".rmfile.">") " call Decho("rmfile<".rmfile.">")
if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '/$') if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '[\/]$')
" attempt to remove file " attempt to remove file
if !all if !all
echohl Statement echohl Statement
@ -2295,7 +2417,7 @@ fun! <SID>LocalBrowseRm(path) range
let all= 1 let all= 1
endif endif
endif endif
let rmfile= substitute(rmfile,'/$','','e') let rmfile= substitute(rmfile,'[\/]$','','e')
if all || ok =~ 'y\%[es]' || ok == "" if all || ok =~ 'y\%[es]' || ok == ""
" call Decho("1st attempt: system(".g:netrw_local_rmdir.' "'.rmfile.'")') " call Decho("1st attempt: system(".g:netrw_local_rmdir.' "'.rmfile.'")')
@ -2313,9 +2435,11 @@ fun! <SID>LocalBrowseRm(path) range
call system("rm ".rmfile) call system("rm ".rmfile)
if v:shell_error != 0 && !exists("g:netrw_quiet") if v:shell_error != 0 && !exists("g:netrw_quiet")
echoerr "unable to remove directory<".rmfile."> -- is it empty?" echoerr "unable to remove directory<".rmfile."> -- is it empty?"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
elseif !exist("g:netrw_quiet")s elseif !exists("g:netrw_quiet")
echoerr "unable to remove directory<".rmfile."> -- is it empty?" echoerr "unable to remove directory<".rmfile."> -- is it empty?"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
endif endif
endif endif
@ -2390,11 +2514,13 @@ fun! <SID>LocalPreview(path) range
if has("quickfix") if has("quickfix")
if !isdirectory(a:path) if !isdirectory(a:path)
exe "pedit ".a:path exe "pedit ".a:path
elseif !exist("g:netrw_quiet")s elseif !exists("g:netrw_quiet")
echoerr "sorry, cannot preview a directory such as <".a:path.">" echoerr "sorry, cannot preview a directory such as <".a:path.">"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
elseif !exist("g:netrw_quiet")s elseif !exists("g:netrw_quiet")
echoerr "sorry, to preview your vim needs the quickfix feature compiled in" echoerr "sorry, to preview your vim needs the quickfix feature compiled in"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
" call Dret("LocalPreview") " call Dret("LocalPreview")
endfun endfun
@ -2406,7 +2532,7 @@ endfun
fun! <SID>NetGetcwd(doesc) fun! <SID>NetGetcwd(doesc)
" call Dfunc("NetGetcwd(doesc=".a:doesc.")") " call Dfunc("NetGetcwd(doesc=".a:doesc.")")
let curdir= substitute(getcwd(),'\\','/','ge') let curdir= substitute(getcwd(),'\\','/','ge')
if curdir !~ '/$' if curdir !~ '[\/]$'
let curdir= curdir.'/' let curdir= curdir.'/'
endif endif
if a:doesc if a:doesc
@ -2595,6 +2721,7 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
else else
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echoerr "***error*** cannot determine method" echoerr "***error*** cannot determine method"
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
let b:netrw_method = -1 let b:netrw_method = -1
endif endif
@ -2685,7 +2812,16 @@ fun! s:NetOptionRestore()
let &gd = s:gdkeep let &gd = s:gdkeep
let &tw = s:twkeep let &tw = s:twkeep
if exists("s:swfkeep") if exists("s:swfkeep")
let &swf= s:swfkeep if &directory == ""
" user hasn't specified a swapfile directory;
" netrw will temporarily make the swapfile
" directory the current local one.
let &directory = getcwd()
silent! let &swf = s:swfkeep
set directory=
else
let &swf= s:swfkeep
endif
unlet s:swfkeep unlet s:swfkeep
endif endif
unlet s:aikeep unlet s:aikeep
@ -2799,6 +2935,12 @@ fun! <SID>SetSort()
endif endif
" call Decho("priority=".priority." spriority<".spriority."> seq<".seq."> seqlist<".seqlist.">") " call Decho("priority=".priority." spriority<".spriority."> seq<".seq."> seqlist<".seqlist.">")
" sanity check
if s:netrw_bannercnt > line("$")
" apparently no files were left after a Hiding pattern was used
" call Dret("SetSort : no files left after hiding")
return
endif
if seq == '*' if seq == '*'
exe 'keepjumps silent '.s:netrw_bannercnt.',$v/^\d\{3}\//s/^/'.spriority.'/' exe 'keepjumps silent '.s:netrw_bannercnt.',$v/^\d\{3}\//s/^/'.spriority.'/'
else else

View File

@ -39,46 +39,47 @@ an 50.10.140 &Syntax.AB.ABEL :cal SetSyn("abel")<CR>
an 50.10.150 &Syntax.AB.AceDB\ model :cal SetSyn("acedb")<CR> an 50.10.150 &Syntax.AB.AceDB\ model :cal SetSyn("acedb")<CR>
an 50.10.160 &Syntax.AB.Ada :cal SetSyn("ada")<CR> an 50.10.160 &Syntax.AB.Ada :cal SetSyn("ada")<CR>
an 50.10.170 &Syntax.AB.AfLex :cal SetSyn("aflex")<CR> an 50.10.170 &Syntax.AB.AfLex :cal SetSyn("aflex")<CR>
an 50.10.180 &Syntax.AB.Altera\ AHDL :cal SetSyn("ahdl")<CR> an 50.10.180 &Syntax.AB.ALSA\ config :cal SetSyn("alsaconf")<CR>
an 50.10.190 &Syntax.AB.Amiga\ DOS :cal SetSyn("amiga")<CR> an 50.10.190 &Syntax.AB.Altera\ AHDL :cal SetSyn("ahdl")<CR>
an 50.10.200 &Syntax.AB.AMPL :cal SetSyn("ampl")<CR> an 50.10.200 &Syntax.AB.Amiga\ DOS :cal SetSyn("amiga")<CR>
an 50.10.210 &Syntax.AB.Ant\ build\ file :cal SetSyn("ant")<CR> an 50.10.210 &Syntax.AB.AMPL :cal SetSyn("ampl")<CR>
an 50.10.220 &Syntax.AB.ANTLR :cal SetSyn("antlr")<CR> an 50.10.220 &Syntax.AB.Ant\ build\ file :cal SetSyn("ant")<CR>
an 50.10.230 &Syntax.AB.Apache\ config :cal SetSyn("apache")<CR> an 50.10.230 &Syntax.AB.ANTLR :cal SetSyn("antlr")<CR>
an 50.10.240 &Syntax.AB.Apache-style\ config :cal SetSyn("apachestyle")<CR> an 50.10.240 &Syntax.AB.Apache\ config :cal SetSyn("apache")<CR>
an 50.10.250 &Syntax.AB.Applix\ ELF :cal SetSyn("elf")<CR> an 50.10.250 &Syntax.AB.Apache-style\ config :cal SetSyn("apachestyle")<CR>
an 50.10.260 &Syntax.AB.Arc\ Macro\ Language :cal SetSyn("aml")<CR> an 50.10.260 &Syntax.AB.Applix\ ELF :cal SetSyn("elf")<CR>
an 50.10.270 &Syntax.AB.Arch\ inventory :cal SetSyn("arch")<CR> an 50.10.270 &Syntax.AB.Arc\ Macro\ Language :cal SetSyn("aml")<CR>
an 50.10.280 &Syntax.AB.ART :cal SetSyn("art")<CR> an 50.10.280 &Syntax.AB.Arch\ inventory :cal SetSyn("arch")<CR>
an 50.10.290 &Syntax.AB.ASP\ with\ VBScript :cal SetSyn("aspvbs")<CR> an 50.10.290 &Syntax.AB.ART :cal SetSyn("art")<CR>
an 50.10.300 &Syntax.AB.ASP\ with\ Perl :cal SetSyn("aspperl")<CR> an 50.10.300 &Syntax.AB.ASP\ with\ VBScript :cal SetSyn("aspvbs")<CR>
an 50.10.310 &Syntax.AB.Assembly.680x0 :cal SetSyn("asm68k")<CR> an 50.10.310 &Syntax.AB.ASP\ with\ Perl :cal SetSyn("aspperl")<CR>
an 50.10.320 &Syntax.AB.Assembly.Flat :cal SetSyn("fasm")<CR> an 50.10.320 &Syntax.AB.Assembly.680x0 :cal SetSyn("asm68k")<CR>
an 50.10.330 &Syntax.AB.Assembly.GNU :cal SetSyn("asm")<CR> an 50.10.330 &Syntax.AB.Assembly.Flat :cal SetSyn("fasm")<CR>
an 50.10.340 &Syntax.AB.Assembly.GNU\ H-8300 :cal SetSyn("asmh8300")<CR> an 50.10.340 &Syntax.AB.Assembly.GNU :cal SetSyn("asm")<CR>
an 50.10.350 &Syntax.AB.Assembly.Intel\ IA-64 :cal SetSyn("ia64")<CR> an 50.10.350 &Syntax.AB.Assembly.GNU\ H-8300 :cal SetSyn("asmh8300")<CR>
an 50.10.360 &Syntax.AB.Assembly.Microsoft :cal SetSyn("masm")<CR> an 50.10.360 &Syntax.AB.Assembly.Intel\ IA-64 :cal SetSyn("ia64")<CR>
an 50.10.370 &Syntax.AB.Assembly.Netwide :cal SetSyn("nasm")<CR> an 50.10.370 &Syntax.AB.Assembly.Microsoft :cal SetSyn("masm")<CR>
an 50.10.380 &Syntax.AB.Assembly.PIC :cal SetSyn("pic")<CR> an 50.10.380 &Syntax.AB.Assembly.Netwide :cal SetSyn("nasm")<CR>
an 50.10.390 &Syntax.AB.Assembly.Turbo :cal SetSyn("tasm")<CR> an 50.10.390 &Syntax.AB.Assembly.PIC :cal SetSyn("pic")<CR>
an 50.10.400 &Syntax.AB.Assembly.VAX\ Macro\ Assembly :cal SetSyn("vmasm")<CR> an 50.10.400 &Syntax.AB.Assembly.Turbo :cal SetSyn("tasm")<CR>
an 50.10.410 &Syntax.AB.Assembly.Z-80 :cal SetSyn("z8a")<CR> an 50.10.410 &Syntax.AB.Assembly.VAX\ Macro\ Assembly :cal SetSyn("vmasm")<CR>
an 50.10.420 &Syntax.AB.Assembly.xa\ 6502\ cross\ assember :cal SetSyn("a65")<CR> an 50.10.420 &Syntax.AB.Assembly.Z-80 :cal SetSyn("z8a")<CR>
an 50.10.430 &Syntax.AB.ASN\.1 :cal SetSyn("asn")<CR> an 50.10.430 &Syntax.AB.Assembly.xa\ 6502\ cross\ assember :cal SetSyn("a65")<CR>
an 50.10.440 &Syntax.AB.Atlas :cal SetSyn("atlas")<CR> an 50.10.440 &Syntax.AB.ASN\.1 :cal SetSyn("asn")<CR>
an 50.10.450 &Syntax.AB.Automake :cal SetSyn("automake")<CR> an 50.10.450 &Syntax.AB.Atlas :cal SetSyn("atlas")<CR>
an 50.10.460 &Syntax.AB.Avenue :cal SetSyn("ave")<CR> an 50.10.460 &Syntax.AB.Automake :cal SetSyn("automake")<CR>
an 50.10.470 &Syntax.AB.Awk :cal SetSyn("awk")<CR> an 50.10.470 &Syntax.AB.Avenue :cal SetSyn("ave")<CR>
an 50.10.480 &Syntax.AB.AYacc :cal SetSyn("ayacc")<CR> an 50.10.480 &Syntax.AB.Awk :cal SetSyn("awk")<CR>
an 50.10.500 &Syntax.AB.B :cal SetSyn("b")<CR> an 50.10.490 &Syntax.AB.AYacc :cal SetSyn("ayacc")<CR>
an 50.10.510 &Syntax.AB.Baan :cal SetSyn("baan")<CR> an 50.10.510 &Syntax.AB.B :cal SetSyn("b")<CR>
an 50.10.520 &Syntax.AB.BASIC :cal SetSyn("basic")<CR> an 50.10.520 &Syntax.AB.Baan :cal SetSyn("baan")<CR>
an 50.10.530 &Syntax.AB.BC\ calculator :cal SetSyn("bc")<CR> an 50.10.530 &Syntax.AB.BASIC :cal SetSyn("basic")<CR>
an 50.10.540 &Syntax.AB.BDF\ font :cal SetSyn("bdf")<CR> an 50.10.540 &Syntax.AB.BC\ calculator :cal SetSyn("bc")<CR>
an 50.10.550 &Syntax.AB.BibTeX :cal SetSyn("bib")<CR> an 50.10.550 &Syntax.AB.BDF\ font :cal SetSyn("bdf")<CR>
an 50.10.560 &Syntax.AB.BIND.BIND\ config :cal SetSyn("named")<CR> an 50.10.560 &Syntax.AB.BibTeX :cal SetSyn("bib")<CR>
an 50.10.570 &Syntax.AB.BIND.BIND\ zone :cal SetSyn("bindzone")<CR> an 50.10.570 &Syntax.AB.BIND.BIND\ config :cal SetSyn("named")<CR>
an 50.10.580 &Syntax.AB.Blank :cal SetSyn("blank")<CR> an 50.10.580 &Syntax.AB.BIND.BIND\ zone :cal SetSyn("bindzone")<CR>
an 50.10.590 &Syntax.AB.Blank :cal SetSyn("blank")<CR>
an 50.20.100 &Syntax.C.C :cal SetSyn("c")<CR> an 50.20.100 &Syntax.C.C :cal SetSyn("c")<CR>
an 50.20.110 &Syntax.C.C++ :cal SetSyn("cpp")<CR> an 50.20.110 &Syntax.C.C++ :cal SetSyn("cpp")<CR>
an 50.20.120 &Syntax.C.C# :cal SetSyn("cs")<CR> an 50.20.120 &Syntax.C.C# :cal SetSyn("cs")<CR>
@ -336,46 +337,47 @@ an 50.100.110 &Syntax.Sh-S.Shell\ script.csh :cal SetSyn("csh")<CR>
an 50.100.120 &Syntax.Sh-S.Shell\ script.tcsh :cal SetSyn("tcsh")<CR> an 50.100.120 &Syntax.Sh-S.Shell\ script.tcsh :cal SetSyn("tcsh")<CR>
an 50.100.130 &Syntax.Sh-S.Shell\ script.zsh :cal SetSyn("zsh")<CR> an 50.100.130 &Syntax.Sh-S.Shell\ script.zsh :cal SetSyn("zsh")<CR>
an 50.100.140 &Syntax.Sh-S.SiCAD :cal SetSyn("sicad")<CR> an 50.100.140 &Syntax.Sh-S.SiCAD :cal SetSyn("sicad")<CR>
an 50.100.150 &Syntax.Sh-S.Simula :cal SetSyn("simula")<CR> an 50.100.150 &Syntax.Sh-S.Sieve :cal SetSyn("sieve")<CR>
an 50.100.160 &Syntax.Sh-S.Sinda.Sinda\ compare :cal SetSyn("sindacmp")<CR> an 50.100.160 &Syntax.Sh-S.Simula :cal SetSyn("simula")<CR>
an 50.100.170 &Syntax.Sh-S.Sinda.Sinda\ input :cal SetSyn("sinda")<CR> an 50.100.170 &Syntax.Sh-S.Sinda.Sinda\ compare :cal SetSyn("sindacmp")<CR>
an 50.100.180 &Syntax.Sh-S.Sinda.Sinda\ output :cal SetSyn("sindaout")<CR> an 50.100.180 &Syntax.Sh-S.Sinda.Sinda\ input :cal SetSyn("sinda")<CR>
an 50.100.190 &Syntax.Sh-S.SKILL.SKILL :cal SetSyn("skill")<CR> an 50.100.190 &Syntax.Sh-S.Sinda.Sinda\ output :cal SetSyn("sindaout")<CR>
an 50.100.200 &Syntax.Sh-S.SKILL.SKILL\ for\ Diva :cal SetSyn("diva")<CR> an 50.100.200 &Syntax.Sh-S.SKILL.SKILL :cal SetSyn("skill")<CR>
an 50.100.210 &Syntax.Sh-S.Slice :cal SetSyn("slice")<CR> an 50.100.210 &Syntax.Sh-S.SKILL.SKILL\ for\ Diva :cal SetSyn("diva")<CR>
an 50.100.220 &Syntax.Sh-S.SLRN.Slrn\ rc :cal SetSyn("slrnrc")<CR> an 50.100.220 &Syntax.Sh-S.Slice :cal SetSyn("slice")<CR>
an 50.100.230 &Syntax.Sh-S.SLRN.Slrn\ score :cal SetSyn("slrnsc")<CR> an 50.100.230 &Syntax.Sh-S.SLRN.Slrn\ rc :cal SetSyn("slrnrc")<CR>
an 50.100.240 &Syntax.Sh-S.SmallTalk :cal SetSyn("st")<CR> an 50.100.240 &Syntax.Sh-S.SLRN.Slrn\ score :cal SetSyn("slrnsc")<CR>
an 50.100.250 &Syntax.Sh-S.Smarty\ Templates :cal SetSyn("smarty")<CR> an 50.100.250 &Syntax.Sh-S.SmallTalk :cal SetSyn("st")<CR>
an 50.100.260 &Syntax.Sh-S.SMIL :cal SetSyn("smil")<CR> an 50.100.260 &Syntax.Sh-S.Smarty\ Templates :cal SetSyn("smarty")<CR>
an 50.100.270 &Syntax.Sh-S.SMITH :cal SetSyn("smith")<CR> an 50.100.270 &Syntax.Sh-S.SMIL :cal SetSyn("smil")<CR>
an 50.100.280 &Syntax.Sh-S.SNMP\ MIB :cal SetSyn("mib")<CR> an 50.100.280 &Syntax.Sh-S.SMITH :cal SetSyn("smith")<CR>
an 50.100.290 &Syntax.Sh-S.SNNS.SNNS\ network :cal SetSyn("snnsnet")<CR> an 50.100.290 &Syntax.Sh-S.SNMP\ MIB :cal SetSyn("mib")<CR>
an 50.100.300 &Syntax.Sh-S.SNNS.SNNS\ pattern :cal SetSyn("snnspat")<CR> an 50.100.300 &Syntax.Sh-S.SNNS.SNNS\ network :cal SetSyn("snnsnet")<CR>
an 50.100.310 &Syntax.Sh-S.SNNS.SNNS\ result :cal SetSyn("snnsres")<CR> an 50.100.310 &Syntax.Sh-S.SNNS.SNNS\ pattern :cal SetSyn("snnspat")<CR>
an 50.100.320 &Syntax.Sh-S.Snobol4 :cal SetSyn("snobol4")<CR> an 50.100.320 &Syntax.Sh-S.SNNS.SNNS\ result :cal SetSyn("snnsres")<CR>
an 50.100.330 &Syntax.Sh-S.Snort\ Configuration :cal SetSyn("hog")<CR> an 50.100.330 &Syntax.Sh-S.Snobol4 :cal SetSyn("snobol4")<CR>
an 50.100.340 &Syntax.Sh-S.SPEC\ (Linux\ RPM) :cal SetSyn("spec")<CR> an 50.100.340 &Syntax.Sh-S.Snort\ Configuration :cal SetSyn("hog")<CR>
an 50.100.350 &Syntax.Sh-S.Specman :cal SetSyn("specman")<CR> an 50.100.350 &Syntax.Sh-S.SPEC\ (Linux\ RPM) :cal SetSyn("spec")<CR>
an 50.100.360 &Syntax.Sh-S.Spice :cal SetSyn("spice")<CR> an 50.100.360 &Syntax.Sh-S.Specman :cal SetSyn("specman")<CR>
an 50.100.370 &Syntax.Sh-S.Spyce :cal SetSyn("spyce")<CR> an 50.100.370 &Syntax.Sh-S.Spice :cal SetSyn("spice")<CR>
an 50.100.380 &Syntax.Sh-S.Speedup :cal SetSyn("spup")<CR> an 50.100.380 &Syntax.Sh-S.Spyce :cal SetSyn("spyce")<CR>
an 50.100.390 &Syntax.Sh-S.Splint :cal SetSyn("splint")<CR> an 50.100.390 &Syntax.Sh-S.Speedup :cal SetSyn("spup")<CR>
an 50.100.400 &Syntax.Sh-S.Squid\ config :cal SetSyn("squid")<CR> an 50.100.400 &Syntax.Sh-S.Splint :cal SetSyn("splint")<CR>
an 50.100.410 &Syntax.Sh-S.SQL.ESQL-C :cal SetSyn("esqlc")<CR> an 50.100.410 &Syntax.Sh-S.Squid\ config :cal SetSyn("squid")<CR>
an 50.100.420 &Syntax.Sh-S.SQL.MySQL :cal SetSyn("mysql")<CR> an 50.100.420 &Syntax.Sh-S.SQL.ESQL-C :cal SetSyn("esqlc")<CR>
an 50.100.430 &Syntax.Sh-S.SQL.PL/SQL :cal SetSyn("plsql")<CR> an 50.100.430 &Syntax.Sh-S.SQL.MySQL :cal SetSyn("mysql")<CR>
an 50.100.440 &Syntax.Sh-S.SQL.SQL\ (Oracle) :cal SetSyn("sql")<CR> an 50.100.440 &Syntax.Sh-S.SQL.PL/SQL :cal SetSyn("plsql")<CR>
an 50.100.450 &Syntax.Sh-S.SQL.SQL\ Forms :cal SetSyn("sqlforms")<CR> an 50.100.450 &Syntax.Sh-S.SQL.SQL\ (Oracle) :cal SetSyn("sql")<CR>
an 50.100.460 &Syntax.Sh-S.SQL.SQLJ :cal SetSyn("sqlj")<CR> an 50.100.460 &Syntax.Sh-S.SQL.SQL\ Forms :cal SetSyn("sqlforms")<CR>
an 50.100.470 &Syntax.Sh-S.SQL.SQL-Informix :cal SetSyn("sqlinformix")<CR> an 50.100.470 &Syntax.Sh-S.SQL.SQLJ :cal SetSyn("sqlj")<CR>
an 50.100.480 &Syntax.Sh-S.SQR :cal SetSyn("sqr")<CR> an 50.100.480 &Syntax.Sh-S.SQL.SQL-Informix :cal SetSyn("sqlinformix")<CR>
an 50.100.490 &Syntax.Sh-S.Ssh.ssh_config :cal SetSyn("sshconfig")<CR> an 50.100.490 &Syntax.Sh-S.SQR :cal SetSyn("sqr")<CR>
an 50.100.500 &Syntax.Sh-S.Ssh.sshd_config :cal SetSyn("sshdconfig")<CR> an 50.100.500 &Syntax.Sh-S.Ssh.ssh_config :cal SetSyn("sshconfig")<CR>
an 50.100.510 &Syntax.Sh-S.Standard\ ML :cal SetSyn("sml")<CR> an 50.100.510 &Syntax.Sh-S.Ssh.sshd_config :cal SetSyn("sshdconfig")<CR>
an 50.100.520 &Syntax.Sh-S.Stored\ Procedures :cal SetSyn("stp")<CR> an 50.100.520 &Syntax.Sh-S.Standard\ ML :cal SetSyn("sml")<CR>
an 50.100.530 &Syntax.Sh-S.Strace :cal SetSyn("strace")<CR> an 50.100.530 &Syntax.Sh-S.Stored\ Procedures :cal SetSyn("stp")<CR>
an 50.100.540 &Syntax.Sh-S.Subversion\ commit :cal SetSyn("svn")<CR> an 50.100.540 &Syntax.Sh-S.Strace :cal SetSyn("strace")<CR>
an 50.100.550 &Syntax.Sh-S.Subversion\ commit :cal SetSyn("svn")<CR>
an 50.110.100 &Syntax.TUV.TADS :cal SetSyn("tads")<CR> an 50.110.100 &Syntax.TUV.TADS :cal SetSyn("tads")<CR>
an 50.110.110 &Syntax.TUV.Tags :cal SetSyn("tags")<CR> an 50.110.110 &Syntax.TUV.Tags :cal SetSyn("tags")<CR>
an 50.110.120 &Syntax.TUV.TAK.TAK\ compare :cal SetSyn("takcmp")<CR> an 50.110.120 &Syntax.TUV.TAK.TAK\ compare :cal SetSyn("takcmp")<CR>
@ -392,23 +394,24 @@ an 50.110.220 &Syntax.TUV.TeX.Texinfo :cal SetSyn("texinfo")<CR>
an 50.110.230 &Syntax.TUV.TF\ mud\ client :cal SetSyn("tf")<CR> an 50.110.230 &Syntax.TUV.TF\ mud\ client :cal SetSyn("tf")<CR>
an 50.110.240 &Syntax.TUV.Tidy\ configuration :cal SetSyn("tidy")<CR> an 50.110.240 &Syntax.TUV.Tidy\ configuration :cal SetSyn("tidy")<CR>
an 50.110.250 &Syntax.TUV.Tilde :cal SetSyn("tilde")<CR> an 50.110.250 &Syntax.TUV.Tilde :cal SetSyn("tilde")<CR>
an 50.110.260 &Syntax.TUV.Trasys\ input :cal SetSyn("trasys")<CR> an 50.110.260 &Syntax.TUV.TPP :cal SetSyn("tpp")<CR>
an 50.110.270 &Syntax.TUV.TSS.Command\ Line :cal SetSyn("tsscl")<CR> an 50.110.270 &Syntax.TUV.Trasys\ input :cal SetSyn("trasys")<CR>
an 50.110.280 &Syntax.TUV.TSS.Geometry :cal SetSyn("tssgm")<CR> an 50.110.280 &Syntax.TUV.TSS.Command\ Line :cal SetSyn("tsscl")<CR>
an 50.110.290 &Syntax.TUV.TSS.Optics :cal SetSyn("tssop")<CR> an 50.110.290 &Syntax.TUV.TSS.Geometry :cal SetSyn("tssgm")<CR>
an 50.110.310 &Syntax.TUV.UIT/UIL :cal SetSyn("uil")<CR> an 50.110.300 &Syntax.TUV.TSS.Optics :cal SetSyn("tssop")<CR>
an 50.110.320 &Syntax.TUV.UnrealScript :cal SetSyn("uc")<CR> an 50.110.320 &Syntax.TUV.UIT/UIL :cal SetSyn("uil")<CR>
an 50.110.340 &Syntax.TUV.Valgrind :cal SetSyn("valgrind")<CR> an 50.110.330 &Syntax.TUV.UnrealScript :cal SetSyn("uc")<CR>
an 50.110.350 &Syntax.TUV.Verilog\ HDL :cal SetSyn("verilog")<CR> an 50.110.350 &Syntax.TUV.Valgrind :cal SetSyn("valgrind")<CR>
an 50.110.360 &Syntax.TUV.Vgrindefs :cal SetSyn("vgrindefs")<CR> an 50.110.360 &Syntax.TUV.Verilog\ HDL :cal SetSyn("verilog")<CR>
an 50.110.370 &Syntax.TUV.VHDL :cal SetSyn("vhdl")<CR> an 50.110.370 &Syntax.TUV.Vgrindefs :cal SetSyn("vgrindefs")<CR>
an 50.110.380 &Syntax.TUV.Vim.Vim\ help\ file :cal SetSyn("help")<CR> an 50.110.380 &Syntax.TUV.VHDL :cal SetSyn("vhdl")<CR>
an 50.110.390 &Syntax.TUV.Vim.Vim\ script :cal SetSyn("vim")<CR> an 50.110.390 &Syntax.TUV.Vim.Vim\ help\ file :cal SetSyn("help")<CR>
an 50.110.400 &Syntax.TUV.Vim.Viminfo\ file :cal SetSyn("viminfo")<CR> an 50.110.400 &Syntax.TUV.Vim.Vim\ script :cal SetSyn("vim")<CR>
an 50.110.410 &Syntax.TUV.Virata\ config :cal SetSyn("virata")<CR> an 50.110.410 &Syntax.TUV.Vim.Viminfo\ file :cal SetSyn("viminfo")<CR>
an 50.110.420 &Syntax.TUV.Visual\ Basic :cal SetSyn("vb")<CR> an 50.110.420 &Syntax.TUV.Virata\ config :cal SetSyn("virata")<CR>
an 50.110.430 &Syntax.TUV.VRML :cal SetSyn("vrml")<CR> an 50.110.430 &Syntax.TUV.Visual\ Basic :cal SetSyn("vb")<CR>
an 50.110.440 &Syntax.TUV.VSE\ JCL :cal SetSyn("vsejcl")<CR> an 50.110.440 &Syntax.TUV.VRML :cal SetSyn("vrml")<CR>
an 50.110.450 &Syntax.TUV.VSE\ JCL :cal SetSyn("vsejcl")<CR>
an 50.120.100 &Syntax.WXYZ.WEB.CWEB :cal SetSyn("cweb")<CR> an 50.120.100 &Syntax.WXYZ.WEB.CWEB :cal SetSyn("cweb")<CR>
an 50.120.110 &Syntax.WXYZ.WEB.WEB :cal SetSyn("web")<CR> an 50.120.110 &Syntax.WXYZ.WEB.WEB :cal SetSyn("web")<CR>
an 50.120.120 &Syntax.WXYZ.WEB.WEB\ Changes :cal SetSyn("change")<CR> an 50.120.120 &Syntax.WXYZ.WEB.WEB\ Changes :cal SetSyn("change")<CR>

View File

@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: C " Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2004 Feb 04 " Last Change: 2004 Dec 09
" For version 5.x: Clear all syntax items " For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded " For version 6.x: Quit when a syntax file was already loaded
@ -124,15 +124,25 @@ if exists("c_comment_strings")
syntax region cCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=cSpecial,cCommentSkip syntax region cCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=cSpecial,cCommentSkip
syntax region cComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=cSpecial syntax region cComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=cSpecial
syntax region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cComment2String,cCharacter,cNumbersCom,cSpaceError,@Spell syntax region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cComment2String,cCharacter,cNumbersCom,cSpaceError,@Spell
syntax region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell if exists("c_no_comment_fold")
syntax region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell
else
syntax region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell fold
endif
else else
syn region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cSpaceError,@Spell syn region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cSpaceError,@Spell
syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell if exists("c_no_comment_fold")
syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell
else
syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell fold
endif
endif endif
" keep a // comment separately, it terminates a preproc. conditional " keep a // comment separately, it terminates a preproc. conditional
syntax match cCommentError display "\*/" syntax match cCommentError display "\*/"
syntax match cCommentStartError display "/\*"me=e-1 contained syntax match cCommentStartError display "/\*"me=e-1 contained
syntax region cBlock start="{" end="}" transparent fold
syn keyword cOperator sizeof syn keyword cOperator sizeof
if exists("c_gnu") if exists("c_gnu")
syn keyword cStatement __asm__ syn keyword cStatement __asm__

View File

@ -2,7 +2,7 @@
" Language: Cascading Style Sheets " Language: Cascading Style Sheets
" Maintainer: Claudio Fleiner <claudio@fleiner.com> " Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/css.vim " URL: http://www.fleiner.com/vim/syntax/css.vim
" Last Change: 2002 Oct 19 " Last Change: 2004 Mar 30
" CSS2 by Nikolai Weibull " CSS2 by Nikolai Weibull
" Full CSS2, HTML4 support by Yeti " Full CSS2, HTML4 support by Yeti
@ -38,7 +38,7 @@ syn match cssSelectorOp "[+>.]"
syn match cssSelectorOp2 "[~|]\?=" contained syn match cssSelectorOp2 "[~|]\?=" contained
syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" transparent contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" transparent contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
syn match cssIdentifier "#\i\+" syn match cssIdentifier "#[A-Za-zÀ-ÿ_@][A-Za-zÀ-ÿ0-9_@-]*"
syn match cssMedia "@media\>" nextgroup=cssMediaType skipwhite skipnl syn match cssMedia "@media\>" nextgroup=cssMediaType skipwhite skipnl
syn keyword cssMediaType contained screen print aural braile embosed handheld projection ty tv all nextgroup=cssMediaComma,cssMediaBlock skipwhite skipnl syn keyword cssMediaType contained screen print aural braile embosed handheld projection ty tv all nextgroup=cssMediaComma,cssMediaBlock skipwhite skipnl

View File

@ -1,7 +1,14 @@
" Vim syntax file " Vim syntax file
" Language: Debian control files " Language: Debian control files
" Maintainer: Wichert Akkerman <wakkerma@debian.org> " Maintainer: Gerfried Fuchs <alfie@debian.org>
" Last Change: October 28, 2001 " Last Change: 29 Oct 2004
" URL: http://alfie.ist.org/software/vim/syntax/debcontrol.vim
"
" Original Version: Wichert Akkerman <wakkerma@debian.org>
" Comments are very welcome - but please make sure that you are commenting on
" the latest version of this file.
" SPAM is _NOT_ welcome - be ready to be reported!
" Standard syntax initialization " Standard syntax initialization
if version < 600 if version < 600
@ -18,10 +25,10 @@ syn match debControlComma ", *"
syn match debControlSpace " " syn match debControlSpace " "
" Define some common expressions we can use later on " Define some common expressions we can use later on
syn match debcontrolArchitecture contained "\(all\|any\|alpha\|arm\|hppa\|ia64\|i386\|m68k\|mipsel\|mips\|powerpc\|sh\|sheb\|sparc\|hurd-i386\)" syn match debcontrolArchitecture contained "\(all\|any\|alpha\|amd64\|arm\|hppa\|i386\|ia64\|m68k\|mipsel\|mips\|powerpc\|s390\|sheb\|sh\|sparc64\|sparc\|hurd-i386\|kfreebsd-i386\|knetbsd-i386\|netbsd-i386\)"
syn match debcontrolName contained "[a-z][a-z0-9+-]*" syn match debcontrolName contained "[a-z][a-z0-9+-]*"
syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)" syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)"
syn match debcontrolSection contained "\(\(contrib\|non-free\|non-US/main\|non-US/contrib\|non-US/non-free\)/\)\=\(admin\|base\|comm\|devel\|doc\|editors\|electronics\|games\|graphics\|hamradio\|interpreters\|libs\|mail\|math\|misc\|net\|news\|oldlibs\|otherosfs\|science\|shells\|sound\|text\|tex\|utils\|web\|x11\|debian-installer\)" syn match debcontrolSection contained "\(\(contrib\|non-free\|non-US/main\|non-US/contrib\|non-US/non-free\)/\)\=\(admin\|base\|comm\|devel\|doc\|editors\|electronics\|embedded\|games\|gnome\|graphics\|hamradio\|interpreters\|kde\|libs\|libdevel\|mail\|math\|misc\|net\|news\|oldlibs\|otherosfs\|perl\|python\|science\|shells\|sound\|text\|tex\|utils\|web\|x11\|debian-installer\)"
syn match debcontrolVariable contained "\${.\{-}}" syn match debcontrolVariable contained "\${.\{-}}"
" An email address " An email address
@ -29,7 +36,7 @@ syn match debcontrolEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+"
syn match debcontrolEmail "<.\{-}>" syn match debcontrolEmail "<.\{-}>"
" List of all legal keys " List of all legal keys
syn match debcontrolKey contained "^\(Source\|Package\|Section\|Priority\|Maintainer\|Uploaders\|Build-Depends\|Build-Conflicts\|Build-Depends-Indep\|Build-Conflicts-Indep\|Standards-Version\|Pre-Depends\|Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Essential\|Architecture\|Description\|Bugs\|Origin\): *" syn match debcontrolKey contained "^\(Source\|Package\|Section\|Priority\|Maintainer\|Uploaders\|Build-Depends\|Build-Conflicts\|Build-Depends-Indep\|Build-Conflicts-Indep\|Standards-Version\|Pre-Depends\|Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Essential\|Architecture\|Description\|Bugs\|Origin\|Enhances\): *"
" Fields for which we do strict syntax checking " Fields for which we do strict syntax checking
syn region debcontrolStrictField start="^Architecture" end="$" contains=debcontrolKey,debcontrolArchitecture,debcontrolSpace oneline syn region debcontrolStrictField start="^Architecture" end="$" contains=debcontrolKey,debcontrolArchitecture,debcontrolSpace oneline
@ -38,7 +45,7 @@ syn region debcontrolStrictField start="^Priority" end="$" contains=debcontrolKe
syn region debcontrolStrictField start="^Section" end="$" contains=debcontrolKey,debcontrolSection oneline syn region debcontrolStrictField start="^Section" end="$" contains=debcontrolKey,debcontrolSection oneline
" Catch-all for the other legal fields " Catch-all for the other legal fields
syn region debcontrolField start="^\(Maintainer\|Build-Depends\|Build-Conflicts\|Build-Depends-Indep\|Build-Conflicts-Indep\|Standards-Version\|Pre-Depends\|Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Essential\|Bugs\|Origin\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline syn region debcontrolField start="^\(Maintainer\|Build-Depends\|Build-Conflicts\|Build-Depends-Indep\|Build-Conflicts-Indep\|Standards-Version\|Pre-Depends\|Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Essential\|Bugs\|Origin\|Enhances\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline
syn region debcontrolMultiField start="^\(Uploaders\|Description\):" skip="^ " end="^$"me=s-1 end="^[^ ]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable syn region debcontrolMultiField start="^\(Uploaders\|Description\):" skip="^ " end="^$"me=s-1 end="^[^ ]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable
" Associate our matches and regions with pretty colours " Associate our matches and regions with pretty colours

View File

@ -2,7 +2,7 @@
" Language: Java " Language: Java
" Maintainer: Claudio Fleiner <claudio@fleiner.com> " Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/java.vim " URL: http://www.fleiner.com/vim/syntax/java.vim
" Last Change: 2004 Apr 23 " Last Change: 2004 Nov 12
" Please check :help java.vim for comments on some of the options available. " Please check :help java.vim for comments on some of the options available.
@ -37,7 +37,7 @@ JavaHiLink javaError2 javaError
" keyword definitions " keyword definitions
syn keyword javaExternal native package syn keyword javaExternal native package
syn match javaExternal "\<import\(\s\+static\>\)\?" syn match javaExternal "\<import\>\(\s\+static\>\)\?"
syn keyword javaError goto const syn keyword javaError goto const
syn keyword javaConditional if else switch syn keyword javaConditional if else switch
syn keyword javaRepeat while for do syn keyword javaRepeat while for do
@ -228,6 +228,7 @@ if exists("java_highlight_debug")
" to make this work you must define the highlighting for these groups " to make this work you must define the highlighting for these groups
syn match javaDebug "\<System\.\(out\|err\)\.print\(ln\)*\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen syn match javaDebug "\<System\.\(out\|err\)\.print\(ln\)*\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
syn match javaDebug "\<p\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
syn match javaDebug "[A-Za-z][a-zA-Z0-9_]*\.printStackTrace\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen syn match javaDebug "[A-Za-z][a-zA-Z0-9_]*\.printStackTrace\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
syn match javaDebug "\<trace[SL]\=\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen syn match javaDebug "\<trace[SL]\=\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
@ -263,6 +264,12 @@ syn region javaParenT transparent matchgroup=javaParen start="(" end=")" con
syn region javaParenT1 transparent matchgroup=javaParen1 start="(" end=")" contains=@javaTop,javaParenT2 contained syn region javaParenT1 transparent matchgroup=javaParen1 start="(" end=")" contains=@javaTop,javaParenT2 contained
syn region javaParenT2 transparent matchgroup=javaParen2 start="(" end=")" contains=@javaTop,javaParenT contained syn region javaParenT2 transparent matchgroup=javaParen2 start="(" end=")" contains=@javaTop,javaParenT contained
syn match javaParenError ")" syn match javaParenError ")"
" catch errors caused by wrong square parenthesis
syn region javaParenT transparent matchgroup=javaParen start="\[" end="\]" contains=@javaTop,javaParenT1
syn region javaParenT1 transparent matchgroup=javaParen1 start="\[" end="\]" contains=@javaTop,javaParenT2 contained
syn region javaParenT2 transparent matchgroup=javaParen2 start="\[" end="\]" contains=@javaTop,javaParenT contained
syn match javaParenError "\]"
JavaHiLink javaParenError javaError JavaHiLink javaParenError javaError
if !exists("java_minlines") if !exists("java_minlines")

View File

@ -2,7 +2,7 @@
" Language: JavaScript " Language: JavaScript
" Maintainer: Claudio Fleiner <claudio@fleiner.com> " Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/javascript.vim " URL: http://www.fleiner.com/vim/syntax/javascript.vim
" Last Change: 2004 May 16 " Last Change: 2004 Nov 20
" For version 5.x: Clear all syntax items " For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded " For version 6.x: Quit when a syntax file was already loaded
@ -35,14 +35,15 @@ syn region javaScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"+ conta
syn region javaScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=javaScriptSpecial,@htmlPreproc syn region javaScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=javaScriptSpecial,@htmlPreproc
syn match javaScriptSpecialCharacter "'\\.'" syn match javaScriptSpecialCharacter "'\\.'"
syn match javaScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>" syn match javaScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
syn region javaScriptRegexpString start=+/+ skip=+\\\\\|\\/+ end=+/[gi]\?\s*$+ end=+/[gi]\?\s*[;,)]+me=e-1 contains=@htmlPreproc oneline syn region javaScriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\?\s*$+ end=+/[gi]\?\s*[;.,)]+me=e-1 contains=@htmlPreproc oneline
syn keyword javaScriptConditional if else syn keyword javaScriptConditional if else
syn keyword javaScriptRepeat while for syn keyword javaScriptRepeat while for
syn keyword javaScriptBranch break continue switch case default syn keyword javaScriptBranch break continue switch case default
syn keyword javaScriptOperator new in syn keyword javaScriptOperator new in
syn keyword javaScriptType this var const syn keyword javaScriptType this var const
syn keyword javaScriptStatement return with syn keyword javaScriptStatement return with
syn keyword javaScriptBoolean true false syn keyword javaScriptBoolean true false
syn keyword javaScriptNull null
if exists("javaScript_fold") if exists("javaScript_fold")
syn match javaScriptFunction "\<function\>" syn match javaScriptFunction "\<function\>"
@ -62,7 +63,8 @@ syn sync fromstart
syn sync maxlines=100 syn sync maxlines=100
" catch errors caused by wrong parenthesis " catch errors caused by wrong parenthesis
syn region javaScriptParen transparent start="(" end=")" contains=javaScriptParen,javaScriptComment,javaScriptSpecial,javaScriptStringD,javaScriptStringS,javaScriptSpecialCharacter,javaScriptNumber,javaScriptRegexpString,javaScriptBoolean,javaScriptBraces syn region javaScriptParen transparent start="(" end=")" contains=javaScriptParen,javaScriptComment,javaScriptSpecial,javaScriptStringD,javaScriptStringS,javaScriptSpecialCharacter,javaScriptNumber,javaScriptRegexpString,javaScriptBoolean,javaScriptBraces,javaScriptFunction,javaScriptFunctionFold,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptOperator,javaScriptType,javaScriptStatement,javaScriptBoolean,javaScriptConstant
syn region javaScriptParen transparent start="(" end=")" contains=javaScriptParen,javaScriptComment,javaScriptSpecial,javaScriptStringD,javaScriptStringS,javaScriptSpecialCharacter,javaScriptNumber,javaScriptRegexpString,javaScriptBoolean,javaScriptBraces
syn match javaScrParenError ")" syn match javaScrParenError ")"
if main_syntax == "javascript" if main_syntax == "javascript"
@ -79,27 +81,28 @@ if version >= 508 || !exists("did_javascript_syn_inits")
else else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif endif
HiLink javaScriptComment Comment HiLink javaScriptComment Comment
HiLink javaScriptLineComment Comment HiLink javaScriptLineComment Comment
HiLink javaScriptCommentTodo Todo HiLink javaScriptCommentTodo Todo
HiLink javaScriptSpecial Special HiLink javaScriptSpecial Special
HiLink javaScriptStringS String HiLink javaScriptStringS String
HiLink javaScriptStringD String HiLink javaScriptStringD String
HiLink javaScriptCharacter Character HiLink javaScriptCharacter Character
HiLink javaScriptSpecialCharacter javaScriptSpecial HiLink javaScriptSpecialCharacter javaScriptSpecial
HiLink javaScriptNumber javaScriptValue HiLink javaScriptNumber javaScriptValue
HiLink javaScriptConditional Conditional HiLink javaScriptConditional Conditional
HiLink javaScriptRepeat Repeat HiLink javaScriptRepeat Repeat
HiLink javaScriptBranch Conditional HiLink javaScriptBranch Conditional
HiLink javaScriptOperator Operator HiLink javaScriptOperator Operator
HiLink javaScriptType Type HiLink javaScriptType Type
HiLink javaScriptStatement Statement HiLink javaScriptStatement Statement
HiLink javaScriptFunction Function HiLink javaScriptFunction Function
HiLink javaScriptBraces Function HiLink javaScriptBraces Function
HiLink javaScriptError Error HiLink javaScriptError Error
HiLink javaScrParenError javaScriptError HiLink javaScrParenError javaScriptError
HiLink javaScriptBoolean Boolean HiLink javaScriptNull Keyword
HiLink javaScriptRegexpString String HiLink javaScriptBoolean Boolean
HiLink javaScriptRegexpString String
delcommand HiLink delcommand HiLink
endif endif

View File

@ -1,8 +1,8 @@
" Vim syntax file " Vim syntax file
" Language: Lex " Language: Lex
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
" Last Change: Jul 28, 2004 " Last Change: Nov 26, 2004
" Version: 5 " Version: 6
" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax " URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
" "
" Option: " Option:
@ -56,7 +56,7 @@ syn region lexBrace start="\[" skip=+\\\\\|\\+ end="]" contained
syn region lexPatString matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained syn region lexPatString matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained
syn match lexPatTag "^<\I\i*\(,\I\i*\)*>*" contained nextgroup=lexPat,lexPatTag,lexMorePat,lexPatSep syn match lexPatTag "^<\I\i*\(,\I\i*\)*>*" contained nextgroup=lexPat,lexPatTag,lexMorePat,lexPatSep
syn match lexPatTag +^<\I\i*\(,\I\i*\)*>*\(\\\\\)*\\"+ contained nextgroup=lexPat,lexPatTag,lexMorePat,lexPatSep syn match lexPatTag +^<\I\i*\(,\I\i*\)*>*\(\\\\\)*\\"+ contained nextgroup=lexPat,lexPatTag,lexMorePat,lexPatSep
syn region lexPatComment start="^\s*/\*" end="\*/" skipnl contained contains=cTodo nextgroup=lexPatComment,lexPat,lexPatString,lexPatTag,@Spell syn region lexPatComment start="^\s*/\*" end="\*/" skipnl contained contains=cTodo skipwhite nextgroup=lexPatComment,lexPat,@Spell
syn match lexPatCodeLine ".*$" contained contains=ALLBUT,@lexListGroup syn match lexPatCodeLine ".*$" contained contains=ALLBUT,@lexListGroup
syn match lexMorePat "\s*|\s*$" skipnl contained nextgroup=lexPat,lexPatTag,lexPatComment syn match lexMorePat "\s*|\s*$" skipnl contained nextgroup=lexPat,lexPatTag,lexPatComment
syn match lexPatSep "\s\+" contained nextgroup=lexMorePat,lexPatCode,lexPatCodeLine syn match lexPatSep "\s\+" contained nextgroup=lexMorePat,lexPatCode,lexPatCodeLine

View File

@ -1,9 +1,9 @@
" Lynx syntax file " Lynx syntax file
" Filename: lynx.vim " Filename: lynx.vim
" Language: Lynx configuration file ( lynx.cfg ) " Language: Lynx configuration file ( lynx.cfg )
" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au> " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" URL: http://mugca.its.monash.edu.au/~djkea2/vim/syntax/lynx.vim " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/syntax/lynx.vim
" Last Change: 2003 May 11 " Last Change: 2004 Nov 27
" TODO: more intelligent and complete argument highlighting " TODO: more intelligent and complete argument highlighting

View File

@ -1,8 +1,8 @@
" Vim syntax file " Vim syntax file
" Language: Mailcap configuration file " Language: Mailcap configuration file
" Maintainer: Doug Kearns " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" Last Change: 2002 November 24 " Last Change: 2004 Nov 27
" URL: http://mugca.its.monash.edu.au/~djkea2/vim/syntax/mailcap.vim " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/syntax/mailcap.vim
" For version 5.x: Clear all syntax items " For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded " For version 6.x: Quit when a syntax file was already loaded

View File

@ -1,8 +1,8 @@
" Vim syntax file " Vim syntax file
" Language: Maple V (based on release 4) " Language: Maple V (based on release 4)
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
" Last Change: Aug 19, 2004 " Last Change: Oct 12, 2004
" Version: 5 " Version: 6
" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax " URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
" "
" Package Function Selection: {{{1 " Package Function Selection: {{{1
@ -116,11 +116,12 @@ syn keyword mvPackage VectorCalculus Worksheet XMLTools
syn keyword mvTodo contained TODO syn keyword mvTodo contained TODO
if exists("g:mapleversion") && g:mapleversion < 9 if exists("g:mapleversion") && g:mapleversion < 9
syn region mvString start=+`+ skip=+``+ end=+`+ keepend contains=mvTodo syn region mvString start=+`+ skip=+``+ end=+`+ keepend contains=mvTodo
syn region mvString start=+"+ skip=+""+ end=+"+ keepend
syn region mvDelayEval start=+'+ end=+'+ keepend contains=ALLBUT,mvError,mvBraceError,mvCurlyError,mvParenError,mvSemiError syn region mvDelayEval start=+'+ end=+'+ keepend contains=ALLBUT,mvError,mvBraceError,mvCurlyError,mvParenError,mvSemiError
syn match mvVarAssign "[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:=" contains=mvAssign syn match mvVarAssign "[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:=" contains=mvAssign
syn match mvAssign ":=" contained syn match mvAssign ":=" contained
else else
syn region mvName start=+`+ skip=+``+ end=+`+ keepend contains=mvTodo syn region mvName start=+`+ skip=+``+ end=+`+ keepend contains=mvTodo
syn region mvString start=+"+ skip=+""+ end=+"+ keepend syn region mvString start=+"+ skip=+""+ end=+"+ keepend
syn region mvDelayEval start=+'+ end=+'+ keepend contains=ALLBUT,mvError,mvBraceError,mvCurlyError,mvParenError syn region mvDelayEval start=+'+ end=+'+ keepend contains=ALLBUT,mvError,mvBraceError,mvCurlyError,mvParenError
syn match mvDelim "[;:]" display syn match mvDelim "[;:]" display

View File

@ -1,9 +1,9 @@
" Vim syntax file " Vim syntax file
" Filename: ratpoison.vim " Filename: ratpoison.vim
" Language: Ratpoison configuration/commands file ( /etc/ratpoisonrc ~/.ratpoisonrc ) " Language: Ratpoison configuration/commands file ( /etc/ratpoisonrc ~/.ratpoisonrc )
" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au> " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" URL: http://mugca.its.monash.edu.au/~djkea2/vim/syntax/ratpoison.vim " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/syntax/ratpoison.vim
" Last Change: 2004 Apr 27 " Last Change: 2004 Nov 27
" For version 5.x: Clear all syntax items " For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded " For version 6.x: Quit when a syntax file was already loaded

View File

@ -1,9 +1,9 @@
" Vim syntax file " Vim syntax file
" Language: Ruby " Language: Ruby
" Maintainer: Doug Kearns " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" Previous Maintainer: Mirko Nasato " Previous Maintainer: Mirko Nasato
" Last Change: 2003 May 31 " Last Change: 2004 Nov 27
" URL: http://mugca.its.monash.edu.au/~djkea2/vim/syntax/ruby.vim " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/syntax/ruby.vim
" $Id$ " $Id$

View File

@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: Scheme (R5RS) " Language: Scheme (R5RS)
" Last Change: July 14, 2004 " Last Change: Nov 28, 2004
" Maintainer: Sergey Khorev <iamphet@nm.ru> " Maintainer: Sergey Khorev <sergey.khorev@gmail.com>
" Original author: Dirk van Deun <dirk@igwe.vub.ac.be> " Original author: Dirk van Deun <dirk@igwe.vub.ac.be>
" This script incorrectly recognizes some junk input as numerals: " This script incorrectly recognizes some junk input as numerals:
@ -143,7 +143,7 @@ syn region schemeStruc matchgroup=Delimiter start="\[" matchgroup=Delimiter end=
syn region schemeStruc matchgroup=Delimiter start="#\[" matchgroup=Delimiter end="\]" contains=ALL syn region schemeStruc matchgroup=Delimiter start="#\[" matchgroup=Delimiter end="\]" contains=ALL
" Simple literals: " Simple literals:
syn region schemeString start=+"+ skip=+\\[\\"]+ end=+"+ syn region schemeString start=+\%(\\\)\@<!"+ skip=+\\[\\"]+ end=+"+
" Comments: " Comments:
@ -172,15 +172,16 @@ syn match schemeChar oneline "#\\newline"
syn match schemeError oneline !#\\newline[^ \t\[\]()";]\+! syn match schemeError oneline !#\\newline[^ \t\[\]()";]\+!
if exists("b:is_mzscheme") || exists("is_mzscheme") if exists("b:is_mzscheme") || exists("is_mzscheme")
" MzScheme extensions added by Sergey Khorev " MzScheme extensions
" multiline comment " multiline comment
syntax region schemeMultilineComment start=/#|/ end=/|#/ syn region schemeComment start="#|" end="|#"
" #%xxx are the special MzScheme identifiers " #%xxx are the special MzScheme identifiers
syn match schemeOther oneline "#%[-a-z!$%&*/:<=>?^_~0-9+.@#%]\+" syn match schemeOther oneline "#%[-a-z!$%&*/:<=>?^_~0-9+.@#%]\+"
" anything limited by |'s is identifier " anything limited by |'s is identifier
syn match schemeOther oneline "|[^|]\+|" syn match schemeOther oneline "|[^|]\+|"
syn match schemeChar oneline "#\\return" syn match schemeChar oneline "#\\\%(return\|tab\)"
" Modules require stmt " Modules require stmt
syn keyword schemeExtSyntax module require dynamic-require lib prefix all-except prefix-all-except rename syn keyword schemeExtSyntax module require dynamic-require lib prefix all-except prefix-all-except rename
@ -230,12 +231,19 @@ endif
if exists("b:is_chicken") || exists("is_chicken") if exists("b:is_chicken") || exists("is_chicken")
" multiline comment
syntax region schemeMultilineComment start=/#|/ end=/|#/ contains=schemeMultilineComment
syn match schemeOther oneline "##[-a-z!$%&*/:<=>?^_~0-9+.@#%]\+" syn match schemeOther oneline "##[-a-z!$%&*/:<=>?^_~0-9+.@#%]\+"
syn match schemeExtSyntax oneline "#:[-a-z!$%&*/:<=>?^_~0-9+.@#%]\+" syn match schemeExtSyntax oneline "#:[-a-z!$%&*/:<=>?^_~0-9+.@#%]\+"
syn keyword schemeExtSyntax unit uses declare hide foreign-declare foreign-parse foreign-parse/spec syn keyword schemeExtSyntax unit uses declare hide foreign-declare foreign-parse foreign-parse/spec
syn keyword schemeExtSyntax foreign-lambda foreign-lambda* syn keyword schemeExtSyntax foreign-lambda foreign-lambda* define-external define-macro load-library
syn keyword schemeExtSyntax let-optionals let-optionals* define-foreign-variable syn keyword schemeExtSyntax let-values let*-values letrec-values ->string require-extension
syn keyword schemeExtSyntax let-optionals let-optionals* define-foreign-variable define-record
syn keyword schemeExtSyntax pointer tag-pointer tagged-pointer? define-foreign-type
syn keyword schemeExtSyntax require require-for-syntax cond-expand and-let* receive argc+argv
syn keyword schemeExtSyntax fixnum? fx= fx> fx< fx>= fx<= fxmin fxmax
syn keyword schemeExtFunc ##core#inline ##sys#error ##sys#update-errno syn keyword schemeExtFunc ##core#inline ##sys#error ##sys#update-errno
" here-string " here-string

View File

@ -2,8 +2,8 @@
" Language: shell (sh) Korn shell (ksh) bash (sh) " Language: shell (sh) Korn shell (ksh) bash (sh)
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int> " Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
" Last Change: Jul 26, 2004 " Last Change: Oct 17, 2004
" Version: 69 " Version: 70
" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax " URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
" "
" Using the following VIM variables: {{{1 " Using the following VIM variables: {{{1
@ -53,6 +53,9 @@ endif
if !exists("g:sh_fold_enabled") if !exists("g:sh_fold_enabled")
let g:sh_fold_enabled= 0 let g:sh_fold_enabled= 0
elseif g:sh_fold_enabled != 0 && !has("folding")
let g:sh_fold_enabled= 0
echomsg "Ignoring g:sh_fold_enabled=".g:sh_fold_enabled."; re-compile vim for +fold support"
endif endif
" sh syntax is case sensitive " sh syntax is case sensitive
@ -344,7 +347,7 @@ syn match bkshFunctionDelim "[{}]" contained
" Parameter Dereferencing: {{{1 " Parameter Dereferencing: {{{1
" ======================== " ========================
syn match shDerefSimple "\$\w\+" syn match shDerefSimple "\$\%(\h\w*\|\d\)"
syn region shDeref matchgroup=PreProc start="\${" end="}" contains=@shDerefList,shDerefVarArray syn region shDeref matchgroup=PreProc start="\${" end="}" contains=@shDerefList,shDerefVarArray
syn match shDerefWordError "[^}$[]" contained syn match shDerefWordError "[^}$[]" contained
syn match shDerefSimple "\$[-#*@!?]" syn match shDerefSimple "\$[-#*@!?]"

70
runtime/syntax/sieve.vim Normal file
View File

@ -0,0 +1,70 @@
" Vim syntax file
" Maintainer: Nikolai Weibull <source@pcppopper.org>
" URL: http://www.pcppopper.org/
" Latest Revision: 2004-11-11
" arch-tag: 356fad6d-ff6b-453c-bd25-7fc63c4758bc
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" Todo
syn keyword sieveTodo contained TODO FIXME XXX NOTE
" Comments
syn region sieveComment matchgroup=sieveComment start='/\*' end='\*/' contains=sieveTodo
syn region sieveComment matchgroup=sieveComment start='#' end='$' contains=sieveTodo
syn case ignore
" Tags
syn match sieveTag ':\h\w*'
" Numbers
syn match sieveNumber '\d\+[KMG]\='
" Specials
syn match sieveSpecial '\\["\\]'
" Strings
syn region sieveString matchgroup=sieveString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=sieveSpecial
syn region sieveString matchgroup=sieveString start='text:' end='\n.\n'
" Keywords
syn keyword sieveConditional if elsif else
syn keyword sieveTest address allof anyof envelope exists false header not size true
syn keyword sievePreProc require stop
syn keyword sieveAction reject fileinto redirect keep discard
syn match sieveKeyword '\<\h\w*\>'
" 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_sieve_syn_inits")
if version < 508
let did_sieve_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink sieveTodo Todo
HiLink sieveComment Comment
HiLink sieveTag Type
HiLink sieveNumber Number
HiLink sieveSpecial Special
HiLink sieveString String
HiLink sieveConditional Conditional
HiLink sieveTest Keyword
HiLink sievePreProc PreProc
HiLink sieveAction Keyword
HiLink sieveKeyword Keyword
delcommand HiLink
endif
let b:current_syntax = "sieve"
" vim: set sts=2 sw=2:

View File

@ -1,8 +1,8 @@
" Vim syntax file " Vim syntax file
" Language: TeX " Language: TeX
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
" Last Change: Jun 15, 2004 " Last Change: Oct 13, 2004
" Version: 25 " Version: 26
" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax " URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
" "
" Notes: {{{1 " Notes: {{{1
@ -112,7 +112,7 @@ else
syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup
syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup
endif endif
syn region texParen start="(" end=")" contains=@texMatchGroup syn region texParen start="(" end=")" contains=@texMatchGroup,@Spell
if !exists("g:tex_no_error") if !exists("g:tex_no_error")
syn match texError "[}\])]" syn match texError "[}\])]"
endif endif
@ -233,9 +233,24 @@ syn match texSpaceCode "\\\(math\|cat\|del\|lc\|sf\|uc\)code`"me=e-1 nextgroup=
syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained
" Sections, subsections, etc: {{{1 " Sections, subsections, etc: {{{1
syn match texSection "\\\(sub\)*section\*\=\>" if exists("tex_dosynfolds") && has("folding")
syn match texSection "\\\(title\|author\|part\|chapter\|paragraph\|subparagraph\)\>" " COMBAK -- this folding doesn't work as expected as yet
syn match texSection "\\begin\s*{\s*abstract\s*}\|\\end\s*{\s*abstract\s*}" syn region Red matchgroup=texSection start="\\section\*\=\>" end="\\\%(sub\)*\%(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>"me=s end="%\s*stopzone\>" fold
" syn region Red matchgroup=texSection start="\\section\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" end="%\s*stopzone\>" contains=TOP fold
" syn region Blue matchgroup=texSection start="\\subsection\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
" syn region texSectionZone matchgroup=texSection start="\\subsubsection\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
" syn region texSectionZone matchgroup=texSection start="\\title\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
" syn region texSectionZone matchgroup=texSection start="\\author\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
" syn region texSectionZone matchgroup=texSection start="\\part\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
" syn region texSectionZone matchgroup=texSection start="\\chapter\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
" syn region texSectionZone matchgroup=texSection start="\\paragraph\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
" syn region texSectionZone matchgroup=texSection start="\\subparagraph\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
" syn region texSectionZone matchgroup=texSection start="\\begin\s*{\s*abstract\s*}" end="\\end\s*{\s*abstract\s*}" contains=TOP fold
else
syn match texSection "\\\(sub\)*section\*\=\>"
syn match texSection "\\\(title\|author\|part\|chapter\|paragraph\|subparagraph\)\>"
syn match texSection "\\begin\s*{\s*abstract\s*}\|\\end\s*{\s*abstract\s*}"
endif
" Bad Math (mismatched): {{{1 " Bad Math (mismatched): {{{1
if !exists("tex_no_math") if !exists("tex_no_math")

View File

@ -1,9 +1,9 @@
" Vim syntax file " Vim syntax file
" Filename: tidy.vim " Filename: tidy.vim
" Language: HMTL Tidy configuration file ( /etc/tidyrc ~/.tidyrc ) " Language: HMTL Tidy configuration file ( /etc/tidyrc ~/.tidyrc )
" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au> " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" URL: http://mugca.its.monash.edu.au/~djkea2/vim/syntax/tidy.vim " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/syntax/tidy.vim
" Last Change: 2002 Oct 24 " Last Change: 2004 Nov 27
" For version 5.x: Clear all syntax items " For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded " For version 6.x: Quit when a syntax file was already loaded

View File

@ -2,7 +2,7 @@
" Language: tpp - Text Presentation Program " Language: tpp - Text Presentation Program
" Maintainer: Gerfried Fuchs <alfie@ist.org> " Maintainer: Gerfried Fuchs <alfie@ist.org>
" Filenames: *.tpp " Filenames: *.tpp
" Last Change: 13. October 2004 " Last Change: 28. October 2004
" URL: http://alfie.ist.org/projects/vim/syntax/tpp.vim " URL: http://alfie.ist.org/projects/vim/syntax/tpp.vim
" License: BSD " License: BSD
" "
@ -25,7 +25,7 @@ endif
"" list of the legal switches/options "" list of the legal switches/options
syn match tppAbstractOptionKey contained "^--\%(author\|title\|date\) *" nextgroup=tppValue syn match tppAbstractOptionKey contained "^--\%(author\|title\|date\) *" nextgroup=tppValue
syn match tppPageLocalOptionKey contained "^--\%(heading\|center\|right\|sleep\|huge\|exec\) *" nextgroup=tppValue syn match tppPageLocalOptionKey contained "^--\%(heading\|center\|right\|huge\|sethugefont\|exec\) *" nextgroup=tppValue
syn match tppPageLocalSwitchKey contained "^--\%(horline\|-\|\%(begin\|end\)\%(\%(shell\)\?output\|slide\%(left\|right\|top\|bottom\)\)\|\%(bold\|rev\|ul\)\%(on\|off\)\|withborder\)" syn match tppPageLocalSwitchKey contained "^--\%(horline\|-\|\%(begin\|end\)\%(\%(shell\)\?output\|slide\%(left\|right\|top\|bottom\)\)\|\%(bold\|rev\|ul\)\%(on\|off\)\|withborder\)"
syn match tppNewPageOptionKey contained "^--newpage *" nextgroup=tppValue syn match tppNewPageOptionKey contained "^--newpage *" nextgroup=tppValue
syn match tppColorOptionKey contained "^--\%(\%(bg\|fg\)\?color\) *" syn match tppColorOptionKey contained "^--\%(\%(bg\|fg\)\?color\) *"
@ -39,7 +39,7 @@ syn region tppPageLocalSwitch start="^--" end="$" contains=tppPageLocalSwitchKey
syn region tppColorOption start="^--\%(\%(bg\|fg\)\?color\)" end="$" contains=tppColorOptionKey,tppColor oneline syn region tppColorOption start="^--\%(\%(bg\|fg\)\?color\)" end="$" contains=tppColorOptionKey,tppColor oneline
syn region tppTimeOption start="^--sleep" end="$" contains=tppTimeOptionKey,tppTime oneline syn region tppTimeOption start="^--sleep" end="$" contains=tppTimeOptionKey,tppTime oneline
syn region tppNewPageOption start="^--newpage" end="$" contains=tppNewPageOptionKey oneline syn region tppNewPageOption start="^--newpage" end="$" contains=tppNewPageOptionKey oneline
syn region tppPageLocalOption start="^--\%(heading\|center\|right\|sleep\|huge\|exec\)" end="$" contains=tppPageLocalOptionKey oneline syn region tppPageLocalOption start="^--\%(heading\|center\|right\|huge\|sethugefont\|exec\)" end="$" contains=tppPageLocalOptionKey oneline
syn region tppAbstractOption start="^--\%(author\|title\|date\)" end="$" contains=tppAbstractOptionKey oneline syn region tppAbstractOption start="^--\%(author\|title\|date\)" end="$" contains=tppAbstractOptionKey oneline
if main_syntax != 'sh' if main_syntax != 'sh'
@ -55,6 +55,7 @@ if main_syntax != 'sh'
endif endif
syn match tppComment "^--##.*$"
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " For version 5.7 and earlier: only when not done already
@ -76,6 +77,7 @@ if version >= 508 || !exists("did_tpp_syn_inits")
HiLink tppValue String HiLink tppValue String
HiLink tppColor String HiLink tppColor String
HiLink tppTime Number HiLink tppTime Number
HiLink tppComment Comment
HiLink tppAbstractOption Error HiLink tppAbstractOption Error
HiLink tppPageLocalOption Error HiLink tppPageLocalOption Error
HiLink tppPageLocalSwitch Error HiLink tppPageLocalSwitch Error

View File

@ -1,8 +1,8 @@
" Vim syntax file " Vim syntax file
" Language: Vim 7.0 script " Language: Vim 7.0 script
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
" Last Change: July 12, 2004 " Last Change: December 07, 2004
" Version: 7.0-01 NOT RELEASED " Version: 7.0-02 NOT RELEASED
" Automatically generated keyword lists: {{{1 " Automatically generated keyword lists: {{{1
" Quit when a syntax file was already loaded {{{2 " Quit when a syntax file was already loaded {{{2
@ -16,7 +16,7 @@ syn keyword vimTodo contained COMBAK NOT RELEASED TODO WIP
syn cluster vimCommentGroup contains=vimTodo syn cluster vimCommentGroup contains=vimTodo
" regular vim commands {{{2 " regular vim commands {{{2
syn keyword vimCommand contained ab[breviate] abc[lear] abo[veleft] al[l] arga[dd] argd[elete] argdo arge[dit] argg[lobal] argl[ocal] ar[gs] argu[ment] as[cii] bad[d] ba[ll] bd[elete] be bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bN[ext] bo[tright] bp[revious] brea[k] breaka[dd] breakd[el] breakl[ist] br[ewind] bro[wse] bufdo b[uffer] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cal[l] cat[ch] cc ccl[ose] cd ce[nter] cf[ile] cfir[st] cg[etfile] c[hange] changes chd[ir] che[ckpath] checkt[ime] cla[st] cl[ist] clo[se] cmapc[lear] cnew[er] cn[ext] cN[ext] cnf[ile] cNf[ile] cnorea[bbrev] col[der] colo[rscheme] comc[lear] comp[iler] conf[irm] con[tinue] cope[n] co[py] cpf[ile] cp[revious] cq[uit] cr[ewind] cuna[bbrev] cu[nmap] cw[indow] debugg[reedy] delc[ommand] d[elete] DeleteFirst delf[unction] diffg[et] diffpatch diffpu[t] diffsplit diffthis dig[raphs] di[splay] dj[ump] dl[ist] dr[op] ds[earch] dsp[lit] echoe[rr] echom[sg] echon e[dit] el[se] elsei[f] em[enu] emenu* endf[unction] en[dif] endt[ry] endw[hile] ene[w] ex exi[t] f[ile] files filetype fina[lly] fin[d] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] folddoc[losed] foldd[oopen] foldo[pen] fu[nction] g[lobal] go[to] gr[ep] grepa[dd] ha[rdcopy] h[elp] helpf[ind] helpg[rep] helpt[ags] hid[e] his[tory] I ia[bbrev] iabc[lear] if ij[ump] il[ist] imapc[lear] inorea[bbrev] is[earch] isp[lit] iuna[bbrev] iu[nmap] j[oin] ju[mps] k keepj[umps] kee[pmarks] lan[guage] la[st] lc[d] lch[dir] le[ft] lefta[bove] l[ist] lm[ap] lmapc[lear] ln[oremap] lo[adview] loc[kmarks] ls lu[nmap] mak[e] ma[rk] marks mat[ch] menut[ranslate] mk[exrc] mks[ession] mkvie[w] mkv[imrc] mod[e] m[ove] mzf[ile] mz[scheme] new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] norm[al] Nread nu[mber] nun[map] Nw omapc[lear] on[ly] o[pen] opt[ions] ou[nmap] pc[lose] ped[it] pe[rl] perld[o] po[p] popu popu[p] pp[op] pre[serve] prev[ious] p[rint] P[rint] prompt promptf[ind] promptr[epl] ps[earch] pta[g] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptN[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] pyf[ile] py[thon] qa[ll] q[uit] quita[ll] r[ead] rec[over] redi[r] red[o] redr[aw] redraws[tatus] reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] rub[y] rubyd[o] rubyf[ile] ru[ntime] rv[iminfo] sal[l] sa[rgument] sav[eas] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbN[ext] sbp[revious] sbr[ewind] sb[uffer] scripte[ncoding] scrip[tnames] se[t] setf[iletype] setg[lobal] setl[ocal] sf[ind] sfir[st sh[ell] sign sil[ent] sim[alt] sla[st] sl[eep] sm[agic] sn[ext] sN[ext] sni[ff] sno[magic] so[urce] sp[lit] spr[evious] sre[wind] sta[g] star[tinsert] startr[eplace] stj[ump] st[op] stopi[nsert] sts[elect] sun[hide] sus[pend] sv[iew] syn syncbind t ta[g] tags tc[l] tcld[o] tclf[ile] te[aroff] tf[irst] the th[row] tj[ump] tl[ast] tm tm[enu] tn[ext] tN[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu tu[nmenu] una[bbreviate] u[ndo] unh[ide] unm[ap] up[date] verb[ose] ve[rsion] vert[ical] v[global] vie[w] vi[sual] vmapc[lear] vne[w] vs[plit] vu[nmap] wa[ll] wh[ile] winc[md] windo winp[os] winpos* win[size] wn[ext] wN[ext] wp[revous] wq wqa[ll] w[rite] ws[verb] wv[iminfo] X xa[ll] x[it] y[ank] syn keyword vimCommand contained ab[breviate] abc[lear] abo[veleft] al[l] arga[dd] argd[elete] argdo arge[dit] argg[lobal] argl[ocal] ar[gs] argu[ment] as[cii] bad[d] ba[ll] bd[elete] be bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bN[ext] bo[tright] bp[revious] brea[k] breaka[dd] breakd[el] breakl[ist] br[ewind] bro[wse] bufdo b[uffer] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cal[l] cat[ch] cc ccl[ose] cd ce[nter] cf[ile] cfir[st] cg[etfile] c[hange] changes chd[ir] che[ckpath] checkt[ime] cla[st] cl[ist] clo[se] cmapc[lear] cnew[er] cn[ext] cN[ext] cnf[ile] cNf[ile] cnorea[bbrev] col[der] colo[rscheme] comc[lear] comp[iler] conf[irm] con[tinue] cope[n] co[py] cpf[ile] cp[revious] cq[uit] cr[ewind] cuna[bbrev] cu[nmap] cw[indow] debugg[reedy] delc[ommand] d[elete] DeleteFirst delf[unction] delm[arks] diffg[et] diffoff diffpatch diffpu[t] diffsplit diffthis dig[raphs] di[splay] dj[ump] dl[ist] dr[op] ds[earch] dsp[lit] echoe[rr] echom[sg] echon e[dit] el[se] elsei[f] em[enu] emenu* endf[unction] en[dif] endt[ry] endw[hile] ene[w] ex exi[t] f[ile] files filetype fina[lly] fin[d] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] folddoc[losed] foldd[oopen] foldo[pen] fu[nction] g[lobal] go[to] gr[ep] grepa[dd] ha[rdcopy] h[elp] helpf[ind] helpg[rep] helpt[ags] hid[e] his[tory] I ia[bbrev] iabc[lear] if ij[ump] il[ist] imapc[lear] inorea[bbrev] is[earch] isp[lit] iuna[bbrev] iu[nmap] j[oin] ju[mps] k keepalt keepj[umps] kee[pmarks] lan[guage] la[st] lc[d] lch[dir] le[ft] lefta[bove] l[ist] lm[ap] lmapc[lear] ln[oremap] lo[adview] loc[kmarks] ls lu[nmap] mak[e] ma[rk] marks mat[ch] menut[ranslate] mk[exrc] mks[ession] mkvie[w] mkv[imrc] mod[e] m[ove] mzf[ile] mz[scheme] new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] Nread nu[mber] nun[map] Nw omapc[lear] on[ly] o[pen] opt[ions] ou[nmap] pc[lose] ped[it] pe[rl] perld[o] po[p] popu popu[p] pp[op] pre[serve] prev[ious] p[rint] P[rint] prompt promptf[ind] promptr[epl] ps[earch] pta[g] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptN[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] pyf[ile] py[thon] qa[ll] q[uit] quita[ll] r[ead] rec[over] redi[r] red[o] redr[aw] redraws[tatus] reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] rub[y] rubyd[o] rubyf[ile] ru[ntime] rv[iminfo] sal[l] sandbox sa[rgument] sav[eas] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbN[ext] sbp[revious] sbr[ewind] sb[uffer] scripte[ncoding] scrip[tnames] se[t] setf[iletype] setg[lobal] setl[ocal] sf[ind] sfir[st sh[ell] sign sil[ent] sim[alt] sla[st] sl[eep] sm[agic] sn[ext] sN[ext] sni[ff] sno[magic] so[urce] sp[lit] spr[evious] sre[wind] sta[g] star[tinsert] startr[eplace] stj[ump] st[op] stopi[nsert] sts[elect] sun[hide] sus[pend] sv[iew] syncbind t ta[g] tags tc[l] tcld[o] tclf[ile] te[aroff] tf[irst] the th[row] tj[ump] tl[ast] tm tm[enu] tn[ext] tN[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu tu[nmenu] una[bbreviate] u[ndo] unh[ide] unm[ap] up[date] verb[ose] ve[rsion] vert[ical] v[global] vie[w] vi[sual] vmapc[lear] vne[w] vs[plit] vu[nmap] wa[ll] wh[ile] winc[md] windo winp[os] winpos* win[size] wn[ext] wN[ext] wp[revous] wq wqa[ll] w[rite] ws[verb] wv[iminfo] X xa[ll] x[it] y[ank]
syn match vimCommand contained "\<z[-+^.=]" syn match vimCommand contained "\<z[-+^.=]"
" vimOptions are caught only when contained in a vimSet {{{2 " vimOptions are caught only when contained in a vimSet {{{2
@ -51,11 +51,13 @@ syn keyword vimGroup contained Comment Constant String Character Number Boolean
" Default highlighting groups {{{2 " Default highlighting groups {{{2
syn keyword vimHLGroup contained Cursor CursorIM DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr Menu ModeMsg MoreMsg NonText Normal Question Scrollbar Search SignColumn SpecialKey StatusLine StatusLineNC Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu syn keyword vimHLGroup contained Cursor CursorIM DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr Menu ModeMsg MoreMsg NonText Normal Question Scrollbar Search SignColumn SpecialKey StatusLine StatusLineNC Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu
syn match vimHLGroup contained "Conceal"
syn case match syn case match
" Function Names {{{2 " Function Names {{{2
syn keyword vimFuncName contained append argc argidx argv browse bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line char2nr cindent col confirm cscope_connection cursor delete did_filetype escape eventhandler executable exists expand filereadable filewritable fnamemodify foldclosed foldclosedend foldlevel foldtext foreground function getbufvar getchar getcharmod getcmdline getcmdpos getcwd getfsize getftime getline getreg getregtype getwinposx getwinposy getwinvar glob globpath has hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent input inputdialog inputrestore inputsave inputsecret isdirectory libcall libcallnr line line2byte lispindent localtime maparg mapcheck match matchend matchstr mode nextnonblank nr2char prevnonblank remote_expr remote_foreground remote_peek remote_read remote_send rename resolve search searchpair server2client serverlist setbufvar setcmdpos setline setreg setwinvar simplify strftime stridx strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system tempname tolower toupper tr type virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winwidth syn keyword vimFuncName contained append argc argidx argv browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx char2nr cindent col confirm cscope_connection cursor delete did_filetype diff_filler diff_hlID escape eventhandler executable exists expand filereadable filewritable finddir findfile fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreground function getbufvar getchar getcharmod getcmdline getcmdpos getcwd getfperm getfsize getftime getftype getline getreg getregtype getwinposx getwinposy getwinvar glob globpath has hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent input inputdialog inputrestore inputsave inputsecret isdirectory libcall libcallnr line line2byte lispindent localtime maparg mapcheck match matchend matchstr mode nextnonblank nr2char prevnonblank remote_expr remote_foreground remote_peek remote_read remote_send rename repeat resolve search searchpair server2client serverlist setbufvar setcmdpos setline setreg setwinvar simplify strftime stridx strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system tempname tolower toupper tr type virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winwidth
"--- syntax above generated by mkvimvim ---
"--- syntax above generated by mkvimvim --- "--- syntax above generated by mkvimvim ---
" Special Vim Highlighting (not automatic) {{{1 " Special Vim Highlighting (not automatic) {{{1
@ -68,7 +70,7 @@ syn match vimNumber "#\x\{6}"
" All vimCommands are contained by vimIsCommands. {{{2 " All vimCommands are contained by vimIsCommands. {{{2
syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd
syn match vimIsCommand "\<\a\+\>" contains=vimCommand syn match vimIsCommand "\<\h\w*\>" contains=vimCommand
syn match vimVar "\<[bwglsav]:\K\k*\>" syn match vimVar "\<[bwglsav]:\K\k*\>"
syn match vimVar contained "\<\K\k*\>" syn match vimVar contained "\<\K\k*\>"
@ -88,7 +90,7 @@ endif
" Filetypes {{{2 " Filetypes {{{2
" ========= " =========
syn match vimFiletype "\<filet\%[ype]\(\s\+\I\i*\)*\(|\|$\)" skipwhite contains=vimFTCmd,vimFTOption,vimFTError syn match vimFiletype "\<filet\%[ype]\(\s\+\I\i*\)*" skipwhite contains=vimFTCmd,vimFTOption,vimFTError
if !exists("g:vimsyntax_noerror") if !exists("g:vimsyntax_noerror")
syn match vimFTError contained "\I\i*" syn match vimFTError contained "\I\i*"
endif endif
@ -126,6 +128,7 @@ syn cluster vimOperGroup contains=vimOper,vimOperParen,vimNumber,vimString,vimOp
syn match vimOper "\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
syn match vimOper "||\|&&\|[-+.]" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "||\|&&\|[-+.]" skipwhite nextgroup=vimString,vimSpecFile
syn region vimOperParen oneline matchgroup=vimOper start="(" end=")" contains=@vimOperGroup syn region vimOperParen oneline matchgroup=vimOper start="(" end=")" contains=@vimOperGroup
syn region vimOperParen oneline matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar
syn match vimOperOk "\<[aiAIrR][()]" syn match vimOperOk "\<[aiAIrR][()]"
if !exists("g:vimsyntax_noerror") if !exists("g:vimsyntax_noerror")
syn match vimOperError ")" syn match vimOperError ")"
@ -242,7 +245,7 @@ syn match vimFilter contained "^!.\{-}\(|\|$\)" contains=vimSpecFile
syn match vimFilter contained "\A!.\{-}\(|\|$\)"ms=s+1 contains=vimSpecFile syn match vimFilter contained "\A!.\{-}\(|\|$\)"ms=s+1 contains=vimSpecFile
" Complex repeats (:h complex-repeat) {{{2 " Complex repeats (:h complex-repeat) {{{2
syn match vimCmplxRepeat '[^a-zA-Z_/\\]q[0-9a-zA-Z"]'lc=1 syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]'lc=1
syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\)' syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\)'
" Set command and associated set-options (vimOptions) with comment {{{2 " Set command and associated set-options (vimOptions) with comment {{{2
@ -266,7 +269,7 @@ syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vim
" Echo and Execute -- prefer strings! {{{2 " Echo and Execute -- prefer strings! {{{2
" ================ " ================
syn region vimEcho oneline excludenl matchgroup=vimCommand start="\<ec\%[ho]\>" skip="\(\\\\\)*\\|" end="$\||" contains=vimFunc,vimString,varVar syn region vimEcho oneline excludenl matchgroup=vimCommand start="\<ec\%[ho]\>" skip="\(\\\\\)*\\|" end="$\||" contains=vimFunc,vimString,varVar
syn region vimExecute oneline excludenl matchgroup=vimCommand start="\<exe\%[cute]\>" skip="\(\\\\\)*\\|" end="$\||\|<[cC][rR]>" contains=vimIsCommand,vimString,vimOper,vimVar,vimNotation syn region vimExecute oneline excludenl matchgroup=vimCommand start="\<exe\%[cute]\>" skip="\(\\\\\)*\\|" end="$\||\|<[cC][rR]>" contains=vimIsCommand,vimString,vimOper,vimVar,vimNotation,vimOperParen
syn match vimEchoHL "echohl\=" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchoHLNone syn match vimEchoHL "echohl\=" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchoHLNone
syn case ignore syn case ignore
syn keyword vimEchoHLNone none syn keyword vimEchoHLNone none

View File

@ -1,9 +1,9 @@
" Wget syntax file " Wget syntax file
" Filename: wget.vim " Filename: wget.vim
" Language: Wget configuration file ( /etc/wgetrc ~/.wgetrc ) " Language: Wget configuration file ( /etc/wgetrc ~/.wgetrc )
" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au> " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" URL: http://mugca.its.monash.edu.au/~djkea2/vim/syntax/wget.vim " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/syntax/wget.vim
" Last Change: 2003 May 11 " Last Change: 2004 Nov 27
" TODO: all commands are actually underscore and hyphen insensitive, though " TODO: all commands are actually underscore and hyphen insensitive, though
" they are normally named as listed below " they are normally named as listed below

View File

@ -67,7 +67,7 @@ Bemerkung: Die Cursor-Tasten sollten ebenfalls funktionieren. Aber wenn Du
Wenn Du die Änderungen speichern und beenden willst, tippe: Wenn Du die Änderungen speichern und beenden willst, tippe:
:wq <ENTER> :wq <ENTER>
3. Wenn Du die Eingabeaufforderung siehst, tippe das Kommando, dass Dich zu 3. Wenn Du die Eingabeaufforderung siehst, tippe das Kommando, das Dich zu
diesem Tutor geführt hat. Das könnte sein: vimtutor <ENTER> diesem Tutor geführt hat. Das könnte sein: vimtutor <ENTER>
Im Normalfall würdest Du eingeben Vim tutor <ENTER> Im Normalfall würdest Du eingeben Vim tutor <ENTER>
@ -299,11 +299,11 @@ Bemerkung: F
Lektion 3.1: ANFÜGEN (PUT) Lektion 3.1: ANFÜGEN (PUT)
** Tippe p ,um das zuletzt Gelöschte nach dem Cursor anzufügen. ** ** Tippe p , um das zuletzt Gelöschte nach dem Cursor anzufügen. **
1. Bewege den Cursor zur ersten Zeile des unten stehenden Sinnspruchs. 1. Bewege den Cursor zur ersten Zeile des unten stehenden Sinnspruchs.
2. Tippe dd , um die Zeile zu löschen und sie im Vims Puffer zu speichern. 2. Tippe dd , um die Zeile zu löschen und sie in Vims Puffer zu speichern.
3. Bewege den Cursor zur Zeile ÜBER derjenigen, 3. Bewege den Cursor zur Zeile ÜBER derjenigen,
wo die gelöschte Zeile platziert werden soll. wo die gelöschte Zeile platziert werden soll.
@ -350,7 +350,7 @@ Bemerkung: Erinnere Dich, dass Du durch Anwenden lernen solltest, nicht durch
1. Bewege den Cursor zur ersten unten stehenden, mit ---> markierten Zeile. 1. Bewege den Cursor zur ersten unten stehenden, mit ---> markierten Zeile.
2. Plaziere den Cursor auf das s von Wstwr. 2. Platziere den Cursor auf das s von Wstwr.
3. Tippe cw und die Wortkorrektur ein (in diesem Fall, tippe 'örter'.) 3. Tippe cw und die Wortkorrektur ein (in diesem Fall, tippe 'örter'.)
@ -372,7 +372,7 @@ Bemerke, dass cw nicht nur das Wort ersetzt, sondern Dich au
** Das change-Kommando arbeitet mit denselben Objekten wie delete ** ** Das change-Kommando arbeitet mit denselben Objekten wie delete **
1. Das change Kommando arbeitet gleicher Weise wie delete. Das Format ist: 1. Das change Kommando arbeitet in gleicher Weise wie delete. Das Format ist:
[Nummer] c Objekt ODER c [Nummer] Objekt [Nummer] c Objekt ODER c [Nummer] Objekt
@ -393,7 +393,7 @@ Bemerke, dass cw nicht nur das Wort ersetzt, sondern Dich au
ZUSAMMENFASSUNG VON LEKTION 3 ZUSAMMENFASSUNG VON LEKTION 3
1. Um einen vorher gelöschten Text anzufügen, tippe p . Diese fügt den 1. Um einen vorher gelöschten Text anzufügen, tippe p . Dies fügt den
gelöschten Text NACH dem Cursor an (wenn es sich um eine ganze Zeile gelöschten Text NACH dem Cursor an (wenn es sich um eine ganze Zeile
handelt, wird ab der Zeile unter dem Cursor eingefügt). handelt, wird ab der Zeile unter dem Cursor eingefügt).
@ -463,7 +463,7 @@ Nun fahre mit der n
** Tippe % , um eine korrespondierende Klammer ),], oder } zu finden. ** ** Tippe % , um eine korrespondierende Klammer ),], oder } zu finden. **
1. Plaziere den Cursor auf irgendeinem der Zeichen (, [, oder { 1. Platziere den Cursor auf irgendeinem der Zeichen (, [, oder {
in der unten stehenden Zeile, die mit ---> markiert ist. in der unten stehenden Zeile, die mit ---> markiert ist.
2. Nun tippe das % Zeichen. 2. Nun tippe das % Zeichen.
@ -612,7 +612,7 @@ Bemerkung: Diese Funktionalit
1. Tippe :!ls bzw. !dir , um sicherzustellen, dass Deine Datei TEST 1. Tippe :!ls bzw. !dir , um sicherzustellen, dass Deine Datei TEST
von vorhin vorhanden ist. von vorhin vorhanden ist.
2. Plaziere den Cursor auf der ersten Zeile dieses Kapitels. 2. Platziere den Cursor auf der ersten Zeile dieses Kapitels.
BEACHTE: Nachdem Du Schritt 3 ausgeführt hast, wirst Du Lektion 5.3 sehen. BEACHTE: Nachdem Du Schritt 3 ausgeführt hast, wirst Du Lektion 5.3 sehen.
An diesem Punkt bewege Dich wieder ABWÄRTS zu dieser Lektion. An diesem Punkt bewege Dich wieder ABWÄRTS zu dieser Lektion.
@ -706,7 +706,7 @@ Bemerkung: Dies macht es
1. Bewege den Cursor zur ersten unten stehenden, mit ---> markierten Zeile. 1. Bewege den Cursor zur ersten unten stehenden, mit ---> markierten Zeile.
2. Plaziere den Cursor auf den Anfang des ersten Wortes, welches sich von 2. Platziere den Cursor auf den Anfang des ersten Wortes, welches sich von
der zweiten mit ---> markierten Zeile unterscheidet (das Wort 'benutze'). der zweiten mit ---> markierten Zeile unterscheidet (das Wort 'benutze').
3. Nun gib ein R ein, und ersetze den Rest des Textes auf der ersten 3. Nun gib ein R ein, und ersetze den Rest des Textes auf der ersten
@ -825,11 +825,19 @@ Du kannst all Deine Lieblingsoptionen zu dieser "vimrc" - Datei zuf
Für weiteres Lesen und Lernen kann folgendes Buch empfohlen werden: Für weiteres Lesen und Lernen kann folgendes Buch empfohlen werden:
Vim - Vi Improved - von Steve Oualline Vim - Vi Improved - von Steve Oualline
Verlag: New Riders Verlag: New Riders
Das erste Buch, dass durchgängig Vim gewidmet ist. Besonders nützlich Das erste Buch, das durchgängig Vim gewidmet ist. Besonders nützlich
für Anfänger. für Anfänger.
Viele Beispiele und Bilder sind enthalten. Viele Beispiele und Bilder sind enthalten.
Siehe http://www.iccf.nl/click5.html Siehe http://www.iccf.nl/click5.html
Als aktuelle Referenz f�r Version 6.2 und knappe Einf�hrung dient das
folgende Buch:
vim ge-packt von Reinhard Wobst
mitp-Verlag, ISBN 3-8266-1425-9
Trotz der kompakten Darstellung ist es durch viele n�tzliche Beispiele auch
f�r Einsteiger empfehlenswert. Probekapitel und die Beispielskripte sind
online erh�ltlich. Siehe http://www.iccf.nl/click5.html
Folgendes Buch ist älter und mehr über Vi als Vim, aber auch empfehlenswert: Folgendes Buch ist älter und mehr über Vi als Vim, aber auch empfehlenswert:
Linda Lamb und Arnold Robbins Linda Lamb und Arnold Robbins
Textbearbeitung mit dem vi-Editor Textbearbeitung mit dem vi-Editor

View File

@ -2,18 +2,16 @@
# Makefile for Vim on RISC OS - Andy Wingate # Makefile for Vim on RISC OS - Andy Wingate
# #
GCC = gcc -mthrowback GCC = gcc -mthrowback
CFLAGS = -DRISCOS -DFEAT_GUI CFLAGS = -DRISCOS -DFEAT_GUI
# Optimising on ex_docmd.c seems to cause segfaults on compilation. Needs investigation. CC = $(GCC) $(CFLAGS) -O2
CCEX_DOCMD = $(GCC) $(CFLAGS)
CC = $(GCC) $(CFLAGS) -O2
# -DUP_BC_PC_EXTERN for term.c needed as BC defined in termlib.c and term.c # -DUP_BC_PC_EXTERN for term.c needed as BC defined in termlib.c and term.c
TERMFLAG = -DUP_BC_PC_EXTERN TERMFLAG = -DUP_BC_PC_EXTERN
ASMFLAGS = -throwback -objasm -gcc ASMFLAGS = -throwback -objasm -gcc
OBJS = o.buffer o.charset o.digraph o.edit o.eval o.ex_cmds o.ex_cmds2 o.diff \ OBJS = o.buffer o.charset o.diff o.digraph o.edit o.eval o.ex_cmds o.ex_cmds2 \
o.ex_docmd o.ex_eval o.ex_getln o.fileio o.fold o.getchar o.main o.mark o.mbyte \ o.ex_docmd o.ex_eval o.ex_getln o.fileio o.fold o.getchar o.main o.mark o.mbyte \
o.memfile o.memline o.menu o.message o.misc1 o.misc2 o.move \ o.memfile o.memline o.menu o.message o.misc1 o.misc2 o.move \
o.normal o.ops o.option o.quickfix o.regexp o.screen o.search \ o.normal o.ops o.option o.quickfix o.regexp o.screen o.search \
@ -26,7 +24,7 @@ Vim: $(OBJS)
install: Vim install: Vim
squeeze -v Vim @.!Vim.Vim squeeze -v Vim @.!Vim.Vim
clean: clean:
create o.!fake! 0 create o.!fake! 0
wipe o.* ~cf wipe o.* ~cf
remove Vim remove Vim
@ -35,134 +33,93 @@ o.swis: s.swis
as $(ASMFLAGS) -o o.swis s.swis as $(ASMFLAGS) -o o.swis s.swis
# Rules for object files # Rules for object files
# You shouldn't need to put all this information in as all but term.c have the same
# rule (and only then to save extra defines) but some versions of make are awkward. o.%: c.%
$(CC) -c $< -o $@
o.buffer: c.buffer o.buffer: c.buffer
$(CC) -c c.buffer -o o.buffer
o.charset: c.charset o.charset: c.charset
$(CC) -c c.charset -o o.charset
o.digraph: c.digraph o.digraph: c.digraph
$(CC) -c c.digraph -o o.digraph
o.diff: c.diff o.diff: c.diff
$(CC) -c c.diff -o o.diff
o.edit: c.edit o.edit: c.edit
$(CC) -c c.edit -o o.edit
o.eval: c.eval o.eval: c.eval
$(CC) -c c.eval -o o.eval
o.ex_cmds: c.ex_cmds o.ex_cmds: c.ex_cmds
$(CC) -c c.ex_cmds -o o.ex_cmds
o.ex_cmds2: c.ex_cmds2 o.ex_cmds2: c.ex_cmds2
$(CC) -c c.ex_cmds2 -o o.ex_cmds2
o.ex_docmd: c.ex_docmd o.ex_docmd: c.ex_docmd
$(CCEX_DOCMD) -c c.ex_docmd -o o.ex_docmd
o.ex_eval: c.ex_eval o.ex_eval: c.ex_eval
$(CCEX_DOCMD) -c c.ex_eval -o o.ex_eval
o.ex_getln: c.ex_getln o.ex_getln: c.ex_getln
$(CC) -c c.ex_getln -o o.ex_getln
o.fileio: c.fileio o.fileio: c.fileio
$(CC) -c c.fileio -o o.fileio
o.fold: c.fold o.fold: c.fold
$(CC) -c c.fold -o o.fold
o.getchar: c.getchar o.getchar: c.getchar
$(CC) -c c.getchar -o o.getchar
o.gui: c.gui o.gui: c.gui
$(CC) -c c.gui -o o.gui
o.gui_riscos: c.gui_riscos o.gui_riscos: c.gui_riscos
$(CC) -c c.gui_riscos -o o.gui_riscos
o.main: c.main o.main: c.main
$(CC) -c c.main -o o.main
o.mark: c.mark o.mark: c.mark
$(CC) -c c.mark -o o.mark
o.mbyte: c.mbyte o.mbyte: c.mbyte
$(CC) -c c.mbyte -o o.mbyte
o.memfile: c.memfile o.memfile: c.memfile
$(CC) -c c.memfile -o o.memfile
o.memline: c.memline o.memline: c.memline
$(CC) -c c.memline -o o.memline
o.menu: c.menu o.menu: c.menu
$(CC) -c c.menu -o o.menu
o.message: c.message o.message: c.message
$(CC) -c c.message -o o.message
o.misc1: c.misc1 o.misc1: c.misc1
$(CC) -c c.misc1 -o o.misc1
o.misc2: c.misc2 o.misc2: c.misc2
$(CC) -c c.misc2 -o o.misc2
o.move: c.move o.move: c.move
$(CC) -c c.move -o o.move
o.normal: c.normal o.normal: c.normal
$(CC) -c c.normal -o o.normal
o.ops: c.ops o.ops: c.ops
$(CC) -c c.ops -o o.ops
o.option: c.option o.option: c.option
$(CC) -c c.option -o o.option
o.os_riscos: c.os_riscos o.os_riscos: c.os_riscos
$(CC) -c c.os_riscos -o o.os_riscos
o.pty: c.pty o.pty: c.pty
$(CC) -c c.pty -o p.pty
o.quickfix: c.quickfix o.quickfix: c.quickfix
$(CC) -c c.quickfix -o o.quickfix
o.regexp: c.regexp o.regexp: c.regexp
$(CC) -c c.regexp -o o.regexp
o.screen: c.screen o.screen: c.screen
$(CC) -c c.screen -o o.screen
o.search: c.search o.search: c.search
$(CC) -c c.search -o o.search
o.syntax: c.syntax o.syntax: c.syntax
$(CC) -c c.syntax -o o.syntax
o.tag: c.tag o.tag: c.tag
$(CC) -c c.tag -o o.tag
o.term: c.term o.term: c.term
$(CC) $(TERMFLAG) -c c.term -o o.term $(CC) $(TERMFLAG) -c c.term -o o.term
o.termlib: c.termlib o.termlib: c.termlib
$(CC) -c c.termlib -o o.termlib
o.ui: c.ui o.ui: c.ui
$(CC) -c c.ui -o o.ui
o.undo: c.undo o.undo: c.undo
$(CC) -c c.undo -o o.undo
o.version: c.version o.version: c.version
$(CC) -c c.version -o o.version
o.window: c.window o.window: c.window
$(CC) -c c.window -o o.window

View File

@ -538,8 +538,7 @@ buf_freeall(buf, del_buf, wipe_buf)
return; return;
} }
# ifdef FEAT_EVAL # ifdef FEAT_EVAL
/* autocmds may abort script processing */ if (aborting()) /* autocmds may abort script processing */
if (aborting())
return; return;
# endif # endif
@ -755,7 +754,6 @@ handle_swap_exists(old_curbuf)
# endif # endif
} }
swap_exists_action = SEA_NONE; swap_exists_action = SEA_NONE;
} }
#endif #endif
@ -1031,8 +1029,12 @@ do_buffer(action, start, dir, count, forceit)
* now. */ * now. */
return FAIL; return FAIL;
# endif # endif
/* If it's still changed fail silently, the dialog already
* mentioned why it fails. */
if (bufIsChanged(buf))
return FAIL;
} }
if (bufIsChanged(buf)) else
#endif #endif
{ {
EMSGN(_("E89: No write since last change for buffer %ld (add ! to override)"), EMSGN(_("E89: No write since last change for buffer %ld (add ! to override)"),
@ -1518,8 +1520,7 @@ buflist_new(ffname, sfname, lnum, flags)
if (buf == curbuf) if (buf == curbuf)
apply_autocmds(EVENT_BUFWIPEOUT, NULL, NULL, FALSE, curbuf); apply_autocmds(EVENT_BUFWIPEOUT, NULL, NULL, FALSE, curbuf);
# ifdef FEAT_EVAL # ifdef FEAT_EVAL
/* autocmds may abort script processing */ if (aborting()) /* autocmds may abort script processing */
if (aborting())
return NULL; return NULL;
# endif # endif
#endif #endif
@ -1572,8 +1573,7 @@ buflist_new(ffname, sfname, lnum, flags)
if (buf != curbuf) /* autocommands deleted the buffer! */ if (buf != curbuf) /* autocommands deleted the buffer! */
return NULL; return NULL;
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
/* autocmds may abort script processing */ if (aborting()) /* autocmds may abort script processing */
if (aborting())
return NULL; return NULL;
#endif #endif
/* buf->b_nwindows = 0; why was this here? */ /* buf->b_nwindows = 0; why was this here? */
@ -1649,8 +1649,7 @@ buflist_new(ffname, sfname, lnum, flags)
if (flags & BLN_LISTED) if (flags & BLN_LISTED)
apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, buf); apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, buf);
# ifdef FEAT_EVAL # ifdef FEAT_EVAL
/* autocmds may abort script processing */ if (aborting()) /* autocmds may abort script processing */
if (aborting())
return NULL; return NULL;
# endif # endif
} }

View File

@ -4485,7 +4485,16 @@ f_foldtext(argvars, retvar)
s = skipwhite(ml_get(lnum)); s = skipwhite(ml_get(lnum));
/* skip C comment-start */ /* skip C comment-start */
if (s[0] == '/' && (s[1] == '*' || s[1] == '/')) if (s[0] == '/' && (s[1] == '*' || s[1] == '/'))
{
s = skipwhite(s + 2); s = skipwhite(s + 2);
if (*skipwhite(s) == NUL
&& lnum + 1 < (linenr_T)vimvars[VV_FOLDEND].val)
{
s = skipwhite(ml_get(lnum + 1));
if (*s == '*')
s = skipwhite(s + 1);
}
}
txt = _("+-%s%3ld lines: "); txt = _("+-%s%3ld lines: ");
r = alloc((unsigned)(STRLEN(txt) r = alloc((unsigned)(STRLEN(txt)
+ STRLEN(vimvars[VV_FOLDDASHES].val) /* for %s */ + STRLEN(vimvars[VV_FOLDDASHES].val) /* for %s */

View File

@ -7892,7 +7892,6 @@ update_topline_cursor()
ex_normal(eap) ex_normal(eap)
exarg_T *eap; exarg_T *eap;
{ {
oparg_T oa;
int save_msg_scroll = msg_scroll; int save_msg_scroll = msg_scroll;
int save_restart_edit = restart_edit; int save_restart_edit = restart_edit;
int save_msg_didout = msg_didout; int save_msg_didout = msg_didout;
@ -7996,30 +7995,17 @@ ex_normal(eap)
*/ */
do do
{ {
clear_oparg(&oa);
finish_op = FALSE;
if (eap->addr_count != 0) if (eap->addr_count != 0)
{ {
curwin->w_cursor.lnum = eap->line1++; curwin->w_cursor.lnum = eap->line1++;
curwin->w_cursor.col = 0; curwin->w_cursor.col = 0;
} }
/* exec_normal_cmd(
* Stuff the argument into the typeahead buffer.
* Execute normal_cmd() until there is no typeahead left.
*/
ins_typebuf(
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
arg != NULL ? arg : arg != NULL ? arg :
#endif #endif
eap->arg, eap->forceit ? REMAP_NONE : REMAP_YES, 0, eap->arg, eap->forceit ? REMAP_NONE : REMAP_YES, FALSE);
TRUE, FALSE);
while ((!stuff_empty() || (!typebuf_typed() && typebuf.tb_len > 0))
&& !got_int)
{
update_topline_cursor();
normal_cmd(&oa, FALSE); /* execute a Normal mode cmd */
}
} }
while (eap->addr_count > 0 && eap->line1 <= eap->line2 && !got_int); while (eap->addr_count > 0 && eap->line1 <= eap->line2 && !got_int);
} }
@ -8085,6 +8071,35 @@ ex_stopinsert(eap)
} }
#endif #endif
#if defined(FEAT_EX_EXTRA) || defined(FEAT_MENU) || defined(PROTO)
/*
* Execute normal mode command "cmd".
* "remap" can be REMAP_NONE or REMAP_YES.
*/
void
exec_normal_cmd(cmd, remap, silent)
char_u *cmd;
int remap;
int silent;
{
oparg_T oa;
/*
* Stuff the argument into the typeahead buffer.
* Execute normal_cmd() until there is no typeahead left.
*/
clear_oparg(&oa);
finish_op = FALSE;
ins_typebuf(cmd, remap, 0, TRUE, silent);
while ((!stuff_empty() || (!typebuf_typed() && typebuf.tb_len > 0))
&& !got_int)
{
update_topline_cursor();
normal_cmd(&oa, FALSE); /* execute a Normal mode cmd */
}
}
#endif
#ifdef FEAT_FIND_ID #ifdef FEAT_FIND_ID
static void static void
ex_checkpath(eap) ex_checkpath(eap)
@ -8741,6 +8756,17 @@ makeopens(fd, dirnow)
vim_free(sname); vim_free(sname);
} }
/*
* If there is an empty, unnamed buffer we will wipe it out later.
* Remember the buffer number.
*/
if (put_line(fd, "if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''") == FAIL)
return FAIL;
if (put_line(fd, " let s:wipebuf = bufnr('%')") == FAIL)
return FAIL;
if (put_line(fd, "endif") == FAIL)
return FAIL;
/* /*
* Now save the current files, current buffer first. * Now save the current files, current buffer first.
*/ */
@ -8875,6 +8901,18 @@ makeopens(fd, dirnow)
if (cnr > 1 && (fprintf(fd, "%dwincmd w", cnr) < 0 || put_eol(fd) == FAIL)) if (cnr > 1 && (fprintf(fd, "%dwincmd w", cnr) < 0 || put_eol(fd) == FAIL))
return FAIL; return FAIL;
/*
* Wipe out an empty unnamed buffer we started in.
*/
if (put_line(fd, "if exists('s:wipebuf')") == FAIL)
return FAIL;
if (put_line(fd, " exe 'bwipe ' . s:wipebuf") == FAIL)
return FAIL;
if (put_line(fd, "endif") == FAIL)
return FAIL;
if (put_line(fd, "unlet! s:wipebuf") == FAIL)
return FAIL;
/* /*
* Restore window sizes again after jumping around in windows, because the * Restore window sizes again after jumping around in windows, because the
* current window has a minimum size while others may not. * current window has a minimum size while others may not.

View File

@ -1820,19 +1820,25 @@ ex_endtry(eap)
} }
/* /*
* Function to be called before a failed command invokes a sequence of * enter_cleanup() and leave_cleanup()
* autocommands for cleanup. (Failure means here that a call to emsg() has
* been made, an interrupt occurred, or there is an uncaught exception from a
* previous autocommand execution of the same command.) This function works a
* bit like ex_finally() except that there was not actually an extra try block
* around the part that failed and an error or interrupt has not (yet) been
* converted to an exception. This function saves the
* error/interrupt/exception state and prepares for the call to do_cmdline()
* that is going to be made for the cleanup autocommand execution.
* *
* Stores the pending error/interrupt/exception state in the cleanup_T * Functions to be called before/after invoking a sequence of autocommands for
* structure pointed to by "csp", which has to be passed as an argument to * cleanup for a failed command. (Failure means here that a call to emsg()
* leave_cleanup() after the autocommand execution has finished. * has been made, an interrupt occurred, or there is an uncaught exception
* from a previous autocommand execution of the same command.)
*
* Call enter_cleanup() with a pointer to a cleanup_T and pass the same
* pointer to leave_cleanup(). The cleanup_T structure stores the pending
* error/interrupt/exception state.
*/
/*
* This function works a bit like ex_finally() except that there was not
* actually an extra try block around the part that failed and an error or
* interrupt has not (yet) been converted to an exception. This function
* saves the error/interrupt/ exception state and prepares for the call to
* do_cmdline() that is going to be made for the cleanup autocommand
* execution.
*/ */
void void
enter_cleanup(csp) enter_cleanup(csp)
@ -1883,16 +1889,19 @@ enter_cleanup(csp)
} }
/* /*
* Function to be called after a failed command invoked a sequence of * See comment above enter_cleanup() for how this function is used.
* autocommands for cleanup. It is a bit like ex_endtry() except that there *
* was not actually an extra try block around the part that failed and an * This function is a bit like ex_endtry() except that there was not actually
* error or interrupt had not (yet) been converted to an exception when the * an extra try block around the part that failed and an error or interrupt
* cleanup autocommand sequence was invoked. This function has to be called * had not (yet) been converted to an exception when the cleanup autocommand
* with the address of the cleanup_T structure filled by enter_cleanup() as an * sequence was invoked.
* argument; it restores the error/interrupt/exception state saved by that *
* function - except there was an aborting error, an interrupt or an uncaught * This function has to be called with the address of the cleanup_T structure
* exception during execution of the cleanup autocommands. In the latter * filled by enter_cleanup() as an argument; it restores the error/interrupt/
* case, the saved error/interrupt/ exception state is discarded. * exception state saved by that function - except there was an aborting
* error, an interrupt or an uncaught exception during execution of the
* cleanup autocommands. In the latter case, the saved error/interrupt/
* exception state is discarded.
*/ */
void void
leave_cleanup(csp) leave_cleanup(csp)
@ -1959,7 +1968,7 @@ leave_cleanup(csp)
/* Report if required by the 'verbose' option or when debugging. */ /* Report if required by the 'verbose' option or when debugging. */
report_resume_pending(pending, report_resume_pending(pending,
(pending & CSTP_THROW) ? (void *)current_exception : NULL); (pending & CSTP_THROW) ? (void *)current_exception : NULL);
} }
} }

View File

@ -3985,8 +3985,9 @@ restore_backup:
* journalled. Syncing the file slows down the system, but assures it has * journalled. Syncing the file slows down the system, but assures it has
* been written to disk and we don't lose it. * been written to disk and we don't lose it.
* For a device do try the fsync() but don't complain if it does not work * For a device do try the fsync() but don't complain if it does not work
* (could be a pipe). */ * (could be a pipe).
if (fsync(fd) != 0 && !device) * If the 'fsync' option is FALSE, don't fsync(). Useful for laptops. */
if (p_fs && fsync(fd) != 0 && !device)
{ {
errmsg = (char_u *)_("E667: Fsync failed"); errmsg = (char_u *)_("E667: Fsync failed");
end = 0; end = 0;

View File

@ -902,6 +902,8 @@ foldMoveTo(updown, dir, count)
int level; int level;
int last; int last;
checkupdate(curwin);
/* Repeat "count" times. */ /* Repeat "count" times. */
for (n = 0; n < count; ++n) for (n = 0; n < count; ++n)
{ {
@ -2883,7 +2885,7 @@ foldRemove(gap, top, bot)
{ {
/* Found an entry below top. */ /* Found an entry below top. */
fold_changed = TRUE; fold_changed = TRUE;
if (fp->fd_top + fp->fd_len > bot) if (fp->fd_top + fp->fd_len - 1 > bot)
{ {
/* 5: Make fold that includes bot start below bot. */ /* 5: Make fold that includes bot start below bot. */
foldMarkAdjustRecurse(&fp->fd_nested, foldMarkAdjustRecurse(&fp->fd_nested,

View File

@ -1514,6 +1514,17 @@ vgetc()
continue; continue;
} }
#endif #endif
#ifdef HAVE_GTK2
/* GTK: <F10> normally selects the menu, but it's passed until
* here to allow mapping it. Intercept and invoke the GTK
* behavior if it's not mapped. */
if (c == K_F10 && gui.menubar != NULL)
{
gtk_menu_shell_select_first(GTK_MENU_SHELL(gui.menubar), FALSE);
continue;
}
#endif
#ifdef FEAT_GUI #ifdef FEAT_GUI
/* Translate K_CSI to CSI. The special key is only used to avoid /* Translate K_CSI to CSI. The special key is only used to avoid
* it being recognized as the start of a special key. */ * it being recognized as the start of a special key. */
@ -1540,7 +1551,14 @@ vgetc()
case K_KDIVIDE: c = '/'; break; case K_KDIVIDE: c = '/'; break;
case K_KMULTIPLY: c = '*'; break; case K_KMULTIPLY: c = '*'; break;
case K_KENTER: c = CAR; break; case K_KENTER: c = CAR; break;
case K_KPOINT: c = '.'; break; case K_KPOINT:
#ifdef WIN32
/* Can be either '.' or a ',', *
* depending on the type of keypad. */
c = MapVirtualKey(VK_DECIMAL, 2); break;
#else
c = '.'; break;
#endif
case K_K0: c = '0'; break; case K_K0: c = '0'; break;
case K_K1: c = '1'; break; case K_K1: c = '1'; break;
case K_K2: c = '2'; break; case K_K2: c = '2'; break;

View File

@ -3080,6 +3080,17 @@ gui_mch_init(void)
gui.menubar = gtk_menu_bar_new(); gui.menubar = gtk_menu_bar_new();
gtk_widget_set_name(gui.menubar, "vim-menubar"); gtk_widget_set_name(gui.menubar, "vim-menubar");
# ifdef HAVE_GTK2
/* Avoid that GTK takes <F10> away from us. */
{
GtkSettings *gtk_settings;
gtk_settings = gtk_settings_get_for_screen(gdk_screen_get_default());
g_object_set(gtk_settings, "gtk-menu-bar-accel", NULL, NULL);
}
# endif
# ifdef FEAT_GUI_GNOME # ifdef FEAT_GUI_GNOME
if (using_gnome) if (using_gnome)
{ {

View File

@ -3792,6 +3792,27 @@ gui_mch_draw_string(row, col, s, len, flags)
(void)SwapQDTextFlags(qd_flags); (void)SwapQDTextFlags(qd_flags);
} }
/*
* When antialiasing we're using srcOr mode, we have to clear the block
* before drawing the text.
* Also needed when 'linespace' is non-zero to remove the cursor and
* underlining.
* But not when drawing transparently.
* The following is like calling gui_mch_clear_block(row, col, row, col +
* len - 1), but without setting the bg color to gui.back_pixel.
*/
if (((sys_version >= 0x1020 && p_antialias) || p_linespace != 0)
&& !(flags & DRAW_TRANSP))
{
Rect rc;
rc.left = FILL_X(col);
rc.top = FILL_Y(row);
rc.right = FILL_X(col + len) + (col + len == Columns);
rc.bottom = FILL_Y(row + 1);
EraseRect(&rc);
}
if (sys_version >= 0x1020 && p_antialias) if (sys_version >= 0x1020 && p_antialias)
{ {
StyleParameter face; StyleParameter face;
@ -3806,22 +3827,6 @@ gui_mch_draw_string(row, col, s, len, flags)
/* Quartz antialiasing works only in srcOr transfer mode. */ /* Quartz antialiasing works only in srcOr transfer mode. */
TextMode(srcOr); TextMode(srcOr);
if (!(flags & DRAW_TRANSP))
{
/*
* Since we're using srcOr mode, we have to clear the block
* before drawing the text. The following is like calling
* gui_mch_clear_block(row, col, row, col + len - 1),
* but without setting the bg color to gui.back_pixel.
*/
Rect rc;
rc.left = FILL_X(col);
rc.top = FILL_Y(row);
rc.right = FILL_X(col + len) + (col + len == Columns);
rc.bottom = FILL_Y(row + 1);
EraseRect(&rc);
}
MoveTo(TEXT_X(col), TEXT_Y(row)); MoveTo(TEXT_X(col), TEXT_Y(row));
DrawText((char*)s, 0, len); DrawText((char*)s, 0, len);
} }

View File

@ -789,8 +789,7 @@ _WndProc(
break; break;
} }
#ifdef MSWIN_FIND_REPLACE #ifdef MSWIN_FIND_REPLACE
else else if (uMsg == s_findrep_msg && s_findrep_msg != 0)
if (uMsg == s_findrep_msg && s_findrep_msg != 0)
{ {
_OnFindRepl(); _OnFindRepl();
} }
@ -1410,20 +1409,6 @@ gui_mch_set_bg_color(guicolor_T color)
#endif #endif
#include <imm.h> #include <imm.h>
/*
* display composition string(korean)
*/
static void
DisplayCompStringOpaque(char_u *s, int len)
{
int OldBkMode = GetBkMode(s_hdc);
SetBkMode(s_hdc, OPAQUE);
gui_outstr_nowrap(s, len, GUI_MON_TRS_CURSOR,
(guicolor_T)0, (guicolor_T)0, 0);
SetBkMode(s_hdc, OldBkMode);
}
/* /*
* handle WM_IME_NOTIFY message * handle WM_IME_NOTIFY message
*/ */

View File

@ -488,27 +488,49 @@ char_to_string(int ch, char_u *string, int slen)
WCHAR wstring[2]; WCHAR wstring[2];
char_u *ws = NULL;; char_u *ws = NULL;;
/* "ch" is a UTF-16 character. Convert it to a string of bytes. When if (os_version.dwPlatformId != VER_PLATFORM_WIN32_NT)
* "enc_codepage" is non-zero use the standard Win32 function, otherwise
* use our own conversion function (e.g., for UTF-8). */
wstring[0] = ch;
if (enc_codepage > 0)
len = WideCharToMultiByte(enc_codepage, 0, wstring, 1, string, slen,
0, NULL);
else
{ {
len = 1; /* On Windows 95/98 we apparently get the character in the active
ws = ucs2_to_enc(wstring, &len); * codepage, not in UCS-2. If conversion is needed convert it to
if (ws == NULL) * UCS-2 first. */
len = 0; if ((int)GetACP() == enc_codepage)
len = 0; /* no conversion required */
else else
{ {
if (len > slen) /* just in case */ string[0] = ch;
len = slen; len = MultiByteToWideChar(GetACP(), 0, string, 1, wstring, 2);
mch_memmove(string, ws, len);
vim_free(ws);
} }
} }
else
{
wstring[0] = ch;
len = 1;
}
if (len > 0)
{
/* "ch" is a UTF-16 character. Convert it to a string of bytes. When
* "enc_codepage" is non-zero use the standard Win32 function,
* otherwise use our own conversion function (e.g., for UTF-8). */
if (enc_codepage > 0)
len = WideCharToMultiByte(enc_codepage, 0, wstring, len,
string, slen, 0, NULL);
else
{
len = 1;
ws = ucs2_to_enc(wstring, &len);
if (ws == NULL)
len = 0;
else
{
if (len > slen) /* just in case */
len = slen;
mch_memmove(string, ws, len);
vim_free(ws);
}
}
}
if (len == 0) if (len == 0)
#endif #endif
{ {
@ -682,9 +704,10 @@ _OnMouseButtonDown(
* Holding down the left and right buttons simulates pushing the middle * Holding down the left and right buttons simulates pushing the middle
* button. * button.
*/ */
if (repeated_click && if (repeated_click
((button == MOUSE_LEFT && s_button_pending == MOUSE_RIGHT) || && ((button == MOUSE_LEFT && s_button_pending == MOUSE_RIGHT)
(button == MOUSE_RIGHT && s_button_pending == MOUSE_LEFT))) || (button == MOUSE_RIGHT
&& s_button_pending == MOUSE_LEFT)))
{ {
/* /*
* Hmm, gui.c will ignore more than one button down at a time, so * Hmm, gui.c will ignore more than one button down at a time, so
@ -745,7 +768,7 @@ _OnMouseMoveOrRelease(
{ {
/* Delayed action for mouse down event */ /* Delayed action for mouse down event */
_OnMouseEvent(s_button_pending, s_x_pending, _OnMouseEvent(s_button_pending, s_x_pending,
s_y_pending, FALSE, s_kFlags_pending); s_y_pending, FALSE, s_kFlags_pending);
s_button_pending = -1; s_button_pending = -1;
} }
if (s_uMsg == WM_MOUSEMOVE) if (s_uMsg == WM_MOUSEMOVE)
@ -1532,6 +1555,9 @@ process_message(void)
int i; int i;
int modifiers = 0; int modifiers = 0;
int key; int key;
#ifdef FEAT_MENU
static char_u k10[] = {K_SPECIAL, 'k', ';', 0};
#endif
GetMessage(&msg, NULL, 0, 0); GetMessage(&msg, NULL, 0, 0);
@ -1619,11 +1645,11 @@ process_message(void)
&& (vk != VK_SPACE || !(GetKeyState(VK_MENU) & 0x8000))) && (vk != VK_SPACE || !(GetKeyState(VK_MENU) & 0x8000)))
{ {
#ifdef FEAT_MENU #ifdef FEAT_MENU
/* Check for <F10>: Windows selects the menu. Ignore it when /* Check for <F10>: Windows selects the menu. When <F10> is
* 'winaltkeys' is "yes" or "menu" */ * mapped we want to use the mapping instead. */
if (vk == VK_F10 if (vk == VK_F10
&& gui.menu_is_active && gui.menu_is_active
&& (*p_wak == 'y' || *p_wak == 'm')) && check_map(k10, State, FALSE) == NULL)
break; break;
#endif #endif
if (GetKeyState(VK_SHIFT) & 0x8000) if (GetKeyState(VK_SHIFT) & 0x8000)
@ -1734,9 +1760,10 @@ process_message(void)
#endif #endif
#ifdef FEAT_MENU #ifdef FEAT_MENU
/* Check for <F10>: Windows selects the menu. Don't let Windows handle it /* Check for <F10>: Default effect is to select the menu. When <F10> is
* when 'winaltkeys' is "no" */ * mapped we need to stop it here to avoid strange effects (e.g., for the
if (vk != VK_F10 || *p_wak != 'n') * key-up event) */
if (vk != VK_F10 || check_map(k10, State, FALSE) == NULL)
#endif #endif
DispatchMessage(&msg); DispatchMessage(&msg);
} }
@ -1829,6 +1856,11 @@ gui_mch_wait_for_chars(int wtime)
s_wait_timer = 0; s_wait_timer = 0;
} }
allow_scrollbar = FALSE; allow_scrollbar = FALSE;
/* Clear pending mouse button, the release event may have been
* taken by the dialog window. */
s_button_pending = -1;
return OK; return OK;
} }
} }

View File

@ -1092,7 +1092,7 @@ cs_find_common(opt, pat, forceit, verbose)
return FALSE; return FALSE;
} }
} }
if (qfpos != NULL && *qfpos != '0' && totmatches > 1) if (qfpos != NULL && *qfpos != '0' && totmatches > 0)
{ {
/* fill error list */ /* fill error list */
FILE *f; FILE *f;

View File

@ -381,13 +381,14 @@ typedef PyObject PyThreadState;
#endif /* Python 1.4 */ #endif /* Python 1.4 */
#ifndef PY_CAN_RECURSE #ifndef PY_CAN_RECURSE
static PyThreadState* saved_python_thread = NULL; static PyThreadState *saved_python_thread = NULL;
/* /*
* Suspend a thread of the Python interpreter, other threads are allowed to * Suspend a thread of the Python interpreter, other threads are allowed to
* run. * run.
*/ */
static void Python_SaveThread(void) static void
Python_SaveThread(void)
{ {
saved_python_thread = PyEval_SaveThread(); saved_python_thread = PyEval_SaveThread();
} }
@ -396,7 +397,8 @@ static void Python_SaveThread(void)
* Restore a thread of the Python interpreter, waits for other threads to * Restore a thread of the Python interpreter, waits for other threads to
* block. * block.
*/ */
static void Python_RestoreThread(void) static void
Python_RestoreThread(void)
{ {
PyEval_RestoreThread(saved_python_thread); PyEval_RestoreThread(saved_python_thread);
saved_python_thread = NULL; saved_python_thread = NULL;
@ -456,8 +458,10 @@ Python_Init(void)
if (PythonMod_Init()) if (PythonMod_Init())
goto fail; goto fail;
#ifndef PY_CAN_RECURSE /* the first python thread is vim's, release the lock */
/* the first python thread is vim's */ #ifdef PY_CAN_RECURSE
PyEval_SaveThread();
#else
Python_SaveThread(); Python_SaveThread();
#endif #endif

View File

@ -383,7 +383,7 @@ enum key_extra
#define K_KDIVIDE TERMCAP2KEY('K', '8') /* keypad / */ #define K_KDIVIDE TERMCAP2KEY('K', '8') /* keypad / */
#define K_KMULTIPLY TERMCAP2KEY('K', '9') /* keypad * */ #define K_KMULTIPLY TERMCAP2KEY('K', '9') /* keypad * */
#define K_KENTER TERMCAP2KEY('K', 'A') /* keypad Enter */ #define K_KENTER TERMCAP2KEY('K', 'A') /* keypad Enter */
#define K_KPOINT TERMCAP2KEY('K', 'B') /* keypad . */ #define K_KPOINT TERMCAP2KEY('K', 'B') /* keypad . or ,*/
#define K_K0 TERMCAP2KEY('K', 'C') /* keypad 0 */ #define K_K0 TERMCAP2KEY('K', 'C') /* keypad 0 */
#define K_K1 TERMCAP2KEY('K', 'D') /* keypad 1 */ #define K_K1 TERMCAP2KEY('K', 'D') /* keypad 1 */

View File

@ -2228,6 +2228,12 @@ main_loop(cmdwin)
getout_preserve_modified(exitval) getout_preserve_modified(exitval)
int exitval; int exitval;
{ {
#if defined(UNIX)
/* Ignore SIGHUP, because a dropped connection may make Vim exit and then
* get a SIGHUP while exiting, which causes various reentrent problems. */
signal(SIGHUP, SIG_IGN);
#endif
ml_close_notmod(); /* close all not-modified buffers */ ml_close_notmod(); /* close all not-modified buffers */
ml_sync_all(FALSE, FALSE); /* preserve all swap files */ ml_sync_all(FALSE, FALSE); /* preserve all swap files */
ml_close_all(FALSE); /* close all memfiles, without deleting */ ml_close_all(FALSE); /* close all memfiles, without deleting */

View File

@ -2107,8 +2107,9 @@ ex_emenu(eap)
return; return;
} }
/* Found the menu, so execute. */ /* Found the menu, so execute.
if (restart_edit) * Use the Insert mode entry when returning to Insert mode. */
if (restart_edit && !current_SID)
{ {
mode = (char_u *)"Insert"; mode = (char_u *)"Insert";
idx = MENU_INDEX_INSERT; idx = MENU_INDEX_INSERT;
@ -2123,8 +2124,7 @@ ex_emenu(eap)
/* GEDDES: This is not perfect - but it is a /* GEDDES: This is not perfect - but it is a
* quick way of detecting whether we are doing this from a * quick way of detecting whether we are doing this from a
* selection - see if the range matches up with the visual * selection - see if the range matches up with the visual
* select start and end. * select start and end. */
*/
if ((curbuf->b_visual_start.lnum == eap->line1) if ((curbuf->b_visual_start.lnum == eap->line1)
&& (curbuf->b_visual_end.lnum) == eap->line2) && (curbuf->b_visual_end.lnum) == eap->line2)
{ {
@ -2144,8 +2144,7 @@ ex_emenu(eap)
tpos.col = MAXCOL; tpos.col = MAXCOL;
} }
/* Activate visual mode /* Activate visual mode */
*/
VIsual_active = TRUE; VIsual_active = TRUE;
VIsual_reselect = TRUE; VIsual_reselect = TRUE;
check_cursor(); check_cursor();
@ -2155,8 +2154,7 @@ ex_emenu(eap)
check_cursor(); check_cursor();
/* Adjust the cursor to make sure it is in the correct pos /* Adjust the cursor to make sure it is in the correct pos
* for exclusive mode * for exclusive mode */
*/
if (*p_sel == 'e' && gchar_cursor() != NUL) if (*p_sel == 'e' && gchar_cursor() != NUL)
++curwin->w_cursor.col; ++curwin->w_cursor.col;
} }
@ -2168,7 +2166,13 @@ ex_emenu(eap)
if (idx != MENU_INDEX_INVALID && menu->strings[idx] != NULL) if (idx != MENU_INDEX_INVALID && menu->strings[idx] != NULL)
{ {
ins_typebuf(menu->strings[idx], menu->noremap[idx], 0, /* When executing a script or function execute the commands right now.
* Otherwise put them in the typeahead buffer. */
if (current_SID != 0)
exec_normal_cmd(menu->strings[idx], menu->noremap[idx],
menu->silent[idx]);
else
ins_typebuf(menu->strings[idx], menu->noremap[idx], 0,
TRUE, menu->silent[idx]); TRUE, menu->silent[idx]);
} }
else else

View File

@ -487,7 +487,7 @@ msg_source(attr)
} }
/* remember the last sourcing name printed, also when it's empty */ /* remember the last sourcing name printed, also when it's empty */
if (sourcing_name == NULL || other_sourcing_name) if (sourcing_name == NULL || other_sourcing_name())
{ {
vim_free(last_sourcing_name); vim_free(last_sourcing_name);
if (sourcing_name == NULL) if (sourcing_name == NULL)

View File

@ -7653,6 +7653,12 @@ get_lisp_indent()
void void
prepare_to_exit() prepare_to_exit()
{ {
#if defined(UNIX)
/* Ignore SIGHUP, because a dropped connection may make Vim exit and then
* get a SIGHUP while exiting, which causes various reentrent problems. */
signal(SIGHUP, SIG_IGN);
#endif
#ifdef FEAT_GUI #ifdef FEAT_GUI
if (gui.in_use) if (gui.in_use)
{ {

View File

@ -1550,8 +1550,13 @@ scrollup_clamp()
if (curwin->w_topfill > 0) if (curwin->w_topfill > 0)
--curwin->w_topfill; --curwin->w_topfill;
else else
#endif
{
#ifdef FEAT_FOLDING
(void)hasFolding(curwin->w_topline, NULL, &curwin->w_topline);
#endif #endif
++curwin->w_topline; ++curwin->w_topline;
}
++curwin->w_botline; /* approximate w_botline */ ++curwin->w_botline; /* approximate w_botline */
curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE); curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE);
} }

View File

@ -2380,7 +2380,7 @@ special_keys(char_u *args)
if ((sep = strchr(tok, '-')) != NULL) if ((sep = strchr(tok, '-')) != NULL)
{ {
*sep = NULL; *sep = NUL;
while (*tok) while (*tok)
{ {
switch (*tok) switch (*tok)

View File

@ -1127,6 +1127,11 @@ getcount:
#endif #endif
} }
/* get the length of mapped chars again after typing a count, second
* character or "z333<cr>". */
if (old_mapped_len > 0)
old_mapped_len = typebuf_maplen();
/* /*
* If an operation is pending, handle it... * If an operation is pending, handle it...
*/ */

View File

@ -2886,6 +2886,15 @@ op_yank(oap, deleting, mess)
*/ */
curbuf->b_op_start = oap->start; curbuf->b_op_start = oap->start;
curbuf->b_op_end = oap->end; curbuf->b_op_end = oap->end;
if (yanktype == MLINE
#ifdef FEAT_VISUAL
&& !oap->block_mode
#endif
)
{
curbuf->b_op_start.col = 0;
curbuf->b_op_end.col = MAXCOL;
}
#ifdef FEAT_CLIPBOARD #ifdef FEAT_CLIPBOARD
/* /*

View File

@ -302,6 +302,7 @@ struct vimoption
#define P_SECURE 0x40000L/* cannot change in modeline or secure mode */ #define P_SECURE 0x40000L/* cannot change in modeline or secure mode */
#define P_GETTEXT 0x80000L/* expand default value with _() */ #define P_GETTEXT 0x80000L/* expand default value with _() */
#define P_NOGLOB 0x100000L/* do not use local value for global vimrc */ #define P_NOGLOB 0x100000L/* do not use local value for global vimrc */
#define P_NFNAME 0x200000L/* only normal file name chars allowed */
/* /*
* options[] is initialized here. * options[] is initialized here.
@ -422,7 +423,7 @@ static struct vimoption
{"backupdir", "bdir", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP|P_SECURE, {"backupdir", "bdir", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP|P_SECURE,
(char_u *)&p_bdir, PV_NONE, (char_u *)&p_bdir, PV_NONE,
{(char_u *)DFLT_BDIR, (char_u *)0L}}, {(char_u *)DFLT_BDIR, (char_u *)0L}},
{"backupext", "bex", P_STRING|P_VI_DEF, {"backupext", "bex", P_STRING|P_VI_DEF|P_NFNAME,
(char_u *)&p_bex, PV_NONE, (char_u *)&p_bex, PV_NONE,
{ {
#ifdef VMS #ifdef VMS
@ -864,7 +865,7 @@ static struct vimoption
{"fileformats", "ffs", P_STRING|P_VIM|P_COMMA|P_NODUP, {"fileformats", "ffs", P_STRING|P_VIM|P_COMMA|P_NODUP,
(char_u *)&p_ffs, PV_NONE, (char_u *)&p_ffs, PV_NONE,
{(char_u *)DFLT_FFS_VI, (char_u *)DFLT_FFS_VIM}}, {(char_u *)DFLT_FFS_VI, (char_u *)DFLT_FFS_VIM}},
{"filetype", "ft", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB, {"filetype", "ft", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB|P_NFNAME,
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
(char_u *)&p_ft, PV_FT, (char_u *)&p_ft, PV_FT,
{(char_u *)"", (char_u *)0L} {(char_u *)"", (char_u *)0L}
@ -953,6 +954,15 @@ static struct vimoption
{"formatprg", "fp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, {"formatprg", "fp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
(char_u *)&p_fp, PV_NONE, (char_u *)&p_fp, PV_NONE,
{(char_u *)"", (char_u *)0L}}, {(char_u *)"", (char_u *)0L}},
{"fsync", "fs", P_BOOL|P_SECURE|P_VI_DEF,
#ifdef HAVE_FSYNC
(char_u *)&p_fs, PV_NONE,
{(char_u *)TRUE, (char_u *)0L}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)FALSE, (char_u *)0L}
#endif
},
{"gdefault", "gd", P_BOOL|P_VI_DEF|P_VIM, {"gdefault", "gd", P_BOOL|P_VI_DEF|P_VIM,
(char_u *)&p_gd, PV_NONE, (char_u *)&p_gd, PV_NONE,
{(char_u *)FALSE, (char_u *)0L}}, {(char_u *)FALSE, (char_u *)0L}},
@ -1278,7 +1288,8 @@ static struct vimoption
{"isprint", "isp", P_STRING|P_VI_DEF|P_RALL|P_COMMA|P_NODUP, {"isprint", "isp", P_STRING|P_VI_DEF|P_RALL|P_COMMA|P_NODUP,
(char_u *)&p_isp, PV_NONE, (char_u *)&p_isp, PV_NONE,
{ {
#if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(MACOS) \ #if defined(MSDOS) || defined(MSWIN) || defined(OS2) \
|| (defined(MACOS) && !defined(MACOS_X)) \
|| defined(VMS) || defined(VMS)
(char_u *)"@,~-255", (char_u *)"@,~-255",
#else #else
@ -1302,7 +1313,7 @@ static struct vimoption
{(char_u *)0L, (char_u *)0L} {(char_u *)0L, (char_u *)0L}
#endif #endif
}, },
{"keymap", "kmp", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_RSTAT, {"keymap", "kmp", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_RSTAT|P_NFNAME,
#ifdef FEAT_KEYMAP #ifdef FEAT_KEYMAP
(char_u *)&p_keymap, PV_KMAP, (char_u *)&p_keymap, PV_KMAP,
{(char_u *)"", (char_u *)0L} {(char_u *)"", (char_u *)0L}
@ -1348,7 +1359,7 @@ static struct vimoption
{(char_u *)NULL, {(char_u *)NULL,
#endif #endif
(char_u *)0L}}, (char_u *)0L}},
{"langmenu", "lm", P_STRING|P_VI_DEF, {"langmenu", "lm", P_STRING|P_VI_DEF|P_NFNAME,
#if defined(FEAT_MENU) && defined(FEAT_MULTI_LANG) #if defined(FEAT_MENU) && defined(FEAT_MULTI_LANG)
(char_u *)&p_lm, PV_NONE, (char_u *)&p_lm, PV_NONE,
#else #else
@ -1594,7 +1605,7 @@ static struct vimoption
{(char_u *)0L, (char_u *)0L} {(char_u *)0L, (char_u *)0L}
#endif #endif
}, },
{"patchmode", "pm", P_STRING|P_VI_DEF, {"patchmode", "pm", P_STRING|P_VI_DEF|P_NFNAME,
(char_u *)&p_pm, PV_NONE, (char_u *)&p_pm, PV_NONE,
{(char_u *)"", (char_u *)0L}}, {(char_u *)"", (char_u *)0L}},
{"path", "pa", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP, {"path", "pa", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP,
@ -1627,7 +1638,7 @@ static struct vimoption
(char_u *)NULL, PV_NONE, (char_u *)NULL, PV_NONE,
#endif #endif
{(char_u *)FALSE, (char_u *)0L}}, {(char_u *)FALSE, (char_u *)0L}},
{"printdevice", "pdev", P_STRING|P_VI_DEF, {"printdevice", "pdev", P_STRING|P_VI_DEF|P_SECURE,
#ifdef FEAT_PRINTER #ifdef FEAT_PRINTER
(char_u *)&p_pdev, PV_NONE, (char_u *)&p_pdev, PV_NONE,
{(char_u *)"", (char_u *)0L} {(char_u *)"", (char_u *)0L}
@ -2040,7 +2051,7 @@ static struct vimoption
{"switchbuf", "swb", P_STRING|P_VI_DEF|P_COMMA|P_NODUP, {"switchbuf", "swb", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
(char_u *)&p_swb, PV_NONE, (char_u *)&p_swb, PV_NONE,
{(char_u *)"", (char_u *)0L}}, {(char_u *)"", (char_u *)0L}},
{"syntax", "syn", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB, {"syntax", "syn", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB|P_NFNAME,
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
(char_u *)&p_syn, PV_SYN, (char_u *)&p_syn, PV_SYN,
{(char_u *)"", (char_u *)0L} {(char_u *)"", (char_u *)0L}
@ -2145,7 +2156,7 @@ static struct vimoption
(char_u *)NULL, PV_NONE, (char_u *)NULL, PV_NONE,
#endif #endif
{(char_u *)85L, (char_u *)0L}}, {(char_u *)85L, (char_u *)0L}},
{"titleold", NULL, P_STRING|P_VI_DEF|P_GETTEXT, {"titleold", NULL, P_STRING|P_VI_DEF|P_GETTEXT|P_SECURE,
#ifdef FEAT_TITLE #ifdef FEAT_TITLE
(char_u *)&p_titleold, PV_NONE, (char_u *)&p_titleold, PV_NONE,
{(char_u *)N_("Thanks for flying Vim"), {(char_u *)N_("Thanks for flying Vim"),
@ -2380,7 +2391,7 @@ static struct vimoption
{(char_u *)0L, (char_u *)0L}}, {(char_u *)0L, (char_u *)0L}},
/* terminal output codes */ /* terminal output codes */
#define p_term(sss, vvv) {sss, NULL, P_STRING|P_VI_DEF|P_RALL, \ #define p_term(sss, vvv) {sss, NULL, P_STRING|P_VI_DEF|P_RALL|P_SECURE, \
(char_u *)&vvv, PV_NONE, \ (char_u *)&vvv, PV_NONE, \
{(char_u *)"", (char_u *)0L}}, {(char_u *)"", (char_u *)0L}},
@ -2435,6 +2446,8 @@ static struct vimoption
p_term("t_vs", T_VS) p_term("t_vs", T_VS)
p_term("t_WP", T_CWP) p_term("t_WP", T_CWP)
p_term("t_WS", T_CWS) p_term("t_WS", T_CWS)
p_term("t_SI", T_CSI)
p_term("t_EI", T_CEI)
p_term("t_xs", T_XS) p_term("t_xs", T_XS)
p_term("t_ZH", T_CZH) p_term("t_ZH", T_CZH)
p_term("t_ZR", T_CZR) p_term("t_ZR", T_CZR)
@ -3388,7 +3401,8 @@ do_set(arg, opt_flags)
errmsg = NULL; errmsg = NULL;
startarg = arg; /* remember for error message */ startarg = arg; /* remember for error message */
if (STRNCMP(arg, "all", 3) == 0 && !isalpha(arg[3])) if (STRNCMP(arg, "all", 3) == 0 && !isalpha(arg[3])
&& !(opt_flags & OPT_MODELINE))
{ {
/* /*
* ":set all" show all options. * ":set all" show all options.
@ -3404,7 +3418,7 @@ do_set(arg, opt_flags)
else else
showoptions(1, opt_flags); showoptions(1, opt_flags);
} }
else if (STRNCMP(arg, "termcap", 7) == 0) else if (STRNCMP(arg, "termcap", 7) == 0 && !(opt_flags & OPT_MODELINE))
{ {
showoptions(2, opt_flags); showoptions(2, opt_flags);
show_termcodes(); show_termcodes();
@ -4704,6 +4718,15 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
errmsg = e_secure; errmsg = e_secure;
} }
/* Check for a "normal" file name in some options. Disallow a path
* separator (slash and/or backslash), wildcards and characters that are
* often illegal in a file name. */
else if ((options[opt_idx].flags & P_NFNAME)
&& vim_strpbrk(*varp, "/\\*?[|<>") != NULL)
{
errmsg = e_invarg;
}
/* 'term' */ /* 'term' */
else if (varp == &T_NAME) else if (varp == &T_NAME)
{ {

View File

@ -19,26 +19,30 @@
# endif # endif
#endif #endif
/* default values for p_efm 'errorformat' */ /*
* Default values for 'errorformat'.
* The "%f|%l| %m" one is used for when the contents of the quickfix window is
* written to a file.
*/
#ifdef AMIGA #ifdef AMIGA
# define DFLT_EFM "%f>%l:%c:%t:%n:%m,%f:%l: %t%*\\D%n: %m,%f %l %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f:%l:%m" # define DFLT_EFM "%f>%l:%c:%t:%n:%m,%f:%l: %t%*\\D%n: %m,%f %l %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f:%l:%m,%f|%l| %m"
#else #else
# if defined(MSDOS) || defined(WIN3264) # if defined(MSDOS) || defined(WIN3264)
# define DFLT_EFM "%f(%l) : %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f(%l) : %m,%*[^ ] %f %l: %m,%f:%l:%m" # define DFLT_EFM "%f(%l) : %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f(%l) : %m,%*[^ ] %f %l: %m,%f:%l:%m,%f|%l| %m"
# else # else
# if defined(__EMX__) /* put most common here (i.e. gcc format) at front */ # if defined(__EMX__) /* put most common here (i.e. gcc format) at front */
# define DFLT_EFM "%f:%l:%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%f(%l:%c) : %m" # define DFLT_EFM "%f:%l:%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%f(%l:%c) : %m,%f|%l| %m"
# else # else
# if defined(__QNX__) # if defined(__QNX__)
# define DFLT_EFM "%f(%l):%*[^WE]%t%*\\D%n:%m" # define DFLT_EFM "%f(%l):%*[^WE]%t%*\\D%n:%m,%f|%l| %m"
# else # else
# ifdef VMS # ifdef VMS
# define DFLT_EFM "%A%p^,%C%%CC-%t-%m,%Cat line number %l in file %f" # define DFLT_EFM "%A%p^,%C%%CC-%t-%m,%Cat line number %l in file %f,%f|%l| %m"
# else /* Unix, probably */ # else /* Unix, probably */
# ifdef EBCDIC # ifdef EBCDIC
#define DFLT_EFM "%*[^ ] %*[^ ] %f:%l%*[ ]%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%DMaking %*\\a in %f" #define DFLT_EFM "%*[^ ] %*[^ ] %f:%l%*[ ]%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m"
# else # else
#define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%DMaking %*\\a in %f" #define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m"
# endif # endif
# endif # endif
# endif # endif
@ -445,6 +449,7 @@ static char *(p_fdo_values[]) = {"all", "block", "hor", "mark", "percent",
# define FDO_JUMP 0x400 # define FDO_JUMP 0x400
#endif #endif
EXTERN char_u *p_fp; /* 'formatprg' */ EXTERN char_u *p_fp; /* 'formatprg' */
EXTERN int p_fs; /* 'fsync' */
EXTERN int p_gd; /* 'gdefault' */ EXTERN int p_gd; /* 'gdefault' */
#ifdef FEAT_PRINTER #ifdef FEAT_PRINTER
EXTERN char_u *p_pdev; /* 'printdevice' */ EXTERN char_u *p_pdev; /* 'printdevice' */

View File

@ -505,14 +505,14 @@ mch_restore_cursor_shape(int restore)
if (restore) if (restore)
{ {
if (saved) if (saved)
regs.h.ah = 0x01; /*Set Cursor*/ regs.h.ah = 0x01; /* Set Cursor */
else else
return; return;
} }
else else
{ {
regs.h.ah = 0x03; /*Get Cursor*/ regs.h.ah = 0x03; /* Get Cursor */
regs.h.bh = 0x00; /*Page */ regs.h.bh = 0x00; /* Page */
saved = TRUE; saved = TRUE;
} }
@ -528,9 +528,9 @@ mch_set_cursor_shape(int thickness)
{ {
union REGS regs; union REGS regs;
regs.h.ch = 7 - thickness; /*Starting Line*/ regs.h.ch = 7 - thickness; /* Starting Line */
regs.h.cl = 7; /*Ending Line*/ regs.h.cl = 7; /* Ending Line */
regs.h.ah = 0x01; /*Set Cursor*/ regs.h.ah = 0x01; /* Set Cursor */
(void)int86(0x10, &regs, &regs); (void)int86(0x10, &regs, &regs);
} }

View File

@ -903,6 +903,13 @@ deathtrap SIGDEFARG(sigarg)
} }
#endif #endif
#ifdef SIGHASARG
/* When SIGHUP is blocked: postpone its effect and return here. This
* avoids that a non-reentrant function is interrupted, e.g., free(). */
if (entered == 0 && sigarg == SIGHUP && !handle_sighup(SIGHUP_RCV))
SIGRETURN;
#endif
/* Remember how often we have been called. */ /* Remember how often we have been called. */
++entered; ++entered;
@ -1173,6 +1180,39 @@ catch_signals(func_deadly, func_other)
signal(signal_info[i].sig, func_other); signal(signal_info[i].sig, func_other);
} }
/*
* Handling of SIGHUP:
* "when" == SIGHUP_RCV: when busy, postpone, otherwise return TRUE
* "when" == SIGHUP_BLOCK: Going to be busy, block SIGHUP
* "when" == SIGHUP_UNBLOCK: Going wait, unblock SIGHUP
* Returns TRUE when Vim should exit.
*/
int
handle_sighup(when)
int when;
{
static int got_sighup = FALSE;
static int blocked = FALSE;
switch (when)
{
case SIGHUP_RCV: if (!blocked)
return TRUE; /* exit! */
got_sighup = TRUE;
got_int = TRUE; /* break any loops */
break;
case SIGHUP_BLOCK: blocked = TRUE;
break;
case SIGHUP_UNBLOCK: blocked = FALSE;
if (got_sighup)
kill(getpid(), SIGHUP);
break;
}
return FALSE;
}
/* /*
* Check_win checks whether we have an interactive stdout. * Check_win checks whether we have an interactive stdout.
*/ */

View File

@ -228,15 +228,18 @@ get_exe_name(void)
# define GETTEXT_DLL "libintl.dll" # define GETTEXT_DLL "libintl.dll"
# endif # endif
/* Dummy funcitons */ /* Dummy funcitons */
static char* null_libintl_gettext(const char *); static char *null_libintl_gettext(const char *);
static char* null_libintl_textdomain(const char *); static char *null_libintl_textdomain(const char *);
static char* null_libintl_bindtextdomain(const char *, const char *); static char *null_libintl_bindtextdomain(const char *, const char *);
static char *null_libintl_bind_textdomain_codeset(const char *, const char *);
static HINSTANCE hLibintlDLL = 0; static HINSTANCE hLibintlDLL = 0;
char* (*dyn_libintl_gettext)(const char *) = null_libintl_gettext; char *(*dyn_libintl_gettext)(const char *) = null_libintl_gettext;
char* (*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain; char *(*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain;
char* (*dyn_libintl_bindtextdomain)(const char *, const char *) char *(*dyn_libintl_bindtextdomain)(const char *, const char *)
= null_libintl_bindtextdomain; = null_libintl_bindtextdomain;
char *(*dyn_libintl_bind_textdomain_codeset)(const char *, const char *)
= null_libintl_bind_textdomain_codeset;
int int
dyn_libintl_init(char *libname) dyn_libintl_init(char *libname)
@ -287,6 +290,15 @@ dyn_libintl_init(char *libname)
return 0; return 0;
} }
} }
/* The bind_textdomain_codeset() function is optional. */
(FARPROC)dyn_libintl_bind_textdomain_codeset =
(FARPROC)GetProcAddress(hLibintlDLL,
"bind_textdomain_codeset");
if (dyn_libintl_bind_textdomain_codeset == NULL)
dyn_libintl_bind_textdomain_codeset =
null_libintl_bind_textdomain_codeset;
return 1; return 1;
} }
@ -299,6 +311,7 @@ dyn_libintl_end()
dyn_libintl_gettext = null_libintl_gettext; dyn_libintl_gettext = null_libintl_gettext;
dyn_libintl_textdomain = null_libintl_textdomain; dyn_libintl_textdomain = null_libintl_textdomain;
dyn_libintl_bindtextdomain = null_libintl_bindtextdomain; dyn_libintl_bindtextdomain = null_libintl_bindtextdomain;
dyn_libintl_bind_textdomain_codeset = null_libintl_bind_textdomain_codeset;
} }
static char * static char *
@ -313,6 +326,13 @@ null_libintl_bindtextdomain(const char *domainname, const char *dirname)
return NULL; return NULL;
} }
static char *
null_libintl_bind_textdomain_codeset(const char *domainname,
const char *codeset)
{
return NULL;
}
static char * static char *
null_libintl_textdomain(const char *domainname) null_libintl_textdomain(const char *domainname)
{ {

View File

@ -34,6 +34,7 @@ void do_exedit __ARGS((exarg_T *eap, win_T *old_curwin));
void do_sleep __ARGS((long msec)); void do_sleep __ARGS((long msec));
FILE *open_exfile __ARGS((char_u *fname, int forceit, char *mode)); FILE *open_exfile __ARGS((char_u *fname, int forceit, char *mode));
void update_topline_cursor __ARGS((void)); void update_topline_cursor __ARGS((void));
void exec_normal_cmd __ARGS((char_u *cmd, int remap, int silent));
char_u *eval_vars __ARGS((char_u *src, int *usedlen, linenr_T *lnump, char_u **errormsg, char_u *srcstart)); char_u *eval_vars __ARGS((char_u *src, int *usedlen, linenr_T *lnump, char_u **errormsg, char_u *srcstart));
char_u *expand_sfile __ARGS((char_u *arg)); char_u *expand_sfile __ARGS((char_u *arg));
int put_eol __ARGS((FILE *fd)); int put_eol __ARGS((FILE *fd));

View File

@ -11,6 +11,7 @@ void mch_didjmp __ARGS((void));
void mch_suspend __ARGS((void)); void mch_suspend __ARGS((void));
void mch_init __ARGS((void)); void mch_init __ARGS((void));
void reset_signals __ARGS((void)); void reset_signals __ARGS((void));
int handle_sighup __ARGS((int when));
int mch_check_win __ARGS((int argc, char **argv)); int mch_check_win __ARGS((int argc, char **argv));
int mch_input_isatty __ARGS((void)); int mch_input_isatty __ARGS((void));
int mch_can_restore_title __ARGS((void)); int mch_can_restore_title __ARGS((void));

View File

@ -40,6 +40,7 @@ int mouse_model_popup __ARGS((void));
void scroll_start __ARGS((void)); void scroll_start __ARGS((void));
void cursor_on __ARGS((void)); void cursor_on __ARGS((void));
void cursor_off __ARGS((void)); void cursor_off __ARGS((void));
void term_cursor_shape __ARGS((void));
void scroll_region_set __ARGS((win_T *wp, int off)); void scroll_region_set __ARGS((win_T *wp, int off));
void scroll_region_reset __ARGS((void)); void scroll_region_reset __ARGS((void));
void clear_termcodes __ARGS((void)); void clear_termcodes __ARGS((void));

View File

@ -110,8 +110,8 @@ typedef struct
int attr; /* attributes to be used for a match */ int attr; /* attributes to be used for a match */
int attr_cur; /* attributes currently active in win_line() */ int attr_cur; /* attributes currently active in win_line() */
linenr_T first_lnum; /* first lnum to search for multi-line pat */ linenr_T first_lnum; /* first lnum to search for multi-line pat */
char_u *startp; /* in win_line() points to char where HL starts */ colnr_T startcol; /* in win_line() points to char where HL starts */
char_u *endp; /* in win_line() points to char where HL ends */ colnr_T endcol; /* in win_line() points to char where HL ends */
} match_T; } match_T;
static match_T search_hl; /* used for 'hlsearch' highlight matching */ static match_T search_hl; /* used for 'hlsearch' highlight matching */
@ -944,8 +944,8 @@ win_update(wp)
/* When a change starts above w_topline and the end is below /* When a change starts above w_topline and the end is below
* w_topline, start redrawing at w_topline. * w_topline, start redrawing at w_topline.
* If the end of the change is above w_topline: do like no changes was * If the end of the change is above w_topline: do like no change was
* maded, but redraw the first line to find changes in syntax. */ * made, but redraw the first line to find changes in syntax. */
if (mod_top != 0 && mod_top < wp->w_topline) if (mod_top != 0 && mod_top < wp->w_topline)
{ {
if (mod_bot > wp->w_topline) if (mod_bot > wp->w_topline)
@ -955,6 +955,11 @@ win_update(wp)
top_end = 1; top_end = 1;
#endif #endif
} }
/* When line numbers are displayed need to redraw all lines below
* inserted/deleted lines. */
if (mod_top != 0 && buf->b_mod_xlines != 0 && wp->w_p_nu)
mod_bot = MAXLNUM;
} }
/* /*
@ -1625,12 +1630,6 @@ win_update(wp)
} }
} }
} }
/* When inserting or deleting lines and 'number' is set:
* Redraw all lines below the change to update the line
* numbers. */
if (buf->b_mod_xlines != 0 && wp->w_p_nu)
bot_start = 0;
} }
#ifdef FEAT_FOLDING #ifdef FEAT_FOLDING
@ -2642,6 +2641,8 @@ win_line(wp, lnum, startrow, endrow)
fromcol = -10; fromcol = -10;
tocol = MAXCOL; tocol = MAXCOL;
} }
else if (bot->col == MAXCOL)
tocol = MAXCOL;
else else
{ {
pos = *bot; pos = *bot;
@ -2852,8 +2853,8 @@ win_line(wp, lnum, startrow, endrow)
shl = &search_hl; shl = &search_hl;
for (;;) for (;;)
{ {
shl->startp = NULL; shl->startcol = MAXCOL;
shl->endp = NULL; shl->endcol = MAXCOL;
shl->attr_cur = 0; shl->attr_cur = 0;
if (shl->rm.regprog != NULL) if (shl->rm.regprog != NULL)
{ {
@ -2868,25 +2869,25 @@ win_line(wp, lnum, startrow, endrow)
if (shl->lnum != 0 && shl->lnum <= lnum) if (shl->lnum != 0 && shl->lnum <= lnum)
{ {
if (shl->lnum == lnum) if (shl->lnum == lnum)
shl->startp = line + shl->rm.startpos[0].col; shl->startcol = shl->rm.startpos[0].col;
else else
shl->startp = line; shl->startcol = 0;
if (lnum == shl->lnum + shl->rm.endpos[0].lnum if (lnum == shl->lnum + shl->rm.endpos[0].lnum
- shl->rm.startpos[0].lnum) - shl->rm.startpos[0].lnum)
shl->endp = line + shl->rm.endpos[0].col; shl->endcol = shl->rm.endpos[0].col;
else else
shl->endp = line + MAXCOL; shl->endcol = MAXCOL;
/* Highlight one character for an empty match. */ /* Highlight one character for an empty match. */
if (shl->startp == shl->endp) if (shl->startcol == shl->endcol)
{ {
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
if (has_mbyte && *shl->endp != NUL) if (has_mbyte && line[shl->endcol] != NUL)
shl->endp += (*mb_ptr2len_check)(shl->endp); shl->endcol += (*mb_ptr2len_check)(line + shl->endcol);
else else
#endif #endif
++shl->endp; ++shl->endcol;
} }
if (shl->startp < ptr) /* match at leftcol */ if ((long)shl->startcol < v) /* match at leftcol */
{ {
shl->attr_cur = shl->attr; shl->attr_cur = shl->attr;
search_attr = shl->attr; search_attr = shl->attr;
@ -3150,22 +3151,22 @@ win_line(wp, lnum, startrow, endrow)
* Do this first for search_hl, then for match_hl, so that * Do this first for search_hl, then for match_hl, so that
* ":match" overrules 'hlsearch'. * ":match" overrules 'hlsearch'.
*/ */
v = (long)(ptr - line);
shl = &search_hl; shl = &search_hl;
for (;;) for (;;)
{ {
while (shl->rm.regprog != NULL) while (shl->rm.regprog != NULL)
{ {
if (shl->startp != NULL if (shl->startcol != MAXCOL
&& ptr >= shl->startp && v >= (long)shl->startcol
&& ptr < shl->endp) && v < (long)shl->endcol)
{ {
shl->attr_cur = shl->attr; shl->attr_cur = shl->attr;
} }
else if (ptr == shl->endp) else if (v == (long)shl->endcol)
{ {
shl->attr_cur = 0; shl->attr_cur = 0;
v = (long)(ptr - line);
next_search_hl(wp, shl, lnum, (colnr_T)v); next_search_hl(wp, shl, lnum, (colnr_T)v);
/* Need to get the line again, a multi-line regexp /* Need to get the line again, a multi-line regexp
@ -3175,23 +3176,23 @@ win_line(wp, lnum, startrow, endrow)
if (shl->lnum == lnum) if (shl->lnum == lnum)
{ {
shl->startp = line + shl->rm.startpos[0].col; shl->startcol = shl->rm.startpos[0].col;
if (shl->rm.endpos[0].lnum == 0) if (shl->rm.endpos[0].lnum == 0)
shl->endp = line + shl->rm.endpos[0].col; shl->endcol = shl->rm.endpos[0].col;
else else
shl->endp = line + MAXCOL; shl->endcol = MAXCOL;
if (shl->startp == shl->endp) if (shl->startcol == shl->endcol)
{ {
/* highlight empty match, try again after /* highlight empty match, try again after
* it */ * it */
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
if (has_mbyte) if (has_mbyte)
shl->endp += shl->endcol += (*mb_ptr2len_check)(line
(*mb_ptr2len_check)(shl->endp); + shl->endcol);
else else
#endif #endif
++shl->endp; ++shl->endcol;
} }
/* Loop to check if the match starts at the /* Loop to check if the match starts at the
@ -3635,8 +3636,22 @@ win_line(wp, lnum, startrow, endrow)
c = ' '; c = ' ';
} }
} }
else if (c == NUL && wp->w_p_list && lcs_eol_one > 0) else if (c == NUL
&& ((wp->w_p_list && lcs_eol > 0)
|| ((fromcol >= 0 || fromcol_prev >= 0)
&& tocol > vcol
&& VIsual_mode != Ctrl_V
&& (
# ifdef FEAT_RIGHTLEFT
wp->w_p_rl ? (col >= 0) :
# endif
(col < W_WIDTH(wp)))
&& !(noinvcur
&& (colnr_T)vcol == wp->w_virtcol)))
&& lcs_eol_one >= 0)
{ {
/* Display a '$' after the line or highlight an extra
* character if the line break is included. */
#if defined(FEAT_DIFF) || defined(LINE_ATTR) #if defined(FEAT_DIFF) || defined(LINE_ATTR)
/* For a diff line the highlighting continues after the /* For a diff line the highlighting continues after the
* "$". */ * "$". */
@ -3667,7 +3682,10 @@ win_line(wp, lnum, startrow, endrow)
c_extra = NUL; c_extra = NUL;
} }
} }
c = lcs_eol; if (wp->w_p_list)
c = lcs_eol;
else
c = ' ';
lcs_eol_one = -1; lcs_eol_one = -1;
--ptr; /* put it back at the NUL */ --ptr; /* put it back at the NUL */
if (area_attr == 0 && search_attr == 0) if (area_attr == 0 && search_attr == 0)
@ -3847,8 +3865,8 @@ win_line(wp, lnum, startrow, endrow)
&& ((area_attr != 0 && vcol == fromcol) && ((area_attr != 0 && vcol == fromcol)
#ifdef FEAT_SEARCH_EXTRA #ifdef FEAT_SEARCH_EXTRA
/* highlight 'hlsearch' match at end of line */ /* highlight 'hlsearch' match at end of line */
|| ptr - 1 == search_hl.startp || (ptr - line) - 1 == (long)search_hl.startcol
|| ptr - 1 == match_hl.startp || (ptr - line) - 1 == (long)match_hl.startcol
#endif #endif
)) ))
{ {
@ -3885,7 +3903,7 @@ win_line(wp, lnum, startrow, endrow)
#ifdef FEAT_SEARCH_EXTRA #ifdef FEAT_SEARCH_EXTRA
if (area_attr == 0) if (area_attr == 0)
{ {
if (ptr - 1 == match_hl.startp) if ((ptr - line) - 1 == (long)match_hl.startcol)
char_attr = match_hl.attr; char_attr = match_hl.attr;
else else
char_attr = search_hl.attr; char_attr = search_hl.attr;

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