Hotkey to jump past closing brackets in JetBrains PhpStorm - html

Right now I'm just using PhpStorm to work with some HTML, and it's great in that it auto indents and automatically closes out HTML tags.
The only problem is this feature doesn't really save me any time because I then have to use my mouse or arrow keys to navigate past the closing tag when I reach it. For example I type <p> and it closes it out <p></p> with my cursor in between, but when I'm done I either have to manually navigate past the closing bracket or use Shift+Enter to jump down to the next line (which isn't always what I want to do).
Is there a command that will just jump me to the end of the next closing bracket, or is there a way of setting this up? I've googled it but haven't been able to find anything.

I've googled it but haven't been able to find anything.
Well... Help | Default Keymap Reference has the most needed shortcuts and actions listed and the one you need is there.
In any case:
Ctrl + ] -- Navigate to code block end -- will jump to the closest closing tag (in HTML) or brace/closing keyword (CSS, PHP).
Ctrl + [ will do the opposite -- jump to the opening tag.
There are few other actions that can help here but may not have any shortcuts assigned by default -- check them in Settings (Preferences on Mac) | Appearance & Behaviour | Keymap (it has search by action name and even by already assigned shortcuts).
Another alternative (or better say -- advanced navigation) would be using AceJump pluign (you have to see it in action -- you either like or hate it).. or even Vim mode navigation (via IdeaVim plugin).

The simplest way to go about this is to press Command + -> (command+right arrow key) when your cursor is inside the brackets, and this will bring you behind the last bracket.
At least, I believe this is what you're asking.

hi, use mac os for: cmd + option + ]

Related

my HTML Shortcuts in VS Code are not working

I started studying HTML on YouTube not long ago and have been using visual studio code. Whenever specific shortcuts are used, mine does not work. An example would be typing the exclamation mark and then the tab button("!" + tab) to automatically give you the default HTML skeletal template.
Also, tag suggestions do not work. Whenever I start to type a tag like , I don't get any suggestions whatsoever and it leads to a lot of mistakes and confusion for me. Can someone help me, please?
CTRL + Shift + P
Change language mode
Click on "Configure file association for .html"
If you scroll down through the list, you will see a label "Current association" next to the file type that your file is currently associated to.
Change it to .HTML if that's what you want .html files to be associated to.
Close the file and open it again.
Try ! - a tooltip should now pop up and then you hit tab.
You can go to VS code and tap on setting will show a pop-up, choose Keyboard Shortcut will showcase you all the keyboard shortcut.
You only need to change languague on status bar (below) from Django html to html.
Now retype the shortcut i.e. "!+Enter"
Change Setting Emmet
Go to Setting , CTRL + , for shortcut
Type Emmet Tab on search bar
Enable trigger expansion on tab
Try type ! + Tab
Suggest
Type ! on HTML File
Press CTRL + SPACE, to activate trigger suggest
And Enter
HTML:5
Type html:5
Enter or Tab

How to stop moving one line down while commenting in PhpStorm?

Whenever I comment (Ctrl + /) in PhpStorm, the IDE automatically moves the pointer one line down. How do I disable that?
You cannot. I mean: there is no option for that.
But you can try a workaround using Macro: https://stackoverflow.com/a/27545802/783119 ... or make a selection (1 symbol anywhere in the line will be enough) before using the shortcut.
Other than that: https://youtrack.jetbrains.com/issue/IDEA-119435 -- watch this ticket (star/vote/comment) to get notified on any progress.
P.S. I personally like current behaviour: it allows me to quickly disable & enable subsequent lines (in any supported language/file format that has line comments) without making any selection.

How to not close the editor window when closing the last tab in VS Code

If there's only one tab on an editor in VS Code, the default behavior is to close the editor right then and there.
Personally, and I think many others agree with me, this behavior is very annoying since the programmer would rather preserve the layout he or she created for the project's workspace.
How do I change this behavior?
I've found discussions on this topic, but all of the solutions do not seem to be the ideal one of simply leaving the editor open but empty. Most of them simply delete the related shortcuts, which seems to me like cutting your arm off just because you broke it.
Anyway, here are some useful links:
Superuser StackExchange: How to prevent VScode from closing editor when pressing ctrl+w with no tabs open?
Issue #54492: Remove CtrlCmd+W keybinding to close window when no editors are opened
The behavior of the shortcut ctrl+w is as-designed closing the application
Actually, VSCode 1.57 (May 2021) will change that:
Removed Cmd+W / Ctrl+W as keybinding to close window when no editor is opened
We have gotten feedback that users are frustrated when the window suddenly closes after having closed the last editor via rapid Cmd+W / Ctrl+W usages.
A quick poll in the team also revealed that many had the keybinding for closing a window unassigned, so we went ahead and removed Cmd+W / Ctrl+W as keybinding to close window when no editor is opened.
You can easily bring the keybinding back by configuring it as follows:
{
"key": "cmd+w", // use "ctrl+w" on windows
"command": "workbench.action.closeWindow",
"when": "!editorIsOpen && !multipleEditorGroups"
}
Note: on all platforms there is a dedicated assigned keybinding to close the window:
macOS: Cmd+Shift+W
Linux: Alt+F4
Windows: Alt+F4
If what you are looking for is to preserve empty groups as well as empty editor windows, there is an option in the preferences that gets you almost all of the way:
"workbench.editor.closeEmptyGroups": false
This has the effect that an editor group will stay open even if the last tab within it is closed.
but all of the solutions do not seem to be the ideal one of simply leaving the editor open but empty
Reddit has an answer providing you the ideal solution of leaving the editor open, but empty: close all tabs but leave editors open.
In brief, they suggest to use in rapid succession the "close all editors" and the "three column editor layout".
They suggest to create a macro like:
"macros": {
"closeAllTabs": [
"workbench.action.closeAllEditors",
"workbench.action.editorLayoutThreeColumns"
]
}
then bind it to a key combination. macrosRe is advised.
The behavior of the shortcut ctrl+w is as-designed closing the application, see #49023. It is advisable to remove the shortcut and cut the arm, since it is design to work like that. However, for version 1.43.1 a new comment was posted this year on a thread you linked. You might want to have a look at it as well.

How to make PhpStorm/WebStorm scope highlighting look more expressive?

When I first learned Java, I was using an IDE called "BlueJ." It had this feature called "Scope Highlighting" which made it very easy to read blocks of code. See picture below:
As you can see on the first picture, on BlueJ the whole Background of a scope is highlighted with one color.
In PhpStorm or even in most of IDE's today, I get only a highlighting for a scope, which I set the cursor on, and only in a very minimalist way, as you can see on the left side of the picture below:
Is there a way, or a Plugin for PhpStorm out there, to get it to look more like BlueJ's scope Highlighting???
Thanks
edit:
What I've have found out so far:
There is something alike for HTML, (Setting>Editor>General>Appearance:Enable HTML/XML tag tree highlighting:Set opacity higher than 0) Then you will get this:
Something like this for the other languages (PHP, JS,...) would make me really happy :)
Maybe you will also like the VSCode extension "Blockman". It highlights nested code blocks based on curly/square/round brackets, html/xml tags and Python/Yaml indentation. (I am the author of Blockman).
.
So far I have found two solutions for this.
The plugin Rainbow Brackets, makes it easier to visually find the corresponding bracket.
Also, it provides the option to highlight the current scope by Ctrl + Right Mouse Click or Ctrl + Shift + Plus. The name of the Shortcut is: Plugins | Rainbow Brackets | Highlight Current Scope and the highlighting looks like this:
The built-in shortcuts to jump to the matching bracket or the one at the code block start/end. Though it does not highlight anything, you can quickly find the matching bracket. Check your ide-settings for the shortcut: Editor Actions | Move Caret to Matching Brace / Editor Actions | Move Caret to Code Block End / Editor Actions | Move Caret to Code Block Start

Sublime Text 2 + Emmet - not expanding correctly

I have installed emmet for Sublime Text 2...
And it works - kind a strange way
When I enter d it starts showing possibilities, but as soon as I press: : emmet shows completely different tip:
b (bottom)
So I need to press esc to close fuzzysearch box and press tab to allow Emmet do what it is used to do.
Dow, if I don't press esc before the tab key the resould is: d:bottom:, is I press esc, it desoults in correct: display:block.
Do you have an idea how can i fix that?
This happens because Emmet tries to respect default ST completions and due to lack of API support to properly handle built-in snippets: https://github.com/sergeche/emmet-sublime#tab-key-handler
By default, Emmet will not expand abbreviations by Tab if there’s autocomplete popup visible to allow users to work with default ST completions and snippets. You can override this behavior:
Go to Preferences > Settings — User
Add "disable_tab_abbreviations_on_auto_complete": false option. Make sure this file contains valid JSON.
After that everything should work fine, but you’ll no longer able to complete items from autocomplete popup with Tab key, use Enter key instead.
I had a similar issue but my fix was different to that of the accepted answer.
I had to go to Preferences > Settings — User and remove "emmet" from the ignored packages and everything started working again!