[Ilugc] Vim to edit binary file

  • From: steve@xxxxxxxxxxxx (steve)
  • Date: Sun, 12 May 2013 15:21:03 +0530

On Sunday 12 May 2013 02:21 PM, Balasubramaniam Natarajan wrote:

Hi

I found on the net that this is the command I need to be in to edit a
binary file after converting to hex.

:%!xxd


I am confused as to why we use the *%* sign.  I know that if we need to run
shell command we can press ESC + colon + exclamation + <shell command>.


% implies the contents of the file you are editing, for example:

:%sort
will sort all the lines of the file alphabetically

:%s/this/that/g
will substitute all the occurrences of 'this' with 'that' in the file you are 
editing and ...

:!wc -l %

with execute the command "wc -l" (echo the number of lines) passing the current 
file as an argument.


cheers,
- steve

Other related posts: