2011年7月23日 星期六

How do iOS programmers develop applications using Vim?

原文出處:http://www.quora.com/Vim/How-do-iOS-programmers-develop-applications-using-Vim


  
How:
  1. Install macvim,
  2. Install cocoa.vim and snipMate.vim plugins by Michael Sanders.
  3. You'll still need to use xCode for a lot of things (find definition, , use Cmd-0 to toggle back to the xCode environment.
  4. get an app for dividing your screen quickly, i use left 2/3 for xcode and right 2/3 for macvim, with a 1/3 overlap in the middle on my laptop, otherwise 1/2 and 1/2 when plugged into a monitor.
  5. use : Ctl-x Ctl-o to for auto completion options
  6. if you get no match on your autoComplete on a method call using bracket syntax then try dot syntax for the correct auto complete
  7. Cmd-0 to toggle to xCode, Cmd-Shft-R to open console and Cmd-B to build to quickly do a build and see debug output
  8. Need to look up something quickly? Cmd-0 to toggle to Xcode, Cmd-Alt-Shft-? to open up xcode documentation window
  9. C-p to show local completion options (matches within currently open buffers)
  10. set macvim to open files in a new tab in same window
  11. set folding, nocompat, incsearch, virtualedit and other options in .vimrc according to your preference.
Advantages to using Vim:
  1. if you are a fast touch typist, a modal editor like vi allows you to work without even thinking about your input method. your fingers are never required to leave the home keys
  2. extensive regular expression support and search and replace support
  3. multiple recordable macros to expedite tasks
  4. many clipboard buffers to which you can copy or append into
  5. highly configurable folding mechanism
  6. cocoa.vim by Michael Sanders provides good text highlighting and workable code completion
  7. python script compatibility allows you to program template files in python or repetitive actions
  8. easy cvs/svn/git/hg integration via vscommand.vim
  9. simple and managable split screening
  10. fast switches between header/interface files
  11. fast toggle between macvim and xcode for build/run or documentation lookups
  12. and a lot more once you customize your vim to your own preferences.

Disadvantages to Vim:
  1. you must be a touch typist to gain a serious advantage, if you can't type like the wind you gain little.
  2. you must toggle back to xcode to leverage the very useful 'Find definition' and 'Find in documentation' options.
  3. its easier to build and run from xcode due to provisioning setup
  4. you need both xcode and vim, its very difficult if not impossible to use JUST vim

0 意見: