2017-11-25 23:10:34 +01:00
;; Emacs configuration
2018-02-23 09:30:22 +01:00
;; Marcel Kapfer (C) 2016 - 2018
2017-11-25 23:10:34 +01:00
;; MIT License
;; -----------------------------------------------------------------------------
;; Package configuration
;;
;; This configuration uses use-package, so we're first ensuring, that it is
;; installed using the emacs package system an MELPA.
2016-07-23 23:20:04 +02:00
( package-initialize )
2017-11-25 23:10:34 +01:00
( require 'package )
( setq package-enable-on-startup nil )
2018-03-11 17:07:57 +01:00
( add-to-list 'package-archives ' ( " org " . " https://orgmode.org/elpa/ " ) t )
2018-10-12 22:29:00 +02:00
( add-to-list 'package-archives ' ( " melpa " . " https://melpa.org/packages/ " ) t )
2016-07-23 23:20:04 +02:00
2018-02-23 09:30:56 +01:00
;; install use-package if not already installed
2017-11-25 23:10:34 +01:00
( unless ( package-installed-p 'use-package )
( package-refresh-contents )
( package-install 'use-package ) )
2018-02-23 09:31:22 +01:00
( setq
;; tell use-package to always ensure
use-package-always-ensure t
;; don't load outdated packages
load-prefer-newer t )
2017-11-28 00:08:53 +01:00
2017-11-25 23:10:34 +01:00
;; -----------------------------------------------------------------------------
;; Basic configuration
;;
;; The code in this block should be package independend.
2017-11-25 23:21:57 +01:00
;; Keep emacs Custom-settings in separate file
2018-02-23 09:31:48 +01:00
;; set the file path
2017-11-25 23:21:57 +01:00
( setq custom-file ( expand-file-name " custom.el " user-emacs-directory ) )
2018-02-23 09:31:48 +01:00
;; create the file if not existent
2017-11-25 23:21:57 +01:00
( when ( not ( file-exists-p custom-file ) )
( with-temp-buffer ( write-file custom-file ) ) )
2018-02-23 09:31:48 +01:00
;; finally load it
2017-11-25 23:21:57 +01:00
( load custom-file )
2018-02-23 09:31:56 +01:00
;; set name and e-mail
( setq user-full-name " Marcel Kapfer "
user-mail-address " opensource@mmk2410.org " )
2017-11-25 23:10:34 +01:00
;; y/n instead of yes/no for confirm questions
2016-07-23 23:20:04 +02:00
( defalias 'yes-or-no-p 'y-or-n-p )
2017-11-25 23:10:34 +01:00
;; Save backup files in ~/.emacs-autosaves/
( defvar user-temporary-file-directory " ~/.emacs-autosaves " )
( make-directory user-temporary-file-directory t )
2018-02-23 09:32:23 +01:00
( setq backup-by-copying t
backup-directory-alist ` ( ( " . " . , user-temporary-file-directory )
( tramp-file-name-regexp nil ) )
auto-save-list-file-prefix ( concat user-temporary-file-directory " .auto-saves- " )
2018-03-12 11:14:08 +01:00
auto-save-file-name-transforms ` ( ( " .* " , user-temporary-file-directory t ) )
;; version numbers for backup files
version-control t
;; delete excess backup versions
delete-old-versions t
;; amount of new versions to keep
kept-new-versions 20
;; amount of old versions to keep
kept-old-versions 5 )
2016-07-23 23:20:04 +02:00
2017-11-25 23:10:34 +01:00
;; set default input encoding
2017-11-28 00:09:09 +01:00
( prefer-coding-system 'utf-8-unix )
2017-11-25 23:10:34 +01:00
( set-language-environment " UTF-8 " )
2016-07-23 23:20:04 +02:00
2018-02-23 09:32:53 +01:00
;; general options
( setq
;; disable startup screen
inhibit-startup-screen t
;; visual bell instead of BEEP
visible-bell 1
;; set text in scratch to nil
initial-scratch-message nil
;; Don't truncate lines
truncate-lines nil
;; Maximize threshold for garbage collection to 10MB for less gc
gc-cons-treshold ( * 10 1024 1024 )
;; confirm before closing emacs
confirm-kill-emacs #' y-or-n-p
;; put a new line at the end of every file
require-final-newline t
;; use german directory in ispell
ispell-dictionary " german "
2018-08-18 05:26:55 +02:00
;; always follow symlinks to git repos
2018-02-23 09:32:53 +01:00
vc-follow-symlinks t
2018-08-18 05:26:55 +02:00
;; indent using spaces, not tabs
2018-02-23 09:32:53 +01:00
indent-tabs-mode nil
;; tab width
2018-03-09 12:14:01 +01:00
tab-width 2
;; https://www.reddit.com/r/emacs/comments/819v0h/how_to_speed_up_cursor_movement_by_10x/
2018-08-03 09:20:58 +02:00
auto-window-vscroll nil
;; Tell imenu to rescan tags
imenu-auto-rescan t )
2018-02-23 09:32:53 +01:00
2018-06-28 21:38:23 +02:00
;; set timezone
( setenv " TZ " " /etc/localtime " )
2018-02-23 09:32:53 +01:00
;; disable cursor blinking
( blink-cursor-mode -1 )
2016-12-04 23:19:35 +01:00
2017-11-25 23:10:34 +01:00
;; activate winner mode
( when ( fboundp 'winner-mode )
( winner-mode 1 ) )
2016-12-04 23:19:35 +01:00
2017-11-25 23:10:34 +01:00
;; Highlight the current line
( global-hl-line-mode t )
;; replace selected text by typing
( delete-selection-mode t )
2018-03-09 12:14:19 +01:00
;; break lines better
( visual-line-mode t )
2017-11-25 23:10:34 +01:00
;; ibuffer configuration
( setq ibuffer-saved-filter-groups
( quote ( ( " default "
( " dired " ( mode . dired-mode ) )
( " org " ( name . " ^.*org$ " ) )
2018-02-23 09:33:09 +01:00
( " shell " ( or
( mode . eshell-mode )
( mode . term-mode ) ) )
( " mu4e " ( or
( mode . mu4e-compose-mode )
( name . " \* mu4e \* " ) ) )
2017-11-25 23:10:34 +01:00
( " programming " ( or
( mode . python-mode )
( mode . sh-mode )
( mode . web-mode )
( mode . emacs-lisp-mode )
( mode . lisp-mode )
( mode . dart-mode ) ) )
( " emacs " ( or
( name . " ^ \\ *scratch \\ *$ " )
2018-02-23 09:33:40 +01:00
( name . " ^ \\ *Messages \\ *$ " ) ) ) ) ) ) )
2018-02-23 09:34:41 +01:00
;; activiate the above ibuffer configuration
2017-11-25 23:10:34 +01:00
( add-hook 'ibuffer-mode-hook
( lambda ( )
( ibuffer-auto-mode 1 )
( ibuffer-switch-to-saved-filter-groups " default " ) ) )
2018-02-23 09:34:41 +01:00
;; ibuffer options
( setq
;; Don't show filter groups if there are no buffers in that group
ibuffer-show-empty-filter-groups nil
;; Don't ask for confirmation to delete marked buffers
ibuffer-expert t )
2017-11-25 23:10:34 +01:00
;; delete trailing whitespaces on save
2018-02-23 09:34:41 +01:00
( add-hook 'before-save-hook #' delete-trailing-whitespace )
2016-12-04 23:19:35 +01:00
2018-08-18 05:26:55 +02:00
;; set default column width
2016-12-04 23:19:35 +01:00
( setq-default fill-column 80 )
2018-03-12 19:46:40 +01:00
;; set cursor style to a vertical bar
( setq-default cursor-type 'bar )
2018-08-18 05:26:55 +02:00
;; hide tool bar, menu bar and scroll bar
2016-12-05 22:01:43 +01:00
( menu-bar-mode 0 )
( tool-bar-mode 0 )
2016-12-08 05:52:21 +01:00
( scroll-bar-mode 0 )
2016-12-05 22:01:43 +01:00
2017-11-25 23:10:34 +01:00
;; auto-fill mode
2017-03-28 11:12:02 +02:00
( add-hook 'mail-mode-hook 'auto-fill-mode )
( add-hook 'mail-mode-hook ( lambda ( ) ( setq fill-column 72 ) ) )
2017-07-20 22:37:05 +02:00
2017-11-25 23:10:34 +01:00
;; set default web browser
2018-08-14 13:48:10 +02:00
( setq browse-url-generic-program " x-www-browser " )
2017-07-20 22:37:05 +02:00
2017-11-25 23:10:34 +01:00
;; set font
2018-10-21 13:37:24 +02:00
( set-frame-font " Fira Mono 10 " nil t )
2017-07-20 22:37:05 +02:00
2018-02-23 09:34:57 +01:00
;; set the default font after the frame is created.
;; needed because of some issue with emacsclient.
( add-hook 'after-make-frame-functions
2018-10-21 13:37:24 +02:00
( lambda ( frame ) ( set-frame-font " Fira Mono 10 " nil t ) ) )
2018-02-23 09:34:57 +01:00
2017-11-25 23:10:34 +01:00
;; -----------------------------------------------------------------------------
2017-07-20 22:37:05 +02:00
2017-11-25 23:10:34 +01:00
;; Custom keybindings
;;
;; here are custom keybindings for emacs or package functions configured. Custom
;; bindings for own functions are set directly after the function declaration.
2017-07-20 22:37:05 +02:00
2017-11-25 23:10:34 +01:00
;; global keys
2017-07-20 22:37:05 +02:00
2017-11-25 23:10:34 +01:00
;; Emacs Shell
( global-set-key ( kbd " C-c e " ) 'eshell )
2017-07-20 22:37:05 +02:00
2017-11-25 23:10:34 +01:00
;; Async shell command
( global-set-key ( kbd " C-c a " ) 'async-shell-command )
2017-07-20 22:37:05 +02:00
2017-11-25 23:10:34 +01:00
;; Open link under cursor
( global-set-key ( kbd " C-c b " ) 'browse-url-at-point )
2017-07-20 22:37:05 +02:00
2018-02-23 09:36:35 +01:00
;; Open link under cursor
( global-set-key ( kbd " C-x e " ) 'mu4e-in-new-frame )
2017-07-21 00:02:57 +02:00
2017-11-25 23:10:34 +01:00
;; eval region
2018-02-23 09:36:35 +01:00
( global-set-key ( kbd " C-c x " ) 'eval-region )
2017-07-21 00:02:57 +02:00
2017-11-25 23:10:34 +01:00
;; revert buffer (reload file from disk)
( global-set-key ( kbd " <f5> " ) 'revert-buffer )
2017-07-21 00:02:57 +02:00
2017-11-25 23:10:34 +01:00
;; use ibuffer as default
( global-set-key ( kbd " C-x C-b " ) 'ibuffer )
2017-07-21 00:02:57 +02:00
2017-11-25 23:10:34 +01:00
;; toggle auto-fill-mode
( global-set-key ( kbd " C-c q " ) 'auto-fill-mode )
2017-07-21 00:02:57 +02:00
2017-11-25 23:10:34 +01:00
;; -----------------------------------------------------------------------------
2017-10-06 19:43:40 +02:00
2017-11-25 23:10:34 +01:00
;; Custom functions
;;
;; custom functions are defined here, sorted by use-case (if possible)
2017-10-06 19:43:40 +02:00
2017-11-25 23:10:34 +01:00
;; general
2017-10-06 19:43:40 +02:00
2017-11-25 23:10:34 +01:00
;; function for closing all buffers
( defun close-all-buffers ( )
" Close all buffers "
( interactive )
( mapc 'kill-buffer ( buffer-list ) ) )
2017-10-06 19:43:40 +02:00
2017-11-25 23:10:34 +01:00
;; -----------------------------------------------------------------------------
;; Packages and package configuration
;;
;; all packages should be loaded with use-package
2018-02-23 09:37:00 +01:00
;; server
( use-package server
:if window-system
:hook
( ( after-init-hook . server-start )
;; StumpWM interaction
( server-done-hook . ( lambda ( )
( shell-command
" stumpish 'eval (stumpwm::return-es-called-win stumpwm::*es-win*)' " ) ) ) )
:init ( setq server-raise-frame t ) )
2018-03-01 10:39:54 +01:00
;; diminish
;; Diminished modes are minor modes with no modeline display
( use-package diminish
:init
( diminish 'abbrev-mode ) )
2018-03-12 11:22:52 +01:00
;; curx
;; A Collection of Ridiculously Useful eXtensions for Emacs
( use-package crux
:bind
( ( " C-a " . crux-move-beginning-of-line ) ) )
2017-11-25 23:10:34 +01:00
;; which-key
;; Display available keybindings in popup
( use-package which-key
2018-03-01 10:39:54 +01:00
:diminish which-key-mode
2017-11-25 23:10:34 +01:00
:config
( which-key-mode ) )
;; org-bullets
;; Show bullets in org-mode as UTF-8 characters
( use-package org-bullets
2018-03-09 12:14:39 +01:00
:after org
:config ( add-hook 'org-mode-hook #' org-bullets-mode ) )
2017-11-25 23:10:34 +01:00
;; undo-tree
;; Treat undo history as a tree
( use-package undo-tree
2018-03-01 10:39:54 +01:00
:diminish undo-tree-mode
2017-11-25 23:10:34 +01:00
:config
( global-undo-tree-mode ) )
;; beacon
;; Highlight the cursor whenever the window scrolls
( use-package beacon
2018-03-01 10:39:54 +01:00
:diminish beacon-mode
2017-11-25 23:10:34 +01:00
:config
( beacon-mode ) )
;; expand-region
;; Increase selected region by semantic units.
( use-package expand-region
2018-02-23 09:45:50 +01:00
:bind ( ( " C-= " . er/expand-region ) ) )
2017-11-25 23:10:34 +01:00
;; dired+
;; Extensions to Dired
2018-05-13 16:55:21 +02:00
( use-package dired+
:load-path " dired+/ " )
2017-11-25 23:10:34 +01:00
;; projectile
;; Manage and navigate projects in Emacs easily
( use-package projectile
2018-03-01 10:39:54 +01:00
:diminish projectile-mode
2018-08-18 05:27:40 +02:00
:defer t
2017-11-25 23:10:34 +01:00
:config
( projectile-global-mode )
( setq projectile-completion-system 'ivy ) )
;; dumb-jump
;; jump to definition for multiple languages without configuration.
( use-package dumb-jump
:config
( dumb-jump-mode t ) )
;; origami
;; Flexible text folding
2018-08-18 05:27:40 +02:00
( use-package origami
:defer t )
2017-11-25 23:10:34 +01:00
;; multiple-cursors
;; Multiple cursors for Emacs
( use-package multiple-cursors
:bind
( ( " C-> " . mc/mark-next-like-this )
( " C-< " . mc/mark-previous-like-this )
( " C-* " . mc/mark-all-like-this )
( " C-; " . mc/edit-lines ) ) )
;; pcre2el
;; regexp syntax converter
( use-package pcre2el
2018-03-01 10:39:54 +01:00
:diminish pcre-mode
2017-11-25 23:10:34 +01:00
:config
( pcre-mode t ) )
;; visual-regexp
;; A regexp/replace command for Emacs with interactive visual feedback
( use-package visual-regexp
:bind
( ( " C-c r " . vr/replace )
( " C-c q " . vr/query-replace )
( " C-c m " . vr/mc-mark ) ) )
2018-08-02 17:23:54 +02:00
;; highlight-indent-guides
2017-11-25 23:10:34 +01:00
;; show vertical lines to guide indentation
2018-08-02 17:23:54 +02:00
( use-package highlight-indent-guides
:diminish highlight-indent-guides-mode
2017-11-25 23:10:34 +01:00
:config
2018-08-02 17:23:54 +02:00
( setq highlight-indent-guides-method 'character )
:hook
( prog-mode . highlight-indent-guides-mode ) )
2017-11-25 23:10:34 +01:00
;; org
;; Outline-based notes management and organizer
( use-package org
2018-02-23 09:48:43 +01:00
:mode " \\ .org$ "
2017-11-25 23:10:34 +01:00
:config
;; add scrartcl LaTeX class to org
( with-eval-after-load 'ox-latex
( add-to-list 'org-latex-classes
' ( " scrartcl "
" \\ documentclass{scrartcl} "
( " \\ section{%s} " . " \\ section*{%s} " )
( " \\ subsection{%s} " . " \\ subsection*{%s} " )
( " \\ subsubsection{%s} " . " \\ subsubsection*{%s} " )
( " \\ paragraph{%s} " . " \\ paragraph*{%s} " )
( " \\ subparagraph{%s} " . " \\ subparagraph*{%s} " ) ) ) )
2018-02-23 09:52:42 +01:00
;; latex related option (mainly support for lualatex)
( setq
2018-03-11 21:22:13 +01:00
;; scrartcl as default class
org-latex-default-class " scrartcl "
2018-03-11 21:22:29 +01:00
;; lualatex as default compiler
org-latex-compiler " lualatex "
2018-02-23 09:52:42 +01:00
;; add latex packages and configurations
org-latex-packages-alist
' (
( " " " booktabs " t )
( " " " listings " t )
( " " " xcolor " t )
( " " " polyglossia " t )
( " utf8 " " luainputenc " t )
( " " " fontspec " t )
( " hidelinks " " hyperref " t )
" \\ setmainfont{Linux Libertine O} "
" \\ setsansfont{Linux Biolinum O} "
2018-05-13 16:18:54 +02:00
" \\ setmonofont[Scale=0.9]{AnonymousPro} "
2018-02-23 09:52:42 +01:00
" \\ setdefaultlanguage{german} " )
;; enable latex listings
org-latex-listings 'listings
;; latex listings options
org-latex-listings-options
' (
( " frame " " single " )
( " rulesep " " 6pt " )
( " backgroundcolor " " \\ color{gray!20} " )
( " basicstyle " " \\ footnotesize \\ ttfamily " )
( " breaklines " " true " ) ) )
2017-11-25 23:10:34 +01:00
;; remove unused default packages
( unless ( boundp 'org-latex-default-packages-alist )
( setq org-latex-default-packages-alist nil ) )
2018-02-23 09:52:42 +01:00
( setq
org-latex-default-packages-alist ( remove ' ( " AUTO " " inputenc " t ) org-latex-default-packages-alist )
org-latex-default-packages-alist ( remove ' ( " " " fixltx2e " nil ) org-latex-default-packages-alist )
org-latex-default-packages-alist ( remove ' ( " " " hyperref " nil ) org-latex-default-packages-alist )
org-latex-default-packages-alist ( remove ' " \\ tolerance=1000 " org-latex-default-packages-alist ) )
2017-11-25 23:10:34 +01:00
2018-03-09 12:15:32 +01:00
;; add comment to easy templates
;; Credits: http://acidwords.com/posts/2018-03-02-extending-org-mode-easy-templates.html
( add-to-list 'org-structure-template-alist
' ( " C " " #+BEGIN_COMMENT \n ? \n #+END_COMMENT " " " ) )
;; org todo keywords
;; Creadits: https://changelog.complete.org/archives/9877-emacs-3-more-on-org-mode
( setq org-todo-keywords ' ( ( sequence
" TODO(t!) " " NEXT(n!) " " STARTED(a!) " " WAIT(w@/!) " " OTHERS(o!) "
" | " " DONE(d) " " CANCELLED(c) " ) ) )
( setq
;; syntax highlighting
org-src-fontify-natively t
;; Don't break line on M-RET
org-M-RET-may-split-line nil
;; Log done time
org-log-done 'time
2018-10-21 13:37:05 +02:00
;; Log time when resheduled
org-log-reschedule 'time
;; Log time when redeadlined
org-log-redeadline 'time
2018-03-09 12:15:32 +01:00
;; only show last star
org-hide-leading-stars t
2018-10-21 13:52:10 +02:00
;; Forbid closing of todos with open subtasks
org-enforce-todo-dependencies t
org-enforce-todo-checkbox-dependencies t
2018-03-09 12:15:32 +01:00
;; show something instead of ...
org-ellipsis " ⤵ " )
2018-02-23 09:53:10 +01:00
;; set default agenda file
2018-03-09 12:15:32 +01:00
( setq org-agenda-files ( list " ~/cloud/org/todo.org "
" ~/cloud/org/notes.org "
" ~/cloud/org/projects.org " )
org-agenda-text-search-extra-files ( list " ~/cloud/org/finance.org "
" ~/cloud/org/emacs-magic.org "
" ~/cloud/org/wiki.org " ) )
2018-02-23 09:53:10 +01:00
;; set priority range from A to C with A being the highest
( setq org-priority-faces ' ( ( ?A . ( :foreground " #F0DFAF " :weight bold ) )
( ?B . ( :foreground " LightSteelBlue " ) )
( ?C . ( :foreground " OliveDrab " ) ) ) )
;; open agenda in current window
( setq org-agenda-window-setup ( quote current-window ) )
;; bind capture templates
( setq org-capture-templates
2018-03-09 12:15:32 +01:00
' ( ( " t " " todo " entry ( file+headline " ~/cloud/org/todo.org " " Tasks " )
2018-10-21 13:37:05 +02:00
" * TODO [#A] %? %^G \n CREATED: %u " )
2018-03-09 12:15:32 +01:00
( " s " " scheduled todo " entry ( file+headline " ~/cloud/org/todo.org " " Tasks " )
2018-10-21 13:37:05 +02:00
" * TODO [#A] %? %^G \n SCHEDULED: %^T \n CREATED: %u \n " )
2018-03-09 12:15:32 +01:00
( " m " " scheduled mail " entry ( file+headline " ~/cloud/org/todo.org " " Tasks " )
2018-10-21 13:37:05 +02:00
" * TODO [#A] %? %^G \n SCHEDULED: %^T \n CREATED: %u \n %a \n " )
2018-03-09 12:15:32 +01:00
( " n " " Note " entry ( file+headline " ~/cloud/org/notes.org " " Notes " )
2018-10-21 13:37:05 +02:00
" * %? \n %i \n CREATED: %u \n %a \n " )
2018-03-09 12:15:32 +01:00
( " p " " Project Idea " entry ( file+headline " ~/cloud/org/projects.org " " INBOX " )
2018-10-21 13:37:05 +02:00
" * TODO %? %^G \n %i \n CREATED: %u \n " )
2018-03-09 12:15:32 +01:00
( " w " " Wiki Entry " entry ( file+headline " ~/cloud/org/wiki.org " " INBOX " )
2018-10-21 13:37:05 +02:00
" * %? \n CREATED: %u \n %i \n " ) ) )
2018-02-23 09:53:10 +01:00
2018-10-17 20:17:05 +02:00
;; set org refile targets
2018-10-17 20:23:19 +02:00
( setq org-refile-targets ' ( ( " ~/cloud/org/projects.org " :maxlevel . 3 ) ) )
2018-10-17 20:17:05 +02:00
2018-02-23 09:53:10 +01:00
;; warn of deadlines in the next seven days
( setq org-deadline-warning-days 7 )
;; show tasks in the next 14 days
( setq org-agenda-span ( quote fortnight ) )
2018-07-09 15:20:48 +02:00
;; org sorthing strategy
( setq org-agenda-sorting-strategy ' ( time-up priority-down ) )
2018-02-23 09:53:10 +01:00
;; don't show tasks as scheduled if they are already shown as a deadline
( setq org-agenda-skip-scheduled-if-deadline-is-shown t )
;; don't give awarning colour to tasks with impending deadlines
;; if they are scheduled to be done
( setq org-agenda-skip-deadline-prewarning-if-scheduled ( quote pre-scheduled ) )
;; mu4e connection
( require 'org-mu4e )
;; store link to message if in header view, not to header query
( setq org-mu4e-link-query-in-headers-mode nil )
2017-11-25 23:10:34 +01:00
:bind
( ( " C-c l " . org-store-link )
2018-03-09 12:15:32 +01:00
( " C-c c " . org-capture )
( " C-c o " . org-iswitchb )
( " C-c a " . org-agenda ) )
:hook ( org-mode-hook . flyspell-mode ) )
2017-11-25 23:10:34 +01:00
2018-07-09 15:20:59 +02:00
;; org-super-agenda
;; Supercharge your Org daily/weekly agenda by grouping items
( use-package org-super-agenda
:after org
:init ( org-super-agenda-mode 1 )
2018-10-17 20:17:05 +02:00
:config ( setq org-super-agenda-groups
' (
( :name " Today "
:time-grid t
:scheduled today )
( :name " Important from the past "
:and ( :priority " A " :scheduled past ) )
( :name " Waiting... "
:todo " WAIT " )
( :name " Scheduled earlier "
:scheduled past )
( :name " Not scheduled "
:scheduled nil )
( :priority<= " B " ) ) ) )
2018-07-09 15:20:59 +02:00
2017-11-25 23:10:34 +01:00
;; fill-column-indicator
;; Graphically indicate the fill column
( use-package fill-column-indicator
:config
2018-02-23 09:52:42 +01:00
( setq
;; set rule width to 5px
fci-rule-width 5
;; set rule color
fci-rule-color " #5B6268 " ) )
2017-11-25 23:10:34 +01:00
;; diff-hl
;; Highlight uncommitted changes using VC
( use-package diff-hl
2018-02-23 09:45:50 +01:00
:defer nil
:config ( global-diff-hl-mode t )
2018-02-23 09:40:59 +01:00
:hook ( magit-post-refresh-hook . diff-hl-magit-post-refresh ) )
2017-11-25 23:10:34 +01:00
2018-08-03 09:21:16 +02:00
;; winum
;; Navigate windows and frames using numbers
( use-package winum
:config ( winum-mode ) )
2017-11-25 23:10:34 +01:00
;; treemacs
;; A tree style file explorer package
( use-package treemacs
:init
2018-08-03 09:21:51 +02:00
( with-eval-after-load 'winum
( define-key winum-keymap ( kbd " M-0 " ) #' treemacs-select-window ) )
2017-11-25 23:10:34 +01:00
:config
2018-08-03 09:21:51 +02:00
( setq treemacs-is-never-other-window t
treemacs-project-follow-cleanup t
treemacs-python-executable ( executable-find " python3 " )
treemacs-recenter-after-file-follow t )
2017-11-25 23:10:34 +01:00
( treemacs-follow-mode t )
2018-08-03 09:21:51 +02:00
( treemacs-git-mode 'extended )
( treemacs-filewatch-mode )
2017-11-25 23:10:34 +01:00
:bind
( :map global-map
2018-08-03 09:21:51 +02:00
( " M-0 " . treemacs-select-window )
( " C-x t 1 " . treemacs-delete-other-window )
( " C-x t t " . treemacs )
( " C-x t B " . treemacs-bookmark )
( " C-x t C-t " . treemacs-find-file )
( " C-x t M-t " . treemacs-find-tag ) ) )
2017-11-25 23:10:34 +01:00
;; treemacs-projectile
;; Projectile integration for treemacs
( use-package treemacs-projectile
2018-08-03 09:21:51 +02:00
:after treemacs projectile )
2017-11-25 23:10:34 +01:00
;; magit
;; A Git porcelain inside Emacs
( use-package magit
:bind
( " C-x g " . magit-status ) )
2018-02-23 09:53:21 +01:00
;; rainbow-delimiters
2017-11-25 23:10:34 +01:00
;; Highlight brackets according to their depth
( use-package rainbow-delimiters
:config
( add-hook 'prog-mode-hook #' rainbow-delimiters-mode ) )
;; pdf-tools
;; Support library for PDF documents.
( use-package pdf-tools
2018-08-18 05:27:40 +02:00
:defer t
2017-11-25 23:10:34 +01:00
:config
2018-02-23 09:53:51 +01:00
( pdf-tools-install ) )
2017-11-25 23:10:34 +01:00
;; counsel
;; Various completion functions using Ivy
( use-package counsel
:bind
( ( " M-x " . counsel-M-x )
( " C-x C-f " . counsel-find-file )
( " <f1> f " . counsel-describe-function )
( " <f1> v " . counsel-describe-variable )
( " <f1> l " . counsel-find-library )
( " <f2> i " . counsel-info-lookup-symbol )
( " <f2> u " . counsel-unicode-char )
( " C-c g " . counsel-git )
( " C-c j " . counsel-git-grep )
( " C-c k " . counsel-ag )
( " C-x l " . counsel-locate )
( " C-S-o " . counsel-rhythmbox ) ) )
;; ivy
;; Incremental Vertical completYon
( use-package ivy
:diminish ( ivy-mode )
:config
( ivy-mode t )
2018-02-23 09:55:00 +01:00
( setq ivy-use-virtual-buffers t
ivy-count-format " (%d/%d) "
ivy-display-style 'fancy
2018-03-12 11:31:00 +01:00
ivy-extra-directories nil
ivy-initial-inputs-alist nil )
2017-11-25 23:10:34 +01:00
:bind
( ( " C-c C-r " . ivy-resume ) ) )
;; swiper
;; Isearch with an overview. Oh, man!
( use-package swiper
:config
2018-02-23 09:52:42 +01:00
( ivy-mode 1 )
( setq ivy-use-virtual-buffers t
ivy-display-style 'fancy
ivy-extra-directories nil )
2017-11-25 23:10:34 +01:00
:bind
( ( " C-s " . swiper )
2018-02-23 09:55:00 +01:00
( " C-r " . swiper )
:map read-expression-map
( " C-r " . counsel-expression-history ) ) )
2017-11-25 23:10:34 +01:00
;; counsel-projectile
;; Ivy UI for Projectile
( use-package counsel-projectile
2018-02-23 09:45:50 +01:00
:after ( projectile )
2017-11-25 23:10:34 +01:00
:config
2018-02-23 09:45:50 +01:00
( counsel-projectile-mode ) )
2017-11-25 23:10:34 +01:00
;; avy
;; Jump to arbitrary positions in visible text and select text quickly.
( use-package avy
:bind
2018-03-12 11:31:16 +01:00
( ( " s-s " . avy-goto-char-2 )
( " s-l " . avy-goto-line ) ) )
2017-11-25 23:10:34 +01:00
;; smooth-scrolling
;; Make emacs scroll smoothly
( use-package smooth-scrolling
:config
( smooth-scrolling-mode t )
( setq smooth-scroll-margin 5 ) )
;; ox-pandoc
;; org exporter for pandoc
( use-package ox-pandoc
2018-02-23 09:48:43 +01:00
:mode ( " \\ .org$ " . org-mode )
2017-11-25 23:10:34 +01:00
:config
2018-02-23 09:52:42 +01:00
;; use lualatex instead of pdflatex
( setq org-pandoc-options-for-latex-pdf ' ( ( latex-engine . " lualatex " ) )
org-pandoc-options-for-beamer-pdf ' ( ( latex-engine . " lualatex " ) ) ) )
2017-11-25 23:10:34 +01:00
;; web-beautify
;; Format HTML, CSS and JavaScript/JSON
( use-package web-beautify
:bind
( :map js2-mode-map ( " C-c b " . web-beautify-js )
:map json-mode-map ( " C-c b " . web-beautify-js )
:map html-mode-map ( " C-c b " . web-beautify-html )
:map css-mode-map ( " C-c b " . web-beautify-css ) ) )
2017-11-25 23:22:32 +01:00
;; company
;; Modular text completion framework
( use-package company
2018-03-01 10:39:54 +01:00
:diminish company-mode
2017-11-28 00:11:13 +01:00
:init
( global-company-mode t )
2017-11-25 23:22:32 +01:00
:config
2017-11-28 00:11:13 +01:00
( setq company-show-numbers t ) )
2017-11-25 23:22:32 +01:00
2017-11-25 23:10:34 +01:00
;; company-math
;; Completion backends for unicode math symbols and latex tags
( use-package company-math
2018-02-23 09:40:59 +01:00
:after ( company tex )
:hook ( TeX-mode-hook . ( lambda ( )
( setq-local company-backends
( append ' ( ( company-math-symbols-latex company-latex-commands ) )
company-backends ) ) ) ) )
2018-02-23 09:45:50 +01:00
( use-package company-shell
:after ( company shell-mode ) )
2017-11-25 23:10:34 +01:00
;; beginend
;; Redefine M-< and M-> for some modes
( use-package beginend
2018-10-21 13:37:36 +02:00
:load-path " beginend/ "
2018-03-01 10:39:54 +01:00
:diminish ( beginend-global-mode
beginend-prog-mode
beginend-magit-status-mode )
2017-11-25 23:10:34 +01:00
:config
( beginend-global-mode t ) )
;; markdown-mode
;; Major mode for Markdown-formatted text
( use-package markdown-mode
:commands ( markdown-mode gfm-mode )
:mode ( ( " README \\ .md \\ ' " . markdown-mode )
( " \\ .md \\ ' " . markdown-mode )
( " \\ .markdown \\ ' " . markdown-mode ) )
2018-02-23 09:55:15 +01:00
:init ( setq markdown-command " kramdown " ) )
2017-11-25 23:10:34 +01:00
;; markdown-preview-mode
;; markdown realtime preview minor mode
( use-package markdown-preview-mode
2018-02-23 09:48:43 +01:00
:after ( markdown-mode )
2017-11-25 23:10:34 +01:00
:config
( add-to-list 'markdown-preview-javascript " http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML " ) )
;; web-mode
;; major mode for editing web templates
( use-package web-mode
2018-02-23 09:48:43 +01:00
:mode
( ( " \\ .phtml \\ ' " . web-mode ) )
( ( " \\ .tpl \\ .php \\ ' " . web-mode ) )
( ( " \\ .[agj]sp \\ ' " . web-mode ) )
( ( " \\ .erb \\ ' " . web-mode ) )
( ( " \\ .mustache \\ ' " . web-mode ) )
( ( " \\ .djhtml \\ ' " . web-mode ) )
( ( " \\ .html? \\ ' " . web-mode ) )
( ( " \\ .css? \\ ' " . web-mode ) )
2017-11-25 23:10:34 +01:00
:config
2018-02-23 09:52:42 +01:00
( setq web-mode-markup-indent-offset 2
web-mode-css-indent-offset 2
web-mode-enable-css-colorization t
web-mode-code-indent-offset 2
web-mode-indent-style 2 ) )
2017-11-25 23:10:34 +01:00
2018-08-18 05:28:16 +02:00
;; LESS style sheet support
( use-package less-css-mode
:mode ( ( " \\ .less \\ ' " . less-css-mode ) ) )
2018-02-23 09:55:34 +01:00
;; js2-mode
;; Major mode for editing JavaScript files
( use-package js2-mode
:mode ( ( " \\ .js \\ ' " . js2-mode ) ) )
2017-11-25 23:10:34 +01:00
;; dart-mode
;; Major mode for editing Dart files
2018-02-23 09:48:43 +01:00
( use-package dart-mode
:mode ( ( " \\ .dart \\ ' " . dart-mode ) ) )
2017-11-25 23:10:34 +01:00
2018-08-09 23:09:09 +02:00
;; ruby
;; Support for the ruby language
( use-package enh-ruby-mode
:after ( robe inf-ruby )
:mode ( ( " \\ (?: \\ .rb \\ |ru \\ |rake \\ |thor \\ |jbuilder \\ |gemspec \\ |podspec \\ |/ \\ (?:Gem \\ |Rake \\ |Cap \\ |Thor \\ |Vagrant \\ |Guard \\ |Pod \\ )file \\ ) \\ ' " . enh-ruby-mode ) )
:hook ( ( 'enh-ruby-mode-hook 'robe-mode )
( 'enh-ruby-mode-hook 'inf-ruby-minor-mode ) ) )
( use-package robe
:after ( company-mode )
:config ( push 'company-robe company-backends ) )
( use-package inf-ruby
:defer t )
2017-11-25 23:10:34 +01:00
;; csv-mode
;; Major mode for editing comma/char separated values
( use-package csv-mode
2018-02-23 09:48:43 +01:00
:mode ( ( " \\ .csv \\ ' " . csv-mode ) )
:config ( setq csv-separators ' ( " ; " ) ) )
2017-11-25 23:10:34 +01:00
;; json-mode
;; Major mode for editing JSON files
2018-02-23 09:48:43 +01:00
( use-package json-mode
:mode ( ( " \\ .json \\ ' " . json-mode ) ) )
2017-11-25 23:10:34 +01:00
;; focus
;; Dim the font color of text in surrounding sections
2018-02-23 09:45:50 +01:00
( use-package focus
:defer t )
2017-11-25 23:10:34 +01:00
;; phpunit
;; Launch PHP unit tests using phpunit
( use-package phpunit
:bind
( :map web-mode-map
( " C-x t " . phpunit-current-test )
( " C-x c " . phpunit-current-class )
( " C-x p " . phpunit-current-project ) ) )
;; php-mode
;; Major mode for editing PHP files
2018-02-23 09:48:43 +01:00
( use-package php-mode
:mode ( ( " \\ .php \\ ' " . php-mode ) ) )
2017-11-25 23:10:34 +01:00
;; fish-mode
;; Major mode for fish shell scripts
2018-02-23 09:48:43 +01:00
( use-package fish-mode
:mode ( ( " \\ .fish \\ ' " . fish-mode ) ) )
2017-11-25 23:10:34 +01:00
;; easy-hugo
;; Write blogs made with hugo by markdown or org-mode
2018-02-23 09:45:50 +01:00
( use-package easy-hugo
:defer t )
2017-11-25 23:10:34 +01:00
;; stumpwm-mode
;; special lisp mode for evaluating code into running stumpwm
2018-02-23 09:48:43 +01:00
( use-package stumpwm-mode
:mode ( ( " stumpwmrc " . stumpwm-mode ) ) )
2017-11-25 23:10:34 +01:00
;; slime
;; Superior Lisp Interaction Mode for Emacs
( use-package slime
2018-02-23 09:48:43 +01:00
:mode ( ( " \\ .lisp \\ ' " . slime )
( " stumpwmrc " . slime ) )
2017-11-25 23:10:34 +01:00
:config
( load ( expand-file-name " ~/quicklisp/slime-helper.el " ) )
( setq inferior-lisp-program " /usr/bin/sbcl " ) )
;; slime-company
;; slime completion backend for company mode
( use-package slime-company
2018-02-23 09:48:43 +01:00
:after ( slime company )
2017-11-25 23:10:34 +01:00
:config
( setq slime-contribs ' ( slime-fancy slime-company ) ) )
;; yaml-mode
;; Major mode for editing YAML files
( use-package yaml-mode
:config
( add-to-list 'auto-mode-alist ' ( " \\ .yml \\ ' " . yaml-mode ) ) )
;; sass-mode
;; Major mode for editing Sass files
2018-02-23 09:48:43 +01:00
( use-package sass-mode
:mode ( ( " \\ .scss \\ ' " . scss-mode )
( " \\ .sass \\ ' " . sass-mode ) ) )
2017-11-25 23:10:34 +01:00
;; coffee-mode
;; Major mode for CoffeeScript code
( use-package coffee-mode
2018-02-23 09:48:43 +01:00
:mode ( ( " \\ .coffee \\ ' " . coffee-mode ) )
2018-02-23 09:52:42 +01:00
:config ( setq whitespace-action ' ( auto-cleanup )
whitespace-style ' ( trailing space-before-tab indentation empty space-after-tab )
coffee-tab-width 2 )
2018-02-23 09:40:59 +01:00
:hook ( coffee-mode-hook whitespace-mode ) )
2017-11-25 23:10:34 +01:00
;; python
;; Python's flying circus support for Emacs
( use-package python
2018-02-23 09:48:43 +01:00
:mode ( ( " \\ .py \\ ' " . python-mode ) )
2018-02-23 09:52:42 +01:00
:config ( setq flycheck-python-pylint-executable " pylint3 " ) )
2017-11-28 00:11:30 +01:00
2018-02-23 09:55:43 +01:00
;; moinmoin
;; Major mode for editing MoinMoin wiki entries
( use-package moinmoin
:load-path " moinmoin/ "
:mode ( ( " \\ .wiki \\ ' " . moinmoin-mode ) ) )
2018-08-03 09:38:38 +02:00
;; typoscript-mode
;; A mode for TYPO3 typoscript
( use-package typoscript-mode
:mode ( ( " \\ .typoscript \\ ' " . typoscript-mode ) ) )
2017-11-28 00:19:06 +01:00
;; mu4e
;; emacs mail client
( use-package mu4e
2018-02-23 09:55:51 +01:00
:load-path " /usr/share/emacs/25.1/site-lisp/mu4e/ "
:commands mu4e
2017-11-28 00:19:06 +01:00
:config
;; get mail
( setq
2018-07-24 19:36:31 +02:00
mu4e-get-mail-command " mbsync -a "
mu4e-update-interval 300
mu4e-change-filenames-when-moving t )
2017-11-28 00:19:06 +01:00
;; faster reindexing
2018-02-23 09:52:42 +01:00
( setq mu4e-maildir-index-cleanup nil
mu4e-index-lazy-check t )
2017-11-28 00:19:06 +01:00
;; smtpmail settings
( setq message-send-mail-function 'smtpmail-send-it
2018-02-23 09:52:42 +01:00
send-mail-function 'smtpmail-send-it )
2017-11-28 00:19:06 +01:00
2018-02-23 09:52:42 +01:00
;; general mu4e options
( setq
;; use mu4e as default emacs mailer
mail-user-agent 'mu4e-user-agent
;; don't keep message buffers around
message-kill-buffer-on-exit t
;; don't save sent messages to "Sent" folder
mu4e-sent-messages-behavior 'delete
;; complete date format
mu4e-headers-date-format " %Y-%m-%d %H:%M "
;; show full addresses
mu4e-view-show-addresses 't
;; attachment directory
mu4e-attachment-dir " /tmp "
;; don't reply to myself
mu4e-compose-dont-reply-to-self t
;; maildir
2018-07-24 19:36:31 +02:00
mu4e-maildir " ~/.mbsync "
2018-02-23 09:52:42 +01:00
;; use correct account context when sending mail based from headers
message-sendmail-envelope-from 'header )
2017-11-28 00:19:06 +01:00
;; list of email addresses
2018-02-23 09:52:42 +01:00
( setq mu4e-user-mail-address-list
' ( " marcel.kapfer@uni-ulm.de "
" marcel@marcel-kapfer.de "
" tex@mmk2410.org "
" me@mmk2410.org "
" debian@mmk2410.org "
" hugo@marcel-kapfer.de "
" info@marcel-kapfer.de "
" contact@marcel-kapfer.de "
" kontakt@marcel-kapfer.de "
" opensource@mmk2410.org " ) )
2017-11-28 00:19:06 +01:00
2018-03-09 12:15:45 +01:00
;; custom header field for maildir
( add-to-list 'mu4e-header-info-custom
' ( :mdir . ( :name " Maildir "
:shortname " Maildir "
:help " Maildir of current message "
:function ( lambda ( msg )
( or
( replace-regexp-in-string
" ^/ \\ (. \\ )[A-Za-z0-9]* "
" \\ 1 "
( mu4e-message-field msg :maildir ) )
" " ) ) ) ) )
2017-11-28 00:19:06 +01:00
;; customize mu4e list view
2018-02-23 09:52:42 +01:00
( setq mu4e-headers-fields
' ( ( :human-date . 20 )
( :flags . 6 )
2018-03-09 12:15:45 +01:00
( :mdir . 15 )
2018-03-01 10:46:38 +01:00
( :mailing-list . 15 )
2018-02-23 09:52:42 +01:00
( :from-or-to . 22 )
( :subject . nil ) ) )
2017-11-28 00:19:06 +01:00
;; convenience function for starting the whole mu4e in its own frame
;; posted by the author of mu4e on the mailing list
( defun mu4e-in-new-frame ( )
" Start mu4e in new frame. "
( interactive )
( select-frame ( make-frame ) )
( mu4e ) )
;; set citation line
2018-06-28 21:38:23 +02:00
( setq message-citation-line-format " %f @ %Y-%m-%d %T %Z: \n " )
( setq message-citation-line-function
( lambda ( )
( message-insert-formatted-citation-line
nil nil ( car ( current-time-zone ) ) ) ) )
2017-11-28 00:19:06 +01:00
2018-05-22 21:09:43 +02:00
;; macro for creating university mu4e contexts
( defmacro mu4e-add-university-context ( context-name match-func mail-address full-name signature-file )
" Add a university context to ` mu4e-contexts.
context-name is the name of the context.
match-func a function when the context should be selected.
full-name is the full name of the sender.
mail-address is the mail address of the sender.
signature-file is the path to the file which contains the signature. "
` ( add-to-list
'mu4e-contexts
( make-mu4e-context
:name , context-name
:enter-func ( lambda ( ) ( mu4e-message , ( concat context-name " Context " ) ) )
:match-func , match-func
:vars ' ( ( user-mail-address . , mail-address )
( user-full-name . , full-name )
( message-signature-file . , signature-file )
;; smtp
( smtpmail-stream-type . starttls )
( smtpmail-default-smtp-server . " smtp.uni-ulm.de " )
( smtpmail-smtp-server . " smtp.uni-ulm.de " )
( smtpmail-smtp-user . " ftu15 " )
( smtpmail-smtp-service . 587 )
;; folders
( mu4e-sent-folder . " /university/Sent " )
( mu4e-drafts-folder . " /university/Drafts " )
( mu4e-trash-folder . " /university/Trash " )
( mu4e-refile-folder . " /university/Archives " ) ) )
t ) )
2017-11-28 00:19:06 +01:00
;; mu4e contexts / mail identities
( setq mu4e-contexts
` ( , ( make-mu4e-context
:name " Mailbox "
:enter-func ( lambda ( ) ( mu4e-message " Mailbox Context " ) )
:match-func ( lambda ( msg )
( when msg
( string-prefix-p " /mailbox " ( mu4e-message-field msg :maildir ) ) ) )
:vars ' ( ( user-mail-address . " marcel.kapfer@mailbox.org " )
( user-full-name . " Marcel Kapfer " )
( message-signature-file . " ~/dotfiles/mutt/sig " )
;; smtp
( smtpmail-stream-type . ssl )
( smtpmail-smtp-server . " smtp.mailbox.org " )
( smtpmail-smtp-user . " marcel.kapfer@mailbox.org " )
( smtpmail-smtp-service . 465 )
;; folders
( mu4e-sent-folder . " /mailbox/Sent " )
( mu4e-drafts-folder . " /mailbox/Drafts " )
( mu4e-trash-folder . " /mailbox/Trash " )
( mu4e-refile-folder . " /mailbox/Archives " ) ) ) ) )
2018-05-22 21:09:43 +02:00
;; university contexts
( mu4e-add-university-context
" A University "
2018-05-23 17:57:33 +02:00
nil
2018-05-22 21:09:43 +02:00
" marcel.kapfer@uni-ulm.de "
" Marcel Kapfer "
2018-08-06 08:52:39 +02:00
nil )
2018-05-22 21:09:43 +02:00
( mu4e-add-university-context
" B StuVe Oeff-Ref "
nil
" stuve.oeffentlichkeit@uni-ulm.de "
" StuVe Öffentlichkeitsreferat "
" ~/dotfiles/dotdotfiles/sig/stuve-oeffentlichkeit " )
( mu4e-add-university-context
" C BECI-Fest "
nil
" becifest.kontakt@uni-ulm.de "
" BECI-Fest "
" ~/dotfiles/dotdotfiles/sig/becifest " )
( mu4e-add-university-context
" D SoNaFe "
nil
" kontakt@sonafe.de "
2018-08-06 08:52:17 +02:00
" Sommernachtsfest (SoNaFe) "
2018-05-22 21:09:43 +02:00
" ~/dotfiles/dotdotfiles/sig/sonafe-kontakt " )
( mu4e-add-university-context
" E FIN Vorstand "
nil
" vorstand.fin@uni-ulm.de "
" FIN Vorstand "
" ~/dotfiles/dotdotfiles/sig/fin-vorstand " )
( mu4e-add-university-context
" F FIN Oeff-Team "
nil
" oeffentlichkeit.fin@uni-ulm.de "
" FIN Öffentlichkeits-Team "
" ~/dotfiles/dotdotfiles/sig/fin-oeffentlichkeit " )
2018-10-21 19:14:21 +02:00
( mu4e-add-university-context
" G StuPa Sitzungsleitung "
nil
" stuve.sitzungsleitung@uni-ulm.de "
" StuPa Sitzungsleitung "
" ~/dotfiles/dotdotfiles/sig/stupa-sitzungsleitung " )
2017-11-28 00:19:06 +01:00
;; custom bookmarks
( setq mu4e-bookmarks ( delete ' ( " flag:unread AND NOT flag:trashed " " Unread messages " 117 ) mu4e-bookmarks ) )
( add-to-list 'mu4e-bookmarks
( make-mu4e-bookmark
2018-05-16 07:32:41 +02:00
:name " Open Messages "
2018-07-16 08:51:48 +02:00
:query " (flag:unread AND NOT flag:trashed AND NOT m:/university/fin/service/open) OR m:/university/inbox OR m:/mailbox/inbox OR m:/university/oeffref/inbox "
2018-05-16 07:32:41 +02:00
:key ?o ) )
2018-02-23 09:56:58 +01:00
( add-to-list 'mu4e-bookmarks
( make-mu4e-bookmark
2018-05-16 07:32:41 +02:00
:name " Open University Messages "
2018-07-16 08:51:48 +02:00
:query " (flag:unread AND NOT flag:trashed AND m:/university/* AND NOT m:/university/fin/service/open) OR m:/university/inbox OR m:/university/oeffref/inbox "
2017-11-28 00:19:06 +01:00
:key ?u ) )
2018-05-16 07:32:41 +02:00
( add-to-list 'mu4e-bookmarks
( make-mu4e-bookmark
:name " Open Private Messages "
:query " (flag:unread AND NOT flag:trashed AND m:/mailbox/*) OR m:/mailbox/inbox "
:key ?m ) )
2017-11-28 00:19:06 +01:00
( add-to-list 'mu4e-bookmarks
( make-mu4e-bookmark
:name " Flagged messages "
2018-02-23 09:56:58 +01:00
:query " flag:flagged AND NOT flag:trashed "
2017-11-28 00:19:06 +01:00
:key ?f ) )
;; custom shortcuts
( setq mu4e-maildir-shortcuts
' ( ( " /university/inbox " . ?u )
2018-02-23 09:52:42 +01:00
( " /university/fin/fin " . ?f )
( " /university/fin/intern " . ?i )
2018-05-13 15:54:13 +02:00
( " /university/fin/service/open " . ?s )
2017-11-28 00:19:06 +01:00
( " /mailbox/inbox " . ?m )
2018-02-23 09:52:42 +01:00
( " /mailbox/debian/devel-changes " . ?c )
( " /mailbox/debian/user " . ?d ) ) )
2017-11-28 00:19:06 +01:00
2018-02-23 09:57:09 +01:00
;; enable spell checking
( add-hook 'mu4e-compose-mode-hook #' flyspell-mode )
;; always BCC myself
( add-hook 'mu4e-compose-mode-hook ( lambda ( ) ( save-excursion ( message-add-header ( concat " Bcc: " user-mail-address " \n " ) ) ) ) )
;; sign message
2018-05-22 21:09:58 +02:00
;; (add-hook 'mu4e-compose-mode-hook (lambda () (mml-secure-message-sign-pgpmime))))
)
2017-11-28 00:19:06 +01:00
2017-11-28 00:11:57 +01:00
;; elfeed
;; emacs feed reader
( use-package elfeed
2018-08-18 05:27:40 +02:00
:defer t
2017-11-28 00:11:57 +01:00
:config
( defun elfeed-search-format-date ( date )
( format-time-string " %Y-%m-%d %H:%M " ( seconds-to-time date ) ) ) )
2017-11-28 00:12:14 +01:00
2018-05-13 16:17:06 +02:00
;; elfeed-protocol
;; use Nextcloud as RSS server
( use-package elfeed-protocol
2018-02-23 09:57:18 +01:00
:after ( elfeed )
:config
2018-05-13 16:17:06 +02:00
( setq elfeed-use-curl t )
( elfeed-set-timeout 36000 )
( setq elfeed-feeds ( list
( list " owncloud+https://mmk2410@cloud.mmk2410.org "
:password ( funcall
( plist-get
( nth 0
( auth-source-search
:host " cloud.mmk2410.org "
2018-08-10 11:23:08 +02:00
:user " mmk2410 "
:require ' ( :secret ) ) )
2018-05-13 16:17:06 +02:00
:secret ) ) ) ) )
( elfeed-protocol-enable ) )
2017-11-28 00:12:14 +01:00
;; bug-hunter
;; Hunt down errors by bisecting elisp files
2018-02-23 09:45:50 +01:00
( use-package bug-hunter
:defer t )
2017-11-28 00:12:36 +01:00
2017-11-28 00:12:45 +01:00
;; hl-todo
;; highlight TODOs and similar keywords
( use-package hl-todo
:init ( global-hl-todo-mode ) )
2017-11-28 00:12:55 +01:00
;; yasnippets
;; Yet another snippet extension for Emacs.
2018-02-23 09:45:50 +01:00
( use-package yasnippet )
2017-11-28 00:12:55 +01:00
2017-11-28 00:13:06 +01:00
;; company-quickhelp
;; Documentation popup for Company
( use-package company-quickhelp
2018-02-23 09:45:50 +01:00
:after ( company )
2017-11-28 00:13:06 +01:00
:init
( company-quickhelp-mode 1 )
:config
( setq company-quickhelp-delay 0.5 ) )
2017-11-28 00:18:21 +01:00
;; LaTeX with AUCTeX
;; Integrated environment for TeX
( use-package tex-site
;; AUCTeX initialization
:ensure auctex )
;; LaTeX with AUCTeX
;; Integrated environment for TeX
( use-package tex
:ensure auctex
:config
( setq
;; Parse file after loading it if no style hook is found for it.
TeX-parse-self t
;; Automatically save style information when saving the buffer.
TeX-auto-save t
;; Automatically interst braces after sub- and superscript in math mode
2018-02-23 09:57:31 +01:00
;; TeX-electric-sub-and-superscript t
2017-11-28 00:18:21 +01:00
;; Don't ask the user when saving a file for each file.
TeX-save-query nil
;; enable synctex correlation.
TeX-source-correlate-mode t
TeX-source-correlate-start-server t
;; use pdf-tools with synctex
TeX-view-program-selection ' ( ( output-pdf " PDF Tools " ) )
2018-02-23 09:52:42 +01:00
TeX-source-correlate-start-server t )
( setq-default
;; set to nil, so AUCTeX always asks for the master file
TeX-master nil
;; use a decent, modern TeX engine
TeX-engine 'luatex ) )
2017-11-28 00:18:21 +01:00
;; LaTeX with AUCTeX
;; Integrated environment for TeX
( use-package tex-buf
:ensure auctex
2018-08-18 05:27:40 +02:00
:defer t
2017-11-28 00:18:21 +01:00
;; Don't ask for confirmation when saving before processing
:config ( setq TeX-save-query nil ) )
;; LaTeX with AUCTeX
;; Integrated environment for TeX
( use-package tex-style
:ensure auctex
2018-08-18 05:27:40 +02:00
:defer t
2017-11-28 00:18:21 +01:00
:config
;; Enable support for csquotes
( setq LaTeX-csquotes-close-quote " } "
2018-02-23 09:58:14 +01:00
LaTeX-csquotes-open-quote " \\ enquote{ " ) )
2017-11-28 00:18:21 +01:00
;; LaTeX with AUCTeX
;; Integrated environment for TeX
( use-package tex-fold
:ensure auctex
2018-08-18 05:27:40 +02:00
:defer t
2017-11-28 00:18:21 +01:00
:init ( add-hook 'TeX-mode-hook #' TeX-fold-mode ) )
;; LaTeX with AUCTeX
;; Integrated environment for TeX
( use-package tex-mode
2018-08-18 05:27:40 +02:00
:ensure auctex
:defer t )
2017-11-28 00:18:21 +01:00
;; LaTeX with AUCTeX
;; Integrated environment for TeX
( use-package latex
:ensure auctex
2018-08-18 05:27:40 +02:00
:defer t
2017-11-28 00:18:21 +01:00
:config
;; No language-specific hyphens please
( setq LaTeX-babel-hyphen nil )
2018-02-23 09:58:22 +01:00
;; helper for a new (La)TeX style guide concept.
;; inserts a line break, a empty comment line and another line break
( defun TeX-insert-comment-line ( )
" Insert a linebreak followed by a '%' and another line break "
( interactive )
( newline-and-indent )
( insert " % " )
( newline-and-indent ) )
2017-11-28 00:18:21 +01:00
;; Easy math input
( add-hook 'TeX-mode-hook #' LaTeX-math-mode )
;; Start flyspell
( add-hook 'TeX-mode-hook #' flyspell-mode )
;; Update PDF buffers after successful LaTeX runs
( add-hook 'TeX-after-TeX-LaTeX-command-finished-hook
#' TeX-revert-document-buffer )
;; hooks for outline mode
( add-hook 'TeX-mode-hook #' outline-minor-mode )
;; reload pdf document after compliation
( add-hook 'TeX-after-compilation-finished-functions
#' TeX-revert-document-buffer )
;; hook for rainbox delimiters mode
( add-hook 'TeX-mode-hook #' rainbow-delimiters-mode )
;; start fci-mode
( add-hook 'TeX-mode-hook #' fci-mode )
;; start auto-fill mode
2018-02-23 09:58:39 +01:00
( add-hook 'TeX-mode-hook #' auto-fill-mode )
:bind ( :map latex-mode-map
( " <C-return> " . TeX-insert-comment-line ) ) )
2017-11-28 00:18:21 +01:00
;; bibtex
;; BibTeX editing
( use-package bibtex
2018-08-18 05:27:40 +02:00
:after ( latex )
2017-11-28 00:18:21 +01:00
;; Use a modern BibTeX dialect
2018-02-23 09:58:58 +01:00
:config ( bibtex-set-dialect 'biblatex )
2018-02-23 09:40:59 +01:00
;; Run prog mode hooks for bibtex
:hook ( bibtex-mode-hook . ( lambda ( ) ( run-hooks 'prog-mode-hook ) ) ) )
2017-11-28 00:18:21 +01:00
;; reftex
;; TeX cross-reference management
( use-package reftex
2018-08-18 05:27:40 +02:00
:after ( latex )
2017-11-28 00:18:21 +01:00
:diminish reftex-mode
:config
( setq
;; Plug into AUCTeX
reftex-plug-into-AUCTeX t
;; Automatically derive labels, and prompt for confirmation
2018-02-23 09:59:25 +01:00
reftex-insert-label-flags ' ( t t ) )
:hook ( LaTeX-mode-hook . reftex-mode ) )
2017-11-28 00:18:21 +01:00
2017-11-28 00:17:57 +01:00
;; term / ansi-term
;; terminal in emacs
( use-package term
2018-08-18 05:27:40 +02:00
:defer t
2017-11-28 00:17:57 +01:00
:init ( defalias 'sh 'ansi-term )
:config
;; set default shell
;; from https://ogbe.net/emacsconfig.html
( defvar my-term-shell " /usr/bin/fish " )
( defadvice ansi-term ( before force-bash )
( interactive ( list my-term-shell ) ) )
( ad-activate 'ansi-term )
;; close ansi-term, when shell session exists
;; from https://ogbe.net/emacsconfig.html
( defadvice term-sentinel ( around my-advice-term-sentinel ( proc msg ) )
( if ( memq ( process-status proc ) ' ( signal exit ) )
( let ( ( buffer ( process-buffer proc ) ) )
ad-do-it
( kill-buffer buffer ) )
ad-do-it ) )
( ad-activate 'term-sentinel )
2018-05-13 16:17:29 +02:00
( add-hook 'term-mode-hook ( lambda ( )
;; disable nlinum in shell
( nlinum-mode -1 )
;; enable visual line mode
( visual-line-mode 1 ) ) )
2018-02-23 09:40:59 +01:00
2018-02-23 09:59:58 +01:00
:bind ( ( " C-c s " . ansi-term )
:map term-raw-map
( " C-y " . term-paste ) ) )
2018-02-23 10:03:01 +01:00
;; saveplace
;; save the last cursor position in a file
( use-package saveplace
:init ( save-place-mode t ) )
2018-02-23 10:03:08 +01:00
;; tramp
;; do stuff over ssh at al.
( use-package tramp
2018-08-18 05:27:40 +02:00
:defer t
2018-02-23 10:03:08 +01:00
:init
;; Set default connection method for TRAMP
2018-03-13 16:47:48 +01:00
( setq tramp-default-method " ssh " )
( require 'em-tramp )
( setq password-cache-expiry 3600 ) )
2018-03-01 10:40:06 +01:00
2018-03-09 12:17:01 +01:00
;; edit-server
( use-package edit-server
:init ( edit-server-start ) )
2018-03-09 12:17:08 +01:00
;; org-moinmoin
;; moinmoin export in org-mode
( use-package ox-moinmoin
2018-08-18 05:27:40 +02:00
:after ( org )
2018-03-09 12:17:08 +01:00
:load-path " org-moinmoin/ " )
2018-05-13 16:18:22 +02:00
;; ox-reveal
;; Exports Org-mode contents to Reveal.js HTML presentation.
( use-package ox-reveal
:after ( org ) )
2018-07-09 15:21:14 +02:00
;; org-tree-slide
( use-package org-tree-slide
:after ( org )
:bind ( :map org-tree-slide-mode-map
( " <f9> " . org-tree-slide-move-previous-tree )
( " <f10> " . org-tree-slide-move-next-tree )
:map org-mode-map
( " <f8> " . org-tree-slide-mode )
( " S-<f8> " . org-tree-slide-skip-done-toggle ) ) )
2018-03-12 12:04:20 +01:00
;; exec-path-from-shell
;; get environmet variables
( use-package exec-path-from-shell
:init
( exec-path-from-shell-initialize )
( exec-path-from-shell-copy-env " SSH_AUTH_SOCK " )
( exec-path-from-shell-copy-env " SSH_AGENT_PID " ) )
2018-07-09 15:21:09 +02:00
;; rust-mode
2018-08-18 05:27:40 +02:00
( use-package rust-mode
:mode ( ( " \\ .rs \\ ' " . rust-mode ) ) )
2018-08-03 07:58:26 +02:00
;; all-the-icons
;; A utility package to collect various Icon Fonts and propertized them within Emacs
( use-package all-the-icons )
;; spaceline
;; Powerline theme from Spacemacs
( use-package spaceline )
;; spaceline-all-the-icons
;; A Spaceline Mode Line theme using All The Icons
( use-package spaceline-all-the-icons
:after spaceline
:config ( spaceline-all-the-icons-theme ) )
2018-08-09 23:58:59 +02:00
;; org-wiki
;; A personal wiki system for Emacs
;; Using the verison ofYouhei Sasaki which uses ido instead of helm
( use-package org-wiki
:load-path " org-wiki/ "
:config
( setq org-wiki-location " ~/wiki " ) )
2018-10-21 13:38:36 +02:00
;; Nord theme
;; https://github.com/arcticicestudio/nord-emacs
2018-10-30 06:56:42 +01:00
;; (use-package nord-theme
;; :config
;; ;; fixed shitty Emacs behavior
;; ;; fix for theme not loading in deamon mode
;; (if (daemonp)
;; (add-hook 'after-make-frame-functions
;; (lambda (frame)
;; (with-selected-frame frame (load-theme 'nord t))))
;; (load-theme 'nord t)))
;; Doom theme
;; https://github.com/hlissner/emacs-doom-themes
( use-package doom-themes
:init
( setq doom-themes-enable-bold t
doom-themes-enable-italic t )
2018-10-21 13:38:36 +02:00
:config
2018-10-30 06:56:42 +01:00
( load-theme 'doom-one-light t )
( doom-themes-treemacs-config )
( doom-themes-org-config ) )