Wednesday, August 6, 2025

Latest Posts

Racer in Spanish: Basic Words Every Racing Enthusiast Should Know.

Okay, so today I wanted to mess around with getting Rust code completion working in different editors. The tool that makes this happen is called Racer. I’d heard of it before but never actually tried setting it up. Time to change that!

Racer in Spanish: Basic Words Every Racing Enthusiast Should Know.

Getting Racer Itself

First things first, I needed to install Racer itself. It’s a Rust program, so I figured I could just use Cargo, Rust’s package manager, to grab it. I ran:

cargo install racer

And… it started compiling a bunch of stuff. You know, the usual Rust thing. Took a few minutes, but eventually, it finished without any errors. Cool, Racer should be installed now. I typed racer in my terminal, and yep, it spat out a help message. So far, so good.

Setting up VS Code

Next, I wanted to get Racer working with VS Code, which is the editor I use most of the time these days. I already had the Rust extension installed, which I think is called “rust-analyzer” now. After reading the docs a bit, it turned out that this extension comes with Racer built in, you just need to point it to the Racer binary and Rust source code.

I went into VS Code’s settings and found the options for the Rust extension. There were two important ones:

Racer in Spanish: Basic Words Every Racing Enthusiast Should Know.
  • : This is where I needed to put the path to the racer executable.
  • : This is where I needed to put the path to the Rust source code.

I was able to find the path to the racer executable by running which racer in my terminal. I pasted that into the first setting. I already had Rust installed via rustup, so I know I can get the path to the source code by running rustup which --toolchain nightly rustc. After that, I just replace the rustc at the end with src.

After changing these settings, I restarted VS Code just to be sure. Then I opened up a Rust project I’d been working on. I typed the name of a struct I defined, followed by a dot, and bam! A list of its fields popped up! It worked! Autocomplete for Rust in VS Code, finally!

Trying out Vim

Just for kicks, I decided to see if I could get Racer working in Vim as well. I used to use Vim all the time, and still do for quick edits sometimes. Turns out there’s a Vim plugin for Racer, too.

I use vim-plug to manage my plugins, so I added this line to my .vimrc:

Plug 'racer-rust/vim-racer'

Racer in Spanish: Basic Words Every Racing Enthusiast Should Know.

Then I ran :PlugInstall in Vim to install it.

The plugin’s instructions said I needed to set two variables in my .vimrc:

  • g:racer_cmd: Path to the racer executable.
  • g:rust_src_path: Path to the Rust source code.

I already knew these paths from setting up VS Code, so I just copied them over to my .vimrc. Saved it, restarted Vim, and opened up a Rust file. Typed a variable name, a dot, and… boom! Autocomplete suggestions in Vim, just like that!

Wrapping Up

So yeah, getting Racer set up was way easier than I expected. I now have Rust code completion working in both VS Code and Vim. Now I don’t have to try so hard to remember the exact names of types and methods. Pretty sweet!

It is worth saying that using rustup to manage my Rust installation made this whole process a lot simpler. If you’re not using it, you probably should be! Makes life much better. Anyway, I hope this little adventure of mine helps someone else out there trying to get their Rust environment set up. Happy coding, folks!

Racer in Spanish: Basic Words Every Racing Enthusiast Should Know.

Latest Posts

Don't Miss