|
@ -293,11 +293,14 @@ Windows Theme: |
|
|
:ID: a2873138-16ee-4990-89a2-26eab778ea74 |
|
|
:ID: a2873138-16ee-4990-89a2-26eab778ea74 |
|
|
:END: |
|
|
:END: |
|
|
#+BEGIN_SRC emacs-lisp |
|
|
#+BEGIN_SRC emacs-lisp |
|
|
(use-package rainbow-mode |
|
|
|
|
|
:ensure t |
|
|
|
|
|
:diminish |
|
|
|
|
|
:hook ((org-mode |
|
|
|
|
|
emacs-lisp-mode) . rainbow-mode)) |
|
|
|
|
|
|
|
|
(use-package rainbow-mode |
|
|
|
|
|
:ensure t |
|
|
|
|
|
:diminish |
|
|
|
|
|
:hook ((org-mode |
|
|
|
|
|
emacs-lisp-mode) . rainbow-mode)) |
|
|
|
|
|
|
|
|
|
|
|
(use-package delight |
|
|
|
|
|
:ensure t) |
|
|
#+END_SRC |
|
|
#+END_SRC |
|
|
* undo |
|
|
* undo |
|
|
:PROPERTIES: |
|
|
:PROPERTIES: |
|
@ -819,10 +822,14 @@ Manage projects and jump quickly between its files |
|
|
(use-package projectile |
|
|
(use-package projectile |
|
|
:ensure t |
|
|
:ensure t |
|
|
:defer t |
|
|
:defer t |
|
|
|
|
|
:hook (projectile-after-switch-project . (lambda () (set-workon_home))) |
|
|
:bind |
|
|
:bind |
|
|
(("C-c p p" . projectile-switch-project) |
|
|
(("C-c p p" . projectile-switch-project) |
|
|
("C-c p c" . projectile-command-map) |
|
|
("C-c p c" . projectile-command-map) |
|
|
("C-c p s s" . projectile-ag)) |
|
|
("C-c p s s" . projectile-ag)) |
|
|
|
|
|
:preface |
|
|
|
|
|
(defun set-workon_home() |
|
|
|
|
|
(setenv "WORKON_HOME" (projectile-project-root))) |
|
|
:init |
|
|
:init |
|
|
(setq-default projectile-cache-file (concat MY--PATH_USER_LOCAL ".projectile-cache") |
|
|
(setq-default projectile-cache-file (concat MY--PATH_USER_LOCAL ".projectile-cache") |
|
|
projectile-known-projects-file (concat MY--PATH_USER_LOCAL ".projectile-bookmarks")) |
|
|
projectile-known-projects-file (concat MY--PATH_USER_LOCAL ".projectile-bookmarks")) |
|
@ -945,33 +952,61 @@ apt install build-essential python3-dev |
|
|
https://github.com/emacs-lsp/lsp-mode#install-language-server |
|
|
https://github.com/emacs-lsp/lsp-mode#install-language-server |
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
#+BEGIN_SRC emacs-lisp |
|
|
(if *sys/linux* |
|
|
|
|
|
(defun my/postactivatehook () |
|
|
|
|
|
(setq lsp-python-ms-extra-paths pyvenv-virtual-env)) |
|
|
|
|
|
|
|
|
|
|
|
(use-package pyvenv |
|
|
|
|
|
:ensure t |
|
|
|
|
|
:config |
|
|
|
|
|
(setenv "WORKON_HOME" (expand-file-name "~/Archiv/Programmierprojekte/Python/virtualenv/")) |
|
|
|
|
|
(add-hook 'pyvenv-post-activate-hooks 'my/postactivatehook)) |
|
|
|
|
|
|
|
|
|
|
|
(use-package virtualenvwrapper |
|
|
|
|
|
:ensure t |
|
|
|
|
|
:hook (venv-postmkvirtualenv . (lambda() (shell-command "pip3 install importmagic epc"))) |
|
|
|
|
|
:config |
|
|
|
|
|
(setq venv-location (expand-file-name "~/Archiv/Programmierprojekte/Python/virtualenv/"))) |
|
|
|
|
|
|
|
|
(use-package lsp-python-ms |
|
|
|
|
|
:if *sys/linux* |
|
|
|
|
|
:ensure t |
|
|
|
|
|
:defer 0.3 |
|
|
|
|
|
:custom (lsp-python-ms-auto-install-server t)) |
|
|
|
|
|
|
|
|
(use-package lsp-python-ms |
|
|
|
|
|
:ensure t |
|
|
|
|
|
;:after lsp-mode python |
|
|
|
|
|
:hook (python-mode . (lambda() |
|
|
|
|
|
(require 'lsp-python-ms) |
|
|
|
|
|
(lsp))) |
|
|
|
|
|
:init |
|
|
|
|
|
(setq lsp-python-ms-executable |
|
|
|
|
|
"~/.config/emacs/mspyls/Microsoft.Python.LanguageServer") |
|
|
|
|
|
:custom ((lsp-python-executable-cmd "python3") |
|
|
|
|
|
(lsp-python-ms-auto-install-server t)))) |
|
|
|
|
|
|
|
|
(use-package python |
|
|
|
|
|
:if *sys/linux* |
|
|
|
|
|
:delight "π " |
|
|
|
|
|
:bind (("M-[" . python-nav-backward-block) |
|
|
|
|
|
("M-]" . python-nav-forward-block))) |
|
|
|
|
|
|
|
|
|
|
|
(use-package pyvenv |
|
|
|
|
|
:if *sys/linux* |
|
|
|
|
|
:ensure t |
|
|
|
|
|
:after python |
|
|
|
|
|
:hook ((python-mode . pyvenv-mode) |
|
|
|
|
|
(python-mode . (lambda () |
|
|
|
|
|
(if-let ((pyvenv-directory (find-pyvenv-directory (buffer-file-name)))) |
|
|
|
|
|
(pyvenv-activate pyvenv-directory)) |
|
|
|
|
|
(lsp)))) |
|
|
|
|
|
:custom |
|
|
|
|
|
(pyvenv-default-virtual-env-name "env") |
|
|
|
|
|
(pyvenv-mode-line-indicator '(pyvenv-virtual-env-name ("[venv:" pyvenv-virtual-env-name "]"))) |
|
|
|
|
|
:preface |
|
|
|
|
|
(defun find-pyvenv-directory (path) |
|
|
|
|
|
"Check if a pyvenv directory exists." |
|
|
|
|
|
(cond |
|
|
|
|
|
((not path) nil) |
|
|
|
|
|
((file-regular-p path) (find-pyvenv-directory (file-name-directory path))) |
|
|
|
|
|
((file-directory-p path) |
|
|
|
|
|
(or |
|
|
|
|
|
(seq-find |
|
|
|
|
|
(lambda (path) (file-regular-p (expand-file-name "pyvenv.cfg" path))) |
|
|
|
|
|
(directory-files path t)) |
|
|
|
|
|
(let ((parent (file-name-directory (directory-file-name path)))) |
|
|
|
|
|
(unless (equal parent path) (find-pyvenv-directory parent)))))))) |
|
|
|
|
|
|
|
|
|
|
|
;; manage multiple python version |
|
|
|
|
|
;; needs to be installed on system |
|
|
|
|
|
; (use-package pyenv-mode |
|
|
|
|
|
; :ensure t |
|
|
|
|
|
; :after python |
|
|
|
|
|
; :hook ((python-mode . pyenv-mode) |
|
|
|
|
|
; (projectile-switch-project . projectile-pyenv-mode-set)) |
|
|
|
|
|
; :custom (pyenv-mode-set "3.8.5") |
|
|
|
|
|
; :preface |
|
|
|
|
|
; (defun projectile-pyenv-mode-set () |
|
|
|
|
|
; "Set pyenv version matching project name." |
|
|
|
|
|
; (let ((project (projectile-project-name))) |
|
|
|
|
|
; (if (member project (pyenv-mode-versions)) |
|
|
|
|
|
; (pyenv-mode-set project) |
|
|
|
|
|
; (pyenv-mode-unset))))) |
|
|
|
|
|
|
|
|
|
|
|
;) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#+END_SRC |
|
|
#+END_SRC |
|
|