Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7920717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:19:10+00:00 2026-06-03T16:19:10+00:00

Note I am using the local vim plugin that allows me to use a

  • 0

Note

I am using the local vim plugin that allows me to use a project-specific .vimrc file, in general it works fine and as you’d expect.

Background

I work with Silverstripe, and therefore have to work with Silverstripe templates, which are *.ss files, however by default vim assigns *.ss to scheme files. Now I only use Silverstripe for one project, and have been using the html filetype set in my project-specific .vimrc for highlighting, however after encountering a few bugs, I figured that I would add the highlighting for *.ss files in an htmlss.vim file (using html.vim as a base, i just added the template rules near the end). After a bit of trial and error I got it working and highlighting properly, however i have encountered a strange bug…

Question

Using this project .vimrc:

augroup filetypedetect
    autocmd! * *.ss
    autocmd! BufEnter *.ss setf htmlss
augroup END

Everything works fine, however, using this .vimrc:

augroup filetypedetect
    autocmd! * *.ss
    autocmd! BufEnter,BufRead,BufNewFile *.ss setf htmlss
augroup END

The syntax highlighting fails, it sets the filetype correctly, but the highlighting goes screwy.

I guess I want to know why version 1 works, but version 2 doesn’t, despite nothing else changing.

Addendum

After a little more investigation, i have found that removing autocmd! * *.ss makes the second one work, only if i remove ! from the autocmd! BufEnter,BufRead,BufNewFile *.ss setf htmlss. i.e.

augroup filetypedetect
    autocmd BufEnter,BufRead,BufNewFile *.ss setf htmlss
augroup END

works but

augroup filetypedetect
    autocmd! BufEnter,BufRead,BufNewFile *.ss setf htmlss
augroup END

and

augroup filetypedetect
    autocmd! * *.ss
    autocmd BufEnter,BufRead,BufNewFile *.ss setf htmlss
augroup END

do not.

Again, my question is why these difference occur, i have a working implementation now, so i am not interested in any investigation. I don’t want solutions as i have no problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:19:11+00:00Added an answer on June 3, 2026 at 4:19 pm

    This is probably caused by your syntax file conflicting with itself when applied multiple times. One of the first lines in the syntax file is probably syntax enable, which enables syntax without changing any of the current highlight settings. Per the docs:

    The ":syntax enable" command will keep your current color settings.  This
    allows using ":highlight" commands to set your preferred colors before or
    after using this command.  If you want Vim to overrule your settings with the
    defaults, use:
            :syntax on
    

    So, an adequate “solution” should be to change syntax enable to syntax on in the syntax file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Grails and I have a local-plugin (that I wrote) that I'm using
I found the following claim in the documentation for Net::OpenSSH : Note that using
Note: I'm using Windows file servers and .NET If I were to create a
First as a note I am using this plugin in a Rails app. Ok
Note: Using Rails 3.1 and current delayed_job gem. I have a User model that
The documentation for set local states: Note that SET LOCAL will appear to have
I am using ABCPDF to print a PDF file to a local printer via
I'm trying to do an XMLHttpRequest from a local file (file://) using JQuery.ajax to
Note: Using Monotouch. I have a directory called Images where I have all my
Note: I'm using Google Chrome Currently I have this test page http://www.evecakes.com/doodles/canvas_size_issue.htm It should

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.