`
universsky
  • 浏览: 99516 次
文章分类
社区版块
存档分类
最新评论

vi 帮助文档 man vi

 
阅读更多


vi or vedit Command

Purpose

Edits files with a full-screen display.

Syntax

{ vi | vedit } [ -l ] [ -R ] [ -tTag ] [ -v ] [ -wNumber] [ -yNumber ] [ -r [ File ] ] [{ + | -c } { Subcommand
} ] [ File ... ]

Description

The vi command starts a full-screen editor based on the underlying ex editor. Therefore, ex subcommands can be
used within the vi editor. The vedit command starts a version of the vi editor intended for beginners. In the
vedit editor, the report option is set to 1, the showmode option is set, and the novice option is set, making it
a line editor.

You start the vi editor by specifying the name of the file or files to be edited. If you supply more than one
File parameter on the command line, the vi editor edits each file in the specified order. The vi editor on an
existing file displays the name of the file, the number of lines, and the number of characters at the bottom of
the screen. In case of multibyte locales the number of characters need to be interpreted as the number of bytes.

Since the vi editor is a full-screen editor, you can edit text on a screen-by-screen basis. The vi editor makes
a copy of the file you are editing in an edit buffer, and the contents of the file are not changed until you
save the changes. The position of the cursor on the display screen indicates its position within the file, and
the subcommands affect the file at the cursor position.

vi Editor Limitations

The following list provides the maximum limits of the vi editor. These counts assume single-byte characters.
* 256 characters per global command list
* 2048 characters in a shell escape command
* 128 characters in a string-valued option
* 30 characters in a tag name
* 128 map macros with 2048 characters total
* 1,048,560 lines silently enforced
* The macro name and the macro text are limited to 100 characters. Note: The vi editor supports a maximum of
2 GB edit buffer.

vi Editing Modes

The vi editor operates in the following modes:
command mode
When you start the vi editor, it is in command mode. You can enter any subcommand except those designated
for use only in the text input mode. The vi editor returns to command mode when subcommands and other modes
end. Press the Esc key to cancel a subcommand.
text-input mode
You use the vi editor in this mode to add text. Enter text input mode with any of the following
subcommands: the a subcommand, A subcommand, i subcommand, I subcommand, o subcommand, O subcommand, cx
subcommands (where the x represents the scope of the subcommand), C subcommand, s subcommand, S subcommand,
and R subcommand. After entering one of these subcommands, you can enter text into the editing buffer. To
return to command mode, press the Esc key for normal exit or press Interrupt (the Ctrl-C key sequence) to
end abnormally.
last-line mode
Subcommands with the prefix : (colon), / (slash), ? (question mark), ! (exclamation point), or !! (two
exclamation points) read input on a line displayed at the bottom of the screen. When you enter the initial
character, the vi editor places the cursor at the bottom of the screen, where you enter the remaining
characters of the command. Press the Enter key to run the subcommand, or press Interrupt (the Ctrl-C key

sequence) to cancel it. When the !! prefix is used, the cursor moves only after both exclamation points are
entered. When you use the : prefix to enter the last-line mode, the vi editor gives special meaning to the
following characters when they are used before commands that specify counts:
%
All lines regardless of cursor position
$
Last line
.
Current line
Note: The history of last line mode subcommands can be navigated using the Up and Down Arrow keys.

Customizing the vi Editor

You can customize the vi editor by:
* Setting vi editor options
* Defining macros
* Mapping keys
* Setting abbreviations

Setting vi Editor Options

The following list describes the vi editor options you can change with the set command. The default setting for
these options is off. If you turn on one of these toggle options, you can turn it off again by entering the word
no before the option. If you want to discontinue the autowrite vi option, enter noaw, where no turns off the
option and aw specifies the autowrite option. Note: Do not include parentheses when entering vi options.
vi Option (Abbreviation)
Description
autoindent (ai)
Indents automatically in text input mode to the indentation of the previous line by using the spacing
between tab stops specified by the shiftwidth option. The default is noai. To back the cursor up to the
previous tab stop, press the Ctrl-D key sequence. This option is not in effect for global commands.
autoprin (ap)
Prints the current line after any command that changes the editing buffer. The default is ap. This option
applies only to the last command in a sequence of commands on a single line and is not in effect for global
commands.
autowrite (aw)
Writes the editing buffer to the file automatically before the :n subcommand, the :ta subcommand, the
Ctrl-A, Ctrl -], and Ctrl -T key sequences, and the ! subcommand if the editing buffer changed since the
last write subcommand. The default is noaw.
backtags (bt)
Allows the Ctrl-T subcommand to return the file editing position to the location where the previous Ctrl-]
subcommand was issued. If nobacktags is set, then Ctrl-T is the same as Ctrl-]. The default is backtags.
beautifying text (bf)
Prevents the user from entering control characters in the editing buffer during text entry (except for tab,
new-line, and form-feed indicators). The default is nobf. This option applies to command input.
closepunct (cp=)
Handles a list of closing punctuation, especially when wrapping text (wraptype option). Precedes
multicharacter punctuation with the number of characters; for example, cp=3..;)}. The vi command does not
split closing punctuation when wrapping.
directory (dir=)
Displays the directory that contains the editing buffer. The default is dir = /var/tmp.
edcompatible (ed)
Retains g (global) and c (confirm) subcommand suffixes during multiple substitutions and causes the r
(read) suffix to work like the r subcommand. The default is noed.
exrc (exrc)
If not set, ignores any .exrc file in the current directory during initialization, unless the current
directory is that named by the HOME environment variable. The default is noexrc.
hardtabs (ht=)

Tells the vi editor the distance between the hardware tab stops on your display screen. (This option must
match the tab setting of the underlying terminal or terminal emulator.) The default is ht=8.
history (hist=)
Sets the limit on last line mode history commands. The initial value is hist=32. The history size is zero
(hist=0) for the tvi command.
ignorecase (ic)
Ignores distinction between uppercase and lowercase while searching for regular expressions. The default is
noic.
linelimit (ll=)
Sets the maximum number of lines, as per the -y command-line option. This option only is effective if used
with the .exrc file or the EXINIT environment variable.
lisp (lisp)
Removes the special meaning of ( ), { }, [ [, and ] ] and enables the = (formatted print) operator for s-
expressions, so you can edit list processing (LISP) programs. The default is nolisp.
list (list)
Displays text with tabs (^I) and the marked end of lines ($). The default is nolist.
magic (magic)
Treats the . (period), [ (left bracket), and * (asterisk) characters as special characters when searching
for a pattern. In off mode, only the ( ) (parentheses) and $ (dollar sign) retain special meanings.
However, you can evoke special meaning in other characters by preceding them with a \ (backslash). The
default is magic.
mesg (mesg)
Turns on write permission to the terminal if set while in visual mode. This option only is effective if
used with the .exrc file or the EXINIT environment variable. The default is on.
modeline (modeline)
Runs a vi editor command line if found in the first five or the last five lines of the file. A vi editor
command line can be anywhere in a line. For the vi editor to recognize a command line, the line must
contain a space or a tab followed by the ex: or vi: string. The command line is ended by a second :
(colon). The vi editor tries to interpret any data between the first and second colon as vi editor
commands. The default is nomodeline.
novice
Indicates whether you are in novice mode. You cannot change the value by using the set command.
number (nu)
Displays lines prefixed with their line numbers. The default is nonu.
optimize (opt)
Speeds the operation of terminals that lack cursor addressing. The default is noopt.
paragraphs (para=)
Defines vi macro names that start paragraphs. The default is para=IPLPPPQPP\ LIpplpipnpbp. Single-letter
nroff macros, such as the .P macro, must include the space as a quoted character if respecifying a
paragraph.
partialchar (pc=)
Appears in the last display column where a double-wide character would not be displayed completely. The
default character is - (minus sign).
prompt
Prompts for a new vi editor command when in command mode by printing a : (colon). The default is on.
readonly (ro)
Sets permanent read-only mode. The default is noreadonly.
redraw (redraw)
Simulates a smart workstation on a dumb workstation. The default is nore.
remap
Allows defining macros in terms of other macros. The default is on.
report (re=)
Sets the number of times you can repeat a command before a message is displayed. For subcommands that
produce many messages, such as global subcommands, the messages are displayed when the command sequence
completes. The default is report=5.
scroll (scr=)
Sets the number of lines to be scrolled when the user scrolls up or down. The default is 1/2 of the window
size, rounded down.

sections (sect=)
Defines vi macro names that start sections. The default is sect=NHSHHH\ HUuhsh+c. Single-letter nroff
macros, such as the .P macro, must include the space as a quoted character if respecifying a paragraph.
shell (sh=)
Defines the shell for the ! subcommand or the :! subcommand. The default is the login shell.
shiftwidth (sw=)
Sets the distance for the software tab stops used by the autoindent option, the shift commands ( > and < ),
and the text input commands ( the Ctrl-D and Ctrl-T key sequences). This vi option only affects the
indentation at the beginning of a line. The default is sw=8.
showmatch (sm)
Shows the ( (matching left parenthesis) or { (left bracket) as you type the ) (right parenthesis) or }
(right bracket). The default is nosm.
showmode (smd)
Displays a message to indicate when the vi editor is in input mode. The default is nosmd.
slowopen (slow)
Postpones updating the display screen during inserts. The default is noslow.
tabstop (ts=)
Sets the distance between tab stops in a displayed file. The default is ts=8.
tags (tags =)
Defines the search path for the database file of function names created using the ctags command. The
default is tags=tags\ /usr/lib/tags.
term (term=)
Sets the type of workstation you are using. The default is term=$TERM, where $TERM is the value of the TERM
shell variable.
terse (terse)
Allows the vi editor to display the short form of messages. The default is noterse.
timeout (to)
Sets a time limit of two seconds on an entry of characters. This limit allows the characters in a macro to
be entered and processed as separate characters when the timeout option is set. To resume use of the macro,
set the notimeout option. The default is to.
ttytype
Indicates the tty type for the terminal being used. You cannot change this value from the vi editor.
warn (warn)
Displays a warning message before the ! subcommand executes a shell command if it is the first time you
issued a shell command after changes were made in the editing buffer but not written to a file. The default
is warn.
window (wi=)
Sets the number of lines displayed in one window of text. The default depends on the baud rate at which you
are operating: 600 baud or less, 8 lines; 1200 baud, 16 lines; higher speeds, full screen minus 1 line.
wrapmargin (wm=)
Sets the margin for automatic word wrapping from one line to the next. The default is wm=0. A value of 0
turns off word wrapping.
wrapscan (ws)
Allows string searches to wrap from the end of the editing buffer to the beginning. The default is ws.
wraptype (wt=)
Indicates the method used to wrap words at the end of a line. The default value is general. You can specify
one of the following four values:
general
Allows wraps on word breaks as white space between two characters. This setting is the default.
word
Allows wraps on words.
rigid
Allows wraps on columns and before closing punctuation.
flexible
Allows wraps on columns, but one character of punctuation can extend past the margin.
writeany (wa)
Turns off the checks usually made before a write subcommand. The default is nowa.

To see a list of the vi editor settings that have changed from the default settings, enter set and press the

spacebar. Press the Enter key to return to the command mode.

To see a complete list of the vi editor settings, enter set all. Press the Enter key to return to the command
mode.

To turn on a vi editor option, enter set Option. This command automatically returns you to the command mode.

To turn on multiple vi editor options, enter set Option Option Option. This command turns on the three
designated vi editor options and returns you to the command mode.

To turn off a vi editor option, enter set noOption. This command automatically returns you to the command mode.

To change the value of a vi editor option, enter set Option=Value. This command automatically returns you to the
command mode.

You can use the :set subcommand of the vi editor to set options for this editing session only, or to set options
for this editing session and all future editing sessions.

To set or change vi editor options for this editing session only, enter the :set subcommand from the command
line.

To set vi options for all editing sessions, put the :set subcommand in the EXINIT environment variable in the
.profile file (read by the shell on login) or put the set subcommand into a .exrc file. The vi editor first
looks for the EXINIT environment variable and runs its commands. If the EXINIT environment variable does not
exist, the vi editor then looks for the $HOME/.exrc file and runs its commands. Last, and regardless of any
previous results, the vi editor looks for the local .exrc file and runs its commands. Note: This process is true
except with the tvi command (trusted vi). In this instance, the vi editor looks for and runs only the /etc/.exrc
file.

For information about changing an option by setting the EXINIT environment variable, see the description of
environment variables in the environment file.

The .exrc file can contain subcommands of the form set Option=Value; for example:

set cp=3 . . ;

To include a comment in the .exrc file, use a " (double quotation mark) as the first character in the line.

Defining Macros

If you use a subcommand or sequence of subcommands frequently, you can use the vi editor to define a macro that
issues that subcommand or sequence.

To define a macro, enter the sequence of subcommands into a buffer named with a letter of the alphabet. The
lowercase letters a through z overlay the contents of the buffer, and the uppercase letters A through Z append
text to the previous contents of the buffer, allowing you to build a macro piece by piece.

For example, to define a buffer macro named c that searches for the word corner and makes the third line after
the word corner the current line, enter the following command:

o /corner/+3

Then press the Esc key and enter the following command:

"c

where c is the name of the buffer macro.

To add text to the previous contents of the defined buffer, enter the o viSubcommand, press the Esc key, and

enter "CapitalLetter, where the CapitalLetter variable specifies an uppercase letter A through Z. For example,
to build a buffer macro named T that searches for the word corner and allows you to add more commands, enter the
following command:

o corner

Then press the Esc key and enter the following command:

"T

where T is the name of the buffer macro. You can repeat this process at any time to add more vi subcommands to
the same buffer.

For example, to add commands that move the cursor to the previous line and delete that line, enter the following
command:

o -dd

where - (minus sign) means to move the cursor up one line, and dd means to delete the current line. Press the
Esc key and enter the following command:

"Tdd

To start the macro, enter @Letter, where the Letter variable specifies the letter name of the buffer macro you
want to use. To use the same macro again, enter @@ (two at symbols). For example, enter @T to start the T buffer
macro and run the search, move cursor, and delete line commands. Enter @@T to start the T buffer macro again.

The character set used by your system is defined by the collation table. This table affects the performance of
vi macros.

Mapping Keys

You can use the :map, :map!, and :ab subcommands to map a keystroke to a command or a sequence of commands. The
:map subcommand is used in the command mode. The :map! and :ab subcommands are used in the text input mode. You
can map keys for this editing session and all future editing sessions or only for the current editing session
from either mode.

To map keys for all future editing sessions, put the subcommand into a $HOME/.exrc file. Each time you start the
vi editor, it reads this file. The mapping remains in effect for every editing session.

To map keys for the current editing session only from the command mode, start the subcommand during the vi
editor session. To map keys for the current editing session only from the text input mode, enter the subcommand
on the command line during the vi editor session. The mapping remains in effect only for the current editing
session. Attention: If you use an IBM(R) 3161 ASCII display station, IBM(R) 3163 ASCII display station, or
IBM(R) 3101 ASCII display station, the default key-mapping of the vi editor can cause you to lose data. To see
the default mapping, issue a :map subcommand. Specific problems arise with the Esc-J or Shift-J key sequence.
These key sequences delete all information from the current position of the cursor to the end of the file. To
avoid problems, change this key sequence using a .exrc file.

The :map, :map!, and :ab subcommands are defined and used as follows:
:map
Defines macros in the command mode. The :map subcommand allows you to run a specified command or sequence
of commands by pressing a single key while in the vi editor.

To map keys in the command mode, start the vi editor with an empty editing buffer and do not name a vi file
using the vi command or type anything into the buffer after the vi editor starts. You can use the :map
subcommand to do the following:
* To map a character to a sequence of editing commands, enter:

:map Letter viSubcommand
* To unmap a character previously mapped in command mode, enter:

:unmap Letter
* To display a list of current mappings for the command mode, enter

:map
The following keys are not used by the vi editor, but are available for use with the :map subcommand in the
command mode:
* Letters g, K, q, V, and v
* Control key sequences Ctrl-A, Ctrl-K, Ctrl-O, Ctrl-W, and Ctrl-X
* Symbols _ (underscore), * (asterisk), \ (backslash), and = (equal sign)
Although you can map a key that is already used by the vi editor, the key's usual function is not available
as long as the map is in effect. Some terminals allow you to map command sequences to function keys. If you
are in LISP mode, the = (equal sign) cannot be used because it is used by the vi editor.

To map the letter v to the sequence of commands that would locate the next occurrence of the word map and
change it to the word MAP, enter the following command:

:map v /map<Ctrl-V><Enter>cwMAP<Ctrl-V><Esc><Ctrl-V><Enter>

The previous example instructs the vi editor to locate the next occurrence of map (/map<Ctrl-V><Enter>),
change map to MAP (cwMAP), end the change-word subcommand (<Ctrl-V><Esc>), and enter the command (<Ctrl-
V><Enter>).

Requirement: To prevent the vi editor from interpreting the Enter key, it must be preceded by the Ctrl-V
key sequence when being mapped. This condition is also true of the Esc, Backspace, and Delete keys.

To map the control characters Ctrl-A, Ctrl-K, and Ctrl-O, simultaneously press the Ctrl key and the letter.
For example, to map the Ctrl-A key sequence to the sequence of commands that saves a file and edits the
next one in a series, enter the following command:

:map <Ctrl-A> :w<Ctrl-V><Enter>:n<Ctrl-V><Enter>

To map the control characters Ctrl-T, Ctrl-W, and Ctrl-X, you must first escape them with the Ctrl-V key
sequence.
To map the | (pipe symbol), you must first escape it with the two Ctrl-V key sequences, as illustrated by
the following example that maps the character g to the sequence of commands that escapes to the shell,
concatenates the file /etc/motd, and pipes the output to the wc command:

:map g :!cat /etc/motd <Ctrl-V><Ctrl-V>| wc<Ctrl-V><Enter>

If your terminal permits you to map function keys, you must reference them with the #number key sequence to
designate the number of the function key that you want to map. In the following example, the F1 function
key is mapped to the sequence of commands that deletes a word and moves the cursor three words down:

:map #1 dwwww

In order for function key mapping to work, the output of the function key for your terminal type must match
the output defined in the terminfo file. These definitions are denoted by the kfnumber entries, where kf1
represents the F1 function key, kf2 represents the F2 function key, and so on. If the output that you get
when you press the function key does not match this entry, you must use the terminal's setup mode to
correct the settings to match these terminal database entries before any mapping can occur.

You can also map certain keyboard special keys, such as the Home, End, Page Up, and Page Down keys. For
most terminals, these keys are already mapped in the vi editor. You can verify this mapping by using the
:map subcommand. If these keys are not already mapped, you can use the :map subcommand as follows:

:map <Ctrl-V><End> G

:map <Ctrl-V><Home> 1G
:map <Ctrl-V><PageUp> <Ctrl-F>
:map <Ctrl-V><PageDown> <Ctrl-B>

To get a listing of all current maps in the command mode, enter the :map subcommand. The preceding examples
are then displayed as follows:

v v /map<Ctrl-M>cwMAP<Ctrl-[>Ctrl-M>
<Ctrl-A> <Ctrl-A> :w<Ctrl-M>:n<Ctrl-M>
g g :!cat /etc/motd | wc <Ctrl-M>

Tip: The Ctrl-V and Enter key sequence is displayed as the Ctrl-M key sequence, and the Ctrl-V and Esc key
sequence is displayed as the Ctrl-[ key sequence.
:map!
Maps character strings to single keys while in text input mode. To map keys in the text input mode, start
the vi editor with an empty editing buffer and do not name a vi file using the vi command or type anything
into the buffer after the vi editor starts. You can use the :map! subcommand to do the following:
* To map a letter to one or more vi strings in text input mode, enter:

:map! Letter String
* To unmap a letter previously mapped in text input mode, enter:

:unmap! Letter
* To display a list of existing strings that are mapped to specific keys in text input mode, enter:

:map!
Typing the mapped key while in text input mode produces the specified string. The Ctrl-V and Esc key
sequence puts you into command mode, backs up to the beginning of the current word (bbw), and starts the cw
(change-word) subcommand. For example:

:map! % <Ctrl-V><Esc>bbwcw

When typing text, if you realize that you have mistyped a word, you can change it by pressing the %
(percent) key and retyping the word. You are automatically returned to insert mode.

Important: Be careful when choosing keys to be used for the :map! subcommand. Once keys have been mapped,
they can no longer be input as text without first issuing the :unmap! subcommand.
:ab
Maps a key or sequence of keys to a string of characters for use in the text input mode. The :ab subcommand
is useful when inputting text that possesses several repetitive phrases, names, or titles.

The following example replaces the word city with the phrase Austin, Texas 78759 whenever it is typed in
text input mode and followed by a white space, period, or comma:

:ab city Austin, Texas 78759

For example, if while inputting text, you type the following:

My current residence is city.

Pressing the Tab key expands the word city to read:

My current residence is Austin, Texas 78759.

The abbreviation is not expanded within a word. For example, if you type My current residence iscity, the
word iscity is not expanded.

If the :map! subcommand is used to map abbreviations for insert mode, then all occurrences of the
abbreviations are expanded regardless of where it occurs. If you used the :map! subcommand for the

preceding example (:map! city Austin, Texas 78759), then whenever you type the word city, regardless of
what precedes or follows, the word will be expanded to Austin, Texas 78759. Therefore, the word iscity
becomes isAustin, Texas 78759.

Important: Be careful when choosing the keys that are used for the :ab subcommand. Once keys are defined,
they can no longer be input as text without first issuing the :unab subcommand.

Setting Abbreviations

The set command has behavior similar to the map! command except that the set command substitutes the string for
the abbreviation only when the abbreviation is a separate word. You can use the set command of the vi editor to:
* List existing abbreviations
* Remove an abbreviation
* Set (define) an abbreviation Tip: Start the vi editor with an empty editing buffer. Do not name a vi file
using the vi command or type anything into the buffer after the vi editor starts. Press the Esc key to be
sure you are in the command mode.
To list abbreviations
Enter the :ab command to list existing abbreviations. Press the Enter key to return to command mode.
To remove abbreviations
Enter the :anabAbbreviation command to remove an abbreviation, where the Abbreviation variable
specifies the character string you do not want abbreviated any more.
To set (define) an abbreviation
Enter the :ab Abbreviation String command to set an abbreviation, where the Abbreviation variable
specifies the character string being defined as an abbreviation and the String variable specifies
the character string being abbreviated. The abbreviation can be substituted for the string only when
the abbreviation is a separate word.

For example, if you enter the :ab kn upper command and then type acknowledge while in the text input
mode, the set abbreviation string is not started because the kn string in the word acknowledge is
not a separate word.

However, if you type the :ab kn upper command and then type make the kn line all kncase while in the
text input mode, the result is make the upper line all uppercase.

分享到:
评论

相关推荐

    oracle man vi vim emacs收集

    例如,输入`man vi`可以查看vi编辑器的使用手册,帮助你理解和掌握vi的基本操作。 vi(Visual Editor)是早期的文本编辑器,简洁而强大,是许多老派程序员的首选。vi有两模式:命令模式和插入模式。在命令模式下,...

    man文档汉化

    在Linux操作系统中,`man`命令是用于查看系统命令、函数、系统调用等的在线帮助文档。然而,默认情况下,这些文档通常是英文的,对于非英语使用者来说可能会有些不便。`man`文档汉化就是将这些英文文档翻译成中文,...

    linux实验报告vi编辑器的使用.pdf

    4. 重新进入Vi,对该文件进行修改,然后存盘,退出Vi,重新编译该文件,如果编译通过了,可以使用 ./file运行该程序 5. 运行man date &gt; file10 ;然后vi file10 ؛使用x,dd等命令删除某些文本行 6. 使用u命令复原...

    vi.rar_vi

    通过阅读`man vi`获取官方手册,或者参考网上的教程,如《VI编辑器教程》等,可以帮助你更好地掌握VI的高级特性。 VI编辑器虽然初学者可能觉得不易上手,但其强大的功能和高效的操作方式使其成为许多系统管理员和...

    vi操作集锦.docx

    对于初学者,学习vi的命令手册(`man vi`)是非常有用的,手册中包含了详细的命令解释和示例。 在文件内容中,提到了一些与vi无关但非常基础的Linux命令,这些命令在日常的系统管理中同样重要: - `man`:查看命令...

    AIX_BASIC_VI命令详解.pdf

    本文档主要介绍AIX系统中的VI编辑器及其使用方法,并涵盖了UNIX系统中的`man`命令的详细解释与应用技巧。AIX作为IBM的一种UNIX操作系统,广泛应用于服务器环境,其文本编辑工具VI(Visual Editor)是用户管理文件...

    经典收藏 VI使用技巧 绝对好用

    以下是一些实用的VI使用技巧,旨在帮助你提升编辑效率。 1. **查看符号定义** 使用VI可以方便地查看函数原型、结构声明和宏定义。首先,你需要安装`ctags`软件包,然后在源代码目录下运行`ctags -R`生成`tags`文件...

    linux Vi操作测试内容

    12. **另存为新文件**:在不退出`vi`的情况下,将文件另存为`man.test.config`,需要在命令模式下输入`:w man.test.config`。 13. **删除字符**:移动到第25行并删除15个字符,先输入`25G`定位到25行,然后在正常...

    vi使用技巧及常用操作

    - `man`: 查看命令的帮助文档。 - `tab`: 自动补全命令或文件名。 - `cal`: 显示日历。 - `cat`: 查看文件内容。 - `more`: 分页查看文件内容。 - `source`: 使环境变量设置生效。 vi编辑器虽然学习曲线较...

    man中文手册安装

    学习linux离不开学习那些命令,学习命令看man...vi /usr/bin/zhman #!/bin/bash #name=zhman export LANG=zh_CN man -M /usr/local/zhman/share/man/zh_CN $1 保存。 5.更改zhman文件权限 chmod 777 /usr/bin/zhman

    VIM 中文说明文档 MAN v1.7.0

    VIM中文说明文档MAN v1.7.0是专为那些在阅读英文文档时遇到困难的用户设计的,它提供了详尽的中文解释,帮助用户更好地理解和使用VIM。 VIM的核心特性包括: 1. **模式切换**:VIM有多种操作模式,如命令模式、...

    linux系统命令及VI用法

    - `man & info`: 查阅命令的手册页或信息文档。 - `LANG=en`: 设置语言环境为英文。 - `sync`: 同步文件系统缓冲区到磁盘。 - `date`: 显示或设置系统日期和时间。 - `cal`: 显示日历,如`cal 2006`显示2006年...

    Linux基础命令帮助文档

    - `man`: 获取命令的帮助文档,如`man ls`。 通过熟练掌握这些基本命令,你将在Linux环境中游刃有余。不断实践和探索,你会发现Linux是一个强大且灵活的工作平台。在学习过程中,利用`man`命令随时查阅帮助文档,...

    Linux vi使用手册.rar

    本手册将详细介绍vi的基本用法和高级特性,帮助你更好地理解和运用这一工具。 一、vi编辑器的启动与退出 1. 启动vi:在命令行输入`vi`或`vim`(Vi IMproved的缩写)后跟文件名即可打开文件,如`vim filename.txt`...

    Linux实验六vi文本编辑器[整理].pdf

    VI 文本编辑器是 Linux 操作系统中的一种功能强大的文本编辑器,广泛应用于编程、文档编辑和文件管理等领域。下面是 VI 文本编辑器的实验操作指南: 一、VI 文本编辑器基本操作 * 启动 VI 文本编辑器:在 Linux ...

    Vi 二十分钟速成.pdf

    - `/\&lt;man\&gt;`:查找man,而不是Batman或manic等其他字符串。 - `?word`:向光标之前寻找一个字符串名称为word的字符串。 - `n`:重复上次的搜索。 - `N`:按相反方向重复上次的搜索。 - `:1,$s/word1/word2/g`:从第...

    vi 学习笔记——取自《Unix&Linux;大学教程》

    1. 通过命令man vi查看手册页。如果显示的是vim的说明书页,则说明系统上安装的是vim。 2. 通过输入vi或vim启动编辑器。如果屏幕显示的是空白或者帮助信息,那么系统上可能是vim。如果只显示vi编辑器的界面,则很...

    linux-VI学习

    - 学习VI,可以参考官方手册页`man vi`或`man vim`。 - "VI Pocket Reference"、"Learning the VI Editor"等书籍是深入理解VI的好资料。 - 在线教程如"Vim Adventures"提供互动式学习体验。 通过熟练掌握VI编辑...

    AIX常用命令及VI的使用.rar_111_AIX常用命令及VI的使用_aix常用命令_vi

    2. **cd**:改变工作目录,帮助用户在不同路径之间切换。 3. **pwd**:显示当前工作目录,确认用户所在的目录位置。 4. **mkdir**:创建新目录,用于组织文件和子目录。 5. **rm**:删除文件或目录,小心使用以免...

    郑州轻工业大学软件工程linux实验报告2

    使用man命令获取date帮助信息并将其重定向到file10,再用Vi编辑file10,执行删除、复原、修改等操作;编写一个名为"exam2"的Shell脚本,实现创建目录、切换目录和显示时间等功能;利用Vi编写一个包含date、cal、pwd...

Global site tag (gtag.js) - Google Analytics