Basic "vi" features

转载 2012年03月22日 08:42:42

To see the original article please refer to link:

One edits a file in vi by issuing the command: vi file-to-edit.txt

The vi editor has three modes, command mode, insert mode and command line mode.

  1. Command mode: letters or sequence of letters interactively command vi. Commands are case sensitive. The ESC key can end a command.
  2. Insert mode: Text is inserted. The ESC key ends insert mode and returns you to command mode. One can enter insert mode with the "i" (insert), "a" (insert after), "A" (insert at end of line), "o" (open new line after current line) or "O" (Open line above current line) commands.
  3. Command line mode: One enters this mode by typing ":" which puts the command line entry at the foot of the screen.

Partial list of interactive commands:

Cursor movement:
Keystrokes Action
h/j/k/l Move cursor left/down/up/right
spacebar Move cursor right one space
-/+ Move cursor down/up in first column
ctrl-d Scroll down one half of a page
ctrl-u Scroll up one half of a page
ctrl-f Scroll forward one page
ctrl-b Scroll back one page
M (shift-h) Move cursor to middle of page
H Move cursor to top of page
L Move cursor to bottom of page
Move cursor a word at a time
Move cursor ahead 5 words
Move cursor back a word at a time
Move cursor back a word at a time
Move cursor back 5 words
Move cursor to end of word
Move cursor ahead to the end of the 5th word
0 (zero) Move cursor to beginning of line
$ Move cursor to end of line
) Move cursor to beginning of next sentence
( Move cursor to beginning of current sentence
G Move cursor to end of file
% Move cursor to the matching bracket.
Place cursor on {}[]() and type "%".
Use the matchit or xmledit plug-in to extend this capability to XML/XHTML tags.
'. Move cursor to previously modified line.
'a Move cursor to line mark "a" generated by marking with keystroke "ma"
'A Move cursor to line mark "a" (global between buffers) generated by marking with keystroke "mA"
]' Move cursor to next lower case mark.
[' Move cursor to previous lower case mark.

Editing commands:

Keystrokes Action
i Insert at cursor
a Append after cursor
A Append at end of line
ESC Terminate insert mode
u Undo last change
U Undo all changes to entire line
o Open a new line
Delete line
Delete 3 lines.
D Delete contents of line after cursor
C Delete contents of line after cursor and insert new text. Press esc key to end insertion.
Delete word
Delete 4 words
cw Change word
x Delete character at cursor
r Replace character
R Overwrite characters from cursor onward
s Substitute one character under cursor continue to insert
S Substitute entire line and begin to insert at beginning of line
~ Change case of individual character
Increment number under the cursor.
Decrement number under the cursor.
/search_string{CR} Search for search_string
?search_string{CR} Search backwards (up in file) for search_string
/\<search_string\>{CR} Search for search_word
Ex: /\<s\>
Search for variable "s" but ignore declaration "string" or words containing "s". This will find "string s;", "s = fn(x);", "x = fn(s);", etc
n Find next occurrence of search_word
N Find previous occurrence of search_word
. repeat last command action.

Terminate session:

  • Use command: ZZ
    Save changes and quit.
  • Use command line: ":wq"
    Save (write) changes and quit.
  • Use command line: ":w"
    Save (write) changes without quitting.
  • Use command line: ":q!"
    Ignore changes and quit. No changes from last write will be saved.
  • Use command line: ":qa"
    Quit all files opened.

【翻译】动态图像监测开源代码 motion 学习-----Motion Guide - Basic Features(motion的基本特性)(一)

Motion Guide - Basic Features This topic consists of the following subtopics:CaptureDeviceOptio...

【翻译】动态图像监测开源代码 motion 学习-----Motion Guide - Basic Features(motion的基本特性)(二)

原文链接  点击打开链接 Motion Guide - Basic Features(基本特性)

Linux vi and vim editor: Tutorial and advanced features

原文来自 本来打算翻译的,但是发现都是比较基本的语句,翻译了反而没不翻译的...
  • cdjlove
  • cdjlove
  • 2013年04月07日 22:12
  • 1448

Basic vi Commands [zz]

Basic vi Commands What is vi ?The default editor that comes with the UNIX operating system is ca...


  • 2011年11月14日 19:00
  • 2.1MB
  • 下载

网络分析之转弯要素(Turn Features)

转弯要素图层 转弯要素是用在network Analysis中的一种限制车道左转、右转、或者回头使用的一个要素类,有了这个类我们就能对我们日常路径分析能起到更好的模拟。 新建要素类中,最常用到的就...
  • 2014年01月03日 11:38
  • 2107

keras系列︱图像多分类训练与利用bottleneck features进行微调(三)

不得不说,这深度学习框架更新太快了尤其到了Keras2.0版本,快到Keras中文版好多都是错的,快到官方文档也有旧的没更新,前路坑太多。 到发文为止,已经有theano/tensorflow...


特征点检测和匹配是计算机视觉中一个很有用的技术。在物体检测,视觉跟踪,三维常年关键等领域都有很广泛的应用。这一次先介绍特征点检测的一种方法——FAST(features from accelerate...

Syntax features 语法特性(一)

语法特性 Genero BDL 是一种和英语类似的编程语言,很容易编写和阅读。 大小写不敏感 Genero BDL 是大小写不敏感的,就是大写字母和小写字母是一样的意思,除非在引号内。用双引号(...


1.批量刪除feature ----ITable.DeleteSearchedRows  method 對于一般的featureClass(不包括Anno FeatureClass),ITabl...
您举报文章:Basic "vi" features