主配置,基础设定 ~/.emacs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
(custom-set-variables '(column-number-mode t) '(gnus-init-file "~/Emacs/28/gnus.el") '(package-selected-packages '(projectile yasnippet-snippets which-key use-package-chords quickrun lsp-ui lsp-java helm-swoop helm-lsp helm-descbinds heaven-and-hell flycheck exec-path-from-shell doom-themes company)) '(safe-local-variable-values '((default-directory . "~/Emacs/tmp/"))) '(scroll-bar-mode 'right) '(show-paren-mode t) '(text-mode-hook '(text-mode-hook-identify))) (custom-set-faces '(erc-timestamp-face ((t (:foreground "black" :weight normal)))) '(eshell-prompt ((t (:foreground "Black" :weight bold)))))
(add-to-list 'load-path "~/Emacs/28/lisp")
(mapc '(lambda (file) (load (file-name-sans-extension file))) (directory-files "~/Emacs/28/config/" t "\\.el$"))
|
我使用的模块配置,会按照第一个数字按顺序加载
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| $> ll ~/Emacs/28/config total 120 -rw-r--r-- 1 staff staff 6507 Feb 1 2022 11.base.el -rw-r--r-- 1 staff staff 155 Oct 31 2022 12.color-theme.el -rw-r--r-- 1 staff staff 417 Oct 31 2022 13.font.el -rw-r--r-- 1 staff staff 1560 Jun 24 2014 14.hotkeys.el -rw-r--r-- 1 staff staff 4743 Oct 31 2022 15.develop.el -rw-r--r-- 1 staff staff 361 Sep 25 2018 16.speedbar.el -rw-r--r--@ 1 staff staff 154 Oct 13 2016 17.magit.el -rw-r--r--@ 1 staff staff 133 Oct 31 2022 18.git-emacs.el -rw-r--r-- 1 staff staff 2620 Oct 31 2022 19.php.el.re -rw-r--r--@ 1 staff staff 7499 Nov 1 2022 30.java.el -rw-r--r-- 1 staff staff 1110 Oct 31 2022 31.python.el.re -rw-r--r-- 1 staff staff 883 Feb 1 2022 32.client.el
|
11.base.el
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
|
(setq user-full-name "YOUR NAME") (setq user-mail-address "YOUR EMAIL")
(setq exec-path '("/bin" "/usr/bin" "/usr/local/bin")) (setenv "PATH" (mapconcat 'identity exec-path path-separator))
(setq inhibit-startup-message t)
(setq visible-bell t) (setq ring-bell-function 'ignore)
(setq show-date (format-time-string "%Y年%m月%d日 %A")) (setq frame-title-format '("" show-date " [ "(buffer-file-name "%f" (dired-directory dired-directory "%b"))" ] "))
(show-paren-mode t) (setq show-paren-style 'parentheses)
(setq default-major-mode 'text-mode) (add-hook 'text-mode-hook 'turn-on-auto-fill)
(setq default-tab-width 4) (setq indent-tabs-mode t)
(setq inhibit-eol-conversion nil)
(defconst query-replace-highlight t)
(setq scroll-step 0 scroll-margin 0 scroll-conservatively 10000)
(setq ansi-color-for-comint-mode t)
(setq backup-directory-alist (quote (("." . "~/Emacs/backups")))) (setq version-control t) (setq kept-old-versions 2) (setq kept-new-versions 5) (setq delete-old-versions t) (setq backup-directory-alist '(("." . "~/Emacs/backups"))) (setq backup-by-copying t)
(setq make-backup-files nil)
(setq gnus-directory "~/Emacs/News/")
(setq message-directory "~/Emacs/Mail/")
(setq hscroll-margin 1) (setq hscroll-step 1)
(setq kill-ring-max 200)
(setq time-stamp-active t) (setq time-stamp-warn-inactive t) (setq time-stamp-format "%:y-%02m-%02d %3a %02H:%02M:%02S K.T")
(setq diary-file "~/Emacs/diary.txt")
(setq default-directory "~/Desktop")
(setq column-number-mode t)
(setq default-fill-column 123)
(fset 'yes-or-no-p 'y-or-n-p)
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
(require 'thumbs) (auto-image-file-mode t)
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (not (fboundp 'tool-bar-mode)) (menu-bar-mode -1))
(auto-compression-mode 1)
(require 'dired) (require 'dired-x)
(global-set-key "\C-x\C-j" 'dired-jump) (define-key dired-mode-map "b" 'dired-mark-extension) (define-key dired-mode-map "c" 'dired-up-directory) (define-key dired-mode-map "e" 'dired-mark-files-containing-regexp) (define-key dired-mode-map "o" 'chunyu-dired-open-explorer) (define-key dired-mode-map "r" 'dired-mark-files-regexp) (define-key dired-mode-map "/" 'dired-mark-directories) (define-key dired-mode-map "K" 'dired-kill-subdir) (define-key dired-mode-map [(control ?/)] 'dired-undo)
(defun chunyu-dired-open-explorer () (interactive) (let ((file-name (dired-get-file-for-visit))) (if (file-exists-p file-name) (w32-shell-execute "open" file-name nil 1))))
(setq dired-listing-switches "-avl" dired-recursive-copies 'top dired-recursive-deletes 'top cvs-dired-use-hook 'always)
(add-hook 'shell-mode-hook 'wcy-shell-mode-hook-func) (defun wcy-shell-mode-hook-func () (set-process-sentinel (get-buffer-process (current-buffer)) #'wcy-shell-mode-kill-buffer-on-exit) ) (defun wcy-shell-mode-kill-buffer-on-exit (process state) (message "%s" state) (if (or (string-match "exited abnormally with code.*" state) (string-match "finished" state)) (kill-buffer (current-buffer))))
(defun dos-unix () (interactive) (goto-char (point-min)) (while (search-forward "\r" nil t) (replace-match ""))) (defun unix-dos () (interactive) (goto-char (point-min)) (while (search-forward "\n" nil t) (replace-match "\r\n")))
(require 'session) (add-hook 'after-init-hook 'session-initialize)
(add-to-list 'session-globals-exclude 'org-mark-ring)
(load "desktop")
(desktop-read)
(autoload 'ansi-color-apply-on-region "ansi-color") (defun article-treat-ansi-sequences () "Translate ANSI SGR control sequences into overlays or extents." (interactive) (save-excursion (when (article-goto-body) (let ((inhibit-read-only t)) (ansi-color-apply-on-region (point) (point-max)))))) (add-hook 'gnus-part-display-hook 'article-treat-ansi-sequences)
|
如果您喜欢此博客或发现它对您有用,则欢迎对此发表评论。 也欢迎您共享此博客,以便更多人可以参与。 如果博客中使用的图像侵犯了您的版权,请与作者联系以将其删除。 谢谢 !