Skip to content
Browse files

Added tmux, vim, and tmux dotfiles.

  • Loading branch information...
1 parent f987365 commit 1f04373dfb3c6da00274a1a18b1d216b94147aaf @tsyd committed Oct 21, 2012
View
23 install.sh
@@ -0,0 +1,23 @@
+p=$(cd "$(dirname "$0")"; pwd)
+
+set -x
+
+mkdir ~/.backup
+
+cp -R ~/.tmux.conf ~/.backup
+cp -R ~/.vim ~/.backup
+cp -R ~/.vimrc ~/.backup
+cp -R ~/.zsh ~/.backup
+cp -R ~/.zshrc ~/.backup
+
+rm -rf ~/.tmux.conf
+rm -rf ~/.vim
+rm -rf ~/.vimrc
+rm -rf ~/.zsh
+rm -rf ~/.zshrc
+
+ln -s $p/tmux.conf ~/.tmux.conf
+ln -s $p/vim ~/.vim
+ln -s $p/vimrc ~/.vimrc
+ln -s $p/zsh ~/.zsh
+ln -s $p/zshrc ~/.zshrc
View
105 tmux.conf
@@ -0,0 +1,105 @@
+# adapted from https://raw.github.com/tony/tmux-config/master/.tmux.conf
+
+# stuff
+# set-option -g display-panes-active-colour colour33 #blue
+# set-option -g display-panes-colour colour166 #orange
+
+# shell
+set-option -g default-shell /bin/zsh
+
+# status bar
+set-option -g status-utf8 on
+
+set -g status-interval 1
+set -g status-justify centre # center align window list
+set -g status-left-length 12
+set -g status-right-length 12
+set -g status-left '#[fg=white,bold]#h#[default]'
+set -g status-right '#[fg=white,bold]%H:%M:%S#[default]'
+
+# default statusbar colors
+set -g status-fg white
+set -g status-bg colour236
+set -g status-attr bright
+
+# message colors
+set -g message-bg colour236
+set -g message-fg white
+set -g status-attr bold
+
+# default window title colors
+set-window-option -g window-status-fg white
+set-window-option -g window-status-bg default
+set-window-option -g window-status-attr dim
+
+# active window title colors
+set-window-option -g window-status-current-fg white
+set-window-option -g window-status-current-bg default
+set-window-option -g window-status-current-attr bright
+
+# C-b is not acceptable -- Vim uses it
+set-option -g prefix C-a
+bind-key C-a last-window
+
+# Start numbering at 1
+set -g base-index 1
+
+# Allows for faster key repetition
+set -s escape-time 0
+
+# Rather than constraining window size to the maximum size of any client
+# connected to the *session*, constrain window size to the maximum size of any
+# client connected to *that window*. Much more reasonable.
+# setw -g aggressive-resize on
+
+# Allows us to use C-a a <command> to send commands to a TMUX session inside
+# another TMUX session
+bind-key a send-prefix
+
+# Activity monitoring
+setw -g monitor-activity on
+set -g visual-activity on
+
+# Highlight active window
+set-window-option -g window-status-current-bg colour81
+set-window-option -g window-status-current-fg black
+
+# Vi copypaste mode
+set-window-option -g mode-keys vi
+bind-key -t vi-copy 'v' begin-selection
+bind-key -t vi-copy 'y' copy-selection
+
+# hjkl pane traversal
+bind h select-pane -L
+bind j select-pane -D
+bind k select-pane -U
+bind l select-pane -R
+
+# resize panes like vim
+bind < resize-pane -L 5
+bind > resize-pane -R 5
+bind & resize-pane -D 5
+bind ^ resize-pane -U 5
+
+# splits
+unbind %
+bind | split-window -h
+bind - split-window -v
+
+set-option -g pane-border-fg colour235
+set-option -g pane-active-border-fg colour81
+
+# reload config
+bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
+
+# auto window rename
+set-window-option -g automatic-rename
+
+# rm mouse mode fail
+# set -g mode-mouse off
+
+# activity
+set -g visual-activity off
+
+# color
+set -g default-terminal "screen-256color"
View
220 vim/colors/molokai.vim
@@ -0,0 +1,220 @@
+" Vim color file
+"
+" Author: Tomas Restrepo <tomas@winterdom.com>
+"
+" Note: Based on the monokai theme for textmate
+" by Wimer Hazenberg and its darker variant
+" by Hamish Stuart Macpherson
+"
+
+hi clear
+
+set background=dark
+if version > 580
+ " no guarantees for version 5.8 and below, but this makes it stop
+ " complaining
+ hi clear
+ if exists("syntax_on")
+ syntax reset
+ endif
+endif
+let g:colors_name="molokai"
+
+if exists("g:molokai_original")
+ let s:molokai_original = g:molokai_original
+else
+ let s:molokai_original = 0
+endif
+
+
+hi Boolean guifg=#AE81FF
+hi Character guifg=#E6DB74
+hi Number guifg=#AE81FF
+hi String guifg=#E6DB74
+hi Conditional guifg=#F92672 gui=bold
+hi Constant guifg=#AE81FF gui=bold
+hi Cursor guifg=#000000 guibg=#F8F8F0
+hi Debug guifg=#BCA3A3 gui=bold
+hi Define guifg=#66D9EF
+hi Delimiter guifg=#8F8F8F
+hi DiffAdd guibg=#13354A
+hi DiffChange guifg=#89807D guibg=#4C4745
+hi DiffDelete guifg=#960050 guibg=#1E0010
+hi DiffText guibg=#4C4745 gui=italic,bold
+
+hi Directory guifg=#A6E22E gui=bold
+hi Error guifg=#960050 guibg=#1E0010
+hi ErrorMsg guifg=#F92672 guibg=#232526 gui=bold
+hi Exception guifg=#A6E22E gui=bold
+hi Float guifg=#AE81FF
+hi FoldColumn guifg=#465457 guibg=#000000
+hi Folded guifg=#465457 guibg=#000000
+hi Function guifg=#A6E22E
+hi Identifier guifg=#FD971F
+hi Ignore guifg=#808080 guibg=bg
+hi IncSearch guifg=#C4BE89 guibg=#000000
+
+hi Keyword guifg=#F92672 gui=bold
+hi Label guifg=#E6DB74 gui=none
+hi Macro guifg=#C4BE89 gui=italic
+hi SpecialKey guifg=#66D9EF gui=italic
+
+hi MatchParen guifg=#000000 guibg=#FD971F gui=bold
+hi ModeMsg guifg=#E6DB74
+hi MoreMsg guifg=#E6DB74
+hi Operator guifg=#F92672
+
+" complete menu
+hi Pmenu guifg=#66D9EF guibg=#000000
+hi PmenuSel guibg=#808080
+hi PmenuSbar guibg=#080808
+hi PmenuThumb guifg=#66D9EF
+
+hi PreCondit guifg=#A6E22E gui=bold
+hi PreProc guifg=#A6E22E
+hi Question guifg=#66D9EF
+hi Repeat guifg=#F92672 gui=bold
+hi Search guifg=#FFFFFF guibg=#455354
+" marks column
+hi SignColumn guifg=#A6E22E guibg=#232526
+hi SpecialChar guifg=#F92672 gui=bold
+hi SpecialComment guifg=#465457 gui=bold
+hi Special guifg=#66D9EF guibg=bg gui=italic
+if has("spell")
+ hi SpellBad guisp=#FF0000 gui=undercurl
+ hi SpellCap guisp=#7070F0 gui=undercurl
+ hi SpellLocal guisp=#70F0F0 gui=undercurl
+ hi SpellRare guisp=#FFFFFF gui=undercurl
+endif
+hi Statement guifg=#F92672 gui=bold
+hi StatusLine guifg=#455354 guibg=fg
+hi StatusLineNC guifg=#808080 guibg=#080808
+hi StorageClass guifg=#FD971F gui=italic
+hi Structure guifg=#66D9EF
+hi Tag guifg=#F92672 gui=italic
+hi Title guifg=#ef5939
+hi Todo guifg=#FFFFFF guibg=bg gui=bold
+
+hi Typedef guifg=#66D9EF
+hi Type guifg=#66D9EF gui=none
+hi Underlined guifg=#808080 gui=underline
+
+hi VertSplit guifg=#808080 guibg=#080808 gui=bold
+hi VisualNOS guibg=#403D3D
+hi Visual guibg=#403D3D
+hi WarningMsg guifg=#FFFFFF guibg=#333333 gui=bold
+hi WildMenu guifg=#66D9EF guibg=#000000
+
+if s:molokai_original == 1
+ hi Normal guifg=#F8F8F2 guibg=#272822
+ hi Comment guifg=#75715E
+ hi CursorLine guibg=#3E3D32
+ hi CursorColumn guibg=#3E3D32
+ hi ColorColumn guibg=#3B3A32
+ hi LineNr guifg=#BCBCBC guibg=#3B3A32
+ hi NonText guifg=#75715E
+ hi SpecialKey guifg=#75715E
+else
+ hi Normal guifg=#F8F8F2 guibg=#1B1D1E
+ hi Comment guifg=#465457
+ hi CursorLine guibg=#293739
+ hi CursorColumn guibg=#293739
+ hi ColorColumn guibg=#232526
+ hi LineNr guifg=#465457 guibg=#232526
+ hi NonText guifg=#465457
+ hi SpecialKey guifg=#465457
+end
+
+"
+" Support for 256-color terminal
+"
+if &t_Co > 255
+ if s:molokai_original == 1
+ hi Normal ctermbg=234
+ hi CursorLine ctermbg=235 cterm=none
+ else
+ hi Normal ctermfg=252 ctermbg=233
+ hi CursorLine ctermbg=234 cterm=none
+ endif
+ hi Boolean ctermfg=135
+ hi Character ctermfg=144
+ hi Number ctermfg=135
+ hi String ctermfg=144
+ hi Conditional ctermfg=161 cterm=bold
+ hi Constant ctermfg=135 cterm=bold
+ hi Cursor ctermfg=16 ctermbg=253
+ hi Debug ctermfg=225 cterm=bold
+ hi Define ctermfg=81
+ hi Delimiter ctermfg=241
+
+ hi DiffAdd ctermbg=24
+ hi DiffChange ctermfg=181 ctermbg=239
+ hi DiffDelete ctermfg=162 ctermbg=53
+ hi DiffText ctermbg=102 cterm=bold
+
+ hi Directory ctermfg=118 cterm=bold
+ hi Error ctermfg=219 ctermbg=89
+ hi ErrorMsg ctermfg=199 ctermbg=16 cterm=bold
+ hi Exception ctermfg=118 cterm=bold
+ hi Float ctermfg=135
+ hi FoldColumn ctermfg=67 ctermbg=16
+ hi Folded ctermfg=67 ctermbg=16
+ hi Function ctermfg=118
+ hi Identifier ctermfg=208 cterm=none
+ hi Ignore ctermfg=244 ctermbg=232
+ hi IncSearch ctermfg=193 ctermbg=16
+
+ hi Keyword ctermfg=161 cterm=bold
+ hi Label ctermfg=229 cterm=none
+ hi Macro ctermfg=193
+ hi SpecialKey ctermfg=81
+
+ hi MatchParen ctermfg=16 ctermbg=208 cterm=bold
+ hi ModeMsg ctermfg=229
+ hi MoreMsg ctermfg=229
+ hi Operator ctermfg=161
+
+ " complete menu
+ hi Pmenu ctermfg=81 ctermbg=16
+ hi PmenuSel ctermbg=244
+ hi PmenuSbar ctermbg=232
+ hi PmenuThumb ctermfg=81
+
+ hi PreCondit ctermfg=118 cterm=bold
+ hi PreProc ctermfg=118
+ hi Question ctermfg=81
+ hi Repeat ctermfg=161 cterm=bold
+ hi Search ctermfg=253 ctermbg=66
+
+ " marks column
+ hi SignColumn ctermfg=118 ctermbg=235
+ hi SpecialChar ctermfg=161 cterm=bold
+ hi SpecialComment ctermfg=245 cterm=bold
+ hi Special ctermfg=81 ctermbg=232
+
+ hi Statement ctermfg=161 cterm=bold
+ hi StatusLine ctermfg=238 ctermbg=253
+ hi StatusLineNC ctermfg=244 ctermbg=232
+ hi StorageClass ctermfg=208
+ hi Structure ctermfg=81
+ hi Tag ctermfg=161
+ hi Title ctermfg=166
+ hi Todo ctermfg=231 ctermbg=232 cterm=bold
+
+ hi Typedef ctermfg=81
+ hi Type ctermfg=81 cterm=none
+ hi Underlined ctermfg=244 cterm=underline
+
+ hi VertSplit ctermfg=244 ctermbg=232 cterm=bold
+ hi VisualNOS ctermbg=238
+ hi Visual ctermbg=235
+ hi WarningMsg ctermfg=231 ctermbg=238 cterm=bold
+ hi WildMenu ctermfg=81 ctermbg=16
+
+ hi Comment ctermfg=59
+ hi CursorColumn ctermbg=234
+ hi ColorColumn ctermbg=234
+ hi LineNr ctermfg=59 ctermbg=none
+ hi NonText ctermfg=59
+ hi SpecialKey ctermfg=59
+end
View
294 vim/indent/python.vim
@@ -0,0 +1,294 @@
+"=============================================================================
+"
+" FileName: python.vim
+" Desc: 修改了缩进的bug
+"
+" Author: dantezhu - http://www.vimer.cn
+" Email: zny2008@gmail.com
+"
+" Created: 2011-02-21 23:55:50
+" Version: 0.0.9
+" History:
+" 0.0.9 | dantezhu | 2011-03-15 10:15:05 | 注释和string不缩进
+" 0.0.8 | dantezhu | 2011-03-10 18:41:15 | 之前修正的有点问题
+" 0.0.7 | dantezhu | 2011-03-10 11:06:01 | 向cindent看齐,函数名
+" | 太短则和匹配的地方对齐
+" 0.0.6 | dantezhu | 2011-02-26 23:45:18 | 只约束是字母太弱了,
+" | 还有数字和下划线
+" 0.0.5 | dantezhu | 2011-02-26 23:28:16 | 修正对调用函数时,多
+" | 行参数的)的缩进
+" 0.0.4 | dantezhu | 2011-02-24 19:32:14 | 之前的fix有问题,重写
+" 0.0.3 | dantezhu | 2011-02-22 14:53:40 | 修正了Comment或者
+" | String中存在:时就会缩
+" | 进的问题
+" 0.0.2 | dantezhu | 2011-02-22 01:15:53 | 增加了对class,if,elif
+" | 等的兼容
+" 0.0.1 | dantezhu | 2011-02-21 23:55:50 | initialization
+"
+"=============================================================================
+
+" Python indent file
+" Language: Python
+" Maintainer: Eric Mc Sween <em@tomcom.de>
+" Original Author: David Bustos <bustos@caltech.edu>
+" Last Change: 2004 Jun 07
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal expandtab
+setlocal nolisp
+setlocal autoindent
+setlocal indentexpr=GetPythonIndent(v:lnum)
+setlocal indentkeys=!^F,o,O,<:>,0),0],0},=elif,=except
+
+let s:maxoff = 50
+
+" Find backwards the closest open parenthesis/bracket/brace.
+function! s:SearchParensPair()
+ let line = line('.')
+ let col = col('.')
+
+ " Skip strings and comments and don't look too far
+ let skip = "line('.') < " . (line - s:maxoff) . " ? dummy :" .
+ \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? ' .
+ \ '"string\\|comment"'
+
+ " Search for parentheses
+ call cursor(line, col)
+ let parlnum = searchpair('(', '', ')', 'bW', skip)
+ let parcol = col('.')
+
+ " Search for brackets
+ call cursor(line, col)
+ let par2lnum = searchpair('\[', '', '\]', 'bW', skip)
+ let par2col = col('.')
+
+ " Search for braces
+ call cursor(line, col)
+ let par3lnum = searchpair('{', '', '}', 'bW', skip)
+ let par3col = col('.')
+
+ " Get the closest match
+ if par2lnum > parlnum || (par2lnum == parlnum && par2col > parcol)
+ let parlnum = par2lnum
+ let parcol = par2col
+ endif
+ if par3lnum > parlnum || (par3lnum == parlnum && par3col > parcol)
+ let parlnum = par3lnum
+ let parcol = par3col
+ endif
+
+ " Put the cursor on the match
+ if parlnum > 0
+ call cursor(parlnum, parcol)
+ endif
+ return parlnum
+endfunction
+
+" Find the start of a multi-line statement
+function! s:StatementStart(lnum)
+ let lnum = a:lnum
+ while 1
+ if getline(lnum - 1) =~ '\\$'
+ let lnum = lnum - 1
+ else
+ call cursor(lnum, 1)
+ let maybe_lnum = s:SearchParensPair()
+ if maybe_lnum < 1
+ return lnum
+ else
+ let lnum = maybe_lnum
+ endif
+ endif
+ endwhile
+endfunction
+
+" Find the block starter that matches the current line
+function! s:BlockStarter(lnum, block_start_re)
+ let lnum = a:lnum
+ let maxindent = 10000 " whatever
+ while lnum > 1
+ let lnum = prevnonblank(lnum - 1)
+ if indent(lnum) < maxindent
+ if getline(lnum) =~ a:block_start_re
+ return lnum
+ else
+ let maxindent = indent(lnum)
+ " It's not worth going further if we reached the top level
+ if maxindent == 0
+ return -1
+ endif
+ endif
+ endif
+ endwhile
+ return -1
+endfunction
+
+function! GetPythonIndent(lnum)
+
+ " First line has indent 0
+ if a:lnum == 1
+ return 0
+ endif
+
+"Add-Begin by dantezhu in 2011-03-15 10:14:01
+"修正注释和字符串缩进的问题
+ " If the start of the line is in a string don't change the indent.
+ if has('syntax_items')
+ \ && synIDattr(synID(a:lnum, col('.')-1, 1), 'name') =~ '\(Comment\|String\)$'
+ return -1
+ endif
+"Add-End
+
+ " If we can find an open parenthesis/bracket/brace, line up with it.
+ call cursor(a:lnum, 1)
+ let parlnum = s:SearchParensPair()
+ if parlnum > 0
+ let parcol = col('.')
+ let closing_paren = match(getline(a:lnum), '^\s*[])}]') != -1
+ if match(getline(parlnum), '[([{]\s*$', parcol - 1) != -1
+ if closing_paren
+ "Mod-Begin by dantezhu in 2011-02-21 23:38:24
+ "FROM
+ "return indent(parlnum)
+ "TO
+ "为了支持如下的格式:
+ "def fun(
+ " a,
+ " b
+ " ):
+ " print a,b
+ "又不影响如下格式:
+ "val = {
+ " (
+ " 1,
+ " 2
+ " ):1
+ "}
+
+ "Add-Begin by dantezhu in 2011-02-26 23:23:08
+ "增加了对
+ "x = user.getdata1_(
+ " a,
+ " b,
+ " c
+ " )
+ "的支持
+ if match(getline(parlnum), '\(\a\|\d\|_\)\s*(\s*$', 0) != -1
+ "增加了对
+ "x(
+ " 1,
+ " 2,
+ " 3
+ " )
+ "user.login(
+ " 1,
+ " 2,
+ " 3
+ " )
+ " 的支持
+ if (parcol -1 - indent(parlnum)) < 4
+ return parcol - 1
+ else
+ return indent(parlnum) + &sw
+ endif
+ endif
+ "Add-End
+ if match(getline(a:lnum), ')\s*:') != -1 &&
+ \ match(getline(parlnum), '\(def\|class\|if\|elif\|while\)\(\s\+\|(\)') != -1
+ return indent(parlnum) + &sw
+ else
+ return indent(parlnum)
+ endif
+ "Mod-End
+ else
+ return indent(parlnum) + &sw
+ endif
+ else
+ if closing_paren
+ return parcol - 1
+ else
+ return parcol
+ endif
+ endif
+ endif
+
+ " Examine this line
+ let thisline = getline(a:lnum)
+ let thisindent = indent(a:lnum)
+
+ " If the line starts with 'elif' or 'else', line up with 'if' or 'elif'
+ if thisline =~ '^\s*\(elif\|else\)\>'
+ let bslnum = s:BlockStarter(a:lnum, '^\s*\(if\|elif\)\>')
+ if bslnum > 0
+ return indent(bslnum)
+ else
+ return -1
+ endif
+ endif
+
+ " If the line starts with 'except' or 'finally', line up with 'try'
+ " or 'except'
+ if thisline =~ '^\s*\(except\|finally\)\>'
+ let bslnum = s:BlockStarter(a:lnum, '^\s*\(try\|except\)\>')
+ if bslnum > 0
+ return indent(bslnum)
+ else
+ return -1
+ endif
+ endif
+
+ " Examine previous line
+ let plnum = a:lnum - 1
+ let pline = getline(plnum)
+ let sslnum = s:StatementStart(plnum)
+
+ " If the previous line is blank, keep the same indentation
+ if pline =~ '^\s*$'
+ return -1
+ endif
+
+ " If this line is explicitly joined, try to find an indentation that looks
+ " good.
+ if pline =~ '\\$'
+ let compound_statement = '^\s*\(if\|while\|for\s.*\sin\|except\)\s*'
+ let maybe_indent = matchend(getline(sslnum), compound_statement)
+ if maybe_indent != -1
+ return maybe_indent
+ else
+ return indent(sslnum) + &sw * 2
+ endif
+ endif
+
+ " If the previous line ended with a colon, indent relative to
+ " statement start.
+ if pline =~ ':\s*$'
+ "Mod-Begin by dantezhu in 2011-02-24 19:30:52
+ "FROM
+ "return indent(sslnum) + &sw
+ "TO
+ let t_col = match(pline,':\s*$')+1
+ if synIDattr(synID(a:lnum-1, t_col, 1), 'name') !~ '\(Comment\|String\)$'
+ return indent(sslnum) + &sw
+ endif
+ "Mod-End
+ endif
+
+ " If the previous line was a stop-execution statement or a pass
+ if getline(sslnum) =~ '^\s*\(break\|continue\|raise\|return\|pass\)\>'
+ " See if the user has already dedented
+ if indent(a:lnum) > indent(sslnum) - &sw
+ " If not, recommend one dedent
+ return indent(sslnum) - &sw
+ endif
+ " Otherwise, trust the user
+ return -1
+ endif
+
+ " In all other cases, line up with the start of the previous statement.
+ return indent(sslnum)
+ endfunction
View
16 vimrc
@@ -0,0 +1,16 @@
+" custom
+colorscheme molokai
+syntax on
+set expandtab
+set tabstop=4
+set history=1000
+set nu
+set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
+set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
+filetype on
+filetype plugin on
+set hlsearch
+set incsearch
+set ignorecase
+set laststatus=0
+set ruler
View
187 zsh/completions/_ack
@@ -0,0 +1,187 @@
+#compdef ack ack-grep
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for ack 1.94 (http://betterthangrep.com).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+
+
+_ack() {
+ local context curcontext="$curcontext" state line cmds update_policy ret=1
+ integer NORMARG
+ typeset -A opt_args
+
+ zstyle -s ":completion:${curcontext}:" cache-policy update_policy
+ [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _ack_types_caching_policy
+
+ unset _ack_raw_types
+ if ( [[ ${+_ack_raw_types} -eq 0 ]] || _cache_invalid "ack-grep" ) && ! _retrieve_cache "ack-grep"; then
+ _ack_raw_types=(${(S)${(f)${${"$(_call_program types $words[1] --help=types)"}#*--\[no\]}}#*no\]})
+ [[ $#_ack_raw_types -gt 0 ]] && _store_cache "ack-grep" _ack_raw_types
+ fi
+
+ _arguments -C -s -S -n \
+ '(- 1 *)--version[display version and copyright information]' \
+ '(- 1 *)--help[print a short help statement]' \
+ '(- 1 *)--man[print the manual page]' \
+ '(-a --all -u --unrestricted)'{-a,--all}'[operate on all files, regardless of type (but still skip directories like blib, CVS, etc.)]' \
+ '(-A --after-context -C --context)'{-A+,--after-context=}'[print N lines of trailing context after matching lines]:number' \
+ '(-B --before-context -C --context)'{-B+,--before-context=}'[print N lines of leading context before matching lines]:number' \
+ '(-C --context -A --after-context -B --before-context)'{-C-,--context=}'[print N lines (default 2) of context around matching lines]:number' \
+ '(-c --count)'{-c,--count}'[suppress normal output; instead print a count of matching lines for each input file]' \
+ '(--nocolor)--color[highlight the matching text]' \
+ '(--color --color-filename --color-match --color-lineno)--nocolor[supress the color]' \
+ '(--nocolor --color)--color-filename[sets the color to be used for filenames]:color:->colors' \
+ '(--nocolor --color)--color-match[sets the color to be used for matches]:color:->colors' \
+ '(--nocolor --color)--color-lineno[sets the color to be used for line numbers]:color:->colors' \
+ '--column[show the column number of the first match]' \
+ '(--noenv)--env[enable environment processing]' \
+ '(--env)--noenv[disable all environment processing, no .ackrc is read and all environment variables are ignored]' \
+ '--flush[flush output immediately]' \
+ '-f[only print the files that would be searched, without actually doing any searching]' \
+ '(--nofollow)--follow[follow symlinks]' \
+ '(--follow)--nofollow[don'\''t follow symlinks]' \
+ '-G+[only paths matching the given regex are included in the search]:regex' \
+ '-g+[print files where the relative path + filename matches the given regex]:regex' \
+ '(--nogroup)--group[group matches by file name]' \
+ '(--group)--nogroup[do not group matches by file name]' \
+ '(-H --with-filename -h --no-filename)'{-H,--with-filename}'[print the filename for each match]' \
+ '(-h --no-filename -H --with-filename)'{-h,--no-filename}'[suppress the prefixing of filenames on output when multiple files are searched]' \
+ '(-i --ignore-case)'{-i,--ignore-case}'[ignore case in the search strings]' \
+ '*--ignore-dir[ignore directory]:directory:_files -/' \
+ '*--noignore-dir[don'\''t ignore directory]:directory:_files -/' \
+ '--invert-file-match[print/search handle files that do not match -g/-G]' \
+ '--line=[only print given line of each file]:number' \
+ '(-l --files-with-matches -L --files-without-matches)'{-l,--files-with-matches}'[only print the filenames of matching files, instead of the matching text]' \
+ '(-L --files-without-matches -l --files-with-matches)'{-L,--files-without-matches}'[only print the filenames of files that do NOT match]' \
+ '--match=[specify the regular expression explicitly]:regex' \
+ '(-m --max-count)'{-m+,--max-count=}'[stop reading a file after N matches]:number' \
+ '(-r -R --recurse -n --no-recurse)'{-r,-R,--recurse}'[recurse into sub-directories]' \
+ '(-n --no-recurse -r -R --recurse)'{-n,--no-recurse}'[no descending into subdirectories]' \
+ '-o[show only the part of each line matching PATTERN (turns off text highlighting)]:pattern' \
+ '--output=[output the evaluation of expr for each line (turns off text highlighting)]:expression' \
+ '--pager=[direct ack'\''s output through program]:pager program:_command_names' \
+ '--passthru[prints all lines, whether or not they match the expression]' \
+ '--print0[the filenames are output separated with a null byte instead of the usual newline]' \
+ '(-Q --literal)'{-Q,--literal}'[quote all metacharacters in the pattern, it is treated as a literal]' \
+ '(--no-smart-case)--smart-case[ignore case in the search strings if pattern contains no uppercase characters]' \
+ '(--smart-case)--no-smart-case[disable --smart-case option]' \
+ '--sort-files[sorts the found files lexically]' \
+ '--show-types[outputs the filetypes that ack associates with each file]' \
+ '--thpppt[display the all-important Bill The Cat logo]' \
+ '*--type=[specify the types of files to include or exclude from a search]:type:->types' \
+ '*--type-add[files with the given extensions are recognized as being of the given type]:type-def:->type-defs' \
+ '*--type-set[files with the given extensions are recognized as being of the given type]:type-def:->type-defs' \
+ '(-u --unrestricted -a --all)'{-u,--unrestricted}'[all files and directories (including blib/, core.*, ...) are searched, nothing is skipped]' \
+ '(-v --invert-match)'{-v,--invert-match}'[invert match: select non-matching lines]' \
+ '(-w --word-regexp)'{-w,--word-regexp}'[force the given pattern to match only whole words]' \
+ '-1[stops after reporting first match of any kind]' \
+ {'--','--no'}${_ack_raw_types/ ##/\[}']' \
+ '*: :->args' \
+ && ret=0
+
+ case $state in
+ args)
+ if [[ CURRENT -eq NORMARG && ${+opt_args[--match]} -eq 0 ]]
+ then
+ # If the current argument is the first non-option argument
+ # and --match isn't present then a pattern is expected
+ _message -e patterns 'pattern' && ret=0
+ else
+ _files
+ fi
+ ;;
+ colors)
+ local colors; colors=(
+ 'black' 'on_black'
+ 'red' 'on_red'
+ 'green' 'on_green'
+ 'yellow' 'on_yellow'
+ 'blue' 'on_blue'
+ 'magenta' 'on_magenta'
+ 'cyan' 'on_cyan'
+ 'white' 'on_white'
+ 'clear'
+ 'reset'
+ 'dark'
+ 'bold'
+ 'underline'
+ 'underscore'
+ 'blink'
+ 'reverse'
+ 'concealed'
+ )
+ _describe -t 'colors' 'color' colors && ret=0
+ ;;
+ type-defs)
+ if compset -P '*='; then
+ local extensions; extensions=(*.*(:e))
+ _values -s ',' 'file extension' '.'$extensions && ret=0
+ else
+ _message -e type-name 'type name' && ret=0
+ fi
+ ;;
+ types)
+ local types; types=({'','no'}${_ack_raw_types/ ##/:})
+ _describe -t 'types' 'type' types
+ ;;
+ esac
+
+ return ret
+}
+
+_ack_types_caching_policy() {
+
+ # Rebuild if ackrc more recent than cache.
+ [[ -f $HOME/.ackrc && $$HOME/.ackrc -nt "$1" ]] && return 0
+
+ # Rebuild if cache is older than one week.
+ local -a oldp
+ oldp=( "$1"(Nmw+1) )
+ (( $#oldp )) && return 0
+
+ return 1
+}
+
+_ack "$@"
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
417 zsh/completions/_adb
@@ -0,0 +1,417 @@
+#compdef adb
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for adb (Android Debug Bridge) 1.0.26
+# (http://developer.android.com/guide/developing/tools/adb.html).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+#
+# ------------------------------------------------------------------------------
+
+
+_adb() {
+ typeset -A opt_args
+ local context state line curcontext="$curcontext" adb_args
+
+ local ret=1
+
+ _arguments -C \
+ '(-e -s)-d[directs command to the only connected USB device, returns an error if more than one USB device is present]' \
+ '(-d -s)-e[directs command to the only running emulator, returns an error if more than one emulator is running]' \
+ '(-d -e)-s[directs command to the USB device or emulator with the given serial number]: :_adb_serial_numbers' \
+ '-p[simple product name or a relative/absolute path to a product out directory]: :_adb_products' \
+ '1: :_adb_cmds' \
+ '*::arg:->args' \
+ && ret=0
+
+ adb_args="${(fkv)opt_args[(I)-d|-e|-s|-p]}"
+
+ case "$state" in
+ (args)
+ curcontext="${curcontext%:*:*}:adb-cmd-$words[1]:"
+ case $words[1] in
+ (help|version|devices|jdwp|bugreport|wait-for-device|start-server|kill-server|get-state|get-serialno|status-window|remount|reboot-bootloader|root|usb)
+ _message 'no more arguments' && ret=0
+ ;;
+ (connect|disconnect)
+ _arguments \
+ '1: :_adb_host_colon_ports' \
+ && ret=0
+ ;;
+ (push)
+ _arguments \
+ '1:local directory:_files -/' \
+ '2: :_adb_remote_files -/' \
+ && ret=0
+ ;;
+ (pull)
+ _arguments \
+ '1: :_adb_remote_files -/' \
+ '2:local directory:_files -/' \
+ && ret=0
+ ;;
+ (sync)
+ _arguments \
+ '-l[list but do not copy]' \
+ '1: :_adb_sync_directories' \
+ && ret=0
+ ;;
+ (shell|emu)
+ _arguments -C \
+ '1: :_adb_remote_commands' \
+ '*::remote-command-arg:->remote-command-args' \
+ && ret=0
+ case "$state" in
+ (remote-command-args)
+ curcontext="${curcontext%:*:*}:adb-remote-cmd-$words[1]:"
+ if (( $+functions[_adb_remote_command_$words[1]_args] )); then
+ _adb_remote_command_$words[1] && ret=0
+ # TODO Write handlers for following commands:
+ # * am (Activity Manager)
+ # * pm (Package Manager)
+ # TODO Reuse existing compdefs for standard commands (ls, id, ifconfig, kill, etc) ?
+ # How do we tell them to use _remote_ files/pids/users/etc ?
+ else
+ _adb_remote_command_default && ret=0
+ fi
+ ;;
+ esac
+ ;;
+ (logcat)
+ local -a rotation_opts
+ [[ -n ${(M)words:#"-f"} ]] && rotation_opts+=('-r[rotates the log file every kbytes of output. The default value is 16]:value (in kb)')
+ [[ -n ${(M)words:#"-r"} ]] && rotation_opts+=('-n[sets the maximum number of rotated logs. The default value is 4]:count')
+ _arguments \
+ '-b[loads an alternate log buffer for viewing, such as event or radio. The main buffer is used by default]: :_adb_logcat_buffers' \
+ '-c[clears (flushes) the entire log and exits]' \
+ '-d[dumps the log to the screen and exits]' \
+ '-f[writes log message output to file. The default is stdout]: :_files' \
+ '-g[prints the size of the specified log buffer and exits]' \
+ '-s[sets the default filter spec to silent]' \
+ '-v[sets the output format for log messages]: :_adb_logcat_output_formats' \
+ "${rotation_opts[@]}" \
+ '*: :_adb_logcat_filter_specs' \
+ && ret=0
+ ;;
+ (forward)
+ _arguments \
+ '1: :_adb_local_forward_specs' \
+ '2: :_adb_remote_forward_specs' \
+ && ret=0
+ ;;
+ (install)
+ _arguments \
+ '-l[forward-lock the app]' \
+ '-r[reinstall the app, keeping its data]' \
+ '-s[install on SD card instead of internal storage]' \
+ '1: :_files' \
+ && ret=0
+ ;;
+ (uninstall)
+ _arguments \
+ '-k[keep the data and cache directories]' \
+ '1: :_adb_packages' \
+ && ret=0
+ ;;
+ (reboot)
+ _arguments \
+ '1:program:((bootloader:reboot\ into\ the\ bootloader\ program recovery:reboot\ into\ the\ recovery\ program))' \
+ && ret=0
+ ;;
+ (tcpip)
+ _arguments \
+ '1::port' \
+ && ret=0
+ ;;
+ (ppp)
+ # TODO Complete tty (See http://developer.android.com/guide/developing/tools/adb.html#commandsummary)
+ # TODO Complete PPP parameters (See http://ppp.samba.org/pppd.html)
+ _arguments \
+ '1::tty' \
+ '*::parameters' \
+ && ret=0
+ ;;
+ esac
+ ;;
+ esac
+
+ return ret
+}
+
+(( $+functions[_adb_cmds] )) ||
+_adb_cmds() {
+ _alternative \
+ 'general-commands:general command:_adb_general_cmds' \
+ 'device-commands:device command:_adb_device_cmds' \
+ 'scripting-commands:scripting command:_adb_scripting_cmds'
+}
+
+(( $+functions[_adb_general_cmds] )) ||
+_adb_general_cmds() {
+ local commands; commands=(
+ 'help:show help message'
+ 'version:show version number'
+ 'devices:list all connected devices'
+ 'connect:connect to a device via TCP/IP'
+ 'disconnect:disconnect from a TCP/IP device'
+ )
+ _describe -t general-commands 'general command' commands "$@"
+}
+
+(( $+functions[_adb_device_cmds] )) ||
+_adb_device_cmds() {
+ local commands; commands=(
+ 'push:copy file/dir to device'
+ 'pull:copy file/dir from device'
+ 'sync:copy host->device only if changed'
+ 'shell:run remote shell interactively or command'
+ 'emu:run emulator console command'
+ 'logcat:view device log'
+ 'forward:forward socket connections'
+ 'jdwp:list PIDs of processes hosting a JDWP transport'
+ 'install:push this padbage file to the device and install it'
+ 'uninstall:remove this app padbage from the device'
+ 'bugreport:return all information from the device'
+ )
+ _describe -t device-commands 'device command' commands "$@"
+}
+
+(( $+functions[_adb_scripting_cmds] )) ||
+_adb_scripting_cmds() {
+ local commands; commands=(
+ 'wait-for-device:block until device is online'
+ 'start-server:ensure that there is a server running'
+ 'kill-server:kill the server if it is running'
+ 'get-state:prints\: offline | bootloader | device'
+ 'get-serialno:prints\: <serial-number>'
+ 'status-window:continuously print device status for a specified device'
+ 'remount:remounts the /system partition on the device read-write'
+ 'reboot:reboots the device, optionally into the bootloader or recovery program'
+ 'reboot-bootloader:reboots the device into the bootloader'
+ 'root:restarts the adbd daemon with root permissions'
+ 'usb:restarts the adbd daemon listening on USB'
+ 'tcpip:restarts the adbd daemon listening on TCP on the specified port'
+ 'ppp:run PPP over USB'
+ )
+ _describe -t scripting-commands 'scripting command' commands "$@"
+}
+
+(( $+functions[_adb_products] )) ||
+_adb_products() {
+ _alternative \
+ 'product-names:product name:_adb_product_names' \
+ 'directories:directory:_files -/'
+}
+
+(( $+functions[_adb_product_names] )) ||
+_adb_product_names() {
+ local ret=1
+ if [[ -n "$ANDROID_PRODUCT_OUT" ]]; then
+ local product_names; product_names=("$ANDROID_PRODUCT_OUT:default value set in ANDROID_PRODUCT_OUT environment variable")
+ _describe -t product-names 'product name' product_names && ret=0
+ else
+ _message -e product-names 'product name' && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_adb_serial_numbers] )) ||
+_adb_serial_numbers() {
+ local serial_numbers; serial_numbers=(${${(M)${(f)"$(_call_program devices $service devices)"}:#*device}%%[[:space:]]*}":connected device")
+ [[ -n "$ANDROID_SERIAL" ]] && serial_numbers+=("$ANDROID_SERIAL:default value set in ANDROID_SERIAL environment variable")
+ _describe -t serial-numbers 'serial number' serial_numbers "$@" && ret=0
+}
+
+(( $+functions[_adb_packages] )) ||
+_adb_packages() {
+ local packages; packages=(${${(ps:\r\n:)"$(_call_program packages $service $adb_args shell 'ls /data/data 2>/dev/null')"}:#\**\*})
+ _multi_parts . packages
+}
+
+(( $+functions[_adb_host_colon_ports] )) ||
+_adb_host_colon_ports() {
+ local ret=1
+ if compset -P '*:'; then
+ _message -e ports 'port' && ret=0
+ else
+ _wanted hosts expl 'host' _hosts -qS: && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_adb_remote_files] )) ||
+_adb_remote_files() {
+ local dirsonly command="ls -d ${(S)words[CURRENT]/\/*//}*/ 2>/dev/null"
+ zparseopts -D -E '/=dirsonly'
+ (( ! $#dirsonly )) && command+="; ls -d ${words[CURRENT]}* 2>/dev/null"
+ local files; files=(${${(ps:\r\n:)"$(_call_program files $service $adb_args shell "'$command'" 2>/dev/null)"}:#\**\*})
+ _multi_parts "$@" / files
+}
+
+(( $+functions[_adb_remote_commands] )) ||
+_adb_remote_commands() {
+ local commands; commands=(${${(ps:\r\n:)"$(_call_program commands $service $adb_args shell "'IFS=:;for path_dir in \$PATH; do ls \$path_dir 2>/dev/null; done'" 2>/dev/null)"}:#\**\*})
+ _describe -t remote-commands 'remote command' commands && ret=0
+}
+
+(( $+functions[_adb_local_forward_specs] )) ||
+_adb_local_forward_specs() {
+ local ret=1
+ if compset -P '*:'; then
+ case ${IPREFIX%:} in
+ (tcp)
+ _message -e ports 'port' && ret=0
+ ;;
+ (localabstract|localreserved)
+ _wanted sockets expl 'socket' _socket && ret=0
+ ;;
+ (localfilesystem)
+ _wanted socket-files expl 'socket file' _files && ret=0
+ ;;
+ (dev)
+ _wanted devices expl 'device' _files -g "/dev/**" && ret=0
+ ;;
+ esac
+ else
+ local modes; modes=(
+ 'tcp:TCP socket'
+ 'localabstract:local abstract socket'
+ 'localreserved:local reserved socket'
+ 'localfilesystem:local filesystem socket'
+ 'dev:device'
+ )
+ _describe -t forward-modes 'forward mode' modes -qS: && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_adb_remote_forward_specs] )) ||
+_adb_remote_forward_specs() {
+ local ret=1
+ if compset -P '*:'; then
+ case ${IPREFIX%:} in
+ (tcp)
+ _message -e ports 'remote port' && ret=0
+ ;;
+ (localabstract|localreserved|localfilesystem)
+ _message -e sockets 'remote socket' && ret=0
+ ;;
+ (dev)
+ _message -e devices 'remote device' && ret=0
+ ;;
+ (jdwp)
+ local pids; pids=(${${(f)"$(_call_program pids $service $adb_args jdwp 2>/dev/null)"}:#\**\*})
+ _describe -t remote-pids 'remote pid' pids && ret=0
+ ;;
+ esac
+ else
+ local modes; modes=(
+ 'tcp:TCP socket'
+ 'localabstract:local abstract socket'
+ 'localreserved:local reserved socket'
+ 'localfilesystem:local filesystem socket'
+ 'dev:device'
+ 'jdwp:Java Debug Wire Protocol'
+ )
+ _describe -t forward-modes 'forward mode' modes -qS: && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_adb_sync_directories] )) ||
+_adb_sync_directories() {
+ _alternative \
+ 'partitions:partition:((system:the\ /system\ partition data:the\ /data\ partition))' \
+ 'directories:directory:_adb_remote_files -/'
+}
+
+(( $+functions[_adb_logcat_filter_specs] )) ||
+_adb_logcat_filter_specs() {
+ local ret=1
+ if compset -P '*:'; then
+ local priorities; priorities=(
+ 'V:verbose (lowest priority)'
+ 'D:debug'
+ 'I:info'
+ 'W:warning'
+ 'E:error'
+ 'F:fatal'
+ 'S:silent (highest priority, on which nothing is ever printed)'
+ )
+ _describe -t log-priorities 'log priority' priorities "$@" && ret=0
+ else
+ local tags; tags=(${(u)${${${(f)"$(_call_program tags $service $adb_args logcat -d 2>/dev/null)"}%%[[:space:]]#\(*}##*\/}:#\**\*})
+ _describe -t log-tags 'log tag' tags -qS: "$@" && ret=0
+ fi
+ return ret
+}
+
+(( $+functions[_adb_logcat_output_formats] )) ||
+_adb_logcat_output_formats() {
+ local formats; formats=(
+ 'brief:display priority/tag and PID of originating process (the default format)'
+ 'process:display PID only'
+ 'tag:display the priority/tag only'
+ 'thread:display process:thread and priority/tag only'
+ 'raw:display the raw log message, with no other metadata fields'
+ 'time:display the date, invocation time, priority/tag, and PID of the originating process'
+ 'long:display all metadata fields and separate messages with a blank lines'
+ )
+ _describe -t log-formats 'log format' formats "$@" && ret=0
+}
+
+(( $+functions[_adb_logcat_buffers] )) ||
+_adb_logcat_buffers() {
+ local buffers; buffers=(
+ 'main:view the main log buffer (default)'
+ 'radio:view the buffer that contains radio/telephony related messages'
+ 'events:view the buffer containing events-related messages'
+ )
+ _describe -t log-buffers 'log buffer' buffers "$@" && ret=0
+}
+
+(( $+functions[_adb_remote_command_default] )) ||
+_adb_remote_command_default() {
+ _wanted remote-files expl 'remote file' _adb_remote_files
+}
+
+_adb "$@"
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
106 zsh/completions/_brew
@@ -0,0 +1,106 @@
+#compdef brew
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for brew (https://github.com/mxcl/homebrew).
+#
+# Source: https://github.com/mxcl/homebrew/blob/master/Library/Contributions/brew_zsh_completion.zsh
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * kulakowski (https://github.com/kulakowski)
+# * Gabe Berke-Williams (https://github.com/gabebw)
+# * James Conroy-Finn (https://github.com/jcf)
+# * Daniel Schauenberg (https://github.com/mrtazz)
+# * Adam Vandenberg (https://github.com/adamv)
+# * Erik Kastner (https://github.com/kastner)
+#
+# ------------------------------------------------------------------------------
+
+
+_brew_all_formulae() {
+ formulae=(`brew search`) # FIXME _call_program should be used here
+}
+
+_brew_installed_formulae() {
+ installed_formulae=(`brew list`) # FIXME _call_program should be used here
+}
+
+local -a _1st_arguments
+_1st_arguments=(
+ 'cat:display formula file for a formula'
+ 'cleanup:uninstall unused and old versions of packages'
+ 'create:create a new formula'
+ 'deps:list dependencies and dependants of a formula'
+ 'doctor:audits your installation for common issues'
+ 'edit:edit a formula'
+ 'home:visit the homepage of a formula or the brew project'
+ 'info:information about a formula'
+ 'install:install a formula'
+ 'link:link a formula'
+ 'list:list files in a formula or not-installed formulae'
+ 'log:git commit log for a formula'
+ 'missing:check all installed formulae for missing dependencies.'
+ 'outdated:list formulae for which a newer version is available'
+ 'prune:remove dead links'
+ 'remove:remove a formula'
+ 'search:search for a formula (/regex/ or string)'
+ 'server:start a local web app that lets you browse formulae (requires Sinatra)'
+ 'unlink:unlink a formula'
+ 'update:freshen up links'
+ 'upgrade:upgrade outdated formulae'
+ 'uses:show formulae which depend on a formula'
+)
+
+local expl
+local -a formulae installed_formulae
+
+_arguments \
+ '(-v)-v[verbose]' \
+ '(--cellar)--cellar[brew cellar]' \
+ '(--config)--config[brew configuration]' \
+ '(--env)--env[brew environment]' \
+ '(--repository)--repository[brew repository]' \
+ '(--version)--version[version information]' \
+ '(--prefix)--prefix[where brew lives on this system]' \
+ '(--cache)--cache[brew cache]' \
+ '*:: :->subcmds' && return 0
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "brew subcommand" _1st_arguments
+ return
+fi
+
+case "$words[1]" in
+ search|-S)
+ _arguments \
+ '(--macports)--macports[search the macports repository]' \
+ '(--fink)--fink[search the fink repository]' ;;
+ list|ls)
+ _arguments \
+ '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
+ '(--versions)--versions[list all installed versions of a formula]' \
+ '1: :->forms' && return 0
+
+ if [[ "$state" == forms ]]; then
+ _brew_installed_formulae
+ _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
+ fi ;;
+ install|home|homepage|log|info|abv|uses|cat|deps|edit|options)
+ _brew_all_formulae
+ _wanted formulae expl 'all formulae' compadd -a formulae ;;
+ remove|rm|uninstall|unlink|cleanup|link|ln)
+ _brew_installed_formulae
+ _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
+esac
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
215 zsh/completions/_play
@@ -0,0 +1,215 @@
+#compdef play
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Play! framework 1.2.2 (http://www.playframework.org).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+# * Mario Fernandez (https://github.com/sirech)
+#
+# ------------------------------------------------------------------------------
+
+
+_play() {
+ local context curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ local ret=1
+
+ _arguments -C \
+ '1: :_play_cmds' \
+ '*::arg:->args' \
+ && ret=0
+
+ case $state in
+ (args)
+ curcontext="${curcontext%:*:*}:play-cmd-$words[1]:"
+ case $line[1] in
+ (build-module|list-modules|lm|check|id)
+ _message 'no more arguments' && ret=0
+ ;;
+ (dependencies|deps)
+ _arguments \
+ '1:: :_play_apps' \
+ '(--debug)--debug[Debug mode (even more informations logged than in verbose mode)]' \
+ '(--jpda)--jpda[Listen for JPDA connection. The process will suspended until a client is plugged to the JPDA port.]' \
+ '(--sync)--sync[Keep lib/ and modules/ directory synced. Delete unknow dependencies.]' \
+ '(--verbose)--verbose[Verbose Mode]' \
+ && ret=0
+ ;;
+ (clean|javadoc|jd|out|pid|secret|stop)
+ _arguments '1:: :_play_apps' && ret=0
+ ;;
+ (help)
+ _arguments '1: :_play_cmds -F "(cp deps ec idea jd st lm nb nm help antify evolutions evolutions:apply evolutions:markApplied evolutions:resolve)"' && ret=0
+ ;;
+ (status|st)
+ _arguments \
+ '1:: :_play_apps' \
+ '(--url)--url[If you want to monitor an application running on a remote server, specify the application URL using this option]:URL:_urls' \
+ '(--secret)--secret[You can provide your own secret key using this option]:Secret key' \
+ && ret=0
+ ;;
+ (new)
+ _arguments \
+ '1: :_play_apps' \
+ '(--with)--with[Automatically enable this set of module for the newly created application]:Modules list:_play_modules_list' \
+ && ret=0
+ ;;
+ (install)
+ _arguments '1:Play! module:_play_modules_dash_versions' && ret=0
+ ;;
+ (new-module)
+ _arguments '1:Module directory:_files -/' && ret=0
+ ;;
+ (test|precompile|run|start|war|auto-test|classpath|cp|eclipsify|ec|idealize|idea|modules|netbeansify|nb)
+ local cmd_args; cmd_args=(
+ '1:: :_play_apps'
+ '(--deps)--deps[Resolve and install dependencies before running the command]'
+ )
+ case $line[1] in
+ (precompile|run|start|restart|war)
+ local app_dir="$line[2]"
+ [[ -d "$app_dir" ]] || app_dir=.
+ [[ -f "$app_dir/conf/application.conf" ]] && cmd_args+=('--'${(u)${(M)$(<$app_dir/conf/application.conf):#%*}%%.*}'[Use this ID to run the application (override the default framework ID)]')
+ ;|
+ (test|run)
+ cmd_args+=('(-f)-f[Disable the JPDA port checking and force the jpda.port value]')
+ ;|
+ (war)
+ cmd_args+=(
+ '(-o --output)'{-o,--output}'[The path where the WAR directory will be created. The contents of this directory will first be deleted]:output directory:_files -/'
+ '(--zip)--zip[By default, the script creates an exploded WAR. If you want a zipped archive, specify the --zip option]'
+ '(--exclude)--exclude[Excludes a list of colon separated directories]:excluded directories list:_play_colon_dirs_list'
+ )
+ ;|
+ (test|run|start|restart|war)
+ cmd_args+=('*:Java option')
+ ;;
+ esac
+ _arguments "$cmd_args[@]" && ret=0
+ ;;
+ *)
+ _call_function ret _play_cmd_$words[1] && ret=0
+ (( ret )) && _message 'no more arguments'
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# FIXME Completes only core commands, some modules add commands too (eg Maven). Where do we get them ?
+# FIXME Parse 'play help' and 'play help <command>' (for aliases) instead of hard-coding.
+(( $+functions[_play_cmds] )) ||
+_play_cmds() {
+ local commands; commands=(
+ 'antify:Create a build.xml file for this project'
+ 'auto-test:Automatically run all application tests'
+ 'build-module:Build and package a module'
+ 'check:Check for a release newer than the current one'
+ {classpath,cp}':Display the computed classpath'
+ 'clean:Delete temporary files (including the bytecode cache)'
+ {dependencies,deps}':Resolve and retrieve project dependencies'
+ {eclipsify,ec}':Create all Eclipse configuration files'
+ 'evolutions:Run the evolution check'
+ 'evolutions\:apply:Automatically apply pending evolutions'
+ 'evolutions\:mark:AppliedMark pending evolutions as manually applied'
+ 'evolutions\:resolve:Resolve partially applied evolution'
+ 'help:Display help on a specific command'
+ 'id:Define the framework ID'
+ {idealize,idea}':Create all IntelliJ Idea configuration files'
+ 'install:Install a module'
+ {javadoc,jd}':Generate your application Javadoc'
+ {list-modules,lm}':List modules available from the central modules repository'
+ 'modules:Display the computed modules list'
+ {netbeansify,nb}':Create all NetBeans configuration files'
+ 'new:Create a new application'
+ {new-module,nm}':Create a module'
+ 'out:Follow logs/system.out file'
+ 'pid:Show the PID of the running application'
+ 'precompile:Precompile all Java sources and templates to speed up application start-up'
+ 'restart:Restart the running application'
+ 'run:Run the application in the current shell'
+ 'secret:Generate a new secret key'
+ 'start:Start the application in the background'
+ {status,st}':Display the running application status'
+ 'stop:Stop the running application'
+ 'test:Run the application in test mode in the current shell'
+ 'war:Export the application as a standalone WAR archive'
+ )
+ _describe -t commands 'Play! command' commands "$@"
+}
+
+(( $+functions[_play_apps] )) ||
+_play_apps() {
+ _wanted application expl 'Play! application directory' _files -/
+}
+
+(( $+functions[_play_modules] )) ||
+_play_modules() {
+ local modules; modules=(${(ps:,:)${${${(S)${(f)$(_call_program modules $service list-modules)}//\]*\[/,}%%\]*}##*\[}})
+ _describe -t modules 'Play! module' modules "$@"
+}
+
+(( $+functions[_play_modules_dash_versions] )) ||
+_play_modules_dash_versions() {
+ local ret=1
+ if compset -P '*-'; then
+ local versions; versions=(${(ps:,:)${${${${${(f)$(_call_program versions $service list-modules)}##*${IPREFIX%-}\]}#*Versions:}%%"~"*}//[[:space:]]/}})
+ _describe -t module-versions "${IPREFIX%-} module versions" versions && ret=0
+ else
+ _wanted modules expl 'Play! module' _play_modules -qS- && ret=0
+ fi
+}
+
+(( $+functions[_play_modules_list] )) ||
+_play_modules_list() {
+ compset -P '*,'; compset -S ',*'
+ _wanted module-list expl 'Play! modules list' _play_modules -qS,
+}
+
+(( $+functions[_play_colon_dirs_list] )) ||
+_play_colon_dirs_list() {
+ compset -P '*:'; compset -S ':*'
+ _wanted directories-list expl 'Directories list' _files -/ -qS:
+}
+
+_play "$@"
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
215 zsh/completions/_play123
@@ -0,0 +1,215 @@
+#compdef play123
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for Play! framework 1.2.2 (http://www.playframework.org).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
+# * Mario Fernandez (https://github.com/sirech)
+#
+# ------------------------------------------------------------------------------
+
+
+_play123() {
+ local context curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ local ret=1
+
+ _arguments -C \
+ '1: :_play_cmds' \
+ '*::arg:->args' \
+ && ret=0
+
+ case $state in
+ (args)
+ curcontext="${curcontext%:*:*}:play-cmd-$words[1]:"
+ case $line[1] in
+ (build-module|list-modules|lm|check|id)
+ _message 'no more arguments' && ret=0
+ ;;
+ (dependencies|deps)
+ _arguments \
+ '1:: :_play_apps' \
+ '(--debug)--debug[Debug mode (even more informations logged than in verbose mode)]' \
+ '(--jpda)--jpda[Listen for JPDA connection. The process will suspended until a client is plugged to the JPDA port.]' \
+ '(--sync)--sync[Keep lib/ and modules/ directory synced. Delete unknow dependencies.]' \
+ '(--verbose)--verbose[Verbose Mode]' \
+ && ret=0
+ ;;
+ (clean|javadoc|jd|out|pid|secret|stop)
+ _arguments '1:: :_play_apps' && ret=0
+ ;;
+ (help)
+ _arguments '1: :_play_cmds -F "(cp deps ec idea jd st lm nb nm help antify evolutions evolutions:apply evolutions:markApplied evolutions:resolve)"' && ret=0
+ ;;
+ (status|st)
+ _arguments \
+ '1:: :_play_apps' \
+ '(--url)--url[If you want to monitor an application running on a remote server, specify the application URL using this option]:URL:_urls' \
+ '(--secret)--secret[You can provide your own secret key using this option]:Secret key' \
+ && ret=0
+ ;;
+ (new)
+ _arguments \
+ '1: :_play_apps' \
+ '(--with)--with[Automatically enable this set of module for the newly created application]:Modules list:_play_modules_list' \
+ && ret=0
+ ;;
+ (install)
+ _arguments '1:Play! module:_play_modules_dash_versions' && ret=0
+ ;;
+ (new-module)
+ _arguments '1:Module directory:_files -/' && ret=0
+ ;;
+ (test|precompile|run|start|war|auto-test|classpath|cp|eclipsify|ec|idealize|idea|modules|netbeansify|nb)
+ local cmd_args; cmd_args=(
+ '1:: :_play_apps'
+ '(--deps)--deps[Resolve and install dependencies before running the command]'
+ )
+ case $line[1] in
+ (precompile|run|start|restart|war)
+ local app_dir="$line[2]"
+ [[ -d "$app_dir" ]] || app_dir=.
+ [[ -f "$app_dir/conf/application.conf" ]] && cmd_args+=('--'${(u)${(M)$(<$app_dir/conf/application.conf):#%*}%%.*}'[Use this ID to run the application (override the default framework ID)]')
+ ;|
+ (test|run)
+ cmd_args+=('(-f)-f[Disable the JPDA port checking and force the jpda.port value]')
+ ;|
+ (war)
+ cmd_args+=(
+ '(-o --output)'{-o,--output}'[The path where the WAR directory will be created. The contents of this directory will first be deleted]:output directory:_files -/'
+ '(--zip)--zip[By default, the script creates an exploded WAR. If you want a zipped archive, specify the --zip option]'
+ '(--exclude)--exclude[Excludes a list of colon separated directories]:excluded directories list:_play_colon_dirs_list'
+ )
+ ;|
+ (test|run|start|restart|war)
+ cmd_args+=('*:Java option')
+ ;;
+ esac
+ _arguments "$cmd_args[@]" && ret=0
+ ;;
+ *)
+ _call_function ret _play_cmd_$words[1] && ret=0
+ (( ret )) && _message 'no more arguments'
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# FIXME Completes only core commands, some modules add commands too (eg Maven). Where do we get them ?
+# FIXME Parse 'play help' and 'play help <command>' (for aliases) instead of hard-coding.
+(( $+functions[_play_cmds] )) ||
+_play_cmds() {
+ local commands; commands=(
+ 'antify:Create a build.xml file for this project'
+ 'auto-test:Automatically run all application tests'
+ 'build-module:Build and package a module'
+ 'check:Check for a release newer than the current one'
+ {classpath,cp}':Display the computed classpath'
+ 'clean:Delete temporary files (including the bytecode cache)'
+ {dependencies,deps}':Resolve and retrieve project dependencies'
+ {eclipsify,ec}':Create all Eclipse configuration files'
+ 'evolutions:Run the evolution check'
+ 'evolutions\:apply:Automatically apply pending evolutions'
+ 'evolutions\:mark:AppliedMark pending evolutions as manually applied'
+ 'evolutions\:resolve:Resolve partially applied evolution'
+ 'help:Display help on a specific command'
+ 'id:Define the framework ID'
+ {idealize,idea}':Create all IntelliJ Idea configuration files'
+ 'install:Install a module'
+ {javadoc,jd}':Generate your application Javadoc'
+ {list-modules,lm}':List modules available from the central modules repository'
+ 'modules:Display the computed modules list'
+ {netbeansify,nb}':Create all NetBeans configuration files'
+ 'new:Create a new application'
+ {new-module,nm}':Create a module'
+ 'out:Follow logs/system.out file'
+ 'pid:Show the PID of the running application'
+ 'precompile:Precompile all Java sources and templates to speed up application start-up'
+ 'restart:Restart the running application'
+ 'run:Run the application in the current shell'
+ 'secret:Generate a new secret key'
+ 'start:Start the application in the background'
+ {status,st}':Display the running application status'
+ 'stop:Stop the running application'
+ 'test:Run the application in test mode in the current shell'
+ 'war:Export the application as a standalone WAR archive'
+ )
+ _describe -t commands 'Play! command' commands "$@"
+}
+
+(( $+functions[_play_apps] )) ||
+_play_apps() {
+ _wanted application expl 'Play! application directory' _files -/
+}
+
+(( $+functions[_play_modules] )) ||
+_play_modules() {
+ local modules; modules=(${(ps:,:)${${${(S)${(f)$(_call_program modules $service list-modules)}//\]*\[/,}%%\]*}##*\[}})
+ _describe -t modules 'Play! module' modules "$@"
+}
+
+(( $+functions[_play_modules_dash_versions] )) ||
+_play_modules_dash_versions() {
+ local ret=1
+ if compset -P '*-'; then
+ local versions; versions=(${(ps:,:)${${${${${(f)$(_call_program versions $service list-modules)}##*${IPREFIX%-}\]}#*Versions:}%%"~"*}//[[:space:]]/}})
+ _describe -t module-versions "${IPREFIX%-} module versions" versions && ret=0
+ else
+ _wanted modules expl 'Play! module' _play_modules -qS- && ret=0
+ fi
+}
+
+(( $+functions[_play_modules_list] )) ||
+_play_modules_list() {
+ compset -P '*,'; compset -S ',*'
+ _wanted module-list expl 'Play! modules list' _play_modules -qS,
+}
+
+(( $+functions[_play_colon_dirs_list] )) ||
+_play_colon_dirs_list() {
+ compset -P '*:'; compset -S ':*'
+ _wanted directories-list expl 'Directories list' _files -/ -qS:
+}
+
+_play "$@"
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
49 zsh/completions/_sbt
@@ -0,0 +1,49 @@
+#compdef sbt
+# ------------------------------------------------------------------------------
+# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for sbt 0.10+ (https://github.com/harrah/xsbt).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Tony Sloane <inkytonik@gmail.com>
+#
+# ------------------------------------------------------------------------------
+
+function _sbt_tasks () {
+ compadd clean compile console console-project console-quick doc package \
+ package-doc package-src publish publish-local run run-main test test-only \
+ test:compile test:package test:package-doc test:package-src update
+}
+
+_arguments "*:task:_sbt_tasks"
+
+return 0
View
212 zsh/completions/_scala
@@ -0,0 +1,212 @@
+#compdef scala scalac
+# ------------------------------------------------------------------------------
+# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for scala and scalac (http://www.scala-lang.org/).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * Tony Sloane <inkytonik@gmail.com>
+#
+# ------------------------------------------------------------------------------
+
+typeset -A opt_args
+local context state line
+
+_scala_phases () {
+ compadd "parser" "namer" "packageobjects" "typer" "superaccessors" \
+ "pickler" "refchecks" "selectiveanf" "liftcode" "selectivecps" "uncurry" \
+ "tailcalls" "specialize" "explicitouter" "erasure" "lazyvals" "lambdalift" \
+ "constructors" "flatten" "mixin" "cleanup" "icode" "inliner" "closelim" \
+ "dce" "jvm" "terminal"
+}
+
+local -a shared_opts
+shared_opts=(
+ "-bootclasspath+[Override location of bootstrap class files]:bootstrap class directory:_files -/"
+ "-classpath+[Specify where to find user class files]:directory:_files -/"
+ "-D-[Pass -Dproperty=value directly to the runtime system]"
+ "-d+[Destination for generated classfiles]: directory or jar file:_files"
+ "-dependencyfile+[Set dependency tracking file]:dependency tracking file:_files"
+ "-deprecation[Emit warning and location for usages of deprecated APIs]"
+ "-encoding+[Specify character encoding used by source files]:encoding:"
+ "-explaintypes[Explain type errors in more detail]"
+ "-extdirs+[Override location of installed extensions]:extensions directory:_files -/"
+ "-g\:-[Set level of generated debugging info (default\: vars)]:debugging info level:(none source line vars notailcalls)"
+ "-help[Print a synopsis of standard options]"
+ "-J-[pass argument directly to Java runtime system]:JVM argument:"
+ "-javabootclasspath+[Override java boot classpath]:Java boot class path directory]:_files -/"
+ "-javaextdirs+[Override java extdirs classpath]:Java extdirs directory:_files -/"
+ "-no-specialization[Ignore @specialize annotations]"
+ "-nobootcp[Do not use the boot classpath for the scala jars]"
+ "-nowarn[Generate no warnings]"
+ "-optimise[Generate faster bytecode by applying optimisations to the program]"
+ "-P\:-[Pass an option to a plugin (written <plugin>:<opt>)]"
+ "-print[Print program with Scala-specific features removed]"
+ "-sourcepath+[Specify location(s) of source files]:source file directory:_files -/"
+ "-target\:-[Target platform for object files (default\: jvm-1.5)]:platform name:(jvm-1.5 msil)"
+ "-toolcp+[Add to the runner classpath]:directory:_files -/"
+ "-unchecked[Enable detailed unchecked (erasure) warnings]"
+ "-uniqid[Uniquely tag all identifiers in debugging output]"
+ "-usejavacp[Utilize the java.class.path in classpath resolution]"
+ "-verbose[Output messages about what the compiler is doing]"
+ "-version[Print product version and exit]"
+ "-X[Print a synopsis of advanced options]"
+ "-Y[Print a synopsis of private options]"
+)
+
+local -a X_opts
+X_opts=(
+ "-Xcheck-null[Warn upon selection of nullable reference]"
+ "-Xcheckinit[Wrap field accessors to throw an exception on uninitialized access]"
+ "-Xdisable-assertions[Generate no assertions or assumptions]"
+ "-Xelide-below+[Calls to @elidable methods are omitted if method priority is lower than integer argument]"
+ "-Xexperimental[Enable experimental extensions]"
+ "-Xfatal-warnings[Fail the compilation if there are any warnings]"
+ "-Xfuture[Turn on future language features]"
+ "-Xgenerate-phase-graph+[Generate the phase graphs (outputs .dot files) to fileX.dot]:output file:_files"
+ "-Xlint[Enable recommended additional warnings]"
+ "-Xlog-implicits[Show more detail on why some implicits are not applicable]"
+ "-Xmax-classfile-name+[Maximum filename length for generated classes]"
+ "-Xmigration[Warn about constructs whose behavior may have changed]"
+ "-Xno-forwarders[Do not generate static forwarders in mirror classes]"
+ "-Xno-uescape[Disable handling of \u unicode escapes]"
+ "-Xnojline[Do not use JLine for editing]"
+ "-Xprint\:-[Print out program after <phase>]:phase name:_scala_phases"
+ "-Xprint-icode[Log internal icode to *.icode files]"
+ "-Xprint-pos[Print tree positions, as offsets]"
+ "-Xprint-types[Print tree types (debugging option)]"
+ "-Xprompt[Display a prompt after each error (debugging option)]"
+ "-Xresident[Compiler stays resident: read source filenames from standard input]"
+ "-Xscript+[Treat the source file as a script and wrap it in a main method]:main object name"
+ "-Xshow-class+[Show internal representation of class]:class name"
+ "-Xshow-object+[Show internal representation of object]:object name"
+ "-Xshow-phases[Print a synopsis of compiler phases]"
+ "-Xsource-reader+[Specify a class name for a custom method of reading source files]:class name"
+ "-Xverify[Verify generic signatures in generated bytecode]"
+
+ "-Xassem-extdirs+[List of directories containing assemblies (requires -target:msil) (default\: lib)]:assembly directory:_files -/"
+ "-Xassem-name+[Name of the output assembly (requires -target:msil)]:assembly name:_files"
+ "-Xassem-path+[List of assemblies referenced by the program (requires -target:msil)]:assembly path:_files"
+ "-Xsourcedir+[Mirror source folder structure in output directory (requires -target:msil)]:source directory:_files -/".
+
+ "-Xplugin\:-[Load one or more plugins from file]:plugin file:_files"
+ "-Xpluginsdir+[Path to search compiler plugins]:plugin directory:_files -/"
+ "-Xplugin-list[Print a synopsis of loaded plugins]"
+ "-Xplugin-disable\:-[Disable the given plugin(s)]"
+ "-Xplugin-require\:-[Abort unless the given plugin(s) are available]"
+)
+
+local -a Y_opts
+Y_opts=(
+ "-Y[Print a synopsis of private options]"
+ "-Ybuild-manager-debug[Generate debug information for the Refined Build Manager compiler]"
+ "-Ybuilder-debug\:-[Compile using the specified build manager (default\: none)]:build manager:(none refined simple)"
+ "-Yclosure-elim[Perform closure elimination]"
+ "-Ycompact-trees[Use compact tree printer when displaying trees]"
+ "-Ydead-code[Perform dead code elimination]"
+ "-Ydependent-method-types[Allow dependent method types]"
+ "-Ygen-javap+[Generate a parallel output directory of .javap files]:output directory:_files -/"
+ "-Yinfer-argument-types[Infer types for arguments of overriden methods]"
+ "-Yinline[Perform inlining when possible]"
+ "-Ylinearizer\:-[Linearizer to use (default\: rpo)]:linearizer:(normal dfs rpo dump)"
+ "-Ylog-classpath[Output information about what classpath is being applied]"
+ "-Yno-completion[Disable tab-completion in the REPL]"
+ "-Yno-generic-signatures[Suppress generation of generic signatures for Java]"
+ "-Yno-imports[Compile without any implicit imports]"
+ "-Yno-self-type-checks[Suppress check for self-type conformance among inherited members]"
+ "-Yno-squeeze[Disable creation of compact code in matching]"
+ "-Ynotnull[Enable (experimental and incomplete) scala.NotNull]"
+ "-Ypmat-naive[Desugar matches as naively as possible]"
+ "-Ypresentation-delay+[Wait number of ms after typing before starting typechecking]"
+ "-Ypresentation-log+[Log presentation compiler events into file]:log file:_files"
+ "-Ypresentation-replay+[Replay presentation compiler events from file]:log file:_files"
+ "-Yprofile-class+[Specify name of profiler class]:profiler class name"
+ "-Yprofile-memory[Heap snapshot after compiler run (requires jgpagent on JVM -agentpath)]"
+ "-Yrangepos[Use range positions for syntax trees]"
+ "-Yrecursion+[Set recursion depth used when locking symbols]"
+ "-Yrepl-sync[Do not use asynchronous code for REPL startup]"
+ "-Ypresentation-verbose[Print information about presentation compiler tasks]"
+ "-Yresolve-term-conflict\:-[Resolve term conflicts (default\: error)]:resolution strategy:(package object error)"
+ "-Yrich-exceptions[Fancier exceptions. Set source search path with -Dscala.control.sourcepath]"
+ "-Yself-in-annots[Include a \"self\" identifier inside of annotations]"
+ "-Yshow\:-[Show after <phase> (requires -Xshow-class or -Xshow-object)]:phase name:_scala_phases"
+ "-Yshow-syms[Print the AST symbol hierarchy after each phase]"
+ "-Yshow-trees[Print detailed ASTs (requires -Xprint:phase)]"
+ "-Ystatistics[Print compiler statistics]"
+ "-Ystruct-dispatch\:-[Structural method dispatch policy (default\: poly-cache)]:policy name:(no-cache mono-cache poly-cache invoke-dynamic)"
+
+ "-Ybrowse\:-[Browse the abstract syntax tree after <phase>]:phase name:_scala_phases"
+ "-Ycheck\:-[Check the tree at the end of <phase>]:phase name:_scala_phases"
+ "-Ylog\:-[Log operations during <phase>]:phase name:_scala_phases"
+ "-Yprofile\:-[Profile CPU usage of given phases (requires jgpagent on JVM -agentpath)]:phase name:_scala_phases"
+ "-Yskip\:-[Skip <phase>]:phase name:_scala_phases"
+ "-Ystop-after\:-[Stop after given phase <phase>]:phase name:_scala_phases"
+ "-Ystop-before\:-[Stop before given phase <phase>]:phase name:_scala_phases"
+
+ "-Ywarn-all[Enable all -Y warnings]"
+ "-Ywarn-dead-code[Warn when dead code is identified]"
+ "-Ywarn-inaccessible[Warn about inaccessible types in method signatures]"
+ "-Ywarn-nullary-override[Warn when non-nullary overrides nullary, e.g. def foo() over def foo]"
+ "-Ywarn-nullary-unit[Warn when nullary methods return Unit]"
+ "-Ywarn-numeric-widen[Warn when numerics are widened]"
+ "-Ywarn-value-discard[Warn when non-Unit expression results are unused]"
+
+ "-Ycompletion-debug[Trace all tab completion activity]"
+ "-Ydebug[Increase the quantity of debugging output]"
+ "-Ydoc-debug[Trace all scaladoc activity]"
+ "-Yide-debug[Generate, validate and output trees using the interactive compiler]"
+ "-Yinfer-debug[Trace type inference and implicit search]"
+ "-Ypmat-debug[Trace all pattern matcher activity]"
+ "-Ypresentation-debug[Enable debugging output for the presentation compiler]"
+ "-Yrepl-debug[Trace all REPL activity]"
+ "-Ytyper-debug[Trace all type assignments]"
+)
+
+local -a scala_opts
+scala_opts=(
+ "-e+[execute <string> as if entered in the repl]:string" \
+ "-howtorun+[what to run (default\: guess)]:execution mode:(script object jar guess)" \
+ "-i+[preload <file> before starting the repl]:file to preload:_files" \
+ "-nc[no compilation daemon\: do not use the fsc offline compiler]" \
+ "-save[save the compiled script in a jar for future use]"
+)
+
+case $words[$CURRENT] in
+ -X*) _arguments $X_opts;;
+ -Y*) _arguments $Y_opts;;
+ *) case $service in
+ scala) _arguments $scala_opts $shared_opts "*::filename:_files";;
+ scalac) _arguments $shared_opts "*::filename:_files";;
+ esac
+esac
+
+return 0
View
1 zsh/git-prompt/README
@@ -0,0 +1 @@
+https://github.com/olivierverdier/zsh-git-prompt
View
74 zsh/git-prompt/gitstatus.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python
+# -*- coding: UTF-8 -*-
+
+from __future__ import print_function
+
+# change those symbols to whatever you prefer
+symbols = {'ahead of': '', 'behind': '', 'prehash':':'}
+
+from subprocess import Popen, PIPE
+
+import sys
+gitsym = Popen(['git', 'symbolic-ref', 'HEAD'], stdout=PIPE, stderr=PIPE)
+branch, error = gitsym.communicate()
+
+error_string = error.decode('utf-8')
+
+if 'fatal: Not a git repository' in error_string:
+ sys.exit(0)
+
+branch = branch.strip()[11:]
+
+res, err = Popen(['git','diff','--name-status'], stdout=PIPE, stderr=PIPE).communicate()
+err_string = err.decode('utf-8')
+if 'fatal' in err_string:
+ sys.exit(0)
+changed_files = [namestat[0] for namestat in res.splitlines()]
+staged_files = [namestat[0] for namestat in Popen(['git','diff', '--staged','--name-status'], stdout=PIPE).communicate()[0].splitlines()]
+nb_changed = len(changed_files) - changed_files.count('U')
+nb_U = staged_files.count('U')
+nb_staged = len(staged_files) - nb_U
+staged = str(nb_staged)
+conflicts = str(nb_U)
+changed = str(nb_changed)
+nb_untracked = len(Popen(['git','ls-files','--others','--exclude-standard'],stdout=PIPE).communicate()[0].splitlines())
+untracked = str(nb_untracked)
+if not nb_changed and not nb_staged and not nb_U and not nb_untracked:
+ clean = '1'
+else:
+ clean = '0'
+
+remote = ''
+
+if not branch: # not on any branch
+ branch = symbols['prehash']+ Popen(['git','rev-parse','--short','HEAD'], stdout=PIPE).communicate()[0][:-1]
+else:
+ remote_name = Popen(['git','config','branch.%s.remote' % branch], stdout=PIPE).communicate()[0].strip()
+ if remote_name:
+ merge_name = Popen(['git','config','branch.%s.merge' % branch], stdout=PIPE).communicate()[0].strip()
+ if remote_name == '.': # local
+ remote_ref = merge_name
+ else:
+ remote_ref = 'refs/remotes/%s/%s' % (remote_name, merge_name[11:])
+ revgit = Popen(['git', 'rev-list', '--left-right', '%s...HEAD' % remote_ref],stdout=PIPE, stderr=PIPE)
+ revlist = revgit.communicate()[0]
+ if revgit.poll(): # fallback to local
+ revlist = Popen(['git', 'rev-list', '--left-right', '%s...HEAD' % merge_name],stdout=PIPE, stderr=PIPE).communicate()[0]
+ behead = revlist.splitlines()
+ ahead = len([x for x in behead if x[0]=='>'])
+ behind = len(behead) - ahead
+ if behind:
+ remote += '%s%s' % (symbols['behind'], behind)
+ if ahead:
+ remote += '%s%s' % (symbols['ahead of'], ahead)
+
+out = '\n'.join([
+ str(branch),
+ remote,
+ staged,
+ conflicts,
+ changed,
+ untracked,
+ clean])
+print(out)
+
View
95 zsh/git-prompt/zshrc.sh
@@ -0,0 +1,95 @@
+# To install source this file from your .zshrc file
+
+# Change this to reflect your installation directory
+export __GIT_PROMPT_DIR=~/.zsh/git-prompt
+# Initialize colors.
+autoload -U colors
+colors
+
+# Allow for functions in the prompt.
+setopt PROMPT_SUBST
+
+autoload -U add-zsh-hook
+
+add-zsh-hook chpwd chpwd_update_git_vars
+add-zsh-hook preexec preexec_update_git_vars
+add-zsh-hook precmd precmd_update_git_vars
+
+## Function definitions
+function preexec_update_git_vars() {
+ case "$2" in
+ git*)
+ __EXECUTED_GIT_COMMAND=1
+ ;;
+ esac
+}
+
+function precmd_update_git_vars() {
+ if [ -n "$__EXECUTED_GIT_COMMAND" ] || [ -n "$ZSH_THEME_GIT_PROMPT_NOCACHE" ]; then
+ update_current_git_vars
+ unset __EXECUTED_GIT_COMMAND
+ fi
+}
+
+function chpwd_update_git_vars() {
+ update_current_git_vars
+}
+
+function update_current_git_vars() {
+ unset __CURRENT_GIT_STATUS
+
+ local gitstatus="$__GIT_PROMPT_DIR/gitstatus.py"
+ _GIT_STATUS=`python ${gitstatus}`
+ __CURRENT_GIT_STATUS=("${(@f)_GIT_STATUS}")
+ GIT_BRANCH=$__CURRENT_GIT_STATUS[1]
+ GIT_REMOTE=$__CURRENT_GIT_STATUS[2]
+ GIT_STAGED=$__CURRENT_GIT_STATUS[3]
+ GIT_CONFLICTS=$__CURRENT_GIT_STATUS[4]
+ GIT_CHANGED=$__CURRENT_GIT_STATUS[5]
+ GIT_UNTRACKED=$__CURRENT_GIT_STATUS[6]
+ GIT_CLEAN=$__CURRENT_GIT_STATUS[7]
+}
+
+
+git_super_status() {
+ precmd_update_git_vars
+ if [ -n "$__CURRENT_GIT_STATUS" ]; then
+ STATUS="($GIT_BRANCH"
+ STATUS="$ZSH_THEME_GIT_PROMPT_PREFIX$ZSH_THEME_GIT_PROMPT_BRANCH$GIT_BRANCH%{${reset_color}%}"
+ if [ -n "$GIT_REMOTE" ]; then
+ STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_REMOTE$GIT_REMOTE%{${reset_color}%}"
+ fi
+ STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_SEPARATOR"
+ if [ "$GIT_STAGED" -ne "0" ]; then
+ STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_STAGED$GIT_STAGED%{${reset_color}%}"
+ fi
+ if [ "$GIT_CONFLICTS" -ne "0" ]; then
+ STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_CONFLICTS$GIT_CONFLICTS%{${reset_color}%}"
+ fi
+ if [ "$GIT_CHANGED" -ne "0" ]; then
+ STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_CHANGED$GIT_CHANGED%{${reset_color}%}"
+ fi
+ if [ "$GIT_UNTRACKED" -ne "0" ]; then
+ STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED%{${reset_color}%}"
+ fi
+ if [ "$GIT_CLEAN" -eq "1" ]; then
+ STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_CLEAN"
+ fi
+ STATUS="$STATUS%{${reset_color}%}$ZSH_THEME_GIT_PROMPT_SUFFIX"
+ echo "$STATUS"
+ fi
+}
+
+# Default values for the appearance of the prompt. Configure at will.
+ZSH_THEME_GIT_PROMPT_PREFIX=" %{\e[38;5;241m%}(%{\e[0m%}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{\e[38;5;241m%})%{\e[0m%}"
+ZSH_THEME_GIT_PROMPT_SEPARATOR=" "
+ZSH_THEME_GIT_PROMPT_BRANCH="%{\e[0;1m\e[38;5;208m%}"
+ZSH_THEME_GIT_PROMPT_STAGED="%{\e[38;5;010m%}+" # ●
+ZSH_THEME_GIT_PROMPT_CONFLICTS="%{\e[0;1m\e[38;5;009m%}✖" # ✖
+ZSH_THEME_GIT_PROMPT_CHANGED="%{\e[38;5;196m%}*" # ✚
+ZSH_THEME_GIT_PROMPT_REMOTE=""
+ZSH_THEME_GIT_PROMPT_UNTRACKED="?" # …
+ZSH_THEME_GIT_PROMPT_CLEAN="%{\e[38;5;010m%}✔"
+
+__EXECUTED_GIT_COMMAND=1
View
58 zshrc
@@ -0,0 +1,58 @@
+# autoloaders
+autoload -U colors; colors
+autoload -U compinit; compinit -i
+
+# completions
+zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
+setopt correct_all
+zstyle ':completion:*:*:kill:*' menu yes select
+zstyle ':completion:*:kill:*' force-list always
+zstyle ':completion:*' squeeze-slashes true
+zstyle ':completion:*' completer _complete _match _approximate
+zstyle ':completion:*:match:*' original only
+zstyle -e ':completion:*:approximate:*' \
+ max-errors 'reply=($((($#PREFIX+$#SUFFIX)/2))numeric)'
+fpath=($HOME/.zsh/completions $fpath)
+bindkey '^R' history-incremental-search-backward
+compinit -i
+zstyle ':completion:*' use-cache on
+zstyle ':completion:*' cache-path ~/.zsh/cache
+
+# history
+HISTFILE=$HOME/.zsh_history
+HISTSIZE=10000
+SAVEHIST=10000
+setopt append_history
+setopt extended_history
+setopt hist_expire_dups_first
+setopt hist_ignore_dups
+setopt hist_ignore_space
+setopt hist_verify
+setopt inc_append_history
+
+# use /etc/hosts and known_hosts for hostname completion
+[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
+[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
+hosts=(
+ "$_global_ssh_hosts[@]"
+ "$_ssh_hosts[@]"
+ "$_etc_hosts[@]"
+ "$HOST"
+ localhost
+)
+zstyle ':completion:*:hosts' hosts $hosts
+
+# git plugin
+source ~/.zsh/git-prompt/zshrc.sh
+
+# common stuff
+export EDITOR=vim
+export PAGER=less
+
+# prompt
+export CLICOLOR=1
+export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
+export PS1=$'%{\e[0;1m\e[38;5;161m%}%m%{\e[0m%}:%{\e[0;1m\e[38;5;118m%}%~%{\e[0m%}$(git_super_status) %(!.%{\e[0;1m\e[38;5;009m%}#%{\e[0m%}.$) '
+
+# aliases
+alias ll="ls -al"

0 comments on commit 1f04373

Please sign in to comment.
Something went wrong with that request. Please try again.