Brit. informal: ineffectual activity
Kate’s Vi Input Mode — What will KDE 4.4 bring?
Dear “Katevim” users. Kate’s Vi Mode is steadily improving and I want to take a moment to tell what’s on the horizon for KDE 4.4. There has been quite a few bugs fixed since 4.3, but some major new features have also been introduced:
The Comma Text Object
This is something that I have been 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 below, the three ranges this text object would cover is highlighted in red.

Comma text object ranges. If the cursor is over, say, "arg2", pressing c i , ("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 parameter
This has actually been in Kate’s Vi Mode for a while now, but since it has not been announced until now, I guess I am the only one using it.
Limited Normal Mode Mapping Support
It is now possible to add mappings in normal mode (:nnoremap in Vim). There are still some flaws, such as the fact that one cannot map a keypress to “:somecommand<enter>“, but hopefully people who are using dvorak/colemake can make use of the vi mode now.
Command Line Mode Commands
Yes, really! Kate’s Vi Mode finally support some of the most command commandline mode commands from Vim. What can be done from the Kate editor part is limited by the fact that it can’t control its hosting application, but Kate – the application – has now gotten support for the following commands:
- q, qa
- w, wq, wa, wqa
- x, xa
- bn, bp
- new, vnew
- edit
| Print article | This entry was posted by Erlend on 26 October, 2009 at 20:12, and is filed under english, kde. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |

![wqa_help Kate showing help text for the wq[a] command](http://hamberg.no/erlend/wp-content/uploads/2009/10/wqa_help-300x210.png)
about 4 months ago
nice
I tried it out yesterday…
will it be possible for the magical kde.vim settings file to work in kate? I tend to rely on the kdelibs-style-enforcer part.
about 4 months ago
Thanks, I use colemak and now I can finally use the Vi mode. Keep up the good work.
about 4 months ago
@chani:
probably not that file directly, but it should be possible to have a katerc file in the kdelibs dir that would set the right settings for tabs/indentation, etc. (is it this file you mean: http://websvn.kde.org/trunk/KDE/kdesdk/scripts/kde-devel-vim.vim?view=markup ?)
@joe:
thanks! hope it suits your need
about 4 months ago
Yay, I’ll have to give it a go. I spend most of my day hacking KDE in vim and it’s ironic that the only KDE link is that vim is running in a konsole.
about 4 months ago
=D Awesome, thanks for your work .. bringing my two favourite editors together!
For what it’s worth, I use ci all the time (in vim and kate) so the feature has definitely been noticed. Can’t wait to see what else KDE 4.4 will bring!
about 4 months ago
@will: hope it works out for you.
@scomar: thanks! i use ‘ci’ all the time, too. i could never live without text objects and hate when i have to use plain vi.
about 4 months ago
Any news or plan about Yzis (www.yzis.org)?
about 4 months ago
@peter: haven’t heard anything in a long time, unfortunately. you could try their mailing list and hear what the current status is.
about 4 months ago
Very cool stuff. I so would love to switch to kate-vi where possible (not so great for some of the remote work I have to do, though all local stuff I’d really like to switch).
That’s just my way of fast navigation through the source…
But https://bugs.kde.org/show_bug.cgi?id=205887 is still a major blocker for me.
Keep up the great work!
About kde-devel-vim.vim: It’s a big hack to put spaces and braces where they belong according to the coding style (tabs and indentation are just a small part of what it does automatically). I believe that supporting it directly is a major effort. OTOH if there were a nicer way to implement this stuff for all of kate (not just in vi mode) I’d prefer to port to that.
about 4 months ago
@matthias: unfortunately, kate’s search code is completely tied to the gui search widget, which makes this really messy. (this should have been a five minute job.)
there is an effort under way to fix this design blunder though. this will be fixed five minutes after that is done.
about 4 months ago
Very nice! Looking forward to :bn :bp :sp :sba and :reg too.
about 4 months ago
@alexander: :bn and :bp are in the list
:reg is coming when there is an easy way of showing a (potentially) large amount of information in a non-annoying way.
about 4 months ago
Impressive works! Still, can you consider including command in the list, which turn a vim into ‘normal mode’ temporarily when it’s in ‘input mode’. The command greatly expand the function of mapping command feture and make all kind of mapping I imagine possible.
about 4 months ago
oops. letters surrounded by ” are not shown. The command I mean was ”.
about 4 months ago
@thanks
i guess you mean ctrl-o? your wish is noted.
about 4 months ago
yes, that’s it what I meant. c-o ^^
I hope that feature to be in your list.
about 3 months ago
Nice work !
Do you plan to implement vi’s ctrl-v visual block mode ? As far as I know, the only way to use block mode in kate/kdevelop4 is to activate block selection, but it’s seriously lacking all the power of vi’s visual mode (insert, replace…).
about 3 months ago
@komuta: yes. absolutely. that’t the feature i miss the most myself. i hope to get that done early in 2010.
about 2 months ago
Two navigation commands I didn’t realize I relied on so heavily are and ‘-’ to move to the first non-blank character of the next/previous line. I can’t get out of the habit of trying to use them.
about 2 months ago
Previous post should have read something like “Two navigation commands I didn’t realize I relied on so heavily are carriage-return and ‘-’ …”.
about 2 months ago
@simgardn: i’ll add that!
Kate in KDE SC 4.4 will support mappings, so you should be able to simulate similar motion commands. I tried
:nnoremap - k^and:nnoremap <enter> j^, but it turns out that there’s an error with the parsing of<enter>. I’ll fix that asap.But to clarify, the “-” and “<enter>” commands will be in the next release – no need to map them your self.