From: Aaron Jacobs Date: Tue, 9 Dec 2025 11:43:39 +0000 (+0100) Subject: runtime(rust): use textwidth=100 for the Rust recommended style X-Git-Tag: v9.1.1963~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98ef8433b654ee96c57b66348b767edc73a44406;p=thirdparty%2Fvim.git runtime(rust): use textwidth=100 for the Rust recommended style The help text here said 99 was the recommended style for the standard library, but I can't find a citation for this anywhere. In contrast the Rust Style Guide hosted on rust-lang.org [says](https://doc.rust-lang.org/stable/style-guide/#indentation-and-line-width) the maximum line width is 100, and rustfmt [agrees](https://github.com/rust-lang/rust/blob/37aa2135b5d0936bd13aa699d941aaa94fbaa645/src/tools/rustfmt/src/config/options.rs#L570). Having the two disagree causes an annoying off-by-one error in vim: if you configure vim to highlight too-long lines then it will occasionally complain about a line that rustfmt refuses to fix. closes: #18892 Signed-off-by: Aaron Jacobs Signed-off-by: Christian Brabandt --- diff --git a/runtime/doc/ft_rust.txt b/runtime/doc/ft_rust.txt index 4f4e3a85e7..b1789b8141 100644 --- a/runtime/doc/ft_rust.txt +++ b/runtime/doc/ft_rust.txt @@ -60,8 +60,8 @@ g:rust_conceal_pub~ *g:rust_recommended_style* g:rust_recommended_style~ Set this option to enable vim indentation and textwidth settings to - conform to style conventions of the rust standard library (i.e. use 4 - spaces for indents and sets 'textwidth' to 99). This option is enabled + conform to style conventions of the Rust style guide (i.e. use 4 + spaces for indents and set 'textwidth' to 100). This option is enabled by default. To disable it: > let g:rust_recommended_style = 0 < diff --git a/runtime/ftplugin/rust.vim b/runtime/ftplugin/rust.vim index 3e2741f919..4765f81704 100644 --- a/runtime/ftplugin/rust.vim +++ b/runtime/ftplugin/rust.vim @@ -3,6 +3,7 @@ " Maintainer: Chris Morgan " Last Change: 2024 Mar 17 " 2024 May 23 by Riley Bruins