-
Notifications
You must be signed in to change notification settings - Fork 1
/
vim-bob.txt
228 lines (194 loc) · 10.6 KB
/
vim-bob.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
*vim-bob* Plugin for working in a Bob environment
Author: Thomas Fehér
URL: https://github.com/ThomasFeher/vim-bob
==============================================================================
Workflow *vim-bob-workflow*
The usual workflow is as follows:
* Change directory into the recipe repository.
* Start vim.
* Run |:BobInit| to initialize vim-bob.
* Run |:BobProject| to define the project to work on. This will build the
current state of the project and setup configuration for the YouCompleteMe
plugin.
* Use |:BobGoto| to set the working path to the root directory of the
specified package.
* Start editing files of that package.
* Run |:make| to rebuild the project.
* Alternatively to |:BobGoto| use |:BobOpen| to open a file from a certain
package directly.
|:BobProject| automatically marks files in `dev/build/` and `dev/dist` as
|readonly|, because these files will be overwritten by Bob during a build and
it is easy to confuse them with equally named files in `dev/src/`. For example
build error messages could refer to header files of depending modules and
therefore jumping to the error jumps into `dev/dist/`. Rebuilding the project
after fixing an error in such a file would then overwrite the file and all
changes would be lost.
However, there is currently no way to remove this behaviour via vim-bobs API.
If necessary, this behaviour can be removed manually by deleting |augroup|
`vim_bob_readonly_dist` via `:augroup! vim_bob_readonly_dist` .
==============================================================================
Commands *vim-bob-commands*
*vim-bob:BobInit*
:BobInit [dir]
Must be run before any other vim-bob command can be used. Initializes
vim-bob with [dir] or the current working directory, respectively, as
the base directory.
The base directory is the directory where the bob commands are
normally executed on the command line.
*vim-bob:BobCheckout*
:BobCheckout [package]
Checkout the given [package].
Runs "bob dev [package] --checkout-only".
*vim-bob:BobGoto*
:BobGoto [package]
Changes the current working directory of the window (using |lcd|) to
be the source directory of the given [package].
Provided for auto-completion:
* dependencies of current project exclusively
* non-root recipes
:BobGoto! [package]
Like ":BobGoto" but sets the current working directory globally
(using |cd|).
*vim-bob:BobGotoAll*
:BobGotoAll [package]
Changes the current working directory of the window (using |lcd|) to
be the source directory of the given [package].
Provides all available root recipes for auto-completion.
:BobGotoAll! [package]
Like ":BobGotoAll" but sets the current working directory globally
(using |cd|).
*vim-bob:BobOpen*
:BobOpen [package]
Open a file selector window where alle files of [package] are
provided. The selected file will be opened.
Requires one of the supported file selection backends (fzf.vim and
telescope.nvim) to be installed.
If no package is provided the path of the recipe repository is used
as search path for the file selector. In case the default FZF command
for search is used (`find`) this can be very much files including all
the files the `dev` and `work` folder. In order to prevent this use a
different search tool like `fd` or `ripgrep` or adjust the options of
`find` accordingly setting the environment variable
`FZF_DEFAULT_COMMAND`.
Examples for using `fd` as search command for FZF:
using shell: `export FZF_DEFAULT_COMMAND="fd --type f "`
using init.vim: `let $FZF_DEFAULT_COMMAND = "fd --type f "`
*vim-bob:BobDev*
:BobDev ([package] ([configuration] ([parameters])))
Build [package] with [configuration] in development mode.
Runs "bob dev [package] -c <configuration-dir>/[configuration]
[parameters]"
When called with no arguments the package, configuration and
parameters are built that were specified with the last call of
|:BobProject|.
Additionally sets |makeprg| for the current file, so that
subsequently the same command can be run via |:make| and error
messages are parsed and gathered in the |quickfix| window.
*vim-bob:BobProject*
:BobProject [package] ([configuration] ([parameters]))
Same as |BobDev| but additionally sets the current project to that
package. That means that |:BobGoto| will provide only dependencies of
that package for auto-completion, but opposing to |:BobGotoAll| it
will also provide non-root recipes.
Additionaly a ".ycm_extra_conf.py" file is generated that loads the
compilation database from the build. This allows conveniently using
|YouCompleteMe| in a Bob environment. It is necessary to configure
the build system to generate a "compile_commands.json" file in the
build directory. CMake will do this if called with
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON".
Additionally the Bob command that is executed is appended to
`.vim-bob_project.log` which allows to recreate the project in later
sessions.
Additionally autocmds are created that set the working directory of
the window to the root directory of the source directory
(the directory `workspace` in `dev/src`) of the current file.
*vim-bob:BobProjectNoBuild*
:BobProjectNoBuild [package] ([configuration] ([parameters]))
Same as |BobProject| but does not trigger a build. Instead, it
assumes that all build artifacts are already existing.
This is useful if one does not want to trigger any changes to the
local state that might be caused by the build, i.e., checking out
later versions or moving changes to attic, etc.
*vim-bob:BobClean*
:BobClean
Deletes `dev/build` and `dev/dist` directories to force rebuilding of
all artifacts.
*vim-bob:BobGraph*
:BobGraph
Generates dependency graph for the current project.
Requires that |BobProject| has been called beforehand.
|g:bob_graph_type| controls the output format.
*vim-bob:BobPersist*
:BobPersist
Persist the current state into the recipes.
This is done by adding comments at the first line of each recipe file
that needs to be changed in order to persist the current state of the
project.
The comments should give useful information on what needs to be
changed.
The actual changes have to be done manually.
*vim-bob:BobSearch*
:BobSearchSource [pattern]
Search [pattern] in all source directories that belong to the current
project.
Needs `fzf` and `ripgrep` to be installed.
The results are displayed by `fzf` in a floating window with the file
content right of the file name.
The preview window is disabled but can be toggled using `?`.
This mode is intended for getting an overview of search results.
:BobSearchSource! [pattern]
Similar to |:BobSearchSource| but the floating window uses the
complete vim window, the content of the files is displayed above the
file names and the preview window is enabled.
This mode is to see maximum amount of context of the search results.
*vim-bob:BobStatus*
:BobStatus [package]
Run `bob status` on [package] or on the current project if no
[package] is provided.
*vim-bob:BobInspect*
:BobInspect
Print internal state of the vim-bob plugin. Used mainly for debugging.
==============================================================================
Configuration *vim-bob-configuration*
g:bob_config_path
Path to configuration files (with file extension ".yaml") relative to
the base path.
g:bob_reduce_goto_list
Default: 1
The list of possible packages for |:BobGoto| is reduced to show only
the leaf package instead of the complete tree from the project root
package. As this could result in duplicates when different packages
depend on the same package, these duplicate entries are removed as
well. This is only performed if the source directory for all variants
are equal, otherwise the variants will remain with their full package
path.
This reduces the number of elements and also their size
significantly, which eases finding the correct one during command
completion.
g:bob_graph_type
Default: "d3"
Output format of |BobGraph|, must be one of "d3" or "dot".
g:bob_auto_complete_items
List of additional parameters for `BobDev` and `BobProject` used for
auto-completion.
example: `['-DBUILD_TYPE=Release', '-DBUILD_TYPE=Debug']`
g:bob_verbose
Default: 0
If set to 1 additional messages are printed. This is mainly for
debugging.
g:bob_prefix *g:bob_prefix*
Default: ''
This string will be prepended (separated by a space character) to
each invocation of the `bob` command.
This allows for example to run Bob inside of a container by setting
the string to `docker run --rm -i -v ${PWD}:/build my_container` .
==============================================================================
Interaction with other plugins *vim-bob-interaction*
CtrlP
Per default |CtrlP| will search the repository structure of the current
file.
In order to have all files of the current project (all files in `dev/`)
available to the search it is necessary to set an additional root
marker like "recipes", which should exist for sure.
This is achived via `let g:ctrlp_root_markers = ['recipes']` .
vim:tw=78:et:ft=help:norl: