|
|
@ -1316,7 +1316,7 @@ It is only available for emacs 26 and higher. |
|
|
|
(defun company/python-mode-hook() |
|
|
|
(message "company/python-mode-hook activated") |
|
|
|
(set (make-local-variable 'company-backends) |
|
|
|
'((company-jedi company-yasnippet))) |
|
|
|
'((company-jedi company-yasnippet company-dabbrev-code) company-dabbrev)) |
|
|
|
; '((company-ob-ipython company-lsp))) |
|
|
|
; '((company-ob-ipython company-jedi))) |
|
|
|
; '((company-jedi company-dabbrev-code company-yasnippet) company-capf company-files)) |
|
|
@ -1570,91 +1570,6 @@ Add some helpers to handle and understand macros |
|
|
|
(semantic-mode t) |
|
|
|
(flycheck-select-checker 'pylint)))) |
|
|
|
#+END_SRC |
|
|
|
*** Python language server (inactive) |
|
|
|
On python side following needs to be installed: |
|
|
|
- python-language-server[all] |
|
|
|
|
|
|
|
First test for lsp-python. |
|
|
|
Some intro: [[https://vxlabs.com/2018/06/08/python-language-server-with-emacs-and-lsp-mode/][Intro]] |
|
|
|
Source python language server: [[https://github.com/palantir/python-language-server][Link]] |
|
|
|
Source lsp-mode: |
|
|
|
Source lsp-python: [[https://github.com/emacs-lsp/lsp-python][Link]] |
|
|
|
Source company-lsp: [[https://github.com/tigersoldier/company-lsp][Link]] |
|
|
|
Source lsp-ui: [[https://github.com/emacs-lsp/lsp-ui][Link]] |
|
|
|
|
|
|
|
BEGIN_SRC emacs-lisp |
|
|
|
(use-package lsp-mode |
|
|
|
:ensure t |
|
|
|
:config |
|
|
|
;; make sure we have lsp-imenu everywhere we have lsp |
|
|
|
(require 'lsp-imenu) |
|
|
|
(add-hook 'lsp-after-open-hook 'lsp-enable-imenu) |
|
|
|
;; get lsp-python-enable defined |
|
|
|
;; nb: use either projectile-project-root or ffip-get-project-root-directory |
|
|
|
;; or any other function that can be used to find the root dir of a project |
|
|
|
(lsp-define-stdio-client lsp-python "python" |
|
|
|
#'projectile-project-root |
|
|
|
'("pyls")) |
|
|
|
;; make sure this is activated when python-mode is activated |
|
|
|
;; lsp-python-enable is created by macro above |
|
|
|
(add-hook 'python-mode-hook |
|
|
|
(lambda () |
|
|
|
(lsp-python-enable) |
|
|
|
(company/python-mode-hook))) |
|
|
|
;; lsp extras |
|
|
|
(use-package lsp-ui |
|
|
|
:ensure t |
|
|
|
:config |
|
|
|
(setq lsp-ui-sideline-ignore-duplicate t) |
|
|
|
(add-hook 'lsp-mode-hook 'lsp-ui-mode)) |
|
|
|
|
|
|
|
(use-package company-lsp |
|
|
|
:ensure t) |
|
|
|
; :config |
|
|
|
; (push 'company-lsp company-backends)) |
|
|
|
|
|
|
|
;; NB: only required if you prefer flake8 instead of the default |
|
|
|
;; send pyls config via lsp-after-initialize-hook -- harmless for |
|
|
|
;; other servers due to pyls key, but would prefer only sending this |
|
|
|
;; when pyls gets initialised (:initialize function in |
|
|
|
;; lsp-define-stdio-client is invoked too early (before server |
|
|
|
;; start)) |
|
|
|
(defun lsp-set-cfg () |
|
|
|
(let ((lsp-cfg `(:pyls (:configurationSources ("flake8"))))) |
|
|
|
;; TODO: check lsp--cur-workspace here to decide per server / project |
|
|
|
(lsp--set-configuration lsp-cfg))) |
|
|
|
|
|
|
|
(add-hook 'lsp-after-initialize-hook 'lsp-set-cfg) |
|
|
|
) |
|
|
|
END_SRC |
|
|
|
BEGIN_SRC emacs-lisp |
|
|
|
(use-package lsp-mode |
|
|
|
:ensure t |
|
|
|
:defer t) |
|
|
|
|
|
|
|
(add-hook 'lsp-mode-hook #'(lambda () |
|
|
|
(customize-set-variable 'lsp-enable-eldoc nil) |
|
|
|
(flycheck-mode 1) |
|
|
|
(company-mode 1))) |
|
|
|
|
|
|
|
(use-package lsp-ui |
|
|
|
:ensure t |
|
|
|
:defer t) |
|
|
|
|
|
|
|
(use-package company-lsp |
|
|
|
:ensure t |
|
|
|
:defer t) |
|
|
|
|
|
|
|
(use-package lsp-python |
|
|
|
:ensure t |
|
|
|
:after lsp-mode |
|
|
|
:defer t |
|
|
|
:init |
|
|
|
(add-hook 'python-mode-hook #'(lambda () |
|
|
|
(lsp-python-enable) |
|
|
|
(flycheck-select-checker 'python-flake8)))) |
|
|
|
|
|
|
|
END_SRC |
|
|
|
|
|
|
|
*** Jedi / Company |
|
|
|
Jedi is a backend for python autocompletion and needs to be installed on the server: |
|
|
@ -1755,45 +1670,91 @@ END_SRC |
|
|
|
(set-face-background 'highlight-indentation-face "#454545") |
|
|
|
(set-face-background 'highlight-indentation-current-column-face "#656565")) |
|
|
|
#+END_SRC |
|
|
|
*** Python language server (inactive) |
|
|
|
On python side following needs to be installed: |
|
|
|
- python-language-server[all] |
|
|
|
|
|
|
|
First test for lsp-python. |
|
|
|
Some intro: [[https://vxlabs.com/2018/06/08/python-language-server-with-emacs-and-lsp-mode/][Intro]] |
|
|
|
Source python language server: [[https://github.com/palantir/python-language-server][Link]] |
|
|
|
Source lsp-mode: |
|
|
|
Source lsp-python: [[https://github.com/emacs-lsp/lsp-python][Link]] |
|
|
|
Source company-lsp: [[https://github.com/tigersoldier/company-lsp][Link]] |
|
|
|
Source lsp-ui: [[https://github.com/emacs-lsp/lsp-ui][Link]] |
|
|
|
|
|
|
|
BEGIN_SRC emacs-lisp |
|
|
|
(use-package highlight-indent-guides |
|
|
|
(use-package lsp-mode |
|
|
|
:ensure t |
|
|
|
:defer t |
|
|
|
:init |
|
|
|
(add-hook 'python-mode-hook 'highlight-indent-guides-mode) |
|
|
|
:config |
|
|
|
(setq highlight-indent-guides-method 'column ;'character |
|
|
|
;highlight-indent-guides-character ?\| |
|
|
|
highlight-indent-guides-auto-odd-face-perc 15 |
|
|
|
highlight-indent-guides-auto-even-face-perc 15 |
|
|
|
highlight-indent-guides-auto-character-face-perc 20)) |
|
|
|
;; make sure we have lsp-imenu everywhere we have lsp |
|
|
|
(require 'lsp-imenu) |
|
|
|
(add-hook 'lsp-after-open-hook 'lsp-enable-imenu) |
|
|
|
;; get lsp-python-enable defined |
|
|
|
;; nb: use either projectile-project-root or ffip-get-project-root-directory |
|
|
|
;; or any other function that can be used to find the root dir of a project |
|
|
|
(lsp-define-stdio-client lsp-python "python" |
|
|
|
#'projectile-project-root |
|
|
|
'("pyls")) |
|
|
|
;; make sure this is activated when python-mode is activated |
|
|
|
;; lsp-python-enable is created by macro above |
|
|
|
(add-hook 'python-mode-hook |
|
|
|
(lambda () |
|
|
|
(lsp-python-enable) |
|
|
|
(company/python-mode-hook))) |
|
|
|
;; lsp extras |
|
|
|
(use-package lsp-ui |
|
|
|
:ensure t |
|
|
|
:config |
|
|
|
(setq lsp-ui-sideline-ignore-duplicate t) |
|
|
|
(add-hook 'lsp-mode-hook 'lsp-ui-mode)) |
|
|
|
|
|
|
|
(use-package company-lsp |
|
|
|
:ensure t) |
|
|
|
; :config |
|
|
|
; (push 'company-lsp company-backends)) |
|
|
|
|
|
|
|
;; NB: only required if you prefer flake8 instead of the default |
|
|
|
;; send pyls config via lsp-after-initialize-hook -- harmless for |
|
|
|
;; other servers due to pyls key, but would prefer only sending this |
|
|
|
;; when pyls gets initialised (:initialize function in |
|
|
|
;; lsp-define-stdio-client is invoked too early (before server |
|
|
|
;; start)) |
|
|
|
(defun lsp-set-cfg () |
|
|
|
(let ((lsp-cfg `(:pyls (:configurationSources ("flake8"))))) |
|
|
|
;; TODO: check lsp--cur-workspace here to decide per server / project |
|
|
|
(lsp--set-configuration lsp-cfg))) |
|
|
|
|
|
|
|
(add-hook 'lsp-after-initialize-hook 'lsp-set-cfg) |
|
|
|
) |
|
|
|
END_SRC |
|
|
|
*** Anaconda (inactive) |
|
|
|
Anaconda test |
|
|
|
BEGIN_SRC emacs-lisp |
|
|
|
(use-package lsp-mode |
|
|
|
:ensure t |
|
|
|
:defer t) |
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
; (use-package anaconda-mode |
|
|
|
; :ensure t |
|
|
|
; :defer t |
|
|
|
; :init |
|
|
|
; (add-hook 'python-mode-hook 'anaconda-mode) |
|
|
|
;; (add-hook 'python-mode-hook 'anaconda-eldoc-mode) |
|
|
|
; :config |
|
|
|
; (setq anaconda-eldoc-mode 1) |
|
|
|
; ) |
|
|
|
#+END_SRC |
|
|
|
(add-hook 'lsp-mode-hook #'(lambda () |
|
|
|
(customize-set-variable 'lsp-enable-eldoc nil) |
|
|
|
(flycheck-mode 1) |
|
|
|
(company-mode 1))) |
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
; (use-package company-anaconda |
|
|
|
; :ensure t |
|
|
|
; :defer t |
|
|
|
; :init |
|
|
|
; (defun my/company-anaconda-hook() |
|
|
|
; (add-to-list 'company-backends 'company-anaconda)) |
|
|
|
; (add-hook 'python-mode-hook 'my/company-anaconda-hook) |
|
|
|
; ) |
|
|
|
#+END_SRC |
|
|
|
(use-package lsp-ui |
|
|
|
:ensure t |
|
|
|
:defer t) |
|
|
|
|
|
|
|
(use-package company-lsp |
|
|
|
:ensure t |
|
|
|
:defer t) |
|
|
|
|
|
|
|
(use-package lsp-python |
|
|
|
:ensure t |
|
|
|
:after lsp-mode |
|
|
|
:defer t |
|
|
|
:init |
|
|
|
(add-hook 'python-mode-hook #'(lambda () |
|
|
|
(lsp-python-enable) |
|
|
|
(flycheck-select-checker 'python-flake8)))) |
|
|
|
|
|
|
|
END_SRC |
|
|
|
** Latex |
|
|
|
Requirements for Linux: |
|
|
|
- Latex |
|
|
|