Simple image host.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rust.txt 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. *rust.txt* Filetype plugin for Rust
  2. ==============================================================================
  3. CONTENTS *rust* *ft-rust*
  4. 1. Introduction |rust-intro|
  5. 2. Settings |rust-settings|
  6. 3. Commands |rust-commands|
  7. 4. Mappings |rust-mappings|
  8. ==============================================================================
  9. INTRODUCTION *rust-intro*
  10. This plugin provides syntax and supporting functionality for the Rust
  11. filetype.
  12. ==============================================================================
  13. SETTINGS *rust-settings*
  14. This plugin has a few variables you can define in your vimrc that change the
  15. behavior of the plugin.
  16. *g:rustc_path*
  17. g:rustc_path~
  18. Set this option to the path to rustc for use in the |:RustRun| and
  19. |:RustExpand| commands. If unset, "rustc" will be located in $PATH: >
  20. let g:rustc_path = $HOME."/bin/rustc"
  21. <
  22. *g:rustc_makeprg_no_percent*
  23. g:rustc_makeprg_no_percent~
  24. Set this option to 1 to have 'makeprg' default to "rustc" instead of
  25. "rustc %": >
  26. let g:rustc_makeprg_no_percent = 1
  27. <
  28. *g:rust_conceal*
  29. g:rust_conceal~
  30. Set this option to turn on the basic |conceal| support: >
  31. let g:rust_conceal = 1
  32. <
  33. *g:rust_conceal_mod_path*
  34. g:rust_conceal_mod_path~
  35. Set this option to turn on |conceal| for the path connecting token
  36. "::": >
  37. let g:rust_conceal_mod_path = 1
  38. <
  39. *g:rust_conceal_pub*
  40. g:rust_conceal_pub~
  41. Set this option to turn on |conceal| for the "pub" token: >
  42. let g:rust_conceal_pub = 1
  43. <
  44. *g:rust_recommended_style*
  45. g:rust_recommended_style~
  46. Set this option to enable vim indentation and textwidth settings to
  47. conform to style conventions of the rust standard library (i.e. use 4
  48. spaces for indents and sets 'textwidth' to 99). This option is enabled
  49. by default. To disable it: >
  50. let g:rust_recommended_style = 0
  51. <
  52. *g:rust_fold*
  53. g:rust_fold~
  54. Set this option to turn on |folding|: >
  55. let g:rust_fold = 1
  56. <
  57. Value Effect ~
  58. 0 No folding
  59. 1 Braced blocks are folded. All folds are open by
  60. default.
  61. 2 Braced blocks are folded. 'foldlevel' is left at the
  62. global value (all folds are closed by default).
  63. *g:rust_bang_comment_leader*
  64. g:rust_bang_comment_leader~
  65. Set this option to 1 to preserve the leader on multi-line doc comments
  66. using the /*! syntax: >
  67. let g:rust_bang_comment_leader = 1
  68. <
  69. *g:ftplugin_rust_source_path*
  70. g:ftplugin_rust_source_path~
  71. Set this option to a path that should be prepended to 'path' for Rust
  72. source files: >
  73. let g:ftplugin_rust_source_path = $HOME.'/dev/rust'
  74. <
  75. *g:cargo_manifest_name*
  76. g:cargo_manifest_name~
  77. Set this option to the name of the manifest file for your projects. If
  78. not specified it defaults to 'Cargo.toml' : >
  79. let g:cargo_manifest_name = 'Cargo.toml'
  80. <
  81. ==============================================================================
  82. COMMANDS *rust-commands*
  83. :RustRun [args] *:RustRun*
  84. :RustRun! [rustc-args] [--] [args]
  85. Compiles and runs the current file. If it has unsaved changes,
  86. it will be saved first using |:update|. If the current file is
  87. an unnamed buffer, it will be written to a temporary file
  88. first. The compiled binary is always placed in a temporary
  89. directory, but is run from the current directory.
  90. The arguments given to |:RustRun| will be passed to the
  91. compiled binary.
  92. If ! is specified, the arguments are passed to rustc instead.
  93. A "--" argument will separate the rustc arguments from the
  94. arguments passed to the binary.
  95. If |g:rustc_path| is defined, it is used as the path to rustc.
  96. Otherwise it is assumed rustc can be found in $PATH.
  97. :RustExpand [args] *:RustExpand*
  98. :RustExpand! [TYPE] [args]
  99. Expands the current file using --pretty and displays the
  100. results in a new split. If the current file has unsaved
  101. changes, it will be saved first using |:update|. If the
  102. current file is an unnamed buffer, it will be written to a
  103. temporary file first.
  104. The arguments given to |:RustExpand| will be passed to rustc.
  105. This is largely intended for specifying various --cfg
  106. configurations.
  107. If ! is specified, the first argument is the expansion type to
  108. pass to rustc --pretty. Otherwise it will default to
  109. "expanded".
  110. If |g:rustc_path| is defined, it is used as the path to rustc.
  111. Otherwise it is assumed rustc can be found in $PATH.
  112. :RustEmitIr [args] *:RustEmitIr*
  113. Compiles the current file to LLVM IR and displays the results
  114. in a new split. If the current file has unsaved changes, it
  115. will be saved first using |:update|. If the current file is an
  116. unnamed buffer, it will be written to a temporary file first.
  117. The arguments given to |:RustEmitIr| will be passed to rustc.
  118. If |g:rustc_path| is defined, it is used as the path to rustc.
  119. Otherwise it is assumed rustc can be found in $PATH.
  120. :RustEmitAsm [args] *:RustEmitAsm*
  121. Compiles the current file to assembly and displays the results
  122. in a new split. If the current file has unsaved changes, it
  123. will be saved first using |:update|. If the current file is an
  124. unnamed buffer, it will be written to a temporary file first.
  125. The arguments given to |:RustEmitAsm| will be passed to rustc.
  126. If |g:rustc_path| is defined, it is used as the path to rustc.
  127. Otherwise it is assumed rustc can be found in $PATH.
  128. ==============================================================================
  129. MAPPINGS *rust-mappings*
  130. This plugin defines mappings for |[[| and |]]| to support hanging indents.
  131. It also has a few other mappings:
  132. *rust_<D-r>*
  133. <D-r> Executes |:RustRun| with no arguments.
  134. Note: This binding is only available in MacVim.
  135. *rust_<D-R>*
  136. <D-R> Populates the command line with |:RustRun|! using the
  137. arguments given to the last invocation, but does not
  138. execute it.
  139. Note: This binding is only available in MacVim.
  140. ==============================================================================
  141. vim:tw=78:sw=4:noet:ts=8:ft=help:norl: