I want to create my install packages with WiX in .wxs source files
edited with Vim.
For WiX I need to generate a new GUID for every new package I
distribute and every
major version of my program.
Could someone create a :command that would check the current selection or
the next 36 chararcters after the cursor to be hexadecimal digits
including minus
sign (anywhere in between) and then replace this text with the output
from a command
line executable (bin/GUIDGEN.exe) ?
Is there a script for this already ?
I do not know vim language, I am still learning the commands
Thank you,
Timothy Madden
Easy
:s/\%#[-[:xdigit:]]\{36}/\=`GUIDGEN`
Explanation:
:s substitute on current line
/ replace what?
\%# zero-width, current cursor position
[ start collection
- dash
[:xdigit:] (inside collection) hex digit
] end collection
\{36} repeat 36 times (i.e., multiply previous atom by 36)
/ replace by what?
\= expression
`GUIDGEN` the stdout of program GUIDGEN which is the PATH
(no flags) do it just once
See
:help :s
:help pattern.txt
Best regards,
Tony.
--
"If I am elected, the concrete barriers around the WHITE HOUSE will be
replaced by tasteful foam replicas of ANN MARGARET!"
Timothy Madden wrote:
>
> My vim says Invalid expression `wine GUIDGEN.exe` after I
> type :Guidgen,
> which I defined like this in ~/.vimrc:
>
> command Guidgen :s$\%#[-[:xdigit:]]\{36}$\=`wine GUIDGEN.exe`
>
> I have vim7.2 on Slackware.
you might try
command Guidgen :s$\%#[-[:xdigit:]]\{36}$\=system('GUIDGEN.exe')
instead.
Regards,
Jürgen
--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)