diff options
author | Bram Moolenaar <Bram@vim.org> | 2004-07-10 09:47:34 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2004-07-10 09:47:34 +0000 |
commit | 8299df966a58236b31c0028fd7ce799c4ac6e625 (patch) | |
tree | 09250c8a4c22a4fb109a7b7a0265454b3c4d5bca /runtime/doc | |
parent | 325b7a2fb5b970b77f7b9ec28ba15eb794f6edf8 (diff) |
updated for version 7.0007v7.0007
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/Makefile | 4 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 16 | ||||
-rw-r--r-- | runtime/doc/help.txt | 1 | ||||
-rw-r--r-- | runtime/doc/indent.txt | 6 | ||||
-rw-r--r-- | runtime/doc/index.txt | 4 | ||||
-rw-r--r-- | runtime/doc/mbyte.txt | 4 | ||||
-rw-r--r-- | runtime/doc/options.txt | 222 | ||||
-rw-r--r-- | runtime/doc/pi_netrw.txt | 85 | ||||
-rw-r--r-- | runtime/doc/print.txt | 751 | ||||
-rw-r--r-- | runtime/doc/quickref.txt | 4 | ||||
-rw-r--r-- | runtime/doc/syntax.txt | 13 | ||||
-rw-r--r-- | runtime/doc/tags | 70 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 119 | ||||
-rw-r--r-- | runtime/doc/various.txt | 368 | ||||
-rw-r--r-- | runtime/doc/version7.txt | 25 | ||||
-rw-r--r-- | runtime/doc/vimtutor.man | 56 |
16 files changed, 1040 insertions, 708 deletions
diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile index a87565ebea..8da592c797 100644 --- a/runtime/doc/Makefile +++ b/runtime/doc/Makefile @@ -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 \ diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 45c015937c..e51d372675 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -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 diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index 2807676a89..0e77179cd9 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -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 diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index a35ce54cee..fd94d326a6 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -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 '#'. diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 4262a7672b..42d4b7b09e 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -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 diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index 5766984b80..41723de2aa 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -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* diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index bf48cde780..1a28bf1794 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -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!" - - *'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) + The name of the printer to be used for |:hardcopy|. + See |pdev-option|. + + *'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: > - - 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: > + Expression used to print the PostScript produced with |:hardcopy|. + See |pexpr-option|. - 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|: - - 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 -< + List of items that control the format of the output of |:hardcopy|. + See |popt-option|. + *'quoteescape''* *'qe'* 'quoteescape' 'qe' string (default "\") local to buffer diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 5e28ed62c9..8bbdb02398 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -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* + +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. -REMOVING FILES OR DIRECTORIES *netrw-delete* *netrw-remove* *netrw-D* + +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 LIST *netrw-H* -EDIT FILE OR DIRECTORY HIDING *netrw-h* +Actually <Leader>H, where the <Leader> is, by default, the backslash. -The "h" map brings up a requestor allowing the user to change the -file/directory hiding list. +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* diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt new file mode 100644 index 0000000000..42a609745a --- /dev/null +++ b/runtime/doc/print.txt @@ -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 |