linux vim dd命令_vim命令和vi的区别

linux vim dd命令_vim命令和vi的区别Vim是从vi发展而来的文本编辑器,可以用颜色或底线等方式来显示一些特殊的信息。Vim是Linux中必不可少的工具,搭建网站修改配置文件时经常用到。本教程介绍Vim的模式和常用操作。背景信息Vim的各个模式介绍如下表所示:模式作用模式转换普通模式(NormalMode)在该模式下,您可以复制、粘贴、删除字符或行。运行vim打开文件时,即进入普通模式。在其他四个模式下,按Esc键…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

Vim是从vi发展而来的文本编辑器,可以用颜色或底线等方式来显示一些特殊的信息。Vim是Linux中必不可少的工具,搭建网站修改配置文件时经常用到。本教程介绍Vim的模式和常用操作。

背景信息 Vim的各个模式介绍如下表所示: 模式 作用 模式转换 普通模式 (Normal Mode)

在该模式下,您可以复制、粘贴、删除字符或行。 运行vim 打开文件时,即进入普通模式。 在其他四个模式下,按Esc键即进入普通模式。 插入模式 (Insert Mode)

在该模式下,您可以插入字符。 在普通模式下,按i,I,a,A,o,O中任一字符即进入插入模式。 说明 进入插入模式后,编辑器左下角会显示– INSERT –。 替换模式 (Replace Mode)

在该模式下,您可以替换字符。 在普通模式下,按R即进入替换模式。 说明 进入替换模式后,编辑器左下角会显示– REPLACE –。 可视模式 (Visual Mode)

在该模式下,您可以选择文本。命令(如,复制、替换、删除等)仅作用于选中的文档。 在普通模式下,按v即进入可视模式。 说明 进入可视模式后,编辑器左下角会显示– VISUAL –。 命令模式 (Command Mode)

在该模式下,您可以查找字符串、替换字符串、显示行号、保存修改、退出编辑器等。 在普通模式下,按:即进入命令模式。 Vim的常用操作包括以下三种: 插入 替换 删除 插入 基本命令: i:在当前字符的左边插入。 I:在当前行的行首插入 。 a:在当前字符的右边插入。 A:在当前行的行尾插入。 o:在当前行下面插入一个新行。 O:在当前行上面插入一个新行。 本示例中使用的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 示例一:在配置文件example.conf的第一行,插入Location。步骤如下: 运行vim example.conf命令打开文件,进入普通模式。 按i进入插入模式。 输入Location。 按回车键换行。 按Esc键退出插入模式。 按:wq保存文件并退出。 插入完成后,example.conf文件如下所示: Location

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 示例二:在配置文件example.conf第十行的行首,插入#。步骤如下: 运行vim example.conf命令打开文件,进入普通模式。 按:10将光标定位到第10行。 按I进入插入模式。 输入#。 按Esc键退出插入模式。 按:wq保存文件并退出。 插入操作完成后,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 示例三:在配置文件example.conf中,在Include conf.modules.d/.conf行的下一行插入LoadModule rewrite_module modules/mod_rewrite.so。步骤如下: 运行vim example.conf命令打开文件,进入普通模式。 运行/Include conf.modules.d/*.conf找到目标行。 按o进入插入模式。 输入LoadModule rewrite_module modules/mod_rewrite.so。 按Esc键退出插入模式。 按:wq保存文件并退出。 插入完成后,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 LoadModule rewrite_module modules/mod_rewrite.so 替换 基本命令:

R:替换光标高亮的字符,直至按下Esc键退出替换模式。

本示例使用的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中的AllowOverride None更改为AllowOverride All。

运行vim example.conf命令打开文件,进入普通模式。 运行/AllowOverride None找到目标。 移动光标至None的首字母。 按R进入替换模式。 输入All和一个空格。 说明 None中共包含4个字符,而All只包含3个字符,因此输入All之后,需再输入一个空格。 按Esc键退出替换模式。 按:wq保存文件并退出。 更改后的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 All 删除 基本命令: x:删除光标高亮的那一个字符。 nx(n为数字): 删除光标高亮的字符及其后面的n-1个字符。 dd:删除光标所在的那一行。 ndd(n为数字):删除光标所在行及其下面的n-1行。 本示例中使用的example.conf文件如下所示:

Listen: Allows you to bind Apache to specific IP addresses and/or

ports, instead of the default. See also the

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:80 Listen 80 示例一:在配置文件example.conf中,将#Listen 12.34.56.78:80行首的#删除。步骤如下: 运行vim example.conf命令打开文件,进入普通模式。 运行/#Listen 12.34.56.78:80找到目标,光标此时定位在#字符上。 按x删除#。 按:wq保存文件并退出。 删除完成后,example.conf文件如下所示:

Listen: Allows you to bind Apache to specific IP addresses and/or

ports, instead of the default. See also the

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:80 Listen 80 示例二:在配置文件example.conf中,将#Listen 12.34.56.78:80行和下一行的内容删掉。步骤如下: 运行vim example.conf命令打开文件,进入普通模式。 运行/#Listen 12.34.56.78:80找到目标。 按2dd删除以下内容。 #Listen 12.34.56.78:80 Listen 80 按:wq保存文件并退出。 删除完成后,example.conf文件如下所示:

Listen: Allows you to bind Apache to specific IP addresses and/or

ports, instead of the default. See also the

directive.

Change this to Listen on specific IP addresses as shown below to

prevent Apache from glomming onto all bound IP addresses.

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/190799.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • matlab 马赫带效应,matlab图像处理基础实例

    matlab 马赫带效应,matlab图像处理基础实例matlab图像处理基础实例·边缘检测(edge)边缘检测时先要把其他格式图像转化为灰度图像>>f=imread(lbxx.bmp);>>a=rgb2gray(f);>>[g,t]=edge(a,canny);>>imshow(g)·剪贴(imcrop)、subplot等imfinfocolormapsubimageimadd…

    2025年6月28日
    5
  • 西天取经意义初探_show concern about

    西天取经意义初探_show concern about构建DirectShow应用程序  本章节描述构建DirectShow应用程序所需的头文件和库。WindowsSDK中提供了最新的DirectShow头文件和库。头文件    所有的DirectShow应用程序都需要Dshow.h头文件,一些DirectShow接口可能还需要额外的头文件。库文件    调试版和发布版都是用相同的.lib文件。 F…

    2022年10月12日
    4
  • axios安装与基本方法

    axios安装与基本方法安装:1.npm安装:npminstallaxios2.在主入口文件main.js中引用:importaxiosfrom’axios’Vue.use(axios);3.在组件文件中的methods里使用:getNewsList(){this.axios.get(‘api/getNewsList’).then((response)=>{this.newsList=response.data.data;}).cat

    2025年6月1日
    2
  • Android Base64Encoder解决方案

    Android Base64Encoder解决方案publicclassBase64Encoder{ privatestaticfinalcharlast2byte=(char)Integer .parseInt(“00000011”,2); privatestaticfinalcharlast4byte=(char)Integer .parseInt(“00001111”,2); pri…

    2022年6月16日
    127
  • 全部覆盖棋盘7×7_acwing题库

    全部覆盖棋盘7×7_acwing题库给定一个 N 行 N 列的棋盘,已知某些格子禁止放置。求最多能往棋盘上放多少块的长度为 2、宽度为 1 的骨牌,骨牌的边界与格线重合(骨牌占用两个格子),并且任意两张骨牌都不重叠。输入格式第一行包含两个整数 N 和 t,其中 t 为禁止放置的格子的数量。接下来 t 行每行包含两个整数 x 和 y,表示位于第 x 行第 y 列的格子禁止放置,行列数从 1 开始。输出格式输出一个整数,表示结果。数据范围1≤N≤100,0≤t≤100输出样例:8 0输出样例:32#include&l

    2022年8月9日
    7
  • RHEL7/Centos7 i686/32bit glibc/stdc++ lib

    RHEL7/Centos7 i686/32bit glibc/stdc++ lib[hushui@HikvisionOSyum.repos.d]$sudoyuminstallglibc.i686Loadedplugins:fastestmirrorDeterminingfastestmirrorslocal|3.6kB00:00(1/2):local/group_gz…

    2022年6月5日
    44

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号