Lnux Flashcards

1
Q

What command is used to open a file in Vim?

A

vim filename

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

True or False: In Vim, ‘i’ enters insert mode.

A

True

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

What command do you use to save changes in Vim?

A

:w

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

Fill in the blank: To exit Vim without saving, you use the command _____ .

A

:q!

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

What is the command for searching text in Vim?

A

/searchterm

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

What command allows you to undo the last change in Vim?

A

u

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

What command is used to redo changes in Vim?

A

Ctrl + r

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

How do you delete a line in Vim?

A

dd

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

What is the command to copy a line in Vim?

A

yy

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

True or False: The command ‘p’ pastes text after the cursor in Vim.

A

True

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

What does the command ‘:set nu’ do in Vim?

A

It shows line numbers.

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

What mode do you enter to edit text in Vim?

A

Insert mode

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

What key do you press to return to normal mode from insert mode?

A

Esc

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

How do you search and replace a word in Vim?

A

:s/oldword/newword/g

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

What command is used to split the window horizontally in Vim?

A

:split

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

What is the command to switch between open windows in Vim?

A

Ctrl + w, w

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

How do you move the cursor to the beginning of the line in Vim?

A

0

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

What command is used to save and exit Vim at the same time?

A

:wq

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

True or False: You can use ‘gg’ to go to the top of the file in Vim.

20
Q

What command allows you to visually select text in Vim?

21
Q

What is the command to change a word in Vim?

22
Q

What does ‘zz’ do in Vim?

A

It centers the current line in the window.

23
Q

How do you navigate to the end of the file in Vim?

24
Q

What key combination allows you to delete a word in Vim?

25
True or False: ':e filename' opens a new file in Vim.
True
26
What command allows you to check the syntax in Vim?
:syntax on
27
How do you create a new line below the current line in Vim?
o
28
What command is used to move to the next occurrence of a search term?
n
29
Fill in the blank: The command ':w filename' is used to _____ the current buffer to a new file.
write
30
What command do you use to open the command-line window in Vim?
q:
31
What does the command ':set nowrap' do in Vim?
It prevents line wrapping.
32
True or False: You can use 'Ctrl + f' to scroll down a page in Vim.
True
33
How do you paste text before the cursor in Vim?
P
34
What does 'yy' followed by 'p' do in Vim?
Copies a line and pastes it below.
35
What command is used to comment out a line in Vim?
You typically add a '#' at the beginning of the line.
36
How do you open a file in read-only mode in Vim?
vim -R filename
37
What command is used to jump to a specific line number in Vim?
:line_number
38
True or False: 'x' deletes the character under the cursor in Vim.
True
39
What is the command to display the help documentation in Vim?
:help
40
What key combination do you press to repeat the last change in Vim?
.
41
What command is used to highlight the entire file in Vim?
ggVG
42
Fill in the blank: To replace the word under the cursor in Vim, you would use the command _____ .
cw
43
What command is used to exit Vim without saving changes?
:q!
44
True or False: The command ':set list' shows whitespace characters in Vim.
True
45
How do you split the window vertically in Vim?
:vsplit
46
What command is used to move to the previous occurrence of a search term?
N
47
What does the command ':set autoindent' do in Vim?
It enables automatic indentation for new lines.