Skip to content

Commit bd3bebc

Browse files
lilyballalexcrichton
authored andcommitted
Rename :Run and :Expand to :RustRun and :RustExpand
1 parent 303cadf commit bd3bebc

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

src/etc/vim/autoload/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function! s:Expand(path, pretty, args)
118118
endfunction
119119

120120
function! rust#CompleteExpand(lead, line, pos)
121-
if a:line[: a:pos-1] =~ '^Expand!\s*\S*$'
121+
if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$'
122122
" first argument and it has a !
123123
let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph="]
124124
if !empty(a:lead)

src/etc/vim/ftplugin/rust.vim

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

63-
" :Run will compile and run the current file. If it has unsaved changes, they
64-
" will be saved first. If it has no path, it will be written to a temporary
65-
" file first. The generated binary is always placed in a temporary directory,
66-
" but run from the current directory.
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.
6767
"
68-
" The arguments passed to :Run will be passed to the generated binary.
68+
" The arguments passed to :RustRun will be passed to the generated binary.
6969
"
7070
" If ! is specified, the arguments are given to rustc as well. A -- argument
7171
" separates rustc args from the args passed to the binary.
7272
"
7373
" If g:rustc_path is defined, it is used as the path to rustc. Otherwise it is
7474
" assumed that rustc is in $PATH.
75-
command! -nargs=* -complete=file -bang -bar -buffer Run call rust#Run(<bang>0, [<f-args>])
75+
command! -nargs=* -complete=file -bang -bar -buffer RustRun call rust#Run(<bang>0, [<f-args>])
7676

77-
" :Expand will expand the current file using --pretty.
77+
" :RustExpand will expand the current file using --pretty.
7878
"
79-
" Any arguments given to :Expand will be passed to rustc. This is largely so
80-
" you can pass various --cfg configurations.
79+
" Any arguments given to :RustExpand will be passed to rustc. This is largely
80+
" so you can pass various --cfg configurations.
8181
"
8282
" If ! is specified, the first argument will be interpreted as the --pretty
8383
" type. Otherwise it will default to 'expanded'.
@@ -87,14 +87,14 @@ command! -nargs=* -complete=file -bang -bar -buffer Run call rust#Run(<bang>0, [
8787
"
8888
" If g:rustc_path is defined, it is used as the path to rustc. Otherwise it is
8989
" assumed that rustc is in $PATH.
90-
command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -bar -buffer Expand call rust#Expand(<bang>0, [<f-args>])
90+
command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -bar -buffer RustExpand call rust#Expand(<bang>0, [<f-args>])
9191

9292
" Mappings {{{1
9393

94-
" Bind ⌘R in MacVim to :Run
95-
nnoremap <silent> <buffer> <D-r> :Run<CR>
96-
" Bind ⌘⇧R in MacVim to :Run! pre-filled with the last args
97-
nnoremap <buffer> <D-R> :Run! <C-r>=join(b:rust_last_rustc_args)<CR><C-\>erust#AppendCmdLine(' -- ' . join(b:rust_last_args))<CR>
94+
" Bind ⌘R in MacVim to :RustRun
95+
nnoremap <silent> <buffer> <D-r> :RustRun<CR>
96+
" Bind ⌘⇧R in MacVim to :RustRun! pre-filled with the last args
97+
nnoremap <buffer> <D-R> :RustRun! <C-r>=join(b:rust_last_rustc_args)<CR><C-\>erust#AppendCmdLine(' -- ' . join(b:rust_last_args))<CR>
9898
9999
if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args")
100100
let b:rust_last_rustc_args = []
@@ -112,8 +112,8 @@ let b:undo_ftplugin = "
112112
\|unlet! b:delimitMate_excluded_regions
113113
\|endif
114114
\|unlet! b:rust_last_rustc_args b:rust_last_args
115-
\|delcommand Run
116-
\|delcommand Expand
115+
\|delcommand RustRun
116+
\|delcommand RustExpand
117117
\|nunmap <buffer> <D-r>
118118
\|nunmap <buffer> <D-R>
119119
\|nunmap <buffer> [[

0 commit comments

Comments
 (0)