├── .Xdefaults ├── .autotest ├── .bash ├── bash_profile ├── colors ├── common ├── darwin_profile ├── functions ├── fzf ├── git ├── golang ├── node ├── ocaml.sh ├── profile ├── prompt.sh ├── python ├── rc.local_example ├── ruby.sh └── ssh.sh ├── .bash_profile ├── .bashrc ├── .ctags ├── .editrc ├── .emacs ├── .gemrc ├── .gitconfig ├── .gitconfig.files ├── COMMIT_EDITMSG ├── COMMIT_EDITMSG_START ├── README.md └── templates │ ├── hooks │ ├── bin │ │ ├── ctags │ │ ├── require-email │ │ ├── validate-no-merge-conflicts │ │ └── validate-no-stop-words │ ├── post-checkout │ ├── post-commit │ ├── post-merge │ ├── post-rewrite │ └── pre-commit │ └── info │ └── exclude ├── .gitignore ├── .gitignore-global ├── .gitmodules ├── .golangrc ├── .history └── .gitkeep ├── .ignore.grep ├── .inputrc ├── .irbrc ├── .local ├── bin │ └── .gitkeep ├── local.gitconfig-example └── rc.bash-example ├── .my.cnf ├── .npmrc ├── .osx ├── brew ├── defaults.sh └── mh.terminal ├── .profile ├── .pythonrc ├── .rdebugrc ├── .rspec ├── .ruby └── lib │ ├── gmarik │ ├── activerecord_ext.rb │ ├── all.rb │ ├── interactive_editor_ext.rb │ ├── irb-1.8-history-fix.rb │ └── utils.rb │ ├── no_deprecation_warnings_kthxbye.rb │ └── require_bench.rb ├── .rubyrc ├── .sbtconfig ├── .slate ├── .tmux.conf ├── .tmux └── default-command.sh ├── .toprc ├── .vim ├── vendor │ ├── snipmate.snippets │ │ ├── README.md │ │ └── snippets │ │ │ ├── _.snippets │ │ │ ├── go.snippets │ │ │ ├── javascript.snippets │ │ │ ├── ruby.snippets │ │ │ ├── sh.snippets │ │ │ ├── snippet.snippets │ │ │ └── vim.snippets │ └── vundle.vim │ │ ├── .gitignore │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE-MIT.txt │ │ ├── README.md │ │ ├── README_ZH_CN.md │ │ ├── README_ZH_TW.md │ │ ├── autoload │ │ ├── vundle.vim │ │ └── vundle │ │ │ ├── config.vim │ │ │ ├── installer.vim │ │ │ └── scripts.vim │ │ ├── changelog.md │ │ ├── doc │ │ └── vundle.txt │ │ ├── ftplugin │ │ └── vundlelog.vim │ │ ├── syntax │ │ └── vundlelog.vim │ │ └── test │ │ ├── files │ │ └── test.erl │ │ ├── minirc.vim │ │ └── vimrc └── vimrc ├── .vimrc ├── .vscode └── settings.json ├── .xinitrc ├── .xmodmap ├── .xsession ├── Library └── Application Support │ └── Code │ └── User │ └── settings.json └── bin ├── bak ├── date-iso-8601 ├── du-hrs ├── gifify ├── git-branch-cleanup ├── git-branch-diff ├── git-branch-merged-remotes ├── git-ls-files-untracked ├── git-mirror-dropbox ├── git-mirror-to ├── git-user-set ├── git-user-set-gmarik ├── go-cover-all ├── go-find-gopath ├── go-find-goroot ├── go-get-recursively ├── go-grep-gopath ├── go-grep-goroot ├── go-lint ├── go-tools-install ├── openssl-selfcert-gen ├── osx ├── makeapp.sh └── open_uri ├── repeat ├── serv_dir ├── ssh-keygen-public ├── watchme └── youtube-dl-mp3 /.Xdefaults: -------------------------------------------------------------------------------- 1 | *font: xft:Terminus:pixelsize=18 2 | 3 | urxvt*scrollBar: false 4 | urxvt*saveLines: 10000 5 | 6 | -------------------------------------------------------------------------------- /.autotest: -------------------------------------------------------------------------------- 1 | # http://rubydoc.info/gems/autotest/4.4.1/frames 2 | require 'autotest/growl' 3 | require 'autotest/fsevent' 4 | require 'autotest/restart' 5 | 6 | Autotest.add_hook :initialize do |at| 7 | %w[.sqlite. doc/ db/ log/ tmp/ .svn/ .hg/ .git/ vendor/ spec/fixtures/].each {|exception| at.add_exception(exception)} 8 | end 9 | 10 | # vim: ft=ruby 11 | -------------------------------------------------------------------------------- /.bash/bash_profile: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # http://gmarik.info/blog/2010/05/02/tracking-dotfiles-with-git 4 | 5 | so() { for f in $@; do [ -s $1 ] && source "$f"; done; } 6 | 7 | so ~/.bash/functions # 8 | so ~/.bash/colors # 9 | so ~/.bash/profile # main configuration 10 | so ~/.bash/${ENV_NAME}_profile # configuration per OS linux/OSX 11 | so ~/.bash/common # common stuff or overriding 12 | so ~/.bash/ssh.sh # ssh functions 13 | so ~/.bash/prompt.sh # PS1 prompt 14 | so ~/.bash/ocaml.sh # 15 | 16 | so ~/.bash/git # 17 | so ~/.bash/python # 18 | so ~/.bash/node # Node stuff. 19 | so ~/.bash/ruby.sh # 20 | so ~/.rubyrc # Ruby stuff. 21 | so ~/.bash/golang # Golang Stuff 22 | so ~/.golangrc # Golang Stuff 23 | so ~/.local/*.bash # machine specific config. not tracked 24 | 25 | [ -d ~/bin ] && export PATH=~/bin:$PATH # users' ~/bin/ takes precedence 26 | [ -d ~/.local/bin ] && export PATH=~/.local/bin:$PATH # untracked local stuff 27 | 28 | # vim: ft=sh 29 | -------------------------------------------------------------------------------- /.bash/colors: -------------------------------------------------------------------------------- 1 | #https://wiki.archlinux.org/index.php/Color_Bash_Prompt 2 | # ^[ is entered as CTRL-v Esc 3 | 4 | tblk='' # Black - Regular 5 | tred='' # Red 6 | tgrn='' # Green 7 | tylw='' # Yellow 8 | tblu='' # Blue 9 | tpur='' # Purple 10 | tcyn='' # Cyan 11 | twht='' # White 12 | # Bold 13 | bblk='' # Black 14 | bred='' # Red 15 | bgrn='' # Green 16 | bylw='' # Yellow 17 | bblu='' # Blue 18 | bpur='' # Purple 19 | bcyn='' # Cyan 20 | bwht='' # White 21 | # Underline 22 | ublk='' # Black 23 | ured='' # Red 24 | ugrn='' # Green 25 | uylw='' # Yellow 26 | ublu='' # Blue 27 | upur='' # Purple 28 | ucyn='' # Cyan 29 | uwht='' # White 30 | # Background 31 | bgblk='' # Black 32 | bgred='' # Red 33 | bggrn='' # Green 34 | bgylw='' # Yellow 35 | bgblu='' # Blue 36 | bgpur='' # Purple 37 | bgcyn='' # Cyan 38 | bgwht='' # White 39 | 40 | rst='' # Text Reset 41 | 42 | # vim:ft=sh 43 | -------------------------------------------------------------------------------- /.bash/common: -------------------------------------------------------------------------------- 1 | # Disable annoying ~ expansion 2 | #http://www.linuxquestions.org/questions/linux-software-2/how-to-stop-bash-from-replacing-%7E-with-home-username-643162/#post3162026 3 | _expand() { return 0; } 4 | __expand_tilde_by_ref() { return 0; } 5 | 6 | 7 | # vim:ft=sh:ts=2: 8 | -------------------------------------------------------------------------------- /.bash/darwin_profile: -------------------------------------------------------------------------------- 1 | # vim: ts=2:sw=2:ft=sh:et 2 | # 3 | # Some OS X specific definitions 4 | 5 | # https://stackoverflow.com/questions/57972341/how-to-install-and-use-gnu-ls-on-macos 6 | # Make all GNU flavor commands available, may override same-name BSD flavor commands 7 | # For x86 Mac 8 | # export PATH="/usr/local/opt/coreutils/libexec/gnubin:${PATH}" 9 | # export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:${MANPATH}" 10 | 11 | # For M1 Mac 12 | export PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH" 13 | export MANPATH="/opt/homebrew/opt/findutils/libexec/gnuman:${MANPATH}" 14 | export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:${PATH}" 15 | export MANPATH="/opt/homebrew/opt/coreutils/libexec/gnuman:${MANPATH}" 16 | export PATH="/opt/homebrew/opt/grep/libexec/gnubin:$PATH" 17 | export MANPATH="/opt/homebrew/opt/grep/libexec/gnuman:$PATH" 18 | 19 | export MANPATH="/opt/homebrew/opt/parallel/share/man/:${MANPATH}" 20 | 21 | 22 | ## TODO improve 23 | alias ?="ggrep --color=auto --exclude-dir={$GREP_DIR_IGNORES} --exclude-from=$HOME/.ignore.grep" 24 | 25 | export PATH="/opt/homebrew/bin:${PATH}" 26 | export PATH="$HOME/bin:/usr/local/linkedin/bin:$PATH" 27 | 28 | if [ -f ~/Applications/MacVim.app/Contents/MacOS/Vim ] 29 | then 30 | vim="$HOME/Applications/MacVim.app/Contents/MacOS/Vim -n" 31 | alias vim="${vim}" 32 | elif [ -f /Applications/MacVim.app/Contents/MacOS/Vim ] 33 | then 34 | vim="/Applications/MacVim.app/Contents/MacOS/Vim -n" 35 | alias vim="${vim}" 36 | fi 37 | 38 | 39 | export VISUAL='code --wait -n' 40 | export EDITOR='code --wait -n' 41 | export SVN_EDITOR='code --wait -n' 42 | export GIT_EDITOR='code --wait -n' 43 | 44 | export MANPAGER=$_MANPAGER 45 | 46 | export LSCOLORS="ExGxBxDxCxEgEdxbxgxcxd" 47 | export CLICOLOR=true 48 | 49 | # export BREW_HOME=`brew --prefix` 50 | export BREW_HOME=/usr/local/ 51 | export PATH=$BREW_HOME/bin:$BREW_HOME/sbin:$PATH:/usr/local/mysql/bin 52 | 53 | # prevent auto-removals https://github.com/Homebrew/brew/issues/5654 54 | export HOMEBREW_NO_INSTALL_CLEANUP=TRUE 55 | 56 | # Bash completion 57 | [ -f /opt/local/etc/bash_completion ] && source /opt/local/etc/bash_completion 58 | [ -f $BREW_HOME/etc/bash_completion ] && source $BREW_HOME/etc/bash_completion 59 | [ -f $BREW_HOME/share/bash-completion/bash_completion ] && source $BREW_HOME/share/bash-completion/bash_completion 60 | 61 | export PATH=~/bin/osx:$PATH 62 | 63 | # alias 64 | alias ls='ls -h' 65 | alias df='df -h' 66 | 67 | # 68 | # rm 69 | # 70 | alias rm=trash 71 | 72 | # top running processes 73 | alias psg='ps -efwww | awk "{print $8}" | sort | uniq -c | sort -n | tail -3' 74 | 75 | # Slow terminal.app startup 76 | # http://superuser.com/questions/31403/how-can-i-speed-up-terminal-app-or-iterm-on-mac-osx 77 | alias rmasl='sudo rm -rf /private/var/log/asl/*.asl' 78 | 79 | # posgres 80 | # use readline instead libedit 81 | # alias psql='LD_PRELOAD=/usr/local/lib/libreadline.6.dylib \psql' 82 | 83 | #flush DNS cache 84 | alias dnsflush='dscacheutil -flushcache' 85 | 86 | 87 | -------------------------------------------------------------------------------- /.bash/functions: -------------------------------------------------------------------------------- 1 | # vim: ft=sh 2 | RCDIR=/etc/rc.d/ 3 | 4 | title() { 5 | export PROMPT_COMMAND="echo -ne \"\033]0;${1:?argument_required}\007\"" 6 | } 7 | 8 | _rc_service() 9 | { 10 | COMPREPLY=() 11 | cur="${COMP_WORDS[COMP_CWORD]}" 12 | prev="${COMP_WORDS[COMP_CWORD-1]}" 13 | 14 | local root=$RCDIR 15 | local items=$(ls -1 $root) 16 | 17 | COMPREPLY=($(compgen -W "${items}" -- "${cur}")) 18 | } 19 | 20 | rc() 21 | { 22 | sudo -p 'sudo password:' $RCDIR/$1 $2 23 | } 24 | 25 | complete -F _rc_service rc 26 | 27 | 28 | SRC_HOME=~/src/ 29 | 30 | _src_dir() 31 | { 32 | COMPREPLY=() 33 | cur="${COMP_WORDS[COMP_CWORD]}" 34 | prev="${COMP_WORDS[COMP_CWORD-1]}" 35 | 36 | local root=$SRC_HOME 37 | local projects=$(ls -1 $root) 38 | 39 | COMPREPLY=($(compgen -W "${projects}" -- "${cur}")) 40 | } 41 | 42 | src() 43 | { 44 | cd "$SRC_HOME/$1" 45 | } 46 | 47 | complete -F _src_dir src 48 | 49 | __basedir() { 50 | local wd; 51 | if [ "$(type -t __gitdir)" == "function" -a -n "$(__gitdir)" -a "$(__gitdir)" != ".git" ]; then 52 | local gd=$(__gitdir) 53 | wd=${gd%/.git} 54 | else 55 | wd=$(pwd) 56 | fi 57 | 58 | # echo "Root: ${tgrn}${wd}${trst}" 59 | 60 | echo "$wd" 61 | } 62 | -------------------------------------------------------------------------------- /.bash/fzf: -------------------------------------------------------------------------------- 1 | # vim: set ft=sh: 2 | 3 | # Use ~~ as the trigger sequence instead of the default ** 4 | export FZF_COMPLETION_TRIGGER='~~' 5 | 6 | # Options to fzf command 7 | export FZF_COMPLETION_OPTS='+c -x' 8 | 9 | # Use ag instead of the default find command for listing candidates. 10 | # - The first argument to the function is the base path to start traversal 11 | # - Note that ag only lists files not directories 12 | # - See the source code (completion.{bash,zsh}) for the details. 13 | # _fzf_compgen_path() { 14 | # find -g "" "$1" 15 | # } 16 | 17 | if [[ -n -z "$(which fzf)" ]]; then 18 | complete -F _fzf_file_completion -o default -o bashdefault 19 | fi 20 | -------------------------------------------------------------------------------- /.bash/git: -------------------------------------------------------------------------------- 1 | 2 | # vim: set ft=sh ts=2 sw=2 et: 3 | 4 | # TODO: fix on linux 5 | # source /usr/local/etc/bash_completion.d/git-*.sh 6 | # source /usr/local/etc/bash_completion.d/git-*.bash 7 | 8 | so /opt/homebrew/etc/bash_completion.d/git-completion.bash 9 | so /opt/homebrew/etc/bash_completion.d/git-prompt.sh 10 | so /usr/share/bash-completion/completions/git 11 | 12 | # to find current completion, run 13 | # $ complete -p git 14 | # complete -o bashdefault -o default -o nospace -F __git_wrap__git_main git 15 | # then use it for custom completions 16 | complete -o bashdefault -o default -o nospace -F __git_wrap__git_main G 17 | alias G='git' 18 | 19 | # automatically create aliases from git config 20 | galias () { 21 | # TODO: optimize it 22 | local aliases=$(git config --global --get-regexp 'alias.*'|cut -f1 -d' '|cut -f2 -d'.') 23 | for a in ${aliases}; do 24 | local _alias=${1:-:}${a} 25 | local cmd=`git config alias.$a|cut -f1 -d ' '` 26 | alias "$_alias"="git $a" 27 | complete -o default -o nospace -F _git_$cmd $_alias # allow git-completion to work with alias aswell 28 | done 29 | } 30 | 31 | # quick status stats over git repos, ie [1 M 1 D 59 ??] 32 | # which is 1 Modified 1 Deleted and 59 (??) Untracked files 33 | # use: _git_status_stats "%s" 34 | # depends on `__gitdir` from "bash-completion" package 35 | _git_status_stats() { 36 | if [ "$(type -t __gitdir)" != "function" ]; then 37 | return 1; 38 | fi 39 | if [ -n "$(__gitdir)" ]; then 40 | local stats=$(git status --short|cut -c1-2|sort|uniq -c|awk '{print $2":"$1 }'|xargs) 41 | if [ -n "$stats" ]; then 42 | printf "$1" "$stats" 43 | fi 44 | fi 45 | } 46 | 47 | 48 | 49 | # http://gmarik.info/blog/2010/05/02/tracking-dotfiles-with-git 50 | 51 | alias .G="git --work-tree=$HOME --git-dir=$HOME/dotfiles.git" 52 | # complete -o default -o nospace -F _git .G # allow git-completion to work with alias aswell 53 | complete -o bashdefault -o default -o nospace -F __git_wrap__git_main .G 54 | 55 | # vim: ft=sh:ts=2 56 | -------------------------------------------------------------------------------- /.bash/golang: -------------------------------------------------------------------------------- 1 | 2 | export GOPATH=~/.golang 3 | 4 | [ -d $GOPATH/bin ] && export PATH="$PATH:$GOPATH/bin" 5 | 6 | # vim: set ft=sh: 7 | -------------------------------------------------------------------------------- /.bash/node: -------------------------------------------------------------------------------- 1 | # vim: set ft=sh: 2 | 3 | # node 4 | export PATH=$PATH:~/.npm-packages/bin/ 5 | 6 | -------------------------------------------------------------------------------- /.bash/ocaml.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #vim: set ft=sh; 3 | 4 | if [[ -r $HOME/.opam/opam-init/init.sh ]]; then 5 | 6 | source $HOME/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true 7 | 8 | # alias ocaml='ledit -h ~/.ocaml_history ocaml' # enable readline in interactive ocaml 9 | fi 10 | -------------------------------------------------------------------------------- /.bash/profile: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # vim: set ft=sh ts=2 sw=2 et: 4 | 5 | # 6 | # Environment 7 | # 8 | # 9 | 10 | # uses different history file 11 | export MY_SHELL_ENV=${MY_SHELL_ENV:-"bash"} 12 | 13 | export EDITOR='vim' 14 | export LESS="--RAW-CONTROL-CHARS --ignore-case" # colored, same as -R 15 | export PAGER='less' 16 | 17 | # common BSD/GNU 18 | export _MANPAGER='col -bx | view - -c ":set ls=0 ft=man nomod nolist nonu noma" -c ":nmap q :q"' 19 | export MANPAGER="/bin/bash -c '$_MANPAGER'" 20 | 21 | export ENV_NAME=$(uname -s|tr 'A-Z' 'a-z') 22 | # 23 | # Terminal 24 | # 25 | stty -ixon # disable XON/XOFF flow control 26 | # terminal wont treat ^s as flow control character 27 | # and ^s now can be used as shortcut 28 | 29 | # 30 | # Completion 31 | # 32 | [ -f /etc/bash_completion ] && source /etc/bash_completion 33 | 34 | # 35 | # History 36 | # 37 | shopt -s histappend # Append each(!) history entry from all terminals realtime(not after sesion ending) 38 | shopt -s cmdhist # store multiline commands as 1 line 39 | shopt -s cdspell # spelling error correction 40 | shopt -s checkwinsize # check the window size after each command and, if necessary, update the values of LINES and COLUMNS. 41 | export HISTCONTROL="ignoredups" # ignore duplicates(store command once) 42 | export HISTCONTROL="ignoreboth" 43 | export HISTIGNORE="&:ls:[bf]g:exit:%[0-9]" # ignore simple commands 44 | export HISTFILE=~/.history/${MY_SHELL_ENV}.bash_history 45 | export HISTTIMEFORMAT="%F %T " 46 | export HISTFILESIZE= # NOTE: effectively "unlimited", since it's defined but without value 47 | export HISTSIZE= # https://superuser.com/questions/137438/how-to-unlimited-bash-shell-history 48 | # https://unix.stackexchange.com/a/20925 49 | 50 | 51 | 52 | # 53 | # Grep 54 | # 55 | export GREP_DIR_IGNORES=".git/,.svn/,__MACOSX" 56 | alias ?="grep --color=auto --exclude-dir={$GREP_DIR_IGNORES} --exclude-from=$HOME/.ignore.grep" 57 | # recursivly search case insensitively, print filenames and line numbers with matches 58 | alias ??='? -Rin' 59 | # list files having matches 60 | alias ??l='? -Ril' 61 | 62 | # Find 63 | alias ?ff='f () { find ${2:-.} -type f -iname "*$1*"; }; f ' 64 | alias ?f='f () { find ${2:-.} -iname "*$1*"; }; f ' 65 | 66 | # 67 | # Less coloring 68 | # 69 | #export LESS_TERMCAP_mb=$'\E[01;31m' 70 | #export LESS_TERMCAP_md=$'\E[01;31m' 71 | #export LESS_TERMCAP_me=$'\E[0m' 72 | #export LESS_TERMCAP_se=$'\E[0m' 73 | #export LESS_TERMCAP_so=$'\E[01;44;33m' 74 | #export LESS_TERMCAP_ue=$'\E[0m' 75 | #export LESS_TERMCAP_us=$'\E[01;32m' 76 | 77 | # 78 | # Aliases 79 | # 80 | 81 | # admin 82 | alias S='sudo' 83 | complete -cf sudo 84 | complete -cf S 85 | 86 | alias dig='dig any' 87 | 88 | alias pm='pacman' 89 | alias k9='kill -9' 90 | alias ssn='sudo shutdown -h now' 91 | alias ps='ps -axf' 92 | alias ps?='ps -axf|? ' 93 | 94 | # shell 95 | alias ..='cd ..' 96 | alias ...='cd ../..' 97 | 98 | alias cp='cp -i' 99 | alias rm='rm -i' 100 | alias mv='mv -i' 101 | 102 | alias mcd='f () { mkdir -p $1 && cd $1; }; f ' 103 | alias mkdir='mkdir -p' 104 | alias md='mkdir' 105 | 106 | alias ls='ls -h --color=auto' 107 | alias l1='ls -1' 108 | alias ll='ls -l' 109 | alias la='ls -A' 110 | alias l='ls -l' 111 | 112 | alias du='du -sh' 113 | alias dua='\du -ah' 114 | 115 | alias df='df --human-readable' 116 | 117 | alias tf='tail -f ' 118 | 119 | # bash 120 | alias Brc='E ~/.bashrc && source ~/.bashrc' 121 | alias Bstats='f() { history|cut -d\ -f4-5|sort|uniq -c|sort -rn|head -${1:-30}; }; f' 122 | alias ,p='cd `mktemp -d /tmp/play-XXX`' 123 | 124 | # editor 125 | alias vi='vim' 126 | alias E='f(){ $EDITOR ${*:-.};}; f' 127 | alias EE='f(){ vim -g ${*:-} ;}; f' 128 | 129 | alias reload='exec bash -l' 130 | 131 | export CLICOLOR=1 132 | alias ls='ls --color --group-directories-first' 133 | alias ll='ls -l --color --group-directories-first' 134 | -------------------------------------------------------------------------------- /.bash/prompt.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Prompt command 3 | # 4 | bak_prompt () { 5 | PS1L=$(printf '%s' `basename $PWD`) 6 | PS1R=$(printf '%s' `dirname $PWD`) 7 | printf "%s>%$(( ${COLUMNS}-${#PS1L}-1 ))s" $PS1L $PS1R 8 | } 9 | 10 | ssh_prompt() { 11 | local ssh_host='' 12 | if [ "$SSH_CONNECTION" ]; then 13 | ssh_host="@$(hostname):" 14 | fi 15 | 16 | echo "$ssh_host" 17 | } 18 | 19 | 20 | # PS1='$(_prompt)  ' 21 | # PS1='$(_prompt) ' 22 | 23 | 24 | # 25 | # Prompt string 26 | # 27 | 28 | # https://wiki.archlinux.org/index.php/Bash/Prompt_customization 29 | # Note: Wrapping the output in \[ \] is recommended by the Bash man page. 30 | # This helps Bash ignore non-printable characters so that it correctly calculates the size of the prompt. 31 | # https://wiki.archlinux.org/index.php/Bash/Prompt_customization#Embedding_commands 32 | # https://unix.stackexchange.com/questions/105958/terminal-prompt-not-wrapping-correctly 33 | # ps1='\[${rst}${bwht}${bgblk}\]\D{%H:%M}' 34 | # ps1+='\[${rst}${bpur}\]$( __git_ps1 "%s" )' 35 | # ps1+='\[${rst}${tgrn}\]$( _git_status_stats "[%s]" )' 36 | # ps1+='\[${rst}${tylw}\]$( ssh_prompt)' 37 | # ps1+='\[${rst}${tred}\]$( V=$PIPESTATUS; if [[ $V -gt 0 ]]; then printf "%d" $V ; fi )' 38 | # ps1+='\n' 39 | # ps1+='\[${rst}${tylw}\]\W' 40 | # ps1+='\[${tgrn}\]\$' 41 | # ps1+='\[${rst}\] ' 42 | # 43 | # PS1="$ps1" 44 | 45 | # export PROMPT_COMMAND="_prompt;history -a" #evaluated each time command line-prompt is printed so we hook up history appending there 46 | 47 | # https://wiki.archlinux.org/index.php/Bash/Prompt_customization 48 | # Note: Wrapping the output in \[ \] is recommended by the Bash man page. 49 | # This helps Bash ignore non-printable characters so that it correctly calculates the size of the prompt. 50 | # https://wiki.archlinux.org/index.php/Bash/Prompt_customization#Embedding_commands 51 | # https://unix.stackexchange.com/questions/105958/terminal-prompt-not-wrapping-correctly 52 | ps1='\[${rst}${bwht}${bgblk}\]\D{%H:%M}' 53 | ps1+='\[${rst}${bpur}\]$( __git_ps1 "%s" )' 54 | ps1+='\[${rst}${tgrn}\]$( _git_status_stats "[%s]" )' 55 | ps1+='\[${rst}${tylw}\]$( ssh_prompt)' 56 | ps1+='\[${rst}${tred}\]$( V=$PIPESTATUS; if [[ $V -gt 0 ]]; then printf "%d" $V ; fi )' 57 | # https://apple.stackexchange.com/questions/139807/what-does-update-terminal-cwd-do-in-the-terminal-of-os-x/139808#139808 58 | [[ "$(type -t update_terminal_cwd)" == "function" ]] && ps1+='\[${rst}\]$(update_terminal_cwd)' 59 | ps1+='\[${rst}\]\n' 60 | ps1+='\[${rst}${tylw}\]\W' 61 | ps1+='\[${tgrn}\]\$' 62 | ps1+='\[${rst}\] ' 63 | 64 | PS1="$ps1" 65 | 66 | export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$"\n"}history -a" 67 | -------------------------------------------------------------------------------- /.bash/python: -------------------------------------------------------------------------------- 1 | # 2 | # Python 3 | # 4 | # vim: set ft=sh: 5 | 6 | test -f ~/.pythonrc && export PYTHONSTARTUP=~/.pythonrc 7 | 8 | -------------------------------------------------------------------------------- /.bash/rc.local_example: -------------------------------------------------------------------------------- 1 | [ -d ~/.rbenv ] && RUBIES+=(~/.rbenv/versions/*) 2 | 3 | 4 | # chruby 5 | so /usr/local/share/chruby/chruby.sh 6 | so /usr/local/share/chruby/auto.sh 7 | 8 | # default ruby 9 | chruby 2 10 | 11 | # OPAM configuration 12 | . /Users/gmarik/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true 13 | 14 | # vi: set ft=sh 15 | -------------------------------------------------------------------------------- /.bash/ruby.sh: -------------------------------------------------------------------------------- 1 | # vim: set ft=sh: 2 | 3 | rails_script () 4 | { 5 | local wd=$(__basedir) 6 | 7 | local lwd=`pwd` 8 | 9 | target=$1; shift 10 | if [ -f $wd/bin/rails ]; then 11 | cmd="$wd/bin/rails $target $@" 12 | elif [ -f $wd/script/rails ]; then 13 | cmd="$wd/script/rails $target $@" 14 | elif [ -f $wd/script/$target ]; then 15 | cmd="$lwd/script/$target $@" 16 | elif [ -f $lwd/script/rails ]; then 17 | cmd="$lwd/script/rails $target $@" 18 | elif [ -f $lwd/script/$target ]; then 19 | cmd="$lwd/script/$target $@" 20 | fi 21 | 22 | echo "${tgrn}Running${rst} $cmd" 23 | $cmd 24 | } 25 | 26 | # rails 27 | alias rails1='rails _1.2.6_' 28 | alias cap1='cap _1.4.0_' 29 | 30 | alias unexample="find ./config/ -name '*.example'|xargs basename -s .example | xargs -I % cp -i config/%{.example,}" 31 | alias Rdm='rake db:migrate' 32 | alias Rdmr='rake db:migrate:redo' 33 | 34 | .r() { touch "$(__basedir)/tmp/restart.txt" ; } 35 | 36 | Rc () { rails_script "console" $@ ; } 37 | Rs () { rails_script "server" $@ ; } 38 | Rg () { rails_script "generate" $@ ; } 39 | Rr () { rails_script "runner" $@ ; } 40 | 41 | Rgm() { rails_script "generate" "migration" $@ ; } 42 | Rgs() { rails_script "generate" "scaffold" $@ ; } 43 | Rgr() { rails_script "generate" "resource" $@ ; } 44 | 45 | Rsb() { DB_ENV=build Rs ; } 46 | Rss() { DB_ENV=staging Rs ; } 47 | Rsp() { DB_ENV=production Rs ; } 48 | 49 | Rcb() { DB_ENV=build Rc ; } 50 | Rcs() { DB_ENV=staging Rc ; } 51 | Rcp() { DB_ENV=production Rc ; } 52 | 53 | Rrb() { DB_ENV=build Rr ; } 54 | Rrs() { DB_ENV=staging Rr ; } 55 | Rrp() { DB_ENV=production Rr ; } 56 | 57 | 58 | -------------------------------------------------------------------------------- /.bash/ssh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ssh_prompt() { 4 | local ssh_host='' 5 | if [ "$SSH_CONNECTION" ]; then 6 | ssh_host="@$(hostname):" 7 | fi 8 | 9 | echo "$ssh_host" 10 | } 11 | -------------------------------------------------------------------------------- /.bash_profile: -------------------------------------------------------------------------------- 1 | [ -f ~/.bash/bash_profile ] && source ~/.bash/bash_profile 2 | -------------------------------------------------------------------------------- /.bashrc: -------------------------------------------------------------------------------- 1 | # .bashrc - gets executed for non-login shells 2 | # details: https://unix.stackexchange.com/questions/320465/new-tmux-sessions-do-not-source-bashrc-file 3 | source ~/.bash/bash_profile 4 | -------------------------------------------------------------------------------- /.ctags: -------------------------------------------------------------------------------- 1 | --recurse=yes 2 | 3 | --exclude=.git/ 4 | --exclude=.hg 5 | 6 | --exclude=log/ 7 | --exclude=tmp/ 8 | --exclude=vendor/ 9 | --exclude=build/ 10 | --exclude=libs/ 11 | 12 | 13 | --languages=-html 14 | --languages=-javascript 15 | --languages=-sql 16 | -------------------------------------------------------------------------------- /.editrc: -------------------------------------------------------------------------------- 1 | bind "^R" em-inc-search-prev 2 | -------------------------------------------------------------------------------- /.emacs: -------------------------------------------------------------------------------- 1 | (setenv "PATH" (concat "/usr/local/Cellar/smlnj/110.75/libexec/bin:" (getenv "PATH"))) 2 | (setq exec-path (cons "/usr/local/Cellar/smlnj/110.75/libexec/bin" exec-path)) 3 | -------------------------------------------------------------------------------- /.gemrc: -------------------------------------------------------------------------------- 1 | --- 2 | gem: --no-ri --no-rdoc 3 | :sources: 4 | - http://rubygems.org 5 | # specify other sources in your Gemfile 6 | :update_sources: true 7 | :verbose: true 8 | :benchmark: false 9 | :backtrace: false 10 | :bulk_threshold: 1000 11 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | # vim: st=2:ts=2:et:ft=gitconfig 2 | 3 | [core] 4 | 5 | excludesfile = ~/.gitignore-global 6 | quotepath = false 7 | commentChar = ? 8 | 9 | # see templatedir below 10 | # https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresshCommand 11 | # sshCommand=~/bin/git-ssh 12 | 13 | [init] 14 | templatedir = ~/.gitconfig.files/templates/ 15 | 16 | [commit] 17 | template = ~/.gitconfig.files/COMMIT_EDITMSG 18 | 19 | [push] 20 | default = current 21 | 22 | [color] 23 | branch = auto 24 | diff = auto 25 | status = auto 26 | grep = auto 27 | [color "branch"] 28 | current = yellow reverse 29 | local = yellow 30 | remote = green 31 | [color "diff"] 32 | meta = yellow bold 33 | frag = magenta bold 34 | old = red bold 35 | new = green bold 36 | [color "status"] 37 | added = yellow 38 | changed = green 39 | untracked = cyan 40 | 41 | [log] 42 | date = relative 43 | 44 | ; [apply] 45 | ; whitespace = fix 46 | ; 47 | [merge] 48 | tool = vimdiff 49 | guitool = p4merge 50 | 51 | [mergetool] 52 | prompt = false 53 | tool = vimdiff 54 | guitool = p4merge 55 | 56 | [mergetool "mvim"] 57 | cmd="/Applications/MacVim.app/Contents/MacOS/Vim -d -g -c 'wincmd J' $MERGED $LOCAL $BASE $REMOTE" 58 | keepbackup=false 59 | 60 | [mergetool "p4merge"] 61 | cmd="/Applications/p4merge.app/Contents/MacOS/p4merge $BASE $LOCAL $REMOTE $MERGED" 62 | keepbackup=false 63 | keepTemporaries = false 64 | 65 | [diff] 66 | tool = vimdiff 67 | guitool = p4merge 68 | 69 | [difftool] 70 | prompt = false 71 | 72 | [difftool "mvim"] 73 | # TODO: doesn't work 74 | cmd="~/Applications/MacVim.app/Contents/MacOS/Vim -d -g -c 'wincmd J' $LOCAL $REMOTE" 75 | 76 | [difftool "p4merge"] 77 | cmd="~/Applications/p4merge.app/Contents/Resources/launchp4merge $LOCAL $REMOTE" 78 | keepTemporaries = false 79 | trustExitCode = false 80 | keepBackup = false 81 | [format] 82 | # 83 | [pretty] 84 | # ll=tformat:%C(bold yellow)%h%Creset %s %C(bold blue)[%an]%Creset %Cblue{%G?}%Creset %Cgreen(%cr)%Creset 85 | log = fuller 86 | ll = format:%C(auto,yellow)%h%C(auto,reset) %s %C(auto,green)(%cr) %C(auto,bold blue) %an %C(auto,reset)%C(auto,red)%d%C(auto,reset) 87 | lh = format:%C(red)%d%Creset %C(yellow)%h%Creset %Cgreen(%cr)%Creset %s %C(bold blue) %an %Creset 88 | 89 | [alias] 90 | 91 | # Adding 92 | a = add 93 | ae = add --edit 94 | ai = add --interactive 95 | ap = add --patch 96 | au = add --update 97 | 98 | # Branching 99 | b = branch 100 | bls = branch -v # list branches with last commit in 101 | 102 | brm = branch -d # remove if branch-to-be-removed if fully merged into HEAD 103 | brmf = branch -D # force removal 104 | # blsm = "!git checkout -q master && git for-each-ref refs/heads/ --format=%(refname:short) | while read branch; do mergeBase=$(git merge-base master $branch) && [[ $(git cherry master $(git commit-tree $(git rev-parse $branch^{tree}) -p $mergeBase -m _)) == "-"* ]] && echo $branch; done" 105 | 106 | # bt - branch track configures current branch to "track" same name from origin or specified remote 107 | bt = "!f() { B=$(git symbolic-ref HEAD|cut -f3 -d/) && git config branch.$B.remote ${1:-origin} && git config branch.$B.merge refs/heads/$B; }; f" 108 | # rename branch 109 | bmv = branch -m 110 | 111 | # Config 112 | cg = config --global 113 | clg = config --global --list 114 | c = config 115 | cl = config --list 116 | ce = config --edit 117 | ceg = config --global --edit 118 | 119 | # Checkout 120 | co = checkout 121 | co- = checkout - # previous one 122 | cob = checkout -b # checkout into a new branch 123 | com = "!f() { git fetch; git checkout -b master origin/master; }; f" # checkout master branch 124 | cot = "!f() { git fetch; git checkout -b ${1##*/} $1; }; f " # 125 | con = "!f() { git fetch; git checkout -b $1 origin/master }; f " # new branch off master 126 | 127 | # fzf checkout 128 | zco = "!f() { git checkout $(git bls \"$@\"|grep -v '^*'|fzf|awk '{print $1}'); }; f" 129 | 130 | 131 | # Add and Commit 132 | ca = "!f() { git add $1; git ci -v $1; }; f" 133 | 134 | # Commit 135 | # commit all using previous commit message as a template 136 | cia = commit -a -e -C HEAD -v --reset-author --untracked-files=no 137 | 138 | # commit staged using prev commit message as a template 139 | ci = commit -v --untracked-files=no 140 | 141 | # commit using branch name as an initial msg 142 | ciab = !B=$(git symbolic-ref HEAD 2>/dev/null) && git commit -v -a --edit -m "${B##refs/heads/}:" --untracked-files=no 143 | 144 | # commit first 145 | cif = "!git ci --allow-empty -t ~/.gitconfig.files/COMMIT_EDITMSG_START" 146 | 147 | cii = commit --interactive 148 | 149 | # edit last commit's message 150 | cid = commit --amend --reset-author -v 151 | cide = commit --amend --reset-author -v --allow-empty 152 | cim = commit -m 153 | cip = commit -am 'WIP!' 154 | 155 | # change author of latest commit 156 | # assumes properly configured author to be now set in the local config 157 | ciu ="!git commit --amend --author=\"`git config --get user.name` <`git config --get user.email`>\"" 158 | 159 | chp = cherry-pick 160 | 161 | ctags = "!.git/hooks/ctags" 162 | 163 | # Diff 164 | d = diff 165 | ds = diff --staged 166 | du = diff @{upstream} 167 | dt = diff --stat=120,130 -M -C 168 | dls = diff --name-status -M -C 169 | 170 | # Edit files 171 | em = "!${EDITOR:-vim} $(git ls-files --modified)" 172 | ea = "!${EDITOR:-vim} $(git status --short --porcelain|cut -f2 -d' ')" 173 | 174 | # Grep 175 | g = "!git --no-pager grep --color --ignore-case -n" 176 | 177 | # GitK 178 | k = "!gitk &" 179 | 180 | # Log 181 | ll = log --pretty=ll --abbrev-commit # compact log 182 | l = log --pretty=log 183 | lt = log --pretty=log --name-status # terse log with filenames 184 | ls = log --pretty=log --stat 185 | lp = log --pretty=log --patch --color-moved -m -c # show merges and compressed diff format 186 | lpw = log --pretty=log --patch --color-moved --word-diff 187 | l1 = !"git --no-pager ll -10" 188 | lg = !git ll --graph 189 | lu = log @{upstream}.. --stat --no-merges 190 | llu = !git ll @{upstream}.. 191 | 192 | smartlog = log --all --graph --pretty=format:'commit: %C(bold red)%h%Creset %C(red)<%H>%Creset %C(bold magenta)%d %Creset%ndate: %C(bold yellow)%cd %Creset%C(yellow)%cr%Creset%nauthor: %C(bold blue)%an%Creset %C(blue)<%ae>%Creset%n%C(cyan)%s%n%Creset' 193 | sl = smartlog 194 | 195 | # Push 196 | po = push --set-upstream origin HEAD 197 | 198 | # Pull 199 | pu = pull 200 | pr = pull --rebase 201 | 202 | # patch 203 | # outputs to stdout instead of a-file-file-commit. Handy for dumping commit log into a file 204 | fps = format-patch --stdout 205 | 206 | # Rebase 207 | r = rebase 208 | ra = rebase --abort 209 | rc = rebase --continue 210 | ri = rebase --interactive 211 | ru = rebase --onto @{upstream} 212 | 213 | # interactive rebase mostly for squashing/rearranging commits 214 | # operates on last 2 if not specified otherwise 215 | rih = "!f() { git rebase -i HEAD~${1:-'2'}; }; f " 216 | 217 | # rebase up to the very first commit; special case 218 | riroot = rebase --interactive --root 219 | 220 | # Reset 221 | # resets staged chages 222 | rst = reset 223 | 224 | # resets last commit 225 | rstl = reset HEAD^ 226 | 227 | # select hunks to unstage|reset 228 | rstp = reset --patch 229 | 230 | # reset to @{upstream} with confirmation 231 | roh = "! git --no-pager ll -10 @{upstream} && read -p '^C to stop, anykey to continue' Z && git rst --hard @{upstream}" 232 | 233 | 234 | # Status 235 | # don't show untracked files 236 | st = status --short --branch --untracked-files=no 237 | # show all 238 | sta = status --short --branch --untracked-files=normal 239 | 240 | # Svn 241 | sv = svn 242 | svci = svn dcommit --no-rebase 243 | svr = svn rebase 244 | 245 | # sync 246 | sy = !git pull --rebase && git push 247 | 248 | sw = update-index --skip-worktree 249 | nosw = update-index --no-skip-worktree 250 | 251 | ta ="!f() { tn=$1; shift; git tag -a $tn -m $tn $@; }; f " 252 | 253 | # Merge Tool 254 | mt = "! [ -d /Applications/p4merge.app ] && git mtt p4merge || [ -d /Applications/MacVim.app ] && git mtt mvimdiff || git mtt vimdiff" 255 | mtt = mergetool -t 256 | 257 | # Show current `"user" ` configured 258 | w = "! echo \"$(git config user.name) <$(git config user.email)> \"" 259 | 260 | # me2 == "merge to" merge current branch to named one. 261 | # does 3 operations in one shot unless merge conflicts 262 | me2 = "!f() { git checkout $1 && git pull && git merge -; }; f " 263 | 264 | # codereview 265 | # http://gitready.com/advanced/2011/10/21/ribbon-and-catchup-reading-new-commits.html 266 | ribbon = tag --force _ribbon origin/master 267 | catchup = log --patch --reverse --topo-order _ribbon..origin/master 268 | 269 | sup = "!git ll --since=$([ $(date +%w) -eq 1 ] && date -v-3d +%F || date -v-1d +%F) --author=\"`git config user.name`\"" 270 | 271 | # ticket = "!f() { git checkout -b `echo $1|tr 'A-Z' 'a-z'` origin/master }; f " 272 | # 273 | # xargs 274 | # run command on modified files 275 | x = "!f() { git status --short --untracked-files=no | cut -d' ' -f3 | xargs $1; }; f" 276 | 277 | # 278 | # Branches 279 | # 280 | # List abandoned branches 281 | blsr = "!git for-each-ref refs/remotes/ --sort=authordate --format='%(color:cyan)%(authordate:format:%m/%d/%Y %I:%M %p) %(align:25,left)%(color:yellow)%(authorname)%(end) %(color:reset)%(refname:strip=2) %(color:green)%(subject)%(color:reset)'" 282 | 283 | # List local branches that has been squash-merged upstream but not cleaned locally 284 | blss = "!git fetch && git for-each-ref refs/heads/ '--format=%(refname:short)' | while read branch; do mergeBase=$(git merge-base origin/master $branch) && [[ $(git cherry origin/master $(git commit-tree $(git rev-parse $branch^{tree}) -p $mergeBase -m _)) == "-"* ]] && echo $branch; done" 285 | blsss = "!git for-each-ref --sort=-committerdate refs/heads/ --format='%(HEAD) %(color:yellow) %(align:45,left) %(refname:short)%(color:reset) %(end) %(color:red)%(objectname:short)%(color:reset) %(contents:subject) %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'" 286 | 287 | ## Hub 288 | hpr = "!hub pull-request --draft --browse" 289 | hbr = "!hub browse" 290 | h = "!hub " 291 | hprco = "!hub pr checkout" # expects the number 292 | hprls = "!hub pr list" 293 | # checkout a github PR without hub 294 | # https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/checking-out-pull-requests-locally 295 | #hprco = "!f() { local b=pull/$1; git fetch origin $b/head:$b; git checkout $b }; f" 296 | 297 | hpr = !gh pr create --draft 298 | hvi = !gh pr view 299 | 300 | # read from given uri 301 | # push to writable one 302 | # http://bit.ly/g9c9Y2 303 | 304 | [url "https://gist.github.com/"] 305 | insteadOf = "gist:" 306 | [url "git@gist.github.com:"] 307 | pushInsteadOf = "https://gist.github.com/" 308 | pushInsteadOf = "http://gist.github.com/" 309 | pushInsteadOf = "gist:" 310 | 311 | [url "git@heroku.com:"] 312 | insteadOf = "heroku:" 313 | 314 | [url "git@github.com:gmarik/"] 315 | pushInsteadOf = "gm:" 316 | insteadOf = "gm:" 317 | 318 | [url "https://github.com/gmarik/"] 319 | pushInsteadOf = "gm://" 320 | insteadOf = "gm://" 321 | 322 | 323 | [url "git@bitbucket.org:gmarik/"] 324 | insteadOf = "bbm:" 325 | pushInsteadOf = "bbm:" 326 | insteadOf = "bbm://" 327 | pushInsteadOf = "bbm://" 328 | 329 | [url "~/Dropbox/.gitrepos/"] 330 | insteadOf = "dx:" 331 | 332 | [include] 333 | path = ~/.local/local.gitconfig 334 | path = ~/.local/private.gitconfig 335 | 336 | # also see global config /Library/Developer/CommandLineTools/usr/share/git-core/gitconfig 337 | # docs: https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage 338 | # debugging: https://stackoverflow.com/questions/54176758/how-do-you-debug-git-credential-helpers 339 | # src: https://github.com/git/git/blob/7f4e64169352e03476b0ea64e7e2973669e491a2/contrib/credential/osxkeychain/git-credential-osxkeychain.c#L113 340 | # https://stackoverflow.com/questions/53419660/how-to-add-credentials-from-the-command-line-using-git-credential-osxkeychain-s 341 | # printf "protocol=https\nhost=github.com\nusername=$USER\npassword=$GITHUB_TOKEN\n" | git credential-osxkeychain store 342 | # printf "protocol=https\nhost=github.com\n" | git credential-osxkeychain get 343 | # [credential "https://github.com/workorg/*"] 344 | # username = workuser 345 | # useHttpPath=true 346 | # helper=osxkeychain 347 | -------------------------------------------------------------------------------- /.gitconfig.files/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | module: why is this? 2 | 3 | ## Context 4 | ## Problem 5 | ### Effects 6 | ### Workarounds 7 | ## Solution 8 | ### Change 9 | ### Risks 10 | 11 | ? ## Context: describe desired behavior 12 | ? ## Problem: cause(s) of undesired behavior 13 | ? ### Effects: consequences of the cause, undesired behavior 14 | ? ### Workarounds: if any 15 | ? ## Solution: how to address the cause 16 | ? ### Change: what changes 17 | ? ### Risks: potential issues as result of the change 18 | -------------------------------------------------------------------------------- /.gitconfig.files/COMMIT_EDITMSG_START: -------------------------------------------------------------------------------- 1 | 🚀: start: see ↓ 2 | 3 | ## Context 4 | ## Problem 5 | ### Effects 6 | ### Workarounds 7 | ## Solution 8 | ### Change 9 | ### Risks 10 | 11 | ? This template is intended for very first message of a new task 12 | ? ## Context: describe desired behavior 13 | ? ## Problem: cause(s) of undesired behavior 14 | ? ### Effects: consequences of the cause, undesired behavior 15 | ? ### Workarounds: if any 16 | ? ## Solution: how to address the cause 17 | ? ### Change: what changes 18 | ? ### Risks: potential issues as result of the change 19 | -------------------------------------------------------------------------------- /.gitconfig.files/README.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | ### templates/hooks/ 4 | 5 | - `ctags` related stuff comes from the TPope's [post](http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html) 6 | -------------------------------------------------------------------------------- /.gitconfig.files/templates/hooks/bin/ctags: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # tpope's http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html 3 | 4 | set -e 5 | PATH="/usr/local/bin:$PATH" 6 | trap "rm -f .git/tags.$$" EXIT 7 | ctags --tag-relative -f.git/tags.$$ 8 | mv .git/tags.$$ .git/tags 9 | 10 | # vim: set ft=sh 11 | -------------------------------------------------------------------------------- /.gitconfig.files/templates/hooks/bin/require-email: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | txtred='' # Red 4 | txtrst='' # Reset 5 | 6 | user=$(git config --local user.name) 7 | email=$(git config --local user.email) 8 | 9 | if [ "${user}" == "" -a "${name}" == "" ]; then 10 | echo "${txtred}" 11 | 12 | echo "You don't have user/email configured for this repo, please configure!" 13 | 14 | ~/bin/git-user-set 15 | echo ${txtrst} 16 | echo "Configured defaults: <$(git config --local user.name)> $(git config --local user.email)" 17 | 18 | exit 1 19 | fi 20 | 21 | # vim: set ft=sh: 22 | 23 | -------------------------------------------------------------------------------- /.gitconfig.files/templates/hooks/bin/validate-no-merge-conflicts: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | txtred='' # Red 4 | txtrst='' # Reset 5 | 6 | if [ -z $(git diff --cached | egrep ">>>>>>>|<<<<<<<") ]; then 7 | exit 0 8 | fi 9 | 10 | echo ${txtred} 11 | echo "merge conflict debris detected" 12 | echo ${txtrst} 13 | exit 1 14 | 15 | # vim: set ft=sh: 16 | 17 | -------------------------------------------------------------------------------- /.gitconfig.files/templates/hooks/bin/validate-no-stop-words: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | txtred='' # Red 4 | txtrst='' # Reset 5 | 6 | STOPWORDS="binding.pry|>>>>>>|<<<<<<<" 7 | 8 | OUT=$(git diff --cached | egrep "$STOPWORDS") 9 | 10 | if [ -n "$OUT" ]; then 11 | echo ${txtred} >&2 12 | echo "stop word(s) detected: $OUT" >&2 13 | echo ${txtrst} >&2 14 | fi 15 | 16 | exit 0 17 | 18 | # vim: set ft=sh: 19 | 20 | -------------------------------------------------------------------------------- /.gitconfig.files/templates/hooks/post-checkout: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | .git/hooks/bin/ctags >/dev/null 2>&1 & 4 | -------------------------------------------------------------------------------- /.gitconfig.files/templates/hooks/post-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | .git/hooks/ctags >/dev/null 2>&1 & 3 | -------------------------------------------------------------------------------- /.gitconfig.files/templates/hooks/post-merge: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | .git/hooks/ctags >/dev/null 2>&1 & 3 | 4 | -------------------------------------------------------------------------------- /.gitconfig.files/templates/hooks/post-rewrite: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | case "$1" in 3 | rebase) exec .git/hooks/post-merge ;; 4 | esac 5 | -------------------------------------------------------------------------------- /.gitconfig.files/templates/hooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | .git/hooks/bin/require-email 4 | .git/hooks/bin/validate-no-stop-words 5 | -------------------------------------------------------------------------------- /.gitconfig.files/templates/info/exclude: -------------------------------------------------------------------------------- 1 | ; local exclude files 2 | ; config/database.yml 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore all by default 2 | /* 3 | .vim/bundle 4 | 5 | # OSX 6 | ~/Library/Services/**/*.png 7 | 8 | # do not ignore: 9 | !.bash/ 10 | !.vim/ 11 | !.ruby/ 12 | !bin/ 13 | !.gitfiles/ 14 | -------------------------------------------------------------------------------- /.gitignore-global: -------------------------------------------------------------------------------- 1 | *.env 2 | .env 3 | 4 | *.local 5 | .vaultplainpass 6 | *.histfile 7 | 8 | TAGS 9 | tags 10 | 11 | # merge conflict 12 | *.orig 13 | 14 | # IntelliJ IDEA 15 | *.iml 16 | *.ipr 17 | *.iws 18 | # Eclipse / Java 19 | *.class 20 | target 21 | .metadata 22 | .cache 23 | .worksheet 24 | *.class 25 | target/ 26 | 27 | # Ruby 28 | .generators 29 | .rakeTasks 30 | 31 | # Python 32 | __pycache__/ 33 | *.py[cod] 34 | 35 | # OSX 36 | *.DS_Store 37 | __MACOSX/* 38 | 39 | 40 | # Xcode 41 | *.pbxuser 42 | *.mode1v3 43 | *.mode2v3 44 | *.perspectivev3 45 | *.xcuserstate 46 | project.xcworkspace/ 47 | xcuserdata/ 48 | 49 | # Vim 50 | .netrwhist 51 | 52 | # misc 53 | zeus.json 54 | 55 | # Golang 56 | vendor/pkg 57 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmarik/dotfiles/d6827428eefff2c2b4e194501d1ff067cfc90d8b/.gitmodules -------------------------------------------------------------------------------- /.golangrc: -------------------------------------------------------------------------------- 1 | export GOPATH=~/.golang 2 | 3 | export PATH=$PATH:$GOPATH/bin 4 | 5 | golang_setup() { 6 | set -e 7 | go get github.com/nsf/gocode 8 | go get code.google.com/p/go.tools/cmd/godoc 9 | 10 | # autoremove unused imports and delegate to format 11 | # let g:gofmt_command='goimports' in vim 12 | go get code.google.com/p/go.tools/cmd/goimports 13 | 14 | } 15 | 16 | # vim: ft=sh:ts=2 17 | -------------------------------------------------------------------------------- /.history/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmarik/dotfiles/d6827428eefff2c2b4e194501d1ff067cfc90d8b/.history/.gitkeep -------------------------------------------------------------------------------- /.ignore.grep: -------------------------------------------------------------------------------- 1 | TAGS 2 | tags 3 | 4 | *.class 5 | 6 | # Python 7 | __pycache__/ 8 | *.py[cod] 9 | 10 | # OSX 11 | *.DS_Store 12 | __MACOSX/* 13 | 14 | .git 15 | .svn 16 | -------------------------------------------------------------------------------- /.inputrc: -------------------------------------------------------------------------------- 1 | set editing-mode emacs # vi 2 | 3 | 4 | set bell-style visible 5 | set colored-stats on 6 | set completion-ignore-case on 7 | set completion-prefix-display-length 3 8 | set mark-directories on 9 | set mark-symlinked-directories on 10 | # set show-all-if-ambiguous on 11 | # set show-all-if-unmodified on 12 | set skip-completed-text on 13 | set visible-stats on 14 | 15 | 16 | set keymap emacs 17 | ## History navigation 18 | 19 | Control-p: history-search-backward 20 | Control-n: history-search-forward 21 | # "\C-p":history-search-backward 22 | # "\C-n":history-search-forward 23 | 24 | set show-all-if-ambiguous On 25 | set completion-ignore-case on 26 | 27 | # cycle through available options 28 | # TAB: menu-complete 29 | 30 | set keymap vi-command 31 | # "\e[A": history-search-backward 32 | # "\e[B": history-search-forward 33 | Control-p: history-search-backward 34 | Control-n: history-search-forward 35 | 36 | set keymap vi-insert 37 | # "\e[A": history-search-backward 38 | # "\e[B": history-search-forward 39 | Control-p: history-search-backward 40 | Control-n: history-search-forward 41 | 42 | -------------------------------------------------------------------------------- /.irbrc: -------------------------------------------------------------------------------- 1 | require 'pp' 2 | require 'irb/completion' 3 | require 'irb/ext/save-history' 4 | require 'gmarik/irb-1.8-history-fix' 5 | 6 | IRB.conf[:IRB_RC] = lambda { |context| 7 | require 'gmarik/all' 8 | } 9 | 10 | 11 | IRB.conf.merge!({ 12 | :USE_READLINE => true, 13 | :AUTO_INDENT => true, 14 | :SAVE_HISTORY => 1000, 15 | :PROMPT_MODE => :VERBOSE, 16 | :HISTORY_FILE => "#{ENV['HOME']}/.irb_history", 17 | }) 18 | 19 | IRB.conf[:PROMPT] ||= {} 20 | IRB.conf[:PROMPT][:VERBOSE] = { 21 | :PROMPT_I => "#{cwd = File.basename(Dir.pwd)}> ", 22 | :PROMPT_S => "#{cwd}* ", 23 | :PROMPT_C => "#{cwd}? ", 24 | :RETURN => "=> %s\n" 25 | } 26 | 27 | -------------------------------------------------------------------------------- /.local/bin/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gmarik/dotfiles/d6827428eefff2c2b4e194501d1ff067cfc90d8b/.local/bin/.gitkeep -------------------------------------------------------------------------------- /.local/local.gitconfig-example: -------------------------------------------------------------------------------- 1 | # vim: set ft=gitconfig: 2 | 3 | [user] 4 | email = gmarik+git@gmail.com 5 | name = gmarik 6 | 7 | [includeIf "gitdir:~/src/work/"] 8 | path = ~/.local/work.gitconfig 9 | 10 | [url "https://github.com/work/"] 11 | insteadOf = "work:" 12 | pushInsteadOf = "work:" 13 | 14 | # requires an access token https://github.com/settings/tokens 15 | # https://git-scm.com/docs/gitcredentials 16 | [credentials "https://github.com/work/"] 17 | username=workacct 18 | helper = osxkeychain 19 | # also match path ie `/work` 20 | useHttpPath=true 21 | -------------------------------------------------------------------------------- /.local/rc.bash-example: -------------------------------------------------------------------------------- 1 | # chruby 2 | [ -d ~/.rbenv ] && RUBIES+=(~/.rbenv/versions/*) 3 | 4 | # source /usr/local/share/chruby/chruby.sh 5 | # chruby 2 6 | -------------------------------------------------------------------------------- /.my.cnf: -------------------------------------------------------------------------------- 1 | [mysql_multi] 2 | user = mysql 3 | 4 | [mysqld2] 5 | port = 3307 6 | socket = /tmp/mysql2.sock 7 | datadir = /usr/local/var/mysql2 8 | server-id = 2 9 | 10 | #replication 11 | log-bin 12 | 13 | replicate-same-server-id = 0 14 | auto-increment-increment = 2 15 | auto-increment-offset = 2 16 | 17 | [mysqld3] 18 | port = 3308 19 | socket = /tmp/mysql3.sock 20 | datadir = /usr/local/var/mysql3 21 | server-id = 3 22 | 23 | #replication 24 | log-bin 25 | 26 | replicate-same-server-id = 0 27 | auto-increment-increment = 2 28 | auto-increment-offset = 2 29 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | prefix = ${HOME}/.npm-packages 2 | -------------------------------------------------------------------------------- /.osx/brew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | function App() { 4 | Brew cask install "${@}" #2> /dev/null 5 | } 6 | 7 | function Brew() { 8 | brew install "${@}" #2> /dev/null 9 | } 10 | 11 | # Install native apps 12 | # Brew tap caskroom/cask 13 | 14 | # Brew install brew-cask 15 | 16 | function Update { 17 | Brew update 18 | } 19 | 20 | function Dev { 21 | Brew git 22 | Brew hub 23 | Brew hg 24 | 25 | Brew socat 26 | 27 | # App iterm2 28 | App macvim 29 | 30 | App sequel-pro 31 | 32 | App p4v 33 | 34 | App docker 35 | 36 | # command-line tools 37 | xcode-select --install 38 | } 39 | 40 | function Ruby { 41 | Brew ruby-install 42 | Brew chruby 43 | } 44 | 45 | function Go { 46 | Brew go 47 | } 48 | 49 | function Tools { 50 | # CLI 51 | # 52 | # bash4 53 | Brew bash 54 | Brew bash-completion 55 | 56 | # Install GNU core utilities (those that come with OS X are outdated) 57 | Brew ctags 58 | Brew coreutils 59 | Brew binutils 60 | Brew findutils 61 | Brew diffutils 62 | Brew ed 63 | Brew gawk 64 | Brew gnu-indent 65 | Brew gnu-sed 66 | Brew gnu-tar 67 | Brew gnu-which 68 | Brew gnutls 69 | Brew grep # GNU grep instead of BSD one 70 | Brew gzip 71 | Brew watch 72 | Brew wdiff 73 | Brew wget 74 | 75 | Brew pstree 76 | Brew tree 77 | 78 | Brew tmux 79 | Brew reattach-to-user-namespace 80 | Brew entr # fs watcher entrproject.org 81 | 82 | Brew jq # json tool and formatter 83 | Brew html-xml-utils 84 | 85 | Brew rename 86 | Brew mmv # mass mv/link/cp/append http://manpages.ubuntu.com/manpages/precise/man1/mmv.1.html 87 | Brew rmtrash # aliases rm to delete to OSX's trash 88 | 89 | Brew fzf 90 | } 91 | 92 | # Make sure we’re using the latest Homebrew 93 | 94 | 95 | function Extra { 96 | Brew lynx 97 | 98 | Brew graphviz 99 | Brew imagemagick 100 | Brew rhino 101 | Brew webkit2png 102 | # Howto video->gif https://gist.github.com/dergachev/4627207 103 | Brew gifsicle 104 | } 105 | 106 | function Tools_Crypto { 107 | # EncFS 108 | App osxfuse 109 | Brew homebrew/fuse/encfs 110 | } 111 | 112 | 113 | 114 | 115 | # # GUI 116 | # # App virtualbox 117 | # App Dash # Documentation 118 | # # App Slack 119 | 120 | # App visual-studio-code 121 | 122 | # App Caskroom/cask/tunnelblick 123 | 124 | # App slate # OSX window manager 125 | 126 | # App google-chrome 127 | # #App google-chrome-canary 128 | 129 | # App imagealpha 130 | # App imageoptim 131 | # App the-unarchiver 132 | 133 | # App licecap 134 | # App keycastr 135 | 136 | # App miro-video-converter 137 | # App vlc 138 | 139 | # App tor-browser 140 | # App transmission 141 | 142 | # # App dropbox 143 | 144 | # # Remove outdated versions from the cellar 145 | # Brew cleanup 146 | 147 | function Main { 148 | for task in "$@"; do 149 | echo "running $task" 150 | $task 151 | done 152 | } 153 | 154 | if [[ "${BASH_SOURCE[0]}" = "$0" ]]; then 155 | echo $@ 156 | Main $@ 157 | fi -------------------------------------------------------------------------------- /.osx/defaults.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # vim: ft=sh 3 | 4 | # disable auto-switching desktops 5 | sudo defaults write com.apple.dock workspaces-auto-swoosh -bool NO 6 | 7 | killall Dock 8 | -------------------------------------------------------------------------------- /.osx/mh.terminal: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BackgroundBlur 6 | 0.0 7 | BackgroundColor 8 | 9 | YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS 10 | AAGGoKMHCA9VJG51bGzTCQoLDA0OV05TV2hpdGVcTlNDb2xvclNwYWNlViRjbGFzc00w 11 | IDAuODUwMDAwMDIAEAOAAtIQERITWiRjbGFzc25hbWVYJGNsYXNzZXNXTlNDb2xvcqIS 12 | FFhOU09iamVjdF8QD05TS2V5ZWRBcmNoaXZlctEXGFRyb290gAEIERojLTI3O0FIUF1k 13 | cnR2e4aPl5qjtbi9AAAAAAAAAQEAAAAAAAAAGQAAAAAAAAAAAAAAAAAAAL8= 14 | 15 | BlinkText 16 | 17 | CursorColor 18 | 19 | YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS 20 | AAGGoKMHCA9VJG51bGzTCQoLDA0OV05TV2hpdGVcTlNDb2xvclNwYWNlViRjbGFzc0sw 21 | LjMwMjQxOTM2ABADgALSEBESE1okY2xhc3NuYW1lWCRjbGFzc2VzV05TQ29sb3KiEhRY 22 | TlNPYmplY3RfEA9OU0tleWVkQXJjaGl2ZXLRFxhUcm9vdIABCBEaIy0yNztBSFBdZHBy 23 | dHmEjZWYobO2uwAAAAAAAAEBAAAAAAAAABkAAAAAAAAAAAAAAAAAAAC9 24 | 25 | Font 26 | 27 | YnBsaXN0MDDUAQIDBAUGGBlYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS 28 | AAGGoKQHCBESVSRudWxs1AkKCwwNDg8QVk5TU2l6ZVhOU2ZGbGFnc1ZOU05hbWVWJGNs 29 | YXNzI0AsAAAAAAAAEBCAAoADWkFuZGFsZU1vbm/SExQVFlokY2xhc3NuYW1lWCRjbGFz 30 | c2VzVk5TRm9udKIVF1hOU09iamVjdF8QD05TS2V5ZWRBcmNoaXZlctEaG1Ryb290gAEI 31 | ERojLTI3PEJLUltiaXJ0dniDiJOco6avwcTJAAAAAAAAAQEAAAAAAAAAHAAAAAAAAAAA 32 | AAAAAAAAAMs= 33 | 34 | FontAntialias 35 | 36 | FontWidthSpacing 37 | 0.99596774193548387 38 | Linewrap 39 | 40 | ProfileCurrentVersion 41 | 2.0499999999999998 42 | SelectionColor 43 | 44 | YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS 45 | AAGGoKMHCA9VJG51bGzTCQoLDA0OV05TV2hpdGVcTlNDb2xvclNwYWNlViRjbGFzc0sw 46 | LjI1NDAzMjI1ABADgALSEBESE1okY2xhc3NuYW1lWCRjbGFzc2VzV05TQ29sb3KiEhRY 47 | TlNPYmplY3RfEA9OU0tleWVkQXJjaGl2ZXLRFxhUcm9vdIABCBEaIy0yNztBSFBdZHBy 48 | dHmEjZWYobO2uwAAAAAAAAEBAAAAAAAAABkAAAAAAAAAAAAAAAAAAAC9 49 | 50 | ShowActiveProcessArgumentsInTitle 51 | 52 | ShowActivityIndicatorInTab 53 | 54 | ShowCommandKeyInTitle 55 | 56 | ShowDimensionsInTitle 57 | 58 | ShowShellCommandInTitle 59 | 60 | ShowTTYNameInTabTitle 61 | 62 | ShowWindowSettingsNameInTitle 63 | 64 | TextBoldColor 65 | 66 | YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS 67 | AAGGoKMHCA9VJG51bGzTCQoLDA0OV05TV2hpdGVcTlNDb2xvclNwYWNlViRjbGFzc0Ix 68 | ABADgALSEBESE1okY2xhc3NuYW1lWCRjbGFzc2VzV05TQ29sb3KiEhRYTlNPYmplY3Rf 69 | EA9OU0tleWVkQXJjaGl2ZXLRFxhUcm9vdIABCBEaIy0yNztBSFBdZGdpa3B7hIyPmKqt 70 | sgAAAAAAAAEBAAAAAAAAABkAAAAAAAAAAAAAAAAAAAC0 71 | 72 | TextColor 73 | 74 | YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS 75 | AAGGoKMHCA9VJG51bGzTCQoLDA0OV05TV2hpdGVcTlNDb2xvclNwYWNlViRjbGFzc0sw 76 | Ljk0NzU4MDY0ABADgALSEBESE1okY2xhc3NuYW1lWCRjbGFzc2VzV05TQ29sb3KiEhRY 77 | TlNPYmplY3RfEA9OU0tleWVkQXJjaGl2ZXLRFxhUcm9vdIABCBEaIy0yNztBSFBdZHBy 78 | dHmEjZWYobO2uwAAAAAAAAEBAAAAAAAAABkAAAAAAAAAAAAAAAAAAAC9 79 | 80 | UseBoldFonts 81 | 82 | UseBrightBold 83 | 84 | deleteSendsBackspace 85 | 86 | name 87 | mh 88 | shellExitAction 89 | 0 90 | type 91 | Window Settings 92 | useOptionAsMetaKey 93 | 94 | warnOnShellCloseAction 95 | 1 96 | 97 | 98 | -------------------------------------------------------------------------------- /.profile: -------------------------------------------------------------------------------- 1 | [ -f ~/.bashrc ] && source ~/.bashrc 2 | -------------------------------------------------------------------------------- /.pythonrc: -------------------------------------------------------------------------------- 1 | # Save as ~/.pythonrc and add 'export PYTHONSTARTUP=~/.pythonrc' to ~/.bashrc 2 | # from http://www.digitalprognosis.com/opensource/scripts/pythonrc 3 | 4 | try: 5 | import readline 6 | except ImportError: 7 | pass 8 | else: 9 | import os 10 | import atexit 11 | import rlcompleter 12 | 13 | class irlcompleter(rlcompleter.Completer): 14 | def complete(self, text, state): 15 | if text == "": 16 | readline.insert_text('\t') 17 | return None 18 | else: 19 | return rlcompleter.Completer.complete(self,text,state) 20 | 21 | # You could change this line to bind another key instead tab. 22 | readline.parse_and_bind("tab: complete") 23 | readline.set_completer(irlcompleter().complete) 24 | 25 | # Restore our command-line history, and save it when Python exits. 26 | historyPath = os.path.expanduser("~/.python_history") 27 | 28 | # Create a blank history file if it doesn't exist already 29 | if not os.path.exists(historyPath) and not os.path.isdir(historyPath): 30 | try: 31 | open(historyPath, 'w').close() 32 | # Gracefully ignore things if historyPath is not writable 33 | except IOError: 34 | pass 35 | 36 | # Read the history file in for autocompletion and save it on exit 37 | if os.access(historyPath, os.W_OK): 38 | atexit.register(lambda x=historyPath: readline.write_history_file(x)) 39 | 40 | if os.access(historyPath, os.R_OK): 41 | readline.read_history_file(historyPath) 42 | 43 | from pprint import pprint as pp 44 | from pprint import pformat as pf 45 | 46 | def t(*args): 47 | return timeit.Timer(*args).timeit() 48 | 49 | # vim: ft=python 50 | -------------------------------------------------------------------------------- /.rdebugrc: -------------------------------------------------------------------------------- 1 | set autolist 2 | set autoeval 3 | set autoreload 4 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | -------------------------------------------------------------------------------- /.ruby/lib/gmarik/activerecord_ext.rb: -------------------------------------------------------------------------------- 1 | module ActiveRecord 2 | class Base 3 | class << self 4 | def first 5 | find(:first, *args); 6 | end unless method_defined?(:first) 7 | 8 | def last 9 | find(:first, :order => 'id DESC' ); 10 | end unless method_defined?(:last) 11 | 12 | alias :[] :find unless method_defined?(:[]) 13 | alias :f :first 14 | alias :l :last 15 | end 16 | end 17 | end if defined?(::ActiveRecord) 18 | 19 | if defined?(::ActiveRecord) 20 | def DB!(db_env) 21 | ActiveRecord::Base.establish_connection(db_env) 22 | end 23 | 24 | def SQL(sql) 25 | ActiveRecord::Base.connection.select_all(sql) 26 | end 27 | 28 | def log!(stream = $stdout) 29 | ActiveRecord::Base.logger = Logger.new(stream) 30 | ActiveRecord::Base.clear_reloadable_connections! 31 | end 32 | 33 | def nolog!; log!(nil); end 34 | end 35 | -------------------------------------------------------------------------------- /.ruby/lib/gmarik/all.rb: -------------------------------------------------------------------------------- 1 | warn "auto-loading #{File.expand_path(__FILE__)}" 2 | 3 | require 'rubygems' 4 | 5 | require 'gmarik/utils' 6 | require 'gmarik/activerecord_ext' 7 | 8 | begin 9 | require 'interactive_editor' 10 | require 'gmarik/interactive_editor_ext' 11 | rescue LoadError 12 | warn '"interactive_editor" not loaded: gem install interactive_editor' 13 | end 14 | 15 | def d(*args) 16 | puts delim = "\n#{'!' * 20 }\n" 17 | p(*args) 18 | puts delim 19 | end 20 | 21 | # begin 22 | # require 'pry' 23 | # IRB=Pry 24 | # warn 'Pry IRBs you' 25 | # rescue LoadError 26 | # warn 'Pry is not available' 27 | # end 28 | -------------------------------------------------------------------------------- /.ruby/lib/gmarik/interactive_editor_ext.rb: -------------------------------------------------------------------------------- 1 | alias :e :vi if defined?(vi) && !defined?(e) 2 | -------------------------------------------------------------------------------- /.ruby/lib/gmarik/irb-1.8-history-fix.rb: -------------------------------------------------------------------------------- 1 | # http://stackoverflow.com/questions/2065923/irb-history-not-working 2 | module IRB 3 | # use at_exit hook instead finalizer to save history 4 | # as finalizer is NOT guaranteed to run 5 | def HistorySavingAbility.extended(obj); 6 | Kernel.at_exit{ HistorySavingAbility.create_finalizer.call } 7 | obj.load_history #TODO: super? 8 | obj 9 | end 10 | end if IRB::HistorySavingAbility.respond_to?(:create_finalizer) 11 | 12 | -------------------------------------------------------------------------------- /.ruby/lib/gmarik/utils.rb: -------------------------------------------------------------------------------- 1 | module Gmarik 2 | extend self 3 | 4 | def mps(entry = nil) 5 | puts entry if entry 6 | mm = `ps -p #{$$} -o rss -o %mem| tail -1`.strip.split(/\s+/) 7 | {:rss =>mm[0], :mem => mm[1]} 8 | end 9 | end 10 | 11 | -------------------------------------------------------------------------------- /.ruby/lib/no_deprecation_warnings_kthxbye.rb: -------------------------------------------------------------------------------- 1 | # see https://gist.github.com/1382974 2 | 3 | begin 4 | require 'rubygems' 5 | Gem::Deprecate.skip = true if defined?(Gem::Deprecate) 6 | rescue LoadError => e 7 | p e 8 | end 9 | 10 | -------------------------------------------------------------------------------- /.ruby/lib/require_bench.rb: -------------------------------------------------------------------------------- 1 | module Kernel 2 | 3 | alias require_orig_bench require 4 | 5 | def require(*args) 6 | from = Time.now.to_f 7 | $__deep ||= 0; $__deep += 1 8 | require_orig_bench(*args) 9 | $stderr.puts %Q[ #{" " * ($__deep - 1) } #{(Time.now.to_f - from).round(5)} in #{args.inspect} ] 10 | $__deep -= 1 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /.rubyrc: -------------------------------------------------------------------------------- 1 | # GC Settings 2 | # http://www.rubyenterpriseedition.com/documentation.html#_garbage_collector_and_object_space 3 | export RUBY_GC_HEAP_INIT_SLOTS=1000000 # initial(startup) number of the process heap slots to allocate 4 | export RUBY_HEAP_MIN_SLOTS=1000000 # for ruby < 2.1 5 | export RUBY_HEAP_SLOTS_INCREMENT=1000000 # first number of heap slots to add when allocating new 6 | export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 # increment multiplier to get next number of heap slots to allocate 7 | export RUBY_HEAP_FREE_MIN=100000 # minimum slots number to be present after GC run, triggers allocation otherwise 8 | export RUBY_GC_MALLOC_LIMIT=50000000 # malloc calls number GC gets triggered after 9 | 10 | # 11 | # http://tbaggery.com/2007/02/11/auto-loading-ruby-code.html 12 | 13 | if [ -d "$HOME/.ruby/lib/" ]; then 14 | RUBYLIB="$RUBYLIB:$HOME/.ruby/lib" 15 | #RUBYOPT="-rgmarik" 16 | RUBYOPT="-rno_deprecation_warnings_kthxbye" 17 | export RUBYLIB RUBYOPT 18 | fi 19 | 20 | #TODO: doenst work 21 | # http://jasonseifer.com/2010/05/05/osx-post-install-guide-4 22 | _mategem() 23 | { 24 | local curw 25 | COMPREPLY=() 26 | curw=${COMP_WORDS[COMP_CWORD]} 27 | local gems="$(gem environment gemdir)/gems" 28 | COMPREPLY=($(compgen -W '$(ls $gems)' -- $curw)); 29 | return 0 30 | } 31 | complete -F _mategem -o dirnames mategem 32 | 33 | # vim: ft=sh:ts=2 34 | -------------------------------------------------------------------------------- /.sbtconfig: -------------------------------------------------------------------------------- 1 | SBT_OPTS="-Xmx1024M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=512M" 2 | -------------------------------------------------------------------------------- /.slate: -------------------------------------------------------------------------------- 1 | # http://thume.ca/howto/2012/11/19/using-slate/ 2 | bonfig defaultToCurrentScreen true 3 | config nudgePercentOf screenSize 4 | config resizePercentOf screenSize 5 | 6 | config modalEscapeKey esc 7 | 8 | config secondsBetweenRepeat 0.1 9 | config checkDefaultsOnLoad true 10 | config focusCheckWidthMax 3000 11 | #config keyboardLayout dvorak 12 | config windowHintsShowIcons true 13 | config windowHintsIgnoreHiddenWindows false 14 | #config windowHintsDuration 5 15 | config windowHintsSpread true 16 | #config windowHintsOrder persist 17 | 18 | 19 | alias leader esc;cmd 20 | 21 | # General aliases 22 | alias sox screenOriginX 23 | alias soy screenOriginY 24 | alias ssx screenSizeX 25 | alias ssy screenSizeY 26 | 27 | # gs - golden secion 28 | alias gsl 0.6 29 | alias gsr 0.4 30 | 31 | alias fullscreen ${sox};${soy} ${ssx};${ssy} 32 | 33 | alias lefthalf ${sox};${soy} ${ssx}/2;${ssy} 34 | alias righthalf ${sox}+${ssx}/2;${soy} ${ssx}/2;${ssy} 35 | 36 | alias leftGs ${sox};${soy} ${ssx}*${gsl};${ssy} 37 | alias rightGs ${sox}+${ssx}*${gsl};${soy} ${ssx}*${gsr};${ssy} 38 | 39 | alias topleft corner top-left resize: ${ssx}/2;${ssy}/2 40 | alias topright corner top-right resize: ${ssx}/2;${ssy}/2 41 | alias bottomleft corner bottom-left resize: ${ssx}/2;${ssy}/2 42 | alias bottomright corner bottom-right resize: ${ssx}/2;${ssy}/2 43 | 44 | alias center screenOriginX+screenSizeX/2-windowSizeX/2;screenOriginY+screenSizeY/2-windowSizeY/2 windowSizeX;windowSizeY 45 | 46 | 47 | default three count:3 48 | default two count:2 49 | default one count:1 50 | 51 | layout three 'Xcode' move ${fullscreen} 1 52 | layout three 'Terminal' move ${fullscreen} 2 53 | layout three 'MacVim' move ${fullscreen} 0 54 | layout three 'Code' move ${fullscreen} 0 55 | 56 | layout two 'Xcode' move ${fullscreen} 0 57 | layout two 'Terminal' move ${rightGs} 0 58 | layout two 'MacVim' move ${leftGs} 0 59 | layout two 'Code' move ${leftGs} 0 60 | 61 | layout one 'Xcode' move ${fullscreen} 1 62 | layout one 'Terminal' move ${rightGs} 1 63 | layout one 'MacVim' move ${leftGs} 1 64 | layout one 'Code' move ${leftGs} 1 65 | 66 | # 67 | # Resize Bindings 68 | # 69 | # bind right:alt resize +10% +0 70 | # bind left:alt resize -10% +0 71 | # bind up:alt resize +0 -10% 72 | # bind down:alt resize +0 +10% 73 | # bind right:ctrl;alt resize -10% +0 bottom-right 74 | # bind left:ctrl;alt resize +10% +0 bottom-right 75 | # bind up:ctrl;alt resize +0 +10% bottom-right 76 | # bind down:ctrl;alt resize +0 -10% bottom-right 77 | 78 | # 79 | bind space:${leader} move ${fullscreen} 80 | 81 | # 82 | # Push Bindings 83 | # 84 | bind l:${leader} move ${rightGs} # push right bar-resize:screenSizeX/2 85 | bind h:${leader} move ${leftGs} # push left bar-resize:screenSizeX/2 86 | bind k:${leader} push up bar-resize:screenSizeY/2 87 | bind j:${leader} push down bar-resize:screenSizeY/2 88 | 89 | 90 | # 91 | # Nudge Bindings 92 | # 93 | # bind right:shift;alt nudge +10% +0 94 | # bind left:shift;alt nudge -10% +0 95 | # bind up:shift;alt nudge +0 -10% 96 | # bind down:shift;alt nudge +0 +10% 97 | # 98 | 99 | 100 | # 101 | # Throw Bindings 102 | # 103 | bind 1:${leader} throw 0 resize 104 | bind 2:${leader} throw 1 resize 105 | bind 3:${leader} throw 2 resize 106 | bind 4:${leader} throw 3 resize 107 | # bind 3:ctrl;alt throw 2 resize 108 | # bind right:ctrl;alt;cmd throw right resize 109 | # bind left:ctrl;alt;cmd throw left resize 110 | # bind up:ctrl;alt;cmd throw up resize 111 | # bind down:ctrl;alt;cmd throw down resize 112 | 113 | # 114 | # Focus Bindings 115 | # 116 | # bind right:cmd focus right 117 | # bind left:cmd focus left 118 | # bind up:cmd focus up 119 | # bind down:cmd focus down 120 | # bind up:cmd;alt focus behind 121 | # bind down:cmd;alt focus behind 122 | bind v:${leader} focus 'MacVim' 123 | bind t:${leader} focus 'Terminal' 124 | bind x:${leader} focus 'Xcode' 125 | bind b:${leader} focus 'Google Chrome' 126 | 127 | # Window Hints 128 | bind esc:alt hint 129 | 130 | # misc 131 | bind return:${leader} relaunch 132 | bind delete:${leader} undo 133 | 134 | bind `:${leader} grid padding:1 1:8,6 135 | 136 | # bind tab:cmd switch 137 | 138 | # bind esc:fn hint 139 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | # vim: ft=tmux ts=2 et: 2 | 3 | # leader binding 4 | unbind C-b 5 | set -g prefix M-a 6 | 7 | # set -g default-shell /usr/local/bin/bash 8 | # required. 9 | # otherwise clipboard copying issues 10 | # also `open .` fails 11 | # set -g default-command "~/.tmux/default-command.sh -l bash" 12 | set-option -g default-command "$HOME/.tmux/default-command.sh" 13 | 14 | bind M-a send-prefix 15 | bind-key a send-prefix 16 | 17 | # fix wait time for escape (helps with tmux and vim) 18 | set -s escape-time 0 19 | 20 | setw -g mode-keys vi 21 | bind h select-pane -L 22 | bind j select-pane -D 23 | bind k select-pane -U 24 | bind l select-pane -R 25 | 26 | bind L last-window 27 | bind n next-window 28 | bind N previous-window 29 | 30 | # start indexing windows from 1, just like tabs 31 | set -g base-index 1 32 | 33 | # set -g default-terminal "screen-256color" 34 | # set -g terminal-overrides 'xterm:colors=256' 35 | 36 | # setw -g automatic-rename on 37 | 38 | # window titles 39 | set -g set-titles on 40 | 41 | 42 | # display visible indicator of each pane 43 | # bind-key w display-panes 44 | 45 | bind-key S source-file $HOME/.tmux.conf; # refresh-client 46 | 47 | # swap panes 48 | 49 | bind-key -r J swap-pane -D 50 | bind-key -r K swap-pane -U 51 | 52 | 53 | # copying and pasting 54 | bind-key [ copy-mode 55 | bind-key ] paste-buffer -s \015 56 | 57 | # capture-pane -S -32768 58 | # tmux capture-pane -S -32768 -p|pbcopy 59 | # tmux save-buffer -| pbcopy 60 | # 61 | if-shell "uname | grep -q Darwin" { 62 | bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy' 63 | bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy' 64 | } { 65 | bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard' 66 | bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'xclip -in -selection clipboard' 67 | } 68 | 69 | # list all paste buffers (default key is '#') 70 | bind-key b list-buffers 71 | 72 | # choose buffer to paste interactively (default key was '=') 73 | bind-key p choose-buffer 74 | 75 | # delete the most recently copied buffer of text (default key was '-') 76 | bind-key x delete-buffer 77 | 78 | 79 | # Screen-like key bindings 80 | 81 | # new window 82 | bind-key C-c new-window -c "#{pane_current_path}" 83 | bind-key c new-window -c "#{pane_current_path}" 84 | 85 | # quit 86 | # bind-key \ confirm-before kill-server 87 | 88 | # displays 89 | bind-key * list-clients 90 | 91 | 92 | # Split windows like vim 93 | 94 | # alternatively, use better mnemonics for horizontal/vertical splits 95 | unbind '"' 96 | bind-key _ split-window -v -c "#{pane_current_path}" 97 | unbind '%' 98 | bind-key | split-window -h -c "#{pane_current_path}" 99 | 100 | # resize panes like vim 101 | bind-key -r < resize-pane -L 7 102 | bind-key -r > resize-pane -R 7 103 | bind-key -r + resize-pane -U 20 104 | bind-key -r - resize-pane -D 20 105 | 106 | # Statusbar settings 107 | 108 | # use vi-style key bindings in the status line 109 | set -g status-keys vi 110 | 111 | # amount of time for which status line messages and other indicators 112 | # are displayed. time is in milliseconds. 113 | set -g display-time 2000 114 | 115 | # default statusbar colors 116 | # set-option -g status-utf8 on 117 | set-option -g status-style fg=colour15,bg=black,none 118 | 119 | setw -g window-status-style fg=colour15,bg=black,none 120 | 121 | setw -g window-status-current-style fg=black,bg=color15 122 | setw -g window-status-current-format '► #[fg=black]#I#[default] #W#F ' 123 | setw -g window-status-format '#[fg=white]#I#[default] #W#F' 124 | 125 | # pane dividers colors 126 | 127 | setw -g pane-border-style fg=white 128 | 129 | setw -g pane-border-style fg=black 130 | setw -g pane-active-border-style fg=yellow,bg=blue 131 | 132 | 133 | set-option -g status-left '#S# #(whoami)@#H# |' 134 | set-option -g status-right '' 135 | 136 | set-option -g status-right-length 1000 137 | set-option -g status-left-length 60 138 | -------------------------------------------------------------------------------- /.tmux/default-command.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | user_shell="$SHELL" 4 | 5 | command_exists () { 6 | type "$1" &> /dev/null ; 7 | } 8 | 9 | 10 | platform="`uname -s|tr '[A-Z]' '[a-z]'`" 11 | 12 | case "${platform}" in 13 | darwin) 14 | if command_exists reattach-to-user-namespace; then 15 | # reattach-to-user-namespace -l sh ~/dotfiles/tmux/clipboard.sh & 16 | reattach-to-user-namespace -l "$user_shell" 17 | else 18 | echo "reattach-to-user-namespace not found \ 19 | $platform clipboard will not work \ 20 | you can: brew install reattach-to-user-namespace" 21 | 22 | exec $user_shell 23 | fi 24 | ;; 25 | linux) 26 | exec $user_shell;; 27 | *) 28 | exec $user_shell;; 29 | esac 30 | -------------------------------------------------------------------------------- /.toprc: -------------------------------------------------------------------------------- 1 | RCfile for "top with windows" # shameless braggin' 2 | Id:a, Mode_altscr=0, Mode_irixps=1, Delay_time=3.000, Curwin=0 3 | Def fieldscur=AEHIOQTWKNMbcdfgjplrsuvyzX 4 | winflags=47992, sortindx=16, maxtasks=0 5 | summclr=2, msgsclr=1, headclr=2, taskclr=2 6 | Job fieldscur=ABcefgjlrstuvyzMKNHIWOPQDX 7 | winflags=62777, sortindx=0, maxtasks=0 8 | summclr=6, msgsclr=6, headclr=7, taskclr=6 9 | Mem fieldscur=ANOPQRSTUVbcdefgjlmyzWHIKX 10 | winflags=62777, sortindx=13, maxtasks=0 11 | summclr=5, msgsclr=5, headclr=4, taskclr=5 12 | Usr fieldscur=ABDECGfhijlopqrstuvyzMKNWX 13 | winflags=62777, sortindx=4, maxtasks=0 14 | summclr=3, msgsclr=3, headclr=2, taskclr=3 15 | -------------------------------------------------------------------------------- /.vim/vendor/snipmate.snippets/README.md: -------------------------------------------------------------------------------- 1 | ## My humble snippet collection 2 | 3 | Snippets are very intimate pieces so using community curated ones do not work for me; so i'm brewing my custom here. 4 | 5 | You're unlikely to find anything more useful than this rant in here. 6 | 7 | -------------------------------------------------------------------------------- /.vim/vendor/snipmate.snippets/snippets/_.snippets: -------------------------------------------------------------------------------- 1 | # Global snippets 2 | 3 | # (c) holds no legal value ;) 4 | snippet c) 5 | Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${1:`g:snips_author`}. All Rights Reserved.${2} 6 | snippet date 7 | `strftime("%Y-%m-%d")` 8 | snippet ddate 9 | `strftime("%B %d, %Y")` 10 | 11 | snippet #v 12 | # vim: set ft=${1:sh}: 13 | 14 | # gpl 15 | snippet gpl 16 | /* 17 | * This program is free software; you can redistribute it and/or modify 18 | * it under the terms of the GNU General Public License as published by 19 | * the Free Software Foundation; either version 2 of the License, or 20 | * (at your option) any later version. 21 | * 22 | * This program is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * GNU General Public License for more details. 26 | * 27 | * You should have received a copy of the GNU General Public License 28 | * along with this program; if not, see . 29 | * 30 | * Copyright (C) ${1:Author}, `strftime("%Y")` 31 | */ 32 | 33 | ${0} 34 | 35 | -------------------------------------------------------------------------------- /.vim/vendor/snipmate.snippets/snippets/go.snippets: -------------------------------------------------------------------------------- 1 | 2 | snippet v 3 | ${1} := ${2} 4 | 5 | snippet vr 6 | var ${1:t} ${2:string} 7 | 8 | snippet var 9 | var ${1} ${2} = ${3:nil} 10 | 11 | snippet vars 12 | var ( 13 | ${1} ${2} = ${3} 14 | ) 15 | 16 | snippet ap 17 | append(${1:slice}, ${2:value}) 18 | 19 | snippet ch 20 | chan ${1:int} 21 | 22 | snippet co 23 | const ( 24 | ${1:NAME1} = iota 25 | ${2:NAME2} 26 | ) 27 | 28 | snippet im 29 | import ( 30 | "${1:package}" 31 | ) 32 | 33 | snippet in 34 | interface{} 35 | 36 | snippet inf 37 | interface ${1:name} { 38 | ${2:/* methods */} 39 | } 40 | 41 | snippet if 42 | if ${1:/* condition */} { 43 | ${2} 44 | } 45 | 46 | snippet el 47 | else { 48 | ${1} 49 | } 50 | 51 | snippet ir 52 | if err != nil { 53 | ${1:return err} 54 | } 55 | 56 | snippet irl 57 | if err != nil { 58 | log.Fatal(err) 59 | } 60 | 61 | snippet ie 62 | if ${1:/* condition */} { 63 | ${2} 64 | } else { 65 | ${3} 66 | } 67 | 68 | snippet fo 69 | for ${1:i} := 0; $1 < ${2:count}; $1${3:+=1} { 70 | ${3} 71 | } 72 | 73 | snippet df 74 | defer ${1:func}() 75 | 76 | snippet dfr 77 | defer func() { 78 | if val := recover(); val != nil { 79 | v := val.(type) 80 | ${1} 81 | } 82 | }() 83 | 84 | snippet fr 85 | for ${1:k}, ${2:v} := range ${3} { 86 | ${4} 87 | } 88 | 89 | # Functions 90 | 91 | snippet fn 92 | func ${1:funcName}(${2}) ${3:error} { 93 | return ${4:nil} 94 | } 95 | 96 | snippet fm 97 | func (${1:} *${2:T}) ${3:name}(${4}) ${5:error} { 98 | ${6:return nil} 99 | } 100 | 101 | snippet mk 102 | make(${1:[]atype}, ${2:0}) 103 | 104 | snippet map 105 | map[${1:keyType}]${2:valType} 106 | 107 | snippet main 108 | package main 109 | 110 | import ( 111 | "fmt" 112 | ) 113 | 114 | func main() { 115 | ${1} 116 | } 117 | 118 | 119 | snippet nw 120 | new(${1:type}) 121 | 122 | snippet pn 123 | panic("${1:msg}") 124 | 125 | snippet logp 126 | log.Println("${1}") 127 | 128 | snippet logf 129 | log.Printf("%${1:s}", ${2:var}) 130 | 131 | snippet pr 132 | fmt.Printf("%${1:s}\n", ${2:var}) 133 | 134 | snippet prn 135 | fmt.Println(${1:var}) 136 | 137 | snippet sp 138 | fmt.Sprintf("%${1:s}", ${2:var}) 139 | 140 | snippet sl 141 | select { 142 | case ${1:v1} := <-${2:chan1} 143 | ${3} 144 | case ${4:v2} := <-${5:chan2} 145 | ${6} 146 | default: 147 | ${7} 148 | } 149 | 150 | 151 | snippet tst 152 | type ${1:name} struct { 153 | ${2} 154 | } 155 | 156 | snippet sw 157 | switch ${1:var} { 158 | case ${2:value1}: 159 | ${3} 160 | case ${4:value2}: 161 | ${5} 162 | default: 163 | ${6} 164 | } 165 | 166 | snippet cs 167 | case ${1:value}: 168 | ${2} 169 | 170 | snippet gof 171 | go func(${1} ${2:type}) { 172 | ${3:/* code */} 173 | }(${4}) 174 | 175 | # 176 | # Testing 177 | # 178 | 179 | snippet Tt 180 | package main 181 | 182 | import ( 183 | "testing" 184 | ) 185 | 186 | func Test_X(t *testing.T) { 187 | } 188 | 189 | snippet Tfn 190 | func Test${1:name}(t *testing.T) { 191 | ${2} 192 | } 193 | 194 | snippet Tbm 195 | func Benchmark${1:name}(t *testing.T) { 196 | ${2} 197 | } 198 | 199 | snippet Tif 200 | var ( 201 | exp := ${1:hello} 202 | got := "got" 203 | ) 204 | 205 | if exp != got { 206 | t.Errorf("\nExp: %v\nGot: %v", exp, got) 207 | } 208 | 209 | snippet Tifr 210 | var ( 211 | exp = ${1:hello} 212 | got = "got" 213 | ) 214 | 215 | if !reflect.DeepEqual(exp, got) { 216 | t.Errorf("\nExp: %v\nGot: %v", exp, got) 217 | } 218 | 219 | snippet Tcas 220 | tcases := []struct { 221 | exp ${1:type1} 222 | in ${2:type2} 223 | }{ 224 | { 225 | ${3:values} 226 | ${4:values} 227 | }, 228 | } 229 | 230 | for _, tc := range tcases { 231 | t.Run("", func(t *testing.T){ 232 | var ( 233 | exp = tc.exp 234 | got = fn(tc.in) 235 | ) 236 | 237 | if !reflect.DeepEqual(exp, got) { 238 | t.Errorf("\nExp: %v\nGot: %v", exp, got) 239 | } 240 | }) 241 | } 242 | 243 | snippet Isort 244 | type sortT struct { m []T } 245 | 246 | func (s *sortT) Len() int { return len(s.m) } 247 | func (s *sortT) Swap(i, j int) { s.m[i], s.m[j] = s.m[j], s.m[i] } 248 | func (s *sortT) Less(i, j int) bool { return T(s.m[i]) < T(s.m[j]) } 249 | 250 | snippet Iomap 251 | ordered := make([]int, 0, len(sourceMap)) 252 | for r, _ := range sourceMap { 253 | ordered = append(ordered, r) 254 | } 255 | 256 | sort.Sort(&sortable{ordered}) 257 | -------------------------------------------------------------------------------- /.vim/vendor/snipmate.snippets/snippets/javascript.snippets: -------------------------------------------------------------------------------- 1 | # Prototype 2 | snippet proto 3 | ${1:class_name}.prototype.${2:method_name} = 4 | function(${3:first_argument}) { 5 | ${4:// body...} 6 | }; 7 | # Function 8 | snippet fun 9 | function ${1:function_name} (${2:argument}) { 10 | ${3:// body...} 11 | } 12 | # Anonymous Function 13 | snippet f 14 | function(${1}) {${2}} 15 | # if 16 | snippet if 17 | if (${1:true}) {${2}} 18 | # if ... else 19 | snippet ife 20 | if (${1:true}) {${2}} 21 | else{${3}} 22 | # tertiary conditional 23 | snippet t 24 | ${1:/* condition */} ? ${2:a} : ${3:b} 25 | # switch 26 | snippet switch 27 | switch(${1:expression}) { 28 | case '${3:case}': 29 | ${4:// code} 30 | break; 31 | ${5} 32 | default: 33 | ${2:// code} 34 | } 35 | # case 36 | snippet case 37 | case '${1:case}': 38 | ${2:// code} 39 | break; 40 | ${3} 41 | # for (...) {...} 42 | snippet for 43 | for (var ${2:i} = 0; $2 < ${1:Things}.length; $2${3:++}) { 44 | ${4:$1[$2]} 45 | }; 46 | # for (...) {...} (Improved Native For-Loop) 47 | snippet forr 48 | for (var ${2:i} = ${1:Things}.length - 1; $2 >= 0; $2${3:--}) { 49 | ${4:$1[$2]} 50 | }; 51 | # while (...) {...} 52 | snippet wh 53 | while (${1:/* condition */}) { 54 | ${2:/* code */} 55 | } 56 | # do...while 57 | snippet do 58 | do { 59 | ${2:/* code */} 60 | } while (${1:/* condition */}); 61 | # Object Method 62 | snippet :f 63 | ${1:method_name}: function(${2:attribute}) { 64 | ${4} 65 | }${3:,} 66 | # setTimeout function 67 | snippet timeout 68 | setTimeout(function() {${3}}${2}, ${1:10}; 69 | # Get Elements 70 | snippet get 71 | getElementsBy${1:TagName}('${2}')${3} 72 | # Get Element 73 | snippet gett 74 | getElementBy${1:Id}('${2}')${3} 75 | -------------------------------------------------------------------------------- /.vim/vendor/snipmate.snippets/snippets/ruby.snippets: -------------------------------------------------------------------------------- 1 | 2 | snippet #! 3 | #!/usr/bin/env ruby 4 | 5 | snippet y? 6 | yield ${1} if block_given? 7 | 8 | snippet br 9 | begin 10 | ${3} 11 | rescue ${1:Exception} => ${2:e} 12 | end 13 | 14 | snippet fo 15 | File.open('${1:file_name}', '${2:w+}') do |f| 16 | f.${3} 17 | end 18 | 19 | snippet req 20 | require "${1}"${2} 21 | 22 | snippet case 23 | case ${1:object} 24 | when ${2:condition} 25 | ${3} 26 | end 27 | 28 | snippet when 29 | when ${1:condition} then 30 | ${2} 31 | 32 | snippet def 33 | def ${1:method_name} 34 | ${2} 35 | end 36 | 37 | snippet deft 38 | def test_${1:case_name} 39 | ${2} 40 | end 41 | 42 | snippet defs 43 | def self.${1:class_method_name} 44 | ${2} 45 | end 46 | 47 | snippet if 48 | if ${1:condition} 49 | ${2} 50 | end 51 | snippet ife 52 | if ${1:condition} 53 | ${2} 54 | else 55 | ${3} 56 | end 57 | 58 | snippet while 59 | while ${1:condition} 60 | ${2} 61 | end 62 | 63 | snippet cla class .. end 64 | class ${1:`substitute(Filename(), '^.', '\u&', '')`} 65 | ${2} 66 | end 67 | 68 | snippet cla class .. initialize .. end 69 | class ${1:`substitute(Filename(), '^.', '\u&', '')`} 70 | def initialize(${2:args}) 71 | ${3} 72 | end 73 | 74 | end 75 | snippet cla class .. < ParentClass .. initialize .. end 76 | 77 | class ${1:`substitute(Filename(), '^.', '\u&', '')`} < ${2:ParentClass} 78 | def initialize(${3:args}) 79 | ${4} 80 | end 81 | 82 | end 83 | 84 | snippet cla ClassName = Struct .. do .. end 85 | ${1:`substitute(Filename(), '^.', '\u&', '')`} = Struct.new(:${2:attr_names}) do 86 | def ${3:method_name} 87 | ${4} 88 | end 89 | 90 | end 91 | 92 | snippet cla class BlankSlate .. initialize .. end 93 | class ${1:BlankSlate} 94 | instance_methods.each { |meth| undef_method(meth) unless meth =~ /\A__/ } 95 | snippet cla class << self .. end 96 | class << ${1:self} 97 | ${2} 98 | end 99 | 100 | snippet cla- 101 | class ${1:`substitute(Filename(), '^.', '\u&', '')`} < DelegateClass(${2:ParentClass}) 102 | def initialize(${3:args}) 103 | super(${4:del_obj}) 104 | 105 | ${5} 106 | end 107 | 108 | end 109 | 110 | snippet mod module .. end 111 | module ${1:`substitute(Filename(), '^.', '\u&', '')`} 112 | ${2} 113 | end 114 | 115 | 116 | snippet r 117 | attr_reader :${1:attr_names} 118 | 119 | snippet w 120 | attr_writer :${1:attr_names} 121 | 122 | snippet rw 123 | attr_accessor :${1:attr_names} 124 | 125 | snippet am 126 | alias_method :${1:new_name}, :${2:old_name} 127 | 128 | snippet al 129 | alias :${1:alias} :${2:name} 130 | 131 | snippet app 132 | if __FILE__ == $PROGRAM_NAME 133 | ${1} 134 | end 135 | 136 | snippet lam 137 | lambda { |${1:args}| ${2} } 138 | 139 | snippet -> 140 | ->(${1:args}) { ${2} } 141 | 142 | snippet do| 143 | do |${1:variable}| 144 | ${2} 145 | end 146 | 147 | snippet do 148 | do 149 | ${1} 150 | end 151 | 152 | snippet : => 153 | :${1:key} => ${2:"value"}${3} 154 | 155 | snippet : 156 | ${1:key}: ${2:"value"}${3} 157 | 158 | snippet ope 159 | open(${1:"path/or/url/or/pipe"}, "${2:w}") { |${3:io}| ${4} } 160 | 161 | snippet as 162 | assert(${1:test}, "${2:Failure message.}")${3} 163 | snippet ase 164 | assert_equal(${1:expected}, ${2:actual})${3} 165 | snippet asne 166 | assert_not_equal(${1:unexpected}, ${2:actual})${3} 167 | snippet asid 168 | assert_in_delta(${1:expected_float}, ${2:actual_float}, ${3:2 ** -20})${4} 169 | snippet asio 170 | assert_instance_of(${1:ExpectedClass}, ${2:actual_instance})${3} 171 | snippet asko 172 | assert_kind_of(${1:ExpectedKind}, ${2:actual_instance})${3} 173 | snippet asn 174 | assert_nil(${1:instance})${2} 175 | snippet asnn 176 | assert_not_nil(${1:instance})${2} 177 | snippet asm 178 | assert_match(/${1:expected_pattern}/, ${2:actual_string})${3} 179 | snippet asnm 180 | assert_no_match(/${1:unexpected_pattern}/, ${2:actual_string})${3} 181 | snippet aso 182 | assert_operator(${1:left}, :${2:operator}, ${3:right})${4} 183 | snippet asr 184 | assert_raise(${1:Exception}) { ${2} } 185 | snippet asnr 186 | assert_nothing_raised(${1:Exception}) { ${2} } 187 | snippet asrt 188 | assert_respond_to(${1:object}, :${2:method})${3} 189 | snippet ass assert_same(..) 190 | assert_same(${1:expected}, ${2:actual})${3} 191 | snippet ass assert_send(..) 192 | assert_send([${1:object}, :${2:message}, ${3:args}])${4} 193 | snippet asns 194 | assert_not_same(${1:unexpected}, ${2:actual})${3} 195 | snippet ast 196 | assert_throws(:${1:expected}) { ${2} } 197 | snippet asnt 198 | assert_nothing_thrown { ${1} } 199 | 200 | 201 | snippet con 202 | context "${1:context}" do 203 | ${2} 204 | end 205 | 206 | snippet desc 207 | describe "${1:description}" do 208 | ${2} 209 | end 210 | 211 | # RSpec Old 212 | #========================== 213 | snippet bea 214 | before :each do 215 | ${1} 216 | end 217 | 218 | snippet it' 219 | it '${1:do someting}' 220 | 221 | snippet it 222 | it '${1:do_somethign}' do 223 | ${2} 224 | end 225 | 226 | snippet .sr 227 | .should_receive(:${1}).${2} 228 | 229 | snippet .w 230 | .with(:${1}) 231 | snippet .ar 232 | .and_return(:${1}) 233 | snippet .re 234 | .raise_error 235 | snippet .sh 236 | .should 237 | snippet .sdn 238 | .should_not 239 | 240 | # Rspec New 241 | #========================== 242 | 243 | snippet subj 244 | subject { ${1} } 245 | 246 | snippet subjd 247 | subject do 248 | ${1} 249 | end 250 | 251 | snippet let 252 | let(:${1:name}) { ${2:val} } 253 | -------------------------------------------------------------------------------- /.vim/vendor/snipmate.snippets/snippets/sh.snippets: -------------------------------------------------------------------------------- 1 | # #!/bin/bash 2 | snippet #! 3 | #!/bin/bash 4 | 5 | snippet if 6 | if [[ ${1:condition} ]]; then 7 | ${2:#statements} 8 | fi 9 | snippet elif 10 | elif [[ ${1:condition} ]]; then 11 | ${2:#statements} 12 | snippet for 13 | for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do 14 | ${3:#statements} 15 | done 16 | snippet wh 17 | while [[ ${1:condition} ]]; do 18 | ${2:#statements} 19 | done 20 | snippet until 21 | until [[ ${1:condition} ]]; do 22 | ${2:#statements} 23 | done 24 | snippet case 25 | case ${1:word} in 26 | ${2:pattern}) 27 | ${3};; 28 | esac 29 | -------------------------------------------------------------------------------- /.vim/vendor/snipmate.snippets/snippets/snippet.snippets: -------------------------------------------------------------------------------- 1 | # snippets for making snippets :) 2 | snippet snip 3 | snippet ${1:trigger} 4 | ${2} 5 | snippet msnip 6 | snippet ${1:trigger} ${2:description} 7 | ${3} 8 | -------------------------------------------------------------------------------- /.vim/vendor/snipmate.snippets/snippets/vim.snippets: -------------------------------------------------------------------------------- 1 | snippet header 2 | " File: ${1:`expand('%:t')`} 3 | " Author: ${2:`g:snips_author`} 4 | " Description: ${3} 5 | ${4:" Last Modified: `strftime("%B %d, %Y")`} 6 | snippet guard 7 | if exists('${1:did_`Filename()`}') || &cp${2: || version < 700} 8 | finish 9 | endif 10 | let $1 = 1${3} 11 | snippet f 12 | fun ${1:function_name}(${2}) 13 | ${3:" code} 14 | endf 15 | snippet for 16 | for ${1:needle} in ${2:haystack} 17 | ${3:" code} 18 | endfor 19 | snippet wh 20 | while ${1:condition} 21 | ${2:" code} 22 | endw 23 | snippet if 24 | if ${1:condition} 25 | ${2:" code} 26 | endif 27 | snippet ife 28 | if ${1:condition} 29 | ${2} 30 | else 31 | ${3} 32 | endif 33 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/.gitignore: -------------------------------------------------------------------------------- 1 | doc/tags 2 | .netrwhist 3 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Pull Requests 2 | ============= 3 | 4 | 1. Please squash your commits to minimize the log pollution. This is more of a convenience for the maintainer who pulls. If you are unfamiliar, see [here](http://ariejan.net/2011/07/05/git-squash-your-latests-commits-into-one/). 5 | 6 | 2. Clearly describe what you aim to fix or add to Vundle. 7 | 8 | 3. Try to minimize code changes and use existing style/functions. 9 | 10 | Issues 11 | ====== 12 | 13 | ## Check For Answers 14 | 15 | Before submitting an issue, be sure to check the following places for answers. 16 | 17 | 1. Vundle docs at [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt). 18 | 19 | 2. The [FAQ](https://github.com/VundleVim/Vundle.vim/wiki). 20 | 21 | 3. [Search](https://github.com/VundleVim/Vundle.vim/search) the repository for related issues. 22 | 23 | ## Try To Eliminate Your Vimrc 24 | 25 | In order to make sure it isn't just `.vimrc` replace your own config file with the [minimal vimrc](https://github.com/VundleVim/Vundle.vim/blob/master/test/minirc.vim). Clear out bundles and then try to reproduce. 26 | 27 | If the problem stops, likely there is an issue in your user configuration. You can incrementally add back your user changes to the minimal file testing the bug each time. This will allow you to slowly bisect the issue. You may want to test one plugin at a time. 28 | 29 | If you can still reproduce the problem, try to find the smallest `.vimrc` config file that creates the problem to include later. 30 | 31 | ## Guidelines 32 | 33 | To better respond to issues please follow these general guidelines when explaining the problem. 34 | 35 | 1. Clearly describe what the error is, if relevant attach output/screenshots. 36 | 37 | 2. Describe how developers can reproduce the bug, the steps should be from starting Vim. 38 | 39 | 3. Include your OS, version and architecture. For example, Windows 7 64, Kubuntu 13.04 32, etc... 40 | 41 | 4. If relevant to reproducing the bug, include the smallest subset of your `.vimrc` that causes the issue. Put this in code tags. 42 | 43 | 5. At the end of your issue, please put the output of `vim --version` in code tags. 44 | 45 | ## Example Post 46 | 47 | I am using Vim on Kubuntu 13.04 64 bit and I get the following error... (add further explanation here) 48 | 49 | To reproduce the bug, use the vimrc file below and run `:PluginInstall`... (continue with steps) 50 | 51 | Vimrc: 52 | ``` 53 | set nocompatible 54 | syntax on 55 | filetype off 56 | set rtp+=~/.vim/bundle/Vundle.vim/ 57 | call vundle#rc() 58 | Plugin 'VundleVim/Vundle.vim' 59 | Plugin 'relevant/plugin' 60 | filetype plugin indent on 61 | 62 | .... more user configs here... 63 | ``` 64 | 65 | Vim Version: 66 | ``` 67 | VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 15 2013 10:58:39) 68 | Included patches: 1-5 69 | Modified by pkg-vim-maintainers@lists.alioth.debian.org 70 | Compiled by buildd@ 71 | Huge version with GTK2 GUI. Features included (+) or not (-): 72 | +arabic +file_in_path +mouse_sgr +tag_binary 73 | +autocmd +find_in_path -mouse_sysmouse +tag_old_static 74 | +balloon_eval +float +mouse_urxvt -tag_any_white 75 | +browse +folding +mouse_xterm +tcl 76 | ++builtin_terms -footer +multi_byte +terminfo 77 | +byte_offset +fork() +multi_lang +termresponse 78 | +cindent +gettext -mzscheme +textobjects 79 | +clientserver -hangul_input +netbeans_intg +title 80 | +clipboard +iconv +path_extra +toolbar 81 | +cmdline_compl +insert_expand +perl +user_commands 82 | +cmdline_hist +jumplist +persistent_undo +vertsplit 83 | +cmdline_info +keymap +postscript +virtualedit 84 | +comments +langmap +printer +visual 85 | +conceal +libcall +profile +visualextra 86 | +cryptv +linebreak +python +viminfo 87 | +cscope +lispindent -python3 +vreplace 88 | +cursorbind +listcmds +quickfix +wildignore 89 | +cursorshape +localmap +reltime +wildmenu 90 | +dialog_con_gui +lua +rightleft +windows 91 | +diff +menu +ruby +writebackup 92 | +digraphs +mksession +scrollbind +X11 93 | +dnd +modify_fname +signs -xfontset 94 | -ebcdic +mouse +smartindent +xim 95 | +emacs_tags +mouseshape -sniff +xsmp_interact 96 | +eval +mouse_dec +startuptime +xterm_clipboard 97 | +ex_extra +mouse_gpm +statusline -xterm_save 98 | +extra_search -mouse_jsbterm -sun_workshop 99 | +farsi +mouse_netterm +syntax 100 | system vimrc file: "$VIM/vimrc" 101 | user vimrc file: "$HOME/.vimrc" 102 | 2nd user vimrc file: "~/.vim/vimrc" 103 | user exrc file: "$HOME/.exrc" 104 | system gvimrc file: "$VIM/gvimrc" 105 | user gvimrc file: "$HOME/.gvimrc" 106 | 2nd user gvimrc file: "~/.vim/gvimrc" 107 | system menu file: "$VIMRUNTIME/menu.vim" 108 | fall-back for $VIM: "/usr/share/vim" 109 | Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/harfbuzz -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -I/usr/include/tcl8.5 -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_LARGEFILE64_SOURCE=1 110 | Linking: gcc -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl -L/usr/lib -llua5.1 -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/lib/perl/5.14/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L/usr/lib/x86_64-linux-gnu -ltcl8.5 -ldl -lpthread -lieee -lm -lruby-1.9.1 -lpthread -lrt -ldl -lcrypt -lm -L/usr/lib 111 | ``` 112 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/LICENSE-MIT.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2010 http://github.com/gmarik 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/README.md: -------------------------------------------------------------------------------- 1 | ## [Help Maintain Vundle](https://github.com/VundleVim/Vundle.vim/issues/383) 2 | 3 | ## About 4 | 5 | [Vundle] is short for _Vim bundle_ and is a [Vim] plugin manager. 6 | 7 | [Vundle] allows you to... 8 | 9 | * keep track of and [configure] your plugins right in the `.vimrc` 10 | * [install] configured plugins (a.k.a. scripts/bundle) 11 | * [update] configured plugins 12 | * [search] by name all available [Vim scripts] 13 | * [clean] unused plugins up 14 | * run the above actions in a *single keypress* with [interactive mode] 15 | 16 | [Vundle] automatically... 17 | 18 | * manages the [runtime path] of your installed scripts 19 | * regenerates [help tags] after installing and updating 20 | 21 | [Vundle] is undergoing an [interface change], please stay up to date to get latest changes. 22 | 23 | [![Gitter-chat](https://badges.gitter.im/VundleVim/Vundle.vim.svg)](https://gitter.im/VundleVim/Vundle.vim) for discussion and support. 24 | 25 | ![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) 26 | 27 | ## Quick Start 28 | 29 | 1. Introduction: 30 | 31 | Installation requires [Git] and triggers [`git clone`] for each configured repository to `~/.vim/bundle/` by default. 32 | Curl is required for search. 33 | 34 | If you are using Windows, go directly to [Windows setup]. If you run into any issues, please consult the [FAQ]. 35 | See [Tips] for some advanced configurations. 36 | 37 | Using non-POSIX shells, such as the popular Fish shell, requires additional setup. Please check the [FAQ]. 38 | 39 | 2. Set up [Vundle]: 40 | 41 | `$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim` 42 | 43 | 3. Configure Plugins: 44 | 45 | Put this at the top of your `.vimrc` to use Vundle. Remove plugins you don't need, they are for illustration purposes. 46 | 47 | ```vim 48 | set nocompatible " be iMproved, required 49 | filetype off " required 50 | 51 | " set the runtime path to include Vundle and initialize 52 | set rtp+=~/.vim/bundle/Vundle.vim 53 | call vundle#begin() 54 | " alternatively, pass a path where Vundle should install plugins 55 | "call vundle#begin('~/some/path/here') 56 | 57 | " let Vundle manage Vundle, required 58 | Plugin 'VundleVim/Vundle.vim' 59 | 60 | " The following are examples of different formats supported. 61 | " Keep Plugin commands between vundle#begin/end. 62 | " plugin on GitHub repo 63 | Plugin 'tpope/vim-fugitive' 64 | " plugin from http://vim-scripts.org/vim/scripts.html 65 | Plugin 'L9' 66 | " Git plugin not hosted on GitHub 67 | Plugin 'git://git.wincent.com/command-t.git' 68 | " git repos on your local machine (i.e. when working on your own plugin) 69 | Plugin 'file:///home/gmarik/path/to/plugin' 70 | " The sparkup vim script is in a subdirectory of this repo called vim. 71 | " Pass the path to set the runtimepath properly. 72 | Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} 73 | " Install L9 and avoid a Naming conflict if you've already installed a 74 | " different version somewhere else. 75 | Plugin 'ascenator/L9', {'name': 'newL9'} 76 | 77 | " All of your Plugins must be added before the following line 78 | call vundle#end() " required 79 | filetype plugin indent on " required 80 | " To ignore plugin indent changes, instead use: 81 | "filetype plugin on 82 | " 83 | " Brief help 84 | " :PluginList - lists configured plugins 85 | " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate 86 | " :PluginSearch foo - searches for foo; append `!` to refresh local cache 87 | " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal 88 | " 89 | " see :h vundle for more details or wiki for FAQ 90 | " Put your non-Plugin stuff after this line 91 | ``` 92 | 93 | 4. Install Plugins: 94 | 95 | Launch `vim` and run `:PluginInstall` 96 | 97 | To install from command line: `vim +PluginInstall +qall` 98 | 99 | ## Docs 100 | 101 | See the [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc for more details. 102 | 103 | ## Changelog 104 | 105 | See the [changelog](https://github.com/VundleVim/Vundle.vim/blob/master/changelog.md). 106 | 107 | ## People Using Vundle 108 | 109 | see [Examples](https://github.com/VundleVim/Vundle.vim/wiki/Examples) 110 | 111 | ## Contributors 112 | 113 | see [Vundle contributors](https://github.com/VundleVim/Vundle.vim/graphs/contributors) 114 | 115 | *Thank you!* 116 | 117 | ## Inspiration & Ideas 118 | 119 | * [pathogen.vim](http://github.com/tpope/vim-pathogen/) 120 | * [Bundler](https://github.com/bundler/bundler) 121 | * [Scott Bronson](http://github.com/bronson) 122 | 123 | ## Also 124 | 125 | * Vundle was developed and tested with [Vim] 7.3 on OS X, Linux and Windows 126 | * Vundle tries to be as [KISS](http://en.wikipedia.org/wiki/KISS_principle) as possible 127 | 128 | ## TODO: 129 | [Vundle] is a work in progress, so any ideas and patches are appreciated. 130 | 131 | * ✓ activate newly added bundles on `.vimrc` reload or after `:PluginInstall` 132 | * ✓ use preview window for search results 133 | * ✓ Vim documentation 134 | * ✓ put Vundle in `bundles/` too (will fix Vundle help) 135 | * ✓ tests 136 | * ✓ improve error handling 137 | * allow specifying revision/version? 138 | * handle dependencies 139 | * show description in search results 140 | * search by description as well 141 | * make it rock! 142 | 143 | [Vundle]:http://github.com/VundleVim/Vundle.vim 144 | [Windows setup]:https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows 145 | [FAQ]:https://github.com/VundleVim/Vundle.vim/wiki 146 | [Tips]:https://github.com/VundleVim/Vundle.vim/wiki/Tips-and-Tricks 147 | [Vim]:http://www.vim.org 148 | [Git]:http://git-scm.com 149 | [`git clone`]:http://gitref.org/creating/#clone 150 | 151 | [Vim scripts]:http://vim-scripts.org/vim/scripts.html 152 | [help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags 153 | [runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 154 | 155 | [configure]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233 156 | [install]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254 157 | [update]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265 158 | [search]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295 159 | [clean]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318 160 | [interactive mode]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360 161 | [interface change]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L372-L396 162 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/README_ZH_CN.md: -------------------------------------------------------------------------------- 1 | ## [帮助维护Vundle](https://github.com/VundleVim/Vundle.vim/issues/383) 2 | 3 | ## 关于 4 | 5 | [Vundle] 是 _Vim bundle_ 的简称,是一个 [Vim] 插件管理器. 6 | 7 | [Vundle] 允许你做... 8 | 9 | * 同时在`.vimrc`中跟踪和[管理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233)插件 10 | * [安装](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254)特定格式的插件(a.k.a. scripts/bundle) 11 | * [更新](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265)特定格式插件 12 | * 通过插件名称[搜索](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295)[Vim scripts](http://vim-scripts.org/vim/scripts.html)中的插件 13 | * [清理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318)未使用的插件 14 | * 可以通过*单一按键*完成以上操作,详见[interactive mode](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360) 15 | 16 | [Vundle] 自动完成... 17 | 18 | * 管理已安装插件的[runtime path](http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27) 19 | * 安装和更新后,重新生成[帮助标签](http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags) 20 | 21 | [Vundle] 正在经历一个 [interface change], 请通过以下方式获取最新信息. 22 | 23 | 讨论和技术支持:[![Gitter-chat](https://badges.gitter.im/VundleVim/Vundle.vim.svg)](https://gitter.im/VundleVim/Vundle.vim) 24 | 25 | ![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) 26 | 27 | ## 快速开始 28 | 29 | 1. 介绍: 30 | 31 | 安装需要[Git](http://git-scm.com/),触发[`git clone`](http://gitref.org/creating/#clone),默认将每一个指定特定格式插件的仓库复制到`~/.vim/bundle/`. 32 | 搜索需要Curl支持. 33 | 34 | Windows用户请直接访问[Windows setup]. 如果有任何问题, 请参考 [FAQ]. 35 | 查看 [Tips] 获取相关高级配置. 36 | 37 | 使用 non-POSIX shells, 比如比较流行对 Fish shell, 需要额外对步骤. 请查看 [FAQ]. 38 | 39 | 2. 初始安装 [Vundle]: 40 | 41 | `$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim` 42 | 43 | 3. 配置插件 : 44 | 45 | 请将以下加在 `.vimrc` 方可使用Vundle. 删掉你不需要的插件, 这些只是用做示例. 46 | 47 | ```vim 48 | set nocompatible " 去除VI一致性,必须 49 | filetype off " 必须 50 | 51 | " 设置包括vundle和初始化相关的runtime path 52 | set rtp+=~/.vim/bundle/Vundle.vim 53 | call vundle#begin() 54 | " 另一种选择, 指定一个vundle安装插件的路径 55 | "call vundle#begin('~/some/path/here') 56 | 57 | " 让vundle管理插件版本,必须 58 | Plugin 'VundleVim/Vundle.vim' 59 | 60 | " 以下范例用来支持不同格式的插件安装. 61 | " 请将安装插件的命令放在vundle#begin和vundle#end之间. 62 | " Github上的插件 63 | " 格式为 Plugin '用户名/插件仓库名' 64 | Plugin 'tpope/vim-fugitive' 65 | " 来自 http://vim-scripts.org/vim/scripts.html 的插件 66 | " Plugin '插件名称' 实际上是 Plugin 'vim-scripts/插件仓库名' 只是此处的用户名可以省略 67 | Plugin 'L9' 68 | " 由Git支持但不再github上的插件仓库 Plugin 'git clone 后面的地址' 69 | Plugin 'git://git.wincent.com/command-t.git' 70 | " 本地的Git仓库(例如自己的插件) Plugin 'file:///+本地插件仓库绝对路径' 71 | Plugin 'file:///home/gmarik/path/to/plugin' 72 | " 插件在仓库的子目录中. 73 | " 正确指定路径用以设置runtimepath. 以下范例插件在sparkup/vim目录下 74 | Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} 75 | " 安装L9,如果已经安装过这个插件,可利用以下格式避免命名冲突 76 | Plugin 'ascenator/L9', {'name': 'newL9'} 77 | 78 | " 你的所有插件需要在下面这行之前 79 | call vundle#end() " 必须 80 | filetype plugin indent on " 必须 加载vim自带和插件相应的语法和文件类型相关脚本 81 | " 忽视插件改变缩进,可以使用以下替代: 82 | "filetype plugin on 83 | " 84 | " 简要帮助文档 85 | " :PluginList - 列出所有已配置的插件 86 | " :PluginInstall - 安装插件,追加 `!` 用以更新或使用 :PluginUpdate 87 | " :PluginSearch foo - 搜索 foo ; 追加 `!` 清除本地缓存 88 | " :PluginClean - 清除未使用插件,需要确认; 追加 `!` 自动批准移除未使用插件 89 | " 90 | " 查阅 :h vundle 获取更多细节和wiki以及FAQ 91 | " 将你自己对非插件片段放在这行之后 92 | ``` 93 | 94 | 4. 安装插件: 95 | 96 | 运行 `vim` 再运行 `:PluginInstall` 97 | 98 | 通过命令行直接安装 `vim +PluginInstall +qall` 99 | 100 | ## Docs 101 | 102 | 查阅 [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc 以获取更多细节. 103 | 104 | ## 更新日志 105 | 106 | 查阅 [changelog](https://github.com/VundleVim/Vundle.vim/blob/master/changelog.md). 107 | 108 | ## 在使用此插件的用户的VIMRC 109 | 110 | 查阅 [Examples](https://github.com/VundleVim/Vundle.vim/wiki/Examples) 111 | 112 | ## 维护者 113 | 114 | 查阅 [Vundle contributors](https://github.com/VundleVim/Vundle.vim/graphs/contributors) 115 | 116 | *感谢!* 117 | 118 | ## 灵感 & 思路 119 | 120 | * [pathogen.vim](http://github.com/tpope/vim-pathogen/) 121 | * [Bundler](https://github.com/bundler/bundler) 122 | * [Scott Bronson](http://github.com/bronson) 123 | 124 | ## 另外 125 | 126 | * Vundle 已测试环境为: [Vim] 7.3 on OS X, Linux and Windows 127 | * Vundle 尝试尽可能保持至简模式 [KISS](http://en.wikipedia.org/wiki/KISS_principle) 128 | 129 | ## TODO: 130 | [Vundle] 是一个正在进步对项目, 所以很多设计思路和补丁是需要借鉴的. 131 | 132 | * ✓ 在重新载入或者执行`:PluginInstall`之后激活`.vimrc`中新添加的插件 133 | * ✓ 使用预览窗口显示搜索结果 134 | * ✓ Vim documentation 135 | * ✓ 同时将Vundle 放置在 `bundles/` 中 (将修复 Vundle 帮助) 136 | * ✓ 测试 137 | * ✓ 提升错误处理能力 138 | * 支持手动指定版本(待考虑) 139 | * 版本依赖 140 | * 搜索结果中显示描述 141 | * 同时支持通过描述搜索 142 | * 使其更加稳定! 143 | 144 | [Vundle]:http://github.com/VundleVim/Vundle.vim 145 | [Windows setup]:https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows 146 | [FAQ]:https://github.com/VundleVim/Vundle.vim/wiki 147 | [Tips]:https://github.com/VundleVim/Vundle.vim/wiki/Tips-and-Tricks 148 | [Vim]:http://www.vim.org 149 | [Git]:http://git-scm.com 150 | [`git clone`]:http://gitref.org/creating/#clone 151 | 152 | [Vim scripts]:http://vim-scripts.org/vim/scripts.html 153 | [help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags 154 | [runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 155 | 156 | [configure]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233 157 | [install]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254 158 | [update]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265 159 | [search]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295 160 | [clean]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318 161 | [interactive mode]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360 162 | [interface change]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L372-L396 163 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/README_ZH_TW.md: -------------------------------------------------------------------------------- 1 | ## [幫助維護Vundle](https://github.com/VundleVim/Vundle.vim/issues/383) 2 | 3 | ## 關於 4 | 5 | [Vundle] 是 _Vim bundle_ 的簡稱,是一個 [Vim] 插件管理器. 6 | 7 | [Vundle] 允許你做... 8 | 9 | * 同時在`.vimrc`中跟蹤和[管理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233)插件 10 | * [安裝](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254)特定格式的插件(a.k.a. scripts/bundle) 11 | * [更新](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265)特定格式插件 12 | * 通過插件名稱[搜索](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295)[Vim scripts](http://vim-scripts.org/vim/scripts.html)中的插件 13 | * [清理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318)未使用的插件 14 | * 可以通過*單一按鍵*完成以上操作,詳見[interactive mode](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360) 15 | 16 | [Vundle] 自動完成... 17 | 18 | * 管理已安裝插件的[runtime path](http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27) 19 | * 安裝和更新後,重新生成[幫助標簽](http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags) 20 | 21 | [Vundle] 正在經歷一個 [interface change], 請通過以下方式獲取最新信息. 22 | 23 | 討論和技術支持:[![Gitter-chat](https://badges.gitter.im/VundleVim/Vundle.vim.svg)](https://gitter.im/VundleVim/Vundle.vim) 24 | 25 | ![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) 26 | 27 | ## 快速開始 28 | 29 | 1. 介紹: 30 | 31 | 安裝需要[Git](http://git-scm.com/),觸發[`git clone`](http://gitref.org/creating/#clone),默認將每一個指定特定格式插件的倉庫復制到`~/.vim/bundle/`. 32 | 搜索需要Curl支持. 33 | 34 | Windows用戶請直接訪問[Windows setup]. 如果有任何問題, 請參考 [FAQ]. 35 | 查看 [Tips] 獲取相關高級配置. 36 | 37 | 使用 non-POSIX shells, 比如比較流行對 Fish shell, 需要額外對步驟. 請查看 [FAQ]. 38 | 39 | 2. 初始安裝 [Vundle]: 40 | 41 | `$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim` 42 | 43 | 3. 配置插件 : 44 | 45 | 請將以下加在 `.vimrc` 方可使用Vundle. 刪掉你不需要的插件, 這些只是用做示例. 46 | 47 | ```vim 48 | set nocompatible " 去除VI一致性,必須 49 | filetype off " 必須 50 | 51 | " 設置包括vundle和初始化相關的runtime path 52 | set rtp+=~/.vim/bundle/Vundle.vim 53 | call vundle#begin() 54 | " 另一種選擇, 指定一個vundle安裝插件的路徑 55 | "call vundle#begin('~/some/path/here') 56 | 57 | " 讓vundle管理插件版本,必須 58 | Plugin 'VundleVim/Vundle.vim' 59 | 60 | " 以下範例用來支持不同格式的插件安裝. 61 | " 請將安裝插的命令放在vundle#begin和vundle#end之間. 62 | " Github上的插件 63 | " 格式為 Plugin '用戶名/插件倉庫名' 64 | Plugin 'tpope/vim-fugitive' 65 | " 來自 http://vim-scripts.org/vim/scripts.html 的插件 66 | " Plugin '插件名稱' 實際上是 Plugin 'vim-scripts/插件倉庫名' 只是此處的用戶名可以省略 67 | Plugin 'L9' 68 | " 由Git支持但不再github上的插件倉庫 Plugin 'git clone 後面的地址' 69 | Plugin 'git://git.wincent.com/command-t.git' 70 | " 本地的Git倉庫(例如自己的插件) Plugin 'file:///+本地插件倉庫絕對路徑' 71 | Plugin 'file:///home/gmarik/path/to/plugin' 72 | " 插件在倉庫的子目錄中. 73 | " 正確指定路徑用以設置runtimepath. 以下範例插件在sparkup/vim目錄下 74 | Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} 75 | " 安裝L9,如果已經安裝過這個插件,可利用以下格式避免命名衝突 76 | Plugin 'ascenator/L9', {'name': 'newL9'} 77 | 78 | " 你的所有插件需要在下面這行之前 79 | call vundle#end() " 必須 80 | filetype plugin indent on " 必須 加載vim自帶和插件相應的語法和文件類型相關腳本 81 | " 忽視插件改變縮進,可以使用以下替代: 82 | "filetype plugin on 83 | " 84 | " 簡要幫助文檔 85 | " :PluginList - 列出所有已配置的插件 86 | " :PluginInstall - 安裝插件,追加 `!` 用以更新或使用 :PluginUpdate 87 | " :PluginSearch foo - 搜索 foo ; 追加 `!` 清除本地緩存 88 | " :PluginClean - 清除未使用插件,需要確認; 追加 `!` 自動批准移除未使用插件 89 | " 90 | " 查閱 :h vundle 獲取更多細節和wiki以及FAQ 91 | " 將你自己對非插件片段放在這行之後 92 | ``` 93 | 94 | 4. 安裝插件: 95 | 96 | 運行 `vim` 再運行 `:PluginInstall` 97 | 98 | 通過命令行直接安裝 `vim +PluginInstall +qall` 99 | 100 | ## Docs 101 | 102 | 查閱 [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc 以獲取更多細節. 103 | 104 | ## 更新日誌 105 | 106 | 查閱 [changelog](https://github.com/VundleVim/Vundle.vim/blob/master/changelog.md). 107 | 108 | ## 在使用此插件的用戶的VIMRC 109 | 110 | 查閱 [Examples](https://github.com/VundleVim/Vundle.vim/wiki/Examples) 111 | 112 | ## 維護者 113 | 114 | 查閱 [Vundle contributors](https://github.com/VundleVim/Vundle.vim/graphs/contributors) 115 | 116 | *感謝!* 117 | 118 | ## 靈感 & 思路 119 | 120 | * [pathogen.vim](http://github.com/tpope/vim-pathogen/) 121 | * [Bundler](https://github.com/bundler/bundler) 122 | * [Scott Bronson](http://github.com/bronson) 123 | 124 | ## 另外 125 | 126 | * Vundle 已測試環境為: [Vim] 7.3 on OS X, Linux and Windows 127 | * Vundle 嘗試盡可能保持至簡模式 [KISS](http://en.wikipedia.org/wiki/KISS_principle) 128 | 129 | ## TODO: 130 | [Vundle] 是一個正在進步對項目, 所以很多設計思路和補丁是需要借鑒的. 131 | 132 | * ✓ 在重新載入或者執行`:PluginInstall`之後激活`.vimrc`中新添加的插件 133 | * ✓ 使用預覽窗口顯示搜索結果 134 | * ✓ Vim documentation 135 | * ✓ 同時將Vundle 放置在 `bundles/` 中 (將修復 Vundle 幫助) 136 | * ✓ 測試 137 | * ✓ 提升錯誤處理能力 138 | * 支持手動指定版本(待考慮) 139 | * 版本依賴 140 | * 搜索結果中顯示描述 141 | * 同時支持通過描述搜索 142 | * 使其更加穩定! 143 | 144 | [Vundle]:http://github.com/VundleVim/Vundle.vim 145 | [Windows setup]:https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows 146 | [FAQ]:https://github.com/VundleVim/Vundle.vim/wiki 147 | [Tips]:https://github.com/VundleVim/Vundle.vim/wiki/Tips-and-Tricks 148 | [Vim]:http://www.vim.org 149 | [Git]:http://git-scm.com 150 | [`git clone`]:http://gitref.org/creating/#clone 151 | 152 | [Vim scripts]:http://vim-scripts.org/vim/scripts.html 153 | [help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags 154 | [runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 155 | 156 | [configure]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233 157 | [install]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254 158 | [update]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265 159 | [search]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295 160 | [clean]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318 161 | [interactive mode]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360 162 | [interface change]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L372-L396 163 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/autoload/vundle.vim: -------------------------------------------------------------------------------- 1 | " Vundle is a shortcut for Vim Bundle and Is a simple plugin manager for Vim 2 | " Author: gmarik 3 | " HomePage: http://github.com/VundleVim/Vundle.vim 4 | " Readme: http://github.com/VundleVim/Vundle.vim/blob/master/README.md 5 | " Version: 0.10.2 6 | 7 | " Plugin Commands 8 | com! -nargs=+ -bar Plugin 9 | \ call vundle#config#bundle() 10 | 11 | com! -nargs=* -bang -complete=custom,vundle#scripts#complete PluginInstall 12 | \ call vundle#installer#new('!' == '', ) 13 | 14 | com! -nargs=? -bang -complete=custom,vundle#scripts#complete PluginSearch 15 | \ call vundle#scripts#all('!' == '', ) 16 | 17 | com! -nargs=0 -bang PluginList 18 | \ call vundle#installer#list('!' == '') 19 | 20 | com! -nargs=? -bang PluginClean 21 | \ call vundle#installer#clean('!' == '') 22 | 23 | com! -nargs=0 PluginDocs 24 | \ call vundle#installer#helptags(g:vundle#bundles) 25 | 26 | " Aliases 27 | com! -nargs=* -complete=custom,vundle#scripts#complete PluginUpdate PluginInstall! 28 | 29 | " Vundle Aliases 30 | com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleInstall PluginInstall 31 | com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleSearch PluginSearch 32 | com! -nargs=? -bang VundleClean PluginClean 33 | com! -nargs=0 VundleDocs PluginDocs 34 | com! VundleUpdate PluginInstall! 35 | com! -nargs=* -complete=custom,vundle#scripts#complete VundleUpdate PluginInstall! 36 | 37 | " Deprecated Commands 38 | com! -nargs=+ Bundle call vundle#config#bundle() 39 | com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleInstall PluginInstall 40 | com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleSearch PluginSearch 41 | com! -nargs=0 -bang BundleList PluginList 42 | com! -nargs=? -bang BundleClean PluginClean 43 | com! -nargs=0 BundleDocs PluginDocs 44 | com! BundleUpdate PluginInstall! 45 | 46 | " Set up the signs used in the installer window. (See :help signs) 47 | if (has('signs')) 48 | sign define Vu_error text=! texthl=Error 49 | sign define Vu_active text=> texthl=Comment 50 | sign define Vu_todate text=. texthl=Comment 51 | sign define Vu_new text=+ texthl=Comment 52 | sign define Vu_updated text=* texthl=Comment 53 | sign define Vu_deleted text=- texthl=Comment 54 | sign define Vu_helptags text=* texthl=Comment 55 | sign define Vu_pinned text== texthl=Comment 56 | endif 57 | 58 | " Set up Vundle. This function has to be called from the users vimrc file. 59 | " This will force Vim to source this file as a side effect which wil define 60 | " the :Plugin command. After calling this function the user can use the 61 | " :Plugin command in the vimrc. It is not possible to do this automatically 62 | " because when loading the vimrc file no plugins where loaded yet. 63 | func! vundle#rc(...) abort 64 | if a:0 > 0 65 | let g:vundle#bundle_dir = expand(a:1, 1) 66 | endif 67 | call vundle#config#init() 68 | endf 69 | 70 | " Alternative to vundle#rc, offers speed up by modifying rtp only when end() 71 | " called later. 72 | func! vundle#begin(...) abort 73 | let g:vundle#lazy_load = 1 74 | call call('vundle#rc', a:000) 75 | endf 76 | 77 | " Finishes putting plugins on the rtp. 78 | func! vundle#end(...) abort 79 | unlet g:vundle#lazy_load 80 | call vundle#config#activate_bundles() 81 | endf 82 | 83 | " Initialize some global variables used by Vundle. 84 | let vundle#bundle_dir = expand('$HOME/.vim/bundle', 1) 85 | let vundle#bundles = [] 86 | let vundle#lazy_load = 0 87 | let vundle#log = [] 88 | let vundle#updated_bundles = [] 89 | 90 | " vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: 91 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/autoload/vundle/config.vim: -------------------------------------------------------------------------------- 1 | " --------------------------------------------------------------------------- 2 | " Add a plugin to the runtimepath. 3 | " 4 | " arg -- a string specifying the plugin 5 | " ... -- a dictionary of options for the plugin 6 | " return -- the return value from vundle#config#init_bundle() 7 | " --------------------------------------------------------------------------- 8 | func! vundle#config#bundle(arg, ...) 9 | let bundle = vundle#config#init_bundle(a:arg, a:000) 10 | if !s:check_bundle_name(bundle) 11 | return 12 | endif 13 | if exists('g:vundle#lazy_load') && g:vundle#lazy_load 14 | call add(g:vundle#bundles, bundle) 15 | else 16 | call s:rtp_rm_a() 17 | call add(g:vundle#bundles, bundle) 18 | call s:rtp_add_a() 19 | call s:rtp_add_defaults() 20 | endif 21 | return bundle 22 | endf 23 | 24 | 25 | " --------------------------------------------------------------------------- 26 | " When lazy bundle load is used (begin/end functions), add all configured 27 | " bundles to runtimepath and reorder appropriately. 28 | " --------------------------------------------------------------------------- 29 | func! vundle#config#activate_bundles() 30 | call s:rtp_add_a() 31 | call s:rtp_add_defaults() 32 | endf 33 | 34 | 35 | " --------------------------------------------------------------------------- 36 | " Initialize Vundle. 37 | " 38 | " Start a new bundles list and make sure the runtimepath does not contain 39 | " directories from a previous call. In theory, this should only be called 40 | " once. 41 | " --------------------------------------------------------------------------- 42 | func! vundle#config#init() 43 | if !exists('g:vundle#bundles') | let g:vundle#bundles = [] | endif 44 | call s:rtp_rm_a() 45 | let g:vundle#bundles = [] 46 | let s:bundle_names = {} 47 | endf 48 | 49 | 50 | " --------------------------------------------------------------------------- 51 | " Add a list of bundles to the runtimepath and source them. 52 | " 53 | " bundles -- a list of bundle objects 54 | " --------------------------------------------------------------------------- 55 | func! vundle#config#require(bundles) abort 56 | for b in a:bundles 57 | call s:rtp_add(b.rtpath) 58 | call s:rtp_add(g:vundle#bundle_dir) 59 | " TODO: it has to be relative rtpath, not bundle.name 60 | exec 'runtime! '.b.name.'/plugin/*.vim' 61 | exec 'runtime! '.b.name.'/after/*.vim' 62 | call s:rtp_rm(g:vundle#bundle_dir) 63 | endfor 64 | call s:rtp_add_defaults() 65 | endf 66 | 67 | 68 | " --------------------------------------------------------------------------- 69 | " Create a bundle object from a bundle specification. 70 | " 71 | " name -- the bundle specification as a string 72 | " opts -- the options dictionary from then bundle definition 73 | " return -- an initialized bundle object 74 | " --------------------------------------------------------------------------- 75 | func! vundle#config#init_bundle(name, opts) 76 | if a:name != substitute(a:name, '^\s*\(.\{-}\)\s*$', '\1', '') 77 | echo "Spurious leading and/or trailing whitespace found in plugin spec '" . a:name . "'" 78 | endif 79 | let opts = extend(s:parse_options(a:opts), s:parse_name(substitute(a:name,"['".'"]\+','','g')), 'keep') 80 | let b = extend(opts, copy(s:bundle)) 81 | let b.rtpath = s:rtpath(opts) 82 | return b 83 | endf 84 | 85 | 86 | " --------------------------------------------------------------------------- 87 | " Check if the current bundle name has already been used in this running 88 | " instance and show an error to that effect. 89 | " 90 | " bundle -- a bundle object whose name is to be checked 91 | " return -- 0 if the bundle's name has been seen before, 1 otherwise 92 | " --------------------------------------------------------------------------- 93 | funct! s:check_bundle_name(bundle) 94 | if has_key(s:bundle_names, a:bundle.name) 95 | echoerr 'Vundle error: Name collision for Plugin ' . a:bundle.name_spec . 96 | \ '. Plugin ' . s:bundle_names[a:bundle.name] . 97 | \ ' previously used the name "' . a:bundle.name . '"' . 98 | \ '. Skipping Plugin ' . a:bundle.name_spec . '.' 99 | return 0 100 | elseif a:bundle.name !~ '\v^[A-Za-z0-9_-]%(\.?[A-Za-z0-9_-])*$' 101 | echoerr 'Invalid plugin name: ' . a:bundle.name 102 | return 0 103 | endif 104 | let s:bundle_names[a:bundle.name] = a:bundle.name_spec 105 | return 1 106 | endf 107 | 108 | 109 | " --------------------------------------------------------------------------- 110 | " Parse the options which can be supplied with the bundle specification. 111 | " Corresponding documentation: vundle-plugins-configure 112 | " 113 | " opts -- a dictionary with the user supplied options for the bundle 114 | " return -- a dictionary with the user supplied options for the bundle, this 115 | " will be merged with a s:bundle object into one dictionary. 116 | " --------------------------------------------------------------------------- 117 | func! s:parse_options(opts) 118 | " TODO: improve this 119 | if len(a:opts) != 1 | return {} | endif 120 | 121 | if type(a:opts[0]) == type({}) 122 | return a:opts[0] 123 | else 124 | return {'rev': a:opts[0]} 125 | endif 126 | endf 127 | 128 | 129 | " --------------------------------------------------------------------------- 130 | " Parse the plugin specification. Corresponding documentation: 131 | " vundle-plugins-uris 132 | " 133 | " arg -- the string supplied to identify the plugin 134 | " return -- a dictionary with the folder name (key 'name') and the uri (key 135 | " 'uri') for cloning the plugin and the original argument (key 136 | " 'name_spec') 137 | " --------------------------------------------------------------------------- 138 | func! s:parse_name(arg) 139 | let arg = a:arg 140 | let git_proto = exists('g:vundle_default_git_proto') ? g:vundle_default_git_proto : 'https' 141 | 142 | if arg =~? '^\s*\(gh\|github\):\S\+' 143 | \ || arg =~? '^[a-z0-9][a-z0-9-]*/[^/]\+$' 144 | let uri = git_proto.'://github.com/'.split(arg, ':')[-1] 145 | if uri !~? '\.git$' 146 | let uri .= '.git' 147 | endif 148 | let name = substitute(split(uri,'\/')[-1], '\.git\s*$','','i') 149 | elseif arg =~? '^\s*\(git@\|git://\)\S\+' 150 | \ || arg =~? '\(file\|https\?\)://' 151 | \ || arg =~? '\.git\s*$' 152 | let uri = arg 153 | let name = split( substitute(uri,'/\?\.git\s*$','','i') ,'\/')[-1] 154 | else 155 | let name = arg 156 | let uri = git_proto.'://github.com/vim-scripts/'.name.'.git' 157 | endif 158 | return {'name': name, 'uri': uri, 'name_spec': arg } 159 | endf 160 | 161 | 162 | " --------------------------------------------------------------------------- 163 | " Modify the runtimepath, after all bundles have been added, so that the 164 | " directories that were in the default runtimepath appear first in the list 165 | " (with their 'after' directories last). 166 | " --------------------------------------------------------------------------- 167 | func! s:rtp_add_defaults() 168 | let current = &rtp 169 | set rtp&vim 170 | let default = &rtp 171 | let &rtp = current 172 | let default_rtp_items = split(default, ',') 173 | if !empty(default_rtp_items) 174 | let first_item = fnameescape(default_rtp_items[0]) 175 | exec 'set rtp-=' . first_item 176 | exec 'set rtp^=' . first_item 177 | endif 178 | endf 179 | 180 | 181 | " --------------------------------------------------------------------------- 182 | " Remove all paths for the plugins which are managed by Vundle from the 183 | " runtimepath. 184 | " --------------------------------------------------------------------------- 185 | func! s:rtp_rm_a() 186 | let paths = map(copy(g:vundle#bundles), 'v:val.rtpath') 187 | let prepends = join(paths, ',') 188 | let appends = join(paths, '/after,').'/after' 189 | exec 'set rtp-='.fnameescape(prepends) 190 | exec 'set rtp-='.fnameescape(appends) 191 | endf 192 | 193 | 194 | " --------------------------------------------------------------------------- 195 | " Add all paths for the plugins which are managed by Vundle to the 196 | " runtimepath. 197 | " --------------------------------------------------------------------------- 198 | func! s:rtp_add_a() 199 | let paths = map(copy(g:vundle#bundles), 'v:val.rtpath') 200 | let prepends = join(paths, ',') 201 | let appends = join(paths, '/after,').'/after' 202 | exec 'set rtp^='.fnameescape(prepends) 203 | exec 'set rtp+='.fnameescape(appends) 204 | endf 205 | 206 | 207 | " --------------------------------------------------------------------------- 208 | " Remove a directory and the corresponding 'after' directory from runtimepath. 209 | " 210 | " dir -- the directory name to be removed as a string. The corresponding 211 | " 'after' directory will also be removed. 212 | " --------------------------------------------------------------------------- 213 | func! s:rtp_rm(dir) abort 214 | exec 'set rtp-='.fnameescape(expand(a:dir, 1)) 215 | exec 'set rtp-='.fnameescape(expand(a:dir.'/after', 1)) 216 | endf 217 | 218 | 219 | " --------------------------------------------------------------------------- 220 | " Add a directory and the corresponding 'after' directory to runtimepath. 221 | " 222 | " dir -- the directory name to be added as a string. The corresponding 223 | " 'after' directory will also be added. 224 | " --------------------------------------------------------------------------- 225 | func! s:rtp_add(dir) abort 226 | exec 'set rtp^='.fnameescape(expand(a:dir, 1)) 227 | exec 'set rtp+='.fnameescape(expand(a:dir.'/after', 1)) 228 | endf 229 | 230 | 231 | " --------------------------------------------------------------------------- 232 | " Expand and simplify a path. 233 | " 234 | " path -- the path to expand as a string 235 | " return -- the expanded and simplified path 236 | " --------------------------------------------------------------------------- 237 | func! s:expand_path(path) abort 238 | return simplify(expand(a:path, 1)) 239 | endf 240 | 241 | 242 | " --------------------------------------------------------------------------- 243 | " Find the actual path inside a bundle directory to be added to the 244 | " runtimepath. It might be provided by the user with the 'rtp' option. 245 | " Corresponding documentation: vundle-plugins-configure 246 | " 247 | " opts -- a bundle dict 248 | " return -- expanded path to the corresponding plugin directory 249 | " --------------------------------------------------------------------------- 250 | func! s:rtpath(opts) 251 | return has_key(a:opts, 'rtp') ? s:expand_path(a:opts.path().'/'.a:opts.rtp) : a:opts.path() 252 | endf 253 | 254 | 255 | " --------------------------------------------------------------------------- 256 | " a bundle 'object' 257 | " --------------------------------------------------------------------------- 258 | let s:bundle = {} 259 | 260 | 261 | " --------------------------------------------------------------------------- 262 | " Return the absolute path to the directory inside the bundle directory 263 | " (prefix) where thr bundle will be cloned. 264 | " 265 | " return -- the target location to clone this bundle to 266 | " --------------------------------------------------------------------------- 267 | func! s:bundle.path() 268 | return s:expand_path(g:vundle#bundle_dir.'/') . self.name 269 | endf 270 | 271 | 272 | " --------------------------------------------------------------------------- 273 | " Determine if the bundle has the pinned attribute set in the config 274 | " 275 | " return -- 1 if the bundle is pinned, 0 otherwise 276 | " --------------------------------------------------------------------------- 277 | func! s:bundle.is_pinned() 278 | return get(self, 'pinned') 279 | endf 280 | 281 | " vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: 282 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/autoload/vundle/installer.vim: -------------------------------------------------------------------------------- 1 | " --------------------------------------------------------------------------- 2 | " Try to clone all new bundles given (or all bundles in g:vundle#bundles by 3 | " default) to g:vundle#bundle_dir. If a:bang is 1 it will also update all 4 | " plugins (git pull). 5 | " 6 | " bang -- 1 or 0 7 | " ... -- any number of bundle specifications (separate arguments) 8 | " --------------------------------------------------------------------------- 9 | func! vundle#installer#new(bang, ...) abort 10 | " No specific plugins are specified. Operate on all plugins. 11 | if a:0 == 0 12 | let bundles = g:vundle#bundles 13 | " Specific plugins are specified for update. Update them. 14 | elseif (a:bang) 15 | let bundles = filter(copy(g:vundle#bundles), 'index(a:000, v:val.name) > -1') 16 | " Specific plugins are specified for installation. Install them. 17 | else 18 | let bundles = map(copy(a:000), 'vundle#config#bundle(v:val, {})') 19 | endif 20 | 21 | if empty(bundles) 22 | echoerr 'No bundles were selected for operation' 23 | return 24 | endif 25 | 26 | let names = vundle#scripts#bundle_names(map(copy(bundles), 'v:val.name_spec')) 27 | call vundle#scripts#view('Installer',['" Installing plugins to '.expand(g:vundle#bundle_dir, 1)], names + ['Helptags']) 28 | 29 | " This calls 'add' as a normal mode command. This is a buffer local mapping 30 | " defined in vundle#scripts#view(). The mapping will call a buffer local 31 | " command InstallPlugin which in turn will call vundle#installer#run() with 32 | " vundle#installer#install(). 33 | call s:process(a:bang, (a:bang ? 'add!' : 'add')) 34 | 35 | call vundle#config#require(bundles) 36 | endf 37 | 38 | 39 | " --------------------------------------------------------------------------- 40 | " Iterate over all lines in a Vundle window and execute the given command for 41 | " every line. Used by the installation and cleaning functions. 42 | " 43 | " bang -- not used (FIXME) 44 | " cmd -- the (normal mode) command to execute for every line as a string 45 | " --------------------------------------------------------------------------- 46 | func! s:process(bang, cmd) 47 | let msg = '' 48 | 49 | redraw 50 | sleep 1m 51 | 52 | let lines = (getline('.','$')[0:-2]) 53 | 54 | for line in lines 55 | redraw 56 | 57 | exec ':norm '.a:cmd 58 | 59 | if 'error' == s:last_status 60 | let msg = 'With errors; press l to view log' 61 | endif 62 | 63 | if 'updated' == s:last_status && empty(msg) 64 | let msg = 'Plugins updated; press u to view changelog' 65 | endif 66 | 67 | " goto next one 68 | exec ':+1' 69 | 70 | setl nomodified 71 | endfor 72 | 73 | redraw 74 | echo 'Done! '.msg 75 | endf 76 | 77 | 78 | " --------------------------------------------------------------------------- 79 | " Call another function in the different Vundle windows. 80 | " 81 | " func_name -- the function to call 82 | " name -- the bundle name to call func_name for (string) 83 | " ... -- the argument to be used when calling func_name (only the first 84 | " optional argument will be used) 85 | " return -- the status returned by the call to func_name 86 | " --------------------------------------------------------------------------- 87 | func! vundle#installer#run(func_name, name, ...) abort 88 | let n = a:name 89 | 90 | echo 'Processing '.n 91 | call s:sign('active') 92 | 93 | sleep 1m 94 | 95 | let status = call(a:func_name, a:1) 96 | 97 | call s:sign(status) 98 | 99 | redraw 100 | 101 | if 'new' == status 102 | echo n.' installed' 103 | elseif 'updated' == status 104 | echo n.' updated' 105 | elseif 'todate' == status 106 | echo n.' already installed' 107 | elseif 'deleted' == status 108 | echo n.' deleted' 109 | elseif 'helptags' == status 110 | echo n.' regenerated' 111 | elseif 'pinned' == status 112 | echo n.' pinned' 113 | elseif 'error' == status 114 | echohl Error 115 | echo 'Error processing '.n 116 | echohl None 117 | sleep 1 118 | else 119 | throw 'whoops, unknown status:'.status 120 | endif 121 | 122 | let s:last_status = status 123 | 124 | return status 125 | endf 126 | 127 | 128 | " --------------------------------------------------------------------------- 129 | " Put a sign on the current line, indicating the status of the installation 130 | " step. 131 | " 132 | " status -- string describing the status 133 | " --------------------------------------------------------------------------- 134 | func! s:sign(status) 135 | if (!has('signs')) 136 | return 137 | endif 138 | 139 | exe ":sign place ".line('.')." line=".line('.')." name=Vu_". a:status ." buffer=" . bufnr("%") 140 | endf 141 | 142 | 143 | " --------------------------------------------------------------------------- 144 | " Install a plugin, then add it to the runtimepath and source it. 145 | " 146 | " bang -- 1 or 0, passed directly to vundle#installer#install() 147 | " name -- the name of a bundle (string) 148 | " return -- the return value from vundle#installer#install() 149 | " --------------------------------------------------------------------------- 150 | func! vundle#installer#install_and_require(bang, name) abort 151 | let result = vundle#installer#install(a:bang, a:name) 152 | let b = vundle#config#bundle(a:name, {}) 153 | call vundle#installer#helptags([b]) 154 | call vundle#config#require([b]) 155 | return result 156 | endf 157 | 158 | 159 | " --------------------------------------------------------------------------- 160 | " Install or update a bundle given by its name. 161 | " 162 | " bang -- 1 or 0, passed directly to s:sync() 163 | " name -- the name of a bundle (string) 164 | " return -- the return value from s:sync() 165 | " --------------------------------------------------------------------------- 166 | func! vundle#installer#install(bang, name) abort 167 | if !isdirectory(g:vundle#bundle_dir) | call mkdir(g:vundle#bundle_dir, 'p') | endif 168 | 169 | let n = substitute(a:name,"['".'"]\+','','g') 170 | let matched = filter(copy(g:vundle#bundles), 'v:val.name_spec == n') 171 | 172 | if len(matched) > 0 173 | let b = matched[0] 174 | else 175 | let b = vundle#config#init_bundle(a:name, {}) 176 | endif 177 | 178 | return s:sync(a:bang, b) 179 | endf 180 | 181 | 182 | " --------------------------------------------------------------------------- 183 | " Call :helptags for all bundles in g:vundle#bundles. 184 | " 185 | " return -- 'error' if an error occurred, else return 'helptags' 186 | " --------------------------------------------------------------------------- 187 | func! vundle#installer#docs() abort 188 | let error_count = vundle#installer#helptags(g:vundle#bundles) 189 | if error_count > 0 190 | return 'error' 191 | endif 192 | return 'helptags' 193 | endf 194 | 195 | 196 | " --------------------------------------------------------------------------- 197 | " Call :helptags for a list of bundles. 198 | " 199 | " bundles -- a list of bundle dictionaries for which :helptags should be 200 | " called. 201 | " return -- the number of directories where :helptags failed 202 | " --------------------------------------------------------------------------- 203 | func! vundle#installer#helptags(bundles) abort 204 | let bundle_dirs = map(copy(a:bundles),'v:val.rtpath') 205 | let help_dirs = filter(bundle_dirs, 's:has_doc(v:val)') 206 | 207 | call s:log('') 208 | call s:log('Helptags:') 209 | 210 | let statuses = map(copy(help_dirs), 's:helptags(v:val)') 211 | let errors = filter(statuses, 'v:val == 0') 212 | 213 | call s:log('Helptags: '.len(help_dirs).' plugins processed') 214 | 215 | return len(errors) 216 | endf 217 | 218 | 219 | " --------------------------------------------------------------------------- 220 | " List all installed plugins. 221 | " Corresponding documentation: vundle-plugins-list 222 | " 223 | " bang -- not used 224 | " --------------------------------------------------------------------------- 225 | func! vundle#installer#list(bang) abort 226 | let bundles = vundle#scripts#bundle_names(map(copy(g:vundle#bundles), 'v:val.name_spec')) 227 | call vundle#scripts#view('list', ['" My Plugins'], bundles) 228 | redraw 229 | echo len(g:vundle#bundles).' plugins configured' 230 | endf 231 | 232 | 233 | " --------------------------------------------------------------------------- 234 | " List and remove all directories in the bundle directory which are not 235 | " activated (added to the bundle list). 236 | " 237 | " bang -- 0 if the user should be asked to confirm every deletion, 1 if they 238 | " should be removed unconditionally 239 | " --------------------------------------------------------------------------- 240 | func! vundle#installer#clean(bang) abort 241 | let bundle_dirs = map(copy(g:vundle#bundles), 'v:val.path()') 242 | let all_dirs = (v:version > 702 || (v:version == 702 && has("patch51"))) 243 | \ ? split(globpath(g:vundle#bundle_dir, '*', 1), "\n") 244 | \ : split(globpath(g:vundle#bundle_dir, '*'), "\n") 245 | let x_dirs = filter(all_dirs, '0 > index(bundle_dirs, v:val)') 246 | 247 | if empty(x_dirs) 248 | let headers = ['" All clean!'] 249 | let names = [] 250 | else 251 | let headers = ['" Removing Plugins:'] 252 | let names = vundle#scripts#bundle_names(map(copy(x_dirs), 'fnamemodify(v:val, ":t")')) 253 | end 254 | 255 | call vundle#scripts#view('clean', headers, names) 256 | redraw 257 | 258 | if (a:bang || empty(names)) 259 | call s:process(a:bang, 'D') 260 | else 261 | call inputsave() 262 | let response = input('Continue? [Y/n]: ') 263 | call inputrestore() 264 | if (response =~? 'y' || response == '') 265 | call s:process(a:bang, 'D') 266 | endif 267 | endif 268 | endf 269 | 270 | 271 | " --------------------------------------------------------------------------- 272 | " Delete to directory for a plugin. 273 | " 274 | " bang -- not used 275 | " dir_name -- the bundle directory to be deleted (as a string) 276 | " return -- 'error' if an error occurred, 'deleted' if the plugin folder was 277 | " successfully deleted 278 | " --------------------------------------------------------------------------- 279 | func! vundle#installer#delete(bang, dir_name) abort 280 | 281 | let cmd = ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) ? 282 | \ 'rmdir /S /Q' : 283 | \ 'rm -rf' 284 | 285 | let bundle = vundle#config#init_bundle(a:dir_name, {}) 286 | let cmd .= ' '.vundle#installer#shellesc(bundle.path()) 287 | 288 | let out = s:system(cmd) 289 | 290 | call s:log('') 291 | call s:log('Plugin '.a:dir_name) 292 | call s:log(cmd, '$ ') 293 | call s:log(out, '> ') 294 | 295 | if 0 != v:shell_error 296 | return 'error' 297 | else 298 | return 'deleted' 299 | endif 300 | endf 301 | 302 | 303 | " --------------------------------------------------------------------------- 304 | " Check if a bundled plugin has any documentation. 305 | " 306 | " rtp -- a path (string) where the plugin is installed 307 | " return -- 1 if some documentation was found, 0 otherwise 308 | " --------------------------------------------------------------------------- 309 | func! s:has_doc(rtp) abort 310 | return isdirectory(a:rtp.'/doc') 311 | \ && (!filereadable(a:rtp.'/doc/tags') || filewritable(a:rtp.'/doc/tags')) 312 | \ && (v:version > 702 || (v:version == 702 && has("patch51"))) 313 | \ ? !(empty(glob(a:rtp.'/doc/*.txt', 1)) && empty(glob(a:rtp.'/doc/*.??x', 1))) 314 | \ : !(empty(glob(a:rtp.'/doc/*.txt')) && empty(glob(a:rtp.'/doc/*.??x'))) 315 | endf 316 | 317 | 318 | " --------------------------------------------------------------------------- 319 | " Update the helptags for a plugin. 320 | " 321 | " rtp -- the path to the plugin's root directory (string) 322 | " return -- 1 if :helptags succeeded, 0 otherwise 323 | " --------------------------------------------------------------------------- 324 | func! s:helptags(rtp) abort 325 | " it is important to keep trailing slash here 326 | let doc_path = resolve(a:rtp . '/doc/') 327 | call s:log(':helptags '.doc_path) 328 | try 329 | execute 'helptags ' . doc_path 330 | catch 331 | call s:log("> Error running :helptags ".doc_path) 332 | return 0 333 | endtry 334 | return 1 335 | endf 336 | 337 | 338 | " --------------------------------------------------------------------------- 339 | " Get the URL for the remote called 'origin' on the repository that 340 | " corresponds to a given bundle. 341 | " 342 | " bundle -- a bundle object to check the repository for 343 | " return -- the URL for the origin remote (string) 344 | " --------------------------------------------------------------------------- 345 | func! s:get_current_origin_url(bundle) abort 346 | let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git config --get remote.origin.url' 347 | let cmd = vundle#installer#shellesc_cd(cmd) 348 | let out = s:strip(s:system(cmd)) 349 | return out 350 | endf 351 | 352 | 353 | " --------------------------------------------------------------------------- 354 | " Get a short sha of the HEAD of the repository for a given bundle 355 | " 356 | " bundle -- a bundle object 357 | " return -- A 15 character log sha for the current HEAD 358 | " --------------------------------------------------------------------------- 359 | func! s:get_current_sha(bundle) 360 | let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git rev-parse HEAD' 361 | let cmd = vundle#installer#shellesc_cd(cmd) 362 | let out = s:system(cmd)[0:15] 363 | return out 364 | endf 365 | 366 | 367 | " --------------------------------------------------------------------------- 368 | " Create the appropriate sync command to run according to the current state of 369 | " the local repository (clone, pull, reset, etc). 370 | " 371 | " In the case of a pull (update), also return the current sha, so that we can 372 | " later check that there has been an upgrade. 373 | " 374 | " bang -- 0 if only new plugins should be installed, 1 if existing plugins 375 | " should be updated 376 | " bundle -- a bundle object to create the sync command for 377 | " return -- A list containing the command to run and the sha for the current 378 | " HEAD 379 | " --------------------------------------------------------------------------- 380 | func! s:make_sync_command(bang, bundle) abort 381 | let git_dir = expand(a:bundle.path().'/.git/', 1) 382 | if isdirectory(git_dir) || filereadable(expand(a:bundle.path().'/.git', 1)) 383 | 384 | let current_origin_url = s:get_current_origin_url(a:bundle) 385 | if current_origin_url != a:bundle.uri 386 | call s:log('Plugin URI change detected for Plugin ' . a:bundle.name) 387 | call s:log('> Plugin ' . a:bundle.name . ' old URI: ' . current_origin_url) 388 | call s:log('> Plugin ' . a:bundle.name . ' new URI: ' . a:bundle.uri) 389 | " Directory names match but the origin remotes are not the same 390 | let cmd_parts = [ 391 | \ 'cd '.vundle#installer#shellesc(a:bundle.path()) , 392 | \ 'git remote set-url origin ' . vundle#installer#shellesc(a:bundle.uri), 393 | \ 'git fetch', 394 | \ 'git reset --hard origin/HEAD', 395 | \ 'git submodule update --init --recursive', 396 | \ ] 397 | let cmd = join(cmd_parts, ' && ') 398 | let cmd = vundle#installer#shellesc_cd(cmd) 399 | let initial_sha = '' 400 | return [cmd, initial_sha] 401 | endif 402 | 403 | if !(a:bang) 404 | " The repo exists, and no !, so leave as it is. 405 | return ['', ''] 406 | endif 407 | 408 | let cmd_parts = [ 409 | \ 'cd '.vundle#installer#shellesc(a:bundle.path()), 410 | \ 'git pull', 411 | \ 'git submodule update --init --recursive', 412 | \ ] 413 | let cmd = join(cmd_parts, ' && ') 414 | let cmd = vundle#installer#shellesc_cd(cmd) 415 | 416 | let initial_sha = s:get_current_sha(a:bundle) 417 | else 418 | let cmd = 'git clone --recursive '.vundle#installer#shellesc(a:bundle.uri).' '.vundle#installer#shellesc(a:bundle.path()) 419 | let initial_sha = '' 420 | endif 421 | return [cmd, initial_sha] 422 | endf 423 | 424 | 425 | " --------------------------------------------------------------------------- 426 | " Install or update a given bundle object with git. 427 | " 428 | " bang -- 0 if only new plugins should be installed, 1 if existing plugins 429 | " should be updated 430 | " bundle -- a bundle object (dictionary) 431 | " return -- a string indicating the status of the bundle installation: 432 | " - todate : Nothing was updated or the repository was up to date 433 | " - new : The plugin was newly installed 434 | " - updated : Some changes where pulled via git 435 | " - error : An error occurred in the shell command 436 | " - pinned : The bundle is marked as pinned 437 | " --------------------------------------------------------------------------- 438 | func! s:sync(bang, bundle) abort 439 | " Do not sync if this bundle is pinned 440 | if a:bundle.is_pinned() 441 | return 'pinned' 442 | endif 443 | 444 | let [ cmd, initial_sha ] = s:make_sync_command(a:bang, a:bundle) 445 | if empty(cmd) 446 | return 'todate' 447 | endif 448 | 449 | let out = s:system(cmd) 450 | call s:log('') 451 | call s:log('Plugin '.a:bundle.name_spec) 452 | call s:log(cmd, '$ ') 453 | call s:log(out, '> ') 454 | 455 | if 0 != v:shell_error 456 | return 'error' 457 | end 458 | 459 | if empty(initial_sha) 460 | return 'new' 461 | endif 462 | 463 | let updated_sha = s:get_current_sha(a:bundle) 464 | 465 | if initial_sha == updated_sha 466 | return 'todate' 467 | endif 468 | 469 | call add(g:vundle#updated_bundles, [initial_sha, updated_sha, a:bundle]) 470 | return 'updated' 471 | endf 472 | 473 | 474 | " --------------------------------------------------------------------------- 475 | " Escape special characters in a string to be able to use it as a shell 476 | " command with system(). 477 | " 478 | " cmd -- the string holding the shell command 479 | " return -- a string with the relevant characters escaped 480 | " --------------------------------------------------------------------------- 481 | func! vundle#installer#shellesc(cmd) abort 482 | if ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) 483 | return '"' . substitute(a:cmd, '"', '\\"', 'g') . '"' 484 | endif 485 | return shellescape(a:cmd) 486 | endf 487 | 488 | 489 | " --------------------------------------------------------------------------- 490 | " Fix a cd shell command to be used on Windows. 491 | " 492 | " cmd -- the command to be fixed (string) 493 | " return -- the fixed command (string) 494 | " --------------------------------------------------------------------------- 495 | func! vundle#installer#shellesc_cd(cmd) abort 496 | if ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) 497 | let cmd = substitute(a:cmd, '^cd ','cd /d ','') " add /d switch to change drives 498 | return cmd 499 | else 500 | return a:cmd 501 | endif 502 | endf 503 | 504 | 505 | " --------------------------------------------------------------------------- 506 | " Make a system call. This can be used to change the way system calls 507 | " are made during developing, without searching the whole code base for 508 | " actual system() calls. 509 | " 510 | " cmd -- the command passed to system() (string) 511 | " return -- the return value from system() 512 | " --------------------------------------------------------------------------- 513 | func! s:system(cmd) abort 514 | return system(a:cmd) 515 | endf 516 | 517 | 518 | " --------------------------------------------------------------------------- 519 | " Add a log message to Vundle's internal logging variable. 520 | " 521 | " str -- the log message (string) 522 | " prefix -- optional prefix for multi-line entries (string) 523 | " return -- a:str 524 | " --------------------------------------------------------------------------- 525 | func! s:log(str, ...) abort 526 | let prefix = a:0 > 0 ? a:1 : '' 527 | let fmt = '%Y-%m-%d %H:%M:%S' 528 | let lines = split(a:str, '\n', 1) 529 | let time = strftime(fmt) 530 | for line in lines 531 | call add(g:vundle#log, '['. time .'] '. prefix . line) 532 | endfor 533 | return a:str 534 | endf 535 | 536 | 537 | " --------------------------------------------------------------------------- 538 | " Remove leading and trailing whitespace from a string 539 | " 540 | " str -- The string to rid of trailing and leading spaces 541 | " return -- A string stripped of side spaces 542 | " --------------------------------------------------------------------------- 543 | func! s:strip(str) 544 | return substitute(a:str, '\%^\_s*\(.\{-}\)\_s*\%$', '\1', '') 545 | endf 546 | 547 | " vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: 548 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/autoload/vundle/scripts.vim: -------------------------------------------------------------------------------- 1 | " --------------------------------------------------------------------------- 2 | " Search the database from vim-script.org for a matching plugin. If no 3 | " argument is given, list all plugins. This function is used by the :Plugins 4 | " and :PluginSearch commands. 5 | " 6 | " bang -- if 1 refresh the script name cache, if 0 don't 7 | " ... -- a plugin name to search for 8 | " --------------------------------------------------------------------------- 9 | func! vundle#scripts#all(bang, ...) 10 | let b:match = '' 11 | let info = ['"Keymap: i - Install plugin; c - Cleanup; s - Search; R - Reload list'] 12 | let matches = s:load_scripts(a:bang) 13 | if !empty(a:1) 14 | let matches = filter(matches, 'v:val =~? "'.escape(a:1,'"').'"') 15 | let info += ['"Search results for: '.a:1] 16 | " TODO: highlight matches 17 | let b:match = a:1 18 | endif 19 | call vundle#scripts#view('search',info, vundle#scripts#bundle_names(reverse(matches))) 20 | redraw 21 | echo len(matches).' plugins found' 22 | endf 23 | 24 | 25 | " --------------------------------------------------------------------------- 26 | " Repeat the search for bundles. 27 | " --------------------------------------------------------------------------- 28 | func! vundle#scripts#reload() abort 29 | silent exec ':PluginSearch! '.(exists('b:match') ? b:match : '') 30 | redraw 31 | endf 32 | 33 | 34 | " --------------------------------------------------------------------------- 35 | " Complete names for bundles in the command line. 36 | " 37 | " a, c, d -- see :h command-completion-custom 38 | " return -- all valid plugin names from vim-scripts.org as completion 39 | " candidates, or all installed plugin names when running an 'Update 40 | " variant'. see also :h command-completion-custom 41 | " --------------------------------------------------------------------------- 42 | func! vundle#scripts#complete(a,c,d) 43 | if match(a:c, '\v^%(Plugin|Vundle)%(Install!|Update)') == 0 44 | " Only installed plugins if updating 45 | return join(map(copy(g:vundle#bundles), 'v:val.name'), "\n") 46 | else 47 | " Or all known plugins otherwise 48 | return join(s:load_scripts(0),"\n") 49 | endif 50 | endf 51 | 52 | 53 | " --------------------------------------------------------------------------- 54 | " View the logfile after an update or installation. 55 | " --------------------------------------------------------------------------- 56 | func! s:view_log() 57 | if !exists('s:log_file') 58 | let s:log_file = tempname() 59 | endif 60 | 61 | if bufloaded(s:log_file) 62 | execute 'silent bdelete' s:log_file 63 | endif 64 | call writefile(g:vundle#log, s:log_file) 65 | execute 'silent pedit ' . s:log_file 66 | set bufhidden=wipe 67 | setl buftype=nofile 68 | setl noswapfile 69 | setl ro noma 70 | 71 | wincmd P | wincmd H 72 | endf 73 | 74 | 75 | " --------------------------------------------------------------------------- 76 | " Parse the output from git log after an update to create a change log for the 77 | " user. 78 | " --------------------------------------------------------------------------- 79 | func! s:create_changelog() abort 80 | let changelog = ['Updated Plugins:'] 81 | for bundle_data in g:vundle#updated_bundles 82 | let initial_sha = bundle_data[0] 83 | let updated_sha = bundle_data[1] 84 | let bundle = bundle_data[2] 85 | 86 | let cmd = 'cd '.vundle#installer#shellesc(bundle.path()). 87 | \ ' && git log --pretty=format:"%s %an, %ar" --graph '. 88 | \ initial_sha.'..'.updated_sha 89 | 90 | let cmd = vundle#installer#shellesc_cd(cmd) 91 | 92 | let updates = system(cmd) 93 | 94 | call add(changelog, '') 95 | call add(changelog, 'Updated Plugin: '.bundle.name) 96 | 97 | if bundle.uri =~ "https://github.com" 98 | call add(changelog, 'Compare at: '.bundle.uri[0:-5].'/compare/'.initial_sha.'...'.updated_sha) 99 | endif 100 | 101 | for update in split(updates, '\n') 102 | let update = substitute(update, '\s\+$', '', '') 103 | call add(changelog, ' '.update) 104 | endfor 105 | endfor 106 | return changelog 107 | endf 108 | 109 | 110 | " --------------------------------------------------------------------------- 111 | " View the change log after an update or installation. 112 | " --------------------------------------------------------------------------- 113 | func! s:view_changelog() 114 | if !exists('s:changelog_file') 115 | let s:changelog_file = tempname() 116 | endif 117 | 118 | if bufloaded(s:changelog_file) 119 | execute 'silent bdelete' s:changelog_file 120 | endif 121 | call writefile(s:create_changelog(), s:changelog_file) 122 | execute 'silent pedit' s:changelog_file 123 | set bufhidden=wipe 124 | setl buftype=nofile 125 | setl noswapfile 126 | setl ro noma 127 | setfiletype vundlelog 128 | 129 | wincmd P | wincmd H 130 | endf 131 | 132 | 133 | " --------------------------------------------------------------------------- 134 | " Create a list of 'Plugin ...' lines from a list of bundle names. 135 | " 136 | " names -- a list of names (strings) of plugins 137 | " return -- a list of 'Plugin ...' lines suitable to be written to a buffer 138 | " --------------------------------------------------------------------------- 139 | func! vundle#scripts#bundle_names(names) 140 | return map(copy(a:names), ' printf("Plugin ' ."'%s'".'", v:val) ') 141 | endf 142 | 143 | 144 | " --------------------------------------------------------------------------- 145 | " Open a buffer to display information to the user. Several special commands 146 | " are defined in the new buffer. 147 | " 148 | " title -- a title for the new buffer 149 | " headers -- a list of header lines to be displayed at the top of the buffer 150 | " results -- the main information to be displayed in the buffer (list of 151 | " strings) 152 | " --------------------------------------------------------------------------- 153 | func! vundle#scripts#view(title, headers, results) 154 | if exists('s:view') && bufloaded(s:view) 155 | exec s:view.'bd!' 156 | endif 157 | 158 | exec 'silent pedit [Vundle] '.a:title 159 | 160 | wincmd P | wincmd H 161 | 162 | let s:view = bufnr('%') 163 | " 164 | " make buffer modifiable 165 | " to append without errors 166 | set modifiable 167 | 168 | call append(0, a:headers + a:results) 169 | 170 | setl buftype=nofile 171 | setl noswapfile 172 | set bufhidden=wipe 173 | 174 | setl cursorline 175 | setl nonu ro noma 176 | if (exists('&relativenumber')) | setl norelativenumber | endif 177 | 178 | setl ft=vundle 179 | setl syntax=vim 180 | syn keyword vimCommand Plugin 181 | syn keyword vimCommand Bundle 182 | syn keyword vimCommand Helptags 183 | 184 | com! -buffer -bang -nargs=1 DeletePlugin 185 | \ call vundle#installer#run('vundle#installer#delete', split(,',')[0], ['!' == '', ]) 186 | 187 | com! -buffer -bang -nargs=? InstallAndRequirePlugin 188 | \ call vundle#installer#run('vundle#installer#install_and_require', split(,',')[0], ['!' == '', ]) 189 | 190 | com! -buffer -bang -nargs=? InstallPlugin 191 | \ call vundle#installer#run('vundle#installer#install', split(,',')[0], ['!' == '', ]) 192 | 193 | com! -buffer -bang -nargs=0 InstallHelptags 194 | \ call vundle#installer#run('vundle#installer#docs', 'helptags', []) 195 | 196 | com! -buffer -nargs=0 VundleLog call s:view_log() 197 | 198 | com! -buffer -nargs=0 VundleChangelog call s:view_changelog() 199 | 200 | nnoremap q :silent bd! 201 | nnoremap D :exec 'Delete'.getline('.') 202 | 203 | nnoremap add :exec 'Install'.getline('.') 204 | nnoremap add! :exec 'Install'.substitute(getline('.'), '^Plugin ', 'Plugin! ', '') 205 | 206 | nnoremap i :exec 'InstallAndRequire'.getline('.') 207 | nnoremap I :exec 'InstallAndRequire'.substitute(getline('.'), '^Plugin ', 'Plugin! ', '') 208 | 209 | nnoremap l :VundleLog 210 | nnoremap u :VundleChangelog 211 | nnoremap h :h vundle 212 | nnoremap ? :h vundle 213 | 214 | nnoremap c :PluginClean 215 | nnoremap C :PluginClean! 216 | 217 | nnoremap s :PluginSearch 218 | nnoremap R :call vundle#scripts#reload() 219 | 220 | " goto first line after headers 221 | exec ':'.(len(a:headers) + 1) 222 | endf 223 | 224 | 225 | " --------------------------------------------------------------------------- 226 | " Load the plugin database from vim-scripts.org . 227 | " 228 | " to -- the filename (string) to save the database to 229 | " return -- 0 on success, 1 if an error occurred 230 | " --------------------------------------------------------------------------- 231 | func! s:fetch_scripts(to) 232 | let scripts_dir = fnamemodify(expand(a:to, 1), ":h") 233 | if !isdirectory(scripts_dir) 234 | call mkdir(scripts_dir, "p") 235 | endif 236 | 237 | let l:vim_scripts_json = 'http://vim-scripts.org/api/scripts.json' 238 | if executable("curl") 239 | let cmd = 'curl --fail -s -o '.vundle#installer#shellesc(a:to).' '.l:vim_scripts_json 240 | elseif executable("wget") 241 | let temp = vundle#installer#shellesc(tempname()) 242 | let cmd = 'wget -q -O '.temp.' '.l:vim_scripts_json. ' && mv -f '.temp.' '.vundle#installer#shellesc(a:to) 243 | if (has('win32') || has('win64')) 244 | let cmd = substitute(cmd, 'mv -f ', 'move /Y ', '') " change force flag 245 | let cmd = vundle#installer#shellesc(cmd) 246 | end 247 | else 248 | echoerr 'Error curl or wget is not available!' 249 | return 1 250 | endif 251 | 252 | call system(cmd) 253 | 254 | if (0 != v:shell_error) 255 | echoerr 'Error fetching scripts!' 256 | return v:shell_error 257 | endif 258 | return 0 259 | endf 260 | 261 | 262 | " --------------------------------------------------------------------------- 263 | " Load the plugin database and return a list of all plugins. 264 | " 265 | " bang -- if 1 download the redatabase, else only download if it is not 266 | " readable on disk (i.e. does not exist) 267 | " return -- a list of strings, these are the names (valid bundle 268 | " specifications) of all plugins from vim-scripts.org 269 | " --------------------------------------------------------------------------- 270 | func! s:load_scripts(bang) 271 | let f = expand(g:vundle#bundle_dir.'/.vundle/script-names.vim-scripts.org.json', 1) 272 | if a:bang || !filereadable(f) 273 | if 0 != s:fetch_scripts(f) 274 | return [] 275 | end 276 | endif 277 | return eval(readfile(f, 'b')[0]) 278 | endf 279 | 280 | " vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: 281 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/changelog.md: -------------------------------------------------------------------------------- 1 | Change Log 2 | ========== 3 | F = Feature, B = Bug Fix, D = Doc Change 4 | 5 | ### Version 0.10.2 6 | 7 | - B: #430 Put user script directories before system directories in rtp 8 | - B: #455 Rename functions that start with `g:` + lowercase letter (Vim patch 7.4.264) 9 | 10 | ### Version 0.10.1 11 | - B: #451 Escape spaces when handling rtp directories 12 | 13 | ### Version 0.10 14 | - F: #415 Support plugin pinning (for non-git repos & preventing updates) 15 | - F: #440 Detect plugin name collisions 16 | - F: #418 Deferred rtp manipulation (speeds up start) 17 | - B: #418 Leave default rtp directories (i.e. ~/.vim) where they should be 18 | - B: #429 Fix newline character in log 19 | - B: #440 Detect changed remotes & update repos 20 | - D: #435 Image update in README.md 21 | - D: #419 Add function documentation 22 | - D: #436 Rename vundle to Vundle.vim, add modelines, quickstart update 23 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/doc/vundle.txt: -------------------------------------------------------------------------------- 1 | *vundle.txt* Vundle, a plug-in manager for Vim. *vundle* 2 | 3 | VUNDLE MANUAL 4 | 5 | 1. About Vundle |vundle-about| 6 | 2. Quick Start |vundle-quickstart| 7 | 3. Plugins |vundle-plugins| 8 | 3.1. Configuring Plugins |vundle-plugins-configure| 9 | 3.2. Supported URIs |vundle-plugins-uris| 10 | 3.3. Installing Plugins |vundle-plugins-install| 11 | 3.4. Updating Plugins |vundle-plugins-update| 12 | 3.5. Searching Plugins |vundle-plugins-search| 13 | 3.6. Listing Plugins |vundle-plugins-list| 14 | 3.7. Cleaning Up |vundle-plugins-cleanup| 15 | 4. Interactive Mode |vundle-interactive| 16 | 5. Key Mappings |vundle-keymappings| 17 | 6. Options |vundle-options| 18 | 7. Plugin Interface Change |vundle-interface-change| 19 | 20 | ============================================================================= 21 | 1. ABOUT VUNDLE ~ 22 | *vundle-about* 23 | 24 | Vundle is short for Vim bundle and is a Vim plugin manager. 25 | 26 | Vundle allows you to... 27 | 28 | - keep track of and configure your scripts right in the `.vimrc` 29 | - install configured scripts (a.k.a. bundle) 30 | - update configured scripts 31 | - search by name all available Vim scripts 32 | - clean unused scripts up 33 | - run the above actions in a single keypress with interactive mode 34 | 35 | Vundle automatically... 36 | 37 | - manages the runtime path of your installed scripts 38 | - regenerates help tags after installing and updating 39 | 40 | Vundle's search uses http://vim-scripts.org to provide a list of all 41 | available Vim scripts. 42 | 43 | Vundle is undergoing an interface change, see |vundle-interface-change| for 44 | more information. 45 | 46 | ============================================================================= 47 | 2. QUICK START ~ 48 | *vundle-quickstart* 49 | 50 | 1. Introduction: 51 | 52 | Installation requires `Git` and triggers git clone for each configured 53 | repository to `~/.vim/bundle/` by default. Curl is required for search. 54 | 55 | *vundle-windows* 56 | If you are using Windows, see instructions on the Wiki 57 | https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows. 58 | 59 | *vundle-faq* 60 | If you run into any issues, please consult the FAQ at 61 | https://github.com/VundleVim/Vundle.vim/wiki 62 | 63 | 2. Setup Vundle: 64 | > 65 | git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim 66 | < 67 | 3. Configure bundles: 68 | 69 | Put this at the top of your `.vimrc` to use Vundle. Remove bundles you 70 | don't need, they are for illustration purposes. 71 | > 72 | set nocompatible " be iMproved, required 73 | filetype off " required 74 | 75 | " set the runtime path to include Vundle and initialize 76 | set rtp+=~/.vim/bundle/Vundle.vim 77 | call vundle#begin() 78 | " alternatively, pass a path where Vundle should install plugins 79 | "call vundle#begin('~/some/path/here') 80 | 81 | " let Vundle manage Vundle, required 82 | Plugin 'VundleVim/Vundle.vim' 83 | 84 | " The following are examples of different formats supported. 85 | " Keep Plugin commands between vundle#begin/end. 86 | " plugin on GitHub repo 87 | Plugin 'tpope/vim-fugitive' 88 | " plugin from http://vim-scripts.org/vim/scripts.html 89 | Plugin 'L9' 90 | " Git plugin not hosted on GitHub 91 | Plugin 'git://git.wincent.com/command-t.git' 92 | " git repos on your local machine (i.e. when working on your own plugin) 93 | Plugin 'file:///home/gmarik/path/to/plugin' 94 | " The sparkup vim script is in a subdirectory of this repo called vim. 95 | " Pass the path to set the runtimepath properly. 96 | Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} 97 | " Avoid a name conflict with L9 98 | Plugin 'user/L9', {'name': 'newL9'} 99 | 100 | " All of your Plugins must be added before the following line 101 | call vundle#end() " required 102 | filetype plugin indent on " required 103 | " To ignore plugin indent changes, instead use: 104 | "filetype plugin on 105 | " 106 | " Brief help 107 | " :PluginList - list configured plugins 108 | " :PluginInstall(!) - install (update) plugins 109 | " :PluginSearch(!) foo - search (or refresh cache first) for foo 110 | " :PluginClean(!) - confirm (or auto-approve) removal of unused plugins 111 | " 112 | " see :h vundle for more details or wiki for FAQ 113 | " Put your non-Plugin stuff after this line 114 | 115 | 4. Install configured bundles: 116 | 117 | Launch vim and run 118 | > 119 | :PluginInstall 120 | < 121 | To install from command line: 122 | > 123 | vim +PluginInstall +qall 124 | 125 | ============================================================================= 126 | 3. PLUGINS ~ 127 | *vundle-plugins* 128 | 129 | 3.1 CONFIGURING PLUGINS ~ 130 | *vundle-plugins-configure* *:Plugin* 131 | 132 | Vundle tracks what plugins you want configured by the `Plugin` commands in your 133 | `.vimrc`. Each `Plugin` command tells Vundle to activate the script on startup 134 | adding it to your |runtimepath|. Commenting out or removing the line will 135 | disable the `Plugin`. 136 | 137 | Each `Plugin` command takes a URI pointing to the script. No comments should 138 | follow on the same line as the command. Example: 139 | > 140 | Plugin 'git_URI' 141 | 142 | The `Plugin` command can optionally take a second argument after the URI. It 143 | has to be a dictionary, separated from the URI by a comma. Each key-value pair 144 | in the dictionary is a configuration option. 145 | 146 | The following per-script configuration options are available. 147 | 148 | The 'rtp' option 149 | ---------------- 150 | 151 | Specifies a directory inside the repository (relative path from the root of 152 | the repository) where the vim plugin resides. It determines the path that will 153 | be added to the |runtimepath|. 154 | 155 | For example: 156 | > 157 | Plugin 'git_URI', {'rtp': 'some/subdir/'} 158 | 159 | This can be used with git repositories that put the vim plugin inside a 160 | subdirectory. 161 | 162 | The 'name' option 163 | ----------------- 164 | 165 | The name of the directory that will hold the local clone of the configured 166 | script. 167 | 168 | For example: 169 | > 170 | Plugin 'git_URI', {'name': 'newPluginName'} 171 | 172 | This can be used to prevent name collisions between plugins that Vundle would 173 | otherwise try to clone into the same directory. It also provides an additional 174 | level of customisation. 175 | 176 | The 'pinned' option 177 | ------------------- 178 | 179 | A flag that, when set to a value of 1, tells Vundle not to perform any git 180 | operations on the plugin, while still adding the existing plugin under the 181 | `bundles` directories to the |runtimepath|. 182 | 183 | For example: 184 | > 185 | Plugin 'mylocalplugin', {'pinned': 1} 186 | 187 | This allows the users to include, with Vundle, plugins tracked with version 188 | control systems other than git, but the user is responsible for cloning and 189 | keeping up to date. It also allows the users to stay in the current version of 190 | a plugin that might have previously been updated by Vundle. 191 | 192 | Please note that the URI will be treated the same as for any other plugins, so 193 | only the last part of it will be added to the |runtimepath|. The user is 194 | advised to use this flag only with single word URIs to avoid confusion. 195 | 196 | 3.2 SUPPORTED URIS ~ 197 | *vundle-plugins-uris* 198 | 199 | `Vundle` integrates very well with both GitHub and vim-scripts.org 200 | (http://vim-scripts.org/vim/scripts.html) allowing short URIs. It also allows 201 | the use of any URI `git` recognizes. In all of the following cases (except 202 | local) the 'https' protocol is used, see Vundle's options to override this. 203 | 204 | More information on `git`'s protocols can be found at: 205 | http://git-scm.com/book/ch4-1.html 206 | 207 | GitHub 208 | ------ 209 | GitHub is used when a user/repo is passed to `Plugin`. 210 | > 211 | Plugin 'VundleVim/Vundle.vim' => https://github.com/VundleVim/Vundle.vim 212 | 213 | Vim Scripts 214 | ----------- 215 | Any single word without a slash '/' is assumed to be from Vim Scripts. 216 | > 217 | Plugin 'ctrlp.vim' => https://github.com/vim-scripts/ctrlp.vim 218 | 219 | Other Git URIs 220 | -------------- 221 | No modification is performed on valid URIs that point outside the above 222 | URLs. 223 | > 224 | Plugin 'git://git.wincent.com/command-t.git' 225 | 226 | Local Plugins 227 | ------------- 228 | The git protocol supports local installation using the 'file://' protocol. 229 | This is handy when developing plugins locally. Follow the protocol with an 230 | absolute path to the script directory. 231 | > 232 | Plugin 'file:///path/from/root/to/plugin' 233 | 234 | 3.3 INSTALLING PLUGINS ~ 235 | *vundle-plugins-install* *:PluginInstall* 236 | > 237 | :PluginInstall 238 | 239 | Will install all plugins configured in your `.vimrc`. Newly installed 240 | plugins will be automatically enabled. Some plugins may require extra steps 241 | such as compilation or external programs, refer to their documentation. 242 | 243 | PluginInstall allows installation of plugins by name: 244 | > 245 | :PluginInstall unite.vim 246 | 247 | Installs and activates unite.vim. 248 | 249 | PluginInstall also allows installation of several plugins separated by space. 250 | > 251 | :PluginInstall tpope/vim-surround tpope/vim-fugitive 252 | 253 | Installs both tpope/vim-surround and tpope/vim-fugitive from GitHub. 254 | 255 | You can use Tab to auto-complete known script names. 256 | Note that the installation just described isn't permanent. To 257 | finish, you must put `Plugin 'unite.vim'` at the appropriate place in your 258 | `.vimrc` to tell Vundle to load the plugin at startup. 259 | 260 | After installing plugins press 'l' (lowercase 'L') to see the log of commands 261 | if any errors occurred. 262 | 263 | 3.4 UPDATING PLUGINS ~ 264 | *vundle-plugins-update* *:PluginUpdate* *:PluginInstall!* 265 | > 266 | :PluginInstall! " NOTE: bang(!) 267 | or > 268 | :PluginUpdate 269 | 270 | Installs or updates the configured plugins. Press 'u' after updates complete 271 | to see the change log of all updated bundles. Press 'l' (lowercase 'L') to 272 | see the log of commands if any errors occurred. 273 | 274 | To update specific plugins, write their names separated by space: 275 | > 276 | :PluginInstall! vim-surround vim-fugitive 277 | or > 278 | :PluginUpdate vim-surround vim-fugitive 279 | 280 | 3.5 SEARCHING PLUGINS ~ 281 | *vundle-plugins-search* *:PluginSearch* 282 | > 283 | :PluginSearch 284 | 285 | Search requires that `curl` be available on the system. The command searches 286 | Vim Scripts (http://vim-scripts.org/vim/scripts.html) for matching 287 | plugins. Results display in a new split window. For example: 288 | > 289 | PluginSearch foo 290 | 291 | displays: 292 | > 293 | "Search results for: foo 294 | Plugin 'MarkdownFootnotes' 295 | Plugin 'VimFootnotes' 296 | Plugin 'foo.vim' 297 | < 298 | *:PluginSearch!* 299 | Alternatively, you can refresh the script list before searching by adding a 300 | bang to the command. 301 | > 302 | :PluginSearch! foo 303 | 304 | If the command is run without argument: 305 | > 306 | :PluginSearch! 307 | 308 | it will display all known plugins in the new split. 309 | 310 | 3.6 LISTING BUNDLES ~ 311 | *vundle-plugins-list* *:PluginList* 312 | > 313 | :PluginList 314 | 315 | Displays a list of installed bundles. 316 | 317 | 3.7 CLEANING UP ~ 318 | *vundle-plugins-cleanup* *:PluginClean* 319 | > 320 | :PluginClean 321 | 322 | Requests confirmation for the removal of all plugins no longered configured 323 | in your `.vimrc` but present in your bundle installation directory 324 | (default: `.vim/bundle/`). 325 | 326 | *:PluginClean!* 327 | > 328 | :PluginClean! 329 | 330 | Automatically confirm removal of unused bundles. 331 | 332 | ============================================================================= 333 | 4. INTERACTIVE MODE ~ 334 | *vundle-interactive* 335 | 336 | Vundle provides a simple interactive mode to help you explore new plugins 337 | easily. Interactive mode is available after any command that lists `Plugins` 338 | such as PluginSearch, PluginList or Plugins. For instance: 339 | > 340 | :PluginSearch! unite 341 | 342 | Searches for plugins matching 'unite' and yields a split window with: 343 | > 344 | "Keymap: i - Install bundle; c - Cleanup; s - Search; R - Reload list 345 | "Search results for: unite 346 | Plugin 'unite-scriptenames' 347 | Plugin 'unite.vim' 348 | Plugin 'unite-yarm' 349 | Plugin 'unite-gem' 350 | Plugin 'unite-locate' 351 | Plugin 'unite-font' 352 | Plugin 'unite-colorscheme' 353 | 354 | To install a bundle, move your cursor to the Plugin of interest and then 355 | select a command. To install 'unite.vim' put your cursor on the line and 356 | then push `i`. For a more complete list see |vundle-keymappings|. After 357 | unite.vim is installed the `:Unite file` command should be available. 358 | 359 | Note: Interactive installation doesn't update your `.vimrc`. 360 | 361 | ============================================================================= 362 | 5. KEY MAPPINGS ~ 363 | *vundle-keymappings* 364 | 365 | KEY | DESCRIPTION 366 | ----|-------------------------- > 367 | i | run :PluginInstall with name taken from line cursor is positioned on 368 | I | same as i, but runs :PluginInstall! to update bundle 369 | D | delete selected bundle (be careful not to remove local modifications) 370 | c | run :PluginClean 371 | s | run :PluginSearch 372 | R | fetch fresh script list from server 373 | 374 | ============================================================================= 375 | 6. OPTIONS ~ 376 | *vundle-options* 377 | > 378 | let g:vundle_default_git_proto = 'git' 379 | < 380 | This option makes Vundle use `git` instead of `https` when building 381 | absolute URIs. For example: 382 | > 383 | Plugin 'sjl/gundo.vim' -> git@github.com:sjl/gundo.git 384 | 385 | ============================================================================= 386 | 7. VUNDLE INTERFACE CHANGE ~ 387 | *vundle-interface-change* *:Bundle* *:BundleInstall!* 388 | *:BundleUpdate* *:BundleSearch* *:BundleList* *:BundleClean!* 389 | *:VundleInstall!* *:VundleUpdate* *:VundleSearch* 390 | *:VundleList* *:VundleClean!* 391 | 392 | In order to bring in new changes, Vundle is adopting a new interface. 393 | Going forward we will support primarily the Plugin namespace, additionally 394 | for convenience we will also alias some commands to the Vundle namespace. 395 | The following table summarizes the interface changes. 396 | 397 | Deprecated Names | New Names 398 | ----------------------------- 399 | Bundle | Plugin 400 | BundleInstall(!) | PluginInstall(!), VundleInstall(!) 401 | BundleUpdate | PluginUpdate, VundleUpdate 402 | BundleSearch(!) | PluginSearch(!), VundleSearch(!) 403 | BundleClean | PluginClean(!), VundleClean(!) 404 | BundleList | PluginList 405 | 406 | Note: The Bundle commands will be deprecated. You may continue using them, 407 | but they may not get all future updates. For instance, we have enabled 408 | comments on Plugin lines but not Bundle, since it requires a change in 409 | command declaration. 410 | 411 | " vim: set expandtab sts=2 ts=2 sw=2 tw=78 ft=help norl: 412 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/ftplugin/vundlelog.vim: -------------------------------------------------------------------------------- 1 | " --------------------------------------------------------------------------- 2 | " Standard ftplugin boilerplate; see ':help ftplugin'. 3 | " --------------------------------------------------------------------------- 4 | if exists("b:did_ftplugin") 5 | finish 6 | endif 7 | let b:did_ftplugin = 1 8 | 9 | 10 | " --------------------------------------------------------------------------- 11 | " Settings for the Vundle update log buffer. 12 | " --------------------------------------------------------------------------- 13 | setlocal textwidth=0 14 | setlocal nowrap 15 | setlocal noswapfile 16 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/syntax/vundlelog.vim: -------------------------------------------------------------------------------- 1 | " --------------------------------------------------------------------------- 2 | " Syntax highlighting for the line which identifies the plugin. 3 | " --------------------------------------------------------------------------- 4 | syntax match VundlePluginName '\v(^Updated Plugin: )@<=.*$' 5 | highlight link VundlePluginName Keyword 6 | 7 | " --------------------------------------------------------------------------- 8 | " Syntax highlighting for the 'compare at' line of each plugin. 9 | " --------------------------------------------------------------------------- 10 | syntax region VundleCompareLine start='\v^Compare at: https:' end='\v\n' 11 | \ contains=VundleCompareUrl 12 | syntax match VundleCompareUrl '\vhttps:\S+' 13 | highlight link VundleCompareLine Comment 14 | highlight link VundleCompareUrl Underlined 15 | 16 | " --------------------------------------------------------------------------- 17 | " Syntax highlighting for individual commits. 18 | " --------------------------------------------------------------------------- 19 | " The main commit line. 20 | " Note that this regex is intimately related to the one for VundleCommitTree, 21 | " and the two should be changed in sync. 22 | syntax match VundleCommitLine '\v(^ [|*]( *[\\|/\*])* )@<=[^*|].*$' 23 | \ contains=VundleCommitMerge,VundleCommitUser,VundleCommitTime 24 | highlight link VundleCommitLine String 25 | " Sub-regions inside the commit message. 26 | syntax match VundleCommitMerge '\v Merge pull request #\d+.*' 27 | syntax match VundleCommitUser '\v( )@<=\S+( \S+)*(, \d+ \w+ ago$)@=' 28 | syntax match VundleCommitTime '\v(, )@<=\d+ \w+ ago$' 29 | highlight link VundleCommitMerge Ignore 30 | highlight link VundleCommitUser Identifier 31 | highlight link VundleCommitTime Comment 32 | " The git history DAG markers are outside of the main commit line region. 33 | " Note that this regex is intimately related to the one for VundleCommitLine, 34 | " and the two should be changed in sync. 35 | syntax match VundleCommitTree '\v(^ )@<=[|*]( *[\\|/\*])*' 36 | highlight link VundleCommitTree Label 37 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/test/files/test.erl: -------------------------------------------------------------------------------- 1 | -module(mmc_logmon_sup). 2 | -behaviour(supervisor). 3 | -export([init/1]). 4 | 5 | init(_) -> 6 | {ok, { 7 | {one_for_one, 5, 1}, 8 | [ 9 | {listener, 10 | {aaa, start_link, []}, 11 | permanent, 100, worker, 12 | [aaa] 13 | }, 14 | {server, 15 | {bbb, start_link, []}, 16 | permanent, 100, worker, 17 | [bbb] 18 | } 19 | ] 20 | }}. 21 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/test/minirc.vim: -------------------------------------------------------------------------------- 1 | set nocompatible 2 | syntax on 3 | filetype off 4 | set rtp+=~/.vim/bundle/Vundle.vim/ 5 | call vundle#begin() 6 | Plugin 'VundleVim/Vundle.vim' 7 | call vundle#end() 8 | filetype plugin indent on 9 | 10 | -------------------------------------------------------------------------------- /.vim/vendor/vundle.vim/test/vimrc: -------------------------------------------------------------------------------- 1 | " vim -u test/vimrc 2 | set nocompatible 3 | 4 | set nowrap 5 | 6 | let bundle_dir = '/tmp/vundle-test/bundles/' 7 | " let src = 'http://github.com/gmarik/vundle.git' 8 | 9 | " Vundle Options 10 | " let g:vundle_default_git_proto = 'git' 11 | 12 | silent execute '!mkdir -p '.bundle_dir 13 | silent execute '!ln -f -s ~/.vim/bundle/Vundle.vim '.bundle_dir 14 | 15 | filetype off 16 | syntax on 17 | 18 | runtime macros/matchit.vim 19 | 20 | " This test should be executed in "test" directory 21 | exec 'set rtp^='.bundle_dir.'Vundle.vim/' 22 | 23 | call vundle#rc(bundle_dir) 24 | 25 | 26 | Plugin 'molokai' " vim-scripts name 27 | 28 | " github username with dashes 29 | Bundle 'vim-scripts/ragtag.vim' 30 | 31 | " original repo 32 | Bundle 'altercation/vim-colors-solarized' 33 | " with extension 34 | Bundle 'nelstrom/vim-mac-classic-theme.git' 35 | " 36 | " invalid uri 37 | "Bundle 'nonexistinguser/yupppierepo.git' 38 | 39 | " full uri 40 | Bundle 'https://github.com/vim-scripts/vim-game-of-life' 41 | " full uri 42 | Bundle 'git@github.com:gmarik/ingretu.git' 43 | " short uri 44 | Bundle 'gh:gmarik/snipmate.vim.git' 45 | Bundle 'github:mattn/gist-vim.git' 46 | 47 | " local uri stuff 48 | Bundle '~/Dropbox/.gitrepos/utilz.vim.git' 49 | " Bundle 'file://Dropbox/.gitrepos/utilz.vim.git' 50 | 51 | " with options 52 | Bundle 'rstacruz/sparkup.git', {'rtp': 'vim/'} 53 | Bundle 'matchit.zip', {'name': 'matchit'} 54 | 55 | " Camel case 56 | Bundle 'vim-scripts/RubySinatra' 57 | 58 | " syntax issue #203 59 | Bundle 'jimenezrick/vimerl' 60 | 61 | " Static bundle: Same name as a valid vim-scripts bundle 62 | Bundle 'latte', {'pinned' : 1} 63 | if !isdirectory(expand(bundle_dir) . '/latte') 64 | call mkdir(expand(bundle_dir) . '/latte', 'p') 65 | endif 66 | 67 | 68 | filetype plugin indent on " Automatically detect file types. 69 | 70 | set wildignore+=doc " should not break helptags 71 | set wildignore+=.git " should not break clone 72 | set wildignore+=.git/* " should not break clone 73 | set wildignore+=*/.git/* 74 | " TODO: helptags fails with this 75 | " set wildignore+=doc/* " should not break clone 76 | " set wildignore+=*/doc/* 77 | 78 | au VimEnter * BundleInstall 79 | 80 | " e test/files/erlang.erl 81 | " vim: set expandtab sts=2 ts=2 sw=2 tw=78: 82 | -------------------------------------------------------------------------------- /.vim/vimrc: -------------------------------------------------------------------------------- 1 | " General "{{{ 2 | set nocompatible " be iMproved 3 | 4 | scriptencoding utf-8 " utf-8 all the way 5 | set encoding=utf-8 6 | 7 | set history=256 " Number of things to remember in history. 8 | set timeoutlen=250 " Time to wait after ESC (default causes an annoying delay) 9 | set clipboard+=unnamed " Yanks go on clipboard instead. 10 | set pastetoggle= " toggle between paste and normal: for 'safer' pasting from keyboard 11 | set shiftround " round indent to multiple of 'shiftwidth' 12 | set tags=.git/tags;$HOME " consider the repo tags first, then 13 | 14 | set path+=$HOME/.vim/bundle/ 15 | 16 | set modeline 17 | set modelines=5 " default numbers of lines to read for modeline instructions 18 | 19 | set autowrite " Writes on make/shell commands 20 | set autoread 21 | 22 | set nobackup 23 | set nowritebackup 24 | set directory=/tmp// " prepend(^=) $HOME/.tmp/ to default path; use full path as backup filename(//) 25 | set noswapfile " 26 | 27 | set isfname-=: " do not treat `:` as part of the filename 28 | 29 | set hidden " The current buffer can be put to the background without writing to disk 30 | 31 | set hlsearch " highlight search 32 | set ignorecase " be case insensitive when searching 33 | set smartcase " be case sensitive when input has a capital letter 34 | set incsearch " show matches while typing 35 | 36 | let g:is_posix = 1 " vim's default is archaic bourne shell, bring it up to the 90s 37 | let mapleader = ',' 38 | let maplocalleader = ' ' " Tab as a local leader 39 | let g:netrw_banner = 0 " do not show Netrw help banner 40 | let g:netrw_sort_sequence = "[\/]$,^\.,*" " do not be C-specific 41 | 42 | " "}}} 43 | 44 | " Formatting "{{{ 45 | set fo+=o " Automatically insert the current comment leader after hitting 'o' or 'O' in Normal mode. 46 | set fo-=r " Do not automatically insert a comment leader after an enter 47 | set fo-=t " Do no auto-wrap text using textwidth (does not apply to comments) 48 | 49 | set nowrap 50 | set textwidth=0 " Don't wrap lines by default 51 | 52 | set tabstop=2 " tab size eql 8 spaces 53 | set softtabstop=2 " 54 | set shiftwidth=2 " default shift width for indents 55 | set expandtab " replace tabs with ${tabstop} spaces 56 | set smarttab " 57 | 58 | set backspace=indent 59 | set backspace+=eol 60 | set backspace+=start 61 | 62 | set autoindent 63 | set cindent 64 | set indentkeys-=0# " do not break indent on # 65 | set cinkeys-=0# 66 | set cinoptions=:s,ps,ts,cs 67 | set cinwords=if,else,while,do 68 | set cinwords+=for,switch,case 69 | " "}}} 70 | 71 | " Visual "{{{ 72 | syntax on " enable syntax 73 | 74 | " set synmaxcol=250 " limit syntax highlighting to 128 columns 75 | 76 | set mouse=a "enable mouse in GUI mode 77 | set mousehide " Hide mouse after chars typed 78 | 79 | set nonumber " line numbers Off 80 | set showmatch " Show matching brackets. 81 | set matchtime=2 " Bracket blinking. 82 | 83 | set wildmode=longest,list " At command line, complete longest common string, then list alternatives. 84 | 85 | set completeopt-=preview " disable auto opening preview window 86 | 87 | set novisualbell " No blinking 88 | set noerrorbells " No noise. 89 | set vb t_vb= " disable any beeps or flashes on error 90 | 91 | set laststatus=2 " always show status line. 92 | set shortmess=atI " shortens messages 93 | set showcmd " display an incomplete command in statusline 94 | 95 | set statusline=%<%f\ " custom statusline 96 | set stl+=[%{&ff}] " show fileformat 97 | set stl+=%y%m%r%= 98 | set stl+=%-14.(%l,%c%V%)\ %P 99 | 100 | 101 | set foldenable " Turn on folding 102 | set foldmethod=marker " Fold on the marker 103 | set foldlevel=100 " Don't autofold anything (but I can still fold manually) 104 | 105 | set foldopen=block,hor,tag " what movements open folds 106 | set foldopen+=percent,mark 107 | set foldopen+=quickfix 108 | 109 | set virtualedit=block 110 | 111 | set splitbelow 112 | set splitright 113 | 114 | set list " display unprintable characters f12 - switches 115 | set listchars=tab:\ ·,eol:¬ 116 | set listchars+=trail:· 117 | set listchars+=extends:»,precedes:« 118 | map :set invlist 119 | 120 | if has('gui_running') 121 | set guioptions=cMg " console dialogs, do not show menu and toolbar 122 | 123 | " Fonts 124 | " :set guifont=* " to launch a GUI dialog 125 | if has('mac') 126 | if has('macligatures') 127 | set antialias guifont=Fira\ Code\ Light:h13 macligatures " -> <= 128 | else 129 | set noantialias linespace=0 guifont=Andale\ Mono:h14 130 | " set antialias linespace=1 guifont=Go\ Mono:h13 131 | end 132 | set fuoptions=maxvert,maxhorz ",background:#00AAaaaa 133 | else 134 | set guifont=Terminus:h16 135 | end 136 | endif 137 | " "}}} 138 | 139 | " Key mappings " {{{ 140 | 141 | " Tmux 142 | nnoremap rp :silent !tmux send-keys -t "wip:test" C-p C-m 143 | 144 | 145 | " Duplication 146 | " 147 | nnoremap c mz"dyy"dp`z 148 | vnoremap c "dymz"dP`z 149 | 150 | " quick nav 151 | nnoremap rs :source ~/.vimrc 152 | nnoremap rs :source ~/.vimrc 153 | nnoremap rt :tabnew ~/.vim/vimrc 154 | nnoremap re :e ~/.vim/vimrc 155 | nnoremap rd :e ~/.vim/ 156 | nnoremap rc :silent ! cd ~/.vim/ && git commit ~/.vim/vimrc -v 157 | 158 | " Disable Esc: future is inescapeable 159 | inoremap 160 | nnoremap 161 | " use Ctrl-C or below ones instead 162 | inoremap 163 | inoremap 164 | 165 | " Tabs 166 | nnoremap :tabprev 167 | nnoremap :tabnext 168 | 169 | " Buffers 170 | nnoremap - :bd 171 | nnoremap -- :bd! 172 | " Split line(opposite to S-J joining line) 173 | nnoremap gEaew 174 | 175 | " map v :vnew 176 | " map s :snew 177 | 178 | " copy filename 179 | map . :let @+=expand('%:p').':'.line('.') 180 | map / :let @+=expand('%:p:h') 181 | " copy path 182 | 183 | 184 | map A 185 | 186 | map E :Explore 187 | map EE :Vexplore!= 188 | 189 | " toggle search highlighting 190 | nnoremap :let &hls=1-&hls 191 | 192 | " " Make Control-direction switch between windows (like C-W h, etc) 193 | " nmap 194 | " nmap 195 | " nmap 196 | " nmap 197 | 198 | inoremap 199 | inoremap 200 | inoremap 201 | inoremap 202 | 203 | 204 | " vertical paragraph-movement 205 | nmap { 206 | nmap } 207 | 208 | " vertical split with fuzzy-searcher 209 | nnoremap v :exec ':vnew \| CtrlP' 210 | " and without 211 | nnoremap V :vnew 212 | 213 | " when pasting copy pasted text back to 214 | " buffer instead replacing with owerride 215 | xnoremap p pgvy 216 | 217 | if has('mac') 218 | 219 | if has('gui_running') 220 | set macmeta 221 | end 222 | 223 | " map(range(1,9), 'exec "imap ".v:val."gt"') 224 | " map(range(1,9), 'exec " map ".v:val."gt"') 225 | 226 | " Copy whole line 227 | nnoremap yy 228 | 229 | " close/delete buffer when closing window 230 | map :bdelete 231 | endif 232 | 233 | " Control+S and Control+Q are flow-control characters: disable them in your terminal settings. 234 | " $ stty -ixon -ixoff 235 | noremap :update 236 | vnoremap :update 237 | inoremap :update 238 | " 239 | " generate HTML version current buffer using current color scheme 240 | map 2h :runtime! syntax/2html.vim 241 | 242 | " " }}} 243 | 244 | " AutoCommands " {{{ 245 | " 246 | au BufRead,BufNewFile {*.go} setl ft=go tabstop=2 247 | au BufRead,BufNewFile {Gemfile,Rakefile,*.rake,config.ru,*.rabl} setl ft=ruby tabstop=2 softtabstop=2 shiftwidth=2 expandtab smarttab 248 | au BufRead,BufNewFile {*.local} setl ft=sh 249 | au BufRead,BufNewFile {*.md,*.mkd,*.markdown} setl ft=markdown 250 | au BufRead,BufNewFile {*.scala} setl ft=scala 251 | au! BufReadPost {COMMIT_EDITMSG,*/COMMIT_EDITMSG} exec 'setl ft=gitcommit noml list spell' | norm 1G 252 | au! BufWritePost {*.snippet,*.snippets} call ReloadAllSnippets() 253 | 254 | " open help in vertical split 255 | " au BufWinEnter {*.txt} if 'help' == &ft | wincmd H | nmap q :q | endif 256 | " " }}} 257 | 258 | " Scripts and Plugins " {{{ 259 | filetype off 260 | runtime macros/matchit.vim 261 | set rtp+=~/.vim/vendor/snipmate.snippets/ 262 | set rtp+=~/.vim/vendor/vundle.vim/ 263 | call vundle#rc() 264 | 265 | " Colorscheme 266 | Plugin 'gmarik/ingretu' 267 | 268 | " if has("gui_running") 269 | " colorscheme ingretu 270 | " endif 271 | 272 | " Programming 273 | Plugin 'majutsushi/tagbar' 274 | 275 | " Python 276 | Plugin 'davidhalter/jedi-vim' 277 | Plugin 'klen/python-mode' 278 | let g:pymode_lint = 0 279 | 280 | " Golang 281 | Plugin 'fatih/vim-go' 282 | " unlike gofmt also adds/removes imports 283 | let g:go_fmt_command = 'gofmt' 284 | let g:go_highlight_functions = 1 285 | let g:go_highlight_methods = 1 286 | let g:go_highlight_structs = 1 287 | let g:go_highlight_build_constraints = 1 288 | 289 | augroup go 290 | " clear everything 291 | autocmd! 292 | 293 | " set visuals 294 | au BufRead,BufNewFile go setl tabstop=2 softtabstop=2 noexpandtab smarttab 295 | " TODO: not working 296 | au BufWritePost go if get(g:,'auto_test') | exec ':GoTest' | endif 297 | 298 | " bindings 299 | au FileType go nmap t :GoTest 300 | au FileType go nmap tf :GoTestFunc 301 | au FileType go nmap r :GoRun 302 | au FileType go nmap e :GoErrCheck 303 | au FileType go nmap v :GoVet 304 | au FileType go nmap l :GoLint 305 | au FileType go nmap ll :GoMetaLinter 306 | au FileType go nmap i :GoImports 307 | au FileType go nmap ii :GoImport 308 | au FileType go nmap d :GoDecls 309 | au FileType go nmap dd :GoDeclsDir 310 | 311 | au FileType go nmap gr :exec ':CtrlP '.system('go env GOROOT')[:-2].'/src/' 312 | au FileType go nmap gp :exec ':CtrlP '.system('go env GOPATH')[:-2].'/src/' 313 | 314 | " commands 315 | autocmd Filetype go command! -bang A call go#alternate#Switch(0, 'edit') 316 | autocmd Filetype go command! -bang AV call go#alternate#Switch(0, 'vsplit') 317 | autocmd Filetype go command! -bang AT GoAutoTypeInfoToggle 318 | autocmd Filetype go command! -bang TT let g:auto_test = 1 - get(g:, 'auto_test') 319 | autocmd Filetype go exec ':set path+=$GOPATH/src,'.system('go env GOPATH')[:-2].'/src,'.system('go env GOROOT')[:-2].'/src,' 320 | 321 | 322 | augroup END 323 | 324 | " goes to the definition under cursor in a new split 325 | " TODO: doesn't work 326 | nnoremap gd ^zz 327 | 328 | 329 | " nand2tetris 330 | Plugin 'sevko/vim-nand2tetris-syntax' 331 | 332 | " Ruby/Rails 333 | Plugin 'tpope/vim-rails' 334 | 335 | " Elm 336 | Plugin 'ElmCast/elm-vim' 337 | let g:elm_setup_keybindings = 0 338 | 339 | " Js 340 | Plugin 'pangloss/vim-javascript' 341 | Plugin 'mxw/vim-jsx' 342 | 343 | " Snippets 344 | Plugin 'gmarik/snipmate.vim' 345 | nnoremap so :Explore ~/.vim/vendor/snipmate.snippets/snippets/ 346 | 347 | 348 | 349 | " Syntax highlight 350 | Plugin 'gmarik/vim-markdown' 351 | Plugin 'timcharper/textile.vim' 352 | 353 | " Git integration 354 | Plugin 'tpope/vim-git' 355 | Plugin 'tpope/vim-fugitive' 356 | " Plugin 'junegunn/gv.vim' 357 | 358 | nnoremap W :Gwrite 359 | nnoremap C :Gcommit -v 360 | nnoremap S :Gstatus \| 7 361 | inoremap W W 362 | inoremap C C 363 | inoremap S S 364 | 365 | Plugin 'tpope/vim-repeat' 366 | Plugin 'tpope/vim-surround' 367 | Plugin 'tpope/vim-unimpaired' 368 | 369 | " bubble current line 370 | nmap ]e 371 | nmap [e 372 | " bubble visual selection lines 373 | vmap ]egv 374 | vmap [egv 375 | 376 | " Utility 377 | Plugin 'AndrewRadev/splitjoin.vim' 378 | nmap sj :SplitjoinJoin 379 | nmap sk :SplitjoinSplit 380 | 381 | " Plugin 'gmarik/github-search.vim' 382 | 383 | Plugin 'gmarik/ide-popup.vim' 384 | Plugin 'gmarik/sudo-gui.vim' 385 | 386 | Plugin 'sjl/gundo.vim' 387 | 388 | Plugin 'mkitt/browser-refresh.vim' 389 | com! ONRRB :au! BufWritePost :RRB 390 | com! NORRB :au! BufWritePost 391 | 392 | 393 | " Plugin 'bogado/file-line' 394 | Plugin 'junegunn/vim-easy-align' 395 | Plugin 'vim-scripts/lastpos.vim' 396 | 397 | Plugin 'Lokaltog/vim-easymotion' 398 | let g:EasyMotion_leader_key='' 399 | 400 | Plugin 'ZoomWin' 401 | noremap o :ZoomWin 402 | vnoremap o :ZoomWin 403 | inoremap o :ZoomWin 404 | 405 | Plugin 'tomtom/tlib_vim' 406 | Plugin 'tomtom/tcomment_vim' 407 | nnoremap // :TComment 408 | vnoremap // :TComment 409 | 410 | Plugin 'gmarik/hlmatch.vim' 411 | nnoremap # :HlmCword 412 | nnoremap # :HlmGrepCword 413 | vnoremap # :HlmVSel 414 | vnoremap # :HlmGrepVSel 415 | 416 | nnoremap ## :HlmPartCword 417 | nnoremap ## :HlmPartGrepCword 418 | vnoremap ## :HlmPartVSel 419 | vnoremap ## :HlmPartGrepVSel 420 | 421 | Plugin 'ctrlpvim/ctrlp.vim' 422 | let g:ctrlp_switch_buffer = 'et' 423 | let g:ctrlp_map = 't' 424 | let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:10,results:10' 425 | let g:ctrlp_extensions = ['tag', 'buffertag', 'dir', 'rtscript', 426 | \ 'undo', 'line', 'changes', 'mixed', 'bookmarkdir'] 427 | 428 | nnoremap 0 :CtrlPClearAllCaches 429 | nnoremap ` :CtrlPUndo 430 | nnoremap 1 :CtrlPTag 431 | nnoremap 2 :exec ':CtrlP '.expand('%:h:p') 432 | nnoremap 22 :CtrlP 433 | nnoremap 3 :CtrlPBuffer 434 | nnoremap 4 :exec 'CtrlPDir '.expand('%:h:p') 435 | nnoremap 44 :CtrlPDir 436 | nnoremap 6 :CtrlPMRU 437 | nnoremap 7 :CtrlPLine 438 | nnoremap 8 :CtrlPChange 439 | nnoremap h :CtrlPRTS 440 | 441 | 442 | Plugin 'rstacruz/sparkup.git', {'rtp': 'vim/'} 443 | let g:sparkupExecuteMapping = '' 444 | let g:sparkupNextMapping = '' 445 | 446 | filetype plugin indent on " Automatically detect file types. 447 | 448 | " }}} 449 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | if filereadable(expand("~/.vim/vimrc")) 2 | source ~/.vim/vimrc 3 | endif 4 | " 5 | if has("gui_running") && filereadable(expand("~/.vim/gvimrc")) 6 | source ~/.vim/gvimrc 7 | endif 8 | 9 | if filereadable(expand("~/.vim/vimrc.local")) 10 | source ~/.vim/vimrc.local 11 | endif 12 | -------------------------------------------------------------------------------- /.xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # ~/.xinitrc 4 | # 5 | # Executed by startx (run your window manager from here) 6 | 7 | #exec gnome-session 8 | /etc/X11/xinit/xinitrc.d/98vboxadd-xclient.sh && exec wmii 9 | # exec startkde 10 | # exec startxfce4 11 | # ...or the Window Manager of your choice 12 | -------------------------------------------------------------------------------- /.xmodmap: -------------------------------------------------------------------------------- 1 | # http://www.radekw.com/blog/2009/05/06/linux-and-apple-keyboard/ 2 | clear Mod4 3 | keycode 169 = Delete 4 | 5 | # keycode 133 = Alt_L Meta_L 6 | # keycode 134 = Alt_R Meta_R 7 | -------------------------------------------------------------------------------- /.xsession: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # ~/.xsession 5 | # 6 | # Executed by xdm/gdm/kdm at login 7 | # 8 | 9 | /bin/bash --login -i ~/.xinitrc 10 | 11 | -------------------------------------------------------------------------------- /Library/Application Support/Code/User/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | // Overwrite settings by placing them into your settings file. 3 | // See http://go.microsoft.com/fwlink/?LinkId=808995 for the most commonly used settings. 4 | // Tips & Tricks: https://github.com/Microsoft/vscode-tips-and-tricks 5 | // env vars: https://code.visualstudio.com/Docs/editor/debugging#_variable-substitution 6 | // Editor 7 | // Controls the font family. 8 | "editor.fontFamily": "Andale Mono, Go Mono, Menlo, Monaco, 'Courier New', monospace", 9 | // Controls the font weight. 10 | "editor.fontWeight": "normal", 11 | // Controls the font size in pixels. 12 | "editor.fontSize": 14, 13 | "window.zoomLevel": 1, 14 | // Format a file on save. A formatter must be available, the file must not be auto-saved, and editor must not be shutting down. 15 | "editor.formatOnSave": false, 16 | // Controls the line height. Use 0 to compute the lineHeight from the fontSize. 17 | "editor.lineHeight": 0, 18 | // Controls the display of line numbers. Possible values are 'on', 'off', and 'relative'. 'relative' shows the line count from the current cursor position. 19 | "editor.lineNumbers": "off", 20 | // Columns at which to show vertical rulers 21 | "editor.rulers": [], 22 | // Characters that will be used as word separators when doing word related navigations or operations 23 | "editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?", 24 | // The number of spaces a tab is equal to. This setting is overriden based on the file contents when `editor.detectIndentation` is on. 25 | "editor.tabSize": 2, 26 | // Insert spaces when pressing Tab. This setting is overriden based on the file contents when `editor.detectIndentation` is on. 27 | "editor.insertSpaces": true, 28 | // When opening a file, `editor.tabSize` and `editor.insertSpaces` will be detected based on the file contents. 29 | "editor.detectIndentation": true, 30 | // Controls if the editor will scroll beyond the last line 31 | "editor.scrollBeyondLastLine": true, 32 | // Controls if lines should wrap. The lines will wrap at min(editor.wrappingColumn, viewportWidthInColumns). 33 | "editor.wordWrap": "off", 34 | // Controls the indentation of wrapped lines. Can be one of 'none', 'same' or 'indent'. 35 | "editor.wrappingIndent": "same", 36 | // A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events 37 | "editor.mouseWheelScrollSensitivity": 1, 38 | // Controls if quick suggestions should show up or not while typing 39 | "editor.quickSuggestions": { 40 | "comments": "on", 41 | "strings": "on", 42 | "other": "on" 43 | }, 44 | // Controls the delay in ms after which quick suggestions will show up 45 | "editor.quickSuggestionsDelay": 10, 46 | // Controls if the editor should automatically close brackets after opening them 47 | "editor.autoClosingBrackets": "languageDefined", 48 | // Controls if the editor should automatically format the line after typing 49 | "editor.formatOnType": false, 50 | // Controls if suggestions should automatically show up when typing trigger characters 51 | "editor.suggestOnTriggerCharacters": true, 52 | // Controls if suggestions should be accepted 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions. 53 | "editor.acceptSuggestionOnEnter": "on", 54 | // Controls whether snippets are shown with other suggestions and how they are sorted. 55 | "editor.snippetSuggestions": "bottom", 56 | // Controls whether copying without a selection copies the current line. 57 | "editor.emptySelectionClipboard": true, 58 | // Enable word based suggestions. 59 | "editor.wordBasedSuggestions": true, 60 | // Font size for the suggest widget 61 | "editor.suggestFontSize": 0, 62 | // Line height for the suggest widget 63 | "editor.suggestLineHeight": 0, 64 | // Insert snippets when their prefix matches. Works best when 'quickSuggestions' aren't enabled. 65 | "editor.tabCompletion": "on", 66 | // Controls whether the editor should highlight similar matches to the selection 67 | "editor.selectionHighlight": true, 68 | // Controls the number of decorations that can show up at the same position in the overview ruler 69 | "editor.overviewRulerLanes": 3, 70 | // Control the cursor animation style, possible values are 'blink', 'smooth', 'phase', 'expand' and 'solid' 71 | "editor.cursorBlinking": "smooth", 72 | // Zoom the font of the editor when using mouse wheel and holding Ctrl 73 | "editor.mouseWheelZoom": false, 74 | // Controls the cursor style, accepted values are 'block', 'line' and 'underline' 75 | "editor.cursorStyle": "line", 76 | // Controls if the cursor should be hidden in the overview ruler. 77 | "editor.hideCursorInOverviewRuler": false, 78 | "editor.minimap.enabled": false, 79 | // Controls how the editor should render whitespace characters, posibilties are 'none', 'boundary', and 'all'. The 'boundary' option does not render single spaces between words. 80 | "editor.renderWhitespace": "all", 81 | // Controls whether the editor should render control characters 82 | "editor.renderControlCharacters": true, 83 | // Controls whether the editor should render the current line highlight 84 | "editor.renderLineHighlight": "gutter", 85 | // Controls if the editor shows code lenses 86 | "editor.codeLens": true, 87 | // Controls whether the editor has code folding enabled 88 | "editor.folding": true, 89 | // Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging. 90 | "editor.glyphMargin": true, 91 | // Inserting and deleting whitespace follows tab stops 92 | "editor.useTabStops": true, 93 | // Remove trailing auto inserted whitespace 94 | "editor.trimAutoWhitespace": true, 95 | // Keep peek editors open even when double clicking their content or when hitting Escape. 96 | "editor.stablePeek": false, 97 | // Controls if the diff editor shows the diff side by side or inline 98 | "diffEditor.renderSideBySide": true, 99 | // Controls if the diff editor shows changes in leading or trailing whitespace as diffs 100 | "diffEditor.ignoreTrimWhitespace": true, 101 | // Files 102 | // Configure glob patterns for excluding files and folders. 103 | "files.exclude": { 104 | "**/.git": true, 105 | "**/.svn": true, 106 | "**/.hg": true, 107 | "**/.DS_Store": true 108 | }, 109 | // Configure file associations to languages (e.g. "*.extension": "html"). These have precedence over the default associations of the languages installed. 110 | "files.associations": {}, 111 | // The default character set encoding to use when reading and writing files. 112 | "files.encoding": "utf8", 113 | // The default end of line character. 114 | "files.eol": "\n", 115 | // When enabled, will trim trailing whitespace when you save a file. 116 | "files.trimTrailingWhitespace": false, 117 | // Controls auto save of dirty files. Accepted values: "off", "afterDelay", "onFocusChange" (editor loses focus), "onWindowChange" (window loses focus). If set to "afterDelay", you can configure the delay in "files.autoSaveDelay". 118 | "files.autoSave": "off", 119 | // Controls the delay in ms after which a dirty file is saved automatically. Only applies when "files.autoSave" is set to "afterDelay" 120 | "files.autoSaveDelay": 1000, 121 | // Configure glob patterns of file paths to exclude from file watching. Changing this setting requires a restart. When you experience Code consuming lots of cpu time on startup, you can exclude large folders to reduce the initial load. 122 | "files.watcherExclude": { 123 | "**/.git/objects/**": true, 124 | "**/node_modules/**": true 125 | }, 126 | "files.insertFinalNewline": true, 127 | // Configure glob patterns for excluding files and folders in searches. Inherits all glob patterns from the files.exclude setting. 128 | "search.exclude": { 129 | "**/node_modules": true, 130 | "**/bower_components": true 131 | }, 132 | // Configure to include results from a global symbol search in the file results for Quick Open. 133 | "search.quickOpen.includeSymbols": false, 134 | // Git 135 | // Is git enabled 136 | "git.enabled": true, 137 | "git.path": null, 138 | "git.confirmSync": true, 139 | "git.countBadge": "all", 140 | // JSON 141 | "json.schemas": [], 142 | "json.format.enable": true, 143 | // Go settings 144 | "[go]": { 145 | "editor.formatOnSave": true, 146 | "editor.insertSpaces": false, 147 | "editor.tabSize": 2, 148 | "editor.fontFamily": "Go Mono, Andale Mono, Menlo, Monaco, 'Courier New', monospace", 149 | }, 150 | // Vim configuration 151 | "vim.easymotion": true, 152 | "vim.autoindent": false, 153 | "vim.hlsearch": true, 154 | "vim.leader": "", 155 | "vim.useSystemClipboard": true, 156 | "workbench.editor.enablePreviewFromQuickOpen": false, 157 | "breadcrumbs.enabled": true, 158 | "go.autocompleteUnimportedPackages": true, 159 | "go.installDependenciesWhenBuilding": false, 160 | "go.useLanguageServer": true, 161 | "workbench.colorTheme": "Material Theme High Contrast", 162 | "material-icon-theme.activeIconPack": "react", 163 | "materialTheme.accent": "Acid Lime", 164 | "terminal.integrated.fontSize": 14, 165 | "editor.fontLigatures": true, 166 | "workbench.editorAssociations": { 167 | "git-rebase-todo": "default" 168 | }, 169 | "remote.SSH.allowLocalServerDownload": true, 170 | "terminal.integrated.enablePersistentSessions": false, 171 | "remote.SSH.connectTimeout": 45, 172 | "diffEditor.renderSideBySide": false, 173 | "python.analysis.typeCheckingMode": "basic", 174 | "editor.guides.indentation": true, 175 | 176 | } 177 | -------------------------------------------------------------------------------- /bin/bak: -------------------------------------------------------------------------------- 1 | 2 | 3 | dir=${@%/} # remove trailing slash 4 | mv $dir ${dir}_bak 5 | 6 | # vim: ft=sh 7 | -------------------------------------------------------------------------------- /bin/date-iso-8601: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # set $1 to `-u` for UTC time-zone 4 | date $1 +"%Y-%m-%dT%H:%M:%S%z" 5 | -------------------------------------------------------------------------------- /bin/du-hrs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # list everything except `..` 4 | # disk usage with human readable sizes 5 | # reverse sort by size 6 | ls -1 -A|xargs gdu -sh |gsort -hr 7 | -------------------------------------------------------------------------------- /bin/gifify: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # v1 from https://gist.github.com/SlexAxton/4989674 3 | # v2 from https://gist.github.com/dergachev/4627207 4 | 5 | set -eu 6 | 7 | gifify() { 8 | if [[ -n "$1" ]]; then 9 | ffmpeg -i "$1" -pix_fmt rgb24 -vf scale="iw/1:ih/1" -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > "$1.gif" 10 | else 11 | echo "proper usage: gifify . You DO need to include extension." 12 | fi 13 | } 14 | 15 | install_osx() { 16 | brew install ffmpeg 17 | brew tap phinze/homebrew-cask 18 | brew install brew-cask 19 | brew cask install x-quartz 20 | open /usr/local/Cellar/x-quartz/2.7.4/XQuartz.pkg 21 | # click through the stuff 22 | brew install gifsicle 23 | brew install imagemagick 24 | 25 | # I had a weird problem with Convert/imagemagick where I had to do: 26 | # ln -s /usr/local/Cellar/libtool/2.4.2/lib/libltdl.7.dylib libltdl.7.dylib 27 | } 28 | 29 | case "$*" in 30 | "--install") install_osx;; 31 | *) gifify "$*";; 32 | esac 33 | 34 | # vim: ft=sh 35 | -------------------------------------------------------------------------------- /bin/git-branch-cleanup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "* Fetching remotes" 4 | git fetch 5 | 6 | echo "* Pruning remote branches " 7 | git remote prune origin 8 | 9 | local_branches=$(git branch --merged origin/master | cut -c 2-| grep -v 'master$') 10 | echo "* Cleaning local,merged branches '$(echo $local_branches|xargs)'" 11 | echo $local_branches | xargs git branch -d 12 | 13 | remote_branches=$(git branch -r --merged origin/master | grep -Ev '/(master|HEAD)$') 14 | echo "* Cleaning remote,merged branch references '$(echo $remote_branches|xargs)'" 15 | echo $remote_branches | xargs git branch -d -r 16 | 17 | merged_branches=$(git blss) 18 | echo "* Cleaning squashed,merged branches '$(echo $merged_branches|xargs)'" 19 | echo $merged_branches | xargs git branch -d -f 20 | 21 | gone_branches=$(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}') 22 | echo "* Cleaning gone branches '$(echo $gone_branches|xargs)'" 23 | echo $gone_branches | xargs git branch -d -f 24 | 25 | echo "* Deleting remote branches '$(echo $remote_branches|xargs)'" 26 | for b in $remote_branches; do 27 | # `${b/\// }` splits `origin/name` into `origin name` 28 | # TODO: push can accept multiple names per origin 29 | git push --delete ${b/\// } 30 | done 31 | 32 | # vim: ft=sh 33 | -------------------------------------------------------------------------------- /bin/git-branch-diff: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | comm -12 <(git branch -a --no-merged ${2:-'master'} ) <(git branch -a --merged ${1:-'staging'} )|grep 'remote/' 5 | -------------------------------------------------------------------------------- /bin/git-branch-merged-remotes: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git branch --sort=-committerdate --remote --merged origin/master \ 4 | | grep -v origin/master \ 5 | | while read branch; do 6 | git --no-pager log --pretty=lh -1 "$branch" 7 | done 8 | -------------------------------------------------------------------------------- /bin/git-ls-files-untracked: -------------------------------------------------------------------------------- 1 | git status --short --untracked-files=normal |grep ^??|cut -d' ' -f2 2 | -------------------------------------------------------------------------------- /bin/git-mirror-dropbox: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | mirror_dbox() { 6 | repo=$(basename -s .git $(pwd)).git 7 | git clone --bare ./.git/ ~/Dropbox/.gitrepos/${repo} 8 | git remote add dbox ~/Dropbox/.gitrepos/${repo} 9 | git push dbox --mirror 10 | } 11 | 12 | repo_not_found() { 13 | echo "${git_dir} not found" 14 | exit 1 15 | } 16 | 17 | git_dir=${1:-`pwd`}/.git 18 | 19 | [ -d ${git_dir} ] && mirror_dbox || repo_not_found 20 | 21 | -------------------------------------------------------------------------------- /bin/git-mirror-to: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | repo_name=$(basename $PWD) 6 | remote_name=$1 7 | remote_path="~/.git-repos/$repo_name.git" 8 | remote_url="$remote_name:~/.git-repos/$repo_name.git" 9 | 10 | echo $remote_name $remote_url $repo_name 11 | 12 | ssh $remote_name "git init --bare $remote_path" 13 | git remote add $remote_name "$remote_url" 14 | git push $remote_name 15 | 16 | 17 | -------------------------------------------------------------------------------- /bin/git-user-set: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # take default config 4 | # which is probably overriden by ~/.gitconfig-local 5 | U=$(git config user.name) 6 | E=$(git config user.email) 7 | 8 | git config --local user.email "$E" 9 | git config --local user.name "$U" 10 | -------------------------------------------------------------------------------- /bin/git-user-set-gmarik: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git config --local user.email gmarik+git@gmail.com 4 | git config --local user.name gmarik 5 | 6 | 7 | -------------------------------------------------------------------------------- /bin/go-cover-all: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # vim: set ft=sh: 4 | 5 | set -e 6 | set -x 7 | 8 | cleanup() { 9 | rm -f .build/.*.cover 10 | rm -f .build/*.cover 11 | rm -f .build/*-coverage.html 12 | } 13 | 14 | # generate 0% coverge for everything: to be overriden by a real coverage 15 | # enables coverage report include completely uncovered files 16 | gen_zero_coverage() { 17 | go list -f '{{$path := .ImportPath}}{{range $idx, $f := .GoFiles}}{{ printf "%s/%s:0.0,0.0 0 0\n" $path $f}}{{end}}' $@ 18 | } 19 | 20 | write_coverage_reports() { 21 | # get actual covers 22 | for pkg in "$@"; do 23 | cname=".build/.$(echo $pkg|tr / -).cover" 24 | go test -covermode=count -coverprofile "$cname" "$pkg" 25 | done 26 | } 27 | 28 | merge_coverage_reports() { 29 | grep -v -h '^mode:' .build/.*.cover 30 | } 31 | 32 | 33 | main() { 34 | # pkgs to cover 35 | PKGS="${PKGS:-$(go list ./...|grep -v vendor)}" 36 | 37 | # pkgs to include in report (including with no cover at all) 38 | ALLPKGS="${ALLPKGS:-$(go list ./...|grep -v vendor)}" 39 | 40 | basename="$(basename $PWD)" 41 | fullcoverage=".build/$basename.cover" 42 | htmlreport=".build/$basename-coverage.html" 43 | 44 | cleanup 45 | 46 | write_coverage_reports $PKGS 47 | 48 | # generate aggregated coverage 49 | ( 50 | echo "mode: count" 51 | merge_coverage_reports 52 | gen_zero_coverage $ALLPKGS 53 | ) > $fullcoverage 54 | 55 | go tool cover -html=$fullcoverage -o $htmlreport 56 | } 57 | -------------------------------------------------------------------------------- /bin/go-find-gopath: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | find $(go env GOPATH)/src -not -path '*/.git/*' $@ 4 | -------------------------------------------------------------------------------- /bin/go-find-goroot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | find $(go env GOROOT) $* 4 | -------------------------------------------------------------------------------- /bin/go-get-recursively: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | go list -f '{{range .Deps}}{{println .}}{{end}}' $1|xargs go get 4 | -------------------------------------------------------------------------------- /bin/go-grep-gopath: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | grep --color --exclude-dir=pkg -nR "$@" $(go env GOPATH)/src 4 | -------------------------------------------------------------------------------- /bin/go-grep-goroot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | grep --color --exclude-dir=pkg -nR "$@" $(go env GOROOT)/src 4 | -------------------------------------------------------------------------------- /bin/go-lint: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # vim: set ft=sh: 4 | 5 | go vet "$*" 6 | golint "$*" 7 | unused "$*" 8 | gosimple "$*" 9 | 10 | -------------------------------------------------------------------------------- /bin/go-tools-install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # from: https://dominik.honnef.co/posts/2014/12/go-tools/ 4 | 5 | set -e 6 | 7 | goget() { 8 | echo "Getting '$*'" 9 | go get $@ 10 | } 11 | 12 | # 13 | # Linters 14 | # 15 | 16 | # go vet - checks for programming errors(comes bundled with Go) 17 | 18 | # ## Metalinter: supported linters 19 | # go vet - Reports potential errors that otherwise compile. 20 | # go vet --shadow - Reports variables that may have been unintentionally shadowed. 21 | # gotype - Syntactic and semantic analysis similar to the Go compiler. 22 | # deadcode - Finds unused code. 23 | # gocyclo - Computes the cyclomatic complexity of functions. 24 | # golint - Google's (mostly stylistic) linter. 25 | # varcheck - Find unused global variables and constants. 26 | # structcheck - Find unused struct fields. 27 | # aligncheck - Warn about un-optimally aligned structures. 28 | # errcheck - Check that error return values are used. 29 | # dupl - Reports potentially duplicated code. 30 | # ineffassign - Detect when assignments to existing variables are not used. 31 | # interfacer - Suggest narrower interfaces that can be used. 32 | # unconvert - Detect redundant type conversions. 33 | # goconst - Finds repeated strings that could be replaced by a constant. 34 | # gosimple - Report simplifications in code. 35 | # staticcheck - Check inputs to functions for correctness 36 | 37 | # ## Disabled by default (enable with --enable=): 38 | # testify - Show location of failed testify assertions. 39 | # test - Show location of test failures from the stdlib testing module. 40 | # gofmt -s - Checks if the code is properly formatted and could not be further simplified. 41 | # goimports - Checks missing or unreferenced package imports. 42 | # lll - Report long lines (see --line-length=N). 43 | # misspell - Finds commonly misspelled English words. 44 | # unused - Find unused variables. 45 | goget github.com/alecthomas/gometalinter 46 | 47 | # Detect ineffectual assignments in Go code. 48 | goget github.com/gordonklaus/ineffassign 49 | 50 | # 51 | # Tests 52 | # 53 | goget -u github.com/cweill/gotests/... 54 | 55 | # 56 | # Benchmarks 57 | # 58 | # benchmarks comparison 59 | goget golang.org/x/tools/cmd/benchcmp # https://godoc.org/golang.org/x/tools/cmd/benchcmp 60 | goget rsc.io/benchstat # https://godoc.org/rsc.io/benchstat 61 | goget github.com/ajstarks/svgo/benchviz 62 | 63 | # 64 | # Code comprehension 65 | # 66 | # goviz -i github.com/hashicorp/serf | dot -Tpng -o hoge.png 67 | goget github.com/hirokidaichi/goviz 68 | 69 | # GOPATH=$GOPATH:$PWD/vendor godepgraph -s ./path/to/pkg |dot -Tsvg -o out.svg 70 | # open -a Safari out.svg 71 | goget github.com/kisielk/godepgraph 72 | 73 | # 74 | # Refactoring 75 | # 76 | goget golang.org/x/tools/cmd/gorename 77 | 78 | # 79 | # Repl 80 | # 81 | goget -u github.com/shurcooL/goexec 82 | goget -u github.com/sno6/gommand 83 | goget -u npf.io/gorram 84 | 85 | goget -u github.com/motemen/gore 86 | -------------------------------------------------------------------------------- /bin/openssl-selfcert-gen: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # https://www.openssl.org/docs/manmaster/man1/openssl-req.html 4 | # generates self-signed certificate without any prompts 5 | openssl req -x509 -days 10000 -nodes -newkey rsa:2048 \ 6 | -keyout www.example.com.self.key \ 7 | -out www.example.com.self.cert.pem \ 8 | -subj '/C=XX/CN=www.example.com/emailAddress=postmaster@example.com' \ 9 | -addext "subjectAltName = DNS:www.example.com" 10 | -------------------------------------------------------------------------------- /bin/osx/makeapp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Create a Fluid-style app launcher for single-window Chrome instances on OSX 4 | # from https://gist.github.com/3484066 5 | # related: http://mathiasbynens.be/notes/shell-script-mac-apps 6 | # 7 | 8 | echo "What should the Application be called (no spaces allowed e.g. GCal)?" 9 | read inputline 10 | name=$inputline 11 | 12 | echo "What is the url (e.g. https://www.google.com/calendar/render)?" 13 | read inputline 14 | url=$inputline 15 | 16 | # echo "What is the full path to the icon (e.g. /Users/username/Desktop/icon.png)?" 17 | # read inputline 18 | # icon=$inputline 19 | 20 | app=$(echo $url|sed -e 's/\.[[:alpha:]]*$//' -e 's/^\s*[[:alpha:]]*:\/\///') 21 | icon_url="https://www.google.com/search?tbm=isch&q=$app+icon" 22 | 23 | cat <& /dev/null 53 | tiff2icns -noLarge $resourcePath/icon.tiff >& /dev/null 54 | fi 55 | 56 | # create the executable 57 | cat >$execPath/$name < $plistPath < 68 | 69 | 70 | 71 | CFBundleExecutable 72 | $name 73 | CFBundleIconFile 74 | icon 75 | 76 | 77 | EOF 78 | 79 | open $appRoot 80 | open "$icon_url" 81 | -------------------------------------------------------------------------------- /bin/osx/open_uri: -------------------------------------------------------------------------------- 1 | #!/usr/bin/osascript 2 | # 3 | # http://github.com/gmarik/dotfiles 4 | 5 | on run argv 6 | open location item 1 of argv 7 | end run 8 | -------------------------------------------------------------------------------- /bin/repeat: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | COUNT_DOWN=5 4 | SLEEP=${SLEEP:-5} 5 | COUNT=0 6 | CMD="$@" 7 | 8 | [[ -z $CMD ]] && echo 'repeat COMMAND' && exit 1 9 | 10 | echo $CMD >&2 11 | 12 | while [ $COUNT_DOWN -gt 0 ]; do 13 | # if [ -z $COUNT ]; then 14 | # let COUNT_DOWN-=1 15 | # fi 16 | 17 | let COUNT+=1 18 | echo $COUNT >&2 19 | 20 | $CMD 21 | 22 | sleep $SLEEP 23 | done 24 | 25 | -------------------------------------------------------------------------------- /bin/serv_dir: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'webrick' 3 | 4 | conf = { 5 | :Port => 5000, 6 | :BindAddress => "127.0.0.1", 7 | :DocumentRoot => Dir.pwd 8 | } 9 | 10 | conf.merge!({:BindAddress => '0.0.0.0'}) if ENV['P'] 11 | 12 | 13 | s = WEBrick::HTTPServer.new(conf) 14 | 15 | trap('INT') { s.shutdown } 16 | trap('TERM') { s.shutdown } 17 | 18 | s.start 19 | -------------------------------------------------------------------------------- /bin/ssh-keygen-public: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Generates public key from provided private 4 | ssh-keygen -y -f ${1:?private_filepath_required} 5 | -------------------------------------------------------------------------------- /bin/watchme: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # vim: ft=sh 3 | # 4 | # based on 5 | # http://www.derekwyatt.org/2012/09/01/the-most-useful-code-ive-written-in-weeks/ 6 | 7 | # watchme 'rspec %' ./spec 8 | # runs `rspec files_that_changed` 9 | # 10 | # watchme rspec ./spec 11 | # runs just `rspec` 12 | 13 | cmd="$1" 14 | shift 15 | fileSpec="$@" 16 | 17 | sentinel=/tmp/t.$$ 18 | 19 | touch $sentinel 20 | 21 | while : 22 | do 23 | files=$(find $fileSpec -newer $sentinel ) # -a '(' $fileSpec ')') 24 | # 25 | if [ $? != 0 ]; then exit $?; fi 26 | 27 | if [ "$files" != "" ]; then 28 | run_cmd=${cmd//%/$files} 29 | echo "Running $run_cmd" 30 | 31 | bash -c "$run_cmd" 32 | touch $sentinel 33 | fi 34 | sleep 0.1 35 | done 36 | 37 | -------------------------------------------------------------------------------- /bin/youtube-dl-mp3: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | youtube-dl --ignore-errors -x --audio-format mp3 "$@" 4 | --------------------------------------------------------------------------------