103.8 Basic File Editing: VI Flashcards
VI
common editor available for all Linux distributions
vi/vim
VI
used to move cursor around and perform various operations on text
Command mode
VI
adding/inserting text in your document
Insert mode
VI
advanced mode for search/replace - executing external commands and using split panes
Ex mode (called LastLine)
VI
global vim config file
/etc/vimrc
VI
user specific config for vim
/home/user/.vimrc
VI - Command Mode number lines shortcuts
turns line numbers on the display on/off
:number/nonumber
VI - Command Mode number lines shortcuts
nu shortcut for :number/nonumber
:nu/no
VIM Command Mode
invoke the insert mode at the current cursor position where you can begin typing in the documant
i
VIM Command Mode
move to the beginning of the current line and invoke insert mode
I
VIM Command Mode
invoke insert mode placing the cursor one character to the right of the current position (append)
a
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
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
o
VIM Command Mode
insert new line above current line - place cursor in the first position of new line insert mode
O
VIM Command Mode
change text at current position
c[option]
VIM Command Mode: c[option]
change the word at the current position
cw
VIM Command Mode: c[option]
change the line at the current position
cc
VIM Command Mode: c[option]
change the current position to the end of the line
c$
VIM Command Mode
replace the character at the current position
r
VIM Command Mode
replace text on same line until you escape the insert mode or until you reach end of line
R
VIM Command Mode
delete the character after the cursor
x
VIM Command Mode
delete the character before the cursor
X
VIM Command Mode
delete the word after the cursor
dw