PHPStorm: Difference between revisions

From Wiki RB4
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Configuration==
===Editor===
* tab size in File -> Settings -> Editor -> Code Style -> <Language>
==Operations==
==Operations==


Change keymapping by CTRL+ALT+S -> Keymapp -> Search -> Right Click -> Add or Remove
Change keymapping by CTRL+ALT+S -> Keymapp -> Search -> Right Click -> Add or Remove
===Debugging===
====Locally====
The approach is called 'zero-configuration debugging' (browser extension to switch on debugging has to be installed).
* click on 'start listening for PHP Debugging Connections'
* set breakpoint
* call the web page


===Gitting===
===Gitting===
* see [https://www.jetbrains.com/help/phpstorm/version-control-integration.html here]
* see [https://www.jetbrains.com/help/phpstorm/version-control-integration.html official documentation]


====Add Files to VCS====
====Add Files to VCS====
* open VCS tool window (ALT+9) -> Local Changes
* open VCS tool window (ALT+9) -> Local Changes
* in Unversioned Filelist Right Click on file -> Add to VCS
* in Unversioned Filelist Right Click on file -> Add to VCS
* press refresh icon on the left side
====Ignore Files====
* open VCS tool window (ALT+9) -> Local Changes
* in Unversioned Filelist Right Click on file -> Ignore
* this will not add anything to <code>.gitignore</code>, for this obviously a plug-in is needed. So if adding or pushing via command line be careful.
====Unignore Files====
* CTRL+ALT+S (will lead to Settings -> Version Control -> Ignored Files)
* select - icon
====Pushing Files====
* VCS -> Git -> Push // if a remote repository is not configured yet you will be asked for URL, user and pwd


====Watch Changes====
====Watch Changes====
Line 17: Line 41:
** blue bar = line changed
** blue bar = line changed
** green bar = line added
** green bar = line added
** triangle = line deleted
** click on the marks will show the changes


===Finding===
===Finding===
Line 22: Line 48:
* find file: CTRL+SHIFT+N
* find file: CTRL+SHIFT+N
* find word where the caret is: CTRL+F3
* find word where the caret is: CTRL+F3
* find in (sub-)path
** right click on directory -> Find in Path
** Open in Find Window -> adds window in bottom area


===Coding===
===Coding===
* toogle line comment CTRL+7 (remapped)
* toogle line comment CTRL+7 (remapped) or 'Code->Comment with Line Comment'
* toogle block comment CTRL+SHIFT+7 (remapped)
* toogle block comment CTRL+SHIFT+7 (remapped)
* rename classes, methods and variables: Refactor->Rename or SHIFT+F6
* rename classes, methods and variables: Refactor->Rename or SHIFT+F6
Line 33: Line 62:


===Cross Reference===
===Cross Reference===
* open declaration: Navigate->Type Declaration or CRTL+SHIFT+B or CTRL+LEFT_MOUSE (Navigate Back changed to CTRL+SHIFT+LEFT_ARROW)
* open declaration: Navigate->Type Declaration or CRTL+SHIFT+B or CTRL+LEFT_MOUSE (navigate back by Menu->Navigate-Back or CTRL+TAB)
* show class hierachy window: CTRL+H
* show class hierachy window: CTRL+H
* show interface implementations: select interface and press CTRL+ALT+B
* show interface implementations: select interface and press CTRL+ALT+B
Line 40: Line 69:
* show UML class diagram: select class and press CRTL+ALT+U
* show UML class diagram: select class and press CRTL+ALT+U
* navigate in actual file: CTRL+F12
* navigate in actual file: CTRL+F12
===Miscellaneous===
* synchronize project tree: ALT+F1
* synchronize project tree: ALT+F1

Latest revision as of 15:17, 24 February 2020

Configuration[edit]

Editor[edit]

  • tab size in File -> Settings -> Editor -> Code Style -> <Language>

Operations[edit]

Change keymapping by CTRL+ALT+S -> Keymapp -> Search -> Right Click -> Add or Remove

Debugging[edit]

Locally[edit]

The approach is called 'zero-configuration debugging' (browser extension to switch on debugging has to be installed).

  • click on 'start listening for PHP Debugging Connections'
  • set breakpoint
  • call the web page

Gitting[edit]

Add Files to VCS[edit]

  • open VCS tool window (ALT+9) -> Local Changes
  • in Unversioned Filelist Right Click on file -> Add to VCS
  • press refresh icon on the left side

Ignore Files[edit]

  • open VCS tool window (ALT+9) -> Local Changes
  • in Unversioned Filelist Right Click on file -> Ignore
  • this will not add anything to .gitignore, for this obviously a plug-in is needed. So if adding or pushing via command line be careful.

Unignore Files[edit]

  • CTRL+ALT+S (will lead to Settings -> Version Control -> Ignored Files)
  • select - icon

Pushing Files[edit]

  • VCS -> Git -> Push // if a remote repository is not configured yet you will be asked for URL, user and pwd

Watch Changes[edit]

  • open VCS tool window (ALT+9) -> Local Changes
    • blue = changed after last synchronization
    • green = new files added, but not committed
  • in the editor just left of the edit area
    • blue bar = line changed
    • green bar = line added
    • triangle = line deleted
    • click on the marks will show the changes

Finding[edit]

  • find class by name: CTRL+N
  • find file: CTRL+SHIFT+N
  • find word where the caret is: CTRL+F3
  • find in (sub-)path
    • right click on directory -> Find in Path
    • Open in Find Window -> adds window in bottom area

Coding[edit]

  • toogle line comment CTRL+7 (remapped) or 'Code->Comment with Line Comment'
  • toogle block comment CTRL+SHIFT+7 (remapped)
  • rename classes, methods and variables: Refactor->Rename or SHIFT+F6
  • override methods: Code->Override
  • implement methods: Code->Implement methods or CTRL+I
  • complete line or language construct: CTRL+SHIFT+ENTER
  • move to next method in class: ALT+UP|DOWN

Cross Reference[edit]

  • open declaration: Navigate->Type Declaration or CRTL+SHIFT+B or CTRL+LEFT_MOUSE (navigate back by Menu->Navigate-Back or CTRL+TAB)
  • show class hierachy window: CTRL+H
  • show interface implementations: select interface and press CTRL+ALT+B
  • show definition of actual element: CTRL+SHIFT+I
  • show method hierachy window: select method and CRTL+SHIFT+H
  • show UML class diagram: select class and press CRTL+ALT+U
  • navigate in actual file: CTRL+F12

Miscellaneous[edit]

  • synchronize project tree: ALT+F1