search
Homephp教程PHP开发Memorize common Vim commands and get twice the result with half the effort in Linux programming

People who want to program in Linux must use vim. Vim is the most commonly used editor in Linux today, so... If you memorize Vim's common commands, Linux programming will get twice the result with half the effort. The common commands of vim are listed below:


i → Insert mode, press ESC to return to Normal mode.
x → Delete a character where the current cursor is.
:wq → Save + exit (:w save, :q exit) (Chen Hao’s note: :w can be followed by the file name)
dd → delete the current line and save the deleted line to the clipboard
d (delete )
v (visual selection)
gU (change to uppercase)
gu (change to lowercase)
a → insert after the cursor
o → insert a new line after the current line
O → insert a new line before the current line
cw → Replace the characters from the cursor position to the end of a word

2dd → ​​Delete 2 lines
3p → Paste the text 3 times

NG → Go to the Nth line (Chen Hao's note: Note that the G in the command is capitalized, In addition, I usually use: N to the Nth line, such as: 137 to the 137th line)
gg → to the first line. (Chen Hao's note: equivalent to 1G, or :1)
G → Go to the last line.
Move by word:
w → to the beginning of the next word.
e → to the end of the next word.
> If you think words are written by default, use lowercase e and w. By default, a word consists of letters, numbers and underscores

Move the cursor on the current line: 0 ^ $ f F t T , ;
0 → to the beginning of the line
^ → to the first non-blank character of the line
$ → to the end of the line
g_ → to the last position of the line that is not a blank character.
fa → Go to the next character of a, you can also fs to the next character of s.
t, → to the first character before the comma. Commas can be changed to other characters.
3fa → Find the third occurrence of a in the current line.
F and T → are the same as f and t, but in opposite directions.

0 → Go to the beginning of the line first
y → Start copying from here
$ → Copy to the last character of this line
You can enter ye to copy from the current position to the last character of this word.

You can also enter y2/foo to copy the string between 2 "foo".

There are still many times where you don’t necessarily have to press y to copy. The following command will also be copied:

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.