Kommand – An AutoHotKey Script that does VIM-Like Text Editing and Window Management

I’m a huge fan of AutoHotKey. AutoHotKey has the power to make your keyboard do amazing things. I use it on a daily basis to open programs and folders, manage windows, and edit text amongst many, many other things. I use it so extensively that I find it frustrating to use a computer without it. AutoHotKey has the power to transform you into a computer ninja. I highly recommend its use.

Recently I released a part of my AutoHotKey script to the Internets and called it Kommand. Kommand remaps your keyboard and enables VIM-like key bindings that are useful for scooting around a document and making changes. I’ve found it very useful for coding. The nice thing is that since it is an AutoHotKey script, it is application independent and works wherever text input is needed. In addition to text editing, Kommand provides many keyboard shortcuts that help in window management. You can close, restore, maximize, minimize, and move windows around the screen really easily and quickly.

Kommand is very early software and I am only putting it out there to see if anyone is interested. More information about it can be found in the AutoHotKey forums here:

http://www.autohotkey.com/forum/viewtopic.php?p=281279

Kommand can be downloaded from the following link. The source AutoHotKey script is included along with a few files and executables that are useful for integrating it with Windows. If you use it, please let me know what you think!

http://www.kylirhorton.com/kommand.zip

Tags: ,

15 Responses to “Kommand – An AutoHotKey Script that does VIM-Like Text Editing and Window Management”

  1. Karl Malone says:

    I want to be a computer ninja!! But i find that if i take more time using the mouse and keyboard, i can waste more company time and money!!!

    j/k

    I had the program installed on one of my laptops, and it did help out a lot. great post!

  2. Kylir says:

    It’s all about saving time so you can waste time on things like Vegas and fried chick-un.

  3. Kylir says:

    PS – What happened to fielz?

  4. Mark says:

    I’m very interested in Kommand – are you still updating it, or have you found it to be stable enough for use as it is? Thanks!!!

  5. Kylir says:

    I am still updating it, although this version should be stable enough to use as-is. I really like the concept of Kommand, but I may change it up a bit and make the keybindings mirror exactly those of VIM. What would you think of that? (Right now the keybindings are quite different from VIM, although I think Kommand is easier to pick up than VIM.)

  6. Mark says:

    Well, it’s very interesting that you ask that, because I was planning on doing just that myself. I really like the idea of having them mirror VIM as much as possible – there’s nothing like having a common interface. I’ve been using Vimperator for Firefox for almost a year now and I’d hate to think how much slower I’d be without it. Obviously, you can’t have a browser interface EXACTLY match Vim’s keystrokes, but they’ve done an incredible job of making them match every place it makes sense. And the same goes for ViEmu for Visual Studio, which I also use habitually, and wouldn’t want to do without. I’d love to see the same thing in a more generic Windows interface, like Kommand. So, short answer: I think it’s a fantastic idea!

  7. Kylir says:

    Haha, nice. I’m also using Vimperator and ViEmu, although I’m more of a newbie at it all. I started using ViEmu shortly after I released Kommand and I was thinking the same idea. Well, I will definitely get something together and update Kommand sometime when I get a chance.

    One thing about Vimperator that drives me nuts is how it conflicts with keystrokes on some sites, like Remember the Milk and Gmail. I also hate pasting with it, as I’ll often paste content from outside Firefox. Do you have any suggestions on getting around those annoyances?

  8. Mark says:

    As for the keystroke conflicts, I stole this line from somebody:

    :autocmd LocationChange .* :js modes.passAllKeys = /mail\.google\.com|www\.google\.com\/reader\/view/.test(buffer.URL)

    If you put it in your vimperatorrc file, it’ll disable Vimperator’s keystrokes when you’re in a tab with google mail or google reader in the url.

    Can you elaborate a little more on the copy/paste problem? I’m sure there’s a way around it…

  9. Kylir says:

    I actually already knew about the autocmd LocationChange thing. For me, it only partially works. The only problem with it is that escape still pulls me out of pass through mode and I use escape pretty heavily on Remember the Milk. Is there a way to override keystrokes for specific sites?

    When I say paste, I mean pasting into text boxes mostly. It is okay that I have to press ctrl+v twice for normal places, but when I’m in that pass-through mode, things go all crazy. It seems like either pasting is disabled or it’ll take me out of pass-through. Sometimes something will happen with Vimperator and I end up having to restart Firefox completely. It would be nice to remap ctrl+v when I’m in pass through + insert mode to be normal ctrl+v. Do you know what I mean?

  10. Mark says:

    Hmmmm – I think that’s beyond the scope of my knowledge at this point, too. However, I’m SURE somebody on the vimperator@mozdev.org mailing list would know. Are you subscribed to that list? Or I could ask the questions in your behalf…

  11. Kylir says:

    Last night I took the time to figure out a solution to a number of annoying things with Vimperator and now I’ve got it set up so that it is pretty usable for me, including fixes for the annoying pasting issues I was having.

    The only thing I would like to figure out is how to do site-specific key mappings. Since Remember the Milk uses the escape key all over the place, it would be cool if I could do two things:
    1. Automatically go into pass-through mode so I can send any keystroke I want. So something like autocmd LocationChange .* :js modes.passAllKeys = /www\.rememberthemilk\.com\/home\/[^/]+\/#section\.tasks/.test(buffer.URL).

    2. I need a way to send the escape keystroke while in insert mode and drop back to pass-through mode after sending it. I’ve tried inoremap and inoremap , but they haven’t quite worked right.

    Another solution to this whole thing would to have a way to completely disable Vimperator in every way for just Remember the Milk. Anyway, I think I’ll just join the mailing list and ask away.

    By the way, I found a way cool extension called jV that enables Vi keybindings inside textareas. If you use it, make sure you put inoremap into your vimperatorrc file, which will solve Escape conflicts between Vimperator and jV in textareas.

  12. Kylir says:

    No, unfortunately not. Although I do like his gui and nogui custom command ideas.

  13. Mark says:

    Looks like the gurus on the mailing list are helping you out, though…

    So back to the original discussion: What’s the prognosis for modifying your script to make it more “Vimpatible”? (Hey, sounds like a cool name…) With my overloaded schedule, I don’t want to start on it, if you’re already in the process…

  14. Kylir says:

    It shouldn’t take too much work to get some of the basic key mappings going, I just need to move things around. I’ll do something over the weekend and put up a new post. We should probably just communicate over email. ;)

Leave a Reply