按i前插入字符。a在光标后追加字符

ctrl+d将光标下称半个窗体。按Ctrl+u将光标上移半个窗体

在输入模式下:ctrl+h删除字符,ctrl+u删除行。ctrl+w删除字

命令模式下。x删除字符。dw删除字,dd删除行

u表示撤销上一个操作

ctrl+r或输入命令:redo。表示重做

命令dw和i能够用一条命令cw(chang world)来实现。

命令cw能够使用VIM进入输入模式

$ vim -r memo

:w memo2

可将文件另存

dw: delete current word, but first thing for this command is the cursor has to be the first character of the word.

d$: delete to the end of the line

0: move to the end of the line.

d3w: delete the 3 words after the cursor. d4w will delete 4 words

U: To undo all the changes on a line

p: put the line which deleted by command 'dd' under the cursor line

r: Type rx to replace the character at the cursor with x

ce: To change until the end of a word, type ce

c$: Delete the context from cursor to the end of the line, and go the input mode

ctrl+g : To show your location in the file and the file status.

G: Go to the bottom of the file.

gg: To move you to the start of the file.

G: Type the number of the line you want to go and then G, this will go to the line you wann to go.

/: search for the phrase from forward

?

: search for the phrase from backward

n: search the same phrase again, simple type n

N: search the same phrase in the opposite direction, type N

ctrl+o: To go back to where you came from. Repeat to go back further

ctrl+i: To go forward

%: to find a matching ),], or }. This is very useful in debugging a program with unmatched parentheses

:s/old/new/ to substitute 'new' for 'old', only change the first occurrence

:s/old/new/g to substitute 'new' for 'old', will change all the occurrences in the line

:%s/old/new/g to change every occurrence in the whole file

:%s/old/new/gc to find every occurrence in the whole file, with a prompt whether to substitute or not

o: to open a line below the cursor and place you in insert mode.

O: to open a line above the cursor and place you in insert mode.

a: to insert text AFTER the cursor

i: to insert text BEFORE the cursor

A: to insert text at the end of line

R: replace more than one character

r: replace one character of cursor position

copy and paste: 

1. start visual mode with v and move the cursor to select the text you want to copy

2. Type y to yank(copy) the highlighted text.

3. Go to the position which you want to paste your text

4. Type p to put(paste) the text

set option:

:set number(set nu): show up line number

:set ic: set ignores case when searching or substitute

:set hls is: set lisearch and incsearch option

:set noic: disable ignoring case 

if you want to ignore case for just one search command, user \c in the phrase: /youString\c

版权声明:本文博客原创文章。博客,未经同意,不得转载。

VIM 初步的更多相关文章

  1. vi/vim初步接触

    vi和vim一直被人津津乐道,到底是什么使得它们如此受欢迎? vi分为3种模式:一般模式,编辑模式,命令行模式. (1)一般模式: 进入vi后,默认就是一般模式. 用处:方便地移动光标,删除字符/整行 ...

  2. install vim

    常用命令: [0]安装vim: oee@copener:~$ sudo apt-get install vim vim-scripts vim-doc 刚安装完$HOME目录下只有两个文件:.vim/ ...

  3. 20135328信息安全系统设计基础第二周学习总结(vim、gcc、gdb)

    第三周学习笔记 学习计时:共8小时 读书:1 代码:5 作业:1 博客:7 一.学习目标 熟悉Linux系统下的开发环境 熟悉vi的基本操作 熟悉gcc编译器的基本原理 熟练使用gcc编译器的常用选项 ...

  4. Linux 桌面玩家指南:02. 以最简洁的方式打造实用的 Vim 环境

    特别说明:要在我的随笔后写评论的小伙伴们请注意了,我的博客开启了 MathJax 数学公式支持,MathJax 使用$标记数学公式的开始和结束.如果某条评论中出现了两个$,MathJax 会将两个$之 ...

  5. Android开发最佳学习路线图

          为了帮助大家更好的学习Android开发的相关知识,尚观4G智能操作系统研究室(www.up4g.com)为大家制作下面学习路线图:希望能帮助到广大的android爱好者. 在開始之前我们 ...

  6. Android开发最佳学习路线图(转)

    Android开发总体路线图:  基础学习——JavaSE:        很多朋友一上手就开始学习Android,似乎太着急了一些. Android应用程序开发是以Java语言为基础的,所以没有扎实 ...

  7. 尚观Linux最佳入门高清视频教程033/133/253

    [高清]Linux 最佳入门ULE112- RHCE033部分高清视频教程[尚观原创] 视频简介:高清RHCE033部分是RHCE考试中的基础部分,同时也是我们Linux入门的必 备学习资料.想学好L ...

  8. vim插件开发初步

    [vim插件开发初步] 将如下代码存在helloworld.vim, 放在~/.vim/plugin目录下,插件即可生效.:w保存代码后, 用:source命令执行后,也可以使用Helloworld命 ...

  9. vim基础初步

    vim文本编辑器初步 一.跟vi编辑器的关系 可以说vim编辑器是vi编辑器的升级版,它保留了vi编辑器的所有东西,而且加入了自己的新的特性. 比如说:支持跨平台,支持语法高亮,支持多级撤销等. ++ ...

随机推荐

  1. c++构造函数隐式转换--转换构造函数

    其实我们已经在C/C++中见到过多次标准类型数据间的转换方式了,这种形式用于在程序中将一种指定的数据转换成另一指定的类型,也即是强制转换,比如:int a = int(1.23),其作用是将1.23转 ...

  2. Codeforces Round#310 div2

    C题:这题说的是套娃,如果做题的时候知道是套娃,那就好理解多了 规则1:套娃A可以放到套娃B里面,当且仅当套娃B没有放在其他套娃里面 规则2:套娃A放在套娃B里面,且套娃B没有放在其他套娃里面,那么可 ...

  3. windows phone 页面传值(7)

    原文:windows phone 页面传值(7) 在windows phone 中微软为我们提供了页面间传递参数的解决方案,下面就为大家介绍使用方法,页面传值的案例中我们建立两个页面,一个是MainP ...

  4. EJB通过ANT提高EJB应用程序的开发效率、无状态发展本地接口bean、开发状态bean

    该jboss集成到eclipse 关掉Jboss控制台新闻Ctrl+c,在MyEclipse→Servers→Jboss可配置JBoss. 通过ANT提高EJB应用的开发效率 在HelloWorld ...

  5. 第五章_JSTL

    5.1.下载JSTL http://jstl.java.net 5.2.JSTL类库 类别 下属功能 URI 前缀 Core 变量支持 http://java.sun.com/jsp/jstl/cor ...

  6. Bulk Insert Data

    Bulk Insert Data 命名空间:Oracle.DataAccess.Client 组件:Oracle.DataAccess.dll(2.112.1.0) ODP.NET 版本:ODP.NE ...

  7. windows phone (22) 隐藏元素

    原文:windows phone (22) 隐藏元素 在wp中我们也会用到隐藏某个元素,已达到某种效果,刚刚从文章看到了,分享一下[作者:神舟龙] Visibility 此属性能非常方便的实现隐藏某个 ...

  8. java线程例子登山

    Through its implementation, this project will familiarize you with the creation and execution of thr ...

  9. Objective C (iOS) for Qt C++ Developers(iOS开发,Qt开发人员需要了解什么?)

    Qt/C++开发人员眼中的Obj-C      对于我们第一次自己定义iOS应用来说,对于来自Qt/C++开发人员来说,我不得不学习Objective-C相关语法与知识 为了让读者可以更easy理解这 ...

  10. Cocos移植Android-Android.mk编译后的文件

    在以前的博客,我们使用的中年cocos工具C和C++源代码可以编译. 其实cocos工具读取<游戏project文件夹>\proj.android\jni\夹Android.mk文件,.A ...