Quick Guide to VI text editor

Here are a few tips on how to get around in VI

To edit a file type: vi filename

Basic vi commands

  • i – Change to insert mode (edit mode)
  • CTRL-C – Change to command mode (exit edit mode)
  • :w – Save the file being edited (command mode only)
  • :wq – Save file and Quit (command mode only)
  • :q – Quit (command mode only)
  • :q! – Quit without saving (command mode only)
  • h/j/k/l Navigation keys if your arrows break (command mode only) (Try pressing scroll-lock first to try and make arrows work)

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.