Skip to content

Instantly share code, notes, and snippets.

@jacobhak
Last active January 4, 2016 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobhak/8658701 to your computer and use it in GitHub Desktop.
Save jacobhak/8658701 to your computer and use it in GitHub Desktop.
My .emacs
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-enabled-themes (quote (wombat)))
'(display-battery-mode t)
'(electric-indent-mode t)
'(electric-pair-mode t)
'(global-auto-complete-mode t)
'(ido-enable-flex-matching t)
'(ido-everywhere t)
'(ido-mode (quote both) nil (ido))
'(js2-basic-offset 2)
'(org-adapt-indentation nil)
'(org-agenda-files (quote ("~/Documents/org/gtd.org")))
'(org-capture-templates (quote (("i" "Idea" entry (file+headline "~/Documents/org/gtd.org" "Ideas") "* %?
%U") ("t" "Todo" entry (file+headline "~/Documents/org/inbox.org" "Tasks") "* TODO %?
%i
") ("l" "Todo with link" entry (file+headline "~/Documents/org/inbox.org" "Tasks") "* TODO %?
%i
%a") ("j" "Journal" entry (file+datetree "~/Documents/org/journal.org") "* %?
Entered on %U
%i
"))))
'(org-default-notes-file "~/Documents/org/new_mobile.org")
'(org-directory "~/Documents/org")
'(org-export-html-postamble t)
'(org-export-html-postamble-format (quote (("en" "<p class=\"author\">Author: %a (%e)</p><p class=\"date\">Date: %d</p>"))))
'(org-export-html-style "<link rel=\"stylesheet\" type=\"text/css\" href=\"//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css\" /><meta name=\"viewport\" content=\"initial-scale = 1.0,maximum-scale = 1.0\" />")
'(org-mobile-directory "~/Dropbox/Apps/MobileOrg")
'(org-mobile-files (quote (org-agenda-files "gtd.org" "gtd.org_archive" "journal.org")))
'(org-mobile-inbox-for-pull "~/Documents/org/inbox.org")
'(org-refile-targets (quote ((org-agenda-files :tag . "") ("~/Documents/org/gtd.org" :maxlevel . 2) ("~/Documents/org/journal.org" :maxlevel . 3))))
'(scroll-bar-mode nil)
'(show-paren-mode t)
'(size-indication-mode t)
'(tool-bar-mode nil)
'(user-mail-address "jacobhakansson@gmail.com"))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
(global-set-key [(meta x)] (lambda ()
(interactive)
(or (boundp 'smex-cache)
(smex-initialize))
(global-set-key [(meta x)] 'smex)
(smex)))
(require 'yasnippet) ;; not yasnippet-bundle
(yas-global-mode 1)
(require 'auto-complete)
(set-default 'ac-sources
'(ac-source-abbrev
ac-source-dictionary
ac-source-yasnippet
ac-source-words-in-buffer
ac-source-words-in-same-mode-buffers
ac-source-semantic))
(setq ac-source-yasnippet nil)
(require 'auto-complete-config)
(ac-config-default)
(add-to-list 'load-path "~/.emacs.d/jdee-2.4.1/lisp")
(autoload 'jde-mode "jde" "JDE mode" t)
(setq jde-help-remote-file-exists-function '("beanshell"))
(setq auto-mode-alist
(append '(("\\.java\\'" . jde-mode)) auto-mode-alist))
(autoload 'js2-mode "js2" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
(dolist (m '(c-mode jde-mode js2-mode))
(add-to-list 'ac-modes m))
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(add-hook 'org-mode-hook 'turn-on-auto-fill)
(defun vc-push ()
"wrapper for git push"
(interactive)
(shell-command "git push &"))
(define-key global-map "\C-xvp" 'vc-push)
(defun splunk-restart ()
"wrapper for splunk restart"
(interactive)
(shell-command "/Applications/Splunk/bin/splunk restart &"))
(defun copy-line (arg)
"Copy lines (as many as prefix argument) in the kill ring"
(interactive "p")
(kill-ring-save (line-beginning-position)
(line-beginning-position (+ 1 arg)))
(message "%d line%s copied" arg (if (= 1 arg) "" "s")))
(key-chord-mode 1)
(key-chord-define-global ";a" 'org-archive-subtree)
(key-chord-define-global ";g" 'magit-status)
(key-chord-define-global ";c" 'copy-line)
(global-set-key (kbd "<C-up>") 'shrink-window)
(global-set-key (kbd "<C-down>") 'enlarge-window)
(global-set-key (kbd "<C-left>") 'shrink-window-horizontally)
(global-set-key (kbd "<C-right>") 'enlarge-window-horizontally)
(set-variable 'magit-emacsclient-executable
"/usr/local/Cellar/emacs/24.3/bin/emacsclient")
;; --------ORG MODE------------------
;; Set to the name of the file where new notes will be stored
(setq org-mobile-inbox-for-pull "~/Documents/org/inbox.org")
;; Set to <your Dropbox root directory>/MobileOrg.
(setq org-mobile-directory "~/Dropbox/Apps/MobileOrg")
(setq org-default-notes-file "~/Documents/org/inbox.org")
(define-key global-map "\C-cc" 'org-capture)
(setq org-publish-project-alist
'(("semikolon" . (:base-directory "~/Developer/semikolon/source/org_posts/"
:base-extension "org"
:publishing-directory "~/Developer/semikolon/source/_posts/"
:sub-superscript ""
:recursive t
:publishing-function org-publish-org-to-html
:headline-levels 4
:html-extension "markdown"
:body-only t))))
;; CamelCase!!
(add-hook 'prog-mode-hook 'subword-mode)
;; Preserve top level headings when archiving in org.
(defadvice org-archive-subtree (around my-org-archive-subtree activate)
(let ((org-archive-location
(if (save-excursion (org-back-to-heading)
(> (org-outline-level) 1))
(concat (car (split-string org-archive-location "::"))
"::* "
(car (org-get-outline-path)))
org-archive-location)))
ad-do-it))
(setq org-feed-alist
'(("Macrumors"
"http://feeds.macrumors.com/MacRumors-All"
"~/Documents/org/feeds.org" "Macrumors")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment