dotfiles-emacs/.emacs.d/init.el
2018-05-08 15:50:25 +02:00

73 lines
2 KiB
EmacsLisp

;;;;
;;;;;; -*- Mode: Emacs-Lisp -*-
;;;;
;; melpa and elpa
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; for important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
;; use space instead of tabs
(setq-default indent-tabs-mode nil)
;; theme
(custom-set-variables
'(column-number-mode t)
'(custom-enabled-themes (quote (tango-dark)))
'(show-paren-mode t)
'(scroll-bar-mode nil)
'(tool-bar-mode nil)
'(menu-bar-mode nil))
;; make the screen go down with one line & mouse wheel support
(setq scroll-step 1)
(mouse-wheel-mode t)
;; use UTF-8 for file name encoding
(setq file-name-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
;; enable line, linum and column numbering
(line-number-mode 1)
(column-number-mode 1)
;; enhanced buffer switching
(windmove-default-keybindings)
;; display of current function (which-function-mode)
(which-function-mode 1)
;; no am/pm in timestamps
(setq display-time-24hr-format t)
;; enable some commands disabled by default
(put 'narrow-to-region 'disabled nil)
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
;; handle backups
(setq backup-directory-alist '(("." . "~/.emacs.d/backups/"))
backup-by-copying t
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t
tramp-backup-directory-alist backup-directory-alist)
;; tramp mode ssh (faster)
(setq tramp-default-method "ssh")
;; gpg gui fix
(setenv GPG_AGENT_INFO nil)
;; include other configs
;; calendar-mode
(if (file-exists-p "~/.emacs.d/calendar.el")
(load-file "~/.emacs.d/calendar.el"))