;;; 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)
(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)))
(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
(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))
;; 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))
(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
(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)
\f
;;; Editing
;; 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 ()
;; (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)
\f
(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)
(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")))