home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / p2demo21.exe / TIPS.TXT < prev   
Text File  |  1995-02-09  |  14KB  |  326 lines

  1. TIPS 
  2. FOR WORKING QUICKLY 
  3. WITH PREDITOR/2 2.0
  4.  
  5. ___________________
  6.  
  7. PREDITOR/2 is packed with handy features designed to increase your 
  8. productivity.  Here are some tips that the product's developers find most 
  9. useful when working with the editor.
  10. ___________________
  11.  
  12.  
  13. Quick Loading
  14.      The initial loading of PREDITOR/2 may be slowed down if you store too 
  15.      many options in the CPE.CFG file.  Therefore, use the LOCAL.PEL file to 
  16.      indicate options that are not likely to change often.
  17.  
  18.  
  19. Online Examples
  20.      To learn more about configuring the CPE.CFG file, refer to the 
  21.      EXAMPLE.CFG file in the CPE directory.  (By default, this directory is 
  22.      C:\CPE.)
  23.  
  24.  
  25. Set Variables in the CPE.CFG File 
  26.      Rather than changing the notebook settings each time you change your 
  27.      work environments, you can create multiple CPE.CFG files (with 
  28.      different names) pertaining to each environment.
  29.      
  30.      Edit the CPE.CFG file directly to set variables.  Once the CPE.CFG file 
  31.      contains the variable settings you want to use as your defaults, create 
  32.      a back-up copy so that you don't have to re-set your variables if you 
  33.      happen to lose the file.
  34.  
  35.  
  36. Before Debugging
  37.      To debug PEL functions, you must first compile the .AE file without the 
  38.      -compress option.  Make this change by editing the MAKE_AE.CMD file in 
  39.      your PEL subdirectory.  Then rename the file CPE.AE to CPE.BAK and 
  40.      recompile the function library by running MAKE_AE.CMD.
  41.  
  42.  
  43. Command and File Name Expansion 
  44.      To expand a partial command or file name from the Command or File 
  45.      prompt, press the tab key.  If there is one matching name, it is 
  46.      displayed at the prompt.  If there are multiple matching names, a 
  47.      dialog box is displayed listing possible matches you can select .       
  48.        
  49.  
  50.  
  51. Open File Under Cursor      
  52.      Quickly open a referenced file by executing the Open file under cursor 
  53.      command from the File menu. When you select Open file under cursor, the 
  54.      selected file is opened into a new buffer. Note:  You can achieve the 
  55.      same results by executing the open_file_under_cursor command from the 
  56.      command dialog box.         
  57.  
  58.  
  59. Scroll Context      
  60.      To increase the performance of scrolling when using the keyboard, set 
  61.      your Scroll context variables on the Scroll vars page of the Windows 
  62.      settings notebook.
  63.  
  64. Buffer Filter 
  65.      The Buffer filter item on the Windows menu enables you to move 
  66.      quickly between your loaded files.  When you select Buffer 
  67.      filter, a dialog box is displayed.  Enter the type of file (for 
  68.      example *.pel) that you want to filter through.  You can then use 
  69.      the Next buffer and Previous buffer commands to move through 
  70.      your currently loaded files of that type.
  71.  
  72.  
  73. Managing Swap File Size
  74.      It is possible for your swap file to become uncommonly large, 
  75.      especially after performing large search and replace operations.  To 
  76.      keep your swap file at a reasonable size, occasionally save your work.  
  77.      This is good practice, and clears all "undo" information out of the 
  78.      swap file.
  79.  
  80.  
  81. History Lists 
  82.      1.  Press UpArrow to scroll through history lists of search strings, 
  83.      file names, or commands in the Search, Command, and Edit File dialog 
  84.      boxes.
  85.     
  86.      2.  Press PageUp to scroll through history lists in Search, Command, 
  87.      and Edit File dialog boxes (in all emulations other than CUA).
  88.  
  89.  
  90. Tags File 
  91.      A tags file is a data file that lists identifiers (function names, 
  92.      variables, etc.) with information on where each is defined in the 
  93.      source code.
  94.   
  95.      Create tags files to help you quickly find information in your source 
  96.      code. Once your tags file is built, you can use the tags() and 
  97.      tags_auto() functions to retrieve the appropriate source file and 
  98.      position the cursor at the definition.  The tags() function prompts
  99.      for a symbol to locate and the tags_auto() function locates the symbol
  100.      under the cursor.
  101.  
  102.      When you run ctags_make(), it will report the date that the tags file 
  103.      was last updated, and will prompt you for the extensions of the files 
  104.      you wish to parse. It only works on the files in the editor's current
  105.      directory, so you should use the 'chdir' command to change to the
  106.      directory containing your source files.  After creating tags files
  107.      in your project directories, you can search them all by setting the
  108.      'Tags path' item on the Directories page of the settings notebook to
  109.      contain the list of directories to search for tags files.
  110.  
  111. Use the Error File 
  112.      The Error file item on the File menu enables you to view errors 
  113.      found after compiling, that were redirected to a file.  Simply enter 
  114.      information in the dialog boxes presented by the Error file command to 
  115.      indicate the file name and compiler you are using.  The Error file 
  116.      generates a list box specific to this information, from which you can 
  117.      double-click on a listed error to open a file with the cursor located
  118.      on that error.
  119.  
  120.                             
  121. Quickly Scanning Dialog Items 
  122.      The PREDITOR/2 toolbar provides the ERR buttons to enable you to more 
  123.      quickly flip through a list of matching search strings or compile errors 
  124.      with the List dialog box minimized. The ERR buttons are located near the 
  125.      right end of the toolbar.
  126.      
  127.      When you have completed a search and the results are presented in the 
  128.      Find All List dialog box or a compile with the results in a compile list 
  129.      dialog box,
  130.      
  131.      1.  Minimize the List dialog box by clicking on the upper right corner 
  132.      of the dialog box. 
  133.      
  134.      2.  Click on the ERR buttons to move forward and backward through the 
  135.      results list.  Your cursor will automatically move to the next 
  136.      occurrence found by the search process.
  137.  
  138.  
  139. Context-Sensitive Search 
  140.      Use the pop-up menu for a quick, context-sensitive search.  Within the 
  141.      buffer you are searching, simply move the cursor to the word you are 
  142.      searching for, press and release the right mouse button, and select the 
  143.      Find String menu item from the pop-up menu that appears. 
  144.  
  145.  
  146. Incremental Find 
  147.      The Incremental find function enables you to follow the progress of the 
  148.      search as you enter a search pattern.                    
  149.  
  150.      For example, if you are searching for the pattern 'apple', the editor 
  151.      finds the first occurrence of 'a' when you type 'a', then it finds the 
  152.      first occurence of 'ap' when you typed 'p' and so on until you have 
  153.      typed the entire pattern.                   
  154.  
  155.      You can access incremental find from the Search menu on the menu bar.  
  156.      The letters you enter appear on the Status bar. If your status bar is 
  157.      toggled off, it is automatically toggled on for the incremental find  
  158.      process. Use the Esc key to end the Incremental find command.
  159.  
  160.        
  161. Context-Sensitive Help for Editor Commands
  162.      Press F1 at the command prompt to receive context-sensitive help on the 
  163.      command name you have entered.
  164.  
  165.  
  166. Wrap Paragraph Function 
  167.      Paragraphs are delimited by empty lines.  The wrap_paragraph 
  168.      command reflows a paragraph at the margins.  This is useful when 
  169.      editing a text file that has different margins than those you 
  170.      have specified.  The wrap_paragraph command operates from the 
  171.      current cursor position to the next empty line or on the current 
  172.      selection.
  173.      
  174.      Note:  Before you execute wrap_paragraph, your text should be aligned 
  175.      at the left margin.
  176.      
  177.      It is often handy to reformat a paragraph after making 
  178.      changes that don't cause an automatic update.  By assigning a key 
  179.      to the function wrap_paragraph(), you can press that key to 
  180.      reformat the current paragraph from the cursor position to the 
  181.      end of the paragraph.  If you highlight one or more paragraphs 
  182.      and press the key assigned to the wrap_paragraph() function, all 
  183.      of the highlighted text is reformatted while paragraph 
  184.      boundaries are honored.
  185.      
  186.      It is also handy to quickly reformat a paragraph using margin 
  187.      settings other than your standard settings.  For example, you 
  188.      might want to indent a list or chart.  To do this, move the block 
  189.      to the desired left margin then  highlight the paragraph with a 
  190.      column block, starting and ending at your desired margins, and 
  191.      execute the wrap_paragraph() function.
  192.  
  193.  
  194. Enabling PVCS 
  195.      To enable PVCS, simply toggle it on by typing "PVCS" in the 
  196.      command dialog box (or at the status bar prompt).  Toggle PVCS 
  197.      off by entering the same command.
  198.  
  199.  
  200. Comparing without PVCS or Vdiff 
  201.      If you do not have PVCS or Vdiff, you can still compare two 
  202.      versions of a file with the compare_buffers() and 
  203.      compare_windows() functions.
  204.      
  205.      With these functions, you do not have to compare entire files.  
  206.      In some cases, this characteristic makes compare_buffers() and 
  207.      compare_windows() a quicker alternative than using Vdiff.
  208.  
  209.   1. Compare Buffers
  210.      To use the compare_buffers() function, simply load both files 
  211.      into consecutive buffers, place the cursor in each buffer at the 
  212.      position where you would like to start the comparison, and call 
  213.      the compare_buffers() function from the command line.  
  214.      
  215.      Note:  When calling compare_buffers(), make sure you are in the 
  216.      first of the two buffers in the list, as compare_buffers() simply 
  217.      compares the current and next buffers, starting at their 
  218.      respective cursor positions.
  219.      
  220.      When the editor finds a difference, the cursor position in both 
  221.      buffers is updated to that location.  Cycling between buffers 
  222.      enables you to see the differences between the two.  If you wish 
  223.      to continue comparing the buffers' remaining content, move the 
  224.      cursor in each buffer to a new location and call the 
  225.      compare_buffers() function again.  If no differences are found, 
  226.      the cursors are positioned at the end of the buffers. 
  227.  
  228.   2. Compare Windows
  229.      The compare_windows() function is a more visual version of the 
  230.      compare_buffers() function.  You must have two and only two 
  231.      windows open, with the buffers to compare displayed in the 
  232.      windows.  
  233.      
  234.      The easiest approach to using this function is to:
  235.      
  236.      --load the files into buffers
  237.      --position the cursors 
  238.      --choose Windows/Split vertical (or horizontal)
  239.      --call compare_windows()
  240.      
  241.      Because both buffers are visible, you can view the differences 
  242.      side-by-side. Otherwise, the functionality is the same as the 
  243.      compare_buffers() function.
  244.  
  245.    
  246. Create Windows 
  247.      When in MDI mode, create a new window by simply pressing the left mouse 
  248.      button in the main editor window, dragging the mouse to a diagonal 
  249.      location and releasing the left mouse button.
  250.      
  251.  
  252. Minimize_and_Save 
  253.      Rather than exiting the editor and restarting each time you want 
  254.      to edit a file, call the minimize_and_save() function to save all 
  255.      your open buffers and minimize the editor.  The editor appears to 
  256.      be closed but is running in the background.
  257.      
  258.      Users who habitually exit the editor rather than minimizing 
  259.      frequently assign the minimize_and_save() function to the "Quit" 
  260.      key in the emulations they use.
  261.            
  262.  
  263. Prompts on the Status Bar 
  264.      To receive command prompts from the status bar (rather than a 
  265.      the Command dialog box), select the "Prompts" option on the 
  266.      Editor Settings notebook Status bar page.
  267.      
  268.      With the prompts "on," you can press the F10 key and the command 
  269.      prompt appears on your status bar.
  270.  
  271.      Note:  This features is accessible in all emulations but CUA.
  272.  
  273.  
  274. Enabling Template Expansion
  275.      Templates are programming constructs you can expand from an 
  276.      abbreviated keyword, and are specific to a programming language. 
  277.      By default, PREDITOR/2's templates are disabled.
  278.      
  279.      To enable template expansion,
  280.      
  281.      1. Click on the Tools menu on the menu bar. 
  282.      2. Click on the Command dialog menu item. 
  283.      3. Type ec in the text box and click on the OK button. (The 
  284.         command ec toggles the template on and off.)  The status bar 
  285.         displays the state of template expansion. 
  286.      4. Type the abbreviated keyword and press the space bar.  The
  287.         construct corresponding to the keyword is displayed after the
  288.         cursor.
  289.      
  290.      Many templates contain fields.  After expansion, press the 
  291.      Ctrl-Enter key to select the next field in the current buffer.  
  292.      By default, the Expand Template key is Space and the Next Field 
  293.      key is Ctrl+Enter.  You can change these by modifying 
  294.      ELECTRIC.PEL around line 77 (search for the string DEFAULT_) 
  295.      and recompiling.
  296.  
  297. Determining Key Assignments
  298.      To determine what function is assigned to a key (or keys), use 
  299.      the print_bindings command.  After running print_bindings, any 
  300.      key (or key combination) that you type will display the assigned 
  301.      function on the status bar.  Press the escape key to end the 
  302.      print_bindings command.
  303.  
  304.      To receive a list of all assigned keys, execute the list_keymap 
  305.      command.  Two optional parameters to the list_keymap command are 
  306.      'pel' and 'cfg' which display the output in PEL or config file 
  307.      format respectively.
  308.  
  309. Useful Functions to Assign to Keys
  310.      tags 
  311.      tags_auto 
  312.      peltags 
  313.      peltags_auto 
  314.      mark_matching 
  315.      mark_matching_next
  316.      goto_matching 
  317.      outdent_tab_maybe 
  318.      indent_tab_maybe 
  319.      upper 
  320.      lower 
  321.      outdent_columns
  322.      indent_columns 
  323.      search_again 
  324.      goto_bookmark 1-9
  325.      minimize_and_save
  326.