使用 Vim 设置 Rust 的正确方法
Right way to set up Rust using Vim
我终于开始研究 Rust 并想澄清一些关于如何很好地设置所有内容的问题。
我在 Linux 上使用 vim,发现了一个很好的语法高亮插件。自动补全有点麻烦,使用 phildawes/racer.
插件需要 Rust 的 src 位置,这实际上没什么大不了的,如果我知道所述目录在哪里(我只在使用建议的 curl <...> | sh
安装时找到了二进制文件和库).源代码可以单独下载,尽管我没有找到 Rust 的安装来设置源代码,例如/usr/local/src/rust 只有二进制文件和库。
其次,我查看了 Cargo 文档,但没有找到任何外部依赖项被克隆到的位置(这不是源目录吗?)
还应该更新 Rust 源代码吗?手动设置所有内容有点蹩脚吗?
克隆Rust存储库并自己构建是精髓吗?
The plugin needs setting up the src location for rust which is in fact not that big of a deal, if I would know where said directory was
我也找不到资源。如果您只想要没有所有历史记录的来源:
对于 1.0.0,
git clone --depth=1 --branch 1.0.0 --single-branch https://github.com/rust-lang/rust/
或每晚
git clone --depth=1 --single-branch https://github.com/rust-lang/rust/
Second I've looked through the cargo docs and and didn't find anything to where the extern dependencies are cloned into (wouldn't this be the source directory?)
在标准安装中,您的主目录中有一个目录 .cargo
,其中包含 git/checkouts
用于克隆的包。
尽管如此,您可能应该尝试 multirust,这使您可以轻松管理 ~/.multirust
中的多个 Rust 安装。
使用 multirust,您的板条箱结帐可能在例如~/.multirust/toolchains/nightly/cargo/git/checkouts
,不是 ~/.cargo/git/checkout
。
Is the quint essence to clone the rust repository and build it yourself?
不,幸运的是,这不再是必需的,除非您在 compiler/stdlibs 上工作或尝试交叉编译。使用 multirust,更新减少到 multirust update
或 multirust update nightly
,等等
我终于开始研究 Rust 并想澄清一些关于如何很好地设置所有内容的问题。
我在 Linux 上使用 vim,发现了一个很好的语法高亮插件。自动补全有点麻烦,使用 phildawes/racer.
插件需要 Rust 的 src 位置,这实际上没什么大不了的,如果我知道所述目录在哪里(我只在使用建议的 curl <...> | sh
安装时找到了二进制文件和库).源代码可以单独下载,尽管我没有找到 Rust 的安装来设置源代码,例如/usr/local/src/rust 只有二进制文件和库。
其次,我查看了 Cargo 文档,但没有找到任何外部依赖项被克隆到的位置(这不是源目录吗?)
还应该更新 Rust 源代码吗?手动设置所有内容有点蹩脚吗?
克隆Rust存储库并自己构建是精髓吗?
The plugin needs setting up the src location for rust which is in fact not that big of a deal, if I would know where said directory was
我也找不到资源。如果您只想要没有所有历史记录的来源:
对于 1.0.0,
git clone --depth=1 --branch 1.0.0 --single-branch https://github.com/rust-lang/rust/
或每晚
git clone --depth=1 --single-branch https://github.com/rust-lang/rust/
Second I've looked through the cargo docs and and didn't find anything to where the extern dependencies are cloned into (wouldn't this be the source directory?)
在标准安装中,您的主目录中有一个目录 .cargo
,其中包含 git/checkouts
用于克隆的包。
尽管如此,您可能应该尝试 multirust,这使您可以轻松管理 ~/.multirust
中的多个 Rust 安装。
使用 multirust,您的板条箱结帐可能在例如~/.multirust/toolchains/nightly/cargo/git/checkouts
,不是 ~/.cargo/git/checkout
。
Is the quint essence to clone the rust repository and build it yourself?
不,幸运的是,这不再是必需的,除非您在 compiler/stdlibs 上工作或尝试交叉编译。使用 multirust,更新减少到 multirust update
或 multirust update nightly
,等等