the5fire

关注Python、Django、Vim、Linux、Web开发、团队管理和互联网--Life is short, we need Python.


最好的VIM/VI入门教程

作者:the5fire | 标签:     | 发布:2012-02-13 8:43 p.m. | 阅读量: 8407, 8188
如果你已经安装了vim/vi的话,这个教程其实已经在你的电脑里了,你只需要在终端输入vimtutor即可(对于windows用户,你需要设置vim的路径到环境变量的path中)。昨天晚上看了看这个教程,很不错,花个半小时看完,能让你进入vim世界的大门。


这里粘贴一部分:

===============================================================================
= 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.1: MOVING THE CURSOR


** To move the cursor, press the h,j,k,l keys as indicated. **
^
k Hint: The h key is at the left and moves left.
< h l > The l key is at the right and moves right.
j The j key looks like a down arrow.
v
1. Move the cursor around the screen until you are comfortable.

2. Hold down the down key (j) until it repeats.
Now you know how to move to the next lesson.

3. Using the down key, move to Lesson 1.2.

NOTE: If you are ever unsure about something you typed, press to place
you in Normal mode. Then retype the command you wanted.

NOTE: The cursor keys should also work. But using hjkl you will be able to
move around much faster, once you get used to it. Really!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 1.2: EXITING VIM


!! NOTE: Before executing any of the steps below, read this entire lesson!!

1. Press the key (to make sure you are in Normal mode).

2. Type: :q! .
This exits the editor, DISCARDING any changes you have made.

3. When you see the shell prompt, type the command that got you into this
tutor. That would be: vimtutor

4. If you have these steps memorized and are confident, execute steps
1 through 3 to exit and re-enter the editor.

NOTE: :q! discards any changes you made. In a few lessons you
will learn how to save the changes to a file.

5. Move the cursor down to Lesson 1.3.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- from the5fire.com
----EOF-----

微信公众号:Python程序员杂谈


其他分类: