Cheat Sheet速查表
跳转到主要内容

Projectionist 速查表

本文根据 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}在根目录下运行命令

参考资料

参见 vim-projectionist.