OSDN Git Service

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