diff --git a/.aliases b/.aliases deleted file mode 100644 index 16b6fca7a3..0000000000 --- a/.aliases +++ /dev/null @@ -1,144 +0,0 @@ -# Easier navigation: .., ..., ...., ....., ~ and - -alias ..="cd .." -alias ...="cd ../.." -alias ....="cd ../../.." -alias .....="cd ../../../.." -alias ~="cd ~" # `cd` is probably faster to type though -alias -- -="cd -" - -# Shortcuts -alias d="cd ~/Documents/Dropbox" -alias dl="cd ~/Downloads" -alias dt="cd ~/Desktop" -alias p="cd ~/projects" -alias g="git" -alias h="history" -alias j="jobs" - -# Detect which `ls` flavor is in use -if ls --color > /dev/null 2>&1; then # GNU `ls` - colorflag="--color" -else # OS X `ls` - colorflag="-G" -fi - -# List all files colorized in long format -alias l="ls -lF ${colorflag}" - -# List all files colorized in long format, including dot files -alias la="ls -laF ${colorflag}" - -# List only directories -alias lsd="ls -lF ${colorflag} | grep --color=never '^d'" - -# Always use color output for `ls` -alias ls="command ls ${colorflag}" -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:' - -# Enable aliases to be sudo’ed -alias sudo='sudo ' - -# Get week number -alias week='date +%V' - -# Stopwatch -alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' - -# Get OS X Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages -alias update='sudo softwareupdate -i -a; brew update; brew upgrade; brew cleanup; npm install npm -g; npm update -g; sudo gem update --system; sudo gem update' - -# IP addresses -alias ip="dig +short myip.opendns.com @resolver1.opendns.com" -alias localip="ipconfig getifaddr en0" -alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'" - -# Flush Directory Service cache -alias flush="dscacheutil -flushcache && killall -HUP mDNSResponder" - -# Clean up LaunchServices to remove duplicates in the “Open With” menu -alias lscleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder" - -# View HTTP traffic -alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'" -alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\"" - -# Canonical hex dump; some systems have this symlinked -command -v hd > /dev/null || alias hd="hexdump -C" - -# OS X has no `md5sum`, so use `md5` as a fallback -command -v md5sum > /dev/null || alias md5sum="md5" - -# OS X has no `sha1sum`, so use `shasum` as a fallback -command -v sha1sum > /dev/null || alias sha1sum="shasum" - -# JavaScriptCore REPL -jscbin="/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc"; -[ -e "${jscbin}" ] && alias jsc="${jscbin}"; -unset jscbin; - -# Trim new lines and copy to clipboard -alias c="tr -d '\n' | pbcopy" - -# Recursively delete `.DS_Store` files -alias cleanup="find . -type f -name '*.DS_Store' -ls -delete" - -# Empty the Trash on all mounted volumes and the main HDD -# Also, clear Apple’s System Logs to improve shell startup speed -alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl" - -# Show/hide hidden files in Finder -alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" -alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder" - -# Hide/show all desktop icons (useful when presenting) -alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder" -alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder" - -# URL-encode strings -alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1]);"' - -# Merge PDF files -# Usage: `mergepdf -o output.pdf input{1,2,3}.pdf` -alias mergepdf='/System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py' - -# Disable Spotlight -alias spotoff="sudo mdutil -a -i off" -# Enable Spotlight -alias spoton="sudo mdutil -a -i on" - -# PlistBuddy alias, because sometimes `defaults` just doesn’t cut it -alias plistbuddy="/usr/libexec/PlistBuddy" - -# Ring the terminal bell, and put a badge on Terminal.app’s Dock icon -# (useful when executing time-consuming commands) -alias badge="tput bel" - -# Intuitive map function -# For example, to list all directories that contain a certain file: -# find . -name .gitattributes | map dirname -alias map="xargs -n1" - -# One of @janmoesen’s ProTip™s -for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do - alias "$method"="lwp-request -m '$method'" -done - -# Make Grunt print stack traces by default -command -v grunt > /dev/null && alias grunt="grunt --stack" - -# Stuff I never really use but cannot delete either because of http://xkcd.com/530/ -alias stfu="osascript -e 'set volume output muted true'" -alias pumpitup="osascript -e 'set volume 7'" - -# Kill all the tabs in Chrome to free up memory -# [C] explained: http://www.commandlinefu.com/commands/view/402/exclude-grep-from-your-grepped-output-of-ps-alias-included-in-description -alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill" - -# Lock the screen (when going AFK) -alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend" - -# Reload the shell (i.e. invoke as a login shell) -alias reload="exec $SHELL -l" - -# Faster npm for Europeans -command -v npm > /dev/null && alias npme="npm --registry http://registry.npmjs.eu/" diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index bec7553240..0000000000 --- a/.editorconfig +++ /dev/null @@ -1,8 +0,0 @@ -root = true - -[*] -charset = utf-8 -indent_style = tab -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/.exports b/.exports deleted file mode 100644 index 9f4406910f..0000000000 --- a/.exports +++ /dev/null @@ -1,25 +0,0 @@ -# Make vim the default editor -export EDITOR="vim"; - -# Larger bash history (allow 32³ entries; default is 500) -export HISTSIZE=32768; -export HISTFILESIZE=$HISTSIZE; -export HISTCONTROL=ignoredups; -# Make some commands not show up in history -export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"; - -# Prefer US English and use UTF-8 -export LANG="en_US.UTF-8"; -export LC_ALL="en_US.UTF-8"; - -# Highlight section titles in manual pages -export LESS_TERMCAP_md="${yellow}"; - -# Don’t clear the screen after quitting a manual page -export MANPAGER="less -X"; - -# Always enable colored `grep` output -export GREP_OPTIONS="--color=auto"; - -# Link Homebrew casks in `/Applications` rather than `~/Applications` -export HOMEBREW_CASK_OPTS="--appdir=/Applications"; diff --git a/.functions b/.functions deleted file mode 100644 index cd29e11223..0000000000 --- a/.functions +++ /dev/null @@ -1,246 +0,0 @@ -# Simple calculator -function calc() { - local result=""; - result="$(printf "scale=10;$*\n" | bc --mathlib | tr -d '\\\n')"; - # └─ default (when `--mathlib` is used) is 20 - # - if [[ "$result" == *.* ]]; then - # improve the output for decimal numbers - printf "$result" | - sed -e 's/^\./0./' `# add "0" for cases like ".5"` \ - -e 's/^-\./-0./' `# add "0" for cases like "-.5"`\ - -e 's/0*$//;s/\.$//'; # remove trailing zeros - else - printf "$result"; - fi; - printf "\n"; -} - -# Create a new directory and enter it -function mkd() { - mkdir -p "$@" && cd "$@"; -} - -# Change working directory to the top-most Finder window location -function cdf() { # short for `cdfinder` - cd "$(osascript -e 'tell app "Finder" to POSIX path of (insertion location as alias)')"; -} - -# Create a .tar.gz archive, using `zopfli`, `pigz` or `gzip` for compression -function targz() { - local tmpFile="${@%/}.tar"; - tar -cvf "${tmpFile}" --exclude=".DS_Store" "${@}" || return 1; - - size=$( - stat -f"%z" "${tmpFile}" 2> /dev/null; # OS X `stat` - stat -c"%s" "${tmpFile}" 2> /dev/null # GNU `stat` - ); - - local cmd=""; - if (( size < 52428800 )) && hash zopfli 2> /dev/null; then - # the .tar file is smaller than 50 MB and Zopfli is available; use it - cmd="zopfli"; - else - if hash pigz 2> /dev/null; then - cmd="pigz"; - else - cmd="gzip"; - fi; - fi; - - echo "Compressing .tar using \`${cmd}\`…"; - "${cmd}" -v "${tmpFile}" || return 1; - [ -f "${tmpFile}" ] && rm "${tmpFile}"; - echo "${tmpFile}.gz created successfully."; -} - -# Determine size of a file or total size of a directory -function fs() { - if du -b /dev/null > /dev/null 2>&1; then - local arg=-sbh; - else - local arg=-sh; - fi - if [[ -n "$@" ]]; then - du $arg -- "$@"; - else - du $arg .[^.]* *; - fi; -} - -# Use Git’s colored diff when available -hash git &>/dev/null; -if [ $? -eq 0 ]; then - function diff() { - git diff --no-index --color-words "$@"; - } -fi; - -# Create a data URL from a file -function dataurl() { - local mimeType=$(file -b --mime-type "$1"); - if [[ $mimeType == text/* ]]; then - mimeType="${mimeType};charset=utf-8"; - fi - echo "data:${mimeType};base64,$(openssl base64 -in "$1" | tr -d '\n')"; -} - -# Create a git.io short URL -function gitio() { - if [ -z "${1}" -o -z "${2}" ]; then - echo "Usage: \`gitio slug url\`"; - return 1; - fi; - curl -i http://git.io/ -F "url=${2}" -F "code=${1}"; -} - -# Start an HTTP server from a directory, optionally specifying the port -function server() { - local port="${1:-8000}"; - sleep 1 && open "http://localhost:${port}/" & - # Set the default Content-Type to `text/plain` instead of `application/octet-stream` - # And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files) - 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"; -} - -# Start a PHP server from a directory, optionally specifying the port -# (Requires PHP 5.4.0+.) -function phpserver() { - local port="${1:-4000}"; - local ip=$(ipconfig getifaddr en1); - sleep 1 && open "http://${ip}:${port}/" & - php -S "${ip}:${port}"; -} - -# Compare original and gzipped file size -function gz() { - local origsize=$(wc -c < "$1"); - local gzipsize=$(gzip -c "$1" | wc -c); - local ratio=$(echo "$gzipsize * 100 / $origsize" | bc -l); - printf "orig: %d bytes\n" "$origsize"; - printf "gzip: %d bytes (%2.2f%%)\n" "$gzipsize" "$ratio"; -} - -# Syntax-highlight JSON strings or files -# Usage: `json '{"foo":42}'` or `echo '{"foo":42}' | json` -function json() { - if [ -t 0 ]; then # argument - python -mjson.tool <<< "$*" | pygmentize -l javascript; - else # pipe - python -mjson.tool | pygmentize -l javascript; - fi; -} - -# Run `dig` and display the most useful info -function digga() { - dig +nocmd "$1" any +multiline +noall +answer; -} - -# UTF-8-encode a string of Unicode symbols -function escape() { - printf "\\\x%s" $(printf "$@" | xxd -p -c1 -u); - # print a newline unless we’re piping the output to another program - if [ -t 1 ]; then - echo ""; # newline - fi; -} - -# Decode \x{ABCD}-style Unicode escape sequences -function unidecode() { - perl -e "binmode(STDOUT, ':utf8'); print \"$@\""; - # print a newline unless we’re piping the output to another program - if [ -t 1 ]; then - echo ""; # newline - fi; -} - -# Get a character’s Unicode code point -function codepoint() { - perl -e "use utf8; print sprintf('U+%04X', ord(\"$@\"))"; - # print a newline unless we’re piping the output to another program - if [ -t 1 ]; then - echo ""; # newline - fi; -} - -# Show all the names (CNs and SANs) listed in the SSL certificate -# for a given domain -function getcertnames() { - if [ -z "${1}" ]; then - echo "ERROR: No domain specified."; - return 1; - fi; - - local domain="${1}"; - echo "Testing ${domain}…"; - echo ""; # newline - - local tmp=$(echo -e "GET / HTTP/1.0\nEOT" \ - | openssl s_client -connect "${domain}:443" -servername "${domain}" 2>&1); - - if [[ "${tmp}" = *"-----BEGIN CERTIFICATE-----"* ]]; then - local certText=$(echo "${tmp}" \ - | openssl x509 -text -certopt "no_aux, no_header, no_issuer, no_pubkey, \ - no_serial, no_sigdump, no_signame, no_validity, no_version"); - echo "Common Name:"; - echo ""; # newline - echo "${certText}" | grep "Subject:" | sed -e "s/^.*CN=//" | sed -e "s/\/emailAddress=.*//"; - echo ""; # newline - echo "Subject Alternative Name(s):"; - echo ""; # newline - echo "${certText}" | grep -A 1 "Subject Alternative Name:" \ - | sed -e "2s/DNS://g" -e "s/ //g" | tr "," "\n" | tail -n +2; - return 0; - else - echo "ERROR: Certificate not found."; - return 1; - fi; -} - -# `s` with no arguments opens the current directory in Sublime Text, otherwise -# opens the given location -function s() { - if [ $# -eq 0 ]; then - subl .; - else - subl "$@"; - fi; -} - -# `a` with no arguments opens the current directory in Atom Editor, otherwise -# opens the given location -function a() { - if [ $# -eq 0 ]; then - atom .; - else - atom "$@"; - fi; -} - -# `v` with no arguments opens the current directory in Vim, otherwise opens the -# given location -function v() { - if [ $# -eq 0 ]; then - vim .; - else - vim "$@"; - fi; -} - -# `o` with no arguments opens the current directory, otherwise opens the given -# location -function o() { - if [ $# -eq 0 ]; then - open .; - else - open "$@"; - fi; -} - -# `tre` is a shorthand for `tree` with hidden files and color enabled, ignoring -# the `.git` directory, listing directories first. The output gets piped into -# `less` with options to preserve color and line numbers, unless the output is -# small enough for one screen. -function tre() { - tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX; -} diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 6bdc702247..0000000000 --- a/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -# Automatically normalize line endings for all text-based files -#* text=auto -# Disabled because of https://github.com/mathiasbynens/dotfiles/issues/149 :( diff --git a/.hgignore b/.hgignore deleted file mode 100644 index ac1973e78e..0000000000 --- a/.hgignore +++ /dev/null @@ -1,17 +0,0 @@ -# Use shell-style glob syntax -syntax: glob - -# Compiled Python files -*.pyc - -# Folder view configuration files -.DS_Store -Desktop.ini - -# Thumbnail cache files -._* -Thumbs.db - -# Files that might appear on external disks -.Spotlight-V100 -.Trashes diff --git a/.irssi/.irssi b/.irssi/.irssi new file mode 120000 index 0000000000..9f884755bd --- /dev/null +++ b/.irssi/.irssi @@ -0,0 +1 @@ +/Users/mien/dotfiles/.irssi \ No newline at end of file diff --git a/.vimrc b/.vimrc index 0208ec29d6..65e2fe2df2 100644 --- a/.vimrc +++ b/.vimrc @@ -1,83 +1,100 @@ -" Vundle setup -set nocompatible -filetype off -set rtp+=~/.vim/bundle/Vundle.vim -call vundle#begin() -Plugin 'gmarik/Vundle.vim' - -"" Custom plugins goes here "" - -Bundle "chrisbra/color_highlight.git" -Bundle "skwp/vim-colors-solarized" -Bundle "itchyny/lightline.vim" -Bundle "jby/tmux.vim.git" -Bundle "morhetz/gruvbox" -Bundle "Xuyuanp/nerdtree-git-plugin" - -Bundle "gregsexton/gitv" -Bundle 'airblade/vim-gitgutter' -Bundle "tpope/vim-fugitive" - -Bundle "pangloss/vim-javascript" -Bundle "othree/javascript-libraries-syntax.vim" - -Bundle "groenewege/vim-less.git" -Bundle "itspriddle/vim-jquery.git" -Bundle "kchmck/vim-coffee-script" -Bundle "scrooloose/syntastic.git" -Bundle "vim-addon-mw-utils" -Bundle "SirVer/ultisnips" -Bundle "skwp/vim-html-escape" -Bundle "honza/vim-snippets" - -Bundle "scrooloose/nerdtree.git" -Bundle "kien/ctrlp.vim" - -Bundle "rking/ag.vim" -Bundle "vim-scripts/IndexedSearch" -Bundle "nelstrom/vim-visual-star-search" -Bundle "Lokaltog/vim-easymotion" - -Bundle "bootleq/vim-textobj-rubysymbol" -Bundle "coderifous/textobj-word-column.vim" -Bundle "kana/vim-textobj-datetime" -Bundle "kana/vim-textobj-entire" -Bundle "kana/vim-textobj-function" -Bundle "kana/vim-textobj-user" -Bundle "lucapette/vim-textobj-underscore" -Bundle "nathanaelkane/vim-indent-guides" -Bundle "nelstrom/vim-textobj-rubyblock" -Bundle "thinca/vim-textobj-function-javascript" -Bundle "vim-scripts/argtextobj.vim" - -Bundle "tpope/vim-abolish" -Bundle "tpope/vim-endwise.git" -Bundle "tpope/vim-ragtag" -Bundle "tpope/vim-repeat.git" -Bundle "tpope/vim-surround.git" -Bundle "tpope/vim-unimpaired" -Bundle "tpope/vim-dispatch" - -Bundle "Raimondi/delimitMate" -Bundle "Valloric/YouCompleteMe" -Bundle 'Shougo/vimproc' -Bundle 'Shougo/unite.vim' -" Bundle "m2mdas/phpcomplete-extended" - -Bundle 'othree/html5.vim' - -Bundle 'xolox/vim-misc' -Bundle 'xolox/vim-easytags' -Bundle 'majutsushi/tagbar' -Bundle 'bling/vim-airline' - - -"" END Plugins "" -call vundle#end() - -set autoindent +" Note: Skip initialization for vim-tiny or vim-small. +if 0 | endif + +if has('vim_starting') + if &compatible + set nocompatible " Be iMproved + endif + + " Required: + set runtimepath+=~/.vim/bundle/neobundle.vim/ +endif + +" Required: +call neobundle#begin(expand('~/.vim/bundle/')) + +" Let NeoBundle manage NeoBundle +" Required: +NeoBundleFetch 'Shougo/neobundle.vim' + +NeoBundle "chrisbra/color_highlight.git" +NeoBundle "skwp/vim-colors-solarized" +NeoBundle "itchyny/lightline.vim" +NeoBundle "jby/tmux.vim.git" +NeoBundle "morhetz/gruvbox" +NeoBundle "Xuyuanp/nerdtree-git-plugin" +NeoBundle "gregsexton/gitv" +NeoBundle 'airblade/vim-gitgutter' +NeoBundle "tpope/vim-fugitive" +NeoBundle "pangloss/vim-javascript" +NeoBundle "othree/javascript-libraries-syntax.vim" +NeoBundle "groenewege/vim-less.git" +NeoBundle "itspriddle/vim-jquery.git" +NeoBundle "kchmck/vim-coffee-script" +NeoBundle "scrooloose/syntastic.git" +NeoBundle "vim-addon-mw-utils" +NeoBundle "SirVer/ultisnips" +NeoBundle "skwp/vim-html-escape" +NeoBundle "honza/vim-snippets" +NeoBundle "scrooloose/nerdtree.git" +NeoBundle "kien/ctrlp.vim" +NeoBundle "rking/ag.vim" +NeoBundle "vim-scripts/IndexedSearch" +NeoBundle "nelstrom/vim-visual-star-search" +NeoBundle "Lokaltog/vim-easymotion" +NeoBundle "bootleq/vim-textobj-rubysymbol" +NeoBundle "coderifous/textobj-word-column.vim" +NeoBundle "kana/vim-textobj-datetime" +NeoBundle "kana/vim-textobj-entire" +NeoBundle "kana/vim-textobj-function" +NeoBundle "kana/vim-textobj-user" +NeoBundle "lucapette/vim-textobj-underscore" +NeoBundle "nathanaelkane/vim-indent-guides" +NeoBundle "nelstrom/vim-textobj-rubyblock" +NeoBundle "thinca/vim-textobj-function-javascript" +NeoBundle "vim-scripts/argtextobj.vim" +NeoBundle "tpope/vim-abolish" +NeoBundle "tpope/vim-endwise.git" +NeoBundle "tpope/vim-ragtag" +NeoBundle "tpope/vim-repeat.git" +NeoBundle "tpope/vim-surround.git" +NeoBundle "tpope/vim-unimpaired" +NeoBundle "tpope/vim-dispatch" +NeoBundle "Raimondi/delimitMate" +NeoBundle 'Shougo/vimproc.vim', { +\ 'build' : { +\ 'windows' : 'tools\\update-dll-mingw', +\ 'cygwin' : 'make -f make_cygwin.mak', +\ 'mac' : 'make -f make_mac.mak', +\ 'linux' : 'make', +\ 'unix' : 'gmake', +\ }, +\ } +NeoBundle 'Valloric/YouCompleteMe', { + \ 'build' : { + \ 'mac' : './install.sh --clang-completer --system-libclang --omnisharp-completer', + \ 'unix' : './install.sh --clang-completer --system-libclang --omnisharp-completer', + \ 'windows' : './install.sh --clang-completer --system-libclang --omnisharp-completer', + \ 'cygwin' : './install.sh --clang-completer --system-libclang --omnisharp-completer' + \ } + \ } + +NeoBundle 'Shougo/unite.vim' +NeoBundle 'othree/html5.vim' +NeoBundle 'xolox/vim-misc' +NeoBundle 'xolox/vim-easytags' +NeoBundle 'majutsushi/tagbar' +NeoBundle 'bling/vim-airline' + +call neobundle#end() + +" Required: filetype plugin indent on +" If there are uninstalled bundles found on startup, +" this will conveniently prompt you to install them. +NeoBundleCheck + " Use the Solarized Dark theme set background=dark colorscheme solarized @@ -89,12 +106,6 @@ set encoding=utf-8 nobomb " Don’t add empty newlines at the end of files set binary set noeol -" Centralize backups, swapfiles and undo history -set backupdir=~/.vim/backups -set directory=~/.vim/swaps -if exists("&undodir") - set undodir=~/.vim/undo -endif " Don’t create backups when editing files in certain directories set backupskip=/tmp/*,/private/tmp/* diff --git a/.zlogin b/.zlogin deleted file mode 100644 index 9911de58dc..0000000000 --- a/.zlogin +++ /dev/null @@ -1,23 +0,0 @@ -# -# Executes commands at login post-zshrc. -# -# Authors: -# Sorin Ionescu -# - -# Execute code that does not affect the current session in the background. -{ - # Compile the completion dump to increase startup speed. - zcompdump="${ZDOTDIR:-$HOME}/.zcompdump" - if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then - zcompile "$zcompdump" - fi -} &! - -# Print a random, hopefully interesting, adage. -if (( $+commands[fortune] )); then - if [[ -t 0 || -t 1 ]]; then - fortune -a - print - fi -fi diff --git a/.zlogout b/.zlogout deleted file mode 100644 index 7c27e88581..0000000000 --- a/.zlogout +++ /dev/null @@ -1,13 +0,0 @@ -# -# Executes commands at logout. -# -# Authors: -# Sorin Ionescu -# - -# Print the message. -cat <<-EOF - -Thank you. Come again! - -- Dr. Apu Nahasapeemapetilon -EOF diff --git a/.zpreztorc b/.zpreztorc index 32a6534ca2..e549d052a3 100644 --- a/.zpreztorc +++ b/.zpreztorc @@ -32,6 +32,17 @@ zstyle ':prezto:load' pmodule \ 'spectrum' \ 'utility' \ 'completion' \ + 'archive' \ + 'fasd' \ + 'git' \ + 'node' \ + 'python' \ + 'rails' \ + 'ruby' \ + 'ssh' \ + 'syntax-highlighting' \ + 'history' \ + 'history-substring-search' \ 'prompt' # @@ -63,7 +74,7 @@ zstyle ':prezto:module:editor' dot-expansion 'yes' # # Set the query found color. -# zstyle ':prezto:module:history-substring-search:color' found '' +zstyle ':prezto:module:history-substring-search:color' found '' # Set the query not found color. # zstyle ':prezto:module:history-substring-search:color' not-found '' @@ -117,31 +128,31 @@ zstyle ':prezto:module:prompt' theme 'steeef' # Set syntax highlighters. # By default, only the main highlighter is enabled. -# zstyle ':prezto:module:syntax-highlighting' highlighters \ -# 'main' \ -# 'brackets' \ -# 'pattern' \ -# 'cursor' \ -# 'root' +zstyle ':prezto:module:syntax-highlighting' highlighters \ + 'main' \ + 'brackets' \ + 'pattern' \ + 'cursor' \ + 'root' # # Set syntax highlighting styles. -# zstyle ':prezto:module:syntax-highlighting' styles \ -# 'builtin' 'bg=blue' \ -# 'command' 'bg=blue' \ -# 'function' 'bg=blue' +#zstyle ':prezto:module:syntax-highlighting' styles \ +# 'builtin' 'bg=blue' \ +# 'command' 'bg=yellow' \ +# 'function' 'bg=red' # # Terminal # # Auto set the tab and window titles. -# zstyle ':prezto:module:terminal' auto-title 'yes' +zstyle ':prezto:module:terminal' auto-title 'yes' # Set the window title format. -# zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s' +zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s' # Set the tab title format. -# zstyle ':prezto:module:terminal:tab-title' format '%m: %s' +zstyle ':prezto:module:terminal:tab-title' format '%m: %s' # # Tmux @@ -150,5 +161,5 @@ zstyle ':prezto:module:prompt' theme 'steeef' # Auto start a session when Zsh is launched in a local terminal. zstyle ':prezto:module:tmux:auto-start' local 'yes' -# Auto start a session when Zsh is launched in a SSH connection. -# zstyle ':prezto:module:tmux:auto-start' remote 'yes' +# Integrate with iTerm2. +zstyle ':prezto:module:tmux:iterm' integrate 'yes' zstyle ':prezto:module:tmux:auto-start' remote 'yes' diff --git a/.zprofile b/.zprofile deleted file mode 100644 index a9e374af22..0000000000 --- a/.zprofile +++ /dev/null @@ -1,77 +0,0 @@ -# -# Executes commands at login pre-zshrc. -# -# Authors: -# Sorin Ionescu -# - -# -# Browser -# - -if [[ "$OSTYPE" == darwin* ]]; then - export BROWSER='open' -fi - -# -# Editors -# - -export EDITOR='vi' -export VISUAL='vi' -export PAGER='less' - -# -# Language -# - -if [[ -z "$LANG" ]]; then - export LANG='en_US.UTF-8' -fi - -# -# Paths -# - -# Ensure path arrays do not contain duplicates. -typeset -gU cdpath fpath mailpath path - -# Set the the list of directories that cd searches. -# cdpath=( -# $cdpath -# ) - -# Set the list of directories that Zsh searches for programs. -path=( - /usr/local/{bin,sbin} - $path -) - -# -# Less -# - -# Set the default Less options. -# Mouse-wheel scrolling has been disabled by -X (disable screen clearing). -# Remove -X and -F (exit if the content fits on one screen) to enable it. -export LESS='-F -g -i -M -R -S -w -X -z-4' - -# Set the Less input preprocessor. -# Try both `lesspipe` and `lesspipe.sh` as either might exist on a system. -if (( $#commands[(i)lesspipe(|.sh)] )); then - export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-" -fi - -# -# Temporary Files -# - -if [[ ! -d "$TMPDIR" ]]; then - export TMPDIR="/tmp/$USER" - mkdir -p -m 700 "$TMPDIR" -fi - -TMPPREFIX="${TMPDIR%/}/zsh" -if [[ ! -d "$TMPPREFIX" ]]; then - mkdir -p "$TMPPREFIX" -fi diff --git a/.zshenv b/.zshenv deleted file mode 100644 index 2d97203180..0000000000 --- a/.zshenv +++ /dev/null @@ -1,11 +0,0 @@ -# -# Defines environment variables. -# -# Authors: -# Sorin Ionescu -# - -# Ensure that a non-login, non-interactive shell has a defined environment. -if [[ "$SHLVL" -eq 1 && ! -o LOGIN && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then - source "${ZDOTDIR:-$HOME}/.zprofile" -fi diff --git a/.zshrc b/.zshrc index 20419b2b7b..40ea86b31b 100644 --- a/.zshrc +++ b/.zshrc @@ -11,5 +11,6 @@ if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then fi # Customize to your needs... + bindkey -M viins '^r' history-incremental-search-backward bindkey -M vicmd '^r' history-incremental-search-backward diff --git a/bootstrap.sh b/bootstrap.sh index 0fa4c12f1f..913f740913 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,22 +1,37 @@ #!/usr/bin/env bash -cd "$(dirname "${BASH_SOURCE}")"; - -git pull origin master; - -function doIt() { - rsync --exclude ".git/" --exclude ".DS_Store" --exclude "bootstrap.sh" \ - --exclude "README.md" --exclude "LICENSE-MIT.txt" -avh --no-perms . ~; - source ~/.bash_profile; -} - -if [ "$1" == "--force" -o "$1" == "-f" ]; then - doIt; -else - read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1; - echo ""; - if [[ $REPLY =~ ^[Yy]$ ]]; then - doIt; - fi; -fi; -unset doIt; +dir=~/dotfiles +files=".curlrc .gitconfig .gitignore .gvimrc .hushlogin .inputrc .tmux.conf .vimrc .wgetrc .zlogin .zlogout .zpreztorc .zprofile .zshenv .zshrc .irssi" + + +########## + +# create dotfiles_old in homedir +echo -n "Creating $olddir for backup of any existing dotfiles in ~ ..." +mkdir -p $olddir +echo "done" + +# change to the dotfiles directory +echo -n "Changing to the $dir directory ..." +cd $dir +echo "done" + +# move any existing dotfiles in homedir to dotfiles_old directory, then create symlinks from the homedir to any files in the ~/dotfiles directory specified in $files +for file in $files; do + echo "Moving any existing dotfiles from ~ to $olddir" + mv ~/$file ~/dotfiles_old/ + echo "Creating symlink to $file in home directory." + ln -s $dir/$file ~/$file +done + +# Install NeoBundle +curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh > install.sh +sh ./install.sh + +# Install ZPrezto +git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" + +setopt EXTENDED_GLOB +for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do + ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" +done diff --git a/brew.sh b/brew.sh index 56598fc91d..035fbe2245 100755 --- a/brew.sh +++ b/brew.sh @@ -58,6 +58,7 @@ apps=( htop irssi cmake + fasd php55 php55-apcu php55-mcrypt @@ -119,12 +120,11 @@ brew cleanup brew linkapps -chsh -s /bin/zsh - # Other libs you might want sudo gem install bundler npm install -g grunt-cli +npm install -g gulp npm install -g bower vagrant plugin install vagrant-bindfs @@ -135,3 +135,13 @@ sudo gem install sass ln -sfv $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist ~/Library/LaunchAgents launchctl load -Fw ~/Library/LaunchAgents/homebrew.mxcl.dnsmasq.plist + +# Install ZPrezto +git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" + +setopt EXTENDED_GLOB +for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do + ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" +done + +chsh -s /bin/zsh diff --git a/init/Preferences.sublime-settings b/init/Preferences.sublime-settings deleted file mode 100644 index 1d190f97d9..0000000000 --- a/init/Preferences.sublime-settings +++ /dev/null @@ -1,41 +0,0 @@ -{ - "color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme", - "default_encoding": "UTF-8", - "default_line_ending": "unix", - "detect_indentation": false, - "draw_white_space": "all", - "ensure_newline_at_eof_on_save": false, - "file_exclude_patterns": - [ - ".DS_Store", - "Desktop.ini", - "*.pyc", - "._*", - "Thumbs.db", - ".Spotlight-V100", - ".Trashes" - ], - "folder_exclude_patterns": - [ - ".git", - "node_modules" - ], - "font_face": "Monaco", - "font_size": 13, - "highlight_modified_tabs": true, - "hot_exit": false, - "line_padding_bottom": 5, - "match_brackets": true, - "match_brackets_angle": true, - "remember_open_files": false, - "rulers": - [ - 80 - ], - "show_encoding": true, - "show_line_endings": true, - "tab_size": 2, - "translate_tabs_to_spaces": false, - "trim_trailing_white_space_on_save": true, - "word_wrap": true -} diff --git a/install.sh b/install.sh new file mode 100644 index 0000000000..850de72700 --- /dev/null +++ b/install.sh @@ -0,0 +1,76 @@ +#!/bin/sh +# Standalone installer for Unixs +# Original version is created by shoma2da +# https://github.com/shoma2da/neobundle_installer + +# Installation directory +BUNDLE_DIR=~/.vim/bundle +INSTALL_DIR=$BUNDLE_DIR/neobundle.vim + +if [ -e $INSTALL_DIR ]; then + echo "$INSTALL_DIR already exists!" + exit 1 +fi + +# check git command +if type git; then + : # You have git command. No Problem. +else + echo 'Please install git or update your path to include the git executable!' + exit 1; +fi + +# make bundle dir and fetch neobundle +echo "Begin fetching NeoBundle..." +mkdir -p $BUNDLE_DIR +git clone https://github.com/Shougo/neobundle.vim $INSTALL_DIR +echo "Done." + +# write initial setting for .vimrc +echo "Please add the following settings for NeoBundle to the top of your .vimrc file:" +{ + echo "" + echo "" + echo "\"NeoBundle Scripts-----------------------------" + echo "if has('vim_starting')" + echo " if &compatible" + echo " set nocompatible \" Be iMproved" + echo " endif" + echo "" + echo " \" Required:" + echo " set runtimepath+=$BUNDLE_DIR/neobundle.vim/" + echo "endif" + echo "" + echo "\" Required:" + echo "call neobundle#begin(expand('$BUNDLE_DIR'))" + echo "" + echo "\" Let NeoBundle manage NeoBundle" + echo "\" Required:" + echo "NeoBundleFetch 'Shougo/neobundle.vim'" + echo "" + echo "\" Add or remove your Bundles here:" + echo "NeoBundle 'Shougo/neosnippet.vim'" + echo "NeoBundle 'Shougo/neosnippet-snippets'" + echo "NeoBundle 'tpope/vim-fugitive'" + echo "NeoBundle 'ctrlpvim/ctrlp.vim'" + echo "NeoBundle 'flazz/vim-colorschemes'" + echo "" + echo "\" You can specify revision/branch/tag." + echo "NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' }" + echo "" + echo "\" Required:" + echo "call neobundle#end()" + echo "" + echo "\" Required:" + echo "filetype plugin indent on" + echo "" + echo "\" If there are uninstalled bundles found on startup," + echo "\" this will conveniently prompt you to install them." + echo "NeoBundleCheck" + echo "\"End NeoBundle Scripts-------------------------" + echo "" + echo "" +} +echo "Done." + +echo "Complete setup NeoBundle!" diff --git a/.osx b/osx.sh similarity index 100% rename from .osx rename to osx.sh