-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable built-in formatting for zig #28878
Comments
It seems that this only documented in the README of https://github.com/ziglang/zig.vim |
@zeertzjq it is absolutely not clear that you have to look in a readme of some third-party repo for a solution to the issue. If this behavior is to be kept, it should at least be added as a |
There seems to be some ongoing effort:
But it's not clear where it is going. |
@zeertzjq the ziglang/zig.vim#51 issue was closed due to not enough interest, but since then, many people have commented on it saying that this behavior is annoying. I think even if this change won't be made in upstream zig.vim, it should be made in Neovim to have better defaults. |
I also stumbled upon this behavior and I support opinion that this should not be on by default. In fact if you’ll look at zig_fmt_autosave in other Vim/Neovim distributions, dotfiles and so on — you’ll see that everybody is aware of this thing |
We do not maintain these files; please contact the maintainer listed at the top of the file and propose the change; if there is no response, you may raise an issue at vim/vim directly. If they make the change, we will port it; otherwise not. |
@clason why can't nvim change ftplugins independently of vim? Is that for compatibility reasons? |
Yes (and to make sure that any improvements benefit both projects). This is an ironclad project policy. |
I've opened a PR with Vim to change the default vim/vim#14820. |
@gpanders perhaps you could continue the work in the existing PR? It is a full refactor of the zig ftplugin, so I think it'd be better to merge that, seems like the only thing it misses is documentation for one variable. |
@clason vim merged the PR with the fix. Will it be downstreamed into nvim automatically? |
Problem
By default, nvim's Zig ftplugin will format zig files on save:
neovim/runtime/ftplugin/zig.vim
Line 61 in 666911b
This is very confusing, since this behavior is not documented anywhere, and users expect nvim not to format anything unless they configure it to do so.
Steps to reproduce
Have
zig
installednvim --clean test.zig
Save the file and it will be automatically formatted
Expected behavior
Nvim should not do any automatic formatting by default which requires an undocumented global variable to disable.
At least the default value should be changed to
0
to disable this setting by default.Neovim version (nvim -v)
NVIM v0.11.0-dev+18-g63e3a63d2
Vim (not Nvim) behaves the same?
Yes, vim 9.1
Operating system/version
Fedora Silverblue 40
Terminal name/version
Wezterm
$TERM environment variable
xterm-256color
Installation
Occurs with any installation method
The text was updated successfully, but these errors were encountered: