vim
commands and their uses, demonstrated by performing one lab task from Week 6.start
PARAMETER AND ITS USES TO base
Vim Keystroke Sequence:
<Enter>
<Enter>
<Esc>
<Enter>
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:
<Enter>
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:
<Enter>
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.
TRACING KEYSTROKES:
Pressing n once
Pressing . once
5) Now, we just keep repeating the above step until we cover every instance of the word “start”
TRACING KEYSTROKES:
Pressing n once
Pressing . once
Note: if we press n again to look for more instances of “start,” we will see the following message:
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)
: w q
SCP
TEST (LOCAL VS. REMOTE), QUESTIONSSCP
TO REMOTEscp
‘d into. Editing the file locally was also increased how long the total test took since I was not able to rely on vim
for edits and special commands (which is what I did above).VIM
ssh
key, which saved time by not having to type out the password.vim
, as I would be saving a lot of time by not having to scp
the file back and forth (in a similar style to the first test computed above). Additionally, vim
offers many useful commands to make changes to a file or program, which promotes its efficiency.
vim
for working on projects remotely due to its capability to save a lot of time and effort.vim
I would probably forget that I cannot use my cursor there but rather certain keys on the keyboard to move around. I feel like this would just make me waste more time since I am not completely familiarized with vim
enough to thoroughly edit a project.
vim
I might choose to use it over any other software for its efficiency (as mentioned above). :)