Sunday, October 7, 2012

Re: Detecting 'view'

On 06/10/12 13:01, Christian Brabandt wrote:
> Hi Paul!
>
> On Sa, 06 Okt 2012, Paul wrote:
>
>> In .vimrc, how can I detect whether vim was invoked as 'view'? Looking
>> for &readonly also matched when doing :help from within 'vim', which I
>> don't want, eg:
>
> :h v:progname
>
> Mit freundlichen Grüßen
> Christian
>

You (Paul) may want to test against a regaxp, e.g.

if v:progname =~ 'view'

in order to catch gview, rview, or "view with any additional trailing
characters" (which Vim will treat as invoking it as view).


Best regards,
Tony.
--
LAUNCELOT: I am, sir. I am a Knight of King Arthur.
FATHER: 'Mm ... very nice castle, Camelot ... very good pig country....
"Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD

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