Added autocomplete and fixed R plot source blocks

This commit is contained in:
Louis Lacoste 2023-01-20 17:06:32 +01:00
parent 10410a80ea
commit 59062b30ab
2 changed files with 48 additions and 23 deletions

View file

@ -87,12 +87,7 @@
(dired-directory dired-directory "%b"))))
(global-font-lock-mode t)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(flyspell-incorrect ((t (:inverse-video t)))))
(line-number-mode 1)
@ -281,10 +276,10 @@ Entered on %U
'("r" "#+begin_src R :results output :session *R* :exports both\n\n#+end_src" "<src lang=\"R\">\n\n</src>"))
(rrmooc/add-org-template
'("R" "#+begin_src R :results output graphics :file (org-babel-temp-file \"figure\" \".png\") :exports both :width 600 :height 400 :session *R* \n\n#+end_src" "<src lang=\"R\">\n\n</src>"))
'("R" "#+begin_src R :results output file graphics :file (org-babel-temp-file \"figure\" \".png\") :exports both :width 600 :height 400 :session *R* \n\n#+end_src" "<src lang=\"R\">\n\n</src>"))
(rrmooc/add-org-template
'("RR" "#+begin_src R :results output graphics :file (org-babel-temp-file (concat (file-name-directory (or load-file-name buffer-file-name)) \"figure-\") \".png\") :exports both :width 600 :height 400 :session *R* \n\n#+end_src" "<src lang=\"R\">\n\n</src>"))
'("RR" "#+begin_src R :results output file graphics :file (org-babel-temp-file (concat (file-name-directory (or load-file-name buffer-file-name)) \"figure-\") \".png\") :exports both :width 600 :height 400 :session *R* \n\n#+end_src" "<src lang=\"R\">\n\n</src>"))
(rrmooc/add-org-template
'("p" "#+begin_src python :results output :exports both\n\n#+end_src" "<src lang=\"python\">\n\n</src>"))
@ -327,7 +322,11 @@ A->B
'(flycheck
company
org-appear
org-fragtog))
org-fragtog
lsp-mode
lsp-ui
lsp-jedi
org-gcal))
(missing-wanted-packages (remove-if #'package-installed-p wanted-packages)))
(when missing-wanted-packages
(message "Missing wanted packages: %s" missing-wanted-packages)
@ -347,14 +346,14 @@ A->B
(add-hook 'org-mode-hook 'org-fragtog-mode)
(with-eval-after-load "lsp-mode"
(add-to-list 'lsp-disabled-clients 'pyls)
(add-to-list 'lsp-enabled-clients 'jedi))
(setq org-gcal-client-id "1026118950970-efrvhrhp5llr6lagec2fp1nt7dr4kqud.apps.googleusercontent.com"
org-gcal-client-secret "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"
org-gcal-fetch-file-alist '(("louis.lacoste@hotmail.fr" . "~/org/journal-stage.org")))
(require 'org-gcal)
(setq plstore-cache-passphrase-for-symmetric-encryption t) ; plstore for caching the OAuth token
(load-theme 'leuven t)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(org-format-latex-options
'(:foreground default :background default :scale 1.5 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers
("begin" "$1" "$" "$$" "\\(" "\\[")))
'(package-selected-packages
'(org-fragtog org-appear magit htmlize flycheck ess company auctex)))

View file

@ -436,7 +436,7 @@ To use this type <R and then TAB. This creates an R block for graphics
that are stored in the =/tmp/=.
#+begin_src emacs-lisp :tangle init.el
(rrmooc/add-org-template
'("R" "#+begin_src R :results output graphics :file (org-babel-temp-file \"figure\" \".png\") :exports both :width 600 :height 400 :session *R* \n\n#+end_src" "<src lang=\"R\">\n\n</src>"))
'("R" "#+begin_src R :results output file graphics :file (org-babel-temp-file \"figure\" \".png\") :exports both :width 600 :height 400 :session *R* \n\n#+end_src" "<src lang=\"R\">\n\n</src>"))
#+end_src
To use this type <RR and then TAB. This creates an R block for
@ -444,7 +444,7 @@ graphics that are stored in the directory of the current file.
#+begin_src emacs-lisp :tangle init.el
(rrmooc/add-org-template
'("RR" "#+begin_src R :results output graphics :file (org-babel-temp-file (concat (file-name-directory (or load-file-name buffer-file-name)) \"figure-\") \".png\") :exports both :width 600 :height 400 :session *R* \n\n#+end_src" "<src lang=\"R\">\n\n</src>"))
'("RR" "#+begin_src R :results output file graphics :file (org-babel-temp-file (concat (file-name-directory (or load-file-name buffer-file-name)) \"figure-\") \".png\") :exports both :width 600 :height 400 :session *R* \n\n#+end_src" "<src lang=\"R\">\n\n</src>"))
#+end_src
*** Python code
To use this type <p and then TAB
@ -514,7 +514,11 @@ This often fails, yielding an ugly warning, and isn't of any use in Org-mode any
'(flycheck
company
org-appear
org-fragtog))
org-fragtog
lsp-mode
lsp-ui
lsp-jedi
org-gcal))
(missing-wanted-packages (remove-if #'package-installed-p wanted-packages)))
(when missing-wanted-packages
(message "Missing wanted packages: %s" missing-wanted-packages)
@ -572,6 +576,28 @@ This code was taken from https://emacs.stackexchange.com/questions/42281/org-mod
"imghttps"
:image-data-fun #'org-image-link)
#+end_src
** LSP
*** Jedi
#+NAME: jedi-lsp
#+begin_src emacs-lisp :tangle init.el
(with-eval-after-load "lsp-mode"
(add-to-list 'lsp-disabled-clients 'pyls)
(add-to-list 'lsp-enabled-clients 'jedi))
#+end_src
** Org Mode and Google Calendar sync
3cd8ed4b63d99dee42b9e34107b2c85d1d2da132732603825491968cf9c1ef70@group.calendar.google.com
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
1026118950970-efrvhrhp5llr6lagec2fp1nt7dr4kqud.apps.googleusercontent.com
#+begin_src emacs-lisp :tangle init.el
(setq org-gcal-client-id "1026118950970-efrvhrhp5llr6lagec2fp1nt7dr4kqud.apps.googleusercontent.com"
org-gcal-client-secret "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"
org-gcal-fetch-file-alist '(("louis.lacoste@hotmail.fr" . "~/org/journal-stage.org")))
(require 'org-gcal)
(setq plstore-cache-passphrase-for-symmetric-encryption t) ; plstore for caching the OAuth token
#+end_src
* Theme
** Activation du thème
#+begin_src emacs-lisp :tangle init.el