目录
1.github项目地址
https://github.com/microsoft/edit
Windows界面效果:
Linux界面效果
可以直接用鼠标点击,非常方便!
注:构建方法写在README中,英语好的读者可以直接看Build Instructions
下面给出中文教程
2.安装和配置rust
由于Edit使用Rust语言编写,因此需要先安装和配置rust
https://www.rust-lang.org/tools/install
官网给出的命令:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
按Enter进行默认安装
安装nightly工具链
rustup install nightly
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
设置环境变量
export RUSTC_BOOTSTRAP=1
3.克隆仓库
git clone https://github.com/microsoft/edit.git
4.自动化build
先切换到edit仓库目录
cd edit
输入以下命令
cargo build --config .cargo/release.toml --release
5.运行edit
使用cargo编译时,产生的可执行文件在target/release中
切换到上述目录:
cargo target/release
会看到有一个可执行文件
./edit
6.效果展示
服务器版运行界面如下:
注:上面的菜单栏可以直接用鼠标点击,非常方便
7.将edit添加到系统命令中
之前在OS4.【Linux】基本指令入门(3)文章讲过
先确保服务器中没有edit命令
记录下edit的路径
将生成的可执行文件移动到系统的命令目录/usr/bin
sudo mv edit /usr/bin
之后就能通过edit命令打开Edit编辑器