Vim configuration for Rust.

Last update: May 23, 2022

rust.vim

Description

This is a Vim plugin that provides Rust file detection, syntax highlighting, formatting, Syntastic integration, and more. It requires Vim 8 or higher for full functionality. Some things may not work on earlier versions.

Installation

For activating the full functionality, this plugin requires either the plugin manager or the .vimrc to have the following:

syntax enable
filetype plugin indent on

Most plugin managers don't do this automatically, so these statements are usually added by users in their vimrc right after the plugin manager load section.

Vim8 packages

git clone https://github.com/rust-lang/rust.vim ~/.vim/pack/plugins/start/rust.vim

Vundle

Plugin 'rust-lang/rust.vim'

Pathogen

git clone --depth=1 https://github.com/rust-lang/rust.vim.git ~/.vim/bundle/rust.vim

vim-plug

Plug 'rust-lang/rust.vim'

dein.vim

call dein#add('rust-lang/rust.vim')

NeoBundle

NeoBundle 'rust-lang/rust.vim'

Features

Error checking with Syntastic

rust.vim automatically registers cargo as a syntax checker with Syntastic, if nothing else is specified. See :help rust-syntastic for more details.

Source browsing with Tagbar

The installation of Tagbar along with Universal Ctags is recommended for a good Tagbar experience. For other kinds of setups, rust.vim tries to configure Tagbar to some degree.

Formatting with rustfmt

The :RustFmt command will format your code with rustfmt if installed. rustfmt can be installed via rustup component add rustfmt.

Placing let g:rustfmt_autosave = 1 in your ~/.vimrc will enable automatic running of :RustFmt when you save a buffer.

Do :help :RustFmt for further formatting help and customization options.

Playpen integration

Note: This feature requires webapi-vim to be installed.

The :RustPlay command will send the current selection, or if nothing is selected the current buffer, to the Rust playpen.

If you set g:rust_clip_command RustPlay will copy the url to the clipboard.

  • Mac:

    let g:rust_clip_command = 'pbcopy'
    
  • Linux:

    let g:rust_clip_command = 'xclip -selection clipboard'
    

Running a test under cursor

In a Cargo project, the :RustTest command will run the test that is under the cursor. This is useful when your project is big and running all of the tests takes a long time.

Help

Further help can be found in the documentation with :Helptags then :help rust.

Detailed help can be found in the documentation with :help rust. Helptags (:help helptags) need to be generated for this plugin in order to navigate the help. Most plugin managers will do this automatically, but check their documentation if that is not the case.

License

Like Rust, rust.vim is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE-APACHE and LICENSE-MIT for details.

GitHub

https://github.com/rust-lang/rust.vim
Comments
  • 1. Add support for new error format

    This adds basic support for the new rustc error format used in recent nightlies. It appears to be working, but it's possible I've missed some edge cases, so comments are welcome.

    Also, I'm not at all familiar with syntastic or how it works, so I haven't tested that part yet. If someone who uses that plugin could give this a try and let me know if it's broken, that would be great.

    Reviewed by jpernst at 2016-08-15 23:04
  • 2. vim shows whole file (with "--- More ---" scrolling) when saving

    So, I have some weird issues when saving files using rust.vim. Whenever I changed a file and want to save it, vim displays the whole file in that scrollable mode (--- More --- at the bottom line, scrolling with arrow keys) and only when I scroll to the bottom, the file gets saved. This does not happen without rust.vim.

    I use pathogen and have nerdtree, youcompleteme, syntastic and rust.vim in my bundle folder.

    vim --version:

    $ vim --version
    VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar 19 2016 22:56:19)
    Included patches: 1-1000
    Compiled by [email protected]
    Huge version with GTK2 GUI.  Features included (+) or not (-):
    +acl             +farsi           +mouse_netterm   +syntax
    +arabic          +file_in_path    +mouse_sgr       +tag_binary
    +autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
    +balloon_eval    +float           +mouse_urxvt     -tag_any_white
    +browse          +folding         +mouse_xterm     -tcl
    ++builtin_terms  -footer          +multi_byte      +terminfo
    +byte_offset     +fork()          +multi_lang      +termresponse
    +cindent         +gettext         -mzscheme        +textobjects
    +clientserver    -hangul_input    +netbeans_intg   +title
    +clipboard       +iconv           +path_extra      +toolbar
    +cmdline_compl   +insert_expand   -perl            +user_commands
    +cmdline_hist    +jumplist        +persistent_undo +vertsplit
    +cmdline_info    +keymap          +postscript      +virtualedit
    +comments        +langmap         +printer         +visual
    +conceal         +libcall         +profile         +visualextra
    +cryptv          +linebreak       +python          +viminfo
    +cscope          +lispindent      -python3         +vreplace
    +cursorbind      +listcmds        +quickfix        +wildignore
    +cursorshape     +localmap        +reltime         +wildmenu
    +dialog_con_gui  -lua             +rightleft       +windows
    +diff            +menu            -ruby            +writebackup
    +digraphs        +mksession       +scrollbind      +X11
    +dnd             +modify_fname    +signs           -xfontset
    -ebcdic          +mouse           +smartindent     +xim
    +emacs_tags      +mouseshape      -sniff           +xsmp_interact
    +eval            +mouse_dec       +startuptime     +xterm_clipboard
    +ex_extra        -mouse_gpm       +statusline      -xterm_save
    +extra_search    -mouse_jsbterm   -sun_workshop    +xpm
       system vimrc file: "$VIM/vimrc"
         user vimrc file: "$HOME/.vimrc"
     2nd user vimrc file: "~/.vim/vimrc"
          user exrc file: "$HOME/.exrc"
      system gvimrc file: "$VIM/gvimrc"
        user gvimrc file: "$HOME/.gvimrc"
    2nd user gvimrc file: "~/.vim/gvimrc"
        system menu file: "$VIMRUNTIME/menu.vim"
      fall-back for $VIM: "/usr/local/share/vim"
     f-b for $VIMRUNTIME: "/usr/share/vim/vim74"
    Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
    Linking: gcc   -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lXt -lX11 -lSM -lICE  -lm -lncurses -lacl -L/usr/lib/python2.7/config -lpython2.7 -ldl -lutil -lm -Xlinker -export-dynamic 
    
    Reviewed by Rukenshia at 2016-03-19 22:10
  • 3. Improved syntastic linting

    This PR builds on PR #72 .

    There's a new option to choose between fast lint (parse-only) or comprehensive (no-trans). You can change this at runtime too.

    Possible improvements include a buffer-local variable so that you can have different projects with different linting levels.

    Reviewed by somini at 2016-03-21 01:32
  • 4. RustFmt is slow with foldmethod=syntax

    Hi,

    when I run :RustFmt on a file under macOS Mojave it takes over three seconds for it to complete. Running the same on the command line completes instantly:

    $ time rustfmt src/main.rs
    rustfmt src/main.rs  0.03s user 0.01s system 90% cpu 0.045 total
    

    :RustInfo

    rust.vim Global Variables:
    let g:ftplugin_rust_source_path = v:null
    let g:loaded_syntastic_rust_cargo_checker = v:null
    let g:loaded_syntastic_rust_filetype = v:null
    let g:loaded_syntastic_rust_rustc_checker = v:null
    let g:rust_bang_comment_leader = v:null
    let g:rust_cargo_avoid_whole_workspace = v:null
    let g:rust_clip_command = v:null
    let g:rust_conceal = v:null
    let g:rust_conceal_mod_path = v:null
    let g:rust_conceal_pub = v:null
    let g:rust_fold = 1
    let g:rust_last_args = v:null
    let b:rust_last_args = []
    let g:rust_last_rustc_args = v:null
    let b:rust_last_rustc_args = []
    let g:rust_original_delimitMate_excluded_regions = v:null
    let g:rust_playpen_url = v:null
    let g:rust_prev_delimitMate_quotes = v:null
    let g:rust_recent_nearest_cargo_tol = v:null
    let g:rust_recent_root_cargo_toml = v:null
    let g:rust_recommended_style = v:null
    let g:rust_set_conceallevel = v:null
    let g:rust_set_conceallevel=1 = v:null
    let g:rust_set_foldmethod = v:null
    let b:rust_set_foldmethod = 1
    let g:rust_set_foldmethod=1 = v:null
    let g:rust_shortener_url = v:null
    let g:rustc_makeprg_no_percent = v:null
    let g:rustc_path = v:null
    let g:rustfmt_autosave = 0
    let g:rustfmt_autosave_because_of_config = v:null
    let g:rustfmt_autosave_if_config_present = v:null
    let g:rustfmt_command = 'rustfmt'
    let g:rustfmt_emit_files = 1
    let g:rustfmt_fail_silently = 0
    let g:rustfmt_options = ''
    let g:syntastic_extra_filetypes = ['rust']
    let g:syntastic_rust_cargo_fname = v:null
    rustfmt 1.0.0-stable (4a4e5081 2018-11-29)
    rustc 1.31.1 (b6c32da9b 2018-12-18)
    cargo 1.31.0 (339d9f9c8 2018-11-16)
    
    VIM - Vi IMproved 8.1 (2018 May 18, compiled Oct 29 2018 06:55:58)
    macOS version
    Included patches: 1-500
    Compiled by Homebrew
    Huge version without GUI.  Features included (+) or not (-):
    +acl               +channel           +cscope            +ex_extra          -hangul_input      +lispindent        -mouse_gpm         +netbeans_intg     +python3           -sun_workshop      +textobjects       +viminfo           -xsmp
    +arabic            +cindent           +cursorbind        +extra_search      +iconv             +listcmds          -mouse_jsbterm     +num64             +quickfix          +syntax            +timers            +vreplace          -xterm_clipboard
    +autocmd           -clientserver      +cursorshape       +farsi             +insert_expand     +localmap          +mouse_netterm     +packages          +reltime           +tag_binary        +title             +wildignore        -xterm_save
    +autochdir         +clipboard         +dialog_con        +file_in_path      +job               -lua               +mouse_sgr         +path_extra        +rightleft         +tag_old_static    -toolbar           +wildmenu
    -autoservername    +cmdline_compl     +diff              +find_in_path      +jumplist          +menu              -mouse_sysmouse    +perl              +ruby              -tag_any_white     +user_commands     +windows
    -balloon_eval      +cmdline_hist      +digraphs          +float             +keymap            +mksession         +mouse_urxvt       +persistent_undo   +scrollbind        -tcl               +vartabs           +writebackup
    +balloon_eval_term +cmdline_info      -dnd               +folding           +lambda            +modify_fname      +mouse_xterm       +postscript        +signs             +termguicolors     +vertsplit         -X11
    -browse            +comments          -ebcdic            -footer            +langmap           +mouse             +multi_byte        +printer           +smartindent       +terminal          +virtualedit       -xfontset
    ++builtin_terms    +conceal           +emacs_tags        +fork()            +libcall           -mouseshape        +multi_lang        +profile           +startuptime       +terminfo          +visual            -xim
    +byte_offset       +cryptv            +eval              -gettext           +linebreak         +mouse_dec         -mzscheme          -python            +statusline        +termresponse      +visualextra       -xpm
       system vimrc file: "$VIM/vimrc"
         user vimrc file: "$HOME/.vimrc"
     2nd user vimrc file: "~/.vim/vimrc"
          user exrc file: "$HOME/.exrc"
           defaults file: "$VIMRUNTIME/defaults.vim"
      fall-back for $VIM: "/usr/local/share/vim"
    Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
    Linking: clang   -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -framework AppKit   -mmacosx-version-min=10.14 -fstack
    -protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.
    7m -framework CoreFoundation  -lruby.2.5.3 -lobjc
    
    Reviewed by abbec at 2018-12-22 20:39
  • 5. Neomake - workspaces are broken

    I'm opening this issue just to get some visibility of people that are both Rust user and VimL-versed.

    https://github.com/neomake/neomake/issues/1916

    Let's say you have project a with a/b subcrate.

    If you cd a/b and vim, neomake stops working well, because rustc still displays error paths as b/src/lib.rs (relative to workspace root) while neomake/Vim would like them to be relative to current dir, so just src/lib/rs.

    All it takes to fix (I think) is fixing the path somewhere here: https://github.com/neomake/neomake/blob/master/autoload/neomake/makers/ft/rust.vim#L136 by stripping the prefix.

    But it's currently beyond me, how to do it right, and I don't have time to dedicate to figure it out.

    Please, someone take a look. :)

    Reviewed by dpc at 2018-09-07 06:50
  • 6. Can't find directory "src" in cdpath when use `:make build`

    • rust.vim version: I use vim-plug to install latest rust.vim master

    Steps to reproduce:

    1. Open a rust source file in src folder
    2. run :compiler cargo
    3. run :make build

    Expected vs. actual behavior: Expected: run cargo build and pop the location list for errors.

    Actual behavior:

    Error detected while processing BufEnter Auto commands for "*":
    E344: Can't find directory "src" in cdpath
    E472: Command failed
    

    Paste debugging info from the Rust Vim plugin via one of the following commands: :RustInfo, :RustInfoToClipboard, or :RustInfoToFile <filename>.

    rust.vim Global Variables:
    
    let g:ftplugin_rust_source_path = v:null
    let g:loaded_syntastic_rust_cargo_checker = v:null
    let g:loaded_syntastic_rust_filetype = v:null
    let g:loaded_syntastic_rust_rustc_checker = v:null
    let g:rust_bang_comment_leader = v:null
    let g:rust_cargo_avoid_whole_workspace = v:null
    let g:rust_clip_command = v:null
    let g:rust_conceal = v:null
    let g:rust_conceal_mod_path = v:null
    let g:rust_conceal_pub = v:null
    let g:rust_fold = v:null
    let g:rust_last_args = v:null
    let b:rust_last_args = []
    let g:rust_last_rustc_args = v:null
    let b:rust_last_rustc_args = []
    let g:rust_original_delimitMate_excluded_regions = v:null
    let g:rust_playpen_url = v:null
    let g:rust_recent_nearest_cargo_tol = v:null
    let g:rust_recent_root_cargo_toml = v:null
    let g:rust_recommended_style = v:null
    let g:rust_set_conceallevel = v:null
    let g:rust_set_conceallevel=1 = v:null
    let g:rust_set_foldmethod = v:null
    let g:rust_set_foldmethod=1 = v:null
    let g:rust_shortener_url = v:null
    let g:rustc_makeprg_no_percent = v:null
    let g:rustc_path = v:null
    let g:rustfmt_autosave = 0
    let g:rustfmt_autosave_because_of_config = v:null
    let g:rustfmt_autosave_if_config_present = v:null
    let g:rustfmt_command = 'rustfmt'
    let g:rustfmt_emit_files = 0
    let g:rustfmt_fail_silently = 0
    let g:rustfmt_options = ''
    let g:syntastic_extra_filetypes = ['rust']
    let g:syntastic_rust_cargo_fname = v:null
    error: toolchain 'stable-x86_64-apple-darwin' does not have the binary `rustfmt`
    
    rustc 1.27.0 (3eda71b00 2018-06-19)
    
    cargo 1.27.0 (1e95190e5 2018-05-27)
    
    
    NVIM v0.3.0
    Build type: Release
    LuaJIT 2.0.5
    Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/tmp/neovim-20180612-71518-1f95nfa/neovim-0.3.0/build/config -I/tmp/neovim-20180612-71518-1f95nfa/neovim-0.3.0/src -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/tmp/neovim-20180612-71518-1f95nfa/neovim-0.3.0/build/src/nvim/auto -I/tmp/neovim-20180612-71518-1f95nfa/neovim-0.3.0/build/include
    Compiled by [email protected]
    
    Features: +acl +iconv +jemalloc +tui 
    See ":help feature-compile"
    
       system vimrc file: "$VIM/sysinit.vim"
      fall-back for $VIM: "/usr/local/Cellar/neovim/0.3.0/share/nvim"
    
    Run :checkhealth for more info
    
    Reviewed by VMatrix1900 at 2018-07-06 13:30
  • 7. Add a cargo checker for syntastic

    Hi there !

    As cargo check has been merged in cargo (see https://github.com/rust-lang/cargo/pull/3296), and the current rustc checker is facing some issues with external crates (see https://github.com/rust-lang/rust.vim/issues/130), I gave a try implementing a cargo checker for syntastic.

    And here is the result. Please note it is my first time writing a syntastic checker, and I'm relatively new to the rust ecosystem, consequently I might have made mistakes, so any feedback will be greatly appreciated !

    It currently works with cargo 0.16.0 nightly.

    Thanks !

    Reviewed by jlevesy at 2016-12-30 13:22
  • 8. syntastic is broken (unresolved imports)

    hi, syntastic gives me wrong error messages. the code compiles fine with cargo though.

    I have my own crate with submodules. when in submodule1 I import some class from submodule2 with "use submodule2::MyClass"; syntastic launches rustc -Zno-trans src/submodule1.rs which results in unresolved imports (E0259). I asked on irc about that and they told me I should compile the whole crate using cargo and not just the single file.

    Reviewed by wagnerf42 at 2016-07-13 06:50
  • 9. *.rs is recognized as hercules files

    In vim's official filetype.vim, I found that in line 860:

    au BufNewFile,BufRead *.vc,*.ev,*.rs,*.sum,*.errsum setf hercules
    

    Maybe it is better to move ftdetect to after/ftdetect?

    Reviewed by zhou13 at 2015-02-20 09:35
  • 10. Syntastic doesn't work

    I use Plug (Plug 'scrooloose/syntastic'), Syntastic is enabled but no response when I save a Rust file that contain many errors...

    I use Neovim (NVIM 0.1.5) on macOS.

    This is the output for :SyntasticInfo, for a Rust source code:

    Syntastic version: 3.7.0-224 (Vim 704, Neovim, Darwin)
    Info for filetype: rust
    Global mode: active
    Filetype rust is active
    The current file will be checked automatically
    Available checker: rustc
    Currently enabled checker: rustc
    

    Also, when I manually enter :SyntasticCheck, no output...

    Current Rust compiler: rustc 1.11.0 (9b21dcd6a 2016-08-15).

    If anyone have an idea about what's wrong here, please to comment! :-)
    Thanks

    Reviewed by k0pernicus at 2016-09-14 05:53
  • 11. Opening additional buffers causes error message

    Steps to reproduce:

    1. Open a rust buffer

    2. Open a second rust buffer See error message:

      Error detected while processing function delimitMate#Get..<SNR>74_get:                                                                  
      line    7:                                                                                                                              
      E716: Key not present in Dictionary: 3.excluded_regions                                                                                 
      E15: Invalid expression: s:options.3.excluded_regions
      
    3. Open a third buffer See error message:

      Error detected while processing function delimitMate#Get..<SNR>74_get:                                                                  
      line    7:                                                                                                                              
      E716: Key not present in Dictionary: 4.excluded_regions                                                                                 
      E15: Invalid expression: s:options.4.excluded_regions
      
    4. And so on...

    Reviewed by euclio at 2015-09-13 23:03
  • 12. Error while loading plugin

    I believe this is an issue with my setup and not the plugin itself, so just hoping for some guidance about how to get it working. I'm not sure if the issue is with Syntastic or Rust.vim, etiher.

    When starting NeoVim 0.6.1 I receive the error

    Cannot source a directory: "/home/me/.config/nvim/plugin/repos/github.com/rust-lang/rust.vim"
    Error detected while processing /home/me/.config/nvim/plugin/repos/github.com/rust-lang/rust.vim/ftplugin/rust.vim:
    line   19:
    E174: Command already exists: add ! to replace it: CompilerSet setlocal <args>
    Error detected while processing /home/me/.config/nvim/plugin/repos/github.com/rust-lang/rust.vim/syntax_checkers/rust/cargo.vim:
    line   86:
    E121: Undefined variable: g:SyntasticRegistry
    Error detected while processing /home/me/.config/nvim/plugin/repos/github.com/rust-lang/rust.vim/syntax_checkers/rust/rustc.vim:
    line   45:
    E121: Undefined variable: g:SyntasticRegistry
    Error detected while processing /home/me/.config/nvim/plugin/repos/github.com/vim-syntastic/syntastic/syntax_checkers/perl6/perl6.vim:
    line   13:
    E488: Trailing characters: # Perl 6 is dead, long live Raku!
    
    • rust.vim version: Installed using dein. Unsure of the rust.vim version, but it has been downloaded in the last week, so is likely the most current version.

    Steps to reproduce: Occurs on NeoVim startup.

    ?

    Paste debugging info from the Rust Vim plugin via one of the following commands: :RustInfo, :RustInfoToClipboard, or :RustInfoToFile <filename>.

    RustInfo
    rust.vim Global Variables:
    let g:ftplugin_rust_source_path = v:null
    let g:loaded_syntastic_rust_cargo_checker = 1
    let g:loaded_syntastic_rust_filetype = v:null
    let g:loaded_syntastic_rust_rustc_checker = 1
    let g:rust_bang_comment_leader = v:null
    let g:rust_cargo_avoid_whole_workspace = v:null
    let g:rust_clip_command = v:null
    let g:rust_conceal = v:null
    let g:rust_conceal_mod_path = v:null
    let g:rust_conceal_pub = v:null
    let g:rust_fold = v:null
    let g:rust_last_args = v:null
    let b:rust_last_args = []
    let g:rust_last_rustc_args = v:null
    let b:rust_last_rustc_args = []
    let g:rust_original_delimitMate_excluded_regions = v:null
    let g:rust_playpen_url = v:null
    let g:rust_prev_delimitMate_quotes = v:null
    let g:rust_recent_nearest_cargo_tol = v:null
    let g:rust_prev_delimitMate_quotes = v:null
    let g:rust_recent_nearest_cargo_tol = v:null
    let g:rust_recent_root_cargo_toml = v:null
    let g:rust_recommended_style = v:null
    let g:rust_set_conceallevel = v:null
    let g:rust_set_conceallevel=1 = v:null
    let g:rust_set_foldmethod = v:null
    let g:rust_set_foldmethod=1 = v:null
    let g:rust_shortener_url = v:null
    let g:rustc_makeprg_no_percent = v:null
    let g:rustc_path = v:null
    let g:rustfmt_autosave = 1
    let g:rustfmt_autosave_if_config_present = v:null
    let g:rustfmt_command = 'rustfmt'
    let g:rustfmt_emit_files = 1
    let g:rustfmt_fail_silently = 0
    let g:rustfmt_options = ''
    let g:syntastic_extra_filetypes = ['rust']
    let g:syntastic_rust_cargo_fname = ''
    rustfmt 1.4.38-stable (9d1b210 2022-02-23)
    rustc 1.59.0 (9d1b2106e 2022-02-23)
    cargo 1.59.0 (49d8809dc 2022-02-10)
    
    Features: +acl +iconv +tui
    See ":help feature-compile"
       system vimrc file: "$VIM/sysinit.vim"
      fall-back for $VIM: "/usr/share/nvim"
    Run :checkhealth for more info
    ----
    Info from Syntastic:
    Syntastic version: 3.10.0-32 (Vim 800, Neovim, Linux)
    Info for filetype:
    Global mode: active
    Filetype  is active
    The current file will be checked automatically
    Available checkers: -
    Currently enabled checkers: -
    The current file will not be checked (file not readable / not local)     
    

    ?

    Reviewed by bicarlsen at 2022-04-29 14:02
  • 13. :Cargo command does not respect :vertical

    • rust.vim version: latest master at time of writing, 4aa69b8

    Steps to reproduce:

    • Run a Cargo command prefixed by :vertical, e.g. :vertical Cargo check

    Expected vs. actual behavior:

    • A vertical split should be made when Cargo is invoked with :vertical, but a horizontal split is made instead.
    Reviewed by agraven at 2022-04-11 12:59
  • 14. Question: is there a rust.vim equivalent to vim-go's `:GoRename`

    As per the title, the vim-go plugin allows you to replace an identifier globally across a project by executing :GoRename <new_name> while the cursor is over an identifier in your code.

    Is this something that exists already in the rust.vim plugin or does anyone know of any plans to support that?

    Thanks!

    Reviewed by Integralist at 2022-03-16 12:29
  • 15. `Cargo check` ignores `g:rust_cargo_check_all_features`

    When we add g:rust_cargo_check_all_features = 1 to .vimrc, Cargo check don't pass all-features

    Here is how Cargo check computes a cargo argument:

    https://github.com/rust-lang/rust.vim/blob/4aa69b84c8a58fcec6b6dad6fe244b916b1cf830/autoload/cargo.vim#L5-L19

    And here is how we build the internal checker: https://github.com/rust-lang/rust.vim/blob/4aa69b84c8a58fcec6b6dad6fe244b916b1cf830/syntax_checkers/rust/cargo.vim#L53-L64

    Seems we are missing these global vars check in autoload/cargo.vim. Maybe its a feature, and not a bug.

    rust.vim version

    https://github.com/rust-lang/rust.vim/commit/4aa69b84c8a58fcec6b6dad6fe244b916b1cf830

    Steps to reproduce

    1. Add let g:rust_cargo_check_all_features = 1 to $MYVIMRC and source it, if applicable
    2. Run :Cargo check

    Expected vs. actual behavior

    The cargo command should be cargo check --all-features, but it is just cargo check

    Debug info

    rust.vim Global Variables:
    
    let g:ftplugin_rust_source_path = v:null
    let g:loaded_syntastic_rust_cargo_checker = v:null
    let g:loaded_syntastic_rust_filetype = v:null
    let g:loaded_syntastic_rust_rustc_checker = v:null
    let g:rust_bang_comment_leader = v:null
    let g:rust_cargo_avoid_whole_workspace = v:null
    let g:rust_clip_command = v:null
    let g:rust_conceal = v:null
    let g:rust_conceal_mod_path = v:null
    let g:rust_conceal_pub = v:null
    let g:rust_fold = v:null
    let g:rust_last_args = v:null
    let b:rust_last_args = []
    let g:rust_last_rustc_args = v:null
    let b:rust_last_rustc_args = []
    let g:rust_original_delimitMate_excluded_regions = v:null
    let g:rust_playpen_url = v:null
    let g:rust_prev_delimitMate_quotes = v:null
    let g:rust_recent_nearest_cargo_tol = v:null
    let g:rust_recent_root_cargo_toml = v:null
    let g:rust_recommended_style = v:null
    let g:rust_set_conceallevel = v:null
    let g:rust_set_conceallevel=1 = v:null
    let g:rust_set_foldmethod = v:null
    let g:rust_set_foldmethod=1 = v:null
    let g:rust_shortener_url = v:null
    let g:rustc_makeprg_no_percent = v:null
    let g:rustc_path = v:null
    let g:rustfmt_autosave = 1
    let g:rustfmt_autosave_if_config_present = v:null
    let g:rustfmt_command = 'rustfmt'
    let g:rustfmt_emit_files = 1
    let g:rustfmt_fail_silently = 0
    let g:rustfmt_options = ''
    let g:syntastic_extra_filetypes = ['rust']
    let g:syntastic_rust_cargo_fname = v:null
    rustfmt 1.4.38-nightly (e95b10b 2022-03-13)
    
    rustc 1.61.0-nightly (e95b10ba4 2022-03-13)
    
    cargo 1.61.0-nightly (65c8266 2022-03-09)
    
    
    
    VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Feb 24 2022 18:41:57)
    Included patches: 1-4464
    Compiled by Arch Linux
    Huge version without GUI.  Features included (+) or not (-):
    +acl               +channel           +cscope            +ex_extra          -hangul_input      +linebreak         +mouse_dec         -mzscheme          +profile           -sodium            +tcl/dyn           +user_commands     +wildmenu
    +arabic            +cindent           +cursorbind        +extra_search      +iconv             +lispindent        +mouse_gpm         +netbeans_intg     -python            -sound             +termguicolors     +vartabs           +windows
    +autocmd           -clientserver      +cursorshape       -farsi             +insert_expand     +listcmds          -mouse_jsbterm     +num64             +python3/dyn       +spell             +terminal          +vertsplit         +writebackup
    +autochdir         -clipboard         +dialog_con        +file_in_path      +ipv6              +localmap          +mouse_netterm     +packages          +quickfix          +startuptime       +terminfo          +vim9script        -X11
    -autoservername    +cmdline_compl     +diff              +find_in_path      +job               +lua/dyn           +mouse_sgr         +path_extra        +reltime           +statusline        +termresponse      +viminfo           -xfontset
    -balloon_eval      +cmdline_hist      +digraphs          +float             +jumplist          +menu              -mouse_sysmouse    +perl/dyn          +rightleft         -sun_workshop      +textobjects       +virtualedit       -xim
    +balloon_eval_term +cmdline_info      -dnd               +folding           +keymap            +mksession         +mouse_urxvt       +persistent_undo   +ruby/dyn          +syntax            +textprop          +visual            -xpm
    -browse            +comments          -ebcdic            -footer            +lambda            +modify_fname      +mouse_xterm       +popupwin          +scrollbind        +tag_binary        +timers            +visualextra       -xsmp
    ++builtin_terms    +conceal           +emacs_tags        +fork()            +langmap           +mouse             +multi_byte        +postscript        +signs             -tag_old_static    +title             +vreplace          -xterm_clipboard
    +byte_offset       +cryptv            +eval              +gettext           +libcall           -mouseshape        +multi_lang        +printer           +smartindent       -tag_any_white     -toolbar           +wildignore        -xterm_save
       system vimrc file: "/etc/vimrc"
         user vimrc file: "$HOME/.vimrc"
     2nd user vimrc file: "~/.vim/vimrc"
          user exrc file: "$HOME/.exrc"
           defaults file: "$VIMRUNTIME/defaults.vim"
      fall-back for $VIM: "/usr/share/vim"
    Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
    Linking: gcc -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.34/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto -L/usr/local/lib -o vim -lm -ltinfo -lelf -lacl -lattr -lgpm -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.34/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib -L/usr/lib/perl5/5.34/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lut
    il -lc -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm
    
    Reviewed by vlopes11 at 2022-03-16 11:16
  • 16. [Bug] Incorrect angle bracket matching

    rust.vim version: latest

    It treats the angle brackets of the comparison operators as valid to match on, which is incorrect.

    Steps to reproduce:

    if 0 < 0 {
    } else if 0 > 0 {
    }
    

    If we put the cursor on any of the brackets above, it will match.

    Expected vs. actual behavior:

    Expectation: Use matchpairs defined by the user. Reality: rust.vim decides to do setlocal matchpairs+=<:> for whatever reason.

    Debug info:

    rust.vim Global Variables:
    
    let g:ftplugin_rust_source_path = v:null
    let g:loaded_syntastic_rust_cargo_checker = v:null
    let g:loaded_syntastic_rust_filetype = v:null
    let g:loaded_syntastic_rust_rustc_checker = v:null
    let g:rust_bang_comment_leader = v:null
    let g:rust_cargo_avoid_whole_workspace = v:null
    let g:rust_clip_command = v:null
    let g:rust_conceal = v:null
    let g:rust_conceal_mod_path = v:null
    let g:rust_conceal_pub = v:null
    let g:rust_fold = v:null
    let g:rust_last_args = v:null
    let b:rust_last_args = []
    let g:rust_last_rustc_args = v:null
    let b:rust_last_rustc_args = []
    let g:rust_original_delimitMate_excluded_regions = v:null
    let g:rust_playpen_url = v:null
    let g:rust_prev_delimitMate_quotes = v:null
    let g:rust_recent_nearest_cargo_tol = v:null
    let g:rust_recent_root_cargo_toml = v:null
    let g:rust_recommended_style = v:null
    let g:rust_set_conceallevel = v:null
    let g:rust_set_conceallevel=1 = v:null
    let g:rust_set_foldmethod = v:null
    let g:rust_set_foldmethod=1 = v:null
    let g:rust_shortener_url = v:null
    let g:rustc_makeprg_no_percent = v:null
    let g:rustc_path = v:null
    let g:rustfmt_autosave = 0
    let g:rustfmt_autosave_if_config_present = v:null
    let g:rustfmt_command = 'rustfmt'
    let g:rustfmt_emit_files = 1
    let g:rustfmt_fail_silently = 0
    let g:rustfmt_options = ''
    let g:syntastic_extra_filetypes = v:null
    let g:syntastic_rust_cargo_fname = v:null
    rustfmt 1.4.38-nightly (71226d7 2022-02-04)
    
    rustc 1.60.0-nightly (71226d717 2022-02-04)
    
    cargo 1.60.0-nightly (25fcb13 2022-02-01)
    
    
    NVIM v0.6.1
    Build type: Release
    LuaJIT 2.1.0-beta3
    Скомпилирован  builduser
    
    Features: +acl +iconv +tui
    See ":help feature-compile"
    
    Reviewed by alexmozaidze at 2022-02-07 18:49
  • 17. [Feature Request] Highlight integer literal suffixes differently

    It would be cool to have integer literal type suffixes highlighted differently. Why would this be useful? Consider this 15312f32, the f32 at the end gets jumbled with the numbers, making it harder to read. A workaround to this problem would be to use the holy underscore, but then it makes the expression longer by one character, truly disastrous! Please add a special highlighting.

    Reviewed by alexmozaidze at 2022-01-28 13:39
Related tags
Language Server Protocol (LSP) support for vim and neovim.
Language Server Protocol (LSP) support for vim and neovim.

For legacy python implementation, see branch master. LanguageClient-neovim Language Server Protocol support for vim and neovim. More recordings at Upd

May 23, 2022
N vim win! Neovim UI designed for Sway/i3.
N vim win! Neovim UI designed for Sway/i3.

Nwin This is an experimental Neovim UI that creates a new OS window for each Neovim window, all backed by the same neovim server. This enables perform

May 1, 2022
A vim profiling tool

vim-profiler ?? vim-profiler is a wrapper around the (n)vim --startuptime command, written in Rust. The binary is called vp and has only been tested o

Apr 25, 2022
Vim-fork focused on extensibility and usability
Vim-fork focused on extensibility and usability

Documentation | Chat | Twitter Neovim is a project that seeks to aggressively refactor Vim in order to: Simplify maintenance and encourage contributio

May 26, 2022
Convert VSCode themes to (Neo)Vim colorschemes
Convert VSCode themes to (Neo)Vim colorschemes

Djanho is a prototype which tries to convert VSCode themes to (Neo)Vim colorschemes. Features Handling of VSCode RGBA colors Out of the box conversion

May 16, 2022
Apprentice-vscode - a port of @romainl’s excellent Apprentice Vim colour scheme to VS Code
Apprentice-vscode - a port of @romainl’s excellent Apprentice Vim colour scheme to VS Code

Apprentice for VS Code apprentice-vscode is a port of @romainl’s excellent Apprentice Vim colour scheme to VS Code. The theme is available in two vari

May 24, 2022
Emacs configuration for Rust

Table of Contents Introduction Installation Melpa Manual installation Feature guide Indentation Code formatting Running / testing / compiling code Cli

May 21, 2022
Rust IDE support for Atom, powered by the Rust Language Server (RLS)

IDE-Rust Rust language support for Atom-IDE, powered by rust-analyzer. Features Auto-completion Diagnostics (errors and warnings from rustc) Document

May 26, 2022
rust-analyzer is a modular compiler frontend for the Rust language
rust-analyzer is a modular compiler frontend for the Rust language

rust-analyzer is a modular compiler frontend for the Rust language. It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust.

May 26, 2022
Rust language support in Atom - LOOKING FOR MAINTAINER, see #144

Rust language support in Atom Adds syntax highlighting and snippets to Rust files in Atom. Install Install the package language-rust in Atom (Preferen

May 2, 2022
Eclipse Corrosion - Rust edition in Eclipse IDE
Eclipse Corrosion - Rust edition in Eclipse IDE

Eclipse Corrosion Rust edition and debug in Eclipse IDE Corrosion is a Rust development plugin for the Eclipse IDE, providing a rich edition experienc

Apr 29, 2022
RustDT is an Eclipse based IDE for the Rust programming language:
RustDT is an Eclipse based IDE for the Rust programming language:

Project website: http://rustdt.github.io/ As of 2017, RustDT is no longer actively maintained, see this blog post for more information. If you are int

Mar 9, 2022
Rust development environment for Emacs
Rust development environment for Emacs

Rustic Table of Contents Rustic Intro Installation straight Compilation Faces rustc errors Rustfmt edition 2018 LSP Server Client eglot lsp-mode lsp-e

May 19, 2022
Better Rust/Cargo support for Flycheck

flycheck-rust — Flycheck for Rust This Flycheck extension configures Flycheck automatically for the current Cargo project. Setup Install from MELPA or

Mar 9, 2022
NetBeans Rust plugin

Rust NetBeans Plugin A NetBeans plugin for Rust. Linux / OSX Windows Requirements NetBeans 8.2.x Java 8+ Rust Cargo Rustup Features So far, it include

May 18, 2022
Rust plugin for the IntelliJ Platform

Rust plugin for the IntelliJ Platform Build Status Check Stable Beta Nightly Installation & Usage Available installation options and features are desc

May 25, 2022
Rust IDE
Rust IDE

This branch contains the development of a "new ride" that maintain a small impact on the ui library. This is for a few reasons. Can customize the colo

May 20, 2022
An IDE for Rust
An IDE for Rust

Introduction SolidOak is a simple IDE for Rust. See the website for binary releases. It has the following features: An embedded copy of Neovim as its

May 18, 2022
The official Sublime Text 3 package for the Rust Programming Language
The official Sublime Text 3 package for the Rust Programming Language

Rust Enhanced About This is a Sublime Text 3 package which supports Rust starting with version 1.0, it makes no attempt at supporting earlier incompat

May 19, 2022