CSCI 57 and 65: Introduction to Unix Courses
Laboratory Assignment 5
1. TURN-IN a hard copy of the following:
- On all homework please include
- Your Name
- Course Number
- Date
- ecst login name
- This homework can be typed and printed from unix or you can just print out this webpage and write the answers on it.
- You NOT need to include the printing cover page (details given in lab).
- To do this lab you need to learn vim using the vimtutor
- You can start using the vimtutor by just typing: vimtutor
- If you recieve a command not found error you can type the full path with: /opt/sfw/bin/vimtutor
- Please answer the following questions (answers and/or help given in lab).
- What command is used to print a file in our lab classroom?______________________________________
- What command is used to view the printer queue in our lab classroom?____________________________
- What command is used to delete print jobs?__________________________________________________
- What option do you use in printing jobs to suppress the banner page?______________________________
- Vim Questions. Go through the
vimtutor and then come back and answer these questions ("arrow keys" are
not answers to any of these questions)
- What key allows you to move up in vim?__________
- What key allows you to move down in vim?__________
- What key allows you to move left in vim?__________
- What key allows you to move right in vim?__________
- What is the undo command?_______________________
- What is the put command?_________________________
- What is the replace command?_______________________
- How do you exit from editing a file without saving your changes?__________________
- How do you exit from editing a file and saving your changes?_____________________
- How do you write your file to a new filename?______________________________________________
- How can you delete an unwanted character in vim?_____________________________
- How can you insert text in vim?____________________________________________
- What one command can you use to change every occurence of the word
"old" to the word "new" in a
file?___________________________________________________
- How can you delete a word (with one command)?_________________________
- How can you delete to the end of a line (with one comand)?_____________________________
- How can you delete an entire line (with one command)?____________________________
- What command will show your location (as in line and column number) in a file?_______________________________
- What is the search command in vim? What other unix
utility we have covered uses the same search
command?___________________________
- How do you search backwards for a term in vim?_______________________
- How can you execute an external command in vim?__________________________________
- How can you insert the contents of anothe file in the current
file you are editing?______________________________________________
- What one letter command can you use to begin appending text
to the end of a line?_________________________________________________
- Download a version of Vim for your platform (Windows, Mac) and install on your home computer or on some other computer (not the Unix systems on campus though). If you have installed Linux then you probably already have Vim installed and can just say you have Linux installed and you don't have to bother with these questions any more than this.
- First Method
- Second Method (better but also slower if you use a dial-up connection to the internet)
- Download Cygwin from http://www.cygwin.com/
- Cygwin gives you a Unix prompt and a lot of Unix utilities
on Windows. You should be able to choose and install vim using
cygwin (I think).
- What method did you try? ________________________________________
- Were you successful (If not successful please give explanation)? ___________________________________________
Also, check out this book. The entire book is open source and available online for free, http://www.newriders.com/books/opl/ebooks/0735710015.html There is much more to Vim then what you are doing in this lab. This lab barely touches the surface.
Here is the user manual for Vim, http://vimdoc.sourceforge.net/dion/vimum.html
Also the FAQ is pretty readable, http://vimdoc.sourceforge.net/cgi-bin/vimfaq2html3.pl