14
14
===============================================================================
15
15
CONTENTS *go-contents*
16
16
17
- 1. Intro........................................| go-intro |
18
- 2. Install......................................| go-install |
19
- 3. Commands.....................................| go-commands |
20
- 4. Mappings.....................................| go-mappings |
21
- 5. Text Objects.................................| go-text-objects |
22
- 6. Settings.....................................| go-settings |
23
- 7. Troubleshooting..............................| go-troubleshooting |
24
- 8. Credits......................................| go-credits |
17
+ 1. Intro........................................| go-intro |
18
+ 2. Install......................................| go-install |
19
+ 3. Commands.....................................| go-commands |
20
+ 4. Mappings.....................................| go-mappings |
21
+ 5. Text Objects.................................| go-text-objects |
22
+ 6. Functions....................................| go-functions |
23
+ 7. Settings.....................................| go-settings |
24
+ 8. Troubleshooting..............................| go-troubleshooting |
25
+ 9. Credits......................................| go-credits |
25
26
26
27
===============================================================================
27
28
INTRO *go-intro*
@@ -65,7 +66,12 @@ easily.
65
66
* Tagbar support to show tags of the source code in a sidebar with `gotags`
66
67
* Custom vim text objects such as `a function` or `inner function`
67
68
* All commands support collecting and displaying errors in Vim's location
68
- list.
69
+ list
70
+ * A async launcher for the go command is implemented for neovim, fully async
71
+ building and testing.
72
+ * Check the status of any async jobs in the statusline with | go#jobcontrol#Statusline() |
73
+ * Integrated with the neovim terminal, launch `:GoRun` and other go commands
74
+ in their own new terminal.
69
75
70
76
===============================================================================
71
77
INSTALL *go-install*
@@ -223,18 +229,25 @@ COMMANDS *go-commands*
223
229
224
230
If [!] is not given the first error is jumped to.
225
231
232
+ If using neovim then `:GoRun` will run in a new terminal according to
233
+ | g:go_term_mode | .
234
+
226
235
*:GoBuild*
227
236
:GoBuild[!] [expand]
228
237
229
- Build your package with `go build`. It automatically builds only the files
230
- that depends on the current file. GoBuild doesn't produce a result file.
238
+ Build your package with `go build`. Errors are populated inside the
239
+ location list. It automatically builds only the files that depends on the
240
+ current file. `:GoBuild` doesn't produce a result file.
231
241
Use 'make' to create a result file.
232
242
233
243
You may optionally pass any valid go build flags/options. For a full list
234
244
please see `go help build`. Options are expanded with 'expand' .
235
245
236
246
If [!] is not given the first error is jumped to.
237
247
248
+ If using neovim then this command is fully async, it does not block the
249
+ UI.
250
+
238
251
*:GoGenerate*
239
252
:GoGenerate[!] [expand]
240
253
@@ -279,6 +292,10 @@ COMMANDS *go-commands*
279
292
280
293
If [!] is not given the first error is jumped to.
281
294
295
+ If using neovim `:GoTest` will run in a new terminal or run asynchronously
296
+ in the background according to | g:go_term_enabled | . You can set the mode of
297
+ the new terminal with | g:go_term_mode | .
298
+
282
299
*:GoTestFunc*
283
300
:GoTestFunc[!] [expand]
284
301
@@ -291,6 +308,10 @@ COMMANDS *go-commands*
291
308
292
309
If [!] is not given the first error is jumped to.
293
310
311
+ If using neovim `:GoTestFunc` will run in a new terminal or run asynchronously
312
+ in the background according to | g:go_term_enabled | . You can set the mode of
313
+ the new terminal with | g:go_term_mode | .
314
+
294
315
*:GoTestCompile*
295
316
:GoTestCompile[!] [expand]
296
317
@@ -302,6 +323,10 @@ COMMANDS *go-commands*
302
323
303
324
If [!] is not given the first error is jumped to.
304
325
326
+ If using neovim `:GoTestCompile` will run in a new terminal or run asynchronously
327
+ in the background according to | g:go_term_enabled | . You can set the mode of
328
+ the new terminal with | g:go_term_mode | .
329
+
305
330
*:GoCoverage*
306
331
:GoCoverage[!] [options]
307
332
@@ -446,8 +471,8 @@ COMMANDS *go-commands*
446
471
:GoOracleTags [tags]
447
472
448
473
Changes the custom | g:go_oracle_tags | setting and overrides it with the
449
- given build tags. This command cooperate with GoReferrers command when
450
- there exist mulitiple build tags in your project,then you can set one
474
+ given build tags. This command cooperate with GoReferrers command when
475
+ there exist mulitiple build tags in your project, then you can set one
451
476
of the build tags for GoReferrers to find more accurate.
452
477
The custom build tags is cleared (unset) if `" " ` is given. If no arguments
453
478
is given it prints the current custom build tags.
@@ -477,6 +502,21 @@ documentation in the |go-commands| section. Available <Plug> keys are:
477
502
478
503
Calls `go run` for the current file
479
504
505
+ *(go-run-tab)*
506
+
507
+ Calls `go run` for the current file in a new terminal tab
508
+ This option is neovim only.
509
+
510
+ *(go-run-split)*
511
+
512
+ Calls `go run` for the current file in a new terminal horizontal split
513
+ This option is neovim only.
514
+
515
+ *(go-run-vertical)*
516
+
517
+ Calls `go run` for the current file in a new terminal vertical split
518
+ This option is neovim only.
519
+
480
520
481
521
*(go-build)*
482
522
@@ -628,6 +668,22 @@ if "inside a function", select contents of a function,
628
668
629
669
630
670
671
+ ===============================================================================
672
+ FUNCTIONS *go-functions*
673
+
674
+ *go#jobcontrol#Statusline()*
675
+
676
+ Shows the status of a job running asynchronously. Can be used to plug into the
677
+ statusline. It works to show the status per package instead of per
678
+ file. Assume you have three files open, all belonging to the same package,
679
+ if the package build (`:GoBuild` ) is successful, all statusline's will be empty
680
+ (means SUCCESS), if you it fails all file's statusline will show FAILED.
681
+
682
+ *go#complete#GetInfo()*
683
+
684
+ Returns the description of the identifer under the cursor. Can be used to plug
685
+ into the statusline. This function is also used for | g:go_auto_type_info | .
686
+
631
687
===============================================================================
632
688
SETTINGS *go-settings*
633
689
@@ -929,6 +985,37 @@ Use this option to auto |:AsmFmt| on save. By default it's enabled. >
929
985
930
986
let g:go_asmfmt_autosave = 1
931
987
<
988
+ *g:go_term_mode*
989
+
990
+ This option is neovim only. Use it to change the default terminal mode of
991
+ go commands that run in a new terminal. The default is vsplit.
992
+ Current options are vsplit, split or tab.
993
+ >
994
+ let g:go_term_mode = "vsplit"
995
+ <
996
+ *g:go_term_height*
997
+ *g:go_term_width*
998
+
999
+ These options are neovim only. Use them to control the height and width of
1000
+ a terminal split. By default these are not set meaning that the height and
1001
+ width are set automatically by neovim. The height only applies with a
1002
+ horizontal split and width only applies to a vertical split.
1003
+
1004
+ For example here is how to set each to 30.
1005
+ >
1006
+ let g:go_term_height = 30
1007
+ let g:go_term_width = 30
1008
+ <
1009
+ *g:go_term_enabled*
1010
+
1011
+ This option is neovim only. Use it to change the behavior of the test
1012
+ commands. If set to 1 it opens the test commands inside a new terminal
1013
+ according to | g:go_term_mode | , otherwise it will run them in the background
1014
+ just like `:GoBuild` and then display the status with | go#jobcontrol#Statusline() | .
1015
+ By default it is disabled.
1016
+ >
1017
+ let g:go_term_enabled = 0
1018
+ <
932
1019
933
1020
===============================================================================
934
1021
TROUBLESHOOTING *go-troubleshooting*
0 commit comments