Check out:
- Russ Cox' tour: https://www.youtube.com/watch?v=dP1xVpMPn8M
:'<,'>!commandAnother useful one is `%!jq .` to pretty print a json file.
$ printf "\x00\x01\x02\x03" | xxd
0000000: 0001 0203
$ printf "\x00\x01\x02\x03" | xxd -g1
0000000: 00 01 02 03
While editing binary files in Vim, one needs to be careful about setting the binary option before editing a binary file or opening the binary file with `-b` option.For example,
printf "\x00\x01\x02\x03" > a.bin
vim a.bin
:%!xxd -g1
would display 0000000: 00 01 02 03 0a .....
(The `printf` and `vim` commands are entered in the shell. The `:%!xxd` command is entered in Vim.)In the above example, a newline has been added by Vim where none existed in the binary file. In fact, if you then run `%!xxd -r` followed by `:w`, this additional newline would be written back to the file. Here is the right way to preserve the binary data in a binary file.
printf "\x00\x01\x02\x03" > a.bin
vim -b a.bin
:%!xxd -g1
would display 0000000: 00 01 02 03 ....
Only the four bytes in the file appear now. Alternatively, one may enter `:set bin` in Vim before editing a binary file.Then i wrote a bunch of Python scripts to do things like recalculating command id's for wxWidgets, generating the registration, header and body parts from event definitions (which i cut/pasted later, but it was much faster than doing that by hand), aligning some declarations to fit with the code style, etc.
The extension would also scan a folder inside My Documents and register any executable, python script, bash script and tcl script to a menu in the IDE. Many people in the studio knew Python and some new Bash (i think i was the only one who used Tcl though, i mainly used it to quickly search the filenames for the project and open a file in VS or Vim. I made it to search as i type and since we had a more or less 1-to-1 mapping between objects and files, i could search for object definitions faster than using VS's search functionality - especially when VS was busy building or doing stuff).