views:

67

answers:

1

Hello!

I am using a lot applications from portableapps.com for work, and more particularly 7-zip portable and gVim portable.

I have set 7zip's external editor to gVimPortable.exe. It works perfectly when editing a file that is not inside an archive or compressed file… but it miserably fails when editing a file inside an archive or compressed file.

What happens is that 7-zip portable stores the file to a temporary place, launches gvimportable.exe, which forks and opens gvim.exe.

And some time after gvimportable.exe exits, I can see in Procmon that 7zFM.exe does a “SetDispositionInformationFile” (Details: “Delete: True”) that deletes the temporary file, and when gvim tries to open it, the file has been deleted.

Note that it works perfectly if I set the editor to NotepadPlusPlusportable.exe.

Do you have an explanation for this behaviour?

Please not that the -f option of gVimPortable.exe does not solve my problem.

+1  A: 

When gvim started as you say by default it forks and exits so 7z thinks that the edit has finished and deletes the file.

What you need is to pass the argument -f or --nofork to prevent this.

See the startup section in the gvim manual

rev1

add

let &guioptions = "gmrLtTf"

to _vimrc (Edit->Startup Settings)

Richard Harrison
Unfortunately, that portable version of gVim (gVimPortable.exe) does not support that `-f` option.
Benoit
have you tried calling the gvim.exe directly app\vim\vim71\gvim.exe -f <FILENAME>
Richard Harrison
This works! But unfortunately my vim preferences are not properly loaded…
Benoit
try telling it where to find the rc file, i.e. app\vim\vim71\gvim.exe -u <PATHTO>_gvimrc \temp\GVimPortable\_gvimrc -f <FILENAME>
Richard Harrison