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

apache html.conf syntax

Expand Messages
  • Allan Kelly
    Hello, hacked up this apache.vim syntax file on the train last night. It should be loaded for http.conf, srm.conf and access.conf files It could be enormously
    Message 1 of 24 , Jan 22, 2000
    • 0 Attachment
      Hello, hacked up this apache.vim syntax file on the train last night. It should
      be loaded for http.conf, srm.conf and access.conf files

      It could be enormously improved I'm sure, but WTF it done the job.

      al.

      --
      # Allan Kelly
      # (+44) (0)131 524 8500 ext 241
      # allan.kelly@...... ..
      # /Software Engineer/i . . . . .
      # ------------------------------ * . . . . .
      # "If you are a Visual Basic programmer, * . . .
      # these details are none of your business." * . . .
      # Mr Bunny's Guide to Active X, by Carlton Egremont III * . .
      # ------------------------------ vi: set noet tw=80 sts=4 ts=8 : .
    • Johannes Zellner
      ... did you notice that there s an apachestyle.vim that comes with 5.6 already ? -- Johannes
      Message 2 of 24 , Jan 22, 2000
      • 0 Attachment
        On Sat, 22 Jan 2000, Allan Kelly wrote:

        > Hello, hacked up this apache.vim syntax file on the train last night. It should
        > be loaded for http.conf, srm.conf and access.conf files
        >
        > It could be enormously improved I'm sure, but WTF it done the job.
        >
        did you notice that there's an apachestyle.vim that comes with
        5.6 already ?

        --
        Johannes
      • Allan Kelly
        ... Ah, no I haven t put 5.6 on my server yet. (I ll do that now). Sounds like my file might still be useful, so in that case... ... removed. ... Yes,
        Message 3 of 24 , Jan 24, 2000
        • 0 Attachment
          On Sat, 22 Jan 2000, you wrote:
          > Allan -
          >
          > > Hello, hacked up this apache.vim syntax file on the train last night. It
          > > should be loaded for http.conf, srm.conf and access.conf files
          > >
          > > It could be enormously improved I'm sure, but WTF it done the job.
          >
          > Are you aware of the apachestyle.vim syntax file? Yours is much more
          > specific, obviously. But perhaps it should be called "apacheconf"? A bit
          > long though...

          Ah, no I haven't put 5.6 on my server yet. (I'll do that now). Sounds like my
          file might still be useful, so in that case...

          > You set the 'comments' option. I don't like the syntax files to have side
          > effects. I hope to move settings like this to another place in Vim 6.0.

          removed.

          > I could include this in the distribution, but the commented-out lines at the
          > bottom need to be changed.

          Yes, commented out for debugging, forgot to reinstate. Done in this version
          (attached).

          chrrs, al.

          --
          # Allan Kelly
          # (+44) (0)131 524 8500 ext 241
          # allan.kelly@...... ..
          # /Software Engineer/i . . . . .
          # ------------------------------ * . . . . .
          # "If you are a Visual Basic programmer, * . . .
          # these details are none of your business." * . . .
          # Mr Bunny's Guide to Active X, by Carlton Egremont III * . .
          # ------------------------------ vi: set noet tw=80 sts=4 ts=8 : .
        • Bram Moolenaar
          ... It looks like your syntax file and the existing apachestyle syntax file are for the same file types. Why include both? Perhaps we can use one
          Message 4 of 24 , Jan 24, 2000
          • 0 Attachment
            Allan Kelly wrote:

            > > Are you aware of the apachestyle.vim syntax file? Yours is much more
            > > specific, obviously. But perhaps it should be called "apacheconf"? A bit
            > > long though...
            >
            > Ah, no I haven't put 5.6 on my server yet. (I'll do that now). Sounds like my
            > file might still be useful, so in that case...

            It looks like your syntax file and the existing apachestyle syntax file are
            for the same file types. Why include both? Perhaps we can use one
            "apache.vim" instead of "apachestyle.vim" and "apacheconf.vim"?

            --
            Proverb: A nightingale that forgets the lyrics is a hummingbird.

            /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
            \ \ Vim: http://www.vim.org ICCF Holland: http://www.vim.org/iccf / /
          • Arnaud Launay
            ... Hmm, I don t think so. It s your instead of which makes me screaming :) Goal here is to define whether apacheconf.vim is destined to replace apachestyle
            Message 5 of 24 , Jan 26, 2000
            • 0 Attachment
              On Mon, Jan 24, 2000 at 02:24:47PM +0100, Bram Moolenaar wrote:
              > It looks like your syntax file and the existing apachestyle syntax file are
              > for the same file types. Why include both? Perhaps we can use one
              > "apache.vim" instead of "apachestyle.vim" and "apacheconf.vim"?

              Hmm, I don't think so. It's your "instead of" which makes me
              screaming :)

              Goal here is to define whether apacheconf.vim is destined to
              replace apachestyle or to supply apache-only oriented file. If it
              is designed to be apache-only, which I don't think, then we must
              keep 'em separated. Else, merging the two could be something fine,
              but I actually like apachestyle file. Maybe, Allan could contact
              Christian in order to see with him what to do, as he's
              apachestyle author ?

              Arnaud.
            • Bram Moolenaar
              ... Finally a reaction! I was wondering if anybody cared about this. ... It s the name apachestyle that is confusing. This suggests it is for the Apache
              Message 6 of 24 , Jan 28, 2000
              • 0 Attachment
                Arnaud Launay wrote:

                > On Mon, Jan 24, 2000 at 02:24:47PM +0100, Bram Moolenaar wrote:
                > > It looks like your syntax file and the existing apachestyle syntax file are
                > > for the same file types. Why include both? Perhaps we can use one
                > > "apache.vim" instead of "apachestyle.vim" and "apacheconf.vim"?
                >
                > Hmm, I don't think so. It's your "instead of" which makes me
                > screaming :)

                Finally a reaction! I was wondering if anybody cared about this.

                > Goal here is to define whether apacheconf.vim is destined to
                > replace apachestyle or to supply apache-only oriented file. If it
                > is designed to be apache-only, which I don't think, then we must
                > keep 'em separated. Else, merging the two could be something fine,
                > but I actually like apachestyle file.

                It's the name "apachestyle" that is confusing. This suggests it is for the
                Apache style files. Then using "apacheconf" would suggest we have two types
                of files for Apache, which is not the case.

                So, we have two kinds of files:
                - A generic one for config files like the one Apache uses.
                - A specific one for Apache config files.

                Is this correct?

                Perhaps the second one can just be called "apache.vim". It would be used for
                the files matching httpd.conf*,srm.conf*,access.conf*. The generic one could
                be called "config.vim" or something like that. Would it be used for
                proftpd.conf*? Perhaps a few others. Not all *.conf, people already
                complained that too many files would be highlighted in a wrong way.

                > Maybe, Allan could contact Christian in order to see with him what to do, as
                > he's apachestyle author ?

                It's always better if the maintainers work out their own syntax files.

                --
                Yesterday is history.
                Tomorrow is a mystery.
                Today is a gift.
                That's why it is called 'present'.

                /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
                \ \ Vim: http://www.vim.org ICCF Holland: http://www.vim.org/iccf / /
              • Johannes Zellner
                On Fri, 28 Jan 2000, Bram Moolenaar wrote: [...] ... [...] what about an even more generic one. Many of the system configuration files (on UNIX) have # s
                Message 7 of 24 , Jan 28, 2000
                • 0 Attachment
                  On Fri, 28 Jan 2000, Bram Moolenaar wrote:

                  [...]
                  > So, we have two kinds of files:
                  > - A generic one for config files like the one Apache uses.
                  > - A specific one for Apache config files.
                  [...]

                  what about an even more generic one. Many of the system
                  configuration files (on UNIX) have #'s starting a comment.
                  what about (at the very end of scripts.vim)

                  " eventyally fallback to system scripts
                  elseif getline(1) =~ '^#' && exists("g:enable_system_scripts")
                  set ft=system

                  and a `syntax/system.vim' file which would mainly highlight
                  lines beginning with a '#' mark as comments.

                  The user (root) would have to enable this with
                  let g:enable_system_scripts=1


                  --
                  Johannes
                • Bram Moolenaar
                  ... Well, I think that no highlighting is better than wrong highlighting. It s easier to do :set ft=config than to disable it when it s wrong again. -- TALL
                  Message 8 of 24 , Jan 28, 2000
                  • 0 Attachment
                    Johannes Zellner wrote:

                    > what about an even more generic one. Many of the system
                    > configuration files (on UNIX) have #'s starting a comment.
                    > what about (at the very end of scripts.vim)
                    >
                    > " eventyally fallback to system scripts
                    > elseif getline(1) =~ '^#' && exists("g:enable_system_scripts")
                    > set ft=system
                    >
                    > and a `syntax/system.vim' file which would mainly highlight
                    > lines beginning with a '#' mark as comments.
                    >
                    > The user (root) would have to enable this with
                    > let g:enable_system_scripts=1

                    Well, I think that no highlighting is better than wrong highlighting. It's
                    easier to do ":set ft=config" than to disable it when it's wrong again.

                    --
                    TALL KNIGHT: Firstly. You must get us another shrubbery!
                    OTHER KNIGHTS: More shrubberies! More shrubberies for the ex-Knights of Ni!
                    ARTHUR: Not another shrubbery -
                    "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                    /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
                    \ \ Vim: http://www.vim.org ICCF Holland: http://www.vim.org/iccf / /
                  • Arnaud Launay
                    ... Hmmmmm -- just give me an example of file beginning by # and not to be a script where # marks comments ? From my point of view, this could be fine. Oh,
                    Message 9 of 24 , Jan 29, 2000
                    • 0 Attachment
                      On Fri, Jan 28, 2000 at 09:59:19PM +0100, Bram Moolenaar wrote:
                      > > The user (root) would have to enable this with
                      > > let g:enable_system_scripts=1
                      >
                      > Well, I think that no highlighting is better than wrong highlighting. It's
                      > easier to do ":set ft=config" than to disable it when it's wrong again.

                      Hmmmmm -- just give me an example of file beginning by "#" and
                      not to be a script where # marks comments ?
                      From my point of view, this could be fine.

                      Oh, another bug, when composing this mail under vim 5.6, the
                      preceding line, beginning by "From", is highlighted, as if it was
                      the one in the headers. This is not good...

                      Arnaud.
                    • Arnaud Launay
                      ... From blablabla not From . I dunno why there is this there :) Arnaud.
                      Message 10 of 24 , Jan 29, 2000
                      • 0 Attachment
                        On Sat, Jan 29, 2000 at 11:10:45PM +0100, Arnaud Launay wrote:
                        > Hmmmmm -- just give me an example of file beginning by "#" and
                        > not to be a script where # marks comments ?
                        > >From my point of view, this could be fine.
                        >
                        > Oh, another bug, when composing this mail under vim 5.6, the

                        From blablabla

                        not ">From". I dunno why there is this ">" there :)

                        Arnaud.
                      • Bram Moolenaar
                        Arnaud Launay - ... C files. When they are not recognized as a C file (no .c or .h extension), you don t want preprocessor lines to become colored like
                        Message 11 of 24 , Jan 30, 2000
                        • 0 Attachment
                          Arnaud Launay -

                          > > Well, I think that no highlighting is better than wrong highlighting. It's
                          > > easier to do ":set ft=config" than to disable it when it's wrong again.
                          >
                          > Hmmmmm -- just give me an example of file beginning by "#" and
                          > not to be a script where # marks comments ?

                          C files. When they are not recognized as a C file (no .c or .h extension),
                          you don't want preprocessor lines to become colored like Comments. It should
                          remain B&W. Hopefully the C file name does not trigger the config filetype.
                          But a C file could have any name, like "conf".

                          > >From my point of view, this could be fine.
                          >
                          > Oh, another bug, when composing this mail under vim 5.6, the
                          > preceding line, beginning by "From", is highlighted, as if it was
                          > the one in the headers. This is not good...

                          This has been discussed before. It could be made that "From" lines are not
                          highlighted, but then a digest or mbox file will not have the "From" lines
                          highlighted. It could be made such that only "From:" lines are highlighted.
                          I would prefer not to highlight "From" lines, but I'm not the maintainer of
                          that file.

                          --
                          BROTHER MAYNARD: Armaments Chapter Two Verses Nine to Twenty One.
                          ANOTHER MONK: And St. Attila raised his hand grenade up on high saying "O
                          Lord bless this thy hand grenade that with it thou mayest
                          blow thine enemies to tiny bits, in thy mercy. "and the Lord
                          did grin and people did feast upon the lambs and sloths and
                          carp and anchovies and orang-utans and breakfast cereals and
                          fruit bats and...
                          BROTHER MAYNARD: Skip a bit brother ...
                          "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                          /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
                          \ \ Vim: http://www.vim.org ICCF Holland: http://www.vim.org/iccf / /
                        • Allan Kelly
                          Hello all, The 2 candidates for apache syntax are an apache-specific thing I threw together one evening on a train, and (already included with 5.6)
                          Message 12 of 24 , Jan 30, 2000
                          • 0 Attachment
                            Hello all,

                            The 2 candidates for apache syntax are an apache-specific thing I threw
                            together one evening on a train, and (already included with 5.6)
                            apachestyle.conf which is a generic 'pattern-based' file by Christian
                            Hammers; I would hazard a guess that Christian hasn't too much emotional
                            investment in his file either. My file is called apacheconf.vim, and was
                            posted recently.

                            The Big Daddy of syntax files is proly c.vim, and the Big Mama is vim.vim.
                            c.vim is spectacularly pattern-based, whilst containing a great deal of
                            'syn keyword's and vim.vim is equally spectacularly 'syn keyword' based,
                            whilst containing it's fair share of patterns.

                            Using keywords is great because it aids in debugging (eg in a C file
                            #defne is not highlighted, leading the programmer to v. quickly see the
                            spelling mistake) and so I like apacheconf.vim for httpd.conf editing,
                            however as has been pointed out a generic unix-conf-stylee.vim file is
                            handy to have.

                            Perhaps the best thing then is to use apacheconf.vim for httpd.conf,
                            srm.conf, access.conf and .htaccess files, and to adapt apachestyle.conf
                            to be the basis for a 'unix-conf-stylee.vim' ?

                            cheers, al.

                            --

                            # Allan Kelly
                            # (+44) (0)131 524 8500 ext 241
                            # allan.kelly@...... ..
                            # /Software Engineer/i . . . . .
                            # ------------------------------ * . . . . .
                            # "If you are a Visual Basic programmer, * . . .
                            # these details are none of your business." * . . .
                            # Mr Bunny's Guide to Active X, by Carlton Egremont III * . .
                            # ------------------------------ vi: set noet tw=80 sts=4 ts=8 : .


                            On Sun, 30 Jan 2000, Bram Moolenaar wrote:

                            >
                            > Arnaud Launay -
                            >
                            > > > Well, I think that no highlighting is better than wrong highlighting. It's
                            > > > easier to do ":set ft=config" than to disable it when it's wrong again.
                            > >
                            > > Hmmmmm -- just give me an example of file beginning by "#" and
                            > > not to be a script where # marks comments ?
                            >
                            > C files. When they are not recognized as a C file (no .c or .h extension),
                            > you don't want preprocessor lines to become colored like Comments. It should
                            > remain B&W. Hopefully the C file name does not trigger the config filetype.
                            > But a C file could have any name, like "conf".
                            >
                            > > >From my point of view, this could be fine.
                            > >
                            > > Oh, another bug, when composing this mail under vim 5.6, the
                            > > preceding line, beginning by "From", is highlighted, as if it was
                            > > the one in the headers. This is not good...
                            >
                            > This has been discussed before. It could be made that "From" lines are not
                            > highlighted, but then a digest or mbox file will not have the "From" lines
                            > highlighted. It could be made such that only "From:" lines are highlighted.
                            > I would prefer not to highlight "From" lines, but I'm not the maintainer of
                            > that file.
                            >
                            > --
                            > BROTHER MAYNARD: Armaments Chapter Two Verses Nine to Twenty One.
                            > ANOTHER MONK: And St. Attila raised his hand grenade up on high saying "O
                            > Lord bless this thy hand grenade that with it thou mayest
                            > blow thine enemies to tiny bits, in thy mercy. "and the Lord
                            > did grin and people did feast upon the lambs and sloths and
                            > carp and anchovies and orang-utans and breakfast cereals and
                            > fruit bats and...
                            > BROTHER MAYNARD: Skip a bit brother ...
                            > "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
                            >
                            > /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
                            > \ \ Vim: http://www.vim.org ICCF Holland: http://www.vim.org/iccf / /
                            >
                          • Arnaud Launay
                            ... Yes, it s me :) ... All right, I see. This just proves I m not a programmer. ... Yes. or even .toto. gcc -o plouf file.toto :) hm, fun :) [back to the real
                            Message 13 of 24 , Jan 30, 2000
                            • 0 Attachment
                              Le Sun, Jan 30, 2000 at 02:16:53PM +0100, Bram Moolenaar a écrit:
                              > Arnaud Launay -

                              Yes, it's me :)

                              > > Hmmmmm -- just give me an example of file beginning by "#" and
                              > > not to be a script where # marks comments ?
                              >
                              > C files. When they are not recognized as a C file (no .c or .h extension),

                              All right, I see. This just proves I'm not a programmer.

                              > But a C file could have any name, like "conf".

                              Yes. or even .toto. gcc -o plouf file.toto :) hm, fun :)

                              [back to the real discussion]
                              Seems like having # lines treated as comments should be fine for
                              sysadmins like johannes and me -- not for programmers. What about
                              having a variable like "sys" and "prog" which control those
                              things out ? in sys mode, # are comments, not in prog.. hm,
                              stupid idea.
                              What about having # comments when files are located under /etc,
                              /usr/etc, etc. ?

                              > This has been discussed before. It could be made that "From" lines are not
                              > highlighted, but then a digest or mbox file will not have the "From" lines
                              > highlighted. It could be made such that only "From:" lines are highlighted.
                              > I would prefer not to highlight "From" lines, but I'm not the maintainer of
                              > that file.

                              Hmm. Separating headers and body for From lines... I'll contact
                              the maintainer of the file.

                              Another small thing: /etc/bashrc isn't recognize by default as a
                              sh file. Could you add /etc/bashrc near /etc/profile in
                              filetype.vim ? Also, /etc/inputrc, used for key encodings by the
                              readline lib.

                              Arnaud.
                            • Bram Moolenaar
                              ... Still a large chance of getting the wrong highlighting. And it s easy to add yourself if you really want it: au BufNewFile,BufReadPost /etc/*,/usr/etc/*
                              Message 14 of 24 , Feb 8, 2000
                              • 0 Attachment
                                Arnaud Launay wrote:

                                > [back to the real discussion]
                                > Seems like having # lines treated as comments should be fine for
                                > sysadmins like johannes and me -- not for programmers. What about
                                > having a variable like "sys" and "prog" which control those
                                > things out ? in sys mode, # are comments, not in prog.. hm,
                                > stupid idea.
                                > What about having # comments when files are located under /etc,
                                > /usr/etc, etc. ?

                                Still a large chance of getting the wrong highlighting. And it's easy to add
                                yourself if you really want it:

                                au BufNewFile,BufReadPost /etc/*,/usr/etc/* set ft=config

                                > Another small thing: /etc/bashrc isn't recognize by default as a
                                > sh file. Could you add /etc/bashrc near /etc/profile in
                                > filetype.vim ? Also, /etc/inputrc, used for key encodings by the
                                > readline lib.

                                I'll add "bashrc". I assume the directory doesn't really matter.
                                What language is "inputrc"? sh, csh, zsh?

                                --
                                Lawmakers made it obligatory for everybody to take at least one bath
                                each week -- on Saturday night.
                                [real standing law in Vermont, United States of America]

                                /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
                                \ \ Vim: http://www.vim.org ICCF Holland: http://www.vim.org/iccf / /
                              • Johannes Zellner
                                On Tue, 8 Feb 2000, Bram Moolenaar wrote: [...] ... [...] actually none of these. inputrc is the description file for gnu readline and has it s own syntax. My
                                Message 15 of 24 , Feb 8, 2000
                                • 0 Attachment
                                  On Tue, 8 Feb 2000, Bram Moolenaar wrote:

                                  [...]
                                  > I'll add "bashrc". I assume the directory doesn't really matter.
                                  > What language is "inputrc"? sh, csh, zsh?
                                  [...]
                                  actually none of these. inputrc is the description file for
                                  gnu readline and has it's own syntax. My opinion is still
                                  that it would be sufficient to have a syntax file which
                                  highlights lines beginning with a `#' mark as comments.
                                  Or do you really want to have a syntax file for each of
                                  these configuration files ?

                                  I just had a look at my home directory

                                  Files which would be ok with a `#' triggering a comment:
                                  ~/.inputrc
                                  ~/.faxdir
                                  ~/.enscriptrc
                                  ~/.lynxrc
                                  ~/.lynx/lynx.cfg
                                  ~/.mailcap
                                  ~/.mime.types
                                  ~/.telnetrc
                                  ~/.wgetrc


                                  Files which would be ok with a `;' triggering a comment:
                                  ~/.kermrc


                                  I also would add
                                  ~/.bash_history [sh]
                                  ~/.gdb_history [gdb]
                                  ~/.gnuplot* [gnuplot] (this includes ~/.gnuplot_history)
                                  ~/.gv [xdefaults]
                                  ~/.history [csh]
                                  ~/.tidyrc [cpp]


                                  I (and maybe most of the people reading this list) know well how
                                  to set the stuff up for me, how to use autocommands and howto write
                                  a syntax file which does the job. But 99.9% of the users won't write
                                  their own syntax files. That's why I proposed (28. Jan) to have a
                                  global variable g:enable_system_scripts which enables syntax coloring
                                  with a generic shell like comment syntax file. This way the options
                                  is *off by default*. What is wrong with this ? -- If the usage of
                                  this variable would be documented, the user could use it, beeing
                                  aware of the risk that files get colored false. And users *would*
                                  use this more likely than starting to write their own syntax files.


                                  --
                                  Johannes
                                • Bram Moolenaar
                                  ... Aha. Would the apachestyle.vim be useful for this? As I suggested before, perhaps there should be a config.vim, which highlights most configuration
                                  Message 16 of 24 , Feb 9, 2000
                                  • 0 Attachment
                                    Johannes Zellner wrote:

                                    > > What language is "inputrc"? sh, csh, zsh?

                                    > actually none of these. inputrc is the description file for
                                    > gnu readline and has it's own syntax. My opinion is still
                                    > that it would be sufficient to have a syntax file which
                                    > highlights lines beginning with a `#' mark as comments.
                                    > Or do you really want to have a syntax file for each of
                                    > these configuration files ?

                                    Aha. Would the apachestyle.vim be useful for this? As I suggested before,
                                    perhaps there should be a config.vim, which highlights most configuration
                                    files.

                                    > I just had a look at my home directory
                                    >
                                    > Files which would be ok with a `#' triggering a comment:
                                    > ~/.inputrc
                                    > ~/.faxdir
                                    > ~/.enscriptrc
                                    > ~/.lynxrc
                                    > ~/.lynx/lynx.cfg
                                    > ~/.mailcap
                                    > ~/.mime.types
                                    > ~/.telnetrc
                                    > ~/.wgetrc
                                    >
                                    >
                                    > Files which would be ok with a `;' triggering a comment:
                                    > ~/.kermrc
                                    >
                                    >
                                    > I also would add
                                    > ~/.bash_history [sh]
                                    > ~/.gdb_history [gdb]
                                    > ~/.gnuplot* [gnuplot] (this includes ~/.gnuplot_history)
                                    > ~/.gv [xdefaults]
                                    > ~/.history [csh]
                                    > ~/.tidyrc [cpp]

                                    Perhaps others can comment on this list?

                                    > I (and maybe most of the people reading this list) know well how
                                    > to set the stuff up for me, how to use autocommands and howto write
                                    > a syntax file which does the job. But 99.9% of the users won't write
                                    > their own syntax files. That's why I proposed (28. Jan) to have a
                                    > global variable g:enable_system_scripts which enables syntax coloring
                                    > with a generic shell like comment syntax file. This way the options
                                    > is *off by default*. What is wrong with this ? -- If the usage of
                                    > this variable would be documented, the user could use it, beeing
                                    > aware of the risk that files get colored false. And users *would*
                                    > use this more likely than starting to write their own syntax files.

                                    I like to be accurate. I don't like doing a wild guess and set the syntax
                                    file based on that. Not even with an option or variable.

                                    Finding the documentation on this specific feature might be hard enough.
                                    While a generic autocommand would do the same:

                                    :au BufNewFile,BufReadPost /etc/* set ft=config

                                    I prefer users to teach generic commands, instead of explaining each specific
                                    detail that has been added. Additionally, when someone adds this himself, he
                                    will understand what happens when the wrong highlighting is used.

                                    --
                                    BODY: I'm not dead!
                                    CART DRIVER: 'Ere. He says he's not dead.
                                    LARGE MAN: Yes he is.
                                    BODY: I'm not!
                                    "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                                    /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
                                    \ \ Vim: http://www.vim.org ICCF Holland: http://www.vim.org/iccf / /
                                  • Johannes Zellner
                                    On Wed, 9 Feb 2000, Bram Moolenaar wrote: [...] ... [...] ... [...] ok for me, at least when the syntax file is supplied with vim. But config is already used
                                    Message 17 of 24 , Feb 9, 2000
                                    • 0 Attachment
                                      On Wed, 9 Feb 2000, Bram Moolenaar wrote:

                                      [...]
                                      > Aha. Would the apachestyle.vim be useful for this? As I suggested before,
                                      > perhaps there should be a config.vim, which highlights most configuration
                                      > files.
                                      [...]
                                      > Finding the documentation on this specific feature might be hard enough.
                                      > While a generic autocommand would do the same:
                                      >
                                      > :au BufNewFile,BufReadPost /etc/* set ft=config
                                      [...]
                                      ok for me, at least when the syntax file is supplied with vim.
                                      But config is already used for configure.in. What about
                                      `sysconfig.vim' ? -- Here is the file (stolen from sh.vim):

                                      " sysconfig.vim
                                      syn clear
                                      syn keyword sysconfigTodo contained TODO XXX FIXME
                                      syn match sysconfigComment "#.*$" contains=sysconfigTodo

                                      if !exists("did_sysconfig_syntax_inits")
                                      hi link sysconfigComment Comment
                                      hi link sysconfigTodo Todo
                                      let did_sysconfig_syntax_inits = 1
                                      endif

                                      let b:current_syntax = "sysconfig"
                                      " EOF

                                      Note that I would recommend no other highlighting except comments
                                      (and a bit of Todo) to keep the risk of errors small. This is
                                      pretty useful for highlighting files which are trashed with
                                      comments.


                                      --
                                      Johannes
                                    • Bram Moolenaar
                                      ... Yes, config.vim already exits. sysconfig.vim is a bit long. How about conf.vim ? ... Going through files in /etc, I think that strings can be
                                      Message 18 of 24 , Feb 10, 2000
                                      • 0 Attachment
                                        Johannes Zellner wrote:

                                        > > Finding the documentation on this specific feature might be hard enough.
                                        > > While a generic autocommand would do the same:
                                        > >
                                        > > :au BufNewFile,BufReadPost /etc/* set ft=config
                                        > [...]
                                        > ok for me, at least when the syntax file is supplied with vim.
                                        > But config is already used for configure.in. What about
                                        > `sysconfig.vim' ? -- Here is the file (stolen from sh.vim):

                                        Yes, config.vim already exits. "sysconfig.vim" is a bit long. How about
                                        "conf.vim"?

                                        > Note that I would recommend no other highlighting except comments
                                        > (and a bit of Todo) to keep the risk of errors small. This is
                                        > pretty useful for highlighting files which are trashed with
                                        > comments.

                                        Going through files in /etc, I think that strings can be highlighted too. At
                                        least this avoids that a '#' inside a string starts a comment. Try this
                                        syntax on your configuration files:

                                        -----------------------------------------------
                                        " Vim syntax file
                                        " Language: generic configure file
                                        " Maintainer: Bram Moolenaar <Bram@...>
                                        " Last Change: 2000 Feb 10

                                        " remove any old syntax stuff hanging around
                                        syn clear

                                        syn keyword confTodo contained TODO FIXME XXX
                                        syn match confComment "#.*" contains=confTodo
                                        syn region confString start=+"+ skip=+\\\\\|\\"+ end=+"+ oneline
                                        syn region confString start=+'+ skip=+\\\\\|\\'+ end=+'+ oneline

                                        if !exists("did_conf_syntax_inits")
                                        let did_conf_syntax_inits = 1
                                        " The default methods for highlighting. Can be overridden later
                                        hi link confComment Comment
                                        hi link confTodo Todo
                                        hi link confString String
                                        endif

                                        let b:current_syntax = "conf"

                                        " vim: ts=8
                                        -----------------------------------------------

                                        Please let me know for which filenames this syntax should be used. Then I can
                                        setup the autocommands for this filetype. I still don't think that this
                                        syntax should be used for all files in /etc. There are a number of shell
                                        scripts, and the disktab looks wrong.

                                        --
                                        OLD WOMAN: King of the WHO?
                                        ARTHUR: The Britons.
                                        OLD WOMAN: Who are the Britons?
                                        "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                                        /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
                                        \ \ Vim: http://www.vim.org ICCF Holland: http://www.vim.org/iccf / /
                                      • Johannes Zellner
                                        On Thu, 10 Feb 2000, Bram Moolenaar wrote:Johannes Zellner wrote: Finding the documentation on this specific feature might be hard enough.
                                        Message 19 of 24 , Feb 10, 2000
                                        • 0 Attachment
                                          On Thu, 10 Feb 2000, Bram Moolenaar wrote:

                                          > Johannes Zellner wrote:
                                          >
                                          > > > Finding the documentation on this specific feature might be hard enough.
                                          > > > While a generic autocommand would do the same:
                                          > > >
                                          > > > :au BufNewFile,BufReadPost /etc/* set ft=config
                                          > > [...]
                                          > > ok for me, at least when the syntax file is supplied with vim.
                                          > > But config is already used for configure.in. What about
                                          > > `sysconfig.vim' ? -- Here is the file (stolen from sh.vim):
                                          >
                                          > Yes, config.vim already exits. "sysconfig.vim" is a bit long. How about
                                          > "conf.vim"?
                                          >
                                          > > Note that I would recommend no other highlighting except comments
                                          > > (and a bit of Todo) to keep the risk of errors small. This is
                                          > > pretty useful for highlighting files which are trashed with
                                          > > comments.
                                          >
                                          > Going through files in /etc, I think that strings can be highlighted too. At
                                          > least this avoids that a '#' inside a string starts a comment. Try this
                                          > syntax on your configuration files:
                                          >
                                          > -----------------------------------------------
                                          > " Vim syntax file
                                          > " Language: generic configure file
                                          > " Maintainer: Bram Moolenaar <Bram@...>
                                          > " Last Change: 2000 Feb 10
                                          >
                                          > " remove any old syntax stuff hanging around
                                          > syn clear
                                          >
                                          > syn keyword confTodo contained TODO FIXME XXX
                                          > syn match confComment "#.*" contains=confTodo
                                          > syn region confString start=+"+ skip=+\\\\\|\\"+ end=+"+ oneline
                                          > syn region confString start=+'+ skip=+\\\\\|\\'+ end=+'+ oneline
                                          >
                                          > if !exists("did_conf_syntax_inits")
                                          > let did_conf_syntax_inits = 1
                                          > " The default methods for highlighting. Can be overridden later
                                          > hi link confComment Comment
                                          > hi link confTodo Todo
                                          > hi link confString String
                                          > endif
                                          >
                                          > let b:current_syntax = "conf"
                                          >
                                          > " vim: ts=8
                                          > -----------------------------------------------
                                          >
                                          > Please let me know for which filenames this syntax should be used. Then I can
                                          > setup the autocommands for this filetype. I still don't think that this
                                          > syntax should be used for all files in /etc. There are a number of shell
                                          > scripts, and the disktab looks wrong.

                                          the list got somehow long. It is the attached `etc.conf.files'.
                                          I tryed *all* files listed there with conf.vim. I also attached
                                          a second list `etc.other.files' which could improve recognition
                                          of alreay existing filetypes.

                                          from my home directory I extracted a list `home.conf.files'.

                                          If you want I'd try to reduce this to a `as short as possible'
                                          list. But this could take some days as I'm a bit short of time.

                                          btw.: what is the cost (speed) of including such an amount of
                                          different files ? -- maybe this could be done somehow conditionally ?

                                          I'm aware that the list is pretty long. Maybe it could be reduced
                                          to highlight at least the most important files like inittab, fstab ...
                                          not easy.


                                          --
                                          Johannes
                                        • Bram Moolenaar
                                          ... Hmm, this list is long, and there isn t an obvious logic to it. We could end up updating this list with every release. How about this alternative: Check
                                          Message 20 of 24 , Feb 11, 2000
                                          • 0 Attachment
                                            Johannes Zellner wrote:

                                            > > Please let me know for which filenames this syntax should be used. Then I
                                            > > can setup the autocommands for this filetype. I still don't think that
                                            > > this syntax should be used for all files in /etc. There are a number of
                                            > > shell scripts, and the disktab looks wrong.
                                            >
                                            > the list got somehow long. It is the attached `etc.conf.files'.
                                            > I tryed *all* files listed there with conf.vim. I also attached
                                            > a second list `etc.other.files' which could improve recognition
                                            > of alreay existing filetypes.

                                            Hmm, this list is long, and there isn't an obvious logic to it. We could end
                                            up updating this list with every release.

                                            How about this alternative: Check the contents of a file if there are lines
                                            starting with "#". That seems to work quite well. It's probably sufficient
                                            to check the first five lines, since these files tend to start with a comment
                                            to explain the contents of the file (but there could be a few empty lines
                                            first). Of course this won't work when creating a new file, it's a
                                            compromise. Try adding this to scripts.vim, just above the "endif":

                                            =====================================
                                            " Generic configuration file (check this last, it's just guessing!)
                                            elseif getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
                                            \ || getline(4) =~ '^#' || getline(5) =~ '^#'
                                            set ft=conf
                                            =====================================

                                            It looks like this works very well. It will miss a few files that don't start
                                            with a comment, which isn't too bad. But perhaps some files are highlighted
                                            which should not. Let me know if this happens.

                                            > btw.: what is the cost (speed) of including such an amount of
                                            > different files ? -- maybe this could be done somehow conditionally ?

                                            I never measured it, but it could take some time to try matching all patterns
                                            with a file name. I don't know how this compares to the other operations done
                                            when opening a file, but it does add up to the total time. I would expect
                                            loading the syntax file itself to take most of the time though.

                                            I updated the conf.vim syntax file a bit, to avoid wrong highlighting in
                                            disktab:

                                            =====================================
                                            " Vim syntax file
                                            " Language: generic configure file
                                            " Maintainer: Bram Moolenaar <Bram@...>
                                            " Last Change: 2000 Feb 11

                                            " remove any old syntax stuff hanging around
                                            syn clear

                                            syn keyword confTodo contained TODO FIXME XXX
                                            " Avoid matching "text#text", used in /etc/disktab and /etc/gettytab
                                            syn match confComment "^#.*" contains=confTodo
                                            syn match confComment "\s#.*"ms=s+1 contains=confTodo
                                            syn region confString start=+"+ skip=+\\\\\|\\"+ end=+"+ oneline
                                            syn region confString start=+'+ skip=+\\\\\|\\'+ end=+'+ oneline

                                            if !exists("did_conf_syntax_inits")
                                            let did_conf_syntax_inits = 1
                                            " The default methods for highlighting. Can be overridden later
                                            hi link confComment Comment
                                            hi link confTodo Todo
                                            hi link confString String
                                            endif

                                            let b:current_syntax = "conf"

                                            " vim: ts=8
                                            =====================================

                                            --
                                            BEDEVERE: And what do you burn, apart from witches?
                                            FOURTH VILLAGER: ... Wood?
                                            BEDEVERE: So why do witches burn?
                                            SECOND VILLAGER: (pianissimo) ... Because they're made of wood...?
                                            "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                                            /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
                                            \ \ Vim: http://www.vim.org ICCF Holland: http://www.vim.org/iccf / /
                                          • Johannes Zellner
                                            On Fri, 11 Feb 2000, Bram Moolenaar wrote: [...] ... [...] this seems to work great. I just checked it with all files `find /etc -type f` (849) and got a
                                            Message 21 of 24 , Feb 11, 2000
                                            • 0 Attachment
                                              On Fri, 11 Feb 2000, Bram Moolenaar wrote:

                                              [...]
                                              > How about this alternative: Check the contents of a file if there are lines
                                              > starting with "#". That seems to work quite well. It's probably sufficient
                                              > to check the first five lines, since these files tend to start with a comment
                                              > to explain the contents of the file (but there could be a few empty lines
                                              > first). Of course this won't work when creating a new file, it's a
                                              > compromise. Try adding this to scripts.vim, just above the "endif":
                                              >
                                              > =====================================
                                              > " Generic configuration file (check this last, it's just guessing!)
                                              > elseif getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
                                              > \ || getline(4) =~ '^#' || getline(5) =~ '^#'
                                              > set ft=conf
                                              > =====================================
                                              [...]

                                              this seems to work great. I just checked it with all
                                              files `find /etc -type f` (849) and got a subset of
                                              263 files recognized as conf! There's only one error

                                              /etc/X11/Xresources/xfree86-common (should be xdefaults, see below)

                                              some of the files are sh or perl `source' files, but as conf is a subset
                                              of both perl and sh, highlighting as conf is better than nothing.

                                              I would recommend to add these:
                                              au ... /etc/*Xresources/* set ft=xdefaults (solves the problem above)
                                              au ... /etc/*fvwm95*.hook set ft=fvwm
                                              (this is recognized as conf now, which is not wrong
                                              as conf is a subset of fvwm, but it could be done better)

                                              system administration seems to become colorful!
                                              thanks Bram!

                                              --
                                              Johannes

                                              PS.: if you wonder how I got all the file types ...

                                              # vim `find /etc -type f`
                                              :source types.vim

                                              where types.vim looks like this:

                                              " types.vim
                                              set nomore
                                              let lastbuf = bufnr("$")

                                              let @j = ""
                                              let bufnr = 1
                                              while bufnr <= lastbuf
                                              if bufexists(bufnr)
                                              exe 'buffer ' . bufnr
                                              let @j = @j . expand("%:p") . " [" . &ft . "]\n"
                                              endif
                                              let bufnr = bufnr + 1
                                              endwhile

                                              let out = tempname()
                                              exe 'sp ' . out
                                              normal "jp
                                            • Bram Moolenaar
                                              ... Well, that s not a bad score! ... I changed the line for xdefaults to: X resources file au BufNewFile,BufRead
                                              Message 22 of 24 , Feb 11, 2000
                                              • 0 Attachment
                                                Johannes Zellner wrote:

                                                > this seems to work great. I just checked it with all
                                                > files `find /etc -type f` (849) and got a subset of
                                                > 263 files recognized as conf! There's only one error

                                                Well, that's not a bad score!

                                                > /etc/X11/Xresources/xfree86-common (should be xdefaults, see below)

                                                I changed the line for xdefaults to:

                                                " X resources file
                                                au BufNewFile,BufRead .Xdefaults,.Xresources,Xresources*,*/app-defaults/*,*/Xresources/*,xdm-config set ft=xdefaults

                                                > some of the files are sh or perl `source' files, but as conf is a subset
                                                > of both perl and sh, highlighting as conf is better than nothing.

                                                These files are not recognizable as sh or perl?

                                                > I would recommend to add these:
                                                > au ... /etc/*Xresources/* set ft=xdefaults (solves the problem above)
                                                > au ... /etc/*fvwm95*.hook set ft=fvwm
                                                > (this is recognized as conf now, which is not wrong
                                                > as conf is a subset of fvwm, but it could be done better)

                                                Should this match "*fvwm95*" (without the .hook)? And is this fvwm 1 or 2?

                                                > system administration seems to become colorful!

                                                Wear your sunglasses! :-)

                                                --
                                                hundred-and-one symptoms of being an internet addict:
                                                3. Your bookmark takes 15 minutes to scroll from top to bottom.

                                                /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
                                                \ \ Vim: http://www.vim.org ICCF Holland: http://www.vim.org/iccf / /
                                              • Arnaud Launay
                                                ... Probably not. Take the following example file local.cfg containing: # GENERAL KERNEL=`uname -r` BKERNEL=`uname -r | cut -b1-3` MODULES=1 UDMA=0 PNP=1
                                                Message 23 of 24 , Feb 13, 2000
                                                • 0 Attachment
                                                  Le Fri, Feb 11, 2000 at 09:42:18PM +0100, Bram Moolenaar a écrit:
                                                  > > some of the files are sh or perl `source' files, but as conf is a subset
                                                  > > of both perl and sh, highlighting as conf is better than nothing.
                                                  >
                                                  > These files are not recognizable as sh or perl?

                                                  Probably not. Take the following example
                                                  file local.cfg containing:
                                                  # GENERAL
                                                  KERNEL=`uname -r`
                                                  BKERNEL=`uname -r | cut -b1-3`
                                                  MODULES=1
                                                  UDMA=0
                                                  PNP=1
                                                  RESEAU=1
                                                  SON=1
                                                  APM=1
                                                  SOURIS=1
                                                  CLAVIER_FR=1
                                                  CROND=1

                                                  it is sh, but we do not have any mean to recognize it as it. (and
                                                  don't ask what it's for, I've rewritten all my rc.d files in
                                                  order to learn shell script).

                                                  > > system administration seems to become colorful!
                                                  >
                                                  > Wear your sunglasses! :-)

                                                  cassis:/etc# vi nsswitch.conf
                                                  :set
                                                  --- Options ---
                                                  background=dark filetype=conf hlsearch syntax=conf viminfo='20,"50
                                                  [snip]

                                                  (no highlight)

                                                  :source /usr/share/vim/vim56/syntax/conf.vim
                                                  (comments get highlighted !)

                                                  in scripts.vim:
                                                  set ft=rcslog
                                                  " Generic configuration file (check this last, it's just guessing!)
                                                  elseif getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
                                                  \ || getline(4) =~ '^#' || getline(5) =~ '^#'
                                                  set ft=conf

                                                  endif

                                                  where am I wrong ???
                                                  -rw-r--r-- 1 root root 863 Feb 13 13:55 conf.vim
                                                  readable...

                                                  If someone has any idea, I'll be happy to say "duh, how can I be
                                                  so stupid" :)

                                                  Arnaud.
                                                • Johannes Zellner
                                                  On Sun, 13 Feb 2000, Arnaud Launay wrote: [...] ... [...] you ve also to tell vim what to do when conf is detected. Put a line like autocmd Syntax conf
                                                  Message 24 of 24 , Feb 13, 2000
                                                  • 0 Attachment
                                                    On Sun, 13 Feb 2000, Arnaud Launay wrote:

                                                    [...]
                                                    > cassis:/etc# vi nsswitch.conf
                                                    > :set
                                                    > --- Options ---
                                                    > background=dark filetype=conf hlsearch syntax=conf viminfo='20,"50
                                                    > [snip]
                                                    >
                                                    > (no highlight)
                                                    >
                                                    > :source /usr/share/vim/vim56/syntax/conf.vim
                                                    > (comments get highlighted !)
                                                    >
                                                    > in scripts.vim:
                                                    > set ft=rcslog
                                                    > " Generic configuration file (check this last, it's just guessing!)
                                                    > elseif getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
                                                    > \ || getline(4) =~ '^#' || getline(5) =~ '^#'
                                                    > set ft=conf
                                                    >
                                                    > endif
                                                    >
                                                    > where am I wrong ???
                                                    > -rw-r--r-- 1 root root 863 Feb 13 13:55 conf.vim
                                                    > readable...
                                                    >
                                                    > If someone has any idea, I'll be happy to say "duh, how can I be
                                                    > so stupid" :)
                                                    [...]

                                                    you've also to tell vim what to do when conf is detected.
                                                    Put a line like
                                                    autocmd Syntax conf source $VIMRUNTIME/syntax/conf.vim
                                                    in either a private syntax file `:help mysyntaxfile' or in the
                                                    system's syntax file $VIMRUNTIME/syntax/synload.vim. In the
                                                    latter case you would use the command `SynAu conf' to save typing.

                                                    --
                                                    Johannes
                                                  Your message has been successfully submitted and would be delivered to recipients shortly.