Edward L. Fox wrote:
Hi VIMmers,

According to the user manual ":h statusline", we should be able to
evaluate a customized function to generate the statusline text:

-------------------- 8< --------------------
   When the option starts with "%!" then it is used as an expression,
   evaluated and the result is used as the option value.  Example:
       :set statusline=%!MyStatusLine()
    The result can contain %{} items that will be evaluated too.
-------------------- 8< --------------------

But...

-------------------- 8< --------------------
:function! MyStatusLine()
:    return 'test'
:endfunction
:set statusline=%!MyStatusLine()
-------------------- 8< --------------------

VIM complains:

E539: Illegal character <!>: statusline=%!MyStatusLine()

What seems to be the matter?


Regards,


Edward L. Fox


IIRC, %! is new in version 7. Are you by any chance using v7 help with a v6 executable?

Do ":help 'statusline'" then look at the replies to
   :echo expand("%:p")
   :set helpfile?
   :echo $VIMRUNTIME
   :echo version

On my gvim 7.0 for Linux I see respectively

/usr/local/share/vim/vim70/doc/options.txt
 helpfile=/usr/local/share/vim/vim70/doc/help.txt
/usr/local/share/vim/vim70
700

On other installations, /usr/local/share/vim may be replaced by something else, which should end in vim; but the version numbers in the 4 lines should agree.

See also http://vim.sourceforge.net/tips/tip.php?tip_id=848 about having more than one version of Vim coexisting peacefully on a single machine.


Best regards,
Tony.

Reply via email to