;;; -*- lexical-binding: t; -*- ;;; Important in order to read passwords (setq epg-pinentry-mode 'loopback) ;;; disable some default modes (tool-bar-mode -1) (menu-bar-mode -1) (scroll-bar-mode -1) (blink-cursor-mode -1) ;;; I use one single space to end a sentence. (set 'sentence-end-double-space nil) ;;; Say y instead of yes (fset 'yes-or-no-p 'y-or-n-p) ;;; Recursive minibuffers is almost indispensable for me. (set 'enable-recursive-minibuffers t) ;;; Use spaces instead of tabs (set-default 'indent-tabs-mode nil) ;;; Don't make noise when saving files (setq save-silently t) ;;; no title on the frame (setq frame-title-format "" icon-title-format "") ;;; major mode of the scratch buffer (set 'initial-major-mode 'emacs-lisp-mode) ;;; echo quickly (setq echo-keystrokes 0.002) ;;; Scroll conservatively please (setq scroll-conservatively 30) ;;; remember my minibuffer (require 'savehist) (set 'savehist-file (expand-file-name "savehist" load-file-directory)) (set 'history-length 1024) (set 'history-delete-duplicates t) (set 'savehist-save-minibuffer-history t) (savehist-mode) ;;; a large file threshold (set 'large-file-warning-threshold (* 1024 1024 1024)) ;;; don't use a GUI dialog box as that is distracting to me (setq use-dialog-box nil) ;;; don't make noise ;;; and when two buffers have the same base name, include more parts to distinguish them (setq uniquify-buffer-name-style 'forward ring-bell-function #'ignore visible-bell nil) ;;; mac specific settings (setq ns-right-alternate-modifier 'none ns-pop-up-frames nil ns-use-native-fullscreen nil ns-use-proxy-icon nil) ;;; where to find the C source code of Emacs. (setq find-function-C-source-directory "/Users/durand/w.emacs.d/emacs/src/") ;;; frame parameters (setq initial-frame-alist '((width . 118))) (set-frame-width nil 118) (add-to-list 'default-frame-alist '(width . 118)) (add-to-list 'default-frame-alist '(font . "Droid Sans Mono for Powerline-20")) (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t)) (add-to-list 'default-frame-alist '(ns-appearance . dark)) (add-to-list 'default-frame-alist '(fullscreen . maximized)) (setq frame-resize-pixelwise t) (setq revert-without-query '(".*")) (set-face-attribute 'variable-pitch nil :family "Avenir" :height 1.0) ;;; disable line numbers, as that is a performace killer for me. (setq-default display-line-numbers-type nil) (global-display-line-numbers-mode -1) ;;; display-buffer-alist (setq display-buffer-alist `((,(rx (seq bos "*Help*" eos)) (display-buffer-in-side-window) (side . bottom) (slot . 1) (window-height . 0.37)) (,(rx (seq bos "*Messages*" eos)) (display-buffer-in-side-window) (side . bottom) (slot . -1) (window-height . 0.37)))) ;;; auto-fill for texts (set 'adaptive-fill-mode t) (add-hook 'text-mode-hook #'auto-fill-mode) ;;; enable all commands (set 'disabled-command-function nil) ;;; Comments relateed (require 'newcomment) (set 'comment-empty-lines nil) (set 'comment-fill-column nil) (set 'comment-multi-line t) (set 'comment-style 'multi-line) ;;; Windows (define-key global-map (vector ?\s-o) #'other-window) (define-key global-map (vector ?\s-&) #'delete-other-windows) (define-key global-map (vector ?\s-à) #'delete-window) (define-key global-map (vector ?\s-f) #'find-file) (define-key global-map (vector ?\s-v) #'durand-focus-completion-or-minibuffer) ;;; Package management ;;;###autoload (defvar package-dir "/Users/durand/elisp_packages/" "The directory containing packages.") ;;;###autoload (defmacro use-package (package-path package-name &rest configs) "Add PACKAGE-PATH to `load-path' and require PACKAGE-NAME. The remaining CONFIGS are evaluated after the package is loaded." (declare (indent 2) (debug defun)) `(progn (add-to-list 'load-path (expand-file-name ,package-path ,package-dir)) (require ,package-name) ,@configs))