(ido-mode 1) (global-font-lock-mode 1) ;;; We define modes for c++, python, and java (defun robocup-c++-mode () "NBites C++ Style." (interactive) (c++-mode) (c-set-style "namespace-style") (setq tab-width 4) (setq c-basic-offset 4) (setq-default show-trailing-whitespace t) (which-func-mode 1) (setq indent-tabs-mode nil) ) (defun robocup-python-mode () (interactive) (python-mode) (setq tab-width 4) (setq c-basic-offset 4) (setq-default show-trailing-whitespace t) (which-func-mode 1) (setq indent-tabs-mode nil) ) (setq indent-tabs-mode nil) ;;; We set the robocup modes as default for the appropraite files ;;; ;;; To make this apply only in robocup directories add a path to the settings ;;; i.e. ("~/src/robocup/.*\\.cpp$" . robocup-c++-mode) (setq auto-mode-alist (append '(("\\.cpp$" . robocup-c++-mode) ("\\.cc$" . robocup-c++-mode) ("\\.hpp$" . robocup-c++-mode) ("\\.h$" . robocup-c++-mode) ("\\.py$" . robocup-python-mode) ("\\.java$" . robocup-java-mode) ) auto-mode-alist)) (show-paren-mode 1) ;; Highlight lines over 80 characters (add-hook 'c-mode-common-hook (lambda () (font-lock-add-keywords nil '(("^[^\n]\\{80\\}\\(.*\\)$" 1 font-lock-warning-face t))))) (c-add-style "namespace-style" '("BSD" (c-offsets-alist . ((innamespace . 0)) )))