Padre::Plugin::Vi - vi keyboard for Padre
Once installed and enabled the user is in full vi-emulation mode, which was partially implemented.
The 3 basic modes of vi are in development:
When you turn on vi-mode, or load Padre with vi-mode already enabled you reach the normal navigation mode of vi.
We don't plan to implement many of the configuration options of vi. Even parts that are going to be implemented will not use the same method of configuration.
That said, we are planning to add looking for vi configuration options in the source file so the editor can set its own configuration based on the vi configuration options.
The following are implemented:
in navigation mode catch ':' and open the command line
l,h,k,j - (right, left, up, down) navigation
4 arrows also work
Number prefix are allowed in both the 4 letter and the 4 arrows
Home - goto first character on line
End - goto last character on line
^ - (shift-6) jump to beginning of line
$ - (shift-4) jump to end of line
v - visual mode, to start marking section
d - delete the selection x - delete the selection y - yank the selection v - stop the visual mode, remove selection
p - paste below
P - paste above
Ctrl-6 - jump to last window edited. (This is inherited from Padre)
a - switch to insert mode after the current character
i - switch to insert mode before the current character
TODO this is currently step one character back as the caret is not ON a caracter but between two.
o - add an empty line below current line and switch to insert mode
O - add an empty line above current line and switch to insert mode
x - delete current character
Nx - delete N characters
dd - delete current line
Ndd - (N any number) delete N lines
d$ - delete till end of line
Ndw - delete N word
yy - yank (copy) current line to buffer
Nyy - yank (copy) N lines to buffer
y$ - yank till end of line
Nyw - yank N words
u - undo last editing
J - (shift-j) join lines, join the next line after the current one
ZZ - save file and close editor
42G - jump to line 42
G - jump to last line
w, Nw - next word, forward N words
b, Nb - back one word, back N words
ESC moves to navigation mode
Ctrl-p - autocompletion (inherited from Padre)
For now at least, everything else should work as in standard Padre.
:w - write current buffer
:e filename - open file for editing
TAB completition of directory and filenames
:42 - goto line 42
(we have it in generalized form, you can type any number there :)
:q - exit
:wq - write and exit
:bN to switch buffer N
TODO: it is not working the same way as in vi, first of all numbers are from and if a file is closed the buffers are renumbered. If we really want to support this option we might need to have our own separate mapping of numbers to buffers and files.
Better indication that Padre is in vi-mode.
Change the cursor for navigation mode and back to insert mode. (fix i)
Integrate command line pop-up move it to the bottom of the window make it come up faster (show/hide instead of create/destroy?) (maybe actually we should have it integrated it into the main GUI and add it as another window under or above the output window?) Most importantly, make it faster to come up
/ and search connect it to the new (and yet experimental search)
r for replacing current character :q! - discard changes and exit
:e! :ls and