├── README.md ├── emacs └── .emacs.d │ ├── snippets │ └── haskell-mode │ │ ├── typed expression │ │ ├── case-clause │ │ └── case │ ├── init.el │ ├── custom.el │ ├── abbrev_defs │ └── emacs.org ├── zathura-sync.sh ├── .zprofile ├── .zshenv ├── .gitignore ├── i3status └── .config │ └── i3status │ └── config ├── .xmobarrc ├── nix └── .nixpkgs │ └── config.nix ├── .zshrc ├── .xmonad └── xmonad.hs └── i3 └── .config └── i3 └── config /README.md: -------------------------------------------------------------------------------- 1 | dotfiles 2 | ======== 3 | 4 | various dotfiles 5 | -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/haskell-mode/typed expression: -------------------------------------------------------------------------------- 1 | # key: ty 2 | # name: typed expression 3 | # -- 4 | (${1:e} :: ${2:Text}) 5 | -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/haskell-mode/case-clause: -------------------------------------------------------------------------------- 1 | # key: ca 2 | # name: case-clause 3 | # expand-env: ((yas-indent-line 'fixed)) 4 | # -- 5 | $1 -> $2 -------------------------------------------------------------------------------- /emacs/.emacs.d/init.el: -------------------------------------------------------------------------------- 1 | (setq load-prefer-newer t) 2 | (setq custom-file "~/.emacs.d/custom.el") 3 | (load "~/.emacs.d/emacs.el") 4 | (load "~/.emacs.d/custom.el") 5 | -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/haskell-mode/case: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: case 3 | # key: case 4 | # expand-env: ((yas-indent-line 'fixed)) 5 | # -- 6 | case ${1:var} of 7 | ${2:cond} -> ${3:value} 8 | $0 -------------------------------------------------------------------------------- /zathura-sync.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | pos="$1" 3 | pdffile="$2" 4 | zathura --synctex-forward "$pos" "$pdffile" || \ 5 | ( 6 | zathura -x "emacsclient --eval '(progn (find-file \"%{input}\") (goto-line %{line}))'" "$pdffile" & 7 | sleep 1; zathura --synctex-forward "$pos" "$pdffile" ) 8 | -------------------------------------------------------------------------------- /.zprofile: -------------------------------------------------------------------------------- 1 | typeset -U path 2 | path=(~/bin 3 | ~/.local/bin 4 | ~/.cabal/bin 5 | ~/code/arcanist/bin 6 | ~/.gem/ruby/2.4.0/bin 7 | ~/.node/bin 8 | ~/.cargo/bin 9 | ~/code/go/bin 10 | $path) 11 | systemctl --user import-environment PATH 12 | -------------------------------------------------------------------------------- /.zshenv: -------------------------------------------------------------------------------- 1 | export _JAVA_AWT_WM_NONREPARENTING=1 2 | export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' 3 | export BROWSER=firefox 4 | export EDITOR=emacsclient 5 | export GOPATH=~/code/go 6 | export MAILDIR=~/mail 7 | export MOZ_USE_XINPUT2=1 8 | export PURE_GIT_PULL=0 9 | export SSH_AUTH_SOCK=${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | #*# 3 | *.hi 4 | *.o 5 | *.elc 6 | /.zsh/antigen-hs 7 | /.xmonad/xmonad-x86_64-linux 8 | /.xmonad/xmonad.errors 9 | /.xmonad/history 10 | /emacs/.emacs.d/emacs.el 11 | /emacs/.emacs.d/notsynced/ 12 | /emacs/.emacs.d/org-clock-save.el 13 | /emacs/.emacs.d/eshell/ 14 | /emacs/.emacs.d/recentf 15 | /emacs/.emacs.d/tramp 16 | /emacs/.emacs.d/recentf 17 | /emacs/.emacs.d/tramp 18 | /emacs/.emacs.d/elpa/ 19 | /emacs/.emacs.d/async-bytecomp.log 20 | /emacs/.emacs.d/flycheck_org-clock-save.el 21 | /emacs/.emacs.d/request/ 22 | /emacs/.emacs.d/semanticdb/ 23 | /emacs/.emacs.d/.cask/ 24 | /emacs/.emacs.d/projectile-bookmarks.eld 25 | /emacs/.emacs.d/workbench.xmi 26 | /emacs/.emacs.d/.mc-lists.el 27 | /emacs/.emacs.d/projectile.cache 28 | /emacs/.emacs.d/oauth2.plstore 29 | /emacs/.emacs.d/emacs/.emacs.desktop.lock 30 | /emacs/.emacs.d/emacs/.emacs.desktop 31 | /emacs/.emacs.d/.sx/ 32 | /emacs/.emacs.d/url/ 33 | /emacs/.emacs.d/var/ 34 | /emacs/.emacs.d/.emacs.desktop 35 | /emacs/.emacs.d/.emacs.desktop.lock 36 | /emacs/.emacs.d/.org-id-locations 37 | /emacs/.emacs.d/bookmarks 38 | /emacs/.emacs.d/irony/bin/irony-server 39 | /emacs/.emacs.d/irony/cdb-json-projects 40 | /emacs/.emacs.d/network-security.data 41 | /emacs/.emacs.d/RFC/ 42 | -------------------------------------------------------------------------------- /i3status/.config/i3status/config: -------------------------------------------------------------------------------- 1 | # i3status configuration file. 2 | # see "man i3status" for documentation. 3 | 4 | # It is important that this file is edited as UTF-8. 5 | # The following line should contain a sharp s: 6 | # ß 7 | # If the above line is not correctly displayed, fix your editor first! 8 | 9 | general { 10 | colors = true 11 | interval = 5 12 | } 13 | 14 | order += "ipv6" 15 | order += "disk /" 16 | order += "run_watch DHCP" 17 | order += "run_watch VPN" 18 | order += "wireless wlp58s0" 19 | order += "ethernet enp57s0u1u4" 20 | order += "volume master" 21 | order += "battery 0" 22 | order += "load" 23 | order += "tztime local" 24 | 25 | wireless wlp58s0 { 26 | format_up = "W: (%quality at %essid) %ip" 27 | format_down = "W: down" 28 | } 29 | 30 | ethernet enp57s0u1u4 { 31 | # if you use %speed, i3status requires root privileges 32 | format_up = "E: %ip (%speed)" 33 | format_down = "E: down" 34 | } 35 | 36 | battery 0 { 37 | format = "%status %percentage %remaining" 38 | } 39 | 40 | tztime local { 41 | format = "%a %Y-%m-%d %H:%M:%S" 42 | } 43 | 44 | load { 45 | format = "%1min" 46 | } 47 | 48 | disk "/" { 49 | format = "/ %free" 50 | } 51 | 52 | disk "/home" { 53 | format = "/home %free" 54 | } 55 | 56 | volume master { 57 | format = "♪: %volume" 58 | format_muted = "♪: muted (%volume)" 59 | device = "pulse" 60 | } 61 | -------------------------------------------------------------------------------- /.xmobarrc: -------------------------------------------------------------------------------- 1 | Config 2 | { font = "xft:Source Code Pro:size=10" 3 | , bgColor = "#121212" 4 | , fgColor = "#AFAF87" 5 | , position = Top 6 | , lowerOnStart = True 7 | , commands = 8 | [ Run DynNetwork ["-t", " kb/s kb/s", "-w", "4"] 15 9 | , Run Date "%a %m-%d %H:%M:%S " "date" 10 10 | , Run Com "/usr/bin/cut" ["-d", " ", "-f", "1-3", "/proc/loadavg"] "load" 50 11 | , Run StdinReader 12 | , Run Kbd [("us(altgr-intl)", "US"), ("gb_de", "GB")] 13 | , Run Memory ["-p", "2", "-c", "0", "-S", "True", 14 | "-H", "80", "-h", "#D7005F", "-L", "50", "-l", "#87FF00", "-n", "#FF8700", 15 | "-t", "RAM: "] 50 16 | , Run Cpu ["-p", "2", "-c", "0", "-S", "True", 17 | "-H", "75", "-h", "#D7005F", "-L", "30", "-l", "#87FF00", "-n", "#FF8700", 18 | "-t", "CPU: "] 50 19 | , Run MPD ["-t", ": - "] 10 20 | , Run BatteryP ["BAT0"] 21 | ["-t", "<acstatus>/<watts> (<left>%)", 22 | "-L", "10", "-H", "80", "-p", "3", 23 | "--", "-O", "<fc=green>On</fc> - ", "-i", "", 24 | "-L", "-15", "-H", "-5", 25 | "-l", "red", "-m", "blue", "-h", "green"] 26 | 600 27 | ] 28 | , template = " %StdinReader% }{ %mpd% | %battery% | <fc=#B2B2B2>%dynnetwork%</fc><fc=#B2B2B2> | KEY: <fc=#87FF00>%kbd%</fc> | %memory% | %cpu% | <fc=#B973FF>%load%</fc></fc><fc=#3F3F3F> | </fc><fc=#D0CFD0>%date%</fc>" 29 | } 30 | -------------------------------------------------------------------------------- /emacs/.emacs.d/custom.el: -------------------------------------------------------------------------------- 1 | (custom-set-faces 2 | ;; custom-set-faces was added by Custom. 3 | ;; If you edit it by hand, you could mess it up, so be careful. 4 | ;; Your init file should contain only one such instance. 5 | ;; If there is more than one, they won't work right. 6 | ) 7 | (custom-set-variables 8 | ;; custom-set-variables was added by Custom. 9 | ;; If you edit it by hand, you could mess it up, so be careful. 10 | ;; Your init file should contain only one such instance. 11 | ;; If there is more than one, they won't work right. 12 | '(package-selected-packages 13 | '(editorconfig bazel jenkins typescript-mode bazel-mode intero glsl-mode ivy-xref academic-phrases wgrep yasnippet-snippets gist langtool flyspell-correct-ivy csharp-mode magit-svn all-the-icons counsel-projectile dired-subtree company ws-butler undo-tree ivy-hydra counsel swiper ivy use-package)) 14 | '(safe-local-variable-values 15 | '((eval set-input-method "TeX") 16 | (haskell-indent-spaces . 4) 17 | (haskell-process-type . cabal-repl) 18 | (eval c-set-offset 'access-label '-) 19 | (eval c-set-offset 'substatement-open 0) 20 | (eval c-set-offset 'arglist-cont-nonempty '+) 21 | (eval c-set-offset 'arglist-cont 0) 22 | (eval c-set-offset 'arglist-intro '+) 23 | (eval c-set-offset 'inline-open 0) 24 | (eval c-set-offset 'defun-open 0) 25 | (eval c-set-offset 'innamespace 0) 26 | (indicate-empty-lines . t) 27 | (intero-targets "servant-match:lib" "servant-match:test:test") 28 | (haskell-stylish-on-save . t) 29 | (buffer-file-coding-system . utf-8-unix) 30 | (ispell-dictionary . "en_GB") 31 | (TeX-source-correlate-method-active . synctex) 32 | (TeX-command-extra-options . "-shell-escape")))) 33 | -------------------------------------------------------------------------------- /nix/.nixpkgs/config.nix: -------------------------------------------------------------------------------- 1 | { 2 | allowUnfree = true; 3 | pulseaudio = true; 4 | packageOverrides = pkgs : rec { 5 | maven = pkgs.maven.override { 6 | jdk = pkgs.openjdk8; 7 | }; 8 | haskellngPackages = pkgs.haskell-ng.packages.ghc7101.override { 9 | overrides = self: super: { 10 | hindent = pkgs.stdenv.lib.overrideDerivation pkgs.haskellngPackages.hindent (attrs : { 11 | postInstall = '' 12 | install -d $out/share/emacs/site-lisp 13 | install "elisp/"*.el $out/share/emacs/site-lisp 14 | ''; 15 | }); 16 | ghci-ng = pkgs.haskellngPackages.mkDerivation { 17 | pname = "ghci-ng"; 18 | version = "0.0"; 19 | src = pkgs.fetchgit { 20 | url = "http://github.com/chrisdone/ghci-ng.git"; 21 | sha256 = "fe77bf57cddc3a626386fc9fab6ee8576d497276c858ca74baaea30b43333a93"; 22 | rev = "92e45782ab96c50bafef2001a14bef82479c4a70"; 23 | }; 24 | isLibrary = false; 25 | isExecutable = true; 26 | buildDepends = with pkgs.haskellngPackages; [ 27 | ghc-paths syb 28 | ]; 29 | testDepends = with pkgs; [ 30 | 31 | ]; 32 | homepage = "http://github.com/chrisdone/ghci-ng"; 33 | description = "Next generation ghci"; 34 | license = pkgs.stdenv.lib.licenses.bsd3; 35 | }; 36 | }; 37 | }; 38 | haskellng784 = pkgs.haskell-ng.packages.ghc784.override { 39 | overrides = self: super: {};}; 40 | libsigsegv = pkgs.stdenv.lib.overrideDerivation pkgs.libsigsegv ( oldAttr : {doCheck = false;} ); 41 | hsEnv = haskellngPackages.ghcWithPackages (p: 42 | [ p.cabal-install p.structured-haskell-mode p.hindent p.hasktags ]); 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | setopt EXTENDED_GLOB 2 | setopt AUTO_CD 3 | unsetopt FLOW_CONTROL 4 | 5 | HISTSIZE=1000000 6 | SAVEHIST=1000000 7 | HISTFILE=$HOME/.zhistory 8 | setopt INC_APPEND_HISTORY 9 | setopt EXTENDED_HISTORY 10 | setopt HIST_IGNORE_DUPS 11 | setopt HIST_EXPIRE_DUPS_FIRST 12 | 13 | autoload -U compinit 14 | compinit 15 | zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' # case insensitive 16 | zstyle ':completion:*' menu select 17 | setopt completealiases 18 | 19 | alias ls='ls --color=auto' 20 | alias sprunge="curl -F 'sprunge=<-' http://sprunge.us" 21 | alias devmon='devmon --no-gui' 22 | alias fixsound="amixer -c 0 cset 'numid=10' 1" 23 | alias pdfgrep="pdfgrep --cache" 24 | function serve-ghcjs { 25 | dir=$(dirname $(cabal-plan list-bin | grep "exe:$1" | awk '{print $2}')); 26 | warp -d "${dir}/$1.jsexe"; 27 | } 28 | 29 | # create a zkbd compatible hash; 30 | # to add other keys to this hash, see: man 5 terminfo 31 | typeset -A key 32 | 33 | key[Home]=${terminfo[khome]} 34 | key[End]=${terminfo[kend]} 35 | key[Insert]=${terminfo[kich1]} 36 | key[Delete]=${terminfo[kdch1]} 37 | key[Up]=${terminfo[kcuu1]} 38 | key[Down]=${terminfo[kcud1]} 39 | key[Left]=${terminfo[kcub1]} 40 | key[Right]=${terminfo[kcuf1]} 41 | key[PageUp]=${terminfo[kpp]} 42 | key[PageDown]=${terminfo[knp]} 43 | 44 | # setup key accordingly 45 | [[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line 46 | [[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line 47 | [[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode 48 | [[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char 49 | [[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history 50 | [[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history 51 | [[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char 52 | [[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char 53 | 54 | bindkey -e 55 | 56 | # use pkgfile 57 | source /usr/share/doc/pkgfile/command-not-found.zsh 58 | 59 | # Base16 Shell 60 | BASE16_SCHEME="monokai" 61 | BASE16_SHELL="$HOME/.config/base16-shell/base16-$BASE16_SCHEME.dark.sh" 62 | [[ -s $BASE16_SHELL ]] && . $BASE16_SHELL 63 | 64 | # fix tramp in emacs 65 | [[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' 66 | 67 | setopt prompt_subst 68 | 69 | autoload -U bashcompinit && bashcompinit 70 | eval "$(stack --bash-completion-script "$(which stack)")" 71 | 72 | # OPAM configuration 73 | . /home/moritz/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true 74 | 75 | source '/home/moritz/.zplugin/bin/zplugin.zsh' 76 | autoload -Uz _zplugin 77 | (( ${+_comps} )) && _comps[zplugin]=_zplugin 78 | 79 | zplugin load "mafredri/zsh-async" 80 | zplugin load "sindresorhus/pure" 81 | zplugin load "zsh-users/zsh-syntax-highlighting" 82 | zplugin load "zsh-users/zsh-history-substring-search" 83 | zplugin snippet "https://raw.githubusercontent.com/rupa/z/master/z.sh" 84 | 85 | bindkey -M emacs '^P' history-substring-search-up 86 | bindkey -M emacs '^N' history-substring-search-down 87 | -------------------------------------------------------------------------------- /emacs/.emacs.d/abbrev_defs: -------------------------------------------------------------------------------- 1 | ;;-*-coding: utf-8;-*- 2 | (define-abbrev-table 'Buffer-menu-mode-abbrev-table '()) 3 | 4 | (define-abbrev-table 'Info-edit-mode-abbrev-table '()) 5 | 6 | (define-abbrev-table 'awk-mode-abbrev-table 7 | '( 8 | )) 9 | 10 | (define-abbrev-table 'bookmark-bmenu-mode-abbrev-table '()) 11 | 12 | (define-abbrev-table 'bookmark-edit-annotation-mode-abbrev-table '()) 13 | 14 | (define-abbrev-table 'c++-mode-abbrev-table 15 | '( 16 | )) 17 | 18 | (define-abbrev-table 'c-mode-abbrev-table 19 | '( 20 | )) 21 | 22 | (define-abbrev-table 'comint-mode-abbrev-table '()) 23 | 24 | (define-abbrev-table 'completion-list-mode-abbrev-table '()) 25 | 26 | (define-abbrev-table 'conf-colon-mode-abbrev-table '()) 27 | 28 | (define-abbrev-table 'conf-javaprop-mode-abbrev-table '()) 29 | 30 | (define-abbrev-table 'conf-ppd-mode-abbrev-table '()) 31 | 32 | (define-abbrev-table 'conf-space-mode-abbrev-table '()) 33 | 34 | (define-abbrev-table 'conf-unix-mode-abbrev-table '()) 35 | 36 | (define-abbrev-table 'conf-windows-mode-abbrev-table '()) 37 | 38 | (define-abbrev-table 'conf-xdefaults-mode-abbrev-table '()) 39 | 40 | (define-abbrev-table 'debugger-mode-abbrev-table '()) 41 | 42 | (define-abbrev-table 'diff-mode-abbrev-table '()) 43 | 44 | (define-abbrev-table 'edit-abbrevs-mode-abbrev-table '()) 45 | 46 | (define-abbrev-table 'elisp-byte-code-mode-abbrev-table '()) 47 | 48 | (define-abbrev-table 'emacs-lisp-mode-abbrev-table '()) 49 | 50 | (define-abbrev-table 'ert-results-mode-abbrev-table '()) 51 | 52 | (define-abbrev-table 'ert-simple-view-mode-abbrev-table '()) 53 | 54 | (define-abbrev-table 'flycheck-error-list-mode-abbrev-table '()) 55 | 56 | (define-abbrev-table 'fundamental-mode-abbrev-table '()) 57 | 58 | (define-abbrev-table 'global-abbrev-table '()) 59 | 60 | (define-abbrev-table 'grep-mode-abbrev-table '()) 61 | 62 | (define-abbrev-table 'help-mode-abbrev-table '()) 63 | 64 | (define-abbrev-table 'ibuffer-mode-abbrev-table '()) 65 | 66 | (define-abbrev-table 'idl-mode-abbrev-table '()) 67 | 68 | (define-abbrev-table 'ivy-occur-grep-mode-abbrev-table '()) 69 | 70 | (define-abbrev-table 'ivy-occur-mode-abbrev-table '()) 71 | 72 | (define-abbrev-table 'java-mode-abbrev-table 73 | '( 74 | )) 75 | 76 | (define-abbrev-table 'lisp-mode-abbrev-table '()) 77 | 78 | (define-abbrev-table 'message-mode-abbrev-table '()) 79 | 80 | (define-abbrev-table 'messages-buffer-mode-abbrev-table '()) 81 | 82 | (define-abbrev-table 'objc-mode-abbrev-table 83 | '( 84 | )) 85 | 86 | (define-abbrev-table 'occur-edit-mode-abbrev-table '()) 87 | 88 | (define-abbrev-table 'occur-mode-abbrev-table '()) 89 | 90 | (define-abbrev-table 'package-menu-mode-abbrev-table '()) 91 | 92 | (define-abbrev-table 'pike-mode-abbrev-table 93 | '( 94 | )) 95 | 96 | (define-abbrev-table 'process-menu-mode-abbrev-table '()) 97 | 98 | (define-abbrev-table 'prog-mode-abbrev-table '()) 99 | 100 | (define-abbrev-table 'racket-describe-mode-abbrev-table '()) 101 | 102 | (define-abbrev-table 'racket-mode-abbrev-table '()) 103 | 104 | (define-abbrev-table 'racket-profile-mode-abbrev-table '()) 105 | 106 | (define-abbrev-table 'racket-repl-mode-abbrev-table '()) 107 | 108 | (define-abbrev-table 'rtags-dependency-tree-mode-abbrev-table '()) 109 | 110 | (define-abbrev-table 'rtags-diagnostics-mode-abbrev-table '()) 111 | 112 | (define-abbrev-table 'rtags-mode-abbrev-table '()) 113 | 114 | (define-abbrev-table 'rtags-preprocess-mode-abbrev-table '()) 115 | 116 | (define-abbrev-table 'rtags-references-tree-mode-abbrev-table '()) 117 | 118 | (define-abbrev-table 'rtags-taglist-mode-abbrev-table '()) 119 | 120 | (define-abbrev-table 'select-tags-table-mode-abbrev-table '()) 121 | 122 | (define-abbrev-table 'sh-mode-abbrev-table '()) 123 | 124 | (define-abbrev-table 'shell-mode-abbrev-table '()) 125 | 126 | (define-abbrev-table 'snippet-mode-abbrev-table '()) 127 | 128 | (define-abbrev-table 'special-mode-abbrev-table '()) 129 | 130 | (define-abbrev-table 'tabulated-list-mode-abbrev-table '()) 131 | 132 | (define-abbrev-table 'tar-mode-abbrev-table '()) 133 | 134 | (define-abbrev-table 'text-mode-abbrev-table '()) 135 | 136 | (define-abbrev-table 'url-cookie-mode-abbrev-table '()) 137 | 138 | (define-abbrev-table 'vc-git-log-edit-mode-abbrev-table '()) 139 | 140 | (define-abbrev-table 'vc-git-log-view-mode-abbrev-table '()) 141 | 142 | (define-abbrev-table 'vc-git-region-history-mode-abbrev-table '()) 143 | 144 | (define-abbrev-table 'xref--xref-buffer-mode-abbrev-table '()) 145 | 146 | -------------------------------------------------------------------------------- /.xmonad/xmonad.hs: -------------------------------------------------------------------------------- 1 | import Data.List 2 | import qualified Data.Map as M 3 | import XMonad.Actions.FloatKeys 4 | import System.Exit 5 | import Text.EditDistance 6 | import Text.Regex.Posix 7 | import XMonad 8 | import XMonad.Actions.GridSelect 9 | import XMonad.Actions.TopicSpace 10 | import XMonad.Actions.WindowBringer 11 | import XMonad.Hooks.DynamicLog 12 | import XMonad.Hooks.EwmhDesktops 13 | import XMonad.Hooks.ManageDocks 14 | import XMonad.Hooks.ManageHelpers 15 | import XMonad.Hooks.SetWMName 16 | import XMonad.Hooks.UrgencyHook 17 | import XMonad.Layout.NoBorders 18 | import XMonad.Layout.SimplestFloat 19 | import XMonad.Layout.Spiral 20 | import XMonad.Prompt 21 | import XMonad.Prompt.Shell 22 | import XMonad.Prompt.Window 23 | import XMonad.Prompt.Workspace 24 | import qualified XMonad.StackSet as W 25 | import XMonad.Util.EZConfig 26 | import XMonad.Util.NamedScratchpad 27 | import XMonad.Util.Run 28 | 29 | main = do 30 | h <- spawnPipe "xmobar" 31 | xmonad $ ewmh $ withUrgencyHook NoUrgencyHook $ defaultConfig 32 | { borderWidth = 2 33 | , normalBorderColor = "#cccccc" 34 | , focusedBorderColor = "#cd8b00" 35 | , logHook = dynamicLogWithPP $ xmobarPP { ppOutput = hPutStrLn h } 36 | , layoutHook = avoidStruts $ lessBorders Screen $ myLayout 37 | , manageHook = myManageHook 38 | , handleEventHook = handleEventHook defaultConfig <+> fullscreenEventHook <+> docksEventHook 39 | , workspaces = ["1:shell", "2:web", "3:news", "4:media", "5", "6", "7", "8", "9", "0:emacs"] 40 | , modMask = mod4Mask 41 | , terminal = "urxvt" 42 | , keys = myKeys 43 | } 44 | 45 | scratchpads = [NS "pavucontrol" "pavucontrol" (className =? "Pavucontrol") (customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3))] 46 | myManageHook = namedScratchpadManageHook scratchpads <+> composeAll [ isFullscreen --> doFullFloat ] 47 | 48 | myLayout = spiral (1 / 1.618) ||| Full ||| Mirror tiled ||| tiled ||| simplestFloat 49 | where 50 | -- default tiling algorithm partitions the screen into two panes 51 | tiled = Tall nmaster delta ratio 52 | 53 | -- The default number of windows in the master pane 54 | nmaster = 1 55 | 56 | -- Default proportion of screen occupied by master pane 57 | ratio = 1/2 58 | 59 | -- Percent of screen to increment by when resizing panes 60 | delta = 3/100 61 | 62 | myKeys c = 63 | mkKeymap c $ 64 | [("M-<Return>",spawn $ terminal c) 65 | ,("M-a",shellPrompt defaultXPConfig {position = Top}) 66 | ,("M-f",fuzzySpawn) 67 | ,("M-S-c",kill) 68 | ,("M-<Space>",sendMessage NextLayout) 69 | ,("M-S-<Space>",setLayout $ layoutHook c) 70 | ,("M-r",windows W.focusDown) 71 | ,("M-t",windows W.focusUp) 72 | ,("M-m",windows W.focusMaster) 73 | ,("M-S-<Return>",windows W.swapMaster) 74 | ,("M-S-r",windows W.swapDown) 75 | ,("M-S-t",windows W.swapUp) 76 | ,("M-n",sendMessage Shrink) 77 | ,("M-d",sendMessage Expand) 78 | ,("M-w",withFocused $ windows . W.sink) 79 | ,("M-,",sendMessage (IncMasterN 1)) 80 | ,("M-.",sendMessage (IncMasterN (-1))) 81 | ,("M-S-q",io (exitWith ExitSuccess)) 82 | ,("M-q",spawn "xmonad --recompile; xmonad --restart") 83 | ,("M-b",sendMessage ToggleStruts) 84 | ,("M-p",namedScratchpadAction scratchpads "pavucontrol") 85 | ,("M-g",promptedGoto) 86 | ,("M-S-g",promptedShift)] ++ 87 | [(m ++ k,windows $ f w) | (w,k) <- zip (workspaces c) 88 | ((map show [1 .. 9]) ++ 89 | ["0"]) 90 | , (m,f) <- [("M-",W.greedyView),("M-S-",W.shift)]] ++ 91 | [(m ++ k 92 | ,screenWorkspace s >>= 93 | flip whenJust (windows . f)) | (s,k) <- zip [0 ..] 94 | ["v","l"] 95 | , (m,f) <- [("M-",W.view),("M-S-",W.shift)]] ++ 96 | [("M-C-" ++ dir,withFocused (keysMoveWindow (dx,dy))) | (dir,dx,dy) <- [("n" 97 | ,-20 98 | ,0) 99 | ,("d" 100 | ,20 101 | ,0) 102 | ,("t" 103 | ,0 104 | ,-20) 105 | ,("r" 106 | ,0 107 | ,20)]] 108 | 109 | 110 | data FuzzySpawn = FuzzySpawn deriving (Read, Show) 111 | instance XPrompt FuzzySpawn where 112 | showXPrompt _ = "Find window: " 113 | 114 | winAction a m = flip whenJust (windows . a) . flip M.lookup m 115 | gotoAction = winAction W.focusWindow 116 | fuzzySpawn = do 117 | wm <- windowMap 118 | a <- fmap gotoAction windowMap 119 | mkXPrompt FuzzySpawn defaultXPConfig {position = Top, alwaysHighlight = True, promptKeymap = emacsLikeXPKeymap} (compList wm) a 120 | where 121 | weight s c = levenshteinDistance defaultEditCosts { deletionCosts = ConstantCost 1000, 122 | substitutionCosts = ConstantCost 1000 } s c 123 | regex s = foldr (\a b -> a:'.':'*':b) [] s 124 | compList m s = return . map snd . sort . map (\c -> (weight s c, c)) 125 | . filter (\a -> a =~ regex s) . map fst . M.toList $ m 126 | 127 | myTopics :: [Topic] 128 | myTopics = 129 | ["uni" 130 | ,"audio"] 131 | 132 | myTopicConfig :: TopicConfig 133 | myTopicConfig = 134 | defaultTopicConfig {topicDirs = 135 | M.fromList $ 136 | [("uni","docs/studium"),("audio","noise")]} 137 | 138 | goto :: Topic -> X () 139 | goto = switchTopic myTopicConfig 140 | 141 | promptedGoto :: X () 142 | promptedGoto = workspacePrompt defaultXPConfig goto 143 | 144 | promptedShift :: X () 145 | promptedShift = workspacePrompt defaultXPConfig $ windows . W.shift 146 | -------------------------------------------------------------------------------- /i3/.config/i3/config: -------------------------------------------------------------------------------- 1 | # This file has been auto-generated by i3-config-wizard(1). 2 | # It will not be overwritten, so edit it as you like. 3 | # 4 | # Should you change your keyboard layout some time, delete 5 | # this file and re-run i3-config-wizard(1). 6 | # 7 | 8 | # i3 config file (v4) 9 | # 10 | # Please see http://i3wm.org/docs/userguide.html for a complete reference! 11 | 12 | set $mod Mod4 13 | 14 | # Font for window titles. Will also be used by the bar unless a different font 15 | # is used in the bar {} block below. 16 | # This font is widely installed, provides lots of unicode glyphs, right-to-left 17 | # text rendering and scalability on retina/hidpi displays (thanks to pango). 18 | font pango:Fira Mono Medium 8 19 | # Before i3 v4.8, we used to recommend this one as the default: 20 | # font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 21 | # The font above is very space-efficient, that is, it looks good, sharp and 22 | # clear in small sizes. However, its unicode glyph coverage is limited, the old 23 | # X core fonts rendering does not support right-to-left and this being a bitmap 24 | # font, it doesn’t scale on retina/hidpi displays. 25 | 26 | # Use Mouse+$mod to drag floating windows to their wanted position 27 | floating_modifier $mod 28 | 29 | # start a terminal 30 | bindsym $mod+Return exec i3-sensible-terminal 31 | 32 | # kill focused window 33 | bindsym $mod+Shift+x kill 34 | 35 | # start dmenu (a program launcher) 36 | bindsym $mod+a exec dmenu_run 37 | # There also is the (new) i3-dmenu-desktop which only displays applications 38 | # shipping a .desktop file. It is a wrapper around dmenu, so you need that 39 | # installed. 40 | # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop 41 | 42 | # change focus 43 | bindsym $mod+n focus left 44 | bindsym $mod+r focus down 45 | bindsym $mod+t focus up 46 | bindsym $mod+d focus right 47 | 48 | # alternatively, you can use the cursor keys: 49 | bindsym $mod+Left focus left 50 | bindsym $mod+Down focus down 51 | bindsym $mod+Up focus up 52 | bindsym $mod+Right focus right 53 | 54 | # move focused window 55 | bindsym $mod+Shift+n move left 56 | bindsym $mod+Shift+r move down 57 | bindsym $mod+Shift+t move up 58 | bindsym $mod+Shift+d moveright 59 | 60 | # move to different workspace 61 | bindsym $mod+q move workspace to output right 62 | bindsym $mod+f move workspace to output left 63 | # alternatively, you can use the cursor keys: 64 | bindsym $mod+Shift+Left exec --no-startup-id playerctl previous 65 | bindsym $mod+Shift+Down move down 66 | bindsym $mod+Shift+Up move up 67 | bindsym $mod+Shift+Right exec --no-startup-id playerctl next 68 | 69 | # split in horizontal orientation 70 | bindsym $mod+s split h 71 | 72 | # split in vertical orientation 73 | bindsym $mod+p split v 74 | 75 | # enter fullscreen mode for the focused container 76 | bindsym $mod+e fullscreen 77 | 78 | # change container layout (stacked, tabbed, toggle split) 79 | bindsym $mod+i layout stacking 80 | bindsym $mod+v layout tabbed 81 | bindsym $mod+l layout toggle split 82 | 83 | # toggle tiling / floating 84 | bindsym $mod+Shift+space floating toggle 85 | 86 | # change focus between tiling / floating windows 87 | bindsym $mod+space focus mode_toggle 88 | 89 | # focus the parent container 90 | bindsym $mod+u focus parent 91 | 92 | # focus the child container 93 | bindsym $mod+x focus child 94 | 95 | # switch to workspace 96 | bindsym $mod+1 workspace 1 97 | bindsym $mod+2 workspace 2 98 | bindsym $mod+3 workspace 3 99 | bindsym $mod+4 workspace 4 100 | bindsym $mod+5 workspace 5 101 | bindsym $mod+6 workspace 6 102 | bindsym $mod+7 workspace 7 103 | bindsym $mod+8 workspace 8 104 | bindsym $mod+9 workspace 9 105 | bindsym $mod+0 workspace 10 106 | 107 | # move focused container to workspace 108 | bindsym $mod+Shift+1 move container to workspace 1 109 | bindsym $mod+Shift+2 move container to workspace 2 110 | bindsym $mod+Shift+3 move container to workspace 3 111 | bindsym $mod+Shift+4 move container to workspace 4 112 | bindsym $mod+Shift+5 move container to workspace 5 113 | bindsym $mod+Shift+6 move container to workspace 6 114 | bindsym $mod+Shift+7 move container to workspace 7 115 | bindsym $mod+Shift+8 move container to workspace 8 116 | bindsym $mod+Shift+9 move container to workspace 9 117 | bindsym $mod+Shift+0 move container to workspace 10 118 | 119 | # reload the configuration file 120 | bindsym $mod+Shift+adiaeresis reload 121 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 122 | bindsym $mod+Shift+c restart 123 | # exit i3 (logs you out of your X session) 124 | bindsym $mod+Shift+l exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" 125 | 126 | # resize window (you can also use the mouse for that) 127 | mode "resize" { 128 | # These bindings trigger as soon as you enter the resize mode 129 | 130 | # Pressing left will shrink the window’s width. 131 | # Pressing right will grow the window’s width. 132 | # Pressing up will shrink the window’s height. 133 | # Pressing down will grow the window’s height. 134 | bindsym n resize shrink width 10 px or 10 ppt 135 | bindsym r resize grow height 10 px or 10 ppt 136 | bindsym t resize shrink height 10 px or 10 ppt 137 | bindsym d resize grow width 10 px or 10 ppt 138 | 139 | # same bindings, but for the arrow keys 140 | bindsym Left resize shrink width 10 px or 10 ppt 141 | bindsym Down resize grow height 10 px or 10 ppt 142 | bindsym Up resize shrink height 10 px or 10 ppt 143 | bindsym Right resize grow width 10 px or 10 ppt 144 | 145 | # back to normal: Enter or Escape 146 | bindsym Return mode "default" 147 | bindsym Escape mode "default" 148 | } 149 | 150 | bindsym $mod+c mode "resize" 151 | 152 | # Start i3bar to display a workspace bar (plus the system information i3status 153 | # finds out, if available) 154 | bar { 155 | status_command i3status 156 | position top 157 | } 158 | 159 | # Make the currently focused window a scratchpad 160 | bindsym $mod+Shift+minus move scratchpad 161 | 162 | # Show the first scratchpad window 163 | bindsym $mod+minus scratchpad show 164 | 165 | for_window [title="Welcome to Wolfram Mathematica 10"] floating enable 166 | for_window [title="Choose a custom style"] floating enable 167 | for_window [title="Wolfram Mathematica 10.0 Student Edition - Personal Use Only"] floating enable 168 | for_window [class="B2g"] floating enable 169 | for_window [ title="^pdfpc - present" ] border none floating enable 170 | assign [class="mpv"] 4 171 | 172 | # volume 173 | 174 | bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% 175 | bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% 176 | bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle 177 | 178 | bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 10 179 | bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 10 180 | 181 | bindsym XF86PowerOff exec --no-startup-id systemctl suspend 182 | 183 | bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause 184 | bindsym XF86AudioNext exec --no-startup-id playerctl next 185 | bindsym XF86AudioPrev exec --no-startup-id playerctl previous 186 | 187 | bindsym button3 floating toggle 188 | bindsym --release button2 kill -------------------------------------------------------------------------------- /emacs/.emacs.d/emacs.org: -------------------------------------------------------------------------------- 1 | * packages 2 | #+begin_src emacs-lisp :tangle yes 3 | (package-initialize nil) 4 | (add-to-list 'package-archives 5 | '("org" . "http://orgmode.org/elpa/")) 6 | (add-to-list 'package-archives 7 | '("melpa" . "http://melpa.org/packages/") t) 8 | (setq package-archive-priorities '(("org" . 3) 9 | ("melpa" . 2) 10 | ("gnu" . 1))) 11 | (unless (package-installed-p 'use-package) 12 | (package-refresh-contents) 13 | (package-install 'use-package)) 14 | (setq use-package-verbose t) 15 | (eval-when-compile 16 | (require 'use-package)) 17 | (use-package diminish :ensure t) 18 | #+end_src 19 | * editorconfig 20 | #+begin_src emacs-lisp :tangle yes 21 | (use-package editorconfig 22 | :ensure t 23 | :config 24 | (editorconfig-mode 1)) 25 | #+end_src 26 | * swiper/ivy 27 | #+begin_src emacs-lisp :tangle yes 28 | (use-package ivy 29 | :ensure t) 30 | (use-package swiper 31 | :ensure t 32 | :diminish ivy-mode 33 | :bind (("C-r" . swiper) 34 | ("C-c C-r" . ivy-resume) 35 | ("C-c h m" . woman) 36 | ("C-x b" . ivy-switch-buffer) 37 | ("C-c u" . swiper-all)) 38 | :config 39 | (ivy-mode 1) 40 | (setq ivy-use-virtual-buffers t)) 41 | (use-package counsel 42 | :ensure t 43 | :commands (counsel-mode) 44 | :bind (("C-s" . counsel-grep-or-swiper) 45 | ("M-x" . counsel-M-x) 46 | ("C-x C-f" . counsel-find-file) 47 | ("C-h f" . counsel-describe-function) 48 | ("C-h v" . counsel-describe-variable) 49 | ("C-h i" . counsel-info-lookup-symbol) 50 | ("C-h u" . counsel-unicode-char) 51 | ("C-c k" . counsel-rg) 52 | ("C-x l" . counsel-locate) 53 | ("C-c g" . counsel-git-grep) 54 | ("C-c h i" . counsel-imenu) 55 | ("C-x p" . counsel-list-processes)) 56 | :init (counsel-mode) 57 | :config 58 | (ivy-set-actions 59 | 'counsel-find-file 60 | '(("j" find-file-other-window "other"))) 61 | (ivy-set-actions 'counsel-git-grep 62 | '(("j" find-file-other-window "other")))) 63 | (use-package ivy-hydra 64 | :ensure t) 65 | (use-package ivy-xref 66 | :ensure t 67 | :init (setq xref-show-xrefs-function #'ivy-xref-show-xrefs)) 68 | #+end_src 69 | 70 | * misc 71 | #+begin_src emacs-lisp :tangle yes 72 | (setq save-interprogram-paste-before-kill t) 73 | (setq ag-highlight-search t) 74 | (blink-cursor-mode -1) 75 | (use-package undo-tree 76 | :ensure t 77 | :config 78 | (progn 79 | (global-undo-tree-mode) 80 | (setq undo-tree-visualizer-timestamps t)) 81 | :diminish undo-tree-mode) 82 | (add-to-list 'auto-mode-alist '("\\.zsh\\'" . sh-mode)) 83 | (winner-mode 1) 84 | (defalias 'yes-or-no-p 'y-or-n-p) 85 | (global-unset-key (kbd "C-z")) 86 | (put 'upcase-region 'disabled nil) 87 | (setq require-final-newline t) 88 | (use-package ws-butler 89 | :ensure t 90 | :diminish ws-butler-mode 91 | :config 92 | (progn 93 | (ws-butler-global-mode) 94 | (setq ws-butler-keep-whitespace-before-point nil))) 95 | (use-package server 96 | :config 97 | (progn 98 | (defun server-enable () 99 | (unless (server-running-p) 100 | (server-start))) 101 | (add-hook 'after-init-hook 'server-enable t))) 102 | #+end_src 103 | * company 104 | #+begin_src emacs-lisp :tangle yes 105 | (use-package company 106 | :ensure t 107 | :diminish company-mode 108 | :defer 2 109 | :bind ("C-<tab>" . company-complete) 110 | :config 111 | (global-company-mode t)) 112 | #+end_src 113 | * dired 114 | #+begin_src emacs-lisp :tangle yes 115 | (use-package dired 116 | :commands dired-mode 117 | :bind (:map dired-mode-map ("C-o" . dired-omit-mode)) 118 | :config 119 | (progn 120 | (setq dired-dwim-target t) 121 | (setq-default dired-omit-mode t) 122 | (setq-default dired-omit-files "^\\.?#\\|^\\.$\\|^\\.\\.$\\|^\\.") 123 | (define-key dired-mode-map "i" 'dired-subtree-insert) 124 | (define-key dired-mode-map ";" 'dired-subtree-remove))) 125 | (use-package dired-subtree 126 | :ensure t 127 | :commands (dired-subtree-insert)) 128 | #+end_src 129 | 130 | * projectile 131 | #+begin_src emacs-lisp :tangle yes 132 | (use-package projectile 133 | :ensure t 134 | :commands (projectile-mode) 135 | :config 136 | (progn 137 | (setq projectile-completion-system 'ivy) 138 | (define-key projectile-mode-map (kbd "s-p") 'projectile-command-map) 139 | (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map))) 140 | (use-package counsel-projectile 141 | :ensure t 142 | :commands (counsel-projectile-mode) 143 | :init 144 | (progn 145 | (projectile-mode +1) 146 | (counsel-projectile-mode))) 147 | #+end_src 148 | * gui 149 | #+begin_src emacs-lisp :tangle yes 150 | (setq inhibit-splash-screen t) 151 | (menu-bar-mode -1) 152 | (tool-bar-mode -1) 153 | (scroll-bar-mode -1) 154 | (column-number-mode t) 155 | (use-package all-the-icons 156 | :ensure t) 157 | (use-package doom-themes 158 | :ensure t 159 | :config 160 | (progn 161 | (setq doom-one-brighter-comments t) 162 | (load-theme 'doom-one t))) 163 | (use-package powerline 164 | :ensure t 165 | :defer t) 166 | #+end_src 167 | * org 168 | #+begin_src emacs-lisp :tangle yes 169 | (use-package org 170 | :ensure t 171 | :mode ("\\.org\\'" . org-mode) 172 | :bind (("C-c l" . org-store-link) 173 | ("C-c c" . org-capture) 174 | ("C-c a" . org-agenda) 175 | ("C-c b" . org-iswitchb) 176 | ("C-c C-w" . org-refile) 177 | ("C-c j" . org-clock-goto) 178 | ("C-c C-x C-o" . org-clock-out)) 179 | :config 180 | (progn 181 | ;; The GTD part of this config is heavily inspired by 182 | ;; https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html 183 | (setq org-directory "~/org") 184 | (setq org-agenda-files 185 | (mapcar (lambda (path) (concat org-directory path)) 186 | '("/org.org" 187 | "/gtd/gtd.org" 188 | "/gtd/inbox.org" 189 | "/gtd/tickler.org"))) 190 | (setq org-log-done 'time) 191 | (setq org-src-fontify-natively t) 192 | (setq org-use-speed-commands t) 193 | (setq org-capture-templates 194 | '(("t" "Todo [inbox]" entry 195 | (file+headline "~/org/gtd/inbox.org" "Tasks") 196 | "* TODO %i%?") 197 | ("T" "Tickler" entry 198 | (file+headline "~/org/gtd/tickler.org" "Tickler") 199 | "* %i%? \n %^t"))) 200 | (setq org-refile-targets 201 | '(("~/org/gtd/gtd.org" :maxlevel . 3) 202 | ("~/org/gtd/someday.org" :level . 1) 203 | ("~/org/gtd/tickler.org" :maxlevel . 2))) 204 | (setq org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)"))) 205 | (setq org-agenda-custom-commands 206 | '(("@" "Contexts" 207 | ((tags-todo "@email" 208 | ((org-agenda-overriding-header "Emails"))) 209 | (tags-todo "@phone" 210 | ((org-agenda-overriding-header "Phone"))))))) 211 | (setq org-clock-persist t) 212 | (org-clock-persistence-insinuate) 213 | (setq org-time-clocksum-format '(:hours "%d" :require-hours t :minutes ":%02d" :require-minutes t)))) 214 | (use-package org-inlinetask 215 | :bind (:map org-mode-map 216 | ("C-c C-x t" . org-inlinetask-insert-task)) 217 | :after (org) 218 | :commands (org-inlinetask-insert-task)) 219 | (use-package org-bullets 220 | :ensure t 221 | :commands (org-bullets-mode) 222 | :init (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) 223 | #+end_src 224 | * functions 225 | #+begin_src emacs-lisp :tangle yes 226 | ;; functions to paste to http://sprunge.us using web.el 227 | (defun sprunge-buffer () 228 | (interactive) 229 | (sprunge-region (point-min) (point-max))) 230 | (defun sprunge-region (start end) 231 | (interactive "r") 232 | (let ((buffer-contents (buffer-substring-no-properties start end)) 233 | (query-data (make-hash-table :test 'equal))) 234 | (puthash 'sprunge buffer-contents query-data) 235 | (web-http-post 236 | (lambda (con header data) 237 | (kill-new (substring data 0 -1))) 238 | :url "http://sprunge.us" 239 | :data query-data))) 240 | (use-package web 241 | :commands (sprunge-region sprunge-buffer) 242 | :ensure t) 243 | (defun narrow-or-widen-dwim (p) 244 | "Widen if buffer is narrowed, narrow-dwim otherwise. 245 | Dwim means: region, org-src-block, org-subtree, or defun, 246 | whichever applies first. Narrowing to org-src-block actually 247 | calls `org-edit-src-code'. 248 | 249 | With prefix P, don't widen, just narrow even if buffer is 250 | already narrowed." 251 | (interactive "P") 252 | (declare (interactive-only)) 253 | (cond ((and (buffer-narrowed-p) (not p)) (widen)) 254 | ((region-active-p) 255 | (narrow-to-region (region-beginning) (region-end))) 256 | ((derived-mode-p 'org-mode) 257 | ;; `org-edit-src-code' is not a real narrowing 258 | ;; command. Remove this first conditional if you 259 | ;; don't want it. 260 | (cond ((ignore-errors (org-edit-src-code)) 261 | (delete-other-windows)) 262 | ((ignore-errors (org-narrow-to-block) t)) 263 | (t (org-narrow-to-subtree)))) 264 | ((derived-mode-p 'latex-mode) 265 | (LaTeX-narrow-to-environment)) 266 | (t (narrow-to-defun)))) 267 | (bind-key "C-c n" 'narrow-or-widen-dwim) 268 | #+end_src 269 | * bindings 270 | #+begin_src emacs-lisp :tangle yes 271 | (global-set-key (kbd "C-c ;") 'comment-line) 272 | ;; expand-region 273 | (pending-delete-mode t) 274 | (use-package expand-region 275 | :ensure t 276 | :commands (er/expand-region 277 | er/mark-inside-pairs 278 | er/mark-inside-quotes 279 | er/mark-outside-pairs 280 | er/mark-outside-quotes 281 | er/mark-defun 282 | er/mark-comment 283 | er/mark-text-sentence 284 | er/mark-text-paragraph 285 | er/mark-word 286 | er/mark-url 287 | er/mark-email 288 | er/mark-symbol)) 289 | (global-set-key (kbd "C-x C-b") 'ibuffer) 290 | (global-set-key (kbd "C-x C-r") 'revert-buffer) 291 | 292 | #+end_src 293 | * ace 294 | #+begin_src emacs-lisp :tangle yes 295 | (use-package ace-window 296 | :ensure t 297 | :bind ("M-ä" . ace-window)) 298 | (use-package avy 299 | :ensure avy 300 | :bind (("C-ß" . avy-goto-char) 301 | ("C-ö" . avy-goto-word-1) 302 | ("C-ä" . avy-goto-char-2) 303 | ("C-ü" . avy-goto-line)) 304 | :config (setq avy-case-fold-search nil)) 305 | #+end_src 306 | * auctex 307 | #+begin_src emacs-lisp :tangle yes 308 | (use-package tex 309 | :ensure auctex 310 | :mode ("\\.tex\\'" . LaTeX-mode) 311 | :config 312 | (setq TeX-view-program-list 313 | '(("zathura" 314 | ("zathura" (mode-io-correlate "-sync.sh") 315 | " " 316 | (mode-io-correlate "%n:1:%b ") 317 | "%o")))) 318 | (setq TeX-view-program-selection '((output-pdf "zathura"))) 319 | (setq TeX-PDF-mode t) 320 | (TeX-source-correlate-mode)) 321 | #+end_src 322 | * haskell 323 | #+begin_src emacs-lisp :tangle yes 324 | (use-package hindent 325 | :ensure t 326 | :commands (hindent-reformat-decl hindent-mode) 327 | :hook (haskell-mode . hindent-mode)) 328 | (use-package haskell-mode 329 | :ensure t 330 | :mode (("\\.c?hs\\'" . haskell-mode) 331 | ("\\.cabal\\'" . haskell-cabal-mode)) 332 | :bind (:map haskell-mode-map 333 | ("C-c i" . hindent-reformat-decl) 334 | ("C-c C-`" . haskell-interactive-bring) 335 | ("C-c C-l" . haskell-process-load-file) 336 | ("C-c C-k" . haskell-interactive-mode-clear)) 337 | :config 338 | (setq haskell-process-log t) 339 | :hook (haskell-mode . haskell-indentation-mode)) 340 | #+end_src 341 | * mu4e 342 | #+begin_src emacs-lisp :tangle yes 343 | (use-package mu4e 344 | :load-path "/usr/share/emacs/site-lisp/mu4e" 345 | :commands mu4e 346 | :config 347 | (use-package mu4e-contrib) 348 | (if mail-on 349 | (progn 350 | (setq mu4e-html2text-command 351 | 'mu4e-shr2text) 352 | (setq mu4e-context-policy 'pick-first) 353 | (setq mu4e-completing-read-function 'ivy-completing-read) 354 | (setq message-send-mail-function 'smtpmail-send-it) 355 | (setq mu4e-view-html-plaintext-ratio-heuristic 50) 356 | (setq mu4e-contexts 357 | (list (make-mu4e-context 358 | :name "purelyfunctional" 359 | :enter-func (lambda () (mu4e-message "Switch to the purelyfunctional context")) 360 | :match-func (lambda (msg) 361 | (when msg 362 | (s-prefix? "/purelyfunctional/" (mu4e-message-field msg :maildir)))) 363 | :vars '((user-mail-address . "moritz.kiefer@purelyfunctional.org") 364 | (mu4e-sent-folder . "/purelyfunctional/sent") 365 | (mu4e-drafts-folder . "/purelyfunctional/drafts") 366 | (mu4e-trash-folder . "/purelyfunctional/Trash") 367 | (mu4e-sent-messages-behavior . sent) 368 | (smtpmail-default-smtp-server . "cassiopeia.uberspace.de") 369 | (smtpmail-smtp-server . "cassiopeia.uberspace.de") 370 | (smtpmail-stream-type . starttls) 371 | (smtpmail-smtp-service . 587))) 372 | (make-mu4e-context 373 | :name "gmail" 374 | :enter-func (lambda () (mu4e-message "Switch to the gmail context")) 375 | :match-func (lambda (msg) 376 | (when msg 377 | (s-prefix? "/gmail/" (mu4e-message-field msg :maildir)))) 378 | :vars '((user-mail-address . "moritz.kiefer@gmail.com") 379 | (mu4e-sent-folder . "/gmail/sent") 380 | (mu4e-drafts-folder . "/gmail/drafts") 381 | (mu4e-trash-folder . "/gmail/trash") 382 | (mu4e-sent-messages-behavior . delete) 383 | (smtpmail-default-smtp-server . "smtp.gmail.com") 384 | (smtpmail-smtp-server . "smtp.gmail.com") 385 | (smtpmail-stream-type . starttls) 386 | (smtpmail-smtp-service . 587))) 387 | (make-mu4e-context 388 | :name "holarse" 389 | :enter-func (lambda () (mu4e-message "Switch to holarse context")) 390 | :match-func (lambda (msg) 391 | (when 392 | msg (mu4e-message-contact-field-matches 393 | msg :to "javafant@holarse-linuxgaming.de"))) 394 | :vars '((user-mail-address . "javafant@holarse-linuxgaming.de") 395 | (mu4e-sent-folder . "/holarse/sent") 396 | (mu4e-drafts-folder . "/holarse/drafts") 397 | (mu4e-sent-messages-behavior . sent) 398 | (smtpmail-default-smtp-server . "asmtp.mail.hostpoint.ch") 399 | (smtpmail-smtp-server . "asmtp.mail.hostpoint.ch") 400 | (smtpmail-stream-type . starttls) 401 | (smtpmail-smtp-service . 587))))) 402 | (setq mu4e-maildir "~/mail") 403 | (setq mu4e-get-mail-command "mbsync -a") 404 | (setq mu4e-update-interval 300) 405 | (setq mu4e-view-show-addresses t) 406 | (setq mu4e-headers-include-related t) 407 | (setq mu4e-headers-show-threads nil) 408 | (setq mu4e-headers-skip-duplicates t) 409 | (setq mu4e-split-view 'vertical) 410 | (setq 411 | user-full-name "Moritz Kiefer" 412 | mu4e-compose-signature "" 413 | mu4e-compose-signature-auto-include nil 414 | mu4e-attachment-dir "~/downloads") 415 | (setq mu4e-maildir-shortcuts 416 | '(("/gmail/inbox" . ?g) 417 | ("/holarse/inbox" . ?h) 418 | ("/purelyfunctional/inbox" . ?p))) 419 | 420 | (setq mu4e-bookmarks '(("flag:unread AND NOT flag:trashed AND NOT maildir:/gmail/spam AND NOT maildir:/purelyfunctional/haskell AND NOT maildir:/purelyfunctional/github" 421 | "Unread messages" ?u) 422 | ("date:today..now" "Today's messages" ?t) 423 | ("date:7d..now" "Last 7 days" ?w) 424 | ("mime:image/*" "Messages with images" ?p) 425 | ("maildir:/purelyfunctional/haskell" "haskell" ?h))) 426 | 427 | (add-hook 'mu4e-compose-mode-hook 'mml-secure-message-sign) 428 | (add-hook 'mu4e-view-mode-hook '(lambda () 429 | (local-set-key (kbd "<end>") 'end-of-line) 430 | (local-set-key (kbd "<home>") 'beginning-of-line))) 431 | (when (fboundp 'imagemagick-register-types) 432 | (imagemagick-register-types)) 433 | (add-to-list 'mu4e-view-actions 434 | '("View in browser" . mu4e-action-view-in-browser) t) 435 | 436 | ;; don't keep message buffers around 437 | (setq message-kill-buffer-on-exit t)))) 438 | #+end_src 439 | * indentation 440 | #+begin_src emacs-lisp :tangle yes 441 | (setq-default tab-width 4) 442 | (setq-default indent-tabs-mode nil) 443 | #+end_src 444 | * lisp 445 | #+begin_src emacs-lisp :tangle yes 446 | (use-package lisp-mode 447 | :defer t 448 | :mode "\\.smt2\\'" 449 | :init 450 | (progn 451 | (use-package elisp-slime-nav 452 | :diminish elisp-slime-nav-mode 453 | :ensure t 454 | :commands turn-on-elisp-slime-nav-mode) 455 | (dolist (hook '(emacs-lisp-mode-hook ielm-mode-hook eval-expression-minibuffer-setup-hook)) 456 | (add-hook hook 'turn-on-elisp-slime-nav-mode)) 457 | (use-package eldoc 458 | :diminish eldoc-mode 459 | :commands turn-on-eldoc-mode 460 | :init 461 | (progn 462 | (add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode) 463 | (add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode) 464 | (add-hook 'ielm-mode-hook 'turn-on-eldoc-mode))))) 465 | #+end_src 466 | * flycheck 467 | #+begin_src emacs-lisp :tangle yes 468 | (use-package flycheck 469 | :ensure t 470 | :defer 2 471 | :commands (flycheck-mode) 472 | :config 473 | (progn 474 | (global-flycheck-mode) 475 | (setq-default flycheck-disabled-checkers '(c/c++-clang c/c++-gcc flycheck-rtags haskell-stack-ghc)) 476 | (setq flycheck-emacs-lisp-load-path 'inherit) 477 | (setq flycheck-verilog-verilator-executable "invoke_verilator.sh")) 478 | :init 479 | (add-hook 'coq-mode-hook (lambda () (flycheck-mode -1)))) 480 | (use-package flycheck-package 481 | :ensure t 482 | :defer t) 483 | #+end_src 484 | * browser 485 | #+begin_src emacs-lisp :tangle yes 486 | (setq browse-url-browser-function 'browse-url-xdg-open) 487 | #+end_src 488 | * gdb 489 | #+begin_src emacs-lisp :tangle yes 490 | (setq gdb-many-windows t) 491 | #+end_src 492 | * yasnippet 493 | #+begin_src emacs-lisp :tangle yes 494 | (use-package yasnippet 495 | :diminish yas-minor-mode 496 | :ensure t 497 | :config 498 | (yas-global-mode t) 499 | :init 500 | (setq yas-alias-to-yas/prefix-p nil)) 501 | (use-package yasnippet-snippets 502 | :ensure t) 503 | #+end_src 504 | * symlinks 505 | #+begin_src emacs-lisp :tangle yes 506 | (setq vc-follow-symlinks t) 507 | #+end_src 508 | * magit 509 | #+begin_src emacs-lisp :tangle yes 510 | (use-package magit 511 | :ensure t 512 | :commands magit-status 513 | :config 514 | (progn 515 | (magit-auto-revert-mode 1) 516 | (setq magit-completing-read-function 'ivy-completing-read)) 517 | :init 518 | (add-hook 'magit-mode-hook 'magit-load-config-extensions)) 519 | (use-package magithub 520 | :after magit 521 | :ensure t 522 | :disabled 523 | :config (magithub-feature-autoinject t)) 524 | #+end_src 525 | * pkgbuild 526 | #+begin_src emacs-lisp :tangle yes 527 | (use-package pkgbuild-mode 528 | :ensure t 529 | :mode "/PKGBULD$") 530 | #+end_src 531 | * abbrev 532 | #+begin_src emacs-lisp :tangle yes 533 | (use-package abbrev 534 | :diminish abbrev-mode 535 | :config 536 | (progn (abbrev-mode) 537 | (setq abbrev-file-name "~/.emacs.d/abbrev_defs"))) 538 | #+end_src 539 | * ediff 540 | #+begin_src emacs-lisp :tangle yes 541 | (setq ediff-window-setup-function 'ediff-setup-windows-plain) 542 | (setq ediff-split-window-function 'split-window-horizontally) 543 | #+end_src 544 | * idris 545 | #+begin_src emacs-lisp :tangle yes 546 | (use-package idris-mode 547 | :ensure t 548 | :pin melpa 549 | :mode "\\.idr\\'" 550 | :init (use-package prop-menu 551 | :ensure t)) 552 | #+end_src 553 | * gpgfix 554 | #+begin_src emacs-lisp :tangle yes 555 | (defun epg--list-keys-1 (context name mode) 556 | (let ((args (append (if (epg-context-home-directory context) 557 | (list "--homedir" 558 | (epg-context-home-directory context))) 559 | '("--with-colons" "--no-greeting" "--batch" 560 | "--with-fingerprint" "--with-fingerprint") 561 | (unless (eq (epg-context-protocol context) 'CMS) 562 | '("--fixed-list-mode")))) 563 | (list-keys-option (if (memq mode '(t secret)) 564 | "--list-secret-keys" 565 | (if (memq mode '(nil public)) 566 | "--list-keys" 567 | "--list-sigs"))) 568 | (coding-system-for-read 'binary) 569 | keys string field index) 570 | (if name 571 | (progn 572 | (unless (listp name) 573 | (setq name (list name))) 574 | (while name 575 | (setq args (append args (list list-keys-option (car name))) 576 | name (cdr name)))) 577 | (setq args (append args (list list-keys-option)))) 578 | (with-temp-buffer 579 | (apply #'call-process 580 | (epg-context-program context) 581 | nil (list t nil) nil args) 582 | (goto-char (point-min)) 583 | (while (re-search-forward "^[a-z][a-z][a-z]:.*" nil t) 584 | (setq keys (cons (make-vector 15 nil) keys) 585 | string (match-string 0) 586 | index 0 587 | field 0) 588 | (while (and (< field (length (car keys))) 589 | (eq index 590 | (string-match "\\([^:]+\\)?:" string index))) 591 | (setq index (match-end 0)) 592 | (aset (car keys) field (match-string 1 string)) 593 | (setq field (1+ field)))) 594 | (nreverse keys)))) 595 | #+end_src 596 | * hydra 597 | #+begin_src emacs-lisp :tangle yes 598 | (use-package hydra 599 | :ensure t) 600 | (global-set-key 601 | (kbd "M-ö") 602 | (defhydra hydra-window (:color amaranth) 603 | "window" 604 | ("n" windmove-left) 605 | ("r" windmove-down) 606 | ("t" windmove-up) 607 | ("d" windmove-right) 608 | ("v" (lambda () 609 | (interactive) 610 | (split-window-right) 611 | (windmove-right)) 612 | "vert") 613 | ("x" (lambda () 614 | (interactive) 615 | (split-window-below) 616 | (windmove-down)) 617 | "horz") 618 | ;; ("t" transpose-frame "'") 619 | ("o" delete-other-windows "one" :color blue) 620 | ("a" ace-window "ace") 621 | ("s" ace-swap-window "swap") 622 | ("k" ace-delete-window "del") 623 | ("i" ace-maximize-window "ace-one" :color blue) 624 | ("b" ivy-switch-buffer "buf") 625 | ("f" counsel-find-file "file") 626 | ;; ("m" headlong-bookmark-jump "bmk") 627 | ("q" nil "cancel"))) 628 | (defhydra hydra-zoom (global-map "<f2>") 629 | "zoom" 630 | ("g" text-scale-increase "in") 631 | ("l" text-scale-decrease "out") 632 | ("0" text-scale-adjust "reset")) 633 | (defhydra hydra-error (global-map "M-g") 634 | "goto-error" 635 | ("h" first-error "first") 636 | ("j" next-error "next") 637 | ("k" previous-error "prev") 638 | ("v" recenter-top-bottom "recenter") 639 | ("q" nil "quit")) 640 | (use-package windmove) 641 | (defun hydra-move-splitter-left (arg) 642 | "Move window splitter left." 643 | (interactive "p") 644 | (if (let ((windmove-wrap-around)) 645 | (windmove-find-other-window 'right)) 646 | (shrink-window-horizontally arg) 647 | (enlarge-window-horizontally arg))) 648 | (defun hydra-move-splitter-right (arg) 649 | "Move window splitter right." 650 | (interactive "p") 651 | (if (let ((windmove-wrap-around)) 652 | (windmove-find-other-window 'right)) 653 | (enlarge-window-horizontally arg) 654 | (shrink-window-horizontally arg))) 655 | (defun hydra-move-splitter-up (arg) 656 | "Move window splitter up." 657 | (interactive "p") 658 | (if (let ((windmove-wrap-around)) 659 | (windmove-find-other-window 'up)) 660 | (enlarge-window arg) 661 | (shrink-window arg))) 662 | (defun hydra-move-splitter-down (arg) 663 | "Move window splitter down." 664 | (interactive "p") 665 | (if (let ((windmove-wrap-around)) 666 | (windmove-find-other-window 'up)) 667 | (shrink-window arg) 668 | (enlarge-window arg))) 669 | (global-set-key 670 | (kbd "M-ü") 671 | (defhydra hydra-splitter () 672 | "splitter" 673 | ("n" hydra-move-splitter-left) 674 | ("r" hydra-move-splitter-down) 675 | ("t" hydra-move-splitter-up) 676 | ("d" hydra-move-splitter-right) 677 | ("q" nil "quit"))) 678 | (use-package volume 679 | :commands (volume-lower volume-raise) 680 | :ensure t) 681 | (bind-key* 682 | "C-c v" 683 | (defhydra hydra-volume (:color amaranth) 684 | ("d" (volume-lower 5)) 685 | ("u" (volume-raise 5)) 686 | ("n" volume-raise) 687 | ("p" volume-lower) 688 | ("q" nil "quit"))) 689 | (bind-key 690 | "C-=" 691 | (defhydra hydra-mark (:hint nil) 692 | " 693 | ^Structure^ ^Pairs^ ^Misc^ 694 | ^^^^^^^^------------------------------------------- 695 | _SPC_: region _P_: inside pairs _u_: url 696 | _d_: defun _p_: outside pairs _m_: email 697 | _c_: comment _Q_: inside quotes _s_: symbol 698 | _._: sentence _q_: outside quotes 699 | _h_: paragraph 700 | " 701 | ("SPC" er/expand-region) 702 | ("P" er/mark-inside-pairs) 703 | ("Q" er/mark-inside-quotes) 704 | ("p" er/mark-outside-pairs) 705 | ("q" er/mark-outside-quotes) 706 | ("d" er/mark-defun) 707 | ("c" er/mark-comment) 708 | ("." er/mark-text-sentence) 709 | ("h" er/mark-text-paragraph) 710 | ("w" er/mark-word) 711 | ("u" er/mark-url) 712 | ("m" er/mark-email) 713 | ("s" er/mark-symbol))) 714 | #+end_src 715 | * guide-key 716 | #+begin_src emacs-lisp :tangle yes 717 | (use-package which-key 718 | :ensure t 719 | :diminish which-key-mode 720 | :config 721 | (which-key-mode)) 722 | #+end_src 723 | * multiple cursors 724 | #+begin_src emacs-lisp :tangle yes 725 | (use-package multiple-cursors 726 | :ensure t 727 | :commands mc/num-cursors 728 | :bind 729 | ("C->" . hydra-multiple-cursors/body) 730 | :init 731 | (defhydra hydra-multiple-cursors (:hint nil) 732 | " 733 | Up^^ Down^^ Miscellaneous % 2(mc/num-cursors) cursor%s(if (> (mc/num-cursors) 1) \"s\" \"\") 734 | ------------------------------------------------------------------ 735 | [_p_] Next [_n_] Next [_l_] Edit lines [_0_] Insert numbers 736 | [_P_] Skip [_N_] Skip [_a_] Mark all [_A_] Insert letters 737 | [_M-p_] Unmark [_M-n_] Unmark [_s_] Search [_q_] Quit 738 | [_|_] Align with input CHAR [Click] Cursor at point" 739 | ("l" mc/edit-lines :exit t) 740 | ("a" mc/mark-all-like-this :exit t) 741 | ("n" mc/mark-next-like-this) 742 | ("N" mc/skip-to-next-like-this) 743 | ("M-n" mc/unmark-next-like-this) 744 | ("p" mc/mark-previous-like-this) 745 | ("P" mc/skip-to-previous-like-this) 746 | ("M-p" mc/unmark-previous-like-this) 747 | ("|" mc/vertical-align) 748 | ("s" mc/mark-all-in-region-regexp :exit t) 749 | ("0" mc/insert-numbers :exit t) 750 | ("A" mc/insert-letters :exit t) 751 | ("<mouse-1>" mc/add-cursor-on-click) 752 | ;; Help with click recognition in this hydra 753 | ("<down-mouse-1>" ignore) 754 | ("<drag-mouse-1>" ignore) 755 | ("q" nil))) 756 | #+end_src 757 | * markdown 758 | #+begin_src emacs-lisp :tangle yes 759 | (use-package markdown-mode 760 | :mode "\\.md\\'" 761 | :ensure t) 762 | #+end_src 763 | * holidays 764 | #+begin_src emacs-lisp :tangle yes 765 | (setq holiday-general-holidays 766 | '((holiday-fixed 1 1 "Neujahr") 767 | (holiday-fixed 5 1 "Tag der Arbeit") 768 | (holiday-fixed 10 3 "Tag der deutschen Einheit"))) 769 | (setq holiday-christian-holidays 770 | '((holiday-fixed 12 25 "1. Weihnachtstag") 771 | (holiday-fixed 12 26 "2. Weihnachtstag") 772 | (holiday-fixed 1 6 "Heilige 3 Könige") 773 | (holiday-fixed 10 31 "Reformationstag") 774 | (holiday-fixed 11 1 "Allerheiligen") 775 | ;; Date of Easter calculation taken from holidays.el. 776 | (let* ((century (1+ (/ displayed-year 100))) 777 | (shifted-epact (% (+ 14 (* 11 (% displayed-year 19)) 778 | (- (/ (* 3 century) 4)) 779 | (/ (+ 5 (* 8 century)) 25) 780 | (* 30 century)) 781 | 30)) 782 | (adjusted-epact (if (or (= shifted-epact 0) 783 | (and (= shifted-epact 1) 784 | (< 10 (% displayed-year 19)))) 785 | (1+ shifted-epact) 786 | shifted-epact)) 787 | (paschal-moon (- (calendar-absolute-from-gregorian 788 | (list 4 19 displayed-year)) 789 | adjusted-epact)) 790 | (easter (calendar-dayname-on-or-before 0 (+ paschal-moon 7)))) 791 | (holiday-filter-visible-calendar 792 | (mapcar 793 | (lambda (l) 794 | (list (calendar-gregorian-from-absolute (+ easter (car l))) 795 | (nth 1 l))) 796 | '(( -2 "Karfreitag") 797 | ( 0 "Ostersonntag") 798 | ( +1 "Ostermontag") 799 | (+39 "Christi Himmelfahrt") 800 | (+49 "Pfingstsonntag") 801 | (+50 "Pfingstmontag") 802 | (+60 "Fronleichnam"))))))) 803 | (setq calendar-holidays (append holiday-general-holidays holiday-christian-holidays)) 804 | #+end_src 805 | * ledger 806 | #+begin_src emacs-lisp :tangle yes 807 | (use-package ledger-mode 808 | :ensure t 809 | :mode "\\.ledger\\'" 810 | :config 811 | (progn 812 | (setq ledger-default-date-format "%Y-%m-%d") 813 | (setq ledger-use-iso-dates t) 814 | (setq ledger-report-use-strict t) 815 | (setq ledger-reconcile-default-commodity "€") 816 | (let ((height (face-attribute 'default :height))) 817 | (set-face-attribute 'ledger-font-payee-cleared-face nil :height height) 818 | (set-face-attribute 'ledger-font-payee-uncleared-face nil :height height)))) 819 | #+end_src 820 | * proofgeneral 821 | #+begin_src emacs-lisp :tangle yes 822 | (use-package proof-site 823 | :load-path ("~/code/emacs/PG/generic") 824 | :mode ("\\.v\\'" . coq-mode) 825 | :init (setq proof-splash-enable nil) 826 | :config (setq proof-three-window-mode-policy 'hybrid)) 827 | (use-package company-coq 828 | :load-path ("~/code/emacs/company-coq/") 829 | :commands (company-coq-mode) 830 | :init (add-hook 'coq-mode-hook 'company-coq-mode t)) 831 | (use-package coq 832 | :defer t) 833 | #+end_src 834 | * json 835 | #+begin_src emacs-lisp :tangle yes 836 | (use-package json-mode 837 | :mode "\\.json\\'" 838 | :ensure t) 839 | #+end_src 840 | * web 841 | #+begin_src emacs-lisp :tangle yes 842 | (use-package web-mode 843 | :ensure t 844 | :mode ("\\.html\\'" 845 | "\\.css\\'" 846 | "\\.php\\'") 847 | :config 848 | (progn 849 | (setq web-mode-code-indent-offset 2) 850 | (setq web-mode-enable-auto-quoting nil))) 851 | #+end_src 852 | * yaml 853 | #+begin_src emacs-lisp :tangle yes 854 | (use-package yaml-mode 855 | :mode "\\.yaml\\'" 856 | :ensure t) 857 | #+end_src 858 | * nginx 859 | #+begin_src emacs-lisp :tangle yes 860 | (use-package nginx-mode 861 | :mode "\\.nginx\\'" 862 | :ensure t) 863 | #+end_src 864 | * c/c++ 865 | #+begin_src emacs-lisp :tangle yes 866 | (use-package cc-mode 867 | :mode (("\\.cpp\\'" . c++-mode) 868 | ("\\.c\\'" . c-mode)) 869 | :init 870 | (progn 871 | (defun remap-fill-paragraph () (define-key c++-mode-map [remap c-fill-paragraph] #'clang-format-buffer)) 872 | (defun remap-fill-paragraph-c () (define-key c-mode-map [remap c-fill-paragraph] #'clang-format-buffer)) 873 | (add-hook 'c++-mode-hook 'remap-fill-paragraph) 874 | (add-hook 'c-mode-hook 'remap-fill-paragraph-c)) 875 | :config 876 | (progn 877 | (setq c-basic-offset 4))) 878 | (use-package cc-styles 879 | :config 880 | (progn 881 | (c-set-offset 'inextern-lang 0))) 882 | (use-package clang-format 883 | :ensure t 884 | :commands (clang-format-buffer)) 885 | #+end_src 886 | * rust 887 | #+begin_src emacs-lisp :tangle yes 888 | (use-package rust-mode 889 | :mode "\\.rs\\'" 890 | :ensure t) 891 | #+end_src 892 | * toml 893 | #+begin_src emacs-lisp :tangle yes 894 | (use-package toml-mode 895 | :mode "\\.toml\\'" 896 | :ensure t) 897 | #+end_src 898 | * sml 899 | #+begin_src emacs-lisp :tangle yes 900 | (use-package sml-mode 901 | :ensure t 902 | :mode ("\\.fun\\'" "\\.sig\\'" "\\.sml\\'")) 903 | #+end_src 904 | * jonprl 905 | #+begin_src emacs-lisp :tangle yes 906 | (use-package jonprl-mode 907 | :mode "\\.jonprl\\'" 908 | :ensure t) 909 | #+end_src 910 | * gnuplot 911 | #+begin_src emacs-lisp :tangle yes 912 | (use-package gnuplot 913 | :commands gnuplot-mode 914 | :defer t 915 | :ensure t) 916 | #+end_src 917 | * cmake 918 | #+begin_src emacs-lisp :tangle yes 919 | (use-package cmake-mode 920 | :ensure t 921 | :mode "CMakeLists\\.txt\\'") 922 | #+end_src 923 | * docker 924 | #+begin_src emacs-lisp :tangle yes 925 | (use-package dockerfile-mode 926 | :mode "Dockerfile\\'" 927 | :ensure t) 928 | #+end_src 929 | * smtlib 930 | #+begin_src emacs-lisp :tangle yes 931 | #+end_src 932 | * pdf-tools 933 | #+begin_src emacs-lisp :tangle yes 934 | (use-package pdf-tools 935 | :mode ("\\.pdf\\'" . pdf-view-mode) 936 | :ensure t 937 | :init (add-hook 'pdf-view-mode-hook 'pdf-view-fit-page-to-window)) 938 | #+end_src 939 | * lean 940 | #+begin_src emacs-lisp :tangle yes 941 | (use-package dash 942 | :defer t 943 | :ensure t) 944 | (use-package dash-functional 945 | :defer t 946 | :ensure t) 947 | (use-package f 948 | :defer t 949 | :ensure t) 950 | (use-package lua-mode 951 | :defer t 952 | :ensure t) 953 | (use-package mmm-mode 954 | :defer t 955 | :ensure t) 956 | (use-package lean-mode 957 | :mode ("\\.lean\\'" "\\.hlean\\'") 958 | :load-path "~/code/lean/src/emacs" 959 | :init (setq lean-rootdir "~/code/lean/")) 960 | #+end_src 961 | * scala 962 | #+begin_src emacs-lisp :tangle yes 963 | (use-package scala-mode 964 | :ensure t 965 | :mode ("\\.scala\\'" . scala-mode) 966 | ;; :config (add-hook 'scala-mode-hook 'ensime-scala-mode-hook) 967 | ) 968 | #+end_src 969 | * rainbow 970 | #+begin_src emacs-lisp :tangle yes 971 | (use-package rainbow-delimiters 972 | :ensure t 973 | :commands rainbow-delimiters-mode 974 | :init 975 | (add-hook 'prog-mode-hook #'rainbow-delimiters-mode)) 976 | #+end_src 977 | * tramp 978 | #+begin_src emacs-lisp :tangle yes 979 | (setq tramp-default-method "ssh") 980 | #+end_src 981 | * keyfreq 982 | #+begin_src emacs-lisp :tangle yes 983 | (use-package keyfreq 984 | :ensure t 985 | :config 986 | (setq keyfreq-excluded-commands 987 | '(self-insert-command 988 | previous-line 989 | next-line 990 | mu4e~headers-jump-to-maildir 991 | mwheel-scroll 992 | mouse-drag-region 993 | mouse-set-point 994 | left-char 995 | ivy-done 996 | kill-line 997 | save-buffers 998 | mu4e-headers-search-bookmark)) 999 | :config 1000 | (keyfreq-mode 1) 1001 | (keyfreq-autosave-mode 1)) 1002 | #+end_src 1003 | * systemd 1004 | #+begin_src emacs-lisp :tangle yes 1005 | (use-package systemd 1006 | :ensure t 1007 | :mode ("\\.socket\\'" . systemd-mode)) 1008 | #+end_src 1009 | * writeroom 1010 | #+begin_src emacs-lisp :tangle yes 1011 | (use-package writeroom-mode 1012 | :ensure t 1013 | :commands writeroom-mode 1014 | :config 1015 | (progn 1016 | (defun my-writeroom-theme (arg) 1017 | (cond 1018 | ((= arg 1) 1019 | (enable-theme 'leuven) 1020 | (disable-theme 'doom-one) 1021 | (text-scale-increase 1)) 1022 | ((= arg -1) 1023 | (disable-theme 'leuven) 1024 | (enable-theme 'doom-one) 1025 | (text-scale-increase 0)))) 1026 | (add-to-list 'writeroom-global-effects 'my-writeroom-theme) 1027 | (add-to-list 'writeroom-global-effects 'visual-line-mode)) 1028 | :init (load-theme 'leuven nil t)) 1029 | #+end_src 1030 | * bison 1031 | #+BEGIN_SRC emacs-lisp :tangle yes 1032 | (use-package bison-mode 1033 | :commands (bison-mode) 1034 | :ensure t) 1035 | #+END_SRC 1036 | * prolog 1037 | #+BEGIN_SRC emacs-lisp :tangle yes 1038 | (use-package prolog 1039 | :load-path "~/code/emacs/prolog" 1040 | :mode ("\\.pl\\'" . prolog-mode) 1041 | :config 1042 | (setq-default prolog-system 'swi) 1043 | (setq prolog-system 'swi)) 1044 | #+END_SRC 1045 | * racket 1046 | #+BEGIN_SRC emacs-lisp :tangle yes 1047 | (use-package racket-mode 1048 | :mode "\\.rkt\\'" 1049 | :ensure t) 1050 | #+END_SRC 1051 | * smartparens 1052 | #+BEGIN_SRC emacs-lisp :tangle yes 1053 | (use-package smartparens-config 1054 | :ensure smartparens 1055 | :commands (turn-on-smartparens-strict-mode) 1056 | :demand t 1057 | :init 1058 | (progn 1059 | (add-hook 'racket-mode-hook #'turn-on-smartparens-strict-mode) 1060 | (add-hook 'racket-repl-mode-hook #'turn-on-smartparens-strict-mode) 1061 | (add-hook 'lisp-mode-hook #'turn-on-smartparens-strict-mode) 1062 | (add-hook 'emacs-lisp-mode-hook #'turn-on-smartparens-strict-mode)) 1063 | :config 1064 | (progn 1065 | (setq sp-show-pair-delay 0) 1066 | (show-smartparens-global-mode t)) 1067 | :bind 1068 | (:map smartparens-mode-map 1069 | ("C-M-f" . sp-forward-sexp) 1070 | ("C-M-b" . sp-backward-sexp) 1071 | 1072 | ("C-M-d" . sp-down-sexp) 1073 | ("C-M-e" . sp-up-sexp) 1074 | 1075 | ("C-M-a" . sp-backward-down-sexp) 1076 | ("C-M-u" . sp-backward-up-sexp) 1077 | 1078 | ("C-S-d" . sp-beginning-of-sexp) 1079 | ("C-S-a" . sp-end-of-sexp) 1080 | 1081 | ("C-M-n" . sp-next-sexp) 1082 | ("C-M-p" . sp-previous-sexp) 1083 | 1084 | ("C-M-k" . sp-kill-sexp) 1085 | ("C-M-w" . sp-copy-sexp) 1086 | 1087 | ("M-[" . sp-backward-unwrap-sexp) 1088 | ("M-]" . sp-unwrap-sexp) 1089 | 1090 | ("C-)" . sp-forward-slurp-sexp) 1091 | ("C-(" . sp-forward-barf-sexp) 1092 | ("C-M-)" . sp-backward-slurp-sexp) 1093 | ("C-M-(" . sp-backward-barf-sexp) 1094 | 1095 | ("M-D" . sp-splice-sexp) 1096 | ("C-M-<delete>" . sp-spilce-sexp-killing-forward) 1097 | ("C-M-<backspace>" . sp-splice-sexp-killing-backward) 1098 | ("C-S-<backspace>" . sp-splice-sexp-killing-around) 1099 | 1100 | ("C-]" . sp-select-next-thing-exchange) 1101 | ("C-M-]" . sp-select-next-thing) 1102 | 1103 | ("M-F" . sp-forward-symbol) 1104 | ("M-B" . sp-backward-symbol) 1105 | ("M-q" . sp-indent-defun) 1106 | ("M-r" . sp-raise-sexp))) 1107 | #+END_SRC 1108 | * ocaml 1109 | #+begin_src emacs-lisp :tangle yes 1110 | (use-package tuareg 1111 | :ensure t 1112 | :mode ("\\.ml\\'" . tuareg-mode)) 1113 | #+end_src 1114 | * js 1115 | #+begin_src emacs-lisp :tangle yes 1116 | (defun lunaryorn-use-js-executables-from-node-modules () 1117 | "Set executables of JS checkers from local node modules." 1118 | (-when-let* ((file-name (buffer-file-name)) 1119 | (root (locate-dominating-file file-name "node_modules")) 1120 | (module-directory (expand-file-name "node_modules" root))) 1121 | (pcase-dolist (`(,checker . ,module) '((javascript-jshint . "jshint") 1122 | (javascript-eslint . "eslint") 1123 | (javascript-jscs . "jscs"))) 1124 | (let ((package-directory (expand-file-name module module-directory)) 1125 | (executable-var (flycheck-checker-executable-variable checker))) 1126 | (when (file-directory-p package-directory) 1127 | (set (make-local-variable executable-var) 1128 | (expand-file-name (concat "bin/" module ".js") 1129 | package-directory))))))) 1130 | (use-package js2-mode 1131 | :ensure t 1132 | :mode ("\\.js\\'" . js2-mode) 1133 | :config 1134 | (progn 1135 | (setq js2-basic-offset 2) 1136 | (setq js2-mode-show-parse-errors nil) 1137 | (flycheck-add-mode 'javascript-eslint 'rjsx-mode)) 1138 | :init (add-hook 'js2-mode-hook 'lunaryorn-use-js-executables-from-node-modules)) 1139 | (use-package rjsx-mode 1140 | :mode ("\\(components\\|containers\\).*\\.js\\'" . rjsx-mode) 1141 | :ensure t) 1142 | (use-package prettier-js 1143 | :load-path "~/code/js/prettier/editors/emacs" 1144 | :commands (prettier-mode prettier) 1145 | :init (add-hook 'js2-mode-hook 'prettier-mode) 1146 | :bind (:map js2-mode-map ("M-q" . prettier)) 1147 | :config (setq prettier-target-mode "js2-mode")) 1148 | #+end_src 1149 | * webpaste 1150 | #+begin_src emacs-lisp :tangle yes 1151 | (use-package webpaste 1152 | :ensure t 1153 | :commands (webpaste-paste-buffer webpaste-paste-region)) 1154 | #+end_src 1155 | * nix 1156 | #+begin_src emacs-lisp :tangle yes 1157 | (use-package nix-mode 1158 | :ensure t 1159 | :mode "\\.nix\\'") 1160 | #+end_src 1161 | * verilog 1162 | #+begin_src emacs-lisp :tangle yes 1163 | (use-package verilog-mode 1164 | :config 1165 | (setq verilog-auto-newline nil)) 1166 | #+end_src 1167 | * why3 1168 | #+begin_src emacs-lisp :tangle yes 1169 | (use-package why3 1170 | :load-path "/home/moritz/code/why3-0.88.1/share/emacs/site-lisp/" 1171 | :mode ("\\.mlw\\'" . why3-mode)) 1172 | #+end_src 1173 | * spell checking 1174 | #+begin_src emacs-lisp :tangle yes 1175 | (use-package ispell 1176 | :config 1177 | (progn 1178 | (setq ispell-program-name (executable-find "hunspell")) 1179 | (setq ispell-dictionary "en_US") 1180 | (setq ispell-tex-skip-alists 1181 | (list 1182 | (append 1183 | (car ispell-tex-skip-alists) 1184 | '(("\\\\autocite" ispell-tex-arg-end) 1185 | ("\\\\autocites" ispell-tex-arg-end))) 1186 | (cadr ispell-tex-skip-alists))))) 1187 | (use-package flyspell-correct-ivy 1188 | :ensure t 1189 | :after flyspell 1190 | :bind (:map flyspell-mode-map 1191 | ("C-;" . flyspell-correct-previous-word-generic))) 1192 | (use-package langtool 1193 | :ensure t 1194 | :config 1195 | (progn 1196 | (setq langtool-bin "/usr/bin/languagetool") 1197 | (setq langtool-default-language "en-US"))) 1198 | #+end_src 1199 | * gist 1200 | #+begin_src emacs-lisp :tangle yes 1201 | (use-package gist 1202 | :ensure t) 1203 | #+end_src 1204 | * auth-sources 1205 | #+begin_src emacs-lisp :tangle yes 1206 | (setq auth-sources '("~/.authinfo.gpg" "~/.authinfo" "~/.netrc")) 1207 | #+end_src 1208 | * academic-phrases 1209 | #+begin_src emacs-lisp :tangle yes 1210 | (use-package academic-phrases 1211 | :ensure t) 1212 | #+end_src 1213 | * glsl 1214 | #+begin_src emacs-lisp :tangle yes 1215 | (use-package glsl-mode 1216 | :ensure t) 1217 | #+end_src 1218 | * Agda 1219 | #+BEGIN_SRC emacs-lisp :tangle yes 1220 | (use-package agda2 1221 | :mode ("\\.agda\\'" . agda2-mode)) 1222 | #+END_SRC 1223 | --------------------------------------------------------------------------------