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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:12:29+00:00 2026-06-14T21:12:29+00:00

I am using molokai in vim to code in python/html/css/javascript. When I edit python

  • 0

I am using molokai in vim to code in python/html/css/javascript. When I edit python files (or javascript) parenthesis are not colored. This is not true for simple scripts (like molokai.vim itself) where parenthesis are colored gray.

I edited molokai.vim and added

hi parens guifg=#999999

and then I edited .vimrc and added:

syn match parens /[(){}]/

but parenthesis and brackets remain white.

What am I doing wrong?

  • 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-14T21:12:32+00:00Added an answer on June 14, 2026 at 9:12 pm
    1. Never use :syn to highlight all filetypes, there is matchadd() for this. Using :syn can easily break highlighting, matchadd() is an overlay.
    2. Syntax highlighting is being overridden when Syntax event fires. More, it has effect only on the current buffer. So just syn in vimrc will never work, you have to use autocommands

      autocmd! Syntax python :syntax match Parens /[(){}]/
      

      (for python it is safe as parenthesis and figure brackets are not matched by any other syntax element).

    3. In javascript parenthesis (()) are already matched by javaScriptParens highlighting group. Thus you have to use

      hi def link javaScriptParens Parens
      

      (in colorscheme). Braces are matched by javaScriptBraces and require similar command.

    4. To determine what highlighting is used for specific symbol I place cursor on this symbol and launch

      echo 'Normal '.join(map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")'))
      

      , the last displayed word is normally what you need. If only Normal is displayed then symbol is not highlighted and you have to go 2., otherwise you have to go 3.

    5. For universal solution disregarding currently used highlighting you may use matchadd() as I already said. But it is local to window so if you are working with multiple windows/tabs you can’t go without autocmd:

      autocmd! WinEnter * :if !exists('w:parens_match_id') | let w:parens_match_id=matchadd('Parens', '[(){}]') | endif
      

    All autocommands are to be surrounded with

    augroup HighlightParens
        autocmd! …
    augroup END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
using this code I can send one texture to the shader: devcon->PSSetShaderResources(0, 1, &pTexture);
Using a CSS image sprite, I'm creating an 'interactive' image where hovering over certain
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using CI for the first time and i'm smashing my head with this seemingly
Using import datetime in python, is it possible to take a formatted time/date string
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
Using intellij and maven pom files, how do i debug tests run inside the
Using PyGtk's IconView, I can set the icons to be reorderable by calling gtk.IconView.set_reorderable(True)

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.