当前位置:网站首页>VIM editor
VIM editor
2022-07-22 00:18:00 【¥ Arab prince ¥】
One 、 Editors and compilers
1. Editor ( Programming )
vi vim emacs gedit ......
vim : yes vi Advanced version of editor
It is also a very powerful editing software ( It has the function of creating files )
vim file name
|
Press iIaAoO V Press :
edit ( Insert ) Pattern <--------- Command mode -----------> Command line mode
-------------> <------------
Press esc Delete :
Be careful : Save and exit , Do not close the terminal directly , Otherwise, an exchange file will be generated
1) Operation in command mode
1> Cursor position
h towards the left j Down k Up l towards the left
gg Position the cursor on the first line
G The cursor returns to the last line (15G The cursor returns to the 15 That's ok )
/string Quickly navigate to the presence string The location of (n Find down N Upward search )
2> The editing of the text
yy Copy ( Copy the contents of the line where the cursor is located )
p Paste ( Paste the copied content under the line where the cursor is located )
P Paste ( Paste the copied content on the top of the line where the cursor is located )
dd shear / Delete ( Cut the contents of the line where the cursor is located )
Cutting without pasting is deleting
3yy Copy 3 Row content
3p Paste the copied content 3 Time
3dd shear / Delete 3 Row content
ygg Copy the contents from the first line to the line where the cursor is located
yG Copy the contents from the line where the cursor is located to the last line
dgg Delete the contents from the first line to the line where the cursor is located
dG Delete the contents from the line where the cursor is located to the last line
x Deletes the character where the cursor is located
D Delete from the cursor position to the end of the line
u revoke
CTRL+ r redo redo
r Replace
3> Mode switch
iIaAoO Switch to edit ( Insert ) Pattern
: Switch to the command ( Low row ) Pattern
v Switch to visual mode
V Switch to visual line mode
------------------------------------------------------------------------------------------------
Adjust the code format in visual mode
a: Enter visual mode
b. Click up and down to select the code to adjust the format
c. Press = Adjustment
==========================================================
CTRL+ v Switch to visual block mode
------------------------------------------------------------------------------------------------
Block insertion
a. Enter visual block mode
b. Select the block to be inserted with the up and down keys
c. Enter insertion mode
d. Enter the content to insert
e. Press two esc
Block deletion
a. Enter visual block mode
b. Select the block to be deleted by pressing the up and down keys
c. Press d Delete
Block replacement
a. Enter visual block mode
b. Select the block to be replaced by up and down keys
c. Press r Enter the replacement operation
2) Operation in edit mode
CTRL + p When writing a program, it is used to supplement
3) Operation in command line mode
1> Save and exit
:w preservation
:q sign out
:wq Save and exit
:q! Forced exit
:wqa Save and exit all files
2> Search and replace
:3,7 s/ck/root/
Lower the file 3-7 Line first appeared ck Replace with root
:3,7 s/ck/root/g
Lower the file 3-7 Line all that appears ck Replace with root
g It means the overall situation
:% s/ck/root/g
Put... In the file
% It means the full text
4) modify vim Configuration file for
vim /etc/vim/vimrc The modified content will affect all users
vim -/.vimrc The modified content will affect the current user
set ai Automatic indentation
set si Smart indent
set ts=4 Occupy 4 Characters
set sw=4 Indent each layer 4 Characters
set nu According to the line Numbers
It can also be configured by itself
5) Use vim Open multiple files ( Be careful : Don't open too much , otherwise vim It will break down )
vim -O Multiple file names Open multiple files in a vertical tab
vim -o Multiple file names Open multiple files in a horizontal tab
Switch the tab bar ctrl + v( two )
vim -p Switch tabs (CTRL+alt +pgup +pgdn)
2. compiler
gcc cc
gcc The compiler depends on cc compiler
( All belong to X86 Compiler under the platform )
Big end format and small end format :arm-linux-gcc
After compilation, there may be 3 States
1) There is no prompt on the terminal after compilation , Represents that the program has no syntax errors , Does not mean that the program is ok , An executable will be generated
2) After compilation, the terminal reports a warning , There are some grammatical problems in the representative program , but 、 Not a fatal problem , An executable will be generated
3) After compilation, the terminal reports an error , The representative program has fatal problems , No executable will be generated
You can adjust all warnings and errors reported after compilation
gcc xxx.c -o xxx
-Wall All warnings
You can specify the name of the generated executable
gcc -Wall xxxx.c
-Wall All warnings
Execute executable
./a.out
边栏推荐
- The last step of QA robot implementation -- Code encapsulation and interface provision
- 2.Ansible中常用模塊
- codis集群的搭建
- 12. User microservice
- Zabbix+ distributed database tidb realizes distributed database monitoring
- Enterprises and individuals choose cloud terminals or cloud servers for cloud desktops? You will know after reading this article
- (C language) flexible array
- JVM运行原理解析
- JasperReports配置中文字体
- Comparison of float and long values
猜你喜欢
Learn IO from simple to deep
Part 03: SQL syntax tree parsing
Does Navicat 16 support native Apple silicon M1 chips| Apple user must read
top及ifconfig命令
ENSP configure DHCP
PeopleSoft warning, error, message box
1.Asible的安装及部署
Part 06: pooling Technology
Deployment of three centers in two places
How are web interface resources saved?
随机推荐
Stack differences
centos7部署mysql8
[untitled] this year's noteworthy God book, Douban scored as high as 9.0, and Jingdong Dangdang is available for sale
Analysis of cross apply and outer apply query of SQL Server - Part I
3. Use playbook in ansible
[secondary development of GeoServer] development of rest automatic deployment module based on GeoServer Manager
JasperReports配置中文字体
Assembly realizes circular judgment on whether it is a square number by means of conditional transfer
Stata used in jupyter
Common auxiliary classes with high concurrency
Zabbix+分布式數據庫TiDB實現分布式數據庫監控
Complete IP protocol number
@Correct use of requestparam annotation
Relevant contents of tube side
Oracle subquery
ENSP configure DHCP
The last step of QA robot implementation -- Code encapsulation and interface provision
Use Mysql to query logs slowly
CDH5安装Kerberos认证
奇怪的响应数据