From 9fabecb0fa5e421c58101ab1a8d003e10eaada34 Mon Sep 17 00:00:00 2001 From: yan Date: Tue, 6 Dec 2011 21:57:45 -0800 Subject: [PATCH] Removed all old bash cruft, supporting only zsh now. Improved README --- .gitignore | 2 + KeyBindings | 1 - README.md | 133 +- bash_aliases => aliases | 15 +- bash_options | 26 - bash_path | 1 - bash_profile | 15 - git-completion.bash | 2276 ---------------------------------- gitconfig | 12 +- vim/doc/vcscommand.txt | 819 ------------ vim/syntax/cvsannotate.vim | 45 - vim/syntax/gitannotate.vim | 44 - vim/syntax/hgannotate.vim | 40 - vim/syntax/svkannotate.vim | 42 - vim/syntax/svnannotate.vim | 40 - vim/syntax/vcscommit.vim | 31 - vim/tmp/ruby_debugger | 1 - vim/tmp/ruby_debugger_log | 16 - vim/tmp/ruby_debugger_output | 34 - vimrc | 5 +- zsh_aliases | 1 - zshrc | 8 +- 22 files changed, 106 insertions(+), 3501 deletions(-) delete mode 160000 KeyBindings rename bash_aliases => aliases (85%) delete mode 100644 bash_options delete mode 100644 bash_path delete mode 100755 bash_profile delete mode 100644 git-completion.bash delete mode 100755 vim/doc/vcscommand.txt delete mode 100755 vim/syntax/cvsannotate.vim delete mode 100755 vim/syntax/gitannotate.vim delete mode 100755 vim/syntax/hgannotate.vim delete mode 100755 vim/syntax/svkannotate.vim delete mode 100755 vim/syntax/svnannotate.vim delete mode 100755 vim/syntax/vcscommit.vim delete mode 100644 vim/tmp/ruby_debugger delete mode 100644 vim/tmp/ruby_debugger_log delete mode 100644 vim/tmp/ruby_debugger_output diff --git a/.gitignore b/.gitignore index 72afb19d..7e3f9582 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .DS_Store vim/backups +vim/view *un~ vim/.netrwhist +vim/tmp .netrwhist diff --git a/KeyBindings b/KeyBindings deleted file mode 160000 index a62dfd4f..00000000 --- a/KeyBindings +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a62dfd4f8aadc4d0dffbdba4916958f2bbf78cec diff --git a/README.md b/README.md index 11be4afb..87e16813 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,51 @@ -Yan's Excellent Dotfiles! +YADR: Yet Another Dotfile Repo ==== -There are two main goals accomplished in my dotfiles to produce insane productivity +Warning: These dotfiles are opinionated! - * All common bash commands should be two and three character mnemonic aliases - * Most vim tasks, especially those having to do with navigation, should be mapped to a single Capital Letter or two letter mnemonic. +This is a collection of best of breed tools from across the web, +from scouring other people's dotfile repos, blogs, and projects. + +In some ways, this is an alternative to janus (https://github.com/carlhuda/janus), offering +many of the same plugins, with minor differnces. But it's also much more, +providing shell customizations (zsh), an irb replacement (pry) with customizations, +and osx settings that are developer friendly (such as fast key repeat), +and remapping your caps-lock to be Esc for vim. + +The strongly held opinions expressed here: + + * OSX is the best operating system for development, but you have to tweak it slightly to be dev friendly. + * ZSH is the best shell. I used bash for a long time and I have seen the light. Just + its fuzzy typo autocompletion is worth the money and saves huge on keystrokes. + * oh-my-zsh is the best collection of plugins for zsh and reduces the switching cost from bash to zsh to one command. + * MacVim is the best editor. You will type less and get more done. Vim should be used everywhere (irb, shell, mysql command line). + * iTerm2 is the best terminal - it has splits and good full screen capabilities + * Git is the best source control manager. There are probably better ones out there, but this one is mine + +The ideas that guide this project: + + * All common commands should be two and three character mnemonic aliases - less keystrokes, RSI reduction + * Most used vim commands should be under your fingertips (home row, prefer Shift to other command keys) + * Avoid stressful hand motions, e.g. remap Esc to caps lock key, remap underscore to Alt-k in vim + * Plugin architecture (using tpope's pathogen for vim) + * Colors are _important_ - avoid stressful colors, use the well designed solarized (http://ethanschoonover.com/solarized) colorscheme + for both vim and iTerm2 + +Before you start +--- + + * Remap caps-lock to escape: http://stackoverflow.com/questions/127591/using-caps-lock-as-esc-in-mac-os-x + + * Switch to zsh using oh-my-zh (https://github.com/robbyrussell/oh-my-zsh) in one easy step: + + wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh Submodules --- This project uses git submodules for some of its plugins. Please run: + git submodule init git submodule update To get all the current plugins. Over time, I plan to move all plugins into submodules. @@ -18,31 +53,26 @@ To get all the current plugins. Over time, I plan to move all plugins into submo Setup for ZSH --- I am now using ZSH as my default shell because of its awesome globbing -and autocomplete features, nice colors, etc. This setup assumes you use -oh-my-zsh (https://github.com/robbyrussell/oh-my-zsh) +and autocomplete features (the spelling fixer autocomplete is worth the money alone). + +This setup assumes you use oh-my-zsh (https://github.com/robbyrussell/oh-my-zsh) Place this as the last line in your ~/.zshrc created by oh-my-zsh: source ~/.dotfiles/zshrc -This setup reuses my bash aliases but provides some custom functions. - -Setup for Bash ---- -To set these up as your own (careful, don't overwrite your bash_profile unintentionally!): - - git clone git://github.com/skwp/dotfiles ~/.dotfiles - - ln -s ~/.dotfiles/bash_profile ~/.bash_profile - . ~/.bash_profile - -Lots of things I do every day are done with -two or three character mnemonic aliases. Please -feel free to edit them: +Lots of things I do every day are done with two or three character +mnemonic aliases. Please feel free to edit them: ae # alias edit ar # alias reload +Here are some of the customizations you get with this setup: + + * Vim mode + * Bash style ctrl-R for reverse history finder + * Fuzzy matching - if you mistype a directory name, tab completoin will fix it + Setup for Pry --- Pry (http://pry.github.com/) offers a much better out of the box IRB experience @@ -53,8 +83,18 @@ with colors, tab completion, and lots of other tricks. You should: ln -s ~/.dotfiles/irb/pryrc ~/.pryrc ln -s ~/.dotfiles/irb/aprc ~/.aprc -The pryrc included here also offers some nice commands like 'clear', 'sql', and etc -Look at the pryrc to see a list of commands or just type 'help' from pry. +Use pry + + * as irb: 'pry' + * as rails console: script/console --irb=pry + +Pry customizations: + + * 'clear' command to clear screen + * 'sql' command to execute something (within a rails console) + * all objects displayed in readable format (colorized, sorted hash keys) - via awesome_print + * a few color modifications to make it more useable + * type 'help' to see all the commands Setup for Vim --- @@ -67,7 +107,7 @@ The .vimrc is well commented and broken up by settings. I encourage you to take a look and learn some of my handy aliases, or comment them out if you don't like them, or make your own. -These are things I use every day to be insanely productive. Hope you like em. +Some of the vim customizations include: * F - instantly Find definition of class (must have exuberant ctags installed) * B - show Buffer explorer @@ -85,12 +125,13 @@ These are things I use every day to be insanely productive. Hope you like em. * Ctrl-\ - Show NerdTree (project finder) and expose current file * cf - Copy Filename of current file into system (not vi) paste buffer * // - clear the search - * ,, or z,, - use EasyMotion - type that and then type one of the highlighted letters. I'm just exploring this one. + * ,, or z,, - use EasyMotion - type that and then type one of the highlighted letters. * Apple-k and Apple-K to type underscores and dashes, since they are so common in code but so far away from home row * yw - remapped to yaw, meaning yanking a word will yank the entire word no matter where your cursor is * W - write a file (instead of :w, saving you keystrokes for the most common vim operation) * gcc (comment a line) via tComment, and gcp custom alias to comment a paragraph * Cc - (Current command) copies the command under your cursor and executes it in vim. Great for testing single line changes to vimrc. + * \ss to run specs, \ll to run a given spec on a line - using my vim-ruby-conque plugin (https://github.com/skwp/vim-ruby-conque) Setup for Git --- @@ -98,7 +139,18 @@ To use the gitconfig (some of the git bash aliases rely on my git aliases) ln -s ~/.dotfiles/gitconfig ~/.gitconfig -Read through the gitconfig to find out what's in store. +Some of the customizations provided include: + + * git l - a much more usable git log + * git b - a list of branches with summary of last commit + * git r - a list of remotes with info + * git t - a list of tags with info + * git nb - a (n)ew (b)ranch - like checkout -b + * git cp - cherry-pick -x (showing what was cherrypicked) + * git changelog - a nice format for creating changelogs + * Some sensible default configs, such as improving merge messages, push only pushes the current branch, removing status hints, and using mnemonic prefixes in diff: (i)ndex, (w)ork tree, (c)ommit and (o)bject + * Slightly imrpoved colors for diff + * git unstage (remove from index) and git uncommit (revert to the time prior to the last commit - dangerous if already pushed) aliases OSX Hacks --- @@ -107,24 +159,17 @@ under osx. Read through it before running it. To use: ./osx -OSX KeyBindings for systemwide text editing +These hacks are Lion-centric. May not work for other OS'es. My favorite mods include: + + * Ultra fast key repeat rate (now you can scroll super quick using j/k) + * No disk image verification (downloaded files open quicker) + * Display the ~/Library folder in finder (hidden in Lion) + +Other recommended OSX tools --- -I am also experimenting with Brett Terpstra's OSX KeyBindings (github: ttscoff/KeyBindings) -for good text editing features across the entire OS. To install: - - git submodule update - mkdir -p ~/Library/KeyBindings - ln -s KeyBindings/DefaultKeyBinding.dict ~/Library/KeyBindings/DefaultKeyBindings.dict - -More info: http://brettterpstra.com/keybinding-madness/ - -other OSX Insane Productivity tools I use ---- - * NValt - Notational Velocity alternative fork - http://brettterpstra.com/project/nvalt/ - Dirt simple note taking, syncs to simplenote, supports all kinds of fun things like @done for todos - - * Safari Snipe extension - find an open tab. Map it to "Ctrl-/" for ultimate vim-style happiness - http://safariextensions.tumblr.com/post/3681229291/snipe-03-06-11 + * NValt - Notational Velocity alternative fork - http://brettterpstra.com/project/nvalt/ - syncs with SimpleNote + * Vimium for Chrome - vim style browsing. The 'f' to type the two char alias of any link is worth it. + * QuickCursor - gives you Apple-Shift-E to edit any OSX text field in vim. Credits === @@ -134,8 +179,8 @@ and other places for the cream of the crop of vim and bash awesomeness. COMING SOON === - * Full migration to tpope's pathogen for all plugins - * Better isolation of customizations in smaller chunks + * Full migration to tpope's pathogen format (~/.vim/bundle) for all plugins + * Better isolation of customizations in smaller chunks, maybe as plugins * Automatic setup script to symlink all dotfiles, or just some selectively For more tips and tricks diff --git a/bash_aliases b/aliases similarity index 85% rename from bash_aliases rename to aliases index ad0e01ea..a67a7e8f 100644 --- a/bash_aliases +++ b/aliases @@ -16,16 +16,8 @@ alias du='du -h -d 2' alias lsg='ll | grep' # Alias Editing -alias ae='vi ~/.dotfiles/bash_aliases' #alias edit -alias ar='source ~/.dotfiles/bash_aliases' #alias reload - -# Bash Options Editing -alias boe='vi ~/.dotfiles/bash_options' -alias bor='source ~/.dotfiles/bash_options' - -# .bash_profile editing -alias bp='vi ~/.bash_profile' -alias br='source ~/.bash_profile' +alias ae='vi ~/.dotfiles/aliases' #alias edit +alias ar='source ~/.dotfiles/aliases' #alias reload # vimrc editing alias ve='vi ~/.vimrc' @@ -76,12 +68,11 @@ alias grsh='git reset --hard' alias gcln='git clean' alias gclndf='git clean -df' -# Common bash functions +# Common shell functions alias less='less -r' alias tf='tail -f' alias l='less' alias lh='ls -alt | head' # see the last modified files -alias fn="find . -name" alias screen='TERM=screen screen' alias cl='clear' alias ps='ps aux' diff --git a/bash_options b/bash_options deleted file mode 100644 index 11811ab3..00000000 --- a/bash_options +++ /dev/null @@ -1,26 +0,0 @@ -# vi mode, of course -set -o vi - -# case-insensitive globbing (used in pathname expansion) -shopt -s nocaseglob - -# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards -[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh - -# Colors the way I like em -export LSCOLORS=BxGxFxdxCxDxDxhbadBxBx - -# Larger bash history (allow 32k entries; default is 500) -export HISTSIZE=32768 -export HISTFILESIZE=$HISTSIZE -export HISTCONTROL=ignoredups - -# Make some commands not show up in history -export HISTIGNORE="ls:ls *" - -export EVENT_NOKQUEUE=1 -export COPY_EXTENDED_ATTRIBUTES_DISABLE=true -export COPYFILE_DISABLE=true - -# Prompt -export PS1='\[\033[01;34m\]\u:\[\033[01;32m\]\w\[\033[00;34m\]\[\033[01;32m\]\[\033[00m\]\[\033[01;33m\]$(__git_ps1)$ \[\033[00;37m\]' diff --git a/bash_path b/bash_path deleted file mode 100644 index 8d71050e..00000000 --- a/bash_path +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PATH:~/.dotfiles/bin:~/.dotfiles/bin/willmorgan/bin diff --git a/bash_profile b/bash_profile deleted file mode 100755 index bd84364d..00000000 --- a/bash_profile +++ /dev/null @@ -1,15 +0,0 @@ -# Load secret stuff that I don't want to share with the world on github :) -if [ -e ~/.secrets ]; then - . ~/.secrets -fi - -# Load git completion -. ~/.dotfiles/git-completion.bash - -# My aliases and options -. ~/.dotfiles/bash_aliases -. ~/.dotfiles/bash_options -. ~/.dotfiles/bash_path - -# RVM -[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" diff --git a/git-completion.bash b/git-completion.bash deleted file mode 100644 index 57245a8c..00000000 --- a/git-completion.bash +++ /dev/null @@ -1,2276 +0,0 @@ -#!bash -# -# bash completion support for core Git. -# -# Copyright (C) 2006,2007 Shawn O. Pearce -# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). -# Distributed under the GNU General Public License, version 2.0. -# -# The contained completion routines provide support for completing: -# -# *) local and remote branch names -# *) local and remote tag names -# *) .git/remotes file names -# *) git 'subcommands' -# *) tree paths within 'ref:path/to/file' expressions -# *) common --long-options -# -# To use these routines: -# -# 1) Copy this file to somewhere (e.g. ~/.git-completion.sh). -# 2) Added the following line to your .bashrc: -# source ~/.git-completion.sh -# -# 3) Consider changing your PS1 to also show the current branch: -# PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ ' -# -# The argument to __git_ps1 will be displayed only if you -# are currently in a git repository. The %s token will be -# the name of the current branch. -# -# In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty -# value, unstaged (*) and staged (+) changes will be shown next -# to the branch name. You can configure this per-repository -# with the bash.showDirtyState variable, which defaults to true -# once GIT_PS1_SHOWDIRTYSTATE is enabled. -# -# You can also see if currently something is stashed, by setting -# GIT_PS1_SHOWSTASHSTATE to a nonempty value. If something is stashed, -# then a '$' will be shown next to the branch name. -# -# If you would like to see if there're untracked files, then you can -# set GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're -# untracked files, then a '%' will be shown next to the branch name. -# -# To submit patches: -# -# *) Read Documentation/SubmittingPatches -# *) Send all patches to the current maintainer: -# -# "Shawn O. Pearce" -# -# *) Always CC the Git mailing list: -# -# git@vger.kernel.org -# - -case "$COMP_WORDBREAKS" in -*:*) : great ;; -*) COMP_WORDBREAKS="$COMP_WORDBREAKS:" -esac - -# __gitdir accepts 0 or 1 arguments (i.e., location) -# returns location of .git repo -__gitdir () -{ - if [ -z "${1-}" ]; then - if [ -n "${__git_dir-}" ]; then - echo "$__git_dir" - elif [ -d .git ]; then - echo .git - else - git rev-parse --git-dir 2>/dev/null - fi - elif [ -d "$1/.git" ]; then - echo "$1/.git" - else - echo "$1" - fi -} - -# __git_ps1 accepts 0 or 1 arguments (i.e., format string) -# returns text to add to bash PS1 prompt (includes branch name) -__git_ps1 () -{ - local g="$(__gitdir)" - if [ -n "$g" ]; then - local r - local b - if [ -f "$g/rebase-merge/interactive" ]; then - r="|REBASE-i" - b="$(cat "$g/rebase-merge/head-name")" - elif [ -d "$g/rebase-merge" ]; then - r="|REBASE-m" - b="$(cat "$g/rebase-merge/head-name")" - else - if [ -d "$g/rebase-apply" ]; then - if [ -f "$g/rebase-apply/rebasing" ]; then - r="|REBASE" - elif [ -f "$g/rebase-apply/applying" ]; then - r="|AM" - else - r="|AM/REBASE" - fi - elif [ -f "$g/MERGE_HEAD" ]; then - r="|MERGING" - elif [ -f "$g/BISECT_LOG" ]; then - r="|BISECTING" - fi - - b="$(git symbolic-ref HEAD 2>/dev/null)" || { - - b="$( - case "${GIT_PS1_DESCRIBE_STYLE-}" in - (contains) - git describe --contains HEAD ;; - (branch) - git describe --contains --all HEAD ;; - (describe) - git describe HEAD ;; - (* | default) - git describe --exact-match HEAD ;; - esac 2>/dev/null)" || - - b="$(cut -c1-7 "$g/HEAD" 2>/dev/null)..." || - b="unknown" - b="($b)" - } - fi - - local w - local i - local s - local u - local c - - if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then - if [ "true" = "$(git rev-parse --is-bare-repository 2>/dev/null)" ]; then - c="BARE:" - else - b="GIT_DIR!" - fi - elif [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then - if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ]; then - if [ "$(git config --bool bash.showDirtyState)" != "false" ]; then - git diff --no-ext-diff --quiet --exit-code || w="*" - if git rev-parse --quiet --verify HEAD >/dev/null; then - git diff-index --cached --quiet HEAD -- || i="+" - else - i="#" - fi - fi - fi - if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ]; then - git rev-parse --verify refs/stash >/dev/null 2>&1 && s="$" - fi - - if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ]; then - if [ -n "$(git ls-files --others --exclude-standard)" ]; then - u="%" - fi - fi - fi - - local f="$w$i$s$u" - printf "${1:- (%s)}" "$c${b##refs/heads/}${f:+ $f}$r" - fi -} - -# __gitcomp_1 requires 2 arguments -__gitcomp_1 () -{ - local c IFS=' '$'\t'$'\n' - for c in $1; do - case "$c$2" in - --*=*) printf %s$'\n' "$c$2" ;; - *.) printf %s$'\n' "$c$2" ;; - *) printf %s$'\n' "$c$2 " ;; - esac - done -} - -# __gitcomp accepts 1, 2, 3, or 4 arguments -# generates completion reply with compgen -__gitcomp () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - if [ $# -gt 2 ]; then - cur="$3" - fi - case "$cur" in - --*=) - COMPREPLY=() - ;; - *) - local IFS=$'\n' - COMPREPLY=($(compgen -P "${2-}" \ - -W "$(__gitcomp_1 "${1-}" "${4-}")" \ - -- "$cur")) - ;; - esac -} - -# __git_heads accepts 0 or 1 arguments (to pass to __gitdir) -__git_heads () -{ - local cmd i is_hash=y dir="$(__gitdir "${1-}")" - if [ -d "$dir" ]; then - git --git-dir="$dir" for-each-ref --format='%(refname:short)' \ - refs/heads - return - fi - for i in $(git ls-remote "${1-}" 2>/dev/null); do - case "$is_hash,$i" in - y,*) is_hash=n ;; - n,*^{}) is_hash=y ;; - n,refs/heads/*) is_hash=y; echo "${i#refs/heads/}" ;; - n,*) is_hash=y; echo "$i" ;; - esac - done -} - -# __git_tags accepts 0 or 1 arguments (to pass to __gitdir) -__git_tags () -{ - local cmd i is_hash=y dir="$(__gitdir "${1-}")" - if [ -d "$dir" ]; then - git --git-dir="$dir" for-each-ref --format='%(refname:short)' \ - refs/tags - return - fi - for i in $(git ls-remote "${1-}" 2>/dev/null); do - case "$is_hash,$i" in - y,*) is_hash=n ;; - n,*^{}) is_hash=y ;; - n,refs/tags/*) is_hash=y; echo "${i#refs/tags/}" ;; - n,*) is_hash=y; echo "$i" ;; - esac - done -} - -# __git_refs accepts 0 or 1 arguments (to pass to __gitdir) -__git_refs () -{ - local i is_hash=y dir="$(__gitdir "${1-}")" - local cur="${COMP_WORDS[COMP_CWORD]}" format refs - if [ -d "$dir" ]; then - case "$cur" in - refs|refs/*) - format="refname" - refs="${cur%/*}" - ;; - *) - for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do - if [ -e "$dir/$i" ]; then echo $i; fi - done - format="refname:short" - refs="refs/tags refs/heads refs/remotes" - ;; - esac - git --git-dir="$dir" for-each-ref --format="%($format)" \ - $refs - return - fi - for i in $(git ls-remote "$dir" 2>/dev/null); do - case "$is_hash,$i" in - y,*) is_hash=n ;; - n,*^{}) is_hash=y ;; - n,refs/tags/*) is_hash=y; echo "${i#refs/tags/}" ;; - n,refs/heads/*) is_hash=y; echo "${i#refs/heads/}" ;; - n,refs/remotes/*) is_hash=y; echo "${i#refs/remotes/}" ;; - n,*) is_hash=y; echo "$i" ;; - esac - done -} - -# __git_refs2 requires 1 argument (to pass to __git_refs) -__git_refs2 () -{ - local i - for i in $(__git_refs "$1"); do - echo "$i:$i" - done -} - -# __git_refs_remotes requires 1 argument (to pass to ls-remote) -__git_refs_remotes () -{ - local cmd i is_hash=y - for i in $(git ls-remote "$1" 2>/dev/null); do - case "$is_hash,$i" in - n,refs/heads/*) - is_hash=y - echo "$i:refs/remotes/$1/${i#refs/heads/}" - ;; - y,*) is_hash=n ;; - n,*^{}) is_hash=y ;; - n,refs/tags/*) is_hash=y;; - n,*) is_hash=y; ;; - esac - done -} - -__git_remotes () -{ - local i ngoff IFS=$'\n' d="$(__gitdir)" - shopt -q nullglob || ngoff=1 - shopt -s nullglob - for i in "$d/remotes"/*; do - echo ${i#$d/remotes/} - done - [ "$ngoff" ] && shopt -u nullglob - for i in $(git --git-dir="$d" config --get-regexp 'remote\..*\.url' 2>/dev/null); do - i="${i#remote.}" - echo "${i/.url*/}" - done -} - -__git_list_merge_strategies () -{ - git merge -s help 2>&1 | - sed -n -e '/[Aa]vailable strategies are: /,/^$/{ - s/\.$// - s/.*:// - s/^[ ]*// - s/[ ]*$// - p - }' -} - -__git_merge_strategies= -# 'git merge -s help' (and thus detection of the merge strategy -# list) fails, unfortunately, if run outside of any git working -# tree. __git_merge_strategies is set to the empty string in -# that case, and the detection will be repeated the next time it -# is needed. -__git_compute_merge_strategies () -{ - : ${__git_merge_strategies:=$(__git_list_merge_strategies)} -} - -__git_complete_file () -{ - local pfx ls ref cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - ?*:*) - ref="${cur%%:*}" - cur="${cur#*:}" - case "$cur" in - ?*/*) - pfx="${cur%/*}" - cur="${cur##*/}" - ls="$ref:$pfx" - pfx="$pfx/" - ;; - *) - ls="$ref" - ;; - esac - - case "$COMP_WORDBREAKS" in - *:*) : great ;; - *) pfx="$ref:$pfx" ;; - esac - - local IFS=$'\n' - COMPREPLY=($(compgen -P "$pfx" \ - -W "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \ - | sed '/^100... blob /{ - s,^.* ,, - s,$, , - } - /^120000 blob /{ - s,^.* ,, - s,$, , - } - /^040000 tree /{ - s,^.* ,, - s,$,/, - } - s/^.* //')" \ - -- "$cur")) - ;; - *) - __gitcomp "$(__git_refs)" - ;; - esac -} - -__git_complete_revlist () -{ - local pfx cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - *...*) - pfx="${cur%...*}..." - cur="${cur#*...}" - __gitcomp "$(__git_refs)" "$pfx" "$cur" - ;; - *..*) - pfx="${cur%..*}.." - cur="${cur#*..}" - __gitcomp "$(__git_refs)" "$pfx" "$cur" - ;; - *) - __gitcomp "$(__git_refs)" - ;; - esac -} - -__git_complete_remote_or_refspec () -{ - local cmd="${COMP_WORDS[1]}" - local cur="${COMP_WORDS[COMP_CWORD]}" - local i c=2 remote="" pfx="" lhs=1 no_complete_refspec=0 - while [ $c -lt $COMP_CWORD ]; do - i="${COMP_WORDS[c]}" - case "$i" in - --mirror) [ "$cmd" = "push" ] && no_complete_refspec=1 ;; - --all) - case "$cmd" in - push) no_complete_refspec=1 ;; - fetch) - COMPREPLY=() - return - ;; - *) ;; - esac - ;; - -*) ;; - *) remote="$i"; break ;; - esac - c=$((++c)) - done - if [ -z "$remote" ]; then - __gitcomp "$(__git_remotes)" - return - fi - if [ $no_complete_refspec = 1 ]; then - COMPREPLY=() - return - fi - [ "$remote" = "." ] && remote= - case "$cur" in - *:*) - case "$COMP_WORDBREAKS" in - *:*) : great ;; - *) pfx="${cur%%:*}:" ;; - esac - cur="${cur#*:}" - lhs=0 - ;; - +*) - pfx="+" - cur="${cur#+}" - ;; - esac - case "$cmd" in - fetch) - if [ $lhs = 1 ]; then - __gitcomp "$(__git_refs2 "$remote")" "$pfx" "$cur" - else - __gitcomp "$(__git_refs)" "$pfx" "$cur" - fi - ;; - pull) - if [ $lhs = 1 ]; then - __gitcomp "$(__git_refs "$remote")" "$pfx" "$cur" - else - __gitcomp "$(__git_refs)" "$pfx" "$cur" - fi - ;; - push) - if [ $lhs = 1 ]; then - __gitcomp "$(__git_refs)" "$pfx" "$cur" - else - __gitcomp "$(__git_refs "$remote")" "$pfx" "$cur" - fi - ;; - esac -} - -__git_complete_strategy () -{ - __git_compute_merge_strategies - case "${COMP_WORDS[COMP_CWORD-1]}" in - -s|--strategy) - __gitcomp "$__git_merge_strategies" - return 0 - esac - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --strategy=*) - __gitcomp "$__git_merge_strategies" "" "${cur##--strategy=}" - return 0 - ;; - esac - return 1 -} - -__git_list_all_commands () -{ - local i IFS=" "$'\n' - for i in $(git help -a|egrep '^ [a-zA-Z0-9]') - do - case $i in - *--*) : helper pattern;; - *) echo $i;; - esac - done -} - -__git_all_commands= -__git_compute_all_commands () -{ - : ${__git_all_commands:=$(__git_list_all_commands)} -} - -__git_list_porcelain_commands () -{ - local i IFS=" "$'\n' - __git_compute_all_commands - for i in "help" $__git_all_commands - do - case $i in - *--*) : helper pattern;; - applymbox) : ask gittus;; - applypatch) : ask gittus;; - archimport) : import;; - cat-file) : plumbing;; - check-attr) : plumbing;; - check-ref-format) : plumbing;; - checkout-index) : plumbing;; - commit-tree) : plumbing;; - count-objects) : infrequent;; - cvsexportcommit) : export;; - cvsimport) : import;; - cvsserver) : daemon;; - daemon) : daemon;; - diff-files) : plumbing;; - diff-index) : plumbing;; - diff-tree) : plumbing;; - fast-import) : import;; - fast-export) : export;; - fsck-objects) : plumbing;; - fetch-pack) : plumbing;; - fmt-merge-msg) : plumbing;; - for-each-ref) : plumbing;; - hash-object) : plumbing;; - http-*) : transport;; - index-pack) : plumbing;; - init-db) : deprecated;; - local-fetch) : plumbing;; - lost-found) : infrequent;; - ls-files) : plumbing;; - ls-remote) : plumbing;; - ls-tree) : plumbing;; - mailinfo) : plumbing;; - mailsplit) : plumbing;; - merge-*) : plumbing;; - mktree) : plumbing;; - mktag) : plumbing;; - pack-objects) : plumbing;; - pack-redundant) : plumbing;; - pack-refs) : plumbing;; - parse-remote) : plumbing;; - patch-id) : plumbing;; - peek-remote) : plumbing;; - prune) : plumbing;; - prune-packed) : plumbing;; - quiltimport) : import;; - read-tree) : plumbing;; - receive-pack) : plumbing;; - reflog) : plumbing;; - remote-*) : transport;; - repo-config) : deprecated;; - rerere) : plumbing;; - rev-list) : plumbing;; - rev-parse) : plumbing;; - runstatus) : plumbing;; - sh-setup) : internal;; - shell) : daemon;; - show-ref) : plumbing;; - send-pack) : plumbing;; - show-index) : plumbing;; - ssh-*) : transport;; - stripspace) : plumbing;; - symbolic-ref) : plumbing;; - tar-tree) : deprecated;; - unpack-file) : plumbing;; - unpack-objects) : plumbing;; - update-index) : plumbing;; - update-ref) : plumbing;; - update-server-info) : daemon;; - upload-archive) : plumbing;; - upload-pack) : plumbing;; - write-tree) : plumbing;; - var) : infrequent;; - verify-pack) : infrequent;; - verify-tag) : plumbing;; - *) echo $i;; - esac - done -} - -__git_porcelain_commands= -__git_compute_porcelain_commands () -{ - __git_compute_all_commands - : ${__git_porcelain_commands:=$(__git_list_porcelain_commands)} -} - -__git_aliases () -{ - local i IFS=$'\n' - for i in $(git --git-dir="$(__gitdir)" config --get-regexp "alias\..*" 2>/dev/null); do - case "$i" in - alias.*) - i="${i#alias.}" - echo "${i/ */}" - ;; - esac - done -} - -# __git_aliased_command requires 1 argument -__git_aliased_command () -{ - local word cmdline=$(git --git-dir="$(__gitdir)" \ - config --get "alias.$1") - for word in $cmdline; do - case "$word" in - \!gitk|gitk) - echo "gitk" - return - ;; - \!*) : shell command alias ;; - -*) : option ;; - *=*) : setting env ;; - git) : git itself ;; - *) - echo "$word" - return - esac - done -} - -# __git_find_on_cmdline requires 1 argument -__git_find_on_cmdline () -{ - local word subcommand c=1 - - while [ $c -lt $COMP_CWORD ]; do - word="${COMP_WORDS[c]}" - for subcommand in $1; do - if [ "$subcommand" = "$word" ]; then - echo "$subcommand" - return - fi - done - c=$((++c)) - done -} - -__git_has_doubledash () -{ - local c=1 - while [ $c -lt $COMP_CWORD ]; do - if [ "--" = "${COMP_WORDS[c]}" ]; then - return 0 - fi - c=$((++c)) - done - return 1 -} - -__git_whitespacelist="nowarn warn error error-all fix" - -_git_am () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)" - if [ -d "$dir"/rebase-apply ]; then - __gitcomp "--skip --continue --resolved --abort" - return - fi - case "$cur" in - --whitespace=*) - __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}" - return - ;; - --*) - __gitcomp " - --3way --committer-date-is-author-date --ignore-date - --ignore-whitespace --ignore-space-change - --interactive --keep --no-utf8 --signoff --utf8 - --whitespace= --scissors - " - return - esac - COMPREPLY=() -} - -_git_apply () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --whitespace=*) - __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}" - return - ;; - --*) - __gitcomp " - --stat --numstat --summary --check --index - --cached --index-info --reverse --reject --unidiff-zero - --apply --no-add --exclude= - --ignore-whitespace --ignore-space-change - --whitespace= --inaccurate-eof --verbose - " - return - esac - COMPREPLY=() -} - -_git_add () -{ - __git_has_doubledash && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp " - --interactive --refresh --patch --update --dry-run - --ignore-errors --intent-to-add - " - return - esac - COMPREPLY=() -} - -_git_archive () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --format=*) - __gitcomp "$(git archive --list)" "" "${cur##--format=}" - return - ;; - --remote=*) - __gitcomp "$(__git_remotes)" "" "${cur##--remote=}" - return - ;; - --*) - __gitcomp " - --format= --list --verbose - --prefix= --remote= --exec= - " - return - ;; - esac - __git_complete_file -} - -_git_bisect () -{ - __git_has_doubledash && return - - local subcommands="start bad good skip reset visualize replay log run" - local subcommand="$(__git_find_on_cmdline "$subcommands")" - if [ -z "$subcommand" ]; then - __gitcomp "$subcommands" - return - fi - - case "$subcommand" in - bad|good|reset|skip) - __gitcomp "$(__git_refs)" - ;; - *) - COMPREPLY=() - ;; - esac -} - -_git_branch () -{ - local i c=1 only_local_ref="n" has_r="n" - - while [ $c -lt $COMP_CWORD ]; do - i="${COMP_WORDS[c]}" - case "$i" in - -d|-m) only_local_ref="y" ;; - -r) has_r="y" ;; - esac - c=$((++c)) - done - - case "${COMP_WORDS[COMP_CWORD]}" in - --*) - __gitcomp " - --color --no-color --verbose --abbrev= --no-abbrev - --track --no-track --contains --merged --no-merged - --set-upstream - " - ;; - *) - if [ $only_local_ref = "y" -a $has_r = "n" ]; then - __gitcomp "$(__git_heads)" - else - __gitcomp "$(__git_refs)" - fi - ;; - esac -} - -_git_bundle () -{ - local cmd="${COMP_WORDS[2]}" - case "$COMP_CWORD" in - 2) - __gitcomp "create list-heads verify unbundle" - ;; - 3) - # looking for a file - ;; - *) - case "$cmd" in - create) - __git_complete_revlist - ;; - esac - ;; - esac -} - -_git_checkout () -{ - __git_has_doubledash && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --conflict=*) - __gitcomp "diff3 merge" "" "${cur##--conflict=}" - ;; - --*) - __gitcomp " - --quiet --ours --theirs --track --no-track --merge - --conflict= --patch - " - ;; - *) - __gitcomp "$(__git_refs)" - ;; - esac -} - -_git_cherry () -{ - __gitcomp "$(__git_refs)" -} - -_git_cherry_pick () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp "--edit --no-commit" - ;; - *) - __gitcomp "$(__git_refs)" - ;; - esac -} - -_git_clean () -{ - __git_has_doubledash && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp "--dry-run --quiet" - return - ;; - esac - COMPREPLY=() -} - -_git_clone () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp " - --local - --no-hardlinks - --shared - --reference - --quiet - --no-checkout - --bare - --mirror - --origin - --upload-pack - --template= - --depth - " - return - ;; - esac - COMPREPLY=() -} - -_git_commit () -{ - __git_has_doubledash && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --cleanup=*) - __gitcomp "default strip verbatim whitespace - " "" "${cur##--cleanup=}" - return - ;; - --reuse-message=*) - __gitcomp "$(__git_refs)" "" "${cur##--reuse-message=}" - return - ;; - --reedit-message=*) - __gitcomp "$(__git_refs)" "" "${cur##--reedit-message=}" - return - ;; - --untracked-files=*) - __gitcomp "all no normal" "" "${cur##--untracked-files=}" - return - ;; - --*) - __gitcomp " - --all --author= --signoff --verify --no-verify - --edit --amend --include --only --interactive - --dry-run --reuse-message= --reedit-message= - --reset-author --file= --message= --template= - --cleanup= --untracked-files --untracked-files= - --verbose --quiet - " - return - esac - COMPREPLY=() -} - -_git_describe () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp " - --all --tags --contains --abbrev= --candidates= - --exact-match --debug --long --match --always - " - return - esac - __gitcomp "$(__git_refs)" -} - -__git_diff_common_options="--stat --numstat --shortstat --summary - --patch-with-stat --name-only --name-status --color - --no-color --color-words --no-renames --check - --full-index --binary --abbrev --diff-filter= - --find-copies-harder - --text --ignore-space-at-eol --ignore-space-change - --ignore-all-space --exit-code --quiet --ext-diff - --no-ext-diff - --no-prefix --src-prefix= --dst-prefix= - --inter-hunk-context= - --patience - --raw - --dirstat --dirstat= --dirstat-by-file - --dirstat-by-file= --cumulative -" - -_git_diff () -{ - __git_has_doubledash && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp "--cached --staged --pickaxe-all --pickaxe-regex - --base --ours --theirs - $__git_diff_common_options - " - return - ;; - esac - __git_complete_file -} - -__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff - tkdiff vimdiff gvimdiff xxdiff araxis p4merge -" - -_git_difftool () -{ - __git_has_doubledash && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --tool=*) - __gitcomp "$__git_mergetools_common kompare" "" "${cur##--tool=}" - return - ;; - --*) - __gitcomp "--cached --staged --pickaxe-all --pickaxe-regex - --base --ours --theirs - --no-renames --diff-filter= --find-copies-harder - --relative --ignore-submodules - --tool=" - return - ;; - esac - __git_complete_file -} - -__git_fetch_options=" - --quiet --verbose --append --upload-pack --force --keep --depth= - --tags --no-tags --all --prune --dry-run -" - -_git_fetch () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp "$__git_fetch_options" - return - ;; - esac - __git_complete_remote_or_refspec -} - -_git_format_patch () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --thread=*) - __gitcomp " - deep shallow - " "" "${cur##--thread=}" - return - ;; - --*) - __gitcomp " - --stdout --attach --no-attach --thread --thread= - --output-directory - --numbered --start-number - --numbered-files - --keep-subject - --signoff - --in-reply-to= --cc= - --full-index --binary - --not --all - --cover-letter - --no-prefix --src-prefix= --dst-prefix= - --inline --suffix= --ignore-if-in-upstream - --subject-prefix= - " - return - ;; - esac - __git_complete_revlist -} - -_git_fsck () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp " - --tags --root --unreachable --cache --no-reflogs --full - --strict --verbose --lost-found - " - return - ;; - esac - COMPREPLY=() -} - -_git_gc () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp "--prune --aggressive" - return - ;; - esac - COMPREPLY=() -} - -_git_gitk () -{ - _gitk -} - -_git_grep () -{ - __git_has_doubledash && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp " - --cached - --text --ignore-case --word-regexp --invert-match - --full-name - --extended-regexp --basic-regexp --fixed-strings - --files-with-matches --name-only - --files-without-match - --max-depth - --count - --and --or --not --all-match - " - return - ;; - esac - - __gitcomp "$(__git_refs)" -} - -_git_help () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp "--all --info --man --web" - return - ;; - esac - __git_compute_all_commands - __gitcomp "$__git_all_commands - attributes cli core-tutorial cvs-migration - diffcore gitk glossary hooks ignore modules - repository-layout tutorial tutorial-2 - workflows - " -} - -_git_init () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --shared=*) - __gitcomp " - false true umask group all world everybody - " "" "${cur##--shared=}" - return - ;; - --*) - __gitcomp "--quiet --bare --template= --shared --shared=" - return - ;; - esac - COMPREPLY=() -} - -_git_ls_files () -{ - __git_has_doubledash && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp "--cached --deleted --modified --others --ignored - --stage --directory --no-empty-directory --unmerged - --killed --exclude= --exclude-from= - --exclude-per-directory= --exclude-standard - --error-unmatch --with-tree= --full-name - --abbrev --ignored --exclude-per-directory - " - return - ;; - esac - COMPREPLY=() -} - -_git_ls_remote () -{ - __gitcomp "$(__git_remotes)" -} - -_git_ls_tree () -{ - __git_complete_file -} - -# Options that go well for log, shortlog and gitk -__git_log_common_options=" - --not --all - --branches --tags --remotes - --first-parent --merges --no-merges - --max-count= - --max-age= --since= --after= - --min-age= --until= --before= -" -# Options that go well for log and gitk (not shortlog) -__git_log_gitk_options=" - --dense --sparse --full-history - --simplify-merges --simplify-by-decoration - --left-right -" -# Options that go well for log and shortlog (not gitk) -__git_log_shortlog_options=" - --author= --committer= --grep= - --all-match -" - -__git_log_pretty_formats="oneline short medium full fuller email raw format:" -__git_log_date_formats="relative iso8601 rfc2822 short local default raw" - -_git_log () -{ - __git_has_doubledash && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - local g="$(git rev-parse --git-dir 2>/dev/null)" - local merge="" - if [ -f "$g/MERGE_HEAD" ]; then - merge="--merge" - fi - case "$cur" in - --pretty=*) - __gitcomp "$__git_log_pretty_formats - " "" "${cur##--pretty=}" - return - ;; - --format=*) - __gitcomp "$__git_log_pretty_formats - " "" "${cur##--format=}" - return - ;; - --date=*) - __gitcomp "$__git_log_date_formats" "" "${cur##--date=}" - return - ;; - --decorate=*) - __gitcomp "long short" "" "${cur##--decorate=}" - return - ;; - --*) - __gitcomp " - $__git_log_common_options - $__git_log_shortlog_options - $__git_log_gitk_options - --root --topo-order --date-order --reverse - --follow --full-diff - --abbrev-commit --abbrev= - --relative-date --date= - --pretty= --format= --oneline - --cherry-pick - --graph - --decorate --decorate= - --walk-reflogs - --parents --children - $merge - $__git_diff_common_options - --pickaxe-all --pickaxe-regex - " - return - ;; - esac - __git_complete_revlist -} - -__git_merge_options=" - --no-commit --no-stat --log --no-log --squash --strategy - --commit --stat --no-squash --ff --no-ff --ff-only -" - -_git_merge () -{ - __git_complete_strategy && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp "$__git_merge_options" - return - esac - __gitcomp "$(__git_refs)" -} - -_git_mergetool () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --tool=*) - __gitcomp "$__git_mergetools_common tortoisemerge" "" "${cur##--tool=}" - return - ;; - --*) - __gitcomp "--tool=" - return - ;; - esac - COMPREPLY=() -} - -_git_merge_base () -{ - __gitcomp "$(__git_refs)" -} - -_git_mv () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp "--dry-run" - return - ;; - esac - COMPREPLY=() -} - -_git_name_rev () -{ - __gitcomp "--tags --all --stdin" -} - -_git_notes () -{ - local subcommands="edit show" - if [ -z "$(__git_find_on_cmdline "$subcommands")" ]; then - __gitcomp "$subcommands" - return - fi - - case "${COMP_WORDS[COMP_CWORD-1]}" in - -m|-F) - COMPREPLY=() - ;; - *) - __gitcomp "$(__git_refs)" - ;; - esac -} - -_git_pull () -{ - __git_complete_strategy && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp " - --rebase --no-rebase - $__git_merge_options - $__git_fetch_options - " - return - ;; - esac - __git_complete_remote_or_refspec -} - -_git_push () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "${COMP_WORDS[COMP_CWORD-1]}" in - --repo) - __gitcomp "$(__git_remotes)" - return - esac - case "$cur" in - --repo=*) - __gitcomp "$(__git_remotes)" "" "${cur##--repo=}" - return - ;; - --*) - __gitcomp " - --all --mirror --tags --dry-run --force --verbose - --receive-pack= --repo= - " - return - ;; - esac - __git_complete_remote_or_refspec -} - -_git_rebase () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)" - if [ -d "$dir"/rebase-apply ] || [ -d "$dir"/rebase-merge ]; then - __gitcomp "--continue --skip --abort" - return - fi - __git_complete_strategy && return - case "$cur" in - --whitespace=*) - __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}" - return - ;; - --*) - __gitcomp " - --onto --merge --strategy --interactive - --preserve-merges --stat --no-stat - --committer-date-is-author-date --ignore-date - --ignore-whitespace --whitespace= - --autosquash - " - - return - esac - __gitcomp "$(__git_refs)" -} - -__git_send_email_confirm_options="always never auto cc compose" -__git_send_email_suppresscc_options="author self cc bodycc sob cccmd body all" - -_git_send_email () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --confirm=*) - __gitcomp " - $__git_send_email_confirm_options - " "" "${cur##--confirm=}" - return - ;; - --suppress-cc=*) - __gitcomp " - $__git_send_email_suppresscc_options - " "" "${cur##--suppress-cc=}" - - return - ;; - --smtp-encryption=*) - __gitcomp "ssl tls" "" "${cur##--smtp-encryption=}" - return - ;; - --*) - __gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to - --compose --confirm= --dry-run --envelope-sender - --from --identity - --in-reply-to --no-chain-reply-to --no-signed-off-by-cc - --no-suppress-from --no-thread --quiet - --signed-off-by-cc --smtp-pass --smtp-server - --smtp-server-port --smtp-encryption= --smtp-user - --subject --suppress-cc= --suppress-from --thread --to - --validate --no-validate" - return - ;; - esac - COMPREPLY=() -} - -_git_stage () -{ - _git_add -} - -__git_config_get_set_variables () -{ - local prevword word config_file= c=$COMP_CWORD - while [ $c -gt 1 ]; do - word="${COMP_WORDS[c]}" - case "$word" in - --global|--system|--file=*) - config_file="$word" - break - ;; - -f|--file) - config_file="$word $prevword" - break - ;; - esac - prevword=$word - c=$((--c)) - done - - git --git-dir="$(__gitdir)" config $config_file --list 2>/dev/null | - while read line - do - case "$line" in - *.*=*) - echo "${line/=*/}" - ;; - esac - done -} - -_git_config () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prv="${COMP_WORDS[COMP_CWORD-1]}" - case "$prv" in - branch.*.remote) - __gitcomp "$(__git_remotes)" - return - ;; - branch.*.merge) - __gitcomp "$(__git_refs)" - return - ;; - remote.*.fetch) - local remote="${prv#remote.}" - remote="${remote%.fetch}" - __gitcomp "$(__git_refs_remotes "$remote")" - return - ;; - remote.*.push) - local remote="${prv#remote.}" - remote="${remote%.push}" - __gitcomp "$(git --git-dir="$(__gitdir)" \ - for-each-ref --format='%(refname):%(refname)' \ - refs/heads)" - return - ;; - pull.twohead|pull.octopus) - __git_compute_merge_strategies - __gitcomp "$__git_merge_strategies" - return - ;; - color.branch|color.diff|color.interactive|\ - color.showbranch|color.status|color.ui) - __gitcomp "always never auto" - return - ;; - color.pager) - __gitcomp "false true" - return - ;; - color.*.*) - __gitcomp " - normal black red green yellow blue magenta cyan white - bold dim ul blink reverse - " - return - ;; - help.format) - __gitcomp "man info web html" - return - ;; - log.date) - __gitcomp "$__git_log_date_formats" - return - ;; - sendemail.aliasesfiletype) - __gitcomp "mutt mailrc pine elm gnus" - return - ;; - sendemail.confirm) - __gitcomp "$__git_send_email_confirm_options" - return - ;; - sendemail.suppresscc) - __gitcomp "$__git_send_email_suppresscc_options" - return - ;; - --get|--get-all|--unset|--unset-all) - __gitcomp "$(__git_config_get_set_variables)" - return - ;; - *.*) - COMPREPLY=() - return - ;; - esac - case "$cur" in - --*) - __gitcomp " - --global --system --file= - --list --replace-all - --get --get-all --get-regexp - --add --unset --unset-all - --remove-section --rename-section - " - return - ;; - branch.*.*) - local pfx="${cur%.*}." - cur="${cur##*.}" - __gitcomp "remote merge mergeoptions rebase" "$pfx" "$cur" - return - ;; - branch.*) - local pfx="${cur%.*}." - cur="${cur#*.}" - __gitcomp "$(__git_heads)" "$pfx" "$cur" "." - return - ;; - guitool.*.*) - local pfx="${cur%.*}." - cur="${cur##*.}" - __gitcomp " - argprompt cmd confirm needsfile noconsole norescan - prompt revprompt revunmerged title - " "$pfx" "$cur" - return - ;; - difftool.*.*) - local pfx="${cur%.*}." - cur="${cur##*.}" - __gitcomp "cmd path" "$pfx" "$cur" - return - ;; - man.*.*) - local pfx="${cur%.*}." - cur="${cur##*.}" - __gitcomp "cmd path" "$pfx" "$cur" - return - ;; - mergetool.*.*) - local pfx="${cur%.*}." - cur="${cur##*.}" - __gitcomp "cmd path trustExitCode" "$pfx" "$cur" - return - ;; - pager.*) - local pfx="${cur%.*}." - cur="${cur#*.}" - __git_compute_all_commands - __gitcomp "$__git_all_commands" "$pfx" "$cur" - return - ;; - remote.*.*) - local pfx="${cur%.*}." - cur="${cur##*.}" - __gitcomp " - url proxy fetch push mirror skipDefaultUpdate - receivepack uploadpack tagopt pushurl - " "$pfx" "$cur" - return - ;; - remote.*) - local pfx="${cur%.*}." - cur="${cur#*.}" - __gitcomp "$(__git_remotes)" "$pfx" "$cur" "." - return - ;; - url.*.*) - local pfx="${cur%.*}." - cur="${cur##*.}" - __gitcomp "insteadOf pushInsteadOf" "$pfx" "$cur" - return - ;; - esac - __gitcomp " - add.ignore-errors - alias. - apply.ignorewhitespace - apply.whitespace - branch.autosetupmerge - branch.autosetuprebase - clean.requireForce - color.branch - color.branch.current - color.branch.local - color.branch.plain - color.branch.remote - color.diff - color.diff.commit - color.diff.frag - color.diff.meta - color.diff.new - color.diff.old - color.diff.plain - color.diff.whitespace - color.grep - color.grep.external - color.grep.match - color.interactive - color.interactive.header - color.interactive.help - color.interactive.prompt - color.pager - color.showbranch - color.status - color.status.added - color.status.changed - color.status.header - color.status.nobranch - color.status.untracked - color.status.updated - color.ui - commit.template - core.autocrlf - core.bare - core.compression - core.createObject - core.deltaBaseCacheLimit - core.editor - core.excludesfile - core.fileMode - core.fsyncobjectfiles - core.gitProxy - core.ignoreCygwinFSTricks - core.ignoreStat - core.logAllRefUpdates - core.loosecompression - core.packedGitLimit - core.packedGitWindowSize - core.pager - core.preferSymlinkRefs - core.preloadindex - core.quotepath - core.repositoryFormatVersion - core.safecrlf - core.sharedRepository - core.symlinks - core.trustctime - core.warnAmbiguousRefs - core.whitespace - core.worktree - diff.autorefreshindex - diff.external - diff.mnemonicprefix - diff.renameLimit - diff.renameLimit. - diff.renames - diff.suppressBlankEmpty - diff.tool - diff.wordRegex - difftool. - difftool.prompt - fetch.unpackLimit - format.attach - format.cc - format.headers - format.numbered - format.pretty - format.signoff - format.subjectprefix - format.suffix - format.thread - gc.aggressiveWindow - gc.auto - gc.autopacklimit - gc.packrefs - gc.pruneexpire - gc.reflogexpire - gc.reflogexpireunreachable - gc.rerereresolved - gc.rerereunresolved - gitcvs.allbinary - gitcvs.commitmsgannotation - gitcvs.dbTableNamePrefix - gitcvs.dbdriver - gitcvs.dbname - gitcvs.dbpass - gitcvs.dbuser - gitcvs.enabled - gitcvs.logfile - gitcvs.usecrlfattr - guitool. - gui.blamehistoryctx - gui.commitmsgwidth - gui.copyblamethreshold - gui.diffcontext - gui.encoding - gui.fastcopyblame - gui.matchtrackingbranch - gui.newbranchtemplate - gui.pruneduringfetch - gui.spellingdictionary - gui.trustmtime - help.autocorrect - help.browser - help.format - http.lowSpeedLimit - http.lowSpeedTime - http.maxRequests - http.noEPSV - http.proxy - http.sslCAInfo - http.sslCAPath - http.sslCert - http.sslKey - http.sslVerify - i18n.commitEncoding - i18n.logOutputEncoding - imap.folder - imap.host - imap.pass - imap.port - imap.preformattedHTML - imap.sslverify - imap.tunnel - imap.user - instaweb.browser - instaweb.httpd - instaweb.local - instaweb.modulepath - instaweb.port - interactive.singlekey - log.date - log.showroot - mailmap.file - man. - man.viewer - merge.conflictstyle - merge.log - merge.renameLimit - merge.stat - merge.tool - merge.verbosity - mergetool. - mergetool.keepBackup - mergetool.prompt - pack.compression - pack.deltaCacheLimit - pack.deltaCacheSize - pack.depth - pack.indexVersion - pack.packSizeLimit - pack.threads - pack.window - pack.windowMemory - pager. - pull.octopus - pull.twohead - push.default - rebase.stat - receive.denyCurrentBranch - receive.denyDeletes - receive.denyNonFastForwards - receive.fsckObjects - receive.unpackLimit - repack.usedeltabaseoffset - rerere.autoupdate - rerere.enabled - sendemail.aliasesfile - sendemail.aliasesfiletype - sendemail.bcc - sendemail.cc - sendemail.cccmd - sendemail.chainreplyto - sendemail.confirm - sendemail.envelopesender - sendemail.multiedit - sendemail.signedoffbycc - sendemail.smtpencryption - sendemail.smtppass - sendemail.smtpserver - sendemail.smtpserverport - sendemail.smtpuser - sendemail.suppresscc - sendemail.suppressfrom - sendemail.thread - sendemail.to - sendemail.validate - showbranch.default - status.relativePaths - status.showUntrackedFiles - tar.umask - transfer.unpackLimit - url. - user.email - user.name - user.signingkey - web.browser - branch. remote. - " -} - -_git_remote () -{ - local subcommands="add rename rm show prune update set-head" - local subcommand="$(__git_find_on_cmdline "$subcommands")" - if [ -z "$subcommand" ]; then - __gitcomp "$subcommands" - return - fi - - case "$subcommand" in - rename|rm|show|prune) - __gitcomp "$(__git_remotes)" - ;; - update) - local i c='' IFS=$'\n' - for i in $(git --git-dir="$(__gitdir)" config --get-regexp "remotes\..*" 2>/dev/null); do - i="${i#remotes.}" - c="$c ${i/ */}" - done - __gitcomp "$c" - ;; - *) - COMPREPLY=() - ;; - esac -} - -_git_replace () -{ - __gitcomp "$(__git_refs)" -} - -_git_reset () -{ - __git_has_doubledash && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp "--merge --mixed --hard --soft --patch" - return - ;; - esac - __gitcomp "$(__git_refs)" -} - -_git_revert () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp "--edit --mainline --no-edit --no-commit --signoff" - return - ;; - esac - __gitcomp "$(__git_refs)" -} - -_git_rm () -{ - __git_has_doubledash && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp "--cached --dry-run --ignore-unmatch --quiet" - return - ;; - esac - COMPREPLY=() -} - -_git_shortlog () -{ - __git_has_doubledash && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp " - $__git_log_common_options - $__git_log_shortlog_options - --numbered --summary - " - return - ;; - esac - __git_complete_revlist -} - -_git_show () -{ - __git_has_doubledash && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --pretty=*) - __gitcomp "$__git_log_pretty_formats - " "" "${cur##--pretty=}" - return - ;; - --format=*) - __gitcomp "$__git_log_pretty_formats - " "" "${cur##--format=}" - return - ;; - --*) - __gitcomp "--pretty= --format= --abbrev-commit --oneline - $__git_diff_common_options - " - return - ;; - esac - __git_complete_file -} - -_git_show_branch () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp " - --all --remotes --topo-order --current --more= - --list --independent --merge-base --no-name - --color --no-color - --sha1-name --sparse --topics --reflog - " - return - ;; - esac - __git_complete_revlist -} - -_git_stash () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local save_opts='--keep-index --no-keep-index --quiet --patch' - local subcommands='save list show apply clear drop pop create branch' - local subcommand="$(__git_find_on_cmdline "$subcommands")" - if [ -z "$subcommand" ]; then - case "$cur" in - --*) - __gitcomp "$save_opts" - ;; - *) - if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then - __gitcomp "$subcommands" - else - COMPREPLY=() - fi - ;; - esac - else - case "$subcommand,$cur" in - save,--*) - __gitcomp "$save_opts" - ;; - apply,--*|pop,--*) - __gitcomp "--index --quiet" - ;; - show,--*|drop,--*|branch,--*) - COMPREPLY=() - ;; - show,*|apply,*|drop,*|pop,*|branch,*) - __gitcomp "$(git --git-dir="$(__gitdir)" stash list \ - | sed -n -e 's/:.*//p')" - ;; - *) - COMPREPLY=() - ;; - esac - fi -} - -_git_submodule () -{ - __git_has_doubledash && return - - local subcommands="add status init update summary foreach sync" - if [ -z "$(__git_find_on_cmdline "$subcommands")" ]; then - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$cur" in - --*) - __gitcomp "--quiet --cached" - ;; - *) - __gitcomp "$subcommands" - ;; - esac - return - fi -} - -_git_svn () -{ - local subcommands=" - init fetch clone rebase dcommit log find-rev - set-tree commit-diff info create-ignore propget - proplist show-ignore show-externals branch tag blame - migrate mkdirs reset gc - " - local subcommand="$(__git_find_on_cmdline "$subcommands")" - if [ -z "$subcommand" ]; then - __gitcomp "$subcommands" - else - local remote_opts="--username= --config-dir= --no-auth-cache" - local fc_opts=" - --follow-parent --authors-file= --repack= - --no-metadata --use-svm-props --use-svnsync-props - --log-window-size= --no-checkout --quiet - --repack-flags --use-log-author --localtime - --ignore-paths= $remote_opts - " - local init_opts=" - --template= --shared= --trunk= --tags= - --branches= --stdlayout --minimize-url - --no-metadata --use-svm-props --use-svnsync-props - --rewrite-root= --prefix= --use-log-author - --add-author-from $remote_opts - " - local cmt_opts=" - --edit --rmdir --find-copies-harder --copy-similarity= - " - - local cur="${COMP_WORDS[COMP_CWORD]}" - case "$subcommand,$cur" in - fetch,--*) - __gitcomp "--revision= --fetch-all $fc_opts" - ;; - clone,--*) - __gitcomp "--revision= $fc_opts $init_opts" - ;; - init,--*) - __gitcomp "$init_opts" - ;; - dcommit,--*) - __gitcomp " - --merge --strategy= --verbose --dry-run - --fetch-all --no-rebase --commit-url - --revision $cmt_opts $fc_opts - " - ;; - set-tree,--*) - __gitcomp "--stdin $cmt_opts $fc_opts" - ;; - create-ignore,--*|propget,--*|proplist,--*|show-ignore,--*|\ - show-externals,--*|mkdirs,--*) - __gitcomp "--revision=" - ;; - log,--*) - __gitcomp " - --limit= --revision= --verbose --incremental - --oneline --show-commit --non-recursive - --authors-file= --color - " - ;; - rebase,--*) - __gitcomp " - --merge --verbose --strategy= --local - --fetch-all --dry-run $fc_opts - " - ;; - commit-diff,--*) - __gitcomp "--message= --file= --revision= $cmt_opts" - ;; - info,--*) - __gitcomp "--url" - ;; - branch,--*) - __gitcomp "--dry-run --message --tag" - ;; - tag,--*) - __gitcomp "--dry-run --message" - ;; - blame,--*) - __gitcomp "--git-format" - ;; - migrate,--*) - __gitcomp " - --config-dir= --ignore-paths= --minimize - --no-auth-cache --username= - " - ;; - reset,--*) - __gitcomp "--revision= --parent" - ;; - *) - COMPREPLY=() - ;; - esac - fi -} - -_git_tag () -{ - local i c=1 f=0 - while [ $c -lt $COMP_CWORD ]; do - i="${COMP_WORDS[c]}" - case "$i" in - -d|-v) - __gitcomp "$(__git_tags)" - return - ;; - -f) - f=1 - ;; - esac - c=$((++c)) - done - - case "${COMP_WORDS[COMP_CWORD-1]}" in - -m|-F) - COMPREPLY=() - ;; - -*|tag) - if [ $f = 1 ]; then - __gitcomp "$(__git_tags)" - else - COMPREPLY=() - fi - ;; - *) - __gitcomp "$(__git_refs)" - ;; - esac -} - -_git_whatchanged () -{ - _git_log -} - -_git () -{ - local i c=1 command __git_dir - - while [ $c -lt $COMP_CWORD ]; do - i="${COMP_WORDS[c]}" - case "$i" in - --git-dir=*) __git_dir="${i#--git-dir=}" ;; - --bare) __git_dir="." ;; - --version|-p|--paginate) ;; - --help) command="help"; break ;; - *) command="$i"; break ;; - esac - c=$((++c)) - done - - if [ -z "$command" ]; then - case "${COMP_WORDS[COMP_CWORD]}" in - --*) __gitcomp " - --paginate - --no-pager - --git-dir= - --bare - --version - --exec-path - --html-path - --work-tree= - --help - " - ;; - *) __git_compute_porcelain_commands - __gitcomp "$__git_porcelain_commands $(__git_aliases)" ;; - esac - return - fi - - local completion_func="_git_${command//-/_}" - declare -F $completion_func >/dev/null && $completion_func && return - - local expansion=$(__git_aliased_command "$command") - if [ -n "$expansion" ]; then - completion_func="_git_${expansion//-/_}" - declare -F $completion_func >/dev/null && $completion_func - fi -} - -_gitk () -{ - __git_has_doubledash && return - - local cur="${COMP_WORDS[COMP_CWORD]}" - local g="$(__gitdir)" - local merge="" - if [ -f "$g/MERGE_HEAD" ]; then - merge="--merge" - fi - case "$cur" in - --*) - __gitcomp " - $__git_log_common_options - $__git_log_gitk_options - $merge - " - return - ;; - esac - __git_complete_revlist -} - -complete -o bashdefault -o default -o nospace -F _git git 2>/dev/null \ - || complete -o default -o nospace -F _git git -complete -o bashdefault -o default -o nospace -F _gitk gitk 2>/dev/null \ - || complete -o default -o nospace -F _gitk gitk - -# The following are necessary only for Cygwin, and only are needed -# when the user has tab-completed the executable name and consequently -# included the '.exe' suffix. -# -if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then -complete -o bashdefault -o default -o nospace -F _git git.exe 2>/dev/null \ - || complete -o default -o nospace -F _git git.exe -fi diff --git a/gitconfig b/gitconfig index 696c1445..f4c87efd 100644 --- a/gitconfig +++ b/gitconfig @@ -11,13 +11,13 @@ old = red bold new = green bold [alias] - d = diff # show unstaged changes - dc = diff --cached # show staged changes - last = diff HEAD^ # show last committed change - unstage = reset HEAD # remove files from index (tracking) + d = diff # show unstaged changes + dc = diff --cached # show staged changes + last = diff HEAD^ # show last committed change + unstage = reset HEAD # remove files from index (tracking) uncommit = reset --soft HEAD^ # go back before last commit, with files in uncommitted state - chunkyadd = add --patch # stage commits chunk by chunk - filelog = log -u # show changes to a file + chunkyadd = add --patch # stage commits chunk by chunk + filelog = log -u # show changes to a file amend = commit --amend ammend = commit --amend mt = mergetool #fire up the merge tool diff --git a/vim/doc/vcscommand.txt b/vim/doc/vcscommand.txt deleted file mode 100755 index 28d4e634..00000000 --- a/vim/doc/vcscommand.txt +++ /dev/null @@ -1,819 +0,0 @@ -*vcscommand.txt* vcscommand -Copyright (c) 2007 Bob Hiestand - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. - -For instructions on installing this file, type - :help add-local-help -inside Vim. - -Author: Bob Hiestand -Credits: Benji Fisher's excellent MatchIt documentation - -============================================================================== -1. Contents *vcscommand-contents* - - Installation : |vcscommand-install| - vcscommand Intro : |vcscommand| - vcscommand Manual : |vcscommand-manual| - Customization : |vcscommand-customize| - SSH "integration" : |vcscommand-ssh| - Changes from cvscommand : |cvscommand-changes| - Bugs : |vcscommand-bugs| - -============================================================================== - -2. vcscommand Installation *vcscommand-install* - -The vcscommand plugin comprises five files: vcscommand.vim, vcssvn.vim, -vcscvs.vim, vcssvk.vim and vcscommand.txt (this file). In order to install -the plugin, place the vcscommand.vim, vcssvn.vim, vcssvk.vim, and vcscvs.vim -files into a plugin directory in your runtime path (please see -|add-global-plugin| and |'runtimepath'|. - -This help file can be included in the VIM help system by copying it into a -'doc' directory in your runtime path and then executing the |:helptags| -command, specifying the full path of the 'doc' directory. Please see -|add-local-help| for more details. - -vcscommand may be customized by setting variables, creating maps, and -specifying event handlers. Please see |vcscommand-customize| for more -details. - -============================================================================== - -3. vcscommand Intro *vcscommand* - *vcscommand-intro* - -The vcscommand plugin provides global ex commands for manipulating -version-controlled source files, currently those controlled either by CVS or -Subversion. In general, each command operates on the current buffer and -accomplishes a separate source control function, such as update, commit, log, -and others (please see |vcscommand-commands| for a list of all available -commands). The results of each operation are displayed in a scratch buffer. -Several buffer variables are defined for those scratch buffers (please see -|vcscommand-buffer-variables|). - -The notion of "current file" means either the current buffer, or, in the case -of a directory buffer (such as Explorer or netrw buffers), the directory (and -all subdirectories) represented by the the buffer. - -For convenience, any vcscommand invoked on a vcscommand scratch buffer acts as -though it was invoked on the original file and splits the screen so that the -output appears in a new window. - -Many of the commands accept revisions as arguments. By default, most operate -on the most recent revision on the current branch if no revision is specified. - -Each vcscommand is mapped to a key sequence starting with the || -keystroke. The default mappings may be overridden by supplying different -mappings before the plugin is loaded, such as in the vimrc, in the standard -fashion for plugin mappings. For examples, please see -|vcscommand-mappings-override|. - -The vcscommand plugin may be configured in several ways. For more details, -please see |vcscommand-customize|. - -============================================================================== - -4. vcscommand Manual *vcscommand-manual* - -4.1 vcscommand commands *vcscommand-commands* - -vcscommand defines the following commands: - -|:VCSAdd| -|:VCSAnnotate| -|:VCSBlame| -|:VCSCommit| -|:VCSDelete| -|:VCSDiff| -|:VCSGotoOriginal| -|:VCSLog| -|:VCSRemove| -|:VCSRevert| -|:VCSReview| -|:VCSStatus| -|:VCSUpdate| -|:VCSVimDiff| - -The following commands are specific to CVS files: - -|:CVSEdit| -|:CVSEditors| -|:CVSUnedit| -|:CVSWatch| -|:CVSWatchAdd| -|:CVSWatchOn| -|:CVSWatchOff| -|:CVSWatchRemove| -|:CVSWatchers| - -:VCSAdd *:VCSAdd* - -This command adds the current file to source control. Please note, this does -not commit the newly-added file. All parameters to the command are passed to -the underlying VCS. - -:VCSAnnotate[!] *:VCSAnnotate* - -This command displays the current file with each line annotated with the -version in which it was most recently changed. If an argument is given, the -argument is used as a revision number to display. If not given an argument, -it uses the most recent version of the file (on the current branch, if under -CVS control). Additionally, if the current buffer is a VCSAnnotate buffer -already, the version number on the current line is used. - -If '!' is used, the view of the annotated buffer is split so that the -annotation is in a separate window from the content, and each is highlighted -separately. - -For CVS buffers, the 'VCSCommandCVSAnnotateParent' option, if set to non-zero, -will cause the above behavior to change. Instead of annotating the version on -the current line, the parent revision is used instead, crossing branches if -necessary. - -With no arguments the cursor will jump to the line in the annotated buffer -corresponding to the current line in the source buffer. - -:VCSBlame[!] *:VCSBlame* - -Alias for |:VCSAnnotate|. - -:VCSCommit[!] *:VCSCommit* - -This command commits changes to the current file to source control. - -If called with arguments, the arguments are the log message. - -If '!' is used, an empty log message is committed. - -If called with no arguments, this is a two-step command. The first step opens -a buffer to accept a log message. When that buffer is written, it is -automatically closed and the file is committed using the information from that -log message. The commit can be abandoned if the log message buffer is deleted -or wiped before being written. - -Alternatively, the mapping that is used to invoke :VCSCommit (by default -||cc, please see |vcscommand-mappings|) can be used in the log message -buffer in Normal mode to immediately commit. This is useful if the -|VCSCommandCommitOnWrite| variable is set to 0 to disable the normal -commit-on-write behavior. - -:VCSDelete *:VCSDelete* - -Deletes the current file and removes it from source control. All parameters -to the command are passed to the underlying VCS. - -:VCSDiff *:VCSDiff* - -With no arguments, this displays the differences between the current file and -its parent version under source control in a new scratch buffer. - -With one argument, the diff is performed on the current file against the -specified revision. - -With two arguments, the diff is performed between the specified revisions of -the current file. - -For CVS, this command uses the |VCSCommandCVSDiffOpt| variable to specify diff -options. If that variable does not exist, a plugin-specific default is used. -If you wish to have no options, then set it to the empty string. - -For SVN, this command uses the |VCSCommandSVNDiffOpt| variable to specify diff -options. If that variable does not exist, the SVN default is used. -Additionally, |VCSCommandSVNDiffExt| can be used to select an external diff -application. - -:VCSGotoOriginal *:VCSGotoOriginal* - -This command jumps to the source buffer if the current buffer is a VCS scratch -buffer. - -:VCSGotoOriginal! - -Like ":VCSGotoOriginal" but also executes :bufwipeout on all VCS scrach -buffers associated with the original file. - -:VCSInfo *:VCSInfo* - -This command displays extended information about the current file in a new -scratch buffer. - -:VCSLock *:VCSLock* - -This command locks the current file in order to prevent other users from -concurrently modifying it. The exact semantics of this command depend on the -underlying VCS. This does nothing in CVS. All parameters are passed to the -underlying VCS. - -:VCSLog *:VCSLog* - -Displays the version history of the current file in a new scratch buffer. If -there is one parameter supplied, it is taken as as a revision parameters to be -passed through to the underlying VCS. Otherwise, all parameters are passed to -the underlying VCS. - -:VCSRemove *:VCSRemove* - -Alias for |:VCSDelete|. - -:VCSRevert *:VCSRevert* - -This command replaces the current file with the most recent version from the -repository in order to wipe out any undesired changes. - -:VCSReview *:VCSReview* - -Displays a particular version of the current file in a new scratch buffer. If -no argument is given, the most recent version of the file on the current -branch is retrieved. - -:VCSStatus *:VCSStatus* - -Displays versioning information about the current file in a new scratch -buffer. All parameters are passed to the underlying VCS. - - -:VCSUnlock *:VCSUnlock* - -Unlocks the current file in order to allow other users from concurrently -modifying it. The exact semantics of this command depend on the underlying -VCS. All parameters are passed to the underlying VCS. - -:VCSUpdate *:VCSUpdate* - -Updates the current file with any relevant changes from the repository. This -intentionally does not automatically reload the current buffer, though vim -should prompt the user to do so if the underlying file is altered by this -command. - -:VCSVimDiff *:VCSVimDiff* - -Uses vimdiff to display differences between versions of the current file. - -If no revision is specified, the most recent version of the file on the -current branch is used. With one argument, that argument is used as the -revision as above. With two arguments, the differences between the two -revisions is displayed using vimdiff. - -With either zero or one argument, the original buffer is used to perform the -vimdiff. When the scratch buffer is closed, the original buffer will be -returned to normal mode. - -Once vimdiff mode is started using the above methods, additional vimdiff -buffers may be added by passing a single version argument to the command. -There may be up to 4 vimdiff buffers total. - -Using the 2-argument form of the command resets the vimdiff to only those 2 -versions. Additionally, invoking the command on a different file will close -the previous vimdiff buffers. - -:CVSEdit *:CVSEdit* - -This command performs "cvs edit" on the current file. Yes, the output buffer -in this case is almost completely useless. - -:CVSEditors *:CVSEditors* - -This command performs "cvs edit" on the current file. - -:CVSUnedit *:CVSUnedit* - -Performs "cvs unedit" on the current file. Again, yes, the output buffer here -is basically useless. - -:CVSWatch *:CVSWatch* - -This command takes an argument which must be one of [on|off|add|remove]. The -command performs "cvs watch" with the given argument on the current file. - -:CVSWatchAdd *:CVSWatchAdd* - -This command is an alias for ":CVSWatch add" - -:CVSWatchOn *:CVSWatchOn* - -This command is an alias for ":CVSWatch on" - -:CVSWatchOff *:CVSWatchOff* - -This command is an alias for ":CVSWatch off" - -:CVSWatchRemove *:CVSWatchRemove* - -This command is an alias for ":CVSWatch remove" - -:CVSWatchers *:CVSWatchers* - -This command performs "cvs watchers" on the current file. - -4.2 Mappings *vcscommand-mappings* - -By default, a mapping is defined for each command. These mappings execute the -default (no-argument) form of each command. - -||ca VCSAdd -||cn VCSAnnotate -||cN VCSAnnotate! -||cc VCSCommit -||cD VCSDelete -||cd VCSDiff -||cg VCSGotoOriginal -||cG VCSGotoOriginal! -||ci VCSInfo -||cl VCSLog -||cL VCSLock -||cr VCSReview -||cs VCSStatus -||cu VCSUpdate -||cU VCSUnlock -||cv VCSVimDiff - -Only for CVS buffers: - -||ce CVSEdit -||cE CVSEditors -||ct CVSUnedit -||cwv CVSWatchers -||cwa CVSWatchAdd -||cwn CVSWatchOn -||cwf CVSWatchOff -||cwf CVSWatchRemove - - *vcscommand-mappings-override* - -The default mappings can be overridden by user-provided instead by mapping to -CommandName. This is especially useful when these mappings collide with -other existing mappings (vim will warn of this during plugin initialization, -but will not clobber the existing mappings). - -There are three methods for controlling mapping: - -First, maps can be overriden for individual commands. For instance, to -override the default mapping for :VCSAdd to set it to '\add', add the -following to the vimrc: - -nmap \add VCSAdd - -Second, the default map prefix ('c') can be overridden by defining the -|VCSCommandMapPrefix| variable. - -Third, the entire set of default maps can be overridden by defining the -|VCSCommandMappings| variable. - - -4.3 Automatic buffer variables *vcscommand-buffer-variables* - -Several buffer variables are defined in each vcscommand result buffer. These -may be useful for additional customization in callbacks defined in the event -handlers (please see |vcscommand-events|). - -The following variables are automatically defined: - -b:VCSCommandOriginalBuffer *b:VCSCommandOriginalBuffer* - -This variable is set to the buffer number of the source file. - -b:VCSCommandCommand *b:VCSCommandCommand* - -This variable is set to the name of the vcscommand that created the result -buffer. - -b:VCSCommandSourceFile *b:VCSCommandSourceFile* - -This variable is set to the name of the original file under source control. - -b:VCSCommandVCSType *b:VCSCommandVCSType* - -This variable is set to the type of the source control. This variable is also -set on the original file itself. -============================================================================== - -5. Configuration and customization *vcscommand-customize* - *vcscommand-config* - -The vcscommand plugin can be configured in several ways: by setting -configuration variables (see |vcscommand-options|) or by defining vcscommand -event handlers (see |vcscommand-events|). Additionally, the vcscommand plugin -supports a customized status line (see |vcscommand-statusline| and -|vcscommand-buffer-management|). - -5.1 vcscommand configuration variables *vcscommand-options* - -Several variables affect the plugin's behavior. These variables are checked -at time of execution, and may be defined at the window, buffer, or global -level and are checked in that order of precedence. - - -The following variables are available: - -|VCSCommandCommitOnWrite| -|VCSCommandCVSDiffOpt| -|VCSCommandCVSExec| -|VCSCommandDeleteOnHide| -|VCSCommandDiffSplit| -|VCSCommandDisableAll| -|VCSCommandDisableMappings| -|VCSCommandDisableExtensionMappings| -|VCSCommandEdit| -|VCSCommandEnableBufferSetup| -|VCSCommandMappings| -|VCSCommandMapPrefix| -|VCSCommandResultBufferNameExtension| -|VCSCommandResultBufferNameFunction| -|VCSCommandSplit| -|VCSCommandSVKExec| -|VCSCommandSVNDiffExt| -|VCSCommandSVNDiffOpt| -|VCSCommandSVNExec| -|VCSCommandVCSTypeOverride| - -VCSCommandCommitOnWrite *VCSCommandCommitOnWrite* - -This variable, if set to a non-zero value, causes the pending commit -to take place immediately as soon as the log message buffer is written. -If set to zero, only the VCSCommit mapping will cause the pending commit to -occur. If not set, it defaults to 1. - -VCSCommandCVSExec *VCSCommandCVSExec* - -This variable controls the executable used for all CVS commands If not set, -it defaults to "cvs". - -VCSCommandDeleteOnHide *VCSCommandDeleteOnHide* - -This variable, if set to a non-zero value, causes the temporary result buffers -to automatically delete themselves when hidden. - -VCSCommandCVSDiffOpt *VCSCommandCVSDiffOpt* - -This variable, if set, determines the options passed to the diff command of -CVS. If not set, it defaults to 'u'. - -VCSCommandDiffSplit *VCSCommandDiffSplit* - -This variable overrides the |VCSCommandSplit| variable, but only for buffers -created with |:VCSVimDiff|. - -VCSCommandDisableAll *VCSCommandDisableAll* - -This variable, if set, prevents the plugin or any extensions from loading at -all. This is useful when a single runtime distribution is used on multiple -systems with varying versions. - -VCSCommandDisableMappings *VCSCommandDisableMappings* - -This variable, if set to a non-zero value, prevents the default command -mappings from being set. This supercedes -|VCSCommandDisableExtensionMappings|. - -VCSCommandDisableExtensionMappings *VCSCommandDisableExtensionMappings* - -This variable, if set to a non-zero value, prevents the default command -mappings from being set for commands specific to an individual VCS. - -VCSCommandEdit *VCSCommandEdit* - -This variable controls whether the original buffer is replaced ('edit') or -split ('split'). If not set, it defaults to 'split'. - -VCSCommandEnableBufferSetup *VCSCommandEnableBufferSetup* - -This variable, if set to a non-zero value, activates VCS buffer management -mode see (|vcscommand-buffer-management|). This mode means that the -'VCSCommandBufferInfo' variable is filled with version information if the file -is VCS-controlled. This is useful for displaying version information in the -status bar. - -VCSCommandMappings *VCSCommandMappings* - -This variable, if set, overrides the default mappings used for shortcuts. It -should be a List of 2-element Lists, each containing a shortcut and function -name pair. The value of the '|VCSCommandMapPrefix|' variable will be added to -each shortcut. - -VCSCommandMapPrefix *VCSCommandMapPrefix* - -This variable, if set, overrides the default mapping prefix ('c'). -This allows customization of the mapping space used by the vcscommand -shortcuts. - -VCSCommandResultBufferNameExtension *VCSCommandResultBufferNameExtension* - -This variable, if set to a non-blank value, is appended to the name of the VCS -command output buffers. For example, '.vcs'. Using this option may help -avoid problems caused by autocommands dependent on file extension. - -VCSCommandResultBufferNameFunction *VCSCommandResultBufferNameFunction* - -This variable, if set, specifies a custom function for naming VCS command -output buffers. This function is expected to return the new buffer name, and -will be passed the following arguments: - - command - name of the VCS command being executed (such as 'Log' or - 'Diff'). - - originalBuffer - buffer number of the source file. - - vcsType - type of VCS controlling this file (such as 'CVS' or 'SVN'). - - statusText - extra text associated with the VCS action (such as version - numbers). - -VCSCommandSplit *VCSCommandSplit* - -This variable controls the orientation of the various window splits that -may occur. - -If set to 'horizontal', the resulting windows will be on stacked on top of -one another. If set to 'vertical', the resulting windows will be -side-by-side. If not set, it defaults to 'horizontal' for all but -VCSVimDiff windows. VCSVimDiff windows default to the user's 'diffopt' -setting, if set, otherwise 'vertical'. - -VCSCommandSVKExec *VCSCommandSVKExec* - -This variable controls the executable used for all SVK commands If not set, -it defaults to "svk". - -VCSCommandSVNDiffExt *VCSCommandSVNDiffExt* - -This variable, if set, is passed to SVN via the --diff-cmd command to select -an external application for performing the diff. - -VCSCommandSVNDiffOpt *VCSCommandSVNDiffOpt* - -This variable, if set, determines the options passed with the '-x' parameter -to the SVN diff command. If not set, no options are passed. - -VCSCommandSVNExec *VCSCommandSVNExec* - -This variable controls the executable used for all SVN commands If not set, -it defaults to "svn". - -VCSCommandVCSTypeOverride *VCSCommandVCSTypeOverride* - -This variable allows the VCS type detection to be overridden on a path-by-path -basis. The value of this variable is expected to be a List of Lists. Each -item in the high-level List is a List containing two elements. The first -element is a regular expression that will be matched against the full file -name of a given buffer. If it matches, the second element will be used as the -VCS type. - -5.2 VCSCommand events *vcscommand-events* - -For additional customization, vcscommand can trigger user-defined events. -Event handlers are provided by defining User event autocommands (see -|autocommand|, |User|) in the vcscommand group with patterns matching the -event name. - -For instance, the following could be added to the vimrc to provide a 'q' -mapping to quit a vcscommand scratch buffer: - -augroup VCSCommand - au User VCSBufferCreated silent! nmap q :bwipeout -augroup END - -The following hooks are available: - -VCSBufferCreated This event is fired just after a vcscommand - result buffer is created and populated. It is - executed within the context of the vcscommand - buffer. The vcscommand buffer variables may - be useful for handlers of this event (please - see |vcscommand-buffer-variables|). - -VCSBufferSetup This event is fired just after vcscommand buffer - setup occurs, if enabled. - -VCSPluginInit This event is fired when the vcscommand plugin - first loads. - -VCSPluginFinish This event is fired just after the vcscommand - plugin loads. - -VCSVimDiffFinish This event is fired just after the VCSVimDiff - command executes to allow customization of, - for instance, window placement and focus. - -Additionally, there is another hook which is used internally to handle loading -the multiple scripts in order. This hook should probably not be used by an -end user without a good idea of how it works. Among other things, any events -associated with this hook are cleared after they are executed (during -vcscommand.vim script initialization). - -VCSLoadExtensions This event is fired just before the - VCSPluginFinish. It is used internally to - execute any commands from the VCS - implementation plugins that needs to be - deferred until the primary plugin is - initialized. - -5.3 vcscommand buffer naming *vcscommand-naming* - -vcscommand result buffers use the following naming convention: -[{VCS type} {VCS command} {Source file name}] - -If additional buffers are created that would otherwise conflict, a -distinguishing number is added: - -[{VCS type} {VCS command} {Source file name}] (1,2, etc) - -5.4 vcscommand status line support *vcscommand-statusline* - -It is intended that the user will customize the |'statusline'| option to -include vcscommand result buffer attributes. A sample function that may be -used in the |'statusline'| option is provided by the plugin, -VCSCommandGetStatusLine(). In order to use that function in the status line, do -something like the following: - -set statusline=%<%f\ %{VCSCommandGetStatusLine()}\ %h%m%r%=%l,%c%V\ %P - -of which %{VCSCommandGetStatusLine()} is the relevant portion. - -The sample VCSCommandGetStatusLine() function handles both vcscommand result -buffers and VCS-managed files if vcscommand buffer management is enabled -(please see |vcscommand-buffer-management|). - -5.5 vcscommand buffer management *vcscommand-buffer-management* - -The vcscommand plugin can operate in buffer management mode, which means that -it attempts to set a buffer variable ('VCSCommandBufferInfo') upon entry into -a buffer. This is rather slow because it means that the VCS will be invoked -at each entry into a buffer (during the |BufEnter| autocommand). - -This mode is disabled by default. In order to enable it, set the -|VCSCommandEnableBufferSetup| variable to a true (non-zero) value. Enabling -this mode simply provides the buffer variable mentioned above. The user must -explicitly include information from the variable in the |'statusline'| option -if they are to appear in the status line (but see |vcscommand-statusline| for -a simple way to do that). - -The 'VCSCommandBufferInfo' variable is a list which contains, in order, the -revision of the current file, the latest revision of the file in the -repository, and (for CVS) the name of the branch. If those values cannot be -determined, the list is a single element: 'Unknown'. - -============================================================================== - -6. SSH "integration" *vcscommand-ssh* - -The following instructions are intended for use in integrating the -vcscommand.vim plugin with an SSH-based CVS environment. - -Familiarity with SSH and CVS are assumed. - -These instructions assume that the intent is to have a message box pop up in -order to allow the user to enter a passphrase. If, instead, the user is -comfortable using certificate-based authentication, then only instructions -6.1.1 and 6.1.2 (and optionally 6.1.4) need to be followed; ssh should then -work transparently. - -6.1 Environment settings *vcscommand-ssh-env* - -6.1.1 CVSROOT should be set to something like: - - :ext:user@host:/path_to_repository - -6.1.2 CVS_RSH should be set to: - - ssh - - Together, those settings tell CVS to use ssh as the transport when - performing CVS calls. - -6.1.3 SSH_ASKPASS should be set to the password-dialog program. In my case, - running gnome, it's set to: - - /usr/libexec/openssh/gnome-ssh-askpass - - This tells SSH how to get passwords if no input is available. - -6.1.4 OPTIONAL. You may need to set SSH_SERVER to the location of the cvs - executable on the remote (server) machine. - -6.2 CVS wrapper program *vcscommand-ssh-wrapper* - -Now you need to convince SSH to use the password-dialog program. This means -you need to execute SSH (and therefore CVS) without standard input. The -following script is a simple perl wrapper that dissasociates the CVS command -from the current terminal. Specific steps to do this may vary from system to -system; the following example works for me on linux. - -#!/usr/bin/perl -w -use strict; -use POSIX qw(setsid); -open STDIN, '/dev/null'; -fork and do {wait; exit;}; -setsid; -exec('cvs', @ARGV); - -6.3 Configuring vcscommand.vim *vcscommand-ssh-config* - -At this point, you should be able to use your wrapper script to invoke CVS with -various commands, and get the password dialog. All that's left is to make CVS -use your newly-created wrapper script. - -6.3.1 Tell vcscommand.vim what CVS executable to use. The easiest way to do this - is globally, by putting the following in your .vimrc: - - let VCSCommandCVSExec=/path/to/cvs/wrapper/script - -6.4 Where to go from here *vcscommand-ssh-other* - -The script given above works even when non-SSH CVS connections are used, -except possibly when interactively entering the message for CVS commit log -(depending on the editor you use... VIM works fine). Since the vcscommand.vim -plugin handles that message without a terminal, the wrapper script can be used -all the time. - -This allows mixed-mode operation, where some work is done with SSH-based CVS -repositories, and others with pserver or local access. - -It is possible, though beyond the scope of the plugin, to dynamically set the -CVS executable based on the CVSROOT for the file being edited. The user -events provided (such as VCSBufferCreated and VCSBufferSetup) can be used to -set a buffer-local value (b:VCSCommandCVSExec) to override the CVS executable -on a file-by-file basis. Alternatively, much the same can be done (less -automatically) by the various project-oriented plugins out there. - -It is highly recommended for ease-of-use that certificates with no passphrase -or ssh-agent are employed so that the user is not given the password prompt -too often. - -============================================================================== - -7. Changes from cvscommand *cvscommand-changes* - -1. Require Vim 7 in order to leverage several convenient features; also -because I wanted to play with Vim 7. - -2. Renamed commands to start with 'VCS' instead of 'CVS'. The exceptions are -the 'CVSEdit' and 'CVSWatch' family of commands, which are specific to CVS. - -3. Renamed options, events to start with 'VCSCommand'. - -4. Removed option to jump to the parent version of the current line in an -annotated buffer, as opposed to the version on the current line. This made -little sense in the branching scheme used by subversion, where jumping to a -parent branch required finding a different location in the repository. It -didn't work consistently in CVS anyway. - -5. Removed option to have nameless scratch buffers. - -6. Changed default behavior of scratch buffers to split the window instead of -displaying in the current window. This may still be overridden using the -'VCSCommandEdit' option. - -7. Split plugin into multiple plugins. - -8. Added 'VCSLock' and 'VCSUnlock' commands. These are implemented for -subversion but not for CVS. These were not kept specific to subversion as they -seemed more general in nature and more likely to be supported by any future VCS -supported by this plugin. - -9. Changed name of buffer variables set by commands. - -'b:cvsOrigBuffNR' became 'b:VCSCommandOriginalBuffer' -'b:cvscmd' became 'b:VCSCommandCommand' - -10. Added new automatic variables to command result buffers. - -'b:VCSCommandSourceFile' -'b:VCSCommandVCSType' - -============================================================================== - -8. Known bugs *vcscommand-bugs* - -Please let me know if you run across any. - -CVSUnedit may, if a file is changed from the repository, provide prompt text -to determine whether the changes should be thrown away. Currently, that text -shows up in the CVS result buffer as information; there is no way for the user -to actually respond to the prompt and the CVS unedit command does nothing. If -this really bothers anyone, please let me know. - -VCSVimDiff, when using the original (real) source buffer as one of the diff -buffers, uses some hacks to try to restore the state of the original buffer -when the scratch buffer containing the other version is destroyed. There may -still be bugs in here, depending on many configuration details. - -vim:tw=78:ts=8:ft=help diff --git a/vim/syntax/cvsannotate.vim b/vim/syntax/cvsannotate.vim deleted file mode 100755 index 4af5809f..00000000 --- a/vim/syntax/cvsannotate.vim +++ /dev/null @@ -1,45 +0,0 @@ -" Vim syntax file -" Language: CVS annotate output -" Maintainer: Bob Hiestand -" Remark: Used by the cvscommand plugin. Originally written by Mathieu -" Clabaut -" License: -" Copyright (c) 2007 Bob Hiestand -" -" 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: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" 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. - -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -syn match cvsDate /\d\d-...-\d\d/ contained -syn match cvsName /(\S* /hs=s+1,he=e-1 contained nextgroup=cvsDate -syn match cvsVer /^\d\+\(\.\d\+\)\+/ contained nextgroup=cvsName -syn region cvsHead start="^\d\+\.\d\+" end="):" contains=cvsVer,cvsName,cvsDate - -if !exists("did_cvsannotate_syntax_inits") - let did_cvsannotate_syntax_inits = 1 - hi link cvsDate Comment - hi link cvsName Type - hi link cvsVer Statement -endif - -let b:current_syntax="CVSAnnotate" diff --git a/vim/syntax/gitannotate.vim b/vim/syntax/gitannotate.vim deleted file mode 100755 index 932342dc..00000000 --- a/vim/syntax/gitannotate.vim +++ /dev/null @@ -1,44 +0,0 @@ -" Vim syntax file -" Language: git annotate output -" Maintainer: Bob Hiestand -" Remark: Used by the vcscommand plugin. -" License: -" Copyright (c) 2009 Bob Hiestand -" -" 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: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" 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. - -if exists("b:current_syntax") - finish -endif - -syn region gitName start="(\@<=" end="\( \d\d\d\d-\)\@=" contained -syn match gitCommit /^\^\?\x\+/ contained -syn match gitDate /\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d [+-]\d\d\d\d/ contained -syn match gitLineNumber /\d\+)\@=/ contained -syn region gitAnnotation start="^" end=") " oneline keepend contains=gitCommit,gitLineNumber,gitDate,gitName - -if !exists("did_gitannotate_syntax_inits") - let did_gitannotate_syntax_inits = 1 - hi link gitName Type - hi link gitCommit Statement - hi link gitDate Comment - hi link gitLineNumber Label -endif - -let b:current_syntax="gitAnnotate" diff --git a/vim/syntax/hgannotate.vim b/vim/syntax/hgannotate.vim deleted file mode 100755 index cee9a236..00000000 --- a/vim/syntax/hgannotate.vim +++ /dev/null @@ -1,40 +0,0 @@ -" Vim syntax file -" Language: HG annotate output -" Maintainer: Bob Hiestand -" Remark: Used by the vcscommand plugin. -" License: -" Copyright (c) 2010 Bob Hiestand -" -" 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: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" 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. - -if exists("b:current_syntax") - finish -endif - -syn match hgVer /\d\+/ contained -syn match hgName /^\s*\S\+/ contained -syn match hgHead /^\s*\S\+\s\+\d\+:/ contains=hgVer,hgName - -if !exists("did_hgannotate_syntax_inits") - let did_hgannotate_syntax_inits = 1 - hi link hgName Type - hi link hgVer Statement -endif - -let b:current_syntax="hgAnnotate" diff --git a/vim/syntax/svkannotate.vim b/vim/syntax/svkannotate.vim deleted file mode 100755 index 3c53c3ca..00000000 --- a/vim/syntax/svkannotate.vim +++ /dev/null @@ -1,42 +0,0 @@ -" Vim syntax file -" Language: SVK annotate output -" Maintainer: Bob Hiestand -" Remark: Used by the vcscommand plugin. -" License: -" Copyright (c) 2007 Bob Hiestand -" -" 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: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" 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. - -if exists("b:current_syntax") - finish -endif - -syn match svkDate /\d\{4}-\d\{1,2}-\d\{1,2}/ skipwhite contained -syn match svkName /(\s*\zs\S\+/ contained nextgroup=svkDate skipwhite -syn match svkVer /^\s*\d\+/ contained nextgroup=svkName skipwhite -syn region svkHead start=/^/ end="):" contains=svkVer,svkName,svkDate oneline - -if !exists("did_svkannotate_syntax_inits") - let did_svkannotate_syntax_inits = 1 - hi link svkName Type - hi link svkDate Comment - hi link svkVer Statement -endif - -let b:current_syntax="svkAnnotate" diff --git a/vim/syntax/svnannotate.vim b/vim/syntax/svnannotate.vim deleted file mode 100755 index d46f771e..00000000 --- a/vim/syntax/svnannotate.vim +++ /dev/null @@ -1,40 +0,0 @@ -" Vim syntax file -" Language: SVN annotate output -" Maintainer: Bob Hiestand -" Remark: Used by the vcscommand plugin. -" License: -" Copyright (c) 2007 Bob Hiestand -" -" 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: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" 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. - -if exists("b:current_syntax") - finish -endif - -syn match svnName /\S\+/ contained -syn match svnVer /^\s\+\zs\d\+/ contained nextgroup=svnName skipwhite -syn match svnHead /^\s\+\d\+\s\+\S\+/ contains=svnVer,svnName - -if !exists("did_svnannotate_syntax_inits") - let did_svnannotate_syntax_inits = 1 - hi link svnName Type - hi link svnVer Statement -endif - -let b:current_syntax="svnAnnotate" diff --git a/vim/syntax/vcscommit.vim b/vim/syntax/vcscommit.vim deleted file mode 100755 index 0cd4c5ea..00000000 --- a/vim/syntax/vcscommit.vim +++ /dev/null @@ -1,31 +0,0 @@ -" Vim syntax file -" Language: VCS commit file -" Maintainer: Bob Hiestand (bob.hiestand@gmail.com) -" License: -" Copyright (c) 2007 Bob Hiestand -" -" 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: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" 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. - -if exists("b:current_syntax") - finish -endif - -syntax region vcsComment start="^VCS: " end="$" -highlight link vcsComment Comment -let b:current_syntax = "vcscommit" diff --git a/vim/tmp/ruby_debugger b/vim/tmp/ruby_debugger deleted file mode 100644 index 9a409baf..00000000 --- a/vim/tmp/ruby_debugger +++ /dev/null @@ -1 +0,0 @@ -++vim-ruby-debugger separator++++vim-ruby-debugger separator++ diff --git a/vim/tmp/ruby_debugger_log b/vim/tmp/ruby_debugger_log deleted file mode 100644 index c3db8d3c..00000000 --- a/vim/tmp/ruby_debugger_log +++ /dev/null @@ -1,16 +0,0 @@ -2011/01/25 11:25:22 Toggling window with name: frames -2011/01/25 11:25:22 Opened window with name: frames -2011/01/25 11:25:22 Start displaying data in window with name: frames -2011/01/25 11:25:22 Set focus to window with name: frames -2011/01/25 11:25:22 Inserted data to window with name: frames -2011/01/25 11:25:22 Restored view of window with name: frames -2011/01/25 11:25:22 Complete displaying data in window with name: frames -2011/01/25 11:25:22 Opened frames window -2011/01/25 11:25:28 Toggling window with name: frames -2011/01/25 11:25:28 Opened window with name: frames -2011/01/25 11:25:28 Start displaying data in window with name: frames -2011/01/25 11:25:28 Set focus to window with name: frames -2011/01/25 11:25:28 Inserted data to window with name: frames -2011/01/25 11:25:28 Restored view of window with name: frames -2011/01/25 11:25:28 Complete displaying data in window with name: frames -2011/01/25 11:25:28 Opened frames window diff --git a/vim/tmp/ruby_debugger_output b/vim/tmp/ruby_debugger_output deleted file mode 100644 index 0d864240..00000000 --- a/vim/tmp/ruby_debugger_output +++ /dev/null @@ -1,34 +0,0 @@ -Fast Debugger (ruby-debug-ide 0.4.16, ruby-debug-base 0.10.4) listens on 127.0.0.1:39767 -=> Booting WEBrick -=> Rails 2.3.6 application starting on http://0.0.0.0:3000 -** [NewRelic] NewRelic Agent Developer Mode enabled. -** [NewRelic] To view performance information, go to http://localhost:3000/newrelic -** [NewRelic] New Relic RPM Agent 2.10.1 Initialized: pid = 95408 -** [NewRelic] Agent Log found in /Users/yan/Sites/git-vamp/log/newrelic_agent.log -=> QueryTrace disabled; CTRL-\ to toggle -=> Call with -d to detach -=> Ctrl-C to shutdown server -[2010-12-11 00:51:22] INFO WEBrick 1.3.1 -[2010-12-11 00:51:22] INFO ruby 1.8.7 (2009-06-12) [universal-darwin10.0] -[2010-12-11 00:51:22] WARN TCPServer Error: Address already in use - bind(2) -Exiting - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/utils.rb:73:in `initialize' - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/utils.rb:73:in `new' - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/utils.rb:73:in `create_listeners' - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/utils.rb:70:in `each' - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/utils.rb:70:in `create_listeners' - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:75:in `listen' - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:63:in `initialize' - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize' - /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:10:in `new' - /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:10:in `run' - /Users/yan/Sites/git-vamp/vendor/rails/railties/lib/commands/server.rb:111 - /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' - /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' - /Users/yan/Sites/git-vamp/script/server:3 - /Library/Ruby/Gems/1.8/gems/ruby-debug-ide-0.4.16/lib/ruby-debug-ide.rb:112:in `debug_load' - /Library/Ruby/Gems/1.8/gems/ruby-debug-ide-0.4.16/lib/ruby-debug-ide.rb:112:in `debug_program' - /Library/Ruby/Gems/1.8/gems/ruby-debug-ide-0.4.16/bin/rdebug-ide:87 - /usr/bin/rdebug-ide:19:in `load' - /usr/bin/rdebug-ide:19 -Uncaught exception: Address already in use - bind(2) diff --git a/vimrc b/vimrc index fdae1dcd..36cb546c 100644 --- a/vimrc +++ b/vimrc @@ -135,16 +135,13 @@ if has("gui_running") " http://ethanschoonover.com/solarized/vim-colors-solarized colorscheme solarized - - set background=dark set guitablabel=%M%t set lines=60 set columns=190 - set guifont=Monaco:h17 - set guifont=Inconsolata:h20 " if available, this one is nicer + set guifont=Inconsolata:h20,Monaco:h17 else "dont load csapprox if we no gui support - silences an annoying warning let g:CSApprox_loaded = 1 diff --git a/zsh_aliases b/zsh_aliases index 0278848e..34c1c1f1 100644 --- a/zsh_aliases +++ b/zsh_aliases @@ -14,5 +14,4 @@ alias -g G='| grep' # now you can do: ls foo G something # (f)ind by (n)ame # usage: fn foo # to find all files containing 'foo' in the name -unalias fn function fn() { ls **/*$1* } diff --git a/zshrc b/zshrc index 17c26c91..ba9de9e6 100644 --- a/zshrc +++ b/zshrc @@ -1,8 +1,7 @@ # Configuration -source ~/.dotfiles/bash_aliases +source ~/.dotfiles/aliases source ~/.dotfiles/zsh_aliases -source ~/.dotfiles/bash_path -# + # Things I don't want to publish to github source ~/.secrets @@ -28,3 +27,6 @@ zstyle ':completion:*:approximate:*' max-errors 1 numeric # RVM [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" + +# Add path to our custom bins +export PATH=$PATH:~/.dotfiles/bin