Home Explore Blog CI



neovim

1st chunk of `runtime/doc/ft_rust.txt`
1d88dd7c83ace8bca1cb9668eec2fcb2d5a7f0bd706304db0000000100000fa4
*ft_rust.txt*      Filetype plugin for Rust

==============================================================================
CONTENTS                                                      *rust*

1. Introduction                                                   |rust-intro|
2. Settings                                                    |rust-settings|
3. Commands                                                    |rust-commands|
4. Mappings                                                    |rust-mappings|

==============================================================================
INTRODUCTION                                                      *rust-intro*

This plugin provides syntax and supporting functionality for the Rust
filetype. It requires Vim 8 or higher for full functionality. Some commands
will not work on earlier versions.

==============================================================================
SETTINGS                                                       *rust-settings*

This plugin has a few variables you can define in your vimrc that change the
behavior of the plugin.

Some variables can be set buffer local (`:b` prefix), and the buffer local
will take precedence over the global `g:` counterpart.

                                                                *g:rustc_path*
g:rustc_path ~
	Set this option to the path to rustc for use in the |:RustRun| and
	|:RustExpand| commands. If unset, `rustc` will be located in $PATH: >vim
	    let g:rustc_path = $HOME."/bin/rustc"
<

                                                  *g:rustc_makeprg_no_percent*
g:rustc_makeprg_no_percent ~
	Set this option to 1 to have 'makeprg' default to `rustc` instead of
	`rustc %`: >vim
	    let g:rustc_makeprg_no_percent = 1
<

                                                              *g:rust_conceal*
g:rust_conceal ~
	Set this option to turn on the basic |conceal| support: >vim
	    let g:rust_conceal = 1
<

                                                     *g:rust_conceal_mod_path*
g:rust_conceal_mod_path ~
	Set this option to turn on |conceal| for the path connecting token
	"::": >vim
	    let g:rust_conceal_mod_path = 1
<

                                                          *g:rust_conceal_pub*
g:rust_conceal_pub ~
	Set this option to turn on |conceal| for the "pub" token: >vim
	    let g:rust_conceal_pub = 1
<

                                                     *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
	by default. To disable it: >vim
	    let g:rust_recommended_style = 0
<

                                                                 *g:rust_fold*
g:rust_fold ~
	Set this option to turn on |folding|: >vim
	    let g:rust_fold = 1
<
	Value		Effect ~
	0		No folding
	1		Braced blocks are folded. All folds are open by
			default.
	2		Braced blocks are folded. 'foldlevel' is left at the
			global value (all folds are closed by default).

						  *g:rust_bang_comment_leader*
g:rust_bang_comment_leader ~
	Set this option to 1 to preserve the leader on multi-line doc comments
	using the `/*!` syntax: >vim
	    let g:rust_bang_comment_leader = 1
<

                                                *g:rust_use_custom_ctags_defs*
g:rust_use_custom_ctags_defs ~
	Set this option to 1 if you have customized ctags definitions for Rust
	and do not wish for those included with rust.vim to be used: >vim
	    let g:rust_use_custom_ctags_defs = 1
<

	NOTE: rust.vim's built-in definitions are only used for the Tagbar Vim
	plugin, if you have it installed, AND if Universal Ctags is not
	detected. This is because Universal Ctags already has built-in
	support for Rust when used with Tagbar.

	Also, note that when using ctags other than Universal Ctags, it is not
	automatically used when

Title: Rust Vim Plugin: Introduction and Settings
Summary
This section of the rust.vim plugin documentation introduces the plugin, its requirements (Vim 8 or higher), and the configurable settings that allow users to customize its behavior. Settings include specifying the path to the Rust compiler, controlling indentation and text width to match Rust style conventions, enabling/disabling code folding and syntax concealing, and managing custom ctags definitions. Some settings can be set globally or locally to a buffer.