Final update

This commit is contained in:
Henrik Lissner 2015-06-04 18:23:21 -04:00
parent d1aaf44255
commit c49a53f9d3
74 changed files with 4405 additions and 2866 deletions

View file

@ -1,30 +1,25 @@
(use-package python
:mode ("\\.py\\'" . python-mode)
:interpreter ("python" . python-mode)
:mode ("\\.py\\'" . python-mode)
:interpreter ("python" . python-mode)
:commands (python-mode)
:init
(progn
(add-hook 'python-mode-hook 'enable-tab-width-4)
(add-hook 'python-mode-hook 'emr-initialize))
(add-to-hook 'python-mode-hook '(narf|enable-tab-width-4 emr-initialize))
:config
(progn
(setq-default python-indent-offset 4)
(setq python-environment-directory my-tmp-dir)
(setq python-environment-directory TMP-DIR)
(setq python-shell-interpreter "ipython")
;; interferes with smartparens
(define-key python-mode-map (kbd "DEL") nil)
(use-package anaconda-mode
:init
(progn
(add-hook 'python-mode-hook 'anaconda-mode)
(add-hook 'python-mode-hook 'eldoc-mode)
;; (add-hook! 'anaconda-mode-hook
;; (process-buffer (python-shell-get-or-create-process python-shell-interpreter t nil)))
)
:defines (anaconda-mode-map anaconda-nav-mode-map)
:functions (anaconda-mode-running-p)
:init (add-to-hook 'python-mode-hook '(anaconda-mode eldoc-mode))
:config
(progn
(bind 'motion anaconda-mode-map "gd" 'anaconda-mode-goto-definitions)
(bind 'normal anaconda-nav-mode-map [escape] 'anaconda-nav-quit)
(bind :motion :map anaconda-mode-map "gd" 'anaconda-mode-goto-definitions)
(bind :normal :map anaconda-nav-mode-map [escape] 'anaconda-nav-quit)
;; Delete the window on escape or C-g
(defadvice anaconda-mode-doc-buffer (after anaconda-doc-buffer-escape-to-close activate)
@ -62,24 +57,23 @@
(after "company"
(use-package company-anaconda
:config (company--backend-on 'python-mode-hook 'company-anaconda)))))
:config
(narf/add-company-backend python-mode (company-anaconda))))))
(use-package nose
:commands nose-mode
:init
(progn
;; Reset nose keymap, we'll set new ones in my-keymaps.el
(defvar nose-mode-map (make-sparse-keymap))
(associate-minor-mode "/test_.+\\.py\\'" 'nose-mode))
:preface (defvar nose-mode-map (make-sparse-keymap))
:init (associate-minor-mode "/test_.+\\.py\\'" 'nose-mode)
:config
(bind 'normal nose-mode-map
",tr" 'nosetests-again
",ta" 'nosetests-all
",ts" 'nosetests-one
",tv" 'nosetests-module
",tA" 'nosetests-pdb-all
",tO" 'nosetests-pdb-one
",tV" 'nosetests-pdb-module))))
(bind normal :map nose-mode-map
:prefix leader
"tr" 'nosetests-again
"ta" 'nosetests-all
"ts" 'nosetests-one
"tv" 'nosetests-module
"tA" 'nosetests-pdb-all
"tO" 'nosetests-pdb-one
"tV" 'nosetests-pdb-module))))
(provide 'init-python)