2012-12-18 05:48:12 +00:00
|
|
|
(require 'cl)
|
|
|
|
|
2012-12-19 20:18:17 +00:00
|
|
|
;; Locations ===================================================================
|
2012-12-18 05:48:12 +00:00
|
|
|
(defvar user-home-directory
|
|
|
|
(expand-file-name (concat user-emacs-directory "../"))
|
|
|
|
"The user's home directory.")
|
|
|
|
|
2012-12-19 20:18:17 +00:00
|
|
|
(defvar user-custom-modes-dir
|
|
|
|
(expand-file-name (concat user-emacs-directory "custom-modes/"))
|
|
|
|
"The directory containing the user's custom modes.")
|
|
|
|
|
2012-12-18 05:48:12 +00:00
|
|
|
(add-to-list 'load-path user-emacs-directory)
|
|
|
|
|
2012-12-19 20:18:17 +00:00
|
|
|
;; Global config ===============================================================
|
|
|
|
;; font size
|
2012-12-18 22:24:55 +00:00
|
|
|
(set-face-attribute 'default nil :height 110)
|
2012-12-19 20:18:17 +00:00
|
|
|
;; number colon mode
|
2012-12-18 05:48:12 +00:00
|
|
|
(global-linum-mode t)
|
2012-12-19 20:18:17 +00:00
|
|
|
;; full screen
|
2012-12-18 22:24:55 +00:00
|
|
|
(tool-bar-mode -1)
|
|
|
|
(menu-bar-mode -1)
|
|
|
|
(scroll-bar-mode -1)
|
|
|
|
(fringe-mode 0)
|
2012-12-19 20:18:17 +00:00
|
|
|
;; no blink
|
|
|
|
(blink-cursor-mode (- (*) (*) (*)))
|
|
|
|
;; save session
|
|
|
|
(desktop-save-mode 1)
|
|
|
|
;; tool tips in echo area
|
2012-12-18 22:24:55 +00:00
|
|
|
(tooltip-mode -1)
|
|
|
|
(setq tooltip-use-echo-area t)
|
2012-12-18 05:48:12 +00:00
|
|
|
;; whitespace-mode
|
2012-12-19 20:18:17 +00:00
|
|
|
(setq-default show-trailing-whitespace nil)
|
2012-12-18 05:48:12 +00:00
|
|
|
;; Inhibit startup message
|
2012-12-18 22:24:55 +00:00
|
|
|
(setq inhibit-startup-message t
|
|
|
|
inhibit-startup-echo-area-message t)
|
|
|
|
(setq initial-scratch-message "")
|
2012-12-18 05:48:12 +00:00
|
|
|
;; Do not make backup files
|
|
|
|
(setq make-backup-files nil)
|
|
|
|
;; When emacs asks for "yes" or "no", let "y" or "n" sufficide
|
|
|
|
(fset 'yes-or-no-p 'y-or-n-p)
|
|
|
|
;; Show column number in mode line
|
|
|
|
(setq column-number-mode t)
|
|
|
|
;; When point is on paranthesis, highlight the matching one
|
|
|
|
(show-paren-mode t)
|
|
|
|
;; auto-save
|
|
|
|
(add-hook 'before-save-hook (lambda () (delete-trailing-whitespace)))
|
2012-12-18 22:24:55 +00:00
|
|
|
(setq redisplay-dont-pause t)
|
2012-12-19 20:18:17 +00:00
|
|
|
;; use only spaces and no tabs
|
|
|
|
(setq-default indent-tabs-mode nil)
|
|
|
|
(setq default-tab-width 4)
|
|
|
|
;; move focus to newly split window
|
|
|
|
(defadvice split-window (after move-point-to-new-window activate)
|
|
|
|
"Moves the point to the newly created window after splitting."
|
|
|
|
(other-window 1))
|
2012-12-18 05:48:12 +00:00
|
|
|
|
2012-12-19 20:18:17 +00:00
|
|
|
;; Config files ================================================================
|
2012-12-18 05:48:12 +00:00
|
|
|
(progn
|
|
|
|
(setq user-emacs-config-dir (concat user-emacs-directory "config/"))
|
|
|
|
(when (file-exists-p user-emacs-config-dir)
|
|
|
|
(dolist (l (directory-files user-emacs-config-dir nil "^[^#].*el$"))
|
|
|
|
(load (concat user-emacs-config-dir l)))))
|
|
|
|
|
2012-12-19 20:18:17 +00:00
|
|
|
(require 'my-funcs)
|
2012-12-18 05:48:12 +00:00
|
|
|
(require 'my-packages)
|
|
|
|
(require 'my-keybindings)
|
2012-12-19 22:56:10 +00:00
|
|
|
(require 'my-keybindings-work)
|
2012-12-19 20:18:17 +00:00
|
|
|
|
|
|
|
;; Python ======================================================================
|
|
|
|
;; clone git repository https://github.com/gabrielelanaro/emacs-for-python
|
|
|
|
;; =============================================================================
|
|
|
|
(setq ropemacs-global-prefix "C-x /") ;; avoid conflict with p4 global prefix
|
|
|
|
(load-file (concat user-emacs-directory "emacs-for-python/epy-init.el"))
|
2012-12-19 22:46:19 +00:00
|
|
|
(require 'epy-setup)
|
|
|
|
(require 'epy-python)
|
|
|
|
(require 'epy-completion)
|
|
|
|
(require 'epy-editing)
|
|
|
|
(require 'epy-bindings)
|
|
|
|
(require 'epy-nose)
|
2012-12-19 20:18:17 +00:00
|
|
|
(epy-setup-checker "pyflakes %f")
|
|
|
|
(epy-setup-ipython)
|
|
|
|
;; line hightlighting
|
|
|
|
(global-hl-line-mode t)
|
2012-12-19 22:46:19 +00:00
|
|
|
(set-face-background 'hl-line "#073642")
|
2012-12-19 20:18:17 +00:00
|
|
|
;; identation highlighting
|
|
|
|
;; (require 'highlight-indentation)
|
|
|
|
;; (add-hook 'python-mode-hook 'highlight-indentation)
|
2012-12-19 22:46:19 +00:00
|
|
|
;; disable auto-pairing
|
|
|
|
;;(setq skeleton-pair nil)
|
|
|
|
(add-hook 'python-mode-hook (lambda ()
|
|
|
|
(local-set-key "\C-c\C-c" 'syl-python-compile)))
|
2012-12-19 20:18:17 +00:00
|
|
|
|
|
|
|
;; Custom modes ================================================================
|
|
|
|
(load-file (concat user-custom-modes-dir "heartbeat-cursor.el"))
|