当前位置:网站首页>Most common usage of vim editor
Most common usage of vim editor
2022-06-24 15:38:00 【Exclusive rainy days】
Vim There is 3 Mode used in : this 3 The switching between the two modes can be illustrated by the following figure

Command mode
In the use of Vim When ordered , Enter command mode by default . Command mode is usually , Do some Whole row operation . The main commands are as follows :
| command | effect |
|---|---|
| dd | Delete ( shear ) The cursor is in the whole line |
| 5dd | Delete ( shear ) Starting at the cursor 5 That's ok |
| yy | Copy the whole line where the cursor is |
| 5yy | Copy from cursor 5 That's ok |
| n | Displays the next string to which the search command navigates |
| N | Display the last string to which the search command is located |
| u | Undo the last action |
| p | Delete the previous (dd) Or copy (yy) Paste the data after the cursor |
Also commonly used is , Use G You can jump directly to the last line ,gg You can go to the first line .
Input ( edit ) Pattern
Mainly 3 Input methods :
- a(append Additional meaning ) Indicates that a bit is inserted after the current mouse
- i (Insert Meaning of insertion ) Indicates to insert... At the current position of the current mouse
- o( Another line means ) Indicates that the mouse is on the line , Insert... In the next line
Last row mode
It is mainly used for preservation or sign out file , And settings Vim Editor working environment , It also allows users to execute external Linux Command or jump to a specific number of lines in the document being written .
The most common command :
:wqSave and exit:qExit without saving ,:q!Forced exit , Discard all saves
| command | effect |
|---|---|
| :set nu | According to the line Numbers |
| :set nonu | Don't show line numbers |
| : command | Execute the command |
| : Integers | Jump to the line |
| /one/two | Move the current cursor The first one in the line one Replace with two |
| /one/two/g | Move the current cursor All in the line one Replace with two |
| :%s/one/two/g | take All in the full text one Replace with two |
| ? character string | Search the string from bottom to top in the text |
| / character string | Search the string from top to bottom in the text |
If you want to see , In all the documents , Can pass vim Order reenter , perhaps cat Output file content .
边栏推荐
- 设备通过国标GB28181接入EasyCVR平台,出现断流情况该如何解决?
- Binary computing
- 10 hands-free idea plug-ins. These codes do not need to be written (the second bullet)
- clang: warning: argument unused during compilation: ‘-no-pie‘ [-Wunused-command-line-argument]
- Es search content top
- Teach you how to view version information with mongodb
- Task priority motion planning of floating base
- Istio Troubleshooting: using istio to reserve ports causes pod startup failure
- US Senate promotes bipartisan gun safety bill
- 如何扩展aws主机上的磁盘空间
猜你喜欢

Multimeter resistance measurement diagram and precautions
An accident caused by a MySQL misoperation, and the "high availability" cannot withstand it!

FreeRTOS新建任务不执行问题解决办法

VNC Viewer方式的远程连接树莓派
Oracle RAC configuration multipathing
![clang: warning: argument unused during compilation: ‘-no-pie‘ [-Wunused-command-line-argument]](/img/f0/42f394dbc989d381387c7b953d2a39.jpg)
clang: warning: argument unused during compilation: ‘-no-pie‘ [-Wunused-command-line-argument]

设备通过国标GB28181接入EasyCVR平台,出现断流情况该如何解决?

国产芯片的赶超,让美国手机芯片龙头高通害怕了,出招应对竞争

Mongodb Getting started Practical Tutoriel: Learning Summary Table des matières

Mysql之Binlog
随机推荐
PHP export data as excel table
Improving the classification of motor imagery by combining EEG and MEG signals in BCI
Bosun query
FPGA based analog I ² C protocol system design (Part 2)
CVPR2022 | 可精簡域適應
How to modify the login user name of easynvr video monitoring system?
国产芯片的赶超,让美国手机芯片龙头高通害怕了,出招应对竞争
推荐几款超级实用的数据分析利器
Data stack technology sharing: how to use data stack for data collection?
Binary computing
如何实现容器内的SqlServer的数据库迁移
"Industry foresight" future development trend of intelligent security monitoring industry
The future of robots -- deep space exploration
Service visibility and observability
Kubernetes practical tips: using ksniff to capture packets
practice
【Prometheus】6. Prometheus and kubernetes (incomplete)
MySQL toolset: the official performance testing tool mysqlslap
Redis highly available
Two way combination of business and technology to build a bank data security management system