Linux工具-vim教程 | ||||||||||||||||||
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.56.78:80Listen 80
|