251 lines
7.4 KiB
EmacsLisp
251 lines
7.4 KiB
EmacsLisp
;; Made by Julien Palard <julien@palard.fr>
|
|
;;
|
|
;; Started on Sun Nov 16 12:00:18 2008 Julien Palard
|
|
;;
|
|
;; Packages I typically use can be reinstalled by using:
|
|
;; M-x package-install-selected-packages
|
|
;;
|
|
;; To gather tags, according to emacs doc:
|
|
;;
|
|
;; find . -name "*.[chCH]" -print | etags -
|
|
|
|
|
|
(setq user-full-name "Julien Palard"
|
|
user-mail-address "julien@palard.fr")
|
|
(require 'use-package)
|
|
(require 'package)
|
|
(package-initialize)
|
|
(server-start)
|
|
(setq exec-path (append exec-path '("/home/mdk/.local/bin")))
|
|
|
|
(setenv "PATH" ; This is so blacken-mode can find black in ~/.local/bin/
|
|
(concat
|
|
(getenv "PATH") path-separator
|
|
(getenv "HOME") "/.local/bin/"
|
|
))
|
|
|
|
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
|
|
("org" . "https://orgmode.org/elpa/")
|
|
("melpa" . "https://melpa.org/packages/")))
|
|
|
|
;; If there are no archived package contents, refresh them
|
|
(when (not package-archive-contents)
|
|
(package-refresh-contents))
|
|
|
|
|
|
(use-package yasnippet-snippets
|
|
:load-path "~/clones/yasnippet-snippets"
|
|
)
|
|
|
|
(use-package ox-latex
|
|
:config
|
|
(add-to-list 'org-latex-classes
|
|
'("lettre"
|
|
"\\documentclass[french,a4paper]{lettre}"
|
|
("\\section{%s}" . "\\section*{%s}")
|
|
("\\subsection{%s}" . "\\subsection*{%s}")
|
|
("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
|
|
)
|
|
|
|
(use-package direnv
|
|
:ensure t
|
|
:config
|
|
(direnv-mode))
|
|
|
|
(use-package flycheck-grammalecte
|
|
:ensure t
|
|
:config
|
|
(flycheck-grammalecte-setup)
|
|
(setq flycheck-global-modes '(not org-mode))
|
|
)
|
|
|
|
(use-package diminish
|
|
:ensure t)
|
|
|
|
(use-package magit
|
|
:ensure t)
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
(use-package lsp-mode
|
|
:ensure t
|
|
:init
|
|
(setq lsp-keymap-prefix "C-c p")
|
|
:custom
|
|
(lsp-jedi-hover-disable-keyword-all t)
|
|
(lsp-signature-doc-lines 1)
|
|
(lsp-diagnostics-provider :none)
|
|
(lsp-jedi-pylsp-extra-paths [])
|
|
(lsp-keymap-prefix "C-c x")
|
|
:config
|
|
(set-face-attribute 'lsp-face-highlight-textual nil
|
|
:background "#666" :foreground "#ffffff"
|
|
)
|
|
:hook ((python-mode) . lsp)
|
|
:commands lsp-mode
|
|
)
|
|
|
|
(use-package python
|
|
:custom
|
|
(python-indent-guess-indent-offset nil)
|
|
)
|
|
|
|
(use-package lsp-ui
|
|
:ensure t)
|
|
|
|
(use-package lsp-jedi
|
|
:ensure t
|
|
:after lsp-mode
|
|
:config
|
|
(with-eval-after-load "lsp-mode"
|
|
(add-to-list 'lsp-disabled-clients 'pyls)
|
|
))
|
|
|
|
;; Test using flycheck-verify-setup
|
|
(use-package flycheck
|
|
:ensure t
|
|
:after lsp-mode
|
|
:config
|
|
(global-flycheck-mode t))
|
|
|
|
(use-package blacken
|
|
:ensure t
|
|
:commands (blacken-mode)
|
|
:hook (python-mode . blacken-mode)
|
|
:config
|
|
(setq blacken-only-if-project-is-blackened t))
|
|
|
|
(use-package org-bullets
|
|
:ensure t
|
|
:init (add-hook 'org-mode-hook 'org-bullets-mode))
|
|
|
|
(add-hook 'org-mode-hook
|
|
(lambda() (setq header-line-format
|
|
'(:eval (org-display-outline-path nil t " > " t)))))
|
|
|
|
|
|
;; Disable transient mark mode, I don't like it:
|
|
(transient-mark-mode nil)
|
|
|
|
;; Coding style
|
|
(setq-default indent-tabs-mode nil
|
|
tab-width 4
|
|
py-indent-offset 4
|
|
)
|
|
|
|
;; Don't show trailing whitespaces in term-mode
|
|
(add-hook 'term-mode-hook
|
|
(lambda() (make-local-variable 'show-trailing-whitespace)
|
|
(setq show-trailing-whitespace nil)))
|
|
|
|
(global-font-lock-mode t)
|
|
(column-number-mode t)
|
|
(show-paren-mode t)
|
|
|
|
(global-set-key "\C-cc" 'compile)
|
|
(global-set-key "\M-n" 'forward-paragraph)
|
|
(global-set-key "\M-p" 'backward-paragraph)
|
|
(global-set-key "\C-xrv" 'list-registers)
|
|
(global-set-key (kbd "M-h") 'backward-kill-word)
|
|
(global-set-key "\C-cj" 'windmove-left)
|
|
(global-set-key "\C-ck" 'windmove-down)
|
|
(global-set-key "\C-cl" 'windmove-up)
|
|
(global-set-key "\C-c;" 'windmove-right)
|
|
(global-set-key "\C-x\M-%" 'query-replace-regexp) ;; As C-M-% is ~impossible to type in a terminal emulator:
|
|
(global-set-key "\C-cl" 'org-store-link)
|
|
(global-set-key "\C-ca" 'org-agenda)
|
|
(global-set-key "\C-cc" 'org-capture)
|
|
(global-set-key "\C-cb" 'org-switchb)
|
|
(global-set-key "\C-\M-v" 'clipboard-yank)
|
|
|
|
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
|
|
|
(setq version-control t ; (for backup files)
|
|
mouse-yank-at-point t
|
|
solarized-high-contrast-mode-line t
|
|
inhibit-startup-message t
|
|
make-backup-files t
|
|
backup-directory-alist (quote ((".*" . "~/.emacs.d/backup/")))
|
|
)
|
|
|
|
;; Save all backup file in this directory.
|
|
(setq-default delete-old-versions t)
|
|
|
|
(fset 'yes-or-no-p 'y-or-n-p)
|
|
|
|
(setq-default truncate-partial-width-windows nil)
|
|
|
|
(menu-bar-mode -1)
|
|
|
|
(use-package whitespace
|
|
:diminish (whitespace-mode global-whitespace-mode whitespace-newline-mode)
|
|
:hook ((python-mode) . whitespace-mode)
|
|
:config
|
|
(setq show-trailing-whitespace t)
|
|
(setq whitespace-line-column 88)
|
|
(setq whitespace-style '(face empty tabs lines-tail trailing))
|
|
)
|
|
|
|
|
|
;; hex color
|
|
(defvar hexcolour-keywords
|
|
'(("#[a-fA-F[:digit:]]\\{3,6\\}"
|
|
(0 (let ((colour (match-string-no-properties 0)))
|
|
(if (or (= (length colour) 4)
|
|
(= (length colour) 7))
|
|
(put-text-property
|
|
(match-beginning 0)
|
|
(match-end 0)
|
|
'face (list :background (match-string-no-properties 0)
|
|
:foreground (if (>= (apply '+ (x-color-values
|
|
(match-string-no-properties 0)))
|
|
(* (apply '+ (x-color-values "white")) .6))
|
|
"black" ;; light bg, dark text
|
|
"white" ;; dark bg, light text
|
|
)))))
|
|
append))))
|
|
|
|
|
|
(defun hexcolour-add-to-font-lock ()
|
|
(interactive)
|
|
(font-lock-add-keywords nil hexcolour-keywords t))
|
|
|
|
(add-hook 'css-mode-hook 'hexcolour-add-to-font-lock)
|
|
(add-hook 'sass-mode-hook 'hexcolour-add-to-font-lock)
|
|
(add-hook 'emacs-lisp-mode-hook 'hexcolour-add-to-font-lock)
|
|
(add-hook 'conf-xdefaults-mode-hook 'hexcolour-add-to-font-lock)
|
|
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
|
;; (add-hook 'after-init-hook 'global-company-mode) je teste de desactiver ça pour l'infobulle chiante
|
|
|
|
(yas-global-mode 1)
|
|
|
|
(setq org-directory "~/Org")
|
|
(setq org-default-notes-file "~/Org/tasks.org")
|
|
|
|
(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.
|
|
'(auth-source-save-behavior nil)
|
|
'(c-basic-offset 4)
|
|
'(frame-background-mode 'dark)
|
|
'(icomplete-mode t)
|
|
'(org-agenda-files '("/home/mdk/Org/tasks.org" "/home/mdk/Org/julien.org"))
|
|
'(org-agenda-span 'fortnight)
|
|
'(org-modules
|
|
'(ol-bbdb ol-bibtex ol-docview ol-doi ol-eww ol-gnus org-habit ol-info ol-irc ol-mhe ol-rmail ol-w3m))
|
|
'(package-selected-packages
|
|
'(gnuplot-mode org-bullets rust-mode flycheck-grammalecte blacken spacemacs-theme company use-package zenburn-theme markdown-mode org po-mode yaml-mode)))
|
|
|
|
(load-theme 'spacemacs-light t)
|
|
(custom-theme-set-faces
|
|
'spacemacs-light
|
|
'(rst-level-1 ((t (:background "grey15" :foreground "white smoke"))))
|
|
'(rst-level-2 ((t (:background "grey15" :foreground "white smoke"))))
|
|
'(rst-reference ((t (:foreground "white smoke"))))
|
|
)
|
|
(enable-theme 'spacemacs-light)
|
|
(add-to-list 'default-frame-alist '(font . "DejaVuSansMono:size=18"))
|
|
(set-face-attribute 'default t :font "DejaVuSansMono:size=18")
|