Skip to content

Commit

Permalink
Start support for Rust
Browse files Browse the repository at this point in the history
* Format the code with ``rustfmt``

To do:

* Shortcut for (un)commenting out lines of code.
* Check syntax for a Rust file.
  • Loading branch information
rmariano committed Dec 30, 2018
1 parent cd2d0ee commit c079230
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions after/ftplugin/rust.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"" Settings for Rust

"" Fix a Rust file: auto-format with ``rustfmt``
function! AutofixRust()
echom "Correcting Rust file"
if executable("rustfmt")
execute ":silent %!rustfmt"
endif
:w
endfunction

map <F3> :call AutofixRust()<CR>

0 comments on commit c079230

Please sign in to comment.