]>
Commit | Line | Data |
---|---|---|
53e6db90 DC |
1 | ;;; better-defaults.el --- Fixing weird quirks and poor defaults |
2 | ||
3 | ;; Copyright © 2013-2020 Phil Hagelberg and contributors | |
4 | ||
5 | ;; Author: Phil Hagelberg | |
6 | ;; URL: https://github.com/technomancy/better-defaults | |
7 | ;; Version: 0.1.4 | |
8 | ;; Package-Requires: ((emacs "25.1")) | |
9 | ;; Created: 2013-04-16 | |
10 | ;; Keywords: convenience | |
11 | ||
12 | ;; This file is NOT part of GNU Emacs. | |
13 | ||
14 | ;;; Commentary: | |
15 | ||
16 | ;; There are a number of unfortunate facts about the way Emacs works | |
17 | ;; out of the box. While all users will eventually need to learn their | |
18 | ;; way around in order to customize it to their particular tastes, | |
19 | ;; this package attempts to address the most obvious of deficiencies | |
20 | ;; in uncontroversial ways that nearly everyone can agree upon. | |
21 | ||
22 | ;; Obviously there are many further tweaks you could do to improve | |
23 | ;; Emacs, (like those the Starter Kit and similar packages) but this | |
24 | ;; package focuses only on those that have near-universal appeal. | |
25 | ||
26 | ;;; License: | |
27 | ||
28 | ;; This program is free software; you can redistribute it and/or modify | |
29 | ;; it under the terms of the GNU General Public License as published by | |
30 | ;; the Free Software Foundation; either version 3, or (at your option) | |
31 | ;; any later version. | |
32 | ;; | |
33 | ;; This program is distributed in the hope that it will be useful, | |
34 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
35 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
36 | ;; GNU General Public License for more details. | |
37 | ;; | |
38 | ;; You should have received a copy of the GNU General Public License | |
39 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
40 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
41 | ;; Boston, MA 02110-1301, USA. | |
42 | ||
43 | ;;; Code: | |
44 | ||
45 | (progn | |
46 | (unless (or (fboundp 'helm-mode) (fboundp 'ivy-mode) (bound-and-true-p fido-vertical-mode)) | |
47 | (ido-mode t) | |
48 | (setq ido-enable-flex-matching t)) | |
49 | ||
50 | (unless (memq window-system '(mac ns)) | |
51 | (menu-bar-mode -1)) | |
52 | (when (fboundp 'tool-bar-mode) | |
53 | (tool-bar-mode -1)) | |
54 | (when (fboundp 'scroll-bar-mode) | |
55 | (scroll-bar-mode -1)) | |
56 | (when (fboundp 'horizontal-scroll-bar-mode) | |
57 | (horizontal-scroll-bar-mode -1)) | |
58 | ||
59 | (autoload 'zap-up-to-char "misc" | |
60 | "Kill up to, but not including ARGth occurrence of CHAR." t) | |
61 | ||
62 | (require 'uniquify) | |
63 | (setq uniquify-buffer-name-style 'forward) | |
64 | ||
65 | ;; https://www.emacswiki.org/emacs/SavePlace | |
66 | (save-place-mode 1) | |
67 | ||
68 | (global-set-key (kbd "M-/") 'hippie-expand) | |
69 | (global-set-key (kbd "C-x C-b") 'ibuffer) | |
70 | (global-set-key (kbd "M-z") 'zap-up-to-char) | |
71 | ||
72 | (global-set-key (kbd "C-s") 'isearch-forward-regexp) | |
73 | (global-set-key (kbd "C-r") 'isearch-backward-regexp) | |
74 | (global-set-key (kbd "C-M-s") 'isearch-forward) | |
75 | (global-set-key (kbd "C-M-r") 'isearch-backward) | |
76 | ||
77 | (show-paren-mode 1) | |
78 | (setq-default indent-tabs-mode nil) | |
79 | (savehist-mode 1) | |
80 | (setq save-interprogram-paste-before-kill t | |
81 | apropos-do-all t | |
82 | mouse-yank-at-point t | |
83 | require-final-newline t | |
84 | visible-bell t | |
85 | load-prefer-newer t | |
86 | backup-by-copying t | |
87 | frame-inhibit-implied-resize t | |
88 | ediff-window-setup-function 'ediff-setup-windows-plain | |
89 | custom-file (expand-file-name "custom.el" user-emacs-directory)) | |
90 | ||
91 | (unless backup-directory-alist | |
92 | (setq backup-directory-alist `(("." . ,(concat user-emacs-directory | |
93 | "backups")))))) | |
94 | ||
95 | (provide 'better-defaults) | |
96 | ;;; better-defaults.el ends here |