编辑器 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