+6
-2
CONTRIBUTING.md
+6
-2
CONTRIBUTING.md
···
25
25
26
26
### Documentation
27
27
Here we're using [mini.doc](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-doc.md)
28
-
for generating help files based on [LuaCats](https://luals.github.io/wiki/annotations/) annotations in comments.
28
+
for generating vimhelp files based on [LuaCats](https://luals.github.io/wiki/annotations/) annotations in comments.
29
+
30
+
For demo gifs in [readme](./README.md) we're using [vhs](https://github.com/charmbracelet/vhs).
31
+
All files related to demos live in [/vhs](./vhs) dir.
29
32
30
33
You can generate docs with:
31
34
```bash
32
-
task docgen
35
+
task docgen # generates vimhelp
36
+
task vhs:generate # generates demo gifs
33
37
```
34
38
35
39
### Commit messages
+8
README.md
+8
README.md
···
99
99
<b>Add and remove tags for structs via <a href="https://github.com/fatih/gomodifytags">gomodifytags</a></b>
100
100
</summary>
101
101
102
+

103
+
102
104
By default `json` tag will be added/removed, if not set:
103
105
104
106
```vim
···
176
178
<b>Interface implementation via <a href="https://github.com/josharian/impl">impl<a></b>
177
179
</summary>
178
180
181
+

182
+
179
183
Syntax of the command:
180
184
```vim
181
185
:GoImpl [receiver] [interface]
···
199
203
<b>Generate boilerplate for doc comments</b>
200
204
</summary>
201
205
206
+

207
+
202
208
First set a cursor on **public** package/function/interface/struct and execute:
203
209
204
210
```vim
···
211
217
<summary>
212
218
<b>Generate <code>if err != nil {</code> via <a href="https://github.com/koron/iferr">iferr</a></b>
213
219
</summary>
220
+
221
+

214
222
215
223
Set the cursor on the line with `err` and execute
216
224
+6
Taskfile.yml
+6
Taskfile.yml
+10
scripts/minimal_init.lua
+10
scripts/minimal_init.lua
···
23
23
install_plug "nvim-lua/plenary.nvim"
24
24
install_plug "nvim-treesitter/nvim-treesitter"
25
25
install_plug "echasnovski/mini.doc" -- used for docs generation
26
+
install_plug "folke/tokyonight.nvim" -- theme for generating demos
26
27
install_plug "echasnovski/mini.test"
27
28
28
29
vim.env.XDG_CONFIG_HOME = root ".tests/config"
···
32
33
33
34
vim.opt.runtimepath:append(root())
34
35
vim.opt.packpath:append(root ".tests/site")
36
+
vim.o.swapfile = false
37
+
vim.o.writebackup = false
35
38
vim.notify = vim.print
36
39
37
40
-- install go treesitter parse
···
51
54
end,
52
55
},
53
56
}
57
+
end
58
+
59
+
-- set colorscheme only when running ui
60
+
if #vim.api.nvim_list_uis() == 1 then
61
+
vim.cmd.colorscheme "tokyonight-night"
62
+
vim.o.cursorline = true
63
+
vim.o.number = true
54
64
end
55
65
56
66
-- needed for tests, i dont know the reason why, but on start
+20
vhs/Taskfile.yml
+20
vhs/Taskfile.yml
vhs/comment.gif
vhs/comment.gif
This is a binary file and will not be displayed.
+7
vhs/comment.go
+7
vhs/comment.go
+34
vhs/comment.tape
+34
vhs/comment.tape
···
1
+
Output comment.gif
2
+
Require nvim
3
+
4
+
Set FontFamily "JetBrains Mono"
5
+
Set Height 800
6
+
Set Width 1500
7
+
Set Padding 20
8
+
Set Shell "bash"
9
+
Set Theme "tokyonight"
10
+
Set TypingSpeed 250ms
11
+
12
+
Hide
13
+
Type@0ms "alias nvim='./nvim.sh'" Enter
14
+
Type@0ms "clear" Enter
15
+
Show
16
+
17
+
Type "nvim comment.go" Sleep 150ms Enter
18
+
19
+
# package
20
+
Type ":GoCmt" Enter Sleep 500ms Escape Sleep 700ms
21
+
22
+
# func
23
+
Type "3j"
24
+
Type ":GoCmt" Enter Sleep 500ms Escape Sleep 700ms
25
+
26
+
# struct
27
+
Type "3j"
28
+
Type ":GoCmt" Enter Sleep 500ms Escape Sleep 700ms
29
+
30
+
# interface
31
+
Type "3j"
32
+
Type ":GoCmt" Enter Sleep 500ms Escape Sleep 700ms
33
+
34
+
Sleep 5s
vhs/iferr.gif
vhs/iferr.gif
This is a binary file and will not be displayed.
+11
vhs/iferr.go
+11
vhs/iferr.go
+23
vhs/iferr.tape
+23
vhs/iferr.tape
···
1
+
Output iferr.gif
2
+
Require nvim
3
+
Require iferr
4
+
5
+
Set FontFamily "JetBrains Mono"
6
+
Set Height 800
7
+
Set Width 1500
8
+
Set Padding 20
9
+
Set Shell "bash"
10
+
Set Theme "tokyonight"
11
+
Set TypingSpeed 250ms
12
+
13
+
Hide
14
+
Type@0ms "alias nvim='./nvim.sh'" Enter
15
+
Type@0ms "clear" Enter
16
+
Show
17
+
18
+
Type "nvim iferr.go" Sleep 150ms Enter
19
+
20
+
Type "3j"
21
+
Type ":GoIfErr" Sleep 500ms Enter
22
+
23
+
Sleep 5s
vhs/impl.gif
vhs/impl.gif
This is a binary file and will not be displayed.
+23
vhs/impl.tape
+23
vhs/impl.tape
···
1
+
Output impl.gif
2
+
Require nvim
3
+
Require iferr
4
+
5
+
Set FontFamily "JetBrains Mono"
6
+
Set Height 800
7
+
Set Width 1500
8
+
Set Padding 20
9
+
Set Shell "bash"
10
+
Set Theme "tokyonight"
11
+
Set TypingSpeed 250ms
12
+
13
+
Hide
14
+
Type@0ms "alias nvim='./nvim.sh'" Enter
15
+
Type@0ms "clear" Enter
16
+
Show
17
+
18
+
Type "nvim impl.go" Sleep 150ms Enter
19
+
20
+
Type "2j"
21
+
Type ":GoImpl io.Reader" Sleep 500ms Enter
22
+
23
+
Sleep 5s