You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

emacsrc.el 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. ;;; emacsrc.el --- Emacs configuration from the unix-starter-kit
  2. ;;
  3. ;; Copyright (c) 2012 Peter Jones
  4. ;; Ideas taken from https://github.com/technomancy/emacs-starter-kit
  5. ;; Unix starter kit internal variables
  6. (setq usk-lisp-dir (concat user-emacs-directory "usk"))
  7. ;; Package loading
  8. (require 'package)
  9. (add-to-list 'package-archives
  10. '("marmalade" . "http://marmalade-repo.org/packages/") t)
  11. (add-to-list 'package-archives
  12. '("melpa" . "http://melpa.milkbox.net/packages/") t)
  13. (package-initialize)
  14. (when (not package-archive-contents)
  15. (package-refresh-contents))
  16. ;; Add in your own as you wish:
  17. (defvar my-packages '(magit flymake-ruby ruby-end inf-ruby yaml-mode gist)
  18. "A list of packages to ensure are installed at launch.")
  19. (dolist (p my-packages)
  20. (when (not (package-installed-p p))
  21. (package-install p)))
  22. ;; Some basic settings
  23. (setq visible-bell t
  24. color-theme-is-global t
  25. shift-select-mode nil
  26. mouse-yank-at-point t
  27. uniquify-buffer-name-style 'forward
  28. echo-keystrokes 0.1
  29. diff-switches "-u")
  30. ;; Put the scroll bar on the right where people expect it, and also
  31. ;; use window fringes.n
  32. (set-scroll-bar-mode 'right)
  33. (require 'fringe)
  34. (fringe-mode 10)
  35. (setq-default indicate-buffer-boundaries 'left
  36. indicate-empty-lines t)
  37. ;; Frame defaults
  38. (defun pjones:frame-title-file-name ()
  39. (let* ((home (expand-file-name "~"))
  40. (end (length home))
  41. (start (and buffer-file-name (substring buffer-file-name 0 end)))
  42. (under-home (and start (string= home start))))
  43. (cond (under-home
  44. (concat "~/" (file-relative-name buffer-file-name "~")))
  45. (buffer-file-name buffer-file-name)
  46. (dired-directory
  47. (if (listp dired-directory) (car dired-directory) dired-directory))
  48. (t (buffer-name)))))
  49. (defun pjones:frame-title-not-saved ()
  50. (if (buffer-modified-p) " (NOT SAVED)"))
  51. (setq default-frame-alist '((cursor-type . bar))
  52. frame-title-format '((:eval (pjones:frame-title-file-name))
  53. (:eval (pjones:frame-title-not-saved))))
  54. ;; Turn off the menu bar in text mode, but leave it on in the GUI.
  55. (setq window-system-default-frame-alist
  56. '((x (menu-bar-lines . 1) (tool-bar-lines . 1))
  57. (nil (menu-bar-lines . 0) (tool-bar-lines . 0))))
  58. ;; Delete the region when you start typing
  59. (delete-selection-mode)
  60. ;; Color theme
  61. (add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
  62. (load-theme 'devalot t)
  63. ;; Load all USK lisp files
  64. (mapc 'load (directory-files usk-lisp-dir t "^[^#].*el$"))