-
-
Notifications
You must be signed in to change notification settings - Fork 6k
runtime: Remove 'formatprg' from ftplugins #19108
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
base: master
Are you sure you want to change the base?
Conversation
Effective use of 'formatprg' requires both an understanding of the specific capabilities of the formatting tool and Vim's formatting commands. This is overly burdensome for some users. Rather than address each complaint on a filetype by filetype basis, remove 'formatprg' settings from all ftplugins. It is expected that formatter plugins will be available in the near future as a better solution. See vim#17145 (Add "formatter" feature using "compiler" as a template). See: vim#18650 (rust.vim: stop setting formatprg to rustfmt) Signed-off-by: Doug Kearns <[email protected]>
866647e to
f0aad7f
Compare
|
Racket: I'm willing to accept this change in Vim's default ftplugins, but I'll probably keep it upstream for now. When the newer mechanism is available, I'll convert. That said, is #17145 still moving? |
Those who prefer predictable behavior use |
|
While I think that Vim shouldn't have to chase the ecosystem (development tools) of every language, hence Vim shouldn't set formatprg by default for any languages without one yet, wouldn't this PR be a breaking change? People already familiar with formatprg of those filetypes will suddenly be presented with something as dumb as |
|
This PR is simply following through on the decision already made in the referenced PR (see #18650 (rust.vim: stop setting formatprg to rustfmt)). |
|
I agree with this approach in principle. However to not surprise users too much, let's merge this after the release. |
|
For what it's worth @ychin 's proposition of an opt-in in #18650
is in-line with existing (inofficial) standards such as |
The ftplugins for go and gleam are adding the setting with this release like rust. So, it would be a good idea not to add it only to remove it in the future. The awk ftplugin has also generated complaints. I'm willing to bet lprolog and modula3 aren't getting too much use and the formatter for the latter is quirky enough that anyone using it probably knows what they're doing. racket is probably the only one likely to cause surprise if it's removed. I'm not sure what difference it makes if users are surprised this release or the next, other than pushing the complaints out into the murky future. :) |
|
Okay fair fine then |
|
On 2026-01-08, Enno (Vim Github Repository) wrote:
Those who prefer predictable behavior use gw instead, which is almost always
what was intended when gq is used. The latter is likely just better known as it
came first. Without formatprg/expr, what's the value provided by gq over gw ?
So I'd rather argue for the opposite coupled with a recommendation of gw
No, gw is not a good replacement for gq because of the way that the
cursor is handled.
A value of gq over gw is that gqj can be executed repeatedly over
a range of lines to reformat them because after each operation, the
cursor is well-positioned for the next operation. That is not true
for gw.
Regards,
Gary
|
|
Not sure if I follow all the details, but what about adding a guard |
Effective use of 'formatprg' requires both an understanding of the
specific capabilities of the formatting tool and Vim's formatting
commands. This is overly burdensome for some users.
Rather than address each complaint on a filetype by filetype basis,
remove 'formatprg' settings from all ftplugins.
It is expected that formatter plugins will be available in the near
future as a better solution. See #17145 (Add "formatter" feature using
"compiler" as a template).
See: #18650 (rust.vim: stop setting formatprg to rustfmt)