Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

4.1. Setups

Shinichi Okada edited this page May 10, 2015 · 6 revisions

Shortcuts

Some shortcuts.

cmd + , //to go to preference.
cmd + p // to open a file. The default was shift + cmd + o. I remapped this. 
cmd + r // File structure. The default was  mapped to cmd + F12
cmd + option + o // to find symbol/method
cmd + up  then enter// to open a navigation bar
cmd + 1 // to toggle sidebar
cmd + o // Navigate class
shift + cmd + a // search everything
option + up (repeat option + up) // select word, line, method, class, etc
cmd + click a method name // jump to the method
cmd + C // to copy a line without selecting a line
cmd + X // to delete a line without selecting a line
cmd + V // to paste a line
opt + F12 // terminal
option + cmd + O // search symbol. This can be used for PHP, css or SASS class as well

Minimum views

Turn of View>Status bar, Tool Buttons, Navigation bar and Toolbar. Go to the preferences, cmd + ,. And search breadcrumb and deselect Show HTML breadcrumbs and other bread crumbs. Restart PhpStorm.

In preference, Editor>Colors & Fonts to change a scheme name. Font to change a size and line spacing.

Adding Color Scheme

  1. Go to http://daylerees.github.io/ and see which scheme you like.
  2. Go to https://github.com/daylerees/colour-schemes and click jetbrain and select the same scheme you like. And click Raw and copy the URL.
  3. In your terminal cd ~/Library/Preferences/WebIde80/colors. WebIde80 could be different. It depends on app.
  4. curl -O paste-your-url-here OR if you have wget wget paste-your-url-here. If it doesn't work, then just create a file of the colorscheme. -O will create a file. And it must be Raw file.
  5. Restart your Phpstorm/pycharm and cmd+, to select the new theme.

Removing Tabs

Right click (or cmt+, and search tab) on a tab to select Tabs placement and click None.

To match sidebar to the main screen color

shift+cmd+a to bring up a search. Search plugins and click config plugins. Click Browse repositories at the bottom. And search color Ide. Install it and restart.

To change keymap

shift+cmd+a to search keymap and select Activate Keymap. Create a copy and name it. Search a keyboard shortcut by clicking an icon next to trash. Remove it and then add a new keyboard shortcut. If a new shortcut exists, then a pop-up will come to remove other assignment. Click Apply and save it.

Create a new file

cmd+up to jump to navigation bar (floating folder), click enter and then type app to go to the folder app and enter. cmd+n to pop-up a new and select Php class, Php file, a file or folder.

Customize a file

shift+cmd+a which search action or option name or shift+shift which search everywhere. When you open shift+shift, click a gear for setting and turn on Show IDE settings. Type file template and go to File and Code Templates in Preferences. In templates>PHPclass, it includes PHP File Header.php. Go to Includes tab and modify PHP FIle Header.

Add a new Template, Name: Eloquent Model, Extension: php. Copy and paste from PHP Class.

<?php

#if (${NAMESPACE})
namespace ${NAMESPACE};
#end

class ${NAME} extends Eloquent{
    
    protected \$fillable = [];

}

Test it to create a file under app/models/ with File name: Order, NAMESPACE: Acme.

Live templates - Snippets

cmd+E shows all recent files.

Create a textfield template.

<!--$VALUE$ Form Input -->
<div class="form-group">
    {{ Form::label('$NAME$', '$VALUE$:') }}
    {{ Form::text('$NAME$', 'null', ['class'=>'form-control']) }}
</div>    

Copy the above and shift shift to search live template and click Save as Live template. Type Abbreviation: textfield, Description: Form text field under user section which automatically selected in this case. You may need to change Applicable in ... for file types. Click Edit varialbes, for VALUE, expression select capitalize(NAME). And change the order if necessary. In this case I want NAME to be the first, so that after expansion, it will highlight to add NAME variable.

Now type textfield to expand it.

In preference Live Templates, click + to add Abbreviation: passwordfield, Description: Form password field.

<!--$VALUE$ Form Input -->
<div class="form-group">
    {{ Form::label('$NAME$', '$VALUE$:') }}
    {{ Form::password('$NAME$', ['class'=>'form-control']) }}
</div>    

And Edit variables. VALUE Expression to capitalize(NAME). And change Applicable to HTML and PHP.

Custom formatting

option + cmd + L or shift shift and Reformat code and Run to reformat. To customize formatting, go to preferences > Code Style > PHP. In Wrapping and Braces > Braces placement,

In class declaration: End of line 
In function declaration: Next line
Other: Next line

For Blank Lines,

After class header: 1

Other

Tick Align key-value pairs
Tick Convert True/False constants to Lower case
Tick Convert Null constant to: Lower case
Tick Blank line before return statement
Tick Spaces around variable/expression in brackets

Spaces

Enable Around Operators>Unary operators
Enable Other>After type cast

Click Apply and Ok. option + cmd + L to format a file.

Clone this wiki locally