Advertisement
layr

Vi commands

Jan 17th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. Vi commands: ( http://www.unix-manuals.com/refs/vi-ref/vi-ref.htm )
  2.  
  3. ===================================
  4. Insert mode [ i ]
  5. ===================================
  6. i - insert text at cursor
  7. I - insert text at beginning of line
  8.  
  9. A - viib kursori line'i lõppu (append text at line A)
  10. a - append text after cursor (sama nagu i, lihtsalt esimene char läheb PÄRAST kursorit; i puhul läheb kusori kohale);
  11.  
  12. o - open line below cursor (open line st tekitab ridade vahele uue rea)
  13. O - open line above cursor
  14.  
  15. cw - kustutab antud sõna (ehk change word)
  16. cc - kustutab antud rea (ehk change line)
  17. C - kustutab kursorist kuni rea lõppu
  18.  
  19. ===================================
  20. Command mode [ Esc ]
  21. ===================================
  22. CURSOR MOVEMENT:
  23.  
  24. arrows / h j k l
  25.  
  26. 0 - go to beginning of line
  27. $ - go to end of line
  28. nG - go to line n == :n
  29. G - go to last line (end of file)
  30.  
  31. w/b - scroll by word
  32.  
  33. ===================================
  34. EDIT:
  35.  
  36. . - repeat last command
  37.  
  38. yy - copies line
  39. p - pastes below cursor
  40. P - pastes above cursor
  41.  
  42. u - undo previous command
  43. U - undo all changes to line
  44.  
  45. D - sama mis C (kustutab kursorist kuni rea lõppu), kuid jääb command mode'i
  46.  
  47. :set ignorecase - Ignore case sensitivity when searching
  48. :set noignorecase - Restore case sensitivity (default)
  49.  
  50. ?string - search backward for string (st otsib alt-üles)
  51. /string - search forward for string
  52.  
  53. :syntax on - highlighting
  54. :syntax off
  55.  
  56. ===================================
  57. DELETE:
  58.  
  59. x - delete char at cursor (st käitub nagu del )
  60. X - delete (backspace) text at cursor (st käitub nagu backspace)
  61.  
  62. D - delete current to end of line
  63.  
  64. dd - delete entire line
  65. 5dd - delete 5 lines
  66. :5,10d - delete lines 5-10
  67.  
  68. ===================================
  69. Save/quit:
  70.  
  71. :w - save changes to buffer
  72. zz or :wq - save changes and quit
  73. :q! - quit w/o saving
  74. :w filename - save file to new file
  75.  
  76. ===================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement