Revamp
This commit is contained in:
parent
02f1e08bf8
commit
eff7e9d880
10 changed files with 81 additions and 357 deletions
21
Makefile
21
Makefile
|
@ -5,11 +5,24 @@ symlinks = $(shell ls $(excludes) `pwd`)
|
||||||
|
|
||||||
all: install
|
all: install
|
||||||
|
|
||||||
install: repos $(symlinks)
|
install: plug-vim $(symlinks)
|
||||||
|
|
||||||
repos:
|
plug-vim:
|
||||||
if test ! -d ~/.vim/bundle/vundle ; then \
|
if test ! -d ~/.vim/autoload/plug.vim ; then \
|
||||||
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/vundle ; \
|
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
|
||||||
|
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim ; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
rbenv: rbenv-base rbenv-build
|
||||||
|
|
||||||
|
rbenv-base:
|
||||||
|
if test ! -d ~/.rbenv ; then \
|
||||||
|
git clone https://github.com/rbenv/rbenv.git ~/.rbenv ; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
rbenv-build:
|
||||||
|
if test ! -d ~/.rbenv/plugins/ruby-build ; then \
|
||||||
|
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$(symlinks):
|
$(symlinks):
|
||||||
|
|
30
aliases
30
aliases
|
@ -3,25 +3,15 @@ alias ...="cd ../.."
|
||||||
alias ....="cd ../../.."
|
alias ....="cd ../../.."
|
||||||
alias .....="cd ../../../.."
|
alias .....="cd ../../../.."
|
||||||
alias a="ls -l --human-readable --all --color=auto"
|
alias a="ls -l --human-readable --all --color=auto"
|
||||||
alias agi="sudo apt-get install"
|
|
||||||
alias agl="dpkg --get-selections"
|
|
||||||
alias agL="dpkg --listfiles"
|
|
||||||
alias agu="sudo apt-get update && sudo apt-get upgrade"
|
|
||||||
alias al="zsh_stats"
|
|
||||||
alias awsp="aws-profile"
|
alias awsp="aws-profile"
|
||||||
alias b="bundle"
|
alias b="bundle"
|
||||||
alias be="bundle exec"
|
alias be="bundle exec"
|
||||||
alias bea="bundle exec rails"
|
alias bea="bundle exec rails"
|
||||||
alias beg="bundle exec guard"
|
|
||||||
alias bej="bundle exec jekyll"
|
|
||||||
alias ber="bundle exec rake"
|
alias ber="bundle exec rake"
|
||||||
alias bet="bundle exec rspec"
|
alias bet="bundle exec rspec"
|
||||||
alias betd="bundle exec rspec --format documentation"
|
alias betd="bundle exec rspec --format documentation"
|
||||||
alias c="clear"
|
alias c="clear"
|
||||||
alias dc="docker-compose"
|
alias dc="docker-compose"
|
||||||
alias dcu="docker-compose up -d"
|
|
||||||
alias dcr="docker-compose rm --all"
|
|
||||||
alias f="map-sshfs"
|
|
||||||
alias g="g" # overwrite g alias in git plugin so function will work
|
alias g="g" # overwrite g alias in git plugin so function will work
|
||||||
alias ga="git add"
|
alias ga="git add"
|
||||||
alias gaa="git add --all"
|
alias gaa="git add --all"
|
||||||
|
@ -29,13 +19,13 @@ alias gap="git add --patch"
|
||||||
alias gb="git branch"
|
alias gb="git branch"
|
||||||
alias gbc="git branch --merged master | grep -v master | xargs git branch -d"
|
alias gbc="git branch --merged master | grep -v master | xargs git branch -d"
|
||||||
alias gbda="git branch | grep -v master | xargs git branch -D"
|
alias gbda="git branch | grep -v master | xargs git branch -D"
|
||||||
|
alias gbdm='git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d'
|
||||||
alias gc="git commit"
|
alias gc="git commit"
|
||||||
alias gca="git commit --amend"
|
alias gca="git commit --amend"
|
||||||
alias gcm="echo Do not specify message at command line. Use gc"
|
alias gcm="echo Do not specify message at command line. Use gc"
|
||||||
alias gco="git checkout"
|
alias gco="git checkout"
|
||||||
alias gd="git diff"
|
alias gd="git diff"
|
||||||
alias gdc="git diff --cached"
|
alias gdc="git diff --cached"
|
||||||
alias gdm='git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d'
|
|
||||||
alias gds="git diff --stat"
|
alias gds="git diff --stat"
|
||||||
alias gdss="git diff --shortstat"
|
alias gdss="git diff --shortstat"
|
||||||
alias gfa="git-date-added"
|
alias gfa="git-date-added"
|
||||||
|
@ -58,7 +48,6 @@ alias grbc="git rebase --continue"
|
||||||
alias grbi="git rebase --interactive"
|
alias grbi="git rebase --interactive"
|
||||||
alias grc="git rm --cached"
|
alias grc="git rm --cached"
|
||||||
alias grh="git reset --hard"
|
alias grh="git reset --hard"
|
||||||
alias gri="echo Use grbi"
|
|
||||||
alias grm="git rm"
|
alias grm="git rm"
|
||||||
alias gs="git status"
|
alias gs="git status"
|
||||||
alias gup="git remote update --prune"
|
alias gup="git remote update --prune"
|
||||||
|
@ -67,40 +56,23 @@ alias Grep='grep'
|
||||||
alias h='heroku'
|
alias h='heroku'
|
||||||
alias hp='git push heroku master'
|
alias hp='git push heroku master'
|
||||||
alias hip='heroku logs -n 1500 | grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" | sort | uniq'
|
alias hip='heroku logs -n 1500 | grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" | sort | uniq'
|
||||||
alias jb="./gradlew"
|
|
||||||
alias jbd="./gradlew dependencies"
|
|
||||||
alias jbr="./gradlew run"
|
|
||||||
alias jbt="./gradlew test"
|
|
||||||
alias l="ls"
|
alias l="ls"
|
||||||
alias ll="ls -lv --human-readable --color=auto"
|
alias ll="ls -lv --human-readable --color=auto"
|
||||||
alias lp="librarian-puppet"
|
|
||||||
alias ls="ls --color=auto"
|
alias ls="ls --color=auto"
|
||||||
alias m="more"
|
alias m="more"
|
||||||
alias md="cd ~/dotfiles > /dev/null 2>&1; make; cd -1 > /dev/null 2>&1"
|
alias md="cd ~/dotfiles > /dev/null 2>&1; make; cd -1 > /dev/null 2>&1"
|
||||||
alias mf="mkdir"
|
alias mf="mkdir"
|
||||||
alias ms="tmux -S /tmp/pair && chmod 777 /tmp/pair"
|
|
||||||
alias mw="tmux new-session -A -s work"
|
alias mw="tmux new-session -A -s work"
|
||||||
alias p="sudo"
|
|
||||||
alias pf="port-forward"
|
alias pf="port-forward"
|
||||||
alias r="ssh"
|
alias r="ssh"
|
||||||
alias rd="popd"
|
alias rd="popd"
|
||||||
alias rs="bundle exec rspec"
|
|
||||||
alias s="cd ~/Source"
|
alias s="cd ~/Source"
|
||||||
alias sci="ssh-copy-id -i .ssh/id_rsa.pub"
|
alias sci="ssh-copy-id -i .ssh/id_rsa.pub"
|
||||||
alias sd="pwd | pushd"
|
alias sd="pwd | pushd"
|
||||||
alias sfs="map-sshfs"
|
|
||||||
alias sz="source ~/.zshrc"
|
alias sz="source ~/.zshrc"
|
||||||
alias t="tmux"
|
alias t="tmux"
|
||||||
alias tls="tmux list-sessions"
|
alias tls="tmux list-sessions"
|
||||||
alias v="vim"
|
alias v="vim"
|
||||||
alias vd="vagrant destroy"
|
|
||||||
alias vh="vagrant halt"
|
|
||||||
alias vn="vim -u NONE"
|
|
||||||
alias vp="vagrant provision"
|
|
||||||
alias vr="vagrant reload"
|
|
||||||
alias vs="vagrant status"
|
|
||||||
alias vssh="vagrant ssh"
|
|
||||||
alias vu="vagrant up"
|
|
||||||
alias w="python -m SimpleHTTPServer"
|
alias w="python -m SimpleHTTPServer"
|
||||||
alias wo="curl http://wttr.in/48912?m"
|
alias wo="curl http://wttr.in/48912?m"
|
||||||
alias x="exit"
|
alias x="exit"
|
||||||
|
|
|
@ -27,14 +27,6 @@ function port-forward {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function map-sshfs {
|
|
||||||
if [ $# -eq 0 ]; then
|
|
||||||
echo Usage: map-sshfs HOST DIRECTORY MOUNT
|
|
||||||
else
|
|
||||||
sshfs -o idmap=user -o workaround=rename $USER'@'$1':'$2 $HOME'/Mounts/'$3
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function gitignore-io {
|
function gitignore-io {
|
||||||
curl https://www.gitignore.io/api/$@
|
curl https://www.gitignore.io/api/$@
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# Copyright 2012 The Go Authors. All rights reserved.
|
|
||||||
# Use of this source code is governed by a BSD-style
|
|
||||||
# license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
# git gofmt pre-commit hook
|
|
||||||
#
|
|
||||||
# To use, store as .git/hooks/pre-commit inside your repository and make sure
|
|
||||||
# it has execute permissions.
|
|
||||||
#
|
|
||||||
# This script does not handle file names that contain spaces.
|
|
||||||
|
|
||||||
gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '.go$')
|
|
||||||
[ -z "$gofiles" ] && exit 0
|
|
||||||
|
|
||||||
unformatted=$(gofmt -l $gofiles)
|
|
||||||
[ -z "$unformatted" ] && exit 0
|
|
||||||
|
|
||||||
# Some files are not gofmt'd. Print message and fail.
|
|
||||||
|
|
||||||
echo >&2 "Go files must be formatted with gofmt. Please run:"
|
|
||||||
for fn in $unformatted; do
|
|
||||||
echo >&2 " gofmt -w $PWD/$fn"
|
|
||||||
done
|
|
||||||
|
|
||||||
exit 1
|
|
|
@ -32,8 +32,6 @@
|
||||||
autocrlf = input
|
autocrlf = input
|
||||||
editor = vim
|
editor = vim
|
||||||
filemode = false
|
filemode = false
|
||||||
[init]
|
|
||||||
templatedir = ~/.git_template
|
|
||||||
[merge]
|
[merge]
|
||||||
tool = vimdiff
|
tool = vimdiff
|
||||||
[push]
|
[push]
|
||||||
|
|
8
linux.sh
8
linux.sh
|
@ -1,8 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if test ! -d ~/.rbenv ; then
|
|
||||||
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
|
|
||||||
fi
|
|
||||||
if test ! -d ~/.rbenv/plugins/ruby-build ; then
|
|
||||||
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
|
|
||||||
fi
|
|
16
tmux.conf
16
tmux.conf
|
@ -1,14 +1,14 @@
|
||||||
# for setting up
|
# for setting up
|
||||||
bind-key r source-file ~/.tmux.conf \; display-message " ✱ ~/.tmux.conf is reloaded"
|
bind-key r source-file ~/.tmux.conf \; display-message " ✱ ~/.tmux.conf is reloaded"
|
||||||
|
|
||||||
# ctrl-b is annoying
|
# 256 colors
|
||||||
set-option -g prefix C-a
|
set -g default-terminal "screen-256color"
|
||||||
|
|
||||||
# double tap for back and forth
|
# double tap for back and forth
|
||||||
bind-key C-a last-window
|
bind-key C-b last-window
|
||||||
|
|
||||||
# for muxception
|
# for muxception
|
||||||
bind-key a send-prefix
|
bind-key b send-prefix
|
||||||
|
|
||||||
# close window
|
# close window
|
||||||
bind q confirm kill-window
|
bind q confirm kill-window
|
||||||
|
@ -17,10 +17,7 @@ bind q confirm kill-window
|
||||||
set-option -g base-index 1
|
set-option -g base-index 1
|
||||||
setw -g pane-base-index 1
|
setw -g pane-base-index 1
|
||||||
|
|
||||||
# 256 colors (bce matches whatever I am doing with t_Co=256 in vim)
|
# history should be longer
|
||||||
set -g default-terminal "screen-256color"
|
|
||||||
|
|
||||||
# hostry should be longer
|
|
||||||
set -g history-limit 10000
|
set -g history-limit 10000
|
||||||
|
|
||||||
# no autorename
|
# no autorename
|
||||||
|
@ -61,4 +58,5 @@ set-option -g status-right '%d %b %Y @ %k:%M'
|
||||||
|
|
||||||
# because the new tmux is inadequate
|
# because the new tmux is inadequate
|
||||||
source-file ~/.tmux.1-8.conf # always source the 1.8 file
|
source-file ~/.tmux.1-8.conf # always source the 1.8 file
|
||||||
if-shell 'tmux -V | grep -q "1.9\|2.0\|2.1\|2.2"' "source-file ~/.tmux.1-9.conf"
|
if-shell "[[ `tmux -V | cut -d' ' -f2` -ge 1.9 ]]" \
|
||||||
|
"source-file ~/.tmux.1-9.conf"
|
||||||
|
|
236
vimrc
236
vimrc
|
@ -1,49 +1,41 @@
|
||||||
scriptencoding utf-8
|
" PLUGINS
|
||||||
set encoding=utf-8
|
call plug#begin('~/.vim/plugged')
|
||||||
|
|
||||||
" fix colors in some ubuntu terminals
|
" colors
|
||||||
set background=dark
|
Plug 'alessandroyorba/alduin'
|
||||||
|
Plug 'nanotech/jellybeans.vim'
|
||||||
|
|
||||||
" vundle bundle; not for changing
|
" keepers
|
||||||
set nocompatible " Disable vi compatibility
|
Plug 'airblade/vim-gitgutter'
|
||||||
filetype off
|
Plug 'bronson/vim-trailing-whitespace'
|
||||||
|
Plug 'ctrlpvim/ctrlp.vim'
|
||||||
|
Plug 'rbgrouleff/bclose.vim'
|
||||||
|
Plug 'tpope/vim-surround'
|
||||||
|
Plug 'vim-scripts/ZoomWin'
|
||||||
|
|
||||||
set runtimepath+=~/.vim/bundle/vundle/
|
" languages
|
||||||
call vundle#begin()
|
Plug 'fatih/vim-go'
|
||||||
|
Plug 'posva/vim-vue'
|
||||||
|
Plug 'tpope/vim-markdown'
|
||||||
|
Plug 'tpope/vim-rails'
|
||||||
|
Plug 'vim-ruby/vim-ruby'
|
||||||
|
|
||||||
Plugin 'gmarik/vundle'
|
" maybe
|
||||||
|
Plug 'tommcdo/vim-lion'
|
||||||
|
Plug 'tpope/vim-fugitive'
|
||||||
|
Plug 'tpope/vim-repeat'
|
||||||
|
|
||||||
Plugin 'airblade/vim-gitgutter'
|
call plug#end()
|
||||||
Plugin 'bronson/vim-trailing-whitespace'
|
|
||||||
Plugin 'ctrlpvim/ctrlp.vim'
|
|
||||||
Plugin 'editorconfig/editorconfig-vim'
|
|
||||||
Plugin 'fatih/vim-go'
|
|
||||||
Plugin 'godlygeek/tabular'
|
|
||||||
Plugin 'itchyny/lightline.vim'
|
|
||||||
Plugin 'nathanaelkane/vim-indent-guides'
|
|
||||||
Plugin 'posva/vim-vue'
|
|
||||||
Plugin 'rbgrouleff/bclose.vim'
|
|
||||||
Plugin 'rodjek/vim-puppet'
|
|
||||||
Plugin 'thoughtbot/vim-rspec'
|
|
||||||
Plugin 'tpope/vim-dispatch'
|
|
||||||
Plugin 'tpope/vim-endwise'
|
|
||||||
Plugin 'tpope/vim-fugitive'
|
|
||||||
Plugin 'tpope/vim-markdown'
|
|
||||||
Plugin 'tpope/vim-rails'
|
|
||||||
Plugin 'tpope/vim-repeat'
|
|
||||||
Plugin 'tpope/vim-surround'
|
|
||||||
Plugin 'tpope/vim-vividchalk'
|
|
||||||
Plugin 'vim-ruby/vim-ruby'
|
|
||||||
|
|
||||||
call vundle#end()
|
" STATUS LINE
|
||||||
filetype plugin indent on
|
set statusline=%<\ %f\ %m%r%y%w%=%l\/%-6L\ %3c\
|
||||||
" end vundle
|
|
||||||
|
|
||||||
" Options
|
" OPTIONS
|
||||||
set fileformats=unix,mac,dos " File format prefer unix endings
|
set fileformats=unix,mac,dos " File format prefer unix endings
|
||||||
set endofline " Add newlien at end of file
|
set endofline " Add newlien at end of file
|
||||||
set shellslash " Forward slashes
|
set shellslash " Forward slashes
|
||||||
set nobackup " No backup files
|
set nobackup " No backup files
|
||||||
|
set noswapfile " Hope for the best
|
||||||
set formatoptions=crq
|
set formatoptions=crq
|
||||||
set textwidth=80
|
set textwidth=80
|
||||||
set cpoptions+=$ " delimit end of change text
|
set cpoptions+=$ " delimit end of change text
|
||||||
|
@ -55,8 +47,8 @@ set cursorcolumn " Highlight current column
|
||||||
set nowrap " Disable wrapping by default
|
set nowrap " Disable wrapping by default
|
||||||
set backspace=2 " Backspace over indent, eol, start of insert
|
set backspace=2 " Backspace over indent, eol, start of insert
|
||||||
set hlsearch " Search highlights
|
set hlsearch " Search highlights
|
||||||
set wrapscan " Wraped search
|
set wrapscan " Wrapped search
|
||||||
set incsearch " Search as yuo type
|
set incsearch " Search as you type
|
||||||
set ignorecase " Ignore case with search
|
set ignorecase " Ignore case with search
|
||||||
set smartcase " Search will not ignore uppercase
|
set smartcase " Search will not ignore uppercase
|
||||||
set showcmd " Show command as you type
|
set showcmd " Show command as you type
|
||||||
|
@ -67,7 +59,6 @@ set colorcolumn=80 " Ruler at line 80
|
||||||
set nomodeline
|
set nomodeline
|
||||||
set relativenumber " Relative line numbers
|
set relativenumber " Relative line numbers
|
||||||
set number
|
set number
|
||||||
set noswapfile " Hope for the best
|
|
||||||
set virtualedit=all " Cursor can go anywhere
|
set virtualedit=all " Cursor can go anywhere
|
||||||
set scrolloff=3 " Keep cursor from touching edges
|
set scrolloff=3 " Keep cursor from touching edges
|
||||||
set timeoutlen=500 " Don't wait too long (ambiguous leaders)
|
set timeoutlen=500 " Don't wait too long (ambiguous leaders)
|
||||||
|
@ -76,19 +67,14 @@ set hidden " Allow unsaved buffers to be hidden
|
||||||
set wildmenu " Command line completion
|
set wildmenu " Command line completion
|
||||||
set wildmode=list:longest,full " Better file completion
|
set wildmode=list:longest,full " Better file completion
|
||||||
set infercase " Adjust completions to match case
|
set infercase " Adjust completions to match case
|
||||||
set noshowmode " Already tracking mode with plugin
|
|
||||||
set wildignorecase " Ignore case on commandline
|
set wildignorecase " Ignore case on commandline
|
||||||
set autowrite " Save file when focus is lost
|
set autowrite " Save file when focus is lost
|
||||||
" Make syntax highlighting faster
|
|
||||||
syntax sync minlines=256
|
|
||||||
set ttyfast
|
|
||||||
set lazyredraw
|
|
||||||
" Tabs are 2 spaces
|
" Tabs are 2 spaces
|
||||||
set tabstop=2
|
set tabstop=2
|
||||||
set softtabstop=2
|
set softtabstop=2
|
||||||
set shiftwidth=2
|
set shiftwidth=2
|
||||||
set expandtab
|
set expandtab
|
||||||
set shiftround " if at odd number spaces, make >> go to next even
|
set shiftround " make >> go to next tab
|
||||||
" Show whitespace markers before cursor in insert mode
|
" Show whitespace markers before cursor in insert mode
|
||||||
set list listchars=tab:\ \ ,trail:·
|
set list listchars=tab:\ \ ,trail:·
|
||||||
" Ignore stuff
|
" Ignore stuff
|
||||||
|
@ -104,42 +90,21 @@ if has('persistent_undo')
|
||||||
set undofile
|
set undofile
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Filetype stuff
|
" KEYBINDS
|
||||||
syntax on
|
|
||||||
|
|
||||||
" Keybinds
|
|
||||||
" ctrl+s for save spam
|
|
||||||
map <C-s> <esc>:w<CR>
|
|
||||||
imap <C-s> <esc>:w<CR>
|
|
||||||
|
|
||||||
" quick replaceement
|
" quick replaceement
|
||||||
nmap S :%s//g<LEFT><LEFT>
|
nmap S :%s//g<LEFT><LEFT>
|
||||||
|
|
||||||
" consistency is key - Y should act like C, D
|
" consistency is key - Y should act like C, D
|
||||||
map Y y$
|
map Y y$
|
||||||
|
|
||||||
" Still using arrow keys when in insert mode sometimes
|
|
||||||
map <Left> <NOP>
|
|
||||||
map <Right> <NOP>
|
|
||||||
map <Up> <NOP>
|
|
||||||
map <Down> <NOP>
|
|
||||||
inoremap <Left> <NOP>
|
|
||||||
inoremap <Right> <NOP>
|
|
||||||
inoremap <Up> <NOP>
|
|
||||||
inoremap <Down> <NOP>
|
|
||||||
|
|
||||||
" Don't cancel visual mode while indenting
|
" Don't cancel visual mode while indenting
|
||||||
vnoremap > >gv
|
vnoremap > >gv
|
||||||
vnoremap < <gv
|
vnoremap < <gv
|
||||||
|
|
||||||
" Use better search highlighting
|
" ZoomWin
|
||||||
nnoremap <silent> n n:call HLNext(0.4)<cr>
|
nmap <c-w>z <Plug>ZoomWin
|
||||||
nnoremap <silent> N N:call HLNext(0.4)<cr>
|
|
||||||
|
|
||||||
" i don't even know what semi-colon does so steal it
|
" LEADERS
|
||||||
noremap ; :
|
|
||||||
|
|
||||||
" Leaders (shortcuts)
|
|
||||||
let mapleader = ","
|
let mapleader = ","
|
||||||
|
|
||||||
" tab swaps
|
" tab swaps
|
||||||
|
@ -147,107 +112,34 @@ map <Leader>2 :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab<cr>
|
||||||
map <Leader>4 :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab<cr>
|
map <Leader>4 :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab<cr>
|
||||||
map <Leader>a :set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab<cr>
|
map <Leader>a :set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab<cr>
|
||||||
|
|
||||||
" buffer movement
|
" plugin
|
||||||
map <Leader>h :wincmd h<cr>
|
map <Leader>bi :PlugInstall<cr>
|
||||||
map <Leader>j :wincmd j<cr>
|
map <Leader>bu :PlugUpdate<cr>
|
||||||
map <Leader>k :wincmd k<cr>
|
|
||||||
map <Leader>l :wincmd l<cr>
|
|
||||||
|
|
||||||
" auto character alignment
|
|
||||||
map <Leader>t> :Tabularize /=><cr>
|
|
||||||
map <Leader>te :Tabularize /=<cr>
|
|
||||||
|
|
||||||
" vundle
|
|
||||||
map <Leader>bi :PluginInstall<cr>
|
|
||||||
map <Leader>bu :PluginInstall!<cr>
|
|
||||||
|
|
||||||
" copy and paste - for Linux
|
|
||||||
map <Leader>c "+
|
|
||||||
map <Leader>p "+p
|
|
||||||
map <Leader>pm :set paste!<cr>
|
|
||||||
|
|
||||||
" clear search
|
" clear search
|
||||||
map <Leader>cs :let @/ = ""<cr>
|
map <Leader>cs :let @/ = ""<cr>
|
||||||
" indent and return
|
|
||||||
map <Leader>i mmgg=G`m<cr>
|
|
||||||
" reload all buffers
|
|
||||||
map <Leader>ra :bufdo e!<cr>
|
|
||||||
" this was better when it was :Sexplore...
|
|
||||||
map <Leader>s :Vexplore ~/Source/<cr>
|
|
||||||
map <Leader>d :Vexplore .<cr>
|
|
||||||
|
|
||||||
" bclose
|
" bclose
|
||||||
nnoremap <silent> <Leader>bd :Bclose<CR>
|
nnoremap <silent> <Leader>bd :Bclose<CR>
|
||||||
nnoremap <silent> <Leader>bD :Bclose!<CR>
|
nnoremap <silent> <Leader>bD :Bclose!<CR>
|
||||||
nnoremap <silent> <Leader>BD :Bclose!<CR>
|
nnoremap <silent> <Leader>BD :Bclose!<CR>
|
||||||
|
|
||||||
|
" other
|
||||||
map <Leader>fw :FixWhitespace<cr>
|
map <Leader>fw :FixWhitespace<cr>
|
||||||
map <Leader>lf :call LargeFileToggle()<cr>
|
map <Leader>pm :set paste!<cr>
|
||||||
map <Leader>sa :call RenameFile()<cr>
|
map <Leader>sa :call RenameFile()<cr>
|
||||||
map <Leader>se :e ~/.vimrc<cr>
|
map <Leader>se :e ~/.vimrc<cr>
|
||||||
map <Leader>st :call SyntaxToggle()<cr>
|
|
||||||
map <Leader>sz :so ~/.vimrc<cr>
|
map <Leader>sz :so ~/.vimrc<cr>
|
||||||
map <Leader>ts :sp ~/tool-sharpener.txt<cr>
|
|
||||||
|
|
||||||
" rspec
|
" PLUGIN CONFIGURATION
|
||||||
map <Leader>t :w<cr>:call RunNearestSpec()<cr>
|
" style
|
||||||
|
colorscheme jellybeans
|
||||||
" Set style
|
syntax enable
|
||||||
colorscheme vividchalk
|
|
||||||
" special case colors set at end of file via function
|
|
||||||
|
|
||||||
" dispatch fix for bundle exec rspec always quickfixing
|
|
||||||
let g:dispatch_compilers = {
|
|
||||||
\ 'bundle exec': ''}
|
|
||||||
|
|
||||||
" rspec
|
|
||||||
let g:rspec_command = "Dispatch bundle exec rspec {spec}"
|
|
||||||
|
|
||||||
" Indentation
|
|
||||||
let g:indent_guides_guide_size=1
|
|
||||||
let g:indent_guides_enable_on_vim_startup=1
|
|
||||||
let g:indent_guides_auto_colors=0
|
|
||||||
|
|
||||||
" lightline
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'colorscheme': 'wombat',
|
|
||||||
\ 'active': {
|
|
||||||
\ 'left': [ [ 'mode', 'paste' ],
|
|
||||||
\ [ 'fugitive', 'filename' ] ]
|
|
||||||
\ },
|
|
||||||
\ 'component': {
|
|
||||||
\ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'
|
|
||||||
\ },
|
|
||||||
\ 'component_visible_condition': {
|
|
||||||
\ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'
|
|
||||||
\ }
|
|
||||||
\ }
|
|
||||||
|
|
||||||
" go
|
" go
|
||||||
let g:go_fmt_command = "goimports"
|
let g:go_fmt_command = "goimports"
|
||||||
|
|
||||||
" editorconfig with fugitive
|
" FUNCTIONS
|
||||||
let g:EditorConfig_exclude_patterns = ['fugitive://.*']
|
|
||||||
|
|
||||||
" Functions
|
|
||||||
" Toggle relative line numbers and cursorline; useful for long line files
|
|
||||||
function! LargeFileToggle()
|
|
||||||
set relativenumber!
|
|
||||||
set cursorline!
|
|
||||||
set cursorcolumn!
|
|
||||||
call SyntaxToggle()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Toggle syntax highlighting
|
|
||||||
function! SyntaxToggle()
|
|
||||||
if exists("g:syntax_on")
|
|
||||||
:syntax off
|
|
||||||
else
|
|
||||||
syntax enable
|
|
||||||
endif
|
|
||||||
call SetColors()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Rename current file - from github/garybernhardt
|
" Rename current file - from github/garybernhardt
|
||||||
function! RenameFile()
|
function! RenameFile()
|
||||||
let old_name = expand('%')
|
let old_name = expand('%')
|
||||||
|
@ -258,43 +150,3 @@ function! RenameFile()
|
||||||
redraw!
|
redraw!
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Blink current search item - from Damian Conway 'More Instantly Better Vim'
|
|
||||||
function! HLNext (blinktime)
|
|
||||||
let [bufnum, lnum, col, off] = getpos('.')
|
|
||||||
let matchlen = strlen(matchstr(strpart(getline('.'),col-1),@/))
|
|
||||||
let target_pat = '\c\%#'.@/
|
|
||||||
let ring = matchadd('ErrorMsg', target_pat, 101)
|
|
||||||
redraw
|
|
||||||
exec 'sleep ' . float2nr(a:blinktime * 1000) . 'm'
|
|
||||||
call matchdelete(ring)
|
|
||||||
redraw
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Zoom / Restore window.
|
|
||||||
function! s:ZoomToggle() abort
|
|
||||||
if exists('t:zoomed') && t:zoomed
|
|
||||||
execute t:zoom_winrestcmd
|
|
||||||
let t:zoomed = 0
|
|
||||||
else
|
|
||||||
let t:zoom_winrestcmd = winrestcmd()
|
|
||||||
resize
|
|
||||||
vertical resize
|
|
||||||
let t:zoomed = 1
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
command! ZoomToggle call s:ZoomToggle()
|
|
||||||
nnoremap <silent> <C-w>z :ZoomToggle<CR>
|
|
||||||
|
|
||||||
" Set special case colors
|
|
||||||
function! SetColors()
|
|
||||||
highlight CursorLine cterm=NONE ctermbg=234
|
|
||||||
highlight CursorColumn cterm=NONE ctermbg=234
|
|
||||||
highlight StatusLine ctermfg=white ctermbg=236
|
|
||||||
highlight ColorColumn ctermbg=234
|
|
||||||
highlight IndentGuidesOdd ctermbg=black
|
|
||||||
highlight IndentGuidesEven ctermbg=234
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Needs to come after SetColors definition
|
|
||||||
call SetColors()
|
|
||||||
|
|
|
@ -1,73 +0,0 @@
|
||||||
# fixme - the load process here seems a bit bizarre
|
|
||||||
|
|
||||||
unsetopt menu_complete # do not autoselect the first completion entry
|
|
||||||
unsetopt flowcontrol
|
|
||||||
setopt auto_menu # show completion menu on succesive tab press
|
|
||||||
setopt complete_in_word
|
|
||||||
setopt always_to_end
|
|
||||||
|
|
||||||
WORDCHARS=''
|
|
||||||
|
|
||||||
zmodload -i zsh/complist
|
|
||||||
|
|
||||||
## case-insensitive (all),partial-word and then substring completion
|
|
||||||
if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
|
|
||||||
zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
|
||||||
unset CASE_SENSITIVE
|
|
||||||
else
|
|
||||||
if [ "x$HYPHEN_INSENSITIVE" = "xtrue" ]; then
|
|
||||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
|
||||||
unset HYPHEN_INSENSITIVE
|
|
||||||
else
|
|
||||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
zstyle ':completion:*' list-colors ''
|
|
||||||
|
|
||||||
# should this be in keybindings?
|
|
||||||
bindkey -M menuselect '^o' accept-and-infer-next-history
|
|
||||||
|
|
||||||
zstyle ':completion:*:*:*:*:*' menu select
|
|
||||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
|
|
||||||
if [ "$OSTYPE[0,7]" = "solaris" ]
|
|
||||||
then
|
|
||||||
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm"
|
|
||||||
else
|
|
||||||
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# disable named-directories autocompletion
|
|
||||||
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
|
|
||||||
|
|
||||||
# Use caching so that commands like apt and dpkg complete are useable
|
|
||||||
zstyle ':completion::complete:*' use-cache 1
|
|
||||||
zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR
|
|
||||||
|
|
||||||
# Don't complete uninteresting users
|
|
||||||
zstyle ':completion:*:*:*:users' ignored-patterns \
|
|
||||||
adm amanda apache at avahi avahi-autoipd beaglidx bin cacti canna \
|
|
||||||
clamav daemon dbus distcache dnsmasq dovecot fax ftp games gdm \
|
|
||||||
gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust kdm \
|
|
||||||
ldap lp mail mailman mailnull man messagebus mldonkey mysql nagios \
|
|
||||||
named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \
|
|
||||||
operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \
|
|
||||||
rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \
|
|
||||||
usbmux uucp vcsa wwwrun xfs '_*'
|
|
||||||
|
|
||||||
# ... unless we really want to.
|
|
||||||
zstyle '*' single-ignored show
|
|
||||||
|
|
||||||
if [[ $COMPLETION_WAITING_DOTS = true ]]; then
|
|
||||||
expand-or-complete-with-dots() {
|
|
||||||
# toggle line-wrapping off and back on again
|
|
||||||
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti rmam
|
|
||||||
print -Pn "%{%F{red}......%f%}"
|
|
||||||
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti smam
|
|
||||||
|
|
||||||
zle expand-or-complete
|
|
||||||
zle redisplay
|
|
||||||
}
|
|
||||||
zle -N expand-or-complete-with-dots
|
|
||||||
bindkey "^I" expand-or-complete-with-dots
|
|
||||||
fi
|
|
18
zshrc
18
zshrc
|
@ -18,7 +18,6 @@ source $HOME/.aliases
|
||||||
source $HOME/.functions
|
source $HOME/.functions
|
||||||
|
|
||||||
source $HOME/.zsh/prompt
|
source $HOME/.zsh/prompt
|
||||||
source $HOME/.zsh/completion
|
|
||||||
|
|
||||||
if [[ "$OSTYPE" == darwin* ]]; then
|
if [[ "$OSTYPE" == darwin* ]]; then
|
||||||
source $HOME/.aliases-mac
|
source $HOME/.aliases-mac
|
||||||
|
@ -28,11 +27,6 @@ fi
|
||||||
zle -N insert-sudo
|
zle -N insert-sudo
|
||||||
bindkey "^z" insert-sudo
|
bindkey "^z" insert-sudo
|
||||||
|
|
||||||
# make 256colors work maybe
|
|
||||||
if [ $TERM="xterm" ]; then
|
|
||||||
export TERM=xterm-256color
|
|
||||||
fi
|
|
||||||
|
|
||||||
# default editor is vim
|
# default editor is vim
|
||||||
export EDITOR='vim'
|
export EDITOR='vim'
|
||||||
|
|
||||||
|
@ -45,3 +39,15 @@ fi
|
||||||
if test -d "$NVM_DIR"; then
|
if test -d "$NVM_DIR"; then
|
||||||
source "$NVM_DIR/nvm.sh"
|
source "$NVM_DIR/nvm.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# temporary fix for tmux
|
||||||
|
bindkey "^a" beginning-of-line
|
||||||
|
bindkey "^e" end-of-line
|
||||||
|
|
||||||
|
# completion
|
||||||
|
autoload -U compinit
|
||||||
|
compinit
|
||||||
|
setopt completeinword
|
||||||
|
|
||||||
|
# directory
|
||||||
|
setopt auto_cd
|
||||||
|
|
Loading…
Reference in a new issue