-;; Configure package, load custom.el and ensure use-package is
-;; installed.
+(defun cenouro/customize (&rest flat_pair_list)
+  "Sets multiple variables using customize-set-variable."
+  (while flat_pair_list
+    (customize-set-variable (car flat_pair_list)
+                            (car (cdr flat_pair_list)))
+    (setq flat_pair_list (cdr (cdr flat_pair_list)))))
+
+;; Initialize package, custom.el and ensure use-package is installed.
 (progn
-  ;; Ensure package variables have been loaded before customizing them
+  ;; ensure package variables have been loaded before customizing them
   (require 'package)
 
   (setq custom-file (expand-file-name "custom.el" user-emacs-directory))

    (require 'use-package))
  (customize-set-variable 'use-package-always-ensure t))

(customize-set-variable 'auto-save-default nil)
(customize-set-variable 'backup-inhibited t)
(customize-set-variable 'make-backup-files nil)

;; Simplify GUI, disable bell and startup screen.  Always start
;; maximized.
(progn
  (menu-bar-mode -1)

  (customize-set-variable 'inhibit-startup-screen t)
  (customize-set-variable 'ring-bell-function 'ignore))

;; Cursor: stop blinking and highlight current line.
(progn
  (blink-cursor-mode -1)
  (global-hl-line-mode 1))

;; Enable relative + line numbers.
(progn
  (global-display-line-numbers-mode t)
  (cenouro/customize 'display-line-numbers-type 'relative
                     'display-line-numbers-width 3))

;; Enable tab expansion.
(cenouro/customize 'backward-delete-char-untabify-method nil
                   'indent-tabs-mode nil
                   'tab-stop-list nil
                   'tab-width 4)

(add-hook 'before-save-hook
          'delete-trailing-whitespace)
