October 12, 2022

Android Studio and Vim

Whenever some kind of IDE raises its ugly head, I start asking about Vim. I am just flat unwilling to use some crummy built in editor for anything other than toy experimentation. My vim habits are deeply ingrained, and if I start doing serious work, I don't want to be tripping over a stupid editor.

Another approach of course is to ditch the IDE altogether, use real VIM, and command line tools. People indeed do that.

I had found an Eclipse plugin that provided vim emulation and had configured it to work smoothly with my habits. There is something called the "IdeaVim" plugin for Android Studio that is the likely solution in the new world I need to enter.

The links above (and there are lots more if you search) range from teaching you how to use vim as a total newcomer, to escaping the android studio IDE and using real vim along with android command line tools.

Install IdeaVIM

Documentation is on the Github page.

I downloaded the plugin version 1.11.1 (dated 8-12-2-22). (This is not what you want to do, see below.) It is a 4M zip file.

/u1/IdeaVim-1.11.1.zip
Inside Android Studio, I go to File -- Settings, this brings up a settings window. I select the "Plugins" entry from this menu. This gives me a nice list of plugins to select from. It offers me IdeaVim 1.10.3 (May 24, 2022). It is 2 versions behind, but it is convenient. There is an install button, so I use it. It takes a few seconds (to download and install presumably) and then the button changes to "restart IDE". So I click the button.

Once again I go to the Plugins menu. It now shows IdeaVim as being installed. There is a gear icon at the top of the Plugins menu and when I click that I get another menu that includs "Install Plugin from Disk". Aha! Clicking this gives me a file browser, I find the path with the 1.11.1 version and select it. It tells me that the newer plugin is incompatible with the build I have of Android Studio. OK, that is fine and not my problem.

The bottom line is to forget about downloading the plugin and just use the plugin facility built into Android Studio.

Now under "Tools" in Android Studio there is an entry for Vim emulation. It is checked to indicate that emulation is enabled. The Github documentation is great.


Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org