Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 7 commits
  • 7 files changed
  • 0 comments
  • 1 contributor
3  .gitmodules
@@ -70,3 +70,6 @@
70 70 [submodule "vim/bundle/colors-tomorrow"]
71 71 path = vim/bundle/colors-tomorrow
72 72 url = https://github.com/chriskempson/Vim-Tomorrow-Theme
  73 +[submodule "vim/bundle/colors-hemisu"]
  74 + path = vim/bundle/colors-hemisu
  75 + url = https://github.com/noahfrederick/Hemisu.git
3  git/Rakefile
@@ -2,6 +2,7 @@ require File.join(File.dirname(__FILE__), '../dotfile_installer.rb')
2 2
3 3 install_dotfiles(
4 4 "gitexcludes" => "~/.gitexcludes",
5   - "gitconfig.erb" => "~/.gitconfig"
  5 + "gitconfig.erb" => "~/.gitconfig",
  6 + "githelpers" => "~/.githelpers"
6 7 )
7 8
24 git/gitconfig.erb
@@ -5,14 +5,28 @@
5 5 user = <%= print("Github User: "); STDOUT.flush; STDIN.gets.chomp %>
6 6 token = <%= print("GitHub API Token: "); STDOUT.flush; STDIN.gets.chomp %>
7 7 [alias]
8   - cp = cherry-pick
9   - co = checkout
  8 + st = status
10 9 ci = commit
  10 + co = checkout
11 11 di = diff
12   - st = status
13   - br = branch
14   - mg = merge
  12 + dc = diff --cached
  13 + amend = commit --amend
  14 + aa = add --all
  15 + head = !git l -1
  16 + h = !git head
  17 + hp = "!source ~/.githelpers && show_git_head"
  18 + r = !git l -30
  19 + ra = !git r --all
  20 + ff = merge --ff-only
  21 + pullff = pull --ff-only
  22 + noff = merge --no-ff
15 23 mt = mergetool
  24 + l = "!source ~/.githelpers && pretty_git_log"
  25 + la = !git l --all
  26 + b = branch
  27 + ds = diff --stat=160,120
  28 + dh1 = diff HEAD~1
  29 + aliases = "!source ~/.githelpers && show_git_aliases"
16 30 [apply]
17 31 whitespace = nowarn
18 32 [core]
46 git/githelpers
... ... @@ -0,0 +1,46 @@
  1 +#!/bin/bash
  2 +
  3 +# Log output:
  4 +#
  5 +# * 51c333e (12 days) <Gary Bernhardt> add vim-eunuch
  6 +#
  7 +# The time massaging regexes start with ^[^<]* because that ensures that they
  8 +# only operate before the first "<". That "<" will be the beginning of the
  9 +# author name, ensuring that we don't destroy anything in the commit message
  10 +# that looks like time.
  11 +#
  12 +# The log format uses } characters between each field, and `column` is later
  13 +# used to split on them. A } in the commit subject or any other field will
  14 +# break this.
  15 +
  16 +HASH="%C(yellow)%h%Creset"
  17 +RELATIVE_TIME="%Cgreen(%ar)%Creset"
  18 +AUTHOR="%C(bold blue)<%an>%Creset"
  19 +REFS="%C(red)%d%Creset"
  20 +SUBJECT="%s"
  21 +
  22 +FORMAT="$HASH}$RELATIVE_TIME}$AUTHOR}$REFS $SUBJECT"
  23 +
  24 +show_git_head() {
  25 + pretty_git_log -1
  26 + git show -p --pretty="tformat:"
  27 +}
  28 +
  29 +pretty_git_log() {
  30 + git log --graph --abbrev-commit --date=relative --pretty="tformat:${FORMAT}" $* |
  31 + # Repalce (2 years ago) with (2 years)
  32 + sed -Ee 's/(^[^<]*) ago)/\1)/' |
  33 + # Replace (2 years, 5 months) with (2 years)
  34 + sed -Ee 's/(^[^<]*), [[:digit:]]+ .*months?)/\1)/' |
  35 + # Line columns up based on } delimiter
  36 + column -s '}' -t |
  37 + # Page only if we need to
  38 + less -FXRS
  39 +}
  40 +
  41 +show_git_aliases() {
  42 + git config --get-regexp 'alias.*' |
  43 + sort |
  44 + sed -E -e 's/^alias.([^ ]+) /\1>/' -e '/aliases/ d' |
  45 + column -t -s '>'
  46 +}
1  vim/bundle/colors-hemisu
... ... @@ -0,0 +1 @@
  1 +Subproject commit 20e798df0451c36637dfc1d60edef742aa772943
302 vim/vimrc
@@ -2,50 +2,74 @@
2 2 " This must be first, because it changes other options as a side effect.
3 3 set nocompatible
4 4
  5 +" Load pathogen plugins
  6 +call pathogen#infect()
  7 +call pathogen#helptags()
  8 +
  9 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  10 +" BASIC EDITING CONFIGURATION
  11 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  12 +
  13 +" , is the leader character (Default \)
  14 +let mapleader = ","
  15 +
5 16 " allow backspacing over everything in insert mode
6 17 set backspace=indent,eol,start
7 18
8 19 " use the system clipboard for copy/paste
9 20 set clipboard+=unnamed
10 21
11   -set nobackup
12   -set nowritebackup
13   -set history=50 " keep 50 lines of command line history
14   -set ruler " show the cursor position all the time
15   -set showcmd " display incomplete commands
16   -set incsearch " do incremental searching
  22 +" Store temporary files in a central spot
  23 +set backup
  24 +set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
  25 +set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
  26 +
  27 +set hidden " allow unsaved background buffers and remember marks/undo for them
  28 +set history=1000 " keep 50 lines of command line history
17 29
18   -" Switch wrap off for everything
19   -set nowrap
  30 +set showtabline=2 " always show tabline
  31 +set laststatus=2 " Always display the status line
  32 +set ruler " show the cursor position all the time
  33 +set showcmd " display selected command movements in status line
  34 +set cursorline " highlight current line
20 35
21   -" Softtabs, 2 spaces
22   -set tabstop=2
23   -set shiftwidth=2
24   -set expandtab
  36 +" Show line numbers
  37 +set number numberwidth=5
25 38
26   -" Always display the status line
27   -set laststatus=2
  39 +set winwidth=79 " Minimum width for current window
  40 +set scrolloff=3 " Show minimum lines around current line when scrolling
  41 +set sidescrolloff=8 " Show minimum chars to right of cursor when scrolling
28 42
29   -" Numbers
30   -set number
31   -set numberwidth=5
  43 +set incsearch " do incremental searching
  44 +set hlsearch " highlight last search results
  45 +
  46 +" case only matters with mixed case expressions
  47 +set ignorecase smartcase
  48 +
  49 +" Soft tabs, 2 spaces
  50 +set tabstop=2 shiftwidth=2
  51 +set expandtab " Expand tabs to spaces
  52 +set autoindent " always set autoindenting on
  53 +set nowrap " Switch wrap off for everything
32 54
33 55 " Tab completion options
34 56 " (only complete to the longest unambiguous match, and show a menu)
35 57 set completeopt=longest,menu
36   -set wildmode=list:longest,list:full
  58 +set wildmode=longest,full
  59 +set wildmenu
37 60 set complete=.,t
38 61
39   -" case only matters with mixed case expressions
40   -set ignorecase
41   -set smartcase
  62 +" set foldenable
  63 +set foldmethod=syntax
  64 +set foldlevel=1
  65 +set foldnestmax=2
42 66
43   -" Load pathogen plugins
44   -call pathogen#infect()
45   -call pathogen#helptags()
  67 +" Enable file type detection.
  68 +filetype plugin indent on
46 69
47   -" \ is the leader character
48   -let mapleader = ","
  70 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  71 +" COLOR SCHEME
  72 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
49 73
50 74 let g:solarized_termcolors = 256
51 75 let g:solarized_termtrans = 1
@@ -56,70 +80,127 @@ let g:solarized_contrast = "normal"
56 80 let g:solarized_visibility = "normal"
57 81
58 82 " Switch syntax highlighting on, when the terminal has colors
59   -" Also switch on highlighting the last used search pattern.
60 83 if (&t_Co > 2 || has("gui_running")) && !exists("syntax_on")
61 84 syntax enable
62 85 set background=dark
63 86 colorscheme solarized
64   - set hlsearch
65 87 endif
66 88
67   -" Only do this part when compiled with support for autocommands.
68   -if has("autocmd")
69   - " Enable file type detection.
70   - " Use the default filetype settings, so that mail gets 'tw' set to 72,
71   - " 'cindent' is on in C files, etc.
72   - " Also load indent files, to automatically do language-dependent indenting.
73   - filetype plugin indent on
  89 +if (has("gui_running"))
  90 + set transparency=6
  91 +endif
74 92
75   - " Set File type to 'text' for files ending in .txt
76   - autocmd BufNewFile,BufRead *.txt setfiletype text
  93 +highlight Search gui=underline guifg=NONE guibg=Black guisp=Red
  94 +highlight Search cterm=underline ctermfg=NONE ctermbg=Black
  95 +highlight IncSearch gui=reverse
  96 +highlight IncSearch cterm=reverse
77 97
78   - " Enable soft-wrapping for text files
79   - autocmd FileType text,markdown,html,xhtml,eruby setlocal wrap linebreak nolist
  98 +highlight Folded gui=italic
  99 +highlight Folded cterm=italic guibg=Black
  100 +highlight FoldColumn guifg=Yellow
80 101
81   - augroup vimrcEx
82   - au!
  102 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  103 +" STATUS LINE
  104 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  105 +:set statusline=%<%f\ (%{&ft})\ %-4(%m%)%=%-19(%3l,%02c%03V%)
83 106
84   - " For all text files set 'textwidth' to 78 characters.
85   - " autocmd FileType text setlocal textwidth=78
  107 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  108 +" CUSTOM AUTOCMDS
  109 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  110 +
  111 +augroup vimrcEx
  112 + " Remove all autocommands for the current group
  113 + autocmd!
86 114
87   - " When editing a file, always jump to the last known cursor position.
88   - " Don't do it when the position is invalid or when inside an event handler
89   - " (happens when dropping a file on gvim).
  115 + " Jump to last cursor position unless it's invalid or in an event handler
90 116 autocmd BufReadPost *
91 117 \ if line("'\"") > 0 && line("'\"") <= line("$") |
92 118 \ exe "normal g`\"" |
93 119 \ endif
94 120
95   - " Automatically load .vimrc source when saved
  121 + " Set File type to 'text' for files ending in .txt
  122 + autocmd BufNewFile,BufRead *.txt
  123 + \ setfiletype text
  124 +
  125 + " For all text files set 'textwidth' to 78 characters.
  126 + autocmd FileType text
  127 + \ setlocal textwidth=78
  128 +
  129 + " Enable soft-wrapping for text files
  130 + autocmd FileType text,markdown,html,xhtml,eruby
  131 + \ setlocal wrap linebreak nolist
  132 +
  133 + " Use 4 spaces for python indentation
  134 + autocmd FileType python
  135 + \ setlocal shiftwidth=4 softtabstop=4 expandtab
  136 +
  137 + autocmd BufRead,BufNewFile *.sass
  138 + \ setfiletype sass
  139 +
  140 + autocmd BufRead *.mkd,*.markdown
  141 + \ set autoindent formatoptions=tcroqn2 comments=n:&gt;
  142 +
  143 + " Indent p tags
  144 + autocmd FileType html,eruby
  145 + \ if g:html_indent_tags !~ '\\|p\>' |
  146 + \ let g:html_indent_tags .= '\|p\|li\|dt\|dd' |
  147 + \ endif
  148 +
  149 + " Use rspec compiler for autotest on spec files
  150 + autocmd BufNewFile,BufRead *_spec.rb compiler rspec
  151 +
  152 + " Strip trailing whitespace
  153 + autocmd BufWritePre * call StripTrailingWhitespace()
  154 +
  155 + " Ignore listed file types for sensitive trailing whitespace
  156 + autocmd FileType markdown let b:noStripWhitespace=1
  157 +
  158 + " Automatically reload .vimrc source when saved
96 159 autocmd BufWritePost .vimrc source $MYVIMRC
  160 +augroup END
  161 +
  162 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  163 +" STRIP TRAILING WHITESPACE
  164 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  165 +function! StripTrailingWhitespace()
  166 + " Only strip if the b:noStripeWhitespace variable isn't set
  167 + if exists('b:noStripWhitespace')
  168 + return
  169 + endif
  170 + %s/\s\+$//e
  171 +endfunction
  172 +
  173 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  174 +" MISC KEY MAPS
  175 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
97 176
98   - augroup END
  177 +" Use Ctrl-C to escape from insert mode
  178 +imap <c-c> <esc>
99 179
100   -else
  180 +" Jump to previous buffer
  181 +nnoremap <leader><leader> <c-^>
101 182
102   - set autoindent " always set autoindenting on
  183 +" Hide search highlighting when pressing return
  184 +nnoremap <CR> :nohlsearch<CR>
103 185
104   -endif " has("autocmd")
  186 +" Toggle search highlighting
  187 +noremap <Leader>h :set invhlsearch<CR>
105 188
106   -" if has("folding")
107   - " set foldenable
108   - " set foldmethod=syntax
109   - " set foldlevel=1
110   - " set foldnestmax=2
111   - " set foldtext=strpart(getline(v:foldstart),0,50).'\ ...\ '.substitute(getline(v:foldend),'^[\ #]*','','g').'\ '
112   -" endif
  189 +" Yank to system clipboard
  190 +map <leader>y "*y
113 191
114   -" No Help, please
115   -nmap <F1> <Esc>
  192 +" Move around splits with <c-hjkl>
  193 +" nnoremap <c-j> <c-w>j
  194 +" nnoremap <c-k> <c-w>k
  195 +" nnoremap <c-h> <c-w>h
  196 +" nnoremap <c-l> <c-w>l
116 197
117   -" Hide search highlighting
118   -map <Leader>h :set invhls <CR>
  198 +" Change MakeGreen default keybinding from <Leader>t
  199 +map <Leader>mg <Plug>MakeGreen
119 200
120   -"
121   -" Editing
122   -"
  201 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  202 +" EDITING
  203 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
123 204
124 205 " Move lines up and down
125 206 map <C-K> :m -2 <CR>
@@ -129,9 +210,9 @@ map <C-J> :m +1 <CR>
129 210 " Visual mode: D
130 211 vmap D y'>p
131 212
132   -"
133   -" File Navigation
134   -"
  213 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  214 +" FILE NAVIGATION
  215 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
135 216
136 217 " Press ^F from insert mode to insert the current file name
137 218 imap <C-F> <C-R>=expand("%")<CR>
@@ -148,22 +229,64 @@ map <Leader>te :tabe <C-R>=expand("%:p:h") . "/" <CR>
148 229 " Command mode: Ctrl+P
149 230 cmap <C-P> <C-R>=expand("%:p:h") . "/" <CR>
150 231
151   -" Press Shift+P while in visual mode to replace the selection without
152   -" overwriting the default register
153   -vmap P p :call setreg('"', getreg('0')) <CR>
  232 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  233 +" MAPS TO JUMP TO SPECIFIC COMMAND-T TARGETS AND FILES
  234 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  235 +map <leader>gr :topleft :split config/routes.rb<cr>
  236 +function! ShowRoutes()
  237 + " Requires 'scratch' plugin
  238 + :topleft 100 :split __Routes__
  239 + " Make sure Vim doesn't write __Routes__ as a file
  240 + :set buftype=nofile
  241 + " Delete everything
  242 + :normal 1GdG
  243 + " Put routes output in buffer
  244 + :0r! rake -s routes
  245 + " Size window to number of lines (1 plus rake output length)
  246 + :exec ":normal " . line("$") . "_ "
  247 + " Move cursor to bottom
  248 + :normal 1GG
  249 + " Delete empty trailing line
  250 + :normal dd
  251 +endfunction
  252 +map <leader>gR :call ShowRoutes()<cr>
  253 +map <leader>gv :CommandTFlush<cr>\|:CommandT app/views<cr>
  254 +map <leader>gc :CommandTFlush<cr>\|:CommandT app/controllers<cr>
  255 +map <leader>gm :CommandTFlush<cr>\|:CommandT app/models<cr>
  256 +map <leader>gh :CommandTFlush<cr>\|:CommandT app/helpers<cr>
  257 +map <leader>gl :CommandTFlush<cr>\|:CommandT lib<cr>
  258 +map <leader>gp :CommandTFlush<cr>\|:CommandT public<cr>
  259 +map <leader>gs :CommandTFlush<cr>\|:CommandT public/stylesheets/sass<cr>
  260 +map <leader>gf :CommandTFlush<cr>\|:CommandT features<cr>
  261 +map <leader>gg :topleft 100 :split Gemfile<cr>
  262 +map <leader>gt :CommandTFlush<cr>\|:CommandTTag<cr>
  263 +map <leader>f :CommandTFlush<cr>\|:CommandT<cr>
  264 +map <leader>F :CommandTFlush<cr>\|:CommandT %%<cr>
  265 +
  266 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  267 +" OPEN FILES IN DIRECTORY OF CURRENT FILE
  268 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  269 +cnoremap %% <C-R>=expand('%:h').'/'<cr>
  270 +map <leader>e :edit %%
  271 +map <leader>v :view %%
  272 +
  273 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  274 +" RENAME CURRENT FILE
  275 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  276 +function! RenameFile()
  277 + let old_name = expand('%')
  278 + let new_name = input('New file name: ', expand('%'), 'file')
  279 + if new_name != '' && new_name != old_name
  280 + exec ':saveas ' . new_name
  281 + exec ':silent !rm ' . old_name
  282 + redraw!
  283 + endif
  284 +endfunction
  285 +map <leader>n :call RenameFile()<cr>
154 286
155   -" Hashrocket
156   -imap <C-L> <Space>=><Space>
157   -
158   -" Local config
159   -if filereadable(".vimrc.local")
160   - source .vimrc.local
161   -endif
162   -
163   -" Use Ack instead of Grep when available
164   -if executable("ack")
165   - set grepprg=ack\ -H\ --nogroup\ --nocolor\ --ignore-dir=tmp\ --ignore-dir=coverage
166   -endif
  287 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  288 +" COMMANDS
  289 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
167 290
168 291 " Open URL
169 292 command! -bar -nargs=1 OpenURL :!open <args>
@@ -178,3 +301,16 @@ function! OpenURL()
178 301 endfunction
179 302 map <Leader>w :call OpenURL()<CR>
180 303
  304 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  305 +" LOCAL CONFIG
  306 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  307 +
  308 +" Use Ack instead of Grep when available
  309 +if executable("ack")
  310 + set grepprg=ack\ -H\ --nogroup\ --nocolor\ --ignore-dir=tmp\ --ignore-dir=coverage
  311 +endif
  312 +
  313 +if filereadable(".vimrc.local")
  314 + source .vimrc.local
  315 +endif
  316 +
2  zsh
... ... @@ -1 +1 @@
1   -Subproject commit f79b3a683a45b80caee911f1b932177ed85eaa95
  1 +Subproject commit 2a2ed7a9692f7528666aa437316279cc7b39c610

No commit comments for this range

Something went wrong with that request. Please try again.