Abbreviations in PhpStorm - intellij-idea

IntelliJ comes with 2 abbreviations that I have used a lot in the past, but cannot find in PhpStorm:
iter Iterate (for each..in)
itar Iterate elements of array (traditional loop)
So whenever I typed iter and pressed tab, it generated an enhanced for-loop. How can I achieve this in PhpStorm?

PHPStorm has live template so you can use it to generate several types of code snippets.
Live templates can be used to insert frequently-used constructs into your source code, for example, loops, conditions, various declarations, print statements, tags, and so on. To expand a code snippet, type the corresponding template abbreviation and press Tab. Keep pressing Tab to jump from one variable in the template to the next. Press Shift+Tab to move to a previous variable
I think this link is useful and also suggest that you read this link
for creating a new snippet you can go settings > Editor > Live Template

Related

JetBrains IDEs live templates - place multiple carets

In IntelliJ live templates one can use $END$ to specify where the cursor should be placed once the template is expanded.
Is there a way to place multiple carets? Specifying multiple $END$ locations doesn't work. I sometimes need to type the same text into several places for what can be an auto-generated piece and that would be a nice expansion of functionality.
Currently as a solution I use "surround templates" where I can first type some text and then use $SELECTION variable.

How to move cursor to Vue methods, computeds, data quickly in VS Code?

I already tried using the symbol explorer in VSCode (CTRL+P then write #). It allows me to jump to data (because it's a method) but it won't jump to normal properties like "computed:" or "methods:"?
This would be useful when eg. I look at my component and think "Aha! I need to add a computed, so let's jump to computeds". I could just CTRL+F but this sometimes doesn't work if another variable or comment has 'computed' in its name
Currently, you can
use Ctrl+R to open Go To Symbol in Editor,
then enter some words like data, computed or methods and etc.,
then press Enter
The cursor would be moved to the selected symbol. Tested in Win10/v1.48.2
The easiest way how to do that is probably using Bookmarks extension.
I am using them and also I haven't find a better way how to solve same problem as you have.

Intellij - Numbers in `Intention Actions` window

I was wondering. Is it possible to add number shortcut to corresponding actions inside Intention Actions window? Like with String Manipulations plugin:
For example in this case:
I would love to press Alt+Enter and then 3 to Create object buzz - I know for a lot of cases I can use shortcut for example ctrl+alt+v for a variable extraction but not for all.
I was looking for this kind of plugin but without a result

Where is the live templates for Java in Intellij-IDEA?

I could not find the live templates for Java! Who can tell me how to set? Thanks.
They're inside all the nodes that are not specific to another language than Java: iterations, output, plain, surround, etc.
As JB Nizet wrote there is not a special node for Java (but you can create one). If you want your own Live Template for Java created do the following.
Open Settings window (File -> Settings)
Click on Editor -> Live Templates
Choose Template Group in which you want to add your Live Template
(you can create your own Template Group if you wish)
Click on + icon and choose Live Template
Specify the Abbreviation, Description and Template text.
Do not forget to define the context (in your case Java)
Example
Here is an example of how to create your own TODO text
Open the Setting window with Live Templates editor (as specified above).
Click on + icon and select Template Group.
Name this group Java.
Click on + icon again and select Live Template.
Specify your Live Template and DEFINE CONTEXT.
In my case writing mtodo and pressing enter will result in:
// TODO myName
You can even use variables. Write in your Template text e.g. $DATE$ and $TIME$
// TODO myName $DATE$ $TIME$
Click on Edit variables button and assign to each variable (defined by dollar sign) and expression (predefined function).
Now mtodo will result in
// TODO myName 13.10.2015 15:39
Predefined functions could be found here. The example was created using IntelliJ IDEA 15 EAP.
For those of you who have taken Postfix completion for Live templates, it is worth mentioning they are different. from not-choosing pretty good answers from #JB Niznet and #vitfo, I guess that's the case for OP writer. The document, here, says:
Postfix code completion is similar to live templates, it transforms the current expression without selecting it. For example, you can type .if after an expression to invoke the corresponding postfix completion and wrap the expression with an if statement.
You can check out a list of postfix completions:
Open the Preferences window
Click on Editor -> General -> Postfix completion
By default, there is no JAVA group in this setting page.
However, these default settings distribute on each feature group. For example, iterations:
IntelliJ IDEA 2019.2.4 (Ultimate Edition)

What is the name of the keyboard shortcut &/or method in an IDE which allows me to jump past automatically generated </endtags>?

This question relates to a prior question which was answered for all practical purposes with a fellow telling me I simply needed to press the "End" key to skip the cursor to the end of the line. But a second respondee told me of other IDE's abilities to this (his words): "In some IDE, pressing the tab key will move your cursor to the next placeholders in the currently auto replaced element, and if there is no more placeholders, brings you past the end of the auto replaced text."
What is this ability called?
I'll show an example very quickly, if you or I were writing some code in Aptana or RubyMine (my two favorite IDE's)...
<table summary="Subject detail view">
<tr>
<th>Name*</th>**
</tr>
</table>
We'd eventually run into the location(*), where the single asterisk is. We would reach this point and be forced to either use our mouse to click past the auto-generated </endtag>, or our keyboard arrows, or, most recently, the "End" key which would skip our cursor to the end of the line.
But can't I just do this with tab like my friend told me? In order to be able to do this I need to know what this keyboard shortcut is called. I need a searchable keyword. Any additional feedback about keyboard/IDE shortcuts etc would also be appreciated.
RubyMine (and IntelliJ IDEA platform it's based on) doesn't have this feature yet. There is an open feature request in the YouTrack issue tracker:
IDEA-74666 Add Eclipse Style Paren/Bracket/Quote Completiton
I have figured out the king of all answers for this question, which is my own.
Create your own macro. It is stupid how easy this is to do (with Komodo Edit, at least).
To do this in Komodo Edit, for example, first set yourself up so your cursor is a position where you need the custom command, whatever that might be.
So, let's say your at the end of an xml tag with your cursor where this ("|") symbol is
<xmltag>blahblah|</xmltag>
Now the < /endtag> has been generated automatically, just to make sure you know that.
Now, go to Tools, Macros, Start Recording. Click it. relax, you can do this as many times as you like...it only records keystrokes, by the way, so do this only with your keyboard. To skip to the end of the tag without the arrow keys, use the 'End' key. And I don't mean to insult your intelligence, but in case you didn't know this, you need to use the End key and not the arrows because future tags could be any length.
OK so do this:
<xmltag>blahblah</xmltag>
|
So you're there. Good, now go to Tools, Macros, and stop the recording.
Next, click on tools, macros, and save the macro.
Then, go to your macro library (same tools submenu) and you should see in the toolbox the file which you named which contains your macro.
Right click it, Properties, Key Bindings tab, then set your custom command in the 'new' form. Apply. OK. You're done.
Test it out, and pat yourself on the back, you just learned something really, really, really useful.
Btw, here's another one I've created.
<!-- | -->
That is a macro command as well. Obviously, you could create an entire form with a simple macro command.