Shortcut to swap characters in PhpStorm - phpstorm

I'd like to be able to use CTRL+T as a shortcut for swapping/transpose 2 letters just like in Sublime Text, Netbeans and even Bash. Is it possible?
Couldn't find anything relevant on Google.

It is very simple. Just create macros and then assign hotkey for this action. You can watch full how-to video https://www.youtube.com/watch?v=5E1ETYOzelU
UPD Also i find this plugin http://plugins.jetbrains.com/plugin/2162?pr=phpStorm
Swap Characters - set a shortcut in Settings

Related

How to align code, in PhpStorm / Intellij, using tabs (and not spaces)

I'm trying to setup PhpStorm, so I can simply press: "Reformat Code" ( Option CMD L), before each save - and then it'll make everything look right.
But I have this case, where I don't know how to make PhpStorm make the code right.
This is the code:
As you can see, then indentation is with tabs, but the aligning of the characters are with spaces.
I want it to look like this:
It would be cool to get the solution. But it would be even cooler to be able to figure out, how I could have found the solution myself.
Further info / idea: There is a Php Codesniffer from Squizlabs implemented. So I can fix is automatically by running a sniff fix-command. It would be pretty cool, to be able to automatically setup PhpStorm's Code style settings, to correspond with Squizlabs styles, without having to gradually tune the settings one thing at the time. But I haven't found that functionality.
Solution attempt 1: Read through all Settings >> Editor >> Code style >> PHP
I couldn't find anything that resembled this.
Solution attempt 2: Disable .editorconfig
I've read quite a bit about .editorconfig and it doesn't have these nitty-gritty functions here (as aligning equal signs).
But to make sure, I tried disabling it. Didn't make a difference.
Solution attempt 3: Search setting for 'align' and 'formatting'
But I didn't find anything useful. :-/
Solution attempt 4: Update PhpStorm
I was on PhpStorm version 2022.2.1.
I tried updating to PhpStorm version 2022.2.4.
This is still in progress.
Please show what you have at Settings (Preferences on macOS) | Editor | Code Style | PHP, specifically Tabs and Indents tab.
Checking Use tab character option with unchecked Smart tabs should do just that.
https://www.jetbrains.com/help/phpstorm/2022.3/settings-code-style-php.html#php-specific-formatting-settings-for-tabs-and-indents
(Pro tip: you can copy-paste your code sample in the preview area and start changing the options; the IDE will apply the changes live on the provided code sample instead of the default one.)

HTML emmet tag configuration

I am a beginner on the HTML format document.I just tried to use emmet like that in VSCode
".cal-row4>button.calc-button4 "
The result was like the image below.
However, I want to make the tags like the image below by using Emmet shortcuts.
It's pain in the ass to struggle with the tags and configuration for the buttons.
How can I change the settings in order to make my emmet configuration like that, when I entered a shortcut similar to my example.
I could not find how to fix it, if you know some plugins or setting to fix that, I am open to taking advice.
You should use a prettier - code formatter. It is the easiest way to format your code.
You will have to install it first and you can install it directly from the vs code.
Go to the Extensions tab and search for it and install it.
You can also configure it according to your need.
command for windows => Shift + CTRL + F
link https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode

VS Code keybind for quick formatting a selection on HTML

I recently switched from Brackets to VS Code and I can't find a specific keyboard shortcut that I used regularly on Brackets, and I can't custom create it because I don't know how to correctly describe the command to the program.
On Brackets I used to use the keyboard shortcut Shift+Ctrl+A and with a few lines selected it would let me format the complete selection. It opened a one-line command screen on the bottom and it would let me add up different tags for HTML for example. Let's say I had a few paragraphs that I needed to format into an ol, once selected I would simply type: ol>li* in the command screen and it would automatically format the whole selection.
English is not my first language so sorry if the explanation is kind of weird! I've been searching for a solution to this for some days and I'm getting nowhere.
Things I already tried/worth noting:
Installed the Brackets keymap extension (I went through all of the keybinds and couldn't replicate this)
Checked VSCode keybinds list.
I, unfortunately, uninstalled Brackets and can't take a screenshot of the thingy. I am regretting this so much already. I should have been more aware of the keyboard shortcuts and whatever extensions I had installed.
Maybe it has to do with an extension that I'm forgetting to install?

Is it possible to add information to the head tag of multiple HTML files, without going into each file manually?

Basically, I have a stylesheet I need to add to a LOT of HTML files. It would take so long to add it to each one manually that it wouldn't even be worth it. Is there any script or application I can use to help me with this, or any tricks in HTML I can take advantage of? Thanks.
Most IDE's have a function called 'find and replace'. I work with Netbeans, but I imagine almost every IDE can do this, perhaps even a decent text editor may be sufficient. Usually you can find it in the 'edit' menu somewhere.
You could search for </head> and replace it with <link href=.../></head> or something similar.
Ususally you can tell the replace function which folder it should search in, and even wich file types to check for. Should be easy and done in a couple of seconds.
Do these HTML pages share some resource? You can consider 2 options:
1 - Make a script to insert those stylesheets to the HTML files head automatically or;
2 - Insert the stylesheet once in an resource(Require the file for an script i.e) already shared by those files;
use php include(); and paste it on top of files. wont take you more than 5sec per page.
You can do this fairly easily using a good text editor like Sublime Text 2 or TextMate (Mac OS X). Here are instructions for how to do this in Sublime Text 2:
Open Sublime Text 2
Create A New Window (File » New Window)
Make sure the Side Bar is visible (View » Side Bar…)
Drag and drop the HTML files (you want to add the stylesheet to) onto the Side Bar
Find » Find in Files… (Note the mini find-replace dialog at the bottom of the window)
Search: </head>
Where: (Clear this field so it will look in: Open files and folders)
Replace: <link href=.../></head> (Hat tip to: #PeterVR)
Click Replace
Confirm dialog and be sure to save all your files!
Good luck!

Sublime text 2: class navigator or browser side bar

Is there a plug-in (or setting) in sublime2 that shows a side pane with a navigator (or tree view) for the class in an active file? Someting similar to the class navigator in netbeans?
Use the CTRL+R command to browser the symbols on the current file, and CTRL+SHIFT+R (only available in Sublime Text 3) to browse symbols in all file opened in tabs.
I think CTags is a nice candidate too.
It uses the ctags executable to index all your project files and allow you to browse through symbols in your whole project. Quite impressive.
Using Sublime2, the CMD+R is the 'Goto Symbol' option on the 'Goto' menu. You may have remapped it. Whilst it isn't a permanent onscreen navigator (like NetBeans for example), it is pretty quick to use.
CMD+R and SHIFT+CMD+R are available on Sublime Text 3 for Mac. CMD+R will browse symbols on the current open file as stated before here, while SHIFT+CMD+R will browse all symbols in all open files if you don't have a ST3 project open, or browse all symbols in all project files if a project is open.
You have to vote here in order to see this functionality implemented in SublimeText :
http://sublimetext.userecho.com/topics/1265-add-a-class-browser/
In the meantime, CTRL+R is the only alternative...