# webstrom-skill **Repository Path**: xccjh/webstrom-skill ## Basic Information - **Project Name**: webstrom-skill - **Description**: webstrom使用经验分享 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: http://xccjh.gitee.io/vuebloger/technology/webstrom使用经验总结.html - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-02-09 - **Last Updated**: 2022-02-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: webstrom, 使用技巧 ## README ## webstrom使用经验分享 ## 前言 以前有想过写一篇webstrom前端通解各种快速技巧的文章没有合适的动力,刚好现在乘着碰到了‘重量级项目’ideation的卡顿体验有了动力写文章分享下。 ## 常用快捷键技巧 以下快捷键基本涉及开发中最最常用的全部使用需求,如果你有兴趣花点时间消化一下,剩下的就是在项目中孰能生巧,一段时间后你会发现自己慢慢喜欢上webstrom,且在其中行云流水了。 > tip 需要下载[setting](https://gitee.com/xccjh/webstrom-skill)导入webstrom(包含CodeStyle,FileTemplate等可以只应用KeyMap),个人做了点使用习惯优化,如有异议或不理解,欢迎交流。 | 快捷键 | 描述 | | :-: | :-: | | ctrl + d | 对比选择文件 | | alt + d | 对比激活窗口 | | ctrl + shift + alt + d | 对比剪切板 | | | | | ctrl + shift + alt + 1 |tab close all | | ctrl + shift + alt + 2 | tab close other | | ctrl + shift + alt + 3 | tab close to left | | ctrl + shift + alt + 4 | tab close to right | | ctrl + shift + alt + 7 | undo commit | | ctrl + shift + alt + 5 | open recent project | | ctrl + shift + alt + f12 | file path navigate | | ctrl + shift + alt + O | show in file system location | | | | | ctrl + 1 | merge中止 | | ctrl + 2 | cherry中止 | | ctrl + 3 | file local history | | ctrl + 4 | compare current version | | ctrl + 5 | fix conflict | | ctrl + 6 | file history | | ctrl + 7 | find in project | | ctrl + r | replace in path | | ctrl + shift + r | replace in project | | ctrl + f | find in path | | ctrl + 8 | file local history selection | | ctrl + 9 | file history selection | | ctrl + 0 | conflict accecpt all | | ctrl + - | conflict accecpt current | | ctrl + = | conflict accecpt coming | | ctrl + shift + g | 高亮冲突 | | ctrl + alt + shift + g | 取消高亮冲突 | | | | | alt + 1 | 当前激化窗口文件定位project文件 | | alt + 2 | 打开favorities | | alt + 6 | 打开todo | | alt + 7 | 打开structure | | alt + 8 | 打开git commit | | alt + 9 | 打开git log | | | | | ctrl + shift + alt + k | commit file | | ctrl + alt + k | commit and push | | ctrl + k | commit(amend选项快速放弃/更改上个提交) | | ctrl + shift + k | push | | ctrl + alt + z | rollback current [all] file change 还原工作区| | | | | alt + f11 | show npm script | | alt + f12 | open cmd | | alt + T | new cmd | | ctrl + f12 | show file structuce navigate | | ctrl + h | 显示当前函数调用堆栈 | | alt + insert | 生成geter/setter/构造 | | ctrl + alt + shift + t | 重构 | | shift + f6 | 重命名(文件,变量,函数名) | | f5 | 复制文件 | | ctrl + shift + / | 大注释 | | | | | f11 | toggle bookmark | | shift + f11 | show all bookmark | | | | | shift + shift | find any | | ctrl + n | find class | | ctrl + shift + n | find file | | ctrl + shift + alt + n | find symbols | | ctrl + shift + alt + a | find action | | ctrl + e | recent file | | ctrl + e + ctrl + e | recent change file | | ctrl + shift + e | recent location | | alt + c | recent change | | | | | ctrl + shift + alt + s | stash 建议用shelf,速度快 | | ctrl + shift + alt + u | unstash 建议用shelf,速度快 | | ctrl + shift + h | 静默应用一个shelf | | ctrl + alt + u | 静默还原一个shelf | | ctrl + alt + shift + 6 | 选文件应用一个shelf | | ctrl + shift + u | 还原一个shelf中的部分文件 | | | | | ctrl + ~ |切换主题 (edit color scheme) | | ctrl + shift + ~ |分支操作(1.切换分支+基于远程某个分支生成同名本地分支+基于当前或已经存在分支生成新分支2.合并操作3.删除分支4.工作区和其他分支对比5.默认选中上次切换的分支) | | ctrl + shift + b |基于当前分支新建分支,要重命名,快速分支一键化可以摸索下ctrl+shift+~ | | | | | ctrl + shift + alt + ‘’ | show in git log (file history下) | | ctrl + shift + alt + ; | other project show in git log | | ctrl + shift + alt + , | current file compare branch | | ctrl + shift + alt + . | current file compare commit | | ctrl + shift + alt + / | reset 某个版本/还原工作区 | | ctrl + shift + alt + Q | show remote origin | | ctrl + shift + alt + + | HTML | | ctrl + shift + alt + - | CSS | | ctrl + shift + alt + <- | JS | | ctrl + shift + alt + 0 | TS | | ctrl + shift + alt + 9 | vue | | ctrl + shift + alt + insert | scratch | | ctrl + shift + alt + [ | file | | ctrl + shift + alt + ] | dir | | ctrl + shift + alt + E | reload file system | | | | | ctrl + alt + <- | 上个光标位置 | | home | 跳行首 | | ctrl + home | 跳文件头 | | | | | alt + j | 下个相同选择 | | ctrl + d | 复制行 | | alt + shift + ⬇ | 移动行 | | alt + backspace | 删除行 | | alt + c | 切换大小写搜索 | | alt + o | 切换全匹配搜索 | | | | | shift + f9 | run npm script (推荐启动项目方式) | | | | | ctrl + shift + i | 直接预览定义 | | ctrl + u | 跳转父类 | | ctrl + alt + b | 查看接口实现、类型定义跳转实现如d.ts定义跳转实现 | | ctrl+ p | 查看参数类型 | | | | | ctrl + j | 模板类型 | | ctrl + alt + o | 优化导入 | | ctrl + alt + l | 格式化 | | ctrl + enter | 智能推荐/自动导入 | | | | | git窗口下: | | | f4 | 查看源码 | | ctrl + d | 对比diff | | ctrl + alt + p | 目录分组查看 | ## git技巧备忘 ```sh git ls-remote | findstr sit cmd查看远程分支commitID git ls-remote | grep sit bash查看远程分支commitID git remote show origin 查看远程仓库地址和分支情况(ctrl + shift + ~) gir remote -v 查看远程仓库地址(ctrl + shift + alt + Q) git remote prune origin 本地分支同步远程分支 cherry pick 应用提交 annotate 查看代码谁在什么时间提交 快速复制commitID alt + 9 快速定位commitID alt + 9(区分三个快速搜索) 整个仓库代码对比分支操作 使用vcs->git 整个仓库代码对比分支和工作区 使用vcs->git 一键还原工作区或回滚上个版本 ctrl+alt+z 或 ctrl+alt+shift+/ 开速合并分支 ctrl + shift + ~ -> 字符匹配 + merge into curent 快速基于远程分支新建同名分支或命名分支 ctrl + shift + ~ -> 字符匹配 + 两次enter 快速切换上一个分支 ctrl + shift + ~ -> 两次enter 快速暂存和还原 ctrl + shift + h/ctrl + alt + u 快速部分暂存和部分还原 ctrl + shift + alt +6/ctrl + shift + u 快速查看文件log ctrl + 6 快速查看分支log alt + 9 -> 过滤head 快速拉取代码 ctrl + t 快速提交代码 ctrl + k -> ctrl + enter (配合gitmoji) 快速推送代码 ctrl + shift + k -> ctrl + enter 配置reset默认hard reset hard 应用一次 配置unshelf默认去除shelf part unshelf 应用一次 配置commit默认跳过hook 重命名.git/hooks为.git/hooks-bak,相当于以后--no-verify,速度飙升 ``` ## 重量级项目使用经验 1. 插件系列 - 推荐 Gitmoji git表情自动补全 Gitmoji PLus 按钮选择git表情 JsonPaser 格式化json字符串为树 CPU Useage Indicator CPU资源监视 IDE Eval Reset 重新激活插件 Git conflict 冲突时像vscode一样解决冲突 close Editor Tabs Left Right 增加关闭左侧tab功能 translate 编辑器内直接翻译 vuejs 增加一键创建vue模板功能 String Manipulation 提供了处理字符串如换成camelCas,kebab-case,PascalCase,切换大小写,排序等 - 了解 KeyPromoter 快捷键提醒 CodeGlance 增加右侧代码缩略图 Kubernetes 方便的查看 k8s 中的各种 yaml 文件 Nginx Support 支持 nginx 配置文件的语法 Go Template 用来支持 Golang 的 template 语法的插件 JS GraphQL 提供 GraphQL 文件的语法高亮,config 文件支持 Git Commit Template 使用 commitizen 优化 git 提交 .env 支持对 .env 文件的语法高亮,代码提示 2. 使用debugger启动停止更快 - 一般上能用webstrom自带的图形化功能操作git不用命令行控制台,能用cmd命令行控制台不用bash控制台(为了速度) - 配置使用npm script (配置为debugger,添加环境变量如sit)-> 使用debugge快速启动(shift + f9或alt + f11) - cmd里git log 中文乱码: 设置环境变量变量名: LESSCHARSET ,变量值: utf-8。 - bash里git log 中文乱码: git的安装路径`(C:\Program Files\Git\etc\bash.bashrc)`下etc文件下有个 bash.bashrc 文件,在这个文件末尾追加: ```sh export LANG="zh_CN.UTF-8" export LC_ALL="zh_CN.UTF-8" ``` - cmd强制删除当前目录所有资源:`rd/q/s .` ,强制删除指定目录及子资源:`rd/q/s xxx`, 强制删除指定文件: `del/q/f/s ss.text` - 如果你对命令行使用git以及git各种缩写提高效率的兴趣,可以看下我在两年前总结的[git命令笔记](http://xccjh.gitee.io/vuebloger/technology/git%E5%91%BD%E4%BB%A4%E7%AC%94%E8%AE%B0.html)和[实用片段备忘之git-alias配置](http://xccjh.gitee.io/vuebloger/bake/%E5%AE%9E%E7%94%A8%E7%89%87%E6%AE%B5%E5%A4%87%E5%BF%98.html#git-alias%E9%85%8D%E7%BD%AE) 3. 使用bookmark favories todo功能 4. 使用加载/删除file模板 tool=>save file as tempalte/setting=> file and code template 使用live模板自动补全 5. 内存配置优化: - Help-> change memorys Setting -> 设置较大值 6. cpu配置优化: - Setting-> Editor ->Code Editing ->Quick Documentation -> 去除 show quick documentation on hover - Setting-> Appearance & Behavior -> System Settings -> 关闭 Synchronization 所有同步 7. 搜索优化和索引优化:添加excluded