Mentions légales du service

Skip to content
Snippets Groups Projects
Commit dd985334 authored by FELŠÖCI Marek's avatar FELŠÖCI Marek
Browse files

Add configuration for Emacs editor

parent 13385f81
No related branches found
No related tags found
No related merge requests found
Pipeline #881212 failed
......@@ -193,9 +193,96 @@ in the experimental environment of the study, use the command below.
#+BEGIN_SRC shell
guix time-machine -C channels.scm -- shell --pure -m manifest.scm -- \
emacs --batch --no-init-file study.org
emacs -q -l study.org
#+END_SRC
***** Emacs configuration
:PROPERTIES:
:CUSTOM_ID: emacs-el
:header-args: :tangle emacs.el :eval never
:END:
For a smoother editing experience in Emacs, we provide here a minimal
configuration file for the Emacs editor, the =emacs.el= file, to use within the
experimental software environment of the study.
The first part of the configuration is dedicated to the indentation setup, we
want to use 2 spaces instead of TAB to indent for every language.
#+begin_src elisp
(defun set-indent (n)
(setq-local c-basic-offset n)
(setq-local sh-basic-offset n)
(setq-local coffee-tab-width n)
(setq-local javascript-indent-level n)
(setq-local js-indent-level n)
(setq-local js2-basic-offset n)
(setq-local web-mode-markup-indent-offset n)
(setq-local web-mode-css-indent-offset n)
(setq-local web-mode-code-indent-offset n)
(setq-local css-indent-offset n)
(setq indent-tabs-mode nil))
(add-hook 'prog-mode-hook (lambda () (set-indent 2)))
(add-hook 'text-mode-hook (lambda () (set-indent 2)))
#+end_src
We then want to highlight the 80th column an automatically wrap text around the
latter.
#+begin_src elisp
(require 'fill-column-indicator)
(setq fci-rule-column 80)
(add-hook 'prog-mode-hook 'turn-on-fci-mode)
(add-hook 'text-mode-hook 'turn-on-fci-mode)
(setq-default fill-column 80)
#+end_src
Follows the Org mode-related setup. After loading the necessary Org packages for
editing templates and bibliography support,
#+begin_src elisp
(require 'org-tempo)
(require 'org-ref)
#+end_src
we:
- do not want to have to confirm every single source code evaluation,
#+begin_src elisp
(setq org-confirm-babel-evaluate nil)
#+end_src
- want to preserve the indentation on export and tangle actions,
#+begin_src elisp
(setq org-src-preserve-indentation t)
(setq org-src-tab-acts-natively t)
#+end_src
- allow syntax highlighting,
#+begin_src elisp
(setq org-src-fontify-natively t)
#+end_src
- load R and shell language support for code evaluation,
#+begin_src elisp
(org-babel-do-load-languages
'org-babel-load-languages
'((R . t)
(shell . t)))
#+end_src
- do not want to hide brackets around URLs.
#+begin_src elisp
(setq org-descriptive-links nil)
#+end_src
Finally, we:
- set the color of the line highlighting the 80th column,
#+begin_src elisp
(setq fci-rule-color "#3C3D37")
#+end_src
- disable the start-up screen.
#+begin_src elisp
(setq inhibit-startup-screen t)
#+end_src
*** Hardware environment
:PROPERTIES:
:CUSTOM_ID: hwe
......@@ -305,6 +392,7 @@ Emacs and Texlive packages.
"emacs-org"
"emacs-org-ref"
"emacs-ess"
"emacs-fill-column-indicator"
"texlive-scheme-basic"
"texlive-hyperref"
"texlive-geometry"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment