当前位置:网站首页>This article takes you to understand the operation of vim
This article takes you to understand the operation of vim
2022-07-02 11:52:00 【Fallen leaves @henry】
One article for you to understand vim The operation of
vim yes Linux A powerful text editor , No menu , Only the command . It contains three patterns : Command mode , Edit mode , Insertion mode .
belt : Of is command mode . Those without are in insert mode , Edit mode is when you edit text , It doesn't involve .
a ( Understood as a add) Insert... After the character where the cursor is located . after
i ( Understood as a insert) Insert... Before the character of the cursor . front
o Insert a new line under the cursor .
In uppercase
A: Insert at the end of the cursor line
I: Insert the cursor at the beginning of the line
O: Insert a line on the cursor
Compare the above three .
:set nu According to the line Numbers
:set nonu Cancel the line Numbers
gg Set to the first line Same as :0
GG Set to the last line Same as :$
nG :n n representative Lines , Skip to the line
/ What you want to search You can search in the text Press n You can adjust to the next goal . If you want to ignore case Sure : set ic
Replace
r Replace The character of the current cursor
R Replace the character you enter after the cursor .
:%s/oldstring/newstring/g Replace the full text with
:n1,n2s/oldstring/newstring/g Replace the Column 3,19s/are/is/g hold 3 To 19 All in the line are Replace with is
If you put g Change it to c Each replacement will ask you
Delete
x Delete cursor character
nx Delete... After cursor n Characters
dd Delete a whole line
D Delete the cursor to the end
dG Delete cursor to Contents at the end of the file
:nd Delete a line
:n1,n2 d Delete the specified range n1 To n2 Function of
u Cancel the operation
dd Cut the current line
ndd Cut below the current cursor n That's ok
nyy Copy below the current line n That's ok
p Paste under the current cursor line
P Capitalization Paste on the line of the current cursor
yy -p Copy and paste
dd -p Cut and paste
:r ! command for example :r !date Write a diary at the end of the text :r /etc/yum.conf hold yum.conf Pour it in
: w Save changes
:w newfilename Save as the specified file
:wq Save and exit
ZZ Save and exit
:q! Exit without saving
:wq! Forced save exit ( Without permission to write )
Set up your own Shortcut key
Such as ctrl +p Comment the current line
:map ^P(ctr+v,ctrl+p) I# <ESC> enter
Input content replacement
:ab phone 138241251** enter When editing Input phone Will be able to phone Switch to 138241251**
If you want to save the shortcut keys set , So that you can use it next time
root The user is in /root Create next file
$ cd /root
$touch .vimrc
$vim .vimrc
边栏推荐
- Bedtools tutorial
- [visual studio 2019] create and import cmake project
- 2022年遭“挤爆”的三款透明LED显示屏
- The computer screen is black for no reason, and the brightness cannot be adjusted.
- PgSQL string is converted to array and associated with other tables, which are displayed in the original order after matching and splicing
- A white hole formed by antineutrons produced by particle accelerators
- On April 17, 2022, the five heart matchmaker team received double good news
- How to Easily Create Barplots with Error Bars in R
- Always report errors when connecting to MySQL database
- 【2022 ACTF-wp】
猜你喜欢
XSS labs master shooting range environment construction and 1-6 problem solving ideas
电脑无缘无故黑屏,无法调节亮度。
Mish shake the new successor of the deep learning relu activation function
YYGH-BUG-04
PYQT5+openCV项目实战:微循环仪图片、视频记录和人工对比软件(附源码)
动态内存(进阶四)
2022年遭“挤爆”的三款透明LED显示屏
GGPlot Examples Best Reference
预言机链上链下调研
Principe du contrat évolutif - delegatecall
随机推荐
On April 17, 2022, the five heart matchmaker team received double good news
BEAUTIFUL GGPLOT VENN DIAGRAM WITH R
QT获取某个日期是第几周
Thesis translation: 2022_ PACDNN: A phase-aware composite deep neural network for speech enhancement
to_ Bytes and from_ Bytes simple example
行業的分析
数据分析 - matplotlib示例代码
抖音海外版TikTok:正与拜登政府敲定最终数据安全协议
PX4 Position_Control RC_Remoter引入
GGPLOT: HOW TO DISPLAY THE LAST VALUE OF EACH LINE AS LABEL
ESP32音频框架 ESP-ADF 添加按键外设流程代码跟踪
Yygh-10-wechat payment
php 二维、多维 数组打乱顺序,PHP_php打乱数组二维数组多维数组的简单实例,php中的shuffle函数只能打乱一维
What is the relationship between digital transformation of manufacturing industry and lean production
C#基于当前时间,获取唯一识别号(ID)的方法
Map set assignment to database
YYGH-10-微信支付
Log4j2
The selected cells in Excel form have the selection effect of cross shading
MySQL comparison operator in problem solving