syntax-highlighting

What is the best way to implement syntax highlighting of source code in Cocoa? [closed]

孤街醉人 提交于 2019-12-03 01:05:00
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I'm working on Cocoa Application that should be able to analyze and highlight a source code written in such languages as Objective-C, SQL, JavaScript, Python etc. The text should be editable too (by using NSTextView, for example). Please advise what is the best way to implement such feature in Mac OS X 10.5.

Vim Configure Line Number Coloring

独自空忆成欢 提交于 2019-12-03 00:58:56
问题 I'm looking for a way to configure the color used for line numbering (as in: :set nu ) in Vim. The default on most platforms seems to be yellow (which is also used for some highlighted tokens). I would like to color the line numbers a dim gray; somewhere in the vicinity of #555 . I'm not picky though, any subdued color would be acceptable. 回答1: Try: help hl-LineNr I found this through: help 'number' which is the way to get help on the 'number' option, instead of the :number command. To

Utilizing emacs' or vim's syntax highlighter for command-line program?

社会主义新天地 提交于 2019-12-03 00:41:32
I have a command-line program that spews JSON and YAML. By default it detects if pygments (pygmentize) is available and if it does, pass the output throught it to get a nice colorized output. However, pygments is not installed by default on most computers that this program will run on. But most computers will have either emacs or vim, however, does. Is there a way to get one of these editors to syntax-highlight some text using ANSI escape sequences and then output it again? as the editor can already do the ansi stuff, rather easy to make a screen capture of the editor, no? script -qc "stty

Eclipse Syntax Coloring File

 ̄綄美尐妖づ 提交于 2019-12-03 00:05:11
After setting up the Java syntax highlighting for my workspace, I want to backup this file to, lets say, give it to my friends. Can you tell me in which file Eclipse stores these coloring values? kaliatech SECOND ANSWER (also in comments below) Sharing Java color syntax setting is possible by working with various Eclipse preference files. See: http://srand2.blogspot.com/2009/08/eclipse-color-themes.html . Specifically: [workspace]\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.jdt.ui.prefs [workspace]\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.ui

Is there an IDE out there that does structural syntax highlighting?

六眼飞鱼酱① 提交于 2019-12-02 22:08:40
Somewhat inspired by this question about a graphical programming environment. I don't think that C++ or C# are really conducive to this type of environment, but perhaps there's something halfway there. Lot's of IDEs that I've used will use syntax highlighting to change the foreground (or even the background) colour of text for keywords, strings, comments, etc... Are there IDEs out there that will highlight larger syntactic structures? Here's an example of what I'm thinking of. Example code structure http://img256.imageshack.us/img256/9441/codestructure.png (Please don't comment on my poor

Notepad++ not syntax highlighting my files

こ雲淡風輕ζ 提交于 2019-12-02 21:39:13
Until a week ago I was happily coding html.erb files in Notepad++ with syntax highlighting. Then my hard drive crashed. I reinstalled Notepad++ on my new system but when I open my html.erbs, only a few of them are highlighting properly. I think the problem might be that most of these files are being considered 'normal text files', where the few that are working are considered 'html files'. I tried 'save as' html file of the same name, but it isn't working. How can I get my syntax highlighting back? This is seriously slowing me down. You could try going to Language > H > Html and that should

Diff syntax highlighting in Github Markdown

本秂侑毒 提交于 2019-12-02 21:32:56
I'm writing documents that should explain code in C# using Markdown. I use the ```csharp to get csharp highlighting. I sometimes want to highlight something specific in the code using bold or anything. I know about <pre> etc... but it takes away my csharp highlighting. Best case scenario - some way to highlight code in the ```csharp section. Next best thing - I can write the code as diff - using + and - to highlight stuff, but how do I tell Github to highlight diff syntax with the red and green backcolor? Is there a way to use both diff and csharp syntax highlighting? Salvador Medina Github's

Compiler compiler in C#

橙三吉。 提交于 2019-12-02 21:13:10
I'm looking for a customizable parser and/or lexer that can allow me to build a custom syntax checker in C#. Essentially the user will enter code a line of code (custom), and the syntax checker will be able respond if it is written correctly or not. That's Irony . Be sure to read the discussion, because it's a lot going on there. Use the old release from November or use the latest, but then make sure you understand what is in that release and what not. For most things, the November release should work well (using it in a pet project). Irony allows to build an abstract syntax tree (AST) from

Syntax Coloring In Mathematica

让人想犯罪 __ 提交于 2019-12-02 20:57:31
How could user-defined function symbol such as f in f [x_] = 2 x or variable symbols such as lotto in lotto = Table[2, {10}]; be colored automatically ? In Syntax coloring on M8 no option is offered for this. Only Local Variables or Global symbols that have no values assigned. This is not exactly what you asked for, but it may be useful to you. You can highlight symbols by context, using this method: SetOptions[$FrontEndSession, AutoStyleOptions -> {"SymbolContextStyles" -> {"highlight`" -> Green}} ] AppendTo[$ContextPath, "highlight`"]; Now, when you create a symbol in the context highlight`

syntax highlighting for react code in sublime

依然范特西╮ 提交于 2019-12-02 19:58:09
I'm started writing some basic React code in sublime text. Here is what my syntax highlighting looks like. Its partly highlighted. Is there any suggested sublime plugin i can use to see a complete syntax highlight? import React, { Component } from 'react' import { connect } from 'react-redux' // <-- is the glue between react and redux import { bindActionCreators } from 'redux' import { selectBook } from '../actions/index' // there is no intrinsic connection between React and Redux // they are two seperate libraries // they are connected using a seperate library called ReactRedux // container?