From 7b2c58f8f2a011ccfdae80ca4c4892e7e644e73b Mon Sep 17 00:00:00 2001 From: Sebastian Schulze Date: Wed, 2 Sep 2015 14:28:01 +0200 Subject: [PATCH] And the ~/. was with with Emacs and Emacs was ~/. --- .gitignore | 1 + .homesick_subdir | 3 +- home/.emacs.d/personal/.gitkeep | 0 home/.emacs.d/personal/appearance-config.el | 31 ++++++++++++ home/.emacs.d/personal/bascht.el | 46 ++++++++++++++++++ home/.emacs.d/personal/coding-config.el | 47 ++++++++++++++++++ home/.emacs.d/personal/custom.el | 13 +++++ home/.emacs.d/personal/mail-config.el | 53 +++++++++++++++++++++ home/.emacs.d/personal/org-config.el | 14 ++++++ home/.emacs.d/personal/shortcut-config.el | 51 ++++++++++++++++++++ home/.emacs.d/personal/snippets/vgb | 7 +++ 11 files changed, 265 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 home/.emacs.d/personal/.gitkeep create mode 100644 home/.emacs.d/personal/appearance-config.el create mode 100644 home/.emacs.d/personal/bascht.el create mode 100644 home/.emacs.d/personal/coding-config.el create mode 100644 home/.emacs.d/personal/custom.el create mode 100644 home/.emacs.d/personal/mail-config.el create mode 100644 home/.emacs.d/personal/org-config.el create mode 100644 home/.emacs.d/personal/shortcut-config.el create mode 100644 home/.emacs.d/personal/snippets/vgb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c531d98 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.elc diff --git a/.homesick_subdir b/.homesick_subdir index 76e3eec..0161110 100644 --- a/.homesick_subdir +++ b/.homesick_subdir @@ -1,3 +1,4 @@ .mutt .maid -.config \ No newline at end of file +.config +.emacs.d/personal \ No newline at end of file diff --git a/home/.emacs.d/personal/.gitkeep b/home/.emacs.d/personal/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/home/.emacs.d/personal/appearance-config.el b/home/.emacs.d/personal/appearance-config.el new file mode 100644 index 0000000..d65bb8e --- /dev/null +++ b/home/.emacs.d/personal/appearance-config.el @@ -0,0 +1,31 @@ +;;; bascht --- all the looks +;;; Commentary: +;;; All the looks + +;;; Code: + +(require 'moe-theme) +(setq moe-theme-highlight-buffer-id t) +(setq moe-theme-resize-org-title '(1.5 1.4 1.3 1.2 1.1 1.0 1.0 1.0 1.0)) +(moe-dark) + + +(defun on-after-init () "Don't set a background for -nw Emacs." + (unless (display-graphic-p (selected-frame)) + (set-face-background 'default "unspecified-bg" (selected-frame)))) + +(add-hook 'window-setup-hook 'on-after-init) + +(if (display-graphic-p) + '(progn + '(menu-bar-mode) + (custom-set-faces + '(mode-line ((t (:background "#85C" :foreground "#85CEEB" :box (:line-width 1 :color "dodger blue"))))) + ) + + (custom-set-faces + '(mode-line ((t (:background "brightblack" :foreground "#4e4e4e" :box (:line-width 1 :color "dodger blue"))))) + ))) + +(provide 'appearance-config) +;;; appearance-config.el ends here diff --git a/home/.emacs.d/personal/bascht.el b/home/.emacs.d/personal/bascht.el new file mode 100644 index 0000000..8e006ad --- /dev/null +++ b/home/.emacs.d/personal/bascht.el @@ -0,0 +1,46 @@ +;;; bascht --- meine settings +;;; Commentary: +;;; Hacky as whatnot, but it's mime. +;;; Code: + +(require 'package) +(require 'ag) +(require 'nyan-mode) +(require 'notmuch) +(require 'notmuch-address) +(require 'multiple-cursors) +(require 'yasnippet) +(require 'rspec-mode) +(require 'ansi-color) + +(add-to-list 'load-path "~/.emacs.d/personal/") + +(load-library "org-config") +(load-library "appearance-config") +(load-library "coding-config") +(load-library "mail-config") +(load-library "shortcut-config") + +;; Archives from which to fetch. +(setq package-archives + (append '(("melpa" . "http://melpa.org/packages/")) + package-archives)) + +;;; Hello, Emacs! +(setq user-full-name "Sebastian Schulze") +(setq user-mail-address "github.com@bascht.com") + +;;; Global modes +(projectile-global-mode) +(global-company-mode) +(global-hl-line-mode 0) +(yas-global-mode 1) + +(setq ispell-dictionary "german") + +(add-hook 'text-mode-hook 'flyspell-mode) +(add-hook 'text-mode-hook 'auto-fill-mode) + +(setq browse-url-browser-function (quote browse-url-firefox)) + +;;; bascht.el ends here diff --git a/home/.emacs.d/personal/coding-config.el b/home/.emacs.d/personal/coding-config.el new file mode 100644 index 0000000..bd4b646 --- /dev/null +++ b/home/.emacs.d/personal/coding-config.el @@ -0,0 +1,47 @@ +;;; bascht --- Code configs +;;; Commentary: +;;; Coding related settings / libs + +;;; Code: + +(require 'rspec-mode) + +(eval-after-load 'rspec-mode + '(rspec-install-snippets)) + +(defun colorize-compilation-buffer () "Nice colours there." + (read-only-mode) + (ansi-color-apply-on-region (point-min) (point-max)) + (read-only-mode)) +(add-hook 'compilation-filter-hook 'colorize-compilation-buffer) + +(defun do-in-root (f) "Execute command F in project root." + (if (projectile-project-p) + (funcall f (projectile-project-root)) + (error "You're not in project"))) + +(defun helm-do-ag-in-root () "Open helm ag current project root." + (interactive) + (do-in-root 'helm-do-ag)) + +(defun do-ag-in-root (string) "Search for ag for STRING in current project root." + (interactive (list (read-from-minibuffer "Search string: " (ag/dwim-at-point)))) + (do-in-root '(lambda (root) (ag/search string root)))) + + +(add-hook 'rspec-mode-hook 'turn-off-flycheck) +(setq rspec-command-options "--format progress") +(setq rspec-spec-command "rspec") +(setq ruby-insert-encoding-magic-comment nil) + +(setq flycheck-rust-executable "/usr/local/bin/rustc") +(setq flycheck-rust-library-path (quote ("/usr/local/lib"))) + +;;; Fix up rust mode +(setenv "LD_LIBRARY_PATH" + (let ((current (getenv "LD_LIBRARY_PATH")) + (new "/usr/local/libs")) + (if current (concat new ":" current) new))) + +(provide 'coding-config) +;;; coding-config.el ends here diff --git a/home/.emacs.d/personal/custom.el b/home/.emacs.d/personal/custom.el new file mode 100644 index 0000000..c3dfcae --- /dev/null +++ b/home/.emacs.d/personal/custom.el @@ -0,0 +1,13 @@ +;;; bascht --- custom settings +;;; Commentary: +;;; Everyting emacs will spit out of M-x customize + +;;; Code: + +(custom-set-variables + '(custom-safe-themes + (quote + ("987d1efa769be3310d48359e54e3c8f6a742449f0c46a651512368359020b87f" default)))) + +(provide 'custom) +;;; custom.el ends here diff --git a/home/.emacs.d/personal/mail-config.el b/home/.emacs.d/personal/mail-config.el new file mode 100644 index 0000000..6658aea --- /dev/null +++ b/home/.emacs.d/personal/mail-config.el @@ -0,0 +1,53 @@ +;;; bascht --- notmuch settings +;;; Commentary: +;;; notmuch and mail related settings + +;;; Code: + +(require 'notmuch) + +(setq notmuch-address-command "/home/bascht/bin/address") +(notmuch-address-message-insinuate) +(setq notmuch-archive-tags '("-unread" "+archive")) +(add-hook 'message-setup-hook 'mml-secure-message-sign-pgpmime) + +(defun notmuch-unread () "Filter for unread and inboxed messages." + (interactive) + (notmuch-search "tag:unread and tag:inbox")) + +(defun notmuch-search-toggle-flagged () + "Toggle flagged state on the current item." + (lambda () + (interactive) + (if (member "flagged" (notmuch-search-get-tags)) + (notmuch-search-tag (list (concat "+" "flagged")))) + (notmuch-search-tag (list(concat "-" "flagged"))) + (notmuch-search-next-thread))) + +(setq notmuch-crypto-process-mime t) +(setq notmuch-hello-sections + (quote + (notmuch-hello-insert-header notmuch-hello-insert-saved-searches notmuch-hello-insert-search notmuch-hello-insert-recent-searches notmuch-hello-insert-alltags notmuch-hello-insert-footer notmuch-hello-insert-inbox))) +(setq notmuch-message-headers (quote ("Subject" "To" "Cc" "Date" "Received"))) +(setq notmuch-search-oldest-first nil) + + +(setq message-send-mail-function 'message-send-mail-with-sendmail) +(setq sendmail-program "~/bin/msmtpq" + user-full-name "Sebastian Schulze") + +(setq message-sendmail-f-is-evil 't) +(setq message-sendmail-extra-arguments '("--read-envelope-from")) +(setq message-kill-buffer-on-exit t) + +(setq mail-host-address "bascht.com") + +;;; load mail-mode when starting up from mutt +(setq auto-mode-alist (append '(("/tmp/mutt.*" . mail-mode)) auto-mode-alist)) + +(add-hook 'mail-mode-hook 'turn-on-flyspell) +(add-hook 'mail-mode-hook 'turn-on-longlines) +(add-hook 'mail-mode-hook 'auto-fill-mode) + +(provide 'mail-config) +;;; mail-config.el ends here diff --git a/home/.emacs.d/personal/org-config.el b/home/.emacs.d/personal/org-config.el new file mode 100644 index 0000000..9908682 --- /dev/null +++ b/home/.emacs.d/personal/org-config.el @@ -0,0 +1,14 @@ +;;; bascht --- org stuff +;;; Commentary: +;;; org-mode related settings + +;;; Code: + +(require 'org) + +(setq org-directory "~/ownCloud/clientsync/Zettelkasten") +(setq org-agenda-files (quote ("~/ownCloud/clientsync/Zettelkasten"))) +(setq org-default-notes-file "~/ownCloud/clientsync/Zettelkasten/refile.org") + +(provide 'org-config) +;;; org-config.el ends here diff --git a/home/.emacs.d/personal/shortcut-config.el b/home/.emacs.d/personal/shortcut-config.el new file mode 100644 index 0000000..85f2a44 --- /dev/null +++ b/home/.emacs.d/personal/shortcut-config.el @@ -0,0 +1,51 @@ +;;; bascht --- Shortcuts +;;; Commentary: +;;; Just keyboard shortcuts + +;;; Code: + +(require 'notmuch) + +(global-set-key [f9] 'notmuch-unread) +(define-key notmuch-search-mode-map "F" + (notmuch-search-toggle-flagged)) + + +(global-set-key (kbd "M-x") 'helm-M-x) +(global-set-key (kbd "C-x b") 'helm-buffers-list) +(global-set-key (kbd "C-c f") 'helm-recentf) +(global-set-key (kbd "C-c p s s") 'helm-do-ag-in-root) +(global-set-key (kbd "C-x C-f") 'helm-find-files) +(global-set-key (kbd "C-c H") 'helm-do-ag-in-root) +(global-set-key (kbd "M-p") 'ace-window) + +;;; I <3 multiple cursors! +(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) +(global-set-key (kbd "C-s->") 'mc/mark-next-like-this) +(global-set-key (kbd "C-s-<") 'mc/mark-previous-like-this) +(global-set-key (kbd "C-s-c s-<") 'mc/mark-all-like-this) +(global-set-key (kbd "C-S-") 'mc/add-cursor-on-click) + + +(global-set-key (kbd "M-+") 'er/expand-region) + +;;; Navigate IDO with N + N +(add-hook 'ido-setup-hook '(lambda () + (define-key ido-completion-map "\C-h" 'ido-delete-backward-updir) + (define-key ido-completion-map "\C-n" 'ido-next-match) + (define-key ido-completion-map "\C-p" 'ido-prev-match) + )) + +(defun fd-switch-dictionary() "Change Flyspell Dictionary on the fly." + (interactive) + (let* ((dic ispell-current-dictionary) + (change (if (string= dic "deutsch8") "english" "deutsch8"))) + (ispell-change-dictionary change) + (message "Dictionary switched from %s to %s" dic change) + )) + +(global-set-key (kbd "") 'fd-switch-dictionary) + + +(provide 'shortcut-config) +;;; shortcut-config.el ends here diff --git a/home/.emacs.d/personal/snippets/vgb b/home/.emacs.d/personal/snippets/vgb new file mode 100644 index 0000000..51a4254 --- /dev/null +++ b/home/.emacs.d/personal/snippets/vgb @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: Viele Grüße +# key: vgb +# binding: direct-keybinding +# -- +Viele Grüße, + Bascht \ No newline at end of file