-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc.before
53 lines (42 loc) · 1.41 KB
/
vimrc.before
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
let mapleader = ","
set cc=120
set backupdir=../.ignore/vim/bkup
set directory=../.ignore/vim/swp
" Remap esc key
inoremap <Leader><Leader> <Esc>
" Turn off search hilighting with leader-s
noremap <Leader>s :nohlsearch<CR>
" Relative line number toggle
noremap <Leader>r :set rnu!<cr>:set rnu?<cr>
noremap <Leader>nu :set nu!<cr>:set nu?<cr>
" CntrlP customizations
let g:ctrlp_map = '<Leader><Space>'
" Buffergator customizations
let g:buffergator_viewport_split_policy = "B"
"let g:ctrlp_arg_map = "1"
"Indent file
noremap <Leader>if ggVG=
"Format file
noremap <Leader>ff ggVGgq
"Close buffer
noremap <Leader>q :bw<CR>
"Close all buffers and exit
noremap <Leader>qq :qa<CR>
noremap <Leader>p :set paste<CR>
"Rspec runners
noremap <Leader>ra :w!<space>\|<space>!bundle exec rspec %<CR>
noremap <Leader>rs :w!<space>\|<space>!bundle exec rspec % --tag ~wip<CR>
noremap <Leader>rw :w!<space>\|<space>!bundle exec rspec % --tag wip<CR>
noremap <Leader>w :w<CR>
noremap <Leader>wa :wa<CR>
noremap <Leader>pp :w!<space>\|<space>!cat % \| pbcopy<CR><CR>
noremap <Leader>rcb :e ~/dotfiles/vimrc.before<CR>
noremap <Leader>rca :e ~/dotfiles/vimrc.after<CR>
noremap <Leader>rc :source ~/.vimrc<CR>
"Simplecov
noremap <Leader>sc :!open coverage/index.html<CR>
"XML
vmap ,x :!tidy -q -i -xml<CR>
" Run tests TODO: move this to a local overrride
noremap <Leader>gt :w!<space>\|<space>!runTests.sh %<CR>
:nnoremap <Leader>sr :%s/\<<C-r><C-w>\>/