dotfiles-emacs/.emacs.d/init.el

89 lines
2.6 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)
;; delete trailing whitespaces before saving
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; add newlines at eof
(setq require-final-newline t)
;; (setq mode-require-final-newline t)
;; theme
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(column-number-mode t)
'(custom-enabled-themes (quote (tango-dark)))
'(menu-bar-mode nil)
'(package-selected-packages (quote (magit pass pinentry)))
'(scroll-bar-mode nil)
'(show-paren-mode t)
'(tool-bar-mode nil))
;; yank at cursor not mouse pointer
(setq mouse-yank-at-point t)
;; 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)
;; clipboard yanking is possible with middle mouse button now
(setq x-select-enable-clipboard t
x-select-enable-primary 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")
;; include other configs
;; calendar-mode
(if (file-exists-p "~/.emacs.d/calendar.el")
(load-file "~/.emacs.d/calendar.el"))