1
0
Fork
You've already forked rust.vim
0
Better syntax highlighting for Rust in Vim
  • Vim Script 96.5%
  • Python 2.6%
  • Dockerfile 0.9%
Find a file
2026年05月03日 04:32:29 -07:00
.github/workflows Migrate from Travis-CI and add .github/workflows/test.yml 2021年08月30日 14:02:37 +03:00
after/syntax after/syntax/rust.vim: lint fixes 2018年07月07日 17:34:47 +03:00
autoload Revert "Performance: Use nvim_buf_set_lines for neovim" 2021年09月04日 23:09:20 +03:00
compiler Ignore For more information line 2022年09月28日 19:37:55 +03:00
ctags ctags: Apply dan-t's fix for 'const' 2018年07月05日 19:46:31 +03:00
doc whitespace 2020年03月06日 09:25:46 +02:00
ftdetect :setf FALLBACK is not available in older versions ( #346 ) 2019年08月30日 16:10:39 +10:00
ftplugin Stop setting 'tabstop' ( #436 ) 2021年02月16日 02:04:18 +05:30
indent Set b:undo_indent 2021年10月05日 20:36:15 +13:00
plugin Add :Ccheck 2020年01月26日 14:04:27 +02:00
syntax Fix highlighting of lifetime bounds ('a: 'b) 2026年05月03日 04:30:23 -07:00
syntax_checkers/rust Check that Syntastic is new enough 2018年11月26日 19:57:21 +02:00
test test/run-tests: fixes for Python 3 2021年08月30日 13:57:52 +03:00
.gitignore Ignore doc/tags 2015年01月30日 00:15:41 +09:00
.vintrc.yml Vint-related fixes 2018年07月09日 00:26:09 +03:00
ISSUE_TEMPLATE.md Guide users to ensuring :RustInfo works 2021年09月09日 19:59:48 +12:00
LICENSE-APACHE License like rust 2015年11月14日 19:51:49 -08:00
LICENSE-MIT License like rust 2015年11月14日 19:51:49 -08:00
README.md Update README 2026年05月03日 04:32:29 -07:00
README.orig.md Add README for fork 2026年01月23日 04:09:07 -08:00
triagebot.toml Revert "Migrate from highfive to triagebot" 2022年11月27日 16:26:22 +02:00

taylor.fish fork of rust.vim

This is a fork of rust.vim with an updated syntax highlighting file (syntax/rust.vim).

For the original README, see README.orig.md.

Installation

Copy syntax/rust.vim to ~/.vim/syntax/:

git clone https://codeberg.org/taylordotfish/rust.vim
mkdir -p ~/.vim/syntax
cp rust.vim/syntax/rust.vim ~/.vim/syntax/

Changes

  • Added ability to customize which edition is used for highlighting. Set g:rust_edition before the syntax file is loaded; e.g., let g:rust_edition = 2021 or let g:rust_edition = "latest".
  • Added support for safe fn.
  • Added support for &raw const and &raw mut.
  • Added support for pub(in ...).
  • Added support for the gen keyword. (Fixes #521.)
  • Added support for items added to the prelude in the 2021 and 2024 editions, like TryFrom and Future.
  • Keywords in positions where an item name is expected are now highlighted (e.g., fn do() {} or mod priv;). (Fixes #406.)
  • Added support for non-ASCII characters in identifiers (Café::new()).
  • Added support for ? as a macro repetition operator ($()?). (Fixes #498.)
  • Fixed highlighting of successive borrow operators (&&x).
  • Fixed highlighting of lifetime bounds ('a: 'b).
  • Fixed false positive highlighting of child path components as built-in types; e.g., str in std::str::FromStr is a module rather than a type.
  • Fixed false positive highlighting of enum variants as prelude items; e.g., Box in enum Shape { Box, Sphere } or let s = Shape::Box. This also applies to associated types, as in let x: <T as Trait>::String.
  • Added support for raw identifiers in paths and function calls (r#foo()).
  • as is now highlighted as a keyword rather than an operator. (Fixes #493.)
  • Updated list of derive macros.
  • Improved highlighting of async, await, try, and dyn.
  • Improved highlighting of impl ... for ... using proper parsing.
  • Improved detection of turbofish function calls (f::<T>()).
  • Improved parsing of attributes (fixes cases like #[[]]).
  • Fixed parsing of /* */* (previously parsed as a comment containing an unclosed nested comment).
  • Improved detection of which Markdown code blocks should be highlighted as Rust code in doc comments.
  • Fixed parsing of multiline attributes and macro repetition expressions ($(x)*) inside code blocks in doc comments.
  • Fixed parsing of non-Rust code blocks in block doc comments (/** */).
  • Fixed parsing of doc comments containing an unclosed code block.
  • Leading # characters in doc comment code blocks (to hide lines in rustdoc’s output) are now highlighted.
  • Added option not to highlight code in doc comments: let g:rust_highlight_doc_code = 0 before the syntax file is loaded. (Fixes #407.)
  • Reduced stale highlighting when syntactic constructs span multiple lines by setting syn sync linebreaks to 1.
  • Added a distinct syntax group for prelude structs instead of including them in rustTrait.
  • Added highlighting for ? in ?Sized.
  • Reduced false positives in highlighting of assert and panic macros (assertiveness!(), paniculate!()).
  • Removed obsolete syntax.

License

The changes in this repository are licensed under the same license as the original: your choice of either the MIT license or version 2 of the Apache License. For more information, see README.orig.md.