目前分類:vi (9)

瀏覽方式: 標題列表 簡短摘要

gg"*yG

 

bamil 發表在 痞客邦 留言(0) 人氣()

/KEYWORD : search forward to find KEYWORD
n : find next

bamil 發表在 痞客邦 留言(0) 人氣()

/KEYWORD : search forward to find KEYWORD
n : find next

bamil 發表在 痞客邦 留言(0) 人氣()

Using markers and buffers

Command Description
mf set marker named ``f''
`f go to marker ``f''
´f go to start of line containing marker ``f''
"s12yy copy 12 lines into buffer ``s''
"ty} copy text from cursor to end of paragraph into buffer ``t''
"ly1G copy text from cursor to top of file into buffer ``l''
"kd`f cut text from cursor up to marker ``f'' into buffer ``k''
"kp paste buffer ``k'' into text

http://osr600doc.sco.com/en/FD_create/vi_summary.html

bamil 發表在 痞客邦 留言(0) 人氣()

ma : set a marker at cursor position

`a  : move from here to marker a

bamil 發表在 痞客邦 留言(0) 人氣()

Linux command: 
 cp a tmp.txt
 vi tmp.txt
 
vi command:
 (cursor at 1 line before begining of where we want to copy) d1G
 (cursor at 1 line after end of where we want to copy) dG
 :x 
 
Now tmp.txt contains only the part we want.
 
Linux command:
 vi b
 (cursor at where we want to paste) :r tmp.txt
 
  
有點笨的作法, 但google了一下, 我只會這個....

bamil 發表在 痞客邦 留言(0) 人氣()

顯示行數

:set number

bamil 發表在 痞客邦 留言(0) 人氣()

 

 

bamil 發表在 痞客邦 留言(0) 人氣()

:g/AAAA/s//BBBB/g   

就會將全文中出現的AAAA用BBBB取代.

bamil 發表在 痞客邦 留言(0) 人氣()