Merge branch

This commit is contained in:
Austen Adler 2016-02-02 15:05:49 -05:00
commit 5044740a4b
4 changed files with 388 additions and 329 deletions

11
scripts/borg.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/zsh
set -e
mkdir -p ~/applications
\cd ~/applications
virtualenv --python=python3 borg-env
pip install 'llfuse<0.41'
source borg-env/bin/activate
pip install borgbackup
mkdir -p ~/bin
ln -s $(readlink -e borg-env/bin/borg) ~/bin/borg
\cd -

View File

@ -5,6 +5,7 @@ echo -n "Press enter to continue..."
read a read a
mkdir ~/ycm_build mkdir ~/ycm_build
cd ~/ycm_build cd ~/ycm_build
touch .nobackup
cmake -G "Unix Makefiles" . ~/.vim/plugged/YouCompleteMe/third_party/ycmd/cpp cmake -G "Unix Makefiles" . ~/.vim/plugged/YouCompleteMe/third_party/ycmd/cpp
make ycm_support_libs make ycm_support_libs
cd - cd -

View File

@ -17,12 +17,35 @@ fi
export DISABLE_AUTO_TITLE=true export DISABLE_AUTO_TITLE=true
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$(readlink -e ~/bin)" export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$(readlink -e ~/bin)"
export EDITOR='vim' export EDITOR='vim'
function asroot(){ # For pasting in commands that start with $
$ () {
$*
}
asroot(){
# Use temporary file for added security # Use temporary file for added security
TEMPFILE=$(tempfile) TEMPFILE=$(tempfile)
xauth extract $TEMPFILE $DISPLAY xauth extract $TEMPFILE $DISPLAY
sudo zsh -c "xauth merge $TEMPFILE;(srm $TEMPFILE||rm $TEMPFILE)&'$@';" sudo zsh -c "xauth merge $TEMPFILE;(srm $TEMPFILE||rm $TEMPFILE)&'$@';"
} }
dsl() {
while (( $# > 0 )); do
readlink $1 2>&1 >/dev/null && mv $(readlink $1) $1
shift
done
}
dedir(){
mv "$1"/* .
rmdir "$1"
if (( !? != 0 )); then
mv "$1"/.* .
fi
rmdir "$1"
}
alias cpatch='diff -crB'
alias capatch='patch --dry-run -p1 -i'
alias apatch='patch -p1 -i'
alias pg="pcregrep -M"
alias eix="eix -F"
alias mouse1="xmodmap <(echo pointer = 1 2 3)" alias mouse1="xmodmap <(echo pointer = 1 2 3)"
alias mouse2="xmodmap <(echo pointer = 3 2 1)" alias mouse2="xmodmap <(echo pointer = 3 2 1)"
alias where="readlink -e" alias where="readlink -e"
@ -37,7 +60,7 @@ alias ll='ls -AlhF'
alias la='ls -A' alias la='ls -A'
alias l='ls -CF' alias l='ls -CF'
alias logout='sudo pkill -u $USER' alias logout='sudo pkill -u $USER'
function rsh(){ rsh(){
if [ -z $1 ] ; then if [ -z $1 ] ; then
echo "Valid hostnames:" echo "Valid hostnames:"
cat /home/stonewareslord/syncthing/shared/ips cat /home/stonewareslord/syncthing/shared/ips
@ -52,7 +75,7 @@ function rsh(){
echo "SSH to $ADDR..." echo "SSH to $ADDR..."
tsh $ADDR $* tsh $ADDR $*
} }
function fixsh(){ fixsh(){
sed -i -e $1"d" ~/.ssh/known_hosts sed -i -e $1"d" ~/.ssh/known_hosts
} }
alias tmux='tmux -2' alias tmux='tmux -2'
@ -60,8 +83,8 @@ alias less='less -R'
alias tree='tree -C' alias tree='tree -C'
alias skim="(head -5; tail -5) <" alias skim="(head -5; tail -5) <"
alias cp='rsync --partial -ha --info=progress2 "$@"' alias cp='rsync --partial -ha --info=progress2 "$@"'
function mv() { /bin/mv -v "$@" } mv() { /bin/mv -v "$@" }
function m() { mv "$@" } m() { mv "$@" }
compdef _cp c m mv cp copy compdef _cp c m mv cp copy
alias dt='date "+%F %T"' alias dt='date "+%F %T"'
alias awake='disphost; while true; do xdotool mousemove 0 0; sleep 60; done' alias awake='disphost; while true; do xdotool mousemove 0 0; sleep 60; done'
@ -85,7 +108,7 @@ if test -f /etc/gentoo-release; then
echo "args: $*" echo "args: $*"
sudo zsh -c "emerge --autounmask-write -av $*" sudo zsh -c "emerge --autounmask-write -av $*"
} }
function update(){ update(){
# If this is a server computer # If this is a server computer
if [ "$(hostname|cut -b1)" = "S" ] ; then if [ "$(hostname|cut -b1)" = "S" ] ; then
echo "You're a server. Exiting" echo "You're a server. Exiting"
@ -144,19 +167,22 @@ alias -g L="2>&1|less"
#alias -g L="2>&1|vimpager" #alias -g L="2>&1|vimpager"
alias -g G='|& ag' alias -g G='|& ag'
export FZF_COMPLETION_OPTS='--no-mouse -m -1 -x' export FZF_COMPLETION_OPTS='--no-mouse -m -1 -x'
function ctar(){ ctar(){
tar -cf - $@|pv -WcN tar|gzip|pv -WcN gzip tar -cf - $@|pv -WcN tar|gzip|pv -WcN gzip
#tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest #tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest
#tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest #tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest
} }
function offline(){ offline(){
echo unshare -n -- sh -c "sudo -u stonewareslord zsh -c '$@'" if [ ! -z "$@" ] ; then
sudo unshare -n -- sh -c "sudo -u stonewareslord zsh -c '$@'" sudo unshare -n -- sudo -u stonewareslord zsh -c "$@"
else
sudo unshare -n -- sudo -u stonewareslord LP_MARK_PREFIX=" $(tput setaf 1)(offline)$(tput sgr0) " zsh
fi
} }
function smon(){ smon(){
timeout 1s pdsh -R ssh -w 10.0.1.196,10.0.1.207 "$@" timeout 1s pdsh -R ssh -w 10.0.1.196,10.0.1.207 "$@"
} }
function dnstest(){ dnstest(){
echo "resolv.conf:" echo "resolv.conf:"
cat /etc/resolv.conf cat /etc/resolv.conf
echo "Testing DNS:" echo "Testing DNS:"
@ -169,7 +195,7 @@ function dnstest(){
echo "Testing DNS" echo "Testing DNS"
curl ifconfig.me curl ifconfig.me
} }
function cinitify(){ cinitify(){
mkdir $2 mkdir $2
cd $2 cd $2
git init git init
@ -194,7 +220,7 @@ function cinitify(){
git checkout master git checkout master
fi fi
} }
function initify(){ initify(){
git init git init
git remote add origin git@austenwares.com:$1/$2.git git remote add origin git@austenwares.com:$1/$2.git
git remote add https https://austenwares.com/gitlab/$1/$2.git git remote add https https://austenwares.com/gitlab/$1/$2.git
@ -210,7 +236,7 @@ function initify(){
git checkout master git checkout master
fi fi
} }
function tsh(){ tsh(){
ssh $* -X ssh $* -X
if which ponysay >/dev/null; then if which ponysay >/dev/null; then
ponysay "Connection closed!" ponysay "Connection closed!"
@ -218,11 +244,11 @@ function tsh(){
echo "\n\n\n\n\n\n\n\n\n\nSESSION CLOSED\n\n\n\n\n\n\n\n\n\n" echo "\n\n\n\n\n\n\n\n\n\nSESSION CLOSED\n\n\n\n\n\n\n\n\n\n"
fi fi
} }
function mcl(){ mcl(){
mkdir -p $1 mkdir -p $1
cd $1 cd $1
} }
function rc(){ rc(){
case $1 in case $1 in
z) vim ~/.zshrc;; z) vim ~/.zshrc;;
v) vim ~/.vimrc;; v) vim ~/.vimrc;;
@ -235,24 +261,50 @@ function rc(){
*) echo "Opts:\nz v i\nuse make unmask mask accept_keywords" *) echo "Opts:\nz v i\nuse make unmask mask accept_keywords"
esac esac
} }
function pub-git-init(){ pub-git-init(){
# Get the project name # Get the project name
branch=$(git remote -v | ag '^origin\s+' | sed -e 's/^origin\s*//' | cut -d\ -f1 | sed -e 's/^.\+\///' -e 's/\.git$//' | head -n1) branch=$(git remote -v | ag '^origin\s+' | sed -e 's/^origin\s*//' | cut -d\ -f1 | sed -r -e 's/^.+\///' -e 's/#.+$//' -e 's/\.git$//' | head -n1)
echo "Branch: $branch"
# Get the hashed project name # Get the hashed project name
enc_branch=$("$branch" | sha512sum | cut -d\ -f1) enc_branch=$(echo "$branch" | sha512sum | cut -d\ -f1)
git remote add local "git@localhost:$branch" git remote add local "gcrypt::git@localhost:stonewareslord/79a79b1a6e37813d9226872c6428aca29eec9f6111558109861cb0dcd2f0ffc8198deea4e361f84e170989212452fdfb21e0ef690da2ad399c03ce308d79dcfe#$enc_branch"
git remote add ncsu "gcrypt::git@github.ncsu.edu:agadler/a86a0f8757772be2ec617b395a0716679bfce51c1bfdeb8da6127feebd84facde645e9e30188318344eb458f5834e3d86800.git#$enc_branch" git remote add ncsu "gcrypt::git@github.ncsu.edu:agadler/a86a0f8757772be2ec617b395a0716679bfce51c1bfdeb8da6127feebd84facde645e9e30188318344eb458f5834e3d86800.git#$enc_branch"
git remote add gitlab "gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#$enc_branch" git remote add gitlab "gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#$enc_branch"
git remote add aws "gcrypt::git@aws:stonewareslord/5e0701d5b5b2118127d378c084be9a1dfb33d185d3e2c5da30a3984f5118e3d5136f3f3b038462bccd538e93f9e32cb06136.git#$enc_branch"
git config remote.ncsu.gcrypt-participants "CCDFE3F1" git config remote.ncsu.gcrypt-participants "CCDFE3F1"
git config remote.gitlab.gcrypt-participants "CCDFE3F1" git config remote.gitlab.gcrypt-participants "CCDFE3F1"
} }
function pub-git-clone(){ pub-git-rm(){
if (( $# == 0 )) ; then
git remote rm local
git remote rm ncsu
git remote rm gitlab
git remote rm aws
fi
while (( $# > 0 )) ; do
git remote rm "$1"
shift
done
}
pub-git-push(){
if (( $# == 0 )) ; then
git push local --all && git push local --tags
git push ncsu --all && git push ncsu --tags
git push gitlab --all && git push gitlab --tags
git push aws --all && git push aws --tags
fi
while (( $# > 0 )) ; do
git push "$1" --all && git push "$1" --tags
shift
done
}
pub-git-clone(){
case $1 in case $1 in
ncsu) remote="gcrypt::git@github.ncsu.edu:agadler/a86a0f8757772be2ec617b395a0716679bfce51c1bfdeb8da6127feebd84facde645e9e30188318344eb458f5834e3d86800.git#" ;; ncsu) remote="gcrypt::git@github.ncsu.edu:agadler/a86a0f8757772be2ec617b395a0716679bfce51c1bfdeb8da6127feebd84facde645e9e30188318344eb458f5834e3d86800.git#" ;;
gitlab) remote="gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#" ;; gitlab) remote="gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#" ;;
#TODO: Fix enc_branch local) remote="gcrypt::git@localhost:stonewareslord/79a79b1a6e37813d9226872c6428aca29eec9f6111558109861cb0dcd2f0ffc8198deea4e361f84e170989212452fdfb21e0ef690da2ad399c03ce308d79dcfe#" ;;
local) remote="git@localhost:" ;; aws) remote="gcrypt::git@aws:stonewareslord/5e0701d5b5b2118127d378c084be9a1dfb33d185d3e2c5da30a3984f5118e3d5136f3f3b038462bccd538e93f9e32cb06136.git#" ;;
*) echo "Opts: ncsu gitlab local" ; return 1 *) echo "Opts: local ncsu gitlab" ; return 1
esac esac
shift shift
if [ -z "$1" ] ; then if [ -z "$1" ] ; then
@ -262,7 +314,7 @@ function pub-git-clone(){
branch=$(echo $1 | sha512sum | cut -d\ -f1) branch=$(echo $1 | sha512sum | cut -d\ -f1)
git clone "$remote$branch" $1 git clone "$remote$branch" $1
} }
function k(){ k(){
#More than 1 arguement #More than 1 arguement
if [[ $# > 1 ]] ; then if [[ $# > 1 ]] ; then
vim $@ vim $@
@ -332,3 +384,7 @@ echo -ne '[##### ]\r'
antigen apply antigen apply
echo -ne '[######]\r' echo -ne '[######]\r'
echo echo
# OPAM configuration
. /home/stonewareslord/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true
(( $+TMUX )) && unset zle_bracketed_paste

597
vim/vimrc
View File

@ -2,193 +2,205 @@
if has('conceal') if has('conceal')
set conceallevel=2 concealcursor=i set conceallevel=2 concealcursor=i
endif endif
nnoremap <Leader>autoformat! :%s/, /,<CR>:%s/ \/ /\/<CR>:%s/ {/{<CR>:%s/} /}<CR>:%s/ = /= let g:formatdef_my_custom_cpp = '"astyle --mode=cpp -xc --style=google -j -s2 -xG -S -K -N -xn -xl -n -p -H"'
let g:formatters_cpp = ['my_custom_cpp']
let g:formatdef_my_custom_java = '"astyle --mode=java -xc --style=google -j -s3 -xG -S -K -N -xn -xl -n -p -H"'
let g:formatters_java = ['my_custom_java']
let g:UltiSnipsUsePythonVersion=3
command! WW %!sudo tee > /dev/null % command! WW %!sudo tee > /dev/null %
"TODO: Fix this "TODO: Fix this
"let g:rbpt_loadcmd_toggle = 1 "let g:rbpt_loadcmd_toggle = 1
"autocmd BufRead,BufNewFile * RainbowParenthesesActivate
""autocmd BufRead,BufNewFile * RainbowParenthesesToggle
""autocmd BufRead,BufNewFile * RainbowParenthesesLoadBraces
"autocmd BufRead,BufNewFile * RainbowParenthesesLoadRound
"autocmd BufRead,BufNewFile * RainbowParenthesesLoadSquare
"autocmd BufRead,BufNewFile * RainbowParenthesesLoadChevrons
let g:indent_guides_auto_colors = 0 let g:indent_guides_auto_colors = 0
autocmd FileType java set shiftwidth=3 tabstop=3 softtabstop=3 expandtab
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=darkgrey ctermbg=darkgrey autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=darkgrey ctermbg=darkgrey
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=grey ctermbg=grey autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=grey ctermbg=grey
filetype plugin on filetype plugin on
set grepprg=grep\ -nH\ $* set grepprg=grep\ -nH\ $*
let g:tex_flavor='latex' let g:tex_flavor='latex'
"match Error /\s\+$/ "match Error /\s\+$/
"nnoremap s xa " Basic, very important mappings {
"nnoremap <F5> :UndotreeToggle<CR> " Movement {
"inoremap <expr><Tab> pumvisible() ? "\<C-n>" : "\<Tab>" "Vertical
imap <Expr>\ neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "\<C-n>" : "\<TAB>" nnoremap gj j
smap <Expr>\ neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>" nnoremap gk k
nnoremap <Leader><Space> :CtrlPTag<CR> nnoremap j gj
nnoremap <C-w>\| <C-w>v<C-w>l nnoremap k gk
nnoremap <C-w>- <C-w>s<C-w>j vnoremap gj j
nnoremap <C-d> <C-w>q vnoremap gk k
nnoremap G G$ vnoremap j gj
vnoremap G G$ vnoremap k gk
nnoremap <F5> :GundoToggle<CR> "Horizontal
nnoremap + <C-a> nnoremap Y y$
nnoremap - <C-x> nnoremap H ^
nnoremap Q <Nop> nnoremap L $
nnoremap <Leader><Leader> <C-^> vnoremap L $h
nnoremap <Leader>a :!git st<CR>:!ls<CR>:!git a vnoremap H ^
nnoremap <Leader>up :!git pull origin "Move to end of line
nnoremap <Leader>st :!git st<CR> inoremap jk <Esc>A
nnoremap <Leader>ci :!git st<CR>:!git ci ""<Left> inoremap kj <Esc>A
nnoremap <Leader>log :!git hist<CR> "Move to last character of last line
nnoremap <Leader>br :!git br<CR> nnoremap G G$
nnoremap gb :ls<CR>:b vnoremap G G$
nnoremap <Leader>d :bd " }
nnoremap <Leader>q :q " Buffers {
nnoremap <Leader>W :%s/\s\+$//<CR>:let @/=''<CR> "Control-key movement
nnoremap <Leader>o m`o<Esc>`` nnoremap <C-h> <C-w>h
nnoremap <Leader>O m`O<Esc>`` nnoremap <C-j> <C-w>j
nnoremap <Leader>go %m`%x`` nnoremap <C-k> <C-w>k
nnoremap <Leader>if m"Oif(){<Esc>jo}<Esc>`"v><Esc>k^wa nnoremap <C-l> <C-w>l
nnoremap <Leader>else m"kAelse{<Esc>jo}<Esc>`"v><Esc> "Arrow keys
nnoremap <Leader>for m"Ofor(){<Esc>jo}<Esc>`"v><Esc>k^wa nnoremap <Up> <C-w>w
nnoremap <Leader>while m"Owhile(){<Esc>jo}<Esc>`"v><Esc>k^wa nnoremap <Down> <C-w>W
nnoremap <Leader>rm m"kddjddkv<<Esc>`" nnoremap <Left> :bp<CR>
nnoremap <Leader># O#{{{<Esc>jo#}}}<Esc>kk^a nnoremap <Right> :bn<CR>
vnoremap <Leader># <Esc>`<O#{{{<Esc>`>o#}}}<Esc>`<k^a "Vertical and horizontal split
nnoremap <Leader>{ O//{{{<Esc>jo//}}}<Esc>kk^la nnoremap <C-w>\| <C-w>v<C-w>l
vnoremap <Leader>{ <Esc>`<O//{{{<Esc>`>o//}}}<Esc>`<k^la nnoremap <C-w>- <C-w>s<C-w>j
vnoremap <Leader>if <Esc>`<Oif(){<Esc>`>o}<Esc>gv><Esc>`<k^wa "Close buffer
vnoremap <Leader>else <Esc>`<kAelse{<Esc>`>o}<Esc>gv><Esc> nnoremap <C-d> <C-w>q
vnoremap <Leader>for <Esc>`<Ofor(){<Esc>`>o}<Esc>gv><Esc>`<k^wa "Fullscreen buffer
vnoremap <Leader>while <Esc>`<Owhile(){<Esc>`>o}<Esc>gv><Esc>`<k^wa nnoremap <C-w>z <C-w>_<C-w>\|
vnoremap <Leader>rm <Esc>`<<Esc>kdd`>jddgv<<Esc> "Go to last buffer
vnoremap <silent> * :call VisualSelection('f')<CR> nnoremap <Leader><Leader> <C-^>
vnoremap <silent> # :call VisualSelection('b')<CR> " }
"nnoremap <Space> zo:set hlsearch! hlsearch?<CR> " Misc {
"nnoremap <Space> :nohlsearch<CR>g<C-g>zo vnoremap <silent> * :call VisualSelection('f')<CR>
nnoremap <BS> :nohlsearch<CR>g<C-g>zo vnoremap <silent> # :call VisualSelection('b')<CR>
nnoremap U <C-r> vnoremap ; :
nnoremap K i<CR><Esc>k$ nnoremap ! :!
nnoremap <Enter> :up<CR>:silent! call sy#start()<CR> vnoremap < <gv
vnoremap gj j vnoremap > >gv
vnoremap gk k "Disable F1
vnoremap j gj nnoremap <F1> <nop>
vnoremap k gk inoremap <F1> <nop>
vnoremap H ^ vnoremap <F1> <nop>
vnoremap L $h "F2 toggle paste
vnoremap ; : nnoremap <F2> :set invpaste<CR>
nnoremap gj j "Better searching
nnoremap gk k nnoremap / /\v
nnoremap j gj vnoremap / /\v
nnoremap k gk "Addition and subtraction
nnoremap H ^ nnoremap + <C-a>
nnoremap L $ nnoremap - <C-x>
nnoremap <C-h> <C-w>h "Backspace remove highlights
nnoremap <C-j> <C-w>j nnoremap <BS> :nohlsearch<CR>g<C-g>zo
nnoremap <C-k> <C-w>k "Better save
nnoremap <C-l> <C-w>l nnoremap <Enter> :up<CR>:silent! call sy#start()<CR>
map , <Plug>(easymotion-prefix) "Unmap Q
nnoremap ! :! nnoremap Q <Nop>
"nnoremap ; m"A;<Esc>`" " }
vnoremap < <gv " }
vnoremap > >gv " Plugin mappings {
nnoremap <F1> <nop> "Easymotion
inoremap <F1> <nop> map , <Plug>(easymotion-prefix)
vnoremap <F1> <nop> "Ctrl-p
nnoremap <Leader>** yyPv$r*jyypv$r* nnoremap <Leader><C-p> :CtrlPFunky<CR>
nnoremap <Leader>= yypv$r= "Gundo
nnoremap <Leader>- yypv$r- nnoremap <F5> :GundoToggle<CR>
nnoremap <Leader>^ yypv$r^ "Easytags
nnoremap <Leader>" yypv$r" nnoremap <Leader><Space> :CtrlPTag<CR>
"inoremap ;; <Esc>m`A;<Esc>``a "Tagbar
"inoremap ;;<Space> <Esc>A;<Esc>o "nnoremap <Leader><Space> :Tagbar<CR>
"nnoremap ;; m"A;<Esc>`" "Add a bundle from clipboard
"nnoremap ;;<Space> A;<Esc>o nnoremap <Leader>bun G?Plug <CR>yyjp$hdi'"+gPo " \| <Esc>"+gp<Esc>:nohlsearch<CR>:up<CR>:PlugInstall
nnoremap Y y$ "Automatic if/else/for/while wrappers
nnoremap <Up> <C-w>w nnoremap <Leader>if m"Oif(){<Esc>jo}<Esc>`"v><Esc>k^wa
nnoremap <Down> <C-w>W nnoremap <Leader>else m"kAelse{<Esc>jo}<Esc>`"v><Esc>
nnoremap <Left> :bp<CR> nnoremap <Leader>for m"Ofor(){<Esc>jo}<Esc>`"v><Esc>k^wa
nnoremap <Right> :bn<CR> nnoremap <Leader>while m"Owhile(){<Esc>jo}<Esc>`"v><Esc>k^wa
nnoremap <C-w>z <C-w>_<C-w>\| nnoremap <Leader>rm m"kddjddkv<<Esc>`"
"nnoremap <Leader>bun G?Plug <CR>yyjp$hdi'"+gP0Wl3d/\/<CR>xjyyP$"+gp<Esc>:nohlsearch<CR>:up<CR>:PluginInstall vnoremap <Leader>if <Esc>`<Oif(){<Esc>`>o}<Esc>gv><Esc>`<k^wa
nnoremap <Leader>bun G?Plug <CR>yyjp$hdi'"+gPo " \| <Esc>"+gp<Esc>:nohlsearch<CR>:up<CR>:PlugInstall vnoremap <Leader>else <Esc>`<kAelse{<Esc>`>o}<Esc>gv><Esc>
nnoremap <Leader><C-p> :CtrlPFunky<CR> vnoremap <Leader>for <Esc>`<Ofor(){<Esc>`>o}<Esc>gv><Esc>`<k^wa
nnoremap <F2> :set invpaste<CR> vnoremap <Leader>while <Esc>`<Owhile(){<Esc>`>o}<Esc>gv><Esc>`<k^wa
"nnoremap <C-Up> [e vnoremap <Leader>rm <Esc>`<<Esc>kdd`>jddgv<<Esc>
"nnoremap <C-Down> ]e " }
"vnoremap <C-Up> [egv " Trial mappings {
"vnoremap <C-Down> ]egv nnoremap <Leader>o m`o<Esc>``
nnoremap / /\v nnoremap <Leader>O m`O<Esc>``
vnoremap / /\v " }
inoremap jk <Esc>A
inoremap kj <Esc>A
set tags=./tags;/ " Gui options {
set wildmode=longest,list,full set gfn=Monospace\ 8
set gfn=Monospace\ 8 set guioptions=
set guioptions= set guicursor+=n-v-c:blinkon0
set guicursor+=n-v-c:blinkon0 set mouse-=a
set ttimeout " }
set ttimeoutlen=0 " Annoyance fixes {
set notimeout "Annoying escape timeouts
set formatoptions-=r set ttimeout
set formatoptions-=o set ttimeoutlen=0
set diffopt+=iwhite set notimeout
set noesckeys " }
set mouse-=a " Misc {
set shiftwidth=2 set tabstop=2 shiftwidth=2 expandtab
set tabstop=2 set tags=./tags;/
set modeline set wildmode=longest,list,full
set softtabstop=2 set formatoptions-=r
set expandtab set formatoptions-=o
set history=1000 set diffopt+=iwhite
set hidden set noesckeys
set cursorline set shiftwidth=2
set incsearch set tabstop=2
set showmatch set modeline
set hlsearch set softtabstop=2
set scrolloff=3 set expandtab
set scrolljump=5 set history=1000
set autoindent set hidden
set backup set cursorline
set backupdir=~/.vim/backup set incsearch
set directory=~/.vim/tmp set showmatch
set undolevels=1000 set hlsearch
set history=500 set scrolloff=3
set ttyfast set scrolljump=5
set fileformat=unix set autoindent
set encoding=utf-8 set backup
set laststatus=2 set backupdir=~/.vim/backup
set foldmethod=indent set directory=~/.vim/tmp
set foldnestmax=10 set undolevels=1000
set foldlevel=2 set history=500
set relativenumber set ttyfast
set number set fileformat=unix
set ts=2 sw=2 et set encoding=utf-8
set background=dark set laststatus=2
set t_Co=256 set foldmethod=indent
set gdefault set foldnestmax=10
set nocompatible set foldlevel=2
"set rtp+=~/.vim/bundle/vundle/ set relativenumber
set ignorecase set number
set textwidth=0 set background=dark
syntax on set t_Co=256
"let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`', '<':'>', '%':'%'} set gdefault
set nocompatible
set ignorecase
set textwidth=0
syntax on
" }
"Signify
let g:signify_vcs_list = [ 'git', 'svn' ] let g:signify_vcs_list = [ 'git', 'svn' ]
let g:signify_difftool = 'diff' let g:signify_difftool = 'diff'
"CtrlP
let g:ctrlp_root_markers = ['.cproot'] let g:ctrlp_root_markers = ['.cproot']
let g:ctrlp_custom_ignore = { let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/](\.git|\.hg|\.svn|vendor)$', \ 'dir': '\v[\/](\.git|\.hg|\.svn|vendor)$',
\ 'file': '\v\.(exe|so|dll)$', \ 'file': '\v\.(exe|so|dll|class)$',
\ 'link': 'SOME_BAD_SYMBOLIC_LINKS', \ 'link': 'SOME_BAD_SYMBOLIC_LINKS',
\ } \ }
let g:ctrlp_extensions=['funky']
"Airline
let g:airline_left_sep='▶' let g:airline_left_sep='▶'
let g:airline_right_sep='◀' let g:airline_right_sep='◀'
let g:airline#extensions#syntastic#enabled=0 let g:airline#extensions#syntastic#enabled=0
let g:ycm_show_diagnostics_ui=0
let g:syntastic_cpp_compiler = 'clang++'
let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++'
let g:airline#extensions#whitespace#enabled=0 let g:airline#extensions#whitespace#enabled=0
let g:airline#extensions#whitespace#show_message=0 let g:airline#extensions#whitespace#show_message=0
let g:airline#extensions#tmuxline#enabled=1 let g:airline#extensions#tmuxline#enabled=1
"Autoformat
let g:formatdef_my_custom_php = '"astyle --mode=php -xc -A10 -j -s2 -xG -S -K -N -xn -xl -n"' let g:formatdef_my_custom_php = '"astyle --mode=php -xc -A10 -j -s2 -xG -S -K -N -xn -xl -n"'
let g:formatdef_my_custom_cpp = '"astyle --mode=c -xc -A10 -j -s2 -xG -S -K -N -xn -xl -n"' let g:formatdef_my_custom_cpp = '"astyle --mode=c -xc -A10 -j -s2 -xG -S -K -N -xn -xl -n"'
let g:formatter_cpp = ['formatdef_my_custom_cpp'] let g:formatter_cpp = ['formatdef_my_custom_cpp']
@ -197,44 +209,34 @@ let g:formatter_php = ['formatdef_my_custom_php']
"let g:formatprg_args_expr_cpp=" --mode=c --style=1tbs -xe -k1 -j" "let g:formatprg_args_expr_cpp=" --mode=c --style=1tbs -xe -k1 -j"
" These flags don't work for some reason " These flags don't work for some reason
" -xn -xc -xl -S " -xn -xc -xl -S
"let g:airline#extensions#tabline#enabled=1 "Syntastic
let g:Powerline_symbols='fancy' let g:syntastic_java_javac_classpath = "/home/stonewareslord/workspace/FullCourseManager/src:/home/stonewareslord/applications/java/junit-4.12.jar:/home/stonewareslord/applications/java/hamcrest-core-1.3.jar"
"IndentGuides
let g:indent_guides_start_level=1 let g:indent_guides_start_level=1
let g:indent_guides_guide_size=1 let g:indent_guides_guide_size=1
let g:indent_guides_enable_on_vim_startup=1 let g:indent_guides_enable_on_vim_startup=1
"let g:neocomplcache_enable_at_startup=1
"let g:neocomplcache_enable_camel_case_completion=1
"let g:neocomplcache_enable_smart_case=1
"let g:neocomplcache_enable_underbar_completion=1
"let g:neocomplcache_enable_auto_delimiter=1
"let g:neocomplcache_max_list=20
"let g:neocomplcache_force_overwrite_completefunc=1
"let g:neocomplcache_min_syntax_length=2
"let g:neocomplcache_enable_auto_select=1
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#sources#syntax#min_keyword_length = 2
let g:php_refactor_command='php /usr/local/bin/refactor.phar' let g:php_refactor_command='php /usr/local/bin/refactor.phar'
let g:ctrlp_extensions=['funky'] function! g:UltiSnips_Complete()
"inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>" call UltiSnips#ExpandSnippet()
"function! g:UltiSnips_Complete() if g:ulti_expand_res == 0
" call UltiSnips#ExpandSnippet() if pumvisible()
" if g:ulti_expand_res == 0 return "\<C-n>"
" if pumvisible() else
" return "\<C-n>" call UltiSnips#JumpForwards()
" else if g:ulti_jump_forwards_res == 0
" call UltiSnips#JumpForwards() return "\<TAB>"
" if g:ulti_jump_forwards_res == 0 endif
" return "\<TAB>" endif
" endif endif
" endif return ""
" endif endfunction
" return "" "inoremap <expr><Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
"endfunction "inoremap <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
"au BufEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=g:UltiSnips_Complete()<cr>" let g:UltiSnipsJumpForwardTrigger="<C-S-Q>"
"let g:UltiSnipsJumpForwardTrigger="<tab>" let g:UltiSnipsExpandTrigger="<S-Tab>"
"let g:UltiSnipsListSnippets="<c-e>" let g:UltiSnipsListSnippets="<C-e>"
"let g:UltiSnipsEditSplit="vertical" let g:UltiSnipsEditSplit="vertical"
let g:ycm_key_list_select_completion = []
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
let loaded_matchit=1 let loaded_matchit=1
filetype off filetype off
@ -243,111 +245,98 @@ if has("win32")
else else
call plug#begin('~/.vim/plugged') call plug#begin('~/.vim/plugged')
endif endif
"Plug 'Floobits/floobits-vim' " Code writing {
"Plug 'tsaleh/vim-matchit' Plug 'Chiel92/vim-autoformat'
"Plug 'Shougo/neosnippet' "Adds autoformat command | https://github.com/Chiel92/vim-autoformat
"Plug 'msanders/snipmate.vim' Plug 'tpope/vim-surround'
"Plug 'vim-scripts/YankRing.vim' "Surround selection in ({\"' or HTML tags | https://github.com/tpope/vim-surround
Plug 'Chiel92/vim-autoformat' Plug 'scrooloose/syntastic'
"Adds autoformat command | https://github.com/Chiel92/vim-autoformat "Syntax checker | https://github.com/scrooloose/syntastic
Plug 'tpope/vim-surround' Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
"Surround selection in ({\"' or HTML tags | https://github.com/tpope/vim-surround "File browser | https://github.com/scrooloose/nerdtree
Plug 'scrooloose/syntastic' Plug 'Lokaltog/vim-easymotion'
"Syntax checker | https://github.com/scrooloose/syntastic "Move around quickly in a document | https://github.com/Lokaltog/vim-easymotion
Plug 'nathanaelkane/vim-indent-guides' Plug 'sjl/gundo.vim', { 'on': 'GundoToggle' }
"Indentation guides | https://github.com/nathanaelkane/vim-indent-guides "Visual undo | https://github.com/sjl/gundo.vim
Plug 'elzr/vim-json' Plug 'tommcdo/vim-exchange'
"JSON highlighting | https://github.com/elzr/vim-json "Exchange two selections of text | https://github.com/tommcdo/vim-exchange
Plug 'groenewege/vim-less' Plug 'tpope/vim-repeat'
"LESS highlighting | https://github.com/groenewege/vim-less "Repeat last tpope command with . | https://github.com/tpope/vim-repeat
Plug 'pangloss/vim-javascript' Plug 'tpope/vim-fugitive'
"JS syntax and indentation | https://github.com/pangloss/vim-javascript "Great Vim-Git compatibility | https://github.com/tpope/vim-fugitive
"Plug 'Lokaltog/powerline-fonts' Plug 'kien/ctrlp.vim'
" "Better powerline fonts | https://github.com/Lokaltog/powerline-fonts "Fuzzy file search | https://github.com/kien/ctrlp.vim
Plug 'bling/vim-airline' Plug 'godlygeek/tabular'
"Bottom status bar | https://github.com/bling/vim-airline "Quickly make tables in vim | https://github.com/godlygeek/tabular
Plug 'terryma/vim-multiple-cursors' Plug 'sirver/UltiSnips'
"Multicursor functionality like Coda | https://github.com/terryma/vim-multiple-cursors " "Adds snippets | https://github.com/sirver/UltiSnips
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'honza/vim-snippets'
"File browser | https://github.com/scrooloose/nerdtree "More snippets | https://github.com/honza/vim-snippets
"Plug 'altercation/vim-colors-solarized' Plug 'othree/eregex.vim'
" "Theme | https://github.com/altercation/vim-colors-solarized "Real regexes in vim | https://github.com/othree/eregex.vim
Plug 'stonewareslord/vim-colors' Plug 'Rykka/colorv.vim'
"Theme pack | https://github.com/spf13/vim-colors "Color selection in vim | https://github.com/Rykka/colorv.vim
"Plug 'spf13/PIV' Plug 'vim-scripts/DoxygenToolkit.vim'
" "PHP tools | https://github.com/spf13/PIV "Doxygen | https://github.com/vim-scripts/DoxygenToolkit.vim
"Plug 'vim-scripts/AutoTag' Plug 'mhinz/vim-signify'
" "Generates taglist with ctags | https://github.com/vim-scripts/AutoTag "Git information inline | https://github.com/mhinz/vim-signify
Plug 'Lokaltog/vim-easymotion' Plug 'https://github.com/jiangmiao/auto-pairs'
"Move around quickly in a document | https://github.com/Lokaltog/vim-easymotion "Automatic pairs | https://github.com/jiangmiao/auto-pairs
Plug 'sjl/gundo.vim' Plug 'https://github.com/Valloric/YouCompleteMe'
"Visual undo | https://github.com/sjl/gundo.vim " "Autocompletion | https://github.com/Valloric/YouCompleteMe
Plug 'tommcdo/vim-exchange' Plug 'https://github.com/joonty/vdebug'
"Exchange two selections of text | https://github.com/tommcdo/vim-exchange "Php debugging | https://github.com/joonty/vdebug
Plug 'tpope/vim-repeat' Plug 'https://github.com/zenbro/mirror.vim'
"Repeat last tpope command with . | https://github.com/tpope/vim-repeat "Edit files remotely | https://github.com/zenbro/mirror.vim
Plug 'tpope/vim-fugitive' Plug 'https://github.com/xolox/vim-easytags'
"Great Vim-Git compatibility | https://github.com/tpope/vim-fugitive "Vim tags | https://github.com/xolox/vim-easytags
Plug 'kien/ctrlp.vim' Plug 'https://github.com/xolox/vim-misc'
"Fuzzy file search | https://github.com/kien/ctrlp.vim "Misc (required for easytags) | https://github.com/xolox/vim-misc
Plug 'godlygeek/tabular' Plug 'https://austenwares.com/gogs/stonewareslord/vim-java-getset.git'
"Quickly make tables in vim | https://github.com/godlygeek/tabular "Java getters and setters| gogs@austenwares.com:stonewareslord/vim-java-getset.git
"Plug 'tpope/vim-abolish' Plug 'https://github.com/majutsushi/tagbar'
" "Better abbrivation | https://github.com/tpope/vim-abolish " | https://github.com/majutsushi/tagbar
Plug 'godlygeek/csapprox' " }
"256 color vim in terminal | https://github.com/godlygeek/csapprox " Style {
"Plug 'sirver/UltiSnips' Plug 'nathanaelkane/vim-indent-guides'
" "Adds snippets | https://github.com/sirver/UltiSnips "Indentation guides | https://github.com/nathanaelkane/vim-indent-guides
Plug 'honza/vim-snippets' Plug 'bling/vim-airline'
"More snippets | https://github.com/honza/vim-snippets "Bottom status bar | https://github.com/bling/vim-airline
Plug 'othree/eregex.vim' Plug 'stonewareslord/vim-colors'
"Real regexes in vim | https://github.com/othree/eregex.vim "Theme pack | https://github.com/spf13/vim-colors
"Plug 'vim-scripts/sessionman.vim' Plug 'godlygeek/csapprox'
" "Session manager | https://github.com/vim-scripts/sessionman.vim "256 color vim in terminal | https://github.com/godlygeek/csapprox
Plug 'mattn/flappyvird-vim' " }
"The amazing Flappy Bird game | https://github.com/mattn/flappyvird-vim " Syntax {
"Plug 'morhetz/gruvbox' Plug 'elzr/vim-json'
" "Colorscheme | https://github.com/morhetz/gruvbox "JSON highlighting | https://github.com/elzr/vim-json
Plug 'superbrothers/vim-vimperator' Plug 'groenewege/vim-less'
"Vimperator for vim | https://github.com/superbrothers/vim-vimperator "LESS highlighting | https://github.com/groenewege/vim-less
Plug 'Rykka/colorv.vim' Plug 'pangloss/vim-javascript'
"Color selection in vim | https://github.com/Rykka/colorv.vim "JS syntax and indentation | https://github.com/pangloss/vim-javascript
Plug 'mhinz/vim-signify' Plug 'superbrothers/vim-vimperator'
"Git information inline | https://github.com/mhinz/vim-signify "Vimperator for vim | https://github.com/superbrothers/vim-vimperator
Plug 'jamessan/vim-gnupg' Plug 'PotatoesMaster/i3-vim-syntax'
"GPG support | https://github.com/jamessan/vim-gnupg "i3 syntax | https://github.com/PotatoesMaster/i3-vim-syntax
Plug 'stonewareslord/zeavim.vim' Plug 'https://github.com/fatih/vim-go'
"Zeal support | https://github.com/stonewareslord/zeavim.vim "go syntax | https://github.com/fatih/vim-go
Plug 'vim-scripts/DirDiff.vim' Plug 'https://github.com/evidens/vim-twig'
"Directory diff | https://github.com/vim-scripts/DirDiff.vim "Twig highlighting | https://github.com/evidens/vim-twig
Plug 'vim-scripts/DoxygenToolkit.vim' " }
"Doxygen | https://github.com/vim-scripts/DoxygenToolkit.vim " Misc {
Plug 'vim-scripts/SyntaxRange' Plug 'mattn/flappyvird-vim'
"Range of syntaxes | https://github.com/vim-scripts/SyntaxRange "The amazing Flappy Bird game | https://github.com/mattn/flappyvird-vim
Plug 'PotatoesMaster/i3-vim-syntax' Plug 'jamessan/vim-gnupg'
"i3 syntax | https://github.com/PotatoesMaster/i3-vim-syntax "GPG support | https://github.com/jamessan/vim-gnupg
Plug 'https://github.com/fatih/vim-go' " }
"go syntax | https://github.com/fatih/vim-go " Unused {
"Plug 'https://github.com/kien/rainbow_parentheses.vim' "Plug 'vim-scripts/DirDiff.vim'
" "Colored parenthesis | https://github.com/kien/rainbow_parentheses.vim "Directory diff | https://github.com/vim-scripts/DirDiff.vim
Plug 'https://github.com/jiangmiao/auto-pairs' "Plug 'https://github.com/kien/rainbow_parentheses.vim'
"Automatic pairs | https://github.com/jiangmiao/auto-pairs " "Colored parenthesis | https://github.com/kien/rainbow_parentheses.vim
Plug 'https://github.com/Valloric/YouCompleteMe' "Plug 'vim-scripts/SyntaxRange'
" "Autocompletion | https://github.com/Valloric/YouCompleteMe "Range of syntaxes | https://github.com/vim-scripts/SyntaxRange
Plug 'https://github.com/evidens/vim-twig' " }
"Twig highlighting | https://github.com/evidens/vim-twig
Plug 'https://github.com/joonty/vdebug'
"Php debugging | https://github.com/joonty/vdebug
Plug 'https://github.com/zenbro/mirror.vim'
"Edit files remotely | https://github.com/zenbro/mirror.vim
Plug 'https://github.com/xolox/vim-easytags'
"Vim tags | https://github.com/xolox/vim-easytags
Plug 'https://github.com/xolox/vim-misc'
"Misc (required for easytags) | https://github.com/xolox/vim-misc
Plug 'https://github.com/lervag/vimtex'
" | https://github.com/lervag/vimtex
Plug 'https://github.com/habamax/vim-skipit'
" | https://github.com/habamax/vim-skipit
call plug#end() call plug#end()
filetype plugin indent on filetype plugin indent on
if exists("+undofile") if exists("+undofile")
@ -380,7 +369,6 @@ else
"colorscheme torte "colorscheme torte
endif endif
silent! colorscheme fruity silent! colorscheme fruity
nnoremap <Leader>W :%s/\s\+$//<cr>:let @/=''<cr>
function! Initialize() function! Initialize()
if has("win32") if has("win32")
if empty(glob("~/_vim/autoload/plug.vim")) if empty(glob("~/_vim/autoload/plug.vim"))
@ -419,3 +407,6 @@ endfunction
\ 're!\\[A-Za-z]*(ref|cite)[A-Za-z]*([^]]*])?{([^}]*, ?)*' \ 're!\\[A-Za-z]*(ref|cite)[A-Za-z]*([^]]*])?{([^}]*, ?)*'
\ ] \ ]
set guifont=Fixed\ Medium\ Semi-Condensed\ 10 set guifont=Fixed\ Medium\ Semi-Condensed\ 10
inoremap <Tab> <C-R>=g:UltiSnips_Complete()<cr>
map <unique> <buffer> <LocalLeader>b <Plug>JavagetsetInsertBothGetterSetter
map <Leader>a m":Autoformat<CR>:%S/\n\n+/\r/<CR>`"