emacs/.emacs
2015-08-19 20:28:19 -04:00

134 lines
4.3 KiB
Plaintext

;; indentation
(setq c-default-style "linux"
c-basic-offset 4
sgml-basic-offset 4)
(c-set-offset `inline-open 0)
(setq-default tab-width 4)
(add-hook 'sh-mode-hook (lambda () (setq tab-width 4)))
;; various options
(setq compilation-scroll-output 1
read-file-name-completion-ignore-case t
inhibit-startup-screen t
vc-follow-symlinks t)
(load-theme 'fred t)
(savehist-mode 1)
(show-paren-mode 1)
(tool-bar-mode -1)
;; buffer display options
(add-to-list 'display-buffer-alist
`("^\\*compilation\\*$"
(display-buffer-reuse-window
display-buffer-in-side-window)
(side . bottom)
(window-height . 0.3)))
;; save backups and autosaves in tmp
(setq backup-directory-alist `((".*" . ,temporary-file-directory))
auto-save-file-name-transforms `((".*" ,temporary-file-directory t)))
;; keybinds
(global-set-key (kbd "C-z") `recompile)
(global-set-key (kbd "C-S-z") `compile)
;; windmove keybinds
(when (fboundp 'windmove-default-keybindings)
(windmove-default-keybindings))
;; install/load quelpa
(package-initialize)
(unless (require 'quelpa nil t)
(with-temp-buffer
(url-insert-file-contents "https://raw.github.com/quelpa/quelpa/master/bootstrap.el")
(eval-buffer)))
;; hopefully temporary: install specific commit of use-package
(quelpa '(use-package
:fetcher github
:repo "jwiegley/use-package"
:files ("use-package.el")
:commit "7154ad996d2468c468b6206fb132e18b12c3ffd2"))
;; install quelpa-use-package
(quelpa '(quelpa-use-package
:fetcher github
:repo "quelpa/quelpa-use-package"))
(require 'quelpa-use-package)
;; external packages (required)
(use-package company :quelpa
:config
(global-company-mode)
(setq company-idle-delay 0.1
company-dabbrev-downcase nil
company-dabbrev-ignore-case nil
company-clang-arguments (quote ("-I/usr/include" "-I/usr/arm-frc-linux-gnueabi/include/")))
(global-set-key (kbd "<C-tab>") 'company-manual-begin))
(use-package smart-mode-line :quelpa
:config
(setq sml/no-confirm-load-theme t)
(sml/setup)
(sml/apply-theme 'respectful)
(add-to-list 'sml/replacer-regexp-list '("^~/Programs/" ":Prog:") t)
(add-to-list 'sml/replacer-regexp-list '("^:Doc:Google Drive/" ":GDrive:") t)
(add-to-list 'sml/replacer-regexp-list '("^:GDrive:Dublin2014-2015/" ":Dublin:") t)
(setq rm-blacklist '(" company" " Undo-Tree")))
(use-package avy :quelpa
:config
(eval-after-load "isearch"
'(define-key isearch-mode-map (kbd "C-'") 'avy-isearch))
:bind ("C-;" . avy-goto-char)
:bind ("C-'" . avy-goto-char-2))
(use-package smex :quelpa
:bind ("M-x" . smex)
:bind ("M-X" . smex-major-mode-commands)
:config (global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)) ;;normal M-x.
(use-package ace-window :quelpa
:bind ("M-p" . ace-window))
(use-package undo-tree :quelpa
:config
(global-undo-tree-mode)
:bind ("M-/" . undo-tree-visualize))
(use-package hydra :quelpa
:config
;config is in separate file because it is really big
(load-file "~/.emacs.d/init-hydra.el"))
(use-package multiple-cursors :quelpa)
(use-package company-quickhelp :quelpa
:config
(company-quickhelp-mode 1)
(setq company-quickhelp-delay 0.5))
(use-package magit :quelpa
:bind ("C-x g" . magit-status))
;; optional external packages
(use-package arduino-mode
:mode "\\.pde\\'"
:mode "\\.ino\\'")
(use-package company-jedi
:config
(add-hook 'python-mode-hook (lambda() (add-to-list 'company-backends 'company-jedi))))
(use-package csharp-mode)
(use-package gnuplot-mode
:mode ("\\.gp$" . gnuplot-mode))
(use-package lua-mode)
(use-package markdown-mode
:config
(setq markdown-command "markdown_py -x markdown.extensions.wikilinks -x markdown.extensions.smarty -x markdown.extensions.extra -x latex -x markdown.extensions.sane_lists -x markdown.extensions.toc -x markdown_checklist.extension -c ~/markdownConfig.yml"
markdown-enable-math t)
(local-set-key (kbd "<tab>") 'markdown-demote)
(local-set-key (kbd "S-<tab>") 'markdown-promote)
:mode "\\.md\\'")
(use-package php-mode)
(use-package pkgbuild-mode)
(use-package qml-mode)
(use-package scad-mode)
(use-package smarttabs
:config
(smart-tabs-insinuate 'c 'c++ 'javascript))
(use-package todotxt-mode
:config
(setq todotxt-default-file (expand-file-name "~/Sync/todo/todo.txt")))