47 lines
853 B
Markdown
47 lines
853 B
Markdown
---
|
||
title: Basic Usage
|
||
localeTitle: 基本用法
|
||
---
|
||
## VIM基本用法
|
||
|
||
### 打开文件
|
||
|
||
* 运行vim或vi并打开给定的文件名。
|
||
|
||
### 插入模式
|
||
|
||
* 打开页面后,输入I,您将在屏幕底部看到“插入模式”文本。从这里,您可以对文件的文本进行任何更改。
|
||
|
||
### 保存存档
|
||
|
||
* :W
|
||
|
||
### 保存并退出
|
||
|
||
* :X
|
||
* SHIFT ZZ
|
||
* :WQ
|
||
|
||
### 如果没有更改,则退出文件
|
||
|
||
* :q
|
||
|
||
### 退出文件并撤消所做的任何更改
|
||
|
||
* :Q!
|
||
|
||
### 显示行号
|
||
|
||
* :设nu
|
||
|
||
### 不显示行号
|
||
|
||
* :设置nonu
|
||
|
||
### 根据使用的编程语言添加语法颜色
|
||
|
||
* :语法上
|
||
|
||
## 关于Vim
|
||
|
||
Vim是基本上在CLI模式下使用的文本编辑器。但现在编辑器也有各种版本。有 还有GVIM,它是VIM的图形版本。 vi是主编,然后改进并命名为VI改进了Vim。 |