intellij-idea - 如何为所有 IntelliJ IDEA 配置默认的“Shorten command line”方法(或其他运行/调试配置选项)?
问题描述
我知道如何为特定配置(例如特定的 JUnit 测试配置)和特定的配置模板(例如所有新的 JUnit 测试配置)设置“缩短命令行”。是否可以将 IntelliJ IDEA 配置为默认设置为特定设置(即在 中设置的内容~/.IntelliJIdea*
),以便所有配置(例如 JUnit、Cucumber、Spring Boot 等)默认使用该默认方法?
解决方案
我还没有找到为所有配置类型设置它的方法,但是有一种方法可以将它设置为特定配置类型的 IDEA 默认值。
首先,在 中,如果它尚不存在,则~/.IntelliJIdea*/config/options/project.default.xml
创建一个元素。<component name="ProjectManager"><defaultProject><component name="RunManager">…</component></defaultProject></component>
然后,对于要默认的每种配置类型:
- 在模板中为现有项目中的该配置类型设置项目默认值。
- 在该项目的
.idea/workspace.xml
文件中,复制该配置类型的<configuration>…</configuration>
元素内的<component name="RunManager">…</component>
元素。 - 将该块粘贴到
~/.IntelliJIdea*/config/options/project.default.xml
里面<component name="ProjectManager"><defaultProject><component name="RunManager">…</component></defaultProject></component>
。
重新启动 IntelliJ IDEA,以便所有实例都采用新的默认值并且不会覆盖,project.default.xml
从而清除设置。
保存project.default.xml
以防退出 IntelliJ IDEA 覆盖修改。
推荐阅读
- c++ - 在 C++ 中生成具有相等概率的随机数
- angular - 是否有用于检测未使用的类属性的 eslint 规则?
- sql - 如何在 azure devops 发布管道中包含更新查询
- javascript - 如何测试中间件中返回的请求值
- c# - 从代码中保存 Unity Console 日志/崩溃报告
- php - 将 MySql 表解析为 Json 时遇到问题
- python - 如何用pytest模拟requests.post?
- sql - 为什么我在 BigQuery 中不断收到此语法错误
- python - 在 Ansible 上使用 Jinja2 的 if 表达式(内联 if-else)中的连接不起作用
- r - 在两个键中收集具有值的四列