当前位置:网站首页>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
边栏推荐
- Is it safe to open a stock account online? I'm a novice, please guide me
- Amazon cloud technology community builder application window opens
- Cmake cross compilation
- YYGH-9-预约下单
- to_bytes与from_bytes简单示例
- GGHIGHLIGHT: EASY WAY TO HIGHLIGHT A GGPLOT IN R
- R HISTOGRAM EXAMPLE QUICK REFERENCE
- php 二维、多维 数组打乱顺序,PHP_php打乱数组二维数组多维数组的简单实例,php中的shuffle函数只能打乱一维
- Log4j2
- How to Easily Create Barplots with Error Bars in R
猜你喜欢

Power Spectral Density Estimates Using FFT---MATLAB

Redis exceeds the maximum memory error oom command not allowed when used memory & gt; ' maxmemory'

How to Create a Beautiful Plots in R with Summary Statistics Labels

Three transparent LED displays that were "crowded" in 2022

Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
![[visual studio 2019] create and import cmake project](/img/51/6c2575030c5103aee6c02bec8d5e77.jpg)
[visual studio 2019] create and import cmake project

ESP32 Arduino 引入LVGL 碰到的一些问题

How to Add P-Values onto Horizontal GGPLOTS

Seriation in R: How to Optimally Order Objects in a Data Matrice

Wechat applet uses Baidu API to achieve plant recognition
随机推荐
Programmer growth Chapter 6: how to choose a company?
Seriation in R: How to Optimally Order Objects in a Data Matrice
MySQL comparison operator in problem solving
flutter 问题总结
ESP32 Arduino 引入LVGL 碰到的一些问题
Research on and off the Oracle chain
Yygh-10-wechat payment
Homer forecast motif
ESP32音频框架 ESP-ADF 添加按键外设流程代码跟踪
What week is a date obtained by QT
Esp32 stores the distribution network information +led displays the distribution network status + press the key to clear the distribution network information (source code attached)
Three transparent LED displays that were "crowded" in 2022
RPA advanced (II) uipath application practice
FLESH-DECT(MedIA 2021)——一个material decomposition的观点
Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
【2022 ACTF-wp】
deepTools对ChIP-seq数据可视化
行业的分析
【2022 ACTF-wp】
Enter the top six! Boyun's sales ranking in China's cloud management software market continues to rise