可视化编辑器_有用的Vi编辑器命令(可视编辑器)

可视化编辑器

The vi editor also named as Visual Editor is one of the oldest screen-based editor and older version of vim editor used by many Unix/Linux users. It can be used from any unix based terminal interfacing. Since, the vi editor is not as a WYSIWYG, a user doesn’t have formatting capabilities such as creating paragraphs, changing fonts, line centering, etc…

vi编辑器 也被称为Visual Editor是许多Unix / Linux用户使用的最古老的基于屏幕的编辑器之一和较旧版本的vim编辑器 。 可以从任何基于unix的终端接口使用它。 由于vi编辑器不像WYSIWYG那样,用户没有格式化功能,例如创建段落,更改字体,行居中等。

Here, in this article, I have mentioned only those vi editor commands that are standard and most useful. It states, Starting vi, moving around with vi commands, editing files with vi editing commands, and colon “:” commands:

在本文中,我仅提到了那些标准且最有用的vi编辑器命令。 它指出,启动vi,使用vi命令移动,使用vi编辑命令编辑文件,并使用冒号“ ”命令:

Opening a file using vi editor:

使用vi编辑器打开文件:

Simply enter the following command at the terminal command line to open single or multiple files:

只需在终端命令行输入以下命令即可打开单个或多个文件:

vi myfileone myfiletwo

vi myfileone myfiletwo

where myfileone and myfiletwo are the names of the files which you want to open.

其中myfileone和myfiletwo是您要打开的文件的名称。

Moving around with the vi editor commands:

使用vi编辑器命令移动:

Moving around is one of the challenging tasks for beginners in vi editor. In order to do so, place the vi editor in command mode simply by pressing the “Esc” key. Following are the commands that can move the cursor in vi editor.

对于vi编辑器的初学者来说,四处移动是一项具有挑战性的任务。 为此,只需按“ Esc”键即可将vi编辑器置于命令模式。 以下是可以在vi编辑器中移动光标的命令。

CommandsActions
h or ←Moves the cursor to left
l or →Moves the cursor to right
j or ↓Moves the cursor down
k or ↑Moves the cursor up
^F or PageDownMoves screen one page down
^B or PageUpMoves screen one page up
^UMoves screen half a page up.
^DMoves screen half a page down
^EMoves the screen one line down
^YMoves the screen one line up
+Sends to the beginning of the next line
Sends to the beginning of the previous line
0 (zero)Sends to the beginning of the current line
$Sends to the end of the current line
}Sends to the next blank line
{Sends to the previous blank line
[[Sends to the beginning of the file
]]Sends to the end of the file
Switch you between beginning of file and current line
bSends punctuation mark or one word back
BSends one word back , including punctuation marks
eSends to the end of the next word or punctuation mark
EGoes to the end of the next word, including punctuation marks
ggGoes to the top of the file
GGoes to the end of the file
^HGoes one character back, including newlines
HGoes to the top of the current page
^PGoes one line up
LGoes to the bottom of the current page
wGoes to the beginning of the next word or punctuation mark
WGoes to the beginning of the next word, including punctuation marks
^ZSuspends the vi; You can use the “fg” command to resume
ZZSave the file and exit.
指令 动作
h或← 向左移动光标
l或→ 向右移动光标
j 或 ↓ 向下移动光标
k 或 ↑ 向上移动光标
^ F或PageDown 将屏幕向下移动一页
^ B或PageUp 将屏幕向上移动一页
^ U 将屏幕向上移动半页。
^ D 将屏幕向下移动半页
^ E 将屏幕向下移动一行
^ Y 将屏幕向上移动一行
+ 发送到下一行的开头
发送到上一行的开头
0(零) 发送到当前行的开头
$ 发送到当前行的末尾
} 发送到下一个空白行
{ 发送到上一个空白行
[[ 发送到文件的开头
]] 发送到文件末尾
在文件开头和当前行之间切换
b 返回标点符号或一个单词
发回一个单词,包括标点符号
Ë 发送到下一个单词或标点符号的末尾
Ë 转到下一个单词的末尾,包括标点符号
gg 转到文件顶部
G 转到文件末尾
^ H 返回一个字符,包括换行符
H 转到当前页面的顶部
^ P 向上一行
大号 转到当前页面的底部
w 转到下一个单词或标点符号的开头
w ^ 转到下一个单词的开头,包括标点符号
^ Z 挂起vi; 您可以使用“ fg ”命令恢复
Z Z 保存文件并退出。

Editing files using vi editor commands:

使用vi编辑器命令编辑文件:

To edit a file in vi editor, simply place the editor into a command mode. In order to edit a file in vi, place the editor into command mode.

要在vi编辑器中编辑文件,只需将编辑器置于命令模式即可。 为了在vi中编辑文件,请将编辑器置于命令模式。

back-spaceRemoves the character before the cursor
delRemoves the character mentioned under the cursor
iInserts text under the cursor
IInserts text under the cursor starting from the beginning of the current line
aInserts text starting after current character
AInserts text starting at the end of the line after the last character
ccRemoves the whole line and moves into insert mode
cwRemoves the current word and moves into insert mode.
CDeletes to the end of line and moves to insert mode.
YYank, copy current line to buffer
ddRemoves the current line
dwRemoves the current word
DRemoves current line (but leave the newline)
JJoins the next line with the current line
oInserts after the current line
OInserts before the current line
pPastes the lines in the buffer (from Y, dd, or x) after the current line
PPastes the lines in the buffer before the current line
rcOverwrites with the character c, or replaces the current character
RChange to overwrite mode
sRemoves the current character and moves into insert mode
SRemoves the current line and moves into insert mode
uUndo the last activity
USwitch you between undoing and redoing the last edit
vVisual: starts the selection for a “d” (delete) or “Y” (yank). Simply move in the direction using movement keys after typing “v” to see the selection
VVisual line: selects the current line for deletion or Yank
xRemoves the character under the cursor
XRemoves the character after the cursor
~Capitalize the current character
==Unindents the current line by typing the equal sign two times
.Repeats the last command
F1Shows online help
退格键 删除光标之前的字符
德尔 删除光标下方提到的字符
一世 在光标下方插入文本
一世 从当前行的开头开始在光标下方插入文本
一个 在当前字符之后插入文本
一个 在最后一个字符之后的行末插入文本
抄送 删除整行并进入插入模式
连续波 删除当前单词并进入插入模式。
C 删除到行尾并进入插入模式。
ÿ 拖动,将当前行复制到缓冲区
dd 删除当前行
dw 删除当前单词
d 删除当前行(但保留换行符)
Ĵ 将下一行与当前行连接
Ø 在当前行之后插入
Ø 在当前行之前插入
p 将当前行之后的行(从Yddx )粘贴到缓冲区中
P 将各行粘贴到当前行之前的缓冲区中
rc 用字符c覆盖,或替换当前字符
[R 更改为覆盖模式
s 删除当前字符并进入插入模式
小号 删除当前行并进入插入模式
ü 撤消上一个活动
ü 在撤消和重做上一次编辑之间切换
v 视觉:开始选择“ d ”(删除)或“ Y ”(猛击)。 键入“ v ”后,只需使用移动键在方向上移动即可查看选择
V 可视行:选择要删除或Yank的当前行
X 删除光标下的字符
X 删除光标后的字符
大写当前字符
== 通过两次键入等号使当前行缩进
重复上一条命令
F1 显示在线帮助

Using colon “:” vi commands: 

使用冒号“:” vi命令:

:wWrites to the file; If file name is not given on the command line, it will complain
:w file-nameSaves the file to specified filename
:qQuit. In vim editor, also exits from help.
:q!Quits without saving.
:wqWrites to the file and quit (same as “ZZ” command)
:w 写入文件; 如果在命令行上未提供文件名,它将抱怨
:w文件名 将文件保存到指定的文件名
:q 退出。 在vim编辑器中,也从帮助中退出。
:q! 退出而不保存。
:wq 写入文件并退出(与“ ZZ ”命令相同)

cPanel Web Hosting UK

翻译自: https://www.eukhost.com/blog/webhosting/useful-vi-editor-commands-visual-editor/

可视化编辑器

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值