DOC PREVIEW
FSU COP 4342 - Visual Editor

This preview shows page 1-2-3-4-5 out of 16 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

vi UPT 17.1“vi” stands for the VIsual editor.Newest forms such as vim and gvim are much more featurefulthan the original barebones editor.It’s “standard” on all Unix machines, and a great way to getemacs going!While it doesn’t make automatic backups of files edited, it alsodoesn’t leave tilde files all over the place.It is generally quite efficient.Unix Tools: Program Development 1Calling viThe vi editor is invoked by issuing the command in the followingform. The -r option is for recovering a file where the system crashedduring a previous editing session. The -t option is to indicate theposition within a file the editing should start.vi [-t tag] [-r ] filenameUnix Tools: Program Development 1Modes in viIt has has three main modes:character input mode: where text can be enteredinsert, append, replace, add lineswindow mode: where regular commands can be issuedbasic cursor motionsscreen controlword commandsdeletionscontrol commandsmiscellaneous commadnsline mode: where ex or ed commands can be issuedUnix Tools: Program Development 1Character input/outputAfter invoking vi, the user is in the window command mode.There are a few different commands to enter character intput mode.At that point, a user types in any desired text. The user then uses theESC key to return back to command mode.Unix Tools: Program Development 1Commands to enter Character Input Modea append text after the cursor positionA append text at the end of linei insert text before the cursor positionI insert text before the first nonblank character in the lineo add text after the current lineO add text before the current line (letter O)rchr replace the current character with ‘‘chr’’R replace text starting at the cursor positionUnix Tools: Program Development 1Basic cursor motionh go back one characterj go down one linek go up one linel go forward one character (space also works)0 go to the beginning of the line (zero)$ go to the end of the lineH go to the top line on the screenL go to the last line on the screenUnix Tools: Program Development 1Word movementw position the cursor at the beginning of the next wordb position the cursor at the beginning of the last worde position the cursor at the end of the current wordUnix Tools: Program Development 1Screen control^U scroll up one half page^D scroll down one half page^B scroll up one page^F scroll down one page^L redisplay the pageUnix Tools: Program Development 1Deletionsdd delete the current lineD delete text from the cursor to the end of the linex delete character at the cursorX delete character preceding the cursordw delete characters from the cursor to the end of the wordUnix Tools: Program Development 1Searching/pattern search forward for "pattern"/ search forward for last "pattern"?pattern search backward for "pattern"? search backward for last "pattern"n re-perform the last / or ? commandUnix Tools: Program Development 1Miscellaneousu undo previous commandU restore entire lineY save current line into bufferp put saved buffer after cursor positionP put saved buffer before cursor positionJ join current line with following line% position cursor over matching "(", ")", "{", or "}"ZZ save file and exit (same as :wq)Unix Tools: Program Development 1RepetitionYou can specify how many times a command is to be performed:3dd delete 3 lines4w advance 4 words7x delete 7 characters5n perform last search 5 timesUnix Tools: Program Development 1Working with tagsThe ctags and etags programs let you take in a set of source filesas input and creates a tags/TAGS file as output.The tags file contains for each function and macroObject nameFile in which the object is defined.Pattern describing the location of the object.The output of etags is also useful with emacs.Unix Tools: Program Development 1Using a tags fileYou can use the -t option when invoking vi to find a particularfunction.vi -t mainvi -t maxUnix Tools: Program Development 1gvimThere is a graphical version of vi called gvim.Unix Tools: Program Development 1Multi-level undo in vim (not vi, though)uCan use the Nu command to undo multiple changes, as opposed tovi, which can only undo the last change. Each time you enter u, theprevious change is undone.Unix Tools: Program Development


View Full Document

FSU COP 4342 - Visual Editor

Download Visual Editor
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Visual Editor and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Visual Editor 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?