From 2cb6ea84615ff63f6c06d1967836cd16d19ebd35 Mon Sep 17 00:00:00 2001 From: Marcus Kammer <2262664-marcuskammer@user.noreply.gitlab.com> Date: Wed, 18 Nov 2020 15:27:56 +0100 Subject: [PATCH] Clean up init file and create default settings --- bundle/bundle--defaults.el | 30 +++++++++++++++++++++++++ bundle/bundle--hooks.el | 18 +++++++++++++++ bundle/bundle--lists.el | 7 ++++++ bundle/custom_win32_EVG02667NB.el | 17 +------------- init.el | 37 +++++-------------------------- 5 files changed, 61 insertions(+), 48 deletions(-) create mode 100644 bundle/bundle--defaults.el create mode 100644 bundle/bundle--hooks.el create mode 100644 bundle/bundle--lists.el diff --git a/bundle/bundle--defaults.el b/bundle/bundle--defaults.el new file mode 100644 index 00000000..33d42d63 --- /dev/null +++ b/bundle/bundle--defaults.el @@ -0,0 +1,30 @@ +(horizontal-scroll-bar-mode 0) +(menu-bar-mode 0) +(scroll-bar-mode 0) +(tool-bar-mode 0) +(show-paren-mode 1) +(global-hl-line-mode 1) + +(put 'narrow-to-region 'disabled nil) +(put 'narrow-to-page 'disabled nil) + +(setq-default indent-tabs-mode nil + inhibit-startup-buffer-menu t + inhibit-startup-screen t + ispell-program-name "aspell" + line-spacing nil + calendar-christian-all-holidays-flag t + calendar-date-style (quote iso) + calendar-view-diary-initially-flag t + calendar-week-start-day 1 + make-backup-files nil + browse-url-browser-function (quote eww-browse-url) + indent-tabs-mode nil + inhibit-startup-buffer-menu t + inhibit-startup-screen t) + + +(setq tab-width 4 + sentence-end-double-space nil + next-line-add-newlines t + require-final-newline 't) diff --git a/bundle/bundle--hooks.el b/bundle/bundle--hooks.el new file mode 100644 index 00000000..3175db77 --- /dev/null +++ b/bundle/bundle--hooks.el @@ -0,0 +1,18 @@ +(add-hook 'diary-display-hook 'fancy-diary-display) +(add-hook 'today-visible-calendar-hook 'calendar-mark-today) +(add-hook 'write-file-hooks 'delete-trailing-whitespace) +(add-hook 'diary-list-entries-hook 'diary-include-other-diary-files) +(add-hook 'diary-mark-entries-hook 'diary-mark-included-diary-files) +(defun me/org-mode () + "My custom configuration for 'org-mode'." + ;(olivetti-mode) + (require 'olivetti) + (olivetti-set-width 82)) +(add-hook 'nov-mode-hook 'me/org-mode) +(add-hook 'org-mode-hook 'turn-on-auto-fill) +(add-hook 'rst-mode-hook 'turn-on-orgstruct) +(add-hook 'newsticker-mode-hook 'imenu-add-menubar-index) +(if (display-graphic-p) + (add-hook 'after-init-hook (lambda () + (org-agenda-list) + (me/split-windows-horizontal)))) diff --git a/bundle/bundle--lists.el b/bundle/bundle--lists.el new file mode 100644 index 00000000..c73fa651 --- /dev/null +++ b/bundle/bundle--lists.el @@ -0,0 +1,7 @@ +(add-to-list 'auto-mode-alist '("\\.tmpl\\'" . web-mode)) +(add-to-list 'auto-mode-alist '("\\.lisp$" . lisp-mode)) +(add-to-list 'auto-mode-alist '("\\.lsp$" . lisp-mode)) +(add-to-list 'auto-mode-alist '("\\.cl$" . lisp-mode)) +(add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode)) +(add-to-list 'auto-mode-alist '("\\.[Cc][Ss][Vv]\\'" . csv-mode)) +(add-to-list 'slime-contribs 'slime-autodoc) diff --git a/bundle/custom_win32_EVG02667NB.el b/bundle/custom_win32_EVG02667NB.el index 283c13a4..547f3167 100644 --- a/bundle/custom_win32_EVG02667NB.el +++ b/bundle/custom_win32_EVG02667NB.el @@ -7,11 +7,6 @@ '(ansi-color-faces-vector [default default default italic underline success warning error]) '(backup-directory-alist (quote (("." . "~/.backup_filez")))) - '(browse-url-browser-function (quote eww-browse-url)) - '(calendar-christian-all-holidays-flag t) - '(calendar-date-style (quote iso)) - '(calendar-view-diary-initially-flag t) - '(calendar-week-start-day 1) '(custom-enabled-themes (quote (nord))) '(custom-safe-themes (quote @@ -33,19 +28,11 @@ (elpy-module-company elpy-module-eldoc elpy-module-flymake elpy-module-pyvenv elpy-module-yasnippet elpy-module-sane-defaults))) '(elpy-test-runner (quote elpy-test-pytest-runner)) '(geiser-default-implementation (quote racket)) - '(global-hl-line-mode t) - '(horizontal-scroll-bar-mode nil) - '(indent-tabs-mode nil) - '(inhibit-startup-buffer-menu t) - '(inhibit-startup-screen t) '(initial-buffer-choice "d:/UserData/marcus.kammer/OneDrive - Siemens AG/documents/Journal/notes.org") '(initial-frame-alist nil) - '(ispell-program-name "aspell") - '(line-spacing nil) '(ls-lisp-dirs-first t) '(make-backup-files nil) - '(menu-bar-mode nil) '(mode-line-format (quote ("-" mode-line-mule-info mode-line-modified mode-line-frame-identification mode-line-buffer-identification " " mode-line-position mode-line-modes @@ -100,9 +87,7 @@ '(projectile-completion-system (quote ivy)) '(python-indent-guess-indent-offset nil) '(python-shell-interpreter "python") - '(ring-bell-function (quote ignore)) - '(scroll-bar-mode nil) - '(tool-bar-mode nil)) + '(ring-bell-function (quote ignore))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/init.el b/init.el index 8355c17f..b3dcf569 100755 --- a/init.el +++ b/init.el @@ -1,4 +1,7 @@ +(require 'cl) + (add-to-list 'load-path (expand-file-name "~/.emacs.d/bundle/")) +(load "bundle--defaults") (load "bundle--server") (load "bundle--package") (load "bundle--customfile") @@ -7,39 +10,9 @@ (load "bundle--holidays") (load "bundle--latex") (load "bundle--mk") +(load "bundle--hooks") +(load "bundle--lists") ;; (load-theme 'nord t) (require 'color-theme-sanityinc-tomorrow) (defalias 'yes-or-no-p 'y-or-n-p) (org-clock-persistence-insinuate) - -;; HOOKS -(add-hook 'diary-display-hook 'fancy-diary-display) -(add-hook 'today-visible-calendar-hook 'calendar-mark-today) -(add-hook 'write-file-hooks 'delete-trailing-whitespace) -(add-hook 'diary-list-entries-hook 'diary-include-other-diary-files) -(add-hook 'diary-mark-entries-hook 'diary-mark-included-diary-files) -(defun me/org-mode () - "My custom configuration for 'org-mode'." - ;(olivetti-mode) - (require 'olivetti) - (olivetti-set-width 82)) -(add-hook 'nov-mode-hook 'me/org-mode) -(add-hook 'org-mode-hook 'turn-on-auto-fill) -(add-hook 'rst-mode-hook 'turn-on-orgstruct) -(add-hook 'newsticker-mode-hook 'imenu-add-menubar-index) -(if (display-graphic-p) - (add-hook 'after-init-hook (lambda () - (org-agenda-list) - (me/split-windows-horizontal)))) - -(add-to-list 'auto-mode-alist '("\\.tmpl\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.lisp$" . lisp-mode)) -(add-to-list 'auto-mode-alist '("\\.lsp$" . lisp-mode)) -(add-to-list 'auto-mode-alist '("\\.cl$" . lisp-mode)) -(add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode)) -(add-to-list 'auto-mode-alist '("\\.[Cc][Ss][Vv]\\'" . csv-mode)) -(add-to-list 'slime-contribs 'slime-autodoc) - - -(put 'narrow-to-region 'disabled nil) -(put 'narrow-to-page 'disabled nil)