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"] [submodule "base16-shell"]
path = base16-shell path = base16-shell
url = git@github.com:chriskempson/base16-shell.git 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 set -g prefix C-a
bind C-a send-prefix 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 # splitting panes
bind v split-window -h bind v split-window -h
bind s split-window -v bind s split-window -v

View File

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

33
vimrc
View File

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

36
zshenv
View File

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

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 antigen bundle command-not-found
t430s-arch|pi) antigen theme robbyrussell
plugins+=(archlinux systemd)
;;
cassiopeia.uberspace.de)
plugins+=()
;;
everard)
plugins+=(jira)
;;
esac
source $ZSH/oh-my-zsh.sh antigen apply
# 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
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