diff --git a/.emacs.d/init.el b/.emacs.d/init.el index fc9e170..b111fae 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -115,15 +115,24 @@ (use-package semantic :defer :init - (add-hook 'c-mode-hook (lambda () - (semantic-mode 1))) + (add-hook 'c-mode-hook 'semantic-mode) :config - (global-semantic-decoration-mode 1) - (global-semantic-highlight-func-mode 1) - (global-semantic-show-unmatched-syntax-mode 1) - (global-semantic-idle-summary-mode 1) - (global-semantic-stickyfunc-mode 1) - (setq semantic-idle-scheduler-idle-time 0.1)) + (setq semantic-default-submodes '(global-semantic-idle-scheduler-mode + global-semanticdb-minor-mode + global-semantic-decoration-mode + global-semantic-highlight-func-mode + global-semantic-show-unmatched-syntax-mode + global-semantic-idle-summary-mode + global-semantic-stickyfunc-mode + global-semantic-idle-local-symbol-highlight-mode) + semantic-idle-scheduler-idle-time 0.2) + + ; inhibit semantic outside of specific modes + (add-to-list 'semantic-inhibit-functions + #'(lambda () (not (member major-mode '(cc-mode java-mode))))) + + (eval-after-load "cc-mode" + '(define-key c-mode-map (kbd "M-.") 'semantic-ia-fast-jump))) (use-package term :config