The VI Input Mode

VI Input Mode
The goal of the VI mode is not to be a complete replacement for Vim and support all Vim’s features. Its aim is to make the Vim way of text editing - and the Vim habits learned - available for programs using the text editor as their internal editor.
The VI mode aims to integrate nicely with the program and deviate from Vim’s behavior where it makes sense. For example, :w will open a save dialog in ’s VI mode.
To enable the VI Input Mode for all new views, go to Settings Configure ... Editing VI Input Mode. On this tab you can set options for the VI Input Mode and define and edit the key mapping in this mode. VI Input Mode can also be toggled with the VI Input Mode setting in the Edit menu. (The default shortcut key is Meta V - where Meta usually is the Windows key).
Many Vi Mode keyboard commands are case-sensitive, unlike most keyboard shortcuts. That means that y and Y are different commands. To enter the y (yank) command, make sure Caps Lock is disabled and press Y. To enter the Y (yank to end of line) command, Y.
This does not apply to commands that use the key, which may be entered regardless of Caps Lock mode and without pressing . However, some commands require the use of a -key combination followed by another key which is case sensitive. For instance, to input W, h (switch to split view right) make sure Caps Lock is disabled, press W, release, and then press H.

Incompatibilities with Vim
There are only a few features of ’s VI mode which are incompatible with Vim (not counting things missing). They are listed below together with the respective reasons.
: U and R is redo.
Vim: R is normal redo, U is used to undo all latest changes on one line.
The reason for having U act as redo in ’s VI mode is that the shortcut R by default is taken by ’s replace function (search and replace). By default, the VI mode won’t override ’s shortcuts (this can be configured in Settings Configure ... Editing Vi Input Mode), therefore a redo-action needs to be available as a regular key press, too. Besides, the behavior of the U command in Vim does not map well to ’s internal undo system, so it would be non-trivial to support anyway.
: print shows the Print dialog.
Vim: print prints the lines of the given range like its grandfather ed.
Commands like :print are available not only in the VI mode but for users using regular , too - therefore the :print command opens the print dialog - following the principle of least surprise instead of mimicking Vim’s behavior.
: Y yanks to end of line.
Vim: Y yanks whole line, just like yy.
VI’s behavior for the Y command is in practice a bug. For both change and delete commands, cc/ dd will do its action on the current line and C/D will work from the cursor column to the end of the line. However, both yy and Y yanks the current line. In ’s VI Mode Y will yank to the end of the line. This is described as more logical in the Vim documentation.
: O and o opens [count] new lines and puts you in insert mode.
Vim: O and o opens a new line and inserts text [count] times when leaving insert mode.
This is mostly done as a consequence of witnessing many people being confused by this behavior on a vim irc channel (#vim on freenode).

Switching Modes
Normal Mode permits you to enter commands to navigate or edit a document, and is the default mode. You can return to it from any other mode by pressing .
Visual Mode permits you to highlight text in a document. Most Normal Mode commands are also valid in this mode. You can enter it by pressing v to select characters or V to select lines.
Insert Mode permits you to edit the document directly. You can enter it by pressing i or one of several other commands listed below.
Command Mode invokes 's command line, permitting you to run many commands available in Vi implementations as well as some specific to . For more information on these commands, see . To use it, press :, enter the command, and press .

Integration with Kate features
Visual Mode is entered automatically when text is selected with the mouse. It is also entered when using functions of Kate that select text, such as Select All (either from the menu or via A .)
Vi marks and Kate bookmarks are integrated. When a mark is created in Vi Mode, a corresponding Kate bookmark is created and appears in the Bookmarks menu. Conversely, when a Kate bookmark is created, a corresponding Vi mark at the 0 column is also created.

Supported normal/visual mode commands
a	Enter Insert Mode; append after cursor
A	Enter Insert Mode; append after line
i	Enter Insert Mode; insert before cursor
Insert	Enter Insert Mode; insert before cursor
I	Enter Insert Mode; insert before first non-blank char on line
gi	Enter Insert Mode; insert before place, where leaving the last insert mode
v	Enter Visual Mode; select characters
V	Enter Visual Mode; select lines
v	Enter Visual Mode; select blocks
gb	Enter Visual Mode; reselect the last selection
o	Open a new line below current line
O	Open a new line above current line
J	Join lines
c	Change: follow by a motion to delete and enter Insert mode
C	Change to end of line: Delete to end of line and enter Insert Mode
cc	Change line: Delete line and enter Insert Mode
s	Substitute character
S	Substitute line
dd	Delete line
d	Follow by a motion to delete
D	Delete to end of line
x	Delete character to right of cursor
Delete	Delete character to right of cursor
X	Delete character to left of cursor
gu	Follow with a motion to make lowercase
guu	Make the current line lowercase
gU	Follow with a motion to make uppercase
gUU	Make the current line uppercase
y	Follow by a motion to yank (copy)
yy	Yank (copy) line
Y	Yank (copy) line
p	Paste after cursor
P	Paste before cursor
]p	Paste after cursor indented
[p	Paste before cursor indented
r	Follow with a character to replace the character after the cursor
R	Enter Replace Mode
:	Enter Command Mode
/	Search
u	Undo
R	Redo
U	Redo
m	Set mark (can be used by motions later)
n	Find next
N	Find previous
>>	Indent line
<<	Unindent line
>	Indent lines
<	Unindent lines
F	Page down
B	Page up
ga	Print the ASCII value of the character
.	Repeat last change
==	commandAlignLine
=	commandAlignLines
~	Change case of current character
S	Split view horizontally
V	Split view vertically
W, w	Cycle to next split window
W, h W Left	Go to left split window
W, l W Right	Go to right split window
W, k W Up	Go to above split window
W, j W Down	Go to below split window

Supported motions
These may be used to move around a document in Normal or Visual mode, or in conjunction with one of the above commands. They may be preceded by a count, which indicates how many of the appropriate movements to make.
h	Left
Left	Left
	Left
j	Down
Down	Down
k	Up
Up	Up
l	Right
Right	Right
Space	Right
$	End of line
End	End of line
0	First character of line (Column 0)
Home	First character of line
^	First non-blank character of line
f	Follow by character to move to right of cursor
F	Follow by character to move to left of cursor
t	Follow by character to move to right of cursor, placing the cursor on character before it
T	Follow by character to move to left of cursor, placing the cursor on character before it
gg	First line
G	Last line
w	Next Word
W	Next word separated by whitespace
b	Previous word
B	Previous word separated by whitespace
e	End of word
E	End of word separated by whitespace
ge	End of previous word
gE	End of previous word separated by whitespace
|	Follow by a column number to move to that column
%	Follow by an item to move to that item
`	Mark
‘	First non-whitespace character of the line the mark is on
[[	Previous opening bracket
]]	Next opening bracket
[]	Previous closing bracket
][	Next closing bracket
I	Jump forward to next location
O	Jump back to previous location
H	Go to first line of screen
M	Go to middle line of screen
L	Go to last line of screen
%percentage	Go to specified percentage of the document
gk	Go one line up visually (when using dynamic word wrap)
gj	Go one line down visually (when using dynamic word wrap)
Left	Move one word left
Right	Move one word right

Supported text objects
These may be used to select certain portions of a document.
iw	Inner word: word including whitespace
aw	A word: word excluding whitespace
i"	Previous double-quote (") to next double-quote, including quotation marks
a”	Previous double-quote (") to next double-quote, excluding quotation marks
i'	Previous single-quote (') to next single-quote, including quotation marks
a'	Previous single-quote (') to next single-quote, excluding quotation marks
i(	Previous opening parenthesis [(] to next closing parenthesis [)], including the parenthesis
a(	Previous opening parenthesis [(] to next closing parenthesis [)], excluding the parenthesis
i[	Previous opening square bracket ([) to next closing square bracket (]), including the brackets
a[	Previous opening square bracket ([) to next closing square bracket (]), excluding the brackets
i{	Previous opening curly bracket ({) to next closing curly bracket (}), including the brackets
a{	Previous opening curly bracket ({) to next closing curly bracket (}), excluding the brackets
i<	Previous opening angle bracket (<) to next closing angle bracket (>), including the brackets
a<	Previous opening angle bracket (<) to next closing square bracket (>), excluding the brackets
i`	Previous backtick (`) to next backtick, including the backticks
a`	Previous backtick (`) to next backtick, excluding the backticks

Supported insert mode commands
D	Unindent
T	Indent
E	Insert from below
Y	Delete word
W	Delete word
U	Delete line
J	New line
H	Delete char backward
Home	Move to first character in the document
R n	Insert the contents of register n
O, command	Enter normal mode for one command only
A	Increment currently selected number
X	Decrement currently selected number

The Comma Text Object
This object is missing in Vim. The comma text object makes it easy to modify parameter lists in C-like languages and other comma separated lists. It is basically the area between two commas or between a comma and a bracket. In the line shown in the illustration, the three ranges this text object can span are highlighted.
An example of Comma Text Object
An example of Comma Text Object
Comma text object ranges. If the cursor is over ⪚ arg2, pressing ci, (change inner comma) would delete double arg2 and place the cursor between the two commas in insert mode. A very convenient way to change a function's parameters.

Missing Features
As stated earlier, the goal of ’s VI Mode is not to support 100% of Vim’s features.