vi - University of Hawaii at Manoa College of Engineering...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
University of Hawaii at Manoa College of Engineering Mastering the VI editor Index Introduction Conventions Before You Begin Starting the VI Editor Getting Out of VI The Two Modes of VI How to Type Commands in Command Mode Some Simple VI Commands Text Buffers in VI Cutting and Yanking Pasting Indenting Your Code and Checking Word and Character Searching Settings for VI (and EX) Abbreviations and Mapping Keys to Other Keys The EXINIT Environment Variable and the .exrc file Recovering Your Work When Something Goes Wrong with Your Terminal Warning About Using VI on the Workstations Summary of VI Commands o o Cutting and Pasting/Deleting text o o Inserting New Text o o Moving the Cursor Around the Screen o o Replacing Text o o Searching for Text or Characters o o Manipulating Character/Line Formatting Saving and Quitting Miscellany EX Commands
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Introduction m them. This tutorial is written to help beginning users get accustomed to using the VI editor, but also contains sections relevant to Conventions In this tutorial, the following convention will be used: you see: A d in the tutorial, that means you hold down the control key and then type the corresponding letter. For this example, you w Before You Begin ull screen, so it needs to know what kind of terminal you have. When you log in, wiliki should ask you what terminal you have. The TERM (vt100) rminal type when you log in. If you have an hp terminal, type "hp the terminal type and hit return. If you are not sure what kind of " for n error when you log in and type the wrong terminal type, don't panic and log out. You can type the following commands to fix th r shell is, type this command to see what shell you have: echo $SHELL.) For the examples given, the terminal type is "vt100". Substitu set term=vt100 For Bourne Shell (/bin/sh) or Korn Shell (/bin/ksh), the commands are the following: export TERM TERM = vt100 Next, reset your terminal with this command: tset
Background image of page 2
Now that the terminal type is (hopefully) correctly set, you are ready to get started with VI. Starting the VI Editor y the filename. For example, to edit a file called temporary, you would type vi temporary and then return. You can start VI without a f left side of the screen. Any blank lines beyond the end of the file are shown this way. At the bottom of your screen, the filename s "filename" 21 lines, 385 characters If the file you specified does not exist, then it will tell you that it is a new file, like this: "newfile" [New file] en VI starts. If the screen does not show you these expected results, your terminal type may be set wrong. Just type : q and return to g Getting Out of VI you have to be in command mode. Hit the key labeled " Escape" or " Esc" (If your terminal does not have such a key, then try ^ still be in the command mode. n. If your file has been modified in any way, the editor will warn you of this, and not let you quit. To ignore this message, the com
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/05/2010 for the course CS UNIX taught by Professor Ajay during the Spring '10 term at Jaypee University IT.

Page1 / 17

vi - University of Hawaii at Manoa College of Engineering...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online