甚么是 Vim
我们从 Wiki 来看:
Vim is a free and open-source, screen-based text editor program.
In 2006, it was voted the most popular editor amongst Linux Journal readers;
Vim 就是 免费的 文字编辑器。
2006年,投票中 是最受欢迎的编辑器(editor)
设定测试的环境
设定步骤为:
C槽先建立一个资料夹 Linux_test使用 CD指令 移动目录使用 touch指令 产生资料1. 我们在C槽先建立一个资料夹 Linux_test
2. 使用 CD指令 移动目录
开头依样是在 c槽的 Linux_test 资料夹里面测试
输入指令: cd /mnt/c/Linux_test
cd /mnt/c/Linux_test
Linux_test 资料夹内是空的
3. 使用 touch指令 产生资料
输入指令: touch vim_test1
touch vim_test1
这样就跑出来 vim_test1
安装 Vim
输入指令: sudo apt install vim
sudo apt install vim
会跑出 要你输入密码,将一开始设定的密码写入
[sudo] password for ____ :
之后就安装完成了
简单的 Hellow world 测试
我们现在的目录是 "C:\Linux_test"
执行步骤为:
执行 Vim 编辑 vim_test1输入 "i" 进入编辑模式写 "Hellow world"按下 ESC 退出模式输入 ":" 进入命令指令模式输入 "wq" 存档后离开打开 vim_test1 资料看看1. 执行 Vim
输入指令: vim vim_test1
vim vim_test1
2. 输入 "i" 进入编辑状态
输入指令: i
i
3. 写 "Hellow world"
输入指令: Hellow world
Hellow world
4. 按下 ESC 退出模式
按下 ESC
5. 输入 ":" 进入命令指令状态
输入指令: :
:
6. 输入 "wq" 存档后离开
输入指令: wq
wq
7. 打开 vim_test1 资料看看