emacs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. (require 'package)
  2. (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
  3. (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
  4. (add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/"))
  5. (setq package-enable-at-startup nil)
  6. (package-initialize)
  7. (defun ensure-package-installed (&rest packages)
  8. "Assure every package is installed, ask for installation if it’s not.
  9. Return a list of installed packages or nil for every skipped package."
  10. (mapcar
  11. (lambda (package)
  12. (if (package-installed-p package)
  13. nil
  14. (if (y-or-n-p (format "Package %s is missing. Install it? " package))
  15. (package-install package)
  16. package)))
  17. packages))
  18. ;; make sure to have downloaded archive description.
  19. (or (file-exists-p package-user-dir)
  20. (package-refresh-contents))
  21. ;; Activate installed packages
  22. (package-initialize)
  23. ;; Check that all packages are installed
  24. (ensure-package-installed
  25. 'iedit
  26. 'magit
  27. 'undo-tree
  28. 'evil
  29. 'evil-leader
  30. 'evil-tabs
  31. 'zenburn-theme
  32. 'powerline-evil
  33. )
  34. ;; Evil leader is Space
  35. (global-evil-leader-mode)
  36. (evil-leader/set-leader "<SPC>")
  37. ;; Evil tabs
  38. (global-evil-tabs-mode t)
  39. ;; Default to evil mode
  40. (require 'evil)
  41. (evil-mode t)
  42. ;; Disable file backup
  43. (setq make-backup-files nil)
  44. ;; Save undo history under .emacs.d/undo
  45. (setq undo-tree-auto-save-history t
  46. undo-tree-history-directory-alist
  47. `(("." . ,(concat user-emacs-directory "undo"))))
  48. (unless (file-exists-p (concat user-emacs-directory "undo"))
  49. (make-directory (concat user-emacs-directory "undo")))
  50. ;; Delete info bindings for evil to take over
  51. (define-key Info-mode-map "g" nil)
  52. (define-key Info-mode-map "n" nil)
  53. (define-key Info-mode-map "p" nil)
  54. ;; Powerline
  55. (require 'powerline)
  56. (powerline-vim-theme)
  57. ;; Recent Files
  58. (require 'recentf)
  59. (recentf-mode 1)
  60. (setq recentf-max-menu-items 25)
  61. (global-set-key "\C-x\ \C-r" 'recentf-open-files)
  62. ;; Leader keybinds
  63. (evil-leader/set-key
  64. "u" 'undo-tree-visualize
  65. "m" 'recentf-open-files)
  66. ;; Leave the clipboard alone
  67. (setq x-select-enable-clipboard nil)
  68. ;; All yes or no prompts are y or n
  69. (defalias 'yes-or-no-p 'y-or-n-p)
  70. ;; Never follow symlinks
  71. (setq vc-follow-symlinks nil)
  72. ;; Text and Notes
  73. (setq sentence-end-double-space nil)
  74. ;; Save minibar history
  75. (savehist-mode 1)
  76. (setq savehist-additional-variables '(kill-ring search-ring regexp-search-ring))
  77. ;; TODO:
  78. ;; Go through the tutorials, skim the manuals
  79. ;; learning elisp
  80. ;; Fuzzy
  81. ;; Evil leader mode
  82. ;; Hotkey for undo tree
  83. ;; autocomplete
  84. ;; recent files
  85. ;; magit bindings
  86. (custom-set-variables
  87. ;; custom-set-variables was added by Custom.
  88. ;; If you edit it by hand, you could mess it up, so be careful.
  89. ;; Your init file should contain only one such instance.
  90. ;; If there is more than one, they won't work right.
  91. '(custom-enabled-themes (quote (zenburn)))
  92. '(custom-safe-themes
  93. (quote
  94. ("4e753673a37c71b07e3026be75dc6af3efbac5ce335f3707b7d6a110ecb636a3" default)))
  95. '(inhibit-default-init t)
  96. '(inhibit-startup-buffer-menu nil)
  97. '(inhibit-startup-echo-area-message "josh")
  98. '(initial-buffer-choice t)
  99. '(initial-scratch-message ";; scratch buffer
  100. ")
  101. '(package-selected-packages
  102. (quote
  103. (evil-tabs powerline-evil zenburn-theme magit iedit evil-leader))))
  104. (custom-set-faces
  105. ;; custom-set-faces was added by Custom.
  106. ;; If you edit it by hand, you could mess it up, so be careful.
  107. ;; Your init file should contain only one such instance.
  108. ;; If there is more than one, they won't work right.
  109. )