Projectile Notes
文章目录
重新生成 项目 cache
- 调用函数 M-x projectile-invalidate-cache
忽略文件问题
https://docs.projectile.mx/projectile/2.2/projects.html#ignoring-files
- 使用 .projectile 配置
或者 设置变量
- projectile-globally-ignored-files
- projectile-globally-ignored-directiories
.projectile 文件配置
只包含的文件夹 "+"
注意
- "+" 后面只能跟目录
- 对文件使用无效
| |
忽略的文件 或者 文件夹 "-"
| |
注意
不指定路径,就是通配
- 即,哪个路径下都匹配
对忽略配置的例外情况 "!"
添加,不可被忽略的文件或文件夹
1 2!/src/foo !*.yml注意
如果使用了 "+"
"!": 设置无效
- 必须是,"+" 包含的文件夹中的内容,才可以
注意
谨慎使用通配符
eg:
1 2 3 4-/gradle -/.gradle !*.gradle因为 "*.gradle" 也包含 .gradle
- 导致上面的 "-/.gradle" 无效
配置无效时
- 可以检查是不是,滥用通配符导致的
我的配置
java
对于 gradle 项目
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16-*.java~ -/.idea -/.meghanada -/.settings -/bin -/build -/gradle -.classpath -.project -*~ -gradlew* !build.gradle !settings.gradle
python
1 2 3 4 5 6 7 8 9 10 11 12-/build -/dist -/.git -/.idea -/temp -/.venv -*~ -__pycache__ -.pytest_cache -.projectile -*#这里,除掉首行, "#" 不表示注释
- 因此,不需要对 "#" 转义
basic command
| command | meaning |
|---|---|
| s-p f | find file |
| s-p p | switch between projects |
| s-p s g | grep to the whole project |
| s-p r | replace a string in all the project |
| s-p m | use this command like a prefix |
| to execute all other command | |
| s-p T | list Test files |
| s-p d | list directories in the project |
| s-p l | list all files in a directory |
| (not all necessary) | |
| s-p b | switch buffers of this project |
| s-p a | switch between "files" with |
| same name but different extensions | |
| s-p R | generate TAGS |
| s-p j | find project's TAGS |
| s-p k | kill all buffers of the same project |
| s-p D | dired at project root |
| s-p C-h | help of projectile |
支持的 project 类型
- 存储在变量
projectile-project-types projectile 会缓存项目类型
- 如果想要让 projectile 发现 project-type 发生改变,需要清除 cache
M-x projectile-invalidate-cache
文章作者
上次更新 2024-01-05 (5c92d1c)