├── LICENSE ├── README.md ├── install.sh ├── tmux.conf ├── vimrc ├── vimrc.bundles └── vimrc.bundles.local /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Tim Mahoney 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | minimum-awesome 2 | =============== 3 | 4 | A Vim setup that will get you into Vim and make it so that you don't want to pull your hair out. 5 | Based on Maximum Awesome by the guys over at Square. ( https://github.com/square/maximum-awesome ) 6 | 7 | Install 8 | ======= 9 | 10 | git clone git@github.com:timthrillist/minimum-awesome.git 11 | 12 | cd minimum-awesome 13 | 14 | chmod a+x install.sh 15 | 16 | ./install.sh 17 | 18 | The install is very simple. It renames your existing tmux.conf and vimrc files to *.bak, 19 | then links to the new ones, installs Vim Bundler (vundle), and installs the Vundles I've added. 20 | 21 | Some of them might not be perfectly supported; I'm basically standing on the shoulders of the guys 22 | at Square with their Maximum Awesome repository (https://github.com/square/maximum-awesome) but most of it works great. 23 | 24 | vim 25 | === 26 | 27 | * ,d brings up NERDTree, a sidebar buffer for navigating and manipulating files 28 | * ,t brings up ctrlp.vim, a project file filter for easily opening specific files 29 | * ,b restricts ctrlp.vim to open buffers 30 | * ,a starts project search with ack.vim using ag (like ack) 31 | * ds/cs delete/change surrounding characters (e.g. "Hey!" + ds" = Hey!, "Hey!" + cs"' = 'Hey!') with vim-surround 32 | * \\\ toggles current line comment 33 | * \\ toggles visual selection comment lines 34 | * vii/vai visually select in or around the cursor's indent 35 | * ,[space] strips trailing whitespace 36 | * ^] jump to definition using ctags 37 | * ,l begins aligning lines on a string, usually used as ,l= to align assignments 38 | * ^hjkl move between windows, shorthand for ^w hjkl 39 | 40 | tmux 41 | ==== 42 | 43 | * ^a is the prefix 44 | * mouse scroll initiates tmux scroll 45 | * prefix v makes a vertical split 46 | * prefix s makes a horizontal split 47 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Move any existing configs. 4 | mv ~/.tmux.conf ~/.tmux.conf.bak 5 | mv ~/.vimrc ~/.vimrc.bak 6 | mv ~/.vimrc.bundles ~/.vimrc.bundles.bak 7 | mv ~/.vimrc.bundles.local ~/.vimrc.bundles.local.bak 8 | 9 | BASEDIR=$(dirname $0) 10 | 11 | ln $BASEDIR/tmux.conf ~/.tmux.conf 12 | ln $BASEDIR/vimrc ~/.vimrc 13 | ln $BASEDIR/vimrc.bundles ~/.vimrc.bundles 14 | ln $BASEDIR/vimrc.bundles.local ~/.vimrc.bundles.local 15 | 16 | # Get vundle for Vim ( Vim Bundles ) 17 | git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle 18 | 19 | # Install all the bundles. 20 | vim +BundleInstall +qall 21 | -------------------------------------------------------------------------------- /tmux.conf: -------------------------------------------------------------------------------- 1 | # use C-a, since it's on the home row and easier to hit than C-b 2 | set-option -g prefix C-a 3 | unbind-key C-a 4 | bind-key C-a send-prefix 5 | set -g base-index 1 6 | 7 | # vi is good 8 | setw -g mode-keys vi 9 | 10 | # mouse behavior 11 | setw -g mode-mouse on 12 | set -g mouse-select-pane on 13 | set -g mouse-resize-pane on 14 | 15 | set-option -g default-terminal screen-256color 16 | 17 | bind-key : command-prompt 18 | bind-key r refresh-client 19 | bind-key L clear-history 20 | 21 | bind-key space next-window 22 | bind-key bspace previous-window 23 | bind-key enter next-layout 24 | 25 | # use vim-like keys for splits and windows 26 | bind-key v split-window -h 27 | bind-key s split-window -v 28 | bind-key h select-pane -L 29 | bind-key j select-pane -D 30 | bind-key k select-pane -U 31 | bind-key l select-pane -R 32 | 33 | bind-key C-o rotate-window 34 | 35 | bind-key + select-layout main-horizontal 36 | bind-key = select-layout main-vertical 37 | set-window-option -g other-pane-height 25 38 | set-window-option -g other-pane-width 80 39 | 40 | bind-key a last-pane 41 | bind-key q display-panes 42 | bind-key c new-window 43 | bind-key t next-window 44 | bind-key T previous-window 45 | 46 | bind-key [ copy-mode 47 | bind-key ] paste-buffer 48 | 49 | # Setup 'v' to begin selection as in Vim 50 | bind-key -t vi-copy v begin-selection 51 | bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" 52 | 53 | # Update default binding of `Enter` to also use copy-pipe 54 | unbind -t vi-copy Enter 55 | bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" 56 | 57 | set-window-option display-panes-time 1500 58 | 59 | # Status Bar 60 | set-option -g status-interval 1 61 | set-option -g status-left '' 62 | set-option -g status-right '%l:%M%p' 63 | set-window-option -g window-status-current-fg magenta 64 | set-option -g status-fg default 65 | 66 | # Status Bar solarized-dark (default) 67 | set-option -g status-bg black 68 | set-option -g pane-active-border-fg black 69 | set-option -g pane-border-fg black 70 | 71 | # Status Bar solarized-light 72 | if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g status-bg white" 73 | if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-active-border-fg white" 74 | if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-border-fg white" 75 | 76 | # Set window notifications 77 | setw -g monitor-activity on 78 | set -g visual-activity on 79 | 80 | # Enable native Mac OS X copy/paste 81 | set-option -g default-command "/bin/bash -c 'which reattach-to-user-namespace >/dev/null && exec reattach-to-user-namespace $SHELL -l || exec $SHELL -l'" 82 | 83 | # Allow the arrow key to be used immediately after changing windows 84 | set-option -g repeat-time 0 85 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | " don't bother with vi compatibility 2 | set nocompatible 3 | 4 | let g:nerdtree_tabs_open_on_console_startup=1 5 | 6 | " configure Vundle 7 | filetype on " without this vim emits a zero exit status, later, because of :ft off 8 | filetype off 9 | filetype plugin indent on 10 | set rtp+=~/.vim/bundle/vundle/ 11 | call vundle#rc() 12 | 13 | " install Vundle bundles 14 | if filereadable(expand("~/.vimrc.bundles")) 15 | source ~/.vimrc.bundles 16 | source ~/.vimrc.bundles.local 17 | endif 18 | 19 | " enable syntax highlighting 20 | syntax enable 21 | 22 | set autoindent 23 | set autoread " reload files when changed on disk, i.e. via `git checkout` 24 | set backspace=2 " Fix broken backspace in some setups 25 | set backupcopy=yes " see :help crontab 26 | set clipboard=unnamed " yank and paste with the system clipboard 27 | set directory-=. " don't store swapfiles in the current directory 28 | set encoding=utf-8 29 | set expandtab " expand tabs to spaces 30 | set ignorecase " case-insensitive search 31 | set incsearch " search as you type 32 | set laststatus=2 " always show statusline 33 | set list " show trailing whitespace 34 | set listchars=tab:▸\ ,trail:▫ 35 | set number " show line numbers 36 | set ruler " show where you are 37 | set scrolloff=3 " show context above/below cursorline 38 | set shiftwidth=2 " normal mode indentation commands use 2 spaces 39 | set showcmd 40 | set smartcase " case-sensitive search if any caps 41 | set softtabstop=2 " insert mode tab and backspace use 2 spaces 42 | set tabstop=8 " actual tabs occupy 8 characters 43 | set wildignore=log/**,node_modules/**,target/**,tmp/**,*.rbc 44 | set wildmenu " show a navigable menu for tab completion 45 | set wildmode=longest,list,full 46 | 47 | " Enable basic mouse behavior such as resizing buffers. 48 | set mouse=a 49 | if exists('$TMUX') " Support resizing in tmux 50 | set ttymouse=xterm2 51 | endif 52 | 53 | " keyboard shortcuts 54 | let mapleader = ',' 55 | map h 56 | map j 57 | map k 58 | map l 59 | map l :Align 60 | nmap a :Ack 61 | nmap b :CtrlPBuffer 62 | nmap d :NERDTreeToggle 63 | nmap f :NERDTreeFind 64 | nmap t :CtrlP 65 | nmap T :CtrlPClearCache:CtrlP 66 | nmap ] :TagbarToggle 67 | nmap :call StripTrailingWhitespaces() 68 | nmap g :GitGutterToggle 69 | nmap c Kwbd 70 | nmap n NERDTreeTabsToggle 71 | map V :source ~/.vimrc:filetype detect:exe ":echo 'vimrc reloaded'" 72 | vmap :!pbcopy 73 | vmap :w !pbcopy 74 | map r :NERDTreeFind 75 | 76 | " plugin settings 77 | let g:ctrlp_match_window = 'order:ttb,max:20' 78 | let g:NERDSpaceDelims=1 79 | let g:gitgutter_enabled = 0 80 | 81 | " Use The Silver Searcher https://github.com/ggreer/the_silver_searcher 82 | if executable('ag') 83 | let g:ackprg = 'ag --nogroup --column' 84 | 85 | " Use Ag over Grep 86 | set grepprg=ag\ --nogroup\ --nocolor 87 | 88 | " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore 89 | let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' 90 | endif 91 | 92 | " fdoc is yaml 93 | autocmd BufRead,BufNewFile *.fdoc set filetype=yaml 94 | " md is markdown 95 | autocmd BufRead,BufNewFile *.md set filetype=markdown 96 | " extra rails.vim help 97 | autocmd User Rails silent! Rnavcommand decorator app/decorators -glob=**/* -suffix=_decorator.rb 98 | autocmd User Rails silent! Rnavcommand observer app/observers -glob=**/* -suffix=_observer.rb 99 | autocmd User Rails silent! Rnavcommand feature features -glob=**/* -suffix=.feature 100 | autocmd User Rails silent! Rnavcommand job app/jobs -glob=**/* -suffix=_job.rb 101 | autocmd User Rails silent! Rnavcommand mediator app/mediators -glob=**/* -suffix=_mediator.rb 102 | autocmd User Rails silent! Rnavcommand stepdefinition features/step_definitions -glob=**/* -suffix=_steps.rb 103 | " automatically rebalance windows on vim resize 104 | autocmd VimResized * :wincmd = 105 | 106 | " Set various file types to PHP (Drupal specific) 107 | au BufReadPost *.install set syntax=php 108 | au BufReadPost *.module set syntax=php 109 | 110 | " Fix Cursor in TMUX 111 | if exists('$TMUX') 112 | let &t_SI = "\Ptmux;\\]50;CursorShape=1\x7\\\" 113 | let &t_EI = "\Ptmux;\\]50;CursorShape=0\x7\\\" 114 | else 115 | let &t_SI = "\]50;CursorShape=1\x7" 116 | let &t_EI = "\]50;CursorShape=0\x7" 117 | endif 118 | 119 | " Go crazy! 120 | if filereadable(expand("~/.vimrc.local")) 121 | " In your .vimrc.local, you might like: 122 | " 123 | " set autowrite 124 | " set nocursorline 125 | " set nowritebackup 126 | " set whichwrap+=<,>,h,l,[,] " Wrap arrow keys between lines 127 | " 128 | " autocmd! bufwritepost .vimrc source ~/.vimrc 129 | " noremap! jj 130 | source ~/.vimrc.local 131 | endif 132 | 133 | " Strip trailing whitespace on save 134 | fun! StripTrailingWhitespaces() 135 | let l = line(".") 136 | let c = col(".") 137 | %s/\s\+$//e 138 | call cursor(l, c) 139 | endfun 140 | autocmd BufWritePre * :call StripTrailingWhitespaces() 141 | 142 | -------------------------------------------------------------------------------- /vimrc.bundles: -------------------------------------------------------------------------------- 1 | " Bundles here are part of the core Maximum Awesome setup 2 | " Do NOT add bundles to this list, as they might get removed when you upgrade 3 | " Maximum Awesome. 4 | " Please create ~/.vim.bundles.local and add any extra bundles you want there 5 | Bundle 'airblade/vim-gitgutter' 6 | Bundle 'altercation/vim-colors-solarized' 7 | Bundle 'austintaylor/vim-indentobject' 8 | Bundle 'christoomey/vim-tmux-navigator' 9 | Bundle 'gmarik/vundle' 10 | Bundle 'juvenn/mustache.vim' 11 | Bundle 'kchmck/vim-coffee-script' 12 | Bundle 'kien/ctrlp.vim' 13 | Bundle 'leafgarland/typescript-vim' 14 | Bundle 'majutsushi/tagbar' 15 | Bundle 'mileszs/ack.vim' 16 | Bundle 'msanders/snipmate.vim' 17 | Bundle 'nathanaelkane/vim-indent-guides' 18 | Bundle 'nono/vim-handlebars' 19 | Bundle 'pangloss/vim-javascript' 20 | Bundle 'rmanalan/jshint.vim' 21 | Bundle 'scrooloose/nerdtree' 22 | Bundle 'scrooloose/syntastic' 23 | Bundle 'slim-template/vim-slim' 24 | Bundle 'tpope/vim-bundler' 25 | Bundle 'tpope/vim-commentary' 26 | Bundle 'tpope/vim-cucumber' 27 | Bundle 'tpope/vim-endwise' 28 | Bundle 'tpope/vim-fugitive' 29 | Bundle 'tpope/vim-pastie' 30 | Bundle 'tpope/vim-ragtag' 31 | Bundle 'tpope/vim-rails' 32 | Bundle 'tpope/vim-repeat' 33 | Bundle 'tpope/vim-surround' 34 | Bundle 'tpope/vim-unimpaired' 35 | Bundle 'tpope/vim-vividchalk' 36 | Bundle 'uarun/vim-protobuf' 37 | Bundle 'vim-ruby/vim-ruby' 38 | Bundle 'vim-scripts/Align' 39 | Bundle 'vim-scripts/greplace.vim' 40 | Bundle 'vim-scripts/kwbdi.vim' 41 | Bundle 'vim-scripts/matchit.zip' 42 | Bundle 'jistr/vim-nerdtree-tabs' 43 | Bundle 'groenewege/vim-less' 44 | -------------------------------------------------------------------------------- /vimrc.bundles.local: -------------------------------------------------------------------------------- 1 | Bundle 'derekwyatt/vim-scala' 2 | --------------------------------------------------------------------------------