syntax-highlighting

How to color highlight .htaccess files in Eclipse

China☆狼群 提交于 2019-12-03 13:13:01
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? 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. I found using the "Properties File Editor" seems to give a decent color output. It's actually for Java files, so it comes with a stock Eclipse. In

Syntax Highlighting: How Does Eclipse Do It So Fast?

两盒软妹~` 提交于 2019-12-03 12:40:22
问题 I've developed a syntax highlighter in Java for Android and it's working well, but the problem is it can be slow with big files. So I'm wondering how source code editors like Eclipse and Gedit (Ubuntu) highlight what you've just wrote so quickly. For example, if you enter the ending greater than symbol when writing a HTML tag, it highlights the tag instantly. How is it so quick, even with big files? Is there a specific way they go about doing it or do they just perform the syntax highlighting

Eclipse stops highlighting references after a while

試著忘記壹切 提交于 2019-12-03 12:39:54
When I open a Java file for editing in Eclipse, references highlighting works well for a while, but then suddenly stops working after some minutes. On this example, parameters was the last variable correctly highlighted, but now it's no longer working and not highlighting anything else (it should highlight password ): Toggling Mark Occurrences off and back on doesn't solve it. I've already tried restarting Eclipse and rebooting the computer (had this problem for weeks actually). The only workaround I found so far is closing the file, and reopening it. But then it stops working again after some

How do I add intellisense to my application?

流过昼夜 提交于 2019-12-03 12:35:41
We have a proprietary macro language in one of our products, edited through our Windows software. I would like to add intellisense, but I have no idea how to go about this (at least not without completely reinventing the wheel). Is there any sample code or 3rd party package that can at least get me started? It doesn't have to be free. The application uses .NET, written in C#. There is a CodeProject article about adding intellisense to your own applications: DIY Intellisense It should give you a good start. There are also open source packages that you can dig into if you really want dig deep

Vim : Highlight the word TODO for every filetype

倾然丶 夕夏残阳落幕 提交于 2019-12-03 11:52:24
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 ? ZyX Highlighting TODO for every filetype and without possibly breaking other syntax rules can be done only by using :match / matchadd() : augroup HiglightTODO autocmd! autocmd WinEnter,VimEnter * :silent! call matchadd('Todo', 'TODO', -1) augroup END

vim syntax highlighting for git commit messages - custom commentchar

倖福魔咒の 提交于 2019-12-03 11:35:44
问题 As mentioned in this answer, since Git 1.8.2 you can use core.commentchar config value to change commit message comments to something else than the default # (hashmark or hashsign). That is a life-saver e.g. if your commit message policy wants you to start commit message with ticket number: #123 Fixed array indices Sad part is that this breaks Vim syntax highlighting. How can you bring the beauty back? 回答1: You should try to run :verbose syntax . The active syntax file is probably $VIMRUNTIME

How to reinitialize highlight.js?

与世无争的帅哥 提交于 2019-12-03 11:33:15
问题 My website is generating some content dynamically, so I have to somehow launch the highlight.js plugin again after loading it. This code is used to launch the highlighter: hljs.initHighlightingOnLoad(); I tried to do something like hljs.initHighlighting(); to do this again but it does not work. 回答1: You must set called to false first: hljs.initHighlighting.called = false; hljs.initHighlighting(); 回答2: You can reinitialize all of the codeblocks like this. $(document).ready(function() { $('pre

How to manually specify syntax highlighting for a specific extension in Eclipse?

家住魔仙堡 提交于 2019-12-03 11:13:00
I am editing some files with the extension '.ctp'. Although these files are perfectly valid PHP files, Eclipse doesn't seem to know that and refuses to do any syntax highlighting with them. How can I manually instruct it to use PHP syntax coloring for '.ctp' files? Is there even a way to do that? netcoder In Preferences , go to General -> Content Types . Unfold Text , then go to PHP Content Type . Click Add and input * .ctp . Then apply your changes. You may need to restart eclipse to take effect. 来源: https://stackoverflow.com/questions/4131128/how-to-manually-specify-syntax-highlighting-for-a

Eclipse syntax highlighting: trying to specify it for a new file extension, and it's not working

点点圈 提交于 2019-12-03 11:02:14
I'm working with Eclipse/PHP and just starting with Drupal 7, which needs me to use PHP files of extension .test. So I'm trying to add the ".test" extension to the list of files that Eclipse recognises as PHP. I've done this two ways: (1) By specifying it in Preferences-General-Editors-File Associations, and (2) By specifying ".test" in Preferences-General-Content Types (as described in How to manually specify syntax highlighting for a specific extension in Eclipse? ). The trouble is, nothing happens - my xyz.test file opens just fine with the PHP editor, but no syntax is highlighted (and yes,

How to change the color of the selected code (Vim scheme)?

允我心安 提交于 2019-12-03 10:58:15
问题 How do I change the color of the selected code in Vim? There are three selection modes, Visual Line mode or Visual Block mode, and selecting with the mouse). hi CursorLine guibg=#DDDDDD gui=none hi CursorColumn guibg=#EEEEEE gui=none hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=none hi Pmenu guifg=#f6f3e8 guibg=#DDDDDD gui=none hi PmenuSel guifg=#000000 guibg=#DDDDDD gui=none endif " General colors hi Cursor guifg=NONE guibg=#656565 gui=none hi Normal guifg=#000000 guibg=#FFFFFF gui=none hi