I'm trying to get tab completion support for rust programs in vim going. There are many descriptions on the net how to this and none of them work out-of-the-box in my environment. The first major roadblock I keep running into is that all seem to rely on or require rustup
. When I run it I get this error:
# curl https://sh.rustup.rs -sSf | sh
info: downloading installer
Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure
Warning: Not enforcing TLS v1.2, this is potentially less secure
warning: it looks like you have an existing installation of Rust at:
warning: /usr/local/bin
warning: rustup should not be installed alongside Rust. Please uninstall your existing Rust first.
warning: Otherwise you may have confusion unless you are careful with your PATH
warning: If you are sure that you want both rustup and your already installed Rust
warning: then please reply `y' or `yes' or set RUSTUP_INIT_SKIP_PATH_CHECK to yes
warning: or pass `-y' to ignore all ignorable checks.
error: cannot install while Rust is installed
This is because my system's (FreeBSD) package manager installs rust (1.50) while compiling Mozilla. I hesitate going down the path of multiple rust installations and being careful with my PATH
. These are the rust-related programs in /usr/local/bin
I can work with:
-rwxr-xr-x 1 root wheel 11762792 Feb 15 23:22 cargo
-rwxr-xr-x 1 root wheel 381104 Feb 15 23:22 cargo-clippy
-rwxr-xr-x 1 root wheel 1266240 Feb 15 23:22 cargo-fmt
-rwxr-xr-x 1 root wheel 6830672 Feb 15 23:22 clippy-driver
-rwxr-xr-x 1 root wheel 25513576 Feb 15 23:22 rls
-rwxr-xr-x 1 root wheel 789 Feb 15 23:22 rust-gdb
-rwxr-xr-x 1 root wheel 1944 Feb 15 23:22 rust-gdbgui
-rwxr-xr-x 1 root wheel 1072 Feb 15 23:22 rust-lldb
-rwxr-xr-x 1 root wheel 7264 Feb 15 23:22 rustc
-rwxr-xr-x 1 root wheel 7031776 Feb 15 23:22 rustdoc
-rwxr-xr-x 1 root wheel 7488904 Feb 15 23:22 rustfmt
Note that the rust language server rls
is already present.
Is there a rustup
-agnostic way of getting rust tab completion working? My vim version is 8.2.2569 and kept reasonably up-to-date. I would prefer a solution for vim instead of neovim. If it works for both, even better. I use the vim-plug plugin manager vim.plug
.
/usr/local/bin
or equivalent and put that in your path before/usr/bin
). b) is really not that hard and done all the time for various things. It's easy to reverse, temporarily disable, etc.'cmd': {server_info->['rustup', 'run', 'nightly', 'rls']},
. It is a twisty little maze of plugins and I have lost orientation. Maybe even misdiagnosed the root cause.