|
| 1 | +*rust.txt* Filetype plugin for Rust |
| 2 | + |
| 3 | +============================================================================== |
| 4 | +CONTENTS *rust* |
| 5 | + |
| 6 | +1. Introduction |rust-intro| |
| 7 | +2. Settings |rust-settings| |
| 8 | +3. Commands |rust-commands| |
| 9 | +4. Mappings |rust-mappings| |
| 10 | + |
| 11 | +============================================================================== |
| 12 | +INTRODUCTION *rust-intro* |
| 13 | + |
| 14 | +This plugin provides syntax and supporting functionality for the Rust |
| 15 | +filetype. |
| 16 | + |
| 17 | +============================================================================== |
| 18 | +SETTINGS *rust-settings* |
| 19 | + |
| 20 | +This plugin has a few variables you can define in your vimrc that change the |
| 21 | +behavior of the plugin. |
| 22 | + |
| 23 | + *g:rustc_path* |
| 24 | +g:rustc_path~ |
| 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" |
| 28 | +< |
| 29 | + |
| 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 |
| 33 | + "rustc %": > |
| 34 | + let g:rustc_makeprg_no_percent = 1 |
| 35 | +< |
| 36 | + |
| 37 | + *g:rust_conceal* |
| 38 | +g:rust_conceal~ |
| 39 | + Set this option to turn on the basic |conceal| support: > |
| 40 | + let g:rust_conceal = 1 |
| 41 | +< |
| 42 | + |
| 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 |
| 46 | + "::": > |
| 47 | + let g:rust_conceal_mod_path = 1 |
| 48 | +< |
| 49 | + |
| 50 | + *g:rust_conceal_pub* |
| 51 | +g:rust_conceal_pub~ |
| 52 | + Set this option to turn on |conceal| for the "pub" token: > |
| 53 | + let g:rust_conceal_pub = 1 |
| 54 | +< |
| 55 | + |
| 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 |
| 61 | +< |
| 62 | + |
| 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 |
| 66 | + source files: > |
| 67 | + let g:ftplugin_rust_source_path = $HOME.'/dev/rust' |
| 68 | +< |
| 69 | + |
| 70 | +============================================================================== |
| 71 | +COMMANDS *rust-commands* |
| 72 | + |
| 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. |
| 80 | + |
| 81 | + The arguments given to |:RustRun| will be passed to the |
| 82 | + compiled binary. |
| 83 | + |
| 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. |
| 87 | + |
| 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. |
| 90 | + |
| 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 |
| 97 | + temporary file first. |
| 98 | + |
| 99 | + The arguments given to |:RustExpand| will be passed to rustc. |
| 100 | + This is largely intended for specifying various --cfg |
| 101 | + configurations. |
| 102 | + |
| 103 | + If ! is specified, the first argument is the expansion type to |
| 104 | + pass to rustc --pretty. Otherwise it will default to |
| 105 | + "expanded". |
| 106 | + |
| 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. |
| 109 | + |
| 110 | + |
| 111 | +============================================================================== |
| 112 | +MAPPINGS *rust-mappings* |
| 113 | + |
| 114 | +This plugin defines mappings for |[[| and |]]| to support hanging indents. |
| 115 | + |
| 116 | +It also has a few other mappings: |
| 117 | + |
| 118 | + *rust_<D-r>* |
| 119 | +<D-r> Executes |:RustRun| with no arguments. |
| 120 | + Note: This binding is only available in MacVim. |
| 121 | + |
| 122 | + *rust_<D-R>* |
| 123 | +<D-R> Populates the command line with |:RustRun|! using the |
| 124 | + arguments given to the last invocation, but does not |
| 125 | + execute it. |
| 126 | + Note: This binding is only available in MacVim. |
| 127 | + |
| 128 | +============================================================================== |
| 129 | + vim:tw=78:sw=4:noet:ts=8:ft=help:norl: |
0 commit comments