1. The document discusses using Vim in Android Studio and customizing the IdeaVim plugin. It provides an overview of Vim and IdeaVim, demonstrates basic Vim shortcuts and navigation, and shows how to define key mappings in the .ideavimrc file to execute common Android Studio actions in Vim.
2. The document also explores extending IdeaVim by creating custom EX commands and command handlers to execute system commands like adb from within Vim.
3. The author concludes they enjoyed customizing their setup, learned about the pairing programming approach when extending IdeaVim, and discusses Vim's learning curve.
4. kimkevin@DroidNights2018: ~
What is Vim?
Vim is a highly configurable text editor
built to enable efficient text editing. It is
an improved version of the vi editor
distributed with most UNIX systems.
Vim is often called a "programmer's editor,"
and so useful for programming that many
consider it an entire IDE. Vim is perfect for
all kinds of text editing, from composing
email to editing configuration files.
– Johnny Appleseed
5. kimkevin@DroidNights2018: ~
IdeaVim is a Vim emulation plugin for IDEs
based on the IntelliJ platform. IdeaVim can
be used with IntelliJ IDEA, PyCharm, CLion,
PhpStorm, WebStorm, RubyMine, AppCode,
DataGrip, GoLand, Cursive, and Android
Studio.
– Jetbrains ideavim GitHub
What is IdeaVim?
11. kimkevin@DroidNights2018: ~
public void setUser(User user)
// $ : the end of line
public void setUser(User user)
// 0 : the start of the line
public void setUser(User user)
// w : move forward word
public void setUser(User user)
// b : move backward word
public void setUser(User user)
12. kimkevin@DroidNights2018: ~
public void setUser(User user)
// 2w : move forward two words
public void setUser(User user)
// dw : delete forward word
public void (User user)
// u : undo
public void setUser(User user)
// db : delete backward word
public setUser(User user)
23. kimkevin@DroidNights2018: ~
nnoremap <leader>rr :action Run<cr>
// {lhs} : left hand side
// {rhs} : right hand side
:actionlist (Show all actions)
ex) Run, RenameElement, FindUsages
<cr> : carriage return
{cmd} {attr} {lhs} {rhs}
34. kimkevin@DroidNights2018: ~
1. EX mode is which is invoked
using the ex command.
2. This is for the Ex commands,
3. ”:", the pattern search
4. commands, "?" and "/", and the
5. filter command, "!".
~
~
~
~
:%s/command/cmd/g
35. kimkevin@DroidNights2018: ~
1. EX mode is which is invoked
using the ex cmd.
2. This is for the Ex cmds,
3. ”:", the pattern search
4. cmds, "?" and "/", and the
5. filter cmd, "!".
~
~
~
~
~
51. kimkevin@DroidNights2018: ~
1. Create EX command Handler and
Register CommandParser
2. Set command and flags on super
class
3. Write codes in execute()
4. Run and Test