home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / riscbsd / 1_1_contri / usd / 15_vi / vi_summary < prev   
Encoding:
Text File  |  1986-05-30  |  9.8 KB  |  442 lines

  1. .\" Copyright (c) 1980 Regents of the University of California.
  2. .\" All rights reserved.  The Berkeley software License Agreement
  3. .\" specifies the terms and conditions for redistribution.
  4. .\"
  5. .\"    @(#)vi.summary    6.1 (Berkeley) 5/30/86
  6. .\"
  7. .ds CH
  8. .ds CF
  9. .de TS
  10. .br
  11. .if !\\n(1T .RT
  12. .ul 0
  13. .ti \\n(.iu
  14. .if t .sp 0.25
  15. .if n .sp
  16. .if \\$1H .TQ
  17. .nr IX 1
  18. ..
  19. .nr PS 9
  20. .ps 9
  21. .nr VS 11
  22. .vs 11
  23. .nr HM .50i
  24. .nr FM .25i
  25. .nr PO 0
  26. .po 0
  27. .nr LL 3.5i
  28. .ll 3.5i
  29. .de nc
  30. .bp
  31. ..
  32. .de h
  33. .LG
  34. .B
  35. \\$1
  36. .R
  37. .NL
  38. ..
  39. .LG
  40. .LG
  41. .B
  42. .ce
  43. Ex Quick Reference
  44. .R
  45. .NL
  46. .LP
  47. .LP
  48. .h "Entering/leaving ex"
  49. .TS
  50. aw(1.4i)b aw(1.8i).
  51. % ex \fIname\fP    edit \fIname\fP, start at end
  52. % ex +\fIn\fP \fIname\fP    ... at line \fIn\fP
  53. % ex \-t \fItag\fP    start at \fItag\fP
  54. % ex \-r    list saved files
  55. % ex \-r \fIname\fP    recover file \fIname\fP
  56. % ex \fIname\fP ...    edit first; rest via \fB:n\fP
  57. % ex \-R \fIname\fP     read only mode
  58. : x    exit, saving changes
  59. : q!    exit, discarding changes
  60. .TE
  61. .h "Ex states"
  62. .TS
  63. lw(1i) lw(2.0i).
  64. Command    T{
  65. Normal and initial state.  Input prompted for by \fB:\fP.
  66. Your kill character cancels partial command.
  67. T}
  68. Insert    T{
  69. Entered by \fBa\fP \fBi\fP and \fBc\fP.
  70. Arbitrary text then terminates with line having only \fB.\fP
  71. character on it or abnormally with interrupt.
  72. T}
  73. Open/visual    T{
  74. Entered by \fBopen\fP or \fBvi\fP, terminates with \fBQ\fP
  75. or ^\e.
  76. T}
  77. .TE
  78. .h "Ex commands"
  79. .TS
  80. lw(.45i) lw(.08i)b lw(.45i) lw(.08i)b lw(.45i) lw(.08i)b.
  81. abbrev    ab    next    n    unabbrev    una
  82. append    a    number    nu    undo    u
  83. args    ar    open    o    unmap    unm
  84. change    c    preserve    pre    version    ve
  85. copy    co    print    p    visual    vi
  86. delete    d    put    pu    write    w
  87. edit    e    quit    q    xit    x
  88. file    f    read    re    yank    ya
  89. global    g    recover    rec    \fIwindow\fP    z
  90. insert    i    rewind    rew    \fIescape\fP    !
  91. join    j    set    se    \fIlshift\fP    <
  92. list    l    shell    sh    \fIprint next\fP    \fRCR\fP
  93. map        source    so    \fIresubst\fP    &
  94. mark    ma    stop    st    \fIrshift\fP    >
  95. move    m    substitute    s    \fIscroll\fP    ^D
  96. .TE
  97. .h "Ex command addresses"
  98. .TS
  99. lw(.3i)b lw(0.8i) lw(.3i)b lw(0.8i).
  100. \fIn\fP    line \fIn\fP    /\fIpat\fP    next with \fIpat\fP
  101. \&.    current    ?\fIpat\fP    previous with \fIpat\fP
  102. $    last    \fIx\fP-\fIn\fP    \fIn\fP before \fIx\fP
  103. +    next    \fIx\fP,\fIy\fP    \fIx\fP through \fIy\fP
  104. \-    previous    \(aa\fIx\fP    marked with \fIx\fP
  105. +\fIn\fP    \fIn\fP forward    \(aa\(aa    previous context
  106. %    1,$
  107. .TE
  108. .nc
  109. .h "Specifying terminal type"
  110. .TS
  111. aw(1.7i)b aw(1.5i).
  112. % setenv TERM \fItype\fP    \fIcsh\fP and all version 6
  113. $ TERM=\fItype\fP; export TERM    \fIsh\fP in Version 7
  114. See also \fItset\fR(1)
  115. .TE
  116. .h "Some terminal types"
  117. .TS
  118. lw(.4i) lw(.4i) lw(.4i) lw(.4i) lw(.4i).
  119. 2621    43    adm31    dw1    h19
  120. 2645    733    adm3a    dw2    i100
  121. 300s    745    c100    gt40    mime
  122. 33    act4    dm1520    gt42    owl
  123. 37    act5    dm2500    h1500    t1061
  124. 4014    adm3    dm3025    h1510    vt52
  125. .TE
  126. .h "Initializing options"
  127. .TS
  128. lw(.9i)b aw(1.5i).
  129. EXINIT    place \fBset\fP's here in environment var.
  130. set \fIx\fP    enable option
  131. set no\fIx\fP    disable option
  132. set \fIx\fP=\fIval\fP    give value \fIval\fP
  133. set    show changed options
  134. set all    show all options
  135. set \fIx\fP?    show value of option \fIx\fP
  136. .TE
  137. .h "Useful options"
  138. .TS
  139. lw(.9i)b lw(.3i) lw(1.0i).
  140. autoindent    ai    supply indent
  141. autowrite    aw    write before changing files
  142. ignorecase    ic    in scanning
  143. lisp        \fB( ) { }\fP are s-exp's
  144. list        print ^I for tab, $ at end
  145. magic        \fB. [ *\fP special in patterns
  146. number    nu    number lines
  147. paragraphs    para    macro names which start ...
  148. redraw        simulate smart terminal
  149. scroll        command mode lines
  150. sections    sect    macro names ...
  151. shiftwidth    sw    for \fB< >\fP, and input \fB^D\fP
  152. showmatch    sm    to \fB)\fP and \fB}\fP as typed
  153. slowopen    slow    choke updates during insert
  154. window        visual mode lines
  155. wrapscan    ws    around end of buffer?
  156. wrapmargin    wm    automatic line splitting
  157. .TE
  158. .LP
  159. .h "Scanning pattern formation"
  160. .TS
  161. aw(.9i)b aw(1.0i).
  162. \(ua    beginning of line
  163. $    end of line
  164. \fB.\fR    any character
  165. \e<    beginning of word
  166. \e>    end of word
  167. [\fIstr\fP]    any char in \fIstr\fP
  168. [\(ua\fIstr\fP]    ... not in \fIstr\fP
  169. [\fIx\-y\fP]    ... between \fIx\fP and \fIy\fP
  170. *    any number of preceding
  171. .TE
  172. .nc
  173. .LP
  174. .LG
  175. .LG
  176. .B
  177. .ce
  178. Vi Quick Reference
  179. .NL
  180. .R
  181. .LP
  182. .LP
  183. .h "Entering/leaving vi"
  184. .TS
  185. aw(1.4i)b aw(1.8i).
  186. % vi \fIname\fP    edit \fIname\fP at top
  187. % vi +\fIn\fP \fIname\fP    ... at line \fIn\fP
  188. % vi + \fIname\fP    ... at end
  189. % vi \-r    list saved files
  190. % vi \-r \fIname\fP    recover file \fIname\fP
  191. % vi \fIname\fP ...    edit first; rest via \fB:n\fP
  192. % vi \-t \fItag\fP    start at \fItag\fP
  193. % vi +/\fIpat\fP \fIname\fP    search for \fIpat\fP
  194. % view \fIname\fP    read only mode
  195. ZZ    exit from vi, saving changes
  196. ^Z    stop vi for later resumption
  197. .TE
  198. .h "The display"
  199. .TS
  200. lw(.75i) lw(2.2i).
  201. Last line    T{
  202. Error messages, echoing input to \fB: / ?\fP and \fB!\fR,
  203. feedback about i/o and large changes.
  204. T}
  205. @ lines    On screen only, not in file.
  206. ~ lines    Lines past end of file.
  207. ^\fIx\fP    Control characters, ^? is delete.
  208. tabs    Expand to spaces, cursor at last.
  209. .TE
  210. .LP
  211. .h "Vi states"
  212. .TS
  213. lw(.75i) lw(2.2i).
  214. Command    T{
  215. Normal and initial state.  Others return here.
  216. ESC (escape) cancels partial command.
  217. T}
  218. Insert    T{
  219. Entered by \fBa i A I o O c C s S\fP \fBR\fP.
  220. Arbitrary text then terminates with ESC character,
  221. or abnormally with interrupt.
  222. T}
  223. Last line    T{
  224. Reading input for \fB: / ?\fP or \fB!\fP; terminate
  225. with ESC or CR to execute, interrupt to cancel.
  226. T}
  227. .TE
  228. .h "Counts before vi commands"
  229. .TS
  230. lw(1.5i) lw(1.7i)b.
  231. line/column number    z  G  |    
  232. scroll amount    ^D  ^U
  233. replicate insert    a  i  A  I
  234. repeat effect    \fRmost rest\fP
  235. .TE
  236. .h "Simple commands"
  237. .TS
  238. lw(1.5i)b lw(1.7i).
  239. dw    delete a word
  240. de    ... leaving punctuation
  241. dd    delete a line
  242. 3dd    ... 3 lines
  243. i\fItext\fP\fRESC\fP    insert text \fIabc\fP
  244. cw\fInew\fP\fRESC\fP    change word to \fInew\fP
  245. ea\fIs\fP\fRESC\fP    pluralize word
  246. xp    transpose characters
  247. .TE
  248. .nc
  249. .h "Interrupting, cancelling"
  250. .TS
  251. aw(0.75i)b aw(1.6i).
  252. ESC    end insert or incomplete cmd
  253. ^?    (delete or rubout) interrupts
  254. ^L    reprint screen if \fB^?\fR scrambles it
  255. .TE
  256. .h "File manipulation"
  257. .TS
  258. aw(0.75i)b aw(1.6i).
  259. :w    write back changes
  260. :wq    write and quit
  261. :q    quit
  262. :q!    quit, discard changes
  263. :e \fIname\fP    edit file \fIname\fP
  264. :e!    reedit, discard changes
  265. :e + \fIname\fP    edit, starting at end
  266. :e +\fIn\fR    edit starting at line \fIn\fR
  267. :e #    edit alternate file
  268. ^\(ua    synonym for \fB:e #\fP
  269. :w \fIname\fP    write file \fIname\fP
  270. :w! \fIname\fP    overwrite file \fIname\fP
  271. :sh    run shell, then return
  272. :!\fIcmd\fP    run \fIcmd\fR, then return
  273. :n    edit next file in arglist
  274. :n \fIargs\fP    specify new arglist
  275. :f    show current file and line
  276. ^G    synonym for \fB:f\fP
  277. :ta \fItag\fP    to tag file entry \fItag\fP
  278. ^]    \fB:ta\fP, following word is \fItag\fP
  279. .TE
  280. .h "Positioning within file"
  281. .TS
  282. aw(0.75i)b aw(1.6i).
  283. ^F    forward screenfull
  284. ^B    backward screenfull
  285. ^D    scroll down half screen
  286. ^U    scroll up half screen
  287. G    goto line (end default)
  288. /\fIpat\fR    next line matching \fIpat\fR
  289. ?\fIpat\fR    prev line matching \fIpat\fR
  290. n    repeat last \fB/\fR or \fB?\fR
  291. N    reverse last \fB/\fR or \fB?\fR
  292. /\fIpat\fP/+\fIn\fP    n'th line after \fIpat\fR
  293. ?\fIpat\fP?\-\fIn\fP    n'th line before \fIpat\fR
  294. ]]    next section/function
  295. [[    previous section/function
  296. %    find matching \fB( ) {\fP or \fB}\fP
  297. .TE
  298. .h "Adjusting the screen"
  299. .TS
  300. aw(0.75i)b aw(1.6i).
  301. ^L    clear and redraw
  302. ^R    retype, eliminate @ lines
  303. z\fRCR\fP    redraw, current at window top
  304. z\-    ... at bottom
  305. z\|.    ... at center
  306. /\fIpat\fP/z\-    \fIpat\fP line at bottom
  307. z\fIn\fP\|.    use \fIn\fP line window
  308. ^E    scroll window down 1 line
  309. ^Y    scroll window up 1 line
  310. .TE
  311. .nc
  312. .h "Marking and returning
  313. .TS
  314. aw(0.5i)b aw(2.0i).
  315. \(ga\(ga    previous context
  316. \(aa\(aa    ... at first non-white in line
  317. m\fIx\fP    mark position with letter \fIx\fP
  318. \(ga\fIx\fP    to mark \fIx\fP
  319. \(aa\fIx\fP    ... at first non-white in line
  320. .TE
  321. .h "Line positioning"
  322. .TS
  323. aw(0.5i)b aw(2.0i).
  324. H    home window line
  325. L    last window line
  326. M    middle window line
  327. +    next line, at first non-white
  328. \-    previous line, at first non-white
  329. \fRCR\fP    return, same as +
  330. \(da \fRor\fP j    next line, same column
  331. \(ua \fRor\fP k    previous line, same column
  332. .TE
  333. .h "Character positioning"
  334. .TS
  335. aw(0.5i)b aw(2.0i).
  336. \(ua    first non white
  337. 0    beginning of line
  338. $    end of line
  339. h \fRor\fP \(->    forward
  340. l \fRor\fP \(<-    backwards
  341. ^H    same as \fB\(<-\fP
  342. \fRspace\fP    same as \fB\(->\fP
  343. f\fIx\fP    find \fIx\fP forward
  344. F\fIx\fP    \fBf\fR backward
  345. t\fIx\fP    upto \fIx\fP forward
  346. T\fIx\fP    back upto \fIx\fP
  347. ;    repeat last \fBf F t\fP or \fBT\fP
  348. ,    inverse of \fB;\fP
  349. |    to specified column
  350. %    find matching \fB( { )\fP or \fB}\fR
  351. .TE
  352. .h "Words, sentences, paragraphs"
  353. .TS
  354. aw(0.5i)b aw(2.0i).
  355. w    word forward
  356. b    back word
  357. e    end of word
  358. )    to next sentence
  359. }    to next paragraph
  360. (    back sentence
  361. {    back paragraph
  362. W    blank delimited word
  363. B    back \fBW\fP
  364. E    to end of \fBW\fP
  365. .TE
  366. .h "Commands for \s-2LISP\s0"
  367. .TS
  368. aw(0.5i)b aw(2.0i).
  369. )    Forward s-expression
  370. }    ... but don't stop at atoms
  371. (    Back s-expression
  372. {    ... but don't stop at atoms
  373. .TE
  374. .nc
  375. .h "Corrections during insert"
  376. .TS
  377. aw(.5i)b aw(2.0i).
  378. ^H    erase last character
  379. ^W    erases last word
  380. \fRerase\fP    your erase, same as \fB^H\fP
  381. \fRkill\fP    your kill, erase input this line
  382. \e    escapes \fB^H\fR, your erase and kill
  383. \fRESC\fP    ends insertion, back to command
  384. ^?    interrupt, terminates insert
  385. ^D    backtab over \fIautoindent\fP
  386. \(ua^D    kill \fIautoindent\fP, save for next
  387. 0^D    ... but at margin next also
  388. ^V    quote non-printing character
  389. .TE
  390. .h "Insert and replace"
  391. .TS
  392. aw(.5i)b aw(2.0i).
  393. a    append after cursor
  394. i    insert before
  395. A    append at end of line
  396. I    insert before first non-blank
  397. o    open line below
  398. O    open above
  399. r\fIx\fP    replace single char with \fIx\fP
  400. R    replace characters
  401. .TE
  402. .h "Operators (double to affect lines)"
  403. .TS
  404. aw(0.5i)b aw(2.0i).
  405. d    delete
  406. c    change
  407. <    left shift
  408. >    right shift
  409. !    filter through command
  410. \&\=    indent for \s-2LISP\s0
  411. y    yank lines to buffer
  412. .TE
  413. .h "Miscellaneous operations"
  414. .TS
  415. aw(0.5i)b aw(2.0i).
  416. C    change rest of line
  417. D    delete rest of line
  418. s    substitute chars
  419. S    substitute lines
  420. J    join lines
  421. x    delete characters
  422. X    ... before cursor
  423. Y    yank lines
  424. .TE
  425. .h "Yank and put"
  426. .TS
  427. aw(0.5i)b aw(2.0i).
  428. p    put back lines
  429. P    put before
  430. "\fIx\fPp    put from buffer \fIx\fP
  431. "\fIx\fPy    yank to buffer \fIx\fP
  432. "\fIx\fPd    delete into buffer \fIx\fP
  433. .TE
  434. .h "Undo, redo, retrieve"
  435. .TS
  436. aw(0.5i)b aw(2.0i).
  437. u    undo last change
  438. U    restore current line
  439. \fB.\fP    repeat last change
  440. "\fId\fP\|p    retrieve \fId\fP'th last delete
  441. .TE
  442.