Is there any shortcut to select entire code block in Atom similar to Option + Up Arrow in PhpStorm - phpstorm

Is there any shortcut to select entire code block in Atom similar to Option + Up Arrow in PhpStorm?
It helps you select the code block and if you press Option + Up Arrow again, it expands the selection to its parent block.
Is there any shortcut or plugin to have that feature? It makes it faster to work with heavy code.

Yes! You want the expand-region plugin, it's great! Add these to your keymap.cson to expand the region with option-up (alt-up on windows) :
'atom-text-editor':
'alt-up': 'expand-region:expand'
'alt-down': 'expand-region:shrink'

Ctrl+Alt+M (Cmd+Ctrl+M on Mac) selects entire code inside the current brackets. It doesn't expand to the parent block though.
If you need that feature, you might want to look for some package. There is select-scope package that claims to add that functionality. I haven't tested if it works. It also doesn't seem to show up on the package list in every atom version.
If you decide to try that package out, you may need to override it's key-binding as it uses Ctrl+S.

This is now built into Atom.
https://blog.atom.io/2018/10/23/atom-1-32.html
Select Larger/Smaller Syntax Node

Related

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 disable the annoying NetBeans auto-suggest while typing

When I am typing in NetBeans 8.2, whether it is a HTML paragraph or something like an input field, this annoying auto-suggest feature keeps on popping up. It is really annoying when I try to press enter to start a new line as it will insert a load of code when I press enter, since 'Button' is automatically highlighted.
I've included a screenshot of the problem below...
How can I disable this autocorrect feature. I don't want to disable autoorrect for PHP or when actually setting up a HTML tag (so I want to use it in a situation like this... <input type="autocorrect displays here" />, but not when typing anything else).
Sorry if I haven't explained myself very well, I can't really think of a good way to describe my problem. Please, leave a commend if you need to know more.
Thanks :)
PS: I can't find any other answers on the internet because I don't know what this is called, since I want this specific auto-suggest to disappear, so please direct me to another answer and I'll delete this question if the answer is appropriate.
PPS: I think the palette may have something to do with it but I can't be sure.
I finally found the solution for this annoying problem:
Simply go to Tools/Palette/Code Clips and remove everything from Palette (all folders and items).
Now the problem is gone!
If you go into NetBeans > Tools > Options > Editor > Code Completion, you can check or uncheck "Auto Popup Completion Window" for whatever Languages you want.
If you move over to the Code Templates tab, you can also customize the specific autocomplete rules for each Language. That way, you can leave certain ones in that you find helpful and remove ones that you find bothersome.
Today I finally had enought of these * autocompletes in my * code.
Found my way thru Google to this question and found no comfort from the answers.
But this is how I did it:
Open Code Clips -manager (Tools > Palette > Code Clips)
Select all HTML-related and click "Remove"
Profit
Apache Netbeans 12.1.
Palette > Code Clips > Remove -- does not work.
NetBeans > Tools > Options > Editor > Code Completion > Disable "Auto popup completion window" -- does work.
In NetBeans 12, disabling the Auto Popup Completion Window option for HTML does not solve the problem when editing PHP files, the popup shows up whenever Tab is pressed in HTML portions of code.
The solution is to keep the Auto Popup Completion Window active for All Languages, then switch to the Code Templates tab, select Language: HTML, remove all templates from the list, and voilá. No more HTML popup suggestions, anywhere, ever. Only the good old PHP suggestions will remain active.

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

PhpStorm keyboard shortcut for code inspection recommended resolution?

If you run a code inspection, you might get something like this in the results panel:
Problem synopsis:
Traditional syntax array literal detected (at line 193)
Problem resolution:
Convert Array Syntax To Short
i.e. it's telling you to change array() to []
The 'resolution' is clickable and it'll fix it for you. But is a keyboard shortcut, or a way of shading identical problems (often you get a bunch of them) and having them fixed for you all at once?
You can use f2/Shift+f2 to jump to next/previous error, then hit Alt+Enter, Enter to apply suggested fixes.
Note that there is a Code | Code Cleanup... command that runs inspections against your code and applies quickfixes. But it only includes a small subset of available inspections that are considered 'safe', so that applying hotfixes automatically doesn't break anything
Use standard shortcut: same as for invoking intentions menu (Quick Fix menu) manually in Editor: Alt + Enter (for Windows/Linux, not sure what that would be on Mac)
Also you can take a look at this tool: https://github.com/fabpot/PHP-CS-Fixer

Is there a Surround With for aptana studio plugin?

Is there some way to get "surround with" in the Aptana perspective in Eclipse like you have in the Java perspective. I would love to be able to surround text with html tags like eg: <div></div> with a keyboard shortcut. Is there some way of doing that with the snippets rubles?
Thanks,
You can do this with AutoHotKey, which has the added benefit of being available across all apps. I have a script which launches a 'surround' menu when I select some text and press CTRL+SHIFT+C
To use it, install AutoHotKey, and create a new .txt file with the following code, and replace the extension with .ahk
http://pastebin.com/48ipiXsG
At the top of the file you'll find a number of groups of items, in the following format
<h1>~<h1>##</h1>
the ~ character divides the name of the function and the function content. The bit before ~ is what appears on your menu, and after the ~ is the code. ## represents where your selected text will go. So if you select the text 'AutoHotKey' and press CTRL+SHIFT+C, and then select <h1> from the menu, it'll replace the with <h1>AutoHotKey</h1>
There are several menus in the script, set up to launch based on what app you press CTRL+SHIFT+C in. For example, I get different shortcuts if I'm in Visual Studio than if I'm in SQL Server. You can modify these easily enough, but the generic menu should work fine for you. Feel free to chop and change but you have to leave GENERIC at the top of the script.
PS: I use this script everyday, and there is one small bug. The script saves whatever you have in the clipboard in a variable, and then writes it back to the clipboard when it's done. Sometimes, instead of surrounding text it replaces it with whatever you had in the clipboard. This is easily undone with CTRL-Z and usually works the second time you try it. I've never been able to figure out what causes this, maybe some autohotkey heads can help out?
PPS : This script is based on some other scripts from the AHK forums, including this one
http://www.autohotkey.com/docs/scripts/FavoriteFolders.htm
So you may find comments that don't make sense. I've seen a few references to the middle click, as the script above uses the middle mouse button instead of CTRL+SHIFT+C.