syntax-highlighting

How to implement a simple Syntax highlighting method for edittext?

。_饼干妹妹 提交于 2019-12-06 01:47:55
问题 I am making an app that involves coding and I need edittext to recognize if the word typed was 'something' then depending if it is registered to be colored, it will color the word. Here is what I want to do, when the user is typing and types 'function' I want it to automatically highlight. Same goes to any other 'function' word, '()', ' " ', and many other words the user types. 回答1: You can accomplish this by using a TextWatcher like so: editText.addTextChangedListener(new TextWatcher() {

Use vim syntax definition with sublime-text2

走远了吗. 提交于 2019-12-06 01:31:17
问题 Does anyone know if you can use (or convert) vim Syntax Highlight Definition Files with Sublime Text? I am searching for a highlighter for promela and only found one for vim, but am using sublime-text as my default editor The Definition i've found https://github.com/vim-scripts/promela.vim/blob/master/syntax/promela.vim 回答1: Sublime Text uses the XML-based PLIST .tmLanguage format for language definitions, and to my knowledge no one has written a converter for vim syntaxes. However, if you'd

Line Numbers, Code Highlighting in TextView

吃可爱长大的小学妹 提交于 2019-12-06 00:09:22
I'm working on an 'IDE' for Android - it could be useful for editing short scripts / making quick adjustments to files. At the moment I'm just using a simple EditText, but I am wanting to add several features, for example Line Numbering down the left hand side of the EditText and Code Highlighting. Does anyone have any suggestions about how to approach this? For the code highlighting, I'm guessing I'll need to write my own subclass of EditText. For the line numbering, could I have a thin vertical TextView that has the same text size as the EditText?? Yes, I'm aware editing code on a mobile

Does vscode editor support .inc file highlight?

China☆狼群 提交于 2019-12-05 22:51:09
问题 I'm using .inc files in vscode, but I find that vscode does not support .inc files' highlight.Does vscode support inc file syntax highlighting? 回答1: .inc files are used in multiple languages; what language are you using them in? You can tell VSCode to apply language-specific syntax highlighting by editing the settings.json (File > Preferences > Settings) by adding the file extension to the highlighting category. For example, to highlight .inc files as PHP, { "files.associations": { "*.inc":

syntax highlighting between matching parenthesis

自作多情 提交于 2019-12-05 18:13:29
Say I hava a LaTeX document open in Vim, and I want to highlight every occurence of {\color{red} ... } (where the dots are supposed to symbolize some contents), that is, I want to have {\color{red} , } and everything between these highlighted. This I have done with :syn region WarningMsg start=+{\\color{red}+ end=+}+ but I have the problem that, if I write something like {\color{red} some{thing} important} , then it is only {\color{red} some{thing} which gets highlighted, because Vim of course mathces the first occurrence of } . How can I make this Highlighting rule so that it skips matching

Groovy syntax highlighting in Vim 7.4

这一生的挚爱 提交于 2019-12-05 16:47:51
Since I updated Vim to version 7.4, Groovy syntax highlighting was broken. For example: int i1 = 100 / 2 * 5 + 120 In example above code after / char is highlighted as string literal while another / char will not be found there. Is anyone met this error? UPDATED: Groovy regexp strings can be written as /regexp/ , but in official Groovy documentation this string is not highlighted (I think because it is very difficult to separate this regexp and division expression). In previous (7.3) major version of Vim is alright. 来源: https://stackoverflow.com/questions/18855809/groovy-syntax-highlighting-in

How do I enable Live Syntax Checking in the Ace Editor

我的未来我决定 提交于 2019-12-05 16:13:18
Ace Editor has Live Syntax Checking , which can check code as it's being typed for syntax errors. I have a Rails 3.2 site with the Ace file included on each coding page. I added a require statement to the javascript to tell Ace where the worker file is, but it's still not working. How do I get Live Syntax checking to work? Each coding page includes: <%= javascript_include_tag "ace-src/ace.js" %> <%= javascript_include_tag "ace-editor" %> The Ace files are located in the ace-src folder. I aded this code to ace-editor.js: require("ace/config").set("workerPath", "/assets/ace-src"); Syntax

Highlighting delimiters without spaces before parentheses in user defined language

血红的双手。 提交于 2019-12-05 14:56:09
I have a problem with custom syntax highlighting in Notepad++. I want to display text in parentheses in a different color. In View → User Define Dialogue I've defined a custom language and set up corresponding delimiters, "(" and ")". However, the problem is that Notepad++ is highlighting the text between parentheses only when there is a space before the left parenthesis. So for example, in ^reg(ular)?$ (ular) is not highlighted, but in ^reg (ular)$ it is. Is there a way to force Notepad++ to recognize delimiters without the space before parentheses? If you add open parenthesis, "(", to the

IntelliJ IDEA - Syntax Highlighting of SQL Inside Java Code

浪子不回头ぞ 提交于 2019-12-05 13:07:45
问题 I am using IntelliJ 13 as an IDE for a project where communication with DB is done via Spring's JDBC Template. When I have code fragments in Java like the following one: getJdbcTemplate().queryForObject("SELECT CONVERT(VARCHAR(255), NEWID())", String.class); where getJdbcTemplate() returns initialized JdbcTemplate object, the IDE has proper syntax highlighting for the SQL statement (you can see it on the snippet bellow): .code {font-family: Monospace} .db-stmt {background: #EDFCED} .db

How to set curly braces'/parentheses'/square brackets'/arithmetic operators' syntax highlight color in VIM?

坚强是说给别人听的谎言 提交于 2019-12-05 09:08:36
How do I highlight operators/parentheses/brackets/etc. in VIM? I'm not interested in coloring matching or unmatching parentheses/brackets. I've tried ":hi cBracket/whatnot guifg=something" and ":hi Operator/cOperator guifg=something" but these don't seem to affect anything. There are two parts to Vim syntax coloring: the syn command and the hi command. As far as I understand, you use syn to define syntax. For example: syn match parens /[(){}]/ Then you use hi to tell Vim how to highlight parens : hi parens ctermfg=red See :h pi_paren.txt about highlighting matching parens: To disable the