syntax-highlighting

How do I create Vim syntax highlighting rules that are common to all filetypes?

▼魔方 西西 提交于 2019-12-11 06:56:18
问题 I'm trying to highlight trailing whitespace in vim, regardless of filetype. I'm able to do it on a per-filetype basis. For example, for HTML: ~/.vim/ftplugin/html.vim color html ~/.vim/syntax/html.vim syn match TrailingSpace display excludenl /\s\+$/ ~/.vim/colors/html.vim hi TrailingSpace ctermbg=52 ~/.vimrc syntax on filetype on filetype plugin on These settings make it so that trailing spaces at the end of a line are highlighted with a red background. (They also override all of vim's built

AvalonEdit: is it possible to highlight this syntax?

不羁岁月 提交于 2019-12-11 06:38:49
问题 I have a simple "language" (similar to template languages and simple markup languages such as BBcode — basically it's just normal text with some variables, tags and similar features) and I want to highlight its syntax. Here is the thing I am stuck with. There are variables, they are enclosed with $ sign ( $var1$ ). I highlight them with this rule: <RuleSet name="VariableSet"> <Rule color="Variable"> \$\S+?\$ </Rule> </RuleSet> Some area around a variable can be surrounded with { } characters.

Proper html attribute highlighting in Vim?

依然范特西╮ 提交于 2019-12-11 06:22:57
问题 While I was looking for proper html tag highlighting in Vim, I found this post. But after looking at romainl's answer (and his screenshot) and html syntax file, I wonder how can I change color of = (equal sign) after attribute to match the color of an attribute without changing html tag's color? 回答1: Exploration Here is a very useful function I've found somewhere (a long time ago, probably on the Vim Wiki) that gives you the syntax group of the word/symbol under your cursor: function!

C++14 Syntax in Eclipse CDT compiles but marked as syntax error (indexer)

三世轮回 提交于 2019-12-11 05:58:19
问题 Eclipse CDT gives me a syntax error for a valid C++14 syntax. Everything compiles and runs but the syntax highlighting is broken. I have MinGW and Eclipse running. The C++14 program compiles and executes but I get incorrect syntax highlighting / syntax checking. Here is my source code: #include <iostream> auto main() -> int { //Binary Literals C++14 with Digit separators C++14 auto seven = int{0b0000'0111}; std::cout << seven << std::endl; std::cout << __cplusplus << std::endl; return int{0};

Eclipse e4 RCP SourceViewer syntax coloring

我怕爱的太早我们不能终老 提交于 2019-12-11 05:18:03
问题 To implement syntax coloring in an eclipse e4 RCP application, I have created a basic plugin project with a Part including a SourceViewer control. public class SyntaxColoringTest { /** The SourceViewer control to create the editor. */ public SourceViewer sv = null; @Inject public SyntaxColoringTest() { } @PostConstruct public void postConstruct(Composite parent) { IVerticalRuler verticalRuler = new VerticalRuler(10); OverviewRuler overviewRuler = new OverviewRuler(null, 20, null); sv = new

python / PyCharm: access to a protected member of another object of the same class

99封情书 提交于 2019-12-11 04:44:21
问题 In a method of my class MyHeader i access the private property _label of another MyHeader object new_header : class MyHeader: def __init__(self, label, n_elem): self._label = label self._n_elem = n_elem def check_header_update(self, new_header): # check that label is preserved if new_header._label != self._label: raise Exception("new header must have the same label") In PyCharm, this results in the syntax highlighting error " Access to a protected member _label of a class ". I tried

Possible to add Ruby syntax highlighting to Visual Studio 2008?

孤街醉人 提交于 2019-12-11 03:11:31
问题 When I open a Ruby file (*.rb) inside Visual Studio, it reads like a regular text file - with no syntax highlighting on language keywords. Is there any way to set this up in Visual Studio? Update: No, I don't use Visual Studio for Ruby development - I use Netbeans. But I would like to open a Ruby file in Visual Studio and see the proper highlighting. 回答1: There is a Ruby plugin for Visual Studio by Sapphire Steel Software, called Ruby in Steel. 回答2: There might be a plugin in Visual Studio,

Disable syntax highlighting for certain filenames

强颜欢笑 提交于 2019-12-11 02:55:15
问题 I have syntax highlighting enabled in .vimrc, but that makes loading certain files too long. So I need to disable (or, to be precise, not enable... enabling it and then disabling is not a solution) syntax highlighting for these files. I tried au BufNewFile,BufRead !*.inc syntax enable but that made just no syntax highlighting applied ever. The solution presented here does not work for me, since I can't make a distinction by filetype. I tried adapting to no avail, which might or might not be

Set colors for custom syntax keywords in Vim?

血红的双手。 提交于 2019-12-11 02:42:18
问题 I'm using a syntax file in vim that defines a number of filetype-specific syntax keywords. To color files of this type I've also created a colorscheme file for the share directory that attempts to highlight these syntax keywords, however they don't take effect when I open files of that extension. My color file does however highlight normal groups such as Normal , Special , Comment , etc. As well, when I attempt to move these highlight commands to my .vimrc file, they still have no effect.

Is there a way to tell gedit that .sage files should always be highlighted as Python code?

送分小仙女□ 提交于 2019-12-11 02:27:19
问题 Well, that's about all there is to say. Currently I have to set the highlighting on each file by hand, which is getting annoying, especially since it sometimes forgets and I have to set it again. I'm using gedit 3.6.1 on a lubuntu machine, if that matters. Sorry if this is a really easy question, but I haven't been able to figure it out myself. Thanks. 回答1: Thanks to Fredrik's comment I found an easy solution, although it seems like more of a hack than one would want. go to /usr/share