1 *rust.txt* Filetype plugin for Rust
3 ==============================================================================
6 1. Introduction |rust-intro|
7 2. Settings |rust-settings|
8 3. Commands |rust-commands|
9 4. Mappings |rust-mappings|
11 ==============================================================================
12 INTRODUCTION *rust-intro*
14 This plugin provides syntax and supporting functionality for the Rust
17 ==============================================================================
18 SETTINGS *rust-settings*
20 This plugin has a few variables you can define in your vimrc that change the
21 behavior of the plugin.
25 Set this option to the path to rustc for use in the |:RustRun| and
26 |:RustExpand| commands. If unset, "rustc" will be located in $PATH: >
27 let g:rustc_path = $HOME."/bin/rustc"
30 *g:rustc_makeprg_no_percent*
31 g:rustc_makeprg_no_percent~
32 Set this option to 1 to have 'makeprg' default to "rustc" instead of
34 let g:rustc_makeprg_no_percent = 1
39 Set this option to turn on the basic |conceal| support: >
40 let g:rust_conceal = 1
43 *g:rust_conceal_mod_path*
44 g:rust_conceal_mod_path~
45 Set this option to turn on |conceal| for the path connecting token
47 let g:rust_conceal_mod_path = 1
52 Set this option to turn on |conceal| for the "pub" token: >
53 let g:rust_conceal_pub = 1
56 *g:rust_bang_comment_leader*
57 g:rust_bang_comment_leader~
58 Set this option to 1 to preserve the leader on multi-line doc comments
59 using the /*! syntax: >
60 let g:rust_bang_comment_leader = 1
63 *g:ftplugin_rust_source_path*
64 g:ftplugin_rust_source_path~
65 Set this option to a path that should be prepended to 'path' for Rust
67 let g:ftplugin_rust_source_path = $HOME.'/dev/rust'
70 ==============================================================================
71 COMMANDS *rust-commands*
73 :RustRun [args] *:RustRun*
74 :RustRun! [rustc-args] [--] [args]
75 Compiles and runs the current file. If it has unsaved changes,
76 it will be saved first using |:update|. If the current file is
77 an unnamed buffer, it will be written to a temporary file
78 first. The compiled binary is always placed in a temporary
79 directory, but is run from the current directory.
81 The arguments given to |:RustRun| will be passed to the
84 If ! is specified, the arguments are passed to rustc instead.
85 A "--" argument will separate the rustc arguments from the
86 arguments passed to the binary.
88 If |g:rustc_path| is defined, it is used as the path to rustc.
89 Otherwise it is assumed rustc can be found in $PATH.
91 :RustExpand [args] *:RustExpand*
92 :RustExpand! [TYPE] [args]
93 Expands the current file using --pretty and displays the
94 results in a new split. If the current file has unsaved
95 changes, it will be saved first using |:update|. If the
96 current file is an unnamed buffer, it will be written to a
99 The arguments given to |:RustExpand| will be passed to rustc.
100 This is largely intended for specifying various --cfg
103 If ! is specified, the first argument is the expansion type to
104 pass to rustc --pretty. Otherwise it will default to
107 If |g:rustc_path| is defined, it is used as the path to rustc.
108 Otherwise it is assumed rustc can be found in $PATH.
111 ==============================================================================
112 MAPPINGS *rust-mappings*
114 This plugin defines mappings for |[[| and |]]| to support hanging indents.
116 It also has a few other mappings:
119 <D-r> Executes |:RustRun| with no arguments.
120 Note: This binding is only available in MacVim.
123 <D-R> Populates the command line with |:RustRun|! using the
124 arguments given to the last invocation, but does not
126 Note: This binding is only available in MacVim.
128 ==============================================================================
129 vim:tw=78:sw=4:noet:ts=8:ft=help:norl: