Skip to content

Commit c079230

Browse files
committed
Start support for Rust
* Format the code with ``rustfmt`` To do: * Shortcut for (un)commenting out lines of code. * Check syntax for a Rust file.
1 parent cd2d0ee commit c079230

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

after/ftplugin/rust.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"" Settings for Rust
2+
3+
"" Fix a Rust file: auto-format with ``rustfmt``
4+
function! AutofixRust()
5+
echom "Correcting Rust file"
6+
if executable("rustfmt")
7+
execute ":silent %!rustfmt"
8+
endif
9+
:w
10+
endfunction
11+
12+
map <F3> :call AutofixRust()<CR>

0 commit comments

Comments
 (0)