vi & Editors Flashcards

1
Q

vi

A

vi (visual) utility is a screen-oriented text editor.

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

vi

  • v
  • e
  • E
  • s
  • y
  • R
A
  • v, Vi mode.
  • e, Ex mode
  • E, Improved Ex mode.
  • s, Silent (batch) mode (only for Ex mode)
  • y, Easy mode.
  • R, Read only mode.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

vi

  • Z
  • m
  • M
  • b
  • C
  • N
A
  • Z, Restricted mode.
  • m, Modifications (writing files) not allowed.
  • M, Modifications in text not allowed.
  • b, Binary mode.
  • C, Compatible with Vi: ‘compatible’.
  • N, Not fully Vi compatible: ‘nocompatible’.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

vi

  • V[N][fname]
  • n
  • r, -L
  • r (with file name)
  • T <terminal></terminal>

–not-a-term

A
  • V[N][fname], Be verbose [level N] [log messages to fname]
  • n, No swap file, use memory only.
  • r, -L, List swap files and exit.
  • r (with file name), Recover crashed session.
  • T <terminal>, Set terminal type to <terminal></terminal></terminal>

–not-a-term, Skip warning for input/output not being a terminal.

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

vi

–ttyfail

-u <vimrc></vimrc>

–noplugin

  • p[N]
  • o[N]
  • O[N]
A

–ttyfail, Exit if input or output is not a terminal.

-u <vimrc>, Use <vimrc> instead of any .vimrc.</vimrc></vimrc>

–noplugin, Don’t load plugin scripts.

  • p[N], Open N tab pages (default: one for each file).
  • o[N], Open N windows (default: one for each file).
  • O[N], Like -o but split vertically.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

vi

+

+<lnum></lnum>

–cmd <command></command></command>

  • c <command></command></command>
  • S <session></session>
  • s <scriptin></scriptin>
A

+, Start at end of file.

+<lnum>, Start at line <lnum>.</lnum></lnum>

–cmd <command></command>, Execute <command></command> before loading any vimrc file.</command></command>

  • c <command></command>, Execute <command></command> after loading the first file.</command></command>
  • S <session>, Source file <session> after loading the first file.</session></session>
  • s <scriptin>, Read Normal mode commands from file <scriptin>.</scriptin></scriptin>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

vi

  • w <scriptout></scriptout>
  • W <scriptout></scriptout>

–clean

A
  • w <scriptout>, Append all typed commands to file <scriptout>.</scriptout></scriptout>
  • W <scriptout>, Write all typed commands to file <scriptout></scriptout></scriptout>

–clean, ‘nocompatible’, Vim defaults, no plugins, no viminfo.

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

vi [INTERNAL COMMANDS]

/

?

A
/ = Repeat previous search forward
? = Repeat previous search backward
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

vi [INTERNAL COMMANDS]

h

j

k

l

A
h = Left
j = Down
k = Up
l = Right
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

vi [INTERNAL COMMANDS]

i

o

a

A
i = Insert text before cursor
o = Open new line for text below cursor
a = Insert text after cursor
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

vi [INTERNAL COMMANDS]

d

p

y

dd

yy

A
d = Deletes characters and lines in the direction of choice. Choices are h, j, k, l.
p = Paste buffer contents.
y = Copies(Yank) a single character after the cursor into the buffer.
dd = Deletes a current line.
yy = Copies a current line into the buffer.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

vi [INTERNAL COMMANDS]

ZZ

:w!

:q!

A
ZZ = Write the file and quit.
\:w! = Write the file overriding protection.
\:q! = Quit the file overriding protection.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Editors

A

vi

vim

nano

emacs

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