16 Ocak 2013

VI için yararlı komutlar

Linux üzerinde metin editörü olarak kullanılan vi programı için bazı yararlı komutlar:

Düzenleme modu:

  • i: insert


Komut modu:

  • ESC  - Komut moduna geçiş

  • a  - append a word

  • o  - another line

  • dd  - Delete entire line (p  - re-inserted deleted line)

  • u  - undo

  • dw  - delete last word

  • R  - replace

  • r  - replace the single character

  • w - moves the cursor to the beginning of the next word

  • b  - moves the cursor to the beginning of the current word

  • o  - moves the cursor to the beginning of the current line

  • $  - moves the cursor to the beginning of the end line

  • Ctrl + F - moves the cursor one screenful forward

  • Ctrl + B - moves the cursor one screenful back

  • G  - move the cursor to the end of the file

  • 10G - move to the cursor to line 10 in the file

  • 1G  - move to the beginning of the file

  • /word  - jump to the first occurence of the pattern (word)

  • ?word - jump to the last occurence of the pattern (word)

  • d$ - delete everything from the cursor to the end of the line

  • dG - delete everything from the cursor to the end of the file

  • :  - enter ex mode


Exit mode:

  • :w  - write the file

  • :wq - write and quit

  • :q!  - without saving quit

  • :q  - quit but will save modifications

  • :e - edit another file (Ex: :e filenamed   Ex2: :e! filename)

  • :r filename - insert the contents of the filename

  • :! - allows you to enter the name of the shell command  (Ex: :r ls  , Ex2: :r! ls)


Ctrl + Z   - suspend

 

Hiç yorum yok:

Yorum Gönder