intellij IDE笔记

2019-12-12  本文已影响0人  zhetengxiang

慕课网课程地址IntelliJ IDEA神器使用技巧,2小时20分
快捷键查询

一、定位代码

1. 跳转

1. alt + num 打开面板快捷键

image.png

2. 代码定位

  1. 项目之间跳转
  1. 文件之间跳转
    (1)Recent Files
  1. 浏览修改位置跳转
    (1)浏览编辑历史
  1. 利用书签跳转
    一般用于浏览源码
  1. 收藏位置和文件
  1. 字符跳转插件emacsIdea置跳转
    用途:例如搜索关键字p,java文件有很多p时不好定位
  1. 编辑区和文件区来回跳转
  1. 利用vim进行多编辑区跳转

2. 精准搜索

  1. 文件
  1. 符号
  1. 字符串

二、代码小助手

1. 列操作

100:"Continue"
101:"Processing"
102:"Checkpoint"

200:"OK"
201:"Created"
202:"Accepted"
public enum  Status {
        // 1xxx
        AA(100),
        BBB(102),
        CCCC(103),

        // 2xxx
        OK(200),
        UPDATE(202),
        CREATE(203);
        /**
        *  错误码
        */
        public int code;

    Status(int code) {
        this.code = code;
    }
}
// visual studio windows keymap
选中任意一行冒号
选中所有冒号 ctrl + shift + alt + J// Select All Occurrences
移到冒号后选中后面的单词 ctrl + shift + → // Move Caret to Next Word with Selection
单词变为大写 ctrl + shift + U // Toggle Case
剪切
移到行首 HOME // Move Caret to Line Start 
复制粘贴 ,左括号
移到下个单词尾 ctrl + → // Move Caret to Next Word
选中冒号后的单词 ctrl + shift + → // Move Caret to Next Word with Selection
右括号,逗号
寻找错误 F2 // Next/previous highlighted error
格式化 alt + F8 // reformat code
// visual studio windows keymap
选中任意一行冒号
选中所有冒号 ctrl + alt + y // Select All Occurrences
移到冒号后选中后面的单词 ctrl + shift + → // Move Caret to Next Word with Selection
单词变为大写 ctrl + shift + x // Toggle Case
剪切
移到行首 HOME // Move Caret to Line Start 
复制粘贴 ,左括号
移到下个单词尾 ctrl + → // Move Caret to Next Word
选中冒号后的单词 ctrl + shift + → // Move Caret to Next Word with Selection
右括号,逗号
寻找错误 ctrl + alt + F2 // Next/previous highlighted error
格式化 ctrl + alt + L // reformat code

2. live template

action:Live Templates
新建templates

  1. main(ide自带psvm)


    image.png
  1. psfi,psfs(ide自带)


    image.png
  1. pi(c),ps(c)


    image.png

3. postfix(不支持自定义)

100.fori中fori就是postfix,被.出来


image.png

action:postfix completion

  1. fori/for:100.fori
for (int i = 0; i < 100; i++) {   

}
  1. sout:100.sout
System.out.println(100);
  1. field:"hello".field
private static String name;
public static void main(String[] args){
      name = "hello";
}
  1. return:1000.return
 return 100;
  1. nn:user.nn
if (mUser != null) {
    
}

4. alt + enter:代码补充

action:show intention actions

三、重构

  1. 重构


    image.png
  1. 抽取

四、寻找修改轨迹

  1. git的集成
  1. local history
    action:local history


    image.png

五、关联一切(暂时没用到)

  1. spring的关联
  2. 数据库的关联

六、debug

  1. 断点调试
  1. run anywhere if you can

七、其他操作

  1. 文件操作
  1. 文本操作
  1. 结构图
上一篇 下一篇

猜你喜欢

热点阅读