


          EExx QQuuiicckk RReeffeerreennccee    


          EEnntteerriinngg//lleeaavviinngg eexx

           %% eexx _n_a_m_e         edit _n_a_m_e, start at end
           %% eexx ++_n _n_a_m_e      ... at line _n
           %% eexx --tt _t_a_g       start at _t_a_g
           %% eexx --rr           list saved files
           %% eexx --rr _n_a_m_e      recover file _n_a_m_e
           %% eexx _n_a_m_e ......     edit first; rest via ::nn
           %% eexx --RR _n_a_m_e      read only mode
           :: xx               exit, saving changes
           :: qq!!              exit, discarding changes

          EExx ssttaatteess

          Command       Normal  and  initial
                        state.         Input
                        prompted  for  by ::.
                        Your kill  character
                        cancels partial com-
                        mand.
          Insert        Entered by aa  ii  and
                        cc.   Arbitrary  text
                        then terminates with
                        line  having  only ..
                        character on  it  or
                        abnormally      with
                        interrupt.
          Open/visual   Entered by  ooppeenn  or
                        vvii,  terminates with
                        QQ or ^\.

          EExx ccoommmmaannddss

          abbrev   aabb   next         nn     unabbrev     uunnaa
          append   aa    number       nnuu    undo         uu
          args     aarr   open         oo     unmap        uunnmm
          change   cc    preserve     pprree   version      vvee
          copy     ccoo   print        pp     visual       vvii
          delete   dd    put          ppuu    write        ww
          edit     ee    quit         qq     xit          xx
          file     ff    read         rree    yank         yyaa
          global   gg    recover      rreecc   _w_i_n_d_o_w       zz
          insert   ii    rewind       rreeww   _e_s_c_a_p_e       !!
          join     jj    set          ssee    _l_s_h_i_f_t       <<
          list     ll    shell        sshh    _p_r_i_n_t _n_e_x_t   CR
          map           source       ssoo    _r_e_s_u_b_s_t      &&
          mark     mmaa   stop         sstt    _r_s_h_i_f_t       >>
          move     mm    substitute   ss     _s_c_r_o_l_l       ^^DD

          EExx ccoommmmaanndd aaddddrreesssseess

          _n     line _n      //_p_a_t   next with _p_a_t
          ..     current     ??_p_a_t   previous with _p_a_t
          $$     last        _x--_n    _n before _x
          ++     next        _x,,_y    _x through _y
          --     previous    ''_x     marked with _x
          ++_n    _n forward   ''''     previous context
          %%     1,$





          SSppeecciiffyyiinngg tteerrmmiinnaall ttyyppee

           %% sseetteennvv TTEERRMM _t_y_p_e           _c_s_h and all version 6
           $$ TTEERRMM==_t_y_p_e;; eexxppoorrtt TTEERRMM     _s_h in Version 7
           SSeeee aallssoo _t_s_e_t(1)

          SSoommee tteerrmmiinnaall ttyyppeess

          2621   43     adm31    dw1     h19
          2645   733    adm3a    dw2     i100
          300s   745    c100     gt40    mime
          33     act4   dm1520   gt42    owl
          37     act5   dm2500   h1500   t1061
          4014   adm3   dm3025   h1510   vt52

          IInniittiiaalliizziinngg ooppttiioonnss

          EEXXIINNIITT       place sseett's here in environment var.
          sseett _x        enable option
          sseett nnoo_x      disable option
          sseett _x==_v_a_l    give value _v_a_l
          sseett          show changed options
          sseett aallll      show all options
          sseett _x??       show value of option _x

          UUsseeffuull ooppttiioonnss

          aauuttooiinnddeenntt   ai     supply indent
          aauuttoowwrriittee    aw     write before changing files
          iiggnnoorreeccaassee   ic     in scanning
          lliisspp                (( )) {{ }} are s-exp's
          lliisstt                print ^I for tab, $ at end
          mmaaggiicc               .. [[ ** special in patterns
          nnuummbbeerr       nu     number lines
          ppaarraaggrraapphhss   para   macro names which start ...
          rreeddrraaww              simulate smart terminal
          ssccrroollll              command mode lines
          sseeccttiioonnss     sect   macro names ...
          sshhiiffttwwiiddtthh   sw     for << >>, and input ^^DD
          sshhoowwmmaattcchh    sm     to )) and }} as typed
          sslloowwooppeenn     slow   choke updates during insert
          wwiinnddooww              visual mode lines
          wwrraappssccaann     ws     around end of buffer?
          wwrraappmmaarrggiinn   wm     automatic line splitting


          SSccaannnniinngg ppaatttteerrnn ffoorrmmaattiioonn

                       beginning of line
            $$          end of line
            ..          any character
            \\<<         beginning of word
            \\>>         end of word
            [[_s_t_r]]      any char in _s_t_r
            [[_s_t_r]]      ... not in _s_t_r
            [[_x_-_y]]      ... between _x and _y
            **          any number of preceding









                       VVii QQuuiicckk RReeffeerreennccee


          EEnntteerriinngg//lleeaavviinngg vvii

           %% vvii _n_a_m_e           edit _n_a_m_e at top
           %% vvii ++_n _n_a_m_e        ... at line _n
           %% vvii ++ _n_a_m_e         ... at end
           %% vvii --rr             list saved files
           %% vvii --rr _n_a_m_e        recover file _n_a_m_e
           %% vvii _n_a_m_e ......       edit first; rest via ::nn
           %% vvii --tt _t_a_g         start at _t_a_g
           %% vvii ++//_p_a_t _n_a_m_e     search for _p_a_t
           %% vviieeww _n_a_m_e         read only mode
           ZZZZ                  exit from vi, saving changes
           ^^ZZ                  stop vi for later resumption

          TThhee ddiissppllaayy

          Last line   Error messages, echoing input  to
                      ::  //  ?? and !!, feedback about i/o
                      and large changes.
          @ lines     On screen only, not in file.
          ~ lines     Lines past end of file.
          ^_x          Control characters, ^? is delete.
          tabs        Expand to spaces, cursor at last.


          VVii ssttaatteess

          Command     Normal   and   initial
                      state.   Others return
                      here.   ESC   (escape)
                      cancels  partial  com-
                      mand.
          Insert      Entered by aa ii AA II oo OO
                      cc  CC ss SS RR.  Arbitrary
                      text  then  terminates
                      with ESC character, or
                      abnormally with inter-
                      rupt.
          Last line   Reading  input for :: //
                      ?? or !!; terminate with
                      ESC  or CR to execute,
                      interrupt to cancel.

          CCoouunnttss bbeeffoorree vvii ccoommmmaannddss

          line/column number   zz  GG  ||
          scroll amount        ^^DD  ^^UU
          replicate insert     aa  ii  AA  II
          repeat effect        most rest

          SSiimmppllee ccoommmmaannddss

          ddww                delete a word
          ddee                ... leaving punctuation
          dddd                delete a line
          33dddd               ... 3 lines
          ii_t_e_x_tESC          insert text _a_b_c
          ccww_n_e_wESC          change word to _n_e_w





          eeaa_sESC            pluralize word
          xxpp                transpose characters
































































          IInntteerrrruuppttiinngg,, ccaanncceelllliinngg

            EESSCC      end insert or incomplete cmd
            ^^??       (delete or rubout) interrupts
            ^^LL       reprint screen if ^^?? scrambles it

          FFiillee mmaanniippuullaattiioonn

           ::ww            write back changes
           ::wwqq           write and quit
           ::qq            quit
           ::qq!!           quit, discard changes
           ::ee _n_a_m_e       edit file _n_a_m_e
           ::ee!!           reedit, discard changes
           ::ee ++ _n_a_m_e     edit, starting at end
           ::ee ++_n         edit starting at line _n
           ::ee ##          edit alternate file
           ^^             synonym for ::ee ##
           ::ww _n_a_m_e       write file _n_a_m_e
           ::ww!! _n_a_m_e      overwrite file _n_a_m_e
           ::sshh           run shell, then return
           ::!!_c_m_d         run _c_m_d, then return
           ::nn            edit next file in arglist
           ::nn _a_r_g_s       specify new arglist
           ::ff            show current file and line
           ^^GG            synonym for ::ff
           ::ttaa _t_a_g       to tag file entry _t_a_g
           ^^]]            ::ttaa, following word is _t_a_g

          PPoossiittiioonniinngg wwiitthhiinn ffiillee

           ^^FF          forward screenfull
           ^^BB          backward screenfull
           ^^DD          scroll down half screen
           ^^UU          scroll up half screen
           GG           goto line (end default)
           //_p_a_t        next line matching _p_a_t
           ??_p_a_t        prev line matching _p_a_t
           nn           repeat last // or ??
           NN           reverse last // or ??
           //_p_a_t//++_n     n'th line after _p_a_t
           ??_p_a_t??--_n     n'th line before _p_a_t
           ]]]]          next section/function
           [[[[          previous section/function
           %%           find matching (( )) {{ or }}

          AAddjjuussttiinngg tthhee ssccrreeeenn

           ^^LL          clear and redraw
           ^^RR          retype, eliminate @ lines
           zzCR         redraw, current at window top
           zz--          ... at bottom
           zz..          ... at center
           //_p_a_t//zz--     _p_a_t line at bottom
           zz_n..         use _n line window
           ^^EE          scroll window down 1 line
           ^^YY          scroll window up 1 line









          MMaarrkkiinngg aanndd rreettuurrnniinngg

           ````      previous context
           ''''      ... at first non-white in line
           mm_x      mark position with letter _x
           ``_x      to mark _x
           ''_x      ... at first non-white in line

          LLiinnee ppoossiittiioonniinngg

           HH         home window line
           LL         last window line
           MM         middle window line
           ++         next line, at first non-white
           --         previous line, at first non-white
           CR        return, same as +
            or jj     next line, same column
            or kk     previous line, same column

          CChhaarraacctteerr ppoossiittiioonniinngg

                       first non white
           00           beginning of line
           $$           end of line
           hh or -->>     forward
           ll or <<--     backwards
           ^^HH          same as <<--
           space       same as -->>
           ff_x          find _x forward
           FF_x          ff backward
           tt_x          upto _x forward
           TT_x          back upto _x
           ;;           repeat last ff FF tt or TT
           ,,           inverse of ;;
           ||           to specified column
           %%           find matching (( {{ )) or }}

          WWoorrddss,, sseenntteenncceess,, ppaarraaggrraapphhss

            ww      word forward
            bb      back word
            ee      end of word
            ))      to next sentence
            }}      to next paragraph
            ((      back sentence
            {{      back paragraph
            WW      blank delimited word
            BB      back WW
            EE      to end of WW

          CCoommmmaannddss ffoorr LLIISSPP

            ))      Forward s-expression
            }}      ... but don't stop at atoms
            ((      Back s-expression
            {{      ... but don't stop at atoms










          CCoorrrreeccttiioonnss dduurriinngg iinnsseerrtt

           ^^HH        erase last character
           ^^WW        erases last word
           erase     your erase, same as ^^HH
           kill      your kill, erase input this line
           \\         escapes ^^HH, your erase and kill
           ESC       ends insertion, back to command
           ^^??        interrupt, terminates insert
           ^^DD        backtab over _a_u_t_o_i_n_d_e_n_t
           ^^DD        kill _a_u_t_o_i_n_d_e_n_t, save for next
           00^^DD       ... but at margin next also
           ^^VV        quote non-printing character

          IInnsseerrtt aanndd rreeppllaaccee

           aa       append after cursor
           ii       insert before
           AA       append at end of line
           II       insert before first non-blank
           oo       open line below
           OO       open above
           rr_x      replace single char with _x
           RR       replace characters

          OOppeerraattoorrss ((ddoouubbllee ttoo aaffffeecctt lliinneess))

            dd      delete
            cc      change
            <<      left shift
            >>      right shift
            !!      filter through command
            ==      indent for LISP
            yy      yank lines to buffer

          MMiisscceellllaanneeoouuss ooppeerraattiioonnss

            CC      change rest of line
            DD      delete rest of line
            ss      substitute chars
            SS      substitute lines
            JJ      join lines
            xx      delete characters
            XX      ... before cursor
            YY      yank lines

          YYaannkk aanndd ppuutt

           pp       put back lines
           PP       put before
           ""_xpp     put from buffer _x
           ""_xyy     yank to buffer _x
           ""_xdd     delete into buffer _x

          UUnnddoo,, rreeddoo,, rreettrriieevvee

           uu       undo last change
           UU       restore current line
           ..       repeat last change
           ""_dpp     retrieve _d'th last delete



