5

I'm a rather happy PhpStorm user, but there are a few things that really annoy me, but I'm not a settings expert and wish there is a solution for them (editing PHP files) :

  • Navigation

Often in the editor, one want to go back to where the cursor was 100 lines above etc... And in PhpStorm Back Alt-Shift-Left and Forward Alt-Shift-Right do this - but they follow an algorithm that is beyond me: it definitely misses "steps" (e.g. from line 500 go to line 300 using keys like arrows or -even worse- page-up/down, then Alt-Shift-Left doesn't bring you back to line 500)

=> Is there a way to refine the conditions that drive the behavior of Back and Forward?

  • Indentation

Is there a way to refine the indentor behavior? For instance

  $a = array('X' => 'Something',
             'Y' => 'Something else',[RETURN]
  ^          ^
 now       there

like in Emacs the cursor would go there right under the first quote after the spaces (and not at now where PS goes)?

=> Is a regexp (or something else) able to refine the behavior of the indentor, Not only for this very specific case but for the behavior in general?
(Not mentioning another problem when Shift-Inserting where the indent is often unreliable)

  • Quotes (automatic)

I don't want to disable the automatic quoting feature as it is sometimes convenient, but it seems the algorithm doesn't parse correctly the environment where the " or ' is inserted (don't have an example right now but at times it was annoying, like inserting 2 " unexpectedly while only one is required, deleting one will actually delete the 2 (normal because they were inserted automatically... but I needed 1 only!) so have in this case to trick PhpStorm to force a 1 ").

=> Is there a regexp or similar to control the quoting behavior?

  • Select via Shift-Arrow (for instance, to delete...)

Almost forgot: PhpStorm remembers at which column the cursor is when navigating Up and Down. Fine. But when one want to select (using Shift and Up/Down Arrows) from beginning of line it is usually to select lines. Not a line-to-where-cursor-was-earlier. An example will explain better: * is where the cursor is [beginning of line 3], % is where the cursor was [middle of line 2]

 1.   $x = 'string';
 2.   $y = %'string';
 3.*

doing Shift-Up will select (all s)

 1.   $x = 'string';
 2.   $y = *sssssssss
 3.

while in the specific case of a selection, it should select that:

 1.   $x = 'string';
 2.*sssssssssssssssss
 3.

not sure there is a way to configure that though - just in case there is?

Thanks

Déjà vu
  • 28,223
  • 6
  • 72
  • 100
  • 1
    Asking several questions in one lowers your chances to get answers. – CrazyCoder Nov 12 '12 at 09:40
  • 1
    @CrazyCoder This is usually true for programming/algorithms unrelated questions. But regarding editor features, I feel it is better to group all the questions I have. – Déjà vu Nov 12 '12 at 09:46

2 Answers2

2

Oh well...

1) Is there a way to refine the conditions that drive the behavior of Back and Forward?

No. Maybe (just maybe) it takes into consideration what you were doing at that location (even if you done nothing, then maybe how long the pause was). But mainly it looks at editing activity, navigation events (jump to declaration/implementation etc).


2) Is a regexp (or something else) able to refine the behavior of the indentor, Not only for this very specific case but for the behavior in general?

RegEx -- definitely no. This question is not clear for me anyway -- are you talking about formatting or navigation? If first -- then all currently existing settings are in "Settings | Code Style". If second -- then check "Settings | Editor | Smart keys" -- maybe they will help.

Otherwise -- please record some screencast/bunch of screenshots for current and desired behaviour and submit it as a new ticket to the Issue Tracker: http://youtrack.jetbrains.com/issues/WI


3) Is there a regexp or similar to control the quoting behavior?

No. You explanation is not clear enough. I suggest the same as for #2 -- get a code example and submit it as a new ticket to the Issue Tracker: http://youtrack.jetbrains.com/issues/WI . This way it may gets implemented/fixed for next version


4) not sure there is a way to configure that though - just in case there is?

Don't know. I'm also facing this usability issue and would like to know workaround. The way I'm using it -- pressing "Home" before (or during/after) making the selection (not ideal "solution" as it is still annoying to do so, but works). Alternatively you can use mouse to select the lines (use it over editor gutter area -- where the line numbers are).

If selection is to just delete/duplicate the line -- then there are shortcuts just for that.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
  • 2. is about formatting - the code-style menu doesn't help much. *not clear*? wow I thought my graphical example was clear enough :-) – Déjà vu Nov 13 '12 at 10:33
  • If something crystal clear for you this does not necessary means that it is the same for another person. That's why separate examples (current and desired) are more helpful than all-in-one. And Yes -- it is still not 100% unclear for me what exactly you want here (sorry for being such slowpoke). Yes, I have some idea what you may be after, but why should I be guessing and trying to answer potentially wrong issue (in case if my guess is incorrect)? – LazyOne Nov 13 '12 at 11:25
  • Sometimes the question is not read carefully (when it's long), I guess you did: so in case 2 (indentation), entering a list of elements E1, E2, ... each on one line, E2 being under E1, E3 under E2 etc.. (see example) - to do this, after hitting the enter key after E2, the editor has to indent up to E2 (and not only to the if or while... level). Emacs does this in C-mode. – Déjà vu Nov 13 '12 at 17:00
  • If you cannot solve #2 with existing Code Style settings, then I suggest (once more) to submit new ticket to the Issue Tracker at http://youtrack.jetbrains.com/issues/WI . Doing nothing will not help solving this issue for you (maybe others are fine with what they have right now). The future is in your hands :) – LazyOne Nov 16 '12 at 14:15
2

Regarding quotes, in cases when you just want the one quote, hit del instead of backspace after typing ".

I've some qualms about the indentation (and code (re)formatting in general) too, but it's that it changes from release to release, there's not much you can do about it though...

Re: selection - in your case you can just hit Home while still holding shift. It never even registered to me as unexpected behavior.

raveren
  • 17,799
  • 12
  • 70
  • 83