diff --git a/README.md b/README.md index 2524210..a53db1b 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,42 @@ - packer.nvim ```lua -use({ "BYT0723/goctl.nvim", run = ":GoctlUpgrade" }) +use({ "BYT0723/goctl.nvim", run = ":GoctlUpgrade", requires = {"MunifTanjim/nui.nvim"} }) + +-- recommend +use("rcarriga/nvim-notify") +``` + +## Init + +```lua +require("goctl").setup() ``` ## Features +- Validate + +> goctl valid when vim event "BufRead", "TextChanged", "TextChangedI". + +- Format + +use command `GoctlApiFormat` or lua + +```lua +-- format when write file +vim.api.nvim_command("au BufWritePre *.api lua require('goctl.api').format()") +``` + +- ApiMenu +use command `GoctlApi` or lua + +```lua +require("goctl.api").menu() +``` + +## Preview +
Code Diagnostic @@ -22,6 +53,20 @@ use({ "BYT0723/goctl.nvim", run = ":GoctlUpgrade" })
+
+ Api + +
+ +
+ ApiNew + +
+
+ ApiGenerate + +
+ ## Other > plugin is being developed. We look forward to your participation and suggestions diff --git a/images/goctl_api_generate.jpg b/images/goctl_api_generate.jpg new file mode 100644 index 0000000..cbecd92 Binary files /dev/null and b/images/goctl_api_generate.jpg differ diff --git a/images/goctl_api_menu.jpg b/images/goctl_api_menu.jpg new file mode 100644 index 0000000..c265c57 Binary files /dev/null and b/images/goctl_api_menu.jpg differ diff --git a/images/goctl_api_new.jpg b/images/goctl_api_new.jpg new file mode 100644 index 0000000..fd5ba97 Binary files /dev/null and b/images/goctl_api_new.jpg differ diff --git a/lua/goctl/api.lua b/lua/goctl/api.lua index 3a53292..678d60b 100644 --- a/lua/goctl/api.lua +++ b/lua/goctl/api.lua @@ -91,7 +91,7 @@ function M.new() job:new(cmd) end - input:new("Path", "greet", on_submit):display() + input:new("New Service", "greet", on_submit):display() end function M.doc() @@ -170,10 +170,10 @@ function M.generate() local type_submit = function(item) table.insert(cmd, item.id) type = item.id - input:new("Path", util.filename_ex_suffix(), dir_submit):display() + input:new("Dir", util.filename_ex_suffix(), dir_submit):display() end - menu:new("Api Generate", { + menu:new("Service Language", { { text = "Golang", id = "go" }, { text = "Typescript", id = "ts" }, { text = "Dart", id = "dart" },