Re: vim -u NONE
On Fri 6-Oct-06 12:38pm -0600, Yakov Lerner wrote: > On 10/6/06, Bill McCarthy <[EMAIL PROTECTED]> wrote: >> On Thu 5-Oct-06 8:54pm -0600, Gary Johnson wrote: >> >> > gvim -u NONE -i NONE -N >> > Setting "-u NONE -i NONE -N" is all that's needed. See ":help -u". > I never noticed that 'vim -u NONE' ever read the .viminfo ? It doesn't, you're in 'cp' mode and 'viminfo' is empty. > For example, if I set 'set nocp' in 'vim -u NONE' then I don't > see any command history that I'd see had .viminfo been read in. That's the problem. As soon as you change to 'nocp' mode, 'viminfo' is populated. When you close, the viminfo file is overwritten. > Do you see any difference between 'vim -u NONE' and 'vi -u NONE -i' ? (Assuming the second is 'vim -u NONE -i NONE'.) Both come up in compatibility "mode." If that is changed to 'nocp' during the session, the chance of overwriting an existing viminfo file is greatly reduced by the second approach. -- Best regards, Bill
Re: vim -u NONE
Yakov Lerner wrote: On 10/6/06, A.J.Mechelynck <[EMAIL PROTECTED]> wrote: Peter Hodge wrote: [...] > I wouldn't think the -i option is necessary, because 'viminfo' is empty by > default anyway. [...] The 'viminfo' option is not empty by default, except in 'compatible' mode (see -u option forces 'compatible' on. Thus I an pretty sure -i is redundant if added to -u NONE. -n NONE forces 'compatible' and thus empty 'viminfo'. Yakov It forces 'compatible' on, unless -N is also used. Now go back to the example given (by Bill McCarthy on 5-Oct-2006 at 15:59:34 -0500) and you'll see that it was "gvim -u NONE -i NONE -N". In this case "-i NONE" is not redundant, because -N forces 'nocompatible': - If the "-N" command line argument is given, 'nocompatible' will be used, even when no vimrc file exists. (*starting.txt* For Vim version 7.0. Last change: 2006 Sep 01, lines 920-921). I just tried it to check: started Vim with -u NONE -N but without any -i argument. Immediately after startup: :set vi? viminfo='20,<50,s10,h which is the 'nocompatible' default for Unix, and implies a viminfo file at ~/.viminfo. And the viminfo is read too, as shown by the many registers listed by ":reg". Adding "-i NONE" doesn't change the 'viminfo' option but it does prevent the file from being read, as can be seen from the fact that ":reg" lists no other registers than * + : Best regards, Tony.
Re: vim -u NONE
On 10/6/06, A.J.Mechelynck <[EMAIL PROTECTED]> wrote: Peter Hodge wrote: [...] > I wouldn't think the -i option is necessary, because 'viminfo' is empty by > default anyway. [...] The 'viminfo' option is not empty by default, except in 'compatible' mode (see -u option forces 'compatible' on. Thus I an pretty sure -i is redundant if added to -u NONE. -n NONE forces 'compatible' and thus empty 'viminfo'. Yakov
Re: vim -u NONE
On 10/6/06, Bill McCarthy <[EMAIL PROTECTED]> wrote: On Thu 5-Oct-06 8:54pm -0600, Gary Johnson wrote: >> > gvim -u NONE -i NONE -N > Setting "-u NONE -i NONE -N" is all that's needed. See ":help -u". I never noticed that 'vim -u NONE' ever read the .viminfo ? For example, if I set 'set nocp' in 'vim -u NONE' then I don't see any command history that I'd see had .viminfo been read in. Do you see any difference between 'vim -u NONE' and 'vi -u NONE -i' ? Yakov
Re: vim -u NONE
Peter Hodge wrote: [...] I wouldn't think the -i option is necessary, because 'viminfo' is empty by default anyway. [...] The 'viminfo' option is not empty by default, except in 'compatible' mode (see ":help 'viminfo'"): 'compatible' default: viminfo= MS-DOS, Windows, OS/2 'nocompatible' default: viminfo='20,<50,s10,h,rA:,rB: Amiga 'nocompatible' default: viminfo='20,<50,s10,h,rdf0:,rdf1:rdf2: 'nocompatible' default on other platforms: viminfo='20,<50,s10,h All of these 'nocompatible' defaults implicitly reference a viminfo file named ~/_viminfo (on Dos/Windows), s:.viminfo (on the Amiga) or ~/.viminfo (on other systems including OS/2) -- unless of course the +viminfo feature was not compiled-in. "-i NONE" explicitly prevents reading or writing any viminfo file, regardless of any other settings (such as 'viminfo') or commands (such as ":rviminfo" or ":wviminfo"). Best regards, Tony.
Re: vim -u NONE
On Fri 6-Oct-06 12:15am -0600, Gary Johnson wrote: > I also found this under ":help gui-init": > > To skip loading the system menu include 'M' in 'guioptions'. > > So to avoid loading _anything_, at the expense of not having any > menus, one could start gvim as > > gvim -N -u NONE -i NONE --cmd 'set go+=M' Since I use Gvim with no menu - much better syntax highlighting than Vim - my vimrc has set guioptions=M which speeds up loading a bit. I also have a toggle in gvimrc which, upon being toggled for the first time, includes: source $vimruntime\menu.vim However, when I'm running Gvim to be as virgin as possible, I keep the menu. My actual aliases do the following (revised after wading through all the existing startup docs and experimenting with -V a few weekends ago): gvim.exe -u NONE -i NONE -N --cmd "se rtp=$VIMRUNTIME" "+so $vim\_minrc" and vim.exe -u NONE -i NONE -N "+so $vim\_minrc" where _minrc does some simple things like shut off bells and screen flashing, gives me my normal 'rtp' and 'stl', and sets 'gfn' (if has("GUI")) for normal and vimdiff. -- Best regards, Bill
Re: vim -u NONE
On 2006-10-05, Bill McCarthy <[EMAIL PROTECTED]> wrote: > On Thu 5-Oct-06 8:54pm -0600, Gary Johnson wrote: > > > > On 2006-10-06, Peter Hodge <[EMAIL PROTECTED]> wrote: > >> > BTW, using > >> > > >> > gvim -u NONE -U NONE > >> > > >> > is both redundant (in the case of -U NONE), dangerous (since > >> > default settings may truncate your viminfo on exit), and put > >> > you in vi compatible mode. Better is: > >> > > >> > gvim -u NONE -i NONE -N > >> > > >> > >> I wouldn't think the -i option is necessary, because 'viminfo' is > >> empty by default anyway. Perhaps there should be a shell script > >> distributed with vim so that anyone can start up vim cleanly. > >> > >> cleanvim.sh: > >> vim -u NONE -i NONE -N --noplugin --cmd 'set rtp=$VIMRUNTIME' '+set > >> rtp&' > >> > >> cleanvim.bat: > >> gvim.exe -u NONE -i NONE -N --noplugin --cmd "set rtp=$VIMRUNTIME" > >> "+set rtp&" > > > > Setting "-u NONE -i NONE -N" is all that's needed. See ":help -u". > > > > When {vimrc} is equal to "NONE" (all uppercase), all > > initializations from files and environment variables are > > skipped, including reading the |gvimrc| file when the GUI > > starts. Loading plugins is also skipped. > > > > The viminfo file may be empty initially, but it probably is not once > > vim has been run. > > Gary, the reason I use and suggested > >--cmd "se rtp=$VIMRUNTIME" > > is to prevent customizations such as adding all of your > colorschemes, compilers, etc. in the Gvim menus, custom > icons, etc. --cmd happens before menu.vim is sourced. > > The reason I use: > > "+se rtp&" > > is to have 'rtp' set as by default but without the side > effects mentioned above. > > :h startup > > For "fun" start with the above but without the --cmd above > but add -V99nocmd. Then include the --cmd above and with > -V99wcmd. Finally do a vimdiff on nocmd and wcmd. Well, I stand corrected. Thanks for explaining that. I was sure that "-u NONE -i NONE -N" was as sufficient for gvim as it is for vim. I had no idea that gvim was so insistent on loading certain files. Sure enough, under ":help -U" it says: Exception: Reading the system-wide menu file is always done. But unfortunately it doesn't go on to say that this implies that 'rtp' will be searched for certain other files, e.g., autoload/paste.vim. I also found this under ":help gui-init": To skip loading the system menu include 'M' in 'guioptions'. So to avoid loading _anything_, at the expense of not having any menus, one could start gvim as gvim -N -u NONE -i NONE --cmd 'set go+=M' Regards, Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Wireless Division | Spokane, Washington, USA
Re: vim -u NONE
On Thu 5-Oct-06 8:54pm -0600, Gary Johnson wrote: > On 2006-10-06, Peter Hodge <[EMAIL PROTECTED]> wrote: >> > BTW, using >> > >> > gvim -u NONE -U NONE >> > >> > is both redundant (in the case of -U NONE), dangerous (since >> > default settings may truncate your viminfo on exit), and put >> > you in vi compatible mode. Better is: >> > >> > gvim -u NONE -i NONE -N >> > >> >> I wouldn't think the -i option is necessary, because 'viminfo' is >> empty by default anyway. Perhaps there should be a shell script >> distributed with vim so that anyone can start up vim cleanly. >> >> cleanvim.sh: >> vim -u NONE -i NONE -N --noplugin --cmd 'set rtp=$VIMRUNTIME' '+set rtp&' >> >> cleanvim.bat: >> gvim.exe -u NONE -i NONE -N --noplugin --cmd "set rtp=$VIMRUNTIME" "+set >> rtp&" > > Setting "-u NONE -i NONE -N" is all that's needed. See ":help -u". > > When {vimrc} is equal to "NONE" (all uppercase), all > initializations from files and environment variables are > skipped, including reading the |gvimrc| file when the GUI > starts. Loading plugins is also skipped. > > The viminfo file may be empty initially, but it probably is not once > vim has been run. Gary, the reason I use and suggested --cmd "se rtp=$VIMRUNTIME" is to prevent customizations such as adding all of your colorschemes, compilers, etc. in the Gvim menus, custom icons, etc. --cmd happens before menu.vim is sourced. The reason I use: "+se rtp&" is to have 'rtp' set as by default but without the side effects mentioned above. :h startup For "fun" start with the above but without the --cmd above but add -V99nocmd. Then include the --cmd above and with -V99wcmd. Finally do a vimdiff on nocmd and wcmd. -- Best regards, Bill
Re: vim -u NONE
On Thu 5-Oct-06 8:20pm -0600, Peter Hodge wrote: >> BTW, using >> >> gvim -u NONE -U NONE >> >> is both redundant (in the case of -U NONE), dangerous (since >> default settings may truncate your viminfo on exit), and put >> you in vi compatible mode. Better is: >> >> gvim -u NONE -i NONE -N > I wouldn't think the -i option is necessary, because 'viminfo' is empty by > default anyway. The first time you use vim that's true. So if you are not planning to use it more than once, you are OK. :h viminfo > Perhaps there should be a shell script distributed with vim so > that anyone can start up vim cleanly. > > cleanvim.sh: > vim -u NONE -i NONE -N --noplugin --cmd 'set rtp=$VIMRUNTIME' '+set rtp&' > > cleanvim.bat: > gvim.exe -u NONE -i NONE -N --noplugin --cmd "set rtp=$VIMRUNTIME" "+set > rtp&" The '--noplugin' is redundant. :h -u :h --noplugin -- Best regards, Bill
Re: vim -u NONE (was: Re: Vim 7.0 (1-109 patches) completion bug.)
On 2006-10-06, Peter Hodge <[EMAIL PROTECTED]> wrote: > > BTW, using > > > > gvim -u NONE -U NONE > > > > is both redundant (in the case of -U NONE), dangerous (since > > default settings may truncate your viminfo on exit), and put > > you in vi compatible mode. Better is: > > > > gvim -u NONE -i NONE -N > > > > I wouldn't think the -i option is necessary, because 'viminfo' is > empty by default anyway. Perhaps there should be a shell script > distributed with vim so that anyone can start up vim cleanly. > > cleanvim.sh: > vim -u NONE -i NONE -N --noplugin --cmd 'set rtp=$VIMRUNTIME' '+set rtp&' > > cleanvim.bat: > gvim.exe -u NONE -i NONE -N --noplugin --cmd "set rtp=$VIMRUNTIME" "+set > rtp&" Setting "-u NONE -i NONE -N" is all that's needed. See ":help -u". When {vimrc} is equal to "NONE" (all uppercase), all initializations from files and environment variables are skipped, including reading the |gvimrc| file when the GUI starts. Loading plugins is also skipped. The viminfo file may be empty initially, but it probably is not once vim has been run. Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Wireless Division | Spokane, Washington, USA
vim -u NONE (was: Re: Vim 7.0 (1-109 patches) completion bug.)
> BTW, using > > gvim -u NONE -U NONE > > is both redundant (in the case of -U NONE), dangerous (since > default settings may truncate your viminfo on exit), and put > you in vi compatible mode. Better is: > > gvim -u NONE -i NONE -N > I wouldn't think the -i option is necessary, because 'viminfo' is empty by default anyway. Perhaps there should be a shell script distributed with vim so that anyone can start up vim cleanly. cleanvim.sh: vim -u NONE -i NONE -N --noplugin --cmd 'set rtp=$VIMRUNTIME' '+set rtp&' cleanvim.bat: gvim.exe -u NONE -i NONE -N --noplugin --cmd "set rtp=$VIMRUNTIME" "+set rtp&" regards, Peter On Yahoo!7 Men's Health: What music do you want to hear on Men's Health Radio? http://www.menshealthmagazine.com.au/