![]() |
![]()
| ![]() |
![]()
NAMEbvi, bview - visual editor for binary files VERSIONbvi-1.4.1 SYNOPSISbvi [-R] [-c cmd] [-f script] [-s skip] [-e end] [-n length] file... bview [-R] [-c cmd] [-f script] [-s skip] [-e end] [-n length] file... OPTIONS
DESCRIPTIONBvi stands for "Binary VIsual editor". Bvi is a screen oriented editor for binary files; its command set is based on that of the vi(1) text editor. As bvi is a binary editor, it does not have the concept of "lines". All end-of-lines (EOLs) are simply bytes. Therefore bvi's commands are different from vi's commands for all line-oriented commands (see below). COMPARISONThe main differences between Vi and Bvi are: The screen is divided in three sections or panes: The byte offset (extreme left), the hex pane (middle), and an ascii pane (right) which shows as printable characters those bytes in the hex pane. On an 80 column terminal there will be sixteen hex values and their ASCII values on each screen line. Note that (as one would expect) the first byte has the offset '0' (zero). You can toggle between the hex and ascii windows with the tab key (TAB). Toggling between these two windows does not change the current position (offset) within the file. No "lines" concept: Files are treated as one long stream of bytes. The characters "newline" and "carriage return" are not special, id est they never mark the end of lines. Therefore the lines on the screen do not represent lines in the usual way. Data is broken across screen lines arbitarily. As a consequence there are no commands in bvi from ex or vi that are based on line numbers, eg "dd", "yy", 'C', 'S', 'o', 'O'. This also changes the meaning of "range" before the ":write" command to a byte offset, ie the command ":100,200w foo" writes all *bytes* (not lines) from offset 100 to offset 200 to the file "foo". No "text objects": There are also no text-specific arrangements like words, paragraphs, sentences, sections and so on. Extended "ruler": The bottom line of the screen shows the current address (byte offset) and the current character in these notations: octal, hexadecimal, decimal and ascii.Search patterns: All search commands understand these special characters: . any character [] set of characters * zero or more occurrences of previous char or setBut as there is no concept of lines you cannot use the standard symbols ("anchors") for "begin-of-line" ('^') and "end-of-line" ('$'). Searching for the start/end of lines must be done explicitly by adding these special characters to your search pattern using these meta sequences: \n newline \r return \t tab \0 binary zeroAdditional search commands: Similar to the text search commands there are additional hex-search functions '\' and '#' which allow to search for any byte value. Example: "\62 76 69" will search for the string "bvi". Spaces between hex value are optional, so searching for "6775636B6573" will find "guckes". Changing the length of data (insertion, deletion) moves the data to other addresses; this is bad for many cases (eg. databases, program files) and is thus disabled by default. You can enable this commands by typing :set memmove BVI Modes: Command Mode (Normal Mode): Input is treated as command. Note that command mode is the default mode after startup and after escaping from input mode. Use ESC (escape) to cancel a partial (uncompleted) command. Input Mode: Input is treated as replacement of current characters or (after the end of the file) is appended to the current file. This mode is entered from command mode by typing one of 'i', 'I', 'A', 'r', or 'R'. You can enter the characters from the keyboard (in the ASCII window) or hexadecimal values (in the HEX window). Type TAB to switch between these two windows. Type ESC to finish the current input and return to command mode. Type CTRL-C to cancel current command abnormally. Command line mode (Last Line Mode or : mode): Similar to vi, this mode is entered by typing one of the characters : / ? \ # ! The command is terminated and executed by typing a carriage return; to cancel a partially typed command, type ESC to cancel the current command and return to command mode. ENVIRONMENTThe editor recognizes the environment variable BVIINIT as a command (or list of commands) to run when it starts up. If this variable is undefined, the editor checks for startup commands in the file ~/.bvirc file, which you must own. However, if there is a .bvirc owned by you in the current directory, the editor takes its startup commands from this file - overriding both the file in your home directory and the environment variable. TERMINOLOGYCharacters names are abbreviated as follows:
COMMAND SUMMARYSee the TERMINOLOGY for a summary on key name abbreviations used within the following description of commands. Abstract:
Sample commands:
Counts before bvi commands:
screen column ⎪ byte of file G scroll amount ^D ^U repeat effect most of the restInterrupting, canceling ESC end insert or incomplete command DEL (delete or rubout) interrupts File manipulation:
Additional edit commands
:i aCR insert bytes (ASCII) at cursor position :a bCR append bytes (Binary) at end of file :c hCR change bytes (hexadecimal) at cursor positionBit-level operations :and n bitwise 'and' operation with value n :or n bitwise 'or' operation with value n :xor n bitwise 'xor' operation with value n :neg two's complement :not logical negation :sl i shift each byte i bits to the left :sr i shift each byte i bits to the right :rl i rotate each byte i bits to the left :rr i rotate each byte i bits to the right Command mode addresses
Positioning within file:
Adjusting the screen:
Marking and returning:
Line positioning:
Character positioning:
Strings:
Corrections during insert:
Append and replace:
Miscellaneous Operations:
Yank and Put:
Undo, Redo:
Setting Options:
Option Default Description autowrite noaw Save current file, if modified, if you give a :n, :r or ! command columns cm=16 on an 80 character wide terminal ignorecase noic Ignores letter case in searching magic nomagic Makes . [ * special in patterns memmove nomm enables insert and delete commands offset of=0 adds an offset to the diplayed addresses readonly noro If set, write fails unless you use ! after command reverse nore display otherwise-printable characters with their high bit set as reverse video scroll sc=1/2 window Number of lines scrolled by ^U and ^D showmode mo Displays statusline on bottom of the screen terse noterse Let you obtain shorter error messages window window=screensize Lines in window, can be reduced at slow terminals wordlength wl=4 Length of an ASCII-string found by w, W, b or B wrapscan ws Searches wrap around past the end of the file unixstyle nous The representation of ascii characters below 32 is displayed in the statusline as shown in ascii(7) if unset rather in DOS-style (^A) AUTHORbvi was developed by Gerhard Buergmann, Vienna, Austria gerhard@puon.at WWWBvi Homepage: http://bvi.sourceforge.net/ Vi Pages: http://www.guckes.net/vi/clones.php3 (all about Vi and its clones) FILES$HOME/.bvirc editor startup file ./.bvirc editor startup file BUGSBvi does not update the screen when the terminal changes its size. SEE ALSObmore(1), vi(1), strings(1), ascii(5)
|