diff options
author | Guangxiong Lin <[email protected]> | 2022-03-13 12:02:36 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-03-13 12:04:38 +0800 |
commit | 49a12b3a00a06031d3965a6120d344674f36e440 (patch) | |
tree | 715418b973f6fff2f318a32d59d0537ff65a9244 | |
parent | 40bfa4dd0556e923807ff54c53d4a43bf70e928e (diff) | |
download | dotfiles-49a12b3a00a06031d3965a6120d344674f36e440.tar.gz dotfiles-49a12b3a00a06031d3965a6120d344674f36e440.tar.bz2 dotfiles-49a12b3a00a06031d3965a6120d344674f36e440.zip |
Improve emacs init
- Running server whenever there is no server running
- Require 'init-local
-rw-r--r-- | .emacs.d/.gitignore | 2 | ||||
-rw-r--r-- | .emacs.d/init.el | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/.emacs.d/.gitignore b/.emacs.d/.gitignore index 5349c45..c65df60 100644 --- a/.emacs.d/.gitignore +++ b/.emacs.d/.gitignore @@ -12,3 +12,5 @@ org-roam.db .org-id-locations pyim .last-package-update-day + +lisp/init-local.el
\ No newline at end of file diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 21e5d01..66a37cc 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -13,6 +13,10 @@ (defconst *is-a-mac* (eq system-type 'darwin)) (defconst *is-a-linux* (eq system-type 'gnu/linux)) +(setq custom-file (expand-file-name "custom.el" user-emacs-directory)) +(unless (file-exists-p custom-file) + (write-region "" nil custom-file)) + (require 'init-package) (require 'init-utils) (require 'init-evil) @@ -29,7 +33,13 @@ (require 'init-misc) (require 'init-appearance) -(setq custom-file (expand-file-name "custom.el" user-emacs-directory)) -(unless (file-exists-p custom-file) - (write-region "" nil custom-file)) +(add-hook 'after-init-hook + (lambda () + (require 'server) + (unless (server-running-p) (server-start)))) + (load custom-file) + +(require 'init-local nil t) + +(provide 'init) |