2017-08-17 21:37:33 +02:00
|
|
|
;;; init.el --- Emacs Initialization File
|
|
|
|
;;
|
|
|
|
;; Copyright (c) 2017 Wojciech Kozlowski
|
|
|
|
;;
|
|
|
|
;; Author: Wojciech Kozlowski <wojciech.kozlowski@vivaldi.net>
|
|
|
|
;; URL: https://gitlab.wojciechkozlowski.eu/config/emacs.d
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
2017-08-17 21:38:30 +02:00
|
|
|
|
|
|
|
;; ----------------------------------------------------------------------------
|
|
|
|
;; Run init without garbage collection.
|
|
|
|
;; ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(let ((gc-cons-threshold most-positive-fixnum))
|
|
|
|
|
2017-08-17 21:39:43 +02:00
|
|
|
;; --------------------------------------------------------------------------
|
|
|
|
;; Visual configuration.
|
|
|
|
;; --------------------------------------------------------------------------
|
|
|
|
|
2017-08-17 23:41:32 +02:00
|
|
|
;; Font ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
(setq default-frame-alist '((font . "Source Code Pro-10")))
|
|
|
|
;; Emacs does not set italic face automatically
|
|
|
|
(set-face-attribute 'italic nil
|
|
|
|
:family "Source Code Pro-Italic")
|
|
|
|
|
2017-08-17 21:39:43 +02:00
|
|
|
;; Fullscreen ---------------------------------------------------------------
|
|
|
|
|
2017-08-18 23:27:38 +02:00
|
|
|
(toggle-frame-maximized)
|
2017-08-17 21:39:43 +02:00
|
|
|
(add-to-list 'default-frame-alist '(fullscreen . maximized))
|
|
|
|
|
|
|
|
;; Visual clutter -----------------------------------------------------------
|
|
|
|
|
|
|
|
(scroll-bar-mode -1)
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
(menu-bar-mode -1)
|
2017-08-18 23:27:38 +02:00
|
|
|
(blink-cursor-mode -1)
|
2017-08-17 21:39:43 +02:00
|
|
|
|
|
|
|
;; Scrolling ----------------------------------------------------------------
|
|
|
|
|
|
|
|
(setq-default scroll-preserve-screen-position 1)
|
|
|
|
|
|
|
|
;; Line number --------------------------------------------------------------
|
|
|
|
|
|
|
|
(setq-default linum-format "%4d \u2502") ;; Line number format
|
2017-08-17 23:41:32 +02:00
|
|
|
(add-hook 'prog-mode-hook 'linum-mode) ;; Only in programming modes
|
|
|
|
|
|
|
|
;; Theme --------------------------------------------------------------------
|
|
|
|
|
2017-08-18 23:22:00 +02:00
|
|
|
(load-theme 'underwater t) ;; Load personal theme
|
2017-08-17 23:41:32 +02:00
|
|
|
|
2017-08-18 23:30:11 +02:00
|
|
|
;; --------------------------------------------------------------------------
|
|
|
|
;; Package configuration.
|
|
|
|
;; --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(require 'package)
|
|
|
|
(add-to-list 'package-archives
|
|
|
|
'("melpa" . "http://melpa.milkbox.net/packages/") t)
|
|
|
|
(package-initialize)
|
|
|
|
|
|
|
|
;; --------------------------------------------------------------------------
|
|
|
|
;; Configure garbage collection.
|
|
|
|
;;
|
|
|
|
;; Based on advice from:
|
|
|
|
;; http://bling.github.io/blog/2016/01/18/why-are-you-changing-gc-cons-threshold/
|
|
|
|
;; --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(defun my-minibuffer-setup-hook ()
|
|
|
|
(setq gc-cons-threshold most-positive-fixnum))
|
|
|
|
|
|
|
|
(defun my-minibuffer-exit-hook ()
|
|
|
|
(setq gc-cons-threshold 800000))
|
|
|
|
|
|
|
|
(add-hook 'minibuffer-setup-hook #'my-minibuffer-setup-hook)
|
|
|
|
(add-hook 'minibuffer-exit-hook #'my-minibuffer-exit-hook)
|
2017-08-17 21:39:43 +02:00
|
|
|
|
2017-08-17 21:38:30 +02:00
|
|
|
) ;; ((gc-cons-threshold most-positive-fixnum))
|