19 files changed,
204 insertions(+),
2 deletions(-)
Author:
Oleksandr Smirnov
ss2316544@gmail.com
Committed by:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2025-08-30 16:59:50 +0300
Change ID:
psypmpxmsyupsqzttwkwkxxqumyxowmm
Parent:
c0951c4
jump to
M
CONTRIBUTING.md
@@ -25,11 +25,15 @@ ```
### Documentation Here we're using [mini.doc](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-doc.md) -for generating help files based on [LuaCats](https://luals.github.io/wiki/annotations/) annotations in comments. +for generating vimhelp files based on [LuaCats](https://luals.github.io/wiki/annotations/) annotations in comments. + +For demo gifs in [readme](./README.md) we're using [vhs](https://github.com/charmbracelet/vhs). +All files related to demos live in [/vhs](./vhs) dir. You can generate docs with: ```bash -task docgen +task docgen # generates vimhelp +task vhs:generate # generates demo gifs ``` ### Commit messages
M
README.md
@@ -99,6 +99,8 @@ <summary>
<b>Add and remove tags for structs via <a href="https://github.com/fatih/gomodifytags">gomodifytags</a></b> </summary> +  + By default `json` tag will be added/removed, if not set: ```vim@@ -176,6 +178,8 @@ <summary>
<b>Interface implementation via <a href="https://github.com/josharian/impl">impl<a></b> </summary> +  + Syntax of the command: ```vim :GoImpl [receiver] [interface]@@ -199,6 +203,8 @@ <summary>
<b>Generate boilerplate for doc comments</b> </summary> +  + First set a cursor on **public** package/function/interface/struct and execute: ```vim@@ -211,6 +217,8 @@ <details>
<summary> <b>Generate <code>if err != nil {</code> via <a href="https://github.com/koron/iferr">iferr</a></b> </summary> + +  Set the cursor on the line with `err` and execute
M
Taskfile.yml
@@ -1,4 +1,10 @@
version: "3" + +includes: + vhs: + taskfile: ./vhs/Taskfile.yml + dir: ./vhs + tasks: lint: cmds:
M
scripts/minimal_init.lua
@@ -23,6 +23,7 @@
install_plug "nvim-lua/plenary.nvim" install_plug "nvim-treesitter/nvim-treesitter" install_plug "echasnovski/mini.doc" -- used for docs generation +install_plug "folke/tokyonight.nvim" -- theme for generating demos install_plug "echasnovski/mini.test" vim.env.XDG_CONFIG_HOME = root ".tests/config"@@ -32,6 +33,8 @@ vim.env.XDG_CACHE_HOME = root ".tests/cache"
vim.opt.runtimepath:append(root()) vim.opt.packpath:append(root ".tests/site") +vim.o.swapfile = false +vim.o.writebackup = false vim.notify = vim.print -- install go treesitter parse@@ -51,6 +54,13 @@ return vim.fn.globpath("spec", "**/*_test.lua", true, true)
end, }, } +end + +-- set colorscheme only when running ui +if #vim.api.nvim_list_uis() == 1 then + vim.cmd.colorscheme "tokyonight-night" + vim.o.cursorline = true + vim.o.number = true end -- needed for tests, i dont know the reason why, but on start
A
vhs/Taskfile.yml
@@ -0,0 +1,20 @@
+version: "3" +tasks: + generate: + deps: + - comment + - iferr + - tags + - impl + + comment: + cmd: vhs comment.tape + + iferr: + cmd: vhs iferr.tape + + tags: + cmd: vhs tags.tape + + impl: + cmd: vhs impl.tape
A
vhs/comment.go
@@ -0,0 +1,7 @@
+package demos + +func doSomethingImportant() {} + +type User struct{} + +type DataProvider interface{}
A
vhs/comment.tape
@@ -0,0 +1,34 @@
+Output comment.gif +Require nvim + +Set FontFamily "JetBrains Mono" +Set Height 800 +Set Width 1500 +Set Padding 20 +Set Shell "bash" +Set Theme "tokyonight" +Set TypingSpeed 250ms + +Hide +Type@0ms "alias nvim='./nvim.sh'" Enter +Type@0ms "clear" Enter +Show + +Type "nvim comment.go" Sleep 150ms Enter + +# package +Type ":GoCmt" Enter Sleep 500ms Escape Sleep 700ms + +# func +Type "3j" +Type ":GoCmt" Enter Sleep 500ms Escape Sleep 700ms + +# struct +Type "3j" +Type ":GoCmt" Enter Sleep 500ms Escape Sleep 700ms + +# interface +Type "3j" +Type ":GoCmt" Enter Sleep 500ms Escape Sleep 700ms + +Sleep 5s
A
vhs/iferr.go
@@ -0,0 +1,11 @@
+package demos + +func ifErr() { + out, err := doSomething() + + _ = out +} + +func doSomething() (string, error) { + return "", nil +}
A
vhs/iferr.tape
@@ -0,0 +1,23 @@
+Output iferr.gif +Require nvim +Require iferr + +Set FontFamily "JetBrains Mono" +Set Height 800 +Set Width 1500 +Set Padding 20 +Set Shell "bash" +Set Theme "tokyonight" +Set TypingSpeed 250ms + +Hide +Type@0ms "alias nvim='./nvim.sh'" Enter +Type@0ms "clear" Enter +Show + +Type "nvim iferr.go" Sleep 150ms Enter + +Type "3j" +Type ":GoIfErr" Sleep 500ms Enter + +Sleep 5s
A
vhs/impl.tape
@@ -0,0 +1,23 @@
+Output impl.gif +Require nvim +Require iferr + +Set FontFamily "JetBrains Mono" +Set Height 800 +Set Width 1500 +Set Padding 20 +Set Shell "bash" +Set Theme "tokyonight" +Set TypingSpeed 250ms + +Hide +Type@0ms "alias nvim='./nvim.sh'" Enter +Type@0ms "clear" Enter +Show + +Type "nvim impl.go" Sleep 150ms Enter + +Type "2j" +Type ":GoImpl io.Reader" Sleep 500ms Enter + +Sleep 5s