Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Simple Addresses:
- 0 Head of file.
- $ End of file.
- #n Jump to character n.
- n Jump to line n.
- /regexp/ First forward occurence of rexexp.
- ?regexp? First backward occurence of regexp.
- . Dot.
- , The mark in the file (see k command).
- "regexp" Preceding simple address is in the file
- referred to by regexp.
- Compound Addresses:
- a1+a2 a2 relative to the end of a1.
- a1-a2 a2 backwards from start of a2.
- a1,a2 The substring from start of a1 to end of
- a2.
- a1;a2 Like a1,a2, but a2 relative to a1.
- + and - bind more tightly than , or ;.
- Useful idioms: a1+- select line containing a1;
- 0/regexp/ find first match;
- ./regexp/// second occurrence;
- .,/regexp/ extends dot.
- Commands:
- a/text/ Insert text after range.
- c As a, but replace text.
- i Insert before range.
- d Delete range.
- s/regexp/text/ Substitute text for first match.
- & stands for the string that matched.
- \d where d is a number offsets within &.
- s2/x/y/ replaces second match.
- s/x/y/g replaces all matches.
- p Print text in range.
- = Print line and char of range.
- =# Print char of range.
- b file-list Set current file to first listed file
- already open. List may be <command.
- B file-list As b, but open unopened files in list.
- n Print menu of files.
- ' or blank : modified or clean.
- - or + or * : unread or read or
- multiple windows
- viewing.
- . or blank : current file.
- D file-list Close files. D alone closes current.
- e filename Replace file with contents of
- filename.
- r filename Replace range with contents of
- filename.
- w filename Write the range (def. 0,$) to
- filename.
- f filename Set the file name and print its new
- menu entry.
- < command Replace range with stdout of command.
- > command Replace range with stdin of command.
- | command Pipe range to stdin, stdio to range.
- ! command Run command.
- When command is omitted, the last shell command will
- be substituted.
- Loops and Conditionals:
- x/regexp/ command Run command on each match in range.
- y/regexp/ command As X but on all non-matches.
- X/regexp/ command For each file matching, command.
- Y/regexp/ command As X on non-matches.
- g/regexp/ command If range contains match, run.
- v/regexp/ command Inverted g.
- Misc:
- k Set mark to range.
- q Quit.
- u n Undo last n top-level commands in current file.
- -n is redo.
- Commands may be grouped within {}. They must appear
- on seperate lines. Changes by one command are not
- visible to others.
- Graphical mode:
- Esc selects text typed since last mouse button press.
- Button 3 opens the window ops. menu.
- Button 1 changes the selection.
- Button 2 opens the editing menu.
- <rio> Exchange snarf buffer with rio.
- /regexp Search for next occurrence of last regexp
- typed in a command.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement