Clean up
This commit is contained in:
parent
5099352078
commit
1b67819fc7
5 changed files with 52 additions and 47 deletions
|
@ -14,54 +14,55 @@
|
|||
(define-env-command! python-mode "python --version | cut -d' ' -f2")
|
||||
|
||||
;; interferes with smartparens
|
||||
(define-key python-mode-map (kbd "DEL") nil))
|
||||
(define-key python-mode-map (kbd "DEL") nil)
|
||||
|
||||
(use-package nose
|
||||
:commands nose-mode
|
||||
:preface (defvar nose-mode-map (make-sparse-keymap))
|
||||
:init
|
||||
(associate! nose-mode :pattern "/test_.+\\.py\\'")
|
||||
:config
|
||||
(bind! :map nose-mode-map
|
||||
:n ",tr" 'nosetests-again
|
||||
:n ",ta" 'nosetests-all
|
||||
:n ",ts" 'nosetests-one
|
||||
:n ",tv" 'nosetests-module
|
||||
:n ",tA" 'nosetests-pdb-all
|
||||
:n ",tO" 'nosetests-pdb-one
|
||||
:n ",tV" 'nosetests-pdb-module))
|
||||
(use-package nose
|
||||
:commands nose-mode
|
||||
:preface (defvar nose-mode-map (make-sparse-keymap))
|
||||
:init
|
||||
(associate! nose-mode :pattern "/test_.+\\.py\\'")
|
||||
:config
|
||||
(bind! :map nose-mode-map
|
||||
:n ",tr" 'nosetests-again
|
||||
:n ",ta" 'nosetests-all
|
||||
:n ",ts" 'nosetests-one
|
||||
:n ",tv" 'nosetests-module
|
||||
:n ",tA" 'nosetests-pdb-all
|
||||
:n ",tO" 'nosetests-pdb-one
|
||||
:n ",tV" 'nosetests-pdb-module))
|
||||
|
||||
(use-package anaconda-mode
|
||||
:diminish anaconda-mode
|
||||
:defines (anaconda-mode-map anaconda-nav-mode-map)
|
||||
:functions (anaconda-mode-running-p)
|
||||
:init
|
||||
(add-hook! python-mode '(anaconda-mode eldoc-mode))
|
||||
(setq anaconda-mode-installation-directory (concat narf-temp-dir "anaconda/"))
|
||||
:config
|
||||
(bind! :map anaconda-mode-map :m "gd" 'anaconda-mode-goto-definitions)
|
||||
(bind! :map anaconda-nav-mode-map :n [escape] 'anaconda-nav-quit)
|
||||
(use-package anaconda-mode
|
||||
:diminish anaconda-mode
|
||||
:defines (anaconda-mode-map anaconda-nav-mode-map)
|
||||
:functions (anaconda-mode-running-p)
|
||||
:init
|
||||
(add-hook! python-mode '(anaconda-mode eldoc-mode))
|
||||
(setq anaconda-mode-installation-directory (concat narf-temp-dir "anaconda/"))
|
||||
:config
|
||||
(bind! :map anaconda-mode-map :m "gd" 'anaconda-mode-goto-definitions)
|
||||
(bind! :map anaconda-nav-mode-map :n [escape] 'anaconda-nav-quit)
|
||||
|
||||
(advice-add 'anaconda-mode-doc-buffer :after 'narf*anaconda-mode-doc-buffer)
|
||||
(advice-add 'anaconda-mode-doc-buffer :after 'narf*anaconda-mode-doc-buffer)
|
||||
|
||||
(require 'company-anaconda)
|
||||
(define-company-backend! python-mode (anaconda))
|
||||
(after! emr
|
||||
(mapc (lambda (x)
|
||||
(let ((command-name (car x))
|
||||
(title (cadr x))
|
||||
(region-p (caddr x))
|
||||
predicate)
|
||||
(setq predicate (lambda () (and (anaconda-mode-running-p)
|
||||
(not (use-region-p))
|
||||
(not (sp-point-in-string-or-comment)))))
|
||||
(emr-declare-command (intern (format "anaconda-mode-%s" (symbol-name command-name)))
|
||||
:title title :modes 'python-mode :predicate predicate)))
|
||||
'((show-doc "view documentation" t)
|
||||
(find-assignments "find assignments" t)
|
||||
(find-definitions "find definitions" t)
|
||||
(find-file "find assignments" t)
|
||||
(find-references "show usages" nil)))))
|
||||
(after! company
|
||||
(require 'company-anaconda)
|
||||
(define-company-backend! python-mode (anaconda)))
|
||||
(after! emr
|
||||
(mapc (lambda (x)
|
||||
(let ((command-name (car x))
|
||||
(title (cadr x))
|
||||
(region-p (caddr x))
|
||||
predicate)
|
||||
(setq predicate (lambda () (and (anaconda-mode-running-p)
|
||||
(not (use-region-p))
|
||||
(not (sp-point-in-string-or-comment)))))
|
||||
(emr-declare-command (intern (format "anaconda-mode-%s" (symbol-name command-name)))
|
||||
:title title :modes 'python-mode :predicate predicate)))
|
||||
'((show-doc "view documentation" t)
|
||||
(find-assignments "find assignments" t)
|
||||
(find-definitions "find definitions" t)
|
||||
(find-file "find assignments" t)
|
||||
(find-references "show usages" nil))))))
|
||||
|
||||
(provide 'module-python)
|
||||
;;; module-python.el ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue