1.5 Text Editors Flashcards

2
Q

What is vim

A

Vim (vi improved), also referred to as vi, is a utility that creates and modifies text files. It is the standard command-line text editor included with Linux distributions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the different vim modes?

A
  1. Command mode is the initial mode vim uses when started. It has commands that cut and replace text, and it is the mode vi uses to enter the other modes.
  2. Command Line mode is the mode that works with the file system. Use it to save files after editing them.
  3. Edit mode is the mode that vim uses to write and edit text in the file.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the two operation modes of the vim edit mode?

A
  1. Insert mode adds text between the preceding and subsequent text.
  2. Replace mode overwrites subsequent text.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the vi command do?

A

Starts vim.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the command vi filename do?

A

Starts vim and immediately begins working on the named file (either a new, non-existent file or an existing file).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the Insert key do in the vim editor when in command mode?

A

Places vim in Insert mode from Command mode.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the i key do in the vim editor when in command mode?

A

Places vim in Insert mode from Command mode.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the s key do in the vim editor when in command mode?

A

Places vim in Insert mode from Command mode.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the Esc key do in the vim editor when in Insert/Replace mode?

A

Places vim in Command mode from Edit mode.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the Delete key do in the vim editor when in Insert/Replace mode?

A

Deletes text.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the Insert key do in the vim editor when in Insert/Replace mode?

A

Toggles between Insert and Replace mode while in edit mode.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does entering a number do in the vim editor when in Command mode?

A

Goes to a specific line in the document.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What do the keystrokes dw do in the vim editor when in Command mode?

A

Cuts a whole word and trailing space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What do the keystrokes de do in the vim editor when in Command mode?

A

Cuts a whole word but omits the trailing space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What do the keystrokes d$ or D do in the vim editor when in Command mode?

A

Cuts all text following the cursor to the end of the line.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What do the keystrokes dd do in the vim editor when in Command mode?

A

Cuts a line from the text.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What does the p key do in the vim editor when in Command mode?

A

Places text in memory into the document.

19
Q

What does the u key do in the vim editor when in Command mode?

A

Undoes the last action.

20
Q

What does the o key do in the vim editor when in Command mode?

A

Opens a new line above the current line.

21
Q

What do the keystrokes Ctrl+g do in the vim editor when in Command mode?

A

Displays file name, total number of lines in the file and the cursor position.

22
Q

What do the keystrokes /term do in the vim editor when in Command mode?

A

Searches forward for all instances of a term. Press n to go to the next term and N to go to the previous term.

23
Q

What do the keystrokes ?term do in the vim editor when in Command mode?

A

Searches backward for all instances of a term. Press n to go to the previous term and N to go to the next term.

24
Q

What do the keystrokes yy do in the vim editor when in Command mode?

A

Copies a line of text into memory.

25
Q

What does the a key do in the vim editor when in Command mode?

A

Appends text after the cursor

26
What does the **A** key do in the **vim** editor when in *Command* mode?
Appends text after the current line
27
What does the **C** key do in the **vim** editor when in *Command* mode?
Changes text from current cursor position to the end of the line.
28
What do the keystrokes **cc** do in the **vim** editor when in *Command* mode?
Change texts of the entire line.
29
What do the keystrokes **ZZ** do in the **vim** editor when in *Command* mode?
Saves current file and exit vim.
30
What does the **h** key do in the **vim** editor when in *Command* mode?
Moves the cursor one space to the left.
31
What does the **j** key do in the **vim** editor when in *Command* mode?
Moves the cursor down a line.
32
What does the **k** key do in the **vim** editor when in *Command* mode?
Moves the cursor up a line.
33
What does the **l** key do in the **vim** editor when in *Command* mode?
Moves the cursor one space to the right.
34
What does the **z** key do in the **vim** editor when in *Command* mode?
Exits without saving.
35
What does the **:** key do in the **vim** editor when in *Command* mode?
Enters command line mode from command mode.Places **vim** in *Command LIne* mode from *Command* mode.
36
What does the command **w** do in the **vim** editor when in *Command Line* mode?
Saves the current document.
37
What does the command **w *filename*** do in the **vim** editor when in *Command Line* mode?
Names and saves the file.
38
What does the command **w! *filename*** do in the **vim** editor when in *Command Line* mode?
Overwrites the file
39
What does the command **q** do in the **vim** editor when in *Command Line* mode?
Exits vim. This produces an error if the text was modified.
40
What does the command **q!** do in the **vim** editor when in *Command Line* mode?
Exits vim without saving.
41
What does the command **wq** or **exit** do in the **vim** editor when in *Command Line* mode?
Saves the document and exit vim.
42
What does the command **e!** do in the **vim** editor when in *Command Line* mode?
Reload the file from the last saved version. This discards all edits and reloads the last saved version of the file into vim.