Vim and Xcode will coexist together, provided that you are not trying to edit the same files at the same time in Vim and the Xcode editor. If you do this, each of them will give you a warning that the file has been modified externally. The terminal version of Vim is a little easier to live in this particular respect: it will only warn you when you try to save the file, asking if you are sure, while MacVim and the Xcode editor will warn you every time you return to the file .
Xcode allows you to select an external application when opening files by file type. In the Xcode settings, go to the File Types tab, and then file-> text-> source code. The preferred editor can be configured to an external program such as MacVim; note that Emacs should already be specified as a choice: when Emacs is selected, Xcode launches Terminal.app with Emacs in the terminal. This parameter of the preferred editor has a problem that you get a new window with every open file, which may not match your workflow.
The Vim remote function may be useful here, see :help remote . With a little work and the above preference of the preferred editor, you need to be able to send the file for editing to any instance of Vim, including the existing Vim running in xterm . I seem to remember that Emacs provides something similar.
But none of this allows you to use the Vim parameter without . Preferred editor: just open and edit project files in Vim, as usual.
In your workflow, you can use Vim to edit the code and switch to Xcode to create the project, but Vim can also run the same build tools as Xcode, and with a little more work, you can even jump to lines with errors. Xcode relies on gdb for debugging, which can also be used with Vim through a plugin.
Of course, one can’t expect Vim to replace something like Interface Builder, but almost any other aspect of the iOS developer can be achieved with the Vim-only solution.
Or just use Vim for faster code editing and continue to use Xcode for the rest.
pb2q Jul 17 '12 at 18:24 2012-07-17 18:24
source share