2015-11-13 00:58:37 +00:00
|
|
|
---
|
|
|
|
title: Projectionist
|
2015-11-24 05:06:06 +00:00
|
|
|
category: Vim
|
2015-11-13 00:58:37 +00:00
|
|
|
---
|
|
|
|
|
2023-03-14 04:40:29 +00:00
|
|
|
### Basic usage
|
2015-11-13 00:58:37 +00:00
|
|
|
|
|
|
|
```json
|
|
|
|
/* .projectionist.vim */
|
|
|
|
{
|
|
|
|
"app/assets/react/components/*.jsx": {
|
|
|
|
"type": "component",
|
|
|
|
"template": [
|
|
|
|
"import React from 'react'",
|
|
|
|
"export default {} = React.createClass({ ... })"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2023-03-14 04:40:29 +00:00
|
|
|
### Available options
|
2015-11-13 00:58:37 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
{
|
|
|
|
"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 */
|
|
|
|
}
|
|
|
|
}
|
2015-11-13 03:26:03 +00:00
|
|
|
```
|
2015-11-13 00:58:37 +00:00
|
|
|
|
2023-03-14 04:40:29 +00:00
|
|
|
### Commands
|
2015-11-13 00:58:37 +00:00
|
|
|
|
|
|
|
| Command | Description |
|
|
|
|
|---------|-------------|
|
|
|
|
| `:A` | Edit alternate |
|
|
|
|
| `:A {file}` | Edit file |
|
|
|
|
|---------|-------------|
|
|
|
|
| `:AS` | Edit in split |
|
|
|
|
| `:AV` | Edit in vsplit |
|
|
|
|
| `:AT` | Edit in tab |
|
|
|
|
|---------|-------------|
|
|
|
|
| `:AD` | Replace with template |
|
|
|
|
|---------|-------------|
|
|
|
|
| `:Cd` | cd to root |
|
|
|
|
| `:Cd {path}` | cd to path in root |
|
|
|
|
| `:Lcd` | cd to root using :lcd |
|
|
|
|
|---------|-------------|
|
|
|
|
| `:ProjectDo {cmd}` | run command in root |
|
|
|
|
|
2023-03-14 04:40:29 +00:00
|
|
|
### Reference
|
2015-11-13 00:58:37 +00:00
|
|
|
|
|
|
|
See [vim-projectionist](https://github.com/tpope/vim-projectionist).
|