aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2016-10-23 22:55:55 +0200
committerMiquel Sabaté Solà <msabate@suse.com>2016-10-23 22:55:55 +0200
commitcde6364e1be827bedc1f4a7f0d736acd13549aa6 (patch)
tree6a6bcdc8b439f54ebf7bb1991f5466492fa5dfaa /emacs
parentd66fd33616e9d196e7f4577d4da6bb9cfad5db8c (diff)
downloaddotfiles-cde6364e1be827bedc1f4a7f0d736acd13549aa6.tar.gz
dotfiles-cde6364e1be827bedc1f4a7f0d736acd13549aa6.zip
emacs: added ideas from @purcell
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el29
1 files changed, 28 insertions, 1 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 295c7ac..f011c7e 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -29,12 +29,21 @@
;; - @dmacvicar: https://github.com/dmacvicar/dotfiles
;; - @bbatsov: https://github.com/bbatsov/emacs.d
;; - @aaronbieber: https://github.com/aaronbieber/dotfiles
+;; - @purcell: https://github.com/purcell/emacs.d
;;; Code:
;; I'm sticking with the major version I'm using, deal with it.
(unless (>= emacs-major-version 24)
- (error "Don't be a cheap bastard and upgrade to at least Emacs 24"))
+ (error "Don't be a cheap bastard and upgrade to at least GNU Emacs 24"))
+
+;; Temporarily reduce garbage collection so startup time is lower. Idea taken
+;; from @purcell.
+(defconst mssola-initial-gc-cons-threshold gc-cons-threshold
+ "Initial value of `gc-cons-threshold' at start-up time.")
+(setq gc-cons-threshold (* 1024 1024 1024))
+(add-hook 'after-init-hook
+ (lambda () (setq gc-cons-threshold mssola-initial-gc-cons-threshold)))
;; Initialize 'package
(require 'package)
@@ -204,6 +213,15 @@ The user will end up in the *scratch* buffer."
(global-set-key (kbd "C-c a") 'mssola-cleanup-workspace)
+(defun emacs-init-time ()
+ "Redefine the `emacs-init-time' function so it is more detailed. Idea taken
+from @purcell."
+ (interactive)
+
+ (let ((init-time
+ (float-time (time-subtract after-init-time before-init-time))))
+ (message "%.3fs" init-time)))
+
;;; My lisp directory
(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
@@ -251,6 +269,14 @@ The user will end up in the *scratch* buffer."
(setq flycheck-display-errors-function
#'flycheck-display-error-messages-unless-error-list))
+;; Let's increase fonts with C-+ and C--
+
+(use-package default-text-scale
+ :ensure t
+ :config
+ (global-set-key (kbd "C-+") 'default-text-scale-increase)
+ (global-set-key (kbd "C--") 'default-text-scale-decrease))
+
;; Projectile & Helm
(use-package projectile
@@ -629,4 +655,5 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package salt-mode
:ensure t)
+(provide 'init)
;;; init.el ends here