change font, package manager and helm
[dotfiles.git] / emacs / emacs
1 (scroll-bar-mode -1)
2 (tool-bar-mode -1)
3 (add-to-list 'default-frame-alist '(width  . 120))
4 (add-to-list 'default-frame-alist '(height . 40))
5 (add-to-list 'default-frame-alist '(font . "Source Code Pro for Powerline-12:weight:light" ))
6 (load-theme 'tango-dark)
7
8 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9 ;http://y.tsutsumi.io/emacs-from-scratch-part-2-package-management.html
10 (require 'package)
11 (add-to-list 'package-archives
12              '("melpa" . "http://melpa.milkbox.net/packages/") t)
13 (package-initialize)
14
15 (defvar required-packages
16   '(
17 ;    magit
18     helm
19     ido-ubiquitous
20     yasnippet
21   ) "a list of packages to ensure are installed at launch.")
22
23
24 ; my-packages.el
25 (require 'cl)
26
27 ; method to check if all packages are installed
28 (defun packages-installed-p ()
29   (loop for p in required-packages
30         when (not (package-installed-p p)) do (return nil)
31         finally (return t)))
32
33 ; if not all packages are installed, check one by one and install the missing ones.
34 (unless (packages-installed-p)
35   ; check for new packages (package versions)
36   (message "%s" "Emacs is now refreshing its package database...")
37   (package-refresh-contents)
38   (message "%s" " done.")
39   ; install the missing packages
40   (dolist (p required-packages)
41     (when (not (package-installed-p p))
42       (package-install p))))
43 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
44
45 (setq fiplr-root-markers '(".git" ".svn" "*.DS_Store"))
46 (setq fiplr-ignored-globs '((directories (".git" ".svn"))
47                             (files ("*.jpg" "*.png" "*.zip" "*~" "*.o" ".obj" "*.swp" "*.hg" ".pyc" ".*" ))))
48
49
50 (setq mac-right-option-modifier 'control)
51
52 (global-set-key (kbd "C-x f") 'fiplr-find-file)
53
54 ;(ido-mode 1)
55 ;(ido-everywhere 1)
56
57 ;;;;;;;;; helm configuration https://github.com/emacs-helm/helm http://tuhdo.github.io/helm-intro.html
58 (require 'helm-config)
59 (global-set-key (kbd "M-x") 'helm-M-x)
60 (helm-mode 1)
61 (setq helm-M-x-fuzzy-match t)
62 (global-set-key (kbd "C-x b") 'helm-mini)
63 (setq helm-buffers-fuzzy-matching t
64       helm-recentf-fuzzy-match    t)
65 (global-set-key (kbd "C-x C-f") 'helm-find-files)
66 (when (executable-find "ack-grep")
67   (setq helm-grep-default-command "ack-grep -Hn --no-group --no-color %e %p %f"
68         helm-grep-default-recurse-command "ack-grep -H --no-group --no-color %e %p %f"))
69