BruceOuyang / issuelist

用于记录日常碰到的各种问题和经验总结 (请看Issues)
4 stars 2 forks source link

Idea 使用习惯 #63

Open BruceOuyang opened 4 years ago

BruceOuyang commented 4 years ago

插件配置

插件 描述
lombok 支持 lombok 语法
markdown support 支持 markdown 语法
sonar lint 代码质量检测
alibaba java coding guidingline 阿里巴巴 java 代码规范
key promoter x 快捷键提示
codeGlance 类似sublime右侧代码总览
RestfulToolkit restful 工具集,支持根据 uri 定位到 controller
GsonFormat json 生成实体类
Translation google 翻译
BruceOuyang commented 4 years ago

常用快捷键

run & debug

快捷键(windows) (mac) 说明
shift + F9 control + D 调试启动
shift + F10 control + R 正常启动

查看

快捷键(windows) (mac) 说明
ctrl + F12 command + F12 查询当前文件结构(属性、方法)
ctrl + alt + b option + command + B 查看实现类
ctrl + alt + ←/→ option + command + ←/→ (左前面看过的代码,右后面看过的代码)

操作

快捷键 说明
shift + F6 全局修改变量名称或方法名
BruceOuyang commented 4 years ago

注释模板

类注释

File-->settings-->Editor-->File and Code Templates-->Files

#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
/**
 * @ClassName: ${NAME}
 * @Description: TODO
 * @Author: ${USER}
 * @Date: ${DATE} ${TIME}
 * @Version: V1
 **/
public class ${NAME} {
}

方法注释

File-->Settings-->Editor-->Live Templates

/**
 * @Author $user$
 * @Description TODO $end$
 * @Date $date$ $time$
 * @Param $params$
 * @return $return$
 **/

对应的 variables 设置:

参数 表达式
$user$ user()
$date$ date()
$time$ time()
$params$ methodParameters()
$return$ methodReturnType()
BruceOuyang commented 4 years ago

基础配置

展示方法的分割线

Settings -> Editor -> General -> Appearance ->
勾选 Show method separators

ctrl + 滚轮:调整字体大小

Settings -> Editor -> General -> 
Mouse -> 勾选 Change font size(Zoom) with Ctrl + Mouse Wheel

打开多个文件文件名分行展示

Settings -> Editor -> General -> Editor Tabs ->
Tab Appearance -> 去掉勾选 Show Tabs In Single Row

在properties文件中显示中文

Settings -> Editor -> File Encodings ->
Properties Files -> 勾选 Transparent native-to-ascii conversion

将光标放到类名上,按atl+enter键,提示生成serialVersionUID

Settings -> Editor -> Inspections ->
Serialization issues -> 勾选 erialzable class without "serialVersionUID"
BruceOuyang commented 4 years ago

Idea 卡顿配置

Edit Custom VM Options

调整 Inspections 级别

适当关闭idea的Inspections的检查或者开发时完全关闭Inspections的检查, 等开发完后在开启检查。个人感觉这个最有效。

可以全部关闭,idea右下角有一个 人头标志,可以点击,调准idea检查级别

BruceOuyang commented 3 years ago

idea 隐藏文件或文件夹(例如:.iml;.idea;.git 等)

Settings -> Editor -> File Types -> Ignore files and folders -> 添加 .idea;.iml;.git;
BruceOuyang commented 2 years ago

正则替换

示例:

    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private java.lang.String id;

    // 替换为
    @TableId(type = IdType.ASSIGN_ID)
    private java.lang.String id;

目标

@ApiModelProperty(.*)\n.*private

结果

private