Format your Go files alphabetically.
-- with lazy
{ "td0m/go-order.nvim", opts = {} }
-- with packer
{
"td0m/go-order.nvim",
config = function()
require("go-order").setup()
end
}
Open any .go
file and run :GoOrder
.
- Sort by declaration type
(const, var, type, method, function)
- Sort functions and methods alphabetically (with public ones first)
- Sort constants and variables alphabetically
- Sort struct fields alphabetically