OSDN Git Service

Regular updates
[twpd/master.git] / projectionist.md
1 ---
2 title: Projectionist
3 category: Vim
4 layout: 2017/sheet
5 ---
6
7 ### Basic usage
8
9 ```json
10 /* .projectionist.vim */
11 {
12   "app/assets/react/components/*.jsx": {
13     "type": "component",
14     "template": [
15       "import React from 'react'",
16       "export default {} = React.createClass({ ... })"
17     ]
18   }
19 ```
20
21 ### Available options
22
23 ```js
24 {
25   "lib/*.rb": {
26     "type": "lib", /* enables :Elib */
27     "alternate": "test/{}_spec.rb", /* for :A */
28     "template": [ ... ],
29
30     "path": "include", /* for `gf` i think */
31
32     "console": "node", /* for :Console */
33     "dispatch": "node", /* for :Dispatch (dispatch.vim) */
34     "start": "rails server", /* for :Start (dispatch.vim) */
35     "make": "node", /* for makeprg */
36   }
37 }
38 ```
39
40 ### Commands
41
42 | Command | Description |
43 |---------|-------------|
44 | `:A` | Edit alternate |
45 | `:A {file}` | Edit file |
46 |---------|-------------|
47 | `:AS` | Edit in split |
48 | `:AV` | Edit in vsplit |
49 | `:AT` | Edit in tab |
50 |---------|-------------|
51 | `:AD` | Replace with template |
52 |---------|-------------|
53 | `:Cd` | cd to root |
54 | `:Cd {path}` | cd to path in root |
55 | `:Lcd` | cd to root using :lcd |
56 |---------|-------------|
57 | `:ProjectDo {cmd}` | run command in root |
58
59 ### Reference
60
61 See [vim-projectionist](https://github.com/tpope/vim-projectionist).