From a86c2ddece8fde8a42f1e6031b189d1865b9b211 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Wed, 18 Jul 2018 19:53:53 -0400 Subject: Prefer stow over hand-rolled solution After discovering GNU stow on Nix IRC, refactored install and setup scripts to consume it. Code is vastly simplified as a result. --- configs/linux/.xinitrc | 1 - configs/linux/xinit/.xinitrc | 1 + configs/os_x/.slate.js | 123 ------------------------------------------ configs/os_x/slate/.slate.js | 123 ++++++++++++++++++++++++++++++++++++++++++ configs/setup | 44 ++------------- configs/shared/.ctags | 104 ----------------------------------- configs/shared/.gitconfig | 21 -------- configs/shared/.gitignore | 2 - configs/shared/.zshrc | 10 ---- configs/shared/ctags/.ctags | 104 +++++++++++++++++++++++++++++++++++ configs/shared/ghci | 13 ----- configs/shared/git/.gitconfig | 21 ++++++++ configs/shared/git/.gitignore | 2 + configs/shared/haskell/.ghci | 32 +++++++++++ configs/shared/zsh/.zshrc | 13 +++++ install.sh | 6 +-- 16 files changed, 303 insertions(+), 317 deletions(-) delete mode 100644 configs/linux/.xinitrc create mode 100644 configs/linux/xinit/.xinitrc delete mode 100644 configs/os_x/.slate.js create mode 100644 configs/os_x/slate/.slate.js delete mode 100644 configs/shared/.ctags delete mode 100644 configs/shared/.gitconfig delete mode 100644 configs/shared/.gitignore delete mode 100644 configs/shared/.zshrc create mode 100644 configs/shared/ctags/.ctags delete mode 100644 configs/shared/ghci create mode 100644 configs/shared/git/.gitconfig create mode 100644 configs/shared/git/.gitignore create mode 100644 configs/shared/haskell/.ghci create mode 100644 configs/shared/zsh/.zshrc diff --git a/configs/linux/.xinitrc b/configs/linux/.xinitrc deleted file mode 100644 index a0e8dea3a363..000000000000 --- a/configs/linux/.xinitrc +++ /dev/null @@ -1 +0,0 @@ -startkde diff --git a/configs/linux/xinit/.xinitrc b/configs/linux/xinit/.xinitrc new file mode 100644 index 000000000000..a0e8dea3a363 --- /dev/null +++ b/configs/linux/xinit/.xinitrc @@ -0,0 +1 @@ +startkde diff --git a/configs/os_x/.slate.js b/configs/os_x/.slate.js deleted file mode 100644 index e097d935faff..000000000000 --- a/configs/os_x/.slate.js +++ /dev/null @@ -1,123 +0,0 @@ -// Support flag to branch KBDs depending on presence of Ergodox keyboard. - -// Since the Ergodox has complicated modifier keys like "hyper" and "meh" key, -// we should prefer to use these when that keyboard is attached because it -// reduces the potential for collisions for Emacs KBDs. This becomes -// problematic, however, when the Ergodox is not attached because these keys are -// unavailable. Slate KBDs. Under these circumstances, potential collisions -// with Emacs KBDs is acceptable. - -var ergodox_attached = true; - -var HYPER = ":alt;shift;cmd;ctrl"; -var MEH = ":alt;shift;ctrl"; - -var modal_key = ergodox_attached ? HYPER : ":ctrl;shift"; -var resize_key = ergodox_attached ? MEH : ":alt;shift"; - -// Configs -S.cfga({ - defaultToCurrentScreen: true, - secondsBetweenRepeat: 0.1, - checkDefaultsOnLoad: true, - focusCheckWidthMax: 3000 -}); - -// window resizing bindings -var window_resizing_bindings = { - ";": { - x: "screenSizeX/3*2 + screenOriginX+20", - y: "screenOriginY+20", - width: "screenSizeX/3 - 40", - height: "screenSizeY-100" - }, - g: { - x: "screenOriginX+20", - y: "screenOriginY+20", - width: "screenSizeX/3*2 - 40", - height: "screenSizeY-100" - }, - o: { - x: "screenSizeX / 2 + screenOriginX + 20", - y: "screenOriginY + 20", - width: "screenSizeX / 2 - 40", - height: "(screenSizeY - 120) / 2" - }, - ",": { - x: "screenSizeX / 2 + screenOriginX + 20", - y: "(screenSizeY - 120) / 2 + 20 + 20", - width: "screenSizeX / 2 - 40", - height: "(screenSizeY - 120) / 2" - }, - h: { - x: "screenOriginX+20", - y: "screenOriginY+20", - width: "screenSizeX*0.5 - 40", - height: "screenSizeY-100" - }, - j: { - x: "screenOriginX+screenSizeX/6", - y: "screenOriginY+20", - width: "2*screenSizeX/3", - height: "screenSizeY - 100" - }, - k: { - x: "screenOriginX+20", - y: "screenOriginY+20", - width: "screenSizeX - 40", - height: "screenSizeY - 100" - }, - l: { - x: "screenSizeX/2 + screenOriginX+20", - y: "screenOriginY+20", - width: "screenSizeX*0.5 - 40", - height: "screenSizeY-100" - } -}; - -var window_resizing_bindings = Object.keys(window_resizing_bindings).reduce( - function(acc, kbd) { - acc[kbd + resize_key] = S.op("move", window_resizing_bindings[kbd]); - return acc; - }, - {} -); - -S.bnda(window_resizing_bindings); - -// Moves applications across multiple screens -var throwLeft = slate.operation("throw", { - screen: "0", - width: "screenSizeX", - height: "screenSizeY" -}); -var throwRight = slate.operation("throw", { - screen: "1", - width: "screenSizeX", - height: "screenSizeY" -}); - -slate.bind("1:ctrl", throwLeft); -slate.bind("2:ctrl", throwRight); - -var focus_apps = { - 1: "1Password", - i: "iTunes", - a: "Atom", - h: "Dash", - e: "Emacs", - t: "iTerm2", - m: "Messages", - s: "Spotify", - c: "Google Chrome", - l: "LimeChat", - k: "Slack", - w: "Wireshark", - p: "Tomato One", - d: "Discord" -}; - -Object.keys(focus_apps).forEach(function(key) { - app = focus_apps[key]; - S.bind(key + modal_key, S.op("focus", { app: app })); -}); diff --git a/configs/os_x/slate/.slate.js b/configs/os_x/slate/.slate.js new file mode 100644 index 000000000000..e097d935faff --- /dev/null +++ b/configs/os_x/slate/.slate.js @@ -0,0 +1,123 @@ +// Support flag to branch KBDs depending on presence of Ergodox keyboard. + +// Since the Ergodox has complicated modifier keys like "hyper" and "meh" key, +// we should prefer to use these when that keyboard is attached because it +// reduces the potential for collisions for Emacs KBDs. This becomes +// problematic, however, when the Ergodox is not attached because these keys are +// unavailable. Slate KBDs. Under these circumstances, potential collisions +// with Emacs KBDs is acceptable. + +var ergodox_attached = true; + +var HYPER = ":alt;shift;cmd;ctrl"; +var MEH = ":alt;shift;ctrl"; + +var modal_key = ergodox_attached ? HYPER : ":ctrl;shift"; +var resize_key = ergodox_attached ? MEH : ":alt;shift"; + +// Configs +S.cfga({ + defaultToCurrentScreen: true, + secondsBetweenRepeat: 0.1, + checkDefaultsOnLoad: true, + focusCheckWidthMax: 3000 +}); + +// window resizing bindings +var window_resizing_bindings = { + ";": { + x: "screenSizeX/3*2 + screenOriginX+20", + y: "screenOriginY+20", + width: "screenSizeX/3 - 40", + height: "screenSizeY-100" + }, + g: { + x: "screenOriginX+20", + y: "screenOriginY+20", + width: "screenSizeX/3*2 - 40", + height: "screenSizeY-100" + }, + o: { + x: "screenSizeX / 2 + screenOriginX + 20", + y: "screenOriginY + 20", + width: "screenSizeX / 2 - 40", + height: "(screenSizeY - 120) / 2" + }, + ",": { + x: "screenSizeX / 2 + screenOriginX + 20", + y: "(screenSizeY - 120) / 2 + 20 + 20", + width: "screenSizeX / 2 - 40", + height: "(screenSizeY - 120) / 2" + }, + h: { + x: "screenOriginX+20", + y: "screenOriginY+20", + width: "screenSizeX*0.5 - 40", + height: "screenSizeY-100" + }, + j: { + x: "screenOriginX+screenSizeX/6", + y: "screenOriginY+20", + width: "2*screenSizeX/3", + height: "screenSizeY - 100" + }, + k: { + x: "screenOriginX+20", + y: "screenOriginY+20", + width: "screenSizeX - 40", + height: "screenSizeY - 100" + }, + l: { + x: "screenSizeX/2 + screenOriginX+20", + y: "screenOriginY+20", + width: "screenSizeX*0.5 - 40", + height: "screenSizeY-100" + } +}; + +var window_resizing_bindings = Object.keys(window_resizing_bindings).reduce( + function(acc, kbd) { + acc[kbd + resize_key] = S.op("move", window_resizing_bindings[kbd]); + return acc; + }, + {} +); + +S.bnda(window_resizing_bindings); + +// Moves applications across multiple screens +var throwLeft = slate.operation("throw", { + screen: "0", + width: "screenSizeX", + height: "screenSizeY" +}); +var throwRight = slate.operation("throw", { + screen: "1", + width: "screenSizeX", + height: "screenSizeY" +}); + +slate.bind("1:ctrl", throwLeft); +slate.bind("2:ctrl", throwRight); + +var focus_apps = { + 1: "1Password", + i: "iTunes", + a: "Atom", + h: "Dash", + e: "Emacs", + t: "iTerm2", + m: "Messages", + s: "Spotify", + c: "Google Chrome", + l: "LimeChat", + k: "Slack", + w: "Wireshark", + p: "Tomato One", + d: "Discord" +}; + +Object.keys(focus_apps).forEach(function(key) { + app = focus_apps[key]; + S.bind(key + modal_key, S.op("focus", { app: app })); +}); diff --git a/configs/setup b/configs/setup index e81b49442f42..7b7a814908a3 100755 --- a/configs/setup +++ b/configs/setup @@ -1,47 +1,11 @@ #!/usr/bin/env bash -dotfiles_path="${HOME}/dotfiles" -configs_dir="${dotfiles_path}/configs" -shared_configs="${configs_dir}/shared" +configs="$HOME/dotfiles/configs" if [[ $(uname) == 'Darwin' ]]; then - os_specific_configs="${configs_dir}/os_x" + (cd "$configs/os_x" && stow --target="$HOME" *) elif [[ $(uname) == 'Linux' ]]; then - os_specific_configs="${configs_dir}/linux" + (cd "$configs/linux" && stow --target="$HOME" *) fi - -function symlink_configs () { - configs_dir=$1 - - for cf in $(find $configs_dir -type f -name ".*"); do - filename=$(grep -o "[^\/]+$" <<<$cf) - echo "$filename: " - - if [ -f "${HOME}/${filename}" ] && [ ! -L "${HOME}/${filename}" ]; then - echo -n "Backing up ${filename}... " && \ - mv "${HOME}/${filename}" "${HOME}/${filename}.bak" && \ - echo "Done." - fi - - if [ -L "${HOME}/${filename}" ]; then - if [ $(readlink "${HOME}/${filename}") = $cf ]; then - echo "Already properly symlinked to ${configs_dir}." - else - echo "Already symlinked but NOT to the proper location. Aborting..." - fi - else - echo -n "Symlinking to ${filename}... " && \ - ln -s $cf "${HOME}/${filename}" && \ - echo "Done." - fi - echo "" - done -} - - -# handle shared configs -symlink_configs $shared_configs - -# handle os-specific configs -symlink_configs $os_specific_configs +(cd "$configs/shared" && stow --target="$HOME" *) diff --git a/configs/shared/.ctags b/configs/shared/.ctags deleted file mode 100644 index c018567f2041..000000000000 --- a/configs/shared/.ctags +++ /dev/null @@ -1,104 +0,0 @@ ---recurse=yes ---exclude=.git ---exclude=vendor/ ---exclude=node_modules ---exclude=db ---exclude=log ---exclude=tmp - - ---langdef=Elixir ---langmap=Elixir:.ex.exs ---regex-Elixir=/^[ \t]*def(p?)[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\2/f,functions,functions (def ...)/ ---regex-Elixir=/^[ \t]*defcallback[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/c,callbacks,callbacks (defcallback ...)/ ---regex-Elixir=/^[ \t]*defdelegate[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/d,delegates,delegates (defdelegate ...)/ ---regex-Elixir=/^[ \t]*defexception[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/e,exceptions,exceptions (defexception ...)/ ---regex-Elixir=/^[ \t]*defimpl[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/i,implementations,implementations (defimpl ...)/ ---regex-Elixir=/^[ \t]*defmacro(p?)[ \t]+([a-z_][a-zA-Z0-9_?!]*)\(/\2/a,macros,macros (defmacro ...)/ ---regex-Elixir=/^[ \t]*defmacro(p?)[ \t]+([a-zA-Z0-9_?!]+)?[ \t]+([^ \tA-Za-z0-9_]+)[ \t]*[a-zA-Z0-9_!?!]/\3/o,operators,operators (e.g. "defmacro a <<< b")/ ---regex-Elixir=/^[ \t]*defmodule[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/m,modules,modules (defmodule ...)/ ---regex-Elixir=/^[ \t]*defprotocol[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/p,protocols,protocols (defprotocol...)/ ---regex-Elixir=/^[ \t]*Record\.defrecord[ \t]+:([a-zA-Z0-9_]+)/\1/r,records,records (defrecord...)/ ---regex-Elixir=/^[ \t]*test[ \t]+\"([a-z_][a-zA-Z0-9_?! ]*)\"*/\1/t,tests,tests (test ...)/ - - ---regex-ruby=/.*alias(_method)?[[:space:]]+:([[:alnum:]_=!?]+),?[[:space:]]+:([[:alnum:]_=!]+)/\2/f,function/ ---regex-ruby=/(^|[:;])[ \t]*([A-Z][[:alnum:]_]+) *=/\2/c,class,constant/ ---regex-ruby=/(^|;)[ \t]*(has_many|belongs_to|has_one|has_and_belongs_to_many)\(? *:([[:alnum:]_]+)/\3/f,function,association/ ---regex-ruby=/(^|;)[ \t]*(named_)?scope\(? *:([[:alnum:]_]+)/\3/f,function,named_scope/ ---regex-ruby=/(^|;)[ \t]*expose\(? *:([[:alnum:]_]+)/\2/f,function,exposure/ ---regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2/f,function,aasm_event/ ---regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2!/f,function,aasm_event/ ---regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2?/f,function,aasm_event/ - ---langmap=Ruby:+(Rakefile) - ---langdef=js ---langmap=js:.js ---langmap=js:+.jsx - ---regex-js=/[ \t.]([A-Z][A-Z0-9._$]+)[ \t]*[=:][ \t]*([0-9"'\[\{]|null)/\1/n,constant/ - ---regex-js=/\.([A-Za-z0-9._$]+)[ \t]*=[ \t]*\{/\1/o,object/ ---regex-js=/['"]*([A-Za-z0-9_$]+)['"]*[ \t]*:[ \t]*\{/\1/o,object/ ---regex-js=/([A-Za-z0-9._$]+)\[["']([A-Za-z0-9_$]+)["']\][ \t]*=[ \t]*\{/\1\.\2/o,object/ - ---regex-js=/([A-Za-z0-9._$]+)[ \t]*=[ \t]*\(function\(\)/\1/c,class/ ---regex-js=/['"]*([A-Za-z0-9_$]+)['"]*:[ \t]*\(function\(\)/\1/c,class/ ---regex-js=/class[ \t]+([A-Za-z0-9._$]+)[ \t]*/\1/c,class/ ---regex-js=/([A-Za-z$][A-Za-z0-9_$()]+)[ \t]*=[ \t]*[Rr]eact.createClass[ \t]*\(/\1/c,class/ ---regex-js=/([A-Z][A-Za-z0-9_$]+)[ \t]*=[ \t]*[A-Za-z0-9_$]*[ \t]*[{(]/\1/c,class/ ---regex-js=/([A-Z][A-Za-z0-9_$]+)[ \t]*:[ \t]*[A-Za-z0-9_$]*[ \t]*[{(]/\1/c,class/ - ---regex-js=/([A-Za-z$][A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\1/f,function/ - ---regex-js=/(function)*[ \t]*([A-Za-z$_][A-Za-z0-9_$]+)[ \t]*\([^)]*\)[ \t]*\{/\2/f,function/ ---regex-js=/['"]*([A-Za-z$][A-Za-z0-9_$]+)['"]*:[ \t]*function[ \t]*\(/\1/m,method/ ---regex-js=/([A-Za-z0-9_$]+)\[["']([A-Za-z0-9_$]+)["']\][ \t]*=[ \t]*function[ \t]*\(/\2/m,method/ - - ---langdef=haskell ---langmap=haskell:.hs ---regex-haskell=/^module[ \t]*([A-Z][a-zA-Z0-9'_.]*)/\1/m,module/ ---regex-haskell=/^(new)?type[ \t]*([A-Z][a-zA-Z0-9'_]*)./\2/t,type/ ---regex-haskell=/^class[ \t]*([A-Z][a-zA-Z0-9'_]*)/\1/c,class/ ---regex-haskell=/^data[ \t]*([A-Z][a-zA-Z0-9'_]*)/\1/d,data/ ---regex-haskell=/^([a-z_][a-zA-Z0-9'_]*).*=/\1/v,function/ - ---langmap=C++:+.mm - ---langdef=golang ---langmap=golang:.go ---regex-golang=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/d,func/ ---regex-golang=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,var/ ---regex-golang=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,type/ - ---langdef=Rust ---langmap=Rust:.rs ---regex-Rust=/^[ \t]*(#\[[^\]]\][ \t]*)*(pub[ \t]+)?(extern[ \t]+)?("[^"]+"[ \t]+)?(unsafe[ \t]+)?fn[ \t]+([a-zA-Z0-9_]+)/\6/f,functions,function definitions/ ---regex-Rust=/^[ \t]*(pub[ \t]+)?type[ \t]+([a-zA-Z0-9_]+)/\2/T,types,type definitions/ ---regex-Rust=/^[ \t]*(pub[ \t]+)?enum[ \t]+([a-zA-Z0-9_]+)/\2/g,enum,enumeration names/ ---regex-Rust=/^[ \t]*(pub[ \t]+)?struct[ \t]+([a-zA-Z0-9_]+)/\2/s,structure names/ ---regex-Rust=/^[ \t]*(pub[ \t]+)?mod[ \t]+([a-zA-Z0-9_]+)/\2/m,modules,module names/ ---regex-Rust=/^[ \t]*(pub[ \t]+)?static[ \t]+([a-zA-Z0-9_]+)/\2/c,consts,static constants/ ---regex-Rust=/^[ \t]*(pub[ \t]+)?trait[ \t]+([a-zA-Z0-9_]+)/\2/t,traits,traits/ ---regex-Rust=/^[ \t]*(pub[ \t]+)?impl([ \t\n]*<[^>]*>)?[ \t]+(([a-zA-Z0-9_:]+)[ \t]*(<[^>]*>)?[ \t]+(for)[ \t]+)?([a-zA-Z0-9_]+)/\4 \6 \7/i,impls,trait implementations/ ---regex-Rust=/^[ \t]*macro_rules![ \t]+([a-zA-Z0-9_]+)/\1/d,macros,macro definitions/ - ---langdef=typescript ---langmap=typescript:.ts ---regex-typescript=/^[ \t]*(export)?[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\2/c,classes/ ---regex-typescript=/^[ \t]*(export)?[ \t]*module[ \t]+([a-zA-Z0-9_]+)/\2/n,modules/ ---regex-typescript=/^[ \t]*(export)?[ \t]*function[ \t]+([a-zA-Z0-9_]+)/\2/f,functions/ ---regex-typescript=/^[ \t]*export[ \t]+var[ \t]+([a-zA-Z0-9_]+)/\1/v,variables/ ---regex-typescript=/^[ \t]*var[ \t]+([a-zA-Z0-9_]+)[ \t]*=[ \t]*function[ \t]*\(\)/\1/v,varlambdas/ ---regex-typescript=/^[ \t]*(export)?[ \t]*(public|private)[ \t]+(static)?[ \t]*([a-zA-Z0-9_]+)/\4/m,members/ ---regex-typescript=/^[ \t]*(export)?[ \t]*interface[ \t]+([a-zA-Z0-9_]+)/\2/i,interfaces/ ---regex-typescript=/^[ \t]*(export)?[ \t]*enum[ \t]+([a-zA-Z0-9_]+)/\2/e,enums/ ---regex-typescript=/^[ \t]*import[ \t]+([a-zA-Z0-9_]+)/\1/I,imports/ - ---langdef=elm ---langmap=elm:.elm ---regex-elm=/^module[ \t]*([A-Z][a-zA-Z0-9'_.]*)/\1/m,module/ ---regex-elm=/^type[ \t]*([A-Z][a-zA-Z0-9'_]*)./\1/t,type/ ---regex-elm=/^([a-z_][a-zA-Z0-9'_]*).*=/\1/v,function/ diff --git a/configs/shared/.gitconfig b/configs/shared/.gitconfig deleted file mode 100644 index e6d0e7b9bc47..000000000000 --- a/configs/shared/.gitconfig +++ /dev/null @@ -1,21 +0,0 @@ -[user] - name = William Carroll - email = wpcarro@gmail.com -[alias] - recent = for-each-ref --count=10 --sort=-committerdate refs/heads/ --format=\"%(refname:short)\" - today = ! git log --date=relative --since=00:00:00 --all --no-merges --oneline --author=\"$(git config --get user.email)\" - changed-files = ! git --no-pager diff --name-only $(current_branch) $(git merge-base $(current_branch) master) - conflicts = ! git --no-pager diff --name-only --diff-filter=U - yday = ! git log --name-only --since=yesterday.midnight --until=today.midnight --author=\"$(git config --get user.email)\" - patch-grep = log -p -S -[credential] - helper = osxkeychain -[push] - default = current -[rebase] - autosquash = true - autostash = true -[github] - user = wpcarro -[core] - excludesfile = ~/.gitignore diff --git a/configs/shared/.gitignore b/configs/shared/.gitignore deleted file mode 100644 index 0d9002511ec2..000000000000 --- a/configs/shared/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Mac -.DS_Store diff --git a/configs/shared/.zshrc b/configs/shared/.zshrc deleted file mode 100644 index f18ef365edbf..000000000000 --- a/configs/shared/.zshrc +++ /dev/null @@ -1,10 +0,0 @@ -export META_DIR="${HOME}/urbint/meta" -export DOTFILES="${HOME}/dotfiles" -export ZSH="${HOME}/.oh-my-zsh" -export PATH="${PATH}:${HOME}/.local/bin" - -ZSH_THEME=refined -plugins=(zsh-autosuggestions git git-extras github) - -source "${ZSH}/oh-my-zsh.sh" -source "${META_DIR}/urbint_101/scripts/setup" diff --git a/configs/shared/ctags/.ctags b/configs/shared/ctags/.ctags new file mode 100644 index 000000000000..c018567f2041 --- /dev/null +++ b/configs/shared/ctags/.ctags @@ -0,0 +1,104 @@ +--recurse=yes +--exclude=.git +--exclude=vendor/ +--exclude=node_modules +--exclude=db +--exclude=log +--exclude=tmp + + +--langdef=Elixir +--langmap=Elixir:.ex.exs +--regex-Elixir=/^[ \t]*def(p?)[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\2/f,functions,functions (def ...)/ +--regex-Elixir=/^[ \t]*defcallback[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/c,callbacks,callbacks (defcallback ...)/ +--regex-Elixir=/^[ \t]*defdelegate[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/d,delegates,delegates (defdelegate ...)/ +--regex-Elixir=/^[ \t]*defexception[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/e,exceptions,exceptions (defexception ...)/ +--regex-Elixir=/^[ \t]*defimpl[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/i,implementations,implementations (defimpl ...)/ +--regex-Elixir=/^[ \t]*defmacro(p?)[ \t]+([a-z_][a-zA-Z0-9_?!]*)\(/\2/a,macros,macros (defmacro ...)/ +--regex-Elixir=/^[ \t]*defmacro(p?)[ \t]+([a-zA-Z0-9_?!]+)?[ \t]+([^ \tA-Za-z0-9_]+)[ \t]*[a-zA-Z0-9_!?!]/\3/o,operators,operators (e.g. "defmacro a <<< b")/ +--regex-Elixir=/^[ \t]*defmodule[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/m,modules,modules (defmodule ...)/ +--regex-Elixir=/^[ \t]*defprotocol[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/p,protocols,protocols (defprotocol...)/ +--regex-Elixir=/^[ \t]*Record\.defrecord[ \t]+:([a-zA-Z0-9_]+)/\1/r,records,records (defrecord...)/ +--regex-Elixir=/^[ \t]*test[ \t]+\"([a-z_][a-zA-Z0-9_?! ]*)\"*/\1/t,tests,tests (test ...)/ + + +--regex-ruby=/.*alias(_method)?[[:space:]]+:([[:alnum:]_=!?]+),?[[:space:]]+:([[:alnum:]_=!]+)/\2/f,function/ +--regex-ruby=/(^|[:;])[ \t]*([A-Z][[:alnum:]_]+) *=/\2/c,class,constant/ +--regex-ruby=/(^|;)[ \t]*(has_many|belongs_to|has_one|has_and_belongs_to_many)\(? *:([[:alnum:]_]+)/\3/f,function,association/ +--regex-ruby=/(^|;)[ \t]*(named_)?scope\(? *:([[:alnum:]_]+)/\3/f,function,named_scope/ +--regex-ruby=/(^|;)[ \t]*expose\(? *:([[:alnum:]_]+)/\2/f,function,exposure/ +--regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2/f,function,aasm_event/ +--regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2!/f,function,aasm_event/ +--regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2?/f,function,aasm_event/ + +--langmap=Ruby:+(Rakefile) + +--langdef=js +--langmap=js:.js +--langmap=js:+.jsx + +--regex-js=/[ \t.]([A-Z][A-Z0-9._$]+)[ \t]*[=:][ \t]*([0-9"'\[\{]|null)/\1/n,constant/ + +--regex-js=/\.([A-Za-z0-9._$]+)[ \t]*=[ \t]*\{/\1/o,object/ +--regex-js=/['"]*([A-Za-z0-9_$]+)['"]*[ \t]*:[ \t]*\{/\1/o,object/ +--regex-js=/([A-Za-z0-9._$]+)\[["']([A-Za-z0-9_$]+)["']\][ \t]*=[ \t]*\{/\1\.\2/o,object/ + +--regex-js=/([A-Za-z0-9._$]+)[ \t]*=[ \t]*\(function\(\)/\1/c,class/ +--regex-js=/['"]*([A-Za-z0-9_$]+)['"]*:[ \t]*\(function\(\)/\1/c,class/ +--regex-js=/class[ \t]+([A-Za-z0-9._$]+)[ \t]*/\1/c,class/ +--regex-js=/([A-Za-z$][A-Za-z0-9_$()]+)[ \t]*=[ \t]*[Rr]eact.createClass[ \t]*\(/\1/c,class/ +--regex-js=/([A-Z][A-Za-z0-9_$]+)[ \t]*=[ \t]*[A-Za-z0-9_$]*[ \t]*[{(]/\1/c,class/ +--regex-js=/([A-Z][A-Za-z0-9_$]+)[ \t]*:[ \t]*[A-Za-z0-9_$]*[ \t]*[{(]/\1/c,class/ + +--regex-js=/([A-Za-z$][A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\1/f,function/ + +--regex-js=/(function)*[ \t]*([A-Za-z$_][A-Za-z0-9_$]+)[ \t]*\([^)]*\)[ \t]*\{/\2/f,function/ +--regex-js=/['"]*([A-Za-z$][A-Za-z0-9_$]+)['"]*:[ \t]*function[ \t]*\(/\1/m,method/ +--regex-js=/([A-Za-z0-9_$]+)\[["']([A-Za-z0-9_$]+)["']\][ \t]*=[ \t]*function[ \t]*\(/\2/m,method/ + + +--langdef=haskell +--langmap=haskell:.hs +--regex-haskell=/^module[ \t]*([A-Z][a-zA-Z0-9'_.]*)/\1/m,module/ +--regex-haskell=/^(new)?type[ \t]*([A-Z][a-zA-Z0-9'_]*)./\2/t,type/ +--regex-haskell=/^class[ \t]*([A-Z][a-zA-Z0-9'_]*)/\1/c,class/ +--regex-haskell=/^data[ \t]*([A-Z][a-zA-Z0-9'_]*)/\1/d,data/ +--regex-haskell=/^([a-z_][a-zA-Z0-9'_]*).*=/\1/v,function/ + +--langmap=C++:+.mm + +--langdef=golang +--langmap=golang:.go +--regex-golang=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/d,func/ +--regex-golang=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,var/ +--regex-golang=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,type/ + +--langdef=Rust +--langmap=Rust:.rs +--regex-Rust=/^[ \t]*(#\[[^\]]\][ \t]*)*(pub[ \t]+)?(extern[ \t]+)?("[^"]+"[ \t]+)?(unsafe[ \t]+)?fn[ \t]+([a-zA-Z0-9_]+)/\6/f,functions,function definitions/ +--regex-Rust=/^[ \t]*(pub[ \t]+)?type[ \t]+([a-zA-Z0-9_]+)/\2/T,types,type definitions/ +--regex-Rust=/^[ \t]*(pub[ \t]+)?enum[ \t]+([a-zA-Z0-9_]+)/\2/g,enum,enumeration names/ +--regex-Rust=/^[ \t]*(pub[ \t]+)?struct[ \t]+([a-zA-Z0-9_]+)/\2/s,structure names/ +--regex-Rust=/^[ \t]*(pub[ \t]+)?mod[ \t]+([a-zA-Z0-9_]+)/\2/m,modules,module names/ +--regex-Rust=/^[ \t]*(pub[ \t]+)?static[ \t]+([a-zA-Z0-9_]+)/\2/c,consts,static constants/ +--regex-Rust=/^[ \t]*(pub[ \t]+)?trait[ \t]+([a-zA-Z0-9_]+)/\2/t,traits,traits/ +--regex-Rust=/^[ \t]*(pub[ \t]+)?impl([ \t\n]*<[^>]*>)?[ \t]+(([a-zA-Z0-9_:]+)[ \t]*(<[^>]*>)?[ \t]+(for)[ \t]+)?([a-zA-Z0-9_]+)/\4 \6 \7/i,impls,trait implementations/ +--regex-Rust=/^[ \t]*macro_rules![ \t]+([a-zA-Z0-9_]+)/\1/d,macros,macro definitions/ + +--langdef=typescript +--langmap=typescript:.ts +--regex-typescript=/^[ \t]*(export)?[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\2/c,classes/ +--regex-typescript=/^[ \t]*(export)?[ \t]*module[ \t]+([a-zA-Z0-9_]+)/\2/n,modules/ +--regex-typescript=/^[ \t]*(export)?[ \t]*function[ \t]+([a-zA-Z0-9_]+)/\2/f,functions/ +--regex-typescript=/^[ \t]*export[ \t]+var[ \t]+([a-zA-Z0-9_]+)/\1/v,variables/ +--regex-typescript=/^[ \t]*var[ \t]+([a-zA-Z0-9_]+)[ \t]*=[ \t]*function[ \t]*\(\)/\1/v,varlambdas/ +--regex-typescript=/^[ \t]*(export)?[ \t]*(public|private)[ \t]+(static)?[ \t]*([a-zA-Z0-9_]+)/\4/m,members/ +--regex-typescript=/^[ \t]*(export)?[ \t]*interface[ \t]+([a-zA-Z0-9_]+)/\2/i,interfaces/ +--regex-typescript=/^[ \t]*(export)?[ \t]*enum[ \t]+([a-zA-Z0-9_]+)/\2/e,enums/ +--regex-typescript=/^[ \t]*import[ \t]+([a-zA-Z0-9_]+)/\1/I,imports/ + +--langdef=elm +--langmap=elm:.elm +--regex-elm=/^module[ \t]*([A-Z][a-zA-Z0-9'_.]*)/\1/m,module/ +--regex-elm=/^type[ \t]*([A-Z][a-zA-Z0-9'_]*)./\1/t,type/ +--regex-elm=/^([a-z_][a-zA-Z0-9'_]*).*=/\1/v,function/ diff --git a/configs/shared/ghci b/configs/shared/ghci deleted file mode 100644 index 844a8901010f..000000000000 --- a/configs/shared/ghci +++ /dev/null @@ -1,13 +0,0 @@ --- Useful Typeclasses -import Control.Applicative -import Data.Monoid - --- Data Structures -import qualified Data.Map.Internal as Map - --- Lenses -import qualified Control.Lens as Lens -import qualified Control.Lens.Traversal as Lens - --- Friendly prompt -:set prompt "\ESC[34mλ> \ESC[m" diff --git a/configs/shared/git/.gitconfig b/configs/shared/git/.gitconfig new file mode 100644 index 000000000000..e6d0e7b9bc47 --- /dev/null +++ b/configs/shared/git/.gitconfig @@ -0,0 +1,21 @@ +[user] + name = William Carroll + email = wpcarro@gmail.com +[alias] + recent = for-each-ref --count=10 --sort=-committerdate refs/heads/ --format=\"%(refname:short)\" + today = ! git log --date=relative --since=00:00:00 --all --no-merges --oneline --author=\"$(git config --get user.email)\" + changed-files = ! git --no-pager diff --name-only $(current_branch) $(git merge-base $(current_branch) master) + conflicts = ! git --no-pager diff --name-only --diff-filter=U + yday = ! git log --name-only --since=yesterday.midnight --until=today.midnight --author=\"$(git config --get user.email)\" + patch-grep = log -p -S +[credential] + helper = osxkeychain +[push] + default = current +[rebase] + autosquash = true + autostash = true +[github] + user = wpcarro +[core] + excludesfile = ~/.gitignore diff --git a/configs/shared/git/.gitignore b/configs/shared/git/.gitignore new file mode 100644 index 000000000000..0d9002511ec2 --- /dev/null +++ b/configs/shared/git/.gitignore @@ -0,0 +1,2 @@ +# Mac +.DS_Store diff --git a/configs/shared/haskell/.ghci b/configs/shared/haskell/.ghci new file mode 100644 index 000000000000..995a5cec2b1d --- /dev/null +++ b/configs/shared/haskell/.ghci @@ -0,0 +1,32 @@ +-- Useful Typeclasses +import Control.Applicative +import Data.Monoid + +-- Data Structures +import qualified Data.Map.Internal as Map + +-- Lenses +import Control.Lens +import qualified Control.Lens as Lens +import qualified Control.Lens.Traversal as Lens + +-- Friendly prompt +:set prompt "\ESC[34mλ> \ESC[m" + +-- GHCi on Acid +:m - Prelude +:m + GOA +setLambdabotHome "/Users/wpcarro/Haskell/bin" +:def bs lambdabot "botsnack" +:def pl lambdabot "pl" +:def unpl lambdabot "unpl" +:def redo lambdabot "redo" +:def undo lambdabot "undo" +:def index lambdabot "index" +:def docs lambdabot "docs" +:def instances lambdabot "instances" +:def hoogle lambdabot "hoogle" +:def source lambdabot "fptools" +:def where lambdabot "where" +:def version lambdabot "version" +:def src lambdabot "src" diff --git a/configs/shared/zsh/.zshrc b/configs/shared/zsh/.zshrc new file mode 100644 index 000000000000..49452db76eaa --- /dev/null +++ b/configs/shared/zsh/.zshrc @@ -0,0 +1,13 @@ +export META_DIR="${HOME}/urbint/meta" +export DOTFILES="${HOME}/dotfiles" +export ZSH="${HOME}/.oh-my-zsh" +export PATH="${PATH}:${HOME}/.local/bin" + +# Put this here temporarily until we have a better place for it. +export FPP_EDITOR='emacsclient -n' + +ZSH_THEME=refined +plugins=(zsh-autosuggestions git git-extras github) + +source "${ZSH}/oh-my-zsh.sh" +source "${META_DIR}/urbint_101/scripts/setup" diff --git a/install.sh b/install.sh index ed2b80fcfc57..d8233b3bf185 100644 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env zsh +#!/usr/bin/env bash -source "${DOTFILES}/configs/setup" -ln -s "${DOTFILES}/emacs.d" "${HOME}/.emacs.d" +source "$HOME/dotfiles/configs/setup" +ln -s "$DOTFILES/emacs.d" "$HOME/.emacs.d" -- cgit 1.4.1