Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


My Emacs Configuration

So I just learned about the org babel stuff, and I think I might save my emacs configuration in an org file like this, and then have emacs just load it with org-babel… It deff makes it easier to navigate around the file…

Repos & Core Packages


Melpa is the big package repo that nearly everything can be found. It’s a must for emacs configs.

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))

Setup use-package if isn’t already

(unless (package-installed-p 'use-package)
  (package-install 'use-package))

  (require 'use-package))

Core Setup

Basic Stuff

Better Defaults

(use-package better-defaults
  :ensure t)

Splash Screen

Remove splash screen and use scratch instead as the home buffer

(setq inhibit-startup-message t
      inhibit-startup-echo-area-message t)

Backup Directory

Funnel all the auto backup files to one location.

(setq backup-directory-alist '(("." . "~/nextcloud/emacs/backups")))

Line Numbers

Switch line numbers on by default in all buffers

(global-linum-mode 1)

Menu Bar

Switch the Menubar off by default (I like to keep everything clean)

(menu-bar-mode -1)

… but still let me easily toggle it on/off

;; Toggle menubar keybind
(global-set-key (kbd "C-c m") 'menu-bar-mode)

Scroll Bar

Remove Scroll Bars

(scroll-bar-mode -1)

Tool Bar

Remove Tool Bars

(tool-bar-mode -1)

New Line indent

New lines auto indents

(define-key global-map (kbd "RET")

Tool Tips

Tool Tips in echo area

(tooltip-mode -1)
(setq tooltip-use-echo-area t)

Smooth Scrolling

Smooth Scrolling

(use-package smooth-scroll
    :ensure t)


Load manual install theme dir

(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")

Install Themes from Repos

List of themes to install

(use-package monokai-alt-theme
  :ensure t
  :defer t)
(use-package gruvbox-theme
  :ensure t
  :defer t)
(use-package darkokai-theme
  :ensure t
  :defer t)
(use-package darktooth-theme
  :ensure t
  :defer t)
(use-package creamsody-theme
  :ensure t
  :defer t)
(use-package github-theme
  :ensure t
  :defer t)
(use-package melancholy-theme
  :ensure t
  :defer t)
(use-package darkburn-theme
  :ensure t
  :defer t)
(use-package kaolin-themes
  :ensure t
  :defer t)
(use-package dracula-theme
  :ensure t
  :defer t)
(use-package darkokai-theme
  :ensure t
  :defer t)

Load Current default theme

(load-theme 'darkokai t)


Set default font

(set-default-font "Hack-10")


Use the “dashboard” package for my startup screen.

(use-package dashboard
  :ensure t

  ;; Edits
  (setq dashboard-banner-logo-title "Welcome to Emacs, Ryan!")
  (setq dashboard-startup-banner 'logo)
  (setq dashboard-items '((recents   . 5)
                          (bookmarks . 5)
                          (agenda    . 5))))

Window Management


(use-package switch-window
  :ensure t)

Key Binding

;; Previous Window shortcut
(global-set-key (kbd "C-x p")
                (lambda() (interactive) (other-window -1)))
(global-set-key (kbd "C-x O")
                (lambda() (interactive) (switch-window)))
(global-set-key (kbd "C-x o")
                (lambda() (interactive) (other-window 1)))
(global-set-key (kbd "C-x \)")
                (lambda() (interactive) (other-frame 1)))
(global-set-key (kbd "C-x 0")
                (lambda() (interactive) (delete-window)))

(global-set-key (kbd "C-c z") 'zoom-window)

Evil Mode

Here is my Evile Mode setup. I’ve nested other use-pacages inside of it, so that if I am using evil, the packages that depend on it go ahead and configure themselves.

;; Evil Mode
(use-package evil
  :ensure t

  (evil-mode 1)
  (use-package evil-leader
    :ensure t
    (global-evil-leader-mode t)
    (evil-leader/set-leader "<SPC>")
      "s s" 'swiper
      "d x w" 'delete-trailing-whitespace)) 

  (use-package evil-surround
    :ensure t
    :config (global-evil-surround-mode))

  (use-package evil-indent-textobject
    :ensure t)

  (use-package evil-org
    :ensure t
    (evil-org-set-key-theme '(textobjects insert navigation additional shift todo heading))
    (add-hook 'org-mode-hook (lambda () (evil-org-mode))))

  (use-package powerline-evil
    :ensure t


Setup and use Ivy

(use-package ivy
  :ensure t
  (ivy-mode 1)
  (setq ivy-use-virtual-buffers t)
  (setq enable-recursive-minibuffers t)
  ;; Ivy Keybindings
  (global-set-key (kbd "C-c C-r") 'ivy-resume))

Configure Swiper

(use-package swiper
  :ensure t
  (global-set-key "\C-s" 'swiper)

Counsel configuration

(use-package counsel 
  :ensure t
  (global-set-key (kbd "M-x") 'counsel-M-x)
  (global-set-key (kbd "C-x C-f") 'counsel-find-file))

Key Bindings

These will eventually be relocations to just be included with their respective use-package calls…

;; Eshell launch keybind
(global-set-key (kbd "C-c t") 'eshell)

;; Comment/Uncomment region
(global-set-key (kbd "C-c ;") 'comment-region)

;; Comment/Uncomment region
(global-set-key (kbd "C-c s") 'org-edit-src-code)


Org Mode

Yes. It get’s it’s own section. Again, I’ve nested everything. I might break that up though now if I the babel stuff to generate my configs…

 (use-package org
   :ensure t
   ;; Make sure org file code highlights correctly
   (setq org-src-fontify-natively t)
   (setq org-todo-keywords '((sequence "TODO" "In Progress" "|" "Waiting" "DONE" "Completed")
			      (sequence "Queue" "Working On" "On Hold" "|" "Finished" "Removed")))

   (evil-leader/set-key-for-mode 'org-mode
     "m i" 'org-clock-in
     "m C" 'org-toggle-checkbox
     "m o" 'org-clock-out
     "m c" 'org-clock-jump-to-current-clock
     "m d" 'org-clock-display
     "m e" 'org-set-effort
     "m p" 'org-pomodoro
     "m t" 'org-set-tags-command
     "m m" 'org-clock-modify-effort-estimate
     "m s" 'org-schedule)

   ;; ;; Org Agenda stuff
   (setq org-agenda-files '("~/nextcloud/emacs/org/archive/work.org"))

   (defun org-code (start end)
     "Wraps selected text with org code tags"
     (interactive "r")
     (let ((selected-text (buffer-substring (mark) (point)))
	    (db-name (read-from-minibuffer "Language[common-lisp]: ")))
	(when (eq db-name "")
	  (setf db-name "common-lisp"))
	(kill-region start end)
	(insert (format "#+BEGIN_SRC %s \n%s \n#+END_SRC" db-name selected-text))))

   (use-package org-pomodoro
     :ensure t
     ;; Persistent Clocking
     (setq org-clock-persist 'history)

     ;; Default Table Params
     (setq org-clock-clocktable-default-properties '(:maxlevel 3 :scope subtree :tags "-Lunch"))

     ;; Org Pomodoro ;;
     ;; Setup pomodoro timer keybind
     (global-set-key (kbd "C-S-c C-S-p") 'org-pomodoro)
     (global-set-key (kbd "C-S-c C-S-e") 'org-pomodoro-extend-last-clock)

     (defun org-pomodoro-get-times ()
	(message "work length: %s  short break: %s  long break: %s"

     (defun org-pomodoro-set-pomodoro ()
	(setf org-pomodoro-length 35)
	(setf org-pomodoro-short-break-length 9)
	(setf org-pomodoro-long-break-length 15))


     (defun org-pomodoro-set-52-17 ()
	(setf org-pomodoro-length 52)
	(setf org-pomodoro-short-break-length 17)
	(setf org-pomodoro-long-break-length 17)))

Htmlize to export my org files to web pages:

(use-package htmlize
  :ensure t)

Add org-clock times into a :LOGBOOK: drawer.

(setq org-clock-into-drawer t)

Org Agenda open in current window

(setq org-agenda-window-setup 'current-window)


(use-package markdown-mode
  :ensure t)

Spell Check

I use ispell for spell checking. The actual libraries are set depending on the system (in my ./emacs-linux.el and ./emacs-work.el files).

(use-package ispell
  :ensure t
  (("C-c w" . 'ispell-word)
   ("C-c r" . 'ispell-region)))

Word Count

(use-package wc-mode
  :ensure t)

Auto word wrap

Automatically wrap my lines:

Removed default on for now… it’s actaully annoying for most things. I’ll eventually figure out which minor modes I want it on by default in and add those hooks here. I also left the setup command commented so I can default it to on again easily in the future if I want.

(use-package aggressive-fill-paragraph
  :ensure t


(use-package darkroom
  :ensure t
  :bind (("C-c d" . darkroom-mode)))


Auto Complete

(use-package auto-complete
  :ensure t


aggressive-indent automatically indents buffers as I type out my code. I love it.

(use-package aggressive-indent
  :ensure t
  (global-aggressive-indent-mode t))

Fill Column Indicator

Draws a line for the fill column, or at a different location.

(use-package fill-column-indicator
    :ensure t) 


smart parens does auto paring for my parenthesis

(use-package smartparens
  :ensure t
  ;; Remove ' and  from pairing
  (sp-pair "'" nil :actions :rem)
  (sp-pair "`" "'" :actions :rem)
  (smartparens-global-mode 1))


I use magit for easy git management

(use-package magit
  :ensure t
  (("C-c g"     . 'magit-status)
   ("C-c C-p"   . 'magit-push)))


Starting to learn projectile a little bit…

;; (use-package projectile
;;   :ensure t
;;   :config
;;   (projectile-global-mode)

;;   (use-package counsel-projectile
;;     :ensure t
;;     )
;;   )

Pretty Code

;; (require 'pretty-mode)
;; (pretty-lambda-mode t)

;;(global-pretty-lambda-mode t)


Setup YAML mode for editing configs

(use-package yaml-mode
  :ensure t)


Json mode:

(use-package json-mode
  :ensure t)


Starting a python dev setup:

;; This should only run fully if elpy is installed
    (use-package elpy
      :ensure t))

Set default interpreter to python 3 instead of 2.

(setf python-shell-interpreter "python3")


Setup my environment for programming in Go.

(use-package go-mode
  :ensure t
  (add-hook 'before-save-hook 'gofmt-before-save))

My Random Functions


Saves the current state of the buffers, and then zooms the current buffer full screen. When called again, goes back to origonal buffer setup.

(setq zoom-temp-window-configuration nil)
(defun zoom-window ()
  (if zoom-temp-window-configuration
        (set-window-configuration zoom-temp-window-configuration)
	(setq zoom-temp-window-configuration nil)
        (message "Window un-zoomed"))
      (setq zoom-temp-window-configuration (current-window-configuration))
      (message "Window zoomed"))))


Clears my eshell more like a normal terminal would

(defun eshell-clear-buffer ()
  "Clear terminal"
  (let ((inhibit-read-only t))

I need this hook for the function, and I like to set it to a keybind:

(add-hook 'eshell-mode-hook
	     (local-set-key (kbd "C-l") 'eshell-clear-buffer)))

(global-set-key (kbd "C-c <delete>") 'eshell-clear-buffer)


Load my functions for org scrum stuff

(use-package ry-org-scrum
  :ensure t)

Load Other Configs

Work Settings


Load my Linux-specific configs

(when (string-equal system-type "gnu/linux")
  (load "~/dotfiles/emacs/.emacs-linux.el"))

The Rest

Auto Generated Stuff

Not sure what to do with this crap in my babel org config…

Theme Load

(put 'dired-find-alternate-file 'disabled nil)