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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:25:06+00:00 2026-06-10T10:25:06+00:00

I use vim with many different languages (C, C++, Java, shell, etc.). I know

  • 0

I use vim with many different languages (C, C++, Java, shell, etc.). I know vim already has it preset settings for each language, but I want to change the settings for each individual language to my personal perference. I already have a .vimrc file with settings,but I want a few more files to declare more specific settings according to the language I’m using. What are the files suppose to be called? c.vim? java.vim?

Example: In C, I want my comments to be green, while in Java, I want them to be light purple.

ALSO, I hate vim’s preset colorschemes. What’s a way I can create my own colorscheme?

I hope that is understandable and complete and makes sense.

Thanks in advance!!

  • 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-10T10:25:07+00:00Added an answer on June 10, 2026 at 10:25 am

    You can use either autocmds:

    autocmd FileType java colorscheme desert
    

    or put the commands in ~/.vim/ftplugin/java_mycolors.vim. (This is for new settings; if you want to override stuff from the default, system-wide ftplugins, you’d put them in ~/.vim/after/ftplugin/java.vim.)

    As you can see, the first approach is quick and dirty, while the latter allows for modularity and lots of customization. Your call.


    As for changing the colorscheme, this is a global setting; you cannot mix them at the same time; but you will only notice that when you split windows or use tab pages, though, so it may be fine.

    You can however change the individual syntax colors. By default, comments in all languages are linked to the Comment highlight group. Read the syntax file (e.g. $VIMRUNTIME/syntax/java.vim) or use the SyntaxAttr.vim plugin to determine the group name. Then you can redefine it in your .vimrc:

    :highlight javaLineComment guifg=Purple
    :highlight javaComment guifg=Purple
    

    This is tedious (depending on how much you want to customize), but more precise, and works in parallel. I’d recommend this unless you really want totally different coloring for each filetype.

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

Sidebar

Related Questions

I use VIM editor for PHP, i know many people will point to PDT
When I use VIM or most modeless editors (Eclipse, NetBeans etc.) I frequently do
I want to use vim on many servers, where in repository it compiled without
I use Vim on a MacBook Pro and in order to input \ ,
I use Vim with clang_complete for omnicompletion. The plugin is automatically triggered when I
I use Vim & Git together. I tend to merge/switch Git branches alot. I
I use vim + xdebug to debug php. If the debug operation waste a
I use vim on both FreeBSD and Linux os, sharing the same .vimrc configuration
I mostly use vim from the terminal by vi command. I want to create
My setup is to use vim (specifically MacVim in graphical mode) to edit source

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.