1@comment Copyright (c) 1994 2@comment The Regents of the University of California. All rights reserved. 3@comment Copyright (c) 1994, 1995, 1996 4@comment Keith Bostic. All rights reserved. 5@comment 6@comment See the LICENSE file for redistribution information. 7@comment 8@comment Id: ex.cmd.texi,v 8.2 2001/08/20 16:05:50 skimo Exp (Berkeley) Date: 2001/08/20 16:05:50 9@comment 10@chapter Ex Description 11 12The following words have special meanings for 13@CO{ex} 14commands. 15@itemize @bullet 16@cindex "<end-of-file>" 17@IP{<end-of-file>} 18 19The end-of-file character is used to scroll the screen in the 20@CO{ex} 21editor. 22This character is normally 23@LI{<control-D>}. 24However, whatever character is set for the current terminal is supported 25as well as 26@LI{<control-D>}. 27@cindex "line" 28@IP{line} 29 30A single-line address, given in any of the forms described in the 31section entitled 32@QB{Ex Addressing} . 33The default for 34@LI{line}is the current line. 35@cindex "range" 36@IP{range} 37 38A line, or a pair of line addresses, separated by a comma or semicolon. 39(See the section entitled 40@QB{Ex Addressing} 41for more information.) 42The default for range is the current line 43@emph{only}, 44i.e. 45@QT{.,.}. 46A percent sign 47@PQ{%} 48stands for the range 49@QT{1,$}. 50The starting address must be less than, or equal to, the ending address. 51@cindex "count" 52@IP{count} 53 54A positive integer, specifying the number of lines to be affected by 55the command; the default is 1. 56Generally, a count past the end-of-file may be specified, e.g. the 57command 58@QT{p 3000} 59in a 10 line file is acceptable, and will print from the current line 60through the last line in the file. 61@cindex "flags" 62@IP{flags} 63 64One or more of the characters 65@QQ{#}, 66@QQ{p}, 67and 68@QQ{l}. 69When a command that accepts these flags completes, the addressed line(s) 70are written out as if by the corresponding 71@CO{#}, 72@CO{l} 73or 74@CO{p} 75commands. 76In addition, any number of 77@QT{+} 78or 79@QT{-} 80characters can be specified before, after, or during the flags, in which 81case the line written is not necessarily the one affected by the command, 82but rather the line addressed by the offset address specified. 83The default for 84@LI{flags}is none. 85@cindex "file" 86@IP{file} 87 88A pattern used to derive a pathname; the default is the current file. 89File names are subjected to normal 90@XR{sh,1} 91word expansions. 92@end itemize 93 94Anywhere a file name is specified, it is also possible to use 95the special string 96@QT{/tmp}. 97This will be replaced with a temporary file name which can be used 98for temporary work, e.g. 99@QT{:e /tmp} 100creates and edits a new file. 101 102If both a count and a range are specified for commands that use either, 103the starting line for the command is the 104@emph{last} 105line addressed by the range, and 106@LI{count}- 1 107subsequent lines are affected by the command, e.g. the command 108@QT{2,3p4} 109prints out lines 3, 4, 5 and 6. 110 111When only a line or range is specified, with no command, the implied 112command is either a 113@CO{list}, 114@CO{number} 115or 116@CO{print} 117command. 118The command used is the most recent of the three commands to have been 119used (including any use as a flag). 120If none of these commands have been used before, the 121@CO{print} 122command is the implied command. 123When no range or count is specified and the command line is a blank line, 124the current line is incremented by 1 and then the current line is displayed. 125 126Zero or more whitespace characters may precede or follow the addresses, 127count, flags, or command name. 128Any object following a command name (such as buffer, file, etc.), 129that begins with an alphabetic character, 130should be separated from the command name by at least one whitespace 131character. 132 133Any character, including 134@LI{<carriage-return>}, 135@QT{%} 136and 137@QT{#} 138retain their literal value when preceded by a backslash. 139@chapter Ex Commands 140 141The following section describes the commands available in the 142@CO{ex} 143editor. 144In each entry below, the tag line is a usage synopsis for the command. 145 146Each command can be entered as the abbreviation 147(those characters in the synopsis command word preceding the 148@QQ{[} 149character), 150the full command (all characters shown for the command word, 151omitting the 152@QQ{[} 153and 154@QQ{]} 155characters), 156or any leading subset of the full command down to the abbreviation. 157For example, the args command (shown as 158@QT{ar[gs]} 159in the synopsis) 160can be entered as 161@QT{ar}, 162@QT{arg} 163or 164@QT{args}. 165 166Each 167@CO{ex} 168command described below notes the new current line after it 169is executed, as well as any options that affect the command. 170@cindex DOUBLEQUOTE 171@deftypefn Command {} {"} 172 173A comment. 174Command lines beginning with the double-quote character 175@PQ{"} 176are ignored. 177This permits comments in editor scripts and startup files. 178@end deftypefn 179@cindex "<control-D>" 180@cindex "<end-of-file>" 181@deftypefn Command {} {<control-D>} 182 183@deftypefnx Command {} {<end-of-file>} 184 185Scroll the screen. 186Write the next N lines, where N is the value of the 187@OP{scroll} 188option. 189The command is the end-of-file terminal character, which may be 190different on different terminals. 191Traditionally, it is the 192@LI{<control-D>}key. 193@sp 1 194Historically, the 195@CO{eof} 196command ignored any preceding count, and the 197@LI{<end-of-file>}character was ignored unless it was entered as the first character 198of the command. 199This implementation treats it as a command 200@emph{only} 201if entered as the first character of the command line, and otherwise 202treats it as any other character. 203@table @asis 204@item Line: 205Set to the last line written. 206@item Options: 207Affected by the 208@OP{scroll} 209option. 210@end table 211@end deftypefn 212@cindex "!" 213@deftypefn Command {} {!} {argument(s)} 214 215@deftypefnx Command {} {[range]!} {argument(s)} 216Execute a shell command, or filter lines through a shell command. 217In the first synopsis, the remainder of the line after the 218@QT{!} 219character is passed to the program named by the 220@OP{shell} 221option, as a single argument. 222@sp 1 223Within the rest of the line, 224@QT{%} 225and 226@QT{#} 227are expanded into the current and alternate pathnames, respectively. 228The character 229@QT{!} 230is expanded with the command text of the previous 231@CO{!} 232command. 233(Therefore, the command 234@CO{!!} 235repeats the previous 236@CO{!} 237command.) 238The special meanings of 239@QT{%}, 240@QT{#}, 241and 242@QT{!} 243can be overridden by escaping them with a backslash. 244If no 245@CO{!} 246or 247@CO{:!} 248command has yet been executed, it is an error to use an unescaped 249@QT{!} 250character. 251The 252@CO{!} 253command does 254@emph{not} 255do shell expansion on the strings provided as arguments. 256If any of the above expansions change the command the user entered, 257the command is redisplayed at the bottom of the screen. 258@sp 1 259@CO{Ex} 260then executes the program named by the 261@OP{shell} 262option, with a 263@strong{-c} 264flag followed by the arguments (which are bundled into a single argument). 265@sp 1 266The 267@CO{!} 268command is permitted in an empty file. 269@sp 1 270If the file has been modified since it was last completely written, 271the 272@CO{!} 273command will warn you. 274@sp 1 275A single 276@QT{!} 277character is displayed when the command completes. 278@sp 1 279In the second form of the 280@CO{!} 281command, the remainder of the line after the 282@QT{!} 283is passed to the program named by the 284@OP{shell} 285option, as described above. 286The specified lines are passed to the program as standard input, 287and the standard and standard error output of the program replace 288the original lines. 289@table @asis 290@item Line: 291Unchanged if no range was specified, otherwise set to the first 292line of the range. 293@item Options: 294Affected by the 295@OP{shell} 296and 297@OP{warn} 298options. 299@end table 300@end deftypefn 301@cindex "#" 302@deftypefn Command {[range]} {#} {[count] [flags]} 303 304@cindex "number" 305@deftypefnx Command {[range]} {nu[mber]} {[count] [flags]} 306Display the selected lines, each preceded with its line number. 307@sp 1 308The line number format is 309@QQ{%6d}, 310followed by two spaces. 311@table @asis 312@item Line: 313Set to the last line displayed. 314@item Options: 315Affected by the 316@OP{list} 317option. 318@end table 319@end deftypefn 320@cindex "@@" 321@deftypefn Command {@@} {buffer} 322 323@cindex "*" 324@deftypefnx Command {} {*} {buffer} 325Execute a buffer. 326Each line in the named buffer is executed as an 327@CO{ex} 328command. 329If no buffer is specified, or if the specified buffer is 330@QT{@@} 331or 332@QT{*}, 333the last buffer executed is used. 334@end deftypefn 335@cindex < 336@deftypefn Command {[range]} {<[< ...]} {[count] [flags]} 337 338Shift lines left or right. 339The specified lines are shifted to the left (for the 340@CO{<} 341command) or right (for the 342@CO{>} 343command), by the number of columns specified by the 344@OP{shiftwidth} 345option. 346Only leading whitespace characters are deleted when shifting left; 347once the first column of the line contains a nonblank character, 348the 349@CO{shift} 350command will succeed, but the line will not be modified. 351@sp 1 352If the command character 353@CO{<} 354or 355@CO{>} 356is repeated more than once, the command is repeated once for each 357additional command character. 358@table @asis 359@item Line: 360If the current line is set to one of the lines that are affected 361by the command, it is unchanged. 362Otherwise, it is set to the first nonblank character of the lowest 363numbered line shifted. 364@item Options: 365Affected by the 366@OP{shiftwidth} 367option. 368@end table 369@end deftypefn 370@cindex = 371@deftypefn Command {[line]} {=} {[flags]} 372 373Display the line number of 374@LI{line}(which defaults to the last line in the file). 375@table @asis 376@item Line: 377Unchanged. 378@item Options: 379None. 380@end table 381@end deftypefn 382@cindex > 383@deftypefn Command {[range]} {>[> ...]} {[count] [flags]} 384 385Shift right. 386The specified lines are shifted to the right by the number of columns 387specified by the 388@OP{shiftwidth} 389option, by inserting tab and space characters. 390Empty lines are not changed. 391@sp 1 392If the command character 393@QT{>} 394is repeated more than once, the command is repeated once for each 395additional command character. 396@table @asis 397@item Line: 398Set to the last line modified by the command. 399@item Options: 400Affected by the 401@OP{shiftwidth} 402option. 403@end table 404@end deftypefn 405@cindex abbrev 406@deftypefn Command {} {ab[brev]} {lhs rhs} 407 408Add an abbreviation to the current abbreviation list. 409When inserting text in 410@CO{vi}, 411each time a non-word character is entered after a word character, 412a set of characters ending at the word character are checked for 413a match with 414@LI{lhs}. 415If a match is found, they are replaced with 416@LI{rhs}. 417The set of characters that are checked for a match are defined as follows, 418for inexplicable historical reasons. 419If only one or two characters were entered before the non-word character 420that triggered the check, 421and after the beginning of the insertion, 422or the beginning of the line or the file, 423or the last 424@LI{<blank>}character that was entered, 425then the one or the both characters are checked for a match. 426Otherwise, the set includes both characters, 427as well as the characters that precede them that are the same word 428class (i.e. word or non-word) as the 429@strong{second} 430to last character entered before the non-word character that triggered 431the check, 432back to the first 433@LI{<blank>}character, 434the beginning of the insertion, 435or the beginning of the line or the file. 436@sp 1 437For example, the abbreviations: 438@sp 1 439@multitable {:abbreviate} {/*#i} {/********************} 440@item :abbreviate @tab abc @tab ABC 441@item :abbreviate @tab #i @tab #include 442@item :abbreviate @tab /*#i @tab /*#include 443@end multitable 444will all work, while the abbreviations: 445@sp 1 446@multitable {:abbreviate} {/*#i} {/********************} 447@item :abbreviate @tab a#i @tab A#include 448@item :abbreviate @tab /* @tab /******************** 449@end multitable 450will not work, and are not permitted by 451@CO{nvi}. 452@sp 1 453To keep the abbreviation expansion from happening, 454the character immediately following the 455@LI{lhs}characters should be quoted with a 456@LI{<literal-next>}character. 457@sp 1 458The replacement 459@LI{rhs}is itself subject to both further abbreviation expansion and further 460map expansion. 461@table @asis 462@item Line: 463Unchanged. 464@item Options: 465None. 466@end table 467@end deftypefn 468@cindex append 469@deftypefn Command {[line]} {a[ppend][!]} 470 471The input text is appended to the specified line. 472If line 0 is specified, the text is inserted at the beginning of the file. 473Set to the last line input. 474If no lines are input, then set to 475@LI{line}, 476or to the first line of the file if a 477@LI{line}of 0 was specified. 478Following the command name with a 479@QT{!} 480character causes the 481@OP{autoindent} 482option to be toggled for the duration of the command. 483@table @asis 484@item Line: 485Unchanged. 486@item Options: 487Affected by the 488@OP{autoindent} 489and 490@OP{number} 491options. 492@end table 493@end deftypefn 494@cindex args 495@deftypefn Command {} {ar[gs]} 496 497Display the argument list. 498The current argument is displayed inside of 499@QT{[} 500and 501@QT{]} 502characters. 503The argument list is the list of operands specified on startup, 504which can be replaced using the 505@CO{next} 506command. 507@table @asis 508@item Line: 509Unchanged. 510@item Options: 511None. 512@end table 513@end deftypefn 514@cindex bg 515@deftypefn Command {} {bg} 516 517@CO{Vi} 518mode only. 519Background the current screen. 520The screen is unchanged, 521but is no longer accessible and disappears from the display. 522Use the 523@CO{fg} 524command to bring the screen back to the display foreground. 525@table @asis 526@item Line: 527Set to the current line when the screen was last edited. 528@item Options: 529None. 530@end table 531@end deftypefn 532@cindex change 533@deftypefn Command {[range]} {c[hange][!]} {[count]} 534 535Replace the lines with input text. 536Following the command name with a 537@QT{!} 538character causes the 539@OP{autoindent} 540option to be toggled for the duration of the command. 541@table @asis 542@item Line: 543Set to the last line input, or, if no lines were input, 544set to the line before the target line, or to the first 545line of the file if there are no lines preceding the target line. 546@item Options: 547Affected by the 548@OP{autoindent} 549and 550@OP{number} 551options. 552@end table 553@cindex cd 554@end deftypefn 555@cindex chdir 556@deftypefn Command {} {chd[ir][!]} {[directory]} 557 558@deftypefnx Command {} {cd[!]} {[directory]} 559Change the current working directory. 560The 561@LI{directory}argument is subjected to 562@XR{sh,1} 563word expansions. 564When invoked with no directory argument and the 565@LI{HOME}environment variable is set, the directory named by the 566@LI{HOME}environment variable becomes the new current directory. 567Otherwise, the new current directory becomes the directory returned 568by the 569@XR{getpwent,3} 570routine. 571@sp 1 572The 573@CO{chdir} 574command will fail if the file has been modified since the last complete 575write of the file. 576You can override this check by appending a 577@QT{!} 578character to the command. 579@table @asis 580@item Line: 581Unchanged. 582@item Options: 583Affected by the 584@OP{cdpath} 585option. 586@end table 587@cindex copy 588@end deftypefn 589@cindex t 590@deftypefn Command {[range]} {co[py]} {line [flags]} 591 592@deftypefnx Command {[range]} {t} {line [flags]} 593Copy the specified lines (range) after the destination line. 594Line 0 may be specified to insert the lines at the beginning of 595the file. 596@table @asis 597@item Line: 598Unchanged. 599@item Options: 600None. 601@end table 602@end deftypefn 603@cindex cscope 604@deftypefn Command {} {cs[cope]} {command [args]} 605 606Execute a 607@CO{cscope} 608command. 609For more information, see the section of the reference manual entitled 610@QB{Tags, Tag Stacks, and Cscope} . 611@end deftypefn 612@cindex delete 613@deftypefn Command {[range]} {d[elete]} {[buffer] [count] [flags]} 614 615Delete the lines from the file. 616The deleted text is saved in the specified buffer, or, if no buffer 617is specified, in the unnamed buffer. 618If the command name is followed by a letter that could be interpreted 619as either a buffer name or a flag value (because neither a 620@LI{count}or 621@LI{flags}values were given), 622@CO{ex} 623treats the letter as a 624@LI{flags}value if the letter immediately follows the command name, 625without any whitespace separation. 626If the letter is preceded by whitespace characters, 627it treats it as a buffer name. 628@table @asis 629@item Line: 630Set to the line following the deleted lines, 631or to the last line if the deleted lines were at the end. 632@item Options: 633None. 634@end table 635@end deftypefn 636@cindex display 637@deftypefn Command {} {di[splay]} {b[uffers] | c[onnections] | s[creens] | t[ags]} 638 639Display buffers, 640@CO{cscope} 641connections, screens or tags. 642The 643@CO{display} 644command takes one of three additional arguments, which are as follows: 645@table @asis 646@item b[uffers] 647Display all buffers (including named, unnamed, and numeric) 648that contain text. 649@item c[onnections] 650Display the source directories for all attached 651@CO{cscope} 652databases. 653@item s[creens] 654Display the file names of all background screens. 655@item t[ags] 656Display the tags stack. 657@end table 658@table @asis 659@item Line: 660Unchanged. 661@item Options: 662None. 663@end table 664@end deftypefn 665@cindex edit 666@deftypefn Command {} {e[dit][!]} {[+cmd] [file]} 667@deftypefnx Command {} {ex[!]} {[+cmd] [file]} 668@deftypefnx Command {} {vs[plit][!]} {[+cmd] [file]} 669Edit a different file. 670If the current buffer has been modified since the last complete write, 671the command will fail. 672You can override this by appending a 673@QT{!} 674character to the command name. 675@sp 1 676If the 677@QT{+cmd} 678option is specified, that 679@CO{ex} 680command will be executed in the new file. 681Any 682@CO{ex} 683command may be used, although the most common use of this feature is 684to specify a line number or search pattern to set the initial location 685in the new file. 686@sp 1 687Capitalizing the first letter of the command, i.e., 688@CO{Edit} 689or 690@CO{Ex}, 691while in 692@CO{vi} 693mode, will edit the file in a new screen. 694In this case, any modifications to the current file are ignored. 695@cindex vertical split 696@cindex splitting, vertically 697@CO{vsplit} is similar, but the screen will be split vertically 698to produce the new screen, rather than horizontally. 699 700@table @asis 701@item Line: 702If you have previously edited the file, the current line will be set 703to your last position in the file. 704If that position does not exist, or you have not previously edited the 705file, the current line will be set to the first line of the file if 706you are in 707@CO{vi} 708mode, and the last line of the file if you are in 709@CO{ex}. 710@item Options: 711None. 712@end table 713@end deftypefn 714@cindex exusage 715@deftypefn Command {} {exu[sage]} {[command]} 716 717Display usage for an 718@CO{ex} 719command. 720If 721@LI{command}is specified, a usage statement for that command is displayed. 722Otherwise, usage statements for all 723@CO{ex} 724commands are displayed. 725@table @asis 726@item Line: 727Unchanged. 728@item Options: 729None. 730@end table 731@end deftypefn 732@cindex file 733@deftypefn Command {} {f[ile]} {[file]} 734 735Display and optionally change the file name. 736If a file name is specified, the current pathname is changed to the 737specified name. 738The current pathname, the number of lines, and the current position 739in the file are displayed. 740@table @asis 741@item Line: 742Unchanged. 743@item Options: 744None. 745@end table 746@end deftypefn 747@cindex fg 748@deftypefn Command {} {fg} {[name]} 749 750@CO{Vi} 751mode only. 752Foreground the specified screen. 753If the argument name doesn't exactly match the name of a file displayed 754by a background screen, 755it is compared against the last component of each of the file names. 756If no background screen is specified, 757the first background screen is foregrounded. 758@sp 1 759By default, 760foregrounding causes the current screen to be swapped with the backgrounded 761screen. 762Capitalizing the first letter of the command, i.e. 763@CO{Fg}, 764will foreground the backgrounded screen in a new screen instead of 765swapping it with the current screen. 766@table @asis 767@item Line: 768Set to the current line when the screen was last edited. 769@item Options: 770None. 771@end table 772@end deftypefn 773@cindex global 774@deftypefn Command {[range]} {g[lobal]} {/pattern/ [commands]} 775 776@cindex v 777@deftypefnx Command {[range]} {v} {/pattern/ [commands]} 778Apply commands to lines matching (or not matching) a pattern. 779The lines within the given range that match 780@PQ{g[lobal]}, 781or do not match 782@PQ{v} 783the given pattern are selected. 784Then, the specified 785@CO{ex} 786command(s) are executed with the current line 787@PQ{.} 788set to each selected line. 789If no range is specified, the entire file is searched for matching, 790or not matching, lines. 791@sp 1 792Multiple commands can be specified, one per line, by escaping each 793@LI{<newline>}character with a backslash, or by separating commands with a 794@QT{|} 795character. 796If no commands are specified, the command defaults to the 797@CO{print} 798command. 799@sp 1 800For the 801@CO{append}, 802@CO{change} 803and 804@CO{insert} 805commands, the input text must be part of the global command line. 806In this case, the terminating period can be omitted if it ends the commands. 807@sp 1 808The 809@CO{visual} 810command may also be specified as one of the 811@CO{ex} 812commands. 813In this mode, input is taken from the terminal. 814Entering a 815@CO{Q} 816command in 817@CO{vi} 818mode causes the next line matching the pattern to be selected and 819@CO{vi} 820to be reentered, until the list is exhausted. 821@sp 1 822The 823@CO{global}, 824@CO{v} 825and 826@CO{undo} 827commands cannot be used as part of these commands. 828@sp 1 829The editor options 830@OP{autoindent}, 831@OP{autoprint} 832and 833@OP{report} 834are turned off for the duration of the 835@CO{global} 836and 837@CO{v} 838commands. 839@table @asis 840@item Line: 841The last line modified. 842@item Options: 843Affected by the 844@OP{ignorecase} 845and 846@OP{magic} 847options. 848Turns off the 849@OP{autoindent}, 850@OP{autoprint} 851and 852@OP{report} 853options. 854@end table 855@end deftypefn 856@cindex help 857@deftypefn Command {} {he[lp]} 858 859Display a help message. 860@table @asis 861@item Line: 862Unchanged. 863@item Options: 864None. 865@end table 866@end deftypefn 867@cindex insert 868@deftypefn Command {[line]} {i[nsert][!]} 869 870The input text is inserted before the specified line. 871Following the command name with a 872@QT{!} 873character causes the 874@OP{autoindent} 875option setting to be toggled for the duration of this command. 876@table @asis 877@item Line: 878Set to the last line input; if no lines were input, 879set to the line before the target line, or to the first line 880of the file if there are no lines preceding the target line. 881Affected by the 882@OP{autoindent} 883and 884@OP{number} 885options. 886@end table 887@end deftypefn 888@cindex join 889@deftypefn Command {[range]} {j[oin][!]} {[count] [flags]} 890 891Join lines of text together. 892@sp 1 893A 894@LI{count}specified to the 895@CO{join} 896command specifies that the last line of the 897@LI{range}plus 898@LI{count}subsequent lines will be joined. 899(Note, this differs by one from the general rule where only 900@LI{count}- 1 901subsequent lines are affected.) 902@sp 1 903If the current line ends with a whitespace character, all whitespace 904is stripped from the next line. 905Otherwise, if the next line starts with a open parenthesis 906@PQ{(}, 907do nothing. 908Otherwise, if the current line ends with a question mark 909@PQ{?}, 910period 911@PQ{.} 912or exclamation point 913@PQ{!}, 914insert two spaces. 915Otherwise, insert a single space. 916@sp 1 917Appending a 918@QT{!} 919character to the command name causes a simpler join with no 920white-space processing. 921@table @asis 922@item Line: 923Unchanged. 924@item Options: 925None. 926@end table 927@end deftypefn 928@cindex list 929@deftypefn Command {[range]} {l[ist]} {[count] [flags]} 930 931Display the lines unambiguously. 932Tabs are displayed as 933@QT{^I}, 934and the end of the line is marked with a 935@QT{$} 936character. 937@table @asis 938@item Line: 939Set to the last line displayed. 940@item Options: 941Affected by the 942@OP{number} 943option. 944@end table 945@end deftypefn 946@cindex map 947@deftypefn Command {} {map[!]} {[lhs rhs]} 948 949Define or display maps (for 950@CO{vi} 951only). 952@sp 1 953If 954@QT{lhs} 955and 956@QT{rhs} 957are not specified, the current set of command mode maps are displayed. 958If a 959@QT{!} 960character is appended to to the command, 961the text input mode maps are displayed. 962@sp 1 963Otherwise, when the 964@QT{lhs} 965character sequence is entered in 966@CO{vi}, 967the action is as if the corresponding 968@QT{rhs} 969had been entered. 970If a 971@QT{!} 972character is appended to the command name, 973the mapping is effective during text input mode, 974otherwise, it is effective during command mode. 975This allows 976@QT{lhs} 977to have two different macro definitions at the same time: one for command 978mode and one for input mode. 979@sp 1 980Whitespace characters require escaping with a 981@LI{<literal-next>}character to be entered in the 982@LI{lhs}string in visual mode. 983@sp 1 984Normally, keys in the 985@LI{rhs}string are remapped (see the 986@OP{remap} 987option), 988and it is possible to create infinite loops. 989However, keys which map to themselves are not further remapped, 990regardless of the setting of the 991@OP{remap} 992option. 993For example, the command 994@QT{:map n nz.} 995maps the 996@QT{n} 997key to the 998@CO{n} 999and 1000@CO{z} 1001commands. 1002@sp 1 1003To exit an infinitely looping map, use the terminal 1004@LI{<interrupt>}character. 1005@table @asis 1006@item Line: 1007Unchanged. 1008@item Options: 1009Affected by the 1010@OP{remap} 1011option. 1012@end table 1013@cindex mark 1014@end deftypefn 1015@cindex k 1016@deftypefn Command {[line]} {ma[rk]} {<character>} 1017 1018@deftypefnx Command {[line]} {k} {<character>} 1019Mark the line with the mark 1020@LI{<character>}. 1021The expressions 1022@QT{'<character>} 1023and 1024@QT{`<character>} 1025can then be used as an address in any command that uses one. 1026@table @asis 1027@item Line: 1028Unchanged. 1029@item Options: 1030None. 1031@end table 1032@end deftypefn 1033@cindex move 1034@deftypefn Command {[range]} {m[ove]} {line} 1035 1036Move the specified lines after the target line. 1037A target line of 0 places the lines at the beginning of the file. 1038@table @asis 1039@item Line: 1040Set to the first of the moved lines. 1041@item Options: 1042None. 1043@end table 1044@end deftypefn 1045@cindex mkexrc 1046@deftypefn Command {} {mk[exrc][!]} {file} 1047 1048Write the abbreviations, editor options and maps to the specified 1049file. 1050Information is written in a form which can later be read back in 1051using the 1052@CO{ex} 1053@CO{source} 1054command. 1055If 1056@LI{file}already exists, the 1057@CO{mkexrc} 1058command will fail. 1059This check can be overridden by appending a 1060@QT{!} 1061character to the command. 1062@table @asis 1063@item Line: 1064Unchanged. 1065@item Options: 1066None. 1067@end table 1068@end deftypefn 1069@cindex next 1070@deftypefn Command {} {n[ext][!]} {[file ...]} 1071 1072Edit the next file from the argument list. 1073The 1074@CO{next} 1075command will fail if the file has been modified since the last complete 1076write. 1077This check can be overridden by appending the 1078@QT{!} 1079character to the command name. 1080The argument list can optionally be replaced by specifying a new one 1081as arguments to this command. 1082In this case, editing starts with the first file on the new list. 1083@sp 1 1084Capitalizing the first letter of the command, i.e. 1085@CO{Next}, 1086while in 1087@CO{vi} 1088mode, will set the argument list and edit the file in a new screen. 1089In this case, any modifications to the current file are ignored. 1090@table @asis 1091@item Line: 1092Set as described for the 1093@CO{edit} 1094command. 1095@item Options: 1096Affected by the options 1097@OP{autowrite} 1098and 1099@OP{writeany}. 1100@end table 1101@end deftypefn 1102@cindex open 1103@deftypefn Command {[line]} {o[pen]} {/pattern/ [flags]} 1104 1105Enter open mode. 1106Open mode is the same as being in 1107@CO{vi}, 1108but with a one-line window. 1109All the standard 1110@CO{vi} 1111commands are available. 1112If a match is found for the optional RE argument, 1113the cursor is set to the start of the matching pattern. 1114@sp 1 1115@emph{This command is not yet implemented.} 1116@table @asis 1117@item Line: 1118Unchanged, unless the optional RE is specified, in which case it is 1119set to the line where the matching pattern is found. 1120@item Options: 1121Affected by the 1122@OP{open} 1123option. 1124@end table 1125@end deftypefn 1126@cindex preserve 1127@deftypefn Command {} {pre[serve]} 1128 1129Save the file in a form that can later be recovered using the 1130@CO{ex} 1131@strong{-r} 1132option. 1133When the file is preserved, an email message is sent to the user. 1134@table @asis 1135@item Line: 1136Unchanged. 1137@item Options: 1138None. 1139@end table 1140@end deftypefn 1141@cindex previous 1142@deftypefn Command {} {prev[ious][!]} 1143 1144Edit the previous file from the argument list. 1145The 1146@CO{previous} 1147command will fail if the file has been modified since the last complete 1148write. 1149This check can be overridden by appending the 1150@QT{!} 1151character to the command name. 1152@sp 1 1153Capitalizing the first letter of the command, i.e. 1154@CO{Previous}, 1155while in 1156@CO{vi} 1157mode, will edit the file in a new screen. 1158In this case, any modifications to the current file are ignored. 1159@table @asis 1160@item Line: 1161Set as described for the 1162@CO{edit} 1163command. 1164@item Options: 1165Affected by the options 1166@OP{autowrite} 1167and 1168@OP{writeany}. 1169None. 1170@end table 1171@end deftypefn 1172@cindex print 1173@deftypefn Command {[range]} {p[rint]} {[count] [flags]} 1174 1175Display the specified lines. 1176@table @asis 1177@item Line: 1178Set to the last line displayed. 1179@item Options: 1180Affected by the 1181@OP{list} 1182and 1183@OP{number} 1184option. 1185@end table 1186@end deftypefn 1187@cindex put 1188@deftypefn Command {[line]} {pu[t]} {[buffer]} 1189 1190Append buffer contents to the current line. 1191If a buffer is specified, its contents are appended to the line, 1192otherwise, the contents of the unnamed buffer are used. 1193@table @asis 1194@item Line: 1195Set to the line after the current line. 1196@item Options: 1197None. 1198@end table 1199@end deftypefn 1200@cindex quit 1201@deftypefn Command {} {q[uit][!]} 1202 1203End the editing session. 1204If the file has been modified since the last complete write, the 1205@CO{quit} 1206command will fail. 1207This check may be overridden by appending a 1208@QT{!} 1209character to the command. 1210@sp 1 1211If there are more files to edit, the 1212@CO{quit} 1213command will fail. 1214Appending a 1215@QT{!} 1216character to the command name or entering two 1217@CO{quit} 1218commands (i.e. 1219@CO{wq}, 1220@CO{quit}, 1221@CO{xit} 1222or 1223@CO{ZZ}) 1224in a row) will override this check and the editor will exit. 1225@table @asis 1226@item Line: 1227Unchanged. 1228@item Options: 1229None. 1230@end table 1231@end deftypefn 1232@cindex read 1233@deftypefn Command {[line]} {r[ead][!]} {[file]} 1234 1235Read a file. 1236A copy of the specified file is appended to the line. 1237If 1238@LI{line}is 0, the copy is inserted at the beginning of the file. 1239If no file is specified, the current file is read; if there is no 1240current file, then 1241@LI{file}becomes the current file. 1242If there is no current file and no 1243@LI{file}is specified, then the 1244@CO{read} 1245command will fail. 1246@sp 1 1247If 1248@LI{file}is preceded by a 1249@QT{!} 1250character, 1251@LI{file}is treated as if it were a shell command, and passed to the program 1252named by the 1253@OP{shell} 1254edit option. 1255The standard and standard error outputs of that command are read into 1256the file after the specified line. 1257The special meaning of the 1258@QT{!} 1259character can be overridden by escaping it with a backslash 1260@PQ{\e} 1261character. 1262@table @asis 1263@item Line: 1264When executed from 1265@CO{ex}, 1266the current line is set to the last line read. 1267When executed from 1268@CO{vi}, 1269the current line is set to the first line read. 1270@item Options: 1271None. 1272@end table 1273@end deftypefn 1274@cindex recover 1275@deftypefn Command {} {rec[over]} {file} 1276 1277Recover 1278@LI{file}if it was previously saved. 1279If no saved file by that name exists, the 1280@CO{recover} 1281command behaves equivalently to the 1282@CO{edit} 1283command. 1284@table @asis 1285@item Line: 1286Set as described for the 1287@CO{edit} 1288command. 1289@item Options: 1290None. 1291@end table 1292@end deftypefn 1293@cindex resize 1294@deftypefn Command {} {res[ize]} {[+|-]size} 1295 1296@CO{Vi} 1297mode only. 1298Grow or shrink the current screen. 1299If 1300@LI{size}is a positive, signed number, the current screen is grown by that many lines. 1301If 1302@LI{size}is a negative, signed number, the current screen is shrunk by that many lines. 1303If 1304@LI{size}is not signed, the current screen is set to the specified 1305@LI{size}. 1306Applicable only to split screens. 1307@table @asis 1308@item Line: 1309Unchanged. 1310@item Options: 1311None. 1312@end table 1313@end deftypefn 1314@cindex rewind 1315@deftypefn Command {} {rew[ind][!]} 1316 1317Rewind the argument list. 1318If the current file has been modified since the last complete write, 1319the 1320@CO{rewind} 1321command will fail. 1322This check may be overridden by appending the 1323@QT{!} 1324character to the command. 1325@sp 1 1326Otherwise, the current file is set to the first file in the argument 1327list. 1328@table @asis 1329@item Line: 1330Set as described for the 1331@CO{edit} 1332command. 1333@item Options: 1334Affected by the 1335@OP{autowrite} 1336and 1337@OP{writeany} 1338options. 1339@end table 1340@end deftypefn 1341@cindex set 1342@deftypefn Command {} {se[t]} {[option[=[value]] ...] [nooption ...] [option? ...] [all]} 1343 1344Display or set editor options. 1345When no arguments are specified, the editor option 1346@OP{term}, 1347and any editor options whose values have been changed from the 1348default settings are displayed. 1349If the argument 1350@LI{all}is specified, the values of all of editor options are displayed. 1351@sp 1 1352Specifying an option name followed by the character 1353@QT{?} 1354causes the current value of that option to be displayed. 1355The 1356@QT{?} 1357can be separated from the option name by whitespace characters. 1358The 1359@QT{?} 1360is necessary only for Boolean valued options. 1361Boolean options can be given values by the form 1362@QT{set option} 1363to turn them on, or 1364@QT{set nooption} 1365to turn them off. 1366String and numeric options can be assigned by the form 1367@QT{set option=value}. 1368Any whitespace characters in strings can be included literally by preceding 1369each with a backslash. 1370More than one option can be set or listed by a single set command, 1371by specifying multiple arguments, each separated from the next by 1372whitespace characters. 1373@table @asis 1374@item Line: 1375Unchanged. 1376@item Options: 1377None. 1378@end table 1379@end deftypefn 1380@cindex shell 1381@deftypefn Command {} {sh[ell]} 1382 1383Run the shell program. 1384The program named by the 1385@OP{shell} 1386option is run with a 1387@strong{-i} 1388(for interactive) flag. 1389Editing is resumed when that program exits. 1390@table @asis 1391@item Line: 1392Unchanged. 1393@item Options: 1394Affected by the 1395@OP{shell} 1396option. 1397@end table 1398@end deftypefn 1399@cindex source 1400@deftypefn Command {} {so[urce]} {file} 1401 1402Read and execute 1403@CO{ex} 1404commands from a file. 1405@CO{Source} 1406commands may be nested. 1407@table @asis 1408@item Line: 1409Unchanged. 1410@item Options: 1411None. 1412@end table 1413@end deftypefn 1414@cindex substitute 1415@deftypefn Command {[range]} {s[ubstitute]} {[/pattern/replace/] [options] [count] [flags]} 1416 1417@cindex & 1418@deftypefnx Command {[range]} {&} {[options] [count] [flags]} 1419@cindex ~ 1420@deftypefnx Command {[range]} {~} {[options] [count] [flags]} 1421Make substitutions. 1422Replace the first instance of 1423@LI{pattern}with the string 1424@LI{replace}on the specified line(s). 1425If the 1426@QT{/pattern/repl/} 1427argument is not specified, the 1428@QT{/pattern/repl/} 1429from the previous 1430@CO{substitute} 1431command is used. 1432Any character other than an alphabetic, numeric, <blank> or backslash 1433character may be used as the delimiter. 1434@sp 1 1435If 1436@LI{options}includes the letter 1437@QT{c} 1438(confirm), you will be prompted for confirmation before each replacement 1439is done. 1440An affirmative response (in English, a 1441@QT{y} 1442character) causes the replacement to be made. 1443A quit response (in English, a 1444@QT{q} 1445character) causes the 1446@CO{substitute} 1447command to be terminated. 1448Any other response causes the replacement not to be made, and the 1449@CO{substitute} 1450command continues. 1451If 1452@LI{options}includes the letter 1453@QT{g} 1454(global), all nonoverlapping instances of 1455@LI{pattern}in the line are replaced. 1456@sp 1 1457The 1458@CO{&} 1459version of the command is the same as not specifying a pattern 1460or replacement string to the 1461@CO{substitute} 1462command, and the 1463@QT{&} 1464is replaced by the pattern and replacement information from the 1465previous substitute command. 1466@sp 1 1467The 1468@CO{~} 1469version of the command is the same as 1470@CO{&} 1471and 1472@CO{s}, 1473except that the search pattern used is the last RE used in 1474@emph{any} 1475command, not necessarily the one used in the last 1476@CO{substitute} 1477command. 1478@sp 1 1479For example, in the sequence 1480@example 1481s/red/blue/ 1482/green 1483~ 1484@end example 1485the 1486@QT{~} 1487is equivalent to 1488@QT{s/green/blue/}. 1489@sp 1 1490The 1491@CO{substitute} 1492command may be interrupted, using the terminal interrupt character. 1493All substitutions completed before the interrupt are retained. 1494@table @asis 1495@item Line: 1496Set to the last line upon which a substitution was made. 1497@item Options: 1498Affected by the 1499@OP{ignorecase} 1500and 1501@OP{magic} 1502option. 1503@end table 1504@end deftypefn 1505@cindex suspend 1506@deftypefn Command {} {su[spend][!]} 1507 1508@cindex stop 1509@deftypefnx Command {} {st[op][!]} 1510@deftypefnx Comamnd {} <control-Z> 1511Suspend the edit session. 1512Appending a 1513@QT{!} 1514character to these commands turns off the 1515@OP{autowrite} 1516option for the command. 1517@table @asis 1518@item Line: 1519Unchanged. 1520@item Options: 1521Affected by the 1522@OP{autowrite} 1523and 1524@OP{writeany} 1525options. 1526@end table 1527@end deftypefn 1528@cindex tag 1529@deftypefn Command {} {ta[g][!]} {tagstring} 1530 1531Edit the file containing the specified tag. 1532If the tag is in a different file, then the new file is edited. 1533If the current file has been modified since the last complete write, 1534the 1535@CO{tag} 1536command will fail. 1537This check can be overridden by appending the 1538@QT{!} 1539character to the command name. 1540@sp 1 1541The 1542@CO{tag} 1543command searches for 1544@LI{tagstring}in the tags file(s) specified by the 1545@OP{tags} 1546option. 1547(See 1548@XR{ctags,1} 1549for more information on tags files.) 1550@sp 1 1551Capitalizing the first letter of the command, i.e. 1552@CO{Tag}, 1553while in 1554@CO{vi} 1555mode, will edit the file in a new screen. 1556In this case, any modifications to the current file are ignored. 1557@table @asis 1558@item Line: 1559Set to the line indicated by the tag. 1560@item Options: 1561Affected by the 1562@OP{autowrite}, 1563@OP{taglength}, 1564@OP{tags} 1565and 1566@OP{writeany} 1567options. 1568@end table 1569@end deftypefn 1570@cindex tagnext 1571@deftypefn Command {} {tagn[ext][!]} 1572 1573Edit the file containing the next context for the current tag. 1574If the context is in a different file, then the new file is edited. 1575If the current file has been modified since the last complete write, 1576the 1577@CO{tagnext} 1578command will fail. 1579This check can be overridden by appending the 1580@QT{!} 1581character to the command name. 1582@sp 1 1583Capitalizing the first letter of the command, i.e. 1584@CO{Tagnext}, 1585while in 1586@CO{vi} 1587mode, will edit the file in a new screen. 1588In this case, any modifications to the current file are ignored. 1589@table @asis 1590@item Line: 1591Set to the line indicated by the tag. 1592@item Options: 1593Affected by the 1594@OP{autowrite} 1595and 1596@OP{writeany} 1597options. 1598@end table 1599@end deftypefn 1600@cindex tagpop 1601@deftypefn Command {} {tagp[op][!]} {[file | number]} 1602 1603Pop to the specified tag in the tags stack. 1604If neither 1605@LI{file}or 1606@LI{number}is specified, the 1607@CO{tagpop} 1608command pops to the most recent entry on the tags stack. 1609If 1610@LI{file}or 1611@LI{number}is specified, the 1612@CO{tagpop} 1613command pops to the most recent entry in the tags stack for that file, 1614or numbered entry in the tags stack, respectively. 1615(See the 1616@CO{display} 1617command for information on displaying the tags stack.) 1618@sp 1 1619If the file has been modified since the last complete write, the 1620@CO{tagpop} 1621command will fail. 1622This check may be overridden by appending a 1623@QT{!} 1624character to the command name. 1625@table @asis 1626@item Line: 1627Set to the line indicated by the tag. 1628@item Options: 1629Affected by the 1630@OP{autowrite} 1631and 1632@OP{writeany} 1633options. 1634@end table 1635@end deftypefn 1636@cindex tagprev 1637@deftypefn Command {} {tagp[rev][!]} 1638 1639Edit the file containing the previous context for the current tag. 1640If the context is in a different file, then the new file is edited. 1641If the current file has been modified since the last complete write, 1642the 1643@CO{tagprev} 1644command will fail. 1645This check can be overridden by appending the 1646@QT{!} 1647character to the command name. 1648@sp 1 1649Capitalizing the first letter of the command, i.e. 1650@CO{Tagprev}, 1651while in 1652@CO{vi} 1653mode, will edit the file in a new screen. 1654In this case, any modifications to the current file are ignored. 1655@table @asis 1656@item Line: 1657Set to the line indicated by the tag. 1658@item Options: 1659Affected by the 1660@OP{autowrite} 1661and 1662@OP{writeany} 1663options. 1664@end table 1665@end deftypefn 1666@cindex tagtop 1667@deftypefn Command {} {tagt[op][!]} 1668 1669Pop to the least recent tag on the tags stack, clearing the tags stack. 1670@sp 1 1671If the file has been modified since the last complete write, the 1672@CO{tagtop} 1673command will fail. 1674This check may be overridden by appending a 1675@QT{!} 1676character to the command name. 1677@table @asis 1678@item Line: 1679Set to the line indicated by the tag. 1680@item Options: 1681Affected by the 1682@OP{autowrite} 1683and 1684@OP{writeany} 1685options. 1686@end table 1687@end deftypefn 1688@cindex unabbrev 1689@deftypefn Command {} {una[bbrev]} {lhs} 1690 1691Delete an abbreviation. 1692Delete 1693@LI{lhs}from the current list of abbreviations. 1694@table @asis 1695@item Line: 1696Unchanged. 1697@item Options: 1698None. 1699@end table 1700@end deftypefn 1701@cindex undo 1702@deftypefn Command {} {u[ndo]} 1703 1704Undo the last change made to the file. 1705Changes made by 1706@CO{global}, 1707@CO{v}, 1708@CO{visual} 1709and map sequences are considered a single command. 1710If repeated, the 1711@CO{u} 1712command alternates between these two states, and is its own inverse. 1713@table @asis 1714@item Line: 1715Set to the last line modified by the command. 1716@item Options: 1717None. 1718@end table 1719@end deftypefn 1720@cindex unmap 1721@deftypefn Command {} {unm[ap][!]} {lhs} 1722 1723Unmap a mapped string. 1724Delete the command mode map definition for 1725@LI{lhs}. 1726If a 1727@QT{!} 1728character is appended to the command name, delete the text input mode 1729map definition instead. 1730@table @asis 1731@item Line: 1732Unchanged. 1733@item Options: 1734None. 1735@end table 1736@end deftypefn 1737@cindex version 1738@deftypefn Command {} {ve[rsion]} 1739 1740Display the version of the 1741@CO{ex/vi} 1742editor. 1743@end deftypefn 1744@cindex visual 1745@deftypefn Command {[line]} {vi[sual]} {[type] [count] [flags]} 1746 1747@CO{Ex} 1748mode only. 1749Enter 1750@CO{vi}. 1751The 1752@LI{type}is optional, and can be 1753@QT{-}, 1754@QT{+} 1755or 1756@QT{^}, 1757as in the 1758@CO{ex} 1759@CO{z} 1760command, to specify the position of the specified line in the screen 1761window. 1762(The default is to place the line at the top of the screen window.) 1763A 1764@LI{count}specifies the number of lines that will initially be displayed. 1765(The default is the value of the 1766@OP{window} 1767editor option.) 1768@table @asis 1769@item Line: 1770Unchanged unless 1771@LI{line}is specified, in which case it is set to that line. 1772@item Options: 1773None. 1774@end table 1775@end deftypefn 1776@cindex visual 1777@deftypefn Command {} {vi[sual][!]} {[+cmd] [file]} 1778 1779@CO{Vi} 1780mode only. 1781Edit a new file. 1782Identical to the 1783@QT{edit[!] [+cmd] [file]} 1784command. 1785@sp 1 1786Capitalizing the first letter of the command, i.e. 1787@CO{Visual}, 1788will edit the file in a new screen. 1789In this case, any modifications to the current file are ignored. 1790@end deftypefn 1791@cindex viusage 1792@deftypefn Command {} {viu[sage]} {[command]} 1793 1794Display usage for a 1795@CO{vi} 1796command. 1797If 1798@LI{command}is specified, a usage statement for that command is displayed. 1799Otherwise, usage statements for all 1800@CO{vi} 1801commands are displayed. 1802@table @asis 1803@item Line: 1804Unchanged. 1805@item Options: 1806None. 1807@end table 1808@end deftypefn 1809@cindex write 1810@deftypefn Command {[range]} {w[rite][!]} {[>>] [file]} 1811 1812@deftypefnx Command {[range]} {w[rite]} {[!] [file]} 1813@cindex wn 1814@deftypefnx Command {[range]} {wn[!]} {[>>] [file]} 1815@cindex wq 1816@deftypefnx Command {[range]} {wq[!]} {[>>] [file]} 1817Write the file. 1818The specified lines (the entire file, if no range is given) is written 1819to 1820@LI{file}. 1821If 1822@LI{file}is not specified, the current pathname is used. 1823If 1824@LI{file}is specified, and it exists, or if the current pathname was set using the 1825@CO{file} 1826command, and the file already exists, these commands will fail. 1827Appending a 1828@QT{!} 1829character to the command name will override this check and the write 1830will be attempted, regardless. 1831@sp 1 1832Specifying the optional 1833@QT{>>} 1834string will cause the write to be appended to the file, in which case 1835no tests are made for the file already existing. 1836@sp 1 1837If the file is preceded by a 1838@QT{!} 1839character, the program named by the shell edit option is 1840invoked with file as its second argument, and the specified 1841lines are passed as standard input to that command. 1842The 1843@QT{!} 1844in this usage must be separated from command name by at least one 1845whitespace character. 1846The special meaning of the 1847@QT{!} 1848may be overridden by escaping it with a backslash 1849@PQ{\e} 1850character. 1851@sp 1 1852The 1853@CO{wq} 1854version of the write command will exit the editor after writing the file, 1855if there are no further files to edit. 1856Appending a 1857@QT{!} 1858character to the command name or entering two 1859@QQ{quit} 1860commands (i.e. 1861@CO{wq}, 1862@CO{quit}, 1863@CO{xit} 1864or 1865@CO{ZZ}) 1866in a row) will override this check and the editor will exit, 1867ignoring any files that have not yet been edited. 1868@sp 1 1869The 1870@CO{wn} 1871version of the write command will move to the next file after writing 1872the file, unless the write fails. 1873@table @asis 1874@item Line: 1875Unchanged. 1876@item Options: 1877Affected by the 1878@OP{readonly} 1879and 1880@OP{writeany} 1881options. 1882@end table 1883@end deftypefn 1884@cindex xit 1885@deftypefn Command {[range]} {x[it][!]} {[file]} 1886 1887Write the file if it has been modified. 1888The specified lines are written to 1889@LI{file}, 1890if the file has been modified since the last complete write to any 1891file. 1892If no 1893@LI{range}is specified, the entire file is written. 1894@sp 1 1895The 1896@CO{xit} 1897command will exit the editor after writing the file, 1898if there are no further files to edit. 1899Appending a 1900@QT{!} 1901character to the command name or entering two 1902@QQ{quit} 1903commands (i.e. 1904@CO{wq}, 1905@CO{quit}, 1906@CO{xit} 1907or 1908@CO{ZZ}) 1909in a row) will override this check and the editor will exit, 1910ignoring any files that have not yet been edited. 1911@table @asis 1912@item Line: 1913Unchanged. 1914@item Options: 1915Affected by the 1916@OP{readonly} 1917and 1918@OP{writeany} 1919options. 1920@end table 1921@end deftypefn 1922@cindex yank 1923@deftypefn Command {[range]} {ya[nk]} {[buffer] [count]} 1924 1925Copy the specified lines to a buffer. 1926If no buffer is specified, the unnamed buffer is used. 1927@table @asis 1928@item Line: 1929Unchanged. 1930@item Options: 1931None. 1932@end table 1933@end deftypefn 1934@cindex z 1935@deftypefn Command {[line]} {z} {[type] [count] [flags]} 1936 1937Adjust the window. 1938If no 1939@LI{type}is specified, then 1940@LI{count}lines following the specified line are displayed. 1941The default 1942@LI{count}is the value of the 1943@OP{window} 1944option. 1945The 1946@LI{type}argument changes the position at which 1947@LI{line}is displayed on the screen by changing the number of lines 1948displayed before and after 1949@LI{line}. 1950The following 1951@LI{type}characters may be used: 1952@table @asis 1953@item - 1954Place the line at the bottom of the screen. 1955@item + 1956Place the line at the top of the screen. 1957@item . 1958Place the line in the middle of the screen. 1959@item ^ 1960Write out count lines starting 1961@LI{count * 2}lines before 1962@LI{line}; 1963the net effect of this is that a 1964@QT{z^} 1965command following a 1966@CO{z} 1967command writes the previous page. 1968@item = 1969Center 1970@LI{line}on the screen with a line of hyphens displayed immediately before and 1971after it. 1972The number of preceding and following lines of text displayed are 1973reduced to account for those lines. 1974@end table 1975@table @asis 1976@item Line: 1977Set to the last line displayed, with the exception of the 1978@QT{=} 1979@LI{type}, 1980where the current line is set to the line specified by the command. 1981@item Options: 1982Affected by the 1983@OP{scroll} 1984option. 1985@end table 1986@end deftypefn 1987