syntax-highlighting

Create Visual Studio Theme Specific Syntax Highlighting

大憨熊 提交于 2019-12-21 09:17:17
问题 I would like to create a Syntax Highlighter in Visual Studio 2012 (and above) that supports different themes (Dark, Light, Blue). Visual Studio's Editor Classifier project template explains how to create your own colors in the environment using Microsoft.VisualStudio.Text.Classification.ClassificationFormatDefinition . It works fine... ... until you realize that there are different themes in Visual Studio 2012 (and above) and you don't really support them. Your pretty dark blue colored

Razor .cshtml syntax highlighting for vim?

梦想与她 提交于 2019-12-21 07:24:09
问题 I'm looking for a .cshtml vim syntax file. Are there any projects that haven't made it to www.vim.org? 回答1: ":setf html" solves the 80% part :) 回答2: this guy has razor support planned, but is not yet there. However, it does add some features to the existing c# support. https://github.com/OrangeT/vim-csharp 回答3: You can find nice vim-razor plugin in https://github.com/adamclerk/vim-razor $ cd ~/.vim/bundle $ git clone https://github.com/adamclerk/vim-razor 回答4: Settled with adding this to

GitHub Atom: How to apply a particular syntax highlighting to some files based on name

白昼怎懂夜的黑 提交于 2019-12-21 07:08:10
问题 How can I configure GitHub's Atom to make it automatically set a particular syntax highlighting to filenames based on name and/or extensions? Specifically I want it to automatically set Ruby syntax highlightning to Cocoapods' Podfile s. 回答1: As of Atom 1.0.8 this is now possible without the file-types package, using a core feature. To achieve this, open the config.cson file, and add a section like the following: "*": # Other config core: customFileTypes: "source.ruby": [ "Podfile" ] There is

Can I customize syntax highlighting in Eclipse to show octal literals differently?

孤人 提交于 2019-12-21 07:07:28
问题 I think octal literals are Very Dangerous Things™, and I'd like them to be glaringly obvious whenever I read source codes. There must be a way to do this in Eclipse, right? So it looks like standard Eclipse cannot be configured to do this? A custom colorer is required? 回答1: No, currently you can only configure a color for all Numbers in Preferences > Java > Editor > Syntax Coloring. May I suggest creating an enhancement request at the Eclipse Bugzilla at http://bugs.eclipse.org/ (correct

HTML syntax highlight sublime 3 Typescript

百般思念 提交于 2019-12-21 05:48:24
问题 I am using TypeScript with Sublime 3. How can I add HTML highlight in template attribute: [NOTE: I am already using Microsoft TypeScript Package] Look how its not highlighted now: 回答1: You can read here how to achieve this: https://forum.sublimetext.com/t/javascript-es6-template-literals-syntax-for-html/18242 Reproduced here: Open Tools > Developer > New Syntax Add: %YAML1.2 --- # See http://www.sublimetext.com/docs/3/syntax.html name: JavaScript NG file_extensions: - js - ng.js scope: source

How to color highlight .htaccess files in Eclipse

為{幸葍}努か 提交于 2019-12-21 04:30:05
问题 I spend some time editing configurations in .htaccess files across several projects in Eclipse. How would I go about telling Eclipse to auto color this file in a similar fashion as shell scripts or HTML? 回答1: One thing that would work for sure is write your own plugin for .htaccess files. But if you've never done that before it will take a bit of time to get into. There are plenty of tutorials available online, though. See here for an example. 回答2: I found using the "Properties File Editor"

Vim : Highlight the word TODO for every filetype

守給你的承諾、 提交于 2019-12-21 03:36:11
问题 I would like to highlight the word TODO in vim, no matter what file is edited (code or normal text). It currently works for many different languages (for example, TODO is highlighted in C/Java comments by default), but I use vim for non-code text files and I would like to see the TODOs highlighted for them too. What is the easiest way to do that ? 回答1: Highlighting TODO for every filetype and without possibly breaking other syntax rules can be done only by using :match / matchadd() : augroup

python highlighting in Rmarkdown in RStudio

﹥>﹥吖頭↗ 提交于 2019-12-21 02:01:06
问题 I'm using RStudio 0.98.1103. It is said in release notes that they've added "Syntax highlighting modes for XML, YAML, SQL, Python, and shell scripts." But when I write something like this: ```{r engine='python', highlight=TRUE} print("Hello World") ``` - I don't get proper highlighting (like I have here). I've seen this question: Syntax highlighting for Python chunks does not work - but I guess it was asked before the release of 0.98.1103 and things could've change, I'm just doing something

How can I show code (specifically C++) in an HTML page?

本秂侑毒 提交于 2019-12-20 12:15:12
问题 How can I show code in a website using HTML? Basically, I have a C++ program that I'd like to share on my website and I want to show it in the page. Is there anyway to show a C++ code in HTML other than using HTML text? 回答1: There are various syntax highlighters out there. Google Code Prettify is a pretty good one. (Good enough for Stack Overflow to use, anyway.) 回答2: HTML includes a tag called <code>, which is meant for the purpose you describe. The spec even includes an example class name

Qt5 Syntax Highlighting in QML

佐手、 提交于 2019-12-20 11:49:50
问题 I am working on a QtQuick 2.0 presentation and I would like to embed some code samples. is it possible easily to create a syntax highlighting qml element. Can you give me example technologies and ideas on how to achieve it. Thanks 回答1: Qt Quick's TextEdit item exposes a textDocument property, of type QQuickTextDocument . This is explicitly exposed so you can use QSyntaxHighlighter directly with the document. QtQuick textEdit documentation for Qt 5.3 回答2: There is no obvious way to achieve