updated for version 7.0007

This commit is contained in:
Bram Moolenaar
2004-07-10 09:47:34 +00:00
parent 325b7a2fb5
commit 8299df966a
54 changed files with 3573 additions and 2586 deletions

View File

@ -71,6 +71,7 @@ DOCS = \
pi_gzip.txt \
pi_netrw.txt \
pi_spec.txt \
print.txt \
quickfix.txt \
quickref.txt \
quotes.txt \
@ -126,6 +127,7 @@ DOCS = \
version4.txt \
version5.txt \
version6.txt \
version7.txt \
vi_diff.txt \
visual.txt \
windows.txt \
@ -189,6 +191,7 @@ HTMLS = \
pi_gzip.html \
pi_netrw.html \
pi_spec.html \
print.html \
quickfix.html \
quickref.html \
quotes.html \
@ -245,6 +248,7 @@ HTMLS = \
version4.html \
version5.html \
version6.html \
version7.html \
vi_diff.html \
visual.html \
windows.html \

View File

@ -928,6 +928,8 @@ system( {expr}) String output of shell command {expr}
tempname() String name for a temporary file
tolower( {expr}) String the String {expr} switched to lowercase
toupper( {expr}) String the String {expr} switched to uppercase
tr( {src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr}
to chars in {tostr}
type( {name}) Number type of variable {name}
virtcol( {expr}) Number screen column of cursor or mark
visualmode( [expr]) String last visual mode used
@ -2608,6 +2610,20 @@ toupper({expr}) *toupper()*
characters turned into uppercase (just like applying |gU| to
the string).
tr({src}, {fromstr}, {tostr}) *tr()*
The result is a copy of the {src} string with all characters
which appear in {fromstr} replaced by the character in that
position in the {tostr} string. Thus the first character in
{fromstr} is translated into the first character in {tostr}
and so on. Exactly like the unix "tr" command.
This code also deals with multibyte characters properly.
Examples: >
echo tr("hello there", "ht", "HT")
< returns "Hello THere" >
echo tr("<blob>", "<>", "{}")
< returns "{blob}"
type({expr}) *type()*
The result is a Number:
0 if {expr} has the type Number

View File

@ -129,6 +129,7 @@ Advanced editing ~
|fold.txt| hide (fold) ranges of lines
Special issues ~
|print.txt| printing
|remote.txt| using Vim as a server or client
|term.txt| using different terminals and mice
|digraph.txt| list of available digraphs

View File

@ -1,4 +1,4 @@
*indent.txt* For Vim version 7.0aa. Last change: 2004 Apr 25
*indent.txt* For Vim version 7.0aa. Last change: 2004 Jul 07
VIM REFERENCE MANUAL by Bram Moolenaar
@ -425,8 +425,8 @@ assume a 'shiftwidth' of 4.
The defaults, spelled out in full, are:
cinoptions=>s,e0,n0,f0,{0,}0,^0,:s,=s,l0,gs,hs,ps,ts,+s,c3,C0,(2s,us,
\U0,w0,m0,j0,)20,*30
cinoptions=>s,e0,n0,f0,{0,}0,^0,:s,=s,l0,b0,gs,hs,ps,ts,is,+s,c3,C0,
/0,(2s,us,U0,w0,W0,m0,j0,)20,*30
Vim puts a line in column 1 if:
- It starts with '#' (preprocessor directives), if 'cinkeys' contains '#'.

View File

@ -1,4 +1,4 @@
*index.txt* For Vim version 7.0aa. Last change: 2004 Jul 04
*index.txt* For Vim version 7.0aa. Last change: 2004 Jul 07
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1224,6 +1224,8 @@ The commands are sorted on the non-optional part of their name.
|:mkvimrc| :mkv[imrc] write current mappings and settings to a file
|:mkview| :mkvie[w] write view of current window to a file
|:mode| :mod[e] show or change the screen mode
|:mzscheme| :mz[scheme] execute MzScheme command
|:mzfile| :mzf[ile] execute MzScheme script file
|:next| :n[ext] go to next file in the argument list
|:new| :new create a new empty window
|:nmap| :nm[ap] like ":map" but for Normal mode

View File

@ -1,4 +1,4 @@
*mbyte.txt* For Vim version 7.0aa. Last change: 2004 Jun 16
*mbyte.txt* For Vim version 7.0aa. Last change: 2004 Jul 05
VIM REFERENCE MANUAL by Bram Moolenaar et al.
@ -742,6 +742,8 @@ is suitable for complex input, such as CJK.
Traditional and Simplified Chinese characters. And it can accept other
locale if you make a correct input table. Xcin can be found at:
http://xcin.linux.org.tw/
Others are scim: http://scim.freedesktop.org/ and fcitx:
http://www.fcitx.org/
- Conversion Server
*conversion-server*

View File

@ -4511,52 +4511,17 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
{only available when compiled with the |+printer|
feature}
This defines the name of the printer to be used when the |:hardcopy|
command is issued with a bang (!) to skip the printer selection
dialog. On Win32, it should be the printer name exactly as it appears
in the standard printer dialog.
If the option is empty, then vim will use the system default printer
for ":hardcopy!"
The name of the printer to be used for |:hardcopy|.
See |pdev-option|.
*'printencoding'* *'penc'* *E620*
'printencoding' 'penc' String (default empty, except for:
Windows, OS/2: cp1252,
Macintosh: mac-roman,
VMS: dec-mcs,
HPUX: hp-roman8,
EBCDIC: ebcdic-uk)
*'printencoding'* *'penc'*
'printencoding' 'penc' String (default empty, except for some systems)
global
{not in Vi}
{only available when compiled with the |+printer|
and |+postscript| features}
Sets the character encoding used when printing. This option tells VIM
which print character encoding file from the "print" directory in
'runtimepath' to use.
This option will accept any value from |encoding-names|. Any
recognized names are converted to VIM standard names - see 'encoding'
for more details. Names not recognized by VIM will just be converted
to lower case and underscores replaced with '-' signs.
If 'printencoding' is empty or VIM cannot find the file then it will
use 'encoding' (if VIM is compiled with |+multi_byte| and it is set an
8-bit encoding) to find the print character encoding file. If VIM is
unable to find a character encoding file then it will use the "latin1"
print character encoding file.
When 'encoding' is set to a multi-byte encoding, VIM will try to
convert characters to the printing encoding for printing (if
'printencoding' is empty then the conversion will be to latin1).
Conversion to a printing encoding other than latin1 will require VIM
to be compiled with the |+iconv| feature. If no conversion is
possible then printing will fail. Any characters that cannot be
converted will be replaced with upside down question marks.
Four print character encoding files are provided to support default
Mac, VMS, HPUX, and EBCDIC character encodings and are used by default
on these platforms. Code page 1252 print character encoding is used
by default on Windows and OS/2 platforms.
Sets the character encoding used when printing.
See |penc-option|.
*'printexpr'* *'pexpr'*
'printexpr' 'pexpr' String (default: see below)
@ -4564,69 +4529,17 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
{only available when compiled with the |+printer|
and |+postscript| features}
Expression that is evaluated to print the PostScript produced with
":hardcopy".
The file name to be printed is in |v:fname_in|.
The arguments to the ":hardcopy" command are in |v:cmdarg|.
The expression must take care of deleting the file after printing it.
When there is an error, the expression must return a non-zero number.
If there is no error, return zero or an empty string.
The default for non MS-Windows or VMS systems is to simply use "lpr"
to print the file: >
Expression used to print the PostScript produced with |:hardcopy|.
See |pexpr-option|.
system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice)
. ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error
<
On MS-Dos, MS-Windows and OS/2 machines the default is to copy the
file to the currently specified printdevice: >
system('copy' . ' ' . v:fname_in . (&printdevice == ''
? ' LPT1:' : (' \"' . &printdevice . '\"')))
. delete(v:fname_in)
<
On VMS machines the default is to send the file to either the default
or currently specified printdevice: >
system('print' . (&printdevice == '' ? '' : ' /queue=' .
&printdevice) . ' ' . v:fname_in) . delete(v:fname_in)
<
If you change this option, using a function is an easy way to avoid
having to escape all the spaces. Example: >
:set printexpr=PrintFile(v:fname_in)
:function PrintFile(fname)
: call system("ghostview " . a:fname)
: call delete(a:fname)
: return v:shell_error
:endfunc
< Be aware that some print programs return control before they have read
the file. If you delete the file too soon it will not be printed.
These programs usually offer an option to have them remove the file
when printing is done.
*E365*
If evaluating the expression fails or it results in a non-zero number,
you get an error message. In that case Vim will delete the
file. In the default value for non-MS-Windows a trick is used: Adding
"v:shell_error" will result in a non-zero number when the system()
call fails.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'printfont'* *'pfn'* *E613*
*'printfont'* *'pfn'*
'printfont' 'pfn' string (default "courier")
global
{not in Vi}
{only available when compiled with the |+printer|
feature}
This is the name of the font that will be used for the |:hardcopy|
command's output. It has the same format as the 'guifont' option,
except that only one font may be named, and the special "guifont=*"
syntax is not available.
In the Win32 GUI version this specifies a font name with its extra
attributes, as with the 'guifont' option.
For other systems, only ":h11" is recognized, where "11" is the point
size of the font. When omitted, the point size is 10.
The name of the font that will be used for |:hardcopy|.
See |pfn-option|.
*'printheader'* *'pheader'*
'printheader' 'pheader' string (default "%<%f%h%m%=Page %N")
@ -4634,100 +4547,35 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
{only available when compiled with the |+printer|
feature}
This defines the format of the header produced in |:hardcopy| output.
The option is defined in the same way as the 'statusline' option.
If Vim has not been compiled with the |+statusline| feature, this
option has no effect and a simple default header is used, which shows
the page number.
The format of the header produced in |:hardcopy| output.
See |pheader-option|.
*'printmbcharset'* *'pmbcs'*
'printmbcharset' 'pmbcs' string (default "")
global
{not in Vi}
{only available when compiled with the |+printer|
and |+multi_byte| features}
The CJK character set to be used for CJK output from |:hardcopy|.
See |pmbcs-option|.
*'printmbfont'* *'pmbfn'*
'printmbfont' 'pmbfn' string (default "")
global
{not in Vi}
{only available when compiled with the |+printer|
and |+multi_byte| features}
List of font names to be used for CJK output from |:hardcopy|.
See |pmbfn-option|.
*'printoptions'* *'popt'*
'printoptions' 'popt' string (default "")
global
{not in Vi}
{only available when compiled with |+printer| feature}
This is a comma-separated list of items that control the format of
the output of |:hardcopy|:
List of items that control the format of the output of |:hardcopy|.
See |popt-option|.
left:{spec} left margin (default: 10pc)
right:{spec} right margin (default: 5pc)
top:{spec} top margin (default: 5pc)
bottom:{spec} bottom margin (default: 5pc)
{spec} is a number followed by "in" for
inches, "pt" for points (1 point is 1/72 of an
inch), "mm" for millimeters or "pc" for a
percentage of the media size.
Weird example:
left:2in,top:30pt,right:16mm,bottom:3pc
If the unit is not recognized there is no
error and the default value is used.
header:{nr} Number of lines to reserve for the header.
Only the first line is actually filled, thus
when {nr} is 2 there is one empty line. The
header is formatted according to
'printheader'.
header:0 Do not print a header.
header:2 (default) Use two lines for the header
syntax:n Do not use syntax highlighting. This is
faster and thus useful when printing large
files.
syntax:y Do syntax highlighting.
syntax:a (default) Use syntax highlighting if the printer appears
to be able to print color or grey.
number:y Include line numbers in the printed output.
number:n (default) No line numbers.
wrap:y (default) Wrap long lines.
wrap:n Truncate long lines.
duplex:off Print on one side.
duplex:long (default) Print on both sides (when possible), bind on
long side.
duplex:short Print on both sides (when possible), bind on
short side.
collate:y (default) Collating: 1 2 3, 1 2 3, 1 2 3
collate:n No collating: 1 1 1, 2 2 2, 3 3 3
jobsplit:n (default) Do all copies in one print job
jobsplit:y Do each copy as a separate print job. Useful
when doing N-up postprocessing.
portrait:y (default) Orientation is portrait.
portrait:n Orientation is landscape.
*a4* *letter*
paper:A4 (default) Paper size: A4
paper:{name} Paper size from this table:
{name} size in cm size in inch ~
10x14 25.4 x 35.57 10 x 14
A3 29.7 x 42 11.69 x 16.54
A4 21 x 29.7 8.27 x 11.69
A5 14.8 x 21 5.83 x 8.27
B4 25 x 35.3 10.12 x 14.33
B5 17.6 x 25 7.17 x 10.12
executive 18.42 x 26.67 7.25 x 10.5
folio 21 x 33 8.27 x 13
ledger 43.13 x 27.96 17 x 11
legal 21.59 x 35.57 8.5 x 14
letter 21.59 x 27.96 8.5 x 11
quarto 21.59 x 27.5 8.5 x 10.83
statement 13.97 x 21.59 5.5 x 8.5
tabloid 27.96 x 43.13 11 x 17
formfeed:n (default) Treat form feed characters (0x0c) as a normal
print character.
formfeed:y When a form feed character is encountered,
continue printing of the current line at the
beginning of the first line on a new page.
The item indicated with (default) is used when the item is not
present. The values are not always used, especially when using a
dialog to select the printer and options.
Example: >
:set printoptions=paper:letter,duplex:off
<
*'quoteescape''* *'qe'*
'quoteescape' 'qe' string (default "\")
local to buffer

View File

@ -17,20 +17,6 @@
5. Ex Commands.........................................|netrw-ex|
6. Variables and Options...............................|netrw-var|
7. Remote Directory Browser............................|netrw-browse|
?..........Help....................................|netrw-help|
<cr>.......Browsing................................|netrw-cr|
<c-l>......Refreshing the Listing..................|netrw-c-l|
<del>......Removing Files or Directories...........|netrw-delete|
D..........Removing Files or Directories...........|netrw-D|
R..........Renaming Files or Directories...........|netrw-R|
-..........Going Up................................|netrw--|
a..........Hiding Files or Directories.............|netrw-a|
h..........Edit File/Directory Hiding..............|netrw-h|
o..........Browsing with a Horizontal Split........|netrw-o|
r..........Reversing Sorting Order.................|netrw-r|
s..........Selecting Sorting Style.................|netrw-s|
v..........Browsing with a Vertical Split..........|netrw-v|
x..........Customizing Browsing....................|netrw-x|
8. Debugging...........................................|netrw-debug|
9. History.............................................|netrw-history|
10. Credits.............................................|netrw-credits|
@ -514,7 +500,26 @@ from <netrw.vim> itself:
==============================================================================
7. Remote Directory Browser *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
?..........Help....................................|netrw-help|
<cr>.......Browsing................................|netrw-cr|
<c-l>......Refreshing the Listing..................|netrw-c-l|
<del>......Removing Files or Directories...........|netrw-delete|
D..........Removing Files or Directories...........|netrw-D|
\H.........Edit File/Directory Hiding List.........|netrw-H|
\M.........Make A New Directory....................|netrw-M|
R..........Renaming Files or Directories...........|netrw-R|
-..........Going Up................................|netrw--|
a..........Hiding Files or Directories.............|netrw-a|
i..........Long Listing............................|netrw-i|
o..........Browsing with a Horizontal Split........|netrw-o|
r..........Reversing Sorting Order.................|netrw-r|
s..........Selecting Sorting Style.................|netrw-s|
v..........Browsing with a Vertical Split..........|netrw-v|
x..........Customizing Browsing....................|netrw-x|
*netrw-browse-cmds*
>
Quick Reference Commands Table
------- -----------
Command Explanation
------- -----------
? Causes Netrw to issue help
@ -526,6 +531,7 @@ from <netrw.vim> itself:
- Makes Netrw go up one directory
a Show all of a directory (temporarily ignore g:netrw_list_hide)
h Edit file hiding list
i Toggles between long and short listing
o Enter the file/directory under the cursor in a new browser
window. A horizontal split is used.
r Reverse sorting order
@ -540,16 +546,22 @@ from <netrw.vim> itself:
Var Explanation
--- -----------
g:netrw_list_cmd supports listing
g:netrw_rm_cmd supports removing files
g:netrw_rmf_cmd supports removing softlinks to directories
g:netrw_rmdir_cmd supports removing directories
g:netrw_winsize specify initial size of new o/v windows
g:netrw_list_hide comma separated list of patterns for
hiding files
g:netrw_local_mkdir specify command for making a directory locally
g:netrw_local_rmdir remove directory command default: rmdir
g:netrw_local_rename rename file/directory command
unix-default: rm win32-default: ren
g:netrw_mkdir_cmd specify command for making a directory remotely
g:netrw_rm_cmd supports removing files
g:netrw_rmdir_cmd supports removing directories
g:netrw_rmf_cmd supports removing softlinks to directories
g:netrw_sort_by sort by "name", "time", or "size"
g:netrw_sort_direction sorting direction: "normal" or "reverse"
g:netrw_sort_sequence when sorting by name, first sort by the
comma-separated pattern sequence
g:netrw_timefmt specify format string to strftime() default: %c
g:netrw_winsize specify initial size of new o/v windows
<
INTRODUCTION TO REMOTE DIRECTORY BROWSING
@ -588,15 +600,33 @@ preferred. The NetList function which implements remote directory
browsing expects that directories will be flagged by a trailing slash.
BROWSING *netrw-cr*
BROWSING *netrw-cr*
Browsing is simple: move the cursor onto a file or directory of interest.
Hitting the <cr> (the return key) will select the file or directory.
Directories will themselves be listed, and files will be opened using the
protocol given in the original read request.
LONG VS SHORT LISTING *netrw-i*
REMOVING FILES OR DIRECTORIES *netrw-delete* *netrw-remove* *netrw-D*
The short listing format gives just the files' and directories' names.
The long listing is either based on the "ls" command via ssh for remote
directories or displays the filename, file size (in bytes), and the
time and date of last modification for local directories.
MAKING A NEW DIRECTORY *netrw-M*
Actually <Leader>M, where the <Leader> is, by default, the backslash.
With the "<Leader>M" map one may make a new directory either remotely (which
depends on the global variable g:netrw_mkdir_cmd) or locally (which depends on
the global variable g:netrw_local_mkdir). Netrw will issue a request for the
new directory's name. A bare <CR> at that point will abort the making of the
directory. Attempts to make a local directory that already exists (as either
a file or a directory) will be detected, reported on, and ignored.
REMOVING FILES OR DIRECTORIES *netrw-delete* *netrw-remove* *netrw-D*
Deleting/removing files and directories involves moving the cursor to the
file/directory to be deleted and pressing "D". Directories must be empty first
@ -626,7 +656,7 @@ to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
g:netrw_rmf_cmd: ssh HOSTNAME rm -f
RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename*
RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R*
Renaming/moving files and directories involves moving the cursor to the
file/directory to be moved (renamed) and pressing "R". You will then be
@ -643,13 +673,18 @@ HIDING FILES OR DIRECTORIES *g:netrw_a* *g:netrw_list_hide*
The "a" map lets the browser ignore the g:netrw_list_hide variable. Normally
the g:netrw_list_hide variable holds a comma separated list of patterns which
will be hidden (removed) from the directory listing.
will be hidden (removed) from the directory listing. Mnemonically, the
"a" stands for show All.
EDIT FILE OR DIRECTORY HIDING *netrw-h*
EDIT FILE OR DIRECTORY HIDING LIST *netrw-H*
The "h" map brings up a requestor allowing the user to change the
file/directory hiding list.
Actually <Leader>H, where the <Leader> is, by default, the backslash.
The "<Leader>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 delimited by commas. Files and/or directories satisfying
these patterns will be hidden (ie. not shown).
BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o*

751
runtime/doc/print.txt Normal file
View File

@ -0,0 +1,751 @@
*print.txt* For Vim version 7.0aa. Last change: 2004 Jul 05
VIM REFERENCE MANUAL by Bram Moolenaar
Printing *printing*
1. Introduction |print-intro|
2. Print options |print-options|
3. PostScript Printing |postscript-printing|
4. PostScript Printing Encoding |postscript-print-encoding|
5. PostScript CJK Printing |postscript-cjk-printing|
6. PostScript Printing Troubleshooting |postscript-print-trouble|
7. PostScript Utilities |postscript-print-util|
8. Formfeed Characters |printing-formfeed|
{Vi has None of this}
{only available when compiled with the |+printer| feature}
==============================================================================
1. Introduction *print-intro*
On MS-Windows Vim can print your text on any installed printer. On other
systems a PostScript file is produced. This can be directly sent to a
PostScript printer. For other printers a program like ghostscript needs to be
used.
*:ha* *:hardcopy* *E237* *E238* *E324*
:[range]ha[rdcopy][!] [arguments]
Send [range] lines (default whole file) to the
printer.
On MS-Windows a dialog is displayed to allow selection
of printer, paper size etc. To skip the dialog, use
the [!]. In this case the printer defined by
'printdevice' is used, or, if 'printdevice' is empty,
the system default printer.
For systems other than MS-Windows, PostScript is
written in a temp file and 'printexpr' is used to
actually print it. Then [arguments] can be used by
'printexpr' through |v:cmdarg|. Otherwise [arguments]
is ignored. 'printoptions' can be used to specify
paper size, duplex, etc.
:[range]ha[rdcopy][!] >{filename}
As above, but write the resulting PostScript in file
{filename}.
Things like "%" are expanded |cmdline-special|
Careful: An existing file is silently overwritten.
{only available when compiled with the |+postscript|
feature}
On MS-Windows use the "print to file" feature of the
printer driver.
Progress is displayed during printing as a page number and a percentage. To
abort printing use the interrupt key (CTRL-C or, on MS-systems, CTRL-Break).
Printer output is controlled by the 'printfont' and 'printoptions' options.
'printheader' specifies the format of a page header.
The printed file is always limited to the selected margins, irrespective of
the current window's 'wrap' or 'linebreak' settings. The "wrap" item in
'printoptions' can be used to switch wrapping off.
The current highlighting colors are used in the printout, with the following
considerations:
1) The normal background is always rendered as white (i.e. blank paper.)
2) White text or the default foreground is rendered as black, so that it shows
up!
3) If 'background' is "dark", then the colours are darkened to compensate for
the fact that otherwise they would be too bright to show up clearly on
white paper.
==============================================================================
2. Print options *print-options*
Here are the details for the options that change the way printing is done.
For generic info about setting options see |options.txt|.
*pdev-option*
'printdevice' 'pdev' string (default empty)
global
This defines the name of the printer to be used when the |:hardcopy| command
is issued with a bang (!) to skip the printer selection dialog. On Win32, it
should be the printer name exactly as it appears in the standard printer
dialog.
If the option is empty, then vim will use the system default printer for
":hardcopy!"
*penc-option* *E620*
'printencoding' 'penc' String (default empty, except for:
Windows, OS/2: cp1252,
Macintosh: mac-roman,
VMS: dec-mcs,
HPUX: hp-roman8,
EBCDIC: ebcdic-uk)
global
Sets the character encoding used when printing. This option tells VIM which
print character encoding file from the "print" directory in 'runtimepath' to
use.
This option will accept any value from |encoding-names|. Any recognized names
are converted to VIM standard names - see 'encoding' for more details. Names
not recognized by VIM will just be converted to lower case and underscores
replaced with '-' signs.
If 'printencoding' is empty or VIM cannot find the file then it will use
'encoding' (if VIM is compiled with |+multi_byte| and it is set an 8-bit
encoding) to find the print character encoding file. If VIM is unable to find
a character encoding file then it will use the "latin1" print character
encoding file.
When 'encoding' is set to a multi-byte encoding, VIM will try to convert
characters to the printing encoding for printing (if 'printencoding' is empty
then the conversion will be to latin1). Conversion to a printing encoding
other than latin1 will require VIM to be compiled with the |+iconv| feature.
If no conversion is possible then printing will fail. Any characters that
cannot be converted will be replaced with upside down question marks.
Four print character encoding files are provided to support default Mac, VMS,
HPUX, and EBCDIC character encodings and are used by default on these
platforms. Code page 1252 print character encoding is used by default on
Windows and OS/2 platforms.
*pexpr-option*
'printexpr' 'pexpr' String (default: see below)
global
Expression that is evaluated to print the PostScript produced with
|:hardcopy|.
The file name to be printed is in |v:fname_in|.
The arguments to the ":hardcopy" command are in |v:cmdarg|.
The expression must take care of deleting the file after printing it.
When there is an error, the expression must return a non-zero number.
If there is no error, return zero or an empty string.
The default for non MS-Windows or VMS systems is to simply use "lpr" to print
the file: >
system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice)
. ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error
On MS-Dos, MS-Windows and OS/2 machines the default is to copy the file to the
currently specified printdevice: >
system('copy' . ' ' . v:fname_in . (&printdevice == ''
? ' LPT1:' : (' \"' . &printdevice . '\"')))
. delete(v:fname_in)
On VMS machines the default is to send the file to either the default or
currently specified printdevice: >
system('print' . (&printdevice == '' ? '' : ' /queue=' .
&printdevice) . ' ' . v:fname_in) . delete(v:fname_in)
If you change this option, using a function is an easy way to avoid having to
escape all the spaces. Example: >
:set printexpr=PrintFile(v:fname_in)
:function PrintFile(fname)
: call system("ghostview " . a:fname)
: call delete(a:fname)
: return v:shell_error
:endfunc
Be aware that some print programs return control before they have read the
file. If you delete the file too soon it will not be printed. These programs
usually offer an option to have them remove the file when printing is done.
*E365*
If evaluating the expression fails or it results in a non-zero number, you get
an error message. In that case Vim will delete the file. In the default
value for non-MS-Windows a trick is used: Adding "v:shell_error" will result
in a non-zero number when the system() call fails.
This option cannot be set from a |modeline| or in the |sandbox|, for security
reasons.
*pfn-option* *E613*
'printfont' 'pfn' string (default "courier")
global
This is the name of the font that will be used for the |:hardcopy| command's
output. It has the same format as the 'guifont' option, except that only one
font may be named, and the special "guifont=*" syntax is not available.
In the Win32 GUI version this specifies a font name with its extra attributes,
as with the 'guifont' option.
For other systems, only ":h11" is recognized, where "11" is the point size of
the font. When omitted, the point size is 10.
*pheader-option*
'printheader' 'pheader' string (default "%<%f%h%m%=Page %N")
global
This defines the format of the header produced in |:hardcopy| output. The
option is defined in the same way as the 'statusline' option. If Vim has not
been compiled with the |+statusline| feature, this option has no effect and a
simple default header is used, which shows the page number.
*pmbcs-option*
'printmbcharset' 'pmbcs' string (default "")
global
Sets the CJK character set to be used when generating CJK output from
|:hardcopy|. The following predefined values are currently recognised by VIM:
Value Description ~
Chinese GB_2312-80
(Simplified) GBT_12345-90
MAC Apple Mac Simplified Chinese
GBT-90_MAC GB/T 12345-90 Apple Mac Simplified
Chinese
GBK GBK (GB 13000.1-93)
ISO10646 ISO 10646-1:1993
Chinese CNS_1993 CNS 11643-1993, Planes 1 & 2
(Traditional) BIG5
ETEN Big5 with ETen extensions
ISO10646 ISO 10646-1:1993
Japanese JIS_C_1978
JIS_X_1983
JIS_X_1990
MSWINDOWS Win3.1/95J (JIS X 1997 + NEC +
IBM extensions)
KANJITALK6 Apple Mac KanjiTalk V6.x
KANJITALK7 Apple Mac KanjiTalk V7.x
Korean KS_X_1992
MAC Apple Macintosh Korean
MSWINDOWS KS X 1992 with MS extensions
ISO10646 ISO 10646-1:1993
Only certain combinations of the above values and 'printencoding' are
possible. The following tables show the valid combinations:
euc-cn gbk ucs-2 utf-8 ~
Chinese GB_2312-80 x
(Simplified) GBT_12345-90 x
MAC x
GBT-90_MAC x
GBK x
ISO10646 x x
euc-tw big5 ucs-2 utf-8 ~
Chinese CNS_1993 x
(Traditional) BIG5 x
ETEN x
ISO10646 x x
euc-jp sjis ucs-2 utf-8 ~
Japanese JIS_C_1978 x x
JIS_X_1983 x x
JIS_X_1990 x x x
MSWINDOWS x
KANJITALK6 x
KANJITALK7 x
euc-kr cp949 ucs-2 utf-8 ~
Korean KS_X_1992 x
MAC x
MSWINDOWS x
ISO10646 x x
To set up the correct encoding and character set for printing some
Japanese text you would do the following; >
:set printencoding=euc-jp
:set printmbcharset=JIS_X_1983
If 'printmbcharset' is not one of the above values then it is assumed to
specify a custom multi-byte character set and no check will be made that it is
compatible with the value for 'printencoding'. VIM will look for a file
defining the character set in the "print" directory in 'runtimepath'.
*pmbfn-option*
'printmbfont' 'pmbfn' string (default "")
global
This is a comma-separated list of fields for font names to be used when
generating CJK output from |:hardcopy|. Each font name has to be preceded
with a letter indicating the style the font is to be used for as follows:
r:{font-name} font to use for normal characters
b:{font-name} font to use for bold characters
i:{font-name} font to use for italic characters
o:{font-name} font to use for bold-italic characters
A field with the r: prefix must be specified when doing CJK printing. The
other fontname specifiers are optional. If a specifier is missing then
another font will be used as follows:
if b: is missing, then use r:
if i: is missing, then use r:
if o: is missing, then use i:
Some CJK fonts do not contain characters for codes in the ASCII code range.
Also, some characters in the CJK ASCII code ranges differ in a few code points
from traditional ASCII characters. There are two additional fields to control
printing of characters in the ASCII code range.
c:yes Use Courier font for characters in the ASCII
c:no (default) code range.
a:yes Use ASCII character set for codes in the ASCII
a:no (default) code range.
The following is an example of specifying two multi-byte fonts, one for normal
and italic printing and one for bold and bold-italic printing, and using
Courier to print codes in the ASCII code range but using the national
character set: >
:set printmbfont=r:WadaMin-Regular,b:WadaMin-Bold,c:yes
<
*popt-option*
'printoptions' 'popt' string (default "")
global
This is a comma-separated list of items that control the format of the output
of |:hardcopy|:
left:{spec} left margin (default: 10pc)
right:{spec} right margin (default: 5pc)
top:{spec} top margin (default: 5pc)
bottom:{spec} bottom margin (default: 5pc)
{spec} is a number followed by "in" for inches, "pt"
for points (1 point is 1/72 of an inch), "mm" for
millimeters or "pc" for a percentage of the media
size.
Weird example:
left:2in,top:30pt,right:16mm,bottom:3pc
If the unit is not recognized there is no error and
the default value is used.
header:{nr} Number of lines to reserve for the header.
Only the first line is actually filled, thus when {nr}
is 2 there is one empty line. The header is formatted
according to 'printheader'.
header:0 Do not print a header.
header:2 (default) Use two lines for the header
syntax:n Do not use syntax highlighting. This is faster and
thus useful when printing large files.
syntax:y Do syntax highlighting.
syntax:a (default) Use syntax highlighting if the printer appears to be
able to print color or grey.
number:y Include line numbers in the printed output.
number:n (default) No line numbers.
wrap:y (default) Wrap long lines.
wrap:n Truncate long lines.
duplex:off Print on one side.
duplex:long (default) Print on both sides (when possible), bind on long
side.
duplex:short Print on both sides (when possible), bind on short
side.
collate:y (default) Collating: 1 2 3, 1 2 3, 1 2 3
collate:n No collating: 1 1 1, 2 2 2, 3 3 3
jobsplit:n (default) Do all copies in one print job
jobsplit:y Do each copy as a separate print job. Useful when
doing N-up postprocessing.
portrait:y (default) Orientation is portrait.
portrait:n Orientation is landscape.
*a4* *letter*
paper:A4 (default) Paper size: A4
paper:{name} Paper size from this table:
{name} size in cm size in inch ~
10x14 25.4 x 35.57 10 x 14
A3 29.7 x 42 11.69 x 16.54
A4 21 x 29.7 8.27 x 11.69
A5 14.8 x 21 5.83 x 8.27
B4 25 x 35.3 10.12 x 14.33
B5 17.6 x 25 7.17 x 10.12
executive 18.42 x 26.67 7.25 x 10.5
folio 21 x 33 8.27 x 13
ledger 43.13 x 27.96 17 x 11
legal 21.59 x 35.57 8.5 x 14
letter 21.59 x 27.96 8.5 x 11
quarto 21.59 x 27.5 8.5 x 10.83
statement 13.97 x 21.59 5.5 x 8.5
tabloid 27.96 x 43.13 11 x 17
formfeed:n (default) Treat form feed characters (0x0c) as a normal print
character.
formfeed:y When a form feed character is encountered, continue
printing of the current line at the beginning of the
first line on a new page.
The item indicated with (default) is used when the item is not present. The
values are not always used, especially when using a dialog to select the
printer and options.
Example: >
:set printoptions=paper:letter,duplex:off
==============================================================================
3. PostScript Printing *postscript-printing*
*E455* *E456* *E457* *E624*
Provided you have enough disk space there should be no problems generating a
PostScript file. You need to have the runtime files correctly installed (if
you can find the help files, they probably are).
There are currently a number of limitations with PostScript printing:
- 'printfont' - The font name is ignored (the Courier family is always used -
it should be available on all PostScript printers) but the font size is
used.
- 'printoptions' - The duplex setting is used when generating PostScript
output, but it is up to the printer to take notice of the setting. If the
printer does not support duplex printing then it should be silently ignored.
Some printers, however, don't print at all.
- 8-bit support - While a number of 8-bit print character encodings are
supported it is possible that some characters will not print. Whether a
character will print depends on the font in the printer knowing the
character. Missing characters will be replaced with an upside down question
mark, or a space if that character is also not known by the font. It may be
possible to get all the characters in an encoding to print by installing a
new version of the Courier font family.
- Multi-byte support - Currently VIM will try to convert multi-byte characters
to the 8-bit encoding specified by 'printencoding' (or latin1 if it is
empty). Any characters that are not successfully converted are shown as
unknown characters. Printing will fail if VIM cannot convert the multi-byte
to the 8-bit encoding.
==============================================================================
4. Custom 8-bit Print Character Encodings *postscript-print-encoding*
*E618* *E619*
To use your own print character encoding when printing 8-bit character data
you need to define your own PostScript font encoding vector. Details on how
to to define a font encoding vector is beyond the scope of this help file, but
you can find details in the PostScript Language Reference Manual, 3rd Edition,
published by Addison-Wesley and available in PDF form at
http://www.adobe.com/. The following describes what you need to do for VIM to
locate and use your print character encoding.
i. Decide on a unique name for your encoding vector, one that does not clash
with any of the recognized or standard encoding names that VIM uses (see
|encoding-names| for a list), and that no one else is likely to use.
ii. Copy $VIMRUNTIME/print/latin1.ps to the print subdirectory in your
'runtimepath' and rename it with your unique name.
iii. Edit your renamed copy of latin1.ps, replacing all occurrences of latin1
with your unique name (don't forget the line starting %%Title:), and
modify the array of glyph names to define your new encoding vector. The
array must have exactly 256 entries or you will not be able to print!
iv. Within VIM, set 'printencoding' to your unique encoding name and then
print your file. VIM will now use your custom print character encoding.
VIM will report an error with the resource file if you change the order or
content of the first 3 lines, other than the name of the encoding on the line
starting %%Title: or the version number on the line starting %%Version:.
[Technical explanation for those that know PostScript - VIM looks for a file
with the same name as the encoding it will use when printing. The file
defines a new PostScript Encoding resource called /VIM-name, where name is the
print character encoding VIM will use.]
==============================================================================
5. PostScript CJK Printing *postscript-cjk-printing*
*E673* *E674* *E675*
VIM supports printing of Chinese, Japanese, and Korean files. Setting up VIM
to correctly print CJK files requires setting up a few more options.
Each of these countries has many standard character sets and encodings which
require that both be specified when printing. In addition, CJK fonts normally
do not have the concept of italic glyphs and use different weight or stroke
style to achieve emphasis when printing. This in turn requires a different
approach to specifying fonts to use when printing.
The encoding and character set are specified with the 'printencoding' and
'printmbcharset' options. If 'printencoding' is not specified then 'encoding'
is used as normal. If 'printencoding' is specified then characters will be
translated to this encoding for printing. You should ensure that the encoding
is compatible with the character set needed for the file contents or some
characters may not appear when printed.
The fonts to use for CJK printing are specified with 'printmbfont'. This
option allows you to specify different fonts to use when printing characters
which are syntax highlighted with the font styles normal, italic, bold and
bold-italic.
No CJK fonts are supplied with VIM. There are some free Korean, Japanese, and
Traditional Chinese fonts available at:
http://examples.oreilly.com/cjkvinfo/adobe/samples/
You can find descriptions of the various fonts in the read me file at
http://examples.oreilly.com/cjkvinfo/adobe/00README
Please read your printer documentation on how to install new fonts.
CJK fonts can be large containing several thousand glyphs, and it is not
uncommon to find that they only contain a subset of a national standard. It
is not unusual to find the fonts to not include characters for codes in the
ASCII code range. If you find half-width Roman characters are not appearing
in your printout then you should configure VIM to use the Courier font the
half-width ASCII characters with 'printmbfont'. If your font does not include
other characters then you will need to find another font that does.
Another issue with ASCII characters, is that the various national character
sets specify a couple of different glyphs in the ASCII code range. If you
print ASCII text using the national character set you may see some unexpected
characters. If you want true ASCII code printing then you need to configure
VIM to output ASCII characters for the ASCII code range with 'printmbfont'.
It is possible to define your own multi-byte character set although this
should not be attempted lightly. A discussion on the process if beyond the
scope of these help files. You can find details on CMap (character map) files
in the document 'Adobe CMap and CIDFont Files Specification, Version 1.0',
available from http://www.adobe.com as a PDF file.
==============================================================================
6. PostScript Printing Troubleshooting *postscript-print-trouble*
*E621*
Usually the only sign of a problem when printing with PostScript is that your
printout does not appear. If you are lucky you may get a printed page that
tells you the PostScript operator that generated the error that prevented the
print job completing.
There are a number of possible causes as to why the printing may have failed:
- Wrong version of the prolog resource file. The prolog resource file
contains some PostScript that VIM needs to be able to print. Each version
of VIM needs one particular version. Make sure you have correctly installed
the runtime files, and don't have any old versions of a file called prolog
in the print directory in your 'runtimepath' directory.
- Paper size. Some PostScript printers will abort printing a file if they do
not support the requested paper size. By default VIM uses A4 paper. Find
out what size paper your printer normally uses and set the appropriate paper
size with 'printoptions'. If you cannot find the name of the paper used,
measure a sheet and compare it with the table of supported paper sizes listed
for 'printoptions', using the paper that is closest in both width AND height.
Note: The dimensions of actual paper may vary slightly from the ones listed.
If there is no paper listed close enough, then you may want to try psresize
from PSUtils, discussed below.
- Two-sided printing (duplex). Normally a PostScript printer that does not
support two-sided printing will ignore any request to do it. However, some
printers may abort the job altogether. Try printing with duplex turned off.
Note: Duplex prints can be achieved manually using PS utils - see below.
- Collated printing. As with Duplex printing, most PostScript printers that
do not support collating printouts will ignore a request to do so. Some may
not. Try printing with collation turned off.
- Syntax highlighting. Some print management code may prevent the generated
PostScript file from being printed on a black and white printer when syntax
highlighting is turned on, even if solid black is the only color used. Try
printing with syntax highlighting turned off.
A safe printoptions setting to try is: >
:set printoptions=paper:A4,duplex:off,collate:n,syntax:n
Replace "A4" with the paper size that best matches your printer paper.
==============================================================================
7. PostScript Utilities *postscript-print-util*
7.1 Ghostscript
Ghostscript is a PostScript and PDF interpreter that can be used to display
and print on non-PostScript printers PostScript and PDF files. It can also
generate PDF files from PostScript.
Ghostscript will run on a wide variety of platforms.
There are three available versions:
- AFPL Ghostscript (formerly Aladdin Ghostscript) which is free for
non-commercial use. It can be obtained from:
http://www.cs.wisc.edu/~ghost/
- GNU Ghostscript which is available under the GNU General Public License. It
can be obtained from:
ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/gnu/
- A commercial version for inclusion in commercial products.
Additional information on Ghostscript can also be found at:
http://www.ghostscript.com/
Support for a number of non PostScript printers is provided in the
distribution as standard, but if you cannot find support for your printer
check the Ghostscript site for other printers not included by default.
7.2 Ghostscript Previewers.
The interface to Ghostscript is very primitive so a number of graphical front
ends have been created. These allow easier PostScript file selection,
previewing at different zoom levels, and printing. Check supplied
documentation for full details.
X11
- Ghostview. Obtainable from:
http://www.cs.wisc.edu/~ghost/gv/
- gv. Derived from Ghostview. Obtainable from:
http://wwwthep.physik.uni-mainz.de/~plass/gv/
Copies (possibly not the most recent) can be found at:
http://www.cs.wisc.edu/~ghost/gv/
OpenVMS
- Is apparently supported in the main code now (untested). See:
http://wwwthep.physik.uni-mainz.de/~plass/gv/
Windows and OS/2
- GSview. Obtainable from:
http://www.cs.wisc.edu/~ghost/gsview/
DOS
- ps_view. Obtainable from:
ftp://ftp.pg.gda.pl/pub/TeX/support/ps_view/
ftp://ftp.dante.de/tex-archive/support/ps_view/
Linux
- GSview. Linux version of the popular Windows and OS/2 previewer.
Obtainable from:
http://www.cs.wisc.edu/~ghost/gsview/
- BMV. Different from Ghostview and gv in that it doesn't use X but svgalib.
Obtainable from:
ftp://sunsite.unc.edu/pub/Linux/apps/graphics/viewers/svga/bmv-1.2.tgz
7.3 PSUtils
PSUtils is a collection of utility programs for manipulating PostScript
documents. Binary distributions are available for many platforms, as well as
the full source. PSUtils can be found at:
http://knackered.org/angus/psutils
The utilities of interest include:
- psnup. Convert PS files for N-up printing.
- psselect. Select page range and order of printing.
- psresize. Change the page size.
- psbook. Reorder and lay out pages ready for making a book.
The output of one program can be used as the input to the next, allowing for
complex print document creation.
N-UP PRINTING
The psnup utility takes an existing PostScript file generated from VIM and
convert it to an n-up version. The simplest way to create a 2-up printout is
to first create a PostScript file with: >
:hardcopy > test.ps
Then on your command line execute: >
psnup -n 2 test.ps final.ps
Note: You may get warnings from some Ghostscript previewers for files produced
by psnup - these may safely be ignored.
Finally print the file final.ps to your PostScript printer with your
platform's print command. (You will need to delete the two PostScript files
afterwards yourself.) 'printexpr' could be modified to perform this extra
step before printing.
ALTERNATE DUPLEX PRINTING
It is possible to achieve a poor man's version of duplex printing using the PS
utility psselect. This utility has options -e and -o for printing just the
even or odd pages of a PS file respectively.
First generate a PS file with the 'hardcopy' command, then generate a new
files with all the odd and even numbered pages with: >
psselect -o test.ps odd.ps
psselect -e test.ps even.ps
Next print odd.ps with your platform's normal print command. Then take the
print output, turn it over and place it back in the paper feeder. Now print
even.ps with your platform's print command. All the even pages should now
appear on the back of the odd pages.
There a couple of points to bear in mind:
1. Position of the first page. If the first page is on top of the printout
when printing the odd pages then you need to reverse the order that the odd
pages are printed. This can be done with the -r option to psselect. This
will ensure page 2 is printed on the back of page 1.
Note: it is better to reverse the odd numbered pages rather than the even
numbered in case there are an odd number of pages in the original PS file.
2. Paper flipping. When turning over the paper with the odd pages printed on
them you may have to either flip them horizontally (along the long edge) or
vertically (along the short edge), as well as possibly rotating them 180
degrees. All this depends on the printer - it will be more obvious for
desktop ink jets than for small office laser printers where the paper path
is hidden from view.
==============================================================================
8. Formfeed Characters *printing-formfeed*
By default VIM does not do any special processing of |formfeed| control
characters. Setting the 'printoptions' formfeed item will make VIM recognize
formfeed characters and continue printing the current line at the beginning
of the first line on a new page. The use of formfeed characters provides
rudimentary print control but there are certain things to be aware of.
VIM will always start printing a line (including a line number if enabled)
containing a formfeed character, even if it is the first character on the
line. This means if a line starting with a formfeed character is the first
line of a page then VIM will print a blank page.
Since the line number is printed at the start of printing the line containing
the formfeed character, the remainder of the line printed on the new page
will not have a line number printed for it (in the same way as the wrapped
lines of a long line when wrap in 'printoptions' is enabled).
If the formfeed character is the last character on a line, then printing will
continue on the second line of the new page, not the first. This is due to
VIM processing the end of the line after the formfeed character and moving
down a line to continue printing.
Due to the points made above it is recommended that when formfeed character
processing is enabled, printing of line numbers is disabled, and that form
feed characters are not the last character on a line. Even then you may need
to adjust the number of lines before a formfeed character to prevent
accidental blank pages.
==============================================================================
vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,4 +1,4 @@
*quickref.txt* For Vim version 7.0aa. Last change: 2004 Jul 04
*quickref.txt* For Vim version 7.0aa. Last change: 2004 Jul 05
VIM REFERENCE MANUAL by Bram Moolenaar
@ -782,6 +782,8 @@ Short explanation of each option: *option-list*
|'printexpr'| |'pexpr'| expression used to print PostScript for :hardcopy
|'printfont'| |'pfn'| name of the font to be used for :hardcopy
|'printheader'| |'pheader'| format of the header used for :hardcopy
|'printmbcharset'| |'pmbcs'| CJK character set to be used for :hardcopy
|'printmbfont'| |'pmbfn'| font names to be used for CJK output of :hardcopy
|'printoptions'| |'popt'| controls the format of :hardcopy output
|'quoteescape'| |'qe'| escape characters used in a string
|'readonly'| |'ro'| disallow writing the buffer

View File

@ -1,4 +1,4 @@
*syntax.txt* For Vim version 7.0aa. Last change: 2004 Jul 01
*syntax.txt* For Vim version 7.0aa. Last change: 2004 Jul 06
VIM REFERENCE MANUAL by Bram Moolenaar
@ -812,11 +812,20 @@ is controlled by the variable dosbatch_cmdextversion. For Windows NT
this should have the value 1, and for Windows 2000 it should be 2.
Select the version you want with the following line: >
:let dosbatch_cmdextversion = 1
:let dosbatch_cmdextversion = 1
If this variable is not defined it defaults to a value of 2 to support
Windows 2000.
A second option covers whether *.btm files should be detected as type
"dosbatch" (MS-DOS batch files) or type "btm" (4DOS batch files). The latter
is used by default. You may select the former with the following line: >
:let g:dosbatch_syntax_for_btm = 1
If this variable is undefined or zero, btm syntax is selected.
DTD *dtd.vim* *dtd-syntax*

View File

@ -615,6 +615,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'pheader' options.txt /*'pheader'*
'pi' options.txt /*'pi'*
'pm' options.txt /*'pm'*
'pmbcs' options.txt /*'pmbcs'*
'pmbfn' options.txt /*'pmbfn'*
'popt' options.txt /*'popt'*
'preserveindent' options.txt /*'preserveindent'*
'previewheight' options.txt /*'previewheight'*
@ -624,6 +626,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'printexpr' options.txt /*'printexpr'*
'printfont' options.txt /*'printfont'*
'printheader' options.txt /*'printheader'*
'printmbcharset' options.txt /*'printmbcharset'*
'printmbfont' options.txt /*'printmbfont'*
'printoptions' options.txt /*'printoptions'*
'prompt' vi_diff.txt /*'prompt'*
'pt' options.txt /*'pt'*
@ -1923,8 +1927,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:gv gui_x11.txt /*:gv*
:gvim gui_x11.txt /*:gvim*
:h various.txt /*:h*
:ha various.txt /*:ha*
:hardcopy various.txt /*:hardcopy*
:ha print.txt /*:ha*
:hardcopy print.txt /*:hardcopy*
:help various.txt /*:help*
:helpf various.txt /*:helpf*
:helpfind various.txt /*:helpfind*
@ -3046,8 +3050,8 @@ E233 gui.txt /*E233*
E234 options.txt /*E234*
E235 options.txt /*E235*
E236 options.txt /*E236*
E237 various.txt /*E237*
E238 various.txt /*E238*
E237 print.txt /*E237*
E238 print.txt /*E238*
E239 sign.txt /*E239*
E24 message.txt /*E24*
E240 remote.txt /*E240*
@ -3140,7 +3144,7 @@ E320 message.txt /*E320*
E321 editing.txt /*E321*
E322 message.txt /*E322*
E323 message.txt /*E323*
E324 various.txt /*E324*
E324 print.txt /*E324*
E325 usr_11.txt /*E325*
E326 recover.txt /*E326*
E327 gui.txt /*E327*
@ -3185,7 +3189,7 @@ E361 pattern.txt /*E361*
E362 term.txt /*E362*
E363 pattern.txt /*E363*
E364 eval.txt /*E364*
E365 options.txt /*E365*
E365 print.txt /*E365*
E366 options.txt /*E366*
E367 autocmd.txt /*E367*
E368 eval.txt /*E368*
@ -3284,9 +3288,9 @@ E451 os_msdos.txt /*E451*
E452 os_msdos.txt /*E452*
E453 os_msdos.txt /*E453*
E454 os_msdos.txt /*E454*
E455 various.txt /*E455*
E456 various.txt /*E456*
E457 various.txt /*E457*
E455 print.txt /*E455*
E456 print.txt /*E456*
E457 print.txt /*E457*
E458 message.txt /*E458*
E459 message.txt /*E459*
E46 message.txt /*E46*
@ -3454,19 +3458,19 @@ E61 pattern.txt /*E61*
E610 options.txt /*E610*
E611 options.txt /*E611*
E612 sign.txt /*E612*
E613 options.txt /*E613*
E613 print.txt /*E613*
E614 editing.txt /*E614*
E615 editing.txt /*E615*
E616 editing.txt /*E616*
E617 options.txt /*E617*
E618 various.txt /*E618*
E619 various.txt /*E619*
E618 print.txt /*E618*
E619 print.txt /*E619*
E62 pattern.txt /*E62*
E620 options.txt /*E620*
E621 various.txt /*E621*
E620 print.txt /*E620*
E621 print.txt /*E621*
E622 if_cscop.txt /*E622*
E623 if_cscop.txt /*E623*
E624 various.txt /*E624*
E624 print.txt /*E624*
E625 if_cscop.txt /*E625*
E626 if_cscop.txt /*E626*
E627 netbeans.txt /*E627*
@ -3520,6 +3524,9 @@ E67 syntax.txt /*E67*
E670 various.txt /*E670*
E671 starting.txt /*E671*
E672 starting.txt /*E672*
E673 print.txt /*E673*
E674 print.txt /*E674*
E675 print.txt /*E675*
E68 pattern.txt /*E68*
E69 pattern.txt /*E69*
E70 pattern.txt /*E70*
@ -3882,7 +3889,7 @@ a insert.txt /*a*
a' motion.txt /*a'*
a( motion.txt /*a(*
a) motion.txt /*a)*
a4 options.txt /*a4*
a4 print.txt /*a4*
a:firstline eval.txt /*a:firstline*
a:lastline eval.txt /*a:lastline*
a:var eval.txt /*a:var*
@ -5205,7 +5212,7 @@ last_buffer_nr() eval.txt /*last_buffer_nr()*
lc_time-variable eval.txt /*lc_time-variable*
left-right-motions motion.txt /*left-right-motions*
less various.txt /*less*
letter options.txt /*letter*
letter print.txt /*letter*
lex-syntax syntax.txt /*lex-syntax*
lex.vim syntax.txt /*lex.vim*
lhaskell.vim syntax.txt /*lhaskell.vim*
@ -5462,6 +5469,8 @@ new-5 version5.txt /*new-5*
new-6 version6.txt /*new-6*
new-7 version7.txt /*new-7*
new-GTK-GUI version5.txt /*new-GTK-GUI*
new-KDE version7.txt /*new-KDE*
new-MzScheme version7.txt /*new-MzScheme*
new-Select-mode version5.txt /*new-Select-mode*
new-View version6.txt /*new-View*
new-argument-list version6.txt /*new-argument-list*
@ -5490,7 +5499,6 @@ new-highlighting version5.txt /*new-highlighting*
new-indent-flex version6.txt /*new-indent-flex*
new-items-6 version6.txt /*new-items-6*
new-items-7 version7.txt /*new-items-7*
new-kde version7.txt /*new-kde*
new-line-continuation version5.txt /*new-line-continuation*
new-multi-byte version5.txt /*new-multi-byte*
new-multi-lang version6.txt /*new-multi-lang*
@ -5500,6 +5508,7 @@ new-options-5.2 version5.txt /*new-options-5.2*
new-options-5.4 version5.txt /*new-options-5.4*
new-perl-python version5.txt /*new-perl-python*
new-plugins version6.txt /*new-plugins*
new-print-multi-byte version7.txt /*new-print-multi-byte*
new-printing version6.txt /*new-printing*
new-runtime-dir version5.txt /*new-runtime-dir*
new-script version5.txt /*new-script*
@ -5589,6 +5598,8 @@ pattern-multi-items pattern.txt /*pattern-multi-items*
pattern-overview pattern.txt /*pattern-overview*
pattern-searches pattern.txt /*pattern-searches*
pattern.txt pattern.txt /*pattern.txt*
pdev-option print.txt /*pdev-option*
penc-option print.txt /*penc-option*
perl if_perl.txt /*perl*
perl-Append if_perl.txt /*perl-Append*
perl-Buffer if_perl.txt /*perl-Buffer*
@ -5613,6 +5624,9 @@ perl-patterns pattern.txt /*perl-patterns*
perl-syntax syntax.txt /*perl-syntax*
perl-using if_perl.txt /*perl-using*
perl.vim syntax.txt /*perl.vim*
pexpr-option print.txt /*pexpr-option*
pfn-option print.txt /*pfn-option*
pheader-option print.txt /*pheader-option*
photon-fonts os_qnx.txt /*photon-fonts*
photon-gui os_qnx.txt /*photon-gui*
php-syntax syntax.txt /*php-syntax*
@ -5628,16 +5642,20 @@ plugin usr_05.txt /*plugin*
plugin-details filetype.txt /*plugin-details*
plugin-filetype usr_41.txt /*plugin-filetype*
plugin-special usr_41.txt /*plugin-special*
pmbcs-option print.txt /*pmbcs-option*
pmbfn-option print.txt /*pmbfn-option*
popt-option print.txt /*popt-option*
popup-menu gui.txt /*popup-menu*
popup-menu-added version5.txt /*popup-menu-added*
ports-5.2 version5.txt /*ports-5.2*
ports-6 version6.txt /*ports-6*
postscr-syntax syntax.txt /*postscr-syntax*
postscr.vim syntax.txt /*postscr.vim*
postscript-print-encoding various.txt /*postscript-print-encoding*
postscript-print-trouble various.txt /*postscript-print-trouble*
postscript-print-util various.txt /*postscript-print-util*
postscript-printing various.txt /*postscript-printing*
postscript-cjk-printing print.txt /*postscript-cjk-printing*
postscript-print-encoding print.txt /*postscript-print-encoding*
postscript-print-trouble print.txt /*postscript-print-trouble*
postscript-print-util print.txt /*postscript-print-util*
postscript-printing print.txt /*postscript-printing*
ppwiz-syntax syntax.txt /*ppwiz-syntax*
ppwiz.vim syntax.txt /*ppwiz.vim*
press-enter message.txt /*press-enter*
@ -5645,9 +5663,12 @@ press-return message.txt /*press-return*
prevcount-variable eval.txt /*prevcount-variable*
preview-window windows.txt /*preview-window*
prevnonblank() eval.txt /*prevnonblank()*
print-intro print.txt /*print-intro*
print-options print.txt /*print-options*
print.txt print.txt /*print.txt*
printcap-syntax syntax.txt /*printcap-syntax*
printing various.txt /*printing*
printing-formfeed various.txt /*printing-formfeed*
printing print.txt /*printing*
printing-formfeed print.txt /*printing-formfeed*
progname-variable eval.txt /*progname-variable*
progress-syntax syntax.txt /*progress-syntax*
progress.vim syntax.txt /*progress.vim*
@ -6247,6 +6268,7 @@ toggle-revins version4.txt /*toggle-revins*
tolower() eval.txt /*tolower()*
toolbar-icon gui.txt /*toolbar-icon*
toupper() eval.txt /*toupper()*
tr() eval.txt /*tr()*
trojan-horse starting.txt /*trojan-horse*
try-conditionals eval.txt /*try-conditionals*
try-echoerr eval.txt /*try-echoerr*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.0aa. Last change: 2004 Jul 05
*todo.txt* For Vim version 7.0aa. Last change: 2004 Jul 09
VIM REFERENCE MANUAL by Bram Moolenaar
@ -30,78 +30,21 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs*
-------------------- Known bugs and current work -----------------------
:syn sync ccomment asdf gives a warning without a line number.
@: doesn't work if cmdline has a ^M, requires using ^V. (Tim Chase)
Mac: Compiling --enable-gui=athena doesn't work. Try to fix without disabling
Carbon. Otherwise adjust configure to disable darwin. (raf)
Mac: "make install" doesn't install.
Make aap build script work again.
For version 7.0:
- Include many PATCHES:
8 ":hardcopy":
- support printing multi-byte characters. Patch from Motonobu
Ichimura. New (better) patch from Mike Williams (2004 Jan 20)
Updated patch: http://www.eandem.co.uk/mrw/vim/special/index.html
7 Add patch from Wall for this one ( ~/Mail/oldmail/wall/in.00019 ):
'flipcase' variable: upper/lowercase pairs.
Insert comma's between pairs and allow a range, make it look like
'isfname'. E.g. ":set flipcase=a-zA-Z,xX,23-33:143-153". The colon to
separate the from and to part is optional.
Resp: no time now.
8 Add GTK 2.3 file dialog support. Patch by Grahame Bowland, 2004 Mar 15,
but it doesn't use "initdir" or "dflt". (will update patch)
8 Add ":n" to fnamemodify(): normalize path, remove "../" when possible.
Aric Blumer has a patch for this.
He will update the patch for 6.3.
8 Add buffer-local autocommands? Reduces overhead for autocommands that
trigger often (inserting a character, switching mode).
:au Event <buffer> do-something
E.g.:
:au BufEnter <buffer> menu enable ...
:au BufLeave <buffer> menu disable ...
Patch from Yakov Lerner, including test (2004 Jan 7).
He'll send updated patch.
Autocommands:
VimResized - When the Vim window has been resized (SIGWINCH)
patch from Yakov Lerner, 2003 July 24.
He'll write documentation and send updated patch.
7 Completion of network shares, patch by Yasuhiro Matsumoto.
Update 2004 Jun 17.
How does this work? Missing comments.
gettext() Translate a message. (Patch from Yasuhiro Matsumoto)
Update 2004 Jun 17
Missing docs. Search in 'runtimepath'?
How to get the messages into the .po files?
8 Make it possible to delete marks. Charles Campbell has a patch that
does this with the markclear() function (2004 Jan 9).
And the ":delmark" command (2004 Feb 9)
http://mysite.verizon.net/astronaut/vim/index.html#Patch
~/tmp/ptch.delmark.bz2
~/tmp/ptch.markclear
Implement setmark(markname, lnum, col [, filename]) instead?
--- responses above --
7 Make "5dd" on last-but-one-line not delete anything (Vi compatible).
Add flag in 'cpoptions' for this. When not present, "2dd" in the last
line should delete the last line. Patch from greenx 2002 Apr 11.
8 Accelerators don't work in a dialog. Include patch from Martin Dalecki
(Jan 3, tested by David Harrison). Should work with Alt-o then.
7 Use accelerators for the Motif file selection dialog. Patch from
Martin Dalecki 2002 Jan 11.
8 Add a few more command names to the menus. Patch from Jiri Brezina
(28 feb 2002).
7 ATTENTION dialog choices are more logical when "Delete it' appears
before "Quit". Patch by Robert Webb, 2004 May 3.
- Include flipcase patch: ~/vim/patches/wall.flipcase2 ? Make it work
for multi-byte characters.
- Win32: add options to print dialog. Patch from Vipin Aravind.
- Patch to add highlighting for whitespace. (Tom Schumm, 2003 Jul 5)
use the patch that keeps using HLF_8 if HLF_WS has not
been given values.
Add section in help files for these highlight groups?
8 "fg" and "bg" don't work in an xterm. Get default colors from xterm
with an ESC sequence. Ideas in: ~/vim/patches/vikas.xtermcolors .
7 Add "DefaultFG" and "DefaultBG" for the colors of the menu. (Martin
Dalecki has a patch for Motif)
- Add possibility to highlight specific columns (for Fortran). Or put a
line in between columns (e.g. for 'textwidth').
Patch to add 'hlcolumn' from Vit Stradal, 2004 May 20.
8 Add functions:
tr(expr, from, to) translate chars (Patch from Ron Aaron, Apr 8
2004)
strrep() Repeat a string (patch from Christophe Poucet,
2003 Sep 12, also contains XX)
Alt: repeat(expr, count) werkt ook voor lists.
@ -140,7 +83,75 @@ For version 7.0:
search() Add optional offset argument.
Add 'n' flag. (patch from Nikolai Weibull
2003 Jan 13)
---
8 Make it possible to delete marks. Charles Campbell has a patch that
does this with the markclear() function (2004 Jan 9).
And the ":delmark" command (2004 Feb 9)
http://mysite.verizon.net/astronaut/vim/index.html#Patch
~/tmp/ptch.delmark.bz2
~/tmp/ptch.markclear
Implement setmark(markname, lnum [, col [, filename]]) instead?
When "lnum" is zero delete the mark.
When "filename" has no wildcards and there is no matching buffer, add
the buffer (unlisted).
Patch for \xnn (Ciaran McCreesh) 2004 Jul 7
--- awaiting updated patch ---
7 Add patch from Wall for this one ( ~/Mail/oldmail/wall/in.00019 ):
'flipcase' variable: upper/lowercase pairs.
Insert comma's between pairs and allow a range, make it look like
'isfname'. E.g. ":set flipcase=a-zA-Z,xX,23-33:143-153". The colon to
separate the from and to part is optional.
Resp: no time now.
8 Add GTK 2.3 file dialog support. Patch by Grahame Bowland, 2004 Mar 15,
but it doesn't use "initdir" or "dflt". (will update patch)
8 Add ":n" to fnamemodify(): normalize path, remove "../" when possible.
Aric Blumer has a patch for this.
He will update the patch for 6.3.
8 Add buffer-local autocommands? Reduces overhead for autocommands that
trigger often (inserting a character, switching mode).
:au Event <buffer> do-something
E.g.:
:au BufEnter <buffer> menu enable ...
:au BufLeave <buffer> menu disable ...
Patch from Yakov Lerner, including test (2004 Jan 7).
He'll send updated patch.
Autocommands:
VimResized - When the Vim window has been resized (SIGWINCH)
patch from Yakov Lerner, 2003 July 24.
He'll write documentation and send updated patch.
7 Completion of network shares, patch by Yasuhiro Matsumoto.
Update 2004 Jun 17.
How does this work? Missing comments.
gettext() Translate a message. (Patch from Yasuhiro Matsumoto)
Update 2004 Jun 17
Missing docs. Search in 'runtimepath'?
How to get the messages into the .po files?
--- did not respond (yet) --
7 Make "5dd" on last-but-one-line not delete anything (Vi compatible).
Add flag in 'cpoptions' for this. When not present, "2dd" in the last
line should delete the last line. Patch from greenx 2002 Apr 11.
8 Accelerators don't work in a dialog. Include patch from Martin Dalecki
(Jan 3, tested by David Harrison). Should work with Alt-o then.
7 Use accelerators for the Motif file selection dialog. Patch from
Martin Dalecki 2002 Jan 11.
8 Add a few more command names to the menus. Patch from Jiri Brezina
(28 feb 2002).
7 ATTENTION dialog choices are more logical when "Delete it' appears
before "Quit". Patch by Robert Webb, 2004 May 3.
- Include flipcase patch: ~/vim/patches/wall.flipcase2 ? Make it work
for multi-byte characters.
- Win32: add options to print dialog. Patch from Vipin Aravind.
- Patch to add highlighting for whitespace. (Tom Schumm, 2003 Jul 5)
use the patch that keeps using HLF_8 if HLF_WS has not
been given values.
Add section in help files for these highlight groups?
8 "fg" and "bg" don't work in an xterm. Get default colors from xterm
with an ESC sequence. Ideas in: ~/vim/patches/vikas.xtermcolors .
7 Add "DefaultFG" and "DefaultBG" for the colors of the menu. (Martin
Dalecki has a patch for Motif)
- Add possibility to highlight specific columns (for Fortran). Or put a
line in between columns (e.g. for 'textwidth').
Patch to add 'hlcolumn' from Vit Stradal, 2004 May 20.
8 Add functions:
confirm() add "flags" argument, with 'v' for vertical
layout and 'c' for console dialog. (Haegg)
Flemming Madsen has a patch for the 'c' flag

View File

@ -1,4 +1,4 @@
*various.txt* For Vim version 7.0aa. Last change: 2004 Jun 18
*various.txt* For Vim version 7.0aa. Last change: 2004 Jul 05
VIM REFERENCE MANUAL by Bram Moolenaar
@ -8,8 +8,7 @@ Various commands *various*
1. Various commands |various-cmds|
2. Online help |online-help|
3. Printing |printing|
4. Using Vim like less or more |less|
3. Using Vim like less or more |less|
==============================================================================
1. Various commands *various-cmds*
@ -721,369 +720,6 @@ Hints for translators:
- Use the |:helptags| command to generate the tags files. It will find all
languages in the specified directory.
==============================================================================
3. Printing *printing*
On MS-Windows Vim can print your text on any installed printer. On other
systems a PostScript file is produced. This can be directly sent to a
PostScript printer. For other printers a program like ghostscript needs to be
used.
3.1 PostScript Printing |postscript-printing|
3.2 PostScript Printing Encoding |postscript-print-encoding|
3.3 PostScript Printing Troubleshooting |postscript-print-trouble|
3.4 PostScript Utilities |postscript-print-util|
3.5 Formfeed Characters |printing-formfeed|
{not in Vi}
{only available when compiled with |+printer| feature}
*:ha* *:hardcopy* *E237* *E238* *E324*
:[range]ha[rdcopy][!] [arguments]
Send [range] lines (default whole file) to the
printer.
On MS-Windows a dialog is displayed to allow selection
of printer, paper size etc. To skip the dialog, use
the [!]. In this case the printer defined by
'printdevice' is used, or, if 'printdevice' is empty,
the system default printer.
For systems other than MS-Windows, PostScript is
written in a temp file and 'printexpr' is used to
actually print it. Then [arguments] can be used by
'printexpr' through |v:cmdarg|. Otherwise [arguments]
is ignored. 'printoptions' can be used to specify
paper size, duplex, etc.
:[range]ha[rdcopy][!] >{filename}
As above, but write the resulting PostScript in file
{filename}.
Things like "%" are expanded |cmdline-special|
Careful: An existing file is silently overwritten.
{only available when compiled with the |+postscript|
feature}
On MS-Windows use the "print to file" feature of the
printer driver.
Progress is displayed during printing as a page number and a percentage. To
abort printing use the interrupt key (CTRL-C or, on MS-systems, CTRL-Break).
Printer output is controlled by the 'printfont' and 'printoptions' options.
'printheader' specifies the format of a page header.
The printed file is always limited to the selected margins, irrespective of
the current window's 'wrap' or 'linebreak' settings. The "wrap" item in
'printoptions' can be used to switch wrapping off.
The current highlighting colors are used in the printout, with the following
considerations:
1) The normal background is always rendered as white (i.e. blank paper.)
2) White text or the default foreground is rendered as black, so that it shows
up!
3) If 'background' is "dark", then the colours are darkened to compensate for
the fact that otherwise they would be too bright to show up clearly on
white paper.
3.1 PostScript Printing *postscript-printing*
*E455* *E456* *E457* *E624*
Provided you have enough disk space there should be no problems generating a
PostScript file. You need to have the runtime files correctly installed (if
you can find the help files, they probably are).
There are currently a number of limitations with PostScript printing:
- 'printfont' - The font name is ignored (the Courier family is always used -
it should be available on all PostScript printers) but the font size is
used.
- 'printoptions' - The duplex setting is used when generating PostScript
output, but it is up to the printer to take notice of the setting. If the
printer does not support duplex printing then it should be silently ignored.
Some printers, however, don't print at all.
- 8-bit support - While a number of 8-bit print character encodings are
supported it is possible that some characters will not print. Whether a
character will print depends on the font in the printer knowing the
character. Missing characters will be replaced with an upside down question
mark, or a space if that character is also not known by the font. It may be
possible to get all the characters in an encoding to print by installing a
new version of the Courier font family.
- Multi-byte support - Currently VIM will try to convert multi-byte characters
to the 8-bit encoding specified by 'printencoding' (or latin1 if it is
empty). Any characters that are not successfully converted are shown as
unknown characters. Printing will fail if VIM cannot convert the multi-byte
to the 8-bit encoding.
3.2 Custom 8-bit Print Character Encodings *postscript-print-encoding*
*E618* *E619*
To use your own print character encoding when printing 8-bit character data
you need to define your own PostScript font encoding vector. Details on how
to to define a font encoding vector is beyond the scope of this help file, but
you can find details in the PostScript Language Reference Manual, 3rd Edition,
published by Addison-Wesley and available in PDF form at
http://www.adobe.com/. The following describes what you need to do for VIM to
locate and use your print character encoding.
i. Decide on a unique name for your encoding vector, one that does not clash
with any of the recognized or standard encoding names that VIM uses (see
|encoding-names| for a list), and that no one else is likely to use.
ii. Copy $VIMRUNTIME/print/latin1.ps to the print subdirectory in your
'runtimepath' and rename it with your unique name.
iii. Edit your renamed copy of latin1.ps, replacing all occurrences of latin1
with your unique name (don't forget the line starting %%Title:), and
modify the array of glyph names to define your new encoding vector. The
array must have exactly 256 entries or you will not be able to print!
iv. Within VIM, set 'printencoding' to your unique encoding name and then
print your file. VIM will now use your custom print character encoding.
VIM will report an error with the resource file if you change the order or
content of the first 3 lines, other than the name of the encoding on the line
starting %%Title: or the version number on the line starting %%Version:.
[Technical explanation for those that know PostScript - VIM looks for a file
with the same name as the encoding it will use when printing. The file
defines a new PostScript Encoding resource called /VIM-name, where name is the
print character encoding VIM will use.]
3.3 PostScript Printing Troubleshooting *postscript-print-trouble*
*E621*
Usually the only sign of a problem when printing with PostScript is that your
printout does not appear. If you are lucky you may get a printed page that
tells you the PostScript operator that generated the error that prevented the
print job completing.
There are a number of possible causes as to why the printing may have failed:
- Wrong version of the prolog resource file. The prolog resource file
contains some PostScript that VIM needs to be able to print. Each version
of VIM needs one particular version. Make sure you have correctly installed
the runtime files, and don't have any old versions of a file called prolog
in the print directory in your 'runtimepath' directory.
- Paper size. Some PostScript printers will abort printing a file if they do
not support the requested paper size. By default VIM uses A4 paper. Find
out what size paper your printer normally uses and set the appropriate paper
size with 'printoptions'. If you cannot find the name of the paper used,
measure a sheet and compare it with the table of supported paper sizes listed
for 'printoptions', using the paper that is closest in both width AND height.
Note: The dimensions of actual paper may vary slightly from the ones listed.
If there is no paper listed close enough, then you may want to try psresize
from PSUtils, discussed below.
- Two-sided printing (duplex). Normally a PostScript printer that does not
support two-sided printing will ignore any request to do it. However, some
printers may abort the job altogether. Try printing with duplex turned off.
Note: Duplex prints can be achieved manually using PS utils - see below.
- Collated printing. As with Duplex printing, most PostScript printers that
do not support collating printouts will ignore a request to do so. Some may
not. Try printing with collation turned off.
- Syntax highlighting. Some print management code may prevent the generated
PostScript file from being printed on a black and white printer when syntax
highlighting is turned on, even if solid black is the only color used. Try
printing with syntax highlighting turned off.
A safe printoptions setting to try is: >
:set printoptions=paper:A4,duplex:off,collate:n,syntax:n
Replace "A4" with the paper size that best matches your printer paper.
3.4 PostScript Utilities *postscript-print-util*
3.4.1 Ghostscript
Ghostscript is a PostScript and PDF interpreter that can be used to display
and print on non-PostScript printers PostScript and PDF files. It can also
generate PDF files from PostScript.
Ghostscript will run on a wide variety of platforms.
There are three available versions:
- AFPL Ghostscript (formerly Aladdin Ghostscript) which is free for
non-commercial use. It can be obtained from:
http://www.cs.wisc.edu/~ghost/
- GNU Ghostscript which is available under the GNU General Public License. It
can be obtained from:
ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/gnu/
- A commercial version for inclusion in commercial products.
Additional information on Ghostscript can also be found at:
http://www.ghostscript.com/
Support for a number of non PostScript printers is provided in the
distribution as standard, but if you cannot find support for your printer
check the Ghostscript site for other printers not included by default.
3.4.2 Ghostscript Previewers.
The interface to Ghostscript is very primitive so a number of graphical front
ends have been created. These allow easier PostScript file selection,
previewing at different zoom levels, and printing. Check supplied
documentation for full details.
X11
- Ghostview. Obtainable from:
http://www.cs.wisc.edu/~ghost/gv/
- gv. Derived from Ghostview. Obtainable from:
http://wwwthep.physik.uni-mainz.de/~plass/gv/
Copies (possibly not the most recent) can be found at:
http://www.cs.wisc.edu/~ghost/gv/
OpenVMS
- Is apparently supported in the main code now (untested). See:
http://wwwthep.physik.uni-mainz.de/~plass/gv/
Windows and OS/2
- GSview. Obtainable from:
http://www.cs.wisc.edu/~ghost/gsview/
DOS
- ps_view. Obtainable from:
ftp://ftp.pg.gda.pl/pub/TeX/support/ps_view/
ftp://ftp.dante.de/tex-archive/support/ps_view/
Linux
- GSview. Linux version of the popular Windows and OS/2 previewer.
Obtainable from:
http://www.cs.wisc.edu/~ghost/gsview/
- BMV. Different from Ghostview and gv in that it doesn't use X but svgalib.
Obtainable from:
ftp://sunsite.unc.edu/pub/Linux/apps/graphics/viewers/svga/bmv-1.2.tgz
3.4.3 PSUtils
PSUtils is a collection of utility programs for manipulating PostScript
documents. Binary distributions are available for many platforms, as well as
the full source. PSUtils can be found at:
http://knackered.org/angus/psutils
The utilities of interest include:
- psnup. Convert PS files for N-up printing.
- psselect. Select page range and order of printing.
- psresize. Change the page size.
- psbook. Reorder and lay out pages ready for making a book.
The output of one program can be used as the input to the next, allowing for
complex print document creation.
N-UP PRINTING
The psnup utility takes an existing PostScript file generated from VIM and
convert it to an n-up version. The simplest way to create a 2-up printout is
to first create a PostScript file with: >
:hardcopy > test.ps
Then on your command line execute: >
psnup -n 2 test.ps final.ps
Note: You may get warnings from some Ghostscript previewers for files produced
by psnup - these may safely be ignored.
Finally print the file final.ps to your PostScript printer with your
platform's print command. (You will need to delete the two PostScript files
afterwards yourself.) 'printexpr' could be modified to perform this extra
step before printing.
ALTERNATE DUPLEX PRINTING
It is possible to achieve a poor man's version of duplex printing using the PS
utility psselect. This utility has options -e and -o for printing just the
even or odd pages of a PS file respectively.
First generate a PS file with the 'hardcopy' command, then generate a new
files with all the odd and even numbered pages with: >
psselect -o test.ps odd.ps
psselect -e test.ps even.ps
Next print odd.ps with your platform's normal print command. Then take the
print output, turn it over and place it back in the paper feeder. Now print
even.ps with your platform's print command. All the even pages should now
appear on the back of the odd pages.
There a couple of points to bear in mind:
1. Position of the first page. If the first page is on top of the printout
when printing the odd pages then you need to reverse the order that the odd
pages are printed. This can be done with the -r option to psselect. This
will ensure page 2 is printed on the back of page 1.
Note: it is better to reverse the odd numbered pages rather than the even
numbered in case there are an odd number of pages in the original PS file.
2. Paper flipping. When turning over the paper with the odd pages printed on
them you may have to either flip them horizontally (along the long edge) or
vertically (along the short edge), as well as possibly rotating them 180
degrees. All this depends on the printer - it will be more obvious for
desktop ink jets than for small office laser printers where the paper path
is hidden from view.
3.5 Formfeed Characters *printing-formfeed*
By default VIM does not do any special processing of |formfeed| control
characters. Setting the 'printoptions' formfeed item will make VIM recognize
formfeed characters and continue printing the current line at the beginning
of the first line on a new page. The use of formfeed characters provides
rudimentary print control but there are certain things to be aware of.
VIM will always start printing a line (including a line number if enabled)
containing a formfeed character, even if it is the first character on the
line. This means if a line starting with a formfeed character is the first
line of a page then VIM will print a blank page.
Since the line number is printed at the start of printing the line containing
the formfeed character, the remainder of the line printed on the new page
will not have a line number printed for it (in the same way as the wrapped
lines of a long line when wrap in 'printoptions' is enabled).
If the formfeed character is the last character on a line, then printing will
continue on the second line of the new page, not the first. This is due to
VIM processing the end of the line after the formfeed character and moving
down a line to continue printing.
Due to the points made above it is recommended that when formfeed character
processing is enabled, printing of line numbers is disabled, and that form
feed characters are not the last character on a line. Even then you may need
to adjust the number of lines before a formfeed character to prevent
accidental blank pages.
==============================================================================
4. Using Vim like less or more *less*

View File

@ -79,6 +79,13 @@ The MzScheme interpreter is supported. |MzScheme|
The |:mzscheme| command can be used to execute MzScheme commands.
The |:mzfile| command can be used to execute an MzScheme script file.
Printing multi-byte text *new-print-multi-byte*
------------------
The |:hardcopy| command now supports printing multi-byte characters.
The 'printmbcharset' and 'printmbfont' options are used for this.
Also see |postscript-cjk-printing|. (Mike Williams)
Various new items *new-items-7*
-----------------
@ -98,27 +105,31 @@ Options: ~
'numberwidth' Minimal width of the space used for the 'number'
option. (Emmanuel Renieris)
'mzquantum' Time in msec to schedule MzScheme threads.
'printmbcharset' CJK character set to be used for :hardcopy
'printmbfont' font names to be used for CJK output of :hardcopy
Ex commands: ~
Win32: The ":winpos" command now also works in the console. (Vipin Aravind)
:startreplace Start Replace mode. (Charles Campbell)
|:startreplace| Start Replace mode. (Charles Campbell)
:0file Removes the name of the buffer. (Charles Campbell)
|:0file| Removes the name of the buffer. (Charles Campbell)
New functions: ~
tr(expr, from, to) |tr()| Translate characters. (Ron Aaron)
New autocommand events: ~
InsertEnter starting Insert or Replace mode
InsertChange going from Insert to Replace mode or back
InsertLeave leaving Insert or Replace mode
|InsertEnter| starting Insert or Replace mode
|InsertChange| going from Insert to Replace mode or back
|InsertLeave| leaving Insert or Replace mode
ColorScheme after loading a color scheme
|ColorScheme| after loading a color scheme
New Syntax/Indent/FTplugin files: ~
@ -143,6 +154,8 @@ IMPROVEMENTS *improvements-7*
":helpgrep" accepts a language specifier after the pattern: "pat@it".
Move the help for printing to a separate help file. It's quite a lot now.
":breakadd here" and ":breakdel here" can be used to set or delete a
breakpoint at the cursor.

View File

@ -1,9 +1,7 @@
VIMTUTOR(1) VIMTUTOR(1)
VIMTUTOR(1) VIMTUTOR(1)
NAME
vimtutor - the Vim tutor
@ -11,18 +9,17 @@ SYNOPSIS
vimtutor [language]
DESCRIPTION
Vimtutor starts the Vim tutor. It copies the tutor file
first, so that it can be modified without changing the
original file.
Vimtutor starts the Vim tutor. It copies the tutor file first, so that
it can be modified without changing the original file.
The Vimtutor is useful for people that want to learn their
first Vim commands.
The Vimtutor is useful for people that want to learn their first Vim
commands.
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.
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.
Vim is always started in Vi compatible mode.
@ -31,36 +28,19 @@ FILES
The Vimtutor text file(s).
/usr/local/lib/vim/tutor/tutor.vim
The Vim script used to copy the Vimtutor
text file.
The Vim script used to copy the Vimtutor text file.
AUTHOR
The Vimtutor was originally written for Vi by Michael C.
Pierce and Robert K. Ware, Colorado School of Mines using
ideas supplied by Charles Smith, Colorado State Univer-
sity. E-mail: bware@mines.colorado.edu.
It was modified for Vim by Bram Moolenaar. For the names
of the translators see the tutor files.
The Vimtutor was originally written for Vi by Michael C. Pierce and
Robert K. Ware, Colorado School of Mines using ideas supplied by
Charles Smith, Colorado State University. E-mail: bware@mines.col-
orado.edu.
It was modified for Vim by Bram Moolenaar. For the names of the trans-
lators see the tutor files.
SEE ALSO
vim(1)
2001 April 2 1
2001 April 2 VIMTUTOR(1)