docs

docs and guides
git clone git://git.2f30.org/docs.git
Log | Files | Refs

commit 855cda47a994cedd54cce06ca0e315d5d2201675
parent cf1fabf2d15d7db636c79f8ec7c4fbe72a0fbba0
Author: sin <sin@2f30.org>
Date:   Thu Jun 27 17:50:58 +0100

Add edcheat

Diffstat:
edcheat.ps | 1178+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 1178 insertions(+), 0 deletions(-)
diff --git a/edcheat.ps b/edcheat.ps @@ -0,0 +1,1178 @@ +%!PS-Adobe-3.0 +%%BoundingBox: 24 24 571 818 +%%Title: Enscript Output +%%For: Lazaros Koromilas,,, +%%Creator: GNU Enscript 1.6.5.2 +%%CreationDate: Wed Sep 19 15:50:37 2012 +%%Orientation: Portrait +%%Pages: (atend) +%%DocumentMedia: A4 595 842 0 () () +%%DocumentNeededResources: (atend) +%%LanguageLevel: 2 +%%EndComments +%%BeginProlog +%%BeginResource: procset Enscript-Prolog 1.6.5 2 +% +% Procedures. +% + +/_S { % save current state + /_s save def +} def +/_R { % restore from saved state + _s restore +} def + +/S { % showpage protecting gstate + gsave + showpage + grestore +} bind def + +/MF { % fontname newfontname -> - make a new encoded font + /newfontname exch def + /fontname exch def + + /fontdict fontname findfont def + /newfont fontdict maxlength dict def + + fontdict { + exch + dup /FID eq { + % skip FID pair + pop pop + } { + % copy to the new font dictionary + exch newfont 3 1 roll put + } ifelse + } forall + + newfont /FontName newfontname put + + % insert only valid encoding vectors + encoding_vector length 256 eq { + newfont /Encoding encoding_vector put + } if + + newfontname newfont definefont pop +} def + +/MF_PS { % fontname newfontname -> - make a new font preserving its enc + /newfontname exch def + /fontname exch def + + /fontdict fontname findfont def + /newfont fontdict maxlength dict def + + fontdict { + exch + dup /FID eq { + % skip FID pair + pop pop + } { + % copy to the new font dictionary + exch newfont 3 1 roll put + } ifelse + } forall + + newfont /FontName newfontname put + + newfontname newfont definefont pop +} def + +/SF { % fontname width height -> - set a new font + /height exch def + /width exch def + + findfont + [width 0 0 height 0 0] makefont setfont +} def + +/SUF { % fontname width height -> - set a new user font + /height exch def + /width exch def + + /F-gs-user-font MF + /F-gs-user-font width height SF +} def + +/SUF_PS { % fontname width height -> - set a new user font preserving its enc + /height exch def + /width exch def + + /F-gs-user-font MF_PS + /F-gs-user-font width height SF +} def + +/M {moveto} bind def +/s {show} bind def + +/Box { % x y w h -> - define box path + /d_h exch def /d_w exch def /d_y exch def /d_x exch def + d_x d_y moveto + d_w 0 rlineto + 0 d_h rlineto + d_w neg 0 rlineto + closepath +} def + +/bgs { % x y height blskip gray str -> - show string with bg color + /str exch def + /gray exch def + /blskip exch def + /height exch def + /y exch def + /x exch def + + gsave + x y blskip sub str stringwidth pop height Box + gray setgray + fill + grestore + x y M str s +} def + +/bgcs { % x y height blskip red green blue str -> - show string with bg color + /str exch def + /blue exch def + /green exch def + /red exch def + /blskip exch def + /height exch def + /y exch def + /x exch def + + gsave + x y blskip sub str stringwidth pop height Box + red green blue setrgbcolor + fill + grestore + x y M str s +} def + +% Highlight bars. +/highlight_bars { % nlines lineheight output_y_margin gray -> - + gsave + setgray + /ymarg exch def + /lineheight exch def + /nlines exch def + + % This 2 is just a magic number to sync highlight lines to text. + 0 d_header_y ymarg sub 2 sub translate + + /cw d_output_w cols div def + /nrows d_output_h ymarg 2 mul sub lineheight div cvi def + + % for each column + 0 1 cols 1 sub { + cw mul /xp exch def + + % for each rows + 0 1 nrows 1 sub { + /rn exch def + rn lineheight mul neg /yp exch def + rn nlines idiv 2 mod 0 eq { + % Draw highlight bar. 4 is just a magic indentation. + xp 4 add yp cw 8 sub lineheight neg Box fill + } if + } for + } for + + grestore +} def + +% Line highlight bar. +/line_highlight { % x y width height gray -> - + gsave + /gray exch def + Box gray setgray fill + grestore +} def + +% Column separator lines. +/column_lines { + gsave + .1 setlinewidth + 0 d_footer_h translate + /cw d_output_w cols div def + 1 1 cols 1 sub { + cw mul 0 moveto + 0 d_output_h rlineto stroke + } for + grestore +} def + +% Column borders. +/column_borders { + gsave + .1 setlinewidth + 0 d_footer_h moveto + 0 d_output_h rlineto + d_output_w 0 rlineto + 0 d_output_h neg rlineto + closepath stroke + grestore +} def + +% Do the actual underlay drawing +/draw_underlay { + ul_style 0 eq { + ul_str true charpath stroke + } { + ul_str show + } ifelse +} def + +% Underlay +/underlay { % - -> - + gsave + 0 d_page_h translate + d_page_h neg d_page_w atan rotate + + ul_gray setgray + ul_font setfont + /dw d_page_h dup mul d_page_w dup mul add sqrt def + ul_str stringwidth pop dw exch sub 2 div ul_h_ptsize -2 div moveto + draw_underlay + grestore +} def + +/user_underlay { % - -> - + gsave + ul_x ul_y translate + ul_angle rotate + ul_gray setgray + ul_font setfont + 0 0 ul_h_ptsize 2 div sub moveto + draw_underlay + grestore +} def + +% Page prefeed +/page_prefeed { % bool -> - + statusdict /prefeed known { + statusdict exch /prefeed exch put + } { + pop + } ifelse +} def + +% Wrapped line markers +/wrapped_line_mark { % x y charwith charheight type -> - + /type exch def + /h exch def + /w exch def + /y exch def + /x exch def + + type 2 eq { + % Black boxes (like TeX does) + gsave + 0 setlinewidth + x w 4 div add y M + 0 h rlineto w 2 div 0 rlineto 0 h neg rlineto + closepath fill + grestore + } { + type 3 eq { + % Small arrows + gsave + .2 setlinewidth + x w 2 div add y h 2 div add M + w 4 div 0 rlineto + x w 4 div add y lineto stroke + + x w 4 div add w 8 div add y h 4 div add M + x w 4 div add y lineto + w 4 div h 8 div rlineto stroke + grestore + } { + % do nothing + } ifelse + } ifelse +} def + +% EPSF import. + +/BeginEPSF { + /b4_Inc_state save def % Save state for cleanup + /dict_count countdictstack def % Count objects on dict stack + /op_count count 1 sub def % Count objects on operand stack + userdict begin + /showpage { } def + 0 setgray 0 setlinecap + 1 setlinewidth 0 setlinejoin + 10 setmiterlimit [ ] 0 setdash newpath + /languagelevel where { + pop languagelevel + 1 ne { + false setstrokeadjust false setoverprint + } if + } if +} bind def + +/EndEPSF { + count op_count sub { pos } repeat % Clean up stacks + countdictstack dict_count sub { end } repeat + b4_Inc_state restore +} bind def + +% Check PostScript language level. +/languagelevel where { + pop /gs_languagelevel languagelevel def +} { + /gs_languagelevel 1 def +} ifelse +%%EndResource +%%BeginResource: procset Enscript-Encoding-88591 1.6.5 2 +/encoding_vector [ +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/space /exclam /quotedbl /numbersign +/dollar /percent /ampersand /quoteright +/parenleft /parenright /asterisk /plus +/comma /hyphen /period /slash +/zero /one /two /three +/four /five /six /seven +/eight /nine /colon /semicolon +/less /equal /greater /question +/at /A /B /C +/D /E /F /G +/H /I /J /K +/L /M /N /O +/P /Q /R /S +/T /U /V /W +/X /Y /Z /bracketleft +/backslash /bracketright /asciicircum /underscore +/quoteleft /a /b /c +/d /e /f /g +/h /i /j /k +/l /m /n /o +/p /q /r /s +/t /u /v /w +/x /y /z /braceleft +/bar /braceright /tilde /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/space /exclamdown /cent /sterling +/currency /yen /brokenbar /section +/dieresis /copyright /ordfeminine /guillemotleft +/logicalnot /hyphen /registered /macron +/degree /plusminus /twosuperior /threesuperior +/acute /mu /paragraph /bullet +/cedilla /onesuperior /ordmasculine /guillemotright +/onequarter /onehalf /threequarters /questiondown +/Agrave /Aacute /Acircumflex /Atilde +/Adieresis /Aring /AE /Ccedilla +/Egrave /Eacute /Ecircumflex /Edieresis +/Igrave /Iacute /Icircumflex /Idieresis +/Eth /Ntilde /Ograve /Oacute +/Ocircumflex /Otilde /Odieresis /multiply +/Oslash /Ugrave /Uacute /Ucircumflex +/Udieresis /Yacute /Thorn /germandbls +/agrave /aacute /acircumflex /atilde +/adieresis /aring /ae /ccedilla +/egrave /eacute /ecircumflex /edieresis +/igrave /iacute /icircumflex /idieresis +/eth /ntilde /ograve /oacute +/ocircumflex /otilde /odieresis /divide +/oslash /ugrave /uacute /ucircumflex +/udieresis /yacute /thorn /ydieresis +] def +%%EndResource +%%EndProlog +%%BeginSetup +%%IncludeResource: font Courier-Bold +%%IncludeResource: font DejaVuSansMono +/HFpt_w 10 def +/HFpt_h 10 def +/Courier-Bold /HF-gs-font MF +/HF /HF-gs-font findfont [HFpt_w 0 0 HFpt_h 0 0] makefont def +/DejaVuSansMono /F-gs-font MF +/F-gs-font 6 6 SF +/#copies 1 def +% Pagedevice definitions: +gs_languagelevel 1 gt { + << + /Duplex true /PageSize [595 842] + >> setpagedevice +} if +/d_page_w 547 def +/d_page_h 794 def +/d_header_x 0 def +/d_header_y 794 def +/d_header_w 547 def +/d_header_h 0 def +/d_footer_x 0 def +/d_footer_y 0 def +/d_footer_w 547 def +/d_footer_h 0 def +/d_output_w 547 def +/d_output_h 794 def +/cols 2 def +%%EndSetup +%%Page: (1) 1 +%%BeginPageSetup +_S +24 24 translate +/pagenum 1 def +/fname () def +/fdir (.) def +/ftail (.) def +/user_header_p false def +/user_footer_p false def +%%EndPageSetup +5 785 M +(.---------------------------------------------------------------------.) s +5 778 M +(| |) s +5 771 M +(| The Original UNIX Text Editor |) s +5 764 M +(| Ed Cheat Sheet |) s +5 757 M +(| |) s +5 750 M +('---------------------------------------------------------------------') s +5 743 M +(| Peteris Krumins \(peter@catonmat.net\), 2007.08.22 |) s +5 736 M +(| http://www.catonmat.net - good coders code, great reuse |) s +5 729 M +('---------------------------------------------------------------------') s +5 715 M +( ====================== Line Addressing Summary ======================) s +5 701 M +(.----------------.----------------------------------------------------.) s +5 694 M +(| | |) s +5 687 M +(| Address Symbol | Description |) s +5 680 M +(| | |) s +5 673 M +('----------------+----------------------------------------------------') s +5 666 M +(| . | The current line \(address\) in the buffer. |) s +5 659 M +('----------------+----------------------------------------------------') s +5 652 M +(| $ | The last line in the buffer. |) s +5 645 M +('----------------+----------------------------------------------------') s +5 638 M +(| n | The nth, line in the buffer where n is a number |) s +5 631 M +(| | in the range [0,$]. |) s +5 624 M +('----------------+----------------------------------------------------') s +5 617 M +(| $ | The last line in the buffer. |) s +5 610 M +('----------------+----------------------------------------------------') s +5 603 M +(| - | The previous line. This is equivalent to -1 and |) s +5 596 M +(| ^ | may be repeated with cumulative effect. |) s +5 589 M +('----------------+----------------------------------------------------') s +5 582 M +(| -n | The nth previous line, where n is a non-negative |) s +5 575 M +(| ^n | number. |) s +5 568 M +('----------------+----------------------------------------------------') s +5 561 M +(| + | The next line. This is equivalent to +1 and may |) s +5 554 M +(| | be repeated with cumulative effect. |) s +5 547 M +('----------------+----------------------------------------------------') s +5 540 M +(| +n | The nth next line, where n is a non-negative |) s +5 533 M +(| whitespace n | number. |) s +5 526 M +(| | Whitespace followed by a number n is interpreted |) s +5 519 M +(| | as +n. |) s +5 512 M +('----------------+----------------------------------------------------') s +5 505 M +(| , | The first through last lines in the buffer. |) s +5 498 M +(| % | This is equivalent to the address range 1,$. |) s +5 491 M +('----------------+----------------------------------------------------') s +5 484 M +(| ; | The current through last lines in the buffer. |) s +5 477 M +(| | This is equivalent to the address range .,$. |) s +5 470 M +('----------------+----------------------------------------------------') s +5 463 M +(| /re/ | The next line containing the regular |) s +5 456 M +(| | expression re. |) s +5 449 M +(| | The search wraps to the beginning of the buffer |) s +5 442 M +(| | and continues down to the current line, if |) s +5 435 M +(| | necessary. |) s +5 428 M +(| | // repeats the last search. |) s +5 421 M +('----------------+----------------------------------------------------') s +5 414 M +(| ?re? | The previous line containing the regular |) s +5 407 M +(| | expression re. |) s +5 400 M +(| | The search wraps to the end of the buffer and |) s +5 393 M +(| | continues up to the current line, if necessary. |) s +5 386 M +(| | ?? repeats the last search. |) s +5 379 M +('----------------+----------------------------------------------------') s +5 372 M +(| 'lc | The line previously marked by a `k' \(mark\) |) s +5 365 M +(| | command, where lc is a lower case letter. |) s +5 358 M +('----------------'----------------------------------------------------') s +5 344 M +(Each address in a comma-delimited range is interpreted relative) s +5 337 M +(to the current address.) s +5 330 M +(In a semicolon-delimited range, the 1st address is used to set) s +5 323 M +(the current address, and the 2nd address is interpreted) s +5 316 M +(relative to the first.) s +5 295 M +( ========================== Command Summary ==========================) s +5 281 M +(.-------------------------.-------------------------------------------.) s +5 274 M +(| | |) s +5 267 M +(| Command | Description |) s +5 260 M +(| | |) s +5 253 M +('-------------------------+-------------------------------------------') s +5 246 M +(| \(.\)a | Appends text to the buffer after the |) s +5 239 M +(| | addressed line, which may be theaddress |) s +5 232 M +(| | 0 \(zero\). Text is entered in input mode. |) s +5 225 M +(| | The current address is set to last line |) s +5 218 M +(| | entered. |) s +5 211 M +('-------------------------+-------------------------------------------') s +5 204 M +(| \(.,.\)c | Changes lines in the buffer. The |) s +5 197 M +(| | addressed lines are deleted from the |) s +5 190 M +(| | buffer, and text is appended in their |) s +5 183 M +(| | place. |) s +5 176 M +(| | Text is entered in input mode. The |) s +5 169 M +(| | current address is set to last line |) s +5 162 M +(| | entered. |) s +5 155 M +('-------------------------+-------------------------------------------') s +5 148 M +(| \(.,.\)d | Deletes the addressed lines from the |) s +5 141 M +(| | buffer. If there is a line after the |) s +5 134 M +(| | deleted range, then the current address |) s +5 127 M +(| | is set to this line. Otherwise the |) s +5 120 M +(| | current address is set to the line before |) s +5 113 M +(| | the deleted range. |) s +5 106 M +('-------------------------+-------------------------------------------') s +5 99 M +(| e file | Edits file, and sets the default |) s +5 92 M +(| | filename. If file is not specified, then |) s +5 85 M +(| | the default filename is used. Any lines |) s +5 78 M +(| | in the buffer are deleted before the new |) s +5 71 M +(| | file is read. The current address is set |) s +5 64 M +(| | to the last line read. |) s +5 57 M +('-------------------------+-------------------------------------------') s +5 50 M +(| e !command | Edits the standard output of `!command', |) s +5 43 M +(| | \(see !command below\). The default |) s +5 36 M +(| | filename is unchanged. Any lines in the |) s +5 29 M +(| | buffer are deleted before the output of |) s +5 22 M +(| | command is read. The current address is |) s +5 15 M +(| | set to the last line read. |) s +5 8 M +('-------------------------+-------------------------------------------') s +278.5 785 M +(.-------------------------+-------------------------------------------.) s +278.5 778 M +(| E file | Edits file unconditionally. This is |) s +278.5 771 M +(| | similar to the e command, except that |) s +278.5 764 M +(| | unwritten changes are discarded without |) s +278.5 757 M +(| | warning. The current address is set to |) s +278.5 750 M +(| | the last line read. |) s +278.5 743 M +('-------------------------+-------------------------------------------') s +278.5 736 M +(| f file | Sets the default filename to file. If |) s +278.5 729 M +(| | file is not specified, then the default |) s +278.5 722 M +(| | unescaped filename is printed. |) s +278.5 715 M +('-------------------------+-------------------------------------------') s +278.5 708 M +(| \(1,$\)g/re/command-list | Applies command-list to each of the |) s +278.5 701 M +(| | addressed lines matching a regular |) s +278.5 694 M +(| | expression re. The current address is set |) s +278.5 687 M +(| | to the line currently matched before |) s +278.5 680 M +(| | command-list is executed. At the end of |) s +278.5 673 M +(| | the `g' command, the current address is |) s +278.5 666 M +(| | set to the last line affected by |) s +278.5 659 M +(| | command-list. |) s +278.5 652 M +(| | |) s +278.5 645 M +(| | Each command in command-list must be on a |) s +278.5 638 M +(| | separate line, and every line except for |) s +278.5 631 M +(| | the last must be terminated by a |) s +278.5 624 M +(| | back-slash \(\\\). Any commands are allowed, |) s +278.5 617 M +(| | except for `g', `G', `v', and `V'. |) s +278.5 610 M +(| | A newline alone in command-list is |) s +278.5 603 M +(| | equivalent to a `p' command. |) s +278.5 596 M +('-------------------------+-------------------------------------------') s +278.5 589 M +(| \(1,$\)G/re/ | Interactively edits the addressed lines |) s +278.5 582 M +(| | matching a regular expression re. For |) s +278.5 575 M +(| | each matching line, the line is printed, |) s +278.5 568 M +(| | the current address is set, and the user |) s +278.5 561 M +(| | is prompted to enter a command-list. |) s +278.5 554 M +(| | At the end of the `G' command, the |) s +278.5 547 M +(| | current address is set to the last line |) s +278.5 540 M +(| | affected by \(the last\) command-list. |) s +278.5 533 M +(| | |) s +278.5 526 M +(| | The format of command-list is the same as |) s +278.5 519 M +(| | that of the `g' command. A newline alone |) s +278.5 512 M +(| | acts as a null command list. A single `&' |) s +278.5 505 M +(| | repeats the last non-null command list. |) s +278.5 498 M +('-------------------------+-------------------------------------------') s +278.5 491 M +(| H | Toggles the printing of error |) s +278.5 484 M +(| | explanations. By default, explanations |) s +278.5 477 M +(| | are not printed. It is recommended that |) s +278.5 470 M +(| | ed scripts begin with this command to aid |) s +278.5 463 M +(| | in debugging. |) s +278.5 456 M +('-------------------------+-------------------------------------------') s +278.5 449 M +(| h | Prints an explanation of the last error. |) s +278.5 442 M +('-------------------------+-------------------------------------------') s +278.5 435 M +(| \(.\)i | Inserts text in the buffer before the |) s +278.5 428 M +(| | current line. Text is entered in input |) s +278.5 421 M +(| | mode. The current address is set to the |) s +278.5 414 M +(| | last line entered. |) s +278.5 407 M +('-------------------------+-------------------------------------------') s +278.5 400 M +(| \(.,.+1\)j | Joins the addressed lines. The addressed |) s +278.5 393 M +(| | lines are deleted from the buffer and |) s +278.5 386 M +(| | replaced by a single line containing |) s +278.5 379 M +(| | their joined text. The current address is |) s +278.5 372 M +(| | set to the resultant line. |) s +278.5 365 M +('-------------------------+-------------------------------------------') s +278.5 358 M +(| \(.\)klc | Marks a line with a lower case letter lc. |) s +278.5 351 M +(| | The line can then be addressed as 'lc |) s +278.5 344 M +(| | \(i.e., a single quote followed by lc\) in |) s +278.5 337 M +(| | subsequent commands. The mark is not |) s +278.5 330 M +(| | cleared until the line is deleted or |) s +278.5 323 M +(| | otherwise modified. |) s +278.5 316 M +('-------------------------+-------------------------------------------') s +278.5 309 M +(| \(.,.\)l | Prints the addressed lines unambiguously. |) s +278.5 302 M +(| | If invoked from a terminal, ed pauses at |) s +278.5 295 M +(| | the end of each page until a newline is |) s +278.5 288 M +(| | entered. The current address is set to |) s +278.5 281 M +(| | the last line printed. |) s +278.5 274 M +('-------------------------+-------------------------------------------') s +278.5 267 M +(| \(.,.\)m\(.\) | Moves lines in the buffer. The addressed |) s +278.5 260 M +(| | lines are moved to after the right-hand |) s +278.5 253 M +(| | destination address, which may be the |) s +278.5 246 M +(| | address 0 \(zero\). The current address is |) s +278.5 239 M +(| | set to the last line moved. |) s +278.5 232 M +('-------------------------+-------------------------------------------') s +278.5 225 M +(| \(.,.\)n | Prints the addressed lines along with |) s +278.5 218 M +(| | their line nums. The curr. addr is set to |) s +278.5 211 M +(| | the last line printed |) s +278.5 204 M +('-------------------------+-------------------------------------------') s +278.5 197 M +(| \(.,.\)p | Prints the addressed lines. If invoked |) s +278.5 190 M +(| | from a terminal, ed pauses at the end of |) s +278.5 183 M +(| | each page until a newline is entered. |) s +278.5 176 M +(| | The current address is set to the last |) s +278.5 169 M +(| | line printed. |) s +278.5 162 M +('-------------------------+-------------------------------------------') s +278.5 155 M +(| P | Toggles the command prompt on and off. |) s +278.5 148 M +(| | Unless a prompt was specified by with |) s +278.5 141 M +(| | command-line option -p string, the |) s +278.5 134 M +(| | command prompt is by default turned off. |) s +278.5 127 M +('-------------------------+-------------------------------------------') s +278.5 120 M +(| q | Quits ed. |) s +278.5 113 M +('-------------------------+-------------------------------------------') s +278.5 106 M +(| Q | Quits ed unconditionally. This is similar |) s +278.5 99 M +(| | to the q command, except that unwritten |) s +278.5 92 M +(| | changes are discarded without warning. |) s +278.5 85 M +('-------------------------+-------------------------------------------') s +278.5 78 M +(| \($\)r file | Reads file to after the addressed line. |) s +278.5 71 M +(| | If file is not specified, then the |) s +278.5 64 M +(| | default filename is used. If there was no |) s +278.5 57 M +(| | default filename prior to the command, |) s +278.5 50 M +(| | then the default filename is set to file. |) s +278.5 43 M +(| | Otherwise, the default filename is |) s +278.5 36 M +(| | unchanged. The current address is set to |) s +278.5 29 M +(| | the last line read. |) s +278.5 22 M +('-------------------------+-------------------------------------------') s +_R +S +%%Page: (2) 2 +%%BeginPageSetup +_S +24 24 translate +/pagenum 2 def +/fname () def +/fdir (.) def +/ftail (.) def +/user_header_p false def +/user_footer_p false def +%%EndPageSetup +5 785 M +(.-------------------------+-------------------------------------------.) s +5 778 M +(| \($\)r !command | Reads to after the addressed line the |) s +5 771 M +(| | standard output of `!command', |) s +5 764 M +(| | \(see the !command below\). The default |) s +5 757 M +(| | filename is unchanged. The current |) s +5 750 M +(| | address is set to the last line read. |) s +5 743 M +('-------------------------+-------------------------------------------') s +5 736 M +(| \(.,.\)s/re/replacement/ | Replaces text in the addressed lines |) s +5 729 M +(| \(.,.\)s/re/replacement/g | matching a regular expression re with |) s +5 722 M +(| \(.,.\)s/re/replacement/n | replacement. By default, only the first |) s +5 715 M +(| | match in each line is replaced. |) s +5 708 M +(| | If the `g' \(global\) suffix is given, then |) s +5 701 M +(| | every match to be replaced. |) s +5 694 M +(| | The `n' suffix, where n is a positive |) s +5 687 M +(| | number, causes only the n-th match to be |) s +5 680 M +(| | replaced. It is an error if no |) s +5 673 M +(| | substitutions are performed on any |) s +5 666 M +(| | of the addressed lines. The current |) s +5 659 M +(| | address is set the last line affected. |) s +5 652 M +(| | |) s +5 645 M +(| | re and replacement may be delimited by |) s +5 638 M +(| | any character other than space and |) s +5 631 M +(| | newline \(see the `s' command below\). |) s +5 624 M +(| | If one or two of the last delimiters is |) s +5 617 M +(| | omitted, then the last line affected is |) s +5 610 M +(| | printed as though the print suffix `p' |) s +5 603 M +(| | were specified. |) s +5 596 M +(| | |) s +5 589 M +(| | An unescaped `&' in replacement is |) s +5 582 M +(| | replaced by the currently matched text. |) s +5 575 M +(| | The character sequence `\\m', where m is a |) s +5 568 M +(| | number in the range [1,9], is replaced by |) s +5 561 M +(| | the m-th backreference expression of the |) s +5 554 M +(| | matched text. If replacement consists of |) s +5 547 M +(| | a single `%', then replacement from the |) s +5 540 M +(| | last substitution is used. Newlines may |) s +5 533 M +(| | be embedded in replacement if they are |) s +5 526 M +(| | escaped with a backslash \(\\\). |) s +5 519 M +('-------------------------+-------------------------------------------') s +5 512 M +(| \(.,.\)s | Repeats the last substitution. This form |) s +5 505 M +(| | of the `s' command accepts a count suffix |) s +5 498 M +(| | `n', or any combination of the characters |) s +5 491 M +(| | `r', `g', and `p'. |) s +5 484 M +(| | If a count suffix `n' is given, then only |) s +5 477 M +(| | the n-th match is replaced. |) s +5 470 M +(| | The `r' suffix causes the regular |) s +5 463 M +(| | expression of the last search to be used |) s +5 456 M +(| | instead of that of the last substitution. |) s +5 449 M +(| | The `g' suffix toggles the global suffix |) s +5 442 M +(| | of the last substitution. |) s +5 435 M +(| | The `p' suffix toggles the print suffix |) s +5 428 M +(| | of the last substitution. The current |) s +5 421 M +(| | address is set to the last line affected. |) s +5 414 M +('-------------------------+-------------------------------------------') s +5 407 M +(| \(.,.\)t\(.\) | Copies \(i.e., transfers\) the addressed |) s +5 400 M +(| | lines to after the right-hand destination |) s +5 393 M +(| | address, which may be the address |) s +5 386 M +(| | 0 \(zero\). The current address is set to |) s +5 379 M +(| | the last line copied. |) s +5 372 M +('-------------------------+-------------------------------------------') s +5 365 M +(| u | Undoes the last command and restores the |) s +5 358 M +(| | current address to what it was before the |) s +5 351 M +(| | command. The global commands `g', `G', |) s +5 344 M +(| | `v', and `V' are treated as a single |) s +5 337 M +(| | command by undo. `u' is its own inverse. |) s +5 330 M +('-------------------------+-------------------------------------------') s +5 323 M +(| \(1,$\)v/re/command-list | Applies command-list to each of the |) s +5 316 M +(| | addressed lines not matching a regular |) s +5 309 M +(| | expression re. This is similar to the |) s +5 302 M +(| | `g' command. |) s +5 295 M +('-------------------------+-------------------------------------------') s +5 288 M +(| \(1,$\)V/re/ | Interactively edits the addressed lines |) s +5 281 M +(| | not matching a regular expression re. |) s +5 274 M +(| | This is similar to the `G' command. |) s +5 267 M +('-------------------------+-------------------------------------------') s +5 260 M +(| \(1,$\)w file | Writes the addressed lines to file. Any |) s +5 253 M +(| | previous contents of file is lost without |) s +5 246 M +(| | warning. If there is no default filename, |) s +5 239 M +(| | then the default filename is set to file, |) s +5 232 M +(| | otherwise it is unchanged. If no filename |) s +5 225 M +(| | is specified, then the default filename |) s +5 218 M +(| | is used. The current address is unchanged.|) s +5 211 M +('-------------------------+-------------------------------------------') s +5 204 M +(| \(1,$\)wq file | Writes the addressed lines to file, and |) s +5 197 M +(| | then executes a `q' command. |) s +5 190 M +('-------------------------+-------------------------------------------') s +5 183 M +(| \(1,$\)w !command | Writes the addressed lines to the |) s +5 176 M +(| | standard input of `!command', \(see the |) s +5 169 M +(| | !command below\). |) s +5 162 M +(| | The defaultfilename and current address |) s +5 155 M +(| | are unchanged. |) s +5 148 M +('-------------------------+-------------------------------------------') s +5 141 M +(| \(1,$\)W file | Appends the addressed lines to the end of |) s +5 134 M +(| | file. This is similar to the `w' command, |) s +5 127 M +(| | expect that the previous contents of file |) s +5 120 M +(| | is not clobbered. The current address is |) s +5 113 M +(| | unchanged. |) s +5 106 M +('-------------------------+-------------------------------------------') s +5 99 M +(| \(.\)x | Copies \(puts\) the contents of the cut |) s +5 92 M +(| | buffer to after the addressed line. |) s +5 85 M +(| | The current address is set to the last |) s +5 78 M +(| | line copied. |) s +5 71 M +('-------------------------+-------------------------------------------') s +5 64 M +(| \(.,.\)y | Copies \(yanks\) the addressed lines to the |) s +5 57 M +(| | cut buffer. The cut buffer is overwritten |) s +5 50 M +(| | by subsequent `y', `s', `j', `d', or `c' |) s +5 43 M +(| | commands. The current address is |) s +5 36 M +(| | unchanged. |) s +5 29 M +('-------------------------+-------------------------------------------') s +278.5 785 M +(.-------------------------+-------------------------------------------.) s +278.5 778 M +(| \(.+1\)zn | Scrolls n lines at a time starting at |) s +278.5 771 M +(| | addressed line. If n is not specified, |) s +278.5 764 M +(| | then the current window size is used. |) s +278.5 757 M +(| | The current address is set to the last |) s +278.5 750 M +(| | line printed. |) s +278.5 743 M +('-------------------------+-------------------------------------------') s +278.5 736 M +(| !command | Executes command via sh\(1\). If the first |) s +278.5 729 M +(| | character of command is `!', then it is |) s +278.5 722 M +(| | replaced by text of the previous |) s +278.5 715 M +(| | `!command'. ed does not process command |) s +278.5 708 M +(| | for backslash \(\\\) escapes. However, an |) s +278.5 701 M +(| | unescaped `%' is replaced by the default |) s +278.5 694 M +(| | filename. When the shell returns from |) s +278.5 687 M +(| | execution, a `!' is printed to the |) s +278.5 680 M +(| | standard output. The current line is |) s +278.5 673 M +(| | unchanged. |) s +278.5 666 M +('-------------------------+-------------------------------------------') s +278.5 659 M +(| \(.,.\)# | Begins a comment; the rest of the line, |) s +278.5 652 M +(| | up to a newline, is ignored. If a line |) s +278.5 645 M +(| | address followed by a semicolon is given, |) s +278.5 638 M +(| | then the current address is set to that |) s +278.5 631 M +(| | address. Otherwise, the current address |) s +278.5 624 M +(| | is unchanged. |) s +278.5 617 M +('-------------------------+-------------------------------------------') s +278.5 610 M +(| \($\)= | Prints the line number of the addressed |) s +278.5 603 M +(| | line. |) s +278.5 596 M +('-------------------------+-------------------------------------------') s +278.5 589 M +(| \(.+1\)newline | Prints the addressed line, and sets the |) s +278.5 582 M +(| | current address to that line. |) s +278.5 575 M +('-------------------------'-------------------------------------------') s +278.5 561 M +( =====================================================================) s +278.5 547 M +(.---------------------------------------------------------------------.) s +278.5 540 M +(| Peteris Krumins \(peter@catonmat.net\), 2007.08.22 |) s +278.5 533 M +(| http://www.catonmat.net - good coders code, great reuse |) s +278.5 526 M +('---------------------------------------------------------------------') s +_R +S +%%Trailer +%%Pages: 2 +%%DocumentNeededResources: font Courier-Bold DejaVuSansMono +%%EOF