当前位置:网站首页>VIM common commands
VIM common commands
2022-06-11 07:32:00 【m0_ fifty-two million twelve thousand six hundred and fifty-six】
vim command
1. Command mode
Text operation
yy: Copy the line where the cursor is nyy: Copy n Row content , Start with the line where the current cursor is dd: Deletes the line where the cursor is located ndd: Delete n Row content , Start with the line where the cursor is p: Paste on the next line of the cursor dd->p: Cutting function np: Paste n Time u: Undo the last action x,nx: Delete the content of the text where the cursor is located From the left -> Right shift+x: Delete the content of the text where the cursor is located From the right -> Left shift+~: Switch the case of the text where the cursor is located r: Replace a character , The character on which the cursor is located , Support nr shift+r: Replace mode , Direct replacement of multiple content . h,j,k,l: Move the cursor to the left , Next , On , Move right
Cursor positioning
gg: Position the cursor at the beginning of the file G: Position the cursor at the end of the file nG: Position the cursor on any line shift+4: Position the cursor at the end of the current line , Anchor point shift+6: Position the cursor at the beginning of the current line , Anchor point b,w: Move forward or backward according to the word nb,nw: according to n Move a word forward or backward
Bottom line mode
set nu: Call out the line number set nonu: Cancel the line Numbers vs file name : Multi file operation ctrl+w+w: Multi file cursor switch file w: preservation q: sign out !: mandatory
ordinary vim To configure
The location of the configuration file
In the catalog /etc/ below , A name is vimrc The file of , This is common in the system vim The configuration file , It works for all users .
And in each user's home directory , You can create your own private configuration file , Name it :“.vimrc”. for example ,/root Under the table of contents , Usually there is already a .vimrc file , If it doesn't exist , It was created. .
Switch users to be their own execution su , Enter your home working directory , perform cd ~
Open your own directory .vimrc file , perform vim .vimrc
Common configuration options , For testing
Set syntax highlighting :syntax on
According to the line Numbers :set nu
Set the number of indented spaces to 4:set shiftwidth=4
A direct configuration vim Methods ( Note only applies to centos7)
Direct operation :curl -sLf https://gitee.com/HGtz2222/VimForCpp/raw/master/install.sh -o ./install.sh && bash ./install.sh
边栏推荐
- Nim product
- Nosqlzoo question brushing-1
- gaussDB for redis和 redis的区别?
- Regular Expression Matching
- Software testing weekly (issue 75): only when you look down, can you see your true self.
- Qstring to hexadecimal qstring
- Raspberry pie builds a full-featured NAS server (07): manage your library & read as you please
- 2022年熔化焊接与热切割考试练习题及答案
- Compound RateModel合约解析
- [STL source code analysis] summary notes (5): a good helper for understanding iterators --list
猜你喜欢

RTMP protocol

C language to write a calculator calculation logic

2022年熔化焊接与热切割考试练习题及答案

【AtCoder1980】Mysterious Light(数学模拟)

Import on CSDN MD file

Summary of classic interview questions

Several transaction modes of Seata

多线程复习总结之解析Volatile关键字

Crmeb/v4.4 Standard Version open version mall source code applet official account h5+app mall source code

2022 low voltage electrician operation certificate test question simulation test platform operation
随机推荐
C language function stack frame
学 SQL 必须了解的10个高级概念
2022 melting welding and thermal cutting exam exercises and answers
Mobile console Gobang (first draft of detailed design)
Seata的几种事务模式
Pat class A by category
[analysis of STL source code] summary note (4): behind the scenes hero allocator
【HDU6357】Hills And Valleys(DP)
Matrix tree theorem
2022低压电工操作证考试题模拟考试平台操作
[STL source code analysis] summary notes (1): Opening
二本畢業,銀行外包測試工作 4 個月有餘。聊聊一些真實感受 ...
2022 low voltage electrician operation certificate test question simulation test platform operation
【集群】LVS+keepalived高可用集群
Pointer to a two-dimensional array
[STL source code analysis] summary notes (7): ingenious deque
QObject usage skills -- control function class
.NET C#基础(6):命名空间 - 有名字的作用域
【CodeForces908H】New Year and Boolean Bridges (FWT)
【软件测试】这样的简历已经刷掉了90%的面试者