1

I installed gvim82 to specifically use the xxd command in windows. I ran the :!xxd -i command followed by file_name.txt > header_file_name.h in the windows command prompt but nothing happens, not even throwing any errors. Can someone help? Is :!xxd only used in the Vim environment?

5
  • Welcome to Vi and Vim! The :! part is pretty much exclusive to Vim, since it's Vim syntax to run an external shell command. Can you just run xxd directly? As in: C:\>xxd -i file_name.txt > header_file_name.h ? – filbranden May 8 '20 at 20:00
  • On Windows it doesn't recognize xxd. Are there any similar commands that I can use on windows? I specifically want to make a header file with the data in the text file which xxd on linux does that – Ado May 8 '20 at 20:04
  • Which directory did you install Vim to? Something like C:\Program Files\Vim\Vim8.2 or similar? Can you find an xxd.exe in there? Does it help if you add that directory to %PATH% or call xxd using the full path? – filbranden May 8 '20 at 20:14
  • 1
    windows command prompt is not POSIX sh (from where the > redirect syntax originates). I have no idea if that will work there. And @filbranden is right; :! is a vim command. – D. Ben Knoble May 8 '20 at 21:20
  • @filbranden It worked!! Thanks! So I should add the xxd patch into my script every time I want to use it? is it the only way? Because I ran the command in the Vim folder which I know is not a good idea – Ado May 12 '20 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.