Is there a shortcut in IntelliJ that allows you to create a boilerplate HTML file like in VSCode? - intellij-idea

In VSCode you can basically type '!' then hit enter and you get a boilerplate HTML document. I love that feature and I wonder if IntelliJ has the same. If it doesn't how could I make it myself? I've tried macros, but it's not instantaneous it types every character one after the other. I've searched for their html shortcuts in keymap and didn't find anything of that sort. Their doc is not helpful either. Do you guys have any idea or hack on how to do that?

You can define a custom Html file template(https://www.jetbrains.com/help/idea/settings-file-and-code-templates.html) from File | Settings/Preferences | Editor | File and Code Templates.

Related

WebStorm not showing .vue syntax highlighting on on file but is on another

Does anyone know what is causing this problem? I can't seem to figure it out.
When I create a new .vue file, I can't get any autocomplete/syntax highlight at all.
But the one I created at the start of the project seems to work fine.
Looks as if the file GameDetails.vue is treated as plain text file. Does the issue persist if you rename the file? Please check the registered patterns in Settings | Editor | File types, Text and Auto-detect file type by content file types - can you see GameDetails.vue or any pattern with .vue suffix there? Removing it from the list should solve the problem.

WebStorm Smarty highlighting

Is there an way to make WebStorm highlight Smarty templates? Either through plugin or some other means?
Also note, I need this for WebStorm, not PhpStorm or some other version; I don't need autocomplete or anything else -- just highlights.
Files have .tpl extension and so far I'm treating them as HTML files and I am looking for options to increase code readability with coloring.
I have tried following based on the comments:
However, resulting .tpl file still looks like

How to get HTML-formatted code from clipboard? [duplicate]

Is there a simple way to copy syntax-coloured code block as rtf in intellij IDEA?
UPDATE: there is now a new plug-in for this: 'Copy' on steroids that is maintained by JetBrains.
There is no way to copy colored code block from IDEA directly.
A workaround is to use File | Export to HTML, then open HTML in a browser, then copy from the browser window and paste into Wordpad or MS Word.
Another and more faster way is to install the Copy as HTML plug-in in Settings | Plugins:
Copies a snippet of code as html
Adds menu items "Copy as HTML" to main menu and editor popup. Will copy the current selection or the complete editor buffer. Currently only works if focus is in editor (for example won't work in project tree).
Preserves more formatting than the built-in HTML export.
HTML is only a snippet (without html and body tags) meant to be inserted into a complete HTML document.
Currently HTML format is fixed and uses CSS a lot.
Options: unindent, add border, padding, line numbers, tabs to spaces conversion, include editor's warning and error highlighting (see IDE Settings -> Copy as HTML).
Reuses the editor "Show Line Numbers" setting (see Idea's "View" menu).
IntelliJ IDEA 15
By default, you can copy rich text from IntelliJ to Microsoft Word (for example).
This feature can be found in File > Settings... > Editor > General > Rich-text copy > Copy as rich text by default
You can also change the color scheme only for the copy-paste operation (your current scheme won't be affected).
Go to https://gist.github.com/
Copy code from IntelliJ to the new private gist;
Save it, copy colorful code from the browser to wherever you want;
Delete the gist.
Use external tool notepad++
1) copy code snippet to notepad++
2) apply syntax highlighting
3) copy with nppexport plugin to clipboard as rtf
If you're on a mac and like TextMate, here's a great way to copy styled code from TextMate: https://github.com/bblimke/copy-with-style-tmbundle
It's not as convenient as doing it directly from IntelliJ, but it's a bit more convenient than using gist or pastebin. Also, unlike the Copy as HTML Plugin for IntelliJ, this solution actually works at the time of this writing.

Intellij Idea how can I specify colors for a specific file type?

I am using a color theme that I am perfectly happy with, but I am dealing with a lot of ".impex" files that are unique to the Hybris platform. The IDE essentially sees them as text files. How can I add syntax coloring to these ".impex" files so the text is not just all one color?
Maybe this plugin can help you.
Syntax highlight for impex files
Besides, you can register a file pattern to a recognised file type: Preferences -> IDE Settings -> File Types.

Copy syntax-coloured code block as rtf in intelliji IDEA?

Is there a simple way to copy syntax-coloured code block as rtf in intellij IDEA?
UPDATE: there is now a new plug-in for this: 'Copy' on steroids that is maintained by JetBrains.
There is no way to copy colored code block from IDEA directly.
A workaround is to use File | Export to HTML, then open HTML in a browser, then copy from the browser window and paste into Wordpad or MS Word.
Another and more faster way is to install the Copy as HTML plug-in in Settings | Plugins:
Copies a snippet of code as html
Adds menu items "Copy as HTML" to main menu and editor popup. Will copy the current selection or the complete editor buffer. Currently only works if focus is in editor (for example won't work in project tree).
Preserves more formatting than the built-in HTML export.
HTML is only a snippet (without html and body tags) meant to be inserted into a complete HTML document.
Currently HTML format is fixed and uses CSS a lot.
Options: unindent, add border, padding, line numbers, tabs to spaces conversion, include editor's warning and error highlighting (see IDE Settings -> Copy as HTML).
Reuses the editor "Show Line Numbers" setting (see Idea's "View" menu).
IntelliJ IDEA 15
By default, you can copy rich text from IntelliJ to Microsoft Word (for example).
This feature can be found in File > Settings... > Editor > General > Rich-text copy > Copy as rich text by default
You can also change the color scheme only for the copy-paste operation (your current scheme won't be affected).
Go to https://gist.github.com/
Copy code from IntelliJ to the new private gist;
Save it, copy colorful code from the browser to wherever you want;
Delete the gist.
Use external tool notepad++
1) copy code snippet to notepad++
2) apply syntax highlighting
3) copy with nppexport plugin to clipboard as rtf
If you're on a mac and like TextMate, here's a great way to copy styled code from TextMate: https://github.com/bblimke/copy-with-style-tmbundle
It's not as convenient as doing it directly from IntelliJ, but it's a bit more convenient than using gist or pastebin. Also, unlike the Copy as HTML Plugin for IntelliJ, this solution actually works at the time of this writing.