vi & Editors Flashcards
vi
vi (visual) utility is a screen-oriented text editor.
vi
- v
- e
- E
- s
- y
- R
- 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.
vi
- Z
- m
- M
- b
- C
- N
- 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’.
vi
- V[N][fname]
- n
- r, -L
- r (with file name)
- T <terminal></terminal>
–not-a-term
- 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.
vi
–ttyfail
-u <vimrc></vimrc>
–noplugin
- p[N]
- o[N]
- O[N]
–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.
vi
+
+<lnum></lnum>
–cmd <command></command></command>
- c <command></command></command>
- S <session></session>
- s <scriptin></scriptin>
+, 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>
vi
- w <scriptout></scriptout>
- W <scriptout></scriptout>
–clean
- 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.
vi [INTERNAL COMMANDS]
/
?
/ = Repeat previous search forward ? = Repeat previous search backward
vi [INTERNAL COMMANDS]
h
j
k
l
h = Left j = Down k = Up l = Right
vi [INTERNAL COMMANDS]
i
o
a
i = Insert text before cursor o = Open new line for text below cursor a = Insert text after cursor
vi [INTERNAL COMMANDS]
d
p
y
dd
yy
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.
vi [INTERNAL COMMANDS]
ZZ
:w!
:q!
ZZ = Write the file and quit. \:w! = Write the file overriding protection. \:q! = Quit the file overriding protection.
Editors
vi
vim
nano
emacs