1 ;;; better-defaults.el --- Fixing weird quirks and poor defaults
3 ;; Copyright © 2013-2020 Phil Hagelberg and contributors
5 ;; Author: Phil Hagelberg
6 ;; URL: https://github.com/technomancy/better-defaults
8 ;; Package-Requires: ((emacs "25.1"))
10 ;; Keywords: convenience
12 ;; This file is NOT part of GNU Emacs.
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.
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.
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)
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.
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.
46 (unless (or (fboundp 'helm-mode) (fboundp 'ivy-mode) (bound-and-true-p fido-vertical-mode))
48 (setq ido-enable-flex-matching t))
50 (unless (memq window-system '(mac ns))
52 (when (fboundp 'tool-bar-mode)
54 (when (fboundp 'scroll-bar-mode)
56 (when (fboundp 'horizontal-scroll-bar-mode)
57 (horizontal-scroll-bar-mode -1))
59 (autoload 'zap-up-to-char "misc"
60 "Kill up to, but not including ARGth occurrence of CHAR." t)
63 (setq uniquify-buffer-name-style 'forward)
65 ;; https://www.emacswiki.org/emacs/SavePlace
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)
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)
78 (setq-default indent-tabs-mode nil)
80 (setq save-interprogram-paste-before-kill t
83 require-final-newline 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))
91 (unless backup-directory-alist
92 (setq backup-directory-alist `(("." . ,(concat user-emacs-directory
95 (provide 'better-defaults)
96 ;;; better-defaults.el ends here