当前位置:网站首页>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
边栏推荐
- 多线程复习总结之解析Volatile关键字
- 零基础自学SQL课程 | OUTER JOIN外连接
- [STL source code analysis] summary notes (7): ingenious deque
- pmp到底是什么?
- Smart pointer (simple version)
- [analysis of STL source code] summary notes (6): Design of iterator and magical traits
- 【CF】 A. New Year Candles
- Classes and objects (Part 2)
- 【CF#388 (Div. 2)】A. Bachgold Problem
- 欧拉定理及扩展(附证明)
猜你喜欢
![[STL source code analysis] summary notes (7): ingenious deque](/img/da/8ec42bfdbbf1b5bd1c2e396c2213e2.jpg)
[STL source code analysis] summary notes (7): ingenious deque

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

10 advanced concepts that must be understood in learning SQL
![[Oracle database] mammy tutorial day02 use of database management tool sqlplus](/img/f2/8f6f74a62427ebfb4c805c1e9b3352.png)
[Oracle database] mammy tutorial day02 use of database management tool sqlplus

【Oracle 数据库】奶妈式教程day02 数据库管理工具SQLPLUS的使用
![2020080 simulation competition [horizontal and vertical coordinates do not affect each other, cactus minimum cut, combined meaning translation formula]](/img/4d/a67a63d2c4eb80c98315c3057b01b9.jpg)
2020080 simulation competition [horizontal and vertical coordinates do not affect each other, cactus minimum cut, combined meaning translation formula]

Decimal to binary

2022低压电工考题及在线模拟考试

Gobang interface of mobile console (C language)

黑群晖DSM7.0.1物理机安装教程
随机推荐
【CF#388 (Div. 2)】A. Bachgold Problem
Tetris preliminary
3年功能测试拿8K,被新来的反超,其实你在假装努力
Arduino_ STM development record
MS office level II wrong question record [4]
QT picture adaptive display control
Post-processing of ffmpeg miscellaneous notes
nosqlzoo刷题-1
Crmeb/v4.4 Standard Version open version mall source code applet official account h5+app mall source code
What is the difference between gaussdb for redis and redis?
@Jsonproperty annotation
QT custom control library creation
2022低压电工考题及在线模拟考试
2022 melting welding and thermal cutting exam exercises and answers
【CF#262 (Div. 2)】 A. Vasya and Socks
Wc2020 course selection
2022年熔化焊接与热切割考试练习题及答案
MFC auxiliary CString string splicing
Sdl-3 YUV playback
如何准备PMP新版大纲考试?