 ;;
 ;;; Code:
 (setq debug-on-error t)
-(require 'dired-x)
+(require 'dash)
+(require 'flycheck)
 (require 'ido)
 (require 'magit)
-(require 'notify)
 (require 'org)
 (require 'org-install)
+(require 'powerline)
+(require 'pungi)
 (require 'python)
+(require 'pyvenv)
 (require 'rst)
 (require 's)
 
 (setq-default dired-omit-files-p t)
 (setq custom-theme-directory (locate-user-emacs-file "themes"))
+(setq custom-theme-allow-multiple-selections nil)
 
 (ido-mode 1)
 (setq ido-case-fold t)

  (auto-fill-mode t)
  (handle-virtualenvs))

(add-hook 'rst-mode #'py-handle-sphinx-docs)

(defun py-setup ()
  "Setup Python developemnt environment."
  (py-auto-workon-maybe)
  (py-handle-virtualenvs)
  (py-set-newline-and-indent)
  (py-set-flycheck-flake8rc-for-current-git-repo))

(add-hook 'python-mode-hook #'py-setup)

(defun notify-jabber-notify (from buf text proposed-alert)
  "Notify via notify.el about new messages using FROM BUF TEXT PROPOSED-ALERT."
  (when (or jabber-message-alert-same-buffer
            (not (memq (selected-window) (get-buffer-window-list buf))))
    (if (jabber-muc-sender-p from)
        (notify (format "(PM) %s"
                       (jabber-jid-displayname (jabber-jid-user from)))
               (format "%s: %s" (jabber-jid-resource from) text)))
      (notify (format "%s" (jabber-jid-displayname from))
             text)))

(add-hook 'jabber-alert-message-hooks 'notify-jabber-notify)

(defun dired-omit-hook ()
  "Omit mode on by default."
  (dired-omit-mode 1))

(add-hook 'dired-load-hook 'dired-omit-hook)

(defun setup-global-key-bindings ()
  "Setup global key bindings."
  (require 'magit)
  (require 'org)
  (global-set-key (kbd "C-c +") 'text-scale-increase)
  (global-set-key (kbd "C-c -") 'text-scale-decrease)
  (global-set-key (kbd "C-c l") 'org-store-link)
  (global-set-key (kbd "C-c c") 'org-capture)
  (global-set-key (kbd "C-c a") 'org-agenda)
  (global-set-key (kbd "C-c b") 'org-iswitchb)
  (global-set-key (kbd "C-c m") 'magit-status))

(add-hook #'after-init-hook #'setup-global-key-bindings)

(provide '.emacs-custom)
;;; .emacs-custom.el ends here

      '(".py" ".zcml" ".el" ".xml" ".js"))

;; org-mode
(setq org-log-done #'time)
(setq org-agenda-files
      (list "~/org/work.org"
