If you use Linux or BSD terminal for coding (like me), probably you use Emacs, so here you find the steps for configuring Emacs for developing RUST applications.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shAfter installation, run the below command:
source "$HOME/.cargo/env"And then check the RUST version by below command:
rustc --versionFor more information about the above command, please see the RUST website.
-
Install build-essential:
sudo apt install build-essential git -y
-
Install
RUSTsource code:rustup component add rust-src
-
Install
rust-analyzer server:git clone https://github.com/rust-analyzer/rust-analyzer.git -b release cd rust-analyzer cargo xtask install --server -
update
~/.emacs: Add the below configuration to your.emacs:(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") ("melpa" . "https://melpa.org/packages/")))
-
Install Emacs packages:
use-packageM-x: As you know, On Debian, first pressEscand then pressx.↩: Is the Enter Key.M-x package-refresh-contents ↩ M-x package-install ↩ use-package ↩
-
Update
~/.emacs:copy this file to your
~/.emacs
cargo new hello_world
cd hello_world/
emacs -nw src/main.rsFor the first time, wait a while for Emacs to be ready to use (depending on your internet speed).
