I've been using vim on the command line for ages, but just recently began work on integrating it better with Xcode, my primary development environment. Adding functionality to VIM is quite easy, and thanks to AppleScript on Mac OS, telling Xcode what to do from VIM is easy as well! First you'll need a copy of
MacVim.
Download and install that in your /Applications folder. Once done, open up Xcode and navigate your way to the 'File Types' tag. Under file->text->sourcecode->sourcecode.c, click where it says "Default (Source Code File). You'll then get a popup menu. Select 'External Editor' and then Other and find MacVim in your /Applications folder.

Now when you double click on a C/C++/Objective-C source file within Xcode, it will open up with MacVim as the editor rather than the default Xcode source code editor.
Now, I didn't like having to change windows back to Xcode in order to make the projects build. Thus, I added a few lines to my ~/.vimrc:
" update the :make command to tell Xcode to build
set makeprg=osascript\ -e\ \"tell\ application\ \\\"Xcode\\\"\"\ -e\ \"build\"\ -e\ \"end\ tell\"
function! XcodeClean()
silent execute ':!osascript -e "tell application \"Xcode\"" -e "Clean" -e "end tell"'
endfunction
command! -complete=command XcodeClean call XcodeClean()
function! XcodeDebug()
silent execute '!osascript -e "tell application \"Xcode\"" -e "Debug" -e "end tell"'
endfunction
command! -complete=command XcodeDebug call XcodeDebug()
" Command-K cleans the project
:noremap <D-k> :XcodeClean<CR>
" Command-Return Starts the program in the debugger
:noremap <D-CR> :XcodeDebug<CR>
And we now have VIM integrated with Xcode. There's only one slight problem that I've found. When starting the debugger, VIM waits for a return even after you're done debugging in Xcode. Hitting CTRL-C gets you back to the editor. If anyone has any suggestions on how to get around this little issue, let me know!