sequence

If you don’t use Vim, you might feel like you’re missing something. This article describes my experience of using VIm in IDEA for over a year. Indeed, once you get used to it, you can’t leave it, as various Vim articles on the Internet have said.

Let’s install plug-ins first

This process should be omitted. The plugin address I posted once: plugins.jetbrains.com/plugin/164-…

Dry goods

If you are worried about not remembering, I suggest bookmarking.

delete

Delete the character

x

s

Delete the word

Note that word separators are non-alphanumeric underscores

Delete current position to word end dw

Delete the current words diw, daw, ciw, caw

Delete rows

Delete current position to end of line d$

Deletes the current position to the beginning of line d0

Delete the current row DD

Deletes the current nested code block

ci{

If you are removing two layers of nested code blocks, use c2i{, and so on.

Deletes current position to end of segment

Notice that segments are separated by empty lines

cip

Deletes current location to end of file

DG deletes the current location to the beginning of the file: DGG

mobile

Move one character bit

H moves one character left, J moves one character down, K moves one character up, l moves one character right

Move a word or string

Note: Words are separated by non-alphanumeric underscores and strings are separated by Spaces

Move forward

W right move a word, the cursor in the current words at the end of the next character a w a string to move right, on the cursor in the current string at the end of the next character on e right move a word, the cursor at the end of the current word on the character of a string to move right e, the cursor on the current string at the end of the character

Move backward

B move to the left a word, the cursor at the beginning of the words on the character of a string to move to the left a b, the cursor at the beginning of the string on the characters of ge mobile left a word, the cursor at the beginning of the words on the top one character of ge a string to move to the left and the cursor at the beginning of the string on top one character at a time

Move to the beginning and end of the line

I goes to the beginning of the row and A goes to the end of the row

Move to the beginning and end of the segment

{move to first segment} Move to last segment

Move to the beginning and end

Gg moved to the beginning and G moved to the end

Turn the page

Ctrl + U goes up half a screen Ctrl + D goes down half a screen

Search (it is recommended to use idea)

This is not necessary, directly with idea to replace the search

Current row lookup

F goes to the right and f goes to the left

Current file lookup

Note that \c means case insensitive and \c means case sensitive

/ XXX \c For example find order word: /order\c

If you want to find the word where the cursor is, you can just use the asterisk.

To find the replacement

:{scope}s/{target}/{replace}/{replace flag} For example :%s/foo/bar/g will look for foo in the global scope (%) and replace it with bar, all occurrences will be replaced with (g).

other

replace

R replaces the character under the cursor; R goes into replace mode, replacing (until) one character at a time.

undo

U Undo the last modification action; U Undo all modifications on the current line.

Insert a line above

Shift + o

Insert a line underneath

o

other

There are some cool looking combos, but I haven’t done any screen recording. I will update them when I find a good screen recording software

The author is not very good at writing articles, but this time he did the following:

  1. In the text, the left and right sides of English characters and Arabic numerals are separated by Spaces
  2. A written order

If you find this article helpful, please leave a like before you go, or browse the author’s other articles if you are interested. If you think this article is a waste of your time, please leave your comments in the comments section. If you have any questions, please leave a message. The author is willing to spend time and energy to find answers and discuss them together.