LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-20-2014, 04:56 AM   #1
Tachtory
Member
 
Registered: Dec 2011
Distribution: Mint, Slackware
Posts: 43

Rep: Reputation: Disabled
vim C/C++ highlight parens, brackets?


Currently my C++ syntax looks like this:

http://i42.tinypic.com/zn3lg3.png

Here is the color portion of my .vimrc file:

Code:
" make sure syntax highlighting is enabled
syntax on

" Colors

hi Comment ctermfg=darkgreen
hi Constant ctermfg=darkred
hi Preproc ctermfg=blue
hi Statement ctermfg=yellow
hi LineNr ctermfg=darkyellow
hi Type ctermfg=lightgreen
hi Identifier ctermfg=magenta
hi Special ctermfg=cyan
hi Number ctermfg=red
hi Boolean ctermfg=red
hi Character ctermfg=white
hi Operator ctermfg=yellow
hi String ctermfg=darkred
hi Constant ctermfg=red

" C

hi cCppParen ctermfg=cyan
hi cCppBracket ctermfg=cyan
hi cBlock ctermfg=cyan
hi cParen ctermfg=cyan
hi cBracket ctermfg=cyan

" Haskell

hi hsDelimiter ctermfg=cyan
hi ConId ctermfg=lightgreen
All the hi settings are working except the C/C++ brackets. Here's an example of some Haskell:

http://i41.tinypic.com/313p47a.png
 
Old 01-21-2014, 07:34 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
What you described is not correct, your C settings are not working for that file. Nothing is cyan, parentheses, brackets, or blocks.

I notice that the syntax line in your file images states "syntax=cpp" versus "syntax=C" and in your .vimrc that section is named "C".

Can you either change that section name in your .vimrc or set the syntax to be C and see if this corrects the problem?
 
Old 01-21-2014, 01:37 PM   #3
Tachtory
Member
 
Registered: Dec 2011
Distribution: Mint, Slackware
Posts: 43

Original Poster
Rep: Reputation: Disabled
That line is just a comment. I tried re-naming the file to *.c and that changed the syntax=c, but still the same result.
 
Old 01-24-2014, 04:28 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Wouldn't it be easier to use one of the supplied syntax files eg /usr/share/vim/vim72/syntax/c.vim ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vim - how to highlight text on cf and ct (change) commands stringchopper Linux - Software 1 02-16-2013 02:07 AM
color highlight in VIM - howyoudothat? chewmanfoo Linux - Software 7 07-02-2007 08:23 AM
highlight matching brackets in vim muddywaters Programming 5 06-26-2006 08:43 AM
vim region highlight problem? Chowroc Linux - Software 2 02-17-2006 06:57 AM
How to make own highlight scheme in vim? kornerr Linux - General 2 01-04-2006 08:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration