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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:33:51+00:00 2026-05-22T22:33:51+00:00

I want to source a color file based on the filetype python. How can

  • 0

I want to source a color file based on the filetype python. How can I do that in .vimrc?

  • 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-22T22:33:52+00:00Added an answer on May 22, 2026 at 10:33 pm

    EDIT:

    ZyX makes a valid point that the use of Buf* events will not ensure that the colorscheme is set correctly for python files where the filetype is set after the file is loaded (e.g., python files without the .py extension or if you begin writing a script in a new buffer and manually set filetype=python). As per ZyX’s suggestion in the comments below, here’s one that uses the FileType event.

    autocmd FileType * if &filetype == 'python' | colorscheme jellybeans | else | colorscheme wombat256 | endif
    

    My previous answer is here below:

    autocmd BufNewFile,BufEnter,BufRead * if &filetype == 'python' | colorscheme jellybeans | else | colorscheme wombat256 | endif
    

    The earlier command changed the colorscheme once you entered a python file and it remained so for the rest of the session. This one lets you have one type of colorscheme for python files and another type for the others.

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

Sidebar

Related Questions

I want see the source code of System.Web.Routing.RouteValueDictionary class. But Reflector can't disassemble it
I want to process each source code file after it has been preprocessed: myprocess
I want to see the source of functions like ns_initparse(), res_search() etc. Where can
i want to show a part of my source code with color coding in
Is it possible to specify a color in a properties file that has an
I have coordinates from some source and want to tag my jpg files with
I want to change the source in XAML to another object source. For example:
I want to download this open source application, and they are using Git. What
I want to give credit to all open source libraries we use in our
I want some slightly 'dynamic' XML source files. I want some of the 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.