本文根据 Devhints / Projectionist 翻译。代码示例及版本范围沿用原文。
基本用法
/* .projectionist.vim */
{
"app/assets/react/components/*.jsx": {
"type": "component",
"template": [
"import React from 'react'",
"export default {} = React.createClass({ ... })"
]
}
可用选项
{
"lib/*.rb": {
"type": "lib", /* enables :Elib */
"alternate": "test/{}_spec.rb", /* for :A */
"template": [ ... ],
"path": "include", /* for `gf` i think */
"console": "node", /* for :Console */
"dispatch": "node", /* for :Dispatch (dispatch.vim) */
"start": "rails server", /* for :Start (dispatch.vim) */
"make": "node", /* for makeprg */
}
}
命令
| 命令 | 说明 |
|---|---|
:A | 编辑备选文件 |
:A {file} | 编辑文件 |
:AS | 在分屏中编辑 |
:AV | 在垂直分屏中编辑 |
:AT | 在标签页中编辑 |
:AD | 使用模板替换 |
:Cd | 切换到根目录 |
:Cd {path} | 切换到根目录下的路径 |
:Lcd | 使用 :lcd 切换到根目录 |
:ProjectDo {cmd} | 在根目录下运行命令 |