Wednesday, May 18, 2011

Re: set GUI font inside function

On Wed, May 18, 2011 11:05 am, Vladimir Rybas wrote:
> But when I'm using external monitor, I want my font to be bigger than 10.
> So
> I want to pass the font size as parameter. I've tried
>
> fun! DarkScheme(n)
> colorscheme molokai
> set gfn="Monaco ".a:n
> " and set gfn="Monaco\ ".a:n
> " and also set gfn=Monaco\ a:n
> call DarkIndentGuides()
> endf
>
> but it's not working. It ignores the font size in any of these examples.
> How
> do I do that? Thanks!

the set can't handle expressions. You want to evaluate an expression
and use the result as an ex command. Therefore, use the :exe command,
e.g. :exe "set gfn=Monaco " . a:n or alternatively use
:let &gfn="Monaco " . a:n

regards,
Christian

--
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: