Next: E-Mail : elm and
Up: The vi editor
Previous: Command mode keys
- edit, write and quit a file
- :w filename : save file with name filename, but do not exit. Omitting filename saves file with current name.
- :w! filename : save file with name filename overriding normal checking.
- :q : Leave vi. If you made any changes, you will be prompted to save the changes first.
- :q! : Leave vi without saving any changes since last write.
- :e filename : Edit file named filename. If you made any changes in current file, you will be prompted to save them or use :e!.
- :e! filename : Edit file named filename disregarding changes since last write. If no filename is specified, current file is re-edited.
- Inserting file
- :r filename : Read the file named filename and insert it beginning from the current line.
- set commands
- :set showmatch : Shows the matching left parenthesis when you type a right parenthesis.
- :set tabstop=n : Set the tab length to n spaces. (Useful for indentation).