Vim基本命令和常用操作-阿里云服务器ECS使用教程 | |||||||||||||||||||||
产品推荐: 1、安全稳定的云服务器租用,2核/2G/5M仅37元,点击抢购>>>; 2、高防物理服务器20核/16G/50M/500G防御仅350元,点击抢购>>> 3、百度智能建站(五合一网站)仅880元/年,点击抢购>>> 模板建站(PC+手机站)仅480元/年,点击抢购>>> 4、阿里云服务器2核2G3M仅99元/年、2核4G5M仅199元/年,新老同享,点击抢购>>> 5、腾讯云服务器2核2G4M仅99元/年、新老同享,点击抢购>>> 点击这里进入阿里云ECS官方页面,立即免费体验云服务器ECS>>> Vim是从vi发展而来的文本编辑器,可以用颜色或底线等方式来显示一些特殊的信息。Vim是Linux中必不可少的工具,搭建网站修改配置文件时经常用到。本教程介绍Vim编辑器的基本命令和常用操作。 背景信息Vim的各个模式介绍如下表所示:
Vim的常用操作包括以下三种:
插入基本命令:
本示例中使用的example.conf文件,如下所示: # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by `httpd -l') do not need # to be loaded here. # # Example:# LoadModule foo_module modules/mod_foo.so # Include conf.modules.d/*.conf
替换基本命令: R:替换光标高亮的字符,直至按下 本示例使用的example.conf文件,如下所示: # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords:# Options FileInfo AuthConfig Limit # AllowOverride None 示例:将配置文件example.conf中的
删除基本命令:
本示例中使用的example.conf文件如下所示: # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the <VirtualHost> # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.XX:XX:80Listen 80
|