my emacs config for emacs starter kit
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)
(load-file "~/.emacs.d/treemode.el")
(load-file "~/.emacs.d/windata.el")
(load-file "~/.emacs.d/dirtree.el")
(load-file "~/.emacs.d/workgroups.el")
(require 'workgroups)
(load-theme 'misterioso)
(setq wg-prefix-key (kbd "C-c w"))
(workgroups-mode 1)
(global-set-key "\C-q" 'backward-kill-word)
(add-to-list 'completion-ignored-extensions ".hi")
(or (fboundp 'haskell-mode)
(let ((paths
'("~/haskell-mode-2.8/haskell-site-file"
"/usr/share/emacs/site-lisp/haskell-mode/haskell-site-file")))
(while paths
(if (not (file-exists-p (concat (car paths) ".el")))
(setq paths (cdr paths))
(load (car paths) t t)
(setq paths nil)))))
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
(add-hook 'haskell-mode-hook (lambda () (require 'inf-haskell)))
(setq x-select-enable-clipboard t)
(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)
;; (add-hook 'c-mode-common-hook '(lambda ()
;; (local-set-key (kbd "RET") 'newline-and-indent)))
(global-set-key (kbd "C-x p") (lambda ()
(interactive)
(other-window -1)))
(defun kill-other-buffers ()
"Kill all buffers but the current one.
Don't mess with special buffers."
(interactive)
(dolist (buffer (buffer-list))
(unless (or (eql buffer (current-buffer)) (not (buffer-file-name buffer)))
(kill-buffer buffer))))
(global-set-key (kbd "C-c k") 'kill-other-buffers)
(electric-pair-mode +1)
;; (global-set-key (kbd "RET") 'newline-and-indent)
;; (electric-indent-mode +1)
(defun google ()
"Google the selected region if any, display a query prompt otherwise."
(interactive)
(browse-url
(concat
"http://www.google.com/search?ie=utf-8&oe=utf-8&q="
(url-hexify-string (if mark-active
(buffer-substring (region-beginning) (region-end))
(read-string "Google: "))))))
(global-set-key (kbd "C-c g") 'google)
(global-set-key (kbd "C-c o") 'open-with)
(defun indent-buffer ()
"Indent the currently visited buffer."
(interactive)
(indent-region (point-min) (point-max)))
(defun indent-region-or-buffer ()
"Indent a region if selected, otherwise the whole buffer."
(interactive)
(save-excursion
(if (region-active-p)
(progn
(indent-region (region-beginning) (region-end))
(message "Indented selected region."))
(progn
(indent-buffer)
(message "Indented buffer.")))))
(global-set-key (kbd "C-M-\\") 'indent-region-or-buffer)
(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.
'(send-mail-function nil))
(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 'yasnippet)
(setq yas/trigger-key "<C-tab>")
(yas/initialize)
(yas/load-directory "~/.emacs.d/snippets")