I am using Emacs24, and my auto-complete plugin was working when I opened my .emacs
file. However, it doesn't work when I open some file like :
whatever.c
To add to this, the auto-complete-c-headers do not work. I believe that auto-complete doesn't work on c/c++ mode.
Here is my .emacs
file:
(add-to-list 'load-path "~/.emacs.d/elpa/neotree")
(require 'neotree)
(global-set-key [f8] 'neotree-toggle)
(defun my:ac-c-header-init()
(require 'auto-complete-c-headers)
(add-to-list 'ac-sources 'ac-source-c-header))
(add-hook 'c++-mode-hook 'my:a-c-header-init)
(add-hook 'c-mode-hook 'my:ac-c-header-init)
(require 'cc-mode)
(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))
(setq-default c-basic-offset 2 c-default-style "linux")
(setq-default tab-width 2 indent-tabs-mode t)
(define-key c-mode-base-map (kbd "RET") 'newline-and-indent)
(add-to-list 'load-path
"~/.emacs.d/plugins/yasnippet")
(require 'yasnippet)
(yas-global-mode 1)
(add-to-list 'load-path "~/.emacs.d/elpa")
(require 'linum)
(global-linum-mode 1)
(add-to-list 'load-path "~/.emacs.d/elpa/auto-complete-1.3.1")
(require 'auto-complete)
(require 'auto-complete-config)
(define-globalized-minor-mode real-global-auto-complete-mode
auto-complete-mode (lambda ()
(if (not (minibufferp (current-buffer)))
(auto-complete-mode 1))
))
(real-global-auto-complete-mode t)
(ac-config-default)
(ac-set-trigger-key "TAB")
(ac-set-trigger-key "<tab>")