Skip to content

Commit 9e8b24f

Browse files
committed
update directions on config file
1 parent 2db70d6 commit 9e8b24f

File tree

3 files changed

+65
-58
lines changed

3 files changed

+65
-58
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ A CLI tool built to automate [vim-plug](https://github.com/junegunn/vim-plug) us
1515

1616
`npm i -g @wallerbuilt/vaq`
1717

18+
### Setting up with vim-plug
19+
20+
_IF_ your vim-plug plugin list is in a separate file from your vim config file, make sure to set the config path to that file instead.
21+
Basically, vaq needs to have access to your `Plug` list in order to make the updates needed.
22+
23+
When first using the cli tool it will ask you for this path and keep it stored for future use.
24+
1825
### Use
1926

2027
`vaq`

lib/prompts.js

+57-57
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,106 @@
1-
const inquirer = require('inquirer')
2-
const { emojify } = require('node-emoji')
3-
const { getConfigPlugins } = require('./files')
4-
const { getPlugNameFromConfig } = require('./helpers')
1+
const inquirer = require("inquirer");
2+
const { emojify } = require("node-emoji");
3+
const { getConfigPlugins } = require("./files");
4+
const { getPlugNameFromConfig } = require("./helpers");
55

66
const askForVimInfo = () => {
77
const questions = [
88
{
9-
name: 'vimpath',
10-
type: 'input',
9+
name: "vimpath",
10+
type: "input",
1111
message:
12-
'Path to your vim config file using vim-plug relative to user directory. Example: .config/nvim/init.vim)?',
12+
"Path to your vim config file using vim-plug relative to user directory. Example: .config/nvim/init.vim)?\nIf your vim-plug block including your plugins is in a separate file, please use the path to that file instead.",
1313
validate: (val) => {
1414
if (val.length) {
15-
return true
15+
return true;
1616
} else {
17-
return 'Please enter a path to your vim config file'
17+
return "Please enter a path to your vim config file or the file that holds your vim-plug Plug declarations.";
1818
}
19-
}
19+
},
2020
},
2121
{
22-
name: 'vimtype',
23-
type: 'list',
24-
message: 'Are you using neovim (nvim) or vim?',
25-
choices: ['nvim', 'vim'],
26-
default: 'vim'
27-
}
28-
]
22+
name: "vimtype",
23+
type: "list",
24+
message: "Are you using neovim (nvim) or vim?",
25+
choices: ["nvim", "vim"],
26+
default: "vim",
27+
},
28+
];
2929

30-
return inquirer.prompt(questions)
31-
}
30+
return inquirer.prompt(questions);
31+
};
3232

3333
const askForQuery = () =>
3434
inquirer.prompt([
3535
{
36-
name: 'query',
37-
type: 'input',
38-
message: 'query',
36+
name: "query",
37+
type: "input",
38+
message: "query",
3939
validate: (val) => {
4040
if (val.length === 0) {
41-
return 'Must supply a name'
41+
return "Must supply a name";
4242
} else {
43-
return true
43+
return true;
4444
}
45-
}
46-
}
47-
])
45+
},
46+
},
47+
]);
4848

4949
const askPluginSelection = (plugins) =>
5050
inquirer.prompt([
5151
{
52-
name: 'selection',
53-
type: 'list',
52+
name: "selection",
53+
type: "list",
5454
choices: plugins.map((p) => ({
5555
name: `${p.name} - ${emojify(p.short_desc)}`,
5656
value: p,
57-
short: `${p.name} - ${emojify(p.short_desc)}`
58-
}))
57+
short: `${p.name} - ${emojify(p.short_desc)}`,
58+
})),
5959
},
6060
{
61-
name: 'action',
62-
type: 'list',
63-
choices: ['info', 'install', 'back', 'exit'],
64-
default: 'info'
65-
}
66-
])
61+
name: "action",
62+
type: "list",
63+
choices: ["info", "install", "back", "exit"],
64+
default: "info",
65+
},
66+
]);
6767

6868
const installedPluginsList = async () => {
69-
const installed = await getConfigPlugins()
69+
const installed = await getConfigPlugins();
7070

7171
return inquirer.prompt([
7272
{
73-
name: 'plugin',
74-
type: 'list',
73+
name: "plugin",
74+
type: "list",
7575
choices: installed.map((p) => {
7676
return {
7777
name: getPlugNameFromConfig(p),
78-
value: p
79-
}
80-
})
78+
value: p,
79+
};
80+
}),
8181
},
8282
{
83-
name: 'action',
84-
type: 'list',
85-
choices: ['info', 'uninstall', 'back', 'exit']
86-
}
87-
])
88-
}
83+
name: "action",
84+
type: "list",
85+
choices: ["info", "uninstall", "back", "exit"],
86+
},
87+
]);
88+
};
8989

9090
const menuSelection = () =>
9191
inquirer.prompt([
9292
{
93-
name: 'command',
94-
type: 'list',
95-
choices: ['query', 'list', 'update', 'exit'],
96-
default: 'query'
97-
}
98-
])
93+
name: "command",
94+
type: "list",
95+
choices: ["query", "list", "update", "exit"],
96+
default: "query",
97+
},
98+
]);
9999

100100
module.exports = {
101101
askForVimInfo,
102102
askForQuery,
103103
askPluginSelection,
104104
installedPluginsList,
105-
menuSelection
106-
}
105+
menuSelection,
106+
};

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wallerbuilt/vaq",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "A cli for managing vim plugins through vim-plug",
55
"main": "index.js",
66
"private": false,

0 commit comments

Comments
 (0)