-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
130 lines (96 loc) · 2.86 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
"Suppress persistent highlighting of searched terms"
set nohlsearch
set nocompatible
set backspace=indent,eol,start
set ruler
set notitle
let mapleader = ","
set tabstop=2 shiftwidth=2 expandtab
set autowriteall
"F6 to user awsfind on the word under the cursor
nnoremap <silent> <F6> :!awsfind <cword><CR>
"incrementally search file"
set incsearch
"put filename in title bar"
set title
"allow backspacing over everything in INSERT mode
set bs=2
"search for files like bash"
set wildmode=list:longest
" autosave if I switch to another buffer
set autowriteall
"move swp files into .vim-tmp/"
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
" edit and update vimrc from ANYWHERE
map <leader>rc :e ~/.vim/.vimrc<CR><C-W>
map <leader>rs :so %
" take me to the command line.
map <leader>c :!<CR>
" stop the process
map <leader>z z
" grep recursively, ignoring case
map <leader>g :! grep -ir
"svn commands
map <leader>up :! svn up<CR>
map <leader>ci :! export VISUAL=vi && svn ci<CR>
map <leader>st :! svn st<CR>
" FuzzyFinder and switchback commands
map <leader>e :e#<CR>
map <leader>b :FuzzyFinderBuffer<CR>
map <leader>f :FuzzyFinderFile<CR>
map <leader>s :%s/
map <leader>t :! rake test<CR>
map <leader>ta :! rake testall<CR>
map <leader>tf :! rake test:functionals<CR>
map <leader>tu :! rake test:units<CR>
map <leader>ub :! rake uadmin_boot<CR>
" Split screen vertically and move between screens.
map <leader>v :vsp<CR>
map <leader>h h
map <leader>< h
map <leader>l l
map <leader>> l
map <leader>= =
" Move between horizontally split screens.
map <leader>j j
map <leader>k k
" set shortcut for TlistToggle
map <leader>tt :TlistToggle<CR>
" set question mark to be part of a VIM word. in Ruby it is!
set isk=@,48-57,_,?,!,192-255
map <leader>n :tnext
map <leader>back t
" tags shortcuts
map fd
map ps
map ut :Runittest<CR>
map ft :Rfunctionaltest<CR>
map md :Rmodel<CR>
map cd :Rcontroller<CR>
map uts :vsp<CR>l:Runittest<CR>
map fts :vsp<CR>l:Rfuntionaltest<CR>
" Switch syntax highlighting on, when the terminal has colors
if &t_Co > 2 || has("gui_running")
syntax on
endif
if &term=="xterm"
set t_Co=8
set t_Sb=^[[4%dm
set t_Sf=^[[3%dm
endif
" Run Ruby unit tests with gT (for all) or gt (only test under
" cursor) in command mode
augroup RubyTests
au!
autocmd BufRead,BufNewFile *_test.rb,test_*.rb
\ :nmap gt V:<C-U>!$HOME/.vim/bin/ruby-run-focused-unit-test
\ % <C-R>=line("'<")<CR>p <CR>|
\ :nmap gT :<C-U>!ruby %<CR>
augroup END
let Tlist_Ctags_Cmd='/usr/bin/ctags'
noremap <buffer> tp ?^sub.*:.*Test<cr>w"zye:!TEST_METHOD='<c-r>z' prove -v %<cr>
autocmd FileType make setlocal noexpandtab
autocmd FileType html setlocal shiftwidth=2 tabstop=2
autocmd FileType ruby setlocal shiftwidth=2 tabstop=2 expandtab
autocmd FileType c setlocal shiftwidth=8 tabstop=8 noexpandtab cindent