Browse Source

added config for ipython, fix for beancount

master
Marc Pohling 6 years ago
parent
commit
a428e0f663
1 changed files with 40 additions and 13 deletions
  1. 53
      config.org

53
config.org

@ -118,9 +118,10 @@
Don't add the font in the work environment, which I am logged in as POH Don't add the font in the work environment, which I am logged in as POH
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(unless (string-equal my/whoami "work_remote")
(set-face-attribute 'default nil :font "Hack-12")
)
(pcase my/whoami
("home" (set-face-attribute 'default nil :font "Hack-10"))
("work_hyperv" (set-face-attribute 'default nil :font "Hack-12"))
)
#+END_SRC #+END_SRC
** Themes ** Themes
@ -850,6 +851,7 @@ Org overwrites RET and C-j, so I need to disable the rebinds
** Org babel helper functions
* Pandoc * Pandoc
Convert between formats, like from org to html. Convert between formats, like from org to html.
@ -925,7 +927,7 @@ sudo apt install pandoc
(getenv "PATH")) (getenv "PATH"))
) )
:config :config
(setq beancount-filename-main "/home/marc/Archiv/Finanzen/transactions.beancount")
(setq beancount-filename-main "/home/marc/Archiv/Finanzen/Transaktionen/transactions.beancount")
) )
) )
#+END_SRC #+END_SRC
@ -1142,15 +1144,17 @@ It is only available for emacs 26 and higher.
*** Company backend hooks *** Company backend hooks
Backend configuration for python-mode
Backend configuration for python-mode
Common backends are:
- company-files: files & directory
- company-keywords: keywords
- company-capf: ??
- company-abbrev: ??
- company-dabbrev: dynamic abbreviations
- company-ispell: ??
Common backends are:
- company-files: files & directory
- company-keywords: keywords
- company-capf: ??
- company-abbrev: ??
- company-dabbrev: dynamic abbreviations
- company-ispell: ??
So far I cannot differenciate a true python mode and a source block of ipython in org-mode, so the python-mode-hook should include both completion backends.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun company/python-mode-hook() (defun company/python-mode-hook()
@ -1163,6 +1167,16 @@ Common backends are:
) )
#+END_SRC #+END_SRC
I have yet to find the proper hook to call this.
#+BEGIN_SRC emacs-lisp
(defun company/ipython-mode-hook()
(message "python-mode-hook activated")
(set (make-local-variable 'company-backends)
'((company-ob-ipython)))
(company-mode t)
)
#+END_SRC
(defun add-pcomplete-to-capf () (defun add-pcomplete-to-capf ()
(add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t)) (add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t))
;; (add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t) ;; (add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t)
@ -1333,6 +1347,18 @@ Add some helpers to handle and understand macros
(setq python-shell-completion-native-enable nil) (setq python-shell-completion-native-enable nil)
) )
#+END_SRC #+END_SRC
*** IPython-Mode
Not sure if this configuraton will interfere with Python-Mode
#+BEGIN_SRC emacs-lisp
(use-package ob-ipython
:ensure t
:defer t
:init
(add-hook 'ob-ipython-mode-hook (lambda ()
'company/ipython-mode-hook
(semantic-mode t)
(flycheck-select-checker 'pylint))))
#+END_SRC
*** Python language server (inactive) *** Python language server (inactive)
First test for lsp-python. First test for lsp-python.
Source python language server: [[https://github.com/palantir/python-language-server][Link]] Source python language server: [[https://github.com/palantir/python-language-server][Link]]
@ -1414,7 +1440,8 @@ END_SRC
;; traceback is in jedi:pop-to-epc-buffer ;; traceback is in jedi:pop-to-epc-buffer
(jedi:setup) (jedi:setup)
(company/python-mode-hook) (company/python-mode-hook)
(setq jedi:server-args '("--log-traceback")))
(setq jedi:server-args '("--log-traceback"))
(message "post-activate-hook"))
(add-hook 'pyvenv-post-activate-hooks 'my/post-activate-hook) (add-hook 'pyvenv-post-activate-hooks 'my/post-activate-hook)
) )
#+END_SRC #+END_SRC

Loading…
Cancel
Save