Skip to content

Commit 55eaa1c

Browse files
lilyballalexcrichton
authored andcommitted
---
yaml --- r: 118732 b: refs/heads/snap-stage3 c: 918eda5 h: refs/heads/master v: v3
1 parent 7db93cc commit 55eaa1c

File tree

3 files changed

+132
-26
lines changed

3 files changed

+132
-26
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: b1646cbfd908dc948b251e362669af421100647a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: bd3bebcf60793477da390471d6d00a5523d716b4
4+
refs/heads/snap-stage3: 918eda59bee9a627919d11b7bc9f909d7a9676ff
55
refs/heads/try: 1813e5aa1a03b0596b8de7abd1af31edf5d6098f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
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:

branches/snap-stage3/src/etc/vim/ftplugin/rust.vim

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -60,33 +60,10 @@ onoremap <silent> <buffer> ]] :call rust#Jump('o', 'Forward')<CR>
6060
6161
" Commands {{{1
6262

63-
" :RustRun will compile and run the current file. If it has unsaved changes,
64-
" they will be saved first. If it has no path, it will be written to a
65-
" temporary file first. The generated binary is always placed in a temporary
66-
" directory, but run from the current directory.
67-
"
68-
" The arguments passed to :RustRun will be passed to the generated binary.
69-
"
70-
" If ! is specified, the arguments are given to rustc as well. A -- argument
71-
" separates rustc args from the args passed to the binary.
72-
"
73-
" If g:rustc_path is defined, it is used as the path to rustc. Otherwise it is
74-
" assumed that rustc is in $PATH.
63+
" See |:RustRun| for docs
7564
command! -nargs=* -complete=file -bang -bar -buffer RustRun call rust#Run(<bang>0, [<f-args>])
7665

77-
" :RustExpand will expand the current file using --pretty.
78-
"
79-
" Any arguments given to :RustExpand will be passed to rustc. This is largely
80-
" so you can pass various --cfg configurations.
81-
"
82-
" If ! is specified, the first argument will be interpreted as the --pretty
83-
" type. Otherwise it will default to 'expanded'.
84-
"
85-
" If the current file has unsaved changes, it will be saved first. If it's an
86-
" unnamed buffer, it will be written to a temporary file.
87-
"
88-
" If g:rustc_path is defined, it is used as the path to rustc. Otherwise it is
89-
" assumed that rustc is in $PATH.
66+
" See |:RustExpand| for docs
9067
command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -bar -buffer RustExpand call rust#Expand(<bang>0, [<f-args>])
9168

9269
" Mappings {{{1

0 commit comments

Comments
 (0)