use python environment setup from github user gabrielelanaro

This commit is contained in:
sbenner 2012-12-19 15:18:17 -05:00
parent 6b8759a737
commit 50040fc42f
12 changed files with 55 additions and 30 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
auto-save-list/
config/
elpa/
emacs-for-python/
ac-comphist.dat

57
init.el
View File

@ -1,5 +1,6 @@
(require 'cl)
;; Locations ===================================================================
(defvar user-home-directory
(expand-file-name (concat user-emacs-directory "../"))
"The user's home directory.")
@ -8,34 +9,39 @@
(expand-file-name (concat user-home-directory "Projects/"))
"The directory containing the user's checked out source code.")
(defvar user-custom-modes-dir
(expand-file-name (concat user-emacs-directory "custom-modes/"))
"The directory containing the user's custom modes.")
(defvar user-dropbox-directory
(expand-file-name (concat user-home-directory "Dropbox/"))
"The user's Dropbox root directory.")
(add-to-list 'load-path user-emacs-directory)
(require 'my-funcs)
;;font size
;; Global config ===============================================================
;; font size
(set-face-attribute 'default nil :height 110)
;;number colon mode
;; number colon mode
(global-linum-mode t)
;;no tool bar
;; full screen
(tool-bar-mode -1)
(menu-bar-mode -1)
(scroll-bar-mode -1)
(fringe-mode 0)
;;tool tips in echo area
;; no blink
(blink-cursor-mode (- (*) (*) (*)))
;; save session
(desktop-save-mode 1)
;; tool tips in echo area
(tooltip-mode -1)
(setq tooltip-use-echo-area t)
;; whitespace-mode
(setq-default show-trailing-whitespace t)
(setq-default show-trailing-whitespace nil)
;; Inhibit startup message
(setq inhibit-startup-message t
inhibit-startup-echo-area-message t)
(setq initial-scratch-message "")
;; Cursor, please do not blink
(blink-cursor-mode nil)
;; Do not make backup files
(setq make-backup-files nil)
;; When emacs asks for "yes" or "no", let "y" or "n" sufficide
@ -47,13 +53,44 @@
;; auto-save
(add-hook 'before-save-hook (lambda () (delete-trailing-whitespace)))
(setq redisplay-dont-pause t)
;; 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))
;; Config files
;; Config files ================================================================
(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)))))
(require 'my-funcs)
(require 'my-packages)
(require 'my-keybindings)
;; 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"))
(require 'epy-setup) ;; It will setup other loads, it is required!
(require 'epy-python) ;; If you want the python facilities [optional]
(require 'epy-completion) ;; If you want the autocompletion settings [optional]
(require 'epy-editing) ;; For configurations related to editing [optional]
(require 'epy-bindings) ;; For my suggested keybindings [optional]
(require 'epy-nose) ;; For nose integration
(epy-setup-checker "pyflakes %f")
(epy-setup-ipython)
;; line hightlighting
(global-hl-line-mode t)
(set-face-background 'hl-line "black")
;; identation highlighting
;; (require 'highlight-indentation)
;; (add-hook 'python-mode-hook 'highlight-indentation)
;; Custom modes ================================================================
(load-file (concat user-custom-modes-dir "heartbeat-cursor.el"))

View File

@ -1,4 +0,0 @@
(require 'anything) (require 'anything-ipython)
(when (require 'anything-show-completion nil t)
(use-anything-show-completion 'anything-ipython-complete
'(length initial-pattern)))

View File

@ -2,7 +2,7 @@
(setq evil-want-C-u-scroll t)
(setq evil-emacs-state-cursor '("red" box))
(setq evil-normal-state-cursor '("red" box))
(setq evil-normal-state-cursor '("orange" box))
(setq evil-visual-state-cursor '("green" box))
(setq evil-insert-state-cursor '("green" bar))
(setq evil-motion-state-cursor '("gray" box))
@ -15,3 +15,5 @@
(setq key-chord-two-keys-delay 0.2)
(key-chord-define evil-insert-state-map "jk" 'evil-normal-state)
(key-chord-mode 1)
;;Compatibility with ace jump mode
(define-key evil-normal-state-map (kbd "SPC") 'ace-jump-mode)

View File

@ -1,2 +0,0 @@
(require 'flymake-python-pyflakes)
(add-hook 'python-mode-hook 'flymake-python-pyflakes-load)

View File

@ -1 +0,0 @@
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))

View File

@ -1,2 +0,0 @@
(require 'sr-speedbar)
(global-set-key (kbd "s-s") 'sr-speedbar-toggle)

View File

@ -8,25 +8,18 @@
(package-initialize)
(defvar z:my-packages
'(
anything
anything-ipython
anything-show-completion
ace-jump-mode
auto-complete
autopair
eproject
erlang
evil
fill-column-indicator
flymake
flymake-python-pyflakes
ipython
key-chord
p4
powerline
python-mode
python-pep8
python-pylint
rainbow-delimiters
solarized-theme
sr-speedbar
surround
))