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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:19:25+00:00 2026-06-13T03:19:25+00:00

Just about every VIM colorscheme has this snippet in it: if exists(syntax_on) syntax reset

  • 0

Just about every VIM colorscheme has this snippet in it:

if exists("syntax_on")
  syntax reset
endif

This is also listed as a “recommended” thing to put in colorschemes in all sorts of tutorials, etc.

However, I’ve experimented quite a bit with the difference between that, and just a plain:

syntax reset

and I can’t find any difference. If syntax is enabled, this command correctly does the usual syntax reset magic, but if syntax is off, it doesn’t appear to have any effect, or give any error. What’s more, reading the whole section of the VIM manual about syntax highlighting and colorschemes, I can’t see any reason why a plain, unguarded syntax reset would be harmful if “syntax_on” isn’t set.

If that’s truly the case, what is the purpose of the if exists("syntax_on") guard? Is it because this used to be required in a previous version of VIM, but is no longer necessary in at least 7.3? Or is there some subtle corner case I’m missing?

  • 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-13T03:19:26+00:00Added an answer on June 13, 2026 at 3:19 am

    When syntax_on is not defined, we don’t need to run syntax reset which is the same as:

    g:syntax_cmd = 'reset'
    runtime! syntax/syncolor.vim
    

    It makes vim faster.

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

Sidebar

Related Questions

I dork this up just about every time I jump back into a C
I have a Java project that has just about every class and package depending
I've spent about a week trying to troubleshoot this - tried just about every
This use case seems like it would apply to just about every form, but
Just about every tree view and list item in Windows has an attractive light-blue
I'm strugging with getting an iPhone application which requires just about every push or
I've read just about every article available on the Internet regarding Error #2048 and
The answer to just about every single question about using C# with JSON seems
Ok, so I've read just about every resource possible on converting from SVN to
I've tried just about every locator, and none of them will detect an element

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.