43 Folders

43 Folders feed subscription icon - Shiny! Drowning in email? Try Inbox Zero to learn sane tips for dealing with high-volume email. And don’t miss the free Inbox Zero video. »

Login or register

Register for free on 43 Folders to comment on articles, post to our forum, customize your visits, and much more. Current users can login now.

Vi commands in all your Cocoa apps

Jason Corso - Vi Input Manager Plugin

Vi Input Manager seems like a godsend for Mac (or more accurately, Cocoa) users who have Vi commands permanently installed in their fingertips.

This bundle patches the Cocoa Text System to add a Vi-like command mode. After entering command-mode (typically, by hitting escape in Vi), ordinary Vi commands can be typed and the text field will be updated accordingly…

Right now, you should be thinking — “you mean the editor in XCode will behave like Vi?” Answer: Yes.

Reminds me it’s about time for another round of trying to learn Vim.

[ via: Vi Input Manager - The Unofficial Apple Weblog (TUAW) ]


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Fred's picture

I just tried using it...

I just tried using it again, and it doesn’t even implement yank! And that’s a command firmly in the “changing a keybinding” set. Using multipliers in any way outside of the grammar described on his website totally fails — you can’t do ‘2dw’, only ‘d2w’.

I think I could actually mistake this for a congealed salad.

jeff's picture

Sadly, this is still missing...

Sadly, this is still missing some of the features I find as key. Like ( and ) for forward and backward by sentence. That’s great, useful stuff, but sadly missing here. It’s probably trivial to add, but I’ve got many higher items on my list than fiddle with key bindings to make vim work in Safari, alas.

Merlin Mann's picture

Not even a ghost's shadow,...

Not even a ghost’s shadow, Fred? Not even the shadow of an actual freaking ghost? Damn. A ghost, mind you. With a shadow. Not this.

But, seriously, if this plugin were standing, nude, in front of like 150 longtime Vi users, it would be so disturbingly “not-like-Vi” that it might actually be mistaken for — what? — maybe a congealed salad or a copy of Meet the Beatles or a slightly dented Toyota Tercel? I mean, truly, then yes: it is that unacceptably bad as to render me without modern human speech.

It would, in fact, be so opposite of every. thing. that Vi is capable of doing that it could more properly be called “The Opposite of Vi” or perhaps “Null Vi Not Vi ever never Not Doodley Doing Vee Eye.” There are no words. Clearly.

Not even a ghost’s. shadow. Wow. I mean. Wow.

That is indeed pointless, Fred, and 43 Folders regrets the error.

Fred's picture

This implements such a simplistic...

This implements such a simplistic subset of functionality as to be pointless. Everything you can use it for has an easy and obvious existing shortcut without the pointless modality. All it’s doing is changing the existing keybindings when you enter command mode. It implements no new functionality.

This isn’t even a ghost’s shadow of vi.

Fred's picture

Merlin, you don't know vi....

Merlin, you don’t know vi. You’ve been halfheartedly trying to learn it for several years. You’re a fanboy of something you don’t even use.

All this implements is a few of the simplest movement and insertion commands as simple keybindings. In terms of actually trying to use it, it behaves completely differently from vi/vim. The way the multiplier works with movement is nowhere near as robust as the way it works in real vi. No s/foo/bar/g. No commands beyond :w, which just presses Command-S for you. Nothing that uses control or alt. None of the stuff that works while you’re in insert mode. None of the alternate input modes.

The only things that are implemented are things that map directly and easily to existing bindings. This isn’t vi, this is the scum of hair and skin cells left on a vi user’s razor.

Levi's picture

Vi command image: http://www.viemu.com/a_vi_vim_graphical_cheat_

Vi command image: http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html

a different Travis's picture

You made it sound like...

You made it sound like I was going to be able to navigate around webpages with vi commands. I have been wanting that for a long time now. I could kill somebody.

parlay's picture

The To-Do List Maze... I've started...

The To-Do List Maze…

I’ve started using this notepad I have to make elaborate To-Do lists every day. This is at once satisfying and hearbreaking. After a certain amount of effort and struggle I get to cross something off the list (“check flagged emails”……

Travis's picture

^^Pwnd! Does anyone know of a...

^^Pwnd! Does anyone know of a desktop background image that has all of Vim’s commands?

Travis's picture

Is there really any point...

Is there really any point in learning Vim when you know Textmate?

mithras's picture

The main thing I'd want...

The main thing I’d want from it would be a quick :s/foo/bar/, but it looks like ‘w’ is the only : command implemented so far…

FARfetched's picture

Ahhhhhhhh.... blessed relief at last! ...

Ahhhhhhhh…. blessed relief at last!

TC!'s picture

I've been praying for this...

I’ve been praying for this for years, hallelujah!

Ignobilitor's picture

I saw this earlier this...

I saw this earlier this week and pounced on it; however, not all Cocoa editors can take advantage of this. Much to my dismay, I’ve learned that TextMate is one of those that can’t, since it doesn’t use the standard cocoa texfield. Smultron works, though…

AmberV's picture

I tried this, but being...

I tried this, but being a long time user of Vim, I found the limited commands to be more frustrating that useful. Moving the cursor around, doing simple things like that — well that is just the way it was in Vi, it doesn’t really add anything to the Cocoa experience. It is the stuff that no other text editor on earth can do in 10 keystrokes that makes Vim as awesome as it is — and this fails the grade at that.

Ara's picture

You can check out the...

You can check out the cheat-sheets for VI: http://www.viemu.com/avivimgraphicalcheatsheettutorial.html

David's picture

For all your key-binding needs,...

For all your key-binding needs, consult: http://www.hcs.harvard.edu/~jrus/Site/Cocoa%20Text%20System.html Let’s just say that it’ll blow your friggin gourd.

Kevin's picture

"Is there really any point...

“Is there really any point in learning Vim when you know Textmate?”

Yes. Faster, cheaper, way more powerful, works anywhere. I gave Textmate a whirl but vim owns it.

Blog Mirrors » Vi commands in all your Cocoa apps's picture

[...] Share This [...] ...

[…] Share This […]

About Merlin Mann

Merlin Mann's picture

Bio

Merlin Mann is an independent writer, speaker, and broadcaster. He’s best known for being the guy who started the website you’re reading right now. He lives in San Francisco, does lots of public speaking, and helps make cool things like You Look Nice Today. Also? He looks like this, answers questions, and has something like a life.

 
EXPLORE 43Folders THE GOOD STUFF

An Oblique Strategy:
Distorting time


STAY IN THE LOOP:

Subscribe with Google Reader

Subscribe on Netvibes

Add to Technorati Favorites

Subscribe on Pageflakes

Add RSS feed

The Podcast Feed

Inbox Zero

The original 43 Folders series looking at the skills, tools, and attitude needed to empty your email inbox — and then keep it that way. Don’t miss the free video of Merlin’s Inbox Zero presentation.

Making Time

3-part series on attention management for artists and makers. Read Bad Correspondence, The Job You Think You Have, and One Clear Line.