天天看點

編輯器 phpstorm配置技巧

激活

phpstorm10

License Server
http://idea.qinxi1992.cn/
搭建自己的IntelliJ IDEA授權伺服器
http://blog.lanyus.com/archives/174.html
           

phpstorm2017.1

License Server
http://idea.goxz.gq
http://v2mc.net:1017
http://idea.imsxm.com
http://idea.ibdyr.com
           

快捷鍵

windows快捷鍵

ctrl+shift+n查找檔案
ctrl+shift+f 在一個目錄裡查找一段代碼(ctrl+f的更新版)
ctr+shift+r 在一個目錄裡查找一段代碼并替換(ctrl+r的更新版)
CTRL+ALT ←/→  傳回上次編輯的位置
ALT+ ←/→  切換代碼視圖,标簽切換
ALT+ ↑/↓  在方法間快速移動定位
ctrl+j插入活動代碼提示
ctrl+alt+t目前位置插入環繞代碼
alt+insert生成代碼菜單
ctrl+q檢視代碼注釋
ctrl+d複制目前行
ctrl+y删除目前行
shift+F6重命名
ctrl+shift+u字母大小寫轉換
ctrl+f查找
ctrl+r替換
F4檢視源碼
ctrl+shift+i檢視變量或方法定義源
ctrl+g跳轉行
ctrl+alt+F12跳轉至目前檔案在磁盤上的位置
ctrl+alt+l重新格式化代碼
ctrl+shift+downstatement向下移動
ctrl+shift+upstatement向上移動
alt+shift+downline向下移動
alt+shift+upline向上移動
ctrl+/行注釋
ctrl+shift+/塊注釋
ctrl+shift+n打開工程中的檔案
ctrl+b跳到變量申明處
ctrl+[]比對 {}[]
ctrl+shift+]/[選中塊代碼
ctrl+x剪切行
ctrl+shift+v複制多個文本
alt+left/right标簽切換
ctrl+p顯示預設參數
ctrl+F12在目前類檔案裡快速查找方法
alt+1檔案菜單展示/關閉
alt+7方法地圖展示/關閉
           

mac快捷鍵

⌘——Command
⌃ ——Control
⌥——Option/Alt
⇧——Shift
⇪——Caps Lock
fn——功能鍵就是fn

編輯
Command+alt+T 用 (if..else, try..catch, for, etc.)包住
Command+/ 注釋/取消注釋的行注釋
Command+alt+/ 注釋/取消注釋與塊注釋
alt+↑ 向上選取代碼塊
alt+↓ 向下選取代碼塊
Command+alt+L 格式化代碼
tab,shift+tab 調整縮進
Control+alt+I 快速調整縮進
Command+C 複制
Command+X 剪切
Command+V 粘貼
Command+shift+V 從剪貼闆裡選擇粘貼
Command+D 複制代碼副本
Command+delete 删除目前行
Control+Shift+J 清除縮進變成單行
shift+回車 快速換行
Command+回車 換行光标還在原先位置
Command+shift+U 大小寫轉換
Command+shift+[,Command+shift+] 檔案頁籤快速切換
Command+加号,Command+減号 收縮代碼塊
Command+shift+加号,Command+shift+減号 收縮整個文檔的代碼塊
Command+W 關閉目前檔案頁籤
alt+單擊 光标在多處定位
Control+shift+J 把下面行的縮進收上來
shift + F6 進階修改,可快速修改光标所在的标簽、變量、函數等
alt+/ 代碼補全

調試
Control+alt+R 運作項目
Command+Control+R 運作Debug
Command+F8 添加斷點
Command+shift+F8 打開斷點清單

導航
Command+O 跳轉到某個類
Command+shift+O 跳轉到某個檔案
Command+alt+O 跳轉到某個符号
Control+←,Control+→ 轉到上/下一個編輯器頁籤
F12 打開之前打開的工具視窗(TODO、終端等)
Command+L 跳轉行
Command+E 彈出最近檔案
Command+alt+←,Command+alt+→ 向前向後導航到代碼塊交接處(一般是空行處)
Command+shift+delete 導航到上一個編輯位置的位置
Command+B 跳轉到變量聲明處
Control+J 擷取變量相關資訊(類型、注釋等,注釋是拿上一行的注釋)
Command+Y 小浮窗顯示變量聲明時的行
Command+[,Command+] 光标現在的位置和之前的位置切換
Command+F12 檔案結構彈出式菜單
alt+H 類的層次結構
F2,shift+F2 切換到上\下一個突出錯誤的位置
Command+↑ 跳轉到導航欄
F3 添加書簽
alt+F3 添加帶助記的書簽
alt+1,alt+2… 切換到相應助記的書簽位置
Command+F3 打開書簽清單

VCS/本地曆史記錄
control+V 打開VST小浮窗
Command+K 送出項目
Command+T 更新項目
alt+shift+C 打開最近修改清單

搜尋和替換
Command+F 搜尋
Command+R 替換
Command+G 查找下一個
Command+shift+G 查找下一個
Command+shift+F 按路徑搜尋
Command+shift+R 按路徑替換

選中文字的搜尋
Command+F7 向聲明的地方搜尋并選中
Command+shift+F7 打開搜尋框進行搜尋
Command+alt+F7 打開小浮窗顯示搜尋清單

對項目檔案的操作(重構)
F5 複制檔案到某個目錄
F6 移動檔案到某個目錄
Command+delete 安全删除
shift+F6 重命名

全局的
輕按兩下shift 彈出小浮窗搜尋所有
Command+~切換項目 Command+shift+~ 反向切換項目 (在打開的不同項目中切換)
Command+shift+A 整個工程的查找操作
Command+1,Command+2… 打開各種工具視窗
alt+shift+F 把檔案添加到收藏夾
alt+shift+I 打開項目描述
alt+~ 快速切換目前計劃
Command+, 設定編輯器
Control+Tab 頁籤和工具視窗之間進行切換
alert+回車 顯示npm版本更新清單
           

主題

github搜color-schemes下載下傳主題
先去http://daylerees.github.io預覽,下載下傳到.WebIde80配置檔案中的font
http://www.ideacolorthemes.org/themes/
主題: https://github.com/daylerees/colour-schemes
主題2: http://www.ideacolorthemes.org/themes/
FiraCode字型:https://github.com/tonsky/FiraCode

解決sidebar與編輯器主題不一緻
plugins下載下傳插件 color ide
           

插件

power model II 字型效果
codeglance 代碼地圖
markdown support
markdown navigator
           

使用技巧

Live Template

1. ctrl+shift+A live template
2. new group
3. new template
4. 設定
Abbreviation: ftext Form
Description:Text Input
Template text:
<!--- $VALUE$ Field --->
<div class="form-group">
{!! Form::label('$NAME$', '$VALUE$:') !!}
{!! Form::text('$NAME$', null, ['class' => 'form-control']) !!}
</div>
修改Define->HTML
edit variables->VALUE->capitalize(NAME)
           

xdebug遠端調試

一、監聽調試(需要浏覽器插件,火狐->The easiest Xdebug,谷歌->xdebug helper)

1 xdebug配置
xdebug.remote_enable = On
xdebug.remote_handler = dbgp
xdebug.remote_host= 192.168.10.1        //用戶端的ip(IDE的機器的ip,不是web server)
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM

2.PHPSTORM配置
2.1 file->setings->php|Debug->xdebug->Debug port:9900(xdebug吐出的debug資訊通過本機的什麼端口傳輸)
2.2 file->setings->php|Servers->host: web伺服器的域名或ip,端口,use path mapping,項目目錄對應伺服器上目錄
2.3 開啟監聽(話筒按鈕或者Run->Start Listening for PHP Debug Connections)

3.浏覽器設定
The easiest Xdebug->IDE key for remote debugging->PHPSTORM
           

二、主動調試

1 xdebug配置
zend_extension = xdebug.so
xdebug.default_enable = On
xdebug.collect_params = On
xdebug.remote_connect_back = On            //開啟将忽略xdebug.remote_host
;xdebug.remote_host = 192.168.10.1        //用戶端的ip(IDE的機器的ip,不是web server)
xdebug.remote_port = 9900                       //用戶端的端口(即IDE的機器的端口,不是web server)
xdebug.remote_enable = On
xdebug.remote_handler = dbgp
xdebug.remote_log = "/var/log/xdebug/xdebug.log"
xdebug.remote_req = req
xdebug.auto_trace = Off
xdebug.remote_autostart = On
xdebug.show_exception_trace = 0
xdebug.collect_vars = On
xdebug.collect_return = On
xdebug.collect_params = On
xdebug.var_display_max_depth = 15
xdebug.show_local_vars = 1
xdebug.dump_undefined = 1
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = "/var/log/xdebug"

2 PHPSTORM配置
2.1 file->setings->php|Debug->xdebug->Debug port:9900(xdebug吐出的debug資訊通過本機的什麼端口傳輸)
2.2 file->setings->php|Servers->host: web伺服器的域名或ip,端口,use path mapping,項目目錄對應伺服器上目錄
           

轉載于:https://www.cnblogs.com/51fx/p/7004441.html