mac10.11+vim rust开发环境搭建
mac10.11+vim rust开发环境搭建
1、安装rust
打开终端 输入如下命令
curl -sf -L https://static.rust-lang.org/rustup.sh | sh
命令行安装可能失败,请到 [rust官网]下载安装安装完成后,输入以下命令
$ rustc –version
如果出现如下 :
rustc 1.3.0 (9a92aaf19 2015-09-15)(恭喜安装成功)
2、安装macvim
2.1、首先安装home-brew包管理工具
请参考 [我的Mac开发环境配置]
2.2、安装macvim
1.下载macvim:我的网盘分享macvim7.4 密码: fjtr
2.解压macvim:解压后三个文件
1)macvim(放入application文件夹);
2)mvim(放入/usr/local/bin);
[注] 方法一:终端命令:“cd /mvim文件路径“
“$sudo cp -f mvim /usr/local/bin/“
方法二:终端命令:”defaults write com.apple.finder AppleShowAllFiles -bool true” 打开显示隐藏文件
找到路径 /usr/local/bin, 将mivm文件复制于里面
终端命令:“defaults write com.apple.finder AppleShowAllFiles -bool false“ 关闭显示隐藏文件
3)readerme(看完删除)
3.打开macvim:方法一:终端命令:“mvim“
方法二:双击MacVim应用程序图标
3、配置macvim rust 开发环境
3.1、首先安装vim插件管理的一个插件vundle,详细用法请参考[github]
1) 在终端输入如下命令
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
2) 配置插件
在你的用户目录(Users/你的用户名)创建 .vimrc文件,添加下面配置内容
set nocompatible " be iMproved, required
filetype off " required" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
" Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
" Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
" Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
" Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
" Plugin 'user/L9', {'name': 'newL9'}" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
3)启动vim,执行:PluginInstall
3.2、安装rust.vim 插件,此插件提供文件检查和语法高亮功能
1) 在 ~/.vimrc 中Plugin ‘rust-lang/rust.vim’ (必须放在call vundle#begin() 和call vundle#end()之间 )
2) 执行命令 vim +PluginInstall +qall
详细请参考 https://github.com/VundleVim/Vundle.vim
3.3安装racer(详细请参考[phildawes/racer])
1) 打开终端,创建/usr/local/rust目录,命令如下
mkdir /usr/local/rust
进入/usr/local/rust目录,命令如下
cd /usr/local/rust
2) 安装racer 执行一下命令
git clone https://github.com/phildawes/racer.git //克隆库
cd racer //进入racer目录下
cargo build –release //编译生成二进制文件
编译结果放在 ./target/release/racer下
3)下载源码 https://www.rust-lang.org/install.html
我将源码放在了/usr/local/rust/src下
4)设置 RUST_SRC_PATH 源码所在目录 , 执行以下命令
export RUST_SRC_PATH=/usr/local/rust/src/rustc-1.3.0/src
5) 在命令行测试
./target/release/racer complete std::io::B
3.4 安装 vim-racer插件,补全提示功能(详细请参考[racer-rust/vim-racer])
1) 在 ~/.vimrc 中Plugin ‘racer-rust/vim-racer’ (必须放在call vundle#begin() 和call vundle#end()之间 )
2)执行命令 vim +PluginInstall +qall
3)添加 g:racer_cmd 和 $RUST_SRC_PATH 变量 到 ~/.vimrc
set hidden
let g:racer_cmd = "/usr/local/rust/racer/target/release/racer"
let $RUST_SRC_PATH="/usr/local/rust/src/rustc-1.3.0/src"
3.5 安装 Vim number toggle 提供显示绝对行号和相对行号(详细请参考[vim-numbertoggle])
1) 在 ~/.vimrc 中Plugin ‘git://github.com/jeffkreeftmeijer/vim-numbertoggle.git’ (必须放在call vundle#begin() 和call vundle#end()之间 )
2)执行命令 vim +PluginInstall +qall
3.6 安装 NERDtree 显示左侧问价菜单(详细请参考[NERDtree])
1) 在 ~/.vimrc 中Plugin ‘Plugin ‘https://github.com/scrooloose/nerdtree.git’ (必须放在call vundle#begin() 和call vundle#end()之间 )
2)执行命令 vim +PluginInstall +qall
3)用鼠标点击左侧菜单
在 ~/.vimrc 中添加以下配置代码
"enable mouse support
set mouse=a
3.7 贴上我简单的vim rust开发环境配置.vimrc文件
set nocompatible " be iMproved, required
set number
"rust-racer
set hidden
let g:racer_cmd = "/usr/local/rust/racer/target/release/racer"
let $RUST_SRC_PATH="/usr/local/rust/src/rustc-1.3.0/src"
"nerdtree
autocmd VimEnter * NERDTree
autocmd BufEnter * NERDTreeMirror"CTRL-t to toggle tree view with CTRL-t
nmap <silent> <C-t> :NERDTreeToggle<CR>
"Set F2 to put the cursor to the nerdtree
nmap <silent> <F2> :NERDTreeFind<CR>
"enable mouse support
set mouse=a
filetype off " required" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'Plugin 'rust-lang/rust.vim'
Plugin 'racer-rust/vim-racer'
Plugin 'git://github.com/jeffkreeftmeijer/vim-numbertoggle.git'
Plugin 'https://github.com/scrooloose/nerdtree.git'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
"Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
"Plugin 'L9'
" Git plugin not hosted on GitHub
"Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
"Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
"Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
"Plugin 'user/L9', {'name': 'newL9'}" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
本人主要参考 https://github.com/ivanceras/rust-vim-setup,如果英语好的,请直接看github上的
mac10.11+vim rust开发环境搭建相关推荐
- rk3568安卓11系统之开发环境搭建
目录 前言 一.解压sdk 二.更新系统并安装依赖 1.更新系统 2.安装依赖 三.编译3568 sdk 1.准备编译环境 2.选择产品 3.IO-Domain GPIO电压配置 4.开始编译sdk ...
- Rust开发环境搭建(Linux)
1.使用Rustup安装 执行如下命令 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 执行结果如下: 在这里使用默认的安 ...
- Rust语言开发环境搭建详细教程
目录 一.Rust简介 1.rust历史 2.rust吉祥物 二.Rust开发环境搭建 1.C++环境安装 2.Rust下载 3.rust安装 4.rust环境检测 查看rust版本 查看cargo版 ...
- Golang开发环境搭建-Vim篇
Golang开发环境搭建-Vim篇 转自:http://tonybai.com/2014/11/07/golang-development-environment-for-vim/ 虽说sublime ...
- 在Windows上搭建Rust开发环境——Clion篇
文章目录 在Windows上搭建Rust开发环境--Clion篇 安装mingw64 安装Rust hello world 安装Clion 使用Clion创建并调试项目 在Windows上搭建Rust ...
- Android NDK 开发环境搭建(二)----来源http://www.cnblogs.com/zdz8207/archive/2012/11/27/android-ndk-install.htm
随笔- 116 文章- 0 评论- 106 android 最新 NDK r8 在window下开发环境搭建 安装配置与使用 详细图文讲解,完整实际配置过程记录(原创) android 最新 N ...
- rust开发环境_Rust开发环境搭建
1.Rust概述 按照百度百科的说法,Rust是一门系统编程语言 ,专注于安全 ,尤其是并发安全,支持函数式和命令式以及泛型等编程范式的多范式语言.Rust在语法上和C++类似 ,但是设计者想要在保证 ...
- 【Tiny4412】 Tiny4412开发环境搭建
创建一个ARM目录 mkdir /disk/A9 -p 接下来你需要准备以下的东西 1.arm-linux-gcc-4.5.1 交叉编译器 2.linux-3.5-tiny4412 ...
- Apache Spark1.1.0部署与开发环境搭建 - Mark Lin
Spark是Apache公司推出的一种基于Hadoop Distributed File System(HDFS)的并行计算架构.与MapReduce不同,Spark并不局限于编写map和reduce ...
最新文章
- poj1741(树的点分治)
- angular监听路由跳转
- 记录一次最新版MySQL-server-5.6.20-1.el6.x86_64.rpm的安装
- oracle报错编码
- 零基础如何学爬虫技术?
- 电脑卡顿不流畅是什么原因_为什么安卓系统用久了会卡,苹果系统却依然流畅?原因找到了!...
- RabbitMQ入门学习系列(六) Exchange的Topic类型
- linux 读分区表文件,Linux 磁盘分区表、文件系统查看和操作
- 最简单的视音频播放示例1:总述
- java spring 连接池配置_Spring中常用的连接池配置
- getmenuiteminfo无法读取内存_简单科普系列—内存为什么需要组双通道原理及其作用...
- Java面试应该准备的知识点系列一
- sql中的字符串拼接
- 【20211206】【信号处理】时频分析 —— 短时傅里叶变换(STFT)
- JS禁止右键、CTRL+C、查看源文件
- CMM 关键过程域
- Python数据库开发之-pymysql模块
- fastdfs磁盘满,如何清除文件?
- 安装SQL Server 2017遇到“以前的某个安装需要重新引导计算机以便使更改生效”的问题
- 如何使用 Docker Buildx Bake 创建复杂的镜像构建管道