forked from colonelpanic/dotfiles
Fix virtualenv jedi.
This commit is contained in:
parent
4a7bac7e0e
commit
7be8a99428
34
init.el
34
init.el
@ -79,6 +79,7 @@ Return a list of installed packages or nil for every package not installed."
|
||||
|
||||
(put 'set-goal-column 'disabled nil)
|
||||
(auto-fill-mode -1)
|
||||
(setq indent-tabs-mode nil)
|
||||
|
||||
;; No hsplits. EVER.
|
||||
(defun split-horizontally-for-temp-buffers () (split-window-horizontally))
|
||||
@ -236,16 +237,8 @@ Return a list of installed packages or nil for every package not installed."
|
||||
;; Python
|
||||
;; =============================================================================
|
||||
|
||||
(use-package python
|
||||
:commands python-mode
|
||||
:mode ("\\.py\\'" . python-mode)
|
||||
:config
|
||||
(progn
|
||||
;; macros
|
||||
(fset 'ipdb "import ipdb; ipdb.set_trace()")
|
||||
(fset 'main "if __name__ == '__main__':")
|
||||
(fset 'sphinx-class ":class:`~")
|
||||
(defvar use-python-tabs nil)
|
||||
|
||||
(defun python-tabs () (setq tab-width 4
|
||||
indent-tabs-mode t
|
||||
python-indent-offset 4))
|
||||
@ -259,9 +252,8 @@ Return a list of installed packages or nil for every package not installed."
|
||||
(apply #'append (mapcar (lambda (env) `("-v" ,env)) virtual-envs)))
|
||||
|
||||
(defun get-virtual-envs ()
|
||||
(interactive)
|
||||
(condition-case ex
|
||||
(let (project-root (projectile-project-root))
|
||||
(let ((project-root (projectile-project-root)))
|
||||
(cl-remove-if-not 'file-exists-p
|
||||
(mapcar (lambda (env-suffix)
|
||||
(concat project-root env-suffix))
|
||||
@ -269,7 +261,21 @@ Return a list of installed packages or nil for every package not installed."
|
||||
('error
|
||||
(message (format "Caught exception: [%s]" ex))
|
||||
(setq retval (cons 'exception (list ex))))
|
||||
nil)))
|
||||
nil))
|
||||
|
||||
(defun message-virtual-envs ()
|
||||
(interactive)
|
||||
(message "%s" (get-virtual-envs)))
|
||||
|
||||
(use-package python
|
||||
:commands python-mode
|
||||
:mode ("\\.py\\'" . python-mode)
|
||||
:config
|
||||
(progn
|
||||
;; macros
|
||||
(fset 'ipdb "import ipdb; ipdb.set_trace()")
|
||||
(fset 'main "if __name__ == '__main__':")
|
||||
(fset 'sphinx-class ":class:`~")
|
||||
:init
|
||||
(progn
|
||||
(use-package jedi
|
||||
@ -280,10 +286,10 @@ Return a list of installed packages or nil for every package not installed."
|
||||
(use-package pymacs :ensure t)
|
||||
(use-package sphinx-doc :ensure t)
|
||||
(add-hook 'python-mode-hook (lambda () (setq show-trailing-whitespace t)))
|
||||
(add-hook 'python-mode-hook (lambda () (if use-python-tabs python-tabs)))
|
||||
(add-hook 'python-mode-hook (lambda () (if use-python-tabs (python-tabs))))
|
||||
(add-hook 'python-mode-hook (lambda () (subword-mode t)))
|
||||
(add-hook 'python-mode-hook #'jedi:setup)
|
||||
(add-hook 'python-mode-hook #'add-virtual-envs-to-jedi-server)))
|
||||
(add-hook 'python-mode-hook #'add-virtual-envs-to-jedi-server))))
|
||||
|
||||
;; =============================================================================
|
||||
;; Scala
|
||||
|
Loading…
Reference in New Issue
Block a user