initial commit, moving to git

This commit is contained in:
Adam Goldsmith 2015-04-25 21:51:54 -04:00
commit a1e590f0bc
33 changed files with 311 additions and 0 deletions

135
.emacs Normal file
View File

@ -0,0 +1,135 @@
;; 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)
;; save backups and autosaves in tmp
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" ,temporary-file-directory t)))
;; load el-get
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil 'noerror)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el")
(goto-char (point-max))
(eval-print-last-sexp)))
(add-to-list 'el-get-recipe-path "~/.emacs.d/el-get-user/recipies")
(setq el-get-user-package-directory "~/.emacs.d/el-get-user/init-files")
(setq my-packages
'(el-get
smart-mode-line
company
tramp
projectile
hideif
magit
undo-tree
lua-mode
pkgbuild-mode
arduino-mode
gnuplot-mode
csharp-mode
markdown-mode
php-mode
scad-mode
smarttabs))
;;auctex))
(el-get-cleanup my-packages)
(el-get 'sync my-packages)
(global-set-key (kbd "C-z") `recompile)
(global-set-key (kbd "C-S-z") `compile)
(desktop-save-mode 1)
(savehist-mode 1)
;; use windmove to move point with shift+arrow key
(when (fboundp 'windmove-default-keybindings)
(windmove-default-keybindings))
(load-theme 'fred t)
(tool-bar-mode -1)
;; define function for inserting today's date
(defun insert-date ()
(interactive)
(insert (format-time-string "%Y.%m.%d")))
;;allow saving files that need root
(defun find-file-as-root(buffer)
"use sudo to open a file"
(interactive "FFind file as root: ")
(find-file (concat "/sudo::" buffer)))
(global-set-key (kbd "C-x C-S-f") `find-file-as-root)
(defadvice save-buffer (around save-buffer-as-root-around activate)
"Use sudo to save the current buffer."
(interactive "p")
(if (and (buffer-file-name) (not (file-writable-p (buffer-file-name))))
(let ((buffer-file-name (format "/sudo::%s" buffer-file-name)))
ad-do-it)
ad-do-it))
;; c++ headers insertion
(defun c++-headers ()
(interactive)
(if (buffer-file-name)
(let*
((fName (upcase (file-name-nondirectory (file-name-sans-extension buffer-file-name))))
(ifDef (concat "#ifndef " fName "_H" "\n#define " fName "_H" "\n"))
(line 3) ;TODO: Make this better
)
(progn
;If less then 5 characters are in the buffer, insert the class definition
(if (< (- (point-max) (point-min)) 5 )
(progn
(insert "\nclass " (capitalize fName) "{\npublic:\n\nprivate:\n\n};\n")
(setq line 6)
)
)
;Insert the Header Guard
(goto-char (point-min))
(insert ifDef)
(goto-char (point-max))
(insert "\n#endif" " //" fName "_H")
(goto-line line))
)
;else
(message (concat "Buffer " (buffer-name) " must have a filename"))
)
)
(eval-after-load "cc-mode"
'(progn
(define-key c-mode-map (kbd "C-c o") 'ff-find-other-file)
(define-key c++-mode-map (kbd "C-c o") 'ff-find-other-file)
(define-key c-mode-map (kbd "C-c h") 'c++-headers)
(define-key c++-mode-map (kbd "C-c h") 'c++-headers)))
(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.
'(safe-local-variable-values
(quote
((company-clang-arguments "-I/usr/include" "-I/usr/arm-frc-linux-gnueabi/include/")))))
(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.
)

View File

@ -0,0 +1,3 @@
;; Arduino mode autoload
(add-to-list 'auto-mode-alist '("\\.pde\\'" . arduino-mode))
(add-to-list 'auto-mode-alist '("\\.ino\\'" . arduino-mode))

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,7 @@
;; load company mode
(add-hook 'after-init-hook '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)

Binary file not shown.

View File

@ -0,0 +1 @@
(setq auto-mode-alist (append '(("\\.gp$" . gnuplot-mode)) auto-mode-alist))

Binary file not shown.

View File

@ -0,0 +1,3 @@
(global-set-key (kbd "C-c C-x h") `hs-hide-block)
(global-set-key (kbd "C-c C-x s") `hs-show-block)
(global-set-key (kbd "C-c C-x l") `hs-hide-level)

View File

@ -0,0 +1,7 @@
(defun markdown-custom ()
"markdown-mode-hook"
(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 "C-<tab>") 'markdown-promote))
(add-hook 'markdown-mode-hook '(lambda() (markdown-custom)))

Binary file not shown.

View File

@ -0,0 +1,7 @@
(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"))

View File

@ -0,0 +1 @@
(smart-tabs-insinuate 'c 'c++ 'javascript)

Binary file not shown.

View File

@ -0,0 +1,2 @@
(add-hook 'after-init-hook 'global-undo-tree-mode)
(global-set-key (kbd "M-/") 'undo-tree-visualize)

Binary file not shown.

View File

@ -0,0 +1 @@
(yas-global-mode 1)

View File

@ -0,0 +1,5 @@
(:name kerboscript-mode
:description "basic syntax highlighting for kOS's scripting language kerboscript"
:type github
:pkgname "frosch03/kerboscript-mode"
:after (require 'kerboscript-mode))

View File

@ -0,0 +1,7 @@
(:name scad-mode
:type http
:description "OpenSCAD Mode"
:url "https://raw.githubusercontent.com/openscad/openscad/3c3ac52576297c5bc4b8bacce83f69fa33c730b9/contrib/scad-mode.el"
:after (progn
(autoload 'scad-mode "scad-mode" "Major mode for editing SCAD code." t)
(add-to-list 'auto-mode-alist '("\\.scad$" . scad-mode))))

46
.emacs.d/fred-theme.el Normal file
View File

@ -0,0 +1,46 @@
(deftheme fred
"Created 2014-12-03.")
(custom-theme-set-variables
'fred
'(ansi-color-names-vector ["#212526" "#ff4b4b" "#b4fa70" "#fce94f" "#729fcf" "#e090d7" "#8cc4ff" "#eeeeec"]))
(custom-theme-set-faces
'fred
'(highlight ((((class color) (min-colors 89)) (:foreground "#2e3436" :background "#edd400"))))
'(mode-line ((((class color) (min-colors 89)) (:box (:line-width -1 :style released-button) :background "#285577" :foreground "#eeeeec"))
(t (:background "#555"))))
'(mode-line-inactive ((((class color) (min-colors 89)) (:box (:line-width -1 :style released-button) :background "#555753" :foreground "#dddddc"))
(t (:background "#555"))))
'(cursor ((((class color) (min-colors 89)) (:background "#fce94f"))))
'(fringe ((((class color) (min-colors 89)) (:background "#212526"))))
'(region ((((class color) (min-colors 89)) (:background "#555753"))))
'(secondary-selection ((((class color) (min-colors 89)) (:background "#204a87"))))
'(isearch ((((class color) (min-colors 89)) (:foreground "#eeeeec" :background "#ce5c00"))))
'(lazy-highlight ((((class color) (min-colors 89)) (:background "#8f5902"))))
'(trailing-whitespace ((((class color) (min-colors 89)) (:background "#a40000"))))
'(minibuffer-prompt ((((class color) (min-colors 89)) (:foreground "#b4fa70")) (t (:foreground "yellow"))))
'(escape-glyph ((((class color) (min-colors 89)) (:foreground "#c4a000"))))
'(error ((((class color) (min-colors 89)) (:foreground "#ff4b4b"))))
'(warning ((((class color) (min-colors 89)) (:foreground "#fcaf3e"))))
'(success ((((class color) (min-colors 89)) (:foreground "#8ae234"))))
'(font-lock-builtin-face ((((class color) (min-colors 89)) (:foreground "#e090d7"))))
'(font-lock-comment-face ((((class color) (min-colors 89)) (:foreground "#73d216"))))
'(font-lock-constant-face ((((class color) (min-colors 89)) (:foreground "#e9b2e3"))))
'(font-lock-function-name-face ((((class color) (min-colors 89)) (:foreground "#fce94f"))))
'(font-lock-keyword-face ((((class color) (min-colors 89)) (:foreground "#b4fa70"))))
'(font-lock-string-face ((((class color) (min-colors 89)) (:foreground "#e9b96e"))))
'(font-lock-type-face ((((class color) (min-colors 89)) (:foreground "#8cc4ff"))))
'(font-lock-variable-name-face ((((class color) (min-colors 89)) (:foreground "#fcaf3e"))))
'(link ((((class color) (min-colors 89)) (:underline t :foreground "#729fcf"))
(t (:foreground "yellow" :underline t))))
'(link-visited ((((class color) (min-colors 89)) (:underline t :foreground "#3465a4"))))
'(default ((((class color) (min-colors 4096)) (:foreground "#eeeeec" :background "#2e3436")) (((class color) (min-colors 256)) (:foreground "#eeeeec" :background "#222")) (((class color) (min-colors 89)) (:foreground "#eeeeec" :background "black"))))
'(company-tooltip ((t (:background "#0f0f0f"))))
'(company-scrollbar-bg ((t (:background "#232323"))))
'(company-scrollbar-fg ((t (:background "#161616"))))
'(company-tooltip-selection ((t (:inherit font-lock-function-name-face))))
'(company-tooltip-common ((t (:inherit font-lock-constant-face))))
'(button ((t (:foreground "yellow")))))
(provide-theme 'fred)

View File

@ -0,0 +1,7 @@
# -*- mode: snippet; require-final-newline: nil -*-
# name: for
# key: for
# --
for ${1:<variable>} in ${2:<collection>} {
$0
}.

View File

@ -0,0 +1,7 @@
# -*- mode: snippet; require-final-newline: nil -*-
# name: if
# key: if
# --
if ${1:<condition>} {
$0
}.

View File

@ -0,0 +1,10 @@
# -*- mode: snippet; require-final-newline: nil -*-
# name: ife
# key: ife
# --
if ${1:<condition>} {
$2
}
else {
$0
}.

View File

@ -0,0 +1,5 @@
# -*- mode: snippet; require-final-newline: nil -*-
# name: lock
# key: l
# --
lock ${1:<variable>} to $0.

View File

@ -0,0 +1,7 @@
# -*- mode: snippet; require-final-newline: nil -*-
# name: on
# key: on
# --
on ${1:<statement>} {
$0
}.

View File

@ -0,0 +1,5 @@
# -*- mode: snippet; require-final-newline: nil -*-
# name: print
# key: p
# --
print "$0".

View File

@ -0,0 +1,5 @@
# -*- mode: snippet; require-final-newline: nil -*-
# name: print at
# key: pat
# --
print "$0" at (${2:<col>},${3:<row>}).

View File

@ -0,0 +1,5 @@
# -*- mode: snippet; require-final-newline: nil -*-
# name: set
# key: s
# --
set ${1:<variable>} to $0.

View File

@ -0,0 +1,7 @@
# -*- mode: snippet; require-final-newline: nil -*-
# name: until
# key: un
# --
until ${1:<condition>} {
$0
}.

View File

@ -0,0 +1,7 @@
# -*- mode: snippet; require-final-newline: nil -*-
# name: when
# key: when
# --
when ${1:<condition>} then {
$0
}.

View File

@ -0,0 +1,6 @@
# -*- mode: snippet; require-final-newline: nil -*-
# name: whn
# key: whn
# --
when ${1:<condition>} then ${2:<expression>}
$0

15
.emacs.d/url/cookies Normal file
View File

@ -0,0 +1,15 @@
;; Emacs-W3 HTTP cookies file
;; Automatically generated file!!! DO NOT EDIT!!!
(setq url-cookie-storage
'((".google.com"
[url-cookie "NID" "67=Bp1GOyi-5CbMiVd0fk0NZ-e8xlZkfi75jCZ15j08H9DknssbC6VPIqnNcAHZ-BWTh7Ll8k-OSzMfnJxML0X7-Gu6n-igQcoFEohGCO6ArZcjtto1YwyJNPs0QUW7TyE9" "07-Jul-2015 00:59:11.00 GMT" "/" ".google.com" nil]
[url-cookie "PREF" "ID=feb856d7e5649926:U=e781d0146f63e2ff:FF=0:TM=1420419551:LM=1428415058:S=15HvNLuSkZkRMmOf" "06-Apr-2017 13:57:38.00 GMT" "/" ".google.com" nil]))
)
(setq url-cookie-secure-storage
'nil)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; End: