summaryrefslogtreecommitdiff
path: root/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'init.el')
-rw-r--r--init.el95
1 files changed, 94 insertions, 1 deletions
diff --git a/init.el b/init.el
index ed4e36a..9d94c06 100644
--- a/init.el
+++ b/init.el
@@ -22,7 +22,7 @@
"The directory to load files")
;;;###autoload
-(defun load-config (file-name)
+(defsubst load-config (file-name)
"Conviently load configuration files in the same directory as this file."
(load-file (expand-file-name file-name load-file-directory)))
@@ -40,12 +40,105 @@
(load-config ,file))
(add-hook ',hook ',entry-name)))
+;;;###autoload
+(defmacro load-after-function (function-name file-path doc redefine-p &rest def)
+ "Load FILE-PATH after FUNCTION-NAME.
+After loading, execute DEF.
+Finally if REDEFINE-P is non-nil,
+then FUNCTION-NAME will be defined as DEF after loading."
+ `(defun ,function-name ()
+ ,doc
+ (interactive)
+ (load-config ,file-path)
+ ,@def
+ ,(cond
+ (redefine-p
+ `(defun ,function-name ()
+ ,doc
+ (interactive)
+ ,@def)))))
+
+(load-config "common.el")
+
(load-config "basic.el")
+(load-config "backup-conf.el")
+
+(load-config "recentf-conf.el")
+
+(load-config "dashboard.el")
+
(load-config "theme.el")
(load-config "modeline.el")
+(add-hook 'emacs-lisp-mode-hook
+ (lambda () (set 'mode-name "ELisp")))
+
(prepare-in-hook-once prepare-elisp emacs-lisp-mode-hook "elisp.el")
+(prepare-in-hook-once prepare-org org-mode-hook "org-conf.el")
+
+;;;###autoload
+(load-after-function durand-mu4e "mail.el" "Open mu4e." t (mu4e))
+
+(add-to-list 'auto-mode-alist (cons "pdf$" #'pdf-view-mode))
+
+;;;###autoload
+(load-after-function pdf-view-mode "pdf.el" "Fake mode that loads the pacakge." nil
+ (pdf-view-mode))
+
+;;; bongo
+
+;;;###autoload
+(load-after-function bongo "bongo.el" "Listen to music in Emacs." nil
+ (bongo))
+
+;;; gnus
+
+(load-config "gnus-conf.el")
+
+;;; comb
+
+;; (load-config "comb/comb.el")
+;; (load-config "comb/comb-annotation.el")
+
+;;; orderless
+
+;; TODO: Write my own completion styles library
+(load-config "comb/orderless-conf.el")
+
+;;; dired configurations
+
+(prepare-in-hook-once prepare-dired dired-mode-hook "dired-conf.el")
+(add-hook 'dired-mode-hook 'dired-hide-details-mode)
+
+;;; ibuffer
+
+(load-config "ibuffer.el")
+
+;;; center buffer
+
+(load-config "center-buffer.el")
+
+;;; tab configurations
+
+(load-config "tab-conf.el")
+
+;;; Save sessions
+
+(load-config "desktop-conf.el")
+
+;;; Text Configurations
+
+(prepare-in-hook-once prepare-text text-mode-hook "text-conf.el")
+
+;;; embark
+
+(load-config "embark-conf.el")
+
+;;; Don't let s-q quit as I oft press that by accident.
+
+(define-key global-map (vector ?\s-q) #'window-toggle-side-windows)
+
(setq gc-cons-threshold (* 2 1024 1024))