5FLTMCXWFLP6MI36R73NDC5ZZGKRB66IXOWY7ZTESTLC7M357H2QC " --- the plugins are between the call plug begin and endcall plug#begin('~/.vim/plugged')Plug 'bronson/vim-trailing-whitespace'Plug 'rking/ag.vim'Plug 'SirVer/ultisnips', { 'on': [] } | Plug 'honza/vim-snippets'Plug 'Valloric/YouCompleteMe', { 'on': [] }Plug 'rdnetto/YCM-Generator', { 'branch': 'stable'}Plug 'tpope/vim-surround'" Unite depend on vimprocPlug 'Shougo/vimproc.vim',{'do':'make'}Plug 'Shougo/unite.vim'" Swift syntax and indent filesPlug 'keith/swift.vim'" syntasticPlug 'https://github.com/scrooloose/syntastic.git'" uses the local eslint installPlug 'mtscout6/syntastic-local-eslint.vim'" vim-goPlug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }" vim-go has some commands that depend on ctrlpPlug 'ctrlpvim/ctrlp.vim'call plug#end()" -- ultisnips / youcompleteme configaugroup load_us_ycmautocmd!autocmd InsertEnter * call plug#load('ultisnips', 'YouCompleteMe')\| autocmd! load_us_ycmaugroup ENDlet g:ycm_autoclose_preview_window_after_completion=1nnoremap <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>" UltiSnips triggeringlet g:UltiSnipsExpandTrigger = '<S-j>'let g:UltiSnipsJumpForwardTrigger = '<S-j>'let g:UltiSnipsJumpBackwardTrigger = '<S-k>'" syntastic configset statusline+=%#warningmsg#set statusline+=%{SyntasticStatuslineFlag()}set statusline+=%*let g:syntastic_always_populate_loc_list = 1let g:syntastic_loc_list_height = 5let g:syntastic_auto_loc_list = 0let g:syntastic_check_on_open = 1let g:syntastic_check_on_wq = 1let g:syntastic_javascript_checkers = ['eslint']let g:syntastic_error_symbol = 'X'let g:syntastic_style_error_symbol = '!'let g:syntastic_warning_symbol = 'W'let g:syntastic_style_warning_symbol = 'S'highlight link SyntasticErrorSign SignColumnhighlight link SyntasticWarningSign SignColumnhighlight link SyntasticStyleErrorSign SignColumnhighlight link SyntasticStyleWarningSign SignColumn" -- VIM-GO configlet g:go_fmt_command = "goimports"let g:go_metalinter_autosave = 1let g:go_metalinter_autosave_enabled = ['vet', 'golint']" let g:go_auto_sameids = 1 " this highlights matching declarations and I think I hate it" these autocmd are like short cuts for moving between filesautocmd Filetype go command! -bang A call go#alternate#Switch(<bang>0, 'edit')autocmd Filetype go command! -bang AV call go#alternate#Switch(<bang>0, 'vsplit')autocmd Filetype go command! -bang AS call go#alternate#Switch(<bang>0, 'split')" prevent issues with syntasticlet g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }let g:go_list_type = "quickfix"" -- LOOK AND FEELset background=darkcolorscheme Tomorrow-Nightfiletype onsyntax enable " enable syntax processingset number " set line numbersset showcmd " show command in bottom barset lazyredraw " redraw only when needed. (speeds things up)set showmatch " highlight matching braces, brackets, parens" -- save on buffer switchset autowrite" -- SEARCHINGset ignorecase " ignore case for searchesset incsearch " search as characters are inputset hlsearch " highlight search matchesnnoremap <silent> <Esc> :nohlsearch<Bar>:echo<CR>" -- Keep more info in memory to speed things up:set hiddenset history=100" -- INDENT SETTINGSautocmd Filetype html setlocal ts=2 sw=2 expandtabautocmd Filetype ruby setlocal ts=2 sw=2 expandtabautocmd Filetype javascript setlocal ts=4 sw=4 sts=0 noexpandtabautocmd Filetype c setlocal ts=4 sw=4 expandtab cindentautocmd Filetype swift setlocal ts=4 sw=4 expandtab cindentautocmd BufNewFile,BufRead *.go setlocal noexpandtab ts=4 sw=4filetype indent onimap <S-tab> <C-d>set smartindentset autoindentset tabstop=4 " number of visual spaces per TABset softtabstop=4 " number of spaces in tab when editingset expandtab " tabs are spacesset nowrap" -- KEY BINDINGS / REMAPS" gV - visually selects last inserted blocknnoremap gV `[v`]" jj - is escape in insert modeinoremap jj <esc>" \a - invoces :Agnnoremap <leader>a :Ag" \j - next buffernnoremap <leader>j :bn<ENTER>" \jw - next buffer in new windownnoremap <leader>wj :sbnext<ENTER>" \pp - paste into buffernnoremap <leader>pp :r !pbpaste<CR>" -- GO lang specific remapings" \rr go run fileautocmd FileType go nmap <leader>rr <Plug>(go-run)" \bb go build fileautocmd FileType go nmap <leader>bb :<C-u>call <SID>build_go_files()<CR>" \tt go test fileautocmd FileType go nmap <leader>tt <Plug>(go-test)" \tc go test coverageautocmd FileType go nmap <Leader>tc <Plug>(go-coverage-toggle)" \tcb go test coverage show in browserautocmd FileType go nmap <Leader>tcb <Plug>(go-coverage-browser)" \gc go run metalinter (ie all of the static analysis tools)autocmd FileType go nmap <leader>gc :GoMetaLinter<CR>" \i go show go info for under cursorautocmd FileType go nmap <Leader>i <Plug>(go-info)" \e run go renameau FileType go nmap <Leader>e <Plug>(go-rename)" ctrl. vim-go quick fix window next errornnoremap <C-n> :cnext<CR>" ctrl, vim-go quik fix window prev errornnoremap <C-m> :cprevious<CR>" ctrl/ vim-go quick fix window closennoremap <leader>c :cclose<CR>" -- FUNCTIONS" run :GoBuild or :GoTestCompile based on the go filefunction! s:build_go_files()let l:file = expand('%')if l:file =~# '^\f\+_test\.go$'call go#cmd#Test(0, 1)elseif l:file =~# '^\f\+\.go$'call go#cmd#Build(0)endifendfunction
# set vi mode by defaultset -o vi# pip should only run if there is a virtualenv currently activatedexport PIP_REQUIRE_VIRTUALENV=true############ Functions############ make a directory and change into itmcd () {mkdir -p $1cd $1}# set the contents of a file to the mac os# clipboardcopy () {cat $1 | pbcopy}# iterate through each immediate child directory# check to see if it's a git repo and run -- git pullpullall () {dir=`pwd`for REPO in `ls -l | grep ^d | grep -oE '[^ ]+$'`;docommand -p cd "$REPO";if [ -d ".git" ]; thencbranch=`git branch | grep "^\* " | sed "s/\* //g"`if [ $cbranch != "master" ]; thenecho "checking out master branch..."command git checkout "master"fiecho "pulling master branch of: $REPO ..."command git pullif [ $cbranch != "master" ]; thenecho "switching back to branch: $cbranch ..."command -p cd "$cbranch"fiecho "done pulling $REPO ..."echo "" #hacky way of newliningficommand -p cd $dirdone;}#################### ALIASES for EB VM###################alias mysql-core='mysql -u root -h 127.0.0.1 -P `docker port mysql-core 3306 | cut -f 2 -d :`'alias mysql-payments='mysql -u root -h 127.0.0.1 -P `docker port mysql-payments 3306 | cut -f 2 -d :`'alias mysql-webhooks='mysql -u root -h 127.0.0.1 -P `docker port mysql-webhooks 3306 | cut -f 2 -d :`'
# prompt settingsexport PS1="[\W] $ "# color settingsexport CLICOLOR=1export LSCOLORS=ExFxBxDxCxegedabagacad# arc tools env variablesexport EBPATH=/Users/ccummings/Eb-Github/eventbrite/# Set architecture flagsexport ARCHFLAGS="-arch x86_64"### PATH SETTINGS# add GOPATH env variable for golangexport GOPATH=$HOME/go_projects# export PATH=$ARCANIST_INSTALL_DIR/bin:/usr/local/bin:$GOPATH/bin:$PATHexport PATH=/usr/local/bin:$GOPATH/bin:$PATH#### Load .bashrc if it existstest -f ~/.bashrc && source ~/.bashrc# swift repl fix - due to brew python being at the front of $PATH variablealias swift="PATH=/usr/bin:$PATH swift"# mysql stuffalias mysql=/usr/local/mysql/bin/mysqlalias mysqladmin=/usr/local/mysql/bin/mysqladmin# end mysql stuffalias cp='cp -iv' # preferred cp implementationalias mv='mv -iv' # preferred mv implementationalias mkdir='mkdir -pv' # preferred mkdir implementationalias ll='ls -FGlAhp' # preferred less implementationcd() { builtin cd "$@"; ls -a; } # Always list directory contents after 'cd'alias cd..='cd ../' # Go back 1 directory level (for fast typers)alias ..='cd ../' # Go back 1 directory levelalias .2='cd ../../' # Go back 2 directory levelsalias .3='cd ../../../' # Go back 3 directory levelsalias .4='cd ../../../../' # Go back 4 directory levelsalias .5='cd ../../../../../' # Go back 5 directory levelsalias finder='open -a Finder ./' # finder: Opens current directory in MacOS Finderalias ~="cd ~" # ~: Go Home# alias c='clear' # c: Clear terminal display# alias which='type -all' # which: Find executablesalias path='echo -e ${PATH//:/\\n}' # path: Echo all executable Pathsalias show_options='shopt' # Show_options: display bash options settingsalias fix_stty='stty sane' # fix_stty: Restore terminal settings when screwed upalias cic='set completion-ignore-case On' # cic: Make tab-completion case-insensitivemkdircd () { mkdir -p "$1" && cd "$1"; } # mcd: Makes new Dir and jumps insidetrash () { command mv "$@" ~/.Trash ; } # trash: Moves a file to the MacOS trashpreview () { qlmanage -p "$*" >& /dev/null; } # ql: Opens any file in MacOS Quicklook Previewalias DT='tee ~/Desktop/terminalOut.txt' # DT: Pipe content to file on MacOS Desktopalias edit='atom' # edit file with Atom text editor# lr: Full Recursive Directory Listing# ------------------------------------------alias lr='ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\'' | less'# -------------------------------# 3. FILE AND FOLDER MANAGEMENT# -------------------------------zipf () { zip -r "$1".zip "$1" ; } # zipf: To create a ZIP archive of a folderalias numFiles='echo $(ls -1 | wc -l)' # numFiles: Count of non-hidden files in current diralias make1mb='mkfile 1m ./1MB.dat' # make1mb: Creates a file of 1mb size (all zeros)alias make5mb='mkfile 5m ./5MB.dat' # make5mb: Creates a file of 5mb size (all zeros)alias make10mb='mkfile 10m ./10MB.dat' # make10mb: Creates a file of 10mb size (all zeros)# cdfinder: 'Cd's to frontmost window of MacOS Finder# ------------------------------------------------------cdfinder () {currFolderPath=$( /usr/bin/osascript <<EOTtell application "Finder"tryset currFolder to (folder of the front window as alias)on errorset currFolder to (path to desktop folder as alias)end tryPOSIX path of currFolderend tellEOT)echo "cd to \"$currFolderPath\""cd "$currFolderPath"}# extract: Extract most know archives with one command# ---------------------------------------------------------extract () {if [ -f $1 ] ; thencase $1 in*.tar.bz2) tar xjf $1 ;;*.tar.gz) tar xzf $1 ;;*.bz2) bunzip2 $1 ;;*.rar) unrar e $1 ;;*.gz) gunzip $1 ;;*.tar) tar xf $1 ;;*.tbz2) tar xjf $1 ;;*.tgz) tar xzf $1 ;;*.zip) unzip $1 ;;*.Z) uncompress $1 ;;*.7z) 7z x $1 ;;*) echo "'$1' cannot be extracted via extract()" ;;esacelseecho "'$1' is not a valid file"fi}alias getstaticip='dig +short myip.opendns.com @resolver1.opendns.com' # get the static ip of the current networkexport ARCANIST_INSTALL_DIR=/Users/ccummings/.evbdevtoolssource $ARCANIST_INSTALL_DIR/devtools/scripts/devenv_bash/arcanist_helpers.sh