Skip to content

Instantly share code, notes, and snippets.

@Codas
Last active August 29, 2015 13:56
Show Gist options
  • Save Codas/9017724 to your computer and use it in GitHub Desktop.
Save Codas/9017724 to your computer and use it in GitHub Desktop.
;; install following plugins:
;; flx-ido (ttps://github.com/lewang/flx) (http://www.youtube.com/watch?v=_swuJ1RuMgk) fuzzy matching for ido
;; rojectile https://github.com/bbatsov/projectile project management somwhat like in sublimetext
;; diff-hl (https://github.com/dgutov/diff-hl) nice screensoht: http://d.pr/i/Udgb show visual VCS diffs
;; undo-tree (http://www.emacswiki.org/emacs/UndoTree) (M-x undo-tree-visualize) Undo Tree, much better undo feature in emacs
;; rainbow-delimiters (https://github.com/jlr/rainbow-delimiters) show nested parsens etc in a sane fashion
;; smartparens (https://github.com/Fuco1/smartparens) autoclose and create parens, braces etc
;; flycheck (https://github.com/flycheck/flycheck) automatic, async syntac checker for nearly every language
;;;;;;;;;;;;;;
;; requires ;;
;;;;;;;;;;;;;;
(require 'flx-ido)
(require 'projectile)
(require 'diff-hl)
(require 'undo-tree)
(require 'rainbow-delimiters)
(require 'smartparens-config)
(require 'flycheck)
;; show visual VCS diffs
(global-diff-hl-mode)
;; spend less time GCing
(setq gc-cons-threshold 50000000)
;; enable rainbow delimeters globally
;; (global-rainbow-delimiters-mode)
;; or only in prog modes
;; (add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
;; or just for lisp modes
(add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode)
;; enable undo tree (more vim style undo)
(global-undo-tree-mode 1)
(setq undo-tree-auto-save-history t)
;; enable projcetile (all .git, .hg, .svn, ..., are automatically tracked as projects)
;; use (C-c p s) to switch to project and choose file to open. Remembers projects across emacs reboots
(projectile-global-mode)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ido mode customizations ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Use flx ido (fuzzy matching)
(ido-mode 1)
(ido-everywhere 1)
(flx-ido-mode 1)
;; disable ido faces to see flx highlights.
(setq ido-use-faces nil)
;; Make ido vertical makes ido look like this: http://d.pr/i/2aJT
(setq ido-decorations
(quote ("\n-> " "" "\n " "\n ..." "[" "]" " [No match]"
" [Matched]" " [Not readable]" " [Too big]" " [Confirm]")))
;; enable ido vertical everywhere
(add-hook 'ido-setup-hook 'ido-define-keys)
(add-hook 'ido-minibuffer-setup-hook 'ido-disable-line-truncation)
;; More intuitive ido key bindings now that ido is vertical
(ac-set-trigger-key "TAB") ; AFTER input prefix, press TAB key ASAP
;; projectile
(projectile-global-mode)
(global-set-Key (kbd "C-c h") 'helm-projectile)
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Backups and auto save ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq backup-by-copying t ; Don't delink hardlinks
backup-directory-alist '(("." . "~/.emacs.d/temps/backups/"))
version-control t ; Use version numbers on backups
delete-old-versions t ; Automatically delete excess backups
kept-new-versions 20 ; how many of the newest versions to keep
kept-old-versions 5 ; and how many of the old
auto-save-file-name-transforms `((".*" ,"~/.emacs.d/temps/autosaves/" t))
undo-tree-history-directory-alist (quote (("." . "~/.emacs.d/temps/undotrees/")))
)
(setq-default save-place t)
(setq save-place-file (expand-file-name ".places" user-emacs-directory))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment