$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. memset和memcopy用法

    void *memset(void *s, int ch, size_t n); 函数解释:将s中前n个字节 (typedef unsigned int size_t)用 ch 替换并返回 s . m ...

  2. win7系统查看端口占用情况

    我们在启动应用或者在开发的时候的时候经常发现我们需要使用的端口被别的程序占用,但是我们又不知道是被谁占用,这时候我们需要找出“真凶”,如何做到呢? 方法/步骤   开始---->运行----&g ...

  3. php数据结构课程---3、队列(队列实现方法)

    php数据结构课程---3.队列(队列实现方法) 一.总结 一句话总结: 1.数据实现:适用于功能不复杂的情况 2.链表实现:受限链表,只能队头队尾操作:适用于功能复杂情况 1.队列的数组实现注意点? ...

  4. winform 添加帮助按钮

    1. 添加提示信息 新建个窗体项目,项目名称为WinFormUI,解决方案名称为WinFormWithHelpDoc.删除默认创建的Form1,新建窗体MainForm,设置相关属性.我们要完成的效果 ...

  5. Codeforces Round #377 (Div. 2) F - Tourist Reform

    前言:关于如何求双连通分量,我们可以在tarjan搜索时标记下所有桥的位置(双连通分量(可以认为是没有桥的无向图图)即可通过删去所有桥得到),那么怎么找桥呢,对于每一条搜索到的边u->x,如果l ...

  6. PHP 常量、PHP 变量全解析(超全局变量、变量的8种数据类型等)

    常量特点 常量一旦被定义就无法更改或撤销定义. 常量名不需要开头的$ 与变量不同,常量贯穿整个脚本是自动全局的. 作用域不影响对常量的访问 常量值只能是字符串或数字 设置 PHP 常量 如需设置常量, ...

  7. TYVJ P1728 普通平衡树

    P1728 普通平衡树 时间: 1000ms / 空间: 131072KiB / Java类名: Main 背景 此为平衡树系列第一道:普通平衡树 描述 您需要写一种数据结构(可参考题目标题),来维护 ...

  8. django autocommit的一个坑,读操作的事务占用导致锁表

    版权归作者所有,任何形式转载请联系作者.作者:petanne(来自豆瓣)来源:https://www.douban.com/note/580618150/ 缘由:有一个django守护进程Daemon ...

  9. openfire服务器开发环境搭建

    2017-07-26 更新:直接获取最新版源码,就不会报错了,而且可支持的插件多,老版本的openfire几乎没有可用的官方插件. 系统及软件环境: MAC OSX EI Capitan 10.11. ...

  10. JS性能之setTimeout与clearTimeout

    测试环境: chrome浏览器 结论: 1 一个页面用setTimeout越多,该页面消耗的内存就会越多,几乎成正比. 2 在'startCount(1000000);-->100万'情况下,不 ...