2017-05-15 01:35:31 +02:00
|
|
|
(package-initialize)
|
|
|
|
(require 'package)
|
|
|
|
|
|
|
|
(push '("marmalade" . "http://marmalade-repo.org/packages/") package-archives)
|
|
|
|
(push '("melpa" . "http://melpa.milkbox.net/packages/") package-archives)
|
|
|
|
|
|
|
|
(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.
|
|
|
|
'(ansi-color-faces-vector
|
|
|
|
[default default default italic underline success warning error])
|
2017-05-16 19:24:48 +02:00
|
|
|
'(ansi-color-names-vector
|
|
|
|
["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"])
|
2017-05-15 01:35:31 +02:00
|
|
|
'(blink-cursor-mode nil)
|
2017-05-16 19:24:48 +02:00
|
|
|
'(custom-enabled-themes (quote (heroku)))
|
|
|
|
'(custom-safe-themes
|
|
|
|
(quote
|
|
|
|
("4f2ede02b3324c2f788f4e0bad77f7ebc1874eff7971d2a2c9b9724a50fb3f65" default)))
|
2017-05-15 01:35:31 +02:00
|
|
|
'(global-evil-surround-mode t)
|
|
|
|
'(inhibit-startup-screen t)
|
|
|
|
'(menu-bar-mode nil)
|
|
|
|
'(package-selected-packages
|
|
|
|
(quote
|
2017-05-16 08:12:04 +02:00
|
|
|
(yasnippet evil-surround org evil-magit magit makefile-runner evil)))
|
2017-05-15 01:35:31 +02:00
|
|
|
'(scroll-bar-mode nil)
|
|
|
|
'(tool-bar-mode nil))
|
|
|
|
(custom-set-faces
|
|
|
|
;; custom-set-faces 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.
|
|
|
|
'(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 113 :width normal :foundry "PfEd" :family "Inconsolata")))))
|
|
|
|
|
2017-05-15 14:25:35 +02:00
|
|
|
;; ensure repo cache is up1date
|
|
|
|
(or (file-exists-p package-user-dir)
|
|
|
|
(package-refresh-contents))
|
|
|
|
|
2017-05-17 20:43:49 +02:00
|
|
|
;; Install use-package
|
|
|
|
(defun ensure-package-installed (package)
|
|
|
|
"Ensure packages are installed"
|
|
|
|
(if (package-installed-p package)
|
|
|
|
nil
|
|
|
|
(progn
|
|
|
|
(package-refresh-contents)
|
|
|
|
(package-install package))))
|
|
|
|
|
|
|
|
(ensure-package-installed 'use-package)
|
|
|
|
|
|
|
|
;; Org-mode
|
|
|
|
(use-package org
|
|
|
|
:ensure t)
|
|
|
|
|
|
|
|
;; Evil-mode
|
|
|
|
(use-package evil
|
|
|
|
:ensure t
|
|
|
|
:demand t
|
|
|
|
:config (evil-mode 1))
|
|
|
|
|
|
|
|
;; Auto-Complete
|
|
|
|
(use-package auto-complete
|
|
|
|
:ensure t
|
|
|
|
:demand t
|
|
|
|
:config (progn
|
|
|
|
(require 'auto-complete-config)
|
|
|
|
(ac-config-default)))
|
2017-05-16 19:24:48 +02:00
|
|
|
|
2017-05-17 20:43:49 +02:00
|
|
|
;; Yasnippet
|
|
|
|
(use-package yasnippet
|
|
|
|
:demand t
|
|
|
|
:config (yas-global-mode 1))
|
2017-05-15 14:25:35 +02:00
|
|
|
|
2017-05-17 20:43:49 +02:00
|
|
|
;; Magit
|
|
|
|
(use-package magit
|
|
|
|
:bind ("C-x g" . magit-status))
|
2017-05-15 14:25:35 +02:00
|
|
|
|
2017-05-17 20:43:49 +02:00
|
|
|
;; Easy terminal
|
|
|
|
(setq my/default-shell (or (executable-find "zsh") (executable-find "bash")))
|
2017-05-15 18:22:09 +02:00
|
|
|
|
2017-05-17 20:43:49 +02:00
|
|
|
(defun term-split ()
|
|
|
|
"creates terminal window below"
|
|
|
|
(interactive)
|
|
|
|
(let ((window (split-window-below -7)))
|
|
|
|
(select-window window)
|
|
|
|
(term my/default-shell)))
|
|
|
|
|
|
|
|
(use-package term
|
|
|
|
:bind ("C-x t" . term-split))
|
|
|
|
|
|
|
|
;; tabbing (doesn't really work yet)
|
|
|
|
(setq-default indent-tabs-mode t)
|
|
|
|
(setq-default tab-width 4)
|
|
|
|
(setq-default LateX-indent-level 4)
|
2017-05-16 08:12:04 +02:00
|
|
|
|
2017-05-15 14:25:35 +02:00
|
|
|
;; Window movement
|
|
|
|
(global-set-key (kbd "C-x <up>") 'windmove-up)
|
|
|
|
(global-set-key (kbd "C-x <down>") 'windmove-down)
|
|
|
|
(global-set-key (kbd "C-x <left>") 'windmove-left)
|
|
|
|
(global-set-key (kbd "C-x <right>") 'windmove-right)
|
|
|
|
|
|
|
|
(defun cycle-window ()
|
|
|
|
"cycles windows"
|
|
|
|
(interactive)
|
|
|
|
(select-window (next-window)))
|
|
|
|
|
|
|
|
(global-set-key (kbd "<C-tab>") 'cycle-window)
|
|
|
|
|
2017-05-15 18:22:09 +02:00
|
|
|
;; Kill term buffer on exit
|
2017-05-16 00:48:57 +02:00
|
|
|
;(defun term-handle-exit--close-buffer (&rest args)
|
|
|
|
; (when (null (get-buffer-process (current-buffer)))
|
|
|
|
; (progn
|
|
|
|
; (let (window (get-buffer-window (current-buffer))
|
|
|
|
; (when (window-dedicated-p ))
|
|
|
|
; (kill-buffer (current-buffer))
|
|
|
|
; Fix...
|
|
|
|
|
|
|
|
; (advice-add 'term-handle-exit :after #'term-handle-exit--close-buffer)
|
|
|
|
|
2017-05-17 20:43:49 +02:00
|
|
|
;; Latex german
|
|
|
|
(quail-define-package "latex-german" "UTF-8" "LaGe" t
|
|
|
|
"Transforms umlauts to the better latex notation.
|
|
|
|
ä -> \"a
|
|
|
|
ö -> \"o
|
|
|
|
ü -> \"u
|
|
|
|
Ä -> \"A
|
|
|
|
Ö -> \"O
|
|
|
|
Ü -> \"U
|
|
|
|
ß -> \"s"
|
|
|
|
nil t nil nil nil nil nil nil nil nil t)
|
|
|
|
(quail-define-rules
|
|
|
|
("ä" ["\"a"])
|
|
|
|
("ö" ["\"o"])
|
|
|
|
("ü" ["\"u"])
|
|
|
|
("Ä" ["\"A"])
|
|
|
|
("Ö" ["\"O"])
|
|
|
|
("Ü" ["\"U"])
|
|
|
|
("ß" ["\"s"])
|
|
|
|
)
|
|
|
|
|
|
|
|
(add-hook 'latex-mode-hook (lambda ()
|
|
|
|
(set-input-method "latex-german")
|
|
|
|
(local-set-key "\"" 'self-insert-command)))
|
2017-05-15 18:22:09 +02:00
|
|
|
|
|
|
|
;; Split windows horizontally preferred
|
|
|
|
(setq split-height-threshold 6)
|
|
|
|
(setq split-width-threshold 20)
|
|
|
|
|
2017-05-17 20:43:49 +02:00
|
|
|
;; Overlay windows (What does it do?)
|
2017-05-15 14:25:35 +02:00
|
|
|
(add-to-list 'display-buffer-alist
|
|
|
|
'("*Apropos*" display-buffer-same-window))
|
|
|
|
(add-to-list 'display-buffer-alist
|
|
|
|
'("*Help*" display-buffer-same-window))
|
2017-05-17 20:43:49 +02:00
|
|
|
|
|
|
|
;; Change all prompts to y or n
|
|
|
|
(fset 'yes-or-no-p 'y-or-n-p)
|