 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Environment
 
-(require 'cl) ;; use common lisp everywhere
+(require 'cl-lib) ;; use common lisp everywhere
 
 ;; My emacs home directory
 (defvar emacs-root (if (or (eq system-type 'darwin)
                            (eq system-type 'gnu/linux)
                            (eq system-type 'linux))
-                        "/home/bsima/.dotfiles/emacs.d.symlink/"
+                        "/Users/bsima/.dotfiles/emacs.d.symlink/"
                         "c:/home/bsima"))
+
+(defun edit-init ()
+  "Edits my configuration file"
+  (interactive)
+  (find-file (concat emacs-root "init.el")))
+
+(defun load-init ()
+  "Loads my init file"
+  (interactive)
+  (load-file (concat emacs-root "init.el")))
+
+(defun open-github (&optional path)
+  "Opens GitHub.com. Prompts for an optional argument of a path to GitHub.
+
+For example: `explore` would resolve to https://github.com/explore, and
+`bsima/bsima` would resolve to https://github.com/bsima/bsima. If no path is
+provided, it defaults to https://github.com"
+  (interactive "sGitHub Path: ")
+  (browse-url
+   (if (null path)
+      "https://github.com"
+      (concat "https://github.com/" path))))
+
+(defun search-ddg (query)
+  "Seraches DuckDuckGo for query."
+  (interactive "sDDG: ")
+  (let ((q (replace-regexp-in-string "\s" "+" query t t)))
+    (browse-url (concat "https://duckduckgo.com?q=" q))))
 
 ;;;;;;;;;
 ;; src => http://howardism.org/Technical/Emacs/eshell-fun.html
 (defun eshell-here ()
-  "Opens up a new shell in the directory assiated with the
+  "Opens a new eshell in current directory.
+
+Opens up a new shell in the directory instantiated with the
 current buffer's file. The eshell is renamed to match said
 directory for easier identification if useing multiple eshells."
   (interactive)

(global-set-key "\C-x\C-k" 'kill-region)
(global-set-key "\C-c\C-k" 'kill-region)
(global-set-key (kbd "M-L") 'linum-mode)

;; M-x qrr = find and replace
(defalias 'qrr 'query-replace-regexp)


;; change theme based on day/night
(setq calendar-location-name "Home") 
(setq calendar-latitude 43.16)
(setq calendar-longitude -77.61)

(require 'theme-changer)
(change-theme 'solarized-light 'solarized-dark)
