sponsor Vim development Vim logo Vim Book Ad

hexman.vim : Simpler Hex viewing and editing

 script karma  Rating 147/69, Downloaded by 10180  Comments, bugs, improvements  Vim wiki

created by
Peter Franz
 
script type
utility
 
description
Hexmanger provides keymapping to view quickly your file
in hexmode (convertion is done over the program xxd).
                                                              
Additional features:
- shows in statusline the current offset (hex and dec.)
- move to next/previous hex character with <TAB> and <S-TAB>
  If you don't like this mapping - please set in your vimrc:
  let hex_movetab = 0
- staying on a hex character it marks the related ascii column
- Goto hex offset
- Delete hex character under cursor
- Insert ascii character before cursor

Available functions:
                                                                    
<leader> hm HexManager: Call/Leave Hexmode (using xxd)
<leader> hd   HexDelete: delete hex character under cursor
<leader> hi   HexInsert: Insert Ascii character before cursor
<leader> hg   HexGoto: Goto hex offset.
<leader> hn   HexNext: Goto next hex offset.
<leader> hp   HexPrev: Goto previous hex offset.
<leader> hs   HexStatus: Show / Hide hexoffset infos in statusline
                         and related ascii column
                                                                    
If you want, you can change the mapping in your vimrc:
Example (call with function key F6 the Hexmode:
map <F6>  <Plug>HexManager                                          

                    
 
install details
Normally, this file should reside in the plugins
directory and be automatically sourced. If not, you must
manually source this file using ':source hexman.vim'.
                                                            
If you want to edit a file in hexmode, start vim
with the -b option - like:
      vim -b <file>
and then switch to hexmode with <leader>hm
(see Available functions).
The program xxd is needed to convert the file in hex (and
back).
Only changes in the hex part are used.  
Changes in the printable text part on the right are ignored.

Additional help:
:help *23.4*
:help xxd                                                  
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
hexman.vim 0.7.3 2014-01-23 7.0 Peter Franz Gvim 7.4 support - xxd on Windows was not found (again).
Hope it works also upwards vim 7.4
hexman.vim 0.7.2 2007-01-18 6.0 Peter Franz Patch from Ingo Karkat / 'xxd' did not start when VIM is installed in a directory containing spaces (e.g. on an English Windows XP:
"c:\Program Files\vim\vim70\xxd.exe").
hexman.vim 0.7.1 2007-01-16 6.0 Peter Franz Patch from Alejandro Cornejo / language independent cursor offset calculation.
hexman.vim 0.7.0 2006-03-30 7.0 Peter Franz Support vim7 (xxd was not found / fix match syntax)
hexman.vim 0.6.0 2003-11-20 6.0 Peter Franz Search Hex Character with \hf  
With search history eg. /<Up> you can repeat the search.
Possibility to switch off advanced ascii/hex editing
(see Additional Features in Script).
hexman.vim 0.5.1 2003-10-31 6.0 Peter Franz FIX: Editing in Hex part was not possible (as of 0.5.0).
hexman.vim 0.5.0 2003-10-31 6.0 Peter Franz Changes in the printable text part (ascii area) are now supported in
Replace mode (command "R" or Select Mode "gh" )
for most characters (see Known Problems).
hexman.vim 0.4.1 2003-08-19 6.0 Peter Franz More features:
- Switch cursor between hex and ascii area with t  or  <leader>ht
  (or map it to a different keymap in vimrc  e.g.: map <F7>  Plug>HexToggle)
- After calling/leaving hexman the cursor is set to current file position.
hexman.vim 0.2.1 2003-08-08 6.0 Peter Franz Bugfixes (one from Ingo karkat - thank you). New feature: Staying on a ascii character it marks the related hex column.
hexman.vim 0.1.0 2003-07-30 6.0 Peter Franz Show own hexman menu entry with hexman commands (gui version).
If you don't like the menu - please set in your vimrc:
let hex_menu = 0
hexman.vim 0.0.2 2003-06-14 6.0 Peter Franz FIX: default moving to next hex character
with <TAB> and <S-TAB> don't work on (LINUX/UNIX)
hexman.vim 0.0.1 2003-06-05 6.0 Peter Franz Initial upload
ip used for rating: 142.132.191.50

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github