cse15l-lab-reports

LAB REPORT: VIM

In this lab report, we will be going over vim commands and their uses, demonstrated by performing one lab task from Week 6.


PART 1: CHANGING THE NAME OF THE start PARAMETER AND ITS USES TO base

1) When starting up DocSearchServer.java in vim, the cursor will be directly at the top left of the file, highlighting the very first character:

Image

2) We then type /start <Enter> in order for the cursor to jump to the first occurrence of the word “start,” as demonstrated in this screenshot:

Image

3) Now, we should type cgn base first, which will make vim go into Insert mode, delete the highlighted word (“start”) and will let us replace it with something else. In this case, we will type “base,” and we press the <Esc> key to return to normal mode, as shown below:

4) Following this, we can press n to find the next instance of the word “start,” and right after we can press . to do the exact same thing that we just did in the previous step, which is deleting the word and replacing it with “base”–this . command will do the very last thing that we have done.

5) Now, we just keep repeating the above step until we cover every instance of the word “start”

6) After all of this, we are done! Now we just need to save the file and exit vim. To do so, we press : w (to save) q (to quit)

PART 2: SCP TEST (LOCAL VS. REMOTE), QUESTIONS

⮞ TESTS

LOCAL EDIT, SCP TO REMOTE

REMOTE EDIT WITH VIM

⮞ QUESTIONS

1) Which of these two styles would you prefer using if you had to work on a program that you were running remotely, and why?

2) What about the project or task might factor into your decision one way or another? (If nothing would affect your decision, say so and why!)