Guest User

Untitled

a guest
Jan 21st, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. (require 'auto-complete)
  2. (require 'auto-complete-config)
  3. (ac-config-default)
  4.  
  5. ;; Function which initializes auto-complete-c-headers and gets called for
  6. ;; c/c++ hooks
  7. (defun my:ac-c-header-init ()
  8. (add-to-list 'ac-sources 'ac-source-c-headers)
  9.  
  10. ;; List of directories where c/c++ headers are located. This list
  11. ;; may change from machine to machine. Type the following command
  12. ;; in a terminal to see your list:
  13. ;;
  14. ;; >> gcc -xc++ -E -v -
  15. ;;
  16. ;; and add whatever paths come after '#include <...> search starts here:'.
  17. ;;
  18. (setq achead:include-directories
  19. (append '("/usr/include/c++/5"
  20. "/usr/include/x86_64-linux-gnu/c++/5"
  21. "/usr/include/c++/5/backward"
  22. "/usr/lib/gcc/x86_64-linux-gnu/5/include"
  23. "/usr/local/include"
  24. "/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed"
  25. "/usr/include/x86_64-linux-gnu")
  26. achead:include-directories)))
  27.  
  28. ;; Call this function from c/c++ hooks
  29. (add-hook 'c++-mode-hook 'my:ac-c-header-init)
  30. (add-hook 'c-mode-hook 'my:ac-c-header-init)
Add Comment
Please, Sign In to add comment