Formatting #75
joachimschmidt557
started this conversation in
Polls
Replies: 1 comment
-
I will go forward with merging the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my opinion, the current state of formatting is not great. I want to gather some community input on how and whether to transition to something else.
The status quo
Right now, we use
zig fmt <file.zig>
on the file on disk and revert the buffer to the formatted file. This approach, whilst simple, has two major problems:revert-buffer
leads to all sorts of problems Format on save makes the cursor jump randomly #73 zig-mode changes my font size #61 lsp-mode is turned off for buffer on buffer save #49, a lot of which would be solved by Restore minor-mode-list across revert-buffer Calls in zig-format-buffer #71.reformatter
reformatter is an emacs package which provides formatting support to some major mode packages. The formatting procedure works by passing the buffer contents as stdin to the formatting program and reading the formatted code via stdout.
zig fmt
supports this. If you want to try this approach, a branch and a PR for this already exists: #51Remove formatting
We could also remove formatting altogether and direct users towards packages such as https://github.com/lassik/emacs-format-all-the-code.
Other
If you have other suggestions, feel free to leave a post in this discussion!
5 votes ·
Beta Was this translation helpful? Give feedback.
All reactions