diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..0dcaeff5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +ac-comphist.dat +auto-save-list diff --git a/.gitmodules b/.gitmodules index e7c7302b..a10d7382 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,9 @@ [submodule "lisp/yasnippet"] path = lisp/yasnippet url = git@github.com:capitaomorte/yasnippet.git +[submodule "emacs-for-python"] + path = emacs-for-python + url = git@github.com:gabrielelanaro/emacs-for-python.git +[submodule "lisp/rainbow-delimiters"] + path = lisp/rainbow-delimiters + url = git@github.com:jlr/rainbow-delimiters.git diff --git a/emacs-for-python b/emacs-for-python new file mode 160000 index 00000000..67bffc20 --- /dev/null +++ b/emacs-for-python @@ -0,0 +1 @@ +Subproject commit 67bffc200b4d183bd1882a42cdeb95e7e73af3f1 diff --git a/init.el b/init.el index 13befdb2..aabe5a76 100644 --- a/init.el +++ b/init.el @@ -1,10 +1,10 @@ -;; ----------------------------------------------------------------------------- +;; ============================================================================= ;; Ivan Malison ;; ___ _ __ ___ __ _ ___ ___ ;; / _ \ '_ ` _ \ / _` |/ __/ __| ;; | __/ | | | | | (_| | (__\__ \ ;; (_)___|_| |_| |_|\__,_|\___|___/ -;; ----------------------------------------------------------------------------- +;; ============================================================================= (setq user-full-name "Ivan Malison") (setq user-mail-address "") @@ -15,7 +15,9 @@ (let ((default-directory "~/.emacs.d/lisp/")) (normal-top-level-add-subdirs-to-load-path)) -(setq load-path (cons "~/.emacs.d/elpa" load-path)) +(add-to-list 'load-path "~/.emacs.d/elpa") +(add-to-list 'load-path "~/.emacs.d/lisp/multi-line-it") + ;; ============================================================================= ;; General Emacs Options @@ -31,20 +33,42 @@ (ido-mode t) (setq ido-enable-flex-matching t) -;; Unique buffer names dependent on file name +;; Give duplicate open buffers better titles. (require 'uniquify) (setq uniquify-buffer-name-style 'forward) (add-hook 'python-mode-hook (lambda () (setq show-trailing-whitespace t))) (setq visible-bell t) -;; Multi-lining for python. -(require 'multi-line-it) - ;; Display line and column numbers in mode line. (line-number-mode t) (column-number-mode t) +;; Don't disable downcase and upcase region. +(put 'upcase-region 'disabled nil) +(put 'downcase-region 'disabled nil) + +;; Change the behavior of M- so that it stops on underscores. +(defun change-major-mode-hook () (modify-syntax-entry ?_ "_")) +(setq c-subword-mode t) + +;; ============================================================================= +;; Python +;; ============================================================================= + +;; Emacs for python. +(load-file "~/.emacs.d/emacs-for-python/epy-init.el") + +;; Multi-lining for python. +(require 'multi-line-it) + +;; Set tabs to be four spaces wide in python mode. +(add-hook 'python-mode-hook + (lambda () + (setq indent-tabs-mode t) + (setq tab-width 4) + (setq python-indent 4))))))))) + ;; ============================================================================= ;; Custom Key Bindings ;; ============================================================================= @@ -64,6 +88,7 @@ (global-set-key "\C-x\C-r" (lambda () (interactive) (revert-buffer t t))) (global-set-key "\C-x\C-i" 'increase-left-margin) (global-set-key "\C-x\C-d" 'decrease-left-margin) +(global-set-key "\C-c\C-c" 'comment-region) ;; ============================================================================= ;; ELPA @@ -100,43 +125,6 @@ (add-hook 'python-mode-hook (lambda () (unless (eq buffer-file-name nil) (flymake-mode 1)))) - (require 'yasnippet) (require 'whitespace) - - - - - - - - -;; pymacs -(require 'pymacs) -(autoload 'pymacs-apply "pymacs") -(autoload 'pymacs-call "pymacs") -(autoload 'pymacs-eval "pymacs" nil t) -(autoload 'pymacs-exec "pymacs" nil t) -(autoload 'pymacs-load "pymacs" nil t) - -(pymacs-load "ropemacs" "rope-") -(whitespace-mode t) - - - -; tab display width of 4 columns by default -; (throw everything at the wall, and eventually something will stick...) -(setq-default tab-width 4) ; Normal emacs tab-width -; (setq-default c-basic-offset 2) ; python-mode.el setting -(setq-default py-indent-offset 4) ; Use Tabs, not spaces -(setq-default py-indent-offset 4) ; emacs-for-python setting -(setq-default py-smart-indentation nil) ; Don't try to guess tab width - - - -(setq c-subword-mode t) -(put 'upcase-region 'disabled nil) -(defun change-major-mode-hook () (modify-syntax-entry ?_ "_")) - -(put 'downcase-region 'disabled nil) - +(require 'rainbow-delimiters) diff --git a/lisp/init_elpa.el b/lisp/init_elpa.el new file mode 100644 index 00000000..0f9d824e --- /dev/null +++ b/lisp/init_elpa.el @@ -0,0 +1,72 @@ +;; ------------------------------------------------------------------------- +;; File: init-elpa.el - initialize the Emacs Lisp Package Archive (ELPA) +;; see http://tromey.com/elpa/ +;; Install a base set of packages automatically. +;; +;; Copyright (c) 2010 Sebastien Varrette +;; http://varrette.gforge.uni.lu +;; +;; _ _ _ _ _ +;; (_)_ __ (_) |_ ___| |_ __ __ _ ___| | +;; | | '_ \| | __|____ / _ \ | '_ \ / _` | / _ \ | +;; | | | | | | ||_____| __/ | |_) | (_| | _ | __/ | +;; |_|_| |_|_|\__| \___|_| .__/ \__,_| (_) \___|_| +;; |_| +;; +;; More information about Emacs Lisp: +;; http://www.emacswiki.org/emacs/EmacsLisp +;; ------------------------------------------------------------------------- +;; This file is NOT part of GNU Emacs. +;; +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . +;; ------------------------------------------------------------------------- +;; Directly Inspired by Emacs Starter Kit +;; see http://github.com/technomancy/emacs-starter-kit/blob/master/ + + +;; Adapt to suit you needs +(defvar starter-kit-packages (list 'magit 'mo-git-blame 'python-mode) + "Libraries that should be installed by default.") + + + +(defun starter-kit-elpa-install () + "Install all starter-kit packages that aren't installed." + (interactive) + (dolist (package starter-kit-packages) + (unless (or (member package package-activated-list) + (functionp package)) + (message "Installing %s" (symbol-name package)) + (package-install package)))) + +(defun esk-online? () + (if (and (functionp 'network-interface-list) + (network-interface-list)) + (some (lambda (iface) (unless (equal "lo" (car iface)) + (member 'up (first (last (network-interface-info + (car iface))))))) + (network-interface-list)) + t)) + +;; On your first run, this should pull in all the base packages. +(when (esk-online?) + (unless package-archive-contents (package-refresh-contents)) + (starter-kit-elpa-install)) + +;; Workaround for an ELPA bug that people are reporting but I've been +;; unable to reproduce: +(autoload 'paredit-mode "paredit") + + +(provide 'init-elpa) diff --git a/lisp/multi-line-it b/lisp/multi-line-it deleted file mode 160000 index da2e474e..00000000 --- a/lisp/multi-line-it +++ /dev/null @@ -1 +0,0 @@ -Subproject commit da2e474ec816c0f22037becc355d339899ddc1dd diff --git a/lisp/multi-line-it.el b/lisp/multi-line-it.el deleted file mode 160000 index da2e474e..00000000 --- a/lisp/multi-line-it.el +++ /dev/null @@ -1 +0,0 @@ -Subproject commit da2e474ec816c0f22037becc355d339899ddc1dd diff --git a/lisp/rainbow-delimiters b/lisp/rainbow-delimiters new file mode 160000 index 00000000..d38744e9 --- /dev/null +++ b/lisp/rainbow-delimiters @@ -0,0 +1 @@ +Subproject commit d38744e9453cbe33ae2d28d76fa847d0611eb4c6