1.插入命令
命令 作用
a 在光标后附加文本
A 在本行行末附加文本
i 在光标前插入文本
I 在本行开始插入文本
o 在光标下插入新行
O 在光标上插入新行
2.定位命令
命令 作用
H 移至屏幕上端
h 方向左键 左移一个字符
j 方向下键 下移一行
M 移至屏幕中央
k 方向上键 下移一行
L 移至屏幕下端
l 方向右键 右移一个字符
$ 移至行尾
0 移至行首
:set nu 设置行号
:set nonu 取消行号
gg 到第一行
G 到最后一行
nG 到第n行
:n 到第n行
3。删除命令
命令 作用
x 删除光标所在处字符
nx 删除光标所在处后n个字符
dd 删除光标所在行,ndd删除n行
dG 删除光标所在行到末尾的内容
D 删除从光标所在处到行尾
:n1,n2d 删除指定范围的行
4.复制与剪切命令
命令 作用
yy、Y 复制当前行
nyy、nY 复制当前行一下n行
dd 剪切当前行
ndd 剪切当前行一下n行
p、P 粘帖在当前光标所在行下或行上
5.替换和取消命令
命令 作用
r 取代光标所在处字符
R 从光标所在处开始替换字符,按Esc结束
u 取消上一步操作
6.搜索和替换命令
命令 作用
/string 向前搜索指定字符串搜索时忽略大小写 :set ic
n 搜索指定字符串的下一个出现位置
:%s/old/new/g 全文替换指定字符串
:n1,n2s/old/new/g 在一定范围内替换指定字符串
7.保存和退出命令
命令 作用
:w 保存修改
:w new_filename 另存为制定文件
:wq 保存修改并退出
ZZ 快捷键保存修改并退出
:q! 不保存修改退出
:wq! 保存修改并退出(文件所有者可忽略文件的只读属性)
8.技巧
导入命令执行结果 :r !命令
定义快捷键 :map 快捷键 触发命令
范例:
:map ^P I#<ESC>
:map ^B 0x
连续行注释
:n1,n2s/^/#/g
:n1,n2s/^#//g
:n1,n2s/^/\/\//g
替换 :ab sammail samlee@lampbrother.net
分享到:
相关推荐
Excel檔式,針對各模組常用的table整理過,寫報表程式比較方哩!
This repository contains some commonly used Matlab functions for working with and displaying AER vision data.zip
Text Mesh Pro 显示中文
Commonly used 3rd party source code for Matlab - sometimes with some minor fixes.zip
Commonly used 3rd party source code for Matlab - sometimes with some minor fixes
matlab 常用命令 matlab 常用命令 (frequently used commands commonly used commands matlab matlab)
Toolbar – provides access to commonly used commands. Context Menu – provides access to commonly used commands 主要特性: Bi-directional Code Generation – read and write almost any format and ...
计算量分析,林肯实验室
SCM is also known as micro-controller (Microcontroller Unit), commonly used letters of the acronym MCU MCU that it was first used in industrial control. Only a single chip by the CPU chip developed ...
A list of commonly used Git commands
Commonly-used-algorithm常用算法
An overview of file management in Unix and commonly used Unix commands is then provided. Further, it delves into the detailed description of file system and compression techniques, processes and ...
A toolbar contains buttons/items for the most commonly-used commands in an application. This component is highly customizable and supports a wide range of features. dhtmlxToolbar 2.0 component ...
An overview of file management in Unix and commonly used Unix commands is then provided. Further, it delves into the detailed description of file system and compression techniques, processes and ...
Junit单元测试入门指导
常用器件选型表,对新手特别有用,还可以让认识很多常用器件
Bill Kafig of industry leader Xilinx, swiftly brings the reader up to speed on techniques and functions commonly used as well as commands and data management. Extensive simple, complete designs are ...
21【全美经典】工程热力学............................................
On the other hand, many of the commonly used data mining algorithms do not scale to large data sets. Two fundamental challenges are: to develop scalable versions of the commonly used data mining ...
Commonly used programming algorithm, commonly used ACM algorithm, love ACM friends quickly!