Lab 1

In this lab, we review some of the features of text editors designed for programmers. You will need to submit a 1 page report answering the questions below. 

Lab Materials
For your assignment this week, choose a text editor (be sure to tell me which one you are using!), and describe how to perform each of the following tasks. Please be as detailed as possible in your description. Ideally, you should actually perform each task on a small example inside your chosen editor, and report the steps you had to take to complete the task. You may use other programs to complete the tasks, but you may use only one editor and it must be the same editor for each task.
  1. Open a file with some C source code. Copy the first 12 lines of text from this file. Create three new files named a.c, b.c, and c.c and paste this text at the top of each new file. Save each new file.
  2. Open two different source files for editing, ensuring both are visible on screen simultaneously, and switch between editing each of these two files and issuing commands to a terminal you have open.
  3. As you are reading the code for a large C program (with multiple source files spanned across multiple directories), you come across a call to an unknown function. Find the definition of this function. Go back to the calling context where you started.
  4. Given a file with a million lines of text, remove the whitespace (spaces, tabs, and newlines) from the beginning of every line. That is, when you have finished, each line should start with a non-whitespace character.
  5. Find and replace every occurrence of the string 'Bill Self' in your source file with the string 'basketball genius Bill Self' (assume that case matters). After you're done, reformat your file so that each line adheres to an 80 character text width. If you are using vim, you may assume that your vimrc has the appropriate textwidth and formatoptions settings so that lines are formatted correctly when the formatting command is used.

< Back to the Lab Home Page