diff options
Diffstat (limited to '')
-rw-r--r-- | init.el | 47 |
1 files changed, 41 insertions, 6 deletions
@@ -123,9 +123,24 @@ This sets each user option VAR's value to the corresponding VALUE. ;;; Initial setup ;; keep ~/.emacs.d clean -(require 'no-littering) -(defalias 'b/etc 'no-littering-expand-etc-file-name) -(defalias 'b/var 'no-littering-expand-var-file-name) +(defvar b/etc-dir + (expand-file-name + (convert-standard-filename "etc/") user-emacs-directory) + "The directory where packages place their configuration files.") +(defvar b/var-dir + (expand-file-name + (convert-standard-filename "var/") user-emacs-directory) + "The directory where packages place their persistent data files.") +(defun b/etc (file) + "Expand filename FILE relative to `b/etc-dir'." + (expand-file-name (convert-standard-filename file) b/etc-dir)) +(defun b/var (file) + "Expand filename FILE relative to `b/var-dir'." + (expand-file-name (convert-standard-filename file) b/var-dir)) + +(csetq + auto-save-list-file-prefix (b/var "auto-save/sessions/") + nsm-settings-file (b/var "nsm-settings.el")) (require 'auto-compile) (auto-compile-on-load-mode) @@ -159,7 +174,7 @@ This sets each user option VAR's value to the corresponding VALUE. (run-with-idle-timer 0.5 nil #'require 'server) (with-eval-after-load 'server (declare-function server-edit "server") - (bind-key "C-c F D" 'server-edit) + (global-set-key (kbd "C-c F D") #'server-edit) (declare-function server-running-p "server") (or (server-running-p) (server-mode))) @@ -256,6 +271,7 @@ This sets each user option VAR's value to the corresponding VALUE. (csetq ;; backups (C-h v make-backup-files RET) backup-by-copying t + backup-directory-alist (list (cons "." (b/var "backup/"))) version-control t delete-old-versions t ;; auto-save @@ -434,7 +450,10 @@ This sets each user option VAR's value to the corresponding VALUE. (require 'bandali-theme) -;; *the* right way to do git +;; magit, *the* right way to do git +(csetq transient-history-file (b/var "transient/history.el") + transient-levels-file (b/etc "transient/levels.el") + transient-values-file (b/etc "transient/values.el")) (with-eval-after-load 'magit (declare-function magit-add-section-hook "magit-section" (hook function &optional at append local)) @@ -477,11 +496,13 @@ This sets each user option VAR's value to the corresponding VALUE. ;; recently opened files (run-with-idle-timer 0.2 nil #'require 'recentf) (with-eval-after-load 'recentf - (csetq recentf-max-saved-items 2000) + (csetq recentf-max-saved-items 2000 + recentf-save-file (b/var "recentf-save.el")) (add-to-list 'recentf-keep #'file-remote-p) (recentf-mode)) ;; needed for history for counsel +(csetq amx-save-file (b/var "amx-save.el")) (run-with-idle-timer 0.3 nil #'require 'amx) (with-eval-after-load 'amx (amx-mode)) @@ -535,6 +556,8 @@ This sets each user option VAR's value to the corresponding VALUE. (define-key help-mode-map (kbd "n") #'forward-button)) (with-eval-after-load 'tramp + (csetq tramp-auto-save-directory (b/var "tramp/auto-save/") + tramp-persistency-file-name (b/var "tramp/persistency.el")) (add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:")) (add-to-list 'tramp-default-proxies-alist '("localhost" nil nil)) (add-to-list 'tramp-default-proxies-alist @@ -561,6 +584,8 @@ This sets each user option VAR's value to the corresponding VALUE. (with-eval-after-load 'scpaste (csetq scpaste-http-destination "https://p.bndl.org" scpaste-scp-destination "p:~")) +(global-set-key (kbd "C-c a p p") #'scpaste) +(global-set-key (kbd "C-c a p r") #'scpaste-region) ;;; Editing @@ -588,11 +613,13 @@ This sets each user option VAR's value to the corresponding VALUE. ;; save minibuffer history (require 'savehist) +(csetq savehist-file (b/var "savehist.el")) (savehist-mode) (add-to-list 'savehist-additional-variables 'kill-ring) ;; automatically save place in files (when (version< "25" emacs-version) + (csetq save-place-file (b/var "save-place.el")) (save-place-mode)) (defun indicate-buffer-boundaries-left () @@ -648,6 +675,8 @@ This sets each user option VAR's value to the corresponding VALUE. ;; (advice-add #'ispell-parse-output :filter-args ;; #'endless/replace-quote)) +;; abbrev +(csetq abbrev-file-name (b/var "abbrev.el")) (add-hook 'text-mode-hook #'abbrev-mode) @@ -814,6 +843,7 @@ This sets each user option VAR's value to the corresponding VALUE. (defconst yas-verbosity-cur yas-verbosity) (setq yas-verbosity 2) + (csetq yas-snippet-dirs `(,(b/etc "yasnippet/snippets"))) (add-to-list 'yas-snippet-dirs "~/src/git/guix/etc/snippets" t) (yas-reload-all) (setq yas-verbosity yas-verbosity-cur) @@ -857,6 +887,11 @@ This sets each user option VAR's value to the corresponding VALUE. (debbugs-gnu debbugs-gnu-default-severities '("guix-patches")))) +;; url and url-cache +(csetq + url-configuration-directory (b/var "url/configuration/") + url-cache-directory (b/var "url/cache/")) + ;; eww (csetq eww-download-directory (file-name-as-directory (getenv "XDG_DOWNLOAD_DIR"))) |