syntax-highlighting

How to create a simple custom language colorization to VS Code

瘦欲@ 提交于 2019-11-30 09:05:35
I'm trying to create a simple colorization for log files, now that it's possible include custom languages in Code (I'm on 0.9.2). I have created a simple .tmLanguage file for colorizing the letter 'q', just for starting up, but have been unsuccessful. My new language, log , is associated correctly with the file extension and I can also select it manually from inside Code, but no coloring takes places. I have a feeling it has to do with what "scope" I associate my pattern with, but I'm not sure. Is there a list of valid scope to choose from? Initially I thought I'd use something general, such

Jquery/Javascript - Syntax highlighting as user types in contentEditable region

末鹿安然 提交于 2019-11-30 08:30:06
I'm developing a contentEditable region on my website, where users will be able to type messages to each other. <div contentEditable="true" class="smartText">User types here...</div> The thing is, we will have smart text inside, meaning that if a user type @usersame inside this div, the @username should be highlighted in blue if the username exist and green if he doesn't exist. And of course all of this should happen as the user types... I have no idea where to start, right now I have this: $("body").on("keyup",".smartText",function(){ var $this = $(this), value = $this.html(), regex = /[^>]#

HTML5 rich-text inside textarea

五迷三道 提交于 2019-11-30 08:26:29
问题 I heard that the new HTML5 will add rich text capability to textareas (it will make them more flexible), so you can do stuff like code syntax highlighting editors without very nasty javascript (like creating iframes and stuff). Is this true? Are there browsers with support for it yet? And where can I find some API? 回答1: NO - jQuery If what you where looking for (the same as me) is NO-jquery tools (pure HTML/CSS + basic JS), then some of the best options I found are: wysihtml5 Squire ckeditor

Fix for Xcode's indiscernible highlighting of inline errors?

為{幸葍}努か 提交于 2019-11-30 07:20:20
I can't be the only one that finds Xcode's method of "pointing out" where your mistakes are - ridiculous. As helpful and essential as the feature is.. it does not help to make the line I need to fix virtually impossible to read or edit... let alone see... And don't get me started on the constant struggle to find a "selection" color that is visible, yet retains one's sanity/ability to see what the selected text actually IS! What am I missing here? I know how to futz with the colors in xCode, I know how to mess with the Appearance "Control Panel", but it all just results in different

Use Syntax Highlighter on AJAX loaded content

与世无争的帅哥 提交于 2019-11-30 06:47:04
How can I use Alex Gorbatchev`s Syntax Highlighter on content loaded after 'window' emits 'load' event? I am trying this way: $.ajax({ url: file, success: function(data) { $('.fileName').text(file); $('#fileSource > pre').text(data); SyntaxHighlighter.all(); } }); ... but it is not working. I need to mention that the ajax call can occure at any time after the page loads. Regards Kasper Rasmussen - SyntaxHighlighter.all() binds window load. So if you want to highlight element when the page loads, then use this method. - SyntaxHighlighter.highlight() highlights elements whenever you will call

Add syntax highlighting to .less-files in NetBeans

孤者浪人 提交于 2019-11-30 05:50:55
I want to have files with a .less extension use the CSS syntax highlighting in NetBeans, and I don't have any clue how to do this. I found a rather time consuming way to do this ( http://netbeans.dzone.com/tips/quickstart-guide-language-supp ), but it hit me that it must be easier way to do this. Anyone knows? a module which adds full less highlighting support can be downloaded from the following page: http://plugins.netbeans.org/plugin/32782/lesscss-module i tested the module with netbeans 7.0 and it worked flawless. You just have to add a new file type in Netbeans > Tools > Options >

Vim inconsistently syntax highlighting bash files

六眼飞鱼酱① 提交于 2019-11-30 05:48:10
When I open some bash script files with vim it sometimes identifies them as conf files, that's okay, I can just correct that by setting the filetype to sh with :setf sh . That great, except I've noticed that this doesn't fix things entirely: Notice that shopt is properly highlighted on the left, but not on the right, where I manually set the filetype to sh . This means that when a file is identified as bash or sh by vim, it sets the filetype to sh but then does some extra steps that I'm not doing when I set the filetype manually. Any one know what that might be, and how I could fix it? vim

UITextView attributedText and syntax highlighting

六月ゝ 毕业季﹏ 提交于 2019-11-30 05:23:05
Background So, with iOS 6 an UITextView can take an attributedString, which could be useful for Syntax highlighting. I'm doing some regex patterns in -textView:shouldChangeTextInRange:replacementText: and oftentimes I need to change the color of a word already typed. I see no other options than resetting the attributedText, which takes time. - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { //A context will allow us to not call -attributedText on the textView, which is slow. //Keep context up to date [self.context

Highlighting unmatched brackets in vim

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 05:04:10
I'm getting burned repeatedly by unmatched parentheses while writing python code in vim. I like how they're handled for C code - vim highlights in red all of the curly braces following the unmatched paren. I looked at the c.vim syntax file briefly to try to understand it, but the section that handles bracket errors is very complex. Can anyone explain how that code works and suggest how I might write something similar for python code? Example C code with unmatched parens: int main(void { /* brace highlighted in red */ } /* brace highlighted in red */ Since python code doesn't have curly braces

Syntax Highlighter for WPF

六眼飞鱼酱① 提交于 2019-11-30 03:58:21
问题 I'm currently looking for a Syntax highlighter for a WPF application. A textbox will be available for the user to type into which would hopefully recognise code and highlight syntax accordingly. I would like to support C# initialy and other languages later. Duplicate of Question 394751 回答1: I think this question has your answer. Anyone know a code editor I can embed in a WPF window or Windows forms? Or you can write one yourself: http://blogs.microsoft.co.il/blogs/tamir/archive/2006/12/14