From 25622048277dc790225a70c5fb705015afb9bccd Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Fri, 16 Apr 2021 20:49:53 +0100 Subject: [PATCH] fix(emacs): move custom-set-variables out of the init.el This is to stop the generated code from cluttering the init.el and it can now be ignored by git --- site-modules/core/files/emacs/.gitignore | 3 ++- site-modules/core/files/emacs/init.el | 17 ----------------- site-modules/core/files/emacs/src/general.el | 6 ++++++ 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/site-modules/core/files/emacs/.gitignore b/site-modules/core/files/emacs/.gitignore index 88ed1bb..234685e 100644 --- a/site-modules/core/files/emacs/.gitignore +++ b/site-modules/core/files/emacs/.gitignore @@ -2,4 +2,5 @@ elpa etc quelpa var -lsp-cache \ No newline at end of file +lsp-cache +custom.el \ No newline at end of file diff --git a/site-modules/core/files/emacs/init.el b/site-modules/core/files/emacs/init.el index 6c7ad90..de25be2 100644 --- a/site-modules/core/files/emacs/init.el +++ b/site-modules/core/files/emacs/init.el @@ -126,20 +126,3 @@ (unless (server-running-p) (message "Starting a server...") (server-start)) - -(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 default default italic underline success warning error]) - '(doom-modeline-mode t) - '(package-selected-packages - '(string-inflection puppet-mode cue-mode evil-multiedit sh-mode dockerfile-mode docker hide-mode-line vterm browse-at-remote yasnippet yaml-mode which-key web-mode typescript-mode treemacs-projectile treemacs-magit treemacs-evil treemacs-all-the-icons smartparens scss-mode sass-mode rjsx-mode rainbow-delimiters quelpa-use-package prettier-js php-mode no-littering lsp-ui lsp-treemacs lsp-ivy ligature json-mode ivy-rich ivy-prescient general flycheck evil-surround evil-commentary evil-collection emmet-mode doom-themes doom-modeline counsel-projectile counsel-notmuch company-box base16-theme))) -(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. - ) diff --git a/site-modules/core/files/emacs/src/general.el b/site-modules/core/files/emacs/src/general.el index 8f469d5..c7577ad 100644 --- a/site-modules/core/files/emacs/src/general.el +++ b/site-modules/core/files/emacs/src/general.el @@ -59,3 +59,9 @@ (string-to-number (or (match-string 3 name) ""))) ) fn))) files))) + +;; Move the custom variables that are auto generated by emacs into +;; there own file. This will then prevent them from cluttering the +;; init.el and messing put git +(setq custom-file (concat user-emacs-directory "custom.el")) +(load custom-file 'noerror)