-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
137 lines (111 loc) · 3.11 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
syntax on
filetype plugin indent on
set nu
set tabpagemax=500
" backups and swapfiles
set nobackup
set noswapfile
" 2 spaces for tabs.
set autoindent
set smartindent
set softtabstop=2
set shiftwidth=2
set tabstop=4
set expandtab
set nosmarttab
" sensible backspace behaviour
set backspace=2
" use ack instead of grep
set grepprg=ack
set grepformat=%f:%l:%m
" ui
set ruler
set noshowcmd
set nolazyredraw
set number
set nostartofline
set cursorline
set showmatch
set virtualedit=block
" searching
set hlsearch
set incsearch
nmap <silent> <Leader>rcrr :call RunRubyCurrentFileConque()<CR>
nmap <silent> <Leader>rcss :call RunRspecCurrentFileConque()<CR>
nmap <silent> <Leader>rcll :call RunRspecCurrentLineConque()<CR>
nmap <silent> <Leader>rccc :call RunCucumberCurrentFileConque()<CR>
nmap <silent> <Leader>rccl :call RunCucumberCurrentLineConque()<CR>
nmap <silent> <Leader>rcRR :call RunRakeConque()<CR>
nmap <silent> <Leader>rcrl :call RunLastConqueCommand()<CR>
nmap <silent> <Leader>ct :ConqueTerm bash<CR>
nnoremap <silent> <C-s> :call RelatedSpecVOpen()<CR>
nnoremap <silent> ,<C-s> :call RelatedSpecOpen()<CR>
" Cmd-Shift-R for RSpec
nmap <silent> <D-R> :call RunRspecCurrentFileConque()<CR>
" Cmd-Shift-L for RSpec Current Line
nmap <silent> <D-L> :call RunRspecCurrentLineConque()<CR>
" ,Cmd-R for Last conque command
nmap <silent> ,<D-R> :call RunLastConqueCommand()<CR>
" fugitive settings
set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
set laststatus=2
set guifont=Menlo:h20
nmap <leader>gs :Gstatus<cr>
nmap <leader>gb :Gblame<cr>
nmap <leader>gd :Gdiff<cr>
nmap <leader>git :Git<cr>
nmap <leader>gpush :Git push<cr>
nmap <leader>gfpush :Git push -f<cr>
" Vimrc and command stuff
nnoremap <silent> <Leader>ev :e ~/.vim/vimrc<CR>
nnoremap <silent> <Leader>sv :so ~/.vimrc<CR>
nnoremap <silent> <Leader>uc :e ~/.vim/useful_commands.markdown<CR>
nnoremap <silent> <Leader>cavs :e ~/.vim/fc_caveats.markdown<CR>
ab pry binding.pry
:inoremap jk <esc>
:inoremap <esc> <nop>
" Whitespace
autocmd BufWritePre * :%s/\s\+$//e
" Rspec folding
function! s:FoldItBlock()
let start = search('^\s*\(it\|specify\|scenario\|before\).*do\s*$', 'We')
let end = search('end', 'We')
let cmd = (start+1).','.(end).'fold'
if (start > 0) && (start < end)
execute cmd
return 1
else
return 0
endif
endfunction
function! FoldAllItBlocks()
let position = line('.')
exe cursor(1,1)
let result = 1
while result == 1
let result = s:FoldItBlock()
endwhile
call cursor(position, 1)
endfunction
nmap f1 :call FoldAllItBlocks()<CR>
nmap f0 :execute "normal zE"<CR>
set rtp+=/.vim/bundle/vundle/
call vundle#rc()
Bundle 'tpope/vim-fugitive'
Bundle 'tpope/vim-rails'
Bundle 'tpope/vim-cucumber'
Bundle 'tpope/vim-haml'
Bundle 'tpope/vim-commentary'
Bundle 'tpope/vim-rake'
Bundle 'tpope/vim-endwise'
Bundle 'kien/ctrlp.vim'
Bundle 'kchmck/vim-coffee-script'
Bundle 'scrooloose/nerdtree'
"Bundle 'msanders/snipmate.vim'
Bundle 'gregsexton/gitv'
" Window management
Bundle 'stevemartin/vim-ruby-conque'
Bundle 'benmills/vimux'
" Autocompletion
Bundle 'ervandew/supertab'
set runtimepath^=~/.vim/bundle/ctrlp.vim