diff options
27 files changed, 1171 insertions, 0 deletions
diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..1a84e69 --- /dev/null +++ b/install.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +root=$(pwd) + +# make sure all submodules are there +git submodule update --init + +# [zsh] +ln -sf $root/shell/_zshrc $HOME/.zshrc +ln -sfT $root/shell/_oh-my-zsh $HOME/.oh-my-zsh + +# [emacs] +ln -sfT $root/dotEmacs $HOME/.emacs.d + +# [vim] +ln -sf $root/shell/_vimrc $HOME/.vimrc + +# [git] +ln -sf $root/shell/_gitconfig $HOME/.gitconfig + +# [tmux] +ln -sf $root/shell/_tmux.conf $HOME/.tmux.conf + +echo "Finished installing dotfiles" diff --git a/shell/_emacs/.gitignore b/shell/_emacs/.gitignore new file mode 100644 index 0000000..88f820a --- /dev/null +++ b/shell/_emacs/.gitignore @@ -0,0 +1,8 @@ +elpa/ +auto-save-list +.smex-items +ac-comphist.dat +*.elc +emacs.html +*~ +url/ diff --git a/shell/_emacs/custom-var.el b/shell/_emacs/custom-var.el new file mode 100644 index 0000000..431ff6e --- /dev/null +++ b/shell/_emacs/custom-var.el @@ -0,0 +1,15 @@ +(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. + '(evil-emacs-state-modes (quote (archive-mode bbdb-mode bookmark-bmenu-mode bookmark-edit-annotation-mode browse-kill-ring-mode bzr-annotate-mode calc-mode cfw:calendar-mode completion-list-mode Custom-mode debugger-mode delicious-search-mode desktop-menu-blist-mode desktop-menu-mode doc-view-mode dvc-bookmarks-mode dvc-diff-mode dvc-info-buffer-mode dvc-log-buffer-mode dvc-revlist-mode dvc-revlog-mode dvc-status-mode dvc-tips-mode ediff-mode ediff-meta-mode efs-mode Electric-buffer-menu-mode emms-browser-mode emms-mark-mode emms-metaplaylist-mode emms-playlist-mode etags-select-mode fj-mode gc-issues-mode gdb-breakpoints-mode gdb-disassembly-mode gdb-frames-mode gdb-locals-mode gdb-memory-mode gdb-registers-mode gdb-threads-mode gist-list-mode gnus-article-mode gnus-browse-mode gnus-group-mode gnus-server-mode gnus-summary-mode google-maps-static-mode ibuffer-mode jde-javadoc-checker-report-mode magit-commit-mode magit-diff-mode magit-key-mode magit-log-mode magit-mode magit-reflog-mode magit-show-branches-mode magit-branch-manager-mode magit-stash-mode magit-status-mode magit-wazzup-mode magit-process-mode mh-folder-mode monky-mode mu4e-main-mode mu4e-headers-mode mu4e-view-mode occur-mode org-agenda-mode package-menu-mode proced-mode rcirc-mode rebase-mode recentf-dialog-mode reftex-select-bib-mode reftex-select-label-mode reftex-toc-mode sldb-mode slime-inspector-mode slime-thread-control-mode slime-xref-mode sr-buttons-mode sr-mode sr-tree-mode sr-virtual-mode tar-mode tetris-mode tla-annotate-mode tla-archive-list-mode tla-bconfig-mode tla-bookmarks-mode tla-branch-list-mode tla-browse-mode tla-category-list-mode tla-changelog-mode tla-follow-symlinks-mode tla-inventory-file-mode tla-inventory-mode tla-lint-mode tla-logs-mode tla-revision-list-mode tla-revlog-mode tla-tree-lint-mode tla-version-list-mode twittering-mode urlview-mode vc-annotate-mode vc-dir-mode vc-git-log-view-mode vc-svn-log-view-mode vm-mode vm-summary-mode w3m-mode wab-compilation-mode xgit-annotate-mode xgit-changelog-mode xgit-diff-mode xgit-revlog-mode xhg-annotate-mode xhg-log-mode xhg-mode xhg-mq-mode xhg-mq-sub-mode xhg-status-extra-mode))) + '(evil-motion-state-modes (quote (apropos-mode Buffer-menu-mode calendar-mode color-theme-mode command-history-mode compilation-mode dictionary-mode ert-results-mode help-mode Info-mode Man-mode speedbar-mode undo-tree-visualizer-mode view-mode woman-mode Custom-mode notmuch-hello-mode notmuch-search-mode))) + '(evil-overriding-maps (quote ((Buffer-menu-mode-map) (color-theme-mode-map) (comint-mode-map) (compilation-mode-map) (dictionary-mode-map) (ert-results-mode-map . motion) (Info-mode-map . motion) (speedbar-key-map) (speedbar-file-key-map) (speedbar-buffers-key-map) (custom-mode-key-map) (notmuch-hello-key-map) (notmuch-search-key-map) (notmuch-show-key-map)))) + '(org-file-apps (quote ((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . "chromium %s") ("\\.pdf\\'" . default))))) +(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. + ) diff --git a/shell/_emacs/init.el b/shell/_emacs/init.el new file mode 100644 index 0000000..921eace --- /dev/null +++ b/shell/_emacs/init.el @@ -0,0 +1,215 @@ +;; VERSION: 0.9.0 +;; BUILD: 141 +;; TODO: +;; - Dependencies: +;; - Haskell: ghc-mod; hlint +;; - Python: jedi (pip install jedi epc) +;; - Arch: aspell-de +;; - org-mode +;; - imagemagick +;; - Latex-preview: texlive-core + +;; TODO: eldoc for C looks awesome +;; company for autocompletion? +;;;; comments +;; Fix custom-set-variables +;; need a redo solution +;; align-regexp +;; need to fix color schemes +;; fix evil state in list-packages buffer +;; fix smooth scrolling (no jumps pls) +;; fix jedi +;; checkout evil-exchange https://github.com/Dewdrops/evil-exchange +;; Learn how the minibuffer works + +;; Turn off mouse interface early to avoid momentary display +(if (fboundp 'menu-bar-mode) (menu-bar-mode -1)) +(if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) +(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) + +;; No welcome screen +(setq inhibit-startup-message t) + +;;;; autoloads +(add-to-list 'load-path (concat user-emacs-directory "/site-lisp/")) +(require 'site-lisp-autoloads) + +;;;; general settings +(when window-system + (setq frame-title-format '(buffer-file-name "%f" ("%b"))) + (blink-cursor-mode -1)) + +(setq visible-bell t + ;; color-theme-is-global t + ;; shift-select-mode nil + ;; mouse-yank-at-point t + backup-directory-alist `((".".,(concat user-emacs-directory "backups")))) + +(defalias 'yes-or-no-p 'y-or-n-p) + +;; much better scrolling +(setq scroll-margin 0 + scroll-conservatively 100000 + scroll-preserve-screen-position 1) + +;; Increase memory for tables +(setq max-lisp-eval-depth '40000) +(setq max-specpdl-size '100000) + +(require 'package) +(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/")) +(add-to-list 'package-archives + '("marmalade" . "http://marmalade-repo.org/packages/")) +(add-to-list 'package-archives + '("melpa" . "http://melpa.milkbox.net/packages/")) +(package-initialize) + +(refresh-proxy-settings) +(when (not package-archive-contents) + (package-refresh-contents)) + +(require 'with-package) + +(with-package (ace-jump-buffer haskell-mode python-mode htmlize + multiple-cursors column-marker + ;; ess ;; statistic + ;; key-chord ;; combination of keys for commands + ;; no-easy-keys + ;; pretty-symbols-mode ;; mode for pretty symbols + ;; auto-complete + ;; auto-complete-clang-async + ;; auto-complete-c-headers + ;; autopair + ;; column-marker + ;; fuzzy ;; better matching + ;; jedi + ;; maxframe + ;; nav + ;; yasnippet + notmuch + midnight + org-plus-contrib +)) + +(with-package* (evil evil-nerd-commenter evil-numbers) + (evil-mode t) + (define-key evil-normal-state-map "m" 'tabbar-forward-tab) + (define-key evil-normal-state-map "M" 'tabbar-backward-tab) + (define-key evil-normal-state-map " " 'ace-jump-buffer) + (define-key evil-normal-state-map (kbd ",ci") + 'evilnc-comment-or-uncomment-lines) + (define-key evil-normal-state-map (kbd ",cl") + 'evilnc-comment-or-uncomment-to-the-line)) + +(define-key evil-normal-state-map (kbd "RET") nil) +(define-key evil-motion-state-map (kbd "RET") nil) + +;; TODO: test this more +(with-package* key-chord + (key-chord-mode t) + (key-chord-define evil-insert-state-map "jk" 'evil-normal-state)) + +;; Evil surround mode. See https://github.com/timcharper/evil-surround +(with-package* surround + (global-surround-mode 1)) + +(with-package* anzu + (global-anzu-mode)) + +(with-package* solarized-theme + (message "Solarized theme loaded!") + (load-theme 'solarized-dark t)) + +;; loading zenburn retriggers this with-package call, so only call it once +;; (with-package* zenburn-theme +;; (unless (symbolp 'zenburn-loaded) +;; (setq 'zenburn-loaded t) +;; (load-theme 'zenburn))) + +(with-package* (ido ido-ubiquitous smex) + (ido-mode t) + (ido-everywhere t) + (setq ido-enable-flex-matching t) + (ido-ubiquitous-mode) + (setq ido-enable-last-directory-history nil + ido-record-commands nil + ido-max-work-directory-list 0 + ido-max-work-file-list 0) + (setq smex-save-file (concat user-emacs-directory ".smex-items")) + (global-set-key (kbd "M-x") 'smex)) + +(with-package* diminish + (diminish 'undo-tree-mode)) + +(show-paren-mode 1) +(global-linum-mode 1) + +;; chmod +x on save if shell script +;; (add-hook 'after-save-hook +;; 'executable-make-buffer-file-executable-if-script-p) + +;; see https://github.com/flycheck/flycheck +;; for all the additional dependencies. +(with-package* (flycheck flycheck-color-mode-line) + (setq flycheck-check-syntax-automatically (quote (save mode-enabled))) + ;; in case cabal isn't in path add path manually + ;; FIXME: don't do this always use -^ + (setq flycheck-haskell-hlint-executable "~/.cabal/bin/hlint") + (global-flycheck-mode t) + (add-hook 'flycheck-mode-hook 'flycheck-color-mode-line-mode)) + +(with-package magit + (define-key magit-status-mode-map (kbd "j") 'magit-goto-next-section) + (define-key magit-status-mode-map (kbd "k") 'magit-goto-previous-section) + (define-key magit-status-mode-map (kbd "n") 'magit-discard-item)) + +;;;; general +(setq tab-width 4) + +;;;; python +;; dependencies: pip install jedi epc +(with-package* jedi + (setq jedi:setup-keys t) + (setq jedi:complete-on-dot t) + (add-hook 'python-mode-hook 'jedi:setup)) + +;;;; C +(setq-default c-basic-offset 4) + +(add-hook 'prog-mode-hook + (lambda () + (font-lock-add-keywords nil + '(("\\<\\(FIX\\(ME\\)?\\|TODO\\|\ HACK\\|REFACTOR\\|NOCOMMIT\\):" + 1 font-lock-warning-face t))))) + +;; highlight with-package* +;; TODO: add-hook to emacs-lisp? +(font-lock-add-keywords + 'emacs-lisp-mode + '(("(\\(with-package\\*?\\)\\(?:\\s-+(?\\([^()]+\\))?\\)?" + (1 'font-lock-keyword-face) + (2 'font-lock-constant-face nil t)))) + +;; eval-and-replace +(global-set-key (kbd "C-c C-e") 'eval-and-replace) + +;; Font size +(define-key global-map (kbd "C-+") 'text-scale-increase) +(define-key global-map (kbd "C--") 'text-scale-decrease) + +;; Show trailing spaces, set whitespace tabs to dim grey and delete trailing +;; whitespaces on save. +;; Note: this will break hard line breaks for markdown. +;; TODO: Add exception for markdown-mode +;; TODO: whitespace cleanup? +;; (setq whitespace-style '(face tabs newline tab-mark) +;; whitespace-line-column 80 +;; whitespace-tab '(:foreground "dim gray" :weight bold)) +;; (global-whitespace-mode t) +;; (add-hook 'before-save-hook 'delete-trailing-whitespace) + +;; Marks the 81st column in a line. +;; (column-marker-1 80) + +(setq custom-file (concat user-emacs-directory "custom-var.el")) +(load custom-file) diff --git a/shell/_emacs/org-fragments.el b/shell/_emacs/org-fragments.el new file mode 100644 index 0000000..0e145ad --- /dev/null +++ b/shell/_emacs/org-fragments.el @@ -0,0 +1,60 @@ + +** org-mode settings + +*** Increase front size of latex previews + +#+BEGIN_SRC emacs-lisp +(setq org-format-latex-options (plist-put 'org-format-latex-options :scale 2.0)) +#+END_SRC + +*** Other customizations +TODO: create subgroups + +#+BEGIN_SRC emacs-lisp +;; org-mode +;; active Babel languages +;; TODO: load on demand + (org-babel-do-load-languages + 'org-babel-load-languages + '((R . t) + (python . t) + )) + +(add-hook 'org-babel-after-execute-hook 'org-display-inline-images) +(add-hook 'org-mode-hook 'org-display-inline-images) +(setq org-confirm-babel-evaluate nil) +(setq org-export-html-validation-link nil) +(setq org-export-allow-BIND t) +(setq org-support-shift-select t) +(setq org-src-fontify-natively t) + + +;; iimage (show images inline) +;; (when window-system +;; (defun iimage-fix-underlining () +;; ;; (set-face-underline-p 'org-link nil) ;; deactivate underlining +;; ) ;; TODO: needing something better aka unclickable links + +;; (defun iimage-refresh-iimages () +;; "Hacked refresh" +;; (clear-image-cache nil) +;; (iimage-mode nil) +;; (iimage-mode t)) + +;; (add-hook 'org-mode-hook 'iimage-mode) +;; (add-hook 'after-save-hook 'iimage-refresh-iimages) +;; (add-hook 'iimage-mode-hook 'iimage-fix-underlining) +;; (iimage-mode nil) +;; (add-to-list 'iimage-mode-image-regex-alist +;; (cons (concat "\\[\\[file:\\(~?" iimage-mode-image-filename-regex +;; "\\)\\]") 1)) +;; ) +#+END_SRC + +** increase memory for tables + +#+BEGIN_SRC emacs-lisp +;; Increase memory for tables +(setq max-lisp-eval-depth '40000) +(setq max-specpdl-size '100000) +#+END_SRC diff --git a/shell/_emacs/site-lisp/dconf-proxy.el b/shell/_emacs/site-lisp/dconf-proxy.el new file mode 100644 index 0000000..954852a --- /dev/null +++ b/shell/_emacs/site-lisp/dconf-proxy.el @@ -0,0 +1,14 @@ +(defun refresh-proxy-settings () + (interactive) + (if (string= (shell-command-to-string "dconf read /system/proxy/http/enabled") "true\n") + (setq url-proxy-services + `(("http" . + ,(concat + (car (split-string-and-unquote ;; split string to remove single quotes and newline + (shell-command-to-string "dconf read /system/proxy/http/host") '"'")) + ":" + (car (split-string-and-unquote ;; split string to remove newline + (shell-command-to-string "dconf read /system/proxy/http/port") '"\n")))))) + (setq url-proxy-services nil))) + +(provide 'dconf-proxy) diff --git a/shell/_emacs/site-lisp/site-lisp-autoloads.el b/shell/_emacs/site-lisp/site-lisp-autoloads.el new file mode 100644 index 0000000..2b1e039 --- /dev/null +++ b/shell/_emacs/site-lisp/site-lisp-autoloads.el @@ -0,0 +1,5 @@ + +(autoload 'refresh-proxy-settings "dconf-proxy" "Refresh proxy settings" t) +(autoload 'eval-and-replace "util" "Eval and replace lisp expression" t) + +(provide 'site-lisp-autoloads) diff --git a/shell/_emacs/site-lisp/util.el b/shell/_emacs/site-lisp/util.el new file mode 100644 index 0000000..b5bdc10 --- /dev/null +++ b/shell/_emacs/site-lisp/util.el @@ -0,0 +1,36 @@ +(defun eval-and-replace () + "Replace the preceding sexp with its value." + (interactive) + (forward-char) ;; for evil normal state + (backward-kill-sexp) + (condition-case nil + (prin1 (eval (read (current-kill 0))) + (current-buffer)) + (error (message "Invalid expression") + (insert (current-kill 0))))) + +(defun lorem () + "Insert a lorem ipsum." + (interactive) + (insert "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do " + "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim" + "ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut " + "aliquip ex ea commodo consequat. Duis aute irure dolor in " + "reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla " + "pariatur. Excepteur sint occaecat cupidatat non proident, sunt in " + "culpa qui officia deserunt mollit anim id est laborum.")) + +(defun insert-date () + "Insert a time-stamp according to locale's date and time format." + (interactive) + (insert (format-time-string "%c" (current-time)))) + +(defun indent-buffer () + (interactive) + (indent-region (point-min) (point-max))) + +(defun untabify-buffer () + (interactive) + (untabify (point-min) (point-max))) + +(provide 'util) diff --git a/shell/_emacs/site-lisp/with-package.el b/shell/_emacs/site-lisp/with-package.el new file mode 100644 index 0000000..3dfc52d --- /dev/null +++ b/shell/_emacs/site-lisp/with-package.el @@ -0,0 +1,31 @@ +(require 'cl) + +;; will be available at emacs 24.4 +(unless (fboundp 'with-eval-after-load) + "Do magic from the future" + (defmacro with-eval-after-load (file &rest body) + `(eval-after-load ,file + `(funcall (function ,(lambda () ,@body)))))) + +(defmacro with-package (packages &rest body) + "After pkg macro" + (declare (indent defun)) + (when (symbolp packages) ;; make a list if necessary + (setf packages (list packages))) + `(progn + (dolist (p ',packages) + (when (not (package-installed-p p)) + (package-install p)) + (with-eval-after-load p ,@body)))) + +(defmacro with-package* (packages &rest body) + "After pkg macro*" + (declare (indent defun)) + (when (symbolp packages) ;; make a list if necessary + (setf packages (list packages))) + `(prog1 + (with-package ,packages ,@body) + (dolist (p ',packages) + (require p)))) + +(provide 'with-package) diff --git a/shell/_emacs/tools/libs/jpeg62.dll b/shell/_emacs/tools/libs/jpeg62.dll Binary files differnew file mode 100644 index 0000000..21c03d5 --- /dev/null +++ b/shell/_emacs/tools/libs/jpeg62.dll diff --git a/shell/_emacs/tools/libs/libXpm.dll b/shell/_emacs/tools/libs/libXpm.dll Binary files differnew file mode 100644 index 0000000..0dcb292 --- /dev/null +++ b/shell/_emacs/tools/libs/libXpm.dll diff --git a/shell/_emacs/tools/libs/libpng-config b/shell/_emacs/tools/libs/libpng-config new file mode 100644 index 0000000..3c39bc9 --- /dev/null +++ b/shell/_emacs/tools/libs/libpng-config @@ -0,0 +1,124 @@ +#! /bin/sh + +# libpng-config +# provides configuration info for libpng. + +# Copyright (C) 2002, 2004, 2006, 2007 Glenn Randers-Pehrson +# For conditions of distribution and use, see copyright notice in png.h + +# Modeled after libxml-config. + +version="1.2.37" +prefix="c:/progra~1/libpng" +exec_prefix="${prefix}" +libdir="${exec_prefix}/lib" +includedir="${prefix}/include/libpng12" +libs="-lpng12" +all_libs="-lpng12 -lz +I_opts="-I${includedir}" +L_opts="-L${libdir}" +R_opts="" +cppflags="" +ccopts="" +ldopts="" + +usage() +{ + cat <<EOF +Usage: $0 [OPTION] ... + +Known values for OPTION are: + + --prefix print libpng prefix + --libdir print path to directory containing library + --libs print library linking information + --ccopts print compiler options + --cppflags print pre-processor flags + --cflags print preprocessor flags, I_opts, and compiler options + --I_opts print "-I" include options + --L_opts print linker "-L" flags for dynamic linking + --R_opts print dynamic linker "-R" or "-rpath" flags + --ldopts print linker options + --ldflags print linker flags (ldopts, L_opts, R_opts, and libs) + --static revise subsequent outputs for static linking + --help print this help and exit + --version print version information +EOF + + exit $1 +} + +if test $# -eq 0; then + usage 1 +fi + +while test $# -gt 0; do + case "$1" in + + --prefix) + echo ${prefix} + ;; + + --version) + echo ${version} + exit 0 + ;; + + --help) + usage 0 + ;; + + --ccopts) + echo ${ccopts} + ;; + + --cppflags) + echo ${cppflags} + ;; + + --cflags) + echo ${I_opts} ${cppflags} ${ccopts} + ;; + + --libdir) + echo ${libdir} + ;; + + --libs) + echo ${libs} + ;; + + --I_opts) + echo ${I_opts} + ;; + + --L_opts) + echo ${L_opts} + ;; + + --R_opts) + echo ${R_opts} + ;; + + --ldopts) + echo ${ldopts} + ;; + + --ldflags) + echo ${ldopts} ${L_opts} ${R_opts} ${libs} + ;; + + --static) + R_opts="" + libs=${all_libs} + ;; + + *) + usage + exit 1 + ;; + esac + shift +done + +exit 0 diff --git a/shell/_emacs/tools/libs/libpng12-config b/shell/_emacs/tools/libs/libpng12-config new file mode 100644 index 0000000..3c39bc9 --- /dev/null +++ b/shell/_emacs/tools/libs/libpng12-config @@ -0,0 +1,124 @@ +#! /bin/sh + +# libpng-config +# provides configuration info for libpng. + +# Copyright (C) 2002, 2004, 2006, 2007 Glenn Randers-Pehrson +# For conditions of distribution and use, see copyright notice in png.h + +# Modeled after libxml-config. + +version="1.2.37" +prefix="c:/progra~1/libpng" +exec_prefix="${prefix}" +libdir="${exec_prefix}/lib" +includedir="${prefix}/include/libpng12" +libs="-lpng12" +all_libs="-lpng12 -lz +I_opts="-I${includedir}" +L_opts="-L${libdir}" +R_opts="" +cppflags="" +ccopts="" +ldopts="" + +usage() +{ + cat <<EOF +Usage: $0 [OPTION] ... + +Known values for OPTION are: + + --prefix print libpng prefix + --libdir print path to directory containing library + --libs print library linking information + --ccopts print compiler options + --cppflags print pre-processor flags + --cflags print preprocessor flags, I_opts, and compiler options + --I_opts print "-I" include options + --L_opts print linker "-L" flags for dynamic linking + --R_opts print dynamic linker "-R" or "-rpath" flags + --ldopts print linker options + --ldflags print linker flags (ldopts, L_opts, R_opts, and libs) + --static revise subsequent outputs for static linking + --help print this help and exit + --version print version information +EOF + + exit $1 +} + +if test $# -eq 0; then + usage 1 +fi + +while test $# -gt 0; do + case "$1" in + + --prefix) + echo ${prefix} + ;; + + --version) + echo ${version} + exit 0 + ;; + + --help) + usage 0 + ;; + + --ccopts) + echo ${ccopts} + ;; + + --cppflags) + echo ${cppflags} + ;; + + --cflags) + echo ${I_opts} ${cppflags} ${ccopts} + ;; + + --libdir) + echo ${libdir} + ;; + + --libs) + echo ${libs} + ;; + + --I_opts) + echo ${I_opts} + ;; + + --L_opts) + echo ${L_opts} + ;; + + --R_opts) + echo ${R_opts} + ;; + + --ldopts) + echo ${ldopts} + ;; + + --ldflags) + echo ${ldopts} ${L_opts} ${R_opts} ${libs} + ;; + + --static) + R_opts="" + libs=${all_libs} + ;; + + *) + usage + exit 1 + ;; + esac + shift +done + +exit 0 diff --git a/shell/_emacs/tools/libs/libpng12.dll b/shell/_emacs/tools/libs/libpng12.dll Binary files differnew file mode 100644 index 0000000..25c0a7c --- /dev/null +++ b/shell/_emacs/tools/libs/libpng12.dll diff --git a/shell/_emacs/tools/libs/libpng14-14.dll b/shell/_emacs/tools/libs/libpng14-14.dll Binary files differnew file mode 100644 index 0000000..8b93b06 --- /dev/null +++ b/shell/_emacs/tools/libs/libpng14-14.dll diff --git a/shell/_emacs/tools/libs/libpng3.dll b/shell/_emacs/tools/libs/libpng3.dll Binary files differnew file mode 100644 index 0000000..649ec64 --- /dev/null +++ b/shell/_emacs/tools/libs/libpng3.dll diff --git a/shell/_emacs/tools/libs/libtiff3.dll b/shell/_emacs/tools/libs/libtiff3.dll Binary files differnew file mode 100644 index 0000000..9883c51 --- /dev/null +++ b/shell/_emacs/tools/libs/libtiff3.dll diff --git a/shell/_emacs/tools/libs/libungif4.dll b/shell/_emacs/tools/libs/libungif4.dll Binary files differnew file mode 100644 index 0000000..2308352 --- /dev/null +++ b/shell/_emacs/tools/libs/libungif4.dll diff --git a/shell/_emacs/tools/libs/xpm4.dll b/shell/_emacs/tools/libs/xpm4.dll Binary files differnew file mode 100644 index 0000000..0414d84 --- /dev/null +++ b/shell/_emacs/tools/libs/xpm4.dll diff --git a/shell/_emacs/tools/libs/zip.exe b/shell/_emacs/tools/libs/zip.exe Binary files differnew file mode 100644 index 0000000..65de183 --- /dev/null +++ b/shell/_emacs/tools/libs/zip.exe diff --git a/shell/_emacs/tools/libs/zlib1.dll b/shell/_emacs/tools/libs/zlib1.dll Binary files differnew file mode 100644 index 0000000..31996cd --- /dev/null +++ b/shell/_emacs/tools/libs/zlib1.dll diff --git a/shell/_emacs/tools/profiler/profile-dotemacs.el b/shell/_emacs/tools/profiler/profile-dotemacs.el new file mode 100644 index 0000000..160b800 --- /dev/null +++ b/shell/_emacs/tools/profiler/profile-dotemacs.el @@ -0,0 +1,200 @@ +;;; profile-dotemacs.el --- Profile your Emacs init file + +;; Copyright (C) 2010, 2012 David Engster + +;; Author: David Engster <dengste@eml.cc> + +;; This file is NOT part of GNU Emacs. + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License +;; as published by the Free Software Foundation; either version 2 +;; of the License, or (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see <http://www.gnu.org/licenses/>. + +;;; Commentary: + +;; This is to easily profile your Emacs init file (or any other +;; script-like Emacs Lisp file, for that matter). + +;; It will go over all sexp's (balanced expressions) in the file and +;; run them through `benchmark-run'. It will then show the file with +;; overlays applied in a way that let you easily find out which sexp's +;; take the most time. Since time is relative, it's not the absolute +;; value that counts but the percentage of the total running time. +;; +;; * All other sexp's with a percentage greater than +;; `profile-dotemacs-low-percentage' will be preceded by a +;; highlighted line, showing the results from `benchmark-run'. +;; Also, the more 'reddish' the background of the sexp, the more +;; time it needs. + +;; * All other sexp's will be grayed out to indicate that their +;; running time is miniscule. You can still see the benchmark +;; results in the minibuffer by hovering over the sexp with the +;; mouse. + +;; You can only benchmark full sexp's, so if you wrapped large parts +;; of your init file in some conditional clause, you'll have to remove +;; that for getting finer granularity. + +;;; Usage: + +;; Start emacs as follows: +;; +;; emacs -Q -l <PATH>/profile-dotemacs.el -f profile-dotemacs +;; +;; with <PATH> being the path to where this file resides. + +;;; Caveats (thanks to Raffaele Ricciardi for reporting those): + +;; - The usual `--debug-init' for debugging your init file won't work +;; with profile-dotemacs, so you'll have to call +;; `toggle-debug-on-error', either on the commandline or at the +;; beginning of your init file. +;; - `load-file-name' is nil when the init file is being loaded +;; by the profiler. This might matter if you perform the +;; bulk of initializations in a different file. +;; - Starting external shells like IELM or eshell in your init file +;; might mess with overlay creation, so this must not be done. + +;;; Download: + +;; You can always get the latest version from +;; http://randomsample.de/profile-dotemacs.el + +;;; Code: + +(require 'thingatpt) +(require 'benchmark) + +;; User variables + +(defvar profile-dotemacs-file "~/.emacs" + "File to be profiled.") + +(defvar profile-dotemacs-low-percentage 3 + "Percentage which should be considered low. +All sexp's with a running time below this percentage will be +grayed out.") + +(defface profile-dotemacs-time-face + '((((background dark)) (:background "OrangeRed1")) + (t (:background "red3"))) + "Background color to indicate percentage of total time.") + +(defface profile-dotemacs-low-percentage-face + '((((background dark)) (:foreground "gray25")) + (t (:foreground "gray75"))) + "Face for sexps below `profile-dotemacs-low-percentage'.") + +(defface profile-dotemacs-highlight-face + '((((background dark)) (:background "blue")) + (t (:background "yellow"))) + "Highlight face for benchmark results.") + +;; Main function + +(defun profile-dotemacs () + "Load `profile-dotemacs-file' and benchmark its sexps." + (interactive) + (with-current-buffer (find-file-noselect profile-dotemacs-file t) + (setq buffer-read-only t) ;; just to be sure + (goto-char (point-min)) + (let (start end results) + (while + (< (point) + (setq end (progn + (forward-sexp 1) + (point)))) + (forward-sexp -1) + (setq start (point)) + (add-to-list + 'results + `(,start ,end + ,(benchmark-run + (eval (sexp-at-point))))) + (goto-char end)) + (profile-dotemacs-show-results results) + (switch-to-buffer (current-buffer))))) + +;; Helper functions + +(defun profile-dotemacs-show-results (results) + "Show timings from RESULTS in current buffer." + (let ((totaltime (profile-dotemacs-totaltime results)) + current percentage ov) + (while results + (let* ((current (pop results)) + (ov (make-overlay (car current) (cadr current))) + (current (car (last current))) + (percentage (/ (+ (car current) (nth 2 current)) + totaltime)) + col benchstr lowface) + (setq col + (profile-dotemacs-percentage-color + percentage + (face-background 'default) + (face-background 'profile-dotemacs-time-face))) + (setq percentage (round (* 100 percentage))) + (setq benchstr (profile-dotemacs-make-benchstr current)) + (overlay-put ov 'help-echo benchstr) + (if (and (numberp profile-dotemacs-low-percentage) + (< percentage profile-dotemacs-low-percentage)) + (overlay-put ov 'face 'profile-dotemacs-low-percentage-face) + (overlay-put ov 'before-string + (propertize benchstr + 'face 'profile-dotemacs-highlight-face)) + (overlay-put ov 'face + `(:background ,col))))) + (setq ov (make-overlay (1- (point-max)) (point-max))) + (overlay-put ov 'after-string + (propertize + (format "\n-----------------\nTotal time: %.2fs\n" + totaltime) + 'face 'profile-dotemacs-highlight-face)))) + +(defun profile-dotemacs-totaltime (results) + "Calculate total time of RESULTS." + (let ((totaltime 0)) + (mapc (lambda (x) + (let ((cur (car (last x)))) + (setq totaltime (+ totaltime (car cur) (nth 2 cur))))) + results) + totaltime)) + +(defun profile-dotemacs-percentage-color (percent col-begin col-end) + "Calculate color according to PERCENT between COL-BEGIN and COL-END." + (let* ((col1 (color-values col-begin)) + (col2 (color-values col-end)) + (col + (mapcar (lambda (c) + (round + (+ (* (- 1 percent) (nth c col1)) + (* percent (nth c col2))))) + '(0 1 2)))) + (format "RGB:%04x/%04x/%04x" + (car col) + (nth 1 col) + (nth 2 col)))) + +(defun profile-dotemacs-make-benchstr (timings) + "Create descriptive benchmark string from TIMINGS." + (format + (concat + "<Percentage: %d ; " + "Time: %.2f ; " + "Number of GC: %d ; " + "Time for GC: %.2f>\n") + percentage + (car timings) (nth 1 timings) (nth 2 timings))) + + +;; profile-dotemacs.el ends here diff --git a/shell/_emacs/tools/profiler/run_profiler.el b/shell/_emacs/tools/profiler/run_profiler.el new file mode 100644 index 0000000..39939c2 --- /dev/null +++ b/shell/_emacs/tools/profiler/run_profiler.el @@ -0,0 +1,2 @@ +;; won't work unless .emacs exists +(eshell-command "emacs -Q -l ~/.emacs.d/tools/profiler/profile-dotemacs.el -f profile-dotemacs") diff --git a/shell/_gitconfig b/shell/_gitconfig new file mode 100644 index 0000000..051b995 --- /dev/null +++ b/shell/_gitconfig @@ -0,0 +1,11 @@ +[user] + name = Tharre + email = tharre3@gmail.com +[push] + default = simple +[alias] + lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit +[branch] + autosetuprebase = always +[merge] + tool = vimdiff diff --git a/shell/_tmux.conf b/shell/_tmux.conf new file mode 100644 index 0000000..84f08c3 --- /dev/null +++ b/shell/_tmux.conf @@ -0,0 +1,9 @@ +set -g prefix C-x +bind C-x send-prefix +unbind C-b + +set -g default-terminal "screen-256color" + +set -g base-index 1 # start window numbering with 1 + +bind-key r source-file ~/.tmux.conf \; display "Config reloaded!" diff --git a/shell/_vimrc b/shell/_vimrc new file mode 100644 index 0000000..fd3e5c7 --- /dev/null +++ b/shell/_vimrc @@ -0,0 +1,120 @@ +" github.com/samnang/dotfiles/blob/master/vimrc +" http://nvie.com/posts/how-i-boosted-my-vim/ +" http://learnvimscriptthehardway.stevelosh.com/chapters/52.html +" May install in the future: +" Git wrapper, similar to magit: 'https://github.com/tpope/vim-fugitive' + +let mapleader="," " set leader early as otherwise it wouldn't work + +" ----- NeoBundle ----- +let reinstall=0 +if !filereadable(expand('~/.vim/bundle/neobundle.vim/README.md')) + " if vundle isn't currently installed + silent !git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim + let reinstall=1 +endif + +if has('vim_starting') + if &compatible + set nocompatible " Be iMproved + endif + + set runtimepath+=/home/xramses/.vim/bundle/neobundle.vim/ +endif + +call neobundle#begin(expand('/home/xramses/.vim/bundle')) + +" Let NeoBundle manage NeoBundle +NeoBundleFetch 'Shougo/neobundle.vim' + +" Add or remove your Bundles here: +NeoBundle 'Shougo/vimproc.vim', { +\ 'build' : { +\ 'windows' : 'tools\\update-dll-mingw', +\ 'cygwin' : 'make -f make_cygwin.mak', +\ 'mac' : 'make -f make_mac.mak', +\ 'linux' : 'make', +\ 'unix' : 'gmake', +\ }, +\ } +NeoBundle 'Lokaltog/vim-distinguished' +NeoBundle 'xolox/vim-reload' +NeoBundle 'xolox/vim-misc' +NeoBundle 'Shougo/unite.vim' +NeoBundle 'bling/vim-airline' +NeoBundle 'scrooloose/syntastic' +NeoBundle 'scrooloose/nerdcommenter' +NeoBundle 'tpope/vim-surround' +"NeoBundle 'msanders/snipmate.vim' +NeoBundle 'davidhalter/jedi-vim' +NeoBundle 'wting/rust.vim' +"NeoBundle 'godlygeek/tabular' +"NeoBundle 'plasticboy/vim-markdown' + +call neobundle#end() + +filetype plugin indent on + +" If there are uninstalled bundles found on startup, +" this will conveniently prompt you to install them. +NeoBundleCheck + +" ----- general settings ----- +set encoding=utf-8 +set ff=unix +set number +set clipboard=unnamedplus +set showmatch " show matching brackets + +set incsearch " Find as you type search +set hlsearch " Highlight search terms +set ignorecase " Case-insensitive searching. +set smartcase " But case-sensitive if expression contains a capital letter. + +set history=1000 " remember more commands and search history +set undolevels=1000 " use many levels of undo + +set nobackup +set noswapfile + +set tabstop=4 +set shiftwidth=4 +set textwidth=80 +set cc=81 + +set list +set listchars=tab:>-,trail:~ + +autocmd InsertEnter * :let @/="" +autocmd InsertLeave * :let @/="" + +"set expandtab + +map Q @ +map <S-m> :tabprevious<CR> +map m :tabnext<CR> + +syntax enable +set background=dark +colorscheme distinguished + +" remove trailing whitespaces on save +autocmd BufWritePre * :%s/\s\+$//e + +" Markdown +autocmd BufRead,BufNew *.md set filetype=markdown + +" airline +set laststatus=2 +let g:airline_theme = 'powerlineish' +"let g:airline#extensions#tabline#enabled = 1 " make tabs look crazy +" only enable trailing whitespace checking +let g:airline#extensions#whitespace#checks = [ 'trailing' ] +let g:airline#extensions#syntastic#enabled = 0 + +" Unite +nnoremap <C-p> :Unite file_rec/async<cr> + +if !has('clipboard') + echo "Clipboard not supported!" +endif diff --git a/shell/_zshrc b/shell/_zshrc new file mode 100644 index 0000000..1c03df1 --- /dev/null +++ b/shell/_zshrc @@ -0,0 +1,173 @@ +zstyle ':completion:*' menu select + +# Path to your oh-my-zsh configuration. +ZSH=$HOME/.oh-my-zsh + +# Set name of the theme to load. +# Look in ~/.oh-my-zsh/themes/ +# Optionally, if you set this to "random", it'll load a random theme each +# time that oh-my-zsh is loaded. +ZSH_THEME="robbyrussell" + +# Set to this to use case-sensitive completion +# CASE_SENSITIVE="true" + +# Comment this out to disable bi-weekly auto-update checks +# DISABLE_AUTO_UPDATE="true" + +# Uncomment to change how many often would you like to wait before auto-updates occur? (in days) +# export UPDATE_ZSH_DAYS=13 + +# Uncomment following line if you want to disable colors in ls +# DISABLE_LS_COLORS="true" + +# Uncomment following line if you want to disable autosetting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment following line if you want red dots to be displayed while waiting for completion +COMPLETION_WAITING_DOTS="true" + +# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) +# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +plugins=(git) + +source $ZSH/oh-my-zsh.sh + +# 256 color mode +if [ -n "$TMUX" ]; then + export TERM=screen-256color +else + export TERM=xterm-256color +fi + +# cabal +export PATH=$PATH:~/.cabal/bin + +# ruby +export PATH=$PATH:$HOME/.gem/ruby/2.1.0/bin + +# vim +export EDITOR=vim + +# xclip +alias xclip="xclip -selection c" + +alias open="xdg-open" + +function noproxy { + unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ftp_proxy FTP_PROXY no_proxy + + # change dconf + dconf reset -f /system/proxy/ + + proxy_update +} + +function setproxy { + base_proxy="proxy.domain.com" + base_proxy_port=8080 + + dconf_proxy="'$base_proxy'" + env_proxy="http://$base_proxy:$base_proxy_port" + + http_proxy=$env_proxy + HTTP_PROXY=$env_proxy + https_proxy=$env_proxy + HTTPS_PROXY=$env_proxy + ftp_proxy=$env_proxy + FTP_PROXY=$env_proxy + no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com" + export http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ftp_proxy FTP_PROXY no_proxy + + # change dconf + dconf write /system/proxy/mode "'manual'" + dconf write /system/proxy/ignore-hosts "['localhost', '127.0.0.0/8', '10.0.0.0/8', '192.168.0.0/16', '172.16.0.0/12']" + dconf write /system/proxy/http/enabled true + dconf write /system/proxy/http/host "$dconf_proxy" + dconf write /system/proxy/http/port "$base_proxy_port" + dconf write /system/proxy/https/host "$dconf_proxy" + dconf write /system/proxy/https/port "$base_proxy_port" + dconf write /system/proxy/ftp/host "$dconf_proxy" + dconf write /system/proxy/ftp/port "$base_proxy_port" + + proxy_update +} + +# restart/reload applications for proxy settings to take effect +function proxy_update { + # dropbox + killall -q dropbox + dropbox-cli start +} + +# set lid closing action to sleep +function set_closing_sleep { + get_closing_action + if [ $? -eq 0 ]; then + head -n -2 /etc/systemd/logind.conf | sudo tee /etc/systemd/logind.conf > /dev/null + echo "Closing action set to sleep if lid is closed." + sudo systemctl restart systemd-logind.service + else + echo "Already set to sleep if lid is closed." + fi +} + +# set lid closing action to nothing +function set_closing_nothing { + get_closing_action + if [ $? -eq 1 ]; then + cat <<'EOF' | sudo tee -a /etc/systemd/logind.conf > /dev/null +#custom +HandleLidSwitch=ignore +EOF + echo "Closing action set to _not_ sleep if lid is closed." + sudo systemctl restart systemd-logind.service + else + echo "Already set to _not_ sleep if lid is closed." + fi +} + +# 0 is nothing, 1 is sleep +function get_closing_action { + grep -q '#custom' /etc/systemd/logind.conf + return $? +} + +function toggle_laptop_closing_action { + get_closing_action + if [ $? -eq 1 ]; then + set_closing_nothing + else + set_closing_sleep + fi +} + +function update_and_sleep { + get_closing_action + save=$? + set_closing_nothing + yaourt -Syu --noconfirm + if [ $save -eq 1 ]; then + set_closing_sleep + fi + systemctl suspend +} + +function 256color_test { + ( x=`tput op` y=`printf %$((${COLUMNS}-6))s`; + for i in {0..256}; + do + o=00$i; + echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x; + done ) +} + + +## run on startup + +if type "archey" > /dev/null; then + archey # nice system information and arch logo +fi + +cat ~/TODO |