$vimtutor

===============================================================================
= W e l c o m e t o t h e V I M T u t o r - Version 1.7 =
===============================================================================

Vim is a very powerful editor that has many commands, too many to
explain in a tutor such as this. This tutor is designed to describe
enough of the commands that you will be able to easily use Vim as
an all-purpose editor.

The approximate time required to complete the tutor is 25-30 minutes,
depending upon how much time is spent with experimentation.

ATTENTION:
The commands in the lessons will modify the text. Make a copy of this
file to practise on (if you started "vimtutor" this is already a copy).

It is important to remember that this tutor is set up to teach by
use. That means that you need to execute the commands to learn them
properly. If you only read the text, you will forget the commands!

Now, make sure that your Shift-Lock key is NOT depressed and press
the j key enough times to move the cursor so that Lesson 1.1
completely fills the screen.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lesson 1 SUMMARY

1. The cursor is moved using either the arrow keys or the hjkl keys.
h (left) j (down) k (up) l (right)

2. To start Vim from the shell prompt type: vim FILENAME <ENTER>

3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes.
OR type: <ESC> :wq <ENTER> to save the changes.

4. To delete the character at the cursor type: x

5. To insert or append text type:
i type inserted text <ESC> insert before the cursor
A type appended text <ESC> append after the line

NOTE: Pressing <ESC> will place you in Normal mode or will cancel
an unwanted and partially completed command.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 2 SUMMARY

1. To delete from the cursor up to the next word type: dw
2. To delete from the cursor to the end of a line type: d$
3. To delete a whole line type: dd

4. To repeat a motion prepend it with a number: 2w
5. The format for a change command is:
operator [number] motion
where:
operator - is what to do, such as d for delete
[number] - is an optional count to repeat the motion
motion - moves over the text to operate on, such as w (word),
$ (to the end of line), etc.

6. To move to the start of the line use a zero: 0

7. To undo previous actions, type: u (lowercase u)
To undo all the changes on a line, type: U (capital U)
To undo the undo's, type: CTRL-R

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 3 SUMMARY

1. To put back text that has just been deleted, type p . This puts the
deleted text AFTER the cursor (if a line was deleted it will go on the
line below the cursor).

2. To replace the character under the cursor, type r and then the
character you want to have there.

3. The change operator allows you to change from the cursor to where the
motion takes you. eg. Type ce to change from the cursor to the end of
the word, c$ to change to the end of a line.

4. The format for change is:

c [number] motion

Now go on to the next lesson.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 4 SUMMARY

1. CTRL-G displays your location in the file and the file status.
G moves to the end of the file.
number G moves to that line number.
gg moves to the first line.

2. Typing / followed by a phrase searches FORWARD for the phrase.
Typing ? followed by a phrase searches BACKWARD for the phrase.
After a search type n to find the next occurrence in the same direction
or N to search in the opposite direction.
CTRL-O takes you back to older positions, CTRL-I to newer positions.

3. Typing % while the cursor is on a (,),[,],{, or } goes to its match.

4. To substitute new for the first old in a line type :s/old/new     // 替换
To substitute new for all 'old's on a line type :s/old/new/g
To substitute phrases between two line #'s type :#,#s/old/new/g
To substitute all occurrences in the file type :%s/old/new/g
To ask for confirmation each time add 'c' :%s/old/new/gc

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 5 SUMMARY

1. :!command executes an external command.

Some useful examples are:
(MS-DOS) (Unix)
:!dir :!ls - shows a directory listing.
:!del FILENAME :!rm FILENAME - removes file FILENAME.

2. :w FILENAME writes the current Vim file to disk with name FILENAME.

3. v motion :w FILENAME saves the Visually selected lines in file
FILENAME.

4. :r FILENAME retrieves disk file FILENAME and puts it below the
cursor position.

5. :r !dir reads the output of the dir command and puts it below the
cursor position.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 6 SUMMARY

1. Type o to open a line BELOW the cursor and start Insert mode.
Type O to open a line ABOVE the cursor.

2. Type a to insert text AFTER the cursor.
Type A to insert text after the end of the line.

3. The e command moves to the end of a word.

4. The y operator yanks (copies) text, p puts (pastes) it.

5. Typing a capital R enters Replace mode until <ESC> is pressed.

6. Typing ":set xxx" sets the option "xxx". Some options are:
'ic' 'ignorecase' ignore upper/lower case when searching
'is' 'incsearch' show partial matches for a search phrase
'hls' 'hlsearch' highlight all matching phrases
You can either use the long or the short option name.

7. Prepend "no" to switch an option off: :set noic

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 7 SUMMARY

1. Type :help or press <F1> or <Help> to open a help window.

2. Type :help cmd to find help on cmd .

3. Type CTRL-W CTRL-W to jump to another window

4. Type :q to close the help window

5. Create a vimrc startup script to keep your preferred settings.

6. When typing a : command, press CTRL-D to see possible completions.
Press <TAB> to use one completion.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This concludes the Vim Tutor. It was intended to give a brief overview of
the Vim editor, just enough to allow you to use the editor fairly easily.
It is far from complete as Vim has many many more commands. Read the user
manual next: ":help user-manual".

vimtutor总结的更多相关文章

  1. 最好的vim教程莫过于vimtutor

    最好的vim教程莫过于vimtutor 直接运行vimtutor即可

  2. vimtutor

    ================================================================================ 欢 迎 阅 读 < V I M ...

  3. VIMTUTOR《VIM教程》

    =============================================================================== =      欢     迎     阅 ...

  4. vimtutor——vim官方教程

    =============================================================================== =      欢     迎     阅 ...

  5. Vimtutor(中文版)学习笔记各章小结

    在Bash中直接输入 vimtutor 打开新世界!通常阅读完需要25-30分钟不等,像玩游戏一样学会vim,然后爱不释手 里面设置了很多例子通过实践操作来学,这里仅把vimtutor上的每一章小结记 ...

  6. Vim使用技巧:vimtutor

    一 写在开头1.1 本文内容本文内容为vim快速入门——vimtutor. 二 第一讲2.1 移动光标(命令模式下)上 - k下 - j左 - h右 - l 2.2 进入和退出vim进入vim - v ...

  7. Vimtutor中文版

    ================================================================================      欢     迎     阅  ...

  8. vimtutor学习笔记

    简介 vimtutor是vim这款知名的文本编辑器的学习工具/指南.语法如下. vimtutor [-g] [language] gvimtutor -g选项和gvimtutor是启动GUI版本的指南 ...

  9. 请通过vim练习:vim vimtutor

    vim vimtutor ================================================================================ W e l ...

  10. VIMTUTOR 1.7中文版

    文章来源:http://waterxfire.blog.hexun.com/4106986_d.html =============================================== ...

随机推荐

  1. BZOJ 3626 [LNOI2014]LCA:树剖 + 差分 + 离线【将深度转化成点权之和】

    题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=3626 题意: 给出一个n个节点的有根树(编号为0到n-1,根节点为0,n <= 50 ...

  2. CNN检测模型统计检出率

    X, y = get_feature_charseq() #max_document_length=64 volcab_file = "volcab.pkl" assert os. ...

  3. Java钉钉开发_02_免登授权(身份验证)

    源码已上传GitHub: https://github.com/shirayner/DingTalk_Demo 一.本节要点 1.免登授权的流程 (1)签名校验 (2)获取code,并传到后台 (3) ...

  4. JavaUtil_02_二维码的生成与解析

    1.引入jar包 zxing-core-1.7.jar  :   http://viralpatel.net/blogs/download/jar/zxing-core-1.7.jar zxing-j ...

  5. leetcode 205. Isomorphic Strings(哈希表)

    Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the chara ...

  6. JAVA堆内存和栈内存初步了解

    一.堆内存和栈内存 程序运行时内存分配有三种:静态存储分配,栈式存储分配,堆式存储分配 1.静态存储分配: 在程序编译时就可以确定数据目标在运行时所需要的内存,因此在编译时就为其分配固定大小的内存. ...

  7. 关于对H264码流的TS的封装的相关代码实现

    1 写在开始之前 在前段时间有分享一个H264封装ps流到相关文章的,这次和大家分享下将H264封装成TS流到相关实现,其实也是工作工作需要.依照上篇一样,分段说明每个数据头的封装情况,当然,一样也会 ...

  8. diea破解

    选择菜单Help->Register->License server,填上http://idea.iteblog.com/key.php,如图所示:  点击Activate,然后就搞定了.

  9. JavaScript-Tool:pluload

    ylbtech-JavaScript-Tool:pluload Plupload是用于处理文件上传的JavaScript API,支持多文件选择.文件类型过滤.请求分块.客户端图像缩放等功能,使用不同 ...

  10. linux命令-tar工具详解

    把文件和目录打成一个包 文件打包 [root@wangshaojun ~]# tar -cvf 1.tar 1.txt 123 234 ///-c创建 -v可视化 -f file放最后面1.txt12 ...