I am new to CudaText, coming from TextMate on Mac.
In TextMate when I save a file I can run a shell command which can optionally replace the contents of the current file.
This is useful for code formatting and automatically adding code where needed e.g. Go Imports can be automatically added.
I have had a look at 'runners' and 'formatters' but I can't seem to get a formatter for Go working.
Can anyone point me in the right direction?
Thanks
Format Go files on saving
-
- Posts: 2323
- Joined: 25.08.2021 18:15
The CudaFormatter plugin + its formatters.
https://wiki.freepascal.org/CudaText_pl ... aFormatter
Call menu item "Options/ Settings-plugins/ CudaFormatter/ Configure on_save".
You tried the formatter for Go? I don't see the formatters for Go in addons-manager, so what did you try? tells us by steps. where did you get the formatter?
https://wiki.freepascal.org/CudaText_pl ... aFormatter
Call menu item "Options/ Settings-plugins/ CudaFormatter/ Configure on_save".
You tried the formatter for Go? I don't see the formatters for Go in addons-manager, so what did you try? tells us by steps. where did you get the formatter?
-
- Posts: 2323
- Joined: 25.08.2021 18:15
-
- Posts: 2323
- Joined: 25.08.2021 18:15
Updated the formatter-package.
Supported the following formatters from this list:
https://github.com/life4/awesome-go-code-formatters
They all must be found in PATH.
- gofmt
- goimports
- goreturns
you can tell which formatters you need and miss.
Supported the following formatters from this list:
https://github.com/life4/awesome-go-code-formatters
They all must be found in PATH.
- gofmt
- goimports
- goreturns
you can tell which formatters you need and miss.