当前位置:网站首页>Use of vim editor
Use of vim editor
2022-07-23 05:59:00 【Pigs who love coriander】
vim Editor
effect : Used to modify the contents of the file
One 、vim Editor Introduction
Patternization
Command mode
Insertion mode
Last row mode
Use format : vim + File name
Two 、 Switching between modes
Command mode ------- Insertion mode
a // Insert... After cursor
i // Insert... At the cursor
o // Insert next line at cursor
Insertion mode ----- Command mode
ESC
Command mode -------- Last row mode
The colon
3、 ... and 、 Last row mode
1、 Save and exit
:wq
2、 Forced exit
:q!
3、 According to the line Numbers
: set nu
4、 Remove line number
: set nonu
5、 Quick replacement
Use format : s/ Old content / New content
:s/linux/ubuntu // Replace the first... In the current line
:s/linux/ubuntu/g // Replace all in the current line
:14,20 s/linux/ubuntu/g // Replace 14-20 All in row
:% s/linux/ubuntu/g // Global replacement
Four 、 Command mode
1、 Move the cursor quickly
$ // Fast to the end of the line
^ // Fast to the beginning of the line
gg // Go back to the first line
89gg // Jump to the specified line
G // Jump to the last line
2、 Delete
x // Delete single characters
d$ // Delete to end of line
d^ // Delete to the beginning of the line
dw // Delete words
dG // Delete to the last line
dd // Delete entire line
3、 Replace
r // Replace single characters
R // Go to replace mode , Continuous replacement
4、 Copy 、 Paste
yy Copy
p Paste
3yy Copy 3 That's ok
5、 Search for
/ Find... From top to bottom
? Search from bottom to top
n: Find down
N: Upward search
6、 revoke
u
example 1: Set up vim Working characteristics of editor
[[email protected] ~]# vim /etc/vimrc // Open with line number by default , Permanent validity
set nu
边栏推荐
猜你喜欢

Learn amber tutorial A17: umbrella sampling and drawing the potential energy surface of alanine tripeptide

嵌入式系统移植【1】————导学

Selenium基础知识 自动登录百度网盘

防火墙知识,原理,设备,厂商调研总结报告

资产测绘流程

Digital verification code identification completes automatic login

03. Design of large-scale high parallel micro service system

使用pip使用报错:pip is configured with locations that require TLS/SSL

Selenium基础知识 调试方法

UNIX编程—网络socket
随机推荐
Amber tutorial 4.6: hydrogen bond analysis of the system
get请求与post请求的区别以及抓包
关系型数据库10 分钟了解 MySQL
浅谈LoRa,LoRaWAN,NB-IoT三类物联网技术
Learn amber tutorial A17: umbrella sampling and drawing the potential energy surface of alanine tripeptide
zstuAcm登记成绩(用STL链表list完成)
vim编辑器的使用
File类的使用,常用API及如何遍历目录及子目录
存储过程
性能测试流程
UNIX编程—网络socket
After class exercise 03---126 letter mailbox registration function
正则表达式Ⅰ
Test case: QQ login
UNIX实现IO多路复用之使用poll函数实现网络socket服务端
Operation of numerical variables and special variables
信息收集的基础要素
指针学习日记(五)经典抽象数据类型、标准函数库
配置yum源遇到的问题
October essay