Recently I switched from Sublime Text to PhpStorm what I will discuss in another post.

It's just a little tip for auto indent lines without select them all. At the moment there are reformat or auto indent selected text / line. Reformat is not always the right choice. For example when you have this markup:


sass                  = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
rename = require('gulp-rename'),
sourcemaps = require('gulp-sourcemaps'),
handleErrors = require('../util/handleErrors');

You want to keep the equal signs in one row. Reformat would cleared this away. Auto indent doesn't touch them.

So what I have done is to create a macro which I named AutoIndent. In the macro I just pressed CTRL+A, CTRL+ALT+I and ESC for deselect everything. In the keymap you can search for macro and find your AutoIndent. Assign it for example with CTRL+ALT+F and you are good to go.




The fast way is like in sublime the global program search:
CTRL+SHIFT+A >>> macro (start recording) >>> CTRL+A + CTRL+ALT+I + ESC >>> CTRL+SHIFT+A >>> macro (stop recording + name it) >>> CTRL+SHIFT+A >>> keymap cu (change current keymap) >>> search for macro >>> see your macro and give it a hotkey.

Nächster Beitrag Vorheriger Beitrag