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 293661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:17:46+00:00 2026-05-12T06:17:46+00:00

My syntax -highlighting is broken for a file which Type is conf as follows:

  • 0

My syntax -highlighting is broken for a file which Type is conf as follows:

File where the syntax highlighting does not work

alt text http://files.getdropbox.com/u/175564/bugs/vim-bug-type.png

The syntax highlighting works for all other files with the extension .markdown. However, the only difference between these files is that the other files’ type is nothing, while that of a file, which has bug, its Conf.

File where the syntax highlighting works

alt text http://files.getdropbox.com/u/175564/bugs/vim-bug-syntax2.png

How can you change the Type to nothing from Conf in Vim?

  • 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-05-12T06:17:46+00:00Added an answer on May 12, 2026 at 6:17 am

    Try:

    :setf none
    

    or (equivalently):

    :set ft=
    

    If you want to do it automatically, you’ll need to configure the syntax detection. Create a file (if it doesn’t exist): vimfiles/after/filetype.vim or ~/.vim/after/filetype.vim. In this file, add the following line:

    au BufNewFile,BufRead *.markdown        set ft=none
    

    Alternatively, download the markdown syntax from here (I’ve not tried this) and configure with:

    au BufNewFile,BufRead *.markdown        set ft=mkd
    

    For more information:

    :help :setf
    :help 'filetype'
    :help :autocmd
    :help BufRead
    :help BufNewFile
    

    For information, the problem arises because the .markdown extension is not recognised, so Vim looks at the contents to try to determine what the file type is. Presumably there is something in your file that looks a little like a configuration file, so it does its best guess. The guess is carried out in the system filetype.vim, typically in c:\vim\vim72 or /usr/share/vim/vim72/filetype.vim (I think) and looks like this:

    " Generic configuration file (check this last, it's just guessing!)
    au BufNewFile,BufRead,StdinReadPost *
        \ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
        \    && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
        \   || getline(4) =~ '^#' || getline(5) =~ '^#') |
        \   setf conf |
        \ endif
    

    This checks whether any of the first five lines start with a # and if they do and no other filetype has been matched, it sets the filetype to conf.

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

Sidebar

Related Questions

Can anyone tell me what syntax highlighting theme is in use here? http://jamierumbelow.net/images/code.png Jamie
I need a text editor for linux with the following features: Syntax Highlighting for
How to do Syntax Highlighting in a UITextView , specifically syntax highlighting (and detection
I would like to create only a syntax highlighting minor mode for Emacs. I
Is there a way to edit my color options for syntax highlighting in structured
I have been recently working on an easy to use Syntax Highlighting system for
I would like to do exactly what google code prettifier (syntax highlighting of code
I'm trying to configure a zenburn-like syntax highlighting for my Visual Studio 2010 environment
For some reason, the syntax highlighting below is working how I'd like it to,
When I run vim from the command line in iTerm, syntax highlighting doesn't seem

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.