After using XCode for a while (couple years), I'm attempting to move to MacVim for development/code editing. Mostly, I'm doing this because I'm starting up some non-obj-c projects and I don't want to keep switching between code editors.
I've setup MacVim with a few convenient plugins:
- Janus (which is a host of plugins, I know)
- cocoa.vim
- clang_complete, which is the most important one to me, since it mimics XCode's code completion.
So far everything works fine except I can't seem to configure it to popup the completion box automatically. I have to use "tab" every time I want to view the code completion. I'd rather it open up after a certain number of characters for a word are entered, say 3 characters. I've searched around for a while (couple hours) but haven't been able to get it to work.
Any help would be appreciated. Thanks!
Here's my .vimrc file:
""
"" Janus setup
""
" Define paths
let g:janus_path = escape(fnamemodify(resolve(expand("<sfile>:p")), ":h"), ' ')
let g:janus_vim_path = escape(fnamemodify(resolve(expand("<sfile>:p" . "vim")), ":h"), ' ')
let g:janus_custom_path = expand("~/.janus")
" Source janus's core
exe 'source ' . g:janus_vim_path . '/core/before/plugin/janus.vim'
" You should note that groups will be processed by Pathogen in reverse
" order they were added.
call janus#add_group("tools")
call janus#add_group("langs")
call janus#add_group("colors")
""
"" Customisations
""
if filereadable(expand("~/.vimrc.before"))
source ~/.vimrc.before
endif
" Disable plugins prior to loading pathogen
exe 'source ' . g:janus_vim_path . '/core/plugins.vim'
""
"" Pathogen setup
""
" Load all groups, custom dir, and janus core
call janus#load_pathogen()
colorscheme Wombat256
"clang_autocomplete options
set conceallevel=2
set concealcursor=vin
let g:clang_use_library=1
let g:clang_library_path='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib'
let g:clang_complete_auto=1
let g:clang_periodic_quickfix=1
let g:clang_snippets=1
let g:clang_conceal_snippets=1
let g:clang_snippets_engine='clang_complete'
" Show clang errors in the quickfix window
"let g:clang_complete_copen = 1
set completeopt=longest,menuone,preview