# -*- mode: org -*- #+TITLE: Emacs init file written in org-mode #+AUTHOR: Arnaud Legrand, Konrad Hinsen #+STARTUP: indent #+LANGUAGE: en This is a "minimal" =.emacs= configuration file. For this configuration to work, you'll need one of: - Emacs 26 (preferred) - Emacs 25 plus Org-Mode 9 * Installation Instructions Backup you own =.emacs= if you have one and replace it with [[file:init.el][the content of this file]]. If you ever want to regenerate if from this org document, simply =M-x org-babel-tangle=. * Machine-dependent configuration #+begin_src emacs-lisp :tangle init.el ;; Machine-dependent configuration - adapt as required for your computer! ;; There are two kinds of settings that might have to be adapted to the ;; specific environment of a computer: ;; 1. Telling Emacs which executables to use for Python and R ;; 2. Telling Emacs to use a Web proxy ;; ;; 1. Telling Emacs which executables to use for Python and R ;; ;; Default setting: Use "python3" under Linux and macOS, but "Python" under Windows. ;; The default for R is "R" for all platforms (predefined by Emacs). (setq org-babel-python-command (if (memq system-type '(windows-nt ms-dos)) "Python" "python3 -q")) ;; If the Python and R executables are on your system's search path, ;; you should not have to modify anything here. If Emacs does not find ;; Python or R, or if it uses a different version of Python or R than you ;; expect, you can uncomment these two lines (one for Python, one for R) ;; and modify them to point to the executables. ;; Python ;; Be careful if the path to your Python installation contains spaces. The path ;; must then be surrounded by backslash-escaped quotation marks, as in ;; (setq org-babel-python-command "\"C:/Program Files/Python/Python37/python.exe\"") ;; R ;; (setq inferior-R-program-name "C:/Program Files/R/R-3.5.1/bin/x64/Rterm.exe") ;; ;; 2. Telling Emacs to use a Web proxy ;; ;; If your local network imposes the use of a Web proxy, you must uncomment and adapt ;; the following lines. Emacs does NOT use system-wide proxy settings. In most ;; cases, only the first two lines (proxy-name and proxy-port) need to be changed, ;; but sometimes the fifth line (no_proxy) also requires modifications. If you are ;; unsure what the right settings are, ask your local network administrator for help. ;; (let* ((proxy-name "proxy.mynetwork.org") ;; (proxy-port "8080") ;; (proxy-name-port (concat proxy-name ":" proxy-port)) ;; (proxy-url (concat "http://" proxy-name-port "/"))) ;; (setq url-proxy-services (list (cons "no_proxy" "127.0.0.1") ;; (cons "http" proxy-name-port) ;; (cons "https" proxy-name-port))) ;; (setenv "http_proxy" proxy-url) ;; (setenv "https_proxy" proxy-url) ;; (setenv "JVM_OPTS" (concat "-Dhttp.proxyHost=" proxy-name ;; " -Dhttp.proxyPort=" proxy-port))) #+end_src * Package sources ** Use melpa-stable (preferred) and melpa in addition to the default GNU archive #+BEGIN_SRC emacs-lisp :tangle init.el (package-initialize) (add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")) (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/")) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (setq package-archive-priorities '(("melpa-stable" . 100) ("melpa" . 50) ("gnu" . 10))) #+END_SRC * Install packages #+begin_src emacs-lisp :tangle init.el (require 'cl) (let* ((required-packages '(dash htmlize ess auctex magit)) (missing-packages (remove-if #'package-installed-p required-packages))) (when missing-packages (message "Missing packages: %s" missing-packages) (package-refresh-contents) (dolist (pkg missing-packages) (package-install pkg) (message "Package %s has been installed" pkg)))) #+end_src * Loading files: ** Loading babel: :ARNAUD: #+begin_src emacs-lisp :tangle init.el (require 'org) #+end_src ** Loading ESS (Emacs support for R) This seems to be needed on some platforms. #+begin_src emacs-lisp :tangle init.el (require 'ess-site) #+end_src * Emacs aesthetics: ** Remove splash screen: :WEB: #+begin_src emacs-lisp :tangle init.el (setq inhibit-splash-screen t) #+end_src ** Change frame name of emacs: :LUKA:WEB: #+begin_src emacs-lisp :tangle init.el (setq frame-title-format '("Emacs - " (buffer-file-name "%f" (dired-directory dired-directory "%b")))) #+end_src ** Text coloring :ARNAUD: #+begin_src emacs-lisp :tangle init.el (global-font-lock-mode t) (custom-set-faces '(flyspell-incorrect ((t (:inverse-video t))))) #+end_src ** Line and column numbering :ARNAUD: #+begin_src emacs-lisp :tangle init.el (line-number-mode 1) (column-number-mode 1) #+end_src ** Parenthesis :ARNAUD: #+begin_src emacs-lisp :tangle init.el (load-library "paren") (show-paren-mode 1) (transient-mark-mode t) (require 'paren) #+end_src ** Asking for confirmation concisely: :WEB: Link: http://org.ryuslash.org/dotfiles/emacs/init.html#sec-7-1 Being asked to type in yes explicitly all the time gets very tedious. I understand that it is safer since y is much easier to type in accidentally than yes and so the potential to say yes to things you don't want is there, but I haven't had any such problems yet. #+begin_src emacs-lisp :tangle init.el (defalias 'yes-or-no-p 'y-or-n-p) #+end_src ** Add the line numbers on the left :LOUIS: Add the number lines on the left side when Org mode is active #+begin_src emacs-lisp :tangle init.el (add-hook 'org-mode-hook 'display-line-numbers-mode) #+end_src * Shortcuts: ** UTF 8 by default :ARNAUD: #+begin_src emacs-lisp :tangle init.el (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) (prefer-coding-system 'utf-8) #+end_src ** Keyboard fix for Mac OS X users... :ADRIEN: Thanks to Adrien Lebre for providing me with this =ns-use-mac-modifier-symbols= thing. Unfortunately, this is broken at the moment (I tried to wrap the command around the cond but it should fail on mac). #+begin_src emacs-lisp :tangle init.el (setq ns-command-modifier 'meta ; Apple/Command key is Meta ns-alternate-modifier nil ; Option is the Mac Option key ns-use-mac-modifier-symbols nil ; display standard Emacs (and not standard Mac) modifier symbols ) #+end_src ** CUA mode a.k.a =C-x, C-c, C-v= Yuck! Many people like this but I hate it as it conflicts with some of my other shortcuts (e.g., the ones for spelling a region). #+begin_src emacs-lisp :tangle init.el ;; (cua-mode t) to activate #+end_src ** Navigate back in text :ARNAUD:noexport: #+begin_src emacs-lisp (defun jump-mark () (interactive) (set-mark-command (point))) (defun beginning-of-defun-and-mark () (interactive) (push-mark (point)) (beginning-of-defun)) (defun end-of-defun-and-mark () (interactive) (push-mark (point)) (end-of-defun)) (global-set-key "\^c\^b" 'beginning-of-defun-and-mark) (global-set-key "\^c\^e" 'end-of-defun-and-mark) (global-set-key "\^c\^j" 'jump-mark) (global-set-key [S-f6] 'jump-mark) ;; jump from mark to mark #+end_src ** Goto line :ARNAUD: #+begin_src emacs-lisp :tangle init.el (global-set-key "\M-g" 'goto-line) #+end_src ** Increase/decrease text size in emacs :WEB: #+begin_src emacs-lisp :tangle init.el (global-set-key (kbd "C-+") 'text-scale-increase) (global-set-key (kbd "C--") 'text-scale-decrease) ;; C-x C-0 restores the default font size #+end_src [11:26:47; 18.04.2014] ** Add spell checker to the file :WEB: #+begin_src emacs-lisp :tangle init.el ;; Inspired from http://tex.stackexchange.com/questions/166681/changing-language-of-flyspell-emacs-with-a-shortcut ;; (defun spell (choice) ;; "Switch between language dictionaries." ;; (interactive "cChoose: (a) American | (f) Francais") ;; (cond ((eq choice ?1) ;; (setq flyspell-default-dictionary "american") ;; (setq ispell-dictionary "american") ;; (ispell-kill-ispell)) ;; ((eq choice ?2) ;; (setq flyspell-default-dictionary "francais") ;; (setq ispell-dictionary "francais") ;; (ispell-kill-ispell)) ;; (t (message "No changes have been made."))) ) (define-key global-map (kbd "C-c s a") (lambda () (interactive) (ispell-change-dictionary "american"))) (define-key global-map (kbd "C-c s f") (lambda () (interactive) (ispell-change-dictionary "francais"))) (define-key global-map (kbd "C-c s r") 'flyspell-region) (define-key global-map (kbd "C-c s b") 'flyspell-buffer) (define-key global-map (kbd "C-c s s") 'flyspell-mode) #+end_src ** Reload buffer :ARNAUD: #+begin_src emacs-lisp :tangle init.el (global-set-key [f5] '(lambda () (interactive) (revert-buffer nil t nil))) #+end_src ** Invoke magit (for git) :WEB: From http://magit.vc/manual/magit.pdf #+begin_src emacs-lisp :tangle init.el (global-set-key (kbd "C-x g") 'magit-status) (global-set-key (kbd "C-x M-g") 'magit-dispatch-popup) ;; (global-magit-file-mode 1) #+end_src * Small fixes for LaTeX: ** PDF with LaTeX by default :ARNAUD: #+begin_src emacs-lisp :tangle init.el (defun auto-fill-mode-on () (TeX-PDF-mode 1)) (add-hook 'tex-mode-hook 'TeX-PDF-mode-on) (add-hook 'latex-mode-hook 'TeX-PDF-mode-on) (setq TeX-PDF-mode t) #+end_src ** Auto-fill-mode #+begin_src emacs-lisp :tangle init.el (defun auto-fill-mode-on () (auto-fill-mode 1)) (add-hook 'text-mode-hook 'auto-fill-mode-on) (add-hook 'emacs-lisp-mode 'auto-fill-mode-on) (add-hook 'tex-mode-hook 'auto-fill-mode-on) (add-hook 'latex-mode-hook 'auto-fill-mode-on) #+end_src * Org-mode convenient configuration ** Default directory #+begin_src emacs-lisp :tangle init.el (setq org-directory "~/org/") #+end_src ** Cosmetics #+begin_src emacs-lisp :tangle init.el (setq org-hide-leading-stars t) (setq org-alphabetical-lists t) (setq org-src-fontify-natively t) ;; you want this to activate coloring in blocks (setq org-src-tab-acts-natively t) ;; you want this to have completion in blocks (setq org-hide-emphasis-markers t) ;; to hide the *,=, or / markers (setq org-pretty-entities t) ;; to have \alpha, \to and others display as utf8 http://orgmode.org/manual/Special-symbols.html #+end_src ** Agenda *** Add short cut keys for the org-agenda :ARNAUD: #+begin_src emacs-lisp :tangle init.el (global-set-key "\C-cl" 'org-store-link) (global-set-key "\C-cc" 'org-capture) (global-set-key (kbd "C-c a") 'org-agenda) (define-key global-map "\C-cl" 'org-store-link) (define-key global-map (kbd "C-c a") 'org-agenda) (global-set-key "\C-cb" 'org-iswitchb) (setq org-default-notes-file "~/org/notes.org") (define-key global-map "\C-cd" 'org-capture) (setq org-capture-templates (quote (("t" "Todo" entry (file+headline "~/org/liste.org" "Tasks") "* TODO %? %i %a" :prepend t) ("j" "Journal" entry (file+datetree "~/org/journal.org") "* %? Entered on %U %i %a")))) #+end_src #+RESULTS: | t | Todo | entry | (file+headline ~/org/liste.org Tasks) | * TODO %?\n %i\n %a | :prepend | t | | j | Journal | entry | (file+datetree ~/org/journal.org) | * %?\nEntered on %U\n %i\n %a | | | *** Agenda config :ARNAUD: #+begin_src emacs-lisp :tangle init.el (setq org-agenda-include-all-todo t) (setq org-agenda-include-diary t) ;; Adding the ~/org directory to the list of directories to scan (setq org-agenda-files '("~/org")) #+end_src * Org-mode shortcuts ** Adding date with brackets with command "C-c d": :LUKA: #+begin_src emacs-lisp :tangle init.el (global-set-key (kbd "C-c d") 'insert-date) (defun insert-date (prefix) "Insert the current date. With prefix-argument, use ISO format. With two prefix arguments, write out the day and month name." (interactive "P") (let ((format (cond ((not prefix) "** %Y-%m-%d") ((equal prefix '(4)) "[%Y-%m-%d]")))) (insert (format-time-string format)))) #+end_src [16:34:01; 24.04.2013] ** Adding date with command "C-c t": :LUKA: #+begin_src emacs-lisp :tangle init.el (global-set-key (kbd "C-c t") 'insert-time-date) (defun insert-time-date (prefix) "Insert the current date. With prefix-argument, use ISO format. With two prefix arguments, write out the day and month name." (interactive "P") (let ((format (cond ((not prefix) "[%H:%M:%S; %d.%m.%Y]") ((equal prefix '(4)) "[%H:%M:%S; %Y-%m-%d]")))) (insert (format-time-string format)))) #+end_src [16:34:15; 24.04.2013] ** Org-store-link: :ARNAUD: #+begin_src emacs-lisp :tangle init.el (global-set-key (kbd "C-c l") 'org-store-link) #+end_src ** Navigating through org-mode: Additional shortcuts for navigating through org-mode documents: #+begin_src emacs-lisp :tangle init.el (global-set-key (kbd "C-c ") 'outline-up-heading) (global-set-key (kbd "C-c ") 'outline-previous-visible-heading) (global-set-key (kbd "C-c ") 'outline-next-visible-heading) #+end_src ** Toggling the visibility of emphasis markers :LOUIS: Sourced from [[https://stackoverflow.com/questions/10969617/hiding-markup-elements-in-org-mode]["Hiding markup Elements" on StackOverflow]] #+begin_src emacs-lisp :tangle init.el (defun org-toggle-emphasis () "Toggle hiding/showing of org emphasize markers." (interactive) (if org-hide-emphasis-markers (set-variable 'org-hide-emphasis-markers nil) (set-variable 'org-hide-emphasis-markers t)) (org-mode-restart)) (define-key org-mode-map (kbd "C-c e") 'org-toggle-emphasis) #+end_src * Org-mode + babel: ** Seamless use of babel (no confirmation, lazy export) :ARNAUD: #+begin_src emacs-lisp :tangle init.el ;; In org-mode 9 you need to have #+PROPERTY: header-args :eval never-export ;; in the beginning or your document to tell org-mode not to evaluate every ;; code block every time you export. (setq org-confirm-babel-evaluate nil) ;; Do not ask for confirmation all the time!! #+end_src ** Some initial languages we want org-babel to support: :ARNAUD: #+begin_src emacs-lisp :tangle init.el (org-babel-do-load-languages 'org-babel-load-languages '( (emacs-lisp . t) (shell . t) (python . t) (R . t) (ruby . t) (ocaml . t) (ditaa . t) (dot . t) (octave . t) (sqlite . t) (perl . t) (screen . t) (plantuml . t) (lilypond . t) (org . t) (makefile . t) )) (setq org-src-preserve-indentation t) #+end_src ** Adding source code blocks: :LUKA: *** Enable the old template system with Orgmode 9.2 and later #+begin_src emacs-lisp :tangle init.el (setq rrmooc/new-org-templates (version<= "9.2" (org-version))) (when rrmooc/new-org-templates (require 'org-tempo)) #+end_src *** Template definitions that work with the old and new templating systems #+begin_src emacs-lisp :tangle init.el (require 'subr-x) (defun rrmooc/add-org-template (old-style-template) (add-to-list 'org-structure-template-alist (if rrmooc/new-org-templates (cons (first old-style-template) (string-trim-right (substring (second old-style-template) 8 -9))) old-style-template))) #+end_src *** With capital letters: To use this type \n\n"))) #+end_src *** Emacs-elisp code: To use this type \n\n")) #+end_src *** R code: To use this type \n\n")) #+end_src To use this type \n\n")) #+end_src To use this type \n\n")) #+end_src *** Python code To use this type

\n\n")) #+end_src #+begin_src emacs-lisp :tangle init.el (rrmooc/add-org-template '("P" "#+begin_src python :results output :session :exports both\n\n#+end_src" "\n\n")) #+end_src #+begin_src emacs-lisp :tangle init.el (rrmooc/add-org-template '("PP" "#+begin_src python :results file :session :var matplot_lib_filename=(org-babel-temp-file \"figure\" \".png\") :exports both\nimport matplotlib.pyplot as plt\n\nimport numpy\nx=numpy.linspace(-15,15)\nplt.figure(figsize=(10,5))\nplt.plot(x,numpy.cos(x)/x)\nplt.tight_layout()\n\nplt.savefig(matplot_lib_filename)\nmatplot_lib_filename\n#+end_src" "\n\n")) #+end_src *** Bash "sh" code: To use this type \n\n")) (rrmooc/add-org-template '("b" "#+begin_src shell :results output :exports both\n\n#+end_src" "\n\n"))) #+end_src To use this type \n\n")) #+end_src *** Graphviz #+begin_src emacs-lisp :tangle init.el (rrmooc/add-org-template '("g" "#+begin_src dot :results output graphics :file \"/tmp/graph.pdf\" :exports both digraph G { node [color=black,fillcolor=white,shape=rectangle,style=filled,fontname=\"Helvetica\"]; A[label=\"A\"] B[label=\"B\"] A->B }\n#+end_src" "\n\n")) #+end_src ** Evaluating whole subtree: :LUKA: #+begin_src emacs-lisp :tangle init.el (global-set-key (kbd "C-c S-t") 'org-babel-execute-subtree) #+end_src ** Display images :ARNAUD: #+begin_src emacs-lisp :tangle init.el (add-hook 'org-babel-after-execute-hook 'org-display-inline-images) (add-hook 'org-mode-hook 'org-display-inline-images) (add-hook 'org-mode-hook 'org-babel-result-hide-all) #+end_src ** Optimizing Python execution *** Don't use readline completion This often fails, yielding an ugly warning, and isn't of any use in Org-mode anyway #+begin_src emacs-lisp :tangle init.el (setq python-shell-completion-native-enable nil) #+end_src * Custom Louis :LOUIS: ** Installing wanted packages #+begin_src emacs-lisp :tangle init.el (let* ((wanted-packages '(flycheck ; grammar flycheck-grammalecte ; grammar company ; auto-complete org-appear ; org emphasis appear org-fragtog ; see latex fragment in org use-package eglot ; LSP client counsel ; ivy autocomplete for M-x eldoc-box ; adding popup for eldoc powerline ; A cool powerline )) (missing-wanted-packages (remove-if #'package-installed-p wanted-packages))) (when missing-wanted-packages (message "Missing wanted packages: %s" missing-wanted-packages) (package-refresh-contents) (dolist (pkg missing-wanted-packages) (package-install pkg) (message "Wanted package %s has been installed" pkg)))) #+end_src #+begin_src emacs-lisp ; :tangle init.el ;; Install straight.el (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) (with-current-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) #+end_src ** Powerline #+begin_src emacs-lisp :tangle init.el (require 'powerline) (powerline-default-theme) #+end_src ** Disabling auto-fill-mode when using org This snippet disables the auto-fill-mode which wraps the line when it exceeds a certain length #+begin_src emacs-lisp :tangle init.el ;; When loading org-mode turns off auto-fill-mode (add-hook 'org-mode-hook 'turn-off-auto-fill) #+end_src ** Activating org-appear minor mode This mode makes the emphasis markers appear when the cursor is on it #+begin_src emacs-lisp :tangle init.el (add-hook 'org-mode-hook 'org-appear-mode) #+end_src ** Visual line mode activated on startup #+begin_src emacs-lisp :tangle init.el (global-visual-line-mode 1) ; 1 for on & 0 for off #+end_src ** Auto toggle the preview of LaTeX fragments #+begin_src emacs-lisp :tangle init.el (add-hook 'org-mode-hook 'org-fragtog-mode) #+end_src ** Remote image display :disabled: This code was taken from https://emacs.stackexchange.com/questions/42281/org-mode-is-it-possible-to-display-online-images and makes use of the =org-yt= package. #+begin_src emacs-lisp (require 'org-yt) (defun org-image-link (protocol link _description) "Interpret LINK as base64-encoded image data." (cl-assert (string-match "\\`img" protocol) nil "Expected protocol type starting with img") (let ((buf (url-retrieve-synchronously (concat (substring protocol 3) ":" link)))) (cl-assert buf nil "Download of image \"%s\" failed." link) (with-current-buffer buf (goto-char (point-min)) (re-search-forward "\r?\n\r?\n") (buffer-substring-no-properties (point) (point-max))))) (org-link-set-parameters "imghttp" :image-data-fun #'org-image-link) (org-link-set-parameters "imghttps" :image-data-fun #'org-image-link) #+end_src ** Global enable Company-mode :completion: #+begin_src emacs-lisp :tangle init.el (global-company-mode) #+end_src ** Ivy for Emacs command completion #+begin_src emacs-lisp :tangle init.el (ivy-mode 1) (setq ivy-use-virtual-buffers t) (setq ivy-count-format "(%d/%d) ") #+end_src ** LSP and other IDE features *** Enabling eglot and adding ess-mode lsp Language Server Protocol (LSP) provides intellisense completion and other nice features of VS Code. #+begin_src emacs-lisp :tangle init.el ; Enables LSP for the provided languages (require 'use-package) (use-package eglot :defer t :commands (eglot eglot-ensure) :hook ((ess-mode . eglot-ensure)) :config (setq eglot-stay-out-of '(company)) ;(add-to-list 'eglot-server-programs '((c-mode c++-mode) "clangd-10")) ) (with-eval-after-load 'eglot (add-to-list 'eglot-server-programs '(ess-mode . ("R" "--slave" "-e" "languageserver::run()")))) #+end_src *** Floating pop-up for eldoc #+begin_src emacs-lisp :tangle init.el (require 'eldoc-box) (add-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode t) #+end_src ** Treemacs :disabled: #+begin_src emacs-lisp ;:tangle init.el (use-package treemacs :ensure t :defer t :init (with-eval-after-load 'winum (define-key winum-keymap (kbd "M-0") #'treemacs-select-window)) :config (progn (setq treemacs-collapse-dirs (if treemacs-python-executable 3 0) treemacs-deferred-git-apply-delay 0.5 treemacs-directory-name-transformer #'identity treemacs-display-in-side-window t treemacs-eldoc-display 'simple treemacs-file-event-delay 2000 treemacs-file-extension-regex treemacs-last-period-regex-value treemacs-file-follow-delay 0.2 treemacs-file-name-transformer #'identity treemacs-follow-after-init t treemacs-expand-after-init t treemacs-find-workspace-method 'find-for-file-or-pick-first treemacs-git-command-pipe "" treemacs-goto-tag-strategy 'refetch-index treemacs-header-scroll-indicators '(nil . "^^^^^^") treemacs-hide-dot-git-directory t treemacs-indentation 2 treemacs-indentation-string " " treemacs-is-never-other-window nil treemacs-max-git-entries 5000 treemacs-missing-project-action 'ask treemacs-move-forward-on-expand nil treemacs-no-png-images nil treemacs-no-delete-other-windows t treemacs-project-follow-cleanup nil treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory) treemacs-position 'left treemacs-read-string-input 'from-child-frame treemacs-recenter-distance 0.1 treemacs-recenter-after-file-follow nil treemacs-recenter-after-tag-follow nil treemacs-recenter-after-project-jump 'always treemacs-recenter-after-project-expand 'on-distance treemacs-litter-directories '("/node_modules" "/.venv" "/.cask") treemacs-project-follow-into-home nil treemacs-show-cursor nil treemacs-show-hidden-files t treemacs-silent-filewatch nil treemacs-silent-refresh nil treemacs-sorting 'alphabetic-asc treemacs-select-when-already-in-treemacs 'move-back treemacs-space-between-root-nodes t treemacs-tag-follow-cleanup t treemacs-tag-follow-delay 1.5 treemacs-text-scale nil treemacs-user-mode-line-format nil treemacs-user-header-line-format nil treemacs-wide-toggle-width 70 treemacs-width 35 treemacs-width-increment 1 treemacs-width-is-initially-locked t treemacs-workspace-switch-cleanup nil) ;; The default width and height of the icons is 22 pixels. If you are ;; using a Hi-DPI display, uncomment this to double the icon size. ;;(treemacs-resize-icons 44) (treemacs-follow-mode t) (treemacs-filewatch-mode t) (treemacs-fringe-indicator-mode 'always) (when treemacs-python-executable (treemacs-git-commit-diff-mode t)) (pcase (cons (not (null (executable-find "git"))) (not (null treemacs-python-executable))) (`(t . t) (treemacs-git-mode 'deferred)) (`(t . _) (treemacs-git-mode 'simple))) (treemacs-hide-gitignored-files-mode nil)) :bind (:map global-map ("M-0" . treemacs-select-window) ("C-x t 1" . treemacs-delete-other-windows) ("C-x t t" . treemacs) ("C-x t d" . treemacs-select-directory) ("C-x t B" . treemacs-bookmark) ("C-x t C-t" . treemacs-find-file) ("C-x t M-t" . treemacs-find-tag))) (use-package treemacs-evil :after (treemacs evil) :ensure t) (use-package treemacs-projectile :after (treemacs projectile) :ensure t) (use-package treemacs-icons-dired :hook (dired-mode . treemacs-icons-dired-enable-once) :ensure t) (use-package treemacs-magit :after (treemacs magit) :ensure t) (use-package treemacs-persp ;;treemacs-perspective if you use perspective.el vs. persp-mode :after (treemacs persp-mode) ;;or perspective vs. persp-mode :ensure t :config (treemacs-set-scope-type 'Perspectives)) (use-package treemacs-tab-bar ;;treemacs-tab-bar if you use tab-bar-mode :after (treemacs) :ensure t :config (treemacs-set-scope-type 'Tabs)) #+end_src * Theme ** Activation du thème #+begin_src emacs-lisp :tangle init.el (load-theme 'leuven t) #+end_src