├── .bash_darwin ├── .bash_profile ├── .bashrc ├── .dircolors ├── .gitignore ├── .tmux.conf ├── .vimrc ├── README.md ├── custom.aliases.bash └── setup.sh /.bash_darwin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Add coreutils bin dir to path 4 | if [ -d /usr/local/opt/coreutils/libexec ]; then 5 | export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" 6 | export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH" 7 | fi 8 | 9 | test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash" 10 | 11 | if [ -d /usr/local/opt/python/libexec/bin ]; then 12 | export PATH="/usr/local/opt/python/libexec/bin:$PATH" 13 | fi 14 | 15 | alias dircolors="gdircolors" 16 | 17 | ssh-add -K ~/.ssh/id_rsa &> /dev/null 18 | ssh-add -A &> /dev/null 19 | 20 | [ -f ~/.fzf.bash ] && source ~/.fzf.bash 21 | 22 | complete -C /usr/local/bin/vault vault 23 | export PATH="/usr/local/opt/openssl/bin:/usr/local/opt/gnu-sed/libexec/gnubin:$PATH" 24 | -------------------------------------------------------------------------------- /.bash_profile: -------------------------------------------------------------------------------- 1 | if [[ $OSTYPE == darwin* ]]; then 2 | . ~/.bash_darwin 3 | fi 4 | 5 | if [ -f ~/.bashrc ]; then 6 | . ~/.bashrc 7 | fi 8 | 9 | # Source any local files 10 | if [ -f ~/.bash_local ]; then 11 | . ~/.bash_local 12 | fi 13 | -------------------------------------------------------------------------------- /.bashrc: -------------------------------------------------------------------------------- 1 | # Source global definitions 2 | if [ -f /etc/bashrc ]; then 3 | . /etc/bashrc 4 | fi 5 | 6 | # dircolors 7 | if [ -e ~/.dircolors ]; then 8 | eval "$(dircolors -b ~/.dircolors)" 9 | fi 10 | 11 | # Lock and Load a custom theme file 12 | # location /.bash_it/themes/ 13 | export BASH_IT_THEME='zork' 14 | 15 | # Set this to false to turn off version control status checking within the prompt for all themes 16 | export SCM_CHECK=true 17 | 18 | # Tab complete sudo commands 19 | complete -cf sudo 20 | 21 | # Load Bash It 22 | export BASH_IT="$HOME/.bash_it" 23 | 24 | if [ -e "${BASH_IT}"/bash_it.sh ]; then 25 | source "${BASH_IT}"/bash_it.sh 26 | fi 27 | 28 | # Fix vim colors inside tmux 29 | if [ -n "${TMUX}" ]; then 30 | alias vim="TERM=screen-256color vim" 31 | fi 32 | 33 | # Set default editor to vim 34 | export EDITOR=vim 35 | -------------------------------------------------------------------------------- /.dircolors: -------------------------------------------------------------------------------- 1 | # Exact Solarized Dark color theme for the color GNU ls utility. 2 | # Designed for dircolors (GNU coreutils) 5.97 3 | # 4 | # This simple theme was simultaneously designed for these terminal color schemes: 5 | # - Solarized dark (best) 6 | # - Solarized light 7 | # - default dark 8 | # - default light 9 | # with a slight optimization for Solarized Dark. 10 | # 11 | # How the colors were selected: 12 | # - Terminal emulators often have an option typically enabled by default that makes 13 | # bold a different color. It is important to leave this option enabled so that 14 | # you can access the entire 16-color Solarized palette, and not just 8 colors. 15 | # - We favor universality over a greater number of colors. So we limit the number 16 | # of colors so that this theme will work out of the box in all terminals, 17 | # Solarized or not, dark or light. 18 | # - We choose to have the following category of files: 19 | # NORMAL & FILE, DIR, LINK, EXEC and 20 | # editable text including source, unimportant text, binary docs & multimedia source 21 | # files, viewable multimedia, archived/compressed, and unimportant non-text 22 | # - For uniqueness, we stay away from the Solarized foreground colors are -- either 23 | # base00 (brightyellow) or base0 (brightblue). However, they can be used if 24 | # you know what the bg/fg colors of your terminal are, in order to optimize the display. 25 | # - 3 different options are provided: universal, solarized dark, and solarized light. 26 | # The only difference between the universal scheme and one that's optimized for 27 | # dark/light is the color of "unimportant" files, which should blend more with the 28 | # background 29 | # - We note that blue is the hardest color to see on dark bg and yellow is the hardest 30 | # color to see on light bg (with blue being particularly bad). So we choose yellow 31 | # for multimedia files which are usually accessed in a GUI folder browser anyway. 32 | # And blue is kept for custom use of this scheme's user. 33 | # - See table below to see the assignments. 34 | 35 | 36 | # Installation instructions: 37 | # This file goes in the /etc directory, and must be world readable. 38 | # You can copy this file to .dir_colors in your $HOME directory to override 39 | # the system defaults. 40 | 41 | # COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not 42 | # pipes. 'all' adds color characters to all output. 'none' shuts colorization 43 | # off. 44 | COLOR tty 45 | 46 | # Below, there should be one TERM entry for each termtype that is colorizable 47 | TERM ansi 48 | TERM color_xterm 49 | TERM color-xterm 50 | TERM con132x25 51 | TERM con132x30 52 | TERM con132x43 53 | TERM con132x60 54 | TERM con80x25 55 | TERM con80x28 56 | TERM con80x30 57 | TERM con80x43 58 | TERM con80x50 59 | TERM con80x60 60 | TERM cons25 61 | TERM console 62 | TERM cygwin 63 | TERM dtterm 64 | TERM dvtm 65 | TERM dvtm-256color 66 | TERM Eterm 67 | TERM eterm-color 68 | TERM fbterm 69 | TERM gnome 70 | TERM gnome-256color 71 | TERM jfbterm 72 | TERM konsole 73 | TERM konsole-256color 74 | TERM kterm 75 | TERM linux 76 | TERM linux-c 77 | TERM mach-color 78 | TERM mlterm 79 | TERM nxterm 80 | TERM putty 81 | TERM putty-256color 82 | TERM rxvt 83 | TERM rxvt-256color 84 | TERM rxvt-cygwin 85 | TERM rxvt-cygwin-native 86 | TERM rxvt-unicode 87 | TERM rxvt-unicode256 88 | TERM rxvt-unicode-256color 89 | TERM screen 90 | TERM screen-16color 91 | TERM screen-16color-bce 92 | TERM screen-16color-s 93 | TERM screen-16color-bce-s 94 | TERM screen-256color 95 | TERM screen-256color-bce 96 | TERM screen-256color-s 97 | TERM screen-256color-bce-s 98 | TERM screen-256color-italic 99 | TERM screen-bce 100 | TERM screen-w 101 | TERM screen.linux 102 | TERM screen.xterm-256color 103 | TERM screen.xterm-new 104 | TERM st 105 | TERM st-meta 106 | TERM st-256color 107 | TERM st-meta-256color 108 | TERM tmux 109 | TERM tmux-256color 110 | TERM vt100 111 | TERM xterm 112 | TERM xterm-new 113 | TERM xterm-16color 114 | TERM xterm-256color 115 | TERM xterm-256color-italic 116 | TERM xterm-88color 117 | TERM xterm-color 118 | TERM xterm-debian 119 | TERM xterm-termite 120 | 121 | # EIGHTBIT, followed by '1' for on, '0' for off. (8-bit output) 122 | EIGHTBIT 1 123 | 124 | ############################################################################# 125 | # Below are the color init strings for the basic file types. A color init 126 | # string consists of one or more of the following numeric codes: 127 | # 128 | # Attribute codes: 129 | # 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed 130 | # Text color codes: 131 | # 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white 132 | # Background color codes: 133 | # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white 134 | # 135 | # NOTES: 136 | # - See http://www.oreilly.com/catalog/wdnut/excerpt/color_names.html 137 | # - Color combinations 138 | # ANSI Color code Solarized Notes Universal SolDark SolLight 139 | # ~~~~~~~~~~~~~~~ ~~~~~~~~~ ~~~~~ ~~~~~~~~~ ~~~~~~~ ~~~~~~~~ 140 | # 00 none NORMAL, FILE 141 | # 30 black base02 142 | # 01;30 bright black base03 bg of SolDark 143 | # 31 red red docs & mm src 144 | # 01;31 bright red orange EXEC 145 | # 32 green green editable text 146 | # 01;32 bright green base01 unimportant text 147 | # 33 yellow yellow unclear in light bg multimedia 148 | # 01;33 bright yellow base00 fg of SolLight unimportant non-text 149 | # 34 blue blue unclear in dark bg user customized 150 | # 01;34 bright blue base0 fg in SolDark unimportant text 151 | # 35 magenta magenta LINK 152 | # 01;35 bright magenta violet archive/compressed 153 | # 36 cyan cyan DIR 154 | # 01;36 bright cyan base1 unimportant non-text 155 | # 37 white base2 156 | # 01;37 bright white base3 bg in SolLight 157 | # 05;37;41 unclear in Putty dark 158 | 159 | 160 | ### By file type 161 | 162 | # global default 163 | NORMAL 00 164 | # normal file 165 | FILE 00 166 | # directory 167 | DIR 34 168 | # 777 directory 169 | OTHER_WRITABLE 34;40 170 | # symbolic link 171 | LINK 35 172 | 173 | # pipe, socket, block device, character device (blue bg) 174 | FIFO 30;44 175 | SOCK 35;44 176 | DOOR 35;44 # Solaris 2.5 and later 177 | BLK 33;44 178 | CHR 37;44 179 | 180 | 181 | ############################################################################# 182 | ### By file attributes 183 | 184 | # Orphaned symlinks (blinking white on red) 185 | # Blink may or may not work (works on iTerm dark or light, and Putty dark) 186 | ORPHAN 05;37;41 187 | # ... and the files that orphaned symlinks point to (blinking white on red) 188 | MISSING 05;37;41 189 | 190 | # files with execute permission 191 | EXEC 01;31 # Unix 192 | .cmd 01;31 # Win 193 | .exe 01;31 # Win 194 | .com 01;31 # Win 195 | .bat 01;31 # Win 196 | .reg 01;31 # Win 197 | .app 01;31 # OSX 198 | 199 | ############################################################################# 200 | ### By extension 201 | 202 | # List any file extensions like '.gz' or '.tar' that you would like ls 203 | # to colorize below. Put the extension, a space, and the color init string. 204 | # (and any comments you want to add after a '#') 205 | 206 | ### Text formats 207 | 208 | # Text that we can edit with a regular editor 209 | .txt 32 210 | .org 32 211 | .md 32 212 | .mkd 32 213 | 214 | # Source text 215 | .h 32 216 | .hpp 32 217 | .c 32 218 | .C 32 219 | .cc 32 220 | .cpp 32 221 | .cxx 32 222 | .objc 32 223 | .cl 32 224 | .sh 32 225 | .bash 32 226 | .csh 32 227 | .zsh 32 228 | .el 32 229 | .vim 32 230 | .java 32 231 | .pl 32 232 | .pm 32 233 | .py 32 234 | .rb 32 235 | .hs 32 236 | .php 32 237 | .htm 32 238 | .html 32 239 | .shtml 32 240 | .erb 32 241 | .haml 32 242 | .xml 32 243 | .rdf 32 244 | .css 32 245 | .sass 32 246 | .scss 32 247 | .less 32 248 | .js 32 249 | .coffee 32 250 | .man 32 251 | .0 32 252 | .1 32 253 | .2 32 254 | .3 32 255 | .4 32 256 | .5 32 257 | .6 32 258 | .7 32 259 | .8 32 260 | .9 32 261 | .l 32 262 | .n 32 263 | .p 32 264 | .pod 32 265 | .tex 32 266 | .go 32 267 | .sql 32 268 | .csv 32 269 | 270 | ### Multimedia formats 271 | 272 | # Image 273 | .bmp 33 274 | .cgm 33 275 | .dl 33 276 | .dvi 33 277 | .emf 33 278 | .eps 33 279 | .gif 33 280 | .jpeg 33 281 | .jpg 33 282 | .JPG 33 283 | .mng 33 284 | .pbm 33 285 | .pcx 33 286 | .pdf 33 287 | .pgm 33 288 | .png 33 289 | .PNG 33 290 | .ppm 33 291 | .pps 33 292 | .ppsx 33 293 | .ps 33 294 | .svg 33 295 | .svgz 33 296 | .tga 33 297 | .tif 33 298 | .tiff 33 299 | .xbm 33 300 | .xcf 33 301 | .xpm 33 302 | .xwd 33 303 | .xwd 33 304 | .yuv 33 305 | 306 | # Audio 307 | .aac 33 308 | .au 33 309 | .flac 33 310 | .m4a 33 311 | .mid 33 312 | .midi 33 313 | .mka 33 314 | .mp3 33 315 | .mpa 33 316 | .mpeg 33 317 | .mpg 33 318 | .ogg 33 319 | .opus 33 320 | .ra 33 321 | .wav 33 322 | 323 | # Video 324 | .anx 33 325 | .asf 33 326 | .avi 33 327 | .axv 33 328 | .flc 33 329 | .fli 33 330 | .flv 33 331 | .gl 33 332 | .m2v 33 333 | .m4v 33 334 | .mkv 33 335 | .mov 33 336 | .MOV 33 337 | .mp4 33 338 | .mp4v 33 339 | .mpeg 33 340 | .mpg 33 341 | .nuv 33 342 | .ogm 33 343 | .ogv 33 344 | .ogx 33 345 | .qt 33 346 | .rm 33 347 | .rmvb 33 348 | .swf 33 349 | .vob 33 350 | .webm 33 351 | .wmv 33 352 | 353 | ### Misc 354 | 355 | # Binary document formats and multimedia source 356 | .doc 31 357 | .docx 31 358 | .rtf 31 359 | .odt 31 360 | .dot 31 361 | .dotx 31 362 | .ott 31 363 | .xls 31 364 | .xlsx 31 365 | .ods 31 366 | .ots 31 367 | .ppt 31 368 | .pptx 31 369 | .odp 31 370 | .otp 31 371 | .fla 31 372 | .psd 31 373 | 374 | # Archives, compressed 375 | .7z 1;35 376 | .apk 1;35 377 | .arj 1;35 378 | .bin 1;35 379 | .bz 1;35 380 | .bz2 1;35 381 | .cab 1;35 # Win 382 | .deb 1;35 383 | .dmg 1;35 # OSX 384 | .gem 1;35 385 | .gz 1;35 386 | .iso 1;35 387 | .jar 1;35 388 | .msi 1;35 # Win 389 | .rar 1;35 390 | .rpm 1;35 391 | .tar 1;35 392 | .tbz 1;35 393 | .tbz2 1;35 394 | .tgz 1;35 395 | .tx 1;35 396 | .war 1;35 397 | .xpi 1;35 398 | .xz 1;35 399 | .z 1;35 400 | .Z 1;35 401 | .zip 1;35 402 | 403 | # For testing 404 | .ANSI-30-black 30 405 | .ANSI-01;30-brblack 01;30 406 | .ANSI-31-red 31 407 | .ANSI-01;31-brred 01;31 408 | .ANSI-32-green 32 409 | .ANSI-01;32-brgreen 01;32 410 | .ANSI-33-yellow 33 411 | .ANSI-01;33-bryellow 01;33 412 | .ANSI-34-blue 34 413 | .ANSI-01;34-brblue 01;34 414 | .ANSI-35-magenta 35 415 | .ANSI-01;35-brmagenta 01;35 416 | .ANSI-36-cyan 36 417 | .ANSI-01;36-brcyan 01;36 418 | .ANSI-37-white 37 419 | .ANSI-01;37-brwhite 01;37 420 | 421 | ############################################################################# 422 | # Your customizations 423 | 424 | # Unimportant text files 425 | # For universal scheme, use brightgreen 01;32 426 | # For optimal on light bg (but too prominent on dark bg), use white 01;34 427 | .log 01;32 428 | *~ 01;32 429 | *# 01;32 430 | #.log 01;34 431 | #*~ 01;34 432 | #*# 01;34 433 | 434 | # Unimportant non-text files 435 | # For universal scheme, use brightcyan 01;36 436 | # For optimal on dark bg (but too prominent on light bg), change to 01;33 437 | #.bak 01;36 438 | #.BAK 01;36 439 | #.old 01;36 440 | #.OLD 01;36 441 | #.org_archive 01;36 442 | #.off 01;36 443 | #.OFF 01;36 444 | #.dist 01;36 445 | #.DIST 01;36 446 | #.orig 01;36 447 | #.ORIG 01;36 448 | #.swp 01;36 449 | #.swo 01;36 450 | #*,v 01;36 451 | .bak 01;33 452 | .BAK 01;33 453 | .old 01;33 454 | .OLD 01;33 455 | .org_archive 01;33 456 | .off 01;33 457 | .OFF 01;33 458 | .dist 01;33 459 | .DIST 01;33 460 | .orig 01;33 461 | .ORIG 01;33 462 | .swp 01;33 463 | .swo 01;33 464 | *,v 01;33 465 | 466 | # The brightmagenta (Solarized: purple) color is free for you to use for your 467 | # custom file type 468 | .gpg 34 469 | .gpg 34 470 | .pgp 34 471 | .asc 34 472 | .3des 34 473 | .aes 34 474 | .enc 34 475 | .sqlite 34 476 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vim/.netrwhist 2 | .vim/plugged/** 3 | .bash_local 4 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | # https://stackoverflow.com/questions/35016458/how-to-write-if-statement-in-tmux-conf-to-set-different-options-for-different-t 2 | ## Add tmux version to environment 3 | run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)" 4 | 5 | ## Enable mouse support 6 | set -g mouse on 7 | 8 | # Scroll History 9 | set -g history-limit 30000 10 | 11 | # Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access. 12 | set -s escape-time 50 13 | 14 | # improve colors 15 | set -g default-terminal 'screen-256color' 16 | 17 | # act like vim 18 | setw -g mode-keys vi 19 | bind h select-pane -L 20 | bind j select-pane -D 21 | bind k select-pane -U 22 | bind l select-pane -R 23 | bind-key -r C-h select-window -t :- 24 | bind-key -r C-l select-window -t :+ 25 | 26 | # Use Vim movement key mappings (uppercase) for resizing panes. 27 | bind -r H resize-pane -L 5 28 | bind -r J resize-pane -D 5 29 | bind -r K resize-pane -U 5 30 | bind -r L resize-pane -R 5 31 | 32 | # PREFIX \: Create a new vertial pane. 33 | bind \ split-window -h 34 | 35 | # PREFIX -: Create a new horizontal pane. 36 | bind - split-window -v 37 | 38 | # Allow sending prefix key to remote sessions (inception) 39 | bind-key -n C-n send-prefix 40 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | " vim-plug configuration 2 | if empty(glob('~/.vim/autoload/plug.vim')) 3 | silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs 4 | \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 5 | autocmd VimEnter * PlugInstall | source $MYVIMRC 6 | endif 7 | 8 | call plug#begin('~/.vim/plugged') 9 | 10 | Plug 'pearofducks/ansible-vim' 11 | Plug 'tpope/vim-fugitive' 12 | Plug 'scrooloose/nerdtree' 13 | Plug 'vim-syntastic/syntastic' 14 | 15 | " Add plugins to &runtimepath 16 | call plug#end() 17 | 18 | " Leader 19 | let mapleader = " " 20 | 21 | set backspace=2 " Backspace deletes like most programs in insert mode 22 | set nobackup 23 | set nowritebackup 24 | set noswapfile " http://robots.thoughtbot.com/post/18739402579/global-gitignore#comment-458413287 25 | set history=50 26 | set ruler " show the cursor position all the time 27 | set showcmd " display incomplete commands 28 | set incsearch " do incremental searching 29 | set laststatus=2 " Always display the status line 30 | set autowrite " Automatically :write before running commands 31 | set pastetoggle= 32 | set mouse=a " Enable mouse in all modes 33 | set ttymouse=xterm2 34 | 35 | " Color adjustments 36 | syntax enable 37 | set background=dark 38 | colorscheme solarized 39 | 40 | if filereadable(expand("~/.vimrc.bundles")) 41 | source ~/.vimrc.bundles 42 | endif 43 | 44 | filetype plugin indent on 45 | 46 | augroup vimrcEx 47 | autocmd! 48 | 49 | " When editing a file, always jump to the last known cursor position. 50 | " Don't do it for commit messages, when the position is invalid, or when 51 | " inside an event handler (happens when dropping a file on gvim). 52 | autocmd BufReadPost * 53 | \ if &ft != 'gitcommit' && line("'\"") > 0 && line("'\"") <= line("$") | 54 | \ exe "normal g`\"" | 55 | \ endif 56 | 57 | " Set syntax highlighting for specific file types 58 | autocmd BufRead,BufNewFile Appraisals set filetype=ruby 59 | autocmd BufRead,BufNewFile *.md set filetype=markdown 60 | autocmd BufRead,BufNewFile .{jscs,jshint,eslint}rc set filetype=json 61 | autocmd BufRead,BufNewFile .j2 set filetype=jinja2 62 | augroup END 63 | 64 | " When the type of shell script is /bin/sh, assume a POSIX-compatible 65 | " shell for syntax highlighting purposes. 66 | let g:is_posix = 1 67 | 68 | " Expand tab to 2 spaces 69 | set tabstop=2 70 | set softtabstop=2 71 | set expandtab 72 | set shiftwidth=2 73 | set smarttab 74 | 75 | " Display extra whitespace and tabs as characters, but not by default 76 | set list 77 | set listchars=tab:\|\ ,trail:·,nbsp:· 78 | 79 | " Use one space, not two, after punctuation. 80 | set nojoinspaces 81 | 82 | " Numbers 83 | set number 84 | set numberwidth=5 85 | 86 | " Get off my lawn 87 | nnoremap :echoe "Use h" 88 | nnoremap :echoe "Use l" 89 | nnoremap :echoe "Use k" 90 | nnoremap :echoe "Use j" 91 | 92 | " Run commands that require an interactive shell 93 | nnoremap r :RunInInteractiveShell 94 | 95 | " Treat
  • and

    tags like the block tags they are 96 | let g:html_indent_tags = 'li\|p' 97 | 98 | " Open new split panes to right and bottom, which feels more natural 99 | set splitbelow 100 | set splitright 101 | 102 | nnoremap < 103 | nnoremap > 104 | 105 | " Quicker window movement 106 | nnoremap j 107 | nnoremap k 108 | nnoremap h 109 | nnoremap l 110 | 111 | " configure syntastic syntax checking to check on open as well as save 112 | let g:syntastic_check_on_open=1 113 | let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute \"ng-"] 114 | let g:syntastic_eruby_ruby_quiet_messages = 115 | \ {"regex": "possibly useless use of a variable in void context"} 116 | 117 | " Always use vertical diffs 118 | set diffopt+=vertical 119 | 120 | " Set the statusline 121 | set statusline=%f " Path to the file 122 | set statusline+=%y " Filetype of the file 123 | set statusline+=%= " Switch to the right side 124 | set statusline+=Current:\ %-4l " Display current line 125 | set statusline+=Total:\ %-4L " Dispay total lines 126 | set statusline+=%{fugitive#statusline()} " Git status 127 | 128 | " map nerdtree viewport to CTRL+n 129 | 130 | map :NERDTreeToggle 131 | 132 | " Options for syntastic 133 | set statusline+=%#warningmsg# 134 | set statusline+=%{SyntasticStatuslineFlag()} 135 | set statusline+=%* 136 | 137 | let g:syntastic_always_populate_loc_list = 1 138 | let g:syntastic_auto_loc_list = 1 139 | let g:syntastic_check_on_open = 1 140 | let g:syntastic_check_on_wq = 0 141 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles 2 | 3 | This is my personal collection of dotfile customizations. 4 | 5 | Setup is simple. Just run `setup.sh` and it will symlink all of the dotfiles into your home directory. The symlink allows you to automatically receive any updates after running a `git pull` in the future. 6 | 7 | ## Mac Users 8 | Certain things won't work as expected if you don't have coreutils installed. The easiest way to do this is with [homebrew](https://brew.sh/): 9 | ``` 10 | brew install coreutils 11 | ``` 12 | -------------------------------------------------------------------------------- /custom.aliases.bash: -------------------------------------------------------------------------------- 1 | alias ls="ls -hp" 2 | alias ll='ls -halp' 3 | alias grep="grep" 4 | alias egrep="egrep" 5 | alias gc="git commit -S -v" 6 | alias gcm="git commit -S -v -m" 7 | alias sudo="sudo -E" 8 | 9 | # Commit and push everything 10 | gitdone() { git add -A; git commit -S -v -m "$1"; git push; } 11 | 12 | # Analyst stuff 13 | alias bro-column="sed \"s/fields.//;s/types.//\" | column -s $'\t' -t" 14 | alias bro-awk='awk -F" "' 15 | bro-grep() { grep -E "(^#)|$1" $2; } 16 | bro-zgrep() { zgrep -E "(^#)|$1" $2; } 17 | topcount() { sort | uniq -c | sort -rn | head -n ${1:-10}; } 18 | colorize() { sed 's/#fields\t\|#types\t/#/g' | awk 'BEGIN {FS="\t"};{for(i=1;i<=NF;i++) printf("\x1b[%sm %s \x1b[0m",(i%7)+31,$i);print ""}'; } 19 | cm() { cat $1 | sed 's/#fields\t\|#types\t/#/g' | awk 'BEGIN {FS="\t"};{for(i=1;i<=NF;i++) printf("\x1b[%sm %s \x1b[0m",(i%7)+31,$i);print ""}'; } 20 | lesscolor() { cat $1 | sed 's/#fields\t\|#types\t/#/g' | awk 'BEGIN {FS="\t"};{for(i=1;i<=NF;i++) printf("\x1b[%sm %s \x1b[0m",(i%7)+31,$i);print ""}' | less -RS; } 21 | topconn() { if [ $# -lt 2 ]; then echo "Usage: topconn {resp|orig} {proto|service} {tcp|udp|icmp|http|dns|ssl|smtp|\"-\"}"; else cat conn.log | bro-cut id.$1_h $2 | grep $3 | topcount; fi; } 22 | fields() { grep -m 1 -E "^#fields" $1 | awk -vRS='\t' '/^[^#]/ { print $1 }' | cat -n ; } 23 | toptalk() { for i in *.log; do echo -e "$i\n================="; cat $i | bro-cut id.orig_h id.resp_h | topcount 20; done; } 24 | talkers() { for j in tcp udp icmp; do echo -e "\t=============\n\t $j\n\t============="; for i in resp orig; do echo -e "====\n$i\n===="; topconn $i proto $j | column -t; done; done; } 25 | 26 | toptotal() { if [ $# -lt 3 ]; then echo "Usage: toptotal {resp|orig} {orig_bytes|resp_bytes|duration} conn.log"; else 27 | zcat $3 | bro-cut id.$1_h $2 \ 28 | | sort \ 29 | | awk '{ if (host != $1) { \ 30 | if (size != 0) \ 31 | print $1, size; \ 32 | host=$1; \ 33 | size=0 \ 34 | } else \ 35 | size += $2 \ 36 | } \ 37 | END { \ 38 | if (size != 0) \ 39 | print $1, size \ 40 | }' \ 41 | | sort -rnk 2 \ 42 | | head -n 20; fi; } 43 | 44 | topconvo() { if [ $# -lt 1 ]; then echo "Usage: topconvo conn.log"; else 45 | zcat $1 | bro-cut id.orig_h id.resp_h orig_bytes resp_bytes \ 46 | | sort \ 47 | | awk '{ if (host != $1 || host2 != $2) { \ 48 | if (size != 0) \ 49 | print $1, $2, size; \ 50 | host=$1; \ 51 | host2=$2; \ 52 | size=0 \ 53 | } else \ 54 | size += $3; \ 55 | size += $4 \ 56 | } \ 57 | END { \ 58 | if (size != 0) \ 59 | print $1, $2, size \ 60 | }' \ 61 | | sort -rnk 3 \ 62 | | head -n 20; fi; } 63 | 64 | 65 | # Use ssht to open tmux automatically for ssh sessions 66 | function ssht(){ 67 | ssh $* -t 'tmux a || tmux || /bin/bash' 68 | } 69 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | params="-sf" 4 | 5 | while getopts "vib" args; do 6 | case $args in 7 | v) 8 | params="$params -v" 9 | ;; 10 | i) 11 | params="$params -i" 12 | ;; 13 | b) 14 | params="$params -b" 15 | ;; 16 | esac 17 | done 18 | 19 | # Store where the script was called from so we can reference it later 20 | script_home="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 21 | 22 | # Update bash-it if it's already installed or download it if it's not 23 | if [ -d $HOME/.bash_it ]; then 24 | cd $HOME/.bash_it 25 | git pull 26 | else 27 | git clone --depth=1 https://github.com/Bash-it/bash-it.git $HOME/.bash_it 28 | fi 29 | 30 | # Add our custom aliases to bash-it 31 | ln $params $script_home/custom.aliases.bash $HOME/.bash_it/aliases/custom.aliases.bash 32 | 33 | # Add Dustin's syntax highlights for Bro 34 | for i in ftdetect syntax; do 35 | if [ ! -f $HOME/.vim/$i/bro.vim ]; then 36 | curl -fLo $HOME/.vim/$i/bro.vim --create-dirs \ 37 | https://raw.githubusercontent.com/mephux/bro.vim/master/$i/bro.vim 38 | fi 39 | done 40 | 41 | # Add solarized colors for vim if not present 42 | if [ ! -f $HOME/.vim/colors/solarized.vim ]; then 43 | curl -fLo $HOME/.vim/colors/solarized.vim --create-dirs \ 44 | https://raw.githubusercontent.com/altercation/vim-colors-solarized/master/colors/solarized.vim 45 | fi 46 | 47 | # Symlink all of our dotfiles to the home directory 48 | for i in .vimrc .dircolors .bashrc .bash_profile .bash_darwin .tmux.conf; 49 | do 50 | ln $params $script_home/$i $HOME/$i 51 | done 52 | --------------------------------------------------------------------------------