I installed the HAML textmate bundle, that display syntax highlight for .haml templates, but I also have Coffee HAML templates that are named like
layout.jst.hamlc
and I would like to add syntax highlight as well.
The Ruby Haml syntax is good enough, so I usually just change the language to Ruby Haml,
but then when I close and open the file again, Sublime Text 2 forgets it and I have to assign it again and again.
Is there a way to automatically assign the ruby Haml syntax highlight for .hamlc files?
In the language selection menu (click on "Plain Text" in the bottom right), at the very top is "Open all with current extension as", which expands to another list of languages. Pick User > Rails > Ruby Haml from there and it will remember that for hamlc files.
I just added a hamlc syntax definition to package control for Sublime.
Related
for example .xlp is my file type and name is code.xlp I want to highlight some code.
or some colors ?
Somethings like this
Inno Setup For VS code
In case you don't want to write custom extension, try manual configuration of 'file association' for '.xlp' files.
This will tell VS Code to highlight content of '.xlp' files as language of your choice.
For example, I set it to C# and it looks like this:
Steps for this configuration:
Inside of '.xlp' file press ctrl + P to open navigation field,
Search for >Change Language Mode,
Choose Configure File Association for '.xlp',
From dropdown list choose language you like.
As mentioned inside a comment you must write an extension for VS-Code to have your custom syntax highlighting for those files.
There is a good documentation available at:
https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide
At the mentioned web page you will find also more information about how to write your own extension and how to deploy it etc.
Many editors and IDEs support converting spaces into tabs by using Tab/Shift+Tab on a line or a selected text fragment, but I've not found such a feature in Eclipse. Is there a plugin or something to add such functionality? I've tried to find one myself, but it doesn't seem to have any by keywords like "tab" or "indent". I'm working with Perl, BTW.
Check if the context menu has an entry like Source->Correct Indentation. That is available for Java, but the availability depends on the language you edit.
Otherwise you can install the AnyEdit Tools plugin which provides a command to convert the selection from tabs to spaces and vice versa.
If you change settings to tabs only or spaces only, Tab, Shift + Tab works as expected. (At least for me).
EDIT:
What I really need is an editor that'll allow me to write html directly and allow inserting macros.
I'm using WMD editor in umbraco 7 and need to add a partial view macro to the page.
The editor does not have an insert macro button and if I pasted the following code in the editor, it is not shown in the page. I think the markdown processor removes it from the page ; <umbraco:Macro Alias="YourMacroAlias" \>
How can I add the macro to the page ?
Out of the box, the WMD editor does not support embedding Macros in the same way as the Richtext Editor does. You could raise a feature request at http://issues.umbraco.org and see if they'll add it, or you could take the source of the WMD from the Umbraco source at https://github.com/umbraco/Umbraco-CMS and create your own version of the markdown editor based on it.
The way the Richtext editor does it is that it stores the macro details as a specially formatted bit of markup, and there's some code in the front end that looks for that markup and replaces it with the output of the Macro.
Go to the developer section. Open the Macros.
In your macro there is a checkbox "Use in rich text editor and the grid" and "Render in rich text editor and the grid" check this.
For Using in Rich Text the option must be checked in the Data Type.
In the Developer section there is below Data Types, the Richtext editor data type check umbmacro.
In the Rich Text editor there is a "Insert Macro" Button, the 2 gears icon.
But for a markdown datatype there is no button, no support, An option is invent a tag a replace you tag in the template with somethings else. To come a bit near a macro functionality.
Instead of using Markdown editor for less options, you can disable excess commands for the tinyMce too. Extra tags added by tinyMce can also be disabled, see at end
Firstly there is file in config folder named tinyMceConfig.config. It handles the options in all datatypes using tinyMce. Below is entry for macro
<command>
<umbracoAlias>umbracomacro</umbracoAlias>
<icon>images/editor/insMacro.gif</icon>
<tinyMceCommand value="" userInterface="true" frontendCommand="umbmacro">umbracomacro</tinyMceCommand>
<priority>62</priority>
</command>
Go to
Developer -> DataTypes -> Rich Text Editor
There will be toolbar checkbox list. Select umbmacro from the list and save the data type. You will see the macro on the WYSIWYG editor. Uncheck all unwanted options. Also you can create new datatype say "RTE Lite" using property editor "Rich Text Editor" and use this "RTE Lite" where less options are needed.
Edit: Okay, if you do not like extra p tag added by tinyMce, go to "tiny_mce_src.js" file from your umbraco solution, search for forced_root_block : 'p' and change it to forced_root_block : ''
How can I setup autocompletion of early typed word in Sublime3?
For example in Notepad when I typing something, and if first symbols match I have popup window.
Can I do such window in sublime 3?
Thanks
Open Preferences -> Settings - User and add the following line:
"auto_complete_selector": "source, text",
Save the file, and you should be all set, whether you're coding (source), typing in plain text, or using HTML or any other markup language like XML, Markdown, reStructuredText, LaTeX, etc. (text).
Is it possible to apply HTML code on highlighted text like in Zend Studio 5?
For example:
Open preferences -> Editor -> Macros (in version 6.9.1)
Open Tools > Options > Editor > Macros (in version 8.0.1)
Add a new macro called something like "html-bold", then hightlight it. Paste this in the Macro Code section:
cut-to-clipboard "<b>" paste-from-clipboard "</b>"
Set a shortcut if you want. I tried it with CTRL+B and it worked fine.
Note that it will replace the current contents of your clipboard with the text you selected.
To learn more about Netbeans macros, see What useful macros have you created in Netbeans?
On the MacOSX version (8.0.2), the Macros editor is still in the 6.9.1 location (Preferences->Editor->Macros).
The above works well, although I had to use Ctrl-Alt- as my meta key sequence, since MacOSX assigns some of the other more convenient ones.