tweaks.el (2243B)
1 ;; -*- lexical-binding: t; -*- 2 ;;; Configuration relating to default behavior of Emacs. 3 4 ;; Make Emacs never beep. 5 (setq ring-bell-function #'ignore) 6 (setf bell-fn #'ignore) 7 8 ;; Not personally a fan of customize.el 9 (setq custom-file "/dev/null") 10 (setq package-selected-packages "/dev/null/") 11 12 ;; These keybinds suspend Emacs (in order to mimic terminal behavior). 13 ;; This has *only* caused me trouble in GUI Emacs. 14 (when (display-graphic-p) 15 (global-unset-key (kbd "C-z")) 16 (global-unset-key (kbd "C-x C-z"))) 17 18 ;; Stop making backup files everywhere, put them all in one place! 19 (make-directory "~/.saves/" t) 20 (make-directory "~/.autosaves/" t) 21 (setq auto-save-file-name-transforms '((".*" "~/.autosaves/" t))) 22 (setq backup-directory-alist `(("." . "~/.saves"))) 23 (setq backup-by-copying t) 24 25 ;; Stop Emacs from bothering you about disabled commands. 26 (setq disabled-command-function nil) 27 28 ;; Stop Emacs from trying to use dialog boxes. 29 (setq use-dialog-box nil) 30 31 ;; Prefer y/n over yes/no. 32 (fset 'yes-or-no-p 'y-or-n-p) 33 34 ;; Stuff is often here too. 35 (add-to-list 'exec-path "~/.local/bin") 36 37 ;; Visual preference. 38 (global-visual-line-mode) 39 40 ;; PgUp and PgDown are scarily close to arrow keys on my laptop. 41 (when (string= (system-name) "qpad") 42 (unbind-key "C-<prior>") 43 (unbind-key "C-<next>")) 44 45 ;; I don't like the character that is displayed when a line goes over 46 (set-display-table-slot standard-display-table 0 ?\ ) 47 48 (use-package crux 49 :bind 50 (("C-a" . crux-move-beginning-of-line) 51 ("C-x 4 t" . crux-transpose-windows) 52 ("C-x K" . crux-kill-other-buffers) 53 ("C-k" . crux-smart-kill-line) 54 ("C-<tab>" . crux-indent-defun)) 55 :config 56 (crux-with-region-or-buffer indent-region) 57 (crux-with-region-or-buffer untabify) 58 (crux-with-region-or-point-to-eol kill-ring-save) 59 (defalias 'rename-file-and-buffer #'crux-rename-file-and-buffer)) 60 61 (use-package rainbow-mode) 62 63 (setq large-file-warning-threshold 100000000) 64 65 (use-package sudo-edit) 66 67 (use-package drag-stuff 68 :bind (("M-<up>" . drag-stuff-up) 69 ("M-<down>" . drag-stuff-down))) 70 71 (global-set-key (kbd "<pinch>") 'ignore) 72 (global-set-key (kbd "<touchscreen-pinch>") 'ignore) 73 (global-set-key (kbd "<C-wheel-up>") 'ignore) 74 (global-set-key (kbd "<C-wheel-down>") 'ignore)