XcodeLearning notesVimEditor assistanceXcodeIs the content to be introduced in this article,VimIs a popular editor, andXcodeAnother nice feature is that when you click a file name in the file panelXcodeAnd provides Optional options for you to specify the name of the editor called when double-clicking the file name. Next we will introduce a usageVimEditor assistanceXcode.
GoXcodeFunction settings, find "File Types", go to file-> text-> sourcecode, bring up the pop-up menu, select "External Editor", and select MacVim. You can also directly use Vim in CLI to open related source files, but there is a small problem, that is, in the Cocoa environment, the source code file is. unfortunately, the Matlab code file ends with m. m. Therefore, make the following adjustments in the vimrc file:
- let filetype_m=’objc’
Using Vim to edit Xcode files is another inconvenient place. During compilation and debugging, you need to switch the window back to Xcode to do these tasks. The solution is to add the following content to 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 :XcodeClean
- ” Command-Return Starts the program in the debugger
- :noremap :XcodeDebug
In this way, two Shortcut Keys + make can meet basic requirements.
The last problem is that Vim does not have the built-in Objective-C syntax to highlight theme, and the default completion is not very useful. Cocoa. vim came into being. With this feature, you have features such as Objective-C highlighting, code completion, and document query. For specific functions and usage, go to the plug-in homepage for reference.
Summary:XcodeLearning notesVimEditor assistanceXcodeI hope this article will help you! For more information, see edit recommendations.