TEACH VEDNOTES                                 Aaron Sloman  30 Sep 1998

This is a set of notes on the most frequently required VED commands. See
HELP LOGICAL_KEYS, for information on VED function names. The file
TEACH USEFULKEYS gives a more elementary introduction, and is not as
comprehensive as this file.

CONTENTS - (Use <ENTER> g to access required sections)

 -- There are several ways of controlling VED
 -- ENTER COMMANDS AND KEYBOARD COMMANDS
 -- File and window management
 -- Search and substitute
 -- -- Caseless search
 -- -- Searching for a named procedure
 -- Move the ved cursor
 -- -- Going to a specified line:
 -- -- Keyboard move sequences
 -- Stacked positions
 -- Marked range facilities
 -- Common Key Sequences
 -- Deleting text
 -- -- ^K (Control-K) delete sequences
 -- -- ^W, ^U shortcuts
 -- Help facilities
 -- Miscellaneous utilities
 -- Reading or sending mail
 -- Local to Birmingham

-- There are several ways of controlling VED --------------------------

1. Via ENTER commands: press the ENTER key (or Control G) then type the
command, then press RETURN. Warning: on some terminals (HP and PC) the
RETURN key (part of the main keyboard) is labelled ENTER. This is not
the real ENTER key, which is on the RIGHT hand edge, except on a Sun3,
when it is L10. There are very many ENTER commands available. Some are
shown below, many others in REF VEDCOMMS, HELP VEDSEARCH and a lot more
in other files. You can define your own ENTER commands when fluent in
Pop-11.

2. Using Function keys: We have produced a graphical keymap which should
work with most terminals running the X window system, as currently set
up at Birmingham for Poplog users. (If these facilities don't work you
may need to have your .Xdefaults file or your vedinit.p file fixed.)

    See HELP XTERMKEYS

Should work on PCs, Suns, DEC Alphas.

3. Using keyboard short cuts based on Control keys and Escape sequences
as described below. A complete overview of the basic functions can
be found in
    HELP VEDKEYS
You can define your own keyboard short cuts, when fluent in Pop-11, by
editing your vedinit.p file. See HELP VEDSET, HELP VEDSETKEY

4. Using VED menus (invoked via the "ENTER menu" command).

5. Using XVed. This takes longer to start up than "plain" VED, but
provides a separate window for each file, and has other facilities based
on the mouse. To run XVed you can type "xved" "xved <filename>" or
"pop11 %x" to Unix. You can limit the number of wnidows XVed creates by
putting something like this in your .Xdefaults file
    XVed*MaxWindows: 6
(This will not limit the number of files you can have in the editor.)
See TEACH XVED, HELP XVED, REF XVED


-- ENTER COMMANDS AND KEYBOARD COMMANDS
Note concerning instructions of the form: "^A"
    This means HOLD "CTRL" or "Control" button down WHILE pressing key A

Note concerning instructions of the form: "ESC a"
    This means press AND RELEASE ESC key BEFORE pressing A key

-- File and window management -----------------------------------------

ENTER ved <file>                    ENTER name <file>
    Get the file into VED               Change current file to new name

ENTER r <file>                          ENTER rb
    Merge <file> contents from disk         "Rotate" buffers - if done
    into current file.                      repeatedly you see all buffers

ENTER q                                 ENTER bye or ENTER xx
    Quit current file. (Also ESC q)         Exit VED and Poplog
    If file changed, asks for
    confirmation

ENTER wq                                ENTER wqved <file>
    Write, then quit current file           Write and quit then VED <file>

ENTER deletefile                        ENTER cleanup
    Delete the file from VED and            Delete VED's "backup" versions
    from the disk                           of the current file.

ENTER w                                 ENTER w1
    Writes (saves) all current              Saves only the current file
    files on the disk

ENTER wr <file>                         ENTER autosave 5
    Writes the marked range to              Change autosave interval to 5
    the disk, in new <file>                 minutes

ENTER dired <pattern>                   ENTER purgefiles <pattern>
    Can be used to browse sets of       ENTER purgefiles
    files. See HELP DIRED                   delete files matching pattern
                                            but show them first.

^L     refresh window                   ESC w  set window size
ESC x  Switch to previous window            (not used in XVED)

ESC V  Scroll other file up             ESC ^V  Scroll other file down
   (Also ENTER xup)                         (Also ENTER xdn)
ESC e (get menu of current files)       ESC q  Quit this file

ESC F  filecomplete (complete name of file left of cursor)
    (Also ESC 3 in some installations.)

ENTER pwd                               ENTER files
    Print Working Directory                 List files currently in VED

-- Search and substitute ----------------------------------------------

In the examples the string can be any sequence of characters. To end
with a space, repeat the "delimiter" after the space. See HELP VEDSEARCH

ENTER /string                           ENTER "string
ENTER \string                           ENTER `string
    Search forward or backward              Search forward or backward for
    for the string                          the string, non-embedded

ENTER /                                 ENTER \
ESC   /                                 ESC   \
    Redo last search, forward               Redo last search, backward

Search patterns can include @a (start of line), @z (end of line) @? any
character. See HELP VEDSEARCH and TEACH REGEXP for more on patterns.

ENTER s/string1/string2/                ENTER gs/string1/string2/
ENTER s"string1"string2"                ENTER gs"string1"string2"
    Interactive search and replace.         Global search and replace in
    Using " ignores embedded strings.       file. " means non-embedded

ENTER gsr/string1/string2               ENTER gsl/string1/string2
ENTER gsr"string1"string2               ENTER gsl"string1"string2
    Global search and replace in            Global search and replace in
    marked range                            current line

Add "s" in front of global commands to make them "silent" or "swift",
e.g.

    ENTER sgs, ENTER sgsr,

-- -- Caseless search

ENTER ss string                         ENTER bss string
    Search forward for string               Search backward for string
    ignoring case                           ignoring case

ENTER ww string                         ENTER bww string
    Search for non-embedded string          Search back for non-embedded
    i.e. "word"                             string

-- -- Searching for a named procedure

ENTER f name
    Search for procedure called name defined in the current file

-- Move the ved cursor ------------------------------------------------

-- -- Going to a specified line:

ENTER 23                                ENTER @a
ENTER 2                                 ENTER @z
    Go to line 23, or line 2                Go to beginning or end of file

ENTER @+5                               ENTER @m
ENTER @-5                               ENTER @e
    Go forward, backward 5 lines            Go to start or end of range

-- -- Keyboard move sequences

^P   charuP (Move up)                   ESC ^P   charuPlots
^N   chardowN                           ESC ^N   chardowNlots
^B   charleft (Backwards)               ESC ^B   charleftlots
^F   charright                          ESC ^F   charrightlots
^H  (BackSpace)
    charleft or delete current character.
^A   screenleft                         ^E  textright

ESC b  wordleft                         ESC <  topfile
ESC f  wordright                        ESC >  endfile

ESC v  screenup                         ESC g  markfind Goto range start
^V     screendown                       ESC G  endrange Goto range end

^A     screenleft                      ^E  textright
ESC ^E  screenright                     ESC ^A  textleft
LF (^J) Next line then left

-- Stacked positions --------------------------------------------------

ESC p                                   ESC P
    Save current position (pushkey)         Restore stacked position

ESC s
    Swap current and stacked position

See also ved_cut, and HELP VEDBLOCKS (manipulation of text blocks)

-- Marked range facilities --------------------------------------------

F1 (or ESC m)                           F2 (or ESC M)
    Mark start of range                     Mark end of range
    (Also use CTRL and middle mouse button in XVED)

ENTER d                                 ENTER t
    Delete marked range                     Transcribe (copy) marked range
ENTER y                                 ENTER m
    Yank back last deleted range.           Move marked range
ENTER mi                                ENTER ti
    Move range In - from other file         Transcribe/copy range In
ENTER mo                                ENTER to
    Move range Out - to other file          Transcribe/copy range Out
ENTER smr                               ENTER crm
    Sort range in alphabetical order        Clear range mark
ENTER mbe                               ENTER mbf
    Mark this file Beginning to End.        Mark from beginning of file.
ENTER mcp                               ENTER mcm
    Mark whole of current procedure.        Mark Current Message
ENTER tidy                              ENTER jcp
    Tidy marked range in program file       Justify Current Procedure
ENTER j                                 ENTER jj
    Justify range-program or text file      Right aline marked range
ESC j                                   ESC J
    Justify current para/procedure          Right aline current para

ENTER imr                               ENTER wrapmr
    Indent marked range                     Break long lines in range

ENTER lmr  (or ^D)                      ENTER lcp  (or ESC c)
    Load compile a marked range             Load Current Procedure

ENTER ltl
ESC d Load this line (loadline)

See also HELP MARK, HELP VED_BC, VED_BR, VED_BL,

-- Common Key Sequences -----------------------------------------------

(See keyboard maps for function keys)

^C  interrupt processing                ^G  - the same as ENTER
ESC RETURN  Re-do last command          ESC ^G  switch status/buffer

ESC o  lineabove                        ESC O  linebelow
                                           (Only on some terminals)
^T                                      ESC l
    Transpose chars left of cursor      ESC u
                                            Change word to lower/upper case
ESC .
    Change case of char under cursor

-- Deleting text ------------------------------------------------------

DEL or Delete Key delets char on left   ^R  dotdelete (del cuRrent char)
(Sometimes Backspace is also set to delete on left)

-- -- ^K (Control-K) delete sequences

(Undo by preceding ^ sequence with ESC)

^K ^B  wordleftdelete                   ^K ^F  wordrightdelete
^K ^A  clearhead                        ^K ^E  cleartail
^K ^K  linedelete                       ^K ^D  delete marked range
^K ^P                                   ESC ^K ^P
    ENTER cut: delete between stacked       ENTER splice: re-insert
    positions (See HELP ved_cut)            after cut

-- -- ^W, ^U shortcuts

   ^W  wordleftdelete                   ^U  clearhead

-- Help facilities ----------------------------------------------------

ESC h                                   ESC n
    Get help on word to right           ESC N
                                            Find next or previous asterisk
ESC k                                   ESC K
    Show function of next key               Show map for keyboard
                                            (Not reliable)
-- Miscellaneous utilities --------------------------------------------

ENTER cal, ENTER cal 95,                ENTER dounix
ENTER cal oct, ENTER cal jan 98             Do the unix shell command on
    Get a calendar                          current line in VED buffer

ENTER unix <command>                    ENTER vman
    Run the unix command, and get           Browser for Unix "man" files
    output into a temp file in VED          (Often quicker than "man")

For manipulating arbitrary blocks of text see HELP VEDBLOCKS

-- Reading or sending mail --------------------------------------------

(see HELP ved_getmail, HELP send -- Birmingham only)

ENTER getmail                           ENTER tmh   (See HELP VED_TMH)
    Get your latest mail file               Tidy mail header
    (With an index to it)

ENTER nm                                ENTER tah
ENTER lm                                    Tidy all mail headers
    Go to Next or Last (previous)           in current mail file
    message in this file

ENTER mergemail                         ENTER nextmail
    Merge current mail file with        ENTER prevmail
    previous one                            Get next or prev. mail file
ENTER mergemail N
    Merge N files with previous one

ENTER sendmr                            ENTER send
    Send marked range (must include         Send WHOLE file. Beware
    To: line.)

ENTER reply                             ENTER respond
ENTER Reply                             ENTER Respond
    Prepare reply to sender only            Prepare reply quoting original
    or to everyone                          message (to one, or to all0

ENTER mcm                               ENTER mdir
ENTER ccm                               ENTER gm
    Mark or clear (delete) current          Create index to current mail
    message                                 file. Goto Message.

ENTER purgemail                         ENTER spell
    Deletes backup mail messages            Check spelling of current file

-- Local to Birmingham ------------------------------------------------

Use SHOWLIB VED_<name> or HELP VED_<name>   to get more information

ENTER calc                              ENTER alias
    Compute value of expression         ENTER aliases
    to right of cursor and insert           Find email aliases

ENTER checkmail 120                     ENTER names <string>
    Check every 120 secs for new mail       Find password file entries
                                            containing <string?

ENTER gn    (See HELP VED_GN)           ENTER postnews
    Get News (for reading netnews)          Post news

ENTER latex   (See TEACH VED_LATEX)     ENTER xdvi
    For running latex, dvips                Run xdvi (Latex previewer)

ENTER latex print -Plw6                 ENTER latex print ps
    Print latex file on printer lw6         Save postscript version of file

ENTER psprint                           ENTER lpq
    For printing to postcript printer       Query printer status
    See also ENTER lpr, ENTER lp (HELP lpr, HELP lp)

ENTER mem  (See HELP VEDMEMFILE)        ENTER gomem
    Remember file and location              Go to remembered file

ENTER mli,  ENTER mlo                   ENTER tli,  ENTER tlo
    Move line in, or out                    Copy line in, or out

ENTER menu                              ENTER www   (See HELP www)
    Start up "toplevel" VED menu            World wide web access from VED

ENTER procheader                        ENTER fileheader
    Start up new documentation header       Start up new header for
    for current procedure                   current file

ENTER headers
    Create temporary index file with
    procedure headings in current file

--- $poplocal/local/teach/vednotes
--- Copyright University of Birmingham 1998. All rights reserved. ------
