Vim is a great text editor in its own right, and Android Studio is a great way to write apps. What if two great pieces of software come together? This article introduces ideaVIm, a plug-in for Android Studio.

Vim is great for Android Studio, so if you’re new to Vim, you’ll love it. Because it meets the specifications of the Programmer’s Manual. Here’s how to install and use it.

Install the Android Studio plugin: ideaVim

To install the ideaVim plugin, go to Plugins and search for ideaVim. When the installation is complete, restart Android Studios.




install.gif

Vim basis

One of the great things about using Vim is that you don’t need to use a mouse, and if you’re familiar with it, you’ll be much more productive.

By default, I divide it into three broad patterns

  • Vim is in command mode: it is mostly used to manipulate text files (rather than the contents of text files), such as saving files; Or it can be used to change the state of the editor itself, such as setting multi-column Windows, tabs or exiting the editor…
  • Insert mode: Write text in this mode. Press ESC to enter command mode and use “wq” to save the text
  • Common mode: To view text, enter I to enter the editing mode. Then, enter shift+: to enter the command mode.

For more, see Vim CheatSheets

IdeaVim use

The following details how to use the ideaVim plug-in, including move commands, edit commands, copy and paste, and so on. Text plus GIF with oh ~

Mobile command

He left – h

The right to l

On – > k

Next, j




left-right-up-down.gif

Skip the beginning of the word →w

Skip the end of the word →e




1-k6k2IYFO43QzouziJTYWSg.gif

Skip to the beginning of the line →o

Skip to the end of the line →$

Skip to the first character of the line → ^




line.gif

Skip to the next code block →}

Skip to the previous code block → {




code.gif

Skip to the next word →*

Skip to the last word →#

The first line of the file →GG

The last line of the file →G

Top of the screen →H

The middle of the screen →M

Bottom of the screen →L




ddt.gif

Lower half page →Ctrl + D

Half page →Ctrl + U

Previous page →Ctrl + B

Next page →Ctrl + F




up.gif

Edit command

Instead of a character → r




r.gif

Change the whole line →cc




cc.gif

Change a word (starting with cursor)→ CW




cw.gif

Change the whole word →ciw




ciw.gif

Repeat the previous action →.




post.gif

Size character conversion →~




Change The size of a character. GIF

Copy/cut/paste

The paste – p

Copy the whole line →yy




yy.gif

Copy a word →yiw




! [Uploading yy_218436.gif . . .]

Cut the entire line -> DD




dd.gif

Cut a word →diw




diw.gif

Search mode →/pattern

Backward search mode →? model

Repeat the search in the same direction →n

Repeat the search in the opposite direction →N




search.gif

That’s about it. If you are familiar with these commands, you will find that they are really quick to develop. Well, that’s it. If you want to know more, check out the official documentation. I hope it works for you.

Thanks to the following website

Ahmed Rizwan

Vim CheatSheets

An awesome intro to Vim

Macros

It’s the end again

Android Blog Weekly: Share top tech blogs at home and abroad every week, as well as excellent class libraries, Google videos and interview experiences. Latest source code summary: weekly share the new open source code, renderings, more intuitive. Please pay attention to the public number, there are surprises.




androidblog.jpg