gvim portable does not create swap files. this is important because these are used by gvim for file recovery.
i attempted to manually force the creation of swap files by adding these lines to my _vimrc file:
set updatecount=50
set updatetime=1000
no go.
any ideas on how to make gvim portable create swap files?
thanks,
david
I disabled this for portability reasons (so that the swap files don't get left there). Besides, I've had them disabled myself for a long time because they caused trouble. Looking back on it now, I could have modified the default vimrc file to
set dir=$TEMP
(which lands on the disk) and not pass -n. I might think about this for the next release.You can do it manually in the mean time by editing Other\Source\gVimPortable.nsi, line 137, and remove the "-n " argument from there, and then recompile it with NSIS Portable, then it'll work for you.
I am a Christian and a developer and moderator here.
“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1
"there" being the portable media?
what kind of trouble did you experience?
i would think you would want to set the swap file location to the gvim portable directory. that way if the system crashed the recoverable swap file would be with the portable media.
but as long as you were not passing "-n" then the local portable app directory can be specified in the vimrc file.
could you re-release gvim minus "-n" within the next two weeks?
thanks for that tip. unfortunately i'm not familiar with compiling with NSIS Portable. so i kind of need to wait until someone else recompiles gvim.
if you think it might take me less than half an hour to recompile gvim with NSIS Portable, point me to some explicit instructions and i'll work on it.
thanks,
david
[Reformatted to make it much more readable - mod Chris]
I disabled it so that swap files won't get left anywhere - the main drive or the USB drive.
I just had trouble with them in earlier versions of Vim which were less stable, and also didn't like having the swp files there (they got in the way with the tab order in Command Prompt and things like that). They (and the backup files which I disable) got in the way with backups too. Now I wouldn't mind so much having swap files again... but I'm happy with them off myself.
$TEMP goes inside gVimPortable\Data\temp, so if I did that it would end up in the gVim Portable directory. (Sorry, I wasn't clear with "disk".)
I don't think I'll re-release it; it's a very minor thing which most people won't care about. I'll wait till Vim 7.3... or 8... or whatever Bram releases next (if it was something important I'd redo it with the latest patch level, 284).
However, you can do it for yourself easily. Steps to do it:
-n
" from line 137.If you feel like it, you can even bypass steps 2c-5 by dragging gVimPortable.nsi to NSISPortable.exe.
I am a Christian and a developer and moderator here.
“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1
thanks for the step-by-step instructions.
once i recompile it could portableapps.com host it unofficially? i've downloaded many beta portable apps and have often noticed that they are hosted on sites other than portable apps. does portableapps.com have a policy of only hosting official releases?
thanks,
david
There's no real need for it to be hosted anywhere. No-one else has complained about it. Just do it for yourself and I'll think about how it's best to tackle it for the next release.
I am a Christian and a developer and moderator here.
“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1
I've also missed the swap files on gVim portable.
As the '-n' command line option is still present on gVim portable 7.3, it is possible to save the lines below as gVimPortable\Data\settings\_gvimrc, instead of recompiling it for each new version:
"================================================================
" gvimrc file
"================================================================
" This file is needed because gVim portable doesn't use swap files by
" default, as it is called using command line option '-n', which
" cause updatecount option being set to 0:
"
" From :h swapfile
" A swapfile will only be present when |'updatecount'| is non-zero and
" 'swapfile' is set.
"
" From :h updatecount
" 'updatecount' 'uc' number (default: 200)
" global
"
" 'updatecount' is set to zero by starting Vim with the "-n" option,
" see |startup|.
"
" From :h -n
"
" 'updatecount' is set to 0 AFTER executing commands from a
" vimrc file, but before the GUI initializations. Thus it
" overrides a setting for 'updatecount' in a vimrc file, but not
" in a gvimrc file. See |startup|.
set uc=200
when i attempted to use this technique with gvimportable 7.3 i did not see any swap files created.
-- david
the gvimportable.nsi file does not appear to be present in gvimportable 7.3. where can i find the gvimportable 7.3 files that i need in order to recompile with nsis portable?
thanks,
david
gVim Portable now uses the PortableApps.com Launcher which means its configuration is in App\AppInfo\Launcher and that alterations there will not need recompiling. You may remove the flag in there and it'll work fine (you'll need to remove it again after updating, as with the NSIS code technique).
I am a Christian and a developer and moderator here.
“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1