103.8 Basic File Editing: VI Flashcards

1
Q

VI

common editor available for all Linux distributions

A

vi/vim

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

VI

used to move cursor around and perform various operations on text

A

Command mode

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

VI

adding/inserting text in your document

A

Insert mode

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

VI

advanced mode for search/replace - executing external commands and using split panes

A

Ex mode (called LastLine)

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

VI

global vim config file

A

/etc/vimrc

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

VI

user specific config for vim

A

/home/user/.vimrc

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

VI - Command Mode number lines shortcuts

turns line numbers on the display on/off

A

:number/nonumber

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

VI - Command Mode number lines shortcuts

nu shortcut for :number/nonumber

A

:nu/no

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

VIM Command Mode

invoke the insert mode at the current cursor position where you can begin typing in the documant

A

i

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

VIM Command Mode

move to the beginning of the current line and invoke insert mode

A

I

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

VIM Command Mode

invoke insert mode placing the cursor one character to the right of the current position (append)

A

a

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

VIM Command Mode

move to the end of current line, placing the cursor one char to the right of the ending position (line append)

A

A

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

VIM Command Mode

insert a new line under the current line and place the cursor in the first position on the new line in insert mode

A

o

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

VIM Command Mode

insert new line above current line - place cursor in the first position of new line insert mode

A

O

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

VIM Command Mode

change text at current position

A

c[option]

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

VIM Command Mode: c[option]

change the word at the current position

A

cw

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

VIM Command Mode: c[option]

change the line at the current position

A

cc

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

VIM Command Mode: c[option]

change the current position to the end of the line

A

c$

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

VIM Command Mode

replace the character at the current position

A

r

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

VIM Command Mode

replace text on same line until you escape the insert mode or until you reach end of line

A

R

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

VIM Command Mode

delete the character after the cursor

A

x

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

VIM Command Mode

delete the character before the cursor

A

X

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

VIM Command Mode

delete the word after the cursor

A

dw

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

VIM Command Mode

delete the entire line the cursor is on

25
VIM Command Mode delete the text from the current cursor to the end of line
D
26
VIM Command Mode delete the text from current cursor to the end of current screen
dL
27
VIM Command Mode delete the text from current cursor to end of file
dG
28
VIM Command Mode delete all text from beginning of line to the current cursor
d^
29
VIM Command Mode undo last operation/change
u
30
VIM Command Mode copy the current line to the buffer
yy yank
31
VIM Command Mode copy from current cursor to end of current word
yw
32
VIM Command Mode paste contents of buffer after the cursor
p
33
VIM Command Mode paste contents of buffer before the cursor
P
34
VIM Command Mode undo ALL changes since the last time the file was saved to disk
:e!
35
VIM Command Mode write file to disk (save)
:w
36
VIM Command Mode quit the editor (will warn you if file has changed and not saved)
:q
37
VIM Command Mode quit right now - don't worry about saved / changed
:q!
38
VIM Command Mode shortcut for save and exit
ZZ
39
VIM Nav Shortcuts one char left
h
40
VIM Nav Shortcuts one line down
j
41
VIM Nav Shortcuts one line up
k
42
VIM Nav Shortcuts one char right
l
43
VIM Nav Shortcuts move back one half page
ctl-u
44
VIM Nav Shortcuts move back one page
ctl-b
45
VIM Nav Shortcuts move forward one half page
ctl-d
46
VIM Nav Shortcuts move forward one page
ctl-f
47
VIM Nav Shortcuts show the name of the file, lines and position in percentage of the total file length
ctl-G
48
VIM Nav Shortcuts move directly to indicated line
[#]G
49
VIM Nav Shortcuts move 12 words to the right
[#]W
50
Command Mode: Searching search from cursor position forward for 'string'
/[string]
51
Command Mode: Searching search from cursor position back for string
?[string]
52
Command Mode: Searching when used after a search, will find the 'next' occurrence of said 'string' in indicated direction
N
53
Replacing syntax
sed-like
54
Replacing substitute in current line
s
55
Replacing substitute in entire file
%s
56
Replacing what to search for
/[value to find]
57
Replacing what to replace with
/[value to substitute]/
58
Replacing optional will replace ALL occurrences rather than just first
g :s/Mar/Apr/g will search for Mar and replace with Apr
59
Run command run indicated command on command line
:!