syntax-highlighting

Where can I change the Asp.net MVC 3 Razor syntax highlighting in VS10?

孤者浪人 提交于 2019-11-27 17:17:39
问题 I searched Tools > Options, but where in VS10 can I turn off or change the default highlighting for the new Razor view on the @nuggets in ASP.NET MVC 3? 回答1: Razor only adds one entry to Fonts & Colors, "Razor Code". That controls the background color given to Razor Code nuggets. The rest of the colors are the same as the C#/VB colors. The "@" character itself and Razor keywords like "model" and "section" use the same color as the ASPX "<%" tag ("HTML Server-Side Script", thanks to another

How do I make my own method similar to String.Format using Composite Formatting in C#

冷暖自知 提交于 2019-11-27 17:15:43
问题 I like how String.Format uses arguments to inject variables in to the string it is formatting. This is called Composite Formating and is discussed by MSDN here. I want this functionality with my logging facade: string foo = "fancy"; string bar = "message"; log.Debug("My {0} log {1}.", foo, bar) My ILoggerFacade has the following method signature: void Debug<T>(T message, params Object[] args); And, I know I can implement this quite simply: ILog m_Log = \\some logging implementation public

Is Crockford style Context Coloring implemented in any code editor?

烂漫一生 提交于 2019-11-27 17:12:09
I watched a video from YUIConf 2012 in which Douglas Crockford gives a talk about implementing monads in JavaScript. In this talk he gives a code example that utilizes what he calls "Context Coloring" which throws out the idea of coloring by language syntax and introduces different colors for different levels of scope. Here is the link to that specific part of the video. http://www.youtube.com/watch?feature=player_embedded&v=dkZFtimgAcM#t=15m58s Is this context coloring scheme implemented by any code editor for JavaScript or any language? I use Sublime Text and this editor like every other

Silverlight XML editor / syntax highlighting

痞子三分冷 提交于 2019-11-27 16:33:23
问题 I am looking for a Silverlight text editor control that provides XML syntax highlighting . I found a few answers in Winforms or WPF , like here on Stackoverflow, but I didn't manage to convert them to Silverlight. The fact that Silverlight is missing System.Drawing is probably a big problem. The only text editor I found for Silverlight is RichTextEdit on Codeplex, but I don't think it is a suitable base for real-time syntax highlighting. Has anyone heard of such a control, or can provide

Can I make vim do syntax highlighting on C++ headers that don't have extensions?

倾然丶 夕夏残阳落幕 提交于 2019-11-27 15:29:36
I have a project with a bunch of C++ header files that follow the standard C++ header naming convention; that is, a class called Foo would be declared in a file called Foo , not Foo.h or Foo.hh . Is there a good way to configure vim to do syntax highlighting for these files only? A slightly-less-pleasing fallback would be to enable C++-style highlighting for all files that don't have an extension. I'm not sure if there's any more sophisticated way to detect the type of file instead of relying solely on its extension. You can use the modeline feature for this. Modelines allow you to set certain

Wrong default syntax highlighting in sublime text 3

半世苍凉 提交于 2019-11-27 14:42:19
I can't remember touching any related configuration, and for no reason, Sublime chooses "LaTeX Log" highlighting syntax as default for *.html files. I opened the Syntax Specific settings file and it's empty (?) What can I do in order to get the proper highlighting for html files automatically? Changing the syntax highlighting for any file type is easy in Sublime. Simply open a file with the extension you want to change, then click on View -> Syntax -> Open all with current extension as... and choose whichever language you wish. This will add the current extension to the "extensions" list in

Get X and Y coordinates of a word in UITextView

假装没事ソ 提交于 2019-11-27 13:17:12
I asked a developer (TwoLivesLeft, the creators of Codea) how they did syntax highlighting in their app. He replied : @TD2 the Codea editor is implemented using a UITextView. The highlighting is done by overlaying subviews in the appropriate positions — usually UILabels. They are dequeued from a re-use pool, similar to the way UITableViewCells work. During scrolling, the lines requiring re-highlighting pull markers out of the pool and lines that have moved off screen dump their markers back into the pool. Can anyone explain how I would get the x and y of a certain word? UITextView conforms to

Add syntax highlighting to gh-pages

笑着哭i 提交于 2019-11-27 12:00:40
问题 Is there an easy way to add syntax highlighting to my various plugin's gh-pages using github's Pygments? I know that every page runs through the Jekyll engine and provides syntax highlighting (ref). But I don't want to install a blog. I just want syntax highlighting applied to the code blocks in my gh-pages. I guess I could always just include a different plugin with my gh-pages... 回答1: Pages already does pygments, there's nothing to install. Just use it! --- layout: default title: Something

How to Syntax Highlight in a RichTextBox [C#]?

微笑、不失礼 提交于 2019-11-27 11:42:45
问题 How do I syntax highlight in a richtextbox control AS THE USER TYPES and USING A String[] keywords . I will be publishing a lightweight notepad to the web soon and I want it to have syntax highlighting. I am using Windows forms. Can someone post a code example? 回答1: RichTextBox syntax highlighting (talks about RichTextBox itself - minimal features but exactly what you asked for here) A textbox/richtextbox that has syntax highlighting? [C#] (talks mostly about other ways of doing it) 回答2: The

How to syntax highlight inline R code in R Markdown?

南笙酒味 提交于 2019-11-27 11:34:45
问题 This question is similar to consistent code html inline and in chunks with knitr. Instead of .Rhtml documents, I want to highlight inline R code in R Markdown documents, e.g., after `r "plot(cars, main = 'A scatterplot.')"` is compiled through rmarkdown , the tokens like plot should be highlighted. By default, R code chunks are syntax highlighted, but there is no way to highlight inline R code. 回答1: Here is one solution using the development version of the highr package ( devtools::install