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

106 lines
3 KiB
EmacsLisp
Raw Normal View History

2015-09-19 23:52:34 +02:00
;;;;
;;;;;; -*- Mode: Emacs-Lisp -*-
;;;;
2018-05-08 15:50:25 +02:00
;; 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)
2018-06-23 13:57:39 +02:00
;; (add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
2018-05-08 15:50:25 +02:00
(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)
;; resize cursor to character
(setq x-stretch-cursor t)
2018-09-20 12:51:57 +02:00
;; set tab width to 4 whitespaces
(setq tab-width 4)
(defvaralias 'c-basic-offset 'tab-width)
(defvaralias 'cperl-indent-level 'tab-width)
;; 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)
2015-09-19 23:52:34 +02:00
;; 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.
2015-09-19 23:52:34 +02:00
'(column-number-mode t)
'(custom-enabled-themes (quote (tango-dark)))
2018-05-14 16:43:47 +02:00
'(menu-bar-mode nil)
2018-06-23 13:57:39 +02:00
'(package-selected-packages
(quote
(wanderlust flycheck-rust cargo flycheck-yamllint yaml-mode pass pinentry magit org)))
2018-05-08 15:50:25 +02:00
'(scroll-bar-mode nil)
2018-05-14 16:43:47 +02:00
'(show-paren-mode t)
'(tool-bar-mode nil))
;; yank at cursor not mouse pointer
(setq mouse-yank-at-point t)
2015-09-19 23:52:34 +02:00
2018-05-08 15:50:25 +02:00
;; make the screen go down with one line & mouse wheel support
2015-09-19 23:52:34 +02:00
(setq scroll-step 1)
(mouse-wheel-mode t)
2018-05-08 15:50:25 +02:00
;; 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
2015-09-19 23:52:34 +02:00
(line-number-mode 1)
(column-number-mode 1)
2018-05-08 15:50:25 +02:00
;; enhanced buffer switching
2015-09-19 23:52:34 +02:00
(windmove-default-keybindings)
2018-05-08 15:50:25 +02:00
;; display of current function (which-function-mode)
2015-09-19 23:52:34 +02:00
(which-function-mode 1)
2018-05-08 15:50:25 +02:00
;; no am/pm in timestamps
2015-09-19 23:52:34 +02:00
(setq display-time-24hr-format t)
2018-05-14 16:43:47 +02:00
;; clipboard yanking is possible with middle mouse button now
(setq x-select-enable-clipboard t
x-select-enable-primary t)
2015-09-20 00:08:37 +02:00
;; enable some commands disabled by default
(put 'narrow-to-region 'disabled nil)
(put 'upcase-region 'disabled nil)
2015-09-19 23:52:34 +02:00
(put 'downcase-region 'disabled nil)
2018-05-08 15:50:25 +02:00
;; 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)
2016-06-20 14:05:19 +02:00
;; tramp mode ssh (faster)
(setq tramp-default-method "ssh")
;; set pass default password length
(setq password-store-password-length 32)
2018-06-23 13:57:39 +02:00
;; load wanderlust
(autoload 'wl "wl" "Wanderlust" t)
2018-05-08 15:50:25 +02:00
;; include other configs
;; calendar-mode
(if (file-exists-p "~/.emacs.d/calendar.el")
(load-file "~/.emacs.d/calendar.el"))