Advertisement
yochju

part of .emacs

Feb 13th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 4.10 KB | None | 0 0
  1. (setq cedet-root-path (file-name-as-directory "~/.emacs.d/cedet/"))
  2.  
  3. (load-file (concat cedet-root-path "cedet-devel-load.el"))
  4. (add-to-list 'load-path (concat cedet-root-path "contrib"))
  5. (require 'cogre)
  6. (require 'cedet-contrib)
  7.  
  8. ;; ------------ select which submodes we want to activate --------------
  9. (add-to-list 'semantic-default-submodes 'global-semantic-mru-bookmark-mode)
  10. (add-to-list 'semantic-default-submodes 'global-cedet-m3-minor-mode)
  11. (add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode)
  12. (add-to-list 'semantic-default-submodes 'global-semantic-decoration-mode)
  13. (add-to-list 'semantic-default-submodes 'global-semantic-highlight-edits-mode)
  14. (add-to-list 'semantic-default-submodes 'global-semantic-highlight-func-mode)
  15. (add-to-list 'semantic-default-submodes 'global-semantic-idle-breadcrumbs-mode)
  16. (add-to-list 'semantic-default-submodes 'global-semantic-idle-local-symbol-highlight-mode)
  17. (add-to-list 'semantic-default-submodes 'global-semantic-idle-scheduler-mode)
  18. (add-to-list 'semantic-default-submodes 'global-semantic-idle-completions-mode)
  19. (add-to-list 'semantic-default-submodes 'global-semantic-idle-summary-mode)
  20. (add-to-list 'semantic-default-submodes 'global-semantic-mru-bookmark-mode)
  21. (add-to-list 'semantic-default-submodes 'global-semantic-show-parser-state-mode)
  22. (add-to-list 'semantic-default-submodes 'global-semantic-show-unmatched-syntax-mode)
  23. (add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode)
  24. (add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode)
  25.  
  26.  
  27. (semantic-load-enable-all-ectags-support)
  28. (semantic-load-enable-all-exuberent-ctags-support)
  29.  
  30. (semantic-load-enable-excessive-code-helpers) 
  31. (semantic-load-enable-semantic-debugging-helpers)
  32.  
  33. (load-file "/home/ju/.emacs.d/cedet/contrib/cedet-contrib-load.el")
  34. (global-semantic-tag-folding-mode 1) ;; tag folding
  35.  
  36. ;; --------------------------------------------------------------------------
  37. ;; Activate semantic
  38. (semantic-mode 1)
  39.  
  40. ;; load contrib library
  41. (require 'eassist)
  42.  
  43.  
  44. (defun my-c-mode-common-hook ()
  45.       (define-key c-mode-base-map (kbd "M-o") 'eassist-switch-h-cpp)
  46.       (define-key c-mode-base-map (kbd "M-m") 'eassist-list-methods))
  47.     (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
  48.  
  49. ;; customisation of modes
  50. (defun alexott/cedet-hook ()
  51.   (local-set-key [(control return)] 'semantic-ia-complete-symbol-menu)
  52.   (local-set-key "\C-c?" 'semantic-ia-complete-symbol)
  53.   ;;
  54.   (local-set-key "\C-c>" 'semantic-complete-analyze-inline)
  55.   (local-set-key "\C-c=" 'semantic-decoration-include-visit)
  56.  
  57.   (local-set-key "\C-cj" 'semantic-ia-fast-jump)
  58.   (local-set-key "\C-cq" 'semantic-ia-show-doc)
  59.   (local-set-key "\C-cs" 'semantic-ia-show-summary)
  60.   (local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle)
  61.   )
  62. (add-hook 'c-mode-common-hook 'alexott/cedet-hook)
  63. (add-hook 'lisp-mode-hook 'alexott/cedet-hook)
  64. (add-hook 'scheme-mode-hook 'alexott/cedet-hook)
  65. (add-hook 'emacs-lisp-mode-hook 'alexott/cedet-hook)
  66. (add-hook 'erlang-mode-hook 'alexott/cedet-hook)
  67.  
  68. (defun alexott/c-mode-cedet-hook ()
  69.   (local-set-key "\C-ct" 'eassist-switch-h-cpp)
  70.   (local-set-key "\C-xt" 'eassist-switch-h-cpp)
  71.   (local-set-key "\C-ce" 'eassist-list-methods)
  72.   (local-set-key "\C-c\C-r" 'semantic-symref)
  73.   )
  74. (add-hook 'c-mode-common-hook 'alexott/c-mode-cedet-hook)
  75.  
  76. (require 'semantic/ia)
  77.  
  78. (semanticdb-enable-gnu-global-databases 'c-mode t)
  79. (semanticdb-enable-gnu-global-databases 'c++-mode t)
  80.  
  81. ;; enable ctags for some languages:
  82. ;;  Unix Shell, Perl, Pascal, Tcl, Fortran, Asm
  83. (when (cedet-ectag-version-check)
  84.   (semantic-load-enable-primary-exuberent-ctags-support))
  85.  
  86. ;; SRecode
  87. (global-srecode-minor-mode 1)
  88.  
  89. ;; EDE
  90. (global-ede-mode 1)
  91. (ede-enable-generic-projects)
  92.  
  93. ;; Setup JAVA....
  94. (require 'cedet-java)
  95.  
  96. (defun my-c-mode-cedet-hook ()
  97.  (local-set-key "." 'semantic-complete-self-insert)
  98.  (local-set-key ">" 'semantic-complete-self-insert))
  99. (add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook)
  100.  
  101. (require 'semantic/bovine/gcc) ;; this is for new version
  102. (require 'semantic/sb) ;; this is for new version
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement