Learning the vi Editor

Learning the vi EditorSearch this book
Previous: A.4 Command Line OptionsAppendix A
Quick Reference
Next: B. Setting Environment Options
 

A.5 Other ex Commands

Abbreviations[1]
:map x sequence

Define keystroke x as a command sequence

:map! x sequence

Define x as command sequence for insert mode

:unmap xDisable the map x
:unmap! xDisable insert mode map x
:ababbr phrase

Abbreviate phrase as abbr; when abbr is typed in insert mode, it expands to full words or phrases

:unab abbrDisable abbreviation
Customizing environment: [1]
:set optionActivate option
:set option=value

Assign value to option

:set nooptionDeactivate option
:setDisplay options set by user
:set all

Display list of all current options, both default and those set by the user

:set option?Display value of option
:Invoke ex from vi editor
:viInvoke vi editor from ex
:shInvoke shell
^DReturn to editor from shell
:! commandGive UNIX command
:r newfile

Read contents of newfile into current file

:r !command

Read output of UNIX command into current file

[1] In .exrc files, omit colon at the start of ex commands.


Previous: A.4 Command Line OptionsLearning the vi EditorNext: B. Setting Environment Options
A.4 Command Line OptionsBook IndexB. Setting Environment Options

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System