|
|
|
(require 'package)
|
|
|
|
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
;; Turn off the startup screen
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(setq inhibit-startup-screen t)
|
|
|
|
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
;; Display battery life in modeline
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(display-battery-mode 1)
|
|
|
|
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
;; Always follow symbolic links to version controlled files
|
|
|
|
;;
|
|
|
|
;; I prefer this option because I generally only get this message when I edit
|
|
|
|
;; a dotfile under version control, and repeatedly typing "yes" is annoying.
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(setq vc-follow-symlinks t)
|
|
|
|
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
;; Enable Org-mode and set agenda files
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(require 'org)
|
|
|
|
|
|
|
|
;; Stuff all of the org files you want under ~/org and they will be loaded automatically
|
|
|
|
;; and have their TODO items accessible by typing C-c a t
|
|
|
|
(setq org-agenda-files '("~/org"))
|
|
|
|
(setq org-log-done t)
|
|
|
|
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
;; Prefer unix style line endings
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(set-buffer-file-coding-system 'unix)
|
|
|
|
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
;; Enable auto-refresh to keep buffers up to date when git or another program
|
|
|
|
;; modifies them
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(global-auto-revert-mode t)
|
|
|
|
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
;; IBuffer configurations (C-x C-b)
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(setq ibuffer-saved-filter-groups
|
|
|
|
'(("default"
|
|
|
|
("Emacs Configuration" (or (filename . ".emacs.d")
|
|
|
|
(filename . "init.el")
|
|
|
|
(filename . "package.el")
|
|
|
|
(filename . "private.el")
|
|
|
|
(filename . "emacs.d")))
|
|
|
|
("Org" (or (mode . org-mode)
|
|
|
|
(filename . "OrgMode")))
|
|
|
|
("Magit" (name . "magit"))
|
|
|
|
("Help" (or (name . "\*Help\*")
|
|
|
|
(name . "\*Apropos\*")
|
|
|
|
(name . "\*info\*")))
|
|
|
|
("Dired" (mode . dired-mode))
|
|
|
|
;; Dev has groups for all languages you program in
|
|
|
|
("Dev" (or (mode . cc-mode)
|
|
|
|
(filename . ".c")
|
|
|
|
(filename . ".cpp")
|
|
|
|
(filename . ".hpp")
|
|
|
|
(filename . ".h")
|
|
|
|
(filename . ".java")
|
|
|
|
(filename . ".properties")
|
|
|
|
(filename . ".gradle")
|
|
|
|
(filename . ".py")
|
|
|
|
(filename . ".am")
|
|
|
|
(mode . yaml-mode))
|
|
|
|
)
|
|
|
|
("Text" (or (filename . ".csv")
|
|
|
|
(filename . ".tsv")
|
|
|
|
(filename . ".txt")
|
|
|
|
(filename . ".log")
|
|
|
|
(filename . ".json")))
|
|
|
|
|
|
|
|
("Emacs" (or (name . "^\\*scratch\\*$")
|
|
|
|
(name . "^\\*Messages\\*$")))
|
|
|
|
("Gnus" (or (mode . message-mode)
|
|
|
|
(mode . bbdb-mode)
|
|
|
|
(mode . mail-mode)
|
|
|
|
(mode . gnus-group-mode)
|
|
|
|
(mode . gnus-summary-mode)
|
|
|
|
(mode . gnus-article-mode)
|
|
|
|
(name . "^\\.bbdb$")
|
|
|
|
(name . "^\\.newsrc-dribble")))
|
|
|
|
)))
|
|
|
|
|
|
|
|
;; Automatically keep buffers up to date and load the filter
|
|
|
|
(add-hook 'ibuffer-mode-hook
|
|
|
|
'(lambda ()
|
|
|
|
(ibuffer-auto-mode 1)
|
|
|
|
(ibuffer-switch-to-saved-filter-groups "default")))
|
|
|
|
|
|
|
|
;; Disable eager line numbering
|
|
|
|
(add-hook 'ibuffer-mode-hook 'nolinum)
|
|
|
|
|
|
|
|
(setq ibuffer-expert t)
|
|
|
|
|
|
|
|
(setq ibuffer-show-empty-filter-groups nil)
|
|
|
|
|
|
|
|
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
;; Enable MELPA
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(add-to-list 'package-archives
|
|
|
|
'("melpa" . "https://melpa.org/packages/") t)
|
|
|
|
(when (< emacs-major-version 24)
|
|
|
|
;; For important compatibility libraries like cl-lib
|
|
|
|
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")))
|
|
|
|
|
|
|
|
(package-initialize)
|
|
|
|
|
|
|
|
;; This will force any out of date packages to update automatically
|
|
|
|
(when (not package-archive-contents)
|
|
|
|
(package-refresh-contents))
|
|
|
|
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
;; Theming
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(load-theme 'material t)
|
|
|
|
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
;; Default modes
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(ivy-mode 1)
|
|
|
|
|
|
|
|
;; Enable paredit for lisp
|
|
|
|
(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t)
|
|
|
|
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode)
|
|
|
|
(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)
|
|
|
|
(add-hook 'ielm-mode-hook #'enable-paredit-mode)
|
|
|
|
(add-hook 'lisp-mode-hook #'enable-paredit-mode)
|
|
|
|
(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)
|
|
|
|
(add-hook 'scheme-mode-hook #'enable-paredit-mode)
|
|
|
|
|
|
|
|
(require 'rainbow-delimiters)
|
|
|
|
|
|
|
|
(add-hook 'clojure-mode-hook 'rainbow-delimiters-mode)
|
|
|
|
(add-hook 'lisp-mode-hook 'rainbow-delimiters-mode)
|
|
|
|
(add-hook 'scheme-mode-hook 'rainbow-delimiters-mode)
|
|
|
|
(add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode)
|
|
|
|
|
|
|
|
;; Only enable aggressive indent on lisp-likes
|
|
|
|
(add-hook 'emacs-lisp-mode-hook #'aggressive-indent-mode)
|
|
|
|
(add-hook 'lisp-mode-hook #'aggressive-indent-mode)
|
|
|
|
(add-hook 'scheme-mode-hook #'aggressive-indent-mode)
|
|
|
|
(add-hook 'clojure-mode-hook #'aggressive-indent-mode)
|
|
|
|
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
;; Save hooks
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
|
|
|
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
;; Keybinds
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(global-set-key "\C-s" 'swiper)
|
|
|
|
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
;; Install and load Packages
|
|
|
|
;;--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(load-file "~/.emacs.d/package.el")
|
|
|
|
|
|
|
|
|
|
|
|
(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.
|
|
|
|
'(package-selected-packages
|
|
|
|
(quote
|
|
|
|
(projectile smex grizzl flycheck-pos-tip flycheck material-theme expand-region wrap-region rainbow-delimiters powerline linum-relative golden-ratio fill-column-indicator autopair exec-path-from-shell ws-butler yaml-mode python-mode protobuf-mode paredit nasm-mode meson-mode markdown-mode magit gradle-mode gitignore-mode feature-mode counsel company-jedi jedi-core company-emacs-eclim company-irony company ag)))
|
|
|
|
|
|
|
|
;; Not technically a mode but mode enough. This forces emacs to ident common lisp
|
|
|
|
;; like common lisp instead of like emacs lisp, which has unlimited else clauses in
|
|
|
|
;; the if statement (implicit progn) and as such indents it funny.
|
|
|
|
'(lisp-indent-function 'common-lisp-indent-function))
|
|
|
|
|
|
|
|
(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.
|
|
|
|
)
|
|
|
|
|
|
|
|
;; Autoload the indent function
|
|
|
|
(autoload 'common-lisp-indent-function "cl-indent" "Common Lisp indent.")
|