Skip to content

Instantly share code, notes, and snippets.

@hsigrist
Created January 12, 2016 04:26
Show Gist options
  • Save hsigrist/862e0d8e4bda4fa9a6f2 to your computer and use it in GitHub Desktop.
Save hsigrist/862e0d8e4bda4fa9a6f2 to your computer and use it in GitHub Desktop.
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
;;("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
(package-initialize)
;; AucTeX fix PATH & XeLaTeX fix
(setenv "PATH" "/usr/local/bin:/Library/TeX/texbin/:$PATH" t)
(setq org-latex-pdf-process '("latexmk -pdflatex='xelatex -synctex=1 --shell-escape' -pdf %f"))
;; Evil mode
(require 'evil)
(evil-mode 1)
(global-set-key (kbd "M-x") 'helm-M-x)
(global-set-key (kbd "C-x C-f") 'helm-find-files)
;; Helm
(require 'helm-config)
;; bracket ] not show in osx
(setq mac-option-modifier nil
mac-command-modifier 'meta
x-select-enable-clipboard t)
;; Face PragmataProMono
(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.
'(default ((t (:inherit nil :stipple nil :background "White" :foreground "Black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 160 :width normal :foundry "nil" :family "PragmataPro Mono")))))
;; Add keybindings for commenting regions of text
(global-set-key (kbd "C-c ;") 'comment-or-uncomment-region)
(global-set-key (kbd "M-'") 'comment-or-uncomment-region)
;; for backup's
(setq backup-directory-alist `(("." . "~/.saves")))
(setq version-control t ;; Use version numbers for backups.
kept-new-versions 10 ;; Number of newest versions to keep.
kept-old-versions 0 ;; Number of oldest versions to keep.
delete-old-versions t ;; Don't ask to delete excess backup versions.
backup-by-copying t) ;; Copy all files, don't rename them.
;; no backup's ********************************* danger!!!!
;;(setq make-backup-files nil)
;;binding f1 shell
(global-set-key [f1] 'shell)
;; display date&time
(setq display-time-day-and-date t
display-time-24hr-format t)
(display-time)
;; Org-mode keys
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-cb" 'org-iswitchb)
;; Fullscreen, no scrollbar
(set-frame-parameter nil 'fullscreen 'fullboth)
(scroll-bar-mode -1)
(tool-bar-mode -1)
;; Theme
(load-file "~/.emacs.d/themes/billw-theme.el")
;; Inhibit welcome screen
(setq inhibit-startup-message t)
;; display line number linum
(global-linum-mode 1)
;; magit
(global-set-key (kbd "C-x g") 'magit-status)
;; git-gutter-fringe
(require 'git-gutter-fringe)
;; org-journal
(require 'org-journal)
(setq org-journal-dir "~/repo/org-journal/")
;; gist
(require 'gist)
;; markdown
(autoload 'markdown-mode "markdown-mode"
"Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . html-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
;; bookmark
(defun bookmark-to-abbrevs ()
"Create abbrevs based on `bookmark-alist'."
(dolist (bookmark bookmark-alist)
(let* ((name (car bookmark))
(file (bookmark-get-filename name)))
(define-abbrev global-abbrev-table name file))))
;; yasnippet
(add-to-list 'load-path
"~/path-to-yasnippet")
(require 'yasnippet)
(yas-global-mode 1)
;;flyspell & ispell
(autoload 'flyspell-babel-setup "flyspell-babel")
(add-hook 'latex-mode-hook 'flyspell-babel-setup)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(add-hook 'TeX-language-dk-hook
(lambda () (ispell-change-dictionary "spanish")))
;; insert time&date
(defun insert-standard-date ()
"Inserts standard date time string."
(interactive)
(insert (format-time-string "%c")))
(global-set-key (kbd "C-c d") 'insert-standard-date)
;; -*- end .emacs.d configuration -*-
;; -*- date: Tue Jan 12 00:51:24 2016 -*-
;; -*- line: 148 -*-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment