From bd7e8292b8b70d903cadcb8b00aaeffcbfc85be8 Mon Sep 17 00:00:00 2001 From: Mitch Tishmack Date: Mon, 11 Apr 2016 08:27:20 -0500 Subject: [PATCH] Updates and remove last vestiges of old stuff. --- Makefile | 8 +- common/.profile.d/00-prelude.sh | 14 - common/.profile.d/01-ps1.sh | 3 - common/.profile.d/10-path.sh | 3 - common/.profile.d/20-functions-path.sh | 42 - common/.profile.d/20-functions.sh | 92 -- common/.profile.d/99-alias.sh | 17 - emacs/.emacs.d/emacs.org | 1245 ------------------------ emacs/.emacs.d/init.el | 5 - emacs/.profile.d/99-alias-emacs.sh | 8 - etangle | 2 + options.el | 1 - osx.el | 1 - readme.org | 147 ++- ruby/.gemrc | 2 - ruby/.maid/rules.rb | 63 -- ruby/.profile.d/99-alias-ruby.sh | 2 - ruby/.pryrc | 19 - 18 files changed, 116 insertions(+), 1558 deletions(-) delete mode 100644 common/.profile.d/00-prelude.sh delete mode 100644 common/.profile.d/01-ps1.sh delete mode 100644 common/.profile.d/10-path.sh delete mode 100644 common/.profile.d/20-functions-path.sh delete mode 100644 common/.profile.d/20-functions.sh delete mode 100644 common/.profile.d/99-alias.sh delete mode 100644 emacs/.emacs.d/emacs.org delete mode 100644 emacs/.emacs.d/init.el delete mode 100644 emacs/.profile.d/99-alias-emacs.sh delete mode 100644 ruby/.gemrc delete mode 100755 ruby/.maid/rules.rb delete mode 100644 ruby/.profile.d/99-alias-ruby.sh delete mode 100644 ruby/.pryrc diff --git a/Makefile b/Makefile index 26b3eee..a7483f7 100644 --- a/Makefile +++ b/Makefile @@ -2,11 +2,11 @@ # outside of emacs. .PHONY: tangle tangle-next DEST:=$(HOME) -LAST:=$(shell cat last || echo 0) +LAST:=$(shell cat .last || echo 0) NEXT:=$(shell l=$(LAST); ((l=l+1)); echo $$l) NEXTGEN:=$(PWD)/generation/$(NEXT) LASTGEN:=$(PWD)/generation/$(LAST) -TANGLERS:=readme.org +TANGLERS:=readme.org emacs.org GEN:=$(LAST) OPTIONS:= @@ -46,7 +46,7 @@ tangle-next: $(MAKE) generation $(MAKE) next $(MAKE) copy GEN=$(NEXT) - @echo $(NEXT) > last + @echo $(NEXT) > .last copy: cd $(PWD)/generation/$(GEN) && find . -type f -exec rm -f $(DEST)/{} \; @@ -60,4 +60,4 @@ clean: -rm -fr tmp nuke: clean - -rm -fr last generation + -rm -fr .last generation diff --git a/common/.profile.d/00-prelude.sh b/common/.profile.d/00-prelude.sh deleted file mode 100644 index e6a0a92..0000000 --- a/common/.profile.d/00-prelude.sh +++ /dev/null @@ -1,14 +0,0 @@ -# common/.profile.d/00-prelude.sh -# -*- mode: Shell-script; -*- -# Common .profile -# -# This file is generated from dotdee and managed from stow. -# -# Manual editing discouraged. - - -# Common variables for use later -_uname=$(uname) -_uname_n=$(uname -n) -_hostname=$(hostname) -export _uname _uname_n _hostname diff --git a/common/.profile.d/01-ps1.sh b/common/.profile.d/01-ps1.sh deleted file mode 100644 index 4bac252..0000000 --- a/common/.profile.d/01-ps1.sh +++ /dev/null @@ -1,3 +0,0 @@ -# common/.profile.d/01-ps1.sh -# Default if not already overridden -_host=${_host:=${_uname_n}} diff --git a/common/.profile.d/10-path.sh b/common/.profile.d/10-path.sh deleted file mode 100644 index 5d96d99..0000000 --- a/common/.profile.d/10-path.sh +++ /dev/null @@ -1,3 +0,0 @@ -# common/.profile.d/10-path.sh -PATH="${PATH}:${HOME}/bin" -export PATH diff --git a/common/.profile.d/20-functions-path.sh b/common/.profile.d/20-functions-path.sh deleted file mode 100644 index 908e923..0000000 --- a/common/.profile.d/20-functions-path.sh +++ /dev/null @@ -1,42 +0,0 @@ -# common/.profile.d/20-functions-path.sh -# cat out a : separated env variable -# variable is the parameter -cat_env() -{ - set | grep '^'"$1"'=' > /dev/null 2>&1 && eval "echo \$$1" | tr ':' ' -' | awk '!/^\s+$/' | awk '!/^$/' -} - -# Convert a line delimited input to : delimited -to_env() -{ - awk '!a[$0]++' < /dev/stdin | tr -s ' -' ':' | sed -e 's/\:$//' | awk 'NF > 0' -} - -# Unshift a new value onto the env var -# first arg is ENV second is value to unshift -# basically prepend value to the ENV variable -unshift_env() -{ - new=$(eval "echo $2; echo \$$1" | to_env) - eval "$1=${new}; export $1" -} - -# Opposite of above, but echos what was shifted off -shift_env() -{ - first=$(cat_env "$1" | head -n 1) - rest=$(cat_env "$1" | awk '{if (NR!=1) {print}}' | to_env) - eval "$1=$rest; export $1" - echo "${first}" -} - -# push $2 to $1 on the variable -push_env() -{ - have=$(cat_env "$1") - new=$(printf "%s -%s" "$have" "$2" | to_env) - eval "$1=$new; export $1" -} diff --git a/common/.profile.d/20-functions.sh b/common/.profile.d/20-functions.sh deleted file mode 100644 index ccc74a0..0000000 --- a/common/.profile.d/20-functions.sh +++ /dev/null @@ -1,92 +0,0 @@ -# common/.profile.d/20-functions.sh -# Remove a line matched in $HOME/.ssh/known_hosts for when there are legit -# host key changes. -nukehost() -{ - if [ -z "$1" ]; then - echo "Usage: nukehost " - echo " Removes from ssh known_host file." - else - sed -i -e "/$1/d" ~/.ssh/known_hosts - fi -} - -# Cheap copy function to make copying a file via ssh from one host -# to another less painful, use pipeviewer to give some idea as to progress. -ssh-copyfile() -{ - if [ -z "$1" -o -z "$2" ]; then - echo "Usage: copy source:/file/location destination:/file/location" - else - srchost="$(echo "$1" | awk -F: '{print $1}')" - src="$(echo "$1" | awk -F: '{print $2}')" - dsthost="$(echo "$2" | awk -F: '{print $1}')" - dst="$(echo "$2" | awk -F: '{print $2}')" - size=$(ssh "$srchost" du -hs "$src" 2> /dev/null) - size=$(echo "${size}" | awk '{print $1}') - echo "Copying $size to $dst" - ssh "$srchost" "/bin/cat \$src" 2> /dev/null | pv -cb -N copied - | ssh "$dsthost" "/bin/cat - > \$dst" 2> /dev/null - fi -} - -# extract function to automate being lazy at extracting archives. -extract() -{ - if [ -f "$1" ]; then - case ${1} in - *.tar.bz2|*.tbz2|*.tbz) bunzip2 -c "$1" | tar xvf -;; - *.tar.gz|*.tgz) gunzip -c "$1" | tar xvf -;; - *.tz|*.tar.z) zcat "$1" | tar xvf -;; - *.tar.xz|*.txz|*.tpxz) xz -d -c "$1" | tar xvf -;; - *.bz2) bunzip2 "$1";; - *.gz) gunzip "$1";; - *.jar|*.zip) unzip "$1";; - *.rar) unrar x "$1";; - *.tar) tar -xvf "$1";; - *.z) uncompress "$1";; - *.rpm) rpm2cpio "$1" | cpio -idv;; - *) echo "Unable to extract <$1> Unknown extension." - esac - else - print "File <$1> does not exist." - fi -} - -# Tcsh compatibility so I can be a lazy bastard and paste things directly -# if/when I need to. -setenv() -{ - export "$1=$2" -} - -# Just to be lazy, set/unset the DEBUG env variable used in my scripts -debug() -{ - if [ -z "$DEBUG" ]; then - if [ -z "$1" ]; then - echo Setting DEBUG to "$1" - setenv DEBUG "$1" - else - echo Setting DEBUG to default - setenv DEBUG default - fi - else - echo Unsetting DEBUG - unset DEBUG - fi -} - -login_shell() -{ - [ "$-" = "*i*" ] -} - -# Yeah, sick of using the web browser for this crap -# Use is NUM FROM TO and boom get the currency converted from goggle. -cconv() -{ - curl -L --silent\ - "https://www.google.com/finance/converter?a=$1&from=$2&to=$3" \ - | grep converter_result \ - | perl -pe 's|[<]\w+ \w+[=]\w+[>]||g;' -e 's|[<][/]span[>]||' -} diff --git a/common/.profile.d/99-alias.sh b/common/.profile.d/99-alias.sh deleted file mode 100644 index 5fdfd12..0000000 --- a/common/.profile.d/99-alias.sh +++ /dev/null @@ -1,17 +0,0 @@ -# common/.profile.d/99-alias.sh -alias s="\$(which ssh)" -alias quit='exit' -alias cr='reset; clear' -alias a=ag -alias n=noglob -alias l=ls -alias L='ls -dal' -alias cleandir="find . -type f \( -name '*~' -o -name '#*#' -o -name '.*~' -o -name '.#*#' -o -name 'core' -o -name 'dead.letter*' \) | grep -v auto-save-list | xargs -t rm" - -# Prefer less for paging duties. -which less > /dev/null 2>&1 -if [ $? -eq 0 ]; then - alias T="\$(which less) -f +F" -else - alias T="\$(which tail) -f" -fi diff --git a/emacs/.emacs.d/emacs.org b/emacs/.emacs.d/emacs.org deleted file mode 100644 index 04d0459..0000000 --- a/emacs/.emacs.d/emacs.org +++ /dev/null @@ -1,1245 +0,0 @@ -#+BABEL: :cache yes -#+PROPERTY: header-args :tangle yes :comments no -#+TITLE: Emacs Configuration -#+AUTHOR: Mitch Tishmack -#+STARTUP: hidestars -#+STARTUP: odd - -* readme - -This is my emacs configuration file. I don't encourage anyone to use this verbatim, -but if you wanted to this is how you would do so: - -*** Clone this repo - -#+BEGIN_SRC sh :tangle no -git clone https://github.com/mitchty/dotfiles -#+END_SRC - -*** Preferably backup your emacs configuration - -Always good to back things up, just in case you hate how I did things. - -#+BEGIN_SRC sh :tangle no -tar cvf ~/.emacs-backup.tar ~/.emacs.d ~/.emacs -#+END_SRC - -*** Remove/move your old configuration - -This is up to you to do right, just an example. - -#+BEGIN_SRC sh :tangle no -rm -fr ~/.emacs.d ~/.emacs -#+END_SRC - -*** Lastly copy necessary files - -#+BEGIN_SRC sh :tangle no -mkdir ~/.emacs.d -cp dotfiles/init.el dotfiles/emacs.org ~/.emacs.d -#+END_SRC - -* prelude - -Startup related tasks/setup that might be used later on. - -*** emacs package setup - -Setup the builtin emacs package manager. - -#+BEGIN_SRC emacs-lisp - (require 'package) - (package-initialize) -#+END_SRC - -Add in the standard package archive urls. - -#+BEGIN_SRC emacs-lisp - (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t) - (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) - (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/") t) -#+END_SRC - -*** use-package bootstrap - -This configuration is using *use-package* extensively. Install it straight away. - -#+BEGIN_SRC emacs-lisp - (unless (package-installed-p 'use-package) - (progn - (package-refresh-contents) - (package-install 'use-package) - (package-initialize))) - - (require 'use-package) -#+END_SRC - -*** match end of string function - -#+BEGIN_SRC emacs-lisp - (defun string/ends-with (string suffix) - "Return t if STRING ends with SUFFIX." - (and (string-match (rx-to-string `(: ,suffix eos) t) - string) - t) - ) -#+END_SRC - -*** always babel tangle and byte compile emacs.org - -Add a save hook to always tangle and byte compile emacs.org file when we save it. - -#+BEGIN_SRC emacs-lisp - (defun tangle-init () - "If the current buffer is 'emacs.org' the code-blocks are - tangled, and the tangled file is compiled." - (when (string/ends-with (buffer-file-name) ".emacs.d/emacs.org") - (let ((prog-mode-hook nil)) - (org-babel-tangle) - (byte-compile-file (concat user-emacs-directory "emacs.el"))) - ) - ) - - (add-hook 'after-save-hook 'tangle-init) -#+END_SRC - -*** debug on error - -Not having to start *emacs* with *--debug-init* is useful. - -#+BEGIN_SRC emacs-lisp - (setq debug-on-error t) -#+END_SRC - -*** emacs server - -Start up the emacs server if it isn't running. - -#+BEGIN_SRC emacs-lisp - (load "server") - (unless (server-running-p) (server-start)) -#+END_SRC - -*** theme - -Solarized light is decent. I'll just use that. Note, to prevent flicker this is setup early in startup. - -#+BEGIN_SRC emacs-lisp - (use-package solarized-theme :ensure t :init (load-theme 'solarized-light 't)) -#+END_SRC - -*** os detection - -Make it easier to determine what os we're running on. - -#+BEGIN_SRC emacs-lisp - (defvar on-mswindows (string-match "windows" (symbol-name system-type)) - "Am I running under windows?") - (defvar on-osx (string-match "darwin" (symbol-name system-type)) - "Am I running under osx?") - (defvar on-linux (string-match "gnu/linux" (symbol-name system-type)) - "Am I running under linux?") -#+END_SRC - -*** disable pointless startup stuff - -Like the startup screen and the echo hooey. - -#+BEGIN_SRC emacs-lisp - (custom-set-variables - '(inhibit-startup-screen t) - '(inhibit-startup-message t) - '(inhibit-startup-echo-area-message t) - ) -#+END_SRC - -*** temporary files - -Keep temporary stuff isolated from everyone else. It infects everything otherwise. As bad as the .DS_Store files on osx. - -#+BEGIN_SRC emacs-lisp - (custom-set-variables - '(temporary-file-directory "/tmp") - '(backup-directory-alist `((".*" . ,temporary-file-directory))) - '(auto-save-file-name-transforms `((".*" ,temporary-file-directory t))) - '(create-lockfiles nil) - '(make-backup-files nil) - '(auto-save-default nil) - '(backup-by-copying t) - '(auto-save-list-file-prefix temporary-file-directory) - '(backup-directory-alist `((".*" . ,temporary-file-directory))) - '(auto-save-file-name-transforms `((".*" ,temporary-file-directory t))) - ) -#+END_SRC - -*** auto revert - -Update files in open buffers as they're changed on disk, freaking annoying without this on. - -#+BEGIN_SRC emacs-lisp - (custom-set-variables '(global-auto-revert-mode t)) -#+END_SRC - -*** dired - -Use dired-x. - -#+BEGIN_SRC emacs-lisp - (add-hook 'dired-load-hook (function (lambda () (load "dired-x")))) -#+END_SRC - -*** ediff - -For those rare times I use it, make it a bit less derp on output. - -#+BEGIN_SRC emacs-lisp - (setq ediff-window-setup-function 'ediff-setup-windows-plain) - (setq ediff-split-window-function 'split-window-horizontally) -#+END_SRC - -*** always remove trailing whitespace - -Trailing whitespace is not normally useful. Remove it always on save in the *before-save-hook*. - -#+BEGIN_SRC emacs-lisp - (add-hook 'before-save-hook 'delete-trailing-whitespace) -#+END_SRC - -*** chmod u+x on save for scripts - -Because its derp to have to chmod 755 stuff after I save. Honestly, do it for me kthxbai. - -#+BEGIN_SRC emacs-lisp - (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) -#+END_SRC - -*** misc text related -*** line wrap - -Line wrapping is useful. Enable it globally for a start. - -Need word-wrap so kill line kills the line, not the displayed line. - -#+BEGIN_SRC emacs-lisp - (global-visual-line-mode t) - (custom-set-variables '(word-wrap t)) -#+END_SRC - -*** default major mode - -So if we don't know, call it text-mode. - -#+BEGIN_SRC emacs-lisp - (custom-set-variables '(default-major-mode 'text-mode)) -#+END_SRC - -*** encoding - -utf8 is the best. Default to it. - -#+BEGIN_SRC emacs-lisp - (custom-set-variables '(locale-coding-system 'utf-8)) - (set-terminal-coding-system 'utf-8) - (set-keyboard-coding-system 'utf-8) - (set-selection-coding-system 'utf-8) - (prefer-coding-system 'utf-8) -#+END_SRC - -*** text selection - -If I selected text, delete the selection, I probably meant it emacs. - -#+BEGIN_SRC emacs-lisp - (delete-selection-mode 1) -#+END_SRC -*** line width - -80 char line columns not 72. - -#+BEGIN_SRC emacs-lisp - (custom-set-variables '(fill-column 80)) -#+END_SRC - -*** we aren't banging rocks anymore - -Double spacing after a line isn't needed. We aren't animals emacs, we have computers. - -#+BEGIN_SRC emacs-lisp - (set-default 'sentence-end-double-space nil) -#+END_SRC - -*** sentence end - -Semi related to the above, make the sentence endings a bit more code-ish. - -#+BEGIN_SRC emacs-lisp - (custom-set-variables - '(sentence-end "[.?!][]\"')]*\\($\\|\t\\| \\)[ \t\n]*") - '(sentence-end-double-space nil) - ) -#+END_SRC - -*** default tab-width - -Two seems sensible, cause well, tabs are evil incarnate. - -Lets use a tab width of 2 by default. - -#+BEGIN_SRC emacs-lisp - (custom-set-variables '(default-tab-width 2)) -#+END_SRC - -*** whitespace - -Customize whitespace mode to make tabs obvious as boxes, and to highlight lines over 80 characters in length. - -#+BEGIN_SRC emacs-lisp -(require 'whitespace) - -(setq whitespace-style '(face tabs trailing)) - -(set-face-attribute 'whitespace-tab nil - :foreground "#2075c7" - :background "lightgrey") - -(set-face-attribute 'whitespace-line nil - :foreground "#2075c7" - :background "lightgrey") -#+END_SRC - -*** uncategorized - -I have no idea how to label these. - -Highlight parens. - -#+BEGIN_SRC emacs-lisp - (show-paren-mode) -#+END_SRC - -Typing out *yes* or *no* is stupid. - -#+BEGIN_SRC emacs-lisp - (fset 'yes-or-no-p 'y-or-n-p) -#+END_SRC - -*** osx specific - -**** no yes-or-no gui windows - -On osx, don't ever display the gui dialog box. Taken from http://superuser.com/questions/125569/how-to-fix-emacs-popup-dialogs-on-mac-os-x - -#+BEGIN_SRC emacs-lisp - (when (and on-osx (window-system)) - (defadvice yes-or-no-p (around prevent-dialog activate) - "Prevent yes-or-no-p from activating a dialog" - (let ((use-dialog-box nil)) - ad-do-it)) - (defadvice y-or-n-p (around prevent-dialog-yorn activate) - "Prevent y-or-n-p from activating a dialog" - (let ((use-dialog-box nil)) - ad-do-it)) - ) -#+END_SRC - -**** make osx gui emacs keyboard setup match console - -Command should be meta on cocoa emacs like the old carbon/macports version. - -#+BEGIN_SRC emacs-lisp - (when (and on-osx (window-system)) - (custom-set-variables - '(mac-command-key-is-meta t) - '(mac-option-key-is-meta nil) - '(mac-command-key-is-meta t) - '(mac-command-modifier 'meta) - '(mac-option-modifier 'none) - ) - ) -#+END_SRC - -*** global key bindings - -Global key bindings. - -#+BEGIN_SRC emacs-lisp - (global-set-key (kbd "C-x ,") 'kill-whole-line) - (global-set-key (kbd "C-x C-m") 'compile) -#+END_SRC - -*** x copy/paste - -#+BEGIN_SRC emacs-lisp - (when (and on-linux (window-system)) - (progn - (setq interprogram-paste-function 'x-cut-buffer-or-selection-value) - (setq x-select-enable-clipboard t) - ) - ) -#+END_SRC -* appearance -*** gui - -When i'm running in a terminal emacs, most of this junk isn't needed. For that matter gui counts for most. - -Basically, never show the tool bar or the scroll bar in gui or tty. In gui its ok to show the menu-bar. - -Also have the scratch buffer be empty instead of have the derp message I never read anyway. - -#+BEGIN_SRC emacs-lisp - (tool-bar-mode -1) - (scroll-bar-mode -1) - (when (not window-system) - (menu-bar-mode -1)) - (custom-set-variables '(initial-scratch-message nil)) -#+END_SRC - -*** fonts - -List of fonts in order of preference. - -#+BEGIN_SRC emacs-lisp - (defvar my/gui-fonts - '( - "PragmataPro" - "Pragmata Pro" ;; Seems to register differently on osx than X - "Source Code Pro" - "Menlo" - "Monaco" - ) - ) -#+END_SRC - -Set preferred font list when we're in a gui emacs session. - -#+BEGIN_SRC emacs-lisp - (with-no-warnings - (when window-system - (if (find-font (font-spec :name (car my/gui-fonts))) - (progn (set-frame-font (car my/gui-fonts)) - (set-face-attribute 'default nil :height 180)) - (progn (set-gui-font (cdr my/gui-fonts)))) - ) - ) -#+END_SRC - -*** tty - - Enable mouse mode for the console and use the mousewheel if possible. - -#+BEGIN_SRC emacs-lisp - (unless window-system - (require 'mouse) - (xterm-mouse-mode t) - (global-set-key [mouse-4] '(lambda () - (interactive) - (scroll-down 1))) - (global-set-key [mouse-5] '(lambda () - (interactive) - (scroll-up 1))) - (defun track-mouse (e)) - ) -#+END_SRC - -* packages - -All the packages I use. - -*** tramp - -#+BEGIN_SRC emacs-lisp - (use-package tramp - :ensure t - :config (custom-set-variables '(tramp-default-method "ssh")) - ) -#+END_SRC - -*** exec-path-from-shell - -Turns out that someone wrote this exact thing already. Yay get to drop my own crap. - -#+BEGIN_SRC emacs-lisp - (use-package exec-path-from-shell - :ensure t - :init (if on-osx (exec-path-from-shell-initialize)) - ) -#+END_SRC - -*** osx-clipboard-mode - -#+BEGIN_SRC emacs-lisp - (when on-osx - (use-package osx-clipboard - :ensure t - :config - (progn - (osx-clipboard-mode +1) - ) - ) - ) -#+END_SRC - -*** smart-mode-line - -#+BEGIN_SRC emacs-lisp - (use-package smart-mode-line - :ensure t - :config - (progn - (custom-set-variables '(sml/name-width 20) - '(sml/mode-width 'full) - '(sml/shorten-modes t) - '(sml/shorten-directory t) - '(sml/hidden-modes - '(" GitGutter" - " Fill" - " $" - " Wrap" - " MRev" - " Ind" - " Projectile" - " SP" - " Undo-Tree" - " yas" - " WSC")) - ) - (sml/toggle-shorten-modes) - (add-to-list 'sml/replacer-regexp-list - '("^~/src/" ":src:")) - (sml/setup) - (column-number-mode) - ) - ) -#+END_SRC - -*** semantic - -#+BEGIN_SRC emacs-lisp - (use-package semantic - :ensure t - :config - (progn - (custom-set-variables - '(global-semantic-decoration-mode t) - '(global-semantic-highlight-func-mode t) - '(global-semantic-idle-scheduler-mode t) - '(global-semantic-idle-local-symbol-highlight-mode t) - '(global-semantic-stickyfunc-mode f) - ) - ) - :init(semantic-mode t) - ) -#+END_SRC - -*** expand-region - -#+BEGIN_SRC emacs-lisp - (use-package expand-region :ensure t :bind ("C-]" . er/expand-region)) -#+END_SRC - -*** helm - -By Helms Deep use Helm to do ALL THE THINGS. IDO is ass in comparison. - -#+BEGIN_SRC emacs-lisp - (use-package helm - :ensure t - :diminish helm-mode - :bind (("M-x" . helm-M-x) - ("M-y" . helm-show-kill-ring) - ("C-x b" . helm-mini) - ("C-x C-b" . helm-buffers-list) - ("C-x C-f" . helm-find-files) - ("C-x C-r" . helm-recentf) - ("C-x c o" . helm-occur)) - :init (progn - (require 'helm-config) - (helm-mode 1) - (use-package helm-descbinds - :ensure t - :bind (("C-h b" . helm-descbinds) - ("C-h w" . helm-descbinds)) - ) - (use-package helm-ag :ensure t) - (use-package helm-projectile :ensure t) - ) - ) -#+END_SRC - -*** magit - -Make git not ass to use. At least in emacs. magit is the best git interface... in the world. - -#+BEGIN_SRC emacs-lisp - (use-package magit - :ensure t - :commands (magit-init - magit-status - magit-diff - magit-commit) - :bind ("C-x m" . magit-status) - :config - (progn - (custom-set-variables - '(magit-auto-revert-mode nil) - '(magit-last-seen-setup-instructions "1.4.0") - ) - (defadvice magit-status (around magit-fullscreen activate) - (window-configuration-to-register :magit-fullscreen) - ad-do-it - (delete-other-windows)) - - (defadvice magit-quit-window (around magit-restore-screen activate) - ad-do-it - (jump-to-register :magit-fullscreen))) - ) -#+END_SRC - -*** workgroups2 - -Save workgroup layouts. Similar..ish to desktop-save. - -#+BEGIN_SRC emacs-lisp :tangle no - (use-package workgroups2 - :ensure t - :diminish (workgroups-mode . "") - :config - (progn - (custom-set-variables - '(wg-session-file "~/.emacs.d/workgroups") - '(wg-prefix-key (kbd "C-c C-w")) - '(wg-mode-line-display-on nil) - ) - ) - :init (workgroups-mode 1) - ) -#+END_SRC - -*** autopair - -Highlight matching ()'s []'s etc... - -#+BEGIN_SRC emacs-lisp - (use-package autopair - :ensure t - :config - (progn (custom-set-variables '(autopair-blink 'nil))) - ) -#+END_SRC - -*** org-mode - -Org-mode keybindings and settings, pretty sparse really. - -#+BEGIN_SRC emacs-lisp - (use-package org - :ensure org-plus-contrib - :bind (("C-c a" . org-agenda) - ("C-c b" . org-iswitchb) - ("C-c c" . org-capture) - ("C-c l" . org-store-link) - ("C-c p" . org-latex-export-to-pdf)) - :config - (progn - (custom-set-variables - '(org-log-done t) - '(org-hide-leading-stars t) - ) - (use-package org-bullets :ensure t) - (org-reload) - ) - ) -#+END_SRC - -*** flycheck - -Flycheck for on the fly checking of code. - -#+BEGIN_SRC emacs-lisp - (use-package flycheck - :ensure t - :init - (custom-set-variables '(flycheck-indication-mode 'left-fringe)) - :config - (add-hook 'prog-mode-hook 'flycheck-mode) - ) -#+END_SRC - -Need to vet this, used it more when I did more c. But its handy for non standard pkg-config -setups. - -Not tangled into the config intentionally. - -#+BEGIN_SRC emacs-lisp :tangle=no - (defun pkg-config-add-lib-cflags (pkg-config-lib) - "This function will add necessary header file path of a - specified by `pkg-config-lib' to `flycheck-clang-include-path', which make it - completionable by auto-complete-clang" - (interactive "spkg-config lib: ") - (if (executable-find "pkg-config") - (if (= (shell-command - (format "pkg-config %s" pkg-config-lib)) - 0) - (setq flycheck-clang-include-path - (append flycheck-clang-include-path - (split-string - (shell-command-to-string - (format "pkg-config --cflags-only-I %s" - pkg-config-lib))))) - (message "Error, pkg-config lib %s not found." pkg-config-lib)) - (message "Error: pkg-config tool not found."))) -#+END_SRC - -*** auto-complete - -Auto complete functionality is nice to have. - -#+BEGIN_SRC emacs-lisp - (use-package auto-complete - :ensure t - :init (progn (require 'auto-complete-config) - (ac-config-default) - (global-auto-complete-mode t) - )) -#+END_SRC - -*** smartparens - -Helpfully inserts matching parens, can be a pita too. - -#+BEGIN_SRC emacs-lisp - (use-package smartparens - :ensure t - :config - (add-hook 'prog-mode-hook 'smartparens-mode) - ) -#+END_SRC - -*** rainbow delimiters - -Makes matching parens easier. - -#+BEGIN_SRC emacs-lisp - (use-package rainbow-delimiters - :ensure t - :config - (add-hook 'prog-mode-hook 'rainbow-delimiters-mode) - ) -#+END_SRC - -*** uniquify - -Make buffer names unique based on their directory and not have or other nonsense. - -#+BEGIN_SRC emacs-lisp - (require 'uniquify) - (custom-set-variables '(uniquify-buffer-name-style 'post-forward)) -#+END_SRC - -*** desktop-save - -Desktop saving of session information handy to keep the same buffers between sessions. - -#+BEGIN_SRC emacs-lisp - (require 'desktop) - - (desktop-save-mode 1) - - (custom-set-variables - '(desktop-restore-eager 5) - '(desktop-path '("~/.emacs.d")) - '(desktop-dirname "~/.emacs.d") - '(desktop-base-file-name "desktop") - ) - - (defun local-desktop-save () - (interactive) - (if (eq (desktop-owner) (emacs-pid)) - (desktop-save desktop-dirname))) - - (add-hook 'auto-save-hook 'desktop-save-in-desktop-dir) -#+END_SRC - -*** fic-mode - -Highlight TODO/FIXME type messages in comments. - -#+BEGIN_SRC emacs-lisp - (use-package fic-mode - :ensure t - :init - (add-hook 'prog-mode-hook 'turn-on-fic-mode) - ) -#+END_SRC - -*** projectile - -#+BEGIN_SRC emacs-lisp - (use-package projectile - :ensure t - :init (projectile-global-mode) - :config - (progn (require 'helm-projectile) - (helm-projectile-on)) - ) -#+END_SRC - -*** git gutter - -#+BEGIN_SRC emacs-lisp - (use-package git-gutter - :ensure t - :config - (progn (global-git-gutter-mode t)) - ) -#+END_SRC - -*** clang-format - -#+BEGIN_SRC emacs-lisp - (use-package clang-format - :ensure t - :bind (([C-M-tab] . clang-format-region)) - ) -#+END_SRC - -*** hideshow - -#+BEGIN_SRC emacs-lisp - (use-package hideshow - :ensure t - :bind ("C-c s" . hs-toggle-hiding) - ) -#+END_SRC - -*** ggtags - -#+BEGIN_SRC emacs-lisp :tangle no - (use-package ggtags :ensure t) -#+END_SRC - -*** company-mode - -Completion tips. - -#+BEGIN_SRC emacs-lisp :tangle no - (use-package company-mode - :ensure t - :config - (progn (add-hook 'after-init-hook 'global-company-mode)) - ) -#+END_SRC - -*** yaml-mode - -For.. yaml - -#+BEGIN_SRC emacs-lisp - (use-package yaml-mode :ensure t) -#+END_SRC - -*** writegood-mode - -So I write gooder. Me fail English? Thats unpossible. - -#+BEGIN_SRC emacs-lisp - (use-package writegood-mode :ensure t) -#+END_SRC - -*** helm-gtags - -#+BEGIN_SRC emacs-lisp - (use-package helm-gtags :ensure t) -#+END_SRC - -*** python-mode - -Compress down python configuration a bit. - -#+BEGIN_SRC emacs-lisp - (use-package python - :commands python-mode - :mode ("\\.py\\'" . python-mode) - :ensure t - :init - (progn - (use-package jedi - :ensure t - :init - (progn - (jedi:install-server) - ) - :config - (progn - (custom-set-variables - '(jedi:complete-on-dot t) - '(jedi:install-imenu t) - ) - ) - :bind - (("M-." . jedi:goto-definition) - ("M-," . jedi:goto-definition-pop-marker) - ) - ) - (use-package company-anaconda - :ensure t - :config - (progn - (add-to-list 'company-backends 'company-anaconda) - (add-hook 'python-mode-hook 'anaconda-mode) - ) - ) - (use-package pytest - :ensure t - :bind ("C-c t" . pytest-one) - ) - (use-package pymacs :ensure t) - ) - :config - (progn - (add-hook 'python-mode-hook' - (lambda () - (jedi:setup) - (push '("lambda" . ?λ) prettify-symbols-alist) - (push '("<=" . ?≤) prettify-symbols-alist) - (push '(">=" . ?≥) prettify-symbols-alist) - (push '("==" . ?≡) prettify-symbols-alist) - (push '("/=" . ?≢) prettify-symbols-alist) - (push '("&&" . ?∧) prettify-symbols-alist) - (push '("||" . ?∨) prettify-symbols-alist) - (push '("not" . ?¬) prettify-symbols-alist) - (push '("None" . ?⊥) prettify-symbols-alist) - (prettify-symbols-mode) - ) - )) - ) -#+END_SRC - -*** haskell-mode - -Need to make haskell source be all pretty. - -#+BEGIN_SRC emacs-lisp - (use-package haskell-mode - :ensure t - :config - (progn - (use-package hindent - :if (executable-find "hindent") - :ensure t - :config - (progn - (add-hook 'haskell-mode-hook #'hindent-mode) - ) - ) - (use-package flycheck-haskell :ensure t) - (use-package flycheck-hdevtools - :ensure t - :config - (progn - (add-hook 'haskell-mode-hook 'flycheck-mode) - ) - ) - (use-package ghc - :if (executable-find "ghc-mod") - :ensure t - :config - (progn - (autoload 'ghc-init "ghc" nil t) - (autoload 'ghc-debug "ghc" nil t) - (add-hook 'haskell-mode-hook (lambda () - (ghc-init) - ) - ) - ) - ) - (add-hook 'haskell-mode-hook 'interactive-haskell-mode) - (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) - (custom-set-variables - '(haskell-program-name "ghci") - '(haskell-process-type 'cabal-repl) - '(haskell-tags-on-save t) - ) - (add-to-list 'completion-ignored-extensions ".hi") - (add-hook 'haskell-mode-hook' - (lambda () - (push '("()" . ?∅) prettify-symbols-alist) - (push '("\\" . ?λ) prettify-symbols-alist) - (push '("pi" . ?π) prettify-symbols-alist) - (push '("=>" . ?⇒) prettify-symbols-alist) - (push '("->" . ?→) prettify-symbols-alist) - (push '("<-" . ?←) prettify-symbols-alist) - (push '("<=" . ?≤) prettify-symbols-alist) - (push '(">=" . ?≥) prettify-symbols-alist) - (push '("==" . ?≡) prettify-symbols-alist) - (push '("/=" . ?≢) prettify-symbols-alist) - (push '("!!" . "‼") prettify-symbols-alist) - (push '("&&" . ?∧) prettify-symbols-alist) - (push '("||" . ?∨) prettify-symbols-alist) - (push '("~>" . ?⇝) prettify-symbols-alist) - (push '("-<" . ?↢) prettify-symbols-alist) - (push '("not" . ?¬) prettify-symbols-alist) - (push '("forall" . ?∀) prettify-symbols-alist) - (push '("sqrt" . ?√) prettify-symbols-alist) - (push '("undefined" . ?⊥) prettify-symbols-alist) - (push '("sqrt" . ?√) prettify-symbols-alist) - (prettify-symbols-mode) - ) - ) - ) - ) -#+END_SRC - -*** undo-tree - -Make undo more useful, and treelike. - -#+BEGIN_SRC emacs-lisp - (use-package undo-tree - :ensure t - :init - (progn (global-undo-tree-mode)) - :config - (progn (defadvice undo-tree-visualize (around undo-tree-split-side-by-side activate) - "Split undo-tree side-by-side" - (let ((split-height-threshold nil) - (split-width-threshold 0)) - ad-do-it) - ) - ) - :bind - ("C-x u" . undo-tree-visualize) - ) -#+END_SRC - -*** color-identifiers-mode - -Color variables for easy identification, its like a rainbow puked over everything opened in prog-mode-hook. - -#+BEGIN_SRC emacs-lisp - (use-package color-identifiers-mode - :ensure t - :config - (add-hook 'prog-mode-hook 'color-identifiers-mode) - ) -#+END_SRC - -*** nix-mode - -Instead of text might as well get a decent mode hook going here. - -#+BEGIN_SRC emacs-lisp - (use-package nix-mode :ensure t) -#+END_SRC - -* mode related -*** common defaults - -Common mode defaults I think are sensible. - -***** prog-mode hook - -#+BEGIN_SRC emacs-lisp - (add-hook 'prog-mode-hook - '(lambda () - (auto-complete-mode) ;; can't get this to work with use-package easily - (interactive) - (hl-line-mode) - (whitespace-mode) - (visual-line-mode) - (flyspell-prog-mode) - (custom-set-variables - '(indent-tabs-mode nil) - '(tab-width 2) - ) - ) - ) -#+END_SRC - -***** c - -#+BEGIN_SRC emacs-lisp - (add-to-list 'auto-mode-alist '("\\.[chm]\\'" . c-mode)) - (add-hook 'c-mode-common-hook - '(lambda () - (global-set-key "\C-x\C-m" 'compile) - (setq flycheck-clang-language-standard "c11") - (setq flycheck-idle-change-delay 2) - (setq flycheck-highlighting-mode 'symbols) - ;; later... - ;; (add-hook 'before-save-hook 'clang-format-buffer nil t) - (c-toggle-auto-state 1) - (setq-default c-basic-offset 2 - tab-width 2 - indent-tabs-mode nil - c-electric-flag t - indent-level 2 - c-default-style "bsd" - backward-delete-function nil) - )) -#+END_SRC - -***** elisp - -TODO: fixme - -#+BEGIN_SRC emacs-lisp :tangle no -(add-hook 'emacs-lisp-hook - (lambda () - (define-key emacs-lisp-map - "\C-x\C-e" 'pp-eval-last-sexp) - (define-key emacs-lisp-map - "\r" 'reindent-then-newline-and-indent))) -#+END_SRC - -***** python-mode - -#+BEGIN_SRC emacs-lisp - (add-hook 'python-mode-hook - '(lambda () - (flycheck-select-checker 'python-flake8) - (flycheck-select-checker 'python-pylint) - ) - ) - -#+END_SRC - -***** shell - -#+BEGIN_SRC emacs-lisp - (autoload 'sh--mode "sh-mode" "mode for shell stuff" t) - - (add-to-list 'auto-mode-alist '("\\.sh$\\'" . sh-mode)) - (add-to-list 'auto-mode-alist '("\\.[zk]sh$\\'" . sh-mode)) - (add-to-list 'auto-mode-alist '("\\.bash$\\'" . sh-mode)) - (add-to-list 'auto-mode-alist '("\\[.].*shrc$\\'" . sh-mode)) - (add-to-list 'auto-mode-alist '("sourceme$\\'" . sh-mode)) - - (add-hook 'sh-mode-hook - '(lambda () - (setq sh-basic-offset 2 sh-indentation 4 - sh-indent-for-case-label 0 sh-indent-for-case-alt '+))) -#+END_SRC - -***** perl - -#+BEGIN_SRC emacs-lisp - (fset 'perl-mode 'cperl-mode) - - (add-hook 'cperl-mode-hook - '(lambda () - (setq indent-tabs-mode t) - (setq tab-width 8) - (setq cperl-indent-level 4) - (setq tab-stop-list (number-sequence 4 200 4)) - (setq cperl-tab-always-indent t) - (setq cperl-indent-parens-as-block t) - ) - ) -#+END_SRC - -*** auto-insert-mode new file templates - -Use auto-insert-mode to insert in templates for blank files. - -So first up, add auto-insert to *find-file-hooks* so we insert straight away. Also setup the copyright bit to minimally put in name. - -#+BEGIN_SRC emacs-lisp - (add-hook 'find-file-hooks 'auto-insert) - (defvar auto-insert-copyright (user-full-name)) -#+END_SRC - -Create *auto-insert-alist* so all the mode lists are the same - -#+BEGIN_SRC emacs-lisp - (defvar auto-insert-alist '(())) -#+END_SRC - -***** c - -#+BEGIN_SRC emacs-lisp - (setq auto-insert-alist - (append - '( - ((c-mode . "c") - nil - "/*\n" - "File: " (file-name-nondirectory buffer-file-name) "\n" - "Copyright: " (substring (current-time-string) -4) " " auto-insert-copyright "\n" - "Description: " _ "\n" - "*/\n" - "#include \n" - "#include \n\n" - "int main(int argc, char **argv) {\n" - " return 0;\n" - "}\n" - ) - ) - auto-insert-alist) - ) -#+END_SRC - -***** elisp -#+BEGIN_SRC emacs-lisp - (setq auto-insert-alist - (append - '( - ((emacs-lisp-mode . "elisp") - nil - ";;-*-mode: emacs-lisp; coding: utf-8;-*-\n" - ";; File: " (file-name-nondirectory buffer-file-name) "\n" - ";; Copyright: " (substring (current-time-string) -4) " " auto-insert-copyright "\n" - ";; Description: " _ "\n" - ) - ) - auto-insert-alist) - ) -#+END_SRC - -***** python - -#+BEGIN_SRC emacs-lisp - (setq auto-insert-alist - (append - '(((python-mode . "python") - nil - "#!/usr/bin/env python\n" - "# -*-mode: Python; coding: utf-8;-*-\n" - "# File: " (file-name-nondirectory buffer-file-name) "\n" - "# Copyright: " (substring (current-time-string) -4) " " auto-insert-copyright "\n" - "# Description: " _ "\n\n" - ) - ) - auto-insert-alist) - ) -#+END_SRC - -***** shell - -#+BEGIN_SRC emacs-lisp - (setq auto-insert-alist - (append - '( - ((sh-mode . "sh") - nil - "#!/usr/bin/env sh\n" - "#-*-mode: Shell-script; coding: utf-8;-*-\n" - "# File: " (file-name-nondirectory buffer-file-name) "\n" - "# Copyright: " (substring (current-time-string) -4) " " auto-insert-copyright "\n" - "# Description: " _ "\n" - "export script=$(basename \"$0\")\n" - "export dir=$(cd \"$(dirname \"$0\")\"; pwd)\n" - "export iam=${dir}/${script}\n" - ) - ) - auto-insert-alist) - ) -#+END_SRC -* custom - -Load this up last to allow for local customization if needed and to keep from custom writing to the init.el file. - -#+BEGIN_SRC emacs-lisp - (setq custom-file "~/.emacs.d/custom.el") - (load custom-file 'noerror) -#+END_SRC diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el deleted file mode 100644 index a1fdc2c..0000000 --- a/emacs/.emacs.d/init.el +++ /dev/null @@ -1,5 +0,0 @@ -;;-*-mode: emacs-lisp; coding: utf-8;-*- -;; I'm normally just using recent emacs here, so a basic org mode is -;; already installed. Makes this even simpler. -(require 'org) -(org-babel-load-file "~/.emacs.d/emacs.org") diff --git a/emacs/.profile.d/99-alias-emacs.sh b/emacs/.profile.d/99-alias-emacs.sh deleted file mode 100644 index 2e7c4d9..0000000 --- a/emacs/.profile.d/99-alias-emacs.sh +++ /dev/null @@ -1,8 +0,0 @@ -# emacs/.profile.d/99-alias-emacs.sh -alias e=emacs -alias de=emacs --debug-init -nw -alias ec=emacsclient -alias ect=emacsclient -t -alias oec=emacsclient -n -c -alias stope=emacsclient -t -e "(save-buffers-kill-emacs)(kill-emacs)" -alias kille=emacsclient -e "(kill-emacs)" diff --git a/etangle b/etangle index 91ff656..dd3fce6 100755 --- a/etangle +++ b/etangle @@ -1,3 +1,5 @@ +;;-*-mode: emacs-lisp; coding: utf-8;-*- +;; Copyright: 2016 Mitchell Tishmack ;; Tangle an org mode file with babel using emacs. (let ((default-directory "~/.emacs.d")) (normal-top-level-add-subdirs-to-load-path)) diff --git a/options.el b/options.el index 8522a44..6c260e4 100644 --- a/options.el +++ b/options.el @@ -21,4 +21,3 @@ ;; Language specific (setq haskell-p nil) (setq perl-p nil) -(setq ruby-p nil) diff --git a/osx.el b/osx.el index fd38aec..a9e5b96 100644 --- a/osx.el +++ b/osx.el @@ -21,4 +21,3 @@ ;; Language specific (setq haskell-p t) (setq perl-p t) -(setq ruby-p nil) diff --git a/readme.org b/readme.org index bcffe93..2b952f5 100644 --- a/readme.org +++ b/readme.org @@ -1,17 +1,17 @@ -#+TITLE: Dotfiles Everywhere +#+TITLE: My Solution To Dotfile Management #+AUTHOR: Mitch Tishmack #+STARTUP: hidestars #+STARTUP: odd #+BABEL: :cache yes -#+PROPERTY: header-args :tangle yes :comments no :padline no +#+PROPERTY: header-args :tangle yes :cache yes :comments no :padline no In the long long ago (2015), I used xstow and update-dotdee to construct my dotfiles from tiny pieces of files. -I have since evolved to this setup. Originally the intention was to make it easy -for me to compile dotfiles based on certain parameters. Aka, my dotfiles are the -same for x, y, and z, whatever those are, but for certain cases z should have -one section be different or added etc... as the case may be. +I have since evolved to this setup. Originally the intention was to make it +easy for me to compile dotfiles based on certain parameters. Aka, my dotfiles +are the same for x, y, and z, whatever those are, but for certain cases z +should have one section be different or added etc... as the case may be. Aka it was just a glorified program or templating system. @@ -20,34 +20,57 @@ why not just do the same for the dotfiles. Bonus, now I can have ALL my dotfiles in one logical file that can build itself. So now if you want to look at my dotfiles, they're all in here. With one -caveat that my emacs configuration is not. That is still separate, I might -change that at some point in the future, but that day is not today. +caveat that my emacs configuration is not. That is still separate. Mostly +because it is large enough that it can be on its own. -* Use +* Use/Abuse -Use of this setup is simple. There really is one step: -- make +Use of this setup is simple. There really is one step in general: -??? HOW ??? +#+BEGIN_SRC sh :tangle no + make +#+END_SRC + +But lets say you want to export things to another directory than $HOME. No +worries, just specify DEST: + +#+BEGIN_SRC sh :tangle no + make DEST=/some/other/directory +#+END_SRC + +But wait, what if you want to export things for an os you're not using? No +worries, just copy options.el to name.el and specify that as OPTIONS too: + +#+BEGIN_SRC sh :tangle no + make DEST=/some/other/directory OPTIONS=osx +#+END_SRC -Well the Makefile is pretty basic, start there. But generally here is how -the sausage is being made. +Want to copy a specific generation to somewhere else? Or maybe you tested +installing to some DEST, and want to copy that to $HOME? No worries: -There are a couple helper scripts: -- etangle, aka emacs tangle, which is just a wrapper around emacs+org for - the commandline/makefile to use. -- ddiff, a rather stupid shell script that recursively diffs directory a - to directory b, ignoring files that do not exist in directory b but - exist in a (aka new files). +#+BEGIN_SRC sh :tangle no + make copy GEN=N +#+END_SRC + +Where N is the generation you want to copy. + +** How does it work? + +It is really rather simple, the makefile isn't that complex. Look at that +for details. -NOTE: Removal of files is YOUR job, not this thing. One could +This isn't intended to cover everything. This could be considered a template +for how you could setup your files in a similar way. Look at this org mode +file for details. + +NOTE: Removal of files is YOUR job, not this tools. One could theoretically look at what changed between two generations and -remove that. BUT that sounds janky and error prone. Removal of +remove that way. BUT that sounds janky and error prone. Removal of files is the users job, not this setup. ** Explanation of what is happening -The prelude controls org variables that change how files get tangled to files. +The file options.el controls predicates that change how files get tangled to files. This allows me to tangle files that would be useful for linux/bsd/etc... without affecting the existing files. @@ -66,7 +89,49 @@ The general idea is this (look at Makefile for details): Note, the destination can be anywhere, not just $HOME. This allows one to compile/tangle files that can then be trivially rsynced to remote machines, or to tar/xz the files as needed. The key here is emacs is only required -to generate config files. +to generate config files, not necessarily to use them. + +** How would I use this? + +Should be easy enough to either clone this repo or copy things to a new repo +and hack in what you need. Your call. + +But, say you have a heading, take .profile which comes up next, under the +heading you would just add: + +#+BEGIN_SRC org :tangle no + :PROPERTIES: + :header-args: :tangle tmp/.profile :comments no :padline no :cache yes :mkdirp yes + :END: +#+END_SRC + +Then any source blocks for that heading will go to tmp/.profile. Its important +that you put everything into ./tmp! This is used to generate things before a +generation is built. It gives the Makefile a chance to know if the tangling +worked or not. + +But lets say you don't need to have lots of sub headings, or even control +a file in multiple subparts that have predicates to control things. + +Pretty simple, just add a source block like normal: +#+BEGIN_SRC org :tangle no + ,#+BEGIN_SRC conf :tangle tmp/.example.conf + put contents here! + ,#+END_SRC + + +#+END_SRC + +** TODO +- [ ] Auto load-file options.el to make code blocks editable in their major +modes. +- [ ] Need to have some way to autocleanup old generations. Rm works for now +so meh. +- [ ] Need to add the ability to detect that make is generating a pointless +new generation. Aka generation N and generation N-1 are the same, just leave +N and don't increment. +- [ ] Maybe checksum file contents somehow and use that? +- [ ] More? For now its functional. * ~/.profile :PROPERTIES: @@ -76,14 +141,14 @@ to generate config files. ** PS1 #+BEGIN_SRC sh -# -*- mode: Shell-script; -*- -# Common .profile -# -# DO NOT EDIT, managed by org mode -_uname=$(uname) -_uname_n=$(uname -n) -_hostname=$(hostname) -export _uname _uname_n _hostname + # -*- mode: Shell-script; -*- + # Common .profile + # + # DO NOT EDIT, managed by org mode + _uname=$(uname) + _uname_n=$(uname -n) + _hostname=$(hostname) + export _uname _uname_n _hostname #+END_SRC OSX uses hostname -s for getting hostname @@ -391,6 +456,14 @@ if [ $? -eq 0 ]; then else alias T="\$(which tail) -f" fi + +alias e=emacs +alias de=emacs --debug-init -nw +alias ec=emacsclient +alias ect=emacsclient -t +alias oec=emacsclient -n -c +alias stope=emacsclient -t -e "(save-buffers-kill-emacs)(kill-emacs)" +alias kille=emacsclient -e "(kill-emacs)" #+END_SRC *** osx @@ -1447,7 +1520,7 @@ cal.each do |line| end #+END_SRC -* Git +* git ** ~/.gitconfig General git configuration. @@ -1539,7 +1612,7 @@ Common crap/build artifacts that git should always ignore. *.hi #+END_SRC -* X +* x ** ~/.Xdefaults X defaults, just urxvt for the moment. Slightly linux/bsd only but not really. @@ -1625,7 +1698,7 @@ I can't remember why I did all this effort. But I'll remove it some year I bet. *color14: brightcyan *color15: #f9f9f9 #+END_SRC -* Zsh +* zsh ** ~/.zprofile Make sure that zsh sources ~/.profile correctly on login. @@ -1815,7 +1888,7 @@ PROMPT="%(!.#.$) " # $ as a user # as root RPROMPT='${vcs_info_msg_0_} ${PWD/#$HOME/~}' #+END_SRC -* Tmux +* tmux ** ~/.tmux.conf Tmux configuration. Pretty boring in most ways. @@ -1973,7 +2046,7 @@ bind C-y run "tmux save-buffer - | xclip -i" # set-option -g status-right-length 55; \ # set-option -g status-right '#(rainbarf --remaining --bolt --bright --width 25) %a %H:%M:%S'; " #+END_SRC -* Vim +* vim ** ~/.vimrc What remains of my days from being a vim user. diff --git a/ruby/.gemrc b/ruby/.gemrc deleted file mode 100644 index 22fd901..0000000 --- a/ruby/.gemrc +++ /dev/null @@ -1,2 +0,0 @@ -install: --no-ri --no-rdoc -update: --no-ri --no-rdoc diff --git a/ruby/.maid/rules.rb b/ruby/.maid/rules.rb deleted file mode 100755 index caddc11..0000000 --- a/ruby/.maid/rules.rb +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env ruby -#-*-mode: Ruby; coding: utf-8;-*- -require 'time' - -Maid.rules do - RUN_TIME = Time.now - DAY_SECONDS = 60 * 60 * 24 - WEEK = DAY_SECONDS * 7 - ONE_WEEK_AGO = (RUN_TIME - WEEK) - TWO_WEEKS_AGO = (RUN_TIME - WEEK * 2) - THREE_MONTHS_AGO = (RUN_TIME - (DAY_SECONDS * 93)) - - # Nuke crap > say 2 weeks should be fine. - def clean_download_dir - dir('~/Downloads/*').each do |path| - trash path if File.mtime(path) < TWO_WEEKS_AGO - end - end - - case %x/uname -s/.chomp - when 'Darwin' - rule '/Library/Caches/Homebrew/' do - dir('/Library/Caches/Homebrew/*.tar.*').each do |path| - trash path if File.mtime(path) < THREE_MONTHS_AGO - end - dir('/Library/Caches/Homebrew/*.tgz').each do |path| - trash path if File.mtime(path) < THREE_MONTHS_AGO - end - dir('/Library/Caches/Homebrew/*.tbz').each do |path| - trash path if File.mtime(path) < THREE_MONTHS_AGO - end - dir('/Library/Caches/Homebrew/*.bz2').each do |path| - trash path if File.mtime(path) < THREE_MONTHS_AGO - end - dir('/Library/Caches/Homebrew/*.gz').each do |path| - trash path if File.mtime(path) < THREE_MONTHS_AGO - end - dir('/Library/Caches/Homebrew/*.xz').each do |path| - trash path if File.mtime(path) < THREE_MONTHS_AGO - end - end - - rule '~/Downloads' do - clean_download_dir - end - - rule '~/Library/Caches' do - dir('~/Library/Caches/Google/Chrome/Default/Cache/*').each do |path| - trash path if File.mtime(path) < THREE_MONTHS_AGO - end - dir('~/Library/Caches/Google/Chrome/PnaclTranslationCache/*').each do |path| - trash path if File.mtime(path) < THREE_MONTHS_AGO - end - dir('~/Library/Caches/Firefox/Profiles/*.default/Cache/*').each do |path| - trash path if File.mtime(path) < THREE_MONTHS_AGO - end - end - when 'Linux' - rule 'Clean Download dir' do - clean_download_dir - end - end -end diff --git a/ruby/.profile.d/99-alias-ruby.sh b/ruby/.profile.d/99-alias-ruby.sh deleted file mode 100644 index c2d08aa..0000000 --- a/ruby/.profile.d/99-alias-ruby.sh +++ /dev/null @@ -1,2 +0,0 @@ -# ruby/.profile.d/99-alias-ruby.sh -alias r=ruby diff --git a/ruby/.pryrc b/ruby/.pryrc deleted file mode 100644 index b30361d..0000000 --- a/ruby/.pryrc +++ /dev/null @@ -1,19 +0,0 @@ -#-*-mode: Ruby; coding: utf-8;-*- - -Pry.config.prompt = [ - proc {|obj, nesting, _| - nesting == 0 ? "#{obj}> " : "#{obj}:#{nesting}> " - }, - proc {''} - ] - -def load_pry_debugstuff - if Gem::Specification::find_all_by_name('pry-debugger').size > 0 - require 'pry-debugger' - Pry.commands.alias_command 'c', 'continue' - Pry.commands.alias_command 's', 'step' - Pry.commands.alias_command 'n', 'next' - end -end - -load_pry_debugstuff