Markdown syntax highlighting in SciTE/Notepad++ - syntax-highlighting

I'm looking for a .properties file for Markdown syntax in SciTE. Is it possible?
A partial highlighter would do, otherwise.

I'm using this syntax file: https://github.com/leafnode/markdown_npp with some color changes to fit dark background.

I've uploaded my (dark) user-defined language Markdown highlighter on GitHub. It uses different workarounds than thomsmits', which for the style of Markdown I've chosen work better.
Until the Markdown Scintilla lexer is imported into Notepad++, user defined languages are the best we can do.
I don't use Notepad++ any more and have deleted my project. Try Brettz9's fork of the project here: https://github.com/brettz9/Notepad---Markdown-Highlighting

I'm using Markdown-plus-plus. The install instruction is outdated on many projects. The actual instruction is:
Select menu "Language" → "Define your language..."
Press button "Import...", and select {markdown}.xml (from GitHub repositories).
Restart Notepad++

I believe somebody mentioned on the mailing list that he is working on such a lexer.
I don't think a simple .properties file can do the job, as there isn't any existing lexer (to my knowledge) with similar syntax.

Related

Is there an editor (or a solution for kate) doing syntax highlighting in a mixed code?

I'm using Kate as the editor of my Node.js projects. In the Node.js projects, I sometimes prefer to code whole index.html in a single file. At that time, I need to use:
html
css (<style>...</style>)
livescript (<script type="text/ls">...</script>)
javascript (<script [type="text/javascript"]>...</script>)
at the same time. Kate can highlight these codes if they are in their separate files.
How can I make the code highlighted correctly when they are mixed in a single file (preferably in Kate, or any other editor that would run on Linux)?
Kate can do this, too. It is supported in e.g. HTML/PHP highlighting and similar. Just have a look into the respective highlighting xml files to get an idea how to implement a highlighting for this. More information about how to write syntax highlighting files can be found in the KatePart Handbook.

What is the equivalent of re-formatting and checking syntax on save of Textmate in SublimeText2?

I recently switched to SublimeText2 from Textmate and I've been enjoying it.
But there are some features of Textmate which I don't know for SBT2.
Selecting a block of code and pressing CMD+OPTION+[ re-formats the selected block.
While saving a file CMD+S, ruby or jquery or coffee-script, etc.. Texmate checks the syntax of the code.
How to do the same with SBT2?
To check syntax on save you can use SublimeLinter and to reformat code you can use something like the following depending on what languages you work with:
HTMLTidy
Sublime-HTMLPrettify (HTML, JS, CSS)
Pretty JSON
PHPTidy
PythonTidy
BeautifyRuby
There are plenty of other similar and other useful extensions and plugins here: http://wbond.net/sublime_packages/community
All of which can be easily installed and kept up to date using Package Control.

Is there support for XML code hinting / completion in Sublime Text 2?

I am giving Sublime Text 2 a try and I was editing an XML file - that had a DOCTYPE declaration and a DTD - and there seems to be no way to get code hinting / completion when editing the XML document.
I am sure its something simple I am overlooking. I cannot imagine Sublime does not have this kind of functionality, even if provided via a plugin.
Can someone shed some light on this for me?
Sublime Text is first and foremost a text editor.
But, the reason for it's popularity is in large part due to it's extensibility.
Although you could use Sublime's api to create a specific plug-in to do this, Sublime has a few tools that are already helpful in editing xml files and other markup files on a bare install.
Hinting and completions in particular are very easy to add. It shouldn't take a more than few minutes to create a domain specific sublime-completions file for your particular xml.
You can use alt+shift+w to create an xml element, in addition alt+. will close any un-closed xml element.
You may also want to try the Sublime Tag plug-in available through Package Control
Lastly you could also bring this up in the Sublime forums as a plug-in request. There are a lot of helpful folks in the plug-in community.
You can use the 'tag' plugin from Sublime Package Control. It has auto tag closing, linting and other features. The github page for the project is here: https://github.com/SublimeText/Tag
You can install it using Package Control without leaving your Sublime text editor.

Is there a way in Sublime Text 2 to support JavaScript completion of objects/functions defined in other files?

If I am editing a .js file in Sublime Text 2 that makes use of a library defined in a separate .js file, is there a way to support tab completion of objects/functions defined in the external library file?
Something analogous to the following from Visual Studio:
/// <reference path="/js/some-library.min.js" />
which enables IntelliSense over the library/plugin code.
I haven't tried it myself yet, but there's SublimeCodeIntel: https://github.com/Kronuz/SublimeCodeIntel#readme
The OP in this thread: http://www.sublimetext.com/forum/viewtopic.php?f=3&t=5319 seems to be complaining that it's pulling suggestions from outside the current file, which may mean it's doing what you want.
I was looking for the exact same thing, and I can confirm that SublimeCodeIntel works well. However, Sublime Text seems slightly less responsive when using SublimeCodeIntel, which is a drawback.
Another cool thing coming from a Visual Studio environment is the support for "Go to definition" in this plugin.
Another option is TernJS:
http://emmet.io/blog/sublime-tern/
I haven't yet used it, but it looks promising. Editor slowdown seems to be an issue with any code completion plugin; sounds like authors are still working out kinks in scraping and caching related files for code completion. The TernJS page addresses this issue and offers some config options for managing how it handles related files.

textmate bundles not recognizing differences

So i'm trying to make a set of grammars recognizing different file extensions properly.
All my files (js/css/html) end with template. This is similiar to how ruby does it with js.erb, css.erb, etc. So I modified the file type attribute to js.template css.template and template itself for html. But it doesn't seem to work. They just default to template even though there are more specific ones.
But for some reason Textmate doesn't want to recognize my different file extensions. Any idea why this would be happening or why the Ruby grammars seem to work but mine don't?
The detailed answer depends on the scope and therefore syntax highlighting you want. The general approach is as follows:
Open the Bundles Editor (Control-Meta-Command-B)
Search for the language definition of JavaScript, i.e. in the JavaScript bundle is a grammar definition called "JavaScript"
Open it and look for the line which starts with "filetypes", which should look like fileTypes = ( 'js', 'htc', 'jsx' );
Add your own file ending, i.e. "js.template"
Close the Bundle Editor or activate another snippet / command / grammar or click the Test button to reload the grammar (note that manual language definitions are preferred over file ending, so create a new file with that extension and load it with TextMate to make sure it works)
Repeat for any grammar definition you want to work with another file ending, i.e. HTML and CSS
This way you will have the default syntax highlighting working in your files with .template endings. However, the Ruby on Rails bundle extends those grammars a little, so maybe you want to extend the supported filetypes of these grammars as well.

Resources