viPlugin

User Manual v2.6.0
Copyright © by Michael Bartl, last updated 15.03.2012
Table of contents
viPlugin is a plugin for the Eclipse Platform that adds vi(m) functionality to almost all text based editors for Eclipse (JDT, CDT, PHP, …). For developers this means all editors implementing the ITextEditor interface.
Supported are all products based on Eclipse >=3.1, including Eclipse itself, Rapid Application Developer, Zend Studio, Aptana and many more.
There are two ways to install the viPlugin.
Click Help → Install New Software...

Enter http://viplugin.com into the textfield and press Add...

Install the viPlugin and the Statusbar plugin.

Press OK

Restart Eclipse

You should see this icon in the toolbar
![]()
By pressing the vi icon the viPlugin is loaded and all text editors will use it. By pressing the vi icon again it will be unloaded.
Download the latest version as zip file from the homepage viplugin.com (download box is on the right side). Extract the zip file to the dropins folder of your Eclipse installation. Restart Eclipse (if running)
The preferences for viPlugin are integrated into Eclipse and can also be accessed via :set
Window → Preferences → Workbench → Keys → Active configuration (drop-down) and select viPlugin.
Note: Some of the following command shortcuts are already in use by Eclipse itself and need to be reassigned yourself if needed. Also note that ambigous keybindings do not work in Eclipse. e.g. CTRL+W for EraseBackOneWord would disable CTRL+W W, CTRL+W L, ...
viPlugin implements the following commands (Eclipse Actions) which can be assigned a keybinding via the standard preferences keys dialog:
LoadViAction (default CTRL+ALT+V – loads/unloads viPlugin)
SwitchToCommandMode (default CTRL+C, remove Eclipse standard CTRL+C binding to activate)
SwitchToVisualBlockMode (default CTRL+V, remove Eclipse standard CTRL+V binding to activate)
ScrollLineUpAction (default CTRL+Y)
ScrollLineDownAction (default CTRL+E)
CycleEditorsAction (default CTRL+W W)
HalfPageUpAction (default CTRL+U)
PageDownAction (default CTRL+F)
PageUpAction (default CTRL+B)
PasteBufferInInsertMode (no default binding)
AddOneLevelOfIndentation (default CTRL+T)
EraseOneLevelOfIndentation (default CTRL+D)
EraseBackOneWord (no default binding)
IncrementNumber (default CTRL+A, remove Eclipse standard CTRL+A CTRL+Y binding to activate)
DecrementNumber (default CTRL+X)
Additionally the following standard Eclipse actions have been remapped:
Redo (default CTRL+R, remove Eclipse standard CTRL+R binding to activate)
Next Editor Tab (default CTRL+W L)
Previous Editor Tab (default CTRL+W H)
Following is a short description of implemented commands.
Not all implemented commands are listed here.
|
Command |
Description |
|
ESC |
Switch to command mode |
|
i |
switch to insert mode on current character |
|
a |
Switch to insert mode after current character |
|
I |
Switch to insert mode on first visible character of the current line |
|
A |
Switch to insert mode on last visible character of the current line |
|
o |
add a new line after the current line and switch to insert mode |
|
O |
add a new line before the current line and switch to insert mode |
|
v |
Switch to visual character mode |
|
V |
Switch to visual line mode |
|
! § CTRL+V (if mapped) |
Switch to visual block mode |
|
Command |
Description |
|
hjkl |
movement keys |
|
w |
move one word forward |
|
b |
Move one word backward |
|
W |
Move one WORD forward |
|
B |
Move one WORD backward |
|
e |
Move to end of word |
|
E |
Move to end of WORD |
|
gg |
Go to the first line |
|
G |
Go to the last line |
|
<n>G |
Go to the <n>-th line |
|
^ |
Move to first visible character in line |
|
$ |
move to the end of the line |
|
0 | (pipe) |
move to the beginning of the line |
|
{ |
Go to next blank line |
|
} |
Go to previous blank line |
|
% |
Match brace |
|
H |
Go to first visible line |
|
L |
Go to last visible line |
|
M |
Go to center visible line |
|
+ |
Go to the first visible character in the next line |
|
- |
Go to the first visible character in the previous line |
|
_ (underscore) |
Go to first visible character in line |
|
<SPACE> |
Move one character right (jump to next line if it was the last character in the line) |
|
<ENTER> |
Go to the first visible character in the next line |
|
Command |
Description |
|
x |
delete current character |
|
s |
delete current character and switch to Insert Mode |
|
dd |
Delete current line |
|
dk or d(Up Arrow) |
delete current line and the line above |
|
dj or d(Down Arrow) |
delete current line and the line below |
|
dw |
Delete word |
|
d$ |
Delete to the end of the line |
|
d0 |
Delete to the beginning of the line |
|
cc or S |
Delete current line and switch to insert mode |
|
cw |
Delete to the end of the word and switch to insert mode |
|
c$ |
Delete to the end of the line and switch to insert mode |
|
c0 |
Delete to the beginning of the line and switch to insert mode |
|
Command |
Description |
|
yy |
yank (copy) current line |
|
y |
yank (copy) selected text to default buffer (clipboard) |
|
"ay |
yank (copy) selected text to buffer a |
|
p |
paste text in default buffer |
|
"ap |
paste text in buffer a |
|
/abc |
search for abc |
|
* |
search for word under cursor |
|
# |
search for word under cursor backwards |
|
n |
search again with the last search string |
|
N |
search backwards with the last search string |
|
. |
repeat last command |
|
u |
Undo last change |
|
U CTRL-R (if mapped) |
Redo last undo |
|
<< |
Shift line left |
|
>> |
Shift line right |
Ex commands support ranges e.g.
:.,+1d
:.,$s/foo/bar/g
:1,'ac
|
Ex-Command |
Description |
|
:d |
Delete current selection |
|
:c |
Delete current selection and switch to insert mode |
|
:fs or :fullscreen |
Maximize editor window |
|
:version |
Show viPlugin version information |
|
:registers |
Show content of registers |
|
:vim |
Execute external vim application with the currently opened file at the same line/column. The path to the vim exectuable has to be configured in the preferences. |
|
:< |
Shift current selection left |
|
:> |
Shift current selection right |
|
:ta |
Start Eclipse „Open Type“ Dialog |
|
:y |
Yank current selection |
|
:e# or :b# |
Switch to last editor |
|
:t or :co (with range) |
Copy range to specified destination |
|
:map |
Map command (easier via preferences) |
|
:imap |
Map insert mode command (easier via preferences) |
|
:umap |
Unmap command or insert mode command (easier via preferences) |
|
:m (with range) |
Move range to specified destination |
|
:w |
Save file |
|
:wq or :x |
Save file and close editor |
|
:wa |
Save all |
|
:e! |
Revert changes |
|
:q |
Close editor without saving (but ask if there are unsaved changes) |
|
:q! |
Close editor without saving (and do not ask if there are unsaved changes) |
|
:<nr> |
go to line number <nr> |
|
:u |
Undo last change |
|
:red |
Redo |
|
:new |
Open new untitled text file |
|
:n |
Goto next editor |
|
:N or :prev |
Goto previous editor |
|
:cn |
Goto next Problem marker in current editor |
|
:$ |
Goto last line |
|
:<Up-Arrow> |
Go through Ex command history |
|
:<Down-Arrow> |
Go through Ex command history |
|
:[%]s/foo/bar/[gic] |
vi style search and replace |
|
:%s or :s |
Execute last search/replace command |
|
:g/pattern/cmd |
Execute cmd on all lines matching pattern. Support commands are d, y, t and m |
|
:v/pattern/cmd |
Execute cmd on all lines NOT matching pattern. Support commands are d, y, t and m |
|
:set |
Open viPlugin preferences |
|
:set ignorecase :set ic |
Ignore case in search (and replace) |
|
:set noignorecase :set noic |
Do not ignore case in search (and replace) |
|
:set vimcursor :set vc |
Use VIM style cursor |
|
:set novimcursor :set novc |
Do not use VIM style cursor |
|
:set shiftwidth=3 :set sw=3 |
Set shiftwidth to 3 |
|
:set expandtab :set et |
Expand tabs to spaces |
|
:set noexpandtab :set noet |
Do not expand tab to spaces |
|
:set wrapscan :set ws |
Wrap searches |
|
:set nowrapscan :set nows |
Do not wrap searches |
|
:set hlsearch |
Highlight search results |
|
:set nohlsearch |
Do not highlight search results |
|
:set incsearch |
Use incremental search |
|
:set noincsearch |
Do not use incremental search |
|
:set copytoclipboard |
Copies the default buffer yanks to the system clipboard |
|
:set nocopytoclipboard |
Deactivate copytoclipboard |
|
:set undolevels=99 |
Sets the number of undo levels to 99 |
This product includes the following software:
Jakarta Commons
Jakarta Codec
The license can be found in the doc folder.