From 1a7119fffc3d89e82406c4b29929025bc5a1193e Mon Sep 17 00:00:00 2001 From: Alexandre Tuleu Date: Tue, 18 Jan 2022 11:18:38 +0100 Subject: [PATCH] Refactors .emacs --- .emacs | 327 ++++++++++++++++++--------------------------------------- 1 file changed, 105 insertions(+), 222 deletions(-) diff --git a/.emacs b/.emacs index 1645274..068da08 100644 --- a/.emacs +++ b/.emacs @@ -1,45 +1,16 @@ - -(global-set-key (kbd "M-p") 'backward-paragraph) -(global-set-key (kbd "M-n") 'forward-paragraph) - - (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") (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. - '(ansi-color-faces-vector - [default bold shadow italic underline bold bold-italic bold]) - '(ansi-color-names-vector - (vector "#eaeaea" "#d54e53" "DarkOliveGreen3" "#e7c547" "DeepSkyBlue1" "#c397d8" "#70c0b1" "#181a26")) - '(c-default-style - (quote - ((c++-mode . "tuleu-c++") - (java-mode . "java") - (awk-mode . "awk") - (other . "gnu")))) '(company-idle-delay 20.0) - '(company-quickhelp-color-background "#4F4F4F") - '(company-quickhelp-color-foreground "#DCDCCC") - '(compilation-scroll-output (quote first-error)) - '(custom-safe-themes - (quote - ("842bf45f64e12795d4b8dcc9a30c1b5396b7794b12cedd81fd4531193b864872" "2540689fd0bc5d74c4682764ff6c94057ba8061a98be5dd21116bf7bf301acfb" "cdb4ffdecc682978da78700a461cdc77456c3a6df1c1803ae2dd55c59fa703e3" "332fcf3c7208aca9fab65d54203f78a242482e7fd65f5725a2482c20b1730732" "c7f10959cb1bc7a36ee355c765a1768d48929ec55dde137da51077ac7f899521" "c9ddf33b383e74dac7690255dd2c3dfa1961a8e8a1d20e401c6572febef61045" "bf798e9e8ff00d4bf2512597f36e5a135ce48e477ce88a0764cfb5d8104e8163" "36ca8f60565af20ef4f30783aa16a26d96c02df7b4e54e9900a5138fb33808da" "2a7beed4f24b15f77160118320123d699282cbf196e0089f113245d4b729ba5d" default))) '(display-line-numbers-type t) - '(fci-rule-color "#14151E") '(global-auto-revert-mode t) '(global-display-line-numbers-mode t) '(gofmt-command "goimports") '(inhibit-startup-screen t) - '(linum-format "%03d ") '(magit-revert-buffers (quote silent) t) - '(markdown-css-paths - (quote - ("file:///home/tuleu/.config/markdown/css/retro.css"))) - '(nrepl-message-colors - (quote - ("#CC9393" "#DFAF8F" "#F0DFAF" "#7F9F7F" "#BFEBBF" "#93E0E3" "#94BFF3" "#DC8CC3"))) '(org-agenda-files (quote ("~/org/1.TODO.org"))) '(package-archives (quote @@ -51,73 +22,14 @@ '(pdf-view-midnight-colors (quote ("#DCDCCC" . "#383838"))) '(safe-local-variable-values (quote - ((TeX-master . "../../../main_fr.tex") - (TeX-master . "../../../main_fr") - (TeX-master . "../../../main_en") - (TeX-master . t) - (cmake-ide-build-dir . "/home/tuleu/devel/formicidae-tracker/fort-studio/build") - (cmake-ide-project-dir . "/home/tuleu/devel/formicidae-tracker/fort-studio") - (eval progn - (let - ((project-root-directory - (when buffer-file-name - (locate-dominating-file buffer-file-name ".dir-locals.el"))))) - (when project-root-directory - (setq compile-command - (concat "make -j 7 -C " project-root-directory)))) - (irony-additional-clang-options concat - (locate-dominating-file buffer-file-name ".dir-locals.el") - "/src") + ((TeX-master . t) (TeX-parse-self . t) - (compile-command concat "make -C " - (locate-dominating-file buffer-file-name ".dir-locals.el") - "/build all check doc") - (compile-command concat "make -C " - (locate-dominating-file buffer-file-name ".dir-locals.el") - "/build -j 7 all") - (compile-command concat "make -C " - (locate-dominating-file buffer-file-name ".dir-locals.el") - "/build") - (compile-command concat "make -C " - (locate-dominating-file buffer-file-name ".dir-locals.el") - "/build-trusty") - (compile-command concat "make -C " - (locate-dominating-file buffer-file-name ".dir-locals.el") - "/build -j 7") - (compile-command concat "make -C " - (locate-dominating-file buffer-file-name ".dir-locals.el") - "/build -j 7 check") - (compile-command concat "make -C " - (locate-dominating-file buffer-file-name ".dir-locals.el") - "/build -j 7 all check") - (compile-command concat "make -C " - (locate-dominating-file buffer-file-name ".dir-locals.el"))))) + ))) '(srefactor--getter-prefix "Get") '(srefactor--getter-setter-capitalize-p t) '(srefactor--setter-prefix "Set") '(tab-width 4) - '(vc-annotate-background nil) - '(vc-annotate-color-map - (quote - ((20 . "#d54e53") - (40 . "goldenrod") - (60 . "#e7c547") - (80 . "DarkOliveGreen3") - (100 . "#70c0b1") - (120 . "DeepSkyBlue1") - (140 . "#c397d8") - (160 . "#d54e53") - (180 . "goldenrod") - (200 . "#e7c547") - (220 . "DarkOliveGreen3") - (240 . "#70c0b1") - (260 . "DeepSkyBlue1") - (280 . "#c397d8") - (300 . "#d54e53") - (320 . "goldenrod") - (340 . "#e7c547") - (360 . "DarkOliveGreen3")))) - '(vc-annotate-very-old-color nil)) + ) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. @@ -137,37 +49,39 @@ '(whitespace-space-after-tab ((t (:foreground "firebrick")))) '(whitespace-tab ((t (:foreground "color-237"))))) - (add-to-list 'auto-mode-alist '("\\.m$" . octave-mode )) (toggle-scroll-bar -1) (menu-bar-mode -1) (tool-bar-mode -1) (add-to-list 'default-frame-alist '(fullscreen . maximized)) -(set-face-attribute 'default nil :height 70) -;;(setq package-enable-at-startup nil) -;;(package-initialize) -;; (require 'auto-complete) -;; (require 'auto-complete-config) - -;; (if (getenv "GOPATH") -;; (progn -;; (require 'go-autocomplete) -;; (add-to-list 'load-path (concat (getenv "GOPATH") "/src/github.com/golang/lint/misc/emacs")) -;; (require 'golint) -;; ) -;; () -;; ) - -;; (ac-config-default) - -;; (define-key ac-mode-map (kbd "M-TAB") 'auto-complete) -;; (setq ac-auto-start nil) - +(add-hook 'before-save-hook 'delete-trailing-whitespace) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Keymap +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (global-set-key (kbd "") 'compile) +(global-set-key (kbd "C-x g") 'magit-status) -;;(require 'codyn-mode) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Company +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defun my-company-mode-hook () + (global-set-key (kbd "C-M-i") 'company-complete)) +(add-hook 'company-mode-hook 'my-company-mode-hook) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CMake +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun my-cmake-mode-hook () + (company-mode) + ) +(add-hook 'cmake-mode-hook 'my-cmake-mode-hook) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; C/C++ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun c-c++-header () "sets either c-mode or c++-mode, whichever is appropriate for @@ -179,62 +93,6 @@ header" (c++-mode)))) (add-to-list 'auto-mode-alist '("\\.h\\'" . c-c++-header)) - -(require 'iso-transl) - - -;; (require 'hideshow) -;; (require 'sgml-mode) -;; (require 'nxml-mode) -;; (add-to-list 'hs-special-modes-alist -;; '(nxml-mode -;; "\\|]*[^/]>" - -;; "