Merge remote-tracking branch 'origin/master' into everard

Conflicts:
	zshenv
	zshrc
This commit is contained in:
Thomas Ruoff
2015-06-16 13:02:14 +02:00
8 changed files with 114 additions and 205 deletions

6
.gitmodules vendored
View File

@@ -1,6 +1,6 @@
[submodule "oh-my-zsh"]
path = oh-my-zsh
url = git@github.com:robbyrussell/oh-my-zsh.git
[submodule "base16-shell"]
path = base16-shell
url = git@github.com:chriskempson/base16-shell.git
[submodule "antigen"]
path = antigen
url = https://github.com/zsh-users/antigen.git

1
antigen Submodule

Submodule antigen added at 7860ce7aec

Submodule oh-my-zsh deleted from 1b7a3ea99a

View File

@@ -17,6 +17,12 @@ unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Copy-paste integration
setw -g mode-keys vi
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
bind y run-shell "tmux show-buffer | xclip -sel clip -i" \; display-message "Copied tmux buffer to system clipboard"
# splitting panes
bind v split-window -h
bind s split-window -v

View File

@@ -3,8 +3,7 @@
"
" Download plug.vim and put it in ~/.vim/autoload
"
" mkdir -p ~/.vim/autoload
" curl -fLo ~/.vim/autoload/plug.vim \
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
"
" Edit your .vimrc
@@ -37,7 +36,7 @@
" Visit https://github.com/junegunn/vim-plug for more information.
"
"
" Copyright (c) 2014 Junegunn Choi
" Copyright (c) 2015 Junegunn Choi
"
" MIT License
"
@@ -68,14 +67,14 @@ let g:loaded_plug = 1
let s:cpo_save = &cpo
set cpo&vim
let s:plug_src = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
let s:plug_src = 'https://github.com/junegunn/vim-plug.git'
let s:plug_tab = get(s:, 'plug_tab', -1)
let s:plug_buf = get(s:, 'plug_buf', -1)
let s:mac_gui = has('gui_macvim') && has('gui_running')
let s:is_win = has('win32') || has('win64')
let s:py2 = has('python') && !s:is_win && !has('win32unix')
let s:ruby = has('ruby') && (v:version >= 703 || v:version == 702 && has('patch374'))
let s:nvim = has('nvim') && !s:is_win
let s:py2 = has('python') && !has('nvim') && !s:is_win && !has('win32unix')
let s:ruby = has('ruby') && !has('nvim') && (v:version >= 703 || v:version == 702 && has('patch374'))
let s:nvim = has('nvim') && exists('*jobwait') && !s:is_win
let s:me = resolve(expand('<sfile>:p'))
let s:base_spec = { 'branch': 'master', 'frozen': 0 }
let s:TYPE = {
@@ -166,7 +165,7 @@ function! plug#end()
if has_key(plug, 'on')
let s:triggers[name] = { 'map': [], 'cmd': [] }
for cmd in s:to_a(plug.on)
if cmd =~ '^<Plug>.\+'
if cmd =~? '^<Plug>.\+'
if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i'))
call s:assoc(lod.map, cmd, name)
endif
@@ -271,7 +270,7 @@ if s:is_win
endfunction
function! s:is_local_plug(repo)
return a:repo =~? '^[a-z]:'
return a:repo =~? '^[a-z]:\|^[%~]'
endfunction
else
function! s:rtp(spec)
@@ -741,6 +740,12 @@ function! s:update_impl(pull, force, args) abort
endtry
endif
if has('nvim') && !exists('*jobwait') && threads > 1
echohl WarningMsg
echomsg 'vim-plug: update Neovim for parallel installer'
echohl None
endif
let s:update = {
\ 'start': reltime(),
\ 'all': todo,
@@ -818,9 +823,7 @@ function! s:job_abort()
if !s:nvim || !exists('s:jobs')
return
endif
augroup PlugJobControl
autocmd!
augroup END
for [name, j] in items(s:jobs)
silent! call jobstop(j.jobid)
if j.new
@@ -830,52 +833,48 @@ function! s:job_abort()
let s:jobs = {}
endfunction
function! s:job_handler(name) abort
" When a:event == 'stdout', data = list of strings
" When a:event == 'exit', data = returncode
function! s:job_handler(job_id, data, event) abort
if !s:plug_window_exists() " plug window closed
return s:job_abort()
endif
if !has_key(s:jobs, a:name)
return
endif
let job = s:jobs[a:name]
if v:job_data[1] == 'exit'
let job.running = 0
if s:lastline(job.result) ==# 'Error'
let job.error = 1
let job.result = substitute(job.result, "Error[\r\n]$", '', '')
endif
call s:reap(a:name)
call s:tick()
else
let job.result .= s:to_s(v:job_data[2])
if a:event == 'stdout'
let self.result .= substitute(s:to_s(a:data), '[\r\n]', '', 'g') . "\n"
" To reduce the number of buffer updates
let job.tick = get(job, 'tick', -1) + 1
if job.tick % len(s:jobs) == 0
call s:log(job.new ? '+' : '*', a:name, job.result)
let self.tick = get(self, 'tick', -1) + 1
if self.tick % len(s:jobs) == 0
call s:log(self.new ? '+' : '*', self.name, self.result)
endif
elseif a:event == 'exit'
let self.running = 0
if a:data != 0
let self.error = 1
endif
call s:reap(self.name)
call s:tick()
endif
endfunction
function! s:spawn(name, cmd, opts)
let job = { 'running': 1, 'new': get(a:opts, 'new', 0),
\ 'error': 0, 'result': '' }
let job = { 'name': a:name, 'running': 1, 'error': 0, 'result': '',
\ 'new': get(a:opts, 'new', 0),
\ 'on_stdout': function('s:job_handler'),
\ 'on_exit' : function('s:job_handler'),
\ }
let s:jobs[a:name] = job
if s:nvim
let x = jobstart(a:name, 'sh', ['-c',
\ (has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd)
\ . ' || echo Error'])
if x > 0
let job.jobid = x
augroup PlugJobControl
execute 'autocmd JobActivity' a:name printf('call s:job_handler(%s)', string(a:name))
augroup END
let argv = [ 'sh', '-c',
\ (has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd) ]
let jid = jobstart(argv, job)
if jid > 0
let job.jobid = jid
else
let job.running = 0
let job.error = 1
let job.result = x < 0 ? 'sh is not executable' :
let job.result = jid < 0 ? 'sh is not executable' :
\ 'Invalid arguments (or job table is full)'
endif
else
@@ -887,10 +886,6 @@ function! s:spawn(name, cmd, opts)
endfunction
function! s:reap(name)
if s:nvim
silent! execute 'autocmd! PlugJobControl JobActivity' a:name
endif
let job = s:jobs[a:name]
if job.error
call add(s:update.errors, a:name)
@@ -1679,6 +1674,12 @@ function! s:git_valid(spec, check_branch)
return [ret, msg]
endfunction
function! s:rm_rf(dir)
if isdirectory(a:dir)
call s:system((s:is_win ? 'rmdir /S /Q ' : 'rm -rf ') . s:shellesc(a:dir))
endif
endfunction
function! s:clean(force)
call s:prepare()
call append(0, 'Searching for unused plugins in '.g:plug_home)
@@ -1727,9 +1728,7 @@ function! s:clean(force)
call inputrestore()
if yes
for dir in todo
if isdirectory(dir)
call s:system((s:is_win ? 'rmdir /S /Q ' : 'rm -rf ') . s:shellesc(dir))
endif
call s:rm_rf(dir)
endfor
call append(line('$'), 'Removed.')
else
@@ -1740,55 +1739,30 @@ function! s:clean(force)
endfunction
function! s:upgrade()
let new = s:me . '.new'
echo 'Downloading '. s:plug_src
echo 'Downloading the latest version of vim-plug'
redraw
let tmp = tempname()
let new = tmp . '/plug.vim'
try
if executable('curl')
let output = s:system(printf('curl -fLo %s %s', s:shellesc(new), s:plug_src))
if v:shell_error
throw get(s:lines(output), -1, v:shell_error)
endif
elseif has('ruby')
call s:upgrade_using_ruby(new)
elseif has('python')
call s:upgrade_using_python(new)
else
return s:err('Missing: curl executable, ruby support or python support')
let out = s:system(printf('git clone --depth 1 %s %s', s:plug_src, tmp))
if v:shell_error
return s:err('Error upgrading vim-plug: '. out)
endif
catch
return s:err('Error upgrading vim-plug: '. v:exception)
if readfile(s:me) ==# readfile(new)
echo 'vim-plug is already up-to-date'
return 0
else
call rename(s:me, s:me . '.old')
call rename(new, s:me)
unlet g:loaded_plug
echo 'vim-plug has been upgraded'
return 1
endif
finally
silent! call s:rm_rf(tmp)
endtry
if readfile(s:me) ==# readfile(new)
echo 'vim-plug is already up-to-date'
silent! call delete(new)
return 0
else
call rename(s:me, s:me . '.old')
call rename(new, s:me)
unlet g:loaded_plug
echo 'vim-plug has been upgraded'
return 1
endif
endfunction
function! s:upgrade_using_ruby(new)
ruby << EOF
require 'open-uri'
File.open(VIM::evaluate('a:new'), 'w') do |f|
f << open(VIM::evaluate('s:plug_src')).read
end
EOF
endfunction
function! s:upgrade_using_python(new)
python << EOF
import urllib
import vim
psrc, dest = vim.eval('s:plug_src'), vim.eval('a:new')
urllib.urlretrieve(psrc, dest)
EOF
endfunction
function! s:upgrade_specs()

33
vimrc
View File

@@ -4,47 +4,44 @@ Plug 'tpope/vim-sensible'
Plug 'L9'
Plug 'unimpaired.vim'
Plug 'surround.vim'
Plug 'editorconfig/editorconfig-vim'
Plug 'Shougo/unite.vim'
Plug 'scrooloose/nerdtree'
Plug 'kien/ctrlp.vim'
Plug 'scrooloose/nerdtree'
Plug 'Valloric/YouCompleteMe', { 'do': './install.sh' }
Plug 'sjl/gundo.vim'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'scrooloose/nerdcommenter'
Plug 'surround.vim'
Plug 'sheerun/vim-polyglot'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'sjl/gundo.vim'
Plug 'editorconfig/editorconfig-vim'
Plug 'Valloric/YouCompleteMe', { 'do': './install.sh' }
Plug 'sheerun/vim-polyglot'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'scrooloose/syntastic'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'inside/vim-search-pulse'
Plug 'rking/ag.vim'
Plug 'christoomey/vim-tmux-navigator'
Plug 'itchyny/lightline.vim'
Plug 'chriskempson/base16-vim'
Plug 'scrooloose/syntastic'
Plug 'Raimondi/delimitMate'
Plug 'marijnh/tern_for_vim', { 'do': 'npm install' }
Plug 'marijnh/tern_for_vim', { 'do': 'npm install', 'for': 'javascript'}
Plug 'mustache/vim-mustache-handlebars'
Plug 'inside/vim-search-pulse'
Plug 'shime/vim-livedown'
call plug#end()
@@ -293,7 +290,7 @@ au BufNewFile,BufRead *.txt set filetype=human
au FileType human,mail,tex set wrap wm=2 textwidth=78 nocindent spell
"" Markdown
au FileType markdown set spell
au FileType markdown set wrap wm=2 textwidth=78 nocindent spell
"" Python
au FileType python set noexpandtab

36
zshenv
View File

@@ -1,8 +1,8 @@
##################
########################
# Source Things
#################
########################
# solarized dircolors
# dircolors
[ -s ~/.dircolors ] && . ~/.dircolors
# extend path
@@ -10,34 +10,24 @@ export PATH=$HOME/local/bin:$PATH
# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
# todo.sh
alias t=todo.sh
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && nvm use > /dev/null
# Base16 Shell
BASE16_SCHEME="solarized"
BASE16_SHELL="$HOME/.base16-shell/base16-$BASE16_SCHEME.dark.sh"
[[ -s $BASE16_SHELL ]] && . $BASE16_SHELL
########################
# Dist related settings
########################
DIST=$(lsb_release -si)
case $DIST in
case DIST in
Arch )
# use python 2.7 by default
export PYTHON=python2
;;
esac
# BW specific stuff
JIRA_URL="https://jira.brandwatch.com"
alias gfu="git fetch upstream"
alias gcbi="git checkout -b $1 upstream/ui-revamp-integration"
alias gcbs="git checkout -b $1 upstream/ui-revamp-stage"
alias gcbl="git checkout -b $1 upstream/ui-revamp-live"
alias gcboi="git checkout -b $1 upstream/integration"
alias gcbos="git checkout -b $1 upstream/stage"
alias gcbol="git checkout -b $1 upstream/live"
########################
# Aliases
########################
alias g=git
rl () { $(npm bin)/$* }

74
zshrc
View File

@@ -1,72 +1,14 @@
export ZSH=$HOME/.oh-my-zsh
source ~/.dotfiles/antigen/antigen.zsh
ZSH_THEME="pygmalion"
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle peterhurford/git-it-on.zsh
antigen bundle gerges/oh-my-zsh-jira-plus
plugins=(bower gitfast git-extras node npm pass screen vi-mode tmux)
antigen use oh-my-zsh
case $(hostname) in
t430s-arch|pi)
plugins+=(archlinux systemd)
;;
cassiopeia.uberspace.de)
plugins+=()
;;
everard)
plugins+=(jira)
;;
esac
antigen bundle command-not-found
antigen theme robbyrussell
source $ZSH/oh-my-zsh.sh
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# turn of autocorrection
unsetopt correct_all
#################
## Keybindings
################
bindkey "^P" vi-up-line-or-history
bindkey "^N" vi-down-line-or-history
bindkey "^[[1~" vi-beginning-of-line # Home
bindkey "^[[4~" vi-end-of-line # End
bindkey '^[[2~' beep # Insert
bindkey '^[[3~' delete-char # Del
bindkey '^[[5~' vi-backward-blank-word # Page Up
bindkey '^[[6~' vi-forward-blank-word # Page Down
bindkey -M viins '^r' history-incremental-search-backward
bindkey -M vicmd '^r' history-incremental-search-backward
bindkey -a 'gg' beginning-of-buffer-or-history
bindkey -a 'g~' vi-oper-swap-case
bindkey -a G end-of-buffer-or-history
bindkey -a u undo
bindkey -a '^R' redo
bindkey '^?' backward-delete-char
bindkey '^H' backward-delete-char
antigen apply
TRAPWINCH() {
zle && { zle reset-prompt; zle -R }
}
##################
# Source Things
#################
# solarized dircolors
source ~/.dircolors
# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
# rvm
if [ -s "$HOME/.rvm/scripts/rvm" ] ; then
source $HOME/.rvm/scripts/rvm
export PATH="$PATH:$HOME/.rvm/bin"
fi