프로그래밍/임베디드 2013. 7. 24. 20:05

vi edit의 모드

Command mode

Text의 위치나 편집 가능하게 함

Input mode

사용자가 text를 작성할 수 있는 모드


:q <enter>

to exit, if you have not made any changes to the file

:q! <enter>

the forced quit, it will discard the changes and quit

:wq <enter>

for save and Exit

:x <enter>

same as above command


To enter the text in vi you should first switch to input mode

•To switch to input mode there are several different commands

•a - Append mode places the insertion point after the current character

•i - Insert mode places the insertion point before the current character

•I - places the insertion point at the beginning of current line

•o - is for open mode and places the insertion point after the current line

•O - places the insertion point before the current line

•R - starts the replace(overwrite) mode


x - deletes the current character

d - is the delete command but pressing only d will not delete anything you need to press a second key

•dw - deletes to end of word

•dd - deletes the current line

•d0 - deletes to beginning of line


There are many more keys to be used with delete command

u - undo the changes made by editing commands

. - repeats the last edit command



Copy, cut and paste in vi

v - visual mode

yy - (yank) copy current line to buffer

nyy - where n is number of lines

p - paste the yanked lines from buffer to the line below

P - paste the yanked lines from buffer to the line above

(the paste commands will also work after yank)

gg - jump the first line of file

G - jump the end of file

nG - jump to the line (where n is line number)



'프로그래밍 > 임베디드' 카테고리의 다른 글

FlightGear Embedded board  (1) 2013.06.29
text lcd  (0) 2013.05.23
linux root filesystem  (0) 2013.05.23
7segment  (0) 2013.05.23
Led  (0) 2013.05.23
//