1 / 9

The vi editor

The vi editor. CS240 Computer Science II. The three modes of vi Editor. Fucntions of the three mode in vi. Input mode: allows text such as source code to be entered.

annice
Télécharger la présentation

The vi editor

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The vi editor CS240 Computer Science II

  2. The three modes of vi Editor

  3. Fucntions of the three mode in vi • Input mode: allows text such as source code to be entered. • Command mode: allows various commands to be entered for text editing and other purposes. Several commands such as insert, append, open, replace, and change that are issued in the command mode will take you to the input mode. • Last-line mode: all commands that start with a colon : puts vi in the last-line mode. Note: all text entered is temporarily kept in a buffer until permanently saved to disk.

  4. Starting vi

  5. Adding text filename: from command to input mode; must press Escape key to return to command mode

  6. Some moving cursors in the command mode

  7. Miscellaneous Commands

  8. viewing different parts of the buffer in the command mode

  9. Customizing the vi environment: the set command • In the command mode type :set followed by a parameter listed below and press enter key. • all: lists a complete list of parameters and their current status. • atuoindent (or ai)creates tab stops; Ctrl+T tabs right and Ctrl_D tabs left. noautoindent or noai turns off autoindent feature. • shiftwidth=nn sets the spacing (#characters) between tab stops • number to display line numbers; nonumber remove line numbers. • wrapmargin=nn, where nn is arbitray positive integer representing # characters after which wrap-around takes place. • showmode displays the mode type; noshowmode removes the display. • Note that the parameters can be permanently set in a user’s startup file .profile With Bourne or Korn shell, or .login with C shell. The parameters may also be set in a .exrc file.

More Related