├── .config └── bash.it.bash_profile.suffix ├── .gitignore ├── LICENSE ├── README.md ├── ack └── ackrc.symlink ├── bash ├── bash_profile.symlink ├── bash_prompt.symlink └── bashrc.symlink ├── bootstrap ├── docs └── getting_started.md ├── git ├── gitconfig.symlink └── gitignore.symlink ├── input └── inputrc.symlink ├── linux └── profile.linux.d.symlink │ ├── aliases │ ├── exports │ ├── extra │ ├── fun │ └── functions ├── osx ├── osx.symlink └── profile.osx.d.symlink │ ├── aliases │ ├── exports │ ├── extra │ ├── fun │ └── functions ├── profile.d ├── aliases.symlink ├── exports.symlink ├── extra.symlink ├── fun.symlink └── functions.symlink ├── screen └── screenrc.symlink ├── tmux └── tmux.conf.symlink ├── vim ├── vim.symlink │ ├── autoload │ │ └── pathogen.vim │ └── bundle │ │ └── vim-sensible │ │ └── plugin │ │ └── sensible.vim └── vimrc.symlink └── zsh └── zshrc.symlink /.config/bash.it.bash_profile.suffix: -------------------------------------------------------------------------------- 1 | 2 | # Load ~/.exports, ~/.aliases, ~/.functions, ~/.fun, and ~/.extra 3 | for file in ~/.{exports,aliases,functions,fun,extra}; do 4 | [ -r "$file" ] && source "$file" 5 | done 6 | unset file 7 | 8 | # Add any system specifics to /etc/bashrc 9 | if [ -r "/etc/bashrc" ]; then 10 | source "/etc/bashrc" 11 | fi 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .*~ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Tyler H.T. Cipriani 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dotfile Boilerplate 2 | 3 | Your dotfiles: 4 | 5 | Unified. Organized. Personalized. 6 | 7 | ## Quickstart 8 | 9 | If you don’t already have a huge collection of dotfiles simply run the installer and follow the prompts: 10 | 11 | ```Shell 12 | git clone git://github.com/thcipriani/dotfile-boilerplate ~/.dotfiles 13 | cd ~/.dotfiles 14 | ./bootstrap --new-setup 15 | ``` 16 | 17 | Follow the prompts 18 | 19 | If you already have a collection of dotfiles then you should omit the `--new-setup` flag 20 | so that you won't be prompted to install any frameworks 21 | 22 | ## What's a dotfile? 23 | 24 | see: http://dotfiles.github.io/ 25 | 26 | ## Why 27 | 28 | There is no canonical method for dotfile organization, sharing, and bootstraping 29 | that is cross-shell and cross-system compatible. 30 | 31 | This project should work to provide dotfile-beginners with sensible defaults 32 | and advanced users with a powerful, configurable framework on which to build. 33 | 34 | ## Features 35 | 36 | At it’s core, **Dotfile Boilerplate** is a system for dotfile 37 | organization more than an opinionated framework. 38 | 39 | The basic structure of **Dotfile Boilerplate** is based on Zach Holman's 40 | [holman/dotfiles](https://github.com/holman/dotfiles) dotfiles. Configuration 41 | files are grouped by topic (e.g., "git", "vim", "zsh", etc.)., and a file 42 | named `[whatever].symlink` will by symlinked to `~/.[whatever]`. 43 | 44 | **Dotfile Boilerplate** heavily "borrows" from many fine dotfile repos 45 | 46 | - _Heavily Modified_ [holman](https://github.com/holman/dotfiles) boostrap script 47 | - [mathiasbynens](http://mths.be/dotfiles) exports, aliases and functions and osx where applicable 48 | - [tpope](https://github.com/tpope/vim-pathogen)'s Pathogen and sensible.vim 49 | - [gf3](https://github.com/gf3/dotfiles)'s Sexy Bash Prompt (for Bash Users) 50 | - [robbyrussell](https://github.com/robbyrussell/oh-my-zsh)'s Oh-my-zsh (for ZSH Users) 51 | - [sjl](http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/)'s Extravagant ZSH Prompt (for ZSH Users) 52 | - [carlhuda](https://github.com/carlhuda/janus)'s Janus Vim Framework (for ZSH Users) 53 | - [metellius](http://www.reddit.com/r/commandline/comments/kbeoe/you_can_make_readline_and_bash_much_more_user/) + [mathiasbynens](http://mths.be/dotfiles) inputrc 54 | - [sjl](https://bitbucket.org/sjl/dotfiles/src/a3ff27f963ced7e7e1e024faab6b5c8d46557172/tmux/tmux.conf?at=default)'s tmux.conf 55 | - a very fine screenrc that's source I no longer remember 56 | 57 | **Further inspiration came from** 58 | 59 | - [jclem](https://github.com/jclem/dotfiles)'s dotfiles 60 | - [ldmosquera](https://github.com/ldmosquera/dotfiles/wiki)'s dotfile wiki 61 | - [heptal](https://gist.github.com/heptal/6052573)'s tput abuse 62 | - [pastjean](https://github.com/pastjean/dotfiles)'s dotfiles 63 | 64 | All of that can, of course, be overridden. 65 | 66 | ## Learn More 67 | 68 | Checkout the [documentation](https://github.com/thcipriani/dotfile-boilerplate/blob/master/docs/getting_started.md). 69 | 70 | ## Contributing 71 | 72 | Fork me and send me a pull request =) -------------------------------------------------------------------------------- /ack/ackrc.symlink: -------------------------------------------------------------------------------- 1 | --ignore-dir=log 2 | --ignore-dir=tmp 3 | --ignore-dir=vendor 4 | --ignore-dir=public/generated 5 | --sort-files 6 | -a 7 | -------------------------------------------------------------------------------- /bash/bash_profile.symlink: -------------------------------------------------------------------------------- 1 | # Modified/Stolen from: 2 | # http://mths.be/dotfiles 3 | 4 | # Case-insensitive globbing (used in pathname expansion) 5 | shopt -s nocaseglob 6 | 7 | # Append to the Bash history file, rather than overwriting it 8 | shopt -s histappend 9 | 10 | # Autocorrect typos in path names when using `cd` 11 | shopt -s cdspell 12 | 13 | # Enable some Bash 4 features when possible: 14 | # * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux` 15 | # * Recursive globbing, e.g. `echo **/*.txt` 16 | for option in autocd globstar; do 17 | shopt -s "$option" 2> /dev/null 18 | done 19 | 20 | if [ -r ~/.bash_prompt ]; then 21 | source ~/.bash_prompt 22 | fi 23 | 24 | # Load ~/.exports, ~/.aliases, ~/.functions, ~/.fun, and ~/.extra 25 | for file in ~/.{exports,aliases,functions,fun,extra}; do 26 | [ -r "$file" ] && source "$file" 27 | done 28 | unset file 29 | 30 | # Add any system specifics to /etc/bashrc 31 | if [ -r "/etc/bashrc" ]; then 32 | source "/etc/bashrc" 33 | fi 34 | -------------------------------------------------------------------------------- /bash/bash_prompt.symlink: -------------------------------------------------------------------------------- 1 | # Sexy Bash Prompt, inspired by "Extravagant Zsh Prompt" 2 | # Screenshot: http://cloud.gf3.ca/M5rG 3 | # A big thanks to \amethyst on Freenode 4 | 5 | if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color 6 | elif [[ $TERM != dumb ]] && infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color 7 | fi 8 | 9 | if tput setaf 1 &> /dev/null; then 10 | tput sgr0 11 | if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then 12 | MAGENTA=$(tput setaf 9) 13 | ORANGE=$(tput setaf 172) 14 | GREEN=$(tput setaf 190) 15 | PURPLE=$(tput setaf 141) 16 | WHITE=$(tput setaf 0) 17 | else 18 | MAGENTA=$(tput setaf 5) 19 | ORANGE=$(tput setaf 4) 20 | GREEN=$(tput setaf 2) 21 | PURPLE=$(tput setaf 1) 22 | WHITE=$(tput setaf 7) 23 | fi 24 | BOLD=$(tput bold) 25 | RESET=$(tput sgr0) 26 | else 27 | MAGENTA="\033[1;31m" 28 | ORANGE="\033[1;33m" 29 | GREEN="\033[1;32m" 30 | PURPLE="\033[1;35m" 31 | WHITE="\033[1;37m" 32 | BOLD="" 33 | RESET="\033[m" 34 | fi 35 | 36 | parse_git_dirty () { 37 | [[ $(git status 2> /dev/null | tail -n1 | cut -c 1-17) != "nothing to commit" ]] && echo "*" 38 | } 39 | parse_git_branch () { 40 | git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" 41 | } 42 | 43 | PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]at \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on \")\[$PURPLE\]\$(parse_git_branch)\[$WHITE\]\n\$ \[$RESET\]" -------------------------------------------------------------------------------- /bash/bashrc.symlink: -------------------------------------------------------------------------------- 1 | [ -n "$PS1" ] && source ~/.bash_profile 2 | -------------------------------------------------------------------------------- /bootstrap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # bootstrap installs things. 3 | 4 | DOTFILES_ROOT="$HOME/.dotfiles" 5 | 6 | set -e 7 | 8 | show_help () { cat </dev/null 2>&1 ] && [ type ack >/dev/null 2>&1 ] && [ type ctags >/dev/null 2>&1 ] && [ type git>/dev/null 2>&1 ] && [ type ruby>/dev/null 2>&1 ] && [ type rake >/dev/null 2>&1]; then 91 | user "Your .vimrc is a bit bare. Would you like to install Janus for Vim? [y/N]" 92 | read installit 93 | 94 | case "$installit" in 95 | Y*|y*) INSTALL_JANUS=true ;; 96 | N*|n*) INSTALL_JANUS=false ;; 97 | *) INSTALL_JANUS=false ;; 98 | esac 99 | 100 | if $INSTALL_JANUS ; then 101 | curl -Lo- https://bit.ly/janus-bootstrap | bash 102 | fi 103 | else 104 | info "You'll need to install curl, ack, ctags, git, ruby and rake to install JANUS" 105 | return 106 | fi 107 | fi 108 | } 109 | 110 | oh_my_zsh_check () { 111 | # check already installed 112 | if [ -d "$HOME/.oh-my-zsh" ]; then 113 | INSTALL_OH_MY=true 114 | return 115 | fi 116 | 117 | user "You are using zshell. Would you like to install Oh-My-Zsh? [y/N]" 118 | read installit 119 | 120 | case "$installit" in 121 | Y*|y*) INSTALL_OH_MY=true ;; 122 | N*|n*) INSTALL_OH_MY=false ;; 123 | *) INSTALL_OH_MY=false ;; 124 | esac 125 | 126 | if $INSTALL_OH_MY; then 127 | if type git >/dev/null 2>&1; then 128 | git clone git://github.com/sjl/oh-my-zsh.git "$HOME/.oh-my-zsh" 129 | else 130 | info 'git not found—skipping .oh-my-zsh install' 131 | fi 132 | fi 133 | } 134 | 135 | bash_it_check () { 136 | # check already installed 137 | if [ -d "$HOME/.bash_it" ]; then 138 | INSTALL_BASH_IT=true 139 | return 140 | fi 141 | 142 | user "You are using bash. Would you like to install Bash-It? [y/N]" 143 | read installit 144 | 145 | case "$installit" in 146 | Y*|y*) INSTALL_BASH_IT=true ;; 147 | N*|n*) INSTALL_BASH_IT=false ;; 148 | *) INSTALL_BASH_IT=false ;; 149 | esac 150 | 151 | if $INSTALL_BASH_IT; then 152 | if type git >/dev/null 2>&1; then 153 | git clone http://github.com/revans/bash-it.git "$HOME/.bash_it" 154 | "$HOME/.bash_it/install.sh" 155 | else 156 | info 'git not found—skipping .bash-it install' 157 | fi 158 | fi 159 | } 160 | 161 | check_bash_suffix () { 162 | if ${INSTALL_BASH_IT:-false}; then 163 | info 'Appending to ~/.bash_profile' 164 | cat "$DOTFILES_ROOT/.config/bash.it.bash_profile.suffix" >> "$HOME/.bash_profile" 165 | fi 166 | } 167 | 168 | install_dotfiles () { 169 | info 'Installing dotfiles' 170 | 171 | case "$SHELL" in 172 | zsh ) 173 | if [[ $(uname -s) == "Linux" ]]; then 174 | files=$(find "$DOTFILES_ROOT" -maxdepth 2 -name \*.symlink -print | grep -v "bash" | grep -v "osx") 175 | elif [[ $(uname -s) == "Darwin" ]]; then 176 | files=$(find "$DOTFILES_ROOT" -maxdepth 2 -name \*.symlink -print | grep -v "bash" | grep -v "linux") 177 | else 178 | files=$(find "$DOTFILES_ROOT" -maxdepth 2 -name \*.symlink -print | grep -v "bash" | grep -v "linux" | grep -v "osx") 179 | fi 180 | 181 | if ${INSTALL_OH_MY:-false} ; then 182 | echo 'Uncomment .zshrc' 183 | # Uncomment the OH-MY-ZSH section if it exists 184 | if [[ $(uname -s) == "Darwin" ]]; then 185 | sed -i '.backup' '/^##~OH-MY-ZSH~#$/,/^##~\/OH-MY-ZSH~#$/s/^#//' "$DOTFILES_ROOT/zsh/zshrc.symlink" 186 | elif [[ $(uname -s) == "Linux" ]]; then 187 | sed -i'.backup' '/^##~OH-MY-ZSH~#$/,/^##~\/OH-MY-ZSH~#$/s/^#//' "$DOTFILES_ROOT/zsh/zshrc.symlink" 188 | fi 189 | fi 190 | ;; 191 | bash ) 192 | if [[ $(uname -s) == "Linux" ]]; then 193 | if ${INSTALL_BASH_IT:-false}; then 194 | files=$(find "$DOTFILES_ROOT" -maxdepth 2 -name \*.symlink -print | grep -v "bash" | grep -v "osx" | grep -v "zsh") 195 | else 196 | files=$(find "$DOTFILES_ROOT" -maxdepth 2 -name \*.symlink -print | grep -v "osx" | grep -v "zsh") 197 | fi 198 | elif [[ $(uname -s) == "Darwin" ]]; then 199 | if ${INSTALL_BASH_IT:-false}; then 200 | files=$(find "$DOTFILES_ROOT" -maxdepth 2 -name \*.symlink -print | grep -v "bash" | grep -v "linux" | grep -v "zsh") 201 | else 202 | files=$(find "$DOTFILES_ROOT" -maxdepth 2 -name \*.symlink -print | grep -v "linux" | grep -v "zsh") 203 | fi 204 | else 205 | if ${INSTALL_BASH_IT:-false}; then 206 | files=$(find "$DOTFILES_ROOT" -maxdepth 2 -name \*.symlink -print | grep -v "bash" | grep -v "linux" | grep -v "osx" | grep -v "zsh") 207 | else 208 | files=$(find "$DOTFILES_ROOT" -maxdepth 2 -name \*.symlink -print | grep -v "linux" | grep -v "osx" | grep -v "zsh") 209 | fi 210 | fi 211 | ;; 212 | * ) 213 | if [[ $(uname -s) == "Linux" ]]; then 214 | files=$(find "$DOTFILES_ROOT" -maxdepth 2 -name \*.symlink -print | grep -v "bash" | grep -v "osx" | grep -v "zsh") 215 | elif [[ $(uname -s) == "Darwin" ]]; then 216 | files=$(find "$DOTFILES_ROOT" -maxdepth 2 -name \*.symlink -print | grep -v "bash" | grep -v "linux" | grep -v "zsh") 217 | else 218 | files=$(find "$DOTFILES_ROOT" -maxdepth 2 -name \*.symlink -print | grep -v "bash" | grep -v "linux" | grep -v "osx" | grep -v "zsh") 219 | fi 220 | ;; 221 | esac 222 | 223 | overwrite_all=false 224 | backup_all=false 225 | skip_all=false 226 | 227 | for source in $files; do 228 | file_base=$(basename "${source%.*}") 229 | 230 | if ${INSTALL_JANUS:-false} ; then 231 | if [[ "$file_base" =~ ^vim ]]; then 232 | continue; 233 | fi 234 | fi 235 | 236 | dest="$HOME/.$file_base" 237 | 238 | if [ -h "$dest" ] && [ $(readlink "$dest") = $source ]; then 239 | continue; 240 | fi 241 | 242 | if [ -f "$dest" ] || [ -d "$dest" ]; then 243 | 244 | overwrite=false 245 | backup=false 246 | skip=false 247 | 248 | if [[ ${INSTALL_OH_MY:-false} && "$file_base" =~ ^zshrc ]]; then 249 | overwrite=true; 250 | fi 251 | 252 | if [ "$overwrite_all" == "false" ] && [ "$backup_all" == "false" ] && [ "$skip_all" == "false" ] && [ "$overwrite" == "false" ]; then 253 | user "File already exists: $(basename "$dest"), what do you want to do? [s]kip, [S]kip all, [o]verwrite, [O]verwrite all, [b]ackup, [B]ackup all?" 254 | read action 255 | 256 | case "$action" in 257 | o ) 258 | overwrite=true;; 259 | O ) 260 | overwrite_all=true;; 261 | b ) 262 | backup=true;; 263 | B ) 264 | backup_all=true;; 265 | s ) 266 | skip=true;; 267 | S ) 268 | skip_all=true;; 269 | * ) 270 | ;; 271 | esac 272 | fi 273 | 274 | if [ "$overwrite" == "true" ] || [ "$overwrite_all" == "true" ]; then 275 | rm -rf "$dest" 276 | success "removed $dest" 277 | fi 278 | 279 | if [ "$backup" == "true" ] || [ "$backup_all" == "true" ]; then 280 | mv "$dest" "$dest"\.backup 281 | success "moved $dest to $dest.backup" 282 | fi 283 | 284 | if [ "$skip" == "false" ] && [ "$skip_all" == "false" ]; then 285 | link_files "$source" "$dest" 286 | else 287 | success "skipped $source" 288 | fi 289 | 290 | else 291 | link_files "$source" "$dest" 292 | fi 293 | 294 | done 295 | 296 | check_bash_suffix 297 | 298 | restart_shell 299 | } 300 | 301 | framework_check () { 302 | if [[ $SHELL == 'zsh' ]]; then 303 | oh_my_zsh_check 304 | elif [[ $SHELL == 'bash' ]]; then 305 | bash_it_check 306 | fi 307 | 308 | # Check for Janus install 309 | check_vimrc 310 | 311 | install_dotfiles 312 | } 313 | 314 | 315 | restart_shell () { 316 | exec "$(which $SHELL)" -l 317 | info "enjoy!" 318 | } 319 | 320 | 321 | if [[ "$1" != '' ]]; then 322 | case "$1" in 323 | "--new-setup" ) 324 | NEW_SETUP=true 325 | ;; 326 | "--help"|"-h" ) 327 | show_help 328 | ;; 329 | * ) 330 | echo -e "Unknown option: $1\n" 331 | show_help 332 | ;; 333 | esac 334 | 335 | fi 336 | 337 | echo 338 | 339 | unset $INSTALL_OH_MY 340 | unset $INSTALL_BASH_IT 341 | unset $INSTALL_JANUS 342 | # Initialize 343 | check_shell 344 | 345 | echo 346 | echo 'All installed!' 347 | -------------------------------------------------------------------------------- /docs/getting_started.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Dotfile Boilerplate 2 | 3 | ## Quick Start 4 | 5 | If you don’t already have a huge collection of dotfiles simply run the 6 | installer and follow the prompts: 7 | 8 | ```Shell 9 | git clone git://github.com/thcipriani/dotfile-boilerplate ~/.dotfiles 10 | cd ~/.dotfiles 11 | ./bootstrap --new-setup 12 | ``` 13 | 14 | ## How it works 15 | 16 | `bootstrap` will guide you through the setup of sensible defaults for your system. 17 | All files in the `~/.dotfiles` directory (and any subdirectory that is a direct descendant 18 | of the `~/.dotfiles` directory) that follow the format `*.symlink` will be symlinked in 19 | your `$HOME` directory. 20 | 21 | ```Shell 22 | ~/.dotfiles/*/*/basename.symlink → ~/.basename 23 | ``` 24 | 25 | If you’ve already accumulated a large collection of dotfiles, 26 | this repository should create a very configurable and portable profile that you can host 27 | on github, bitbucket, dropbox, s3 or wherever. 28 | 29 | ### Files to tweak 30 | 31 | The main files you’ll want to change are: 32 | 33 | - `~/.dotfiles/profile.d/aliases.symlink` 34 | - `~/.dotfiles/profile.d/exports.symlink` 35 | - `~/.dotfiles/profile.d/functions.symlink` 36 | - `~/.dotfiles/profile.d/extra.symlink` 37 | 38 | Each of those are meant to hold and bash aliases, exported variables, 39 | unique functions or other configuration, respectively. 40 | 41 | In addition to those files, be sure to modify any files in `~/.dotfiles` which may 42 | overwrite configurations that you’d like to keep. 43 | 44 | ### Some Configs for OSX, Other Configs for Linux 45 | 46 | Yep. We do that. 47 | 48 | In addition to the files in the `~/.dotfiles/shell` directory there are 49 | system-specific copies of all the `shell` files in their respective 50 | system folders—`osx` for Macs and `linux` for Linux machines. 51 | 52 | The goal is to have a single, unified, dotfile repo for all the systems on which you work. 53 | 54 | ### Default Configs 55 | 56 | By default **Dotfile Boilerplate** includes config files for: 57 | 58 | - bash (including `.bash_profile`, `.bashrc` and `.bash_prompt`) 59 | - zsh 60 | - vim (both `.vimrc` and `.vim/` directory with Pathogen) 61 | - tmux 62 | - ack 63 | - `.inputrc` 64 | 65 | These configurations where amalgamated from various sources which are, largely (hopefully), 66 | indicated in-line in the actual config file. 67 | 68 | ### Semi-Intelligent 69 | 70 | If you already have an `~/.*rc` file for a program, **Dotfile Boilerplate**’s 71 | `bootstrap` won’t simply overwrite that file—you’ll be 72 | prompted if you want to `[s]kip` that config, `[b]ackup` that config (saving 73 | it to `~/.[whatever].backup` OR simply `[o]verwrite` the existing file. 74 | 75 | **Dotfile Boilerplate** detects your system-type and will only link items 76 | from the `osx` folder if you’re on a Mac—likewise 77 | for the `linux` directory on linux. 78 | 79 | **Dotfile Boilerplate** also detects shell-type and won’ link anything 80 | from the `zsh` directory if you’re using bash—likewise if you’re 81 | using Z-Shell, it won’t install anything from the `bash` directory. 82 | 83 | ### Prompts 84 | 85 | `bootstrap` is also able to semi-intelligently a small collection of dotfile frameworks. 86 | 87 | To be prompted to install new frameworks simply run bootstrap with the `--new-setup` option. 88 | 89 | If you run the bootstrap script with the `--new-setup` flag you _may_—depending on your current configurations—be 90 | prompted to install some shell frameworks ([Oh-My-ZSH](http://github.com/robbyrussell/oh-my-zsh/) for Z-Shell users 91 | and [Bash-It](https://github.com/revans/bash-it) for Bash users). 92 | 93 | If you already have these frameworks installed in their default locations—**Dotfile Boilerplate** 94 | will proceed with the remainder of the installation without prompting you to 95 | _reinstall_ these frameworks. 96 | 97 | In addition to these shell frameworks if your `~/.dotfiles/vim/.vimrc` is LESS 98 | THAN 10 lines AND you have `curl`, `ack`, `ctags`, `git`, `ruby`, and `rake` in your 99 | `$PATH` you will be prompted to install the [Janus Vim Framework](https://github.com/carlhuda/janus) 100 | -------------------------------------------------------------------------------- /git/gitconfig.symlink: -------------------------------------------------------------------------------- 1 | [alias] 2 | # View abbreviated SHA, description, and history graph of the latest 20 commits 3 | l = log --pretty=oneline -n 20 --graph --abbrev-commit 4 | # View the current working tree status using the short format 5 | s = status -s 6 | # Show the diff between the latest commit and the current state 7 | d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat" 8 | # `git di $number` shows the diff between the state `$number` revisions ago and the current state 9 | di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d" 10 | # Pull in remote changes for the current repository and all its submodules 11 | p = !"git pull; git submodule foreach git pull origin master" 12 | # Clone a repository including all submodules 13 | c = clone --recursive 14 | # Commit all changes 15 | ca = !git add -A && git commit -av 16 | # Switch to a branch, creating it if necessary 17 | go = checkout -B 18 | # Show verbose output about tags, branches or remotes 19 | tags = tag -l 20 | branches = branch -a 21 | remotes = remote -v 22 | # Credit an author on the latest commit 23 | credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f" 24 | # Interactive rebase with the given number of latest commits 25 | reb = "!r() { git rebase -i HEAD~$1; }; r" 26 | 27 | [apply] 28 | # Detect whitespace errors when applying a patch 29 | whitespace = fix 30 | 31 | [core] 32 | # Use custom `.gitignore` and `.gitattributes` 33 | excludesfile = ~/.gitignore 34 | attributesfile = ~/.gitattributes 35 | # Treat spaces before tabs, lines that are indented with 8 or more spaces, and all kinds of trailing whitespace as an error 36 | whitespace = space-before-tab,indent-with-non-tab,trailing-space 37 | 38 | [color] 39 | # Use colors in Git commands that are capable of colored output when outputting to the terminal 40 | ui = auto 41 | [color "branch"] 42 | current = yellow reverse 43 | local = yellow 44 | remote = green 45 | [color "diff"] 46 | meta = yellow bold 47 | frag = magenta bold 48 | old = red bold 49 | new = green bold 50 | [color "status"] 51 | added = yellow 52 | changed = green 53 | untracked = cyan 54 | [merge] 55 | # Include summaries of merged commits in newly created merge commit messages 56 | log = true 57 | 58 | [push] 59 | default = matching 60 | -------------------------------------------------------------------------------- /git/gitignore.symlink: -------------------------------------------------------------------------------- 1 | # Compiled Python files 2 | *.pyc 3 | 4 | # Folder view configuration files 5 | .DS_Store 6 | Desktop.ini 7 | 8 | # Thumbnail cache files 9 | ._* 10 | Thumbs.db 11 | 12 | # Files that might appear on external disks 13 | .Spotlight-V100 14 | .Trashes 15 | -------------------------------------------------------------------------------- /input/inputrc.symlink: -------------------------------------------------------------------------------- 1 | # DISCUSSION: 2 | # http://www.reddit.com/r/commandline/comments/kbeoe/you_can_make_readline_and_bash_much_more_user/ 3 | 4 | # This one is pretty obvious from the name; when completing case will not 5 | # be taken into consideration. 6 | set completion-ignore-case on 7 | 8 | # This one is insanely useful when you have a folder with lots of similarly 9 | # named files and you are not sure how far the completion has gone when you 10 | # press TAB. The first part that has been completed will be replaced by "...", 11 | # and it is simple to see what you need to type to finish the completion. 12 | set completion-prefix-display-length 2 13 | 14 | # List all matches in case multiple possible completions are possible 15 | 16 | 17 | # These will make completions appear immediately after pressing TAB once, 18 | # instead of the default behavior which is to show them after pressing twice. 19 | # I think you'll find this saves you many unnecessary keystrokes, but the 20 | # potential downside is that it could take up the space of terminal backlog 21 | # you were intending on keeping visible. 22 | set show-all-if-ambiguous on 23 | set show-all-if-unmodified on 24 | 25 | # With this enabled, underscores and hyphens are treated equally when 26 | # completing, which is a plus to me because I find hyphens a lot easier to type. 27 | set completion-map-case on 28 | 29 | # REMAINDER Modified/Stolen from: 30 | # http://mths.be/dotfiles 31 | 32 | # Immediately add a trailing slash when autocompleting symlinks to directories 33 | set mark-symlinked-directories on 34 | 35 | # Use the text that has already been typed as the prefix for searching through 36 | # commands (i.e. more intelligent Up/Down behavior) 37 | "\e[B": history-search-forward 38 | "\e[A": history-search-backward 39 | 40 | # Do not autocomplete hidden files unless the pattern explicitly begins with a dot 41 | set match-hidden-files off 42 | 43 | # Show all autocomplete results at once 44 | set page-completions off 45 | 46 | # If there are more than 200 possible completions for a word, ask to show them all 47 | set completion-query-items 200 48 | 49 | # Show extra file information when completing, like `ls -F` does 50 | set visible-stats on 51 | 52 | # Be more intelligent when autocompleting by also looking at the text after 53 | # the cursor. For example, when the current line is "cd ~/src/mozil", and 54 | # the cursor is on the "z", pressing Tab will not autocomplete it to "cd 55 | # ~/src/mozillail", but to "cd ~/src/mozilla". (This is supported by the 56 | # Readline used by Bash 4.) 57 | set skip-completed-text on 58 | 59 | # Allow UTF-8 input and output, instead of showing stuff like $'\0123\0456' 60 | set input-meta on 61 | set output-meta on 62 | set convert-meta off 63 | 64 | # Use Alt/Meta + Delete to delete the preceding word 65 | "\e[3;3~": kill-word 66 | -------------------------------------------------------------------------------- /linux/profile.linux.d.symlink/aliases: -------------------------------------------------------------------------------- 1 | # PBCopy on Linux 2 | alias pbcopy='xclip -selection clipboard' 3 | alias pbpaste='xclip -selection clipboard -o' 4 | 5 | # From "Cowboy" Ben Alman https://github.com/cowboy/dotfiles/blob/master/source/50_ubuntu.sh 6 | # Package management 7 | alias update="sudo apt-get -qq update && sudo apt-get upgrade" 8 | alias install="sudo apt-get install" 9 | alias remove="sudo apt-get remove" 10 | alias search="apt-cache search" 11 | -------------------------------------------------------------------------------- /linux/profile.linux.d.symlink/exports: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thcipriani/dotfile-boilerplate/70f98451288cacfeb06d861f4c8d4cb66316f133/linux/profile.linux.d.symlink/exports -------------------------------------------------------------------------------- /linux/profile.linux.d.symlink/extra: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thcipriani/dotfile-boilerplate/70f98451288cacfeb06d861f4c8d4cb66316f133/linux/profile.linux.d.symlink/extra -------------------------------------------------------------------------------- /linux/profile.linux.d.symlink/fun: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thcipriani/dotfile-boilerplate/70f98451288cacfeb06d861f4c8d4cb66316f133/linux/profile.linux.d.symlink/fun -------------------------------------------------------------------------------- /linux/profile.linux.d.symlink/functions: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thcipriani/dotfile-boilerplate/70f98451288cacfeb06d861f4c8d4cb66316f133/linux/profile.linux.d.symlink/functions -------------------------------------------------------------------------------- /osx/osx.symlink: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ~/.osx — http://mths.be/osx 4 | 5 | # Ask for the administrator password upfront 6 | sudo -v 7 | 8 | # Keep-alive: update existing `sudo` time stamp until `.osx` has finished 9 | while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & 10 | 11 | ############################################################################### 12 | # General UI/UX # 13 | ############################################################################### 14 | 15 | # Set computer name (as done via System Preferences → Sharing) 16 | sudo scutil --set ComputerName "MathBook Pro" 17 | sudo scutil --set HostName "MathBook Pro" 18 | sudo scutil --set LocalHostName "MathBook-Pro" 19 | sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "MathBook-Pro" 20 | 21 | # Set standby delay to 24 hours (default is 1 hour) 22 | sudo pmset -a standbydelay 86400 23 | 24 | # Disable the sound effects on boot 25 | sudo nvram SystemAudioVolume=" " 26 | 27 | # Menu bar: disable transparency 28 | defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false 29 | 30 | # Menu bar: show remaining battery time (on pre-10.8); hide percentage 31 | defaults write com.apple.menuextra.battery ShowPercent -string "NO" 32 | defaults write com.apple.menuextra.battery ShowTime -string "YES" 33 | 34 | # Menu bar: hide the useless Time Machine and Volume icons 35 | defaults write com.apple.systemuiserver menuExtras -array "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" "/System/Library/CoreServices/Menu Extras/AirPort.menu" "/System/Library/CoreServices/Menu Extras/Battery.menu" "/System/Library/CoreServices/Menu Extras/Clock.menu" 36 | 37 | # Set highlight color to green 38 | defaults write NSGlobalDomain AppleHighlightColor -string '0.764700 0.976500 0.568600' 39 | 40 | # Set sidebar icon size to medium 41 | defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2 42 | 43 | # Always show scrollbars 44 | defaults write NSGlobalDomain AppleShowScrollBars -string "Always" 45 | # Possible values: `WhenScrolling`, `Automatic` and `Always` 46 | 47 | # Disable smooth scrolling 48 | # (Uncomment if you’re on an older Mac that messes up the animation) 49 | #defaults write NSGlobalDomain NSScrollAnimationEnabled -bool false 50 | 51 | # Disable opening and closing window animations 52 | defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false 53 | 54 | # Increase window resize speed for Cocoa applications 55 | defaults write NSGlobalDomain NSWindowResizeTime -float 0.001 56 | 57 | # Expand save panel by default 58 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true 59 | 60 | # Expand print panel by default 61 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true 62 | 63 | # Save to disk (not to iCloud) by default 64 | defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false 65 | 66 | # Automatically quit printer app once the print jobs complete 67 | defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true 68 | 69 | # Disable the “Are you sure you want to open this application?” dialog 70 | defaults write com.apple.LaunchServices LSQuarantine -bool false 71 | 72 | # Display ASCII control characters using caret notation in standard text views 73 | # Try e.g. `cd /tmp; unidecode "\x{0000}" > cc.txt; open -e cc.txt` 74 | defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true 75 | 76 | # Disable Resume system-wide 77 | defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false 78 | 79 | # Disable automatic termination of inactive apps 80 | defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true 81 | 82 | # Disable the crash reporter 83 | #defaults write com.apple.CrashReporter DialogType -string "none" 84 | 85 | # Set Help Viewer windows to non-floating mode 86 | defaults write com.apple.helpviewer DevMode -bool true 87 | 88 | # Fix for the ancient UTF-8 bug in QuickLook (http://mths.be/bbo) 89 | # Commented out, as this is known to cause problems when saving files in 90 | # Adobe Illustrator CS5 :( 91 | #echo "0x08000100:0" > ~/.CFUserTextEncoding 92 | 93 | # Reveal IP address, hostname, OS version, etc. when clicking the clock 94 | # in the login window 95 | sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName 96 | 97 | # Restart automatically if the computer freezes 98 | systemsetup -setrestartfreeze on 99 | 100 | # Never go into computer sleep mode 101 | systemsetup -setcomputersleep Off > /dev/null 102 | 103 | # Check for software updates daily, not just once per week 104 | defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1 105 | 106 | # Disable Notification Center and remove the menu bar icon 107 | launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist 108 | 109 | ############################################################################### 110 | # Trackpad, mouse, keyboard, Bluetooth accessories, and input # 111 | ############################################################################### 112 | 113 | # Trackpad: enable tap to click for this user and for the login screen 114 | defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true 115 | defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 116 | defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 117 | 118 | # Trackpad: map bottom right corner to right-click 119 | defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2 120 | defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true 121 | defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1 122 | defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true 123 | 124 | # Trackpad: swipe between pages with three fingers 125 | defaults write NSGlobalDomain AppleEnableSwipeNavigateWithScrolls -bool true 126 | defaults -currentHost write NSGlobalDomain com.apple.trackpad.threeFingerHorizSwipeGesture -int 1 127 | defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerHorizSwipeGesture -int 1 128 | 129 | # Disable “natural” (Lion-style) scrolling 130 | defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false 131 | 132 | # Increase sound quality for Bluetooth headphones/headsets 133 | defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40 134 | 135 | # Enable full keyboard access for all controls 136 | # (e.g. enable Tab in modal dialogs) 137 | defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 138 | 139 | # Enable access for assistive devices 140 | echo -n 'a' | sudo tee /private/var/db/.AccessibilityAPIEnabled > /dev/null 2>&1 141 | sudo chmod 444 /private/var/db/.AccessibilityAPIEnabled 142 | # TODO: avoid GUI password prompt somehow (http://apple.stackexchange.com/q/60476/4408) 143 | #sudo osascript -e 'tell application "System Events" to set UI elements enabled to true' 144 | 145 | # Use scroll gesture with the Ctrl (^) modifier key to zoom 146 | defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true 147 | defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144 148 | # Follow the keyboard focus while zoomed in 149 | defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true 150 | 151 | # Disable press-and-hold for keys in favor of key repeat 152 | defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false 153 | 154 | # Set a blazingly fast keyboard repeat rate 155 | defaults write NSGlobalDomain KeyRepeat -int 0 156 | 157 | # Automatically illuminate built-in MacBook keyboard in low light 158 | defaults write com.apple.BezelServices kDim -bool true 159 | # Turn off keyboard illumination when computer is not used for 5 minutes 160 | defaults write com.apple.BezelServices kDimTime -int 300 161 | 162 | # Set language and text formats 163 | # Note: if you’re in the US, replace `EUR` with `USD`, `Centimeters` with 164 | # `Inches`, `en_GB` with `en_US`, and `true` with `false`. 165 | defaults write NSGlobalDomain AppleLanguages -array "en" "nl" 166 | defaults write NSGlobalDomain AppleLocale -string "en_GB@currency=EUR" 167 | defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters" 168 | defaults write NSGlobalDomain AppleMetricUnits -bool true 169 | 170 | # Set the timezone; see `systemsetup -listtimezones` for other values 171 | systemsetup -settimezone "Europe/Brussels" > /dev/null 172 | 173 | # Disable auto-correct 174 | defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false 175 | 176 | ############################################################################### 177 | # Screen # 178 | ############################################################################### 179 | 180 | # Require password immediately after sleep or screen saver begins 181 | defaults write com.apple.screensaver askForPassword -int 1 182 | defaults write com.apple.screensaver askForPasswordDelay -int 0 183 | 184 | # Save screenshots to the desktop 185 | defaults write com.apple.screencapture location -string "$HOME/Desktop" 186 | 187 | # Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF) 188 | defaults write com.apple.screencapture type -string "png" 189 | 190 | # Disable shadow in screenshots 191 | defaults write com.apple.screencapture disable-shadow -bool true 192 | 193 | # Enable subpixel font rendering on non-Apple LCDs 194 | defaults write NSGlobalDomain AppleFontSmoothing -int 2 195 | 196 | # Enable HiDPI display modes (requires restart) 197 | sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true 198 | 199 | ############################################################################### 200 | # Finder # 201 | ############################################################################### 202 | 203 | # Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons 204 | defaults write com.apple.finder QuitMenuItem -bool true 205 | 206 | # Finder: disable window animations and Get Info animations 207 | defaults write com.apple.finder DisableAllAnimations -bool true 208 | 209 | # Show icons for hard drives, servers, and removable media on the desktop 210 | defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true 211 | defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true 212 | defaults write com.apple.finder ShowMountedServersOnDesktop -bool true 213 | defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true 214 | 215 | # Finder: show hidden files by default 216 | defaults write com.apple.finder AppleShowAllFiles -bool true 217 | 218 | # Finder: show all filename extensions 219 | defaults write NSGlobalDomain AppleShowAllExtensions -bool true 220 | 221 | # Finder: show status bar 222 | defaults write com.apple.finder ShowStatusBar -bool true 223 | 224 | # Finder: show path bar 225 | defaults write com.apple.finder ShowPathbar -bool true 226 | 227 | # Finder: allow text selection in Quick Look 228 | defaults write com.apple.finder QLEnableTextSelection -bool true 229 | 230 | # Display full POSIX path as Finder window title 231 | defaults write com.apple.finder _FXShowPosixPathInTitle -bool true 232 | 233 | # When performing a search, search the current folder by default 234 | defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" 235 | 236 | # Disable the warning when changing a file extension 237 | defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false 238 | 239 | # Enable spring loading for directories 240 | defaults write NSGlobalDomain com.apple.springing.enabled -bool true 241 | 242 | # Remove the spring loading delay for directories 243 | defaults write NSGlobalDomain com.apple.springing.delay -float 0 244 | 245 | # Avoid creating .DS_Store files on network volumes 246 | defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true 247 | 248 | # Disable disk image verification 249 | defaults write com.apple.frameworks.diskimages skip-verify -bool true 250 | defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true 251 | defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true 252 | 253 | # Automatically open a new Finder window when a volume is mounted 254 | defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true 255 | defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true 256 | defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true 257 | 258 | # Show item info near icons on the desktop and in other icon views 259 | /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist 260 | /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist 261 | /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist 262 | 263 | # Show item info to the right of the icons on the desktop 264 | /usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom false" ~/Library/Preferences/com.apple.finder.plist 265 | 266 | # Enable snap-to-grid for icons on the desktop and in other icon views 267 | /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist 268 | /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist 269 | /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist 270 | 271 | # Increase grid spacing for icons on the desktop and in other icon views 272 | /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist 273 | /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist 274 | /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist 275 | 276 | # Increase the size of icons on the desktop and in other icon views 277 | /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist 278 | /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist 279 | /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist 280 | 281 | # Use list view in all Finder windows by default 282 | # Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv` 283 | defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv" 284 | 285 | # Disable the warning before emptying the Trash 286 | defaults write com.apple.finder WarnOnEmptyTrash -bool false 287 | 288 | # Empty Trash securely by default 289 | defaults write com.apple.finder EmptyTrashSecurely -bool true 290 | 291 | # Enable AirDrop over Ethernet and on unsupported Macs running Lion 292 | defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true 293 | 294 | # Enable the MacBook Air SuperDrive on any Mac 295 | sudo nvram boot-args="mbasd=1" 296 | 297 | # Show the ~/Library folder 298 | chflags nohidden ~/Library 299 | 300 | # Remove Dropbox’s green checkmark icons in Finder 301 | file=/Applications/Dropbox.app/Contents/Resources/emblem-dropbox-uptodate.icns 302 | [ -e "$file" ] && mv -f "$file" "$file.bak" 303 | 304 | ############################################################################### 305 | # Dock, Dashboard, and hot corners # 306 | ############################################################################### 307 | 308 | # Enable highlight hover effect for the grid view of a stack (Dock) 309 | defaults write com.apple.dock mouse-over-hilite-stack -bool true 310 | 311 | # Set the icon size of Dock items to 36 pixels 312 | defaults write com.apple.dock tilesize -int 36 313 | 314 | # Enable spring loading for all Dock items 315 | defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true 316 | 317 | # Show indicator lights for open applications in the Dock 318 | defaults write com.apple.dock show-process-indicators -bool true 319 | 320 | # Wipe all (default) app icons from the Dock 321 | # This is only really useful when setting up a new Mac, or if you don’t use 322 | # the Dock to launch apps. 323 | #defaults write com.apple.dock persistent-apps -array 324 | 325 | # Don’t animate opening applications from the Dock 326 | defaults write com.apple.dock launchanim -bool false 327 | 328 | # Speed up Mission Control animations 329 | defaults write com.apple.dock expose-animation-duration -float 0.1 330 | 331 | # Don’t group windows by application in Mission Control 332 | # (i.e. use the old Exposé behavior instead) 333 | defaults write com.apple.dock expose-group-by-app -bool false 334 | 335 | # Disable Dashboard 336 | defaults write com.apple.dashboard mcx-disabled -bool true 337 | 338 | # Don’t show Dashboard as a Space 339 | defaults write com.apple.dock dashboard-in-overlay -bool true 340 | 341 | # Don’t automatically rearrange Spaces based on most recent use 342 | defaults write com.apple.dock mru-spaces -bool false 343 | 344 | # Remove the auto-hiding Dock delay 345 | defaults write com.apple.dock autohide-delay -float 0 346 | # Remove the animation when hiding/showing the Dock 347 | defaults write com.apple.dock autohide-time-modifier -float 0 348 | 349 | # Enable the 2D Dock 350 | #defaults write com.apple.dock no-glass -bool true 351 | 352 | # Automatically hide and show the Dock 353 | defaults write com.apple.dock autohide -bool true 354 | 355 | # Make Dock icons of hidden applications translucent 356 | defaults write com.apple.dock showhidden -bool true 357 | 358 | # Reset Launchpad 359 | find ~/Library/Application\ Support/Dock -name "*.db" -maxdepth 1 -delete 360 | 361 | # Add iOS Simulator to Launchpad 362 | ln -s /Applications/Xcode.app/Contents/Applications/iPhone\ Simulator.app /Applications/iOS\ Simulator.app 363 | 364 | # Add a spacer to the left side of the Dock (where the applications are) 365 | #defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' 366 | # Add a spacer to the right side of the Dock (where the Trash is) 367 | #defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}' 368 | 369 | # Hot corners 370 | # Possible values: 371 | # 0: no-op 372 | # 2: Mission Control 373 | # 3: Show application windows 374 | # 4: Desktop 375 | # 5: Start screen saver 376 | # 6: Disable screen saver 377 | # 7: Dashboard 378 | # 10: Put display to sleep 379 | # 11: Launchpad 380 | # 12: Notification Center 381 | # Top left screen corner → Mission Control 382 | defaults write com.apple.dock wvous-tl-corner -int 2 383 | defaults write com.apple.dock wvous-tl-modifier -int 0 384 | # Top right screen corner → Desktop 385 | defaults write com.apple.dock wvous-tr-corner -int 4 386 | defaults write com.apple.dock wvous-tr-modifier -int 0 387 | # Bottom left screen corner → Start screen saver 388 | defaults write com.apple.dock wvous-bl-corner -int 5 389 | defaults write com.apple.dock wvous-bl-modifier -int 0 390 | 391 | ############################################################################### 392 | # Safari & WebKit # 393 | ############################################################################### 394 | 395 | # Set Safari’s home page to `about:blank` for faster loading 396 | defaults write com.apple.Safari HomePage -string "about:blank" 397 | 398 | # Prevent Safari from opening ‘safe’ files automatically after downloading 399 | defaults write com.apple.Safari AutoOpenSafeDownloads -bool false 400 | 401 | # Allow hitting the Backspace key to go to the previous page in history 402 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true 403 | 404 | # Hide Safari’s bookmarks bar by default 405 | defaults write com.apple.Safari ShowFavoritesBar -bool false 406 | 407 | # Disable Safari’s thumbnail cache for History and Top Sites 408 | defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2 409 | 410 | # Enable Safari’s debug menu 411 | defaults write com.apple.Safari IncludeInternalDebugMenu -bool true 412 | 413 | # Make Safari’s search banners default to Contains instead of Starts With 414 | defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false 415 | 416 | # Remove useless icons from Safari’s bookmarks bar 417 | defaults write com.apple.Safari ProxiesInBookmarksBar "()" 418 | 419 | # Enable the Develop menu and the Web Inspector in Safari 420 | defaults write com.apple.Safari IncludeDevelopMenu -bool true 421 | defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true 422 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true 423 | 424 | # Add a context menu item for showing the Web Inspector in web views 425 | defaults write NSGlobalDomain WebKitDeveloperExtras -bool true 426 | 427 | ############################################################################### 428 | # iTunes (pre-iTunes 11 only) # 429 | ############################################################################### 430 | 431 | # Disable the iTunes store link arrows 432 | defaults write com.apple.iTunes show-store-link-arrows -bool false 433 | 434 | # Disable the Genius sidebar in iTunes 435 | defaults write com.apple.iTunes disableGeniusSidebar -bool true 436 | 437 | # Disable radio stations in iTunes 438 | defaults write com.apple.iTunes disableRadio -bool true 439 | 440 | # Make ⌘ + F focus the search input in iTunes 441 | # To use these commands in another language, browse iTunes’s package contents, 442 | # open `Contents/Resources/your-language.lproj/Localizable.strings`, and look 443 | # for `kHiddenMenuItemTargetSearch`. 444 | defaults write com.apple.iTunes NSUserKeyEquivalents -dict-add "Target Search Field" "@F" 445 | 446 | ############################################################################### 447 | # Mail # 448 | ############################################################################### 449 | 450 | # Disable send and reply animations in Mail.app 451 | defaults write com.apple.mail DisableReplyAnimations -bool true 452 | defaults write com.apple.mail DisableSendAnimations -bool true 453 | 454 | # Copy email addresses as `foo@example.com` instead of `Foo Bar ` in Mail.app 455 | defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false 456 | 457 | # Add the keyboard shortcut ⌘ + Enter to send an email in Mail.app 458 | defaults write com.apple.mail NSUserKeyEquivalents -dict-add "Send" "@\\U21a9" 459 | 460 | ############################################################################### 461 | # Spotlight # 462 | ############################################################################### 463 | 464 | # Hide Spotlight tray-icon (and subsequent helper) 465 | #sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search 466 | # Disable Spotlight indexing for any volume that gets mounted and has not yet 467 | # been indexed before. 468 | # Use `sudo mdutil -i off "/Volumes/foo"` to stop indexing any volume. 469 | sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes" 470 | # Change indexing order and disable some file types 471 | defaults write com.apple.spotlight orderedItems -array \ 472 | '{"enabled" = 1;"name" = "APPLICATIONS";}' \ 473 | '{"enabled" = 1;"name" = "SYSTEM_PREFS";}' \ 474 | '{"enabled" = 1;"name" = "DIRECTORIES";}' \ 475 | '{"enabled" = 1;"name" = "PDF";}' \ 476 | '{"enabled" = 1;"name" = "FONTS";}' \ 477 | '{"enabled" = 0;"name" = "DOCUMENTS";}' \ 478 | '{"enabled" = 0;"name" = "MESSAGES";}' \ 479 | '{"enabled" = 0;"name" = "CONTACT";}' \ 480 | '{"enabled" = 0;"name" = "EVENT_TODO";}' \ 481 | '{"enabled" = 0;"name" = "IMAGES";}' \ 482 | '{"enabled" = 0;"name" = "BOOKMARKS";}' \ 483 | '{"enabled" = 0;"name" = "MUSIC";}' \ 484 | '{"enabled" = 0;"name" = "MOVIES";}' \ 485 | '{"enabled" = 0;"name" = "PRESENTATIONS";}' \ 486 | '{"enabled" = 0;"name" = "SPREADSHEETS";}' \ 487 | '{"enabled" = 0;"name" = "SOURCE";}' 488 | # Load new settings before rebuilding the index 489 | killall mds 490 | # Make sure indexing is enabled for the main volume 491 | sudo mdutil -i on / 492 | # Rebuild the index from scratch 493 | sudo mdutil -E / 494 | 495 | ############################################################################### 496 | # Terminal # 497 | ############################################################################### 498 | 499 | # Only use UTF-8 in Terminal.app 500 | defaults write com.apple.terminal StringEncodings -array 4 501 | 502 | # Use a modified version of the Pro theme by default in Terminal.app 503 | open "$HOME/init/Mathias.terminal" 504 | sleep 1 # Wait a bit to make sure the theme is loaded 505 | defaults write com.apple.terminal "Default Window Settings" -string "Mathias" 506 | defaults write com.apple.terminal "Startup Window Settings" -string "Mathias" 507 | 508 | # Enable “focus follows mouse” for Terminal.app and all X11 apps 509 | # i.e. hover over a window and start typing in it without clicking first 510 | #defaults write com.apple.terminal FocusFollowsMouse -bool true 511 | #defaults write org.x.X11 wm_ffm -bool true 512 | 513 | ############################################################################### 514 | # Time Machine # 515 | ############################################################################### 516 | 517 | # Prevent Time Machine from prompting to use new hard drives as backup volume 518 | defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true 519 | 520 | # Disable local Time Machine backups 521 | hash tmutil &> /dev/null && sudo tmutil disablelocal 522 | 523 | ############################################################################### 524 | # Address Book, Dashboard, iCal, TextEdit, and Disk Utility # 525 | ############################################################################### 526 | 527 | # Enable the debug menu in Address Book 528 | defaults write com.apple.addressbook ABShowDebugMenu -bool true 529 | 530 | # Enable Dashboard dev mode (allows keeping widgets on the desktop) 531 | defaults write com.apple.dashboard devmode -bool true 532 | 533 | # Enable the debug menu in iCal (pre-10.8) 534 | defaults write com.apple.iCal IncludeDebugMenu -bool true 535 | 536 | # Use plain text mode for new TextEdit documents 537 | defaults write com.apple.TextEdit RichText -int 0 538 | # Open and save files as UTF-8 in TextEdit 539 | defaults write com.apple.TextEdit PlainTextEncoding -int 4 540 | defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4 541 | 542 | # Enable the debug menu in Disk Utility 543 | defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true 544 | defaults write com.apple.DiskUtility advanced-image-options -bool true 545 | 546 | ############################################################################### 547 | # Mac App Store # 548 | ############################################################################### 549 | 550 | # Enable the WebKit Developer Tools in the Mac App Store 551 | defaults write com.apple.appstore WebKitDeveloperExtras -bool true 552 | 553 | # Enable Debug Menu in the Mac App Store 554 | defaults write com.apple.appstore ShowDebugMenu -bool true 555 | 556 | ############################################################################### 557 | # Google Chrome & Google Chrome Canary # 558 | ############################################################################### 559 | 560 | # Allow installing user scripts via GitHub or Userscripts.org 561 | defaults write com.google.Chrome ExtensionInstallSources -array "https://*.github.com/*" "http://userscripts.org/*" 562 | defaults write com.google.Chrome.canary ExtensionInstallSources -array "https://*.github.com/*" "http://userscripts.org/*" 563 | 564 | ############################################################################### 565 | # GPGMail 2 # 566 | ############################################################################### 567 | 568 | # Disable signing emails by default 569 | defaults write ~/Library/Preferences/org.gpgtools.gpgmail SignNewEmailsByDefault -bool false 570 | 571 | ############################################################################### 572 | # SizeUp.app # 573 | ############################################################################### 574 | 575 | # Start SizeUp at login 576 | defaults write com.irradiatedsoftware.SizeUp StartAtLogin -bool true 577 | 578 | # Don’t show the preferences window on next start 579 | defaults write com.irradiatedsoftware.SizeUp ShowPrefsOnNextStart -bool false 580 | 581 | ############################################################################### 582 | # Transmission.app # 583 | ############################################################################### 584 | 585 | # Use `~/Documents/Torrents` to store incomplete downloads 586 | defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true 587 | defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Documents/Torrents" 588 | 589 | # Don’t prompt for confirmation before downloading 590 | defaults write org.m0k.transmission DownloadAsk -bool false 591 | 592 | # Trash original torrent files 593 | defaults write org.m0k.transmission DeleteOriginalTorrent -bool true 594 | 595 | # Hide the donate message 596 | defaults write org.m0k.transmission WarningDonate -bool false 597 | # Hide the legal disclaimer 598 | defaults write org.m0k.transmission WarningLegal -bool false 599 | 600 | ############################################################################### 601 | # Twitter.app # 602 | ############################################################################### 603 | 604 | # Disable smart quotes as it’s annoying for code tweets 605 | defaults write com.twitter.twitter-mac AutomaticQuoteSubstitutionEnabled -bool false 606 | 607 | # Show the app window when clicking the menu icon 608 | defaults write com.twitter.twitter-mac MenuItemBehavior -int 1 609 | 610 | # Enable the hidden ‘Develop’ menu 611 | defaults write com.twitter.twitter-mac ShowDevelopMenu -bool true 612 | 613 | # Open links in the background 614 | defaults write com.twitter.twitter-mac openLinksInBackground -bool true 615 | 616 | # Allow closing the ‘new tweet’ window by pressing `Esc` 617 | defaults write com.twitter.twitter-mac ESCClosesComposeWindow -bool true 618 | 619 | # Show full names rather than Twitter handles 620 | defaults write com.twitter.twitter-mac ShowFullNames -bool true 621 | 622 | # Hide the app in the background if it’s not the front-most window 623 | defaults write com.twitter.twitter-mac HideInBackground -bool true 624 | 625 | ############################################################################### 626 | # Kill affected applications # 627 | ############################################################################### 628 | 629 | for app in "Address Book" "Calendar" "Contacts" "Dashboard" "Dock" "Finder" \ 630 | "Mail" "Safari" "SizeUp" "SystemUIServer" "Terminal" "Transmission" \ 631 | "Twitter" "iCal" "iTunes"; do 632 | killall "$app" > /dev/null 2>&1 633 | done 634 | echo "Done. Note that some of these changes require a logout/restart to take effect." 635 | -------------------------------------------------------------------------------- /osx/profile.osx.d.symlink/aliases: -------------------------------------------------------------------------------- 1 | alias o="open" 2 | alias oo="open ." 3 | 4 | # Get OS X Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages 5 | alias update='sudo softwareupdate -i -a; brew update; brew upgrade; brew cleanup; npm update npm -g; npm update -g; sudo gem update' 6 | 7 | # Flush Directory Service cache 8 | alias flush="dscacheutil -flushcache && killall -HUP mDNSResponder" 9 | 10 | # Clean up LaunchServices to remove duplicates in the “Open With” menu 11 | alias lscleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder" 12 | 13 | # OS X has no `md5sum`, so use `md5` as a fallback 14 | command -v md5sum > /dev/null || alias md5sum="md5" 15 | 16 | # OS X has no `sha1sum`, so use `shasum` as a fallback 17 | command -v sha1sum > /dev/null || alias sha1sum="shasum" 18 | 19 | # Trim new lines and copy to clipboard 20 | alias c="tr -d '\n' | pbcopy" 21 | 22 | # Recursively delete `.DS_Store` files 23 | alias cleanup="find . -type f -name '*.DS_Store' -ls -delete" 24 | 25 | 26 | # Empty the Trash on all mounted volumes and the main HDD 27 | # Also, clear Apple’s System Logs to improve shell startup speed 28 | alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl" 29 | 30 | # Show/hide hidden files in Finder 31 | alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" 32 | alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder" 33 | 34 | # Hide/show all desktop icons (useful when presenting) 35 | alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder" 36 | alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder" 37 | 38 | # Merge PDF files 39 | # Usage: `mergepdf -o output.pdf input{1,2,3}.pdf` 40 | alias mergepdf='/System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py' 41 | 42 | # Disable Spotlight 43 | alias spotoff="sudo mdutil -a -i off" 44 | # Enable Spotlight 45 | alias spoton="sudo mdutil -a -i on" 46 | 47 | # PlistBuddy alias, because sometimes `defaults` just doesn’t cut it 48 | alias plistbuddy="/usr/libexec/PlistBuddy" 49 | alias mute="osascript -e 'set volume 0'" 50 | alias loud="osascript -e 'set volume 7'" 51 | 52 | # Stuff I never really use but cannot delete either because of http://xkcd.com/530/ 53 | alias stfu="osascript -e 'set volume output muted true'" 54 | alias pumpitup="osascript -e 'set volume 7'" 55 | alias hax="growlnotify -a 'Activity Monitor' 'System error' -m 'WTF R U DOIN'" 56 | -------------------------------------------------------------------------------- /osx/profile.osx.d.symlink/exports: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thcipriani/dotfile-boilerplate/70f98451288cacfeb06d861f4c8d4cb66316f133/osx/profile.osx.d.symlink/exports -------------------------------------------------------------------------------- /osx/profile.osx.d.symlink/extra: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thcipriani/dotfile-boilerplate/70f98451288cacfeb06d861f4c8d4cb66316f133/osx/profile.osx.d.symlink/extra -------------------------------------------------------------------------------- /osx/profile.osx.d.symlink/fun: -------------------------------------------------------------------------------- 1 | # Peer Gynt :) 2 | alias mountainking="osascript -e 'say \"Dum dum dum dum dum dum dum he he he ho ho ho fa lah lah lah lah lah lah fa lah full hoo hoo hoo\" using \"Cellos\"'" 3 | -------------------------------------------------------------------------------- /osx/profile.osx.d.symlink/functions: -------------------------------------------------------------------------------- 1 | # Change working directory to the top-most Finder window location 2 | function cdf() { # short for `cdfinder` 3 | cd "$(osascript -e 'tell app "Finder" to POSIX path of (insertion location as alias)')" 4 | } 5 | 6 | # Add note to Notes.app (OS X 10.8) 7 | # Usage: `note 'title' 'body'` or `echo 'body' | note` 8 | # Title is optional 9 | function note() { 10 | local title 11 | local body 12 | if [ -t 0 ]; then 13 | title="$1" 14 | body="$2" 15 | else 16 | title=$(cat) 17 | fi 18 | osascript >/dev/null <
" & "$body"} 23 | end tell 24 | end tell 25 | end tell 26 | EOF 27 | } 28 | 29 | # Add reminder to Reminders.app (OS X 10.8) 30 | # Usage: `remind 'foo'` or `echo 'foo' | remind` 31 | function remind() { 32 | local text 33 | if [ -t 0 ]; then 34 | text="$1" # argument 35 | else 36 | text=$(cat) # pipe 37 | fi 38 | osascript >/dev/null < /dev/null 2>&1; then # GNU `ls` 19 | colorflag="--color" 20 | else # OS X `ls` 21 | colorflag="-G" 22 | fi 23 | 24 | # List all files colorized in long format 25 | alias l="ls -lF ${colorflag}" 26 | 27 | # List all files colorized in long format, including dot files 28 | alias la="ls -laF ${colorflag}" 29 | 30 | # List only directories 31 | alias lsd='ls -lF ${colorflag} | grep "^d"' 32 | 33 | # Always use color output for `ls` 34 | alias ls="command ls ${colorflag}" 35 | export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:' 36 | 37 | # Enable aliases to be sudo’ed 38 | alias sudo='sudo ' 39 | 40 | # Gzip-enabled `curl` 41 | alias gurl='curl --compressed' 42 | 43 | # Get week number 44 | alias week='date +%V' 45 | 46 | # Stopwatch 47 | alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' 48 | 49 | # IP addresses 50 | alias ip="dig +short myip.opendns.com @resolver1.opendns.com" 51 | alias ips="ifconfig -a | grep -o 'inet6\? \(\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\|[a-fA-F0-9:]\+\)' | sed -e 's/inet6* //'" 52 | 53 | # Enhanced WHOIS lookups 54 | alias whois="whois -h whois-servers.net" 55 | 56 | # View HTTP traffic 57 | alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'" 58 | alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\"" 59 | 60 | # Canonical hex dump; some systems have this symlinked 61 | command -v hd > /dev/null || alias hd="hexdump -C" 62 | 63 | # ROT13-encode text. Works for decoding, too! ;) 64 | alias rot13='tr a-zA-Z n-za-mN-ZA-M' 65 | 66 | # URL-encode strings 67 | alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1]);"' 68 | 69 | # Ring the terminal bell, and put a badge on Terminal.app’s Dock icon 70 | # (useful when executing time-consuming commands) 71 | alias badge="tput bel" 72 | 73 | # Intuitive map function 74 | # For example, to list all directories that contain a certain file: 75 | # find . -name .gitattributes | map dirname 76 | alias map="xargs -n1" 77 | 78 | # One of @janmoesen’s ProTip™s 79 | for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do 80 | alias "$method"="lwp-request -m '$method'" 81 | done 82 | 83 | # Make Grunt print stack traces by default 84 | command -v grunt > /dev/null && alias grunt="grunt --stack" 85 | 86 | if [[ $(uname -s) == "Darwin" ]]; then 87 | source ~/.profile.osx.d/aliases 88 | elif [[ $(uname -s) == "Linux" ]]; then 89 | source ~/.profile.linux.d/aliases 90 | fi 91 | -------------------------------------------------------------------------------- /profile.d/exports.symlink: -------------------------------------------------------------------------------- 1 | # Modified/Stolen from: 2 | # http://mths.be/dotfiles 3 | 4 | # Make vim the default editor 5 | export EDITOR="vim" 6 | 7 | # Larger bash history (allow 32³ entries; default is 500) 8 | export HISTSIZE=32768 9 | export HISTFILESIZE=$HISTSIZE 10 | export HISTCONTROL=ignoredups 11 | # Make some commands not show up in history 12 | export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help" 13 | 14 | # Prefer US English and use UTF-8 15 | export LANG="en_US" 16 | export LC_ALL="en_US.UTF-8" 17 | 18 | # Highlight section titles in manual pages 19 | export LESS_TERMCAP_md="$ORANGE" 20 | 21 | # Don’t clear the screen after quitting a manual page 22 | export MANPAGER="less -X" 23 | 24 | # Always enable colored `grep` output 25 | export GREP_OPTIONS="--color=auto" 26 | 27 | # Customize to your needs... 28 | export PATH=/usr/local/bin:/usr/local/sbin:$PATH 29 | 30 | if [[ $(uname -s) == "Darwin" ]]; then 31 | source ~/.profile.osx.d/exports 32 | elif [[ $(uname -s) == "Linux" ]]; then 33 | source ~/.profile.linux.d/exports 34 | fi 35 | -------------------------------------------------------------------------------- /profile.d/extra.symlink: -------------------------------------------------------------------------------- 1 | # Last things sourced save /etc/bashrc 2 | 3 | if [[ $(uname -s) == "Darwin" ]]; then 4 | source ~/.profile.osx.d/extra 5 | elif [[ $(uname -s) == "Linux" ]]; then 6 | source ~/.profile.linux.d/extra 7 | fi 8 | -------------------------------------------------------------------------------- /profile.d/fun.symlink: -------------------------------------------------------------------------------- 1 | # hehe 2 | alias ny='telnet miku.acm.uiuc.edu' 3 | alias rr='curl -L http://bit.ly/10hA8iC | bash' 4 | alias sw='telnet towel.blinkenlights.nl' 5 | 6 | if [[ $(uname -s) == "Darwin" ]]; then 7 | source ~/.profile.osx.d/fun 8 | elif [[ $(uname -s) == "Linux" ]]; then 9 | source ~/.profile.linux.d/fun 10 | fi 11 | -------------------------------------------------------------------------------- /profile.d/functions.symlink: -------------------------------------------------------------------------------- 1 | # Modified/Stolen from: 2 | # http://mths.be/dotfiles 3 | 4 | # Simple calculator 5 | function calc() { 6 | local result="" 7 | result="$(printf "scale=10;$*\n" | bc --mathlib | tr -d '\\\n')" 8 | # └─ default (when `--mathlib` is used) is 20 9 | # 10 | if [[ "$result" == *.* ]]; then 11 | # improve the output for decimal numbers 12 | printf "$result" | 13 | sed -e 's/^\./0./' `# add "0" for cases like ".5"` \ 14 | -e 's/^-\./-0./' `# add "0" for cases like "-.5"`\ 15 | -e 's/0*$//;s/\.$//' # remove trailing zeros 16 | else 17 | printf "$result" 18 | fi 19 | printf "\n" 20 | } 21 | 22 | # Create a new directory and enter it 23 | function take () { 24 | mkdir -p "$@" && cd "$@" 25 | } 26 | 27 | # Create a .tar.gz archive, using `zopfli`, `pigz` or `gzip` for compression 28 | function targz() { 29 | local tmpFile="${@%/}.tar" 30 | tar -cvf "${tmpFile}" --exclude=".DS_Store" "${@}" || return 1 31 | 32 | size=$( 33 | stat -f"%z" "${tmpFile}" 2> /dev/null; # OS X `stat` 34 | stat -c"%s" "${tmpFile}" 2> /dev/null # GNU `stat` 35 | ) 36 | 37 | local cmd="" 38 | if (( size < 52428800 )) && hash zopfli 2> /dev/null; then 39 | # the .tar file is smaller than 50 MB and Zopfli is available; use it 40 | cmd="zopfli" 41 | else 42 | if hash pigz 2> /dev/null; then 43 | cmd="pigz" 44 | else 45 | cmd="gzip" 46 | fi 47 | fi 48 | 49 | echo "Compressing .tar using \`${cmd}\`…" 50 | "${cmd}" -v "${tmpFile}" || return 1 51 | [ -f "${tmpFile}" ] && rm "${tmpFile}" 52 | echo "${tmpFile}.gz created successfully." 53 | } 54 | 55 | # Determine size of a file or total size of a directory 56 | function fs() { 57 | if du -b /dev/null > /dev/null 2>&1; then 58 | local arg=-sbh 59 | else 60 | local arg=-sh 61 | fi 62 | if [[ -n "$@" ]]; then 63 | du $arg -- "$@" 64 | else 65 | du $arg .[^.]* * 66 | fi 67 | } 68 | 69 | # Use Git’s colored diff when available 70 | hash git &>/dev/null 71 | if [ $? -eq 0 ]; then 72 | function diff() { 73 | git diff --no-index --color-words "$@" 74 | } 75 | fi 76 | 77 | # Create a data URL from a file 78 | function dataurl() { 79 | local mimeType=$(file -b --mime-type "$1") 80 | if [[ $mimeType == text/* ]]; then 81 | mimeType="${mimeType};charset=utf-8" 82 | fi 83 | echo "data:${mimeType};base64,$(openssl base64 -in "$1" | tr -d '\n')" 84 | } 85 | 86 | # Create a git.io short URL 87 | function gitio() { 88 | if [ -z "${1}" -o -z "${2}" ]; then 89 | echo "Usage: \`gitio slug url\`" 90 | return 1 91 | fi 92 | curl -i http://git.io/ -F "url=${2}" -F "code=${1}" 93 | } 94 | 95 | # Start an HTTP server from a directory, optionally specifying the port 96 | function server() { 97 | local port="${1:-8000}" 98 | sleep 1 && open "http://localhost:${port}/" & 99 | # Set the default Content-Type to `text/plain` instead of `application/octet-stream` 100 | # And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files) 101 | python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port" 102 | } 103 | 104 | # Start a PHP server from a directory, optionally specifying the port 105 | # (Requires PHP 5.4.0+.) 106 | function phpserver() { 107 | local port="${1:-4000}" 108 | local ip=$(ipconfig getifaddr en1) 109 | sleep 1 && open "http://${ip}:${port}/" & 110 | php -S "${ip}:${port}" 111 | } 112 | 113 | # Compare original and gzipped file size 114 | function gz() { 115 | local origsize=$(wc -c < "$1") 116 | local gzipsize=$(gzip -c "$1" | wc -c) 117 | local ratio=$(echo "$gzipsize * 100/ $origsize" | bc -l) 118 | printf "orig: %d bytes\n" "$origsize" 119 | printf "gzip: %d bytes (%2.2f%%)\n" "$gzipsize" "$ratio" 120 | } 121 | 122 | # Syntax-highlight JSON strings or files 123 | # Usage: `json '{"foo":42}'` or `echo '{"foo":42}' | json` 124 | function json() { 125 | if [ -t 0 ]; then # argument 126 | python -mjson.tool <<< "$*" | pygmentize -l javascript 127 | else # pipe 128 | python -mjson.tool | pygmentize -l javascript 129 | fi 130 | } 131 | 132 | # All the dig info 133 | function digga() { 134 | dig +nocmd "$1" any +multiline +noall +answer 135 | } 136 | 137 | # Escape UTF-8 characters into their 3-byte format 138 | function escape() { 139 | printf "\\\x%s" $(printf "$@" | xxd -p -c1 -u) 140 | # print a newline unless we’re piping the output to another program 141 | if [ -t 1 ]; then 142 | echo # newline 143 | fi 144 | } 145 | 146 | # Decode \x{ABCD}-style Unicode escape sequences 147 | function unidecode() { 148 | perl -e "binmode(STDOUT, ':utf8'); print \"$@\"" 149 | # print a newline unless we’re piping the output to another program 150 | if [ -t 1 ]; then 151 | echo # newline 152 | fi 153 | } 154 | 155 | # Get a character’s Unicode code point 156 | function codepoint() { 157 | perl -e "use utf8; print sprintf('U+%04X', ord(\"$@\"))" 158 | # print a newline unless we’re piping the output to another program 159 | if [ -t 1 ]; then 160 | echo # newline 161 | fi 162 | } 163 | 164 | # Show all the names (CNs and SANs) listed in the SSL certificate 165 | # for a given domain 166 | function getcertnames() { 167 | if [ -z "${1}" ]; then 168 | echo "ERROR: No domain specified." 169 | return 1 170 | fi 171 | 172 | local domain="${1}" 173 | echo "Testing ${domain}…" 174 | echo # newline 175 | 176 | local tmp=$(echo -e "GET / HTTP/1.0\nEOT" \ 177 | | openssl s_client -connect "${domain}:443" 2>&1); 178 | 179 | if [[ "${tmp}" = *"-----BEGIN CERTIFICATE-----"* ]]; then 180 | local certText=$(echo "${tmp}" \ 181 | | openssl x509 -text -certopt "no_header, no_serial, no_version, \ 182 | no_signame, no_validity, no_issuer, no_pubkey, no_sigdump, no_aux"); 183 | echo "Common Name:" 184 | echo # newline 185 | echo "${certText}" | grep "Subject:" | sed -e "s/^.*CN=//"; 186 | echo # newline 187 | echo "Subject Alternative Name(s):" 188 | echo # newline 189 | echo "${certText}" | grep -A 1 "Subject Alternative Name:" \ 190 | | sed -e "2s/DNS://g" -e "s/ //g" | tr "," "\n" | tail -n +2 191 | return 0 192 | else 193 | echo "ERROR: Certificate not found."; 194 | return 1 195 | fi 196 | } 197 | 198 | # Install Grunt plugins and add them as `devDependencies` to `package.json` 199 | # Usage: `gi contrib-watch contrib-uglify zopfli` 200 | function gi() { 201 | local IFS=, 202 | eval npm install --save-dev grunt-{"$*"} 203 | } 204 | 205 | # Display image with tput 206 | # https://gist.github.com/heptal/6052573 207 | function image() { 208 | convert $1 -resize 40 txt:-|sed -E 's/://;s/\( ? ?//;s/, ? ?/,/g;s/\)//;s/([0-9]+,[0-9]+,[0-9]+),[0-9]+/\1/g;s/255/254/g;/mage/d'|awk '{print $1,$2}'|sed -E 's/^0,[0-9]+ /print "echo;tput setaf "\;/;s/^[0-9]+,[0-9]+ /print "tput setaf ";/;s/(.+),(.+),(.+)/\1\/42.5*36+\2\/42.5*6+\3\/42.5+16/'|bc|sed 's/$/;echo -n " ";/'|tr '\n' ' '|sed 's/^/tput rev;/;s/; /;/g;s/$/tput sgr0;echo/'|bash 209 | } 210 | 211 | if [[ $(uname -s) == "Darwin" ]]; then 212 | source ~/.profile.osx.d/functions 213 | elif [[ $(uname -s) == "Linux" ]]; then 214 | source ~/.profile.linux.d/functions 215 | fi 216 | -------------------------------------------------------------------------------- /screen/screenrc.symlink: -------------------------------------------------------------------------------- 1 | startup_message off 2 | vbell off 3 | screen -t bash1 4 | screen -t bash2 5 | screen -t bash3 6 | altscreen on 7 | term screen-256color 8 | 9 | #change the hardstatus settings to give an window list at the bottom of the screen, with the time and date and with the current window highlighted 10 | hardstatus alwayslastline 11 | ##hardstatus string '%{= kG}%-Lw%{= kW}%50> %n%f* %t%{= kG}%+Lw%< %{= kG}%-=%c:%s%{-}' 12 | hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W}%c %{g}]' 13 | -------------------------------------------------------------------------------- /tmux/tmux.conf.symlink: -------------------------------------------------------------------------------- 1 | # https://bitbucket.org/sjl/dotfiles/raw/ea3fd4a6795ae2c5b27006f03201805a2454158e/tmux/tmux.conf 2 | 3 | # Use something easier to type as the prefix. 4 | set -g prefix C-f 5 | unbind C-b 6 | bind C-f send-prefix 7 | 8 | # Relax! 9 | set -sg escape-time 0 10 | set -sg repeat-time 600 11 | 12 | # Shut up. 13 | set -g quiet on 14 | 15 | # Mouse 16 | set -g mode-mouse on 17 | setw -g mouse-select-window on 18 | setw -g mouse-select-pane on 19 | 20 | # This is hilariously absurd. How many nerds use tmux on OS X every day and 21 | # it's still fundamentally broken? 22 | set -g default-command "reattach-to-user-namespace -l zsh" 23 | set -g default-command "reattach-to-user-namespace -l fish" 24 | 25 | # Less stretching to get to the first item. 26 | set -g base-index 1 27 | setw -g pane-base-index 1 28 | 29 | # Reload the config. 30 | bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf" 31 | 32 | # Saner splitting. 33 | bind v split-window -h 34 | bind s split-window -v 35 | bind S choose-session 36 | 37 | # Pane movement 38 | bind h select-pane -L 39 | bind j select-pane -D 40 | bind k select-pane -U 41 | bind l select-pane -R 42 | 43 | # DVTM style pane selection 44 | bind 1 select-pane -t 1 45 | bind 2 select-pane -t 2 46 | bind 3 select-pane -t 3 47 | bind 4 select-pane -t 4 48 | bind 5 select-pane -t 5 49 | bind 6 select-pane -t 6 50 | bind 7 select-pane -t 7 51 | bind 8 select-pane -t 8 52 | bind 9 select-pane -t 9 53 | 54 | # Layouts 55 | set -g main-pane-width 260 56 | bind M select-layout main-vertical 57 | bind E select-layout even-horizontal 58 | 59 | # Pane resizing 60 | bind -r C-h resize-pane -L 5 61 | bind -r C-j resize-pane -D 5 62 | bind -r C-k resize-pane -U 5 63 | bind -r C-l resize-pane -R 5 64 | 65 | # Window movement 66 | # Only really makes sense if you have your parens bound to shifts like me. 67 | bind -r ( select-window -t :- 68 | bind -r ) select-window -t :+ 69 | bind-key -r H swap-window -t -1 70 | bind-key -r L swap-window -t +1 71 | 72 | # 256 colors please 73 | set -g default-terminal "screen-256color" 74 | 75 | # Bad Wolf 76 | set -g status-fg white 77 | set -g status-bg colour234 78 | set -g window-status-activity-attr bold 79 | set -g pane-border-fg colour245 80 | set -g pane-active-border-fg colour39 81 | set -g message-fg colour16 82 | set -g message-bg colour221 83 | set -g message-attr bold 84 | 85 | # Custom status bar 86 | # Powerline symbols: ⮂ ⮃ ⮀ ⮁ â­¤ 87 | set -g status-left-length 32 88 | set -g status-right-length 150 89 | set -g status-interval 5 90 | 91 | set -g status-left '#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour238,nobold]⮀#[fg=colour15,bg=colour238,bold] #(ls ~/.mail/steve-stevelosh.com/INBOX/cur ~/.mail/steve-stevelosh.com/INBOX/new | wc -l | tr -d " ") #[fg=colour238,bg=colour234,nobold]⮀' 92 | 93 | set -g status-right '#[fg=colour245]⮃ %R ⮃ %d %b #[fg=colour254,bg=colour234,nobold]#(rdio-current-track-tmux)⮂#[fg=colour16,bg=colour254,bold] #h ' 94 | 95 | set -g window-status-format "#[fg=white,bg=colour234] #I #W " 96 | set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=colour16,bg=colour39,noreverse,bold] #I ⮁ #W #[fg=colour39,bg=colour234,nobold]⮀" 97 | 98 | # Activity 99 | setw -g monitor-activity on 100 | set -g visual-activity off 101 | 102 | # Autorename sanely. 103 | setw -g automatic-rename on 104 | 105 | # Better name management 106 | bind c new-window 107 | bind , command-prompt "rename-window '%%'" 108 | 109 | # Copy mode 110 | setw -g mode-keys vi 111 | bind ` copy-mode 112 | unbind [ 113 | unbind p 114 | bind p paste-buffer 115 | bind -t vi-copy H start-of-line 116 | bind -t vi-copy L end-of-line 117 | bind -t vi-copy v begin-selection 118 | bind -t vi-copy y copy-selection 119 | bind -t vi-copy Escape cancel 120 | bind y run "tmux save-buffer - | reattach-to-user-namespace pbcopy" 121 | -------------------------------------------------------------------------------- /vim/vim.symlink/autoload/pathogen.vim: -------------------------------------------------------------------------------- 1 | " pathogen.vim - path option manipulation 2 | " Maintainer: Tim Pope 3 | " Version: 2.2 4 | 5 | " Install in ~/.vim/autoload (or ~\vimfiles\autoload). 6 | " 7 | " For management of individually installed plugins in ~/.vim/bundle (or 8 | " ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your 9 | " .vimrc is the only other setup necessary. 10 | " 11 | " The API is documented inline below. For maximum ease of reading, 12 | " :set foldmethod=marker 13 | 14 | if exists("g:loaded_pathogen") || &cp 15 | finish 16 | endif 17 | let g:loaded_pathogen = 1 18 | 19 | function! s:warn(msg) 20 | echohl WarningMsg 21 | echomsg a:msg 22 | echohl NONE 23 | endfunction 24 | 25 | " Point of entry for basic default usage. Give a relative path to invoke 26 | " pathogen#incubate() (defaults to "bundle/{}"), or an absolute path to invoke 27 | " pathogen#surround(). For backwards compatibility purposes, a full path that 28 | " does not end in {} or * is given to pathogen#runtime_prepend_subdirectories() 29 | " instead. 30 | function! pathogen#infect(...) abort " {{{1 31 | for path in a:0 ? reverse(copy(a:000)) : ['bundle/{}'] 32 | if path =~# '^[^\\/]\+$' 33 | call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') 34 | call pathogen#incubate(path . '/{}') 35 | elseif path =~# '^[^\\/]\+[\\/]\%({}\|\*\)$' 36 | call pathogen#incubate(path) 37 | elseif path =~# '[\\/]\%({}\|\*\)$' 38 | call pathogen#surround(path) 39 | else 40 | call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') 41 | call pathogen#surround(path . '/{}') 42 | endif 43 | endfor 44 | call pathogen#cycle_filetype() 45 | return '' 46 | endfunction " }}}1 47 | 48 | " Split a path into a list. 49 | function! pathogen#split(path) abort " {{{1 50 | if type(a:path) == type([]) | return a:path | endif 51 | let split = split(a:path,'\\\@"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags')) 224 | silent! execute 'helptags' pathogen#fnameescape(dir.'/doc') 225 | endif 226 | endfor 227 | endfor 228 | endfunction " }}}1 229 | 230 | command! -bar Helptags :call pathogen#helptags() 231 | 232 | " Execute the given command. This is basically a backdoor for --remote-expr. 233 | function! pathogen#execute(...) abort " {{{1 234 | for command in a:000 235 | execute command 236 | endfor 237 | return '' 238 | endfunction " }}}1 239 | 240 | " Like findfile(), but hardcoded to use the runtimepath. 241 | function! pathogen#runtime_findfile(file,count) abort "{{{1 242 | let rtp = pathogen#join(1,pathogen#split(&rtp)) 243 | let file = findfile(a:file,rtp,a:count) 244 | if file ==# '' 245 | return '' 246 | else 247 | return fnamemodify(file,':p') 248 | endif 249 | endfunction " }}}1 250 | 251 | " Backport of fnameescape(). 252 | function! pathogen#fnameescape(string) abort " {{{1 253 | if exists('*fnameescape') 254 | return fnameescape(a:string) 255 | elseif a:string ==# '-' 256 | return '\-' 257 | else 258 | return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','') 259 | endif 260 | endfunction " }}}1 261 | 262 | if exists(':Vedit') 263 | finish 264 | endif 265 | 266 | let s:vopen_warning = 0 267 | 268 | function! s:find(count,cmd,file,lcd) " {{{1 269 | let rtp = pathogen#join(1,pathogen#split(&runtimepath)) 270 | let file = pathogen#runtime_findfile(a:file,a:count) 271 | if file ==# '' 272 | return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'" 273 | endif 274 | if !s:vopen_warning 275 | let s:vopen_warning = 1 276 | let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE' 277 | else 278 | let warning = '' 279 | endif 280 | if a:lcd 281 | let path = file[0:-strlen(a:file)-2] 282 | execute 'lcd `=path`' 283 | return a:cmd.' '.pathogen#fnameescape(a:file) . warning 284 | else 285 | return a:cmd.' '.pathogen#fnameescape(file) . warning 286 | endif 287 | endfunction " }}}1 288 | 289 | function! s:Findcomplete(A,L,P) " {{{1 290 | let sep = pathogen#separator() 291 | let cheats = { 292 | \'a': 'autoload', 293 | \'d': 'doc', 294 | \'f': 'ftplugin', 295 | \'i': 'indent', 296 | \'p': 'plugin', 297 | \'s': 'syntax'} 298 | if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0]) 299 | let request = cheats[a:A[0]].a:A[1:-1] 300 | else 301 | let request = a:A 302 | endif 303 | let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*' 304 | let found = {} 305 | for path in pathogen#split(&runtimepath) 306 | let path = expand(path, ':p') 307 | let matches = split(glob(path.sep.pattern),"\n") 308 | call map(matches,'isdirectory(v:val) ? v:val.sep : v:val') 309 | call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]') 310 | for match in matches 311 | let found[match] = 1 312 | endfor 313 | endfor 314 | return sort(keys(found)) 315 | endfunction " }}}1 316 | 317 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(,'edit',,0) 318 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(,'edit',,0) 319 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(,'edit',,1) 320 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(,'split',,1) 321 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(,'vsplit',,1) 322 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(,'tabedit',,1) 323 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(,'pedit',,1) 324 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(,'read',,1) 325 | 326 | " vim:set et sw=2: 327 | -------------------------------------------------------------------------------- /vim/vim.symlink/bundle/vim-sensible/plugin/sensible.vim: -------------------------------------------------------------------------------- 1 | " sensible.vim - Defaults everyone can agree on 2 | " Maintainer: Tim Pope 3 | " Version: 1.0 4 | 5 | if exists('g:loaded_sensible') || &compatible 6 | finish 7 | else 8 | let g:loaded_sensible = 1 9 | endif 10 | 11 | if has('autocmd') 12 | filetype plugin indent on 13 | endif 14 | if has('syntax') && !exists('g:syntax_on') 15 | syntax enable 16 | endif 17 | 18 | " Use :help 'option' to see the documentation for the given option. 19 | 20 | set autoindent 21 | set backspace=indent,eol,start 22 | set complete-=i 23 | set showmatch 24 | set smarttab 25 | 26 | set nrformats-=octal 27 | set shiftround 28 | 29 | set ttimeout 30 | set ttimeoutlen=50 31 | 32 | set incsearch 33 | " Use to clear the highlighting of :set hlsearch. 34 | if maparg('', 'n') ==# '' 35 | nnoremap :nohlsearch 36 | endif 37 | 38 | set laststatus=2 39 | set ruler 40 | set showcmd 41 | set wildmenu 42 | 43 | if !&scrolloff 44 | set scrolloff=1 45 | endif 46 | if !&sidescrolloff 47 | set sidescrolloff=5 48 | endif 49 | set display+=lastline 50 | 51 | if &encoding ==# 'latin1' && has('gui_running') 52 | set encoding=utf-8 53 | endif 54 | 55 | if &listchars ==# 'eol:$' 56 | set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+ 57 | if !has('win32') && (&termencoding ==# 'utf-8' || &encoding ==# 'utf-8') 58 | let &listchars = "tab:\u21e5 ,trail:\u2423,extends:\u21c9,precedes:\u21c7,nbsp:\u00b7" 59 | endif 60 | endif 61 | 62 | if &shell =~# 'fish$' 63 | set shell=/bin/bash 64 | endif 65 | 66 | set autoread 67 | set fileformats+=mac 68 | 69 | if &history < 1000 70 | set history=1000 71 | endif 72 | if &tabpagemax < 50 73 | set tabpagemax=50 74 | endif 75 | if !empty(&viminfo) 76 | set viminfo^=! 77 | endif 78 | 79 | " Allow color schemes to do bright colors without forcing bold. 80 | if &t_Co == 8 && $TERM !~# '^linux' 81 | set t_Co=16 82 | endif 83 | 84 | " Load matchit.vim, but only if the user hasn't installed a newer version. 85 | if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# '' 86 | runtime! macros/matchit.vim 87 | endif 88 | 89 | inoremap u 90 | 91 | " vim:set ft=vim et sw=2: 92 | -------------------------------------------------------------------------------- /vim/vimrc.symlink: -------------------------------------------------------------------------------- 1 | execute pathogen#infect() 2 | syntax on 3 | filetype plugin indent on 4 | -------------------------------------------------------------------------------- /zsh/zshrc.symlink: -------------------------------------------------------------------------------- 1 | ##~OH-MY-ZSH~# 2 | ## This section will be uncommented if: 3 | ## a.) You don't change this file and delete this section AND 4 | ## b.) You opt to install Oh-My_ZSH from the bootstratp 5 | # 6 | ## Path to your oh-my-zsh configuration. 7 | #export ZSH=$HOME/.oh-my-zsh 8 | # 9 | ## Set to the name theme to load. 10 | ## Look in ~/.oh-my-zsh/themes/ 11 | #export ZSH_THEME="robbyrussell" 12 | # 13 | ## Set to this to use case-sensitive completion 14 | ## export CASE_SENSITIVE="true" 15 | # 16 | ## Comment this out to disable weekly auto-update checks 17 | #export DISABLE_AUTO_UPDATE="true" 18 | # 19 | ## Uncomment following line if you want to disable colors in ls 20 | ## export DISABLE_LS_COLORS="true" 21 | # 22 | ## Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) 23 | ## Example format: plugins=(rails git textmate ruby lighthouse) 24 | #plugins=(osx git ruby gem node npm heroku cap bundler brew cake rails3 redis-cli zsh-syntax-highlighting) 25 | # 26 | #source $ZSH/oh-my-zsh.sh 27 | ##~/OH-MY-ZSH~# 28 | 29 | 30 | # Load ~/.exports, ~/.aliases, ~/.functions, ~/.fun, and ~/.extra 31 | for file in ~/.{exports,aliases,functions,fun,extra}; do 32 | [ -r "$file" ] && source "$file" 33 | done 34 | unset file 35 | --------------------------------------------------------------------------------