xavierd / clang_complete

Vim plugin that use clang for completing C/C++ code.
http://www.vim.org/scripts/script.php?script_id=3302
1.95k stars 308 forks source link

Vim opens and freezes to a blank screen when using a file of *.c or *.cpp #585

Open bhache opened 3 years ago

bhache commented 3 years ago

I am having trouble using clang_complete with MacOS Big Sur. I installed the plugin using vim pack. :version output

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jun 17 2021 18:50:51)                                                                                       
macOS version
Included patches: 1-2029
Compiled by root@apple.com
Normal version without GUI.  Features included (+) or not (-):
+acl               +cmdline_hist      +ex_extra          +jumplist          -mouse_dec         -perl              -sound             +textprop          +writebackup
-arabic            +cmdline_info      +extra_search      -keymap            -mouse_gpm         +persistent_undo   +spell             +timers            -X11
+autocmd           +comments          -farsi             +lambda            -mouse_jsbterm     +popupwin          +startuptime       +title             -xfontset
+autochdir         -conceal           +file_in_path      -langmap           -mouse_netterm     +postscript        +statusline        -toolbar           -xim
-autoservername    +cryptv            +find_in_path      +libcall           +mouse_sgr         +printer           -sun_workshop      +user_commands     -xpm
-balloon_eval      +cscope            +float             +linebreak         -mouse_sysmouse    -profile           +syntax            -vartabs           -xsmp
-balloon_eval_term +cursorbind        +folding           +lispindent        -mouse_urxvt       +python/dyn        +tag_binary        +vertsplit         -xterm_clipboard
-browse            +cursorshape       -footer            +listcmds          +mouse_xterm       -python3           -tag_old_static    +virtualedit       -xterm_save
+builtin_terms     +dialog_con        +fork()            +localmap          +multi_byte        +quickfix          -tag_any_white     +visual
+byte_offset       +diff              -gettext           -lua               +multi_lang        +reltime           -tcl               +visualextra
+channel           +digraphs          -hangul_input      +menu              -mzscheme          -rightleft         -termguicolors     +viminfo
+cindent           -dnd               +iconv             +mksession         +netbeans_intg     +ruby/dyn          +terminal          +vreplace
-clientserver      -ebcdic            +insert_expand     +modify_fname      +num64             +scrollbind        +terminfo          +wildignore
+clipboard         -emacs_tags        -ipv6              +mouse             +packages          +signs             +termresponse      +wildmenu
+cmdline_compl     +eval              +job               -mouseshape        +path_extra        +smartindent       +textobjects       +windows
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L/usr/local/lib -o vim        -lm -lncurses  -liconv -framework Cocoa

I added the following lines to ~/.vim/vimrc

set omnifunc=ClangComplete                                                      
set completefunc=ClangComplete                                                  
let g:clang_snippets = 1                                                        
let g:clang_snippets_engine = 'clang_complete'                                  
let g:clang_library_path='/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/lib' 

I am not sure what else I could do. Please let me know.