Loading ...
Sorry, an error occurred while loading the content.

Re: Can 'set ' be elided? When?

Expand Messages
  • Dotan Cohen
    ... Why is syntax an option yet colorscheme a command? -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- -- You received this message from
    Message 1 of 10 , Mar 31, 2013
    • 0 Attachment
      On Sat, Mar 23, 2013 at 12:58 AM, Paul Isambert <zappathustra@...> wrote:
      >> I notice that some settings use the format ':set name=value' and other
      >> use ':name value'. For instance:
      >> :set syntax=php
      >> :syntax off
      >
      > Note that ":syntax php" doesn't work.
      >
      >> Can the string 'set ' always be safely elided?
      >
      > No.
      >
      >> If not, then what are the guidelines?
      >
      > As far as I can tell, there aren't any. Some commands have the same name as
      > options (e.g. :filetype and 'filetype', :confirm and 'confirm'), but they don't
      > do the same things.
      >
      > Best,
      > Paul
      >

      I notice that the following doesn't work:
      :syntax php

      However the following does work:
      :colorscheme desert

      Why is "syntax" an option yet "colorscheme" a command?



      --
      Dotan Cohen

      http://gibberish.co.il
      http://what-is-what.com

      --
      --
      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@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Christian Brabandt
      Hi Dotan! ... Probably because colorschemes do not change the behaviour of Vim but rather change its appearance. But who really knows the reasoning why some
      Message 2 of 10 , Mar 31, 2013
      • 0 Attachment
        Hi Dotan!

        On So, 31 Mär 2013, Dotan Cohen wrote:

        > I notice that the following doesn't work:
        > :syntax php
        >
        > However the following does work:
        > :colorscheme desert
        >
        > Why is "syntax" an option yet "colorscheme" a command?

        Probably because colorschemes do not change the behaviour of Vim but
        rather change its appearance.

        But who really knows the reasoning why some commands are not options?

        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

        ---
        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@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Dotan Cohen
        ... Thank you. I did not realize that syntax actually changes the behaviour of VIM. I suppose that it could change things like indentation. -- Dotan Cohen
        Message 3 of 10 , Mar 31, 2013
        • 0 Attachment
          On Sun, Mar 31, 2013 at 7:34 PM, Christian Brabandt <cblists@...> wrote:
          >> Why is "syntax" an option yet "colorscheme" a command?
          >
          > Probably because colorschemes do not change the behaviour of Vim but
          > rather change its appearance.
          >
          > But who really knows the reasoning why some commands are not options?
          >

          Thank you. I did not realize that syntax actually changes the
          behaviour of VIM. I suppose that it could change things like
          indentation.


          --
          Dotan Cohen

          http://gibberish.co.il
          http://what-is-what.com

          --
          --
          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@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Christian Brabandt
          Hi Dotan! ... Yes, loading syntax files could e.g. change the isk setting so syntax highlighting works better, but this might have other side effects. So in
          Message 4 of 10 , Mar 31, 2013
          • 0 Attachment
            Hi Dotan!

            On So, 31 Mär 2013, Dotan Cohen wrote:

            > On Sun, Mar 31, 2013 at 7:34 PM, Christian Brabandt <cblists@...> wrote:
            > >> Why is "syntax" an option yet "colorscheme" a command?
            > >
            > > Probably because colorschemes do not change the behaviour of Vim but
            > > rather change its appearance.
            > >
            > > But who really knows the reasoning why some commands are not options?
            > >
            >
            > Thank you. I did not realize that syntax actually changes the
            > behaviour of VIM. I suppose that it could change things like
            > indentation.

            Yes, loading syntax files could e.g. change the 'isk' setting so syntax
            highlighting works better, but this might have other side effects. So in
            fact setting syntax (and therefore loading a special syntax file) might
            in fact change the behaviour of Vim.

            Actually I think the syntax option is a bad example here, since
            :set syntax?
            might not always give the exact syntax setting that is used.

            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

            ---
            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@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Tony Mechelynck
            ... There is both a :syntax command and a syntax option, and they are not ... also other variants ... etc. Most of the variants of this command are for use
            Message 5 of 10 , Mar 31, 2013
            • 0 Attachment
              On 31/03/13 17:24, Dotan Cohen wrote:
              > On Sat, Mar 23, 2013 at 12:58 AM, Paul Isambert <zappathustra@...> wrote:
              >>> I notice that some settings use the format ':set name=value' and other
              >>> use ':name value'. For instance:
              >>> :set syntax=php
              >>> :syntax off
              >>
              >> Note that ":syntax php" doesn't work.
              >>
              >>> Can the string 'set ' always be safely elided?
              >>
              >> No.
              >>
              >>> If not, then what are the guidelines?
              >>
              >> As far as I can tell, there aren't any. Some commands have the same name as
              >> options (e.g. :filetype and 'filetype', :confirm and 'confirm'), but they don't
              >> do the same things.
              >>
              >> Best,
              >> Paul
              >>
              >
              > I notice that the following doesn't work:
              > :syntax php
              >
              > However the following does work:
              > :colorscheme desert
              >
              > Why is "syntax" an option yet "colorscheme" a command?
              >
              >
              >
              > --
              > Dotan Cohen
              >
              > http://gibberish.co.il
              > http://what-is-what.com
              >

              There is both a :syntax command and a 'syntax' option, and they are not
              interchangeable: The command can be:

              :syntax on
              :syntax off
              :syntax enable
              :syntax list " with optional arguments
              :syntax sync fromstart
              :syntax sync clear
              :syntax sync ccomment
              " also other variants
              :syntax sync " with no arguments: "tell me"

              etc. Most of the variants of this command are for use in syntax scripts,
              to define how the particular syntax of a certain filetype must be
              highlighted. ":syntax on" can be used in your vimrc to enable syntax
              highlighting. ":syntax sync" with no arguments and ":syntax list" are
              used from the keyboard, to request information.



              The 'syntax' option is something else: it defines which named syntax
              applies to a given file. It can be set, usually by ":setlocal"; normally
              this is done automatically as part of the FileType event handling. You
              can also do it manually, for instance

              :setlocal syntax=

              to remove all syntax highlighting for one editfile only, until it is
              reloaded.



              As for the :colorscheme command, ":colorscheme foobar" is approximately
              equivalent with (IIUC) ":doautocmd ColorScheme foobar | runtime
              colors/foobar.vim" which is also a command. If you want to determine
              which colorscheme is in use, you should check the global variable
              colors_name which every properly constructed colorscheme will set to its
              own filename (without the path and the .vim extension). You can do that
              with ":colorscheme" with no argument, which (in a Vim with +eval
              compiled-in) does something similar to ":if exists('g:colors_name') |
              echo g:colors_name | else | echo 'default' | endif", another command.


              Best regards,
              Tony.
              --
              LETTERS TO THE EDITOR (The Times of London)

              Dear Sir,

              I am firmly opposed to the spread of microchips either to the home or
              to the office. We have more than enough of them foisted upon us in
              public places. They are a disgusting Americanism, and can only result
              in the farmers being forced to grow smaller potatoes, which in turn
              will cause massive unemployment in the already severely depressed
              agricultural industry.

              Yours faithfully,
              Capt. Quinton D'Arcy, J. P.
              Sevenoaks

              --
              --
              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@....
              For more options, visit https://groups.google.com/groups/opt_out.
            Your message has been successfully submitted and would be delivered to recipients shortly.