home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / editors / pur_c_vi.zoo / help.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-11  |  3.4 KB  |  120 lines

  1. /*
  2.  * STevie - ST editor for VI enthusiasts.    ...Tim Thompson...twitch!tjt...
  3.  */
  4.  
  5. #include <ctype.h>
  6. #include "stevie.h"
  7.  
  8. static int helprow;
  9.  
  10. help()
  11. {
  12.     windclear();
  13.     windgoto(helprow=0,0);
  14. longline("\
  15. \n\
  16.    Cursor movement commands\n\
  17.    ========================\n\
  18.    control-l         Redraw screen\n\
  19.    control-d         Cursor down 1/2 screen\n\
  20.    control-u         Cursor up 1/2 screen\n\
  21.    control-f         Cursor forward 1 screen\n");
  22. longline("\
  23.    control-b         Cursor back 1 screen\n\
  24.    control-g         Give info on file\n\
  25. \n\
  26.       h              Cursor left 1 char\n\
  27.       j              Cursor down 1 char\n\
  28.       k              Cursor up 1 char\n");
  29. longline("\
  30.       l              Cursor right 1 char\n\
  31.       $              Cursor to end of line\n\
  32.       ^ -or- 0       Cursor to beginning of line\n\
  33.       b              Cursor back 1 word\n");
  34. longline("\
  35.       w              Cursor forward 1 word\n\
  36.       [#]G           Goto line # (or last line if no #)\n\
  37. \n\
  38.                                                <Press space bar to continue>\n\
  39.                                                <Any other key will quit>");
  40.     windrefresh();
  41.     if ( vgetc() != ' ' )
  42.         return;
  43.     windclear();
  44.     windgoto(helprow=0,0);
  45. longline("\
  46. \n\
  47.     Modification commands\n\
  48.     =====================\n\
  49.     x           Delete 1 char\n\
  50.     dw          Delete 1 word\n\
  51.     D           Delete rest of line\n\
  52.     [#]dd       Delete 1 (or #) lines\n\
  53.     C           Change rest of line\n");
  54. longline("\
  55.     cw          Change word\n\
  56.     cc          Change line\n\
  57.     r           Replace single character\n\
  58.     [#]yy       Yank 1 (or #) lines\n\
  59.     p           Insert last yanked or deleted line(s)\n");
  60. longline("\
  61.     P              below (p) or above (P) current line\n\
  62.     J           Join current and next line\n\
  63.     [#]<<          Shift line left 1 (or #) tabs\n\
  64.     [#]>>          Shift line right 1 (or #) tabs\n\
  65.     i           Enter Insert mode (<ESC> to exit)\n");
  66. longline("\
  67.     a           Append (<ESC> to exit) \n\
  68.     o           Open line (<ESC> to exit)\n\
  69. \n\
  70.                                                <Press space bar to continue>\n\
  71.                                                <Any other key will quit>");
  72.     windrefresh();
  73.     if ( vgetc() != ' ' )
  74.         return;
  75.     windclear();
  76.     windgoto(helprow=0,0);
  77. longline("\
  78. \n\
  79.     Miscellaneous\n\
  80.     =============\n\
  81.     .           Repeat last insert or delete\n\
  82.     u           Undo last insert or delete\n\
  83.     /str/       Search for 'str'\n\
  84.     ?str?       Search backward for 'str'\n");
  85. longline("    n           Repeat previous search\n\
  86.     :.=         Print current line number\n\
  87.     :$=         Print number of lines in file\n\
  88.     H        Help\n\
  89. \n\
  90.     File manipulation\n\
  91.     =================\n");
  92. longline("\
  93.     :w          Write file\n\
  94.     :wq         Write and quit\n\
  95.     :e {file}   Edit a new file\n\
  96.     :e!         Re-read current file\n\
  97.     :f          Print file into (current line and total # of lines)\n");
  98. longline("\
  99.     :f {file}   Change current file name\n\
  100.     :q          Quit\n\
  101.     :q!         Quit (no save)\n\
  102. \n\
  103.                                                      <Press any key>");
  104.     windrefresh();
  105.     vgetc();
  106. }
  107.  
  108. longline(p)
  109. char *p;
  110. {
  111.     char *s;
  112.  
  113.     for ( s=p; *s; s++ ) {
  114.         if ( *s == '\n' )
  115.             windgoto(++helprow,0);
  116.         else
  117.             windputc(*s);
  118.     }
  119. }
  120.