开发者

What's the best way to use vim for Cocoa development?

开发者 https://www.devze.com 2023-02-08 10:52 出处:网络
First time poster, long time reader. I searched and found no questions that answered this question. If I missed a thread somewhere I apologize.

First time poster, long time reader. I searched and found no questions that answered this question. If I missed a thread somewhere I apologize.

I've been looking at doing some s开发者_运维知识库erious Cocoa development for a few years now. Even attended WWDC back about 5 years ago. With the App Stores making things easier for distribution I figured now is about as good of a time as any.

There's also been a fair amount of discussion regarding Vim lately and how it can increase productivity once you get a good handle on it. So I've purchased a couple books on Vim and bookmarked a dozen or two websites that I've seen lately.

My question is what plugins or whatever could I use with Vim to make developing with Cocoa/ObjC better?

I'm familiar with the Cocoa.vim plugin, but looking at the site there it hasn't been actively worked on for around 10 months. Before I get used to the features in that plugin I'd rather look at alternatives that have seen more development (if there are any).

That said, I'm interested in any and all tips regarding Vim and Cocoa/ObjC. Any easy ways to integrate them? I know you can set MacVim as the default editor in Xcode. What else might someone be able to do? Doing a Command-R to build&run would be great (Cocoa.vim claims to do this), but again, lack of development makes me cautious.

Thanks, gks


Install the XVim plugin for Xcode. It gives Vim-like key bindings to Xcode.


I start using Vim one month ago, so I'm not a master but I'm quite familiar now.

As a Cocoa developer, I've been also looking to integrate things better, but until now, even with cocoa.vim I think Xcode still better for "application development". With this expression, I mean developing the easy part, that is logic like designing controllers.

You may agree with me. That's the easy part. Writing IBActions and so on. We don't need many editing commands to do that, and Xcode has a lot of advantages here. The auto-completion is phenomenal, it's intelligent and reads what you have been typing like no other. And can you imagine things with Xcode 4? Dragging an outlet from the interface directly into code is something that will not be available in Vim in a recent future.

Now, when it comes to writing models with heavy logic and C things, I stick with Vim.

You see, I still need to learn a lot. I'd love to have Vim running in the exact place of Xcode editor, but while that doesn't happens I have been trying to get the best from both worlds. Xcode is not all about editing text, it's about developing and debugging and many more, and it does these things in a fantastic way.

I'll let more experienced users continue…


I use vim for every text editing job except Cocoa. I agree with the things Sidyll says about the advantages of Xcode. Xcode is a pretty decent development environment with it's native editor.

I do have my Xcode set so that a double click brings up the file in Vim. I use this for things like fairly complex find and replace with regular expressions.

Another feature I'd like to see in Xcode is support for literate programing. In Haskell I can compile a file wih lhs suffix, and run the same file through Pandoc (or txt2tags) and get an HTML or PDF version. With Xcode I have to keep my development notes in a separate file.

0

精彩评论

暂无评论...
验证码 换一张
取 消