knowledge › Rust

Getting Started

Installing Rust on Arch is a little weird because it doesn't use the officially supported method.

sudo pacman -S rustup
rustup toolchain install stable
rustup default stable

Vim integration

Install the official vim plugin with:

Plug 'rust-lang/rust.vim'

Then install the Rust CoC extension with:

:CocInstall coc-rls

Hello, Rust!

Now that Rust is installed and configured we can actually make something.

cargo new hello-rust

This creates a new folder called hello-rust with some files to get started with. When opening in vim for the first time it may prompt you to install RLS. Accept that and some more files/folders will be created, AFAIK right now it's safe to add these to .gitignore (usually target/).

Next you can modify the code in src/main.rs or simply run cargo run to compile and run the code.

Links