diff --git a/7.-Contoh-Custom-Plugins.md b/7.-Contoh-Custom-Plugins.md index 6c6e35c..83e4bb9 100644 --- a/7.-Contoh-Custom-Plugins.md +++ b/7.-Contoh-Custom-Plugins.md @@ -1483,4 +1483,54 @@ return { } ``` Sumber :
-https://github.com/nvim-treesitter/nvim-treesitter-context \ No newline at end of file +https://github.com/nvim-treesitter/nvim-treesitter-context + +# Golang Setupe +- install treesitter +``` +:TSInstall go gomod +``` +- Mason Install +``` +:MasonInstall gopls golangci-lint-langserver delve goimports gofumpt gomodifytags gotests impl go-debug-adapter +``` +- but file lua/plugin/golang.lua +```lua +return { + { + "olexsmir/gopher.nvim", + config = function() + require("gopher").setup({ + commands = { + go = "go", + gomodifytags = "gomodifytags", + gotests = "gotests", + impl = "impl", + iferr = "iferr", + }, + }) + end, + }, + { + "leoluz/nvim-dap-go", + config = function() + require("dap-go").setup() + end, + }, +} +``` +- Register LSP pada file lua/custom/default.lua +```lua +vim.g.pcode_register_lsp = { + "gopls", +} +``` +- Config code runner lua/custom/default.lua +```lua +vim.g.pcode_coderunner = { + go = "go run $fileName", +} +``` +summer :
+https://github.com/olexsmir/gopher.nvim
+https://github.com/leoluz/nvim-dap-go