Monday, October 25, 2010

Re: Statusline with %b, %B and %O matching ga

On Mon, Oct 25, 2010 at 06:02:46PM -0700, Fernando Basso wrote:
> I'm currently using this line:
> :set statusline=%f\ Buffer=%n\ %m\ %h\ %r\ %=Filetype=%y\ Dec=%b\ Hex=
> %B\ %{printf("Oct=%03o",
> char2nr(matchstr(getline("."),'.',col(".")-1)))}\ Line=%l\ Col=%c\ %P
>
> It is giving the the message:
> E540: Unclosed expression sequence: statusline=%f\ Buffer=%n\ %m\ %h\
> %r\ %=Filetype=%y\ Dec=%b\ Hex=%B\ %{printf(
>
> :help E540 was not enough for me to understand what is wrong. I think
> I'm using that printf line wrongly.

Hmm, ran into the same. What about sth like this:

:func MyOct()
: return printf("Oct=%03o",char2nr(matchstr(getline("."),'.',col(".")-1)))
:endfunc

:set statusline=%f\ Buffer=%n\ %m\ %h\ %r\ %=Filetype=%y\ Dec=%b\ Hex=%B\ %{MyOct()}\ Line=%l\ Col=%c\ %P

flori

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment