Re: user defined command n/a in Tiny mode, any has() +xxx reqired for that?

2006-07-21 Thread Yakov Lerner

[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

Use if 1 | endif  to wrap everything is possible, but not always, since
the script may use finish to terminate itself and attach some data after
the finish. In the Tiny version the finish is not possible, so the
script will execute into the data and got thousands of errors.


You can try
--- ~/.vimrc --
if 1  skipped on tiny vim
   source ~/.vimrc-full  skipped on tiny
   finish  skipped on tiny
endif
source ~/.vimrc-tiny
---
or
- ~/.vimrc -
source ~/.vimrc-tiny
if 1 skipped on tiny
   source ~/.vimrc-full skipped on tiny
endif skipped on tiny


Yakov


Re: user defined command n/a in Tiny mode, any has() +xxx reqired for that?

2006-07-20 Thread A.J.Mechelynck

[EMAIL PROTECTED] wrote:

Hi,

For some reason my .vimrc must works for multiple versions of Vim.

Now, I found that in Vim 6.1 Tiny version (shipped with Redhat 9), the
following does not work:

command! -nargs=+ TestCmd echo args
TestCmd my test

The vim saids: Not an editor command: TestCmd my test

It seems that the command define are not available for the Vim 6.1 Tiny
version, but when I :help command, it doesn't show any +xxx feature reqired
for define command.

It would be Okay to disable it in the Tiny version, but I just do not know
how. since it does not reqire +x feature, I cannot use if has() endif
to wrap it.

Any work around?

--
Sincerely, Pan, Shi Zhu. ext: 2606





Under :help +feature-list (with the plus sign) we see that there is a 
+user_commands feature which require Normal version (or bigger).


Also, remember that it's hard to effectively test for Tiny version, 
since they cannot do expression evaluation, and everything from :if to 
:endif will be disregarded (on both sides of the else). The only 
possibility I see is something like this (untested):



- 8  killtiny.vim
if 1
 we got expression evaluation: OK
finish
endif
set more cmdheight=1
echoerr Tiny version -- abort
echoerr !!!
echoerr !!!
echoerr !!!
qall!
- 8 -

Invoke it with

source killtiny.vim

in order to abort Vim (with an error message) if a Tiny version is being 
used.


Or if you just want to disable soe statements in a Tiny version, wrap 
them between :if 1 and :endif. (For a function: the definition _and_ 
every invocation will probably need to be wrapped that way.)



Best regards,
Tony.