Saturday, March 23, 2013

Re: Can 'set ' be elided? When?

On 22/03/13 23:43, Dotan Cohen wrote:
> I notice that some settings use the format ':set name=value' and other
> use ':name value'. For instance:
> :set syntax=php
> :syntax off
>
> Can the string 'set ' always be safely elided? If not, then what are
> the guidelines?
>
> Thanks.
>
In addition to the replies you already got, (e.g. that ":set syntax=php"
sets an option while ":syntax php" gives error E410) I'll add that AFAIK
there is exactly one case where an option may be modified by name
without the word "set" being used, and that is in a modeline. Modelines,
however, are never typed at the keyboard, they are among the first or
last lines in the file to which they apply. There are two forms of
modelines: one uses "set" and can end before the end of the line (so it
can be used in a /* */ or <!-- --> comment without moving the comment
end marker to the next line), the other doesn't and can't. The last line
of helpfiles distributed with Vim is a modeline. For a more detailed
explanation, see
:help modeline
:help 'modeline'


Best regards,
Tony.
--
[The rest of the ARMY stand around looking at a loss.]
INSPECTOR END OF FILM: (picks up megaphone) All right! Clear off! Go on!
"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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment